mirror of
https://github.com/mainwp/mainwp-child.git
synced 2025-09-01 03:58:07 +08:00
Merge pull request #135 from mainwp/bogdan01-cf-autofix
Apply fixes from CodeFactor
This commit is contained in:
commit
d1ee11a4fe
4 changed files with 9 additions and 10 deletions
|
@ -306,7 +306,7 @@ class MainWP_Backup {
|
|||
}
|
||||
closedir( $fh );
|
||||
// phpcs:enable
|
||||
|
||||
|
||||
if ( defined( 'MAINWP_DEBUG' ) && MAINWP_DEBUG ) {
|
||||
$string = wp_json_encode(
|
||||
array(
|
||||
|
@ -317,7 +317,7 @@ class MainWP_Backup {
|
|||
'lang' => defined( 'WPLANG' ) ? WPLANG : '',
|
||||
'plugins' => $plugins,
|
||||
'themes' => $themes,
|
||||
)
|
||||
)
|
||||
);
|
||||
} else {
|
||||
$string = base64_encode( // phpcs:ignore WordPress.PHP.DiscouragedPHPFunctions -- safe.
|
||||
|
@ -446,7 +446,7 @@ class MainWP_Backup {
|
|||
$this->zip->create( $backupFolder, PCLZIP_OPT_REMOVE_PATH, $backupFolder );
|
||||
if ( $addConfig ) {
|
||||
global $wpdb;
|
||||
|
||||
|
||||
if ( defined( 'MAINWP_DEBUG' ) && MAINWP_DEBUG ) {
|
||||
$string = wp_json_encode(
|
||||
array(
|
||||
|
@ -455,7 +455,7 @@ class MainWP_Backup {
|
|||
'abspath' => ABSPATH,
|
||||
'prefix' => $wpdb->prefix,
|
||||
'lang' => WPLANG,
|
||||
)
|
||||
)
|
||||
);
|
||||
} else {
|
||||
$string = base64_encode( // phpcs:ignore WordPress.PHP.DiscouragedPHPFunctions -- safe.
|
||||
|
@ -470,7 +470,7 @@ class MainWP_Backup {
|
|||
)
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
$this->add_file_from_string_to_pcl_zip( 'clone/config.txt', $string, $filepath );
|
||||
}
|
||||
// Remove backup folder.
|
||||
|
|
|
@ -523,7 +523,7 @@ class MainWP_Child_Timecapsule {
|
|||
$current_limit = WPTC_Factory::get( 'config' )->get_option( 'activity_log_lazy_load_limit' );
|
||||
$to_limit = $from_limit + $current_limit;
|
||||
|
||||
$sub_records = $wpdb->get_results( $wpdb->prepare( 'SELECT * FROM ' . $wpdb->base_prefix . "wptc_activity_log WHERE action_id = %s AND show_user = 1 ORDER BY id DESC LIMIT %d, %d", $action_id, $from_limit, $current_limit ) );
|
||||
$sub_records = $wpdb->get_results( $wpdb->prepare( 'SELECT * FROM ' . $wpdb->base_prefix . 'wptc_activity_log WHERE action_id = %s AND show_user = 1 ORDER BY id DESC LIMIT %d, %d', $action_id, $from_limit, $current_limit ) );
|
||||
|
||||
$row_count = count( $sub_records );
|
||||
|
||||
|
@ -560,7 +560,7 @@ class MainWP_Child_Timecapsule {
|
|||
$more_logs = false;
|
||||
$load_more = false;
|
||||
if ( '' != $rec->action_id ) {
|
||||
$sub_records = $wpdb->get_results( $wpdb->prepare( 'SELECT * FROM ' . $wpdb->base_prefix . "wptc_activity_log WHERE action_id= %s AND show_user = 1 ORDER BY id DESC LIMIT 0, %d", $rec->action_id, $limit ) );
|
||||
$sub_records = $wpdb->get_results( $wpdb->prepare( 'SELECT * FROM ' . $wpdb->base_prefix . 'wptc_activity_log WHERE action_id= %s AND show_user = 1 ORDER BY id DESC LIMIT 0, %d', $rec->action_id, $limit ) );
|
||||
$row_count = count( $sub_records );
|
||||
if ( $row_count == $limit ) {
|
||||
$load_more = true;
|
||||
|
|
|
@ -72,7 +72,7 @@ class MainWP_Child_WooCommerce_Status {
|
|||
|
||||
// Get sales.
|
||||
$sales = $wpdb->get_var(
|
||||
$wpdb->prepare(
|
||||
$wpdb->prepare(
|
||||
"SELECT SUM( postmeta.meta_value ) FROM {$wpdb->posts} as posts
|
||||
LEFT JOIN {$wpdb->term_relationships} AS rel ON posts.ID=rel.object_ID
|
||||
LEFT JOIN {$wpdb->term_taxonomy} AS tax USING( term_taxonomy_id )
|
||||
|
|
|
@ -247,7 +247,7 @@ class Tar_Archiver {
|
|||
'lang' => get_bloginfo( 'language' ),
|
||||
'plugins' => $plugins,
|
||||
'themes' => $themes,
|
||||
)
|
||||
)
|
||||
);
|
||||
} else {
|
||||
$string = base64_encode( // phpcs:ignore WordPress.PHP.DiscouragedPHPFunctions -- base64_encode function is used for begin reasons.
|
||||
|
@ -264,7 +264,6 @@ class Tar_Archiver {
|
|||
)
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
$this->add_empty_directory( 'clone', 0, 0, 0, time() );
|
||||
$this->add_file_from_string( 'clone/config.txt', $string );
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue