* global instances from clashing with instances in other plugins.
*/
$vprefix = str_replace('-', '_', GLM_SERVERSTATS_PLUGIN_SLUG);
-define('GLM_SERVERSTATS_PREFIX', $vprefix.'_');
+define('GLM_SERVERSTATS_PLUGIN_PREFIX', $vprefix.'_');
// URLs
define('GLM_SERVERSTATS_SITE_BASE_URL', home_url('/') );
define('GLM_SERVERSTATS_PLUGIN_MODEL_PATH', GLM_SERVERSTATS_PLUGIN_PATH.'/models');
define('GLM_SERVERSTATS_PLUGIN_VIEW_PATH', GLM_SERVERSTATS_PLUGIN_PATH.'/views');
+// Update Server
+define('GLM_SERVERSTATS_PLUGIN_UPDATE_SERVER', 'http://www.gaslightmedia.com/update_server');
\ No newline at end of file
}
-
/*
* Plugin Update Support - uses Gaslight Media update server
*/
-require GLM_SERVERSTATS_PLUGIN_LIB_PATH.'/opentools-update-checker/opentools-update-checker.php';
-${GLM_SERVERSTATS_PREFIX."updateChecker"} = new OpenToolsPluginUpdateChecker(
- 'http://www.gaslightmedia.com/update_server/?action=get_metadata&slug='.GLM_SERVERSTATS_PLUGIN_SLUG,
+require_once GLM_SERVERSTATS_PLUGIN_LIB_PATH.'/opentools-update-checker/opentools-update-checker.php';
+${GLM_SERVERSTATS_PLUGIN_PREFIX."updateChecker"} = new OpenToolsPluginUpdateChecker(
+ GLM_SERVERSTATS_PLUGIN_UPDATE_SERVER.'/?action=get_metadata&slug='.GLM_SERVERSTATS_PLUGIN_SLUG,
__FILE__,
GLM_SERVERSTATS_PLUGIN_SLUG
);
-
-${GLM_SERVERSTATS_PREFIX."updateChecker"}->declareCredentials(array(
- 'license_key' => __('License Key:')
+${GLM_SERVERSTATS_PLUGIN_PREFIX."updateChecker"}->declareCredentials(array(
+ 'license_key' => __('License Key:')
));
-
-
/*
*
* Activate and Deactivate hooks
/**
* OpenTools Update Check Admin JS
*/
+var credentialsRowDisplayed = [];
var showUpdateCredentialsRow = function (btn) {
- if (showUpdateCredentialsRow.credentialsRowDisplayed) {
- return;
- }
- showUpdateCredentialsRow.credentialsRowDisplayed = true;
var ajaxurl = jQuery(btn).data('ajaxurl');
var slug = jQuery(btn).data("slug");
var nonce = jQuery(btn).data("nonce");
+
+ if (credentialsRowDisplayed[slug]) {
+ return false;
+ }
+ credentialsRowDisplayed[slug] = true;
var ajaxargs = {
type: "POST",
url: ajaxurl,
data: {
- action: 'getUpdateCredentialsRow',
+ action: 'getUpdateCredentialsRow_' + slug,
slug: slug,
_ajax_nonce: nonce
},
success: function ( json ) {
jQuery(btn).closest('tr').after(json['row']);
},
- error: function() { },
- complete: function() { },
+ error: function() { },
+ complete: function() { },
};
jQuery.ajax(ajaxargs);
return false;
};
var submitUpdateCredentials = function(btn) {
+
var ajaxurl = jQuery(btn).data('ajaxurl');
var slug = jQuery(btn).data("slug");
var nonce = jQuery(btn).data("nonce");
var tr = jQuery(btn).closest('tr');
var data = {
- action: 'submitUpdateCredentials',
+ action: 'submitUpdateCredentials_' + slug,
slug: slug,
_ajax_nonce: nonce,
};
// add_filter('plugin_row_meta', array($this, 'displayUpdateCredentialsLink'), 9, 2);
add_filter('plugin_action_links_'.$this->pluginFile, array($this, 'displayUpdateCredentialsLink'), 9, 2);
- add_action( 'wp_ajax_getUpdateCredentialsRow', array( &$this, 'getUpdateCredentialsRow') );
- add_action( 'wp_ajax_submitUpdateCredentials', array( &$this, 'submitUpdateCredentials') );
+ add_action( 'wp_ajax_getUpdateCredentialsRow_'.$this->slug, array( &$this, 'getUpdateCredentialsRow') );
+ add_action( 'wp_ajax_submitUpdateCredentials_'.$this->slug, array( &$this, 'submitUpdateCredentials') );
}
protected function getCredentials($slug)
*/
public function getUpdateCredentialsRow() {
$json = array('row' => '', 'message'=>'Unsuccessful');
-
$showCredentials = isset($_REQUEST['slug'])
&& $_REQUEST['slug'] == $this->slug
&& current_user_can('update_plugins')
&& check_ajax_referer('otup_enter_update_credentials');
$showCredentials = $showCredentials && !empty($this->credvars);
-
if ( $showCredentials && (is_network_admin() || !is_multisite() )) {
+
$slug = $this->slug;
if ( is_network_admin() ) {
$active_class = is_plugin_active_for_network( $this->pluginFile ) ? 'active': '';
$tr .= $credname . " <input type=\"text\" name=\"otup_update_credentials[$slug][$credkey]\" value=\"" . esc_attr($current_credentials[$credkey]) . "\"> ";
}
- $tr .= sprintf('<input type="submit" class="button otup_update_credentials_submit" onclick="return submitUpdateCredentials(this);" data-slug="%s" data-nonce="%s" data-ajaxurl="%s" data-credentialvars=\'%s\'>',
+// $tr .= sprintf('<input type="submit" class="button otup_update_credentials_submit" onclick="return submitUpdateCredentials(this);" data-slug="%s" data-nonce="%s" data-ajaxurl="%s" data-credentialvars=\'%s\'>',
+ $tr .= sprintf('<div class="button otup_update_credentials_submit" style="line-height: 1.2em; height: 1.5em;" onclick="return submitUpdateCredentials(this);" data-slug="%s" data-nonce="%s" data-ajaxurl="%s" data-credentialvars=\'%s\'>Update License Key</div>',
esc_attr($this->slug),
esc_attr(wp_create_nonce( 'otup_enter_update_credentials_'.$slug )),
esc_attr($this->ajaxurl),
msgstr "Vérifier les mises à jour"
#: plugin-update-checker.php:681
-msgid "This plugin is up to date."
+msgid "No plugin update available."
msgstr "Ce plugin est à jour."
#: plugin-update-checker.php:683
msgstr "Frissítés ellenőrzése"
#: plugin-update-checker.php:896
-msgid "This plugin is up to date."
+msgid "No plugin update available."
msgstr "Ez a plugin naprakész."
#: plugin-update-checker.php:898
msgstr ""
#: plugin-update-checker.php:896
-msgid "This plugin is up to date."
+msgid "No plugin update available."
msgstr ""
#: plugin-update-checker.php:898
//Try to parse the response\r
$status = $this->validateApiResponse($result);\r
$pluginInfo = null;\r
- if ( !is_wp_error($status) ){\r
+ if ( !is_wp_error($status)){\r
$pluginInfo = PluginInfo_3_1::fromJson($result['body']);\r
if ( $pluginInfo !== null ) {\r
$pluginInfo->filename = $this->pluginFile;\r
$pluginInfo->slug = $this->slug;\r
}\r
+\r
} else {\r
+ return false;\r
+ /* Not generating error at this time as this could simply be a bad or missing key submitted\r
$this->triggerError(\r
sprintf('The URL %s does not point to a valid plugin metadata file. ', $url)\r
. $status->get_error_message(),\r
E_USER_WARNING\r
);\r
+ */\r
}\r
\r
$pluginInfo = apply_filters('puc_request_info_result-'.$this->slug, $pluginInfo, $result);\r
if ( isset($_GET['puc_update_check_result'], $_GET['puc_slug']) && ($_GET['puc_slug'] == $this->slug) ) {\r
$status = strval($_GET['puc_update_check_result']);\r
if ( $status == 'no_update' ) {\r
- $message = __('This plugin is up to date.', 'plugin-update-checker');\r
+ $message = __('No plugin update available.', 'plugin-update-checker');\r
} else if ( $status == 'update_available' ) {\r
$message = __('A new version of this plugin is available.', 'plugin-update-checker');\r
} else {\r