is_plugin_installed = true;
}
if ( ! $this->is_plugin_installed ) {
return;
}
add_filter( 'mainwp_site_sync_others_data', array( $this, 'sync_others_data' ), 10, 2 );
}
public function init() {
if ( ! $this->is_plugin_installed ) {
return;
}
if ( get_option( 'mainwp_time_capsule_ext_enabled' ) !== 'Y' ) {
return;
}
add_action( 'mainwp_child_site_stats', array( $this, 'do_site_stats' ) );
if ( get_option( 'mainwp_time_capsule_hide_plugin' ) === 'hide' ) {
add_filter( 'all_plugins', array( $this, 'all_plugins' ) );
add_action( 'admin_menu', array( $this, 'remove_menu' ) );
add_filter( 'site_transient_update_plugins', array( &$this, 'remove_update_nag' ) );
add_filter( 'mainwp_child_hide_update_notice', array( &$this, 'hide_update_notice' ) );
}
}
public function action() {
if ( ! $this->is_plugin_installed ) {
mainwp_child_helper()->write( array( 'error' => 'Please install WP Time Capsule plugin on child website' ) );
}
try {
$this->require_files();
} catch ( \Exception $e ) {
$error = $e->getMessage();
mainwp_child_helper()->write( array( 'error' => $error ) );
}
$information = array();
$options_helper = new Wptc_Options_Helper();
$options = WPTC_Factory::get( 'config' );
$is_user_logged_in = $options->get_option( 'is_user_logged_in' );
$privileges_wptc = $options_helper->get_unserialized_privileges();
if ( isset( $_POST['mwp_action'] ) ) {
if ( ( 'save_settings' == $_POST['mwp_action'] || 'get_staging_details_wptc' == $_POST['mwp_action'] || 'progress_wptc' == $_POST['mwp_action'] ) && ( ! $is_user_logged_in || ! $privileges_wptc ) ) {
mainwp_child_helper()->write( array( 'error' => 'You are not login to your WP Time Capsule account.' ) );
}
switch ( $_POST['mwp_action'] ) {
case 'set_showhide':
$information = $this->set_showhide();
break;
case 'get_root_files':
$information = $this->get_root_files();
break;
case 'get_tables':
$information = $this->get_tables();
break;
case 'exclude_file_list':
$information = $this->exclude_file_list();
break;
case 'exclude_table_list':
$information = $this->exclude_table_list();
break;
case 'include_table_list':
$information = $this->include_table_list();
break;
case 'include_table_structure_only':
$information = $this->include_table_structure_only();
break;
case 'include_file_list':
$information = $this->include_file_list();
break;
case 'get_files_by_key':
$information = $this->get_files_by_key();
break;
case 'wptc_login':
$information = $this->process_wptc_login();
break;
case 'get_installed_plugins':
$information = $this->get_installed_plugins();
break;
case 'get_installed_themes':
$information = $this->get_installed_themes();
break;
case 'is_staging_need_request':
$information = $this->is_staging_need_request();
break;
case 'get_staging_details_wptc':
$information = $this->get_staging_details_wptc();
break;
case 'start_fresh_staging_wptc':
$information = $this->start_fresh_staging_wptc();
break;
case 'get_staging_url_wptc':
$information = $this->get_staging_url_wptc();
break;
case 'stop_staging_wptc':
$information = $this->stop_staging_wptc();
break;
case 'continue_staging_wptc':
$information = $this->continue_staging_wptc();
break;
case 'delete_staging_wptc':
$information = $this->delete_staging_wptc();
break;
case 'copy_staging_wptc':
$information = $this->copy_staging_wptc();
break;
case 'get_staging_current_status_key':
$information = $this->get_staging_current_status_key();
break;
case 'wptc_sync_purchase':
$information = $this->wptc_sync_purchase();
break;
case 'init_restore':
$information = $this->init_restore();
break;
case 'save_settings':
$information = $this->save_settings_wptc();
break;
case 'analyze_inc_exc':
$information = $this->analyze_inc_exc();
break;
case 'get_enabled_plugins':
$information = $this->get_enabled_plugins();
break;
case 'get_enabled_themes':
$information = $this->get_enabled_themes();
break;
case 'get_system_info':
$information = $this->get_system_info();
break;
case 'update_vulns_settings':
$information = $this->update_vulns_settings();
break;
case 'start_fresh_backup':
$information = $this->start_fresh_backup_tc_callback_wptc();
break;
case 'save_manual_backup_name':
$information = $this->save_manual_backup_name_wptc();
break;
case 'progress_wptc':
$information = $this->progress_wptc();
break;
case 'stop_fresh_backup':
$information = $this->stop_fresh_backup_tc_callback_wptc();
break;
case 'wptc_cron_status':
$information = $this->wptc_cron_status();
break;
case 'get_this_backups_html':
$information = $this->get_this_backups_html();
break;
case 'start_restore_tc_wptc':
$information = $this->start_restore_tc_callback_wptc();
break;
case 'get_sibling_files':
$information = $this->get_sibling_files_callback_wptc();
break;
case 'get_logs_rows':
$information = $this->get_logs_rows();
break;
case 'clear_logs':
$information = $this->clear_wptc_logs();
break;
case 'send_issue_report':
$information = $this->send_issue_report();
break;
case 'lazy_load_activity_log':
$information = $this->lazy_load_activity_log_wptc();
break;
}
}
mainwp_child_helper()->write( $information );
}
public function require_files() {
if ( ! class_exists( 'WPTC_Base_Factory' ) && defined( 'WPTC_PLUGIN_DIR' ) ) {
if ( MainWP_Helper::check_files_exists( WPTC_PLUGIN_DIR . 'Base/Factory.php' ) ) {
include_once WPTC_PLUGIN_DIR . 'Base/Factory.php';
}
}
if ( ! class_exists( 'Wptc_Options_Helper' ) && defined( 'WPTC_PLUGIN_DIR' ) ) {
if ( MainWP_Helper::check_files_exists( WPTC_PLUGIN_DIR . 'Views/wptc-options-helper.php' ) ) {
include_once WPTC_PLUGIN_DIR . 'Views/wptc-options-helper.php';
}
}
}
public function set_showhide() {
$hide = isset( $_POST['showhide'] ) && ( 'hide' === $_POST['showhide'] ) ? 'hide' : '';
MainWP_Helper::update_option( 'mainwp_time_capsule_hide_plugin', $hide, 'yes' );
$information['result'] = 'SUCCESS';
return $information;
}
public function sync_others_data( $information, $data = array() ) {
if ( isset( $data['syncWPTimeCapsule'] ) && $data['syncWPTimeCapsule'] ) {
$information['syncWPTimeCapsule'] = $this->get_sync_data();
if ( get_option( 'mainwp_time_capsule_ext_enabled' ) !== 'Y' ) {
MainWP_Helper::update_option( 'mainwp_time_capsule_ext_enabled', 'Y', 'yes' );
}
}
return $information;
}
public function get_sync_data() {
try {
$this->require_files();
MainWP_Helper::check_classes_exists( array( 'Wptc_Options_Helper', 'WPTC_Base_Factory', 'WPTC_Factory' ) );
$config = WPTC_Factory::get( 'config' );
MainWP_Helper::check_methods( $config, 'get_option' );
$main_account_email_var = $config->get_option( 'main_account_email' );
$last_backup_time = $config->get_option( 'last_backup_time' );
$wptc_settings = WPTC_Base_Factory::get( 'Wptc_Settings' );
$options_helper = new Wptc_Options_Helper();
MainWP_Helper::check_methods( $options_helper, array( 'get_plan_interval_from_subs_info', 'get_is_user_logged_in' ) );
MainWP_Helper::check_methods( $wptc_settings, array( 'get_connected_cloud_info' ) );
$all_backups = $this->get_backups();
$backups_count = 0;
if ( is_array( $all_backups ) ) {
$formatted_backups = array();
foreach ( $all_backups as $key => $value ) {
$value_array = (array) $value;
$formatted_backups[ $value_array['backupID'] ][] = $value_array;
}
$backups_count = count( $formatted_backups );
}
$return = array(
'main_account_email' => $main_account_email_var,
'signed_in_repos' => $wptc_settings->get_connected_cloud_info(),
'plan_name' => $options_helper->get_plan_interval_from_subs_info(),
'plan_interval' => $options_helper->get_plan_interval_from_subs_info(),
'lastbackup_time' => ! empty( $last_backup_time ) ? $last_backup_time : 0,
'is_user_logged_in' => $options_helper->get_is_user_logged_in(),
'backups_count' => $backups_count,
);
return $return;
} catch ( \Exception $e ) {
// do not exit here!
}
return false;
}
protected function get_backups( $last_time = false ) {
if ( empty( $last_time ) ) {
$last_time = strtotime( date( 'Y-m-d', strtotime( date( 'Y-m-01' ) ) ) ); // phpcs:ignore -- local time.
}
global $wpdb;
$all_backups = $wpdb->get_results(
$wpdb->prepare(
"SELECT backupID
FROM {$wpdb->base_prefix}wptc_processed_files
WHERE backupID > %s ",
$last_time
)
);
return $all_backups;
}
public function get_tables() {
$category = $_POST['category'];
$exclude_class_obj = new Wptc_ExcludeOption( $category );
$exclude_class_obj->get_tables();
die();
}
public function exclude_file_list() {
if ( ! isset( $_POST['data'] ) ) {
wptc_die_with_json_encode( array( 'status' => 'no data found' ) );
}
$category = $_POST['category'];
$exclude_class_obj = new Wptc_ExcludeOption( $category );
$exclude_class_obj->exclude_file_list( $_POST['data'] );
die();
}
public function progress_wptc() {
$config = WPTC_Factory::get( 'config' );
global $wpdb;
if ( ! $config->get_option( 'in_progress' ) ) {
spawn_cron();
}
$processed_files = WPTC_Factory::get( 'processed-files' );
$return_array = array();
$return_array['stored_backups'] = $processed_files->get_stored_backups();
$return_array['backup_progress'] = array();
$return_array['starting_first_backup'] = $config->get_option( 'starting_first_backup' );
$return_array['meta_data_backup_process'] = $config->get_option( 'meta_data_backup_process' );
$return_array['backup_before_update_progress'] = $config->get_option( 'backup_before_update_progress' );
$return_array['is_staging_running'] = apply_filters( 'is_any_staging_process_going_on', '' );
$cron_status = $config->get_option( 'wptc_own_cron_status' );
if ( ! empty( $cron_status ) ) {
$return_array['wptc_own_cron_status'] = unserialize( $cron_status ); // phpcs:ignore -- third party credit.
$return_array['wptc_own_cron_status_notified'] = (int) $config->get_option( 'wptc_own_cron_status_notified' );
}
$start_backups_failed_server = $config->get_option( 'start_backups_failed_server' );
if ( ! empty( $start_backups_failed_server ) ) {
$return_array['start_backups_failed_server'] = unserialize( $start_backups_failed_server ); // phpcs:ignore -- third party credit.
$config->set_option( 'start_backups_failed_server', false );
}
$processed_files->get_current_backup_progress( $return_array );
$return_array['user_came_from_existing_ver'] = (int) $config->get_option( 'user_came_from_existing_ver' );
$return_array['show_user_php_error'] = $config->get_option( 'show_user_php_error' );
$return_array['bbu_setting_status'] = apply_filters( 'get_backup_before_update_setting_wptc', '' );
$return_array['bbu_note_view'] = apply_filters( 'get_bbu_note_view', '' );
$return_array['staging_status'] = apply_filters( 'staging_status_wptc', '' );
$processed_files = WPTC_Factory::get( 'processed-files' );
$last_backup_time = $config->get_option( 'last_backup_time' );
if ( ! empty( $last_backup_time ) ) {
$user_time = $config->cnvt_UTC_to_usrTime( $last_backup_time );
$processed_files->modify_schedule_backup_time( $user_time );
$formatted_date = date( 'M d @ g:i a', $user_time ); // phpcs:ignore -- local time.
$return_array['last_backup_time'] = $formatted_date;
} else {
$return_array['last_backup_time'] = 'No Backup Taken';
}
return array( 'result' => $return_array );
}
public function wptc_cron_status() {
$config = WPTC_Factory::get( 'config' );
wptc_own_cron_status();
$status = array();
$cron_status = $config->get_option( 'wptc_own_cron_status' );
if ( ! empty( $cron_status ) ) {
$cron_status = unserialize( $cron_status ); // phpcs:ignore -- third party credit.
if ( 'success' == $cron_status['status'] ) {
$status['status'] = 'success';
} else {
$status['status'] = 'failed';
$status['status_code'] = $cron_status['statusCode'];
$status['err_msg'] = $cron_status['body'];
$status['cron_url'] = $cron_status['cron_url'];
$status['ips'] = $cron_status['ips'];
}
return array( 'result' => $status );
}
return false;
}
public function get_this_backups_html() {
$this_backup_ids = $_POST['this_backup_ids'];
$specific_dir = $_POST['specific_dir'];
$type = $_POST['type'];
$treeRecursiveCount = $_POST['treeRecursiveCount'];
$processed_files = WPTC_Factory::get( 'processed-files' );
$result = $processed_files->get_this_backups_html( $this_backup_ids, $specific_dir, $type, $treeRecursiveCount );
return array( 'result' => $result );
}
public function start_restore_tc_callback_wptc() {
if ( apply_filters( 'is_restore_to_staging_wptc', '' ) ) {
$request = apply_filters( 'get_restore_to_staging_request_wptc', '' );
} else {
$request = $_POST['data'];
}
include_once WPTC_CLASSES_DIR . 'class-prepare-restore-bridge.php';
new WPTC_Prepare_Restore_Bridge( $request );
}
public function get_sibling_files_callback_wptc() {
// note that we are getting the ajax function data via $_POST.
$file_name = $_POST['data']['file_name'];
$file_name = wp_normalize_path( $file_name );
$backup_id = $_POST['data']['backup_id'];
$recursive_count = $_POST['data']['recursive_count'];
$processed_files = WPTC_Factory::get( 'processed-files' );
echo $processed_files->get_this_backups_html( $backup_id, $file_name, $type = 'sibling', (int) $recursive_count );
die();
}
public function send_issue_report() {
WPTC_Base_Factory::get( 'Wptc_App_Functions' )->send_report();
die();
}
public function get_logs_rows() {
$result = $this->prepare_items();
$result['display_rows'] = base64_encode( serialize( $this->get_display_rows( $result['items'] ) ) ); // phpcs:ignore WordPress.PHP.DiscouragedPHPFunctions -- base64_encode function is used for begin reasons.
return $result;
}
public function prepare_items() {
global $wpdb;
if ( isset( $_POST['type'] ) ) {
$type = $_POST['type'];
switch ( $type ) {
case 'backups':
$query = 'SELECT * FROM ' . $wpdb->base_prefix . "wptc_activity_log WHERE type LIKE '%backup%' AND show_user = 1 GROUP BY action_id";
break;
case 'restores':
$query = 'SELECT * FROM ' . $wpdb->base_prefix . "wptc_activity_log WHERE type LIKE 'restore%' GROUP BY action_id";
break;
case 'staging':
$query = 'SELECT * FROM ' . $wpdb->base_prefix . "wptc_activity_log WHERE type LIKE 'staging%' GROUP BY action_id";
break;
case 'backup_and_update':
$query = 'SELECT * FROM ' . $wpdb->base_prefix . "wptc_activity_log WHERE type LIKE 'backup_and_update%' GROUP BY action_id";
break;
case 'auto_update':
$query = 'SELECT * FROM ' . $wpdb->base_prefix . "wptc_activity_log WHERE type LIKE 'auto_update%' GROUP BY action_id";
break;
case 'others':
$query = 'SELECT * FROM ' . $wpdb->base_prefix . "wptc_activity_log WHERE type NOT LIKE 'restore%' AND type NOT LIKE 'backup%' AND show_user = 1";
break;
default:
$query = 'SELECT * FROM ' . $wpdb->base_prefix . 'wptc_activity_log GROUP BY action_id UNION SELECT * FROM ' . $wpdb->base_prefix . "wptc_activity_log WHERE action_id='' AND show_user = 1";
break;
}
} else {
$query = 'SELECT * FROM ' . $wpdb->base_prefix . 'wptc_activity_log WHERE show_user = 1 GROUP BY action_id ';
}
$orderby = ! empty( $_POST['orderby'] ) ? MainWP_Child_DB::real_escape_string( $_POST['orderby'] ) : 'id';
$order = ! empty( $_POST['order'] ) ? MainWP_Child_DB::real_escape_string( $_POST['order'] ) : 'DESC';
if ( ! empty( $orderby ) & ! empty( $order ) ) {
$query .= ' ORDER BY ' . $orderby . ' ' . $order;
}
$totalitems = $wpdb->query( $query ); // phpcs:ignore -- safe query.
$perpage = 20;
$paged = ! empty( $_POST['paged'] ) ? $_POST['paged'] : '';
if ( empty( $paged ) || ! is_numeric( $paged ) || $paged <= 0 ) {
$paged = 1;
}
$totalpages = ceil( $totalitems / $perpage );
if ( ! empty( $paged ) && ! empty( $perpage ) ) {
$offset = ( $paged - 1 ) * $perpage;
$query .= ' LIMIT ' . (int) $offset . ',' . (int) $perpage;
}
return array(
'items' => $wpdb->get_results( $query ), // phpcs:ignore -- safe query.
'totalitems' => $totalitems,
'perpage' => $perpage,
);
}
public function lazy_load_activity_log_wptc() {
if ( ! isset( $_POST['data'] ) ) {
return false;
}
$data = $_POST['data'];
if ( ! isset( $data['action_id'] ) || ! isset( $data['limit'] ) ) {
return false;
}
global $wpdb;
$action_id = $data['action_id'];
$from_limit = $data['limit'];
$detailed = '';
$load_more = false;
$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 ) );
$row_count = count( $sub_records );
if ( $row_count == $current_limit ) {
$load_more = true;
}
$detailed = $this->get_activity_log( $sub_records );
if ( isset( $load_more ) && $load_more ) {
$detailed .= '
';
echo '' . __( 'Setting', 'wp-time-capsule' ) . ' | ' . __( 'Value', 'wp-time-capsule' ) . ' |
';
echo '' . __( 'WordPress version', 'wp-time-capsule' ) . ' | ' . esc_html( $wptc_settings->get_plugin_data( 'wp_version' ) ) . ' |
';
echo '' . __( 'WP Time Capsule version', 'wp-time-capsule' ) . ' | ' . esc_html( $wptc_settings->get_plugin_data( 'Version' ) ) . ' |
';
$bit = '';
if ( PHP_INT_SIZE === 4 ) {
$bit = ' (32bit)';
}
if ( PHP_INT_SIZE === 8 ) {
$bit = ' (64bit)';
}
echo '' . __( 'PHP version', 'wp-time-capsule' ) . ' | ' . esc_html( PHP_VERSION . ' ' . $bit ) . ' |
';
echo '' . __( 'MySQL version', 'wp-time-capsule' ) . ' | ' . esc_html( $wpdb->get_var( 'SELECT VERSION() AS version' ) ) . ' |
';
if ( function_exists( 'curl_version' ) ) {
$curlversion = curl_version();
echo '' . __( 'cURL version', 'wp-time-capsule' ) . ' | ' . esc_html( $curlversion['version'] ) . ' |
';
echo '' . __( 'cURL SSL version', 'wp-time-capsule' ) . ' | ' . esc_html( $curlversion['ssl_version'] ) . ' |
';
} else {
echo '' . __( 'cURL version', 'wp-time-capsule' ) . ' | ' . __( 'unavailable', 'wp-time-capsule' ) . ' |
';
}
echo '';
echo '' . __( 'Server', 'wp-time-capsule' ) . ' | ' . esc_html( $_SERVER['SERVER_SOFTWARE'] ) . ' |
';
echo '' . __( 'Operating System', 'wp-time-capsule' ) . ' | ' . esc_html( PHP_OS ) . ' |
';
echo '' . __( 'PHP SAPI', 'wp-time-capsule' ) . ' | ' . esc_html( PHP_SAPI ) . ' |
';
$php_user = __( 'Function Disabled', 'wp-time-capsule' );
if ( function_exists( 'get_current_user' ) ) {
$php_user = get_current_user();
}
echo '' . __( 'Current PHP user', 'wp-time-capsule' ) . ' | ' . esc_html( $php_user ) . ' |
';
echo '' . __( 'Maximum execution time', 'wp-time-capsule' ) . ' | ' . esc_html( ini_get( 'max_execution_time' ) ) . ' ' . __( 'seconds', 'wp-time-capsule' ) . ' |
';
if ( defined( 'FS_CHMOD_DIR' ) ) {
echo '' . __( 'CHMOD Dir', 'wp-time-capsule' ) . ' | ' . esc_html( FS_CHMOD_DIR ) . ' |
';
} else {
echo '' . __( 'CHMOD Dir', 'wp-time-capsule' ) . ' | 0755 |
';
}
$now = localtime( time(), true );
echo '' . __( 'Server Time', 'wp-time-capsule' ) . ' | ' . esc_html( $now['tm_hour'] . ':' . $now['tm_min'] ) . ' |
';
echo '' . __( 'Blog Time', 'wp-time-capsule' ) . ' | ' . date( 'H:i', current_time( 'timestamp' ) ) . ' |
'; // phpcs:ignore -- local time.
echo '' . __( 'Blog language', 'wp-time-capsule' ) . ' | ' . get_bloginfo( 'language' ) . ' |
';
echo '' . __( 'MySQL Client encoding', 'wp-time-capsule' ) . ' | ';
echo defined( 'DB_CHARSET' ) ? DB_CHARSET : '';
echo ' |
';
echo '' . __( 'Blog charset', 'wp-time-capsule' ) . ' | ' . get_bloginfo( 'charset' ) . ' |
';
echo '' . __( 'PHP Memory limit', 'wp-time-capsule' ) . ' | ' . esc_html( ini_get( 'memory_limit' ) ) . ' |
';
echo '' . __( 'WP memory limit', 'wp-time-capsule' ) . ' | ' . esc_html( WP_MEMORY_LIMIT ) . ' |
';
echo '' . __( 'WP maximum memory limit', 'wp-time-capsule' ) . ' | ' . esc_html( WP_MAX_MEMORY_LIMIT ) . ' |
';
echo '' . __( 'Memory in use', 'wp-time-capsule' ) . ' | ' . size_format( memory_get_usage( true ), 2 ) . ' |
';
// disabled PHP functions.
$disabled = esc_html( ini_get( 'disable_functions' ) );
if ( ! empty( $disabled ) ) {
$disabledarry = explode( ',', $disabled );
echo '' . __( 'Disabled PHP Functions:', 'wp-time-capsule' ) . ' | ';
echo implode( ', ', $disabledarry );
echo ' |
';
}
// Loaded PHP Extensions.
echo '' . __( 'Loaded PHP Extensions:', 'wp-time-capsule' ) . ' | ';
$extensions = get_loaded_extensions();
sort( $extensions );
echo esc_html( implode( ', ', $extensions ) );
echo ' |
';
echo '
';
$html = ob_get_clean();
return array( 'result' => $html );
}
public function update_vulns_settings() {
$vulns_obj = WPTC_Base_Factory::get( 'Wptc_Vulns' );
$data = isset( $_POST['data'] ) ? $_POST['data'] : array();
$vulns_obj->update_vulns_settings( $data );
return array( 'success' => 1 );
}
public function start_fresh_backup_tc_callback_wptc() {
$type = '';
$args = null;
$test_connection = true;
$ajax_check = false;
start_fresh_backup_tc_callback_wptc( $type, $args, $test_connection, $ajax_check );
return array( 'result' => 'success' );
}
public function save_manual_backup_name_wptc() {
$backup_name = $_POST['backup_name'];
$processed_files = WPTC_Factory::get( 'processed-files' );
$processed_files->save_manual_backup_name_wptc( $backup_name );
die();
}
public function all_plugins( $plugins ) {
foreach ( $plugins as $key => $value ) {
$plugin_slug = basename( $key, '.php' );
if ( 'wp-time-capsule' === $plugin_slug ) {
unset( $plugins[ $key ] );
}
}
return $plugins;
}
public function remove_menu() {
remove_menu_page( 'wp-time-capsule-monitor' );
$pos = stripos( $_SERVER['REQUEST_URI'], 'admin.php?page=wp-time-capsule-monitor' );
if ( false !== $pos ) {
wp_safe_redirect( get_option( 'siteurl' ) . '/wp-admin/index.php' );
exit();
}
}
public function hide_update_notice( $slugs ) {
$slugs[] = 'wp-time-capsule/wp-time-capsule.php';
return $slugs;
}
public function remove_update_nag( $value ) {
if ( isset( $_POST['mainwpsignature'] ) ) {
return $value;
}
if ( ! MainWP_Helper::is_screen_with_update() ) {
return $value;
}
if ( isset( $value->response['wp-time-capsule/wp-time-capsule.php'] ) ) {
unset( $value->response['wp-time-capsule/wp-time-capsule.php'] );
}
return $value;
}
}