| @@ -7,13 +7,11 @@ | ||
| 7 | 7 | * Author: MainWP |
| 8 | 8 | * Author URI: https://mainwp.com |
| 9 | 9 | * Plugin URI: https://mainwp.com/ |
| 10 | 10 | * Text Domain: mainwp |
| 11 | - * Version: 5.0.2 | |
| 11 | + * Version: 4.1 | |
| 12 | 12 | * |
| 13 | 13 | * @package MainWP/Dashboard |
| 14 | - * | |
| 15 | - * @uses \MainWP\Dashboard\MainWP_System | |
| 16 | 14 | */ |
| 17 | 15 | |
| 18 | 16 | if ( ! defined( 'MAINWP_PLUGIN_FILE' ) ) { |
| 19 | 17 | |
| @@ -45,34 +43,8 @@ | ||
| 45 | 43 | */ |
| 46 | 44 | define( 'MAINWP_PLUGIN_URL', plugin_dir_url( MAINWP_PLUGIN_FILE ) ); |
| 47 | 45 | } |
| 48 | 46 | |
| 49 | - | |
| 50 | -if ( ! defined( 'MAINWP_MODULES_DIR' ) ) { | |
| 51 | - define( 'MAINWP_MODULES_DIR', MAINWP_PLUGIN_DIR . 'modules' . DIRECTORY_SEPARATOR ); | |
| 52 | -} | |
| 53 | - | |
| 54 | -if ( ! defined( 'MAINWP_MODULES_URL' ) ) { | |
| 55 | - define( 'MAINWP_MODULES_URL', MAINWP_PLUGIN_URL . 'modules/' ); | |
| 56 | -} | |
| 57 | - | |
| 58 | - | |
| 59 | -/** | |
| 60 | - * Define enable Log Module. | |
| 61 | - */ | |
| 62 | -if ( ! defined( 'MAINWP_MODULE_LOG_ENABLED' ) ) { | |
| 63 | - define( 'MAINWP_MODULE_LOG_ENABLED', true ); | |
| 64 | -} | |
| 65 | - | |
| 66 | -if ( ! defined( 'MAINWP_MODULE_COST_TRACKER_ENABLED' ) ) { | |
| 67 | - define( 'MAINWP_MODULE_COST_TRACKER_ENABLED', true ); | |
| 68 | -} | |
| 69 | - | |
| 70 | -if ( ! defined( 'MAINWP_MODULE_API_BACKUPS_ENABLED' ) ) { | |
| 71 | - define( 'MAINWP_MODULE_API_BACKUPS_ENABLED', true ); | |
| 72 | -} | |
| 73 | - | |
| 74 | - | |
| 75 | 47 | // Version information from WordPress. |
| 76 | 48 | require_once ABSPATH . 'wp-includes' . DIRECTORY_SEPARATOR . 'version.php'; |
| 77 | 49 | |
| 78 | 50 | if ( ! function_exists( 'mainwp_autoload' ) ) { |
| @@ -100,9 +72,9 @@ | ||
| 100 | 72 | 'widgets' => 'widget', |
| 101 | 73 | ); |
| 102 | 74 | |
| 103 | 75 | foreach ( $autoload_types as $type => $prefix ) { |
| 104 | - $autoload_dir = \trailingslashit( __DIR__ . DIRECTORY_SEPARATOR . $type ); | |
| 76 | + $autoload_dir = \trailingslashit( dirname( __FILE__ ) . DIRECTORY_SEPARATOR . $type ); | |
| 105 | 77 | $autoload_path = sprintf( '%s%s-%s.php', $autoload_dir, $prefix, strtolower( str_replace( '_', '-', $class_name ) ) ); |
| 106 | 78 | |
| 107 | 79 | if ( file_exists( $autoload_path ) ) { |
| 108 | 80 | require_once $autoload_path; |
| @@ -115,13 +87,12 @@ | ||
| 115 | 87 | spl_autoload_register( 'mainwp_autoload' ); |
| 116 | 88 | |
| 117 | 89 | require_once MAINWP_PLUGIN_DIR . 'includes' . DIRECTORY_SEPARATOR . 'functions.php'; |
| 118 | 90 | require_once MAINWP_PLUGIN_DIR . 'includes' . DIRECTORY_SEPARATOR . 'compatible.php'; |
| 119 | -require_once MAINWP_PLUGIN_DIR . 'includes' . DIRECTORY_SEPARATOR . 'class-mainwp-includes.php'; | |
| 120 | 91 | |
| 121 | 92 | // Detect if secupress_scanner is running. |
| 122 | 93 | $mainwp_is_secupress_scanning = false; |
| 123 | -if ( ! empty( $_GET ) && isset( $_GET['test'] ) && isset( $_GET['action'] ) && 'secupress_scanner' === $_GET['action'] ) { // phpcs:ignore WordPress.Security.NonceVerification,WordPress.Security.ValidatedSanitizedInput.InputNotSanitized.Recommended | |
| 94 | +if ( ! empty( $_GET ) && isset( $_GET['test'] ) && isset( $_GET['action'] ) && 'secupress_scanner' === $_GET['action'] ) { | |
| 124 | 95 | $mainwp_is_secupress_scanning = true; |
| 125 | 96 | } |
| 126 | 97 | |
| 127 | 98 | // Fix a conflict with SecuPress plugin. |
| @@ -128,6 +99,6 @@ | ||
| 128 | 99 | if ( ! $mainwp_is_secupress_scanning ) { |
| 129 | 100 | $mainWP = new MainWP\Dashboard\MainWP_System( WP_PLUGIN_DIR . DIRECTORY_SEPARATOR . plugin_basename( __FILE__ ) ); |
| 130 | 101 | register_activation_hook( __FILE__, array( $mainWP, 'activation' ) ); |
| 131 | 102 | register_deactivation_hook( __FILE__, array( $mainWP, 'deactivation' ) ); |
| 132 | - add_action( 'plugins_loaded', array( $mainWP, 'update_install' ) ); | |
| 103 | + add_action( 'plugins_loaded', array( $mainWP, 'update' ) ); | |
| 133 | 104 | } |