function seed_cspv4_mwp_perform_update($update) { if (!function_exists('get_plugin_data') || !function_exists('is_plugin_active')) { // make sure we have the needed functions available if (!@(include_once ABSPATH . 'wp-admin/includes/plugin.php')) { return $update; } } if (!(is_plugin_active('worker/init.php') || is_plugin_active('managewp/init.php'))) { // ManageWP client plugin needed return $update; } global $seed_cspv4; $api_key = $seed_cspv4['api_key']; $updater = new SellWP_UpdaterV2(); $response = $updater->getRemote_information($api_key, SEED_CSPV4_VERSION, 'seedprod-coming-soon-pro/seedprod-coming-soon-pro.php'); $cspv4 = get_plugin_data(SEED_CSPV4_PLUGIN_PATH . 'seedprod-coming-soon-pro.php'); // EDIT: if necessary edit the path to your main plugin file $cspv4['url'] = $response->download_link; // EDIT: provide URL to the archive file with the new version and we will use WordPress update mechanism $cspv4['type'] = 'plugin'; $cspv4['slug'] = 'seedprod-coming-soon-pro/seedprod-coming-soon-pro.php'; //$my_addon['callback'] = 'my_update_callback'; // EDIT: OR alternately provide your own callback function for managing the update. Do not use both. array_push($update, $cspv4); return $update; }
/** * Check License */ function check_license() { if (check_ajax_referer('seed_cspv4_check_license')) { global $seed_cspv4; extract($seed_cspv4); $api_key = $_GET['apikey']; $seed_emaillist = ""; $seed_admin_email = get_option('admin_email', ''); if (!empty($seed_cspv4['emaillist'])) { $seed_emaillist = $seed_cspv4['emaillist']; } $data = array(); $data['emaillist'] = $seed_emaillist; $data['admin_email'] = $seed_admin_email; $updater = new SellWP_UpdaterV2(); $response = $updater->getRemote_information($api_key, SEED_CSPV4_VERSION, 'seedprod-coming-soon-pro/seedprod-coming-soon-pro.php', null, $data); echo json_encode($response); exit; } }