Bump the version number in Debug Bar HTML.

Technically, this is not necessary because that part of the library hasn't really changed, but let's use the same version number everywhere for consistency.
This commit is contained in:
Yahnis Elsts 2022-10-09 00:58:18 +03:00
parent 4b6127f0f2
commit 2dbb2baff1
5 changed files with 15 additions and 15 deletions

View File

@ -26,7 +26,7 @@ if ( !class_exists(Extension::class, false) ):
add_filter('debug_bar_panels', array($this, 'addDebugBarPanel'));
add_action('debug_bar_enqueue_scripts', array($this, 'enqueuePanelDependencies'));
add_action('wp_ajax_puc_v4_debug_check_now', array($this, 'ajaxCheckNow'));
add_action('wp_ajax_puc_v5_debug_check_now', array($this, 'ajaxCheckNow'));
}
/**
@ -47,17 +47,17 @@ if ( !class_exists(Extension::class, false) ):
*/
public function enqueuePanelDependencies() {
wp_enqueue_style(
'puc-debug-bar-style-v4',
'puc-debug-bar-style-v5',
$this->getLibraryUrl("/css/puc-debug-bar.css"),
array('debug-bar'),
'20171124'
'20221008'
);
wp_enqueue_script(
'puc-debug-bar-js-v4',
'puc-debug-bar-js-v5',
$this->getLibraryUrl("/js/debug-bar.js"),
array('jquery'),
'20201209'
'20221008'
);
}
@ -157,7 +157,7 @@ if ( !class_exists(Extension::class, false) ):
public function removeHooks() {
remove_filter('debug_bar_panels', array($this, 'addDebugBarPanel'));
remove_action('debug_bar_enqueue_scripts', array($this, 'enqueuePanelDependencies'));
remove_action('wp_ajax_puc_v4_debug_check_now', array($this, 'ajaxCheckNow'));
remove_action('wp_ajax_puc_v5_debug_check_now', array($this, 'ajaxCheckNow'));
}
/**

View File

@ -23,7 +23,7 @@ if ( !class_exists(Panel::class, false) && class_exists('Debug_Bar_Panel', false
public function render() {
printf(
'<div class="puc-debug-bar-panel-v4" id="%1$s" data-slug="%2$s" data-uid="%3$s" data-nonce="%4$s">',
'<div class="puc-debug-bar-panel-v5" id="%1$s" data-slug="%2$s" data-uid="%3$s" data-nonce="%4$s">',
esc_attr($this->updateChecker->getUniqueName('debug-bar-panel')),
esc_attr($this->updateChecker->slug),
esc_attr($this->updateChecker->getUniqueName('uid')),

View File

@ -13,7 +13,7 @@ if ( !class_exists(PluginExtension::class, false) ):
public function __construct($updateChecker) {
parent::__construct($updateChecker, PluginPanel::class);
add_action('wp_ajax_puc_v4_debug_request_info', array($this, 'ajaxRequestInfo'));
add_action('wp_ajax_puc_v5_debug_request_info', array($this, 'ajaxRequestInfo'));
}
/**

View File

@ -1,4 +1,4 @@
.puc-debug-bar-panel-v4 pre {
.puc-debug-bar-panel-v5 pre {
margin-top: 0;
}

View File

@ -2,7 +2,7 @@ jQuery(function($) {
function runAjaxAction(button, action) {
button = $(button);
var panel = button.closest('.puc-debug-bar-panel-v4');
var panel = button.closest('.puc-debug-bar-panel-v5');
var responseBox = button.closest('td').find('.puc-ajax-response');
responseBox.text('Processing...').show();
@ -20,13 +20,13 @@ jQuery(function($) {
);
}
$('.puc-debug-bar-panel-v4 input[name="puc-check-now-button"]').on('click', function() {
runAjaxAction(this, 'puc_v4_debug_check_now');
$('.puc-debug-bar-panel-v5 input[name="puc-check-now-button"]').on('click', function() {
runAjaxAction(this, 'puc_v5_debug_check_now');
return false;
});
$('.puc-debug-bar-panel-v4 input[name="puc-request-info-button"]').on('click', function() {
runAjaxAction(this, 'puc_v4_debug_request_info');
$('.puc-debug-bar-panel-v5 input[name="puc-request-info-button"]').on('click', function() {
runAjaxAction(this, 'puc_v5_debug_request_info');
return false;
});
@ -34,7 +34,7 @@ jQuery(function($) {
// Debug Bar uses the panel class name as part of its link and container IDs. This means we can
// end up with multiple identical IDs if more than one plugin uses the update checker library.
// Fix it by replacing the class name with the plugin slug.
var panels = $('#debug-menu-targets').find('.puc-debug-bar-panel-v4');
var panels = $('#debug-menu-targets').find('.puc-debug-bar-panel-v5');
panels.each(function() {
var panel = $(this);
var uid = panel.data('uid');