Priority File Manager

📁 public_html
Base Directory:
/home/ecedu/public_html/wp-content/plugins/updraftplus/includes/updraftclone
NameTypeSizeActions
📁 .. Folder -
📄 temporary-clone-auto-login.php File 3801
Edit Download
📄 temporary-clone-dash-notice.php File 6815
Edit Download
📄 temporary-clone-restore.php File 3026
Edit Download
📄 temporary-clone-status.php File 13589
Edit Download
📄 temporary-clone-user-notice.php File 4120
Edit Download
refresh_connection(); } } /** * This function will add a dashboard notice to every page, that shows the user when their clone will expire and directs them to UpdraftPlus.com to extend their clones life. * * @return void */ public function all_admin_notices_dashboard_notice() { $date = strtotime(get_site_option('updraftplus_clone_scheduled_removal', '')); if ('' == $date) { $pretty_date = __('Unable to get renew date', 'updraftplus'); $date_diff = ''; } else { $pretty_date = get_date_from_gmt(gmdate('Y-m-d H:i:s', (int) $date), 'M d, Y G:i'); $date_diff = sprintf(__('%s from now', 'updraftplus'), human_time_diff($date)); } $package_cost = get_site_option('updraftplus_clone_package_cost', 0); $package_cost = empty($package_cost) ? 1 : $package_cost; ?>

.

'.esc_html__('Warning: You have no clone tokens remaining and either no subscriptions or no subscription that will renew before the clone expiry date.', 'updraftplus').'

' ?>
process_dash_notice_ajax(); } else { return; } } /** * This function will handle the ajax calls for the UpdraftClone notice mu-plugin. * * @return void */ public function process_dash_notice_ajax() { $return = array('code' => 'fail', 'data' => ''); if (!isset($_POST['subaction'])) { $return['code'] = 'error'; $return['data'] = 'Missing subaction'; echo json_encode($return); die(); } if ('refresh_connection' === $_POST['subaction']) { check_ajax_referer('updraftplus_refresh_connection', 'nonce'); $result = $this->refresh_connection(); if ($result) { $return['code'] = 'success'; $return['data'] = $result; } else { $return['code'] = 'error'; $return['data'] = $result; } echo json_encode($return); die(); } else { $return['code'] = 'error'; $return['data'] = 'Unknown action'; echo json_encode($return); die(); } } /** * This function will refresh the stored clones expire date by calling UpdraftPlus.com and getting the latest value. * Note this function needs three defines to work UPDRAFTPLUS_USER_ID and UPDRAFTPLUS_VPS_ID and UPDRAFTPLUS_UNIQUE_TOKEN. * * @return array - that contains the updated expire data or error information */ public function refresh_connection() { global $updraftplus; if (!defined('UPDRAFTPLUS_USER_ID') || !is_numeric(UPDRAFTPLUS_USER_ID) || !defined('UPDRAFTPLUS_VPS_ID') || !is_numeric(UPDRAFTPLUS_VPS_ID)) { return array('code' => 'error', 'data' => 'No user or VPS ID found'); } if (!defined('UPDRAFTPLUS_UNIQUE_TOKEN')) return array('code' => 'error', 'data' => 'No unique token found'); $user_id = UPDRAFTPLUS_USER_ID; $vps_id = UPDRAFTPLUS_VPS_ID; $token = UPDRAFTPLUS_UNIQUE_TOKEN; $data = array('user_id' => $user_id, 'vps_id' => $vps_id, 'token' => $token); $result = $updraftplus->get_updraftplus_clone()->clone_status($data); if (!isset($result['data'])) return array('code' => 'error', 'data' => 'No data returned from clone status call'); $vps_info = $result['data']; if (empty($vps_info['scheduled_removal'])) return array('code' => 'error', 'data' => 'No scheduled removal date found'); if (empty($vps_info['package_cost'])) return array('code' => 'error', 'data' => 'Missing the expected clone package cost information'); update_site_option('updraftplus_clone_scheduled_removal', $vps_info['scheduled_removal']); update_site_option('updraftplus_clone_package_cost', $vps_info['package_cost']); $clone_removal_warning = false; if (isset($vps_info['tokens']) && 0 == $vps_info['tokens']) { if (empty($vps_info['subscription_renewals'])) { $clone_removal_warning = true; } else { $subscription_before_expire = false; foreach ($vps_info['subscription_renewals'] as $renewal) { if ($renewal < $vps_info['scheduled_removal']) $subscription_before_expire = true; } if (!$subscription_before_expire) $clone_removal_warning = true; } } update_site_option('updraftplus_clone_removal_warning', $clone_removal_warning); $vps_data = array( 'scheduled_removal' => $vps_info['scheduled_removal'], 'package_cost' => $vps_info['package_cost'] ); return array('code' => 'success', 'data' => $vps_data); } } if (defined('UPDRAFTPLUS_THIS_IS_CLONE')) { new UpdraftPlus_Temporary_Clone_Dash_Notice(); }