Fixed: CodeFactor issues

This commit is contained in:
Bogdan Rapaić 2020-04-08 20:02:31 +02:00 committed by GitHub
parent c0579d6a0e
commit 7b75928e1d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -291,10 +291,11 @@ class MainWP_Child_Timecapsule {
} }
global $wpdb; global $wpdb;
$all_backups = $wpdb->get_results( $all_backups = $wpdb->get_results(
$wpdb->prepare( " $wpdb->prepare(
SELECT backupID "SELECT backupID
FROM {$wpdb->base_prefix}wptc_processed_files FROM {$wpdb->base_prefix}wptc_processed_files
WHERE backupID > %s ", $last_time WHERE backupID > %s ",
$last_time
) )
); );
@ -438,7 +439,7 @@ class MainWP_Child_Timecapsule {
public function get_logs_rows() { public function get_logs_rows() {
$result = $this->prepare_items(); $result = $this->prepare_items();
$result['display_rows'] = base64_encode( serialize( $this->get_display_rows( $result['items'] ) ) ); $result['display_rows'] = base64_encode( serialize( $this->get_display_rows( $result['items'] ) ) ); // phpcs:ignore WordPress.PHP.DiscouragedPHPFunctions -- base64_encode function is used for benign reasons.
return $result; return $result;
} }
@ -791,8 +792,8 @@ class MainWP_Child_Timecapsule {
$config = WPTC_Base_Factory::get( 'Wptc_InitialSetup_Config' ); $config = WPTC_Base_Factory::get( 'Wptc_InitialSetup_Config' );
$options = WPTC_Factory::get( 'config' ); $options = WPTC_Factory::get( 'config' );
$config->set_option( 'wptc_main_acc_email_temp', base64_encode( $email ) ); $config->set_option( 'wptc_main_acc_email_temp', base64_encode( $email ) ); // phpcs:ignore WordPress.PHP.DiscouragedPHPFunctions -- base64_encode function is used for benign reasons.
$config->set_option( 'wptc_main_acc_pwd_temp', base64_encode( md5( trim( wp_unslash( $pwd ) ) ) ) ); $config->set_option( 'wptc_main_acc_pwd_temp', base64_encode( md5( trim( wp_unslash( $pwd ) ) ) ) ); // phpcs:ignore WordPress.PHP.DiscouragedPHPFunctions -- base64_encode function is used for benign reasons.
$config->set_option( 'wptc_token', false ); $config->set_option( 'wptc_token', false );
$options->request_service( $options->request_service(
@ -856,10 +857,12 @@ class MainWP_Child_Timecapsule {
$staging = WPTC_Pro_Factory::get( 'Wptc_Staging' ); $staging = WPTC_Pro_Factory::get( 'Wptc_Staging' );
if ( empty( $_POST['path'] ) ) { if ( empty( $_POST['path'] ) ) {
wptc_die_with_json_encode( array( wptc_die_with_json_encode(
array(
'status' => 'error', 'status' => 'error',
'msg' => 'path is missing', 'msg' => 'path is missing',
) ); )
);
} }
$staging->choose_action( $_POST['path'], $reqeust_type = 'fresh' ); $staging->choose_action( $_POST['path'], $reqeust_type = 'fresh' );
@ -939,7 +942,7 @@ class MainWP_Child_Timecapsule {
); );
} }
$data = unserialize( base64_decode( $_POST['data'] ) ); $data = unserialize( base64_decode( $_POST['data'] ) ); // phpcs:ignore WordPress.PHP.DiscouragedPHPFunctions -- base64_encode function is used for benign reasons.
$tabName = $_POST['tabname']; $tabName = $_POST['tabname'];
$is_general = $_POST['is_general']; $is_general = $_POST['is_general'];