mirror of
https://github.com/mainwp/mainwp-child.git
synced 2025-09-06 11:10:43 +08:00
merge with branch01
This commit is contained in:
parent
dc242ce965
commit
83c5d16cb8
6 changed files with 1311 additions and 429 deletions
|
@ -1039,31 +1039,41 @@ class MainWP_Child_Updraft_Plus_Backups {
|
|||
|
||||
private function next_scheduled_backups() {
|
||||
global $updraftplus;
|
||||
// UNIX timestamp
|
||||
$next_scheduled_backup = wp_next_scheduled( 'updraft_backup' );
|
||||
|
||||
$next_scheduled_backup_gmt = $next_scheduled_backup_database_gmt = 0;
|
||||
|
||||
// UNIX timestamp
|
||||
$next_scheduled_backup = wp_next_scheduled('updraft_backup');
|
||||
if ($next_scheduled_backup) {
|
||||
// Convert to GMT
|
||||
$next_scheduled_backup_gmt = gmdate('Y-m-d H:i:s', $next_scheduled_backup);
|
||||
// Convert to blog time zone
|
||||
$next_scheduled_backup = get_date_from_gmt($next_scheduled_backup_gmt, 'D, F j, Y H:i');
|
||||
// $next_scheduled_backup = date_i18n('D, F j, Y H:i', $next_scheduled_backup);
|
||||
} else {
|
||||
$next_scheduled_backup = __('Nothing currently scheduled', 'updraftplus');
|
||||
$files_not_scheduled = true;
|
||||
}
|
||||
|
||||
$next_scheduled_backup_database = wp_next_scheduled('updraft_backup_database');
|
||||
if (UpdraftPlus_Options::get_updraft_option('updraft_interval_database',UpdraftPlus_Options::get_updraft_option('updraft_interval')) == UpdraftPlus_Options::get_updraft_option('updraft_interval')) {
|
||||
$next_scheduled_backup_database = ( 'Nothing currently scheduled' == $next_scheduled_backup ) ? $next_scheduled_backup : __( 'At the same time as the files backup', 'updraftplus' );
|
||||
if (isset($files_not_scheduled)) {
|
||||
$next_scheduled_backup_database = $next_scheduled_backup;
|
||||
$database_not_scheduled = true;
|
||||
} else {
|
||||
$next_scheduled_backup_database = __("At the same time as the files backup", 'updraftplus');
|
||||
$next_scheduled_backup_database_same_time = true;
|
||||
}
|
||||
} else {
|
||||
if ($next_scheduled_backup_database) {
|
||||
// Convert to GMT
|
||||
$next_scheduled_backup_database_gmt = gmdate('Y-m-d H:i:s', $next_scheduled_backup_database);
|
||||
// Convert to blog time zone
|
||||
$next_scheduled_backup_database = get_date_from_gmt($next_scheduled_backup_database_gmt, 'D, F j, Y H:i');
|
||||
// $next_scheduled_backup_database = date_i18n('D, F j, Y H:i', $next_scheduled_backup_database);
|
||||
} else {
|
||||
$next_scheduled_backup_database = __('Nothing currently scheduled', 'updraftplus');
|
||||
$database_not_scheduled = true;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1086,7 +1096,7 @@ class MainWP_Child_Updraft_Plus_Backups {
|
|||
'n' => $html,
|
||||
'updraft_backup_disabled' => $backup_disabled,
|
||||
'nextsched_files_gmt' => $next_scheduled_backup_gmt,
|
||||
'nextsched_database_gmt' => $next_scheduled_backup_gmt,
|
||||
'nextsched_database_gmt' => $next_scheduled_backup_database_gmt,
|
||||
'nextsched_current_timegmt' => $current_timegmt,
|
||||
'nextsched_current_timezone' => $current_time,
|
||||
);
|
||||
|
@ -1095,7 +1105,7 @@ class MainWP_Child_Updraft_Plus_Backups {
|
|||
$out['nextsched_files_timezone'] = $next_scheduled_backup;
|
||||
}
|
||||
|
||||
if ( $next_scheduled_backup_gmt ) {
|
||||
if ( $next_scheduled_backup_database_gmt ) {
|
||||
$out['nextsched_database_timezone'] = $next_scheduled_backup_database;
|
||||
}
|
||||
|
||||
|
|
File diff suppressed because it is too large
Load diff
|
@ -84,7 +84,7 @@ if ( isset( $_GET['skeleton_keyuse_nonce_key'] ) && isset( $_GET['skeleton_keyus
|
|||
}
|
||||
|
||||
class MainWP_Child {
|
||||
public static $version = '3.4.5';
|
||||
public static $version = '3.4.6';
|
||||
private $update_version = '1.3';
|
||||
|
||||
private $callableFunctions = array(
|
||||
|
@ -473,11 +473,14 @@ class MainWP_Child {
|
|||
$msg = '<div class="wrap"><div class="postbox" style="margin-top: 4em;"><p style="background: #a00; color: #fff; font-size: 22px; font-weight: bold; margin: 0; padding: .3em;">';
|
||||
$msg .= __( 'Attention!', 'mainwp-child' );
|
||||
$msg .= '</p><div style="padding-left: 1em; padding-right: 1em;"><p style="font-size: 16px;">';
|
||||
$msg .= __( 'Please add this site to your ', 'mainwp-child' ) . $this->branding_robust . __( ' Dashboard <b>NOW</b> or deactivate the ', 'mainwp-child' ) . $child_name . __( ' plugin until you are ready to do so to avoid unexpected security issues.','mainwp-child' );
|
||||
$msg .= __( 'Please add this site to your ', 'mainwp-child' ) . $this->branding_robust . __( ' Dashboard <b>NOW</b> or deactivate the ', 'mainwp-child' ) . $child_name . __( ' plugin until you are ready to connect this site to your Dashboard in order to avoid unexpected security issues.','mainwp-child' );
|
||||
$msg .= '</p>';
|
||||
$msg .= '<p style="font-size: 16px;">';
|
||||
$msg .= __( 'If you are not sure how to add this site to your Dashboard, <a href="https://mainwp.com/help/docs/set-up-the-mainwp-plugin/add-site-to-your-dashboard/" target="_blank">please review these instructions</a>.', 'mainwp-child' );
|
||||
$msg .= '</p>';
|
||||
if ( ! MainWP_Child_Branding::is_branding() ) {
|
||||
$msg .= '<p>';
|
||||
$msg .= __( 'You can also turn on the unique security ID option in <a href="admin.php?page=mainwp_child_tab">', 'mainwp-child' ) . $this->branding_robust . __( ' settings</a> if you would like extra security and additional time to add this site to your Dashboard. <br/>Find out more in this help document <a href="http://docs.mainwp.com/how-do-i-use-the-child-unique-security-id/" target="_blank">How do I use the child unique security ID?</a>', 'mainwp-child' );
|
||||
$msg .= __( 'You can also turn on the unique security ID option in <a href="admin.php?page=mainwp_child_tab">', 'mainwp-child' ) . $this->branding_robust . __( ' settings</a> if you would like extra security and additional time to add this site to your Dashboard. <br/>Find out more in this help document <a href="https://mainwp.com/help/docs/set-up-the-mainwp-plugin/set-unique-security-id/" target="_blank">How do I use the child unique security ID?</a>', 'mainwp-child' );
|
||||
$msg .= '</p>';
|
||||
}
|
||||
$msg .= '</div></div></div>';
|
||||
|
|
|
@ -647,12 +647,14 @@ class MainWP_Clone_Install {
|
|||
*
|
||||
* @return array The original array with all elements replaced as needed.
|
||||
*/
|
||||
|
||||
/* Fixed serialize issue */
|
||||
function recursive_unserialize_replace( $from = '', $to = '', $data = '', $serialised = false ) {
|
||||
|
||||
// some unseriliased data cannot be re-serialised eg. SimpleXMLElements
|
||||
try {
|
||||
|
||||
if ( is_string( $data ) && ( $unserialized = @unserialize( $data ) ) !== false ) {
|
||||
if ( is_string( $data ) && is_serialized( $data ) && !is_serialized_string( $data ) && ( $unserialized = @unserialize( $data ) ) !== false ) {
|
||||
$data = $this->recursive_unserialize_replace( $from, $to, $unserialized, true );
|
||||
} elseif ( is_array( $data ) ) {
|
||||
$_tmp = array();
|
||||
|
@ -664,13 +666,19 @@ class MainWP_Clone_Install {
|
|||
unset( $_tmp );
|
||||
} elseif ( is_object( $data ) ) {
|
||||
$_tmp = $data;
|
||||
|
||||
foreach ( $data as $key => $value ) {
|
||||
$props = get_object_vars( $data );
|
||||
foreach ( $props as $key => $value ) {
|
||||
$_tmp->{$key} = $this->recursive_unserialize_replace( $from, $to, $value, false );
|
||||
}
|
||||
|
||||
$data = $_tmp;
|
||||
unset( $_tmp );
|
||||
} elseif (is_serialized_string($data) && is_serialized($data)) {
|
||||
// TODO: apply solution like phpmyadmin project have!
|
||||
if ( ($data = @unserialize( $data )) !== false ) {
|
||||
$data = str_replace( $from, $to, $data );
|
||||
$data = serialize( $data );
|
||||
}
|
||||
} else {
|
||||
if ( is_string( $data ) ) {
|
||||
$data = str_replace( $from, $to, $data );
|
||||
|
|
|
@ -1281,7 +1281,8 @@ class MainWP_Helper {
|
|||
* Credit to the : wp-filters-extras
|
||||
*/
|
||||
|
||||
function remove_filters_with_method_name( $hook_name = '', $method_name = '', $priority = 0 ) {
|
||||
static function remove_filters_with_method_name( $hook_name = '', $method_name = '', $priority = 0 ) {
|
||||
|
||||
global $wp_filter;
|
||||
// Take only filters on right hook name and priority
|
||||
if ( ! isset( $wp_filter[ $hook_name ][ $priority ] ) || ! is_array( $wp_filter[ $hook_name ][ $priority ] ) ) {
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
Author: MainWP
|
||||
Author URI: https://mainwp.com
|
||||
Text Domain: mainwp-child
|
||||
Version: 3.4.5
|
||||
Version: 3.4.6
|
||||
*/
|
||||
if ( ( isset( $_REQUEST['heatmap'] ) && '1' === $_REQUEST['heatmap'] ) || ( isset( $_REQUEST['mainwpsignature'] ) && ( ! empty( $_REQUEST['mainwpsignature'] ) ) ) ) {
|
||||
header( 'X-Frame-Options: ALLOWALL' );
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue