From 9defdfc3592f514e03dd378217284bdc7394a5bd Mon Sep 17 00:00:00 2001 From: Marius Jensen Date: Fri, 16 Aug 2019 14:09:06 +0200 Subject: [PATCH 1/6] Check that issues for the health check page are valid before we try using them, avoids a fatal error preventing the tests from finishing. --- assets/javascript/site-status/site-status-tests.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/assets/javascript/site-status/site-status-tests.js b/assets/javascript/site-status/site-status-tests.js index 1b9ff4f2..90b42fb2 100644 --- a/assets/javascript/site-status/site-status-tests.js +++ b/assets/javascript/site-status/site-status-tests.js @@ -11,6 +11,10 @@ jQuery( document ).ready( function( $ ) { } ); function AppendIssue( issue ) { + if ( typeof issue === 'undefined' || typeof issue.status === 'undefined' ) { + return; + } + const template = wp.template( 'health-check-issue' ), issueWrapper = $( '#health-check-issues-' + issue.status ); From 2dc19733108b7e775006b2ceafd77116fb22c26d Mon Sep 17 00:00:00 2001 From: Marius Jensen Date: Tue, 27 Aug 2019 23:56:50 +0200 Subject: [PATCH 2/6] Check SQL versions via queries, not native functions, as MariaDB version hacks cause invalid responses. --- src/includes/class-health-check-debug-data.php | 2 +- src/includes/class-health-check-site-status.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/includes/class-health-check-debug-data.php b/src/includes/class-health-check-debug-data.php index 1a0c7e16..51fb8577 100644 --- a/src/includes/class-health-check-debug-data.php +++ b/src/includes/class-health-check-debug-data.php @@ -747,7 +747,7 @@ static function debug_data() { $extension = null; } - $server = $wpdb->db_version(); + $server = $wpdb->get_var( 'SELECT VERSION()' ); if ( isset( $wpdb->use_mysqli ) && $wpdb->use_mysqli ) { $client_version = $wpdb->dbh->client_info; diff --git a/src/includes/class-health-check-site-status.php b/src/includes/class-health-check-site-status.php index c8b50f06..8d826263 100644 --- a/src/includes/class-health-check-site-status.php +++ b/src/includes/class-health-check-site-status.php @@ -52,7 +52,7 @@ private function prepare_sql_data() { $mysql_server_type = mysql_get_server_info( $wpdb->dbh ); } - $this->mysql_server_version = $wpdb->db_version(); + $this->mysql_server_version = $wpdb->get_var( 'SELECT VERSION()' ); } $this->health_check_mysql_rec_version = '5.6'; From 229cf91b2db72ded9a9fd51c7264d4a0928f219f Mon Sep 17 00:00:00 2001 From: Marius Jensen Date: Thu, 29 Aug 2019 22:30:58 +0200 Subject: [PATCH 3/6] Make sure our fallback is an object, not an array, to avoid throwing notices, and also provide more useful directions for first-time users. --- .../class-health-check-dashboard-widget.php | 33 +++++++++++++++---- 1 file changed, 27 insertions(+), 6 deletions(-) diff --git a/src/includes/class-health-check-dashboard-widget.php b/src/includes/class-health-check-dashboard-widget.php index dcdeaf75..501f8342 100644 --- a/src/includes/class-health-check-dashboard-widget.php +++ b/src/includes/class-health-check-dashboard-widget.php @@ -20,12 +20,12 @@ function dashboard_setup() { } function widget_render() { - $issue_counts = get_transient( 'health-check-site-status-result' ); + $get_issues = get_transient( 'health-check-site-status-result' ); - if ( false !== $issue_counts ) { - $issue_counts = json_decode( $issue_counts ); + if ( false !== $get_issues ) { + $issue_counts = json_decode( $get_issues ); } else { - $issue_counts = array( + $issue_counts = (object) array( 'good' => 0, 'recommended' => 0, 'critical' => 0, @@ -42,10 +42,30 @@ function widget_render() {
- + + + + +
+ +

+ +

+ +

+ Visit the Site Health page to gather information on about your site..', 'health-check' ), + esc_url( admin_url( 'tools.php?page=health-check' ) ) + ); + ?> +

+ +

critical > 0 ) : ?> @@ -55,8 +75,9 @@ function widget_render() {

+ - 0 ) : ?> + 0 && false !== $get_issues ) : ?>

Date: Fri, 30 Aug 2019 10:36:11 +0200 Subject: [PATCH 4/6] Fix indentation warnings in PHPCS --- .../class-health-check-dashboard-widget.php | 38 +++++++++---------- 1 file changed, 19 insertions(+), 19 deletions(-) diff --git a/src/includes/class-health-check-dashboard-widget.php b/src/includes/class-health-check-dashboard-widget.php index 501f8342..2fe4d4f3 100644 --- a/src/includes/class-health-check-dashboard-widget.php +++ b/src/includes/class-health-check-dashboard-widget.php @@ -42,30 +42,30 @@ function widget_render() {

- - - - - + + + + +
-

- -

+

+ +

-

- Visit the Site Health page to gather information on about your site..', 'health-check' ), - esc_url( admin_url( 'tools.php?page=health-check' ) ) - ); - ?> -

+

+ Visit the Site Health page to gather information on about your site..', 'health-check' ), + esc_url( admin_url( 'tools.php?page=health-check' ) ) + ); + ?> +

- +

critical > 0 ) : ?> @@ -75,7 +75,7 @@ function widget_render() {

- + 0 && false !== $get_issues ) : ?>

From 339de474a39d497aa8b98a856241e7d89ace5029 Mon Sep 17 00:00:00 2001 From: Ulrich Pogson Date: Thu, 26 Sep 2019 15:21:59 +0200 Subject: [PATCH 5/6] Internationalize strings (#361) --- .../tools/class-health-check-plugin-compatibility.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/includes/tools/class-health-check-plugin-compatibility.php b/src/includes/tools/class-health-check-plugin-compatibility.php index edc32831..60cd4be7 100644 --- a/src/includes/tools/class-health-check-plugin-compatibility.php +++ b/src/includes/tools/class-health-check-plugin-compatibility.php @@ -20,10 +20,10 @@ public function tab_content() { - - - - + + + + From 7a400a6ead8ded8d7e2baa008e06bf7314f8c8c4 Mon Sep 17 00:00:00 2001 From: Marius Jensen Date: Sat, 28 Sep 2019 12:47:52 +0200 Subject: [PATCH 6/6] Version bump to 1.4.1 for release --- docs/plugin/readme.txt | 7 ++++++- src/health-check.php | 4 ++-- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/docs/plugin/readme.txt b/docs/plugin/readme.txt index f2952f3a..f014ec02 100644 --- a/docs/plugin/readme.txt +++ b/docs/plugin/readme.txt @@ -4,7 +4,7 @@ Contributors: wordpressdotorg, westi, pento, Clorith Requires at least: 4.0 Requires PHP: 5.2 Tested up to: 5.2 -Stable tag: 1.4.0 +Stable tag: 1.4.1 License: GPLv2 License URI: https://www.gnu.org/licenses/gpl-2.0.html @@ -49,6 +49,11 @@ At this time, the plugin has been tested with every version of PHP from 5.2 thro == Changelog == += v1.4.1 = +* Fixed SQL version checks for various MariaDB installs. +* Fixed a warning being generated in logfiles for first-time users with no existing Site Health history. +* Added missing translation function for the new PHP compatibility tool. + = v1.4.0 = * Fix a bug when viewing the Site Health page if enabling the Health Check plugin in troubleshooting mode. * Fix an inconsistency with how database versions are checked. diff --git a/src/health-check.php b/src/health-check.php index 3fc9b34c..95d2f7a2 100644 --- a/src/health-check.php +++ b/src/health-check.php @@ -9,7 +9,7 @@ * Plugin URI: https://wordpress.org/plugins/health-check/ * Description: Checks the health of your WordPress install. * Author: The WordPress.org community - * Version: 1.4.0 + * Version: 1.4.1 * Author URI: https://wordpress.org/plugins/health-check/ * Text Domain: health-check */ @@ -35,7 +35,7 @@ define( 'HEALTH_CHECK_MYSQL_REC_VERSION', '5.6' ); // Set the plugin version. -define( 'HEALTH_CHECK_PLUGIN_VERSION', '1.4.0' ); +define( 'HEALTH_CHECK_PLUGIN_VERSION', '1.4.1' ); // Set the plugin file. define( 'HEALTH_CHECK_PLUGIN_FILE', __FILE__ );
PluginVersionMinimum PHPHighest supported PHP