function w3tc_licensing_reset_rooturi() { $license_key = $this->_config->get_string('plugin.license_key'); delete_transient('w3tc_license_status'); edd_w3edge_w3tc_activate_license($license_key, W3TC_VERSION); $license = edd_w3edge_w3tc_check_license($license_key, W3TC_VERSION); if ($license) { $status = $license->license_status; if (substr($status . '.', 0, 7) == 'active.') { Util_Admin::redirect_with_custom_messages2(array('notes' => array('Your license has been reset already. Activated for this website now.')), true); } } $r = edd_w3edge_w3tc_reset_rooturi($this->_config->get_string('plugin.license_key'), W3TC_VERSION); if (isset($r->status) && $r->status == 'done') { Util_Admin::redirect_with_custom_messages2(array('notes' => array('Email with a link for license reset was sent to you')), true); } else { Util_Admin::redirect_with_custom_messages2(array('errors' => array('Failed to reset license')), true); } }
/** * @return string */ function update_license_status() { $status = ''; $license_key = $this->get_license_key(); if (!empty($license_key) || defined('W3TC_LICENSE_CHECK')) { $license = edd_w3edge_w3tc_check_license($license_key); $status = $license->license; if (in_array($status, array('valid', 'host_valid'))) { $version = 'pro'; } else { $version = ''; } $this->_config->set('plugin.type', $version); } else { $status = 'no_key'; $this->_config->set('plugin.type', ''); } try { $this->_config->save(); } catch (Exception $ex) { } return $status; }
function action_verify_plugin_license_key() { $license = Util_Request::get_string('license_key', ''); if ($license) { $status = edd_w3edge_w3tc_check_license($license, W3TC_VERSION); echo $status->license_status; } else { echo 'invalid'; } exit; }
/** * Return product type * @param bool $license * @param $version * @return mixed */ function edd_w3edge_w3tc_check_license_product($license, $version) { $license = edd_w3edge_w3tc_check_license($license, $version); return $license->type; }
/** * @return string */ function update_license_status() { $status = ''; $license_key = $this->get_license_key(); if (!empty($license_key) || defined('W3TC_LICENSE_CHECK')) { $license = edd_w3edge_w3tc_check_license($license_key, W3TC_VERSION); $version = ''; if ($license) { $status = $license->license; if ('host_valid' == $status) { $version = 'pro'; } elseif (in_array($status, array('site_inactive', 'valid')) && w3tc_is_pro_dev_mode()) { $status = 'valid'; $version = 'pro_dev'; } } $this->_config->set('plugin.type', $version); } else { $status = 'no_key'; $this->_config->set('plugin.type', ''); } try { $this->_config->save(); } catch (Exception $ex) { } return $status; }