Version Description
Download this release
Release Info
Developer | Clorith |
Plugin | Health Check |
Version | 1.1.2 |
Comparing to | |
See all releases |
Code changes from version 1.1.1 to 1.1.2
- assets/css/health-check.css +15 -3
- assets/mu-plugin/health-check-troubleshooting-mode.php +31 -4
- health-check.php +2 -2
- readme.txt +7 -1
assets/css/health-check.css
CHANGED
@@ -214,9 +214,9 @@ body.dashboard_page_health-check #health-check-diff-modal-close-ref {
|
|
214 |
/* Modal styles */
|
215 |
.health-check-modal {
|
216 |
display: none;
|
217 |
-
position:
|
218 |
z-index: 1000;
|
219 |
-
padding-top:
|
220 |
left: 0;
|
221 |
top: 0;
|
222 |
width: 100%;
|
@@ -226,6 +226,12 @@ body.dashboard_page_health-check #health-check-diff-modal-close-ref {
|
|
226 |
background-color: rgba(0, 0, 0, 0.4);
|
227 |
}
|
228 |
|
|
|
|
|
|
|
|
|
|
|
|
|
229 |
.health-check-modal.show {
|
230 |
display: block;
|
231 |
}
|
@@ -235,7 +241,13 @@ body.dashboard_page_health-check #health-check-diff-modal-close-ref {
|
|
235 |
margin: auto;
|
236 |
padding: 20px;
|
237 |
border: 1px solid #888;
|
238 |
-
width:
|
|
|
|
|
|
|
|
|
|
|
|
|
239 |
}
|
240 |
|
241 |
.health-check-modal .modal-content .modal-close {
|
214 |
/* Modal styles */
|
215 |
.health-check-modal {
|
216 |
display: none;
|
217 |
+
position: absolute;
|
218 |
z-index: 1000;
|
219 |
+
padding-top: 50px;
|
220 |
left: 0;
|
221 |
top: 0;
|
222 |
width: 100%;
|
226 |
background-color: rgba(0, 0, 0, 0.4);
|
227 |
}
|
228 |
|
229 |
+
@media all and (min-width: 1024px) {
|
230 |
+
.health-check-modal {
|
231 |
+
padding-top: 100px;
|
232 |
+
}
|
233 |
+
}
|
234 |
+
|
235 |
.health-check-modal.show {
|
236 |
display: block;
|
237 |
}
|
241 |
margin: auto;
|
242 |
padding: 20px;
|
243 |
border: 1px solid #888;
|
244 |
+
width: 90%;
|
245 |
+
}
|
246 |
+
|
247 |
+
@media all and (min-width: 1024px) {
|
248 |
+
.health-check-modal .modal-content {
|
249 |
+
width: 30%;
|
250 |
+
}
|
251 |
}
|
252 |
|
253 |
.health-check-modal .modal-content .modal-close {
|
assets/mu-plugin/health-check-troubleshooting-mode.php
CHANGED
@@ -2,7 +2,7 @@
|
|
2 |
/*
|
3 |
Plugin Name: Health Check Troubleshooting Mode
|
4 |
Description: Conditionally disabled themes or plugins on your site for a given session, used to rule out conflicts during troubleshooting.
|
5 |
-
Version: 1.4
|
6 |
*/
|
7 |
|
8 |
if ( ! defined( 'ABSPATH' ) ) {
|
@@ -14,6 +14,8 @@ class Health_Check_Troubleshooting_MU {
|
|
14 |
private $default_theme = true;
|
15 |
private $active_plugins = array();
|
16 |
private $current_theme;
|
|
|
|
|
17 |
|
18 |
private $available_query_args = array(
|
19 |
'health-check-disable-plugins',
|
@@ -172,8 +174,10 @@ class Health_Check_Troubleshooting_MU {
|
|
172 |
}
|
173 |
|
174 |
printf(
|
175 |
-
'<div class="notice notice-warning"><p>%s</p></div>',
|
176 |
-
esc_html__( 'Plugin actions are not available while in Troubleshooting Mode.', 'health-check' )
|
|
|
|
|
177 |
);
|
178 |
}
|
179 |
|
@@ -375,11 +379,29 @@ class Health_Check_Troubleshooting_MU {
|
|
375 |
* @return string Theme slug to be perceived as the active theme.
|
376 |
*/
|
377 |
function health_check_troubleshoot_theme( $theme ) {
|
|
|
|
|
|
|
|
|
|
|
378 |
// Check if overrides are triggered if not break out.
|
379 |
if ( ! $this->override_theme() ) {
|
380 |
return $theme;
|
381 |
}
|
382 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
383 |
// Check if a default theme exists, and if so use it as a default.
|
384 |
$default_theme = $this->has_default_theme();
|
385 |
if ( $default_theme ) {
|
@@ -491,6 +513,11 @@ class Health_Check_Troubleshooting_MU {
|
|
491 |
return;
|
492 |
}
|
493 |
|
|
|
|
|
|
|
|
|
|
|
494 |
// Ensure the theme functions are available to us on every page.
|
495 |
include_once( trailingslashit( ABSPATH ) . 'wp-admin/includes/theme.php' );
|
496 |
|
@@ -503,7 +530,7 @@ class Health_Check_Troubleshooting_MU {
|
|
503 |
$allowed_plugins = get_option( 'health-check-allowed-plugins', array() );
|
504 |
|
505 |
// Add a link to manage plugins if there are more than 20 set to be active.
|
506 |
-
if ( count( $
|
507 |
$wp_menu->add_node( array(
|
508 |
'id' => 'health-check-plugins',
|
509 |
'title' => esc_html__( 'Manage active plugins', 'health-check' ),
|
2 |
/*
|
3 |
Plugin Name: Health Check Troubleshooting Mode
|
4 |
Description: Conditionally disabled themes or plugins on your site for a given session, used to rule out conflicts during troubleshooting.
|
5 |
+
Version: 1.4.1
|
6 |
*/
|
7 |
|
8 |
if ( ! defined( 'ABSPATH' ) ) {
|
14 |
private $default_theme = true;
|
15 |
private $active_plugins = array();
|
16 |
private $current_theme;
|
17 |
+
private $current_theme_details;
|
18 |
+
private $self_fetching_theme = false;
|
19 |
|
20 |
private $available_query_args = array(
|
21 |
'health-check-disable-plugins',
|
174 |
}
|
175 |
|
176 |
printf(
|
177 |
+
'<div class="notice notice-warning"><p>%s</p><p>%s</p><p>%s</p></div>',
|
178 |
+
esc_html__( 'Plugin actions are not available while in Troubleshooting Mode.', 'health-check' ),
|
179 |
+
esc_html__( 'By enabling the Troubleshooting Mode, all plugins will appear inactive and your site will switch to the default theme only for you. All other users will see your site as usual.', 'health-check' ),
|
180 |
+
esc_html__( 'A Troubleshooting Mode menu is added to your admin bar, which will allow you to enable plugins individually, switch back to your current theme, and disable Troubleshooting Mode.', 'health-check' )
|
181 |
);
|
182 |
}
|
183 |
|
379 |
* @return string Theme slug to be perceived as the active theme.
|
380 |
*/
|
381 |
function health_check_troubleshoot_theme( $theme ) {
|
382 |
+
// Check if this is us fetching theme details, we then want to just return things as usual.
|
383 |
+
if ( $this->self_fetching_theme ) {
|
384 |
+
return $theme;
|
385 |
+
}
|
386 |
+
|
387 |
// Check if overrides are triggered if not break out.
|
388 |
if ( ! $this->override_theme() ) {
|
389 |
return $theme;
|
390 |
}
|
391 |
|
392 |
+
if ( empty( $this->current_theme_details ) ) {
|
393 |
+
$this->self_fetching_theme = true;
|
394 |
+
$this->current_theme_details = wp_get_theme( $this->current_theme );
|
395 |
+
$this->self_fetching_theme = false;
|
396 |
+
}
|
397 |
+
|
398 |
+
// Check if this is a parent theme request, if so return it as usual.
|
399 |
+
if ( $this->current_theme_details->parent() ) {
|
400 |
+
if ( $this->current_theme_details->get_template() === $theme ) {
|
401 |
+
return $theme;
|
402 |
+
}
|
403 |
+
}
|
404 |
+
|
405 |
// Check if a default theme exists, and if so use it as a default.
|
406 |
$default_theme = $this->has_default_theme();
|
407 |
if ( $default_theme ) {
|
513 |
return;
|
514 |
}
|
515 |
|
516 |
+
// We need some admin functions to make this a better user experience, so include that file.
|
517 |
+
if ( ! is_admin() ) {
|
518 |
+
require_once( trailingslashit( ABSPATH ) . 'wp-admin/includes/plugin.php' );
|
519 |
+
}
|
520 |
+
|
521 |
// Ensure the theme functions are available to us on every page.
|
522 |
include_once( trailingslashit( ABSPATH ) . 'wp-admin/includes/theme.php' );
|
523 |
|
530 |
$allowed_plugins = get_option( 'health-check-allowed-plugins', array() );
|
531 |
|
532 |
// Add a link to manage plugins if there are more than 20 set to be active.
|
533 |
+
if ( count( $this->active_plugins ) > 20 ) {
|
534 |
$wp_menu->add_node( array(
|
535 |
'id' => 'health-check-plugins',
|
536 |
'title' => esc_html__( 'Manage active plugins', 'health-check' ),
|
health-check.php
CHANGED
@@ -8,7 +8,7 @@
|
|
8 |
* Plugin URI: http://wordpress.org/plugins/health-check/
|
9 |
* Description: Checks the health of your WordPress install.
|
10 |
* Author: The WordPress.org community
|
11 |
-
* Version: 1.1.
|
12 |
* Author URI: http://wordpress.org/plugins/health-check/
|
13 |
* Text Domain: health-check
|
14 |
*/
|
@@ -34,7 +34,7 @@ define( 'HEALTH_CHECK_MYSQL_MIN_VERSION', '5.0' );
|
|
34 |
define( 'HEALTH_CHECK_MYSQL_REC_VERSION', '5.6' );
|
35 |
|
36 |
// Set the plugin version.
|
37 |
-
define( 'HEALTH_CHECK_PLUGIN_VERSION', '1.1.
|
38 |
|
39 |
// Set the absolute path for the plugin.
|
40 |
define( 'HEALTH_CHECK_PLUGIN_DIRECTORY', plugin_dir_path( __FILE__ ) );
|
8 |
* Plugin URI: http://wordpress.org/plugins/health-check/
|
9 |
* Description: Checks the health of your WordPress install.
|
10 |
* Author: The WordPress.org community
|
11 |
+
* Version: 1.1.2
|
12 |
* Author URI: http://wordpress.org/plugins/health-check/
|
13 |
* Text Domain: health-check
|
14 |
*/
|
34 |
define( 'HEALTH_CHECK_MYSQL_REC_VERSION', '5.6' );
|
35 |
|
36 |
// Set the plugin version.
|
37 |
+
define( 'HEALTH_CHECK_PLUGIN_VERSION', '1.1.2' );
|
38 |
|
39 |
// Set the absolute path for the plugin.
|
40 |
define( 'HEALTH_CHECK_PLUGIN_DIRECTORY', plugin_dir_path( __FILE__ ) );
|
readme.txt
CHANGED
@@ -3,7 +3,7 @@ Tags: health check
|
|
3 |
Contributors: wordpressdotorg, westi, pento, Clorith
|
4 |
Requires at least: 3.8
|
5 |
Tested up to: 4.9
|
6 |
-
Stable tag: 1.1.
|
7 |
License: GPLv2
|
8 |
License URI: https://www.gnu.org/licenses/gpl-2.0.html
|
9 |
|
@@ -35,6 +35,12 @@ In the future we may introduce more checks, and welcome feedback both through th
|
|
35 |
|
36 |
== Changelog ==
|
37 |
|
|
|
|
|
|
|
|
|
|
|
|
|
38 |
= v 1.1.1 =
|
39 |
* Fixed a fatal error that would occur if a user had an older version of Troubleshooting Mode on their system.
|
40 |
|
3 |
Contributors: wordpressdotorg, westi, pento, Clorith
|
4 |
Requires at least: 3.8
|
5 |
Tested up to: 4.9
|
6 |
+
Stable tag: 1.1.2
|
7 |
License: GPLv2
|
8 |
License URI: https://www.gnu.org/licenses/gpl-2.0.html
|
9 |
|
35 |
|
36 |
== Changelog ==
|
37 |
|
38 |
+
= v 1.1.2 =
|
39 |
+
* Fixed child themes not displaying properly in Troubleshooting Mode.
|
40 |
+
* Improved styling for the backup warning, shown when activating the plugin, so it doesn't block mobile users.
|
41 |
+
* Added explanations to the plugins screen if you enter Troubleshooting Mode there, so users know what is going on.
|
42 |
+
* Fixed admin menu overflowing if too many plugins exist.
|
43 |
+
|
44 |
= v 1.1.1 =
|
45 |
* Fixed a fatal error that would occur if a user had an older version of Troubleshooting Mode on their system.
|
46 |
|