本文整理汇总了PHP中GFCommon::get_key方法的典型用法代码示例。如果您正苦于以下问题:PHP GFCommon::get_key方法的具体用法?PHP GFCommon::get_key怎么用?PHP GFCommon::get_key使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类GFCommon
的用法示例。
在下文中一共展示了GFCommon::get_key方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: get_key
private static function get_key()
{
if (self::is_gravityforms_supported()) {
return GFCommon::get_key();
} else {
return "";
}
}
示例2: get_addon_info
public static function get_addon_info($api, $action, $args)
{
if ($action == 'plugin_information' && empty($api) && (!rgempty('rg', $_GET) || $args->slug == 'gravityforms')) {
$key = GFCommon::get_key();
$raw_response = GFCommon::post_to_manager('api.php', "op=get_plugin&slug={$args->slug}&key={$key}", array());
if (is_wp_error($raw_response) || $raw_response['response']['code'] != 200) {
return false;
}
$plugin = unserialize($raw_response['body']);
$api = new stdClass();
$api->name = $plugin['title'];
$api->version = $plugin['version'];
$api->download_link = $plugin['download_url'];
$api->tested = '10.0';
}
return $api;
}
示例3: addons_page
public static function addons_page()
{
wp_print_scripts("thickbox");
wp_print_styles(array("thickbox"));
$plugins = get_plugins();
$installed_plugins = array();
foreach ($plugins as $key => $plugin) {
$is_active = is_plugin_active($key);
$installed_plugin = array("plugin" => $key, "name" => $plugin["Name"], "is_active" => $is_active);
$installed_plugin["activation_url"] = $is_active ? "" : wp_nonce_url("plugins.php?action=activate&plugin={$key}", "activate-plugin_{$key}");
$installed_plugin["deactivation_url"] = !$is_active ? "" : wp_nonce_url("plugins.php?action=deactivate&plugin={$key}", "deactivate-plugin_{$key}");
$installed_plugins[] = $installed_plugin;
}
$nonces = self::get_addon_nonces();
$body = array("plugins" => urlencode(serialize($installed_plugins)), "nonces" => urlencode(serialize($nonces)), "key" => GFCommon::get_key());
$options = array('body' => $body, 'headers' => array('Referer' => get_bloginfo("url")));
$request_url = GRAVITY_MANAGER_URL . "/api.php?op=plugin_browser&{$_SERVER["QUERY_STRING"]}";
$raw_response = wp_remote_post($request_url, $options);
if (is_wp_error($raw_response) || $raw_response['response']['code'] != 200) {
echo "<div class='error' style='margin-top:50px; padding:20px;'>" . __("Add-On brower is currently unavailable. Please try again later.", "gravityforms") . "</div>";
} else {
echo GFCommon::get_remote_message();
echo $raw_response["body"];
}
}
示例4: addons_page
public static function addons_page()
{
wp_print_styles(array('thickbox'));
$plugins = get_plugins();
$installed_plugins = array();
foreach ($plugins as $key => $plugin) {
$is_active = is_plugin_active($key);
$installed_plugin = array('plugin' => $key, 'name' => $plugin['Name'], 'is_active' => $is_active);
$installed_plugin['activation_url'] = $is_active ? '' : wp_nonce_url("plugins.php?action=activate&plugin={$key}", "activate-plugin_{$key}");
$installed_plugin['deactivation_url'] = !$is_active ? '' : wp_nonce_url("plugins.php?action=deactivate&plugin={$key}", "deactivate-plugin_{$key}");
$installed_plugins[] = $installed_plugin;
}
$nonces = self::get_addon_nonces();
$body = array('plugins' => urlencode(serialize($installed_plugins)), 'nonces' => urlencode(serialize($nonces)), 'key' => GFCommon::get_key());
$options = array('body' => $body, 'headers' => array('Referer' => get_bloginfo('url')), 'timeout' => 15);
$raw_response = GFCommon::post_to_manager('api.php', "op=plugin_browser&{$_SERVER['QUERY_STRING']}", $options);
if (is_wp_error($raw_response) || $raw_response['response']['code'] != 200) {
echo "<div class='error' style='margin-top:50px; padding:20px;'>" . __('Add-On browser is currently unavailable. Please try again later.', 'gravityforms') . '</div>';
} else {
echo GFCommon::get_remote_message();
echo $raw_response['body'];
}
}
示例5: ensure_site_registered
public function ensure_site_registered()
{
if (!$this->is_site_registered()) {
$license_key_md5 = GFCommon::get_key();
if (empty($license_key_md5)) {
return false;
}
$result = $this->add_site($license_key_md5, true);
if (!$result || is_wp_error($result)) {
return false;
}
}
return array('site_key' => $this->get_site_key(), 'site_secret' => $this->get_site_secret());
}
示例6: cache_remote_message
public static function cache_remote_message()
{
//Getting version number
$key = GFCommon::get_key();
$body = "key={$key}";
$options = array('method' => 'POST', 'timeout' => 3, 'body' => $body);
$options['headers'] = array('Content-Type' => 'application/x-www-form-urlencoded; charset=' . get_option('blog_charset'), 'Content-Length' => strlen($body), 'User-Agent' => 'WordPress/' . get_bloginfo("version"), 'Referer' => get_bloginfo("url"));
$request_url = GRAVITY_MANAGER_URL . "/message.php?" . GFCommon::get_remote_request_params();
$raw_response = wp_remote_request($request_url, $options);
if (is_wp_error($raw_response) || 200 != $raw_response['response']['code']) {
$message = "";
} else {
$message = $raw_response['body'];
}
//validating that message is a valid Gravity Form message. If message is invalid, don't display anything
if (substr($message, 0, 10) != "<!--GFM-->") {
$message = "";
}
update_option("rg_gforms_message", $message);
}
示例7: upgrade_license
public static function upgrade_license()
{
$key = GFCommon::get_key();
$body = "key={$key}";
$options = array('method' => 'POST', 'timeout' => 3, 'body' => $body);
$options['headers'] = array('Content-Type' => 'application/x-www-form-urlencoded; charset=' . get_option('blog_charset'), 'Content-Length' => strlen($body), 'User-Agent' => 'WordPress/' . get_bloginfo('version'), 'Referer' => get_bloginfo('url'));
$raw_response = GFCommon::post_to_manager('api.php', 'op=upgrade_message&key=' . GFCommon::get_key(), $options);
if (is_wp_error($raw_response) || 200 != $raw_response['response']['code']) {
$message = '';
} else {
$message = $raw_response['body'];
}
//validating that message is a valid Gravity Form message. If message is invalid, don't display anything
if (substr($message, 0, 10) != '<!--GFM-->') {
$message = '';
}
echo $message;
exit;
}
示例8: upgrade_license
public static function upgrade_license()
{
check_ajax_referer('gf_upgrade_license', 'gf_upgrade_license');
$key = GFCommon::get_key();
$body = "key={$key}";
$options = array('method' => 'POST', 'timeout' => 3, 'body' => $body);
$options['headers'] = array('Content-Type' => 'application/x-www-form-urlencoded; charset=' . get_option('blog_charset'), 'Content-Length' => strlen($body), 'User-Agent' => 'WordPress/' . get_bloginfo("version"), 'Referer' => get_bloginfo("url"));
$request_url = GRAVITY_MANAGER_URL . "/api.php?op=upgrade_message&key=" . GFCommon::get_key();
$raw_response = wp_remote_request($request_url, $options);
if (is_wp_error($raw_response) || 200 != $raw_response['response']['code']) {
$message = "";
} else {
$message = $raw_response['body'];
}
//validating that message is a valid Gravity Form message. If message is invalid, don't display anything
if (substr($message, 0, 10) != "<!--GFM-->") {
$message = "";
}
echo $message;
exit;
}
示例9: get_key
private function get_key()
{
if ($this->_is_gravityforms_supported) {
return GFCommon::get_key();
} else {
return "";
}
}
示例10: get_key
private function get_key()
{
if (GFAddOn::is_gravityforms_supported($this->_min_gravityforms_version)) {
return GFCommon::get_key();
} else {
return "";
}
}
示例11: display_changelog
public static function display_changelog()
{
if ($_REQUEST["plugin"] != "gravityforms") {
return;
}
$key = GFCommon::get_key();
$body = "key={$key}";
$options = array('method' => 'POST', 'timeout' => 3, 'body' => $body);
$options['headers'] = array('Content-Type' => 'application/x-www-form-urlencoded; charset=' . get_option('blog_charset'), 'Content-Length' => strlen($body), 'User-Agent' => 'WordPress/' . get_bloginfo("version"), 'Referer' => get_bloginfo("url"));
$raw_response = wp_remote_request(GRAVITY_MANAGER_URL . "/changelog.php?" . GFCommon::get_remote_request_params(), $options);
if (is_wp_error($raw_response) || 200 != $raw_response['response']['code']) {
$page_text = __("Oops!! Something went wrong.<br/>Please try again or <a href='http://www.gravityforms.com'>contact us</a>.", 'gravityforms');
} else {
$page_text = $raw_response['body'];
if (substr($page_text, 0, 10) != "<!--GFM-->") {
$page_text = "";
}
}
echo stripslashes($page_text);
exit;
}