Skip to content

Commit

Permalink
Merge branch 'release/v2.4.3' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
qriouslad committed May 22, 2023
2 parents d38507e + 4f68d99 commit c297d20
Show file tree
Hide file tree
Showing 16 changed files with 65 additions and 68 deletions.
19 changes: 14 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ Contributors: qriouslad
Donate link: https://bowo.io/vi-sp-rdm
Tags: php variables, variable dump, debug, developer
Requires at least: 4.8
Tested up to: 6.2
Stable tag: 2.4.0
Tested up to: 6.2.2
Stable tag: 2.4.3
Requires PHP: 5.6
License: GPLv2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Expand Down Expand Up @@ -66,8 +66,6 @@ If you need something more versatile for larger, more complex projects, these [P

[Click here](https://bowo.io/vi-pro-scrsht-rdm) to see a screenshot of the [PRO version](https://bowo.io/vi-up-hstd-dsc) or see below in the screenshots section.

To upgrade, simply go to Variable Inspector dashboard in wp-admin and hit the Upgrade button. Or, go to the [PRO version's description page](https://bowo.io/vi-up-hstd-dsc) and purchase the PRO version there.

### Check These Out Too

* [Admin and Site Enhancements](https://wordpress.org/plugins/admin-site-enhancements/) helps you to easily enhance various admin workflows and site aspects while replacing multiple plugins doing it.
Expand All @@ -94,7 +92,18 @@ Variable Inspector was built with: [WordPress Plugin Boilerplate](https://github

### Sponsor Variable Inspector

If this plugin has been useful for your **personal project(s), paid dev work, client site(s) and or agency's workflow**, please kindly consider **sponsoring from as little as USD 1** ([monthly](https://bowo.io/vi-sp-gth-chnlg) or [one-time](https://bowo.io/vi-sp-ppl-chnlg)). This helps ensure you're going to continue seeing **new features and/or fixes**, hopefully for years to come. Thank you!
If this plugin has been useful for your **personal project(s), paid dev work, client site(s) and or agency's workflow**, please kindly consider **sponsoring from as little as USD 1** ([monthly](https://bowo.io/vi-sp-gth-chnlg) or [one-time](https://bowo.io/vi-sp-ppl-chnlg)). You can also choose to [upgrade to the PRO version](https://bowo.io/vi-up-chnlg). Thank you!

### 2.4.3 (2023.05.22)

* Add handling for null type / value
* Added link to changelog in footer
* [PRO] Feedback link in header no longer links to wordpress.org support forum. It now links to the contact form within wp-admin.
* [PRO] Fixed: space in vis() inspector's second parameter no longer causes JS error and prevents variable content from loading. This is handled by converting space to underscore, e.g. 'the variable' will show up as $the_variable in the inspection result accordion.
* [PRO] Fixed: special characters inside the 'notes' parameter in vi() and vis() inspectors are now handled better and won't cause JS error.
* [PRO] Fixed: JS error "Maximum call stack size exceeded" when performing ajax actions, e.g. generate sample results, refrehs, etc.
* [PRO] kint viewer: now will properly show $variable_name when getting the access path info of each node in the inspection result
* [PRO] Make the style of NULL results uniform across var_dump_r, var_dump_tree and kint viewers

### 2.4.0 (2023.05.15)

Expand Down
33 changes: 18 additions & 15 deletions admin/class-variable-inspector-admin.php
Original file line number Diff line number Diff line change
Expand Up @@ -239,12 +239,7 @@ public function vi_generate_sample_results()
// $backtrace = debug_backtrace();
// do_action( 'inspect', [ 'backtrace', $backtrace, __FILE__, __LINE__ ] );
global $current_user, $wp_roles, $wp_post_types ;
do_action( 'inspect', [
'wp_post_types',
$wp_post_types,
__FILE__,
__LINE__
] );
// do_action( 'inspect', [ 'wp_post_types', $wp_post_types, __FILE__, __LINE__ ] );
// do_action( 'inspect', [ 'wp_roles', $wp_roles, __FILE__, __LINE__ ] );
do_action( 'inspect', [
'current_user',
Expand Down Expand Up @@ -386,6 +381,10 @@ public function vi_inspection_results()
case 'object':
$variable_content = (object) maybe_unserialize( $variable['content'] );
break;
case 'NULL':
$variable_type = 'null';
$variable_content = NULL;
break;
}
$variable_category = ( $variable['category'] ? $variable['category'] : 'gray' );
$variable_notes = $variable['extra'];
Expand Down Expand Up @@ -419,7 +418,7 @@ public function vi_inspection_results()
$output .= '<div class="accordion inspection-accordion">';
$output .= '<div class="accordion__control"><span class="variable-type">' . esc_html( $variable_type ) . '</span><span class="variable-name">' . esc_html( $variable_name ) . '</span><span class="variable-notes">' . esc_html( $variable_notes ) . '</span><span class="accordion__indicator"></span></div>';
$output .= '
<div id="' . esc_html( $identifier ) . '" class="accordion__panel">
<div id="' . esc_attr( $identifier ) . '" class="accordion__panel">
<div class="functions">
<a class="item" data-tab="var_export">var_export</a>' . $separator . '
<a class="item" data-tab="var_dump">var_dump</a>' . $separator . '
Expand Down Expand Up @@ -497,16 +496,19 @@ public function vi_create_main_page()

<?php
// Free version code
// Free version code
?>
<a href="https://bowo.io/vi-fdbk" target="_blank" class="vi-header-action">✚
<?php
esc_html_e( 'Feedback', 'variable-inspector' );
?>
</a>
<?php
?>

<a href="https://bowo.io/vi-rvw" target="_blank" class="vi-header-action"><span>★</span>
<?php
esc_html_e( 'Review', 'variable-inspector' );
?>
</a>
<a href="https://bowo.io/vi-fdbk" target="_blank" class="vi-header-action">✚
<?php
esc_html_e( 'Feedback', 'variable-inspector' );
?>
</a>

Expand Down Expand Up @@ -600,7 +602,7 @@ public function vi_create_main_page()
public function vi_footer_text()
{
?>
<a href="https://bowo.io/vi-dotorg" target="_blank">Variable Inspector</a> is on <a href="https://bowo.io/vi-gthb" target="_blank">github</a>
<a href="https://bowo.io/vi-dotorg" target="_blank">Variable Inspector</a> is on <a href="https://bowo.io/vi-gthb" target="_blank">github</a> | <a href="https://bowo.io/vi-chnglg" target="_blank">View changelog</a>
<?php
}

Expand All @@ -609,9 +611,10 @@ public function vi_footer_text()
*
* @since 2.0.0
*/
public function vi_footer_version_text()
public function vi_footer_version_text( $content )
{
return 'Also by Bowo &#8594; <a href="https://bowo.io/vi-bw" target="_blank">WordPress Newsboard</a>: The latest from 100+ sources';
$content = 'Also by Bowo &#8594; <a href="https://bowo.io/vi-bw" target="_blank">WordPress Newsboard</a>: The latest from 100+ sources';
return $content;
}

/**
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
77 changes: 31 additions & 46 deletions admin/js/variable-inspector-admin.js
Original file line number Diff line number Diff line change
Expand Up @@ -81,44 +81,7 @@

}

function maybeHideColorFilter() {
var greenVarsCount = $('.inspection-result[data-color=green]').length;
var orangeVarsCount = $('.inspection-result[data-color=orange]').length;
var redVarsCount = $('.inspection-result[data-color=red]').length;
var purpleVarsCount = $('.inspection-result[data-color=purple]').length;
var blueVarsCount = $('.inspection-result[data-color=blue]').length;

if ( greenVarsCount > 0 ) {
$('#green-filter').show();
} else {
$('#green-filter').hide();
}
if ( orangeVarsCount > 0 ) {
$('#orange-filter').show();
} else {
$('#orange-filter').hide();
}
if ( redVarsCount > 0 ) {
$('#red-filter').show();
} else {
$('#red-filter').hide();
}
if ( purpleVarsCount > 0 ) {
$('#purple-filter').show();
} else {
$('#purple-filter').hide();
}
if ( blueVarsCount > 0 ) {
$('#blue-filter').show();
} else {
$('#blue-filter').hide();
}
if ( greenVarsCount > 0 || orangeVarsCount > 0 || redVarsCount > 0 || purpleVarsCount > 0 || blueVarsCount > 0 ) {
$('#gray-filter').show();
} else {
$('#gray-filter').hide();
}
}


$(document).ready( function() {

Expand Down Expand Up @@ -233,6 +196,19 @@
});


updateResultsCount();
}, 2500);

}

},
error:function(errorThrown) {
console.log(errorThrown);
}
});

});
/*! </fs_premium_only> */

// Refresh results

Expand All @@ -248,8 +224,8 @@
viewer = $('#results_viewer').find("option:selected").attr('value');

setTimeout(function() {
maybeHideColorFilter();
updateResultsCount();

setViewer( viewer );
$('#results-spinner').hide();
}, 3000);
Expand Down Expand Up @@ -281,7 +257,7 @@
$('#results-spinner').hide();
$('.color-filters').removeClass('color-chosen');
$('.color-filter').removeClass('color-active');
maybeHideColorFilter();

updateResultsCount();
}

Expand Down Expand Up @@ -333,9 +309,19 @@
close: 'slide:top'
}
});

// Invoke tracking of link clicks to track how man times the "Sponsor" button is clicked

$('#generate-sample-results, #generate-sample-results-premium, #clear-results').click( function() {
$.ajax({
url: 'https://bowo.io/vi-rf-btn',
method: 'GET',
dataType: 'jsonp',
crossDomain: true
// success: function(response) {
// console.log(response);
// }
});
});

$('#plugin-sponsor').click( function() {
$.ajax({
url: 'https://bowo.io/vi-sp-btn',
Expand All @@ -348,8 +334,6 @@
});
});

// Invoke tracking of link clicks to track how man times the "Upgrade" button is clicked

$('#plugin-upgrade').click( function() {
$.ajax({
url: 'https://bowo.io/vi-up-btn-trk',
Expand Down Expand Up @@ -381,8 +365,9 @@ function AjaxAutoLoad(selector){(function($){
$.ajax({
type: "GET",
url: window.location.href
}).done(function(res){
$(selector).html( $(res).find(selector).html() );
}).done(function(result){
var newResults = $(result).find(selector).html();
$(selector).html( newResults );

$(".accordion__control").click(function() {
$("#auto_load").prop( "checked", false );
Expand Down
4 changes: 2 additions & 2 deletions variable-inspector.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
* Plugin Name: Variable Inspector
* Plugin URI: https://wordpress.org/plugins/variable-inspector/
* Description: Easily dump and centrally inspect your PHP variables for convenient debugging.
* Version: 2.4.0
* Version: 2.4.3
* Author: Bowo
* Author URI: https://bowo.io
* License: GPL-2.0+
Expand All @@ -35,7 +35,7 @@
* Start at version 1.0.0 and use SemVer - https://semver.org
* Rename this for your plugin and update it as you release new versions.
*/
define( 'VARIABLE_INSPECTOR_VERSION', '2.4.0' );
define( 'VARIABLE_INSPECTOR_VERSION', '2.4.3' );

/**
* The code that runs during plugin activation.
Expand Down

0 comments on commit c297d20

Please sign in to comment.