mirror of
https://github.com/mainwp/mainwp-child.git
synced 2025-08-30 02:32:07 +08:00
Refactoring
This commit is contained in:
parent
cef274c15b
commit
cb858c1882
7 changed files with 56 additions and 52 deletions
|
@ -162,12 +162,12 @@ class MainWP_Backup {
|
|||
$backupdir = $dirs[0];
|
||||
if ( ! defined( 'PCLZIP_TEMPORARY_DIR' ) ) {
|
||||
|
||||
/**
|
||||
* Defines PCLZIP temporary directory.
|
||||
*
|
||||
* @const ( string ) Temporary backup directory.
|
||||
* @source https://code-reference.mainwp.com/classes/MainWP.Child.MainWP_Backup.html
|
||||
*/
|
||||
/**
|
||||
* Defines PCLZIP temporary directory.
|
||||
*
|
||||
* @const ( string ) Temporary backup directory.
|
||||
* @source https://code-reference.mainwp.com/classes/MainWP.Child.MainWP_Backup.html
|
||||
*/
|
||||
define( 'PCLZIP_TEMPORARY_DIR', $backupdir );
|
||||
}
|
||||
|
||||
|
|
|
@ -318,12 +318,12 @@ class MainWP_Child_Plugins_Check {
|
|||
|
||||
if ( ! defined( 'DAY_IN_SECONDS' ) ) {
|
||||
|
||||
/**
|
||||
* Defines days in seconds.
|
||||
*
|
||||
* @const ( string ) Default: true.
|
||||
* @source https://code-reference.mainwp.com/classes/MainWP.Child.MainWP_Child_Plugins_Check.html
|
||||
*/
|
||||
/**
|
||||
* Defines days in seconds.
|
||||
*
|
||||
* @const ( string ) Default: true.
|
||||
* @source https://code-reference.mainwp.com/classes/MainWP.Child.MainWP_Child_Plugins_Check.html
|
||||
*/
|
||||
define( 'DAY_IN_SECONDS', 24 * 60 * 60 );
|
||||
}
|
||||
|
||||
|
|
|
@ -288,12 +288,12 @@ class MainWP_Child_Themes_Check {
|
|||
|
||||
if ( ! defined( 'DAY_IN_SECONDS' ) ) {
|
||||
|
||||
/**
|
||||
* Defines days in seconds.
|
||||
*
|
||||
* @const ( string ) Default: true.
|
||||
* @source https://code-reference.mainwp.com/classes/MainWP.Child.MainWP_Child_Themes_Check.html
|
||||
*/
|
||||
/**
|
||||
* Defines days in seconds.
|
||||
*
|
||||
* @const ( string ) Default: true.
|
||||
* @source https://code-reference.mainwp.com/classes/MainWP.Child.MainWP_Child_Themes_Check.html
|
||||
*/
|
||||
define( 'DAY_IN_SECONDS', 24 * 60 * 60 );
|
||||
}
|
||||
|
||||
|
|
|
@ -116,7 +116,11 @@ class MainWP_Child {
|
|||
*/
|
||||
public function load_all_options() {
|
||||
|
||||
/** @global object $wpdb WordPress object. */
|
||||
/**
|
||||
* WP Database object.
|
||||
*
|
||||
* @global object $wpdb WordPress object.
|
||||
*/
|
||||
global $wpdb;
|
||||
|
||||
if ( ! defined( 'WP_INSTALLING' ) || ! is_multisite() ) {
|
||||
|
@ -250,12 +254,12 @@ class MainWP_Child {
|
|||
// Register does not require auth, so we register here.
|
||||
if ( isset( $_POST['function'] ) && 'register' === $_POST['function'] ) {
|
||||
|
||||
/**
|
||||
* Checks whether cron is in progress.
|
||||
*
|
||||
* @const ( bool ) Default: true
|
||||
* @source https://code-reference.mainwp.com/classes/MainWP.Child.MainWP_Child.html
|
||||
*/
|
||||
/**
|
||||
* Checks whether cron is in progress.
|
||||
*
|
||||
* @const ( bool ) Default: true
|
||||
* @source https://code-reference.mainwp.com/classes/MainWP.Child.MainWP_Child.html
|
||||
*/
|
||||
define( 'DOING_CRON', true );
|
||||
|
||||
MainWP_Utility::fix_for_custom_themes();
|
||||
|
|
|
@ -214,21 +214,21 @@ class MainWP_Helper {
|
|||
if ( empty( $creds ) ) {
|
||||
if ( ! defined( 'MAINWP_SAVE_FS_METHOD' ) ) {
|
||||
|
||||
/**
|
||||
* Defines save file system method.
|
||||
*
|
||||
* @const ( string ) Defined save file system method.
|
||||
* @source https://code-reference.mainwp.com/classes/MainWP.Child.MainWP_Helper.html
|
||||
*/
|
||||
/**
|
||||
* Defines save file system method.
|
||||
*
|
||||
* @const ( string ) Defined save file system method.
|
||||
* @source https://code-reference.mainwp.com/classes/MainWP.Child.MainWP_Helper.html
|
||||
*/
|
||||
define( 'MAINWP_SAVE_FS_METHOD', get_filesystem_method() );
|
||||
}
|
||||
|
||||
/**
|
||||
* Defines file system method.
|
||||
*
|
||||
* @const ( string ) Defined file system method.
|
||||
* @source https://code-reference.mainwp.com/classes/MainWP.Child.MainWP_Helper.html
|
||||
*/
|
||||
/**
|
||||
* Defines file system method.
|
||||
*
|
||||
* @const ( string ) Defined file system method.
|
||||
* @source https://code-reference.mainwp.com/classes/MainWP.Child.MainWP_Helper.html
|
||||
*/
|
||||
define( 'FS_METHOD', 'direct' );
|
||||
}
|
||||
$init = \WP_Filesystem( $creds );
|
||||
|
|
|
@ -172,12 +172,12 @@ class MainWP_WordPress_SEO {
|
|||
|
||||
if ( ! defined( 'DIRECTORY_SEPARATOR' ) ) {
|
||||
|
||||
/**
|
||||
* Defines reusable directory separator.
|
||||
*
|
||||
* @const ( string ) Directory separator.
|
||||
* @source https://code-reference.mainwp.com/classes/MainWP.Dashboard.MainWP_WordPress_SEO.html
|
||||
*/
|
||||
/**
|
||||
* Defines reusable directory separator.
|
||||
*
|
||||
* @const ( string ) Directory separator.
|
||||
* @source https://code-reference.mainwp.com/classes/MainWP.Dashboard.MainWP_WordPress_SEO.html
|
||||
*/
|
||||
define( 'DIRECTORY_SEPARATOR', '/' );
|
||||
}
|
||||
$p_path = $upload_dir['basedir'] . DIRECTORY_SEPARATOR . 'wpseo-import' . DIRECTORY_SEPARATOR;
|
||||
|
|
|
@ -30,9 +30,9 @@ define( 'MAINWP_CHILD_DEBUG', false );
|
|||
if ( ! defined( 'MAINWP_CHILD_FILE' ) ) {
|
||||
/**
|
||||
* Define MainWP Child Plugin absolute full path and filename of this file.
|
||||
*
|
||||
* @const ( string ) Defined MainWP Child file path.
|
||||
* @source https://code-reference.mainwp.com/classes/MainWP.Child.MainWP_Child.html
|
||||
*
|
||||
* @const ( string ) Defined MainWP Child file path.
|
||||
* @source https://code-reference.mainwp.com/classes/MainWP.Child.MainWP_Child.html
|
||||
*/
|
||||
define( 'MAINWP_CHILD_FILE', __FILE__ );
|
||||
}
|
||||
|
@ -40,9 +40,9 @@ if ( ! defined( 'MAINWP_CHILD_FILE' ) ) {
|
|||
if ( ! defined( 'MAINWP_CHILD_PLUGIN_DIR' ) ) {
|
||||
/**
|
||||
* Define MainWP Child Plugin Directory.
|
||||
*
|
||||
* @const ( string ) Defined MainWP Child Plugin Directory.
|
||||
* @source https://code-reference.mainwp.com/classes/MainWP.Child.MainWP_Child.html
|
||||
*
|
||||
* @const ( string ) Defined MainWP Child Plugin Directory.
|
||||
* @source https://code-reference.mainwp.com/classes/MainWP.Child.MainWP_Child.html
|
||||
*/
|
||||
define( 'MAINWP_CHILD_PLUGIN_DIR', plugin_dir_path( MAINWP_CHILD_FILE ) );
|
||||
}
|
||||
|
@ -50,9 +50,9 @@ if ( ! defined( 'MAINWP_CHILD_PLUGIN_DIR' ) ) {
|
|||
if ( ! defined( 'MAINWP_CHILD_URL' ) ) {
|
||||
/**
|
||||
* Define MainWP Child Plugin URL.
|
||||
*
|
||||
* @const ( string ) Defined MainWP Child Plugin URL.
|
||||
* @source https://code-reference.mainwp.com/classes/MainWP.Child.MainWP_Child.html
|
||||
*
|
||||
* @const ( string ) Defined MainWP Child Plugin URL.
|
||||
* @source https://code-reference.mainwp.com/classes/MainWP.Child.MainWP_Child.html
|
||||
*/
|
||||
define( 'MAINWP_CHILD_URL', plugin_dir_url( MAINWP_CHILD_FILE ) );
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue