[CodeFactor] Apply fixes to commit bca98c3

[ci skip] [skip ci]
This commit is contained in:
codefactor-io 2020-05-05 13:19:34 +00:00
parent bca98c3a1a
commit 0c562742f7
12 changed files with 60 additions and 57 deletions

View file

@ -4302,8 +4302,9 @@ class MainWP_Child {
} }
$maxPages = 50; $maxPages = 50;
if ( defined( 'MAINWP_CHILD_NR_OF_PAGES' ) ) if ( defined( 'MAINWP_CHILD_NR_OF_PAGES' ) ) {
$maxPages = MAINWP_CHILD_NR_OF_PAGES; $maxPages = MAINWP_CHILD_NR_OF_PAGES;
}
if ( isset( $_POST['maxRecords'] ) ) { if ( isset( $_POST['maxRecords'] ) ) {
$maxPages = $_POST['maxRecords']; $maxPages = $_POST['maxRecords'];
@ -4353,8 +4354,9 @@ class MainWP_Child {
} }
$maxComments = 50; $maxComments = 50;
if ( defined( 'MAINWP_CHILD_NR_OF_COMMENTS' ) ) if ( defined( 'MAINWP_CHILD_NR_OF_COMMENTS' ) ) {
$maxComments = MAINWP_CHILD_NR_OF_COMMENTS; // to compatible. $maxComments = MAINWP_CHILD_NR_OF_COMMENTS; // to compatible.
}
if ( isset( $_POST['maxRecords'] ) ) { if ( isset( $_POST['maxRecords'] ) ) {
$maxComments = $_POST['maxRecords']; $maxComments = $_POST['maxRecords'];

View file

@ -90,9 +90,9 @@ class MainWP_Clone {
} }
public function init() { public function init() {
add_action( 'check_admin_referer', array( MainWP_Clone::get_class_name(), 'permalinkChanged' ) ); add_action( 'check_admin_referer', array( self::get_class_name(), 'permalinkChanged' ) );
if ( get_option( 'mainwp_child_clone_permalink' ) || get_option( 'mainwp_child_restore_permalink' ) ) { if ( get_option( 'mainwp_child_clone_permalink' ) || get_option( 'mainwp_child_restore_permalink' ) ) {
add_action( 'admin_notices', array( MainWP_Clone::get_class_name(), 'permalinkAdminNotice' ) ); add_action( 'admin_notices', array( self::get_class_name(), 'permalinkAdminNotice' ) );
} }
} }
@ -130,7 +130,7 @@ class MainWP_Clone {
} }
$uploadedfile = $_FILES['file']; $uploadedfile = $_FILES['file'];
$upload_overrides = array( 'test_form' => false ); $upload_overrides = array( 'test_form' => false );
add_filter( 'upload_mimes', array( MainWP_Clone::get_class_name(), 'upload_mimes' ) ); add_filter( 'upload_mimes', array( self::get_class_name(), 'upload_mimes' ) );
$movefile = wp_handle_upload( $uploadedfile, $upload_overrides ); $movefile = wp_handle_upload( $uploadedfile, $upload_overrides );
if ( $movefile ) { if ( $movefile ) {
$uploadFile = str_replace( ABSPATH, '', $movefile['file'] ); $uploadFile = str_replace( ABSPATH, '', $movefile['file'] );

View file

@ -1322,11 +1322,11 @@ class MainWP_Helper {
break; break;
} }
if ( ! $activated ) if ( ! $activated ) {
return 0; return 0;
}
return get_option( 'mainwp_lasttime_backup_' . $by, 0 ); return get_option( 'mainwp_lasttime_backup_' . $by, 0 );
} }

View file

@ -26,8 +26,9 @@ if ( ! defined( 'MAINWP_CHILD_URL' ) ) {
function mainwp_child_autoload( $class_name ) { function mainwp_child_autoload( $class_name ) {
if ( 0 !== strpos( $class_name, 'MainWP\Child' ) ) if ( 0 !== strpos( $class_name, 'MainWP\Child' ) ) {
return; return;
}
// trip the namespace prefix: MainWP\Child\ . // trip the namespace prefix: MainWP\Child\ .
$class_name = substr( $class_name, 13 ); $class_name = substr( $class_name, 13 );