Changeset 2286705
- Timestamp:
- 04/19/2020 10:20:03 AM (6 years ago)
- Location:
- site-health-tool-manager
- Files:
-
- 2 added
- 4 edited
- 1 copied
-
tags/1.1 (copied) (copied from site-health-tool-manager/trunk)
-
tags/1.1/README.md (added)
-
tags/1.1/readme.txt (modified) (2 diffs)
-
tags/1.1/site-health-tool-manager.php (modified) (5 diffs)
-
trunk/README.md (added)
-
trunk/readme.txt (modified) (2 diffs)
-
trunk/site-health-tool-manager.php (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
site-health-tool-manager/tags/1.1/readme.txt
r2285205 r2286705 5 5 Tested up to: 5.4 6 6 Requires PHP: 5.6 7 Stable tag: 1. 0.17 Stable tag: 1.1 8 8 License: GPLv2 or later 9 9 License URI: http://www.gnu.org/licenses/gpl-2.0.html … … 27 27 2. Disable the tests that aren't needed 28 28 3. Disabled tests are not run on the Site Health screen 29 30 == Changelog == 31 32 1.1 33 - Adds ability to disable the Dashboard widget 34 - Fixes fatal error in WP 5.4 35 36 1.0.1 37 - Fix issue for plugins that use closures for test callbacks 38 39 1.0 40 - Initial Release -
site-health-tool-manager/tags/1.1/site-health-tool-manager.php
r2083969 r2286705 4 4 * Plugin URI: https://github.com/earnjam/site-health-tool-manager 5 5 * Description: Control which tests appear in the the Site Health Tool 6 * Version: 1. 0.16 * Version: 1.1 7 7 * Author: William Earnhardt 8 8 * Author URI: https://wearnhardt.com … … 48 48 49 49 /** 50 * Disable the dashboard widget 51 */ 52 function shtm_filter_dashboard_widget() { 53 if ( ! get_option( 'shtm_widget_enabled', 1 ) ) { 54 global $wp_meta_boxes; 55 unset( $wp_meta_boxes['dashboard']['normal']['core']['dashboard_site_health'] ); 56 } 57 } 58 add_action( 'wp_dashboard_setup', 'shtm_filter_dashboard_widget' ); 59 60 61 /** 50 62 * Output for the Site Health Tool Settings page 51 63 */ … … 61 73 } 62 74 63 include ABSPATH . 'wp-admin/includes/class-wp-site-health.php';75 include_once ABSPATH . 'wp-admin/includes/class-wp-site-health.php'; 64 76 $tests = WP_Site_Health::get_tests(); 65 77 $disabled = get_option( 'shtm_hidden_tests', array() ); 78 $widget = get_option( 'shtm_widget_enabled', 1 ); 66 79 $enabled = array(); 67 80 68 81 // If tests have been submitted, process the form data 69 if ( isset( $_POST[' checked'] ) ) {82 if ( isset( $_POST['submit'] ) ) { 70 83 71 84 // Verify form nonce before saving … … 87 100 $disabled = $new_disabled; 88 101 102 $widget = ( isset( $_POST['widget'] ) ) ? 1 : 0; 103 update_option( 'shtm_widget_enabled', $widget ); 104 89 105 $classes = 'notice notice-success is-dismissible'; 90 106 $message = __( 'Settings saved.', 'site-health-tool-manager' ); … … 100 116 } 101 117 ?> 102 <h2><?php _e( 'Tests Enabled', 'site-health-tool-manager' ); ?></h2>103 <p><?php _e( 'Certain tests may not be relevant to your environment. Uncheck a test to remove it from the Site Health Status screen.', 'site-health-tool-manager' ); ?></p>104 118 <form method="POST" action=""> 105 <?php wp_nonce_field( 'shtm-disable-tests', 'shtm-disable-tests-nonce' ); ?> 119 <h2><?php _e( 'Tests Enabled', 'site-health-tool-manager' ); ?></h2> 120 <p><?php _e( 'Certain tests may not be relevant to your environment. Uncheck a test to remove it from the Site Health Status screen.', 'site-health-tool-manager' ); ?></p> 121 <?php wp_nonce_field( 'shtm-disable-tests', 'shtm-disable-tests-nonce' ); ?> 122 <ul> 123 <?php 124 foreach ( $tests as $type ) { 125 $checked = false; 126 foreach ( $type as $test => $details ) { 127 $checked = ( ! in_array( $test, $disabled ) ); 128 echo '<li><input type="checkbox" '; 129 if ( $checked ) { 130 echo 'checked="checked" '; 131 } 132 echo 'name="checked[]" id="' . $test . '" value="' . $test . '" />'; 133 echo '<label for="' . $test . '">' . $details['label'] . '</label></li>'; 134 } 135 } 136 ?> 137 </ul> 138 <h2><?php _e( 'Other Settings', 'site-health-tool-manager' ); ?></h2> 106 139 <ul> 107 <?php 108 foreach ( $tests as $type ) { 109 $checked = false; 110 foreach ( $type as $test => $details ) { 111 $checked = ( ! in_array( $test, $disabled ) ); 112 echo '<li><input type="checkbox" '; 113 if ( $checked ) { 114 echo 'checked="checked" '; 115 } 116 echo 'name="checked[]" id="' . $test . '" value="' . $test . '" />'; 117 echo '<label for="' . $test . '">' . $details['label'] . '</label></li>'; 118 } 119 } 120 ?> 140 <li> 141 <input type="checkbox" name="widget" id="widget-setting" 142 <?php 143 if ( $widget ) { 144 echo 'checked="checked"'; 145 } 146 ?> 147 /> 148 <label for="widget-setting"><?php _e( 'Dashboard Widget Enabled', 'site-health-tool-manager' ); ?></label> 149 </li> 121 150 </ul> 122 <input class="button button-primary" type="submit" value="<?php _e( 'Save Tests', 'site-health-tool-manager' ); ?>" /> 151 <p> 152 <input class="button button-primary" type="submit" value="<?php _e( 'Save Settings', 'site-health-tool-manager' ); ?>" name="submit" /> 153 </p> 123 154 </form> 124 155 </div> -
site-health-tool-manager/trunk/readme.txt
r2285205 r2286705 5 5 Tested up to: 5.4 6 6 Requires PHP: 5.6 7 Stable tag: 1. 0.17 Stable tag: 1.1 8 8 License: GPLv2 or later 9 9 License URI: http://www.gnu.org/licenses/gpl-2.0.html … … 27 27 2. Disable the tests that aren't needed 28 28 3. Disabled tests are not run on the Site Health screen 29 30 == Changelog == 31 32 1.1 33 - Adds ability to disable the Dashboard widget 34 - Fixes fatal error in WP 5.4 35 36 1.0.1 37 - Fix issue for plugins that use closures for test callbacks 38 39 1.0 40 - Initial Release -
site-health-tool-manager/trunk/site-health-tool-manager.php
r2083969 r2286705 4 4 * Plugin URI: https://github.com/earnjam/site-health-tool-manager 5 5 * Description: Control which tests appear in the the Site Health Tool 6 * Version: 1. 0.16 * Version: 1.1 7 7 * Author: William Earnhardt 8 8 * Author URI: https://wearnhardt.com … … 48 48 49 49 /** 50 * Disable the dashboard widget 51 */ 52 function shtm_filter_dashboard_widget() { 53 if ( ! get_option( 'shtm_widget_enabled', 1 ) ) { 54 global $wp_meta_boxes; 55 unset( $wp_meta_boxes['dashboard']['normal']['core']['dashboard_site_health'] ); 56 } 57 } 58 add_action( 'wp_dashboard_setup', 'shtm_filter_dashboard_widget' ); 59 60 61 /** 50 62 * Output for the Site Health Tool Settings page 51 63 */ … … 61 73 } 62 74 63 include ABSPATH . 'wp-admin/includes/class-wp-site-health.php';75 include_once ABSPATH . 'wp-admin/includes/class-wp-site-health.php'; 64 76 $tests = WP_Site_Health::get_tests(); 65 77 $disabled = get_option( 'shtm_hidden_tests', array() ); 78 $widget = get_option( 'shtm_widget_enabled', 1 ); 66 79 $enabled = array(); 67 80 68 81 // If tests have been submitted, process the form data 69 if ( isset( $_POST[' checked'] ) ) {82 if ( isset( $_POST['submit'] ) ) { 70 83 71 84 // Verify form nonce before saving … … 87 100 $disabled = $new_disabled; 88 101 102 $widget = ( isset( $_POST['widget'] ) ) ? 1 : 0; 103 update_option( 'shtm_widget_enabled', $widget ); 104 89 105 $classes = 'notice notice-success is-dismissible'; 90 106 $message = __( 'Settings saved.', 'site-health-tool-manager' ); … … 100 116 } 101 117 ?> 102 <h2><?php _e( 'Tests Enabled', 'site-health-tool-manager' ); ?></h2>103 <p><?php _e( 'Certain tests may not be relevant to your environment. Uncheck a test to remove it from the Site Health Status screen.', 'site-health-tool-manager' ); ?></p>104 118 <form method="POST" action=""> 105 <?php wp_nonce_field( 'shtm-disable-tests', 'shtm-disable-tests-nonce' ); ?> 119 <h2><?php _e( 'Tests Enabled', 'site-health-tool-manager' ); ?></h2> 120 <p><?php _e( 'Certain tests may not be relevant to your environment. Uncheck a test to remove it from the Site Health Status screen.', 'site-health-tool-manager' ); ?></p> 121 <?php wp_nonce_field( 'shtm-disable-tests', 'shtm-disable-tests-nonce' ); ?> 122 <ul> 123 <?php 124 foreach ( $tests as $type ) { 125 $checked = false; 126 foreach ( $type as $test => $details ) { 127 $checked = ( ! in_array( $test, $disabled ) ); 128 echo '<li><input type="checkbox" '; 129 if ( $checked ) { 130 echo 'checked="checked" '; 131 } 132 echo 'name="checked[]" id="' . $test . '" value="' . $test . '" />'; 133 echo '<label for="' . $test . '">' . $details['label'] . '</label></li>'; 134 } 135 } 136 ?> 137 </ul> 138 <h2><?php _e( 'Other Settings', 'site-health-tool-manager' ); ?></h2> 106 139 <ul> 107 <?php 108 foreach ( $tests as $type ) { 109 $checked = false; 110 foreach ( $type as $test => $details ) { 111 $checked = ( ! in_array( $test, $disabled ) ); 112 echo '<li><input type="checkbox" '; 113 if ( $checked ) { 114 echo 'checked="checked" '; 115 } 116 echo 'name="checked[]" id="' . $test . '" value="' . $test . '" />'; 117 echo '<label for="' . $test . '">' . $details['label'] . '</label></li>'; 118 } 119 } 120 ?> 140 <li> 141 <input type="checkbox" name="widget" id="widget-setting" 142 <?php 143 if ( $widget ) { 144 echo 'checked="checked"'; 145 } 146 ?> 147 /> 148 <label for="widget-setting"><?php _e( 'Dashboard Widget Enabled', 'site-health-tool-manager' ); ?></label> 149 </li> 121 150 </ul> 122 <input class="button button-primary" type="submit" value="<?php _e( 'Save Tests', 'site-health-tool-manager' ); ?>" /> 151 <p> 152 <input class="button button-primary" type="submit" value="<?php _e( 'Save Settings', 'site-health-tool-manager' ); ?>" name="submit" /> 153 </p> 123 154 </form> 124 155 </div>
Note: See TracChangeset
for help on using the changeset viewer.