Warning: Cannot modify header information - headers already sent by (output started at /var/www/jonas-eriksen.dk/pic/private/index.php:1) in /var/www/jonas-eriksen.dk/pic/private/index.php on line 215
PK!Vnpages/tools.phpnu[

PK!pages/debug-data.phpnu[

Site Health Status page.' ), esc_url( admin_url( 'site-health.php' ) ) ); ?>

$details ) { if ( ! isset( $details['fields'] ) || empty( $details['fields'] ) ) { continue; } ?>

PK!@pages/site-health-header.phpnu[


PK!Zpages/site-status.phpnu[



PK!4pages/phpinfo.phpnu[

]*>(.*)<\/body>/siU', $phpinfo_raw, $phpinfo ); // Extract the styles `phpinfo()` creates for this page. preg_match_all( '/]*>(.*)<\/style>/siU', $phpinfo_raw, $styles ); // We remove various styles that break the visual flow of wp-admin. $remove_patterns = array( "/a:.+?\n/si", "/body.+?\n/si", ); // Output the styles as an inline style block. if ( isset( $styles[1][0] ) ) { $styles = preg_replace( $remove_patterns, '', $styles[1][0] ); echo ''; } // Output the actual phpinfo data. if ( isset( $phpinfo[1][0] ) ) { echo $phpinfo[1][0]; } ?>
PK!.Epages/troubleshoot.phpnu[

PK!%w pages/screenshots.phpnu[

%s', esc_html_x( 'Take Screenshot', 'Description of the button label', 'health-check' ) ) ); ?>

'health-check-images', 'posts_per_page' => -1, ) ); if ( ! $screenshots ) { echo '

' . esc_html__( 'You have not taken any screenshots, return here when you have to view them.', 'health-check' ) . '

'; } foreach ( $screenshots as $screenshot ) { $controls = array( 'view' => sprintf( '%s', esc_url( add_query_arg( array( 'health-check-screenshot' => $screenshot->hash_id, ), site_url() ) ), esc_html__( 'View screenshot', 'health-check' ) ), 'embed' => sprintf( '', esc_attr( sprintf( '%s', add_query_arg( array( 'health-check-screenshot' => $screenshot->hash_id, ), site_url() ), esc_attr( $screenshot->post_title ) ) ), esc_html__( 'Copy forum markup', 'health-check' ), esc_html__( 'Copied!', 'health-check' ) ), 'delete' => sprintf( '%s', esc_url( wp_nonce_url( add_query_arg( array( 'tab' => 'screenshots', 'health-check-delete-screenshot' => $screenshot->ID, ), admin_url( 'site-health.php' ) ), sprintf( 'health-check-delete-screenshot-%d', $screenshot->ID ) ) ), esc_html__( 'Delete screenshot', 'health-check' ) ), ); printf( '
%s
%s%s
%s
', sprintf( '%s', ( $screenshot->screenshot ), esc_attr( $screenshot->post_title ) ), esc_html( $screenshot->post_title ), sprintf( // translators: %s: The date and time the screenshot was taken. esc_html__( 'Published on %s', 'health-check' ), esc_html( $screenshot->post_date ) ), implode( ' ', $controls ) ); } ?>
PK!e>vHH uninstall.phpnu[delete( $wpdb->usermeta, array( 'meta_key' => 'health-check', ) ); // Remove any transients and similar which the plugin may have left behind. $wpdb->query( "DELETE FROM {$wpdb->options} WHERE `option_name` LIKE '_transient_health-check%'" ); // Remove the old Must-Use plugin if it was implemented. if ( file_exists( trailingslashit( WPMU_PLUGIN_DIR ) . 'health-check-disable-plugins.php' ) ) { wp_delete_file( trailingslashit( WPMU_PLUGIN_DIR ) . 'health-check-disable-plugins.php' ); } // Remove the renamed Must-Use plugin if it exists. if ( file_exists( trailingslashit( WPMU_PLUGIN_DIR ) . 'health-check-troubleshooting-mode.php' ) ) { wp_delete_file( trailingslashit( WPMU_PLUGIN_DIR ) . 'health-check-troubleshooting-mode.php' ); } PK!*9*9 changelog.txtnu[= v1.6.0 (2023-03-31) = * Improved the visual aspects of the Troubleshooting Mode Widget. * Improved security by hardening Troubleshooting Mode actions with security tokens (nonces). * Added a new tool to check `.htaccess` rules (where applicable). * Added TwentyTwenty Three to the list of default themes. * Added option to install the latest classic (non Site Editor-focused) default theme if no default theme exists. * Added a new security confirmation prompt in Troubleshooting Mode, if a security token (nonce) value is either expired, or missing. * Added better documentation around reporting security concerns. * Fixed a bug where notices from previous Troubleshooting sessions would show up in a new session, which is just confusing. = v1.5.1 (2022-11-02) = * Fixed a bug where if Health Check was disabled during troubleshooting, you would need to force-enable/disable other plugins or themes. = v1.5.0 (2022-09-10) = * Added a custom filter for the Health Check plugin PHP Compatibility check. * Added functions which will try to disable cache solutions during troubleshooting. * Added ability to force changes if loopbacks fail during troubleshooting. * Changed how JavaScript is built and bundled in the plugin. * Changed the location of the `phpinfo()` check to the Tools section. * Changed how troubleshooting mode implements its conditional actions and filters when enabled. * Fixed styling issues for troubleshooting mode in WordPress 5.9. * Removed Site Health Status from the plugin, as they were implemented in WordPress 5.2. = v1.4.5 = * Fix Troubleshooting Mode throwing errors in frontend on WordPress 5.5 = v1.4.4 = * Fixed hidden JavaScript warning when using troubleshooting mode on the Dashboard * Fixed plugin and theme lists staying hidden in troubleshooting mode on the Dashboard = v1.4.3 = * Compatibility with WordPress 5.4 = v1.4.2 = * Fix missing headers for a loopback request in the debug section = 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. * Fix the file comparison view on Windows systems if there are modified core files. * Fix a bug where some premium plugins could not be enabled in troubleshooting mode * Improved styles for older browsers. * Improved the PHP module checks to allow for constant checks as well. Should help with some edge case tests. * Improved the core file integrity checker. * Improved testing of WP_cron, now works properly for those running a "real cron" outside of WordPress. * Improved the htaccess rule test to only run if using an Apache server that supports these. * Modify the Site Health grading indicator. * Modified strings to make them clearer. * Added server headers to the Debug information. * Added polyfills for core features from WordPress 5.2 so they work for older sites. * Added a link to the Site Health page from the plugin overview. * Added a custom capability, `view_site_health_checks` for the plugin. * Added support for parent/child theme output in the Debug screen. * Added system user information to the Debug information. * Added a Site Health test for timezone localization. * Added `mbstring` and `json` (again) as requirements to the list of PHP extensions. * Added a missing toggle to the list of plugins/themes to the troubleshooting dashboard widget. * Added bulk actions to enable or disable plugins when troubleshooting, or to initiate troubleshooting mode. * Added plugin compatibility checker to the tools section. * Added a dashboard widget to show your Site Health status at a glance when logging in. * Added filters for Site Health test results. * Added WP-CLI support, you can now run `wp health-check status` for a list of test and their status. * Moved compatibility functions out of primary files and into a `compat.php` so they can be conditionally loaded. * Disable the Fatal Error (WSOD) protection in WordPress while in troubleshooting mode. = v1.3.2 = * Add polyfill for directory size calculations for sites running WordPress versions older than 5.2.0 * Fix link for the extended PHP information = v1.3.1 = * Include missing dependency for JavaScript files, first introduced in WordPress 5.2 = v1.3.0 = * Plugin moved to the Tools section in the admin menu * New UI/UX for the plugin pages * New troubleshooting mode UI/UX * Removed the backup reminder nag * Improved security hardening * Changed cookie names for improved hosting compatibility * Improved accessibility * Automatically check for critical issues once a week (adds a counter next to the menu item) * Dates in the email tester now follow your site settings = v1.2.5 = * Fix: Ensure the REST API status test runs as intended. * Fix: Remove warning on plugin screens when premium plugins are used. * Fix: Backup reminder would not remain dismissed in all scenarios after the recent update. = v1.2.4 = * Security: Prevent arbitrary file viewing through the integrity file actions. Independently reported by Julien Legras of [Synacktiv](https://synacktiv.com) and siliconforks. * Security: Site status was available to any user with a subscriber role or higher on a site. Reported by Julien Legras of [Synacktiv](https://synacktiv.com). * Security: Hardened the troubleshooting mode session so it is locked to the users location when active. * New enhancement: Check that various PHP extensions exist, as recommended by the WordPress Hosting Community. * New enhancement: Check if update APIs are being manipulated by plugins or themes. * Fix: Copying debug information had the wrong indentation for easier readability. * Fix: Toggling plugins and themes from the troubleshooting widget on in the dashboard now lets you expand/collapse them as intended. * Fix: When debugging was enabled in WordPress, disabling a plugin in troubleshooting mode would cause a WSOD if the disabled plugin caused a fatal error. = v1.2.3 = * Added REST API availability test to the Site Status = v 1.2.2 = * Added Twenty Nineteen as a recognized core theme. = v 1.2.1 = * Make sure only those with access to the plugin see the backup encouragement notice. * Make sure the `is_troubleshooting()` checks are available to the Site Status tester when the MU plugin may not have updated yet. * Avoid a warning of an undefined variable if you have the latest WordPress version installed. = v 1.2.0 = * Changed plugin name, it now better describes the plugins two primary purposes. * Changed the `Health Check` tab, it's now named `Site Status`, as we used the old name too many places and it was confusing. * Site status tests now run asynchronously, making the page load much faster. * The HTTPS tests now also check your Site URL settings to make sure they are following recommended best practices. * Fixed a warning preventing plugin names from displaying on the front-end in some cases. * Fixed an issue where you might get a 500 error if you tried using Troubleshooting Mode while using a child theme. * Automatically disable/enable a plugin or theme in Troubleshooting Mode if they are detected to cause errors. * Introduce a new dashboard widget during Troubleshooting Mode (and a simplified version on the plugins screen) to better explain what is going on, and make available actions more discoverable than the admin menu is. * Some text improvements throughout the plugin. * When loopback tests fail, we previously tested all plugins at once, for sites that have many plugins this may fail as the request times out. We now test one plugin at a time to avoid this, while also showing more information at the tests are running to the end user. = v 1.1.2 = * Fixed child themes not displaying properly in Troubleshooting Mode. * Improved styling for the backup warning, shown when activating the plugin, so it doesn't block mobile users. * Added explanations to the plugins screen if you enter Troubleshooting Mode there, so users know what is going on. * Fixed admin menu overflowing if too many plugins exist. = v 1.1.1 = * Fixed a fatal error that would occur if a user had an older version of Troubleshooting Mode on their system. = v 1.1.0 = * Check for theme, plugin and WordPress updates when visiting the debug tab. * Improved wording on some failure situations. * Made the Debug Information tab a bit easier to read with fixed table styles. * Redesigned tools page, with added accordion to avoid information overload, and different features mixing together. * Mail test tool now allows you to include an optional customized message. * Users can now change between any installed theme while in troubleshooting mode. * Renamed the Must-Use plugin, making it align with what features present in the file. * Improved the plugin cleanup process, when the plugin is deleted. * Show full plugin names, and not slugs, in the troubleshooting admin bar menu. * Check if the .htaccess file contains any rules not added by WordPress core in the debug section. * Allow the disabling of Troubleshooting Mode from the same page as you previously enabled it from. * Removed cURL checks from the automated test page, this was more confusion than help. * Add installation size to the debug information. = v 1.0.1 = * Fixed email tester having the wrong class reference, preventing it from running. * Add some missing text domains preventing full translations. = v 1.0.0 = * Added minimum PHP version checks with documentation links. * Added testing with a default theme to the loopback checker. * Added cURL version checker to the health check tab. * Added simple e-mail tester. * Added core file integrity checker. * Added capability checks, to avoid installing things that may modify the database while troubleshooting. * Added a prompt to install a default theme if none exist. * Added a warning encouraging users to maintain up to date backups when troubleshooting. * Fixed MU plugin not always updating (if available) when a user tries to troubleshoot. * Fixed fatal error when trying to troubleshoot "too early". * Updated troubleshooting drop down, it no longer shows theme switching if no default theme exists. * Removed the checkbox requirement from the Troubleshooting tab, it wasn't needed any more, and added pointless complexity now. = v 0.9.0 = * Various string changes, typo fixes and translation enhancements. * Added conditional hiding of the plugins list from the admin bar, if there's too many plugins it becomes a bad experience. (Hidden if there are more than 20 active plugins) * Added ability to enable/disable plugins in Troubleshooting Mode from the plugins list. * Added filter to remove actions from the plugin list in Troubleshooting Mode. * Fixed notices on the plugin screen when plugin data may be inconsistent. * Fixed jumping directly to troubleshooting mode for single file plugins placed directly in the plugin directory root. * Fixed issue where troubleshooting a plugin directly made it impossible to disable it while in Troubleshooting Mode. * Fixed so that the original language is returned when translating the debug data for copying. * Fixed issue where the Debug screen would turn to half-English when using a non-English language. * Fixed an issue where plugins could become truly disabled on a site when in Troubleshooting Mode. * Fixed so that enabled/disabled plugins don't carry over between troubleshooting sessions. = v 0.8.0 = * Updated recommended PHP version to mirror WordPress.org. * Updated texts for troubleshooting mode. * Re-labeled database terms to be more user friendly. * Added media information to the debug tab. * Added individual `Troubleshoot` links for the list of active plugins. * Added automatic copy to clipboard with supported browsers in the debug tab. = v 0.7.0 = * Troubleshooting mode now also switches to a default theme. * Introduced a method for toggling default or active theme use when in troubleshooting mode. * Introduced a method for enabling/disabling plugins while in troubleshooting mode. * Introduced a method for disabling troubleshooting mode without needing to log out and back in again. = v 0.6.0 = * Improved loopback tests * Check if loopbacks can be completed without plugins activated * Test individual plugins to identify loopback blockers * Add troubleshooting mode, test your website without any plugins for your session without disabling functionality for visitors. = v 0.5.1 = * Introduced loopback check to the health checker status. = v 0.5.0 = * Added clarity to many text strings. * Avoid listing MU directories if it's not being used. * Add a Table of Contents heading and make navigating the debug page from it smoother. * Only enqueue our CSS and JavaScript if we are on the health check pages. * Add some missing version numbers nor being included in text strings. * Avoid fatal errors if accessing files directly, caused by translation functions being used when they don't exist. * Avoid "empty" strings when author or version is missing from plugins or themes. * Make the health checker test background updates. * Make the health checker look for missed scheduled events. * If using a localized version of WordPress, also display the copy and paste field in English if using an international support resource. * Indicate if 64bit values are supported by PHP in the debug section. * Improved MariaDB version detection/comparison. = v 0.4.1 = * Better SQL version detection to account for MariaDB versions * Added translation support * Removed unintentional indentations in the debug copying field = v 0.4 = * Added debug section * Added PHP info section * Cleaned up the health check * Added WordPress.org connectivity check * Added HTTPS check = v 0.3.1 = * Fixed a few typos = v 0.3 = * Added recommended PHP and MySQL versions * Check for utf8mb4 support * Fixed a bunch of PHP warnings = v 0.2.1 = * Fixed version comparison bug - When the server had the exact required versions we reported it as out of date. = v 0.2 = * Updated with actual PHP and MySQL version requirements for WordPress 3.2 = v 0.1 = * Initial release with checks for the PHP and MySQL versions we will likely target for WordPress 3.2 PK!/mu-plugin/health-check-troubleshooting-mode.phpnu[init(); } /** * Actually initiation of the plugin. * * @return void */ public function init() { add_filter( 'option_active_plugins', array( $this, 'health_check_loopback_test_disable_plugins' ) ); add_filter( 'option_active_sitewide_plugins', array( $this, 'health_check_loopback_test_disable_plugins' ) ); add_filter( 'pre_option_template', array( $this, 'health_check_troubleshoot_theme_template' ) ); add_filter( 'pre_option_stylesheet', array( $this, 'health_check_troubleshoot_theme_stylesheet' ) ); add_filter( 'bulk_actions-plugins', array( $this, 'remove_plugin_bulk_actions' ) ); add_filter( 'handle_bulk_actions-plugins', array( $this, 'handle_plugin_bulk_actions' ), 10, 3 ); $this->load_options(); // If troubleshooting mode is enabled, add special filters and actions. if ( $this->is_troubleshooting() ) { // Attempt to avoid cache entries from a troubleshooting session. wp_suspend_cache_addition( true ); // Add nocache headers for browser caches. add_action( 'init', 'nocache_headers' ); add_action( 'admin_init', 'nocache_headers' ); add_action( 'admin_enqueue_scripts', array( $this, 'enqueue_assets' ) ); add_action( 'admin_bar_menu', array( $this, 'health_check_troubleshoot_menu_bar' ), 999 ); add_filter( 'wp_fatal_error_handler_enabled', '__return_false' ); add_action( 'admin_notices', array( $this, 'prompt_install_default_theme' ) ); add_filter( 'user_has_cap', array( $this, 'remove_plugin_theme_install' ) ); add_action( 'plugin_action_links', array( $this, 'plugin_actions' ), 50, 4 ); add_action( 'admin_notices', array( $this, 'display_dashboard_widget' ) ); add_action( 'admin_footer', array( $this, 'dashboard_widget_scripts' ) ); add_action( 'wp_logout', array( $this, 'health_check_troubleshooter_mode_logout' ) ); add_action( 'init', array( $this, 'health_check_troubleshoot_get_captures' ) ); // If needed, prompt the user to confirm their actions if they are missing a valid nonce. add_action( 'admin_footer', array( $this, 'nonce_confirmation_prompt' ) ); /* * Plugin activations can be forced by other tools in things like themes, so let's * attempt to work around that by forcing plugin lists back and forth. * * This is not an ideal scenario, but one we must accept as reality. */ add_action( 'activated_plugin', array( $this, 'plugin_activated' ) ); } } /** * Set up the class variables based on option table entries. * * @return void */ public function load_options() { $this->disable_hash = get_option( 'health-check-disable-plugin-hash', null ); $this->allowed_plugins = get_option( 'health-check-allowed-plugins', array() ); $this->default_theme = ( 'yes' === get_option( 'health-check-default-theme', 'yes' ) ? true : false ); $this->active_plugins = $this->get_unfiltered_plugin_list(); $this->current_theme = get_option( 'health-check-current-theme', false ); } /** * Enqueue styles and scripts used by the MU plugin if applicable. * * @return void */ public function enqueue_assets() { if ( ! is_admin() ) { return; } $health_check = include WP_PLUGIN_DIR . '/health-check/build/health-check.asset.php'; wp_enqueue_style( 'health-check', plugins_url( '/health-check/build/health-check.css' ), array(), $health_check['version'] ); if ( ! wp_script_is( 'site-health', 'registered' ) ) { wp_enqueue_script( 'site-health', plugins_url( '/health-check/build/health-check.js' ), array( 'jquery', 'wp-a11y', 'wp-util' ), $health_check['version'], true ); } $troubleshooter = include WP_PLUGIN_DIR . '/health-check/build/troubleshooting-mode.asset.php'; wp_enqueue_script( 'health-check', plugins_url( '/health-check/build/troubleshooting-mode.js' ), array( 'site-health' ), $troubleshooter['version'], true ); } /** * Add a prompt to install a default theme. * * If no default theme exists, we can't reliably assert if an issue is * caused by the theme. In these cases we should provide an easy step * to get to, and install, one of the default themes. * * @return void */ public function prompt_install_default_theme() { if ( $this->has_default_theme() ) { return; } printf( '

%s

%s %s

', esc_html__( 'You don\'t have any of the default themes installed. A default theme helps you determine if your current theme is causing conflicts.', 'health-check' ), esc_url( admin_url( sprintf( 'theme-install.php?theme=%s', $this->default_themes[0] ) ) ), esc_html__( 'Install the latest default theme', 'health-check' ), esc_url( admin_url( sprintf( 'theme-install.php?theme=%s', $this->latest_classic_default_theme ) ) ), esc_html__( 'Install the latest classic default theme', 'health-check' ) ); } /** * Remove the `Add` option for plugins and themes. * * When troubleshooting, adding or changing themes and plugins can * lead to unexpected results. Remove these menu items to make it less * likely that a user breaks their site through these. * * @param array $caps Array containing the current users capabilities. * * @return array */ public function remove_plugin_theme_install( $caps ) { $caps['switch_themes'] = false; /* * This is to early for `get_current_screen()`, so we have to do it the * old fashioned way with `$_SERVER`. */ if ( 'plugin-install.php' === substr( $_SERVER['REQUEST_URI'], -18 ) ) { $caps['activate_plugins'] = false; } return $caps; } /** * Fire on plugin activation. * * When in Troubleshooting Mode, plugin activations * will clear out the DB entry for `active_plugins`, this is bad. * * We fix this by re-setting the DB entry if anything tries * to modify it during troubleshooting. * * @return void */ public function plugin_activated() { // Force the database entry for active plugins if someone tried changing plugins while in Troubleshooting Mode. update_option( 'active_plugins', $this->active_plugins ); } public function handle_plugin_bulk_actions( $sendback, $action, $plugins ) { if ( ! $this->is_troubleshooting() && 'health-check-troubleshoot' !== $action ) { return $sendback; } $sendback = self_admin_url( 'plugins.php' ); if ( 'health-check-troubleshoot' === $action ) { foreach ( $plugins as $single_plugin ) { $plugin_slug = explode( '/', $single_plugin ); $plugin_slug = $plugin_slug[0]; if ( in_array( $single_plugin, $this->active_plugins, true ) ) { $this->allowed_plugins[ $plugin_slug ] = $plugin_slug; } } Health_Check_Troubleshoot::initiate_troubleshooting_mode( $this->allowed_plugins ); if ( ! $this->test_site_state() ) { $this->allowed_plugins = array(); update_option( 'health-check-allowed-plugins', $this->allowed_plugins ); $this->add_dashboard_notice( __( 'When enabling troubleshooting on the selected plugins, a site failure occurred. Because of this the selected plugins were kept disabled while troubleshooting mode started.', 'health-check' ), 'warning' ); } } if ( 'health-check-enable' === $action ) { $old_allowed_plugins = $this->allowed_plugins; foreach ( $plugins as $single_plugin ) { $plugin_slug = explode( '/', $single_plugin ); $plugin_slug = $plugin_slug[0]; if ( in_array( $single_plugin, $this->active_plugins, true ) ) { $this->allowed_plugins[ $plugin_slug ] = $plugin_slug; } } update_option( 'health-check-allowed-plugins', $this->allowed_plugins ); if ( ! $this->test_site_state() ) { $this->allowed_plugins = $old_allowed_plugins; update_option( 'health-check-allowed-plugins', $old_allowed_plugins ); $this->add_dashboard_notice( __( 'When bulk-enabling plugins, a site failure occurred. Because of this the change was automatically reverted.', 'health-check' ), 'warning' ); } } if ( 'health-check-disable' === $action ) { $old_allowed_plugins = $this->allowed_plugins; foreach ( $plugins as $single_plugin ) { $plugin_slug = explode( '/', $single_plugin ); $plugin_slug = $plugin_slug[0]; if ( in_array( $single_plugin, $this->active_plugins, true ) ) { unset( $this->allowed_plugins[ $plugin_slug ] ); } } update_option( 'health-check-allowed-plugins', $this->allowed_plugins ); if ( ! $this->test_site_state() ) { $this->allowed_plugins = $old_allowed_plugins; update_option( 'health-check-allowed-plugins', $old_allowed_plugins ); $this->add_dashboard_notice( __( 'When bulk-disabling plugins, a site failure occurred. Because of this the change was automatically reverted.', 'health-check' ), 'warning' ); } } return $sendback; } public function remove_plugin_bulk_actions( $actions ) { if ( ! $this->is_troubleshooting() ) { $actions['health-check-troubleshoot'] = __( 'Troubleshoot', 'health-check' ); return $actions; } $actions = array( 'health-check-enable' => __( 'Enable while troubleshooting', 'health-check' ), 'health-check-disable' => __( 'Disable while troubleshooting', 'health-check' ), ); return $actions; } /** * Modify plugin actions. * * While in Troubleshooting Mode, weird things will happen if you start * modifying your plugin list. Prevent this, but also add in the ability * to enable or disable a plugin during troubleshooting from this screen. * * @param $actions * @param $plugin_file * @param $plugin_data * @param $context * * @return array */ public function plugin_actions( $actions, $plugin_file, $plugin_data, $context ) { if ( 'mustuse' === $context ) { return $actions; } /* * Disable all plugin actions when in Troubleshooting Mode. * * We intentionally remove all plugin actions to avoid accidental clicking, activating or deactivating plugins * while our plugin is altering plugin data may lead to unexpected behaviors, so to keep things sane we do * not allow users to perform any actions during this time. */ $actions = array(); // This isn't an active plugin, so does not apply to our troubleshooting scenarios. if ( ! in_array( $plugin_file, $this->active_plugins, true ) ) { return $actions; } // Set a slug if the plugin lives in the plugins directory root. if ( ! stristr( $plugin_file, '/' ) ) { $plugin_slug = $plugin_file; } else { // Set the slug for plugin inside a folder. $plugin_slug = explode( '/', $plugin_file ); $plugin_slug = $plugin_slug[0]; } if ( in_array( $plugin_slug, $this->allowed_plugins, true ) ) { $actions['troubleshoot-disable'] = sprintf( '%s', esc_url( add_query_arg( array( 'health-check-troubleshoot-disable-plugin' => $plugin_slug, '_wpnonce' => $this->prepare_action_nonce( 'health-check-troubleshoot-disable-plugin', array( $plugin_slug ) ), ), admin_url( 'plugins.php' ) ) ), esc_html__( 'Disable while troubleshooting', 'health-check' ) ); } else { $actions['troubleshoot-disable'] = sprintf( '%s', esc_url( add_query_arg( array( 'health-check-troubleshoot-enable-plugin' => $plugin_slug, '_wpnonce' => $this->prepare_action_nonce( 'health-check-troubleshoot-enable-plugin', array( $plugin_slug ) ), ), admin_url( 'plugins.php' ) ) ), esc_html__( 'Enable while troubleshooting', 'health-check' ) ); } return $actions; } /** * Get the actual list of active plugins. * * When in Troubleshooting Mode we override the list of plugins, * this function lets us grab the active plugins list without * any interference. * * @return array Array of active plugins. */ public function get_unfiltered_plugin_list() { $this->override_active = false; $all_plugins = get_option( 'active_plugins' ); $this->override_active = true; return $all_plugins; } /** * Check if the user is currently in Troubleshooting Mode or not. * * @return bool */ public function is_troubleshooting() { // Check if a session cookie to disable plugins has been set. if ( isset( $_COOKIE['wp-health-check-disable-plugins'] ) ) { $_GET['health-check-disable-plugin-hash'] = $_COOKIE['wp-health-check-disable-plugins'] . md5( $_SERVER['REMOTE_ADDR'] ); } // If the disable hash isn't set, no need to interact with things. if ( ! isset( $_GET['health-check-disable-plugin-hash'] ) ) { return false; } if ( empty( $this->disable_hash ) ) { return false; } // If the plugin hash is not valid, we also break out if ( $this->disable_hash !== $_GET['health-check-disable-plugin-hash'] ) { return false; } return true; } /** * Filter the plugins that are activated in WordPress. * * @param array $plugins An array of plugins marked as active. * * @return array */ function health_check_loopback_test_disable_plugins( $plugins ) { if ( ! $this->is_troubleshooting() || ! $this->override_active ) { return $plugins; } // If we've received a comma-separated list of allowed plugins, we'll add them to the array of allowed plugins. if ( isset( $_GET['health-check-allowed-plugins'] ) ) { $this->allowed_plugins = explode( ',', $_GET['health-check-allowed-plugins'] ); } foreach ( $plugins as $plugin_no => $plugin_path ) { // Split up the plugin path, [0] is the slug and [1] holds the primary plugin file. $plugin_parts = explode( '/', $plugin_path ); // We may want to allow individual, or groups of plugins, so introduce a skip-mechanic for those scenarios. if ( in_array( $plugin_parts[0], $this->allowed_plugins, true ) ) { continue; } // Remove the reference to this plugin. unset( $plugins[ $plugin_no ] ); } // Return a possibly modified list of activated plugins. return $plugins; } /** * Check if a default theme exists. * * If a default theme exists, return the most recent one, if not return `false`. * * @return bool|string */ function has_default_theme() { foreach ( $this->default_themes as $default_theme ) { if ( $this->theme_exists( $default_theme ) ) { return $default_theme; } } return false; } /** * Check if a theme exists by looking for the slug. * * @param string $theme_slug * * @return bool */ function theme_exists( $theme_slug ) { return is_dir( WP_CONTENT_DIR . '/themes/' . $theme_slug ); } /** * Check if theme overrides are active. * * @return bool */ function override_theme() { if ( ! $this->is_troubleshooting() ) { return false; } return true; } /** * Override the default theme. * * Attempt to set one of the default themes, or a theme of the users choosing, as the active one * during Troubleshooting Mode. * * @param $default * * @return bool|string */ function health_check_troubleshoot_theme_stylesheet( $default ) { if ( $this->self_fetching_theme ) { return $default; } if ( ! $this->override_theme() ) { return $default; } if ( empty( $this->current_theme_details ) ) { $this->self_fetching_theme = true; $this->current_theme_details = wp_get_theme( $this->current_theme ); $this->self_fetching_theme = false; } // If no theme has been chosen, start off by troubleshooting as a default theme if one exists. $default_theme = $this->has_default_theme(); if ( false === $this->current_theme ) { if ( $default_theme ) { return $default_theme; } } return $this->current_theme; } /** * Override the default parent theme. * * If this is a child theme, override the parent and provide our users chosen themes parent instead. * * @param $default * * @return bool|string */ function health_check_troubleshoot_theme_template( $default ) { if ( $this->self_fetching_theme ) { return $default; } if ( ! $this->override_theme() ) { return $default; } if ( empty( $this->current_theme_details ) ) { $this->self_fetching_theme = true; $this->current_theme_details = wp_get_theme( $this->current_theme ); $this->self_fetching_theme = false; } // If no theme has been chosen, start off by troubleshooting as a default theme if one exists. $default_theme = $this->has_default_theme(); if ( false === $this->current_theme ) { if ( $default_theme ) { return $default_theme; } } if ( $this->current_theme_details->parent() ) { return $this->current_theme_details->get_template(); } return $this->current_theme; } /** * Disable Troubleshooting Mode on logout. * * If logged in, disable the Troubleshooting Mode when the logout * event is fired, this ensures we start with a clean slate on * the next login. * * @return void */ function health_check_troubleshooter_mode_logout() { if ( isset( $_COOKIE['wp-health-check-disable-plugins'] ) ) { $this->disable_troubleshooting_mode(); } } function disable_troubleshooting_mode() { unset( $_COOKIE['wp-health-check-disable-plugins'] ); setcookie( 'wp-health-check-disable-plugins', '', 0, COOKIEPATH, COOKIE_DOMAIN ); delete_option( 'health-check-allowed-plugins' ); delete_option( 'health-check-default-theme' ); delete_option( 'health-check-current-theme' ); delete_option( 'health-check-dashboard-notices' ); delete_option( 'health-check-backup-plugin-list' ); } /** * Takes a URL, or uses the current URL, and removes the query args we use to control the Troubleshooting Mode. * * @param string $url Optional. Defaults to the current URL. The URL to strip query arguments from. * * @return string */ private function get_clean_url( $url = null ) { if ( ! $url ) { // The full URL for the current request. $raw_url = ( is_ssl() ? 'https://' : 'http://' ) . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI']; // We prepare the `REQUEST_URI` entry our selves, to account for WP installs in subdirectories or similar. $request_uri = str_ireplace( site_url( '/' ), '', $raw_url ); $url = site_url( $request_uri ); } return remove_query_arg( $this->available_query_args, $url ); } /** * A helper function to validate if nonces exist, and is valid. * * This helps us add nonce-verification to internal links within the WordPress admin, while * at the same time allowing for the flexibility of support volunteers giving direct links to users who * may otherwise spend needless time looking for the correct links. * * @param string $action The action being performed and confirmed. * @param array $assets And array of the plugins, or themes, the action is applied to. * * @return boolean */ private function validate_action_nonce( $action, $assets ) { $nonce_action = sprintf( '%s-%s', $action, md5( implode( ',', $assets ) ) ); $nonce = ( isset( $_GET['_wpnonce'] ) ? $_GET['_wpnonce'] : false ); // Validate nonce. if ( ! isset( $_GET['_wpnonce'] ) || ! wp_verify_nonce( $nonce, $nonce_action ) ) { return false; } return true; } /** * Generate a predetermined formatted nonce value for the actions we wish to perform. * * @param string $action The action being performed and confirmed. * @param array $assets An array of the plugins, or themes, the action is applied to. * * @return false|string */ private function prepare_action_nonce( $action, $assets ) { $nonce_action = sprintf( '%s-%s', $action, md5( implode( ',', $assets ) ) ); return wp_create_nonce( $nonce_action ); } /** * Catch query arguments. * * When in Troubleshooting Mode, look for various GET variables that trigger * various plugin actions. * * @return void */ function health_check_troubleshoot_get_captures() { // Disable Troubleshooting Mode. if ( isset( $_GET['health-check-disable-troubleshooting'] ) ) { // Validate the cache or return early. if ( ! $this->validate_action_nonce( 'health-check-disable-troubleshooting', array() ) ) { $this->show_nonce_validator = true; $this->nonce_validator_fields = array( '_wpnonce' => $this->prepare_action_nonce( 'health-check-disable-troubleshooting', array() ), 'health-check-disable-troubleshooting' => 1, ); $this->nonce_validator_details = sprintf( '

%s

', __( 'You were attempting to disable Troubleshooting Mode.', 'health-check' ) ); return; } $this->disable_troubleshooting_mode(); wp_redirect( remove_query_arg( $this->available_query_args ) ); die(); } // Dismiss notices. if ( isset( $_GET['health-check-dismiss-notices'] ) && $this->is_troubleshooting() && is_admin() ) { // Validate the cache or return early. if ( ! $this->validate_action_nonce( 'health-check-dismiss-notices', array() ) ) { $this->show_nonce_validator = true; $this->nonce_validator_fields = array( '_wpnonce' => $this->prepare_action_nonce( 'health-check-dismiss-notices', array() ), 'health-check-dismiss-notices' => 1, ); $this->nonce_validator_details = sprintf( '

%s

', __( 'You were attempting to dismiss all notices.', 'health-check' ) ); return; } update_option( 'health-check-dashboard-notices', array() ); wp_redirect( admin_url() ); die(); } // Enable an individual plugin. if ( isset( $_GET['health-check-troubleshoot-enable-plugin'] ) ) { // Validate the cache or return early. if ( ! $this->validate_action_nonce( 'health-check-troubleshoot-enable-plugin', array( $_GET['health-check-troubleshoot-enable-plugin'] ) ) ) { $this->show_nonce_validator = true; $this->nonce_validator_fields = array( '_wpnonce' => $this->prepare_action_nonce( 'health-check-troubleshoot-enable-plugin', array( $_GET['health-check-troubleshoot-enable-plugin'] ) ), 'health-check-troubleshoot-enable-plugin' => implode( ',', array( $_GET['health-check-troubleshoot-enable-plugin'] ) ), ); $this->nonce_validator_details = sprintf( '

%s

', sprintf( // translators: The plugin being affected. __( 'You were attempting to enable the %s plugin while troubleshooting.', 'health-check' ), sprintf( '%s', $_GET['health-check-troubleshoot-enable-plugin'] ) ) ); return; } $old_allowed_plugins = $this->allowed_plugins; $this->allowed_plugins[ $_GET['health-check-troubleshoot-enable-plugin'] ] = $_GET['health-check-troubleshoot-enable-plugin']; update_option( 'health-check-allowed-plugins', $this->allowed_plugins ); if ( isset( $_GET['health-check-plugin-force-enable'] ) ) { $this->add_dashboard_notice( sprintf( // translators: %s: The plugin slug. 'The %s plugin was forcefully enabled.', $_GET['health-check-troubleshoot-enable-plugin'] ), 'info' ); } if ( ! $this->test_site_state() && ! isset( $_GET['health-check-plugin-force-enable'] ) ) { $this->allowed_plugins = $old_allowed_plugins; update_option( 'health-check-allowed-plugins', $old_allowed_plugins ); $notice = sprintf( // Translators: %1$s: The link-button markup to force enable the plugin. %2$s: The force-enable link markup. __( 'When enabling the plugin, %1$s, a site failure occurred. Because of this the change was automatically reverted. %2$s', 'health-check' ), $_GET['health-check-troubleshoot-enable-plugin'], sprintf( '%s', esc_url( add_query_arg( array( 'health-check-troubleshoot-enable-plugin' => $_GET['health-check-troubleshoot-enable-plugin'], 'health-check-plugin-force-enable' => 'true', '_wpnonce' => $this->prepare_action_nonce( 'health-check-troubleshoot-enable-plugin', array( $_GET['health-check-troubleshoot-enable-plugin'] ) ), ), $this->get_clean_url() ) ), esc_attr( sprintf( // translators: %s: Plugin name. __( 'Force-enable the plugin, %s, even though the loopback checks failed.', 'health-check' ), $_GET['health-check-troubleshoot-enable-plugin'] ) ), __( 'Enable anyway', 'health-check' ) ) ); $this->add_dashboard_notice( $notice, 'warning' ); } wp_redirect( remove_query_arg( $this->available_query_args ) ); die(); } // Disable an individual plugin. if ( isset( $_GET['health-check-troubleshoot-disable-plugin'] ) ) { // Validate the cache or return early. if ( ! $this->validate_action_nonce( 'health-check-troubleshoot-disable-plugin', array( $_GET['health-check-troubleshoot-disable-plugin'] ) ) ) { $this->show_nonce_validator = true; $this->nonce_validator_fields = array( '_wpnonce' => $this->prepare_action_nonce( 'health-check-troubleshoot-disable-plugin', array( $_GET['health-check-troubleshoot-disable-plugin'] ) ), 'health-check-troubleshoot-disable-plugin' => implode( ',', array( $_GET['health-check-troubleshoot-disable-plugin'] ) ), ); $this->nonce_validator_details = sprintf( '

%s

', sprintf( // translators: The plugin being affected. __( 'You were attempting to disable the %s plugin while troubleshooting.', 'health-check' ), sprintf( '%s', $_GET['health-check-troubleshoot-disable-plugin'] ) ) ); return; } $old_allowed_plugins = $this->allowed_plugins; unset( $this->allowed_plugins[ $_GET['health-check-troubleshoot-disable-plugin'] ] ); update_option( 'health-check-allowed-plugins', $this->allowed_plugins ); if ( isset( $_GET['health-check-plugin-force-disable'] ) ) { $this->add_dashboard_notice( sprintf( // translators: %s: The plugin slug. 'The %s plugin was forcefully disabled.', $_GET['health-check-troubleshoot-disable-plugin'] ), 'info' ); } if ( ! $this->test_site_state() && ! isset( $_GET['health-check-plugin-force-disable'] ) ) { $this->allowed_plugins = $old_allowed_plugins; update_option( 'health-check-allowed-plugins', $old_allowed_plugins ); $notice = sprintf( // Translators: %1$s: The plugin slug that was disabled. %2$s: The force-disable link markup. __( 'When disabling the plugin, %1$s, a site failure occurred. Because of this the change was automatically reverted. %2$s', 'health-check' ), $_GET['health-check-troubleshoot-disable-plugin'], sprintf( '%3$s', esc_url( add_query_arg( array( 'health-check-troubleshoot-disable-plugin' => $_GET['health-check-troubleshoot-disable-plugin'], 'health-check-plugin-force-disable' => 'true', '_wpnonce' => $this->prepare_action_nonce( 'health-check-troubleshoot-disable-plugin', array( $_GET['health-check-troubleshoot-disable-plugin'] ) ), ), $this->get_clean_url() ) ), esc_attr( sprintf( // translators: %s: Plugin name. __( 'Force-disable the plugin, %s, even though the loopback checks failed.', 'health-check' ), $_GET['health-check-troubleshoot-disable-plugin'] ) ), __( 'Disable anyway', 'health-check' ) ) ); $this->add_dashboard_notice( $notice, 'warning' ); } wp_redirect( remove_query_arg( $this->available_query_args ) ); die(); } // Change the active theme for this session. if ( isset( $_GET['health-check-change-active-theme'] ) ) { // Validate the cache or return early. if ( ! $this->validate_action_nonce( 'health-check-change-active-theme', array( $_GET['health-check-change-active-theme'] ) ) ) { $this->show_nonce_validator = true; $this->nonce_validator_fields = array( '_wpnonce' => $this->prepare_action_nonce( 'health-check-change-active-theme', array( $_GET['health-check-change-active-theme'] ) ), 'health-check-change-active-theme' => implode( ',', array( $_GET['health-check-change-active-theme'] ) ), ); $this->nonce_validator_details = sprintf( '

%s

', sprintf( // translators: The theme being activated. __( 'You were attempting to change the active theme to %s while troubleshooting.', 'health-check' ), sprintf( '%s', $_GET['health-check-change-active-theme'] ) ) ); return; } $old_theme = get_option( 'health-check-current-theme' ); update_option( 'health-check-current-theme', $_GET['health-check-change-active-theme'] ); if ( isset( $_GET['health-check-theme-force-switch'] ) ) { $this->add_dashboard_notice( sprintf( // translators: %s: The theme slug. 'The theme was forcefully switched to %s.', $_GET['health-check-change-active-theme'] ), 'info' ); } if ( ! $this->test_site_state() && ! isset( $_GET['health-check-theme-force-switch'] ) ) { update_option( 'health-check-current-theme', $old_theme ); $notice = sprintf( // Translators: %1$s: The theme slug that was switched to.. %2$s: The force-enable link markup. __( 'When switching the active theme to %1$s, a site failure occurred. Because of this we reverted the theme to the one you used previously. %2$s', 'health-check' ), $_GET['health-check-change-active-theme'], sprintf( '%s', esc_url( add_query_arg( array( 'health-check-change-active-theme' => $_GET['health-check-change-active-theme'], 'health-check-theme-force-switch' => 'true', '_wpnonce' => $this->prepare_action_nonce( 'health-check-change-active-theme', array( $_GET['health-check-change-active-theme'] ) ), ), $this->get_clean_url() ) ), esc_attr( sprintf( // translators: %s: Plugin name. __( 'Force-switch to the %s theme, even though the loopback checks failed.', 'health-check' ), $_GET['health-check-change-active-theme'] ) ), __( 'Switch anyway', 'health-check' ) ) ); $this->add_dashboard_notice( $notice, 'warning' ); } wp_redirect( remove_query_arg( $this->available_query_args ) ); die(); } } private function add_dashboard_notice( $message, $severity = 'notice' ) { $notices = get_option( 'health-check-dashboard-notices', array() ); $notices[] = array( 'severity' => $severity, 'message' => $message, 'time' => gmdate( 'Y-m-d H:i' ), ); update_option( 'health-check-dashboard-notices', $notices ); } /** * Extend the admin bar. * * When in Troubleshooting Mode, introduce a new element to the admin bar to show * enabled and disabled plugins (if conditions are met), switch between themes * and disable Troubleshooting Mode altogether. * * @param WP_Admin_Bar $wp_menu * * @return void */ function health_check_troubleshoot_menu_bar( $wp_menu ) { // We need some admin functions to make this a better user experience, so include that file. if ( ! is_admin() ) { require_once( trailingslashit( ABSPATH ) . 'wp-admin/includes/plugin.php' ); } // Make sure the updater tools are available since WordPress 5.5.0 auto-updates were introduced. if ( ! function_exists( 'wp_is_auto_update_enabled_for_type' ) ) { require_once( trailingslashit( ABSPATH ) . 'wp-admin/includes/update.php' ); } // Ensure the theme functions are available to us on every page. include_once( trailingslashit( ABSPATH ) . 'wp-admin/includes/theme.php' ); // Add top-level menu item. $wp_menu->add_menu( array( 'id' => 'health-check', 'title' => esc_html__( 'Troubleshooting Mode', 'health-check' ), 'href' => admin_url( '/' ), ) ); // Add a link to manage plugins if there are more than 20 set to be active. if ( count( $this->active_plugins ) > 20 ) { $wp_menu->add_node( array( 'id' => 'health-check-plugins', 'title' => esc_html__( 'Manage active plugins', 'health-check' ), 'parent' => 'health-check', 'href' => admin_url( 'plugins.php' ), ) ); } else { $wp_menu->add_node( array( 'id' => 'health-check-plugins', 'title' => esc_html__( 'Plugins', 'health-check' ), 'parent' => 'health-check', 'href' => admin_url( 'plugins.php' ), ) ); $wp_menu->add_group( array( 'id' => 'health-check-plugins-enabled', 'parent' => 'health-check-plugins', ) ); $wp_menu->add_group( array( 'id' => 'health-check-plugins-disabled', 'parent' => 'health-check-plugins', ) ); foreach ( $this->active_plugins as $single_plugin ) { $plugin_slug = explode( '/', $single_plugin ); $plugin_slug = $plugin_slug[0]; $plugin_data = get_plugin_data( trailingslashit( WP_PLUGIN_DIR ) . $single_plugin ); $enabled = true; if ( in_array( $plugin_slug, $this->allowed_plugins, true ) ) { $label = sprintf( // Translators: %s: Plugin slug. esc_html__( 'Disable %s', 'health-check' ), sprintf( '%s', $plugin_data['Name'] ) ); $url = add_query_arg( array( 'health-check-troubleshoot-disable-plugin' => $plugin_slug, '_wpnonce' => $this->prepare_action_nonce( 'health-check-troubleshoot-disable-plugin', array( $plugin_slug ) ), ), $this->get_clean_url() ); } else { $enabled = false; $label = sprintf( // Translators: %s: Plugin slug. esc_html__( 'Enable %s', 'health-check' ), sprintf( '%s', $plugin_data['Name'] ) ); $url = add_query_arg( array( 'health-check-troubleshoot-enable-plugin' => $plugin_slug, '_wpnonce' => $this->prepare_action_nonce( 'health-check-troubleshoot-enable-plugin', array( $plugin_slug ) ), ), $this->get_clean_url() ); } $wp_menu->add_node( array( 'id' => sprintf( 'health-check-plugin-%s', $plugin_slug ), 'title' => $label, 'parent' => ( $enabled ? 'health-check-plugins-enabled' : 'health-check-plugins-disabled' ), 'href' => $url, ) ); } } $wp_menu->add_node( array( 'id' => 'health-check-theme', 'title' => esc_html__( 'Themes', 'health-check' ), 'parent' => 'health-check', 'href' => admin_url( 'themes.php' ), ) ); $themes = wp_prepare_themes_for_js(); foreach ( $themes as $theme ) { $node = array( 'id' => sprintf( 'health-check-theme-%s', sanitize_title( $theme['id'] ) ), 'title' => sprintf( '%s %s', ( $theme['active'] ? esc_html_x( 'Active:', 'Prefix for the active theme in troubleshooting mode', 'health-check' ) : esc_html_x( 'Switch to', 'Prefix for inactive themes in troubleshooting mode', 'health-check' ) ), $theme['name'] ), 'parent' => 'health-check-theme', ); if ( ! $theme['active'] ) { $node['href'] = add_query_arg( array( 'health-check-change-active-theme' => $theme['id'], '_wpnonce' => $this->prepare_action_nonce( 'health-check-change-active-theme', array( $theme['id'] ) ), ), $this->get_clean_url() ); } $wp_menu->add_node( $node ); } // Add a link to disable Troubleshooting Mode. $wp_menu->add_node( array( 'id' => 'health-check-disable', 'title' => esc_html__( 'Disable Troubleshooting Mode', 'health-check' ), 'parent' => 'health-check', 'href' => add_query_arg( array( 'health-check-disable-troubleshooting' => true, '_wpnonce' => $this->prepare_action_nonce( 'health-check-disable-troubleshooting', array() ), ), $this->get_clean_url() ), ) ); } public function test_site_state() { // Make sure the Health_Check_Loopback class is available to us, in case the primary plugin is disabled. if ( ! method_exists( 'Health_Check_Loopback', 'can_perform_loopback' ) ) { $plugin_file = trailingslashit( WP_PLUGIN_DIR ) . 'health-check/HealthCheck/class-health-check-loopback.php'; // Make sure the file exists, in case someone deleted the plugin manually, we don't want any errors. if ( ! file_exists( $plugin_file ) ) { // If the plugin files are inaccessible, we can't guarantee for the state of the site, so the default is a bad response. return false; } require_once( $plugin_file ); } $loopback_state = Health_Check_Loopback::can_perform_loopback(); if ( 'good' !== $loopback_state->status ) { return false; } return true; } public function dashboard_widget_scripts() { // Check that it's the dashboard page, we don't want to disturb any other pages. $screen = get_current_screen(); if ( 'dashboard' !== $screen->id && 'plugins' !== $screen->id ) { return; } } public function display_dashboard_widget() { // Check that it's the dashboard page, we don't want to disturb any other pages. $screen = get_current_screen(); if ( 'dashboard' !== $screen->id && 'plugins' !== $screen->id ) { return; } $notices = get_option( 'health-check-dashboard-notices', array() ); $active_plugins = array(); $inactive_plugins = array(); $themes = wp_prepare_themes_for_js(); ?>

%s', esc_html__( 'enabled', 'health-check' ) ) ); ?>

%s', esc_url( add_query_arg( array( 'health-check-disable-troubleshooting' => true, '_wpnonce' => $this->prepare_action_nonce( 'health-check-disable-troubleshooting', array() ), ), $this->get_clean_url() ) ), esc_html__( 'Disable Troubleshooting Mode', 'health-check' ) ); ?>

no effect on your site visitors, they will continue to view your site as usual, but for you it will look as if you had just installed WordPress for the first time.', 'health-check' ); ?>

any changes you make to settings will be kept when you disable Troubleshooting Mode.', 'health-check' ); ?>

User Switcher plugin allows for all of this while also being compatible with Troubleshooting Mode.', 'health-check' ); ?>

', esc_attr( $notice['severity'] ), wp_kses( $notice['message'], array( 'a' => array( 'class' => true, 'href' => true, 'aria-label' => true, ), ) ) ); } ?> %s
', esc_url( add_query_arg( array( 'health-check-dismiss-notices' => true, '_wpnonce' => $this->prepare_action_nonce( 'health-check-dismiss-notices', array() ), ), $this->get_clean_url() ) ), esc_html__( 'Dismiss notices', 'health-check' ) ); } ?>
show_nonce_validator ) { return; } $kses_allowed_markup = array( 'p' => array( 'class' ), 'ul' => array( 'class' ), 'li' => array( 'class' ), 'strong' => array(), 'em' => array(), ); $form_fields = array(); foreach ( $this->nonce_validator_fields as $field => $value ) { $form_fields[] = sprintf( '', esc_attr( $field ), esc_attr( $value ) ); } echo '
' . implode( "\n", $form_fields ) . '

' . esc_html__( 'Troubleshooting Mode - Security check', 'health-check' ) . '

' . esc_html__( 'You were attempting to perform an action that requires a security token, which was either not present in your request, or was considered invalid. Please verify that the following action is intentional, or feel free to cancel the action and nothing will change.', 'health-check' ) . '

' . wp_kses( $this->nonce_validator_details, $kses_allowed_markup ) . '
'; } } new Health_Check_Troubleshooting_MU(); PK!gzz/HealthCheck/BackCompat/class-wp-site-health.phpnu[init(); } public function init() { add_filter( 'cron_schedules', array( $this, 'cron_schedules' ) ); add_action( 'admin_menu', array( $this, 'action_admin_menu' ) ); add_action( 'admin_enqueue_scripts', array( $this, 'enqueues' ) ); add_action( 'site_health_tab_content', array( $this, 'site_health_tab' ) ); } public function cron_schedules( $schedules ) { if ( ! isset( $schedules['weekly'] ) ) { $schedules['weekly'] = array( 'interval' => 7 * DAY_IN_SECONDS, 'display' => __( 'Once weekly', 'health-check' ), ); } return $schedules; } /** * Enqueue assets. * * Conditionally enqueue our CSS and JavaScript when viewing plugin related pages in wp-admin. * * @uses wp_enqueue_style() * @uses plugins_url() * @uses wp_enqueue_script() * @uses wp_localize_script() * @uses esc_html__() * * @return void */ public function enqueues() { $screen = get_current_screen(); // Don't enqueue anything unless we're on the health check page. if ( 'tools_page_site-health' !== $screen->id ) { return; } $health_check = include HEALTH_CHECK_PLUGIN_DIRECTORY . 'build/health-check.asset.php'; wp_enqueue_style( 'health-check', trailingslashit( HEALTH_CHECK_PLUGIN_URL ) . 'build/health-check.css', array(), $health_check['version'] ); wp_enqueue_script( 'health-check', trailingslashit( HEALTH_CHECK_PLUGIN_URL ) . 'build/health-check.js', array( 'jquery' ), $health_check['version'] ); wp_localize_script( 'health-check', 'HealthCheck', array( 'nonce' => array( 'rest_api' => wp_create_nonce( 'wp_rest' ), ), ) ); } /** * Add item to the admin menu. * * @uses add_dashboard_page() * @uses __() * * @return void */ public function action_admin_menu() { $critical_issues = 0; $issue_counts = get_transient( 'health-check-site-status-result' ); if ( false !== $issue_counts ) { $issue_counts = json_decode( $issue_counts ); $critical_issues = absint( $issue_counts->critical ); } $critical_count = sprintf( '%s', esc_attr( $critical_issues ), sprintf( '%d %s', esc_html( $critical_issues ), esc_html_x( 'Critical issues', 'Issue counter label for the admin menu', 'health-check' ) ) ); $menu_title = sprintf( // translators: %s: Critical issue counter, if any. _x( 'Site Health %s', 'Menu Title', 'health-check' ), ( ! $issue_counts || $critical_issues < 1 ? '' : $critical_count ) ); add_submenu_page( 'tools.php', _x( 'Site Health', 'Page title', 'health-check' ), $menu_title, 'view_site_health_checks', 'site-health', array( $this, 'render_menu_page' ) ); } public function render_menu_page() { require_once HEALTH_CHECK_PLUGIN_DIRECTORY . '/pages/site-health-header.php'; $tab = ( isset( $_GET['tab'] ) && ! empty( $_GET['tab'] ) ? $_GET['tab'] : '' ); do_action( 'site_health_tab_content', $tab ); } public function site_health_tab( $tab ) { include_once( HEALTH_CHECK_PLUGIN_DIRECTORY . '/pages/site-health-header.php' ); switch ( Health_Check::current_tab() ) { case 'debug': include_once( HEALTH_CHECK_PLUGIN_DIRECTORY . '/pages/debug-data.php' ); break; case 'troubleshoot': include_once( HEALTH_CHECK_PLUGIN_DIRECTORY . '/pages/troubleshoot.php' ); break; case 'tools': include_once( HEALTH_CHECK_PLUGIN_DIRECTORY . '/pages/tools.php' ); break; case 'site-status': default: include_once( HEALTH_CHECK_PLUGIN_DIRECTORY . '/pages/site-status.php' ); } // Close out the div tag opened as a wrapper in the header. echo ''; } } new WP_Site_Health(); PK!C;.HealthCheck/BackCompat/class-wp-debug-data.phpnu[ $update ) { if ( 'upgrade' === $update->response ) { /* translators: %s: Latest WordPress version number. */ $core_update_needed = ' ' . sprintf( __( '(Latest version: %s)' ), $update->version ); } else { $core_update_needed = ''; } } } // Set up the array that holds all debug information. $info = array(); $info['wp-core'] = array( 'label' => __( 'WordPress' ), 'fields' => array( 'version' => array( 'label' => __( 'Version' ), 'value' => $core_version . $core_update_needed, 'debug' => $core_version, ), 'site_language' => array( 'label' => __( 'Site Language' ), 'value' => get_locale(), ), 'user_language' => array( 'label' => __( 'User Language' ), 'value' => get_user_locale(), ), 'timezone' => array( 'label' => __( 'Timezone' ), 'value' => wp_timezone_string(), ), 'home_url' => array( 'label' => __( 'Home URL' ), 'value' => get_bloginfo( 'url' ), 'private' => true, ), 'site_url' => array( 'label' => __( 'Site URL' ), 'value' => get_bloginfo( 'wpurl' ), 'private' => true, ), 'permalink' => array( 'label' => __( 'Permalink structure' ), 'value' => $permalink_structure ? $permalink_structure : __( 'No permalink structure set' ), 'debug' => $permalink_structure, ), 'https_status' => array( 'label' => __( 'Is this site using HTTPS?' ), 'value' => $is_ssl ? __( 'Yes' ) : __( 'No' ), 'debug' => $is_ssl, ), 'multisite' => array( 'label' => __( 'Is this a multisite?' ), 'value' => $is_multisite ? __( 'Yes' ) : __( 'No' ), 'debug' => $is_multisite, ), 'user_registration' => array( 'label' => __( 'Can anyone register on this site?' ), 'value' => $users_can_register ? __( 'Yes' ) : __( 'No' ), 'debug' => $users_can_register, ), 'blog_public' => array( 'label' => __( 'Is this site discouraging search engines?' ), 'value' => $blog_public ? __( 'No' ) : __( 'Yes' ), 'debug' => $blog_public, ), 'default_comment_status' => array( 'label' => __( 'Default comment status' ), 'value' => 'open' === $default_comment_status ? _x( 'Open', 'comment status' ) : _x( 'Closed', 'comment status' ), 'debug' => $default_comment_status, ), 'environment_type' => array( 'label' => __( 'Environment type' ), 'value' => $environment_type, 'debug' => $environment_type, ), ), ); if ( ! $is_multisite ) { $info['wp-paths-sizes'] = array( 'label' => __( 'Directories and Sizes' ), 'fields' => array(), ); } $info['wp-dropins'] = array( 'label' => __( 'Drop-ins' ), 'show_count' => true, 'description' => sprintf( /* translators: %s: wp-content directory name. */ __( 'Drop-ins are single files, found in the %s directory, that replace or enhance WordPress features in ways that are not possible for traditional plugins.' ), '' . str_replace( ABSPATH, '', WP_CONTENT_DIR ) . '' ), 'fields' => array(), ); $info['wp-active-theme'] = array( 'label' => __( 'Active Theme' ), 'fields' => array(), ); $info['wp-parent-theme'] = array( 'label' => __( 'Parent Theme' ), 'fields' => array(), ); $info['wp-themes-inactive'] = array( 'label' => __( 'Inactive Themes' ), 'show_count' => true, 'fields' => array(), ); $info['wp-mu-plugins'] = array( 'label' => __( 'Must Use Plugins' ), 'show_count' => true, 'fields' => array(), ); $info['wp-plugins-active'] = array( 'label' => __( 'Active Plugins' ), 'show_count' => true, 'fields' => array(), ); $info['wp-plugins-inactive'] = array( 'label' => __( 'Inactive Plugins' ), 'show_count' => true, 'fields' => array(), ); $info['wp-media'] = array( 'label' => __( 'Media Handling' ), 'fields' => array(), ); $info['wp-server'] = array( 'label' => __( 'Server' ), 'description' => __( 'The options shown below relate to your server setup. If changes are required, you may need your web host’s assistance.' ), 'fields' => array(), ); $info['wp-database'] = array( 'label' => __( 'Database' ), 'fields' => array(), ); // Check if WP_DEBUG_LOG is set. $wp_debug_log_value = __( 'Disabled' ); if ( is_string( WP_DEBUG_LOG ) ) { $wp_debug_log_value = WP_DEBUG_LOG; } elseif ( WP_DEBUG_LOG ) { $wp_debug_log_value = __( 'Enabled' ); } // Check CONCATENATE_SCRIPTS. if ( defined( 'CONCATENATE_SCRIPTS' ) ) { $concatenate_scripts = CONCATENATE_SCRIPTS ? __( 'Enabled' ) : __( 'Disabled' ); $concatenate_scripts_debug = CONCATENATE_SCRIPTS ? 'true' : 'false'; } else { $concatenate_scripts = __( 'Undefined' ); $concatenate_scripts_debug = 'undefined'; } // Check COMPRESS_SCRIPTS. if ( defined( 'COMPRESS_SCRIPTS' ) ) { $compress_scripts = COMPRESS_SCRIPTS ? __( 'Enabled' ) : __( 'Disabled' ); $compress_scripts_debug = COMPRESS_SCRIPTS ? 'true' : 'false'; } else { $compress_scripts = __( 'Undefined' ); $compress_scripts_debug = 'undefined'; } // Check COMPRESS_CSS. if ( defined( 'COMPRESS_CSS' ) ) { $compress_css = COMPRESS_CSS ? __( 'Enabled' ) : __( 'Disabled' ); $compress_css_debug = COMPRESS_CSS ? 'true' : 'false'; } else { $compress_css = __( 'Undefined' ); $compress_css_debug = 'undefined'; } // Check WP_LOCAL_DEV. if ( defined( 'WP_LOCAL_DEV' ) ) { $wp_local_dev = WP_LOCAL_DEV ? __( 'Enabled' ) : __( 'Disabled' ); $wp_local_dev_debug = WP_LOCAL_DEV ? 'true' : 'false'; } else { $wp_local_dev = __( 'Undefined' ); $wp_local_dev_debug = 'undefined'; } $info['wp-constants'] = array( 'label' => __( 'WordPress Constants' ), 'description' => __( 'These settings alter where and how parts of WordPress are loaded.' ), 'fields' => array( 'ABSPATH' => array( 'label' => 'ABSPATH', 'value' => ABSPATH, 'private' => true, ), 'WP_HOME' => array( 'label' => 'WP_HOME', 'value' => ( defined( 'WP_HOME' ) ? WP_HOME : __( 'Undefined' ) ), 'debug' => ( defined( 'WP_HOME' ) ? WP_HOME : 'undefined' ), ), 'WP_SITEURL' => array( 'label' => 'WP_SITEURL', 'value' => ( defined( 'WP_SITEURL' ) ? WP_SITEURL : __( 'Undefined' ) ), 'debug' => ( defined( 'WP_SITEURL' ) ? WP_SITEURL : 'undefined' ), ), 'WP_CONTENT_DIR' => array( 'label' => 'WP_CONTENT_DIR', 'value' => WP_CONTENT_DIR, ), 'WP_PLUGIN_DIR' => array( 'label' => 'WP_PLUGIN_DIR', 'value' => WP_PLUGIN_DIR, ), 'WP_MEMORY_LIMIT' => array( 'label' => 'WP_MEMORY_LIMIT', 'value' => WP_MEMORY_LIMIT, ), 'WP_MAX_MEMORY_LIMIT' => array( 'label' => 'WP_MAX_MEMORY_LIMIT', 'value' => WP_MAX_MEMORY_LIMIT, ), 'WP_DEBUG' => array( 'label' => 'WP_DEBUG', 'value' => WP_DEBUG ? __( 'Enabled' ) : __( 'Disabled' ), 'debug' => WP_DEBUG, ), 'WP_DEBUG_DISPLAY' => array( 'label' => 'WP_DEBUG_DISPLAY', 'value' => WP_DEBUG_DISPLAY ? __( 'Enabled' ) : __( 'Disabled' ), 'debug' => WP_DEBUG_DISPLAY, ), 'WP_DEBUG_LOG' => array( 'label' => 'WP_DEBUG_LOG', 'value' => $wp_debug_log_value, 'debug' => WP_DEBUG_LOG, ), 'SCRIPT_DEBUG' => array( 'label' => 'SCRIPT_DEBUG', 'value' => SCRIPT_DEBUG ? __( 'Enabled' ) : __( 'Disabled' ), 'debug' => SCRIPT_DEBUG, ), 'WP_CACHE' => array( 'label' => 'WP_CACHE', 'value' => WP_CACHE ? __( 'Enabled' ) : __( 'Disabled' ), 'debug' => WP_CACHE, ), 'CONCATENATE_SCRIPTS' => array( 'label' => 'CONCATENATE_SCRIPTS', 'value' => $concatenate_scripts, 'debug' => $concatenate_scripts_debug, ), 'COMPRESS_SCRIPTS' => array( 'label' => 'COMPRESS_SCRIPTS', 'value' => $compress_scripts, 'debug' => $compress_scripts_debug, ), 'COMPRESS_CSS' => array( 'label' => 'COMPRESS_CSS', 'value' => $compress_css, 'debug' => $compress_css_debug, ), 'WP_LOCAL_DEV' => array( 'label' => 'WP_LOCAL_DEV', 'value' => $wp_local_dev, 'debug' => $wp_local_dev_debug, ), 'DB_CHARSET' => array( 'label' => 'DB_CHARSET', 'value' => ( defined( 'DB_CHARSET' ) ? DB_CHARSET : __( 'Undefined' ) ), 'debug' => ( defined( 'DB_CHARSET' ) ? DB_CHARSET : 'undefined' ), ), 'DB_COLLATE' => array( 'label' => 'DB_COLLATE', 'value' => ( defined( 'DB_COLLATE' ) ? DB_COLLATE : __( 'Undefined' ) ), 'debug' => ( defined( 'DB_COLLATE' ) ? DB_COLLATE : 'undefined' ), ), ), ); $is_writable_abspath = wp_is_writable( ABSPATH ); $is_writable_wp_content_dir = wp_is_writable( WP_CONTENT_DIR ); $is_writable_upload_dir = wp_is_writable( $upload_dir['basedir'] ); $is_writable_wp_plugin_dir = wp_is_writable( WP_PLUGIN_DIR ); $is_writable_template_directory = wp_is_writable( get_theme_root( get_template() ) ); $info['wp-filesystem'] = array( 'label' => __( 'Filesystem Permissions' ), 'description' => __( 'Shows whether WordPress is able to write to the directories it needs access to.' ), 'fields' => array( 'wordpress' => array( 'label' => __( 'The main WordPress directory' ), 'value' => ( $is_writable_abspath ? __( 'Writable' ) : __( 'Not writable' ) ), 'debug' => ( $is_writable_abspath ? 'writable' : 'not writable' ), ), 'wp-content' => array( 'label' => __( 'The wp-content directory' ), 'value' => ( $is_writable_wp_content_dir ? __( 'Writable' ) : __( 'Not writable' ) ), 'debug' => ( $is_writable_wp_content_dir ? 'writable' : 'not writable' ), ), 'uploads' => array( 'label' => __( 'The uploads directory' ), 'value' => ( $is_writable_upload_dir ? __( 'Writable' ) : __( 'Not writable' ) ), 'debug' => ( $is_writable_upload_dir ? 'writable' : 'not writable' ), ), 'plugins' => array( 'label' => __( 'The plugins directory' ), 'value' => ( $is_writable_wp_plugin_dir ? __( 'Writable' ) : __( 'Not writable' ) ), 'debug' => ( $is_writable_wp_plugin_dir ? 'writable' : 'not writable' ), ), 'themes' => array( 'label' => __( 'The themes directory' ), 'value' => ( $is_writable_template_directory ? __( 'Writable' ) : __( 'Not writable' ) ), 'debug' => ( $is_writable_template_directory ? 'writable' : 'not writable' ), ), ), ); // Conditionally add debug information for multisite setups. if ( is_multisite() ) { $network_query = new WP_Network_Query(); $network_ids = $network_query->query( array( 'fields' => 'ids', 'number' => 100, 'no_found_rows' => false, ) ); $site_count = 0; foreach ( $network_ids as $network_id ) { $site_count += get_blog_count( $network_id ); } $info['wp-core']['fields']['user_count'] = array( 'label' => __( 'User count' ), 'value' => get_user_count(), ); $info['wp-core']['fields']['site_count'] = array( 'label' => __( 'Site count' ), 'value' => $site_count, ); $info['wp-core']['fields']['network_count'] = array( 'label' => __( 'Network count' ), 'value' => $network_query->found_networks, ); } else { $user_count = count_users(); $info['wp-core']['fields']['user_count'] = array( 'label' => __( 'User count' ), 'value' => $user_count['total_users'], ); } // WordPress features requiring processing. $wp_dotorg = wp_remote_get( 'https://wordpress.org', array( 'timeout' => 10 ) ); if ( ! is_wp_error( $wp_dotorg ) ) { $info['wp-core']['fields']['dotorg_communication'] = array( 'label' => __( 'Communication with WordPress.org' ), 'value' => __( 'WordPress.org is reachable' ), 'debug' => 'true', ); } else { $info['wp-core']['fields']['dotorg_communication'] = array( 'label' => __( 'Communication with WordPress.org' ), 'value' => sprintf( /* translators: 1: The IP address WordPress.org resolves to. 2: The error returned by the lookup. */ __( 'Unable to reach WordPress.org at %1$s: %2$s' ), gethostbyname( 'wordpress.org' ), $wp_dotorg->get_error_message() ), 'debug' => $wp_dotorg->get_error_message(), ); } // Get a list of all drop-in replacements. $dropins = get_dropins(); // Get dropins descriptions. $dropin_descriptions = _get_dropins(); // Spare few function calls. $not_available = __( 'Not available' ); foreach ( $dropins as $dropin_key => $dropin ) { $info['wp-dropins']['fields'][ sanitize_text_field( $dropin_key ) ] = array( 'label' => $dropin_key, 'value' => $dropin_descriptions[ $dropin_key ][0], 'debug' => 'true', ); } // Populate the media fields. $info['wp-media']['fields']['image_editor'] = array( 'label' => __( 'Active editor' ), 'value' => _wp_image_editor_choose(), ); // Get ImageMagic information, if available. if ( class_exists( 'Imagick' ) ) { // Save the Imagick instance for later use. $imagick = new Imagick(); $imagick_version = $imagick->getVersion(); } else { $imagick_version = __( 'Not available' ); } $info['wp-media']['fields']['imagick_module_version'] = array( 'label' => __( 'ImageMagick version number' ), 'value' => ( is_array( $imagick_version ) ? $imagick_version['versionNumber'] : $imagick_version ), ); $info['wp-media']['fields']['imagemagick_version'] = array( 'label' => __( 'ImageMagick version string' ), 'value' => ( is_array( $imagick_version ) ? $imagick_version['versionString'] : $imagick_version ), ); if ( ! function_exists( 'ini_get' ) ) { $info['wp-media']['fields']['ini_get'] = array( 'label' => __( 'File upload settings' ), 'value' => sprintf( /* translators: %s: ini_get() */ __( 'Unable to determine some settings, as the %s function has been disabled.' ), 'ini_get()' ), 'debug' => 'ini_get() is disabled', ); } else { // Get the PHP ini directive values. $post_max_size = ini_get( 'post_max_size' ); $upload_max_filesize = ini_get( 'upload_max_filesize' ); $max_file_uploads = ini_get( 'max_file_uploads' ); $effective = min( wp_convert_hr_to_bytes( $post_max_size ), wp_convert_hr_to_bytes( $upload_max_filesize ) ); // Add info in Media section. $info['wp-media']['fields']['file_uploads'] = array( 'label' => __( 'File uploads' ), 'value' => empty( ini_get( 'file_uploads' ) ) ? __( 'Disabled' ) : __( 'Enabled' ), 'debug' => 'File uploads is turned off', ); $info['wp-media']['fields']['post_max_size'] = array( 'label' => __( 'Max size of post data allowed' ), 'value' => $post_max_size, ); $info['wp-media']['fields']['upload_max_filesize'] = array( 'label' => __( 'Max size of an uploaded file' ), 'value' => $upload_max_filesize, ); $info['wp-media']['fields']['max_effective_size'] = array( 'label' => __( 'Max effective file size' ), 'value' => size_format( $effective ), ); $info['wp-media']['fields']['max_file_uploads'] = array( 'label' => __( 'Max number of files allowed' ), 'value' => number_format( $max_file_uploads ), ); } // If Imagick is used as our editor, provide some more information about its limitations. if ( 'WP_Image_Editor_Imagick' === _wp_image_editor_choose() && isset( $imagick ) && $imagick instanceof Imagick ) { $limits = array( 'area' => ( defined( 'imagick::RESOURCETYPE_AREA' ) ? size_format( $imagick->getResourceLimit( imagick::RESOURCETYPE_AREA ) ) : $not_available ), 'disk' => ( defined( 'imagick::RESOURCETYPE_DISK' ) ? $imagick->getResourceLimit( imagick::RESOURCETYPE_DISK ) : $not_available ), 'file' => ( defined( 'imagick::RESOURCETYPE_FILE' ) ? $imagick->getResourceLimit( imagick::RESOURCETYPE_FILE ) : $not_available ), 'map' => ( defined( 'imagick::RESOURCETYPE_MAP' ) ? size_format( $imagick->getResourceLimit( imagick::RESOURCETYPE_MAP ) ) : $not_available ), 'memory' => ( defined( 'imagick::RESOURCETYPE_MEMORY' ) ? size_format( $imagick->getResourceLimit( imagick::RESOURCETYPE_MEMORY ) ) : $not_available ), 'thread' => ( defined( 'imagick::RESOURCETYPE_THREAD' ) ? $imagick->getResourceLimit( imagick::RESOURCETYPE_THREAD ) : $not_available ), ); $limits_debug = array( 'imagick::RESOURCETYPE_AREA' => ( defined( 'imagick::RESOURCETYPE_AREA' ) ? size_format( $imagick->getResourceLimit( imagick::RESOURCETYPE_AREA ) ) : 'not available' ), 'imagick::RESOURCETYPE_DISK' => ( defined( 'imagick::RESOURCETYPE_DISK' ) ? $imagick->getResourceLimit( imagick::RESOURCETYPE_DISK ) : 'not available' ), 'imagick::RESOURCETYPE_FILE' => ( defined( 'imagick::RESOURCETYPE_FILE' ) ? $imagick->getResourceLimit( imagick::RESOURCETYPE_FILE ) : 'not available' ), 'imagick::RESOURCETYPE_MAP' => ( defined( 'imagick::RESOURCETYPE_MAP' ) ? size_format( $imagick->getResourceLimit( imagick::RESOURCETYPE_MAP ) ) : 'not available' ), 'imagick::RESOURCETYPE_MEMORY' => ( defined( 'imagick::RESOURCETYPE_MEMORY' ) ? size_format( $imagick->getResourceLimit( imagick::RESOURCETYPE_MEMORY ) ) : 'not available' ), 'imagick::RESOURCETYPE_THREAD' => ( defined( 'imagick::RESOURCETYPE_THREAD' ) ? $imagick->getResourceLimit( imagick::RESOURCETYPE_THREAD ) : 'not available' ), ); $info['wp-media']['fields']['imagick_limits'] = array( 'label' => __( 'Imagick Resource Limits' ), 'value' => $limits, 'debug' => $limits_debug, ); } // Get GD information, if available. if ( function_exists( 'gd_info' ) ) { $gd = gd_info(); } else { $gd = false; } $info['wp-media']['fields']['gd_version'] = array( 'label' => __( 'GD version' ), 'value' => ( is_array( $gd ) ? $gd['GD Version'] : $not_available ), 'debug' => ( is_array( $gd ) ? $gd['GD Version'] : 'not available' ), ); // Get Ghostscript information, if available. if ( function_exists( 'exec' ) ) { $gs = exec( 'gs --version' ); if ( empty( $gs ) ) { $gs = $not_available; $gs_debug = 'not available'; } else { $gs_debug = $gs; } } else { $gs = __( 'Unable to determine if Ghostscript is installed' ); $gs_debug = 'unknown'; } $info['wp-media']['fields']['ghostscript_version'] = array( 'label' => __( 'Ghostscript version' ), 'value' => $gs, 'debug' => $gs_debug, ); // Populate the server debug fields. if ( function_exists( 'php_uname' ) ) { $server_architecture = sprintf( '%s %s %s', php_uname( 's' ), php_uname( 'r' ), php_uname( 'm' ) ); } else { $server_architecture = 'unknown'; } if ( function_exists( 'phpversion' ) ) { $php_version_debug = phpversion(); // Whether PHP supports 64-bit. $php64bit = ( PHP_INT_SIZE * 8 === 64 ); $php_version = sprintf( '%s %s', $php_version_debug, ( $php64bit ? __( '(Supports 64bit values)' ) : __( '(Does not support 64bit values)' ) ) ); if ( $php64bit ) { $php_version_debug .= ' 64bit'; } } else { $php_version = __( 'Unable to determine PHP version' ); $php_version_debug = 'unknown'; } if ( function_exists( 'php_sapi_name' ) ) { $php_sapi = php_sapi_name(); } else { $php_sapi = 'unknown'; } $info['wp-server']['fields']['server_architecture'] = array( 'label' => __( 'Server architecture' ), 'value' => ( 'unknown' !== $server_architecture ? $server_architecture : __( 'Unable to determine server architecture' ) ), 'debug' => $server_architecture, ); $info['wp-server']['fields']['httpd_software'] = array( 'label' => __( 'Web server' ), 'value' => ( isset( $_SERVER['SERVER_SOFTWARE'] ) ? $_SERVER['SERVER_SOFTWARE'] : __( 'Unable to determine what web server software is used' ) ), 'debug' => ( isset( $_SERVER['SERVER_SOFTWARE'] ) ? $_SERVER['SERVER_SOFTWARE'] : 'unknown' ), ); $info['wp-server']['fields']['php_version'] = array( 'label' => __( 'PHP version' ), 'value' => $php_version, 'debug' => $php_version_debug, ); $info['wp-server']['fields']['php_sapi'] = array( 'label' => __( 'PHP SAPI' ), 'value' => ( 'unknown' !== $php_sapi ? $php_sapi : __( 'Unable to determine PHP SAPI' ) ), 'debug' => $php_sapi, ); // Some servers disable `ini_set()` and `ini_get()`, we check this before trying to get configuration values. if ( ! function_exists( 'ini_get' ) ) { $info['wp-server']['fields']['ini_get'] = array( 'label' => __( 'Server settings' ), 'value' => sprintf( /* translators: %s: ini_get() */ __( 'Unable to determine some settings, as the %s function has been disabled.' ), 'ini_get()' ), 'debug' => 'ini_get() is disabled', ); } else { $info['wp-server']['fields']['max_input_variables'] = array( 'label' => __( 'PHP max input variables' ), 'value' => ini_get( 'max_input_vars' ), ); $info['wp-server']['fields']['time_limit'] = array( 'label' => __( 'PHP time limit' ), 'value' => ini_get( 'max_execution_time' ), ); $info['wp-server']['fields']['memory_limit'] = array( 'label' => __( 'PHP memory limit' ), 'value' => ini_get( 'memory_limit' ), ); $info['wp-server']['fields']['max_input_time'] = array( 'label' => __( 'Max input time' ), 'value' => ini_get( 'max_input_time' ), ); $info['wp-server']['fields']['upload_max_filesize'] = array( 'label' => __( 'Upload max filesize' ), 'value' => ini_get( 'upload_max_filesize' ), ); $info['wp-server']['fields']['php_post_max_size'] = array( 'label' => __( 'PHP post max size' ), 'value' => ini_get( 'post_max_size' ), ); } if ( function_exists( 'curl_version' ) ) { $curl = curl_version(); $info['wp-server']['fields']['curl_version'] = array( 'label' => __( 'cURL version' ), 'value' => sprintf( '%s %s', $curl['version'], $curl['ssl_version'] ), ); } else { $info['wp-server']['fields']['curl_version'] = array( 'label' => __( 'cURL version' ), 'value' => $not_available, 'debug' => 'not available', ); } // SUHOSIN. $suhosin_loaded = ( extension_loaded( 'suhosin' ) || ( defined( 'SUHOSIN_PATCH' ) && constant( 'SUHOSIN_PATCH' ) ) ); $info['wp-server']['fields']['suhosin'] = array( 'label' => __( 'Is SUHOSIN installed?' ), 'value' => ( $suhosin_loaded ? __( 'Yes' ) : __( 'No' ) ), 'debug' => $suhosin_loaded, ); // Imagick. $imagick_loaded = extension_loaded( 'imagick' ); $info['wp-server']['fields']['imagick_availability'] = array( 'label' => __( 'Is the Imagick library available?' ), 'value' => ( $imagick_loaded ? __( 'Yes' ) : __( 'No' ) ), 'debug' => $imagick_loaded, ); // Pretty permalinks. $pretty_permalinks_supported = got_url_rewrite(); $info['wp-server']['fields']['pretty_permalinks'] = array( 'label' => __( 'Are pretty permalinks supported?' ), 'value' => ( $pretty_permalinks_supported ? __( 'Yes' ) : __( 'No' ) ), 'debug' => $pretty_permalinks_supported, ); // Check if a .htaccess file exists. if ( is_file( ABSPATH . '.htaccess' ) ) { // If the file exists, grab the content of it. $htaccess_content = file_get_contents( ABSPATH . '.htaccess' ); // Filter away the core WordPress rules. $filtered_htaccess_content = trim( preg_replace( '/\# BEGIN WordPress[\s\S]+?# END WordPress/si', '', $htaccess_content ) ); $filtered_htaccess_content = ! empty( $filtered_htaccess_content ); if ( $filtered_htaccess_content ) { /* translators: %s: .htaccess */ $htaccess_rules_string = sprintf( __( 'Custom rules have been added to your %s file.' ), '.htaccess' ); } else { /* translators: %s: .htaccess */ $htaccess_rules_string = sprintf( __( 'Your %s file contains only core WordPress features.' ), '.htaccess' ); } $info['wp-server']['fields']['htaccess_extra_rules'] = array( 'label' => __( '.htaccess rules' ), 'value' => $htaccess_rules_string, 'debug' => $filtered_htaccess_content, ); } // Populate the database debug fields. if ( is_resource( $wpdb->dbh ) ) { // Old mysql extension. $extension = 'mysql'; } elseif ( is_object( $wpdb->dbh ) ) { // mysqli or PDO. $extension = get_class( $wpdb->dbh ); } else { // Unknown sql extension. $extension = null; } $server = $wpdb->get_var( 'SELECT VERSION()' ); if ( isset( $wpdb->use_mysqli ) && $wpdb->use_mysqli ) { $client_version = $wpdb->dbh->client_info; } else { // phpcs:ignore WordPress.DB.RestrictedFunctions.mysql_mysql_get_client_info,PHPCompatibility.Extensions.RemovedExtensions.mysql_DeprecatedRemoved if ( preg_match( '|[0-9]{1,2}\.[0-9]{1,2}\.[0-9]{1,2}|', mysql_get_client_info(), $matches ) ) { $client_version = $matches[0]; } else { $client_version = null; } } $info['wp-database']['fields']['extension'] = array( 'label' => __( 'Extension' ), 'value' => $extension, ); $info['wp-database']['fields']['server_version'] = array( 'label' => __( 'Server version' ), 'value' => $server, ); $info['wp-database']['fields']['client_version'] = array( 'label' => __( 'Client version' ), 'value' => $client_version, ); $info['wp-database']['fields']['database_user'] = array( 'label' => __( 'Database username' ), 'value' => $wpdb->dbuser, 'private' => true, ); $info['wp-database']['fields']['database_host'] = array( 'label' => __( 'Database host' ), 'value' => $wpdb->dbhost, 'private' => true, ); $info['wp-database']['fields']['database_name'] = array( 'label' => __( 'Database name' ), 'value' => $wpdb->dbname, 'private' => true, ); $info['wp-database']['fields']['database_prefix'] = array( 'label' => __( 'Table prefix' ), 'value' => $wpdb->prefix, 'private' => true, ); $info['wp-database']['fields']['database_charset'] = array( 'label' => __( 'Database charset' ), 'value' => $wpdb->charset, 'private' => true, ); $info['wp-database']['fields']['database_collate'] = array( 'label' => __( 'Database collation' ), 'value' => $wpdb->collate, 'private' => true, ); // List must use plugins if there are any. $mu_plugins = get_mu_plugins(); foreach ( $mu_plugins as $plugin_path => $plugin ) { $plugin_version = $plugin['Version']; $plugin_author = $plugin['Author']; $plugin_version_string = __( 'No version or author information is available.' ); $plugin_version_string_debug = 'author: (undefined), version: (undefined)'; if ( ! empty( $plugin_version ) && ! empty( $plugin_author ) ) { /* translators: 1: Plugin version number. 2: Plugin author name. */ $plugin_version_string = sprintf( __( 'Version %1$s by %2$s' ), $plugin_version, $plugin_author ); $plugin_version_string_debug = sprintf( 'version: %s, author: %s', $plugin_version, $plugin_author ); } else { if ( ! empty( $plugin_author ) ) { /* translators: %s: Plugin author name. */ $plugin_version_string = sprintf( __( 'By %s' ), $plugin_author ); $plugin_version_string_debug = sprintf( 'author: %s, version: (undefined)', $plugin_author ); } if ( ! empty( $plugin_version ) ) { /* translators: %s: Plugin version number. */ $plugin_version_string = sprintf( __( 'Version %s' ), $plugin_version ); $plugin_version_string_debug = sprintf( 'author: (undefined), version: %s', $plugin_version ); } } $info['wp-mu-plugins']['fields'][ sanitize_text_field( $plugin['Name'] ) ] = array( 'label' => $plugin['Name'], 'value' => $plugin_version_string, 'debug' => $plugin_version_string_debug, ); } // List all available plugins. $plugins = get_plugins(); $plugin_updates = get_plugin_updates(); $transient = get_site_transient( 'update_plugins' ); foreach ( $plugins as $plugin_path => $plugin ) { $plugin_part = ( is_plugin_active( $plugin_path ) ) ? 'wp-plugins-active' : 'wp-plugins-inactive'; $plugin_version = $plugin['Version']; $plugin_author = $plugin['Author']; $plugin_version_string = __( 'No version or author information is available.' ); $plugin_version_string_debug = 'author: (undefined), version: (undefined)'; if ( ! empty( $plugin_version ) && ! empty( $plugin_author ) ) { /* translators: 1: Plugin version number. 2: Plugin author name. */ $plugin_version_string = sprintf( __( 'Version %1$s by %2$s' ), $plugin_version, $plugin_author ); $plugin_version_string_debug = sprintf( 'version: %s, author: %s', $plugin_version, $plugin_author ); } else { if ( ! empty( $plugin_author ) ) { /* translators: %s: Plugin author name. */ $plugin_version_string = sprintf( __( 'By %s' ), $plugin_author ); $plugin_version_string_debug = sprintf( 'author: %s, version: (undefined)', $plugin_author ); } if ( ! empty( $plugin_version ) ) { /* translators: %s: Plugin version number. */ $plugin_version_string = sprintf( __( 'Version %s' ), $plugin_version ); $plugin_version_string_debug = sprintf( 'author: (undefined), version: %s', $plugin_version ); } } if ( array_key_exists( $plugin_path, $plugin_updates ) ) { /* translators: %s: Latest plugin version number. */ $plugin_version_string .= ' ' . sprintf( __( '(Latest version: %s)' ), $plugin_updates[ $plugin_path ]->update->new_version ); $plugin_version_string_debug .= sprintf( ' (latest version: %s)', $plugin_updates[ $plugin_path ]->update->new_version ); } $info[ $plugin_part ]['fields'][ sanitize_text_field( $plugin['Name'] ) ] = array( 'label' => $plugin['Name'], 'value' => $plugin_version_string, 'debug' => $plugin_version_string_debug, ); } // Populate the section for the currently active theme. global $_wp_theme_features; $theme_features = array(); if ( ! empty( $_wp_theme_features ) ) { foreach ( $_wp_theme_features as $feature => $options ) { $theme_features[] = $feature; } } $active_theme = wp_get_theme(); $theme_updates = get_theme_updates(); $transient = get_site_transient( 'update_themes' ); $active_theme_version = $active_theme->version; $active_theme_version_debug = $active_theme_version; if ( array_key_exists( $active_theme->stylesheet, $theme_updates ) ) { $theme_update_new_version = $theme_updates[ $active_theme->stylesheet ]->update['new_version']; /* translators: %s: Latest theme version number. */ $active_theme_version .= ' ' . sprintf( __( '(Latest version: %s)' ), $theme_update_new_version ); $active_theme_version_debug .= sprintf( ' (latest version: %s)', $theme_update_new_version ); } $active_theme_author_uri = $active_theme->display( 'AuthorURI' ); if ( $active_theme->parent_theme ) { $active_theme_parent_theme = sprintf( /* translators: 1: Theme name. 2: Theme slug. */ __( '%1$s (%2$s)' ), $active_theme->parent_theme, $active_theme->template ); $active_theme_parent_theme_debug = sprintf( '%s (%s)', $active_theme->parent_theme, $active_theme->template ); } else { $active_theme_parent_theme = __( 'None' ); $active_theme_parent_theme_debug = 'none'; } $info['wp-active-theme']['fields'] = array( 'name' => array( 'label' => __( 'Name' ), 'value' => sprintf( /* translators: 1: Theme name. 2: Theme slug. */ __( '%1$s (%2$s)' ), $active_theme->name, $active_theme->stylesheet ), ), 'version' => array( 'label' => __( 'Version' ), 'value' => $active_theme_version, 'debug' => $active_theme_version_debug, ), 'author' => array( 'label' => __( 'Author' ), 'value' => wp_kses( $active_theme->author, array() ), ), 'author_website' => array( 'label' => __( 'Author website' ), 'value' => ( $active_theme_author_uri ? $active_theme_author_uri : __( 'Undefined' ) ), 'debug' => ( $active_theme_author_uri ? $active_theme_author_uri : '(undefined)' ), ), 'parent_theme' => array( 'label' => __( 'Parent theme' ), 'value' => $active_theme_parent_theme, 'debug' => $active_theme_parent_theme_debug, ), 'theme_features' => array( 'label' => __( 'Theme features' ), 'value' => implode( ', ', $theme_features ), ), 'theme_path' => array( 'label' => __( 'Theme directory location' ), 'value' => get_stylesheet_directory(), ), ); $parent_theme = $active_theme->parent(); if ( $parent_theme ) { $parent_theme_version = $parent_theme->version; $parent_theme_version_debug = $parent_theme_version; if ( array_key_exists( $parent_theme->stylesheet, $theme_updates ) ) { $parent_theme_update_new_version = $theme_updates[ $parent_theme->stylesheet ]->update['new_version']; /* translators: %s: Latest theme version number. */ $parent_theme_version .= ' ' . sprintf( __( '(Latest version: %s)' ), $parent_theme_update_new_version ); $parent_theme_version_debug .= sprintf( ' (latest version: %s)', $parent_theme_update_new_version ); } $parent_theme_author_uri = $parent_theme->display( 'AuthorURI' ); $info['wp-parent-theme']['fields'] = array( 'name' => array( 'label' => __( 'Name' ), 'value' => sprintf( /* translators: 1: Theme name. 2: Theme slug. */ __( '%1$s (%2$s)' ), $parent_theme->name, $parent_theme->stylesheet ), ), 'version' => array( 'label' => __( 'Version' ), 'value' => $parent_theme_version, 'debug' => $parent_theme_version_debug, ), 'author' => array( 'label' => __( 'Author' ), 'value' => wp_kses( $parent_theme->author, array() ), ), 'author_website' => array( 'label' => __( 'Author website' ), 'value' => ( $parent_theme_author_uri ? $parent_theme_author_uri : __( 'Undefined' ) ), 'debug' => ( $parent_theme_author_uri ? $parent_theme_author_uri : '(undefined)' ), ), 'theme_path' => array( 'label' => __( 'Theme directory location' ), 'value' => get_template_directory(), ), ); } // Populate a list of all themes available in the install. $all_themes = wp_get_themes(); foreach ( $all_themes as $theme_slug => $theme ) { // Exclude the currently active theme from the list of all themes. if ( $active_theme->stylesheet === $theme_slug ) { continue; } // Exclude the currently active parent theme from the list of all themes. if ( ! empty( $parent_theme ) && $parent_theme->stylesheet === $theme_slug ) { continue; } $theme_version = $theme->version; $theme_author = $theme->author; // Sanitize. $theme_author = wp_kses( $theme_author, array() ); $theme_version_string = __( 'No version or author information is available.' ); $theme_version_string_debug = 'undefined'; if ( ! empty( $theme_version ) && ! empty( $theme_author ) ) { /* translators: 1: Theme version number. 2: Theme author name. */ $theme_version_string = sprintf( __( 'Version %1$s by %2$s' ), $theme_version, $theme_author ); $theme_version_string_debug = sprintf( 'version: %s, author: %s', $theme_version, $theme_author ); } else { if ( ! empty( $theme_author ) ) { /* translators: %s: Theme author name. */ $theme_version_string = sprintf( __( 'By %s' ), $theme_author ); $theme_version_string_debug = sprintf( 'author: %s, version: (undefined)', $theme_author ); } if ( ! empty( $theme_version ) ) { /* translators: %s: Theme version number. */ $theme_version_string = sprintf( __( 'Version %s' ), $theme_version ); $theme_version_string_debug = sprintf( 'author: (undefined), version: %s', $theme_version ); } } if ( array_key_exists( $theme_slug, $theme_updates ) ) { /* translators: %s: Latest theme version number. */ $theme_version_string .= ' ' . sprintf( __( '(Latest version: %s)' ), $theme_updates[ $theme_slug ]->update['new_version'] ); $theme_version_string_debug .= sprintf( ' (latest version: %s)', $theme_updates[ $theme_slug ]->update['new_version'] ); } $info['wp-themes-inactive']['fields'][ sanitize_text_field( $theme->name ) ] = array( 'label' => sprintf( /* translators: 1: Theme name. 2: Theme slug. */ __( '%1$s (%2$s)' ), $theme->name, $theme_slug ), 'value' => $theme_version_string, 'debug' => $theme_version_string_debug, ); } // Add more filesystem checks. if ( defined( 'WPMU_PLUGIN_DIR' ) && is_dir( WPMU_PLUGIN_DIR ) ) { $is_writable_wpmu_plugin_dir = wp_is_writable( WPMU_PLUGIN_DIR ); $info['wp-filesystem']['fields']['mu-plugins'] = array( 'label' => __( 'The must use plugins directory' ), 'value' => ( $is_writable_wpmu_plugin_dir ? __( 'Writable' ) : __( 'Not writable' ) ), 'debug' => ( $is_writable_wpmu_plugin_dir ? 'writable' : 'not writable' ), ); } /** * Add or modify the debug information. * * Plugin or themes may wish to introduce their own debug information without creating additional admin pages * they can utilize this filter to introduce their own sections or add more data to existing sections. * * Array keys for sections added by core are all prefixed with `wp-`, plugins and themes should use their own slug as * a prefix, both for consistency as well as avoiding key collisions. Note that the array keys are used as labels * for the copied data. * * All strings are expected to be plain text except $description that can contain inline HTML tags (see below). * * @param array $args { * The debug information to be added to the core information page. * * This is an associative multi-dimensional array, up to three levels deep. The topmost array holds the sections. * Each section has a `$fields` associative array (see below), and each `$value` in `$fields` can be * another associative array of name/value pairs when there is more structured data to display. * * @type string $label The title for this section of the debug output. * @type string $description Optional. A description for your information section which may contain basic HTML * markup, inline tags only as it is outputted in a paragraph. * @type boolean $show_count Optional. If set to `true` the amount of fields will be included in the title for * this section. * @type boolean $private Optional. If set to `true` the section and all associated fields will be excluded * from the copied data. * @type array $fields { * An associative array containing the data to be displayed. * * @type string $label The label for this piece of information. * @type string $value The output that is displayed for this field. Text should be translated. Can be * an associative array that is displayed as name/value pairs. * @type string $debug Optional. The output that is used for this field when the user copies the data. * It should be more concise and not translated. If not set, the content of `$value` is used. * Note that the array keys are used as labels for the copied data. * @type boolean $private Optional. If set to `true` the field will not be included in the copied data * allowing you to show, for example, API keys here. * } * } * @since 5.2.0 * */ $info = apply_filters( 'debug_information', $info ); return $info; } /** * Format the information gathered for debugging, in a manner suitable for copying to a forum or support ticket. * * @param array $info_array Information gathered from the `WP_Debug_Data::debug_data` function. * @param string $type The data type to return, either 'info' or 'debug'. * * @return string The formatted data. * @since 5.2.0 * */ public static function format( $info_array, $type ) { $return = "`\n"; foreach ( $info_array as $section => $details ) { // Skip this section if there are no fields, or the section has been declared as private. if ( empty( $details['fields'] ) || ( isset( $details['private'] ) && $details['private'] ) ) { continue; } $section_label = 'debug' === $type ? $section : $details['label']; $return .= sprintf( "### %s%s ###\n\n", $section_label, ( isset( $details['show_count'] ) && $details['show_count'] ? sprintf( ' (%d)', count( $details['fields'] ) ) : '' ) ); foreach ( $details['fields'] as $field_name => $field ) { if ( isset( $field['private'] ) && true === $field['private'] ) { continue; } if ( 'debug' === $type && isset( $field['debug'] ) ) { $debug_data = $field['debug']; } else { $debug_data = $field['value']; } // Can be array, one level deep only. if ( is_array( $debug_data ) ) { $value = ''; foreach ( $debug_data as $sub_field_name => $sub_field_value ) { $value .= sprintf( "\n\t%s: %s", $sub_field_name, $sub_field_value ); } } elseif ( is_bool( $debug_data ) ) { $value = $debug_data ? 'true' : 'false'; } elseif ( empty( $debug_data ) && '0' !== $debug_data ) { $value = 'undefined'; } else { $value = $debug_data; } if ( 'debug' === $type ) { $label = $field_name; } else { $label = $field['label']; } $return .= sprintf( "%s: %s\n", $label, $value ); } $return .= "\n"; } $return .= '`'; return $return; } /** * Fetch the total size of all the database tables for the active database user. * * @return int The size of the database, in bytes. * @since 5.2.0 * */ public static function get_database_size() { global $wpdb; $size = 0; $rows = $wpdb->get_results( 'SHOW TABLE STATUS', ARRAY_A ); if ( $wpdb->num_rows > 0 ) { foreach ( $rows as $row ) { $size += $row['Data_length'] + $row['Index_length']; } } return (int) $size; } } PK!)s$$+HealthCheck/class-health-check-loopback.phpnu[ 'no-cache', ); // Include Basic auth in loopback requests. if ( isset( $_SERVER['PHP_AUTH_USER'] ) && isset( $_SERVER['PHP_AUTH_PW'] ) ) { $headers['Authorization'] = 'Basic ' . base64_encode( wp_unslash( $_SERVER['PHP_AUTH_USER'] ) . ':' . wp_unslash( $_SERVER['PHP_AUTH_PW'] ) ); } $url = admin_url(); if ( ! empty( $disable_plugin_hash ) ) { $url = add_query_arg( array( 'health-check-disable-plugin-hash' => $disable_plugin_hash, ), $url ); } if ( ! empty( $allowed_plugins ) ) { if ( ! is_array( $allowed_plugins ) ) { $allowed_plugins = (array) $allowed_plugins; } $url = add_query_arg( array( 'health-check-allowed-plugins' => implode( ',', $allowed_plugins ), ), $url ); } $r = wp_remote_get( $url, compact( 'cookies', 'headers', 'timeout' ) ); if ( is_wp_error( $r ) ) { return (object) array( 'status' => 'critical', 'message' => sprintf( '%s
%s', esc_html__( 'The loopback request to your site failed, this means features relying on them are not currently working as expected.', 'health-check' ), sprintf( /* translators: %1$d: The HTTP response code. %2$s: The error message returned. */ esc_html__( 'Error encountered: (%1$d) %2$s', 'health-check' ), wp_remote_retrieve_response_code( $r ), $r->get_error_message() ) ), ); } if ( 200 !== wp_remote_retrieve_response_code( $r ) ) { return (object) array( 'status' => 'recommended', 'message' => sprintf( /* translators: %d: The HTTP response code returned. */ esc_html__( 'The loopback request returned an unexpected http status code, %d, it was not possible to determine if this will prevent features from working as expected.', 'health-check' ), wp_remote_retrieve_response_code( $r ) ), ); } return (object) array( 'status' => 'good', 'message' => __( 'The loopback request to your site completed successfully.', 'health-check' ), ); } /** * Perform the loopback check, but ensure no plugins are enabled when we do so. * * @uses ob_start() * @uses Health_Check_Troubleshoot::mu_plugin_exists() * @uses Health_Check::get_filesystem_credentials() * @uses Health_Check_Troubleshoot::setup_must_use_plugin() * @uses Health_Check_Troubleshoot::maybe_update_must_use_plugin() * @uses ob_get_clean() * @uses wp_send_json_error() * @uses md5() * @uses rand() * @uses update_option() * @uses Health_Check_Loopback::can_perform_loopback() * @uses sprintf() * @uses esc_attr() * @uses esc_html__() * @uses esc_html() * @uses wp_send_json_success() * * @return void */ static function loopback_no_plugins() { check_ajax_referer( 'health-check-loopback-no-plugins' ); if ( ! current_user_can( 'view_site_health_checks' ) ) { wp_send_json_error(); } ob_start(); $needs_creds = false; if ( ! Health_Check_Troubleshoot::mu_plugin_exists() ) { if ( ! Health_Check::get_filesystem_credentials() ) { $needs_creds = true; } else { $check_output = Health_Check_Troubleshoot::setup_must_use_plugin(); if ( false === $check_output ) { $needs_creds = true; } } } else { if ( ! Health_Check_Troubleshoot::maybe_update_must_use_plugin() ) { $needs_creds = true; } } $result = ob_get_clean(); if ( $needs_creds ) { wp_send_json_error( $result ); die(); } $loopback_hash = md5( rand() ); update_option( 'health-check-disable-plugin-hash', $loopback_hash ); update_option( 'health-check-default-theme', 'yes' ); $no_plugin_test = Health_Check_Loopback::can_perform_loopback( $loopback_hash ); $message = sprintf( '
%s: %s', esc_attr( $no_plugin_test->status ), esc_html__( 'Result from testing without any plugins active and a default theme', 'health-check' ), $no_plugin_test->message ); if ( 'error' !== $no_plugin_test->status ) { $plugins = wp_get_active_and_valid_plugins(); $theme = wp_get_theme(); $message .= ''; foreach ( $plugins as $single_plugin ) { $plugin = get_plugin_data( $single_plugin ); $message .= sprintf( '', esc_attr( plugin_basename( $single_plugin ) ), esc_html( $plugin['Name'] ), esc_html__( 'Waiting...', 'health-check' ) ); } $message .= sprintf( '', sprintf( // translators: %s: The active theme name. esc_html__( 'Active theme: %s', 'health-check' ), $theme->name ), esc_html__( 'Waiting...', 'health-check' ) ); $message .= '
%s%s
%s%s
'; $message .= '
'; } $response = array( 'message' => $message, ); delete_option( 'health-check-default-theme' ); wp_send_json_success( $response ); die(); } /** * Test individual plugins for loopback compatibility issues. * * This function will perform the loopback check, without any plugins, then conditionally enables one plugin at a time. * * @uses ob_start() * @uses Health_Check_Troubleshoot::mu_plugin_exists() * @uses Health_Check::get_filesystem_credentials() * @uses Health_Check_Troubleshoot::setup_must_use_plugin() * @uses ob_get_clean() * @uses wp_send_json_error() * @uses delete_option() * @uses get_option() * @uses md5() * @uses rand() * @uses update_option() * @uses explode() * @uses Health_Check_Loopback::can_perform_loopback() * @uses sprintf() * @uses esc_attr() * @uses esc_html__() * @uses esc_html() * @uses wp_send_json_success() * * @return void */ static function loopback_test_individual_plugins() { check_ajax_referer( 'health-check-loopback-individual-plugins' ); if ( ! current_user_can( 'view_site_health_checks' ) ) { wp_send_json_error(); } ob_start(); $needs_creds = false; if ( ! Health_Check_Troubleshoot::mu_plugin_exists() ) { if ( ! Health_Check::get_filesystem_credentials() ) { $needs_creds = true; } else { Health_Check_Troubleshoot::setup_must_use_plugin(); } } $result = ob_get_clean(); if ( $needs_creds ) { wp_send_json_error( $result ); die(); } delete_option( 'health-check-disable-plugin-hash' ); $loopback_hash = md5( rand() ); update_option( 'health-check-disable-plugin-hash', $loopback_hash ); $plugin_slug = explode( '/', $_POST['plugin'] ); $plugin_slug = $plugin_slug[0]; $single_test = Health_Check_Loopback::can_perform_loopback( $loopback_hash, $plugin_slug ); $message = sprintf( ' %s', esc_attr( $single_test->status ), $single_test->message ); $response = array( 'message' => $message, ); wp_send_json_success( $response ); die(); } static function loopback_test_default_theme() { check_ajax_referer( 'health-check-loopback-default-theme' ); if ( ! current_user_can( 'view_site_health_checks' ) ) { wp_send_json_error(); } ob_start(); $needs_creds = false; if ( ! Health_Check_Troubleshoot::mu_plugin_exists() ) { if ( ! Health_Check::get_filesystem_credentials() ) { $needs_creds = true; } else { Health_Check_Troubleshoot::setup_must_use_plugin(); } } $result = ob_get_clean(); if ( $needs_creds ) { wp_send_json_error( $result ); die(); } delete_option( 'health-check-disable-plugin-hash' ); $loopback_hash = md5( rand() ); update_option( 'health-check-disable-plugin-hash', $loopback_hash ); $message = ''; // Test without a theme active. update_option( 'health-check-default-theme', 'yes' ); $theme_test = Health_Check_Loopback::can_perform_loopback( $loopback_hash, '' ); $message .= sprintf( ' %s', esc_attr( $theme_test->status ), $theme_test->message ); delete_option( 'health-check-default-theme' ); $response = array( 'message' => $message, ); wp_send_json_success( $response ); die(); } } PK!\=4  =HealthCheck/Tools/class-health-check-plugin-compatibility.phpnu[label = __( 'Plugin compatibility', 'health-check' ); $this->description = sprintf( '%s
%s', __( 'Attempt to identify the compatibility of your plugins before upgrading PHP, note that a compatibility check may not always be accurate, and you may want to contact the plugin author to confirm that things will continue working.', 'health-check' ), __( 'The compatibility check will need to send requests to the WPTide project to fetch the test results for each of your plugins.', 'health-check' ) ); add_action( 'rest_api_init', array( $this, 'register_plugin_compat_rest_route' ) ); parent::__construct(); } public function register_plugin_compat_rest_route() { register_rest_route( 'health-check/v1', 'plugin-compat', array( 'methods' => 'POST', 'callback' => array( $this, 'check_plugin_version' ), 'permission_callback' => function() { return current_user_can( 'view_site_health_checks' ); }, ) ); } public function tab_content() { ?> $plugin ) { printf( '', esc_attr( $slug ), esc_attr( $plugin['Version'] ), $plugin['Name'], $plugin['Version'], ( isset( $plugin['RequiresPHP'] ) && ! empty( $plugin['RequiresPHP'] ) ? $plugin['RequiresPHP'] : '—' ), '' ); } ?>
%s%s%s%s

has_param( 'slug' ) || ! $request->has_param( 'version' ) ) { return new WP_Error( 'missing_arg', __( 'The slug, or version, is missing from the request.', 'health-check' ) ); } $slug = $request->get_param( 'slug' ); $version = $request->get_param( 'version' ); /* * Override for the Health Check plugin, which has back-compat code we are aware * of and can account for early on. It should not become a habit to add exceptions for * plugins in this field, this is rather to avoid confusion and concern in users of this plugin specifically. */ if ( 'health-check/health-check.php' === $slug ) { $response = array( 'version' => '8.1', ); } else { $response = array( 'version' => $this->get_highest_supported_php( $slug, $version ), ); } return new WP_REST_Response( $response, 200 ); } function get_highest_supported_php( $slug, $version ) { $versions = $this->get_supported_php( $slug, $version ); if ( empty( $versions ) ) { return __( 'Could not be determined', 'health-check' ); } $highest = 0; foreach ( $versions as $version ) { if ( version_compare( $version, $highest, '>' ) ) { $highest = $version; } } return $highest; } function get_supported_php( $slug, $version ) { // Clean up the slug, in case it's got more details if ( stristr( $slug, '/' ) ) { $parts = explode( '/', $slug ); $slug = $parts[0]; } $transient_name = sprintf( 'health-check-tide-%s-%s', $slug, $version ); $tide_versions = get_transient( $transient_name ); if ( false === $tide_versions ) { $tide_api_response = wp_remote_get( sprintf( 'https://wptide.org/api/v1/audit/wporg/plugin/%s/%s?reports=all', $slug, $version ) ); $tide_response = wp_remote_retrieve_body( $tide_api_response ); $json = json_decode( $tide_response ); if ( empty( $json ) || ! isset( $json->reports->phpcs_phpcompatibilitywp->report->compatible ) ) { $tide_versions = array(); } else { $tide_versions = $json->reports->phpcs_phpcompatibilitywp->report->compatible; } set_transient( $transient_name, $tide_versions, 1 * WEEK_IN_SECONDS ); } return $tide_versions; } } new Health_Check_Plugin_Compatibility(); PK!XVI3HealthCheck/Tools/class-health-check-mail-check.phpnu[label = __( 'Mail Check', 'health-check' ); $this->description = __( 'The Mail Check will invoke the wp_mail() function and check if it succeeds. We will use the E-mail address you have set up, but you can change it below if you like.', 'health-check' ); add_action( 'wp_ajax_health-check-mail-check', array( $this, 'run_mail_check' ) ); parent::__construct(); } /** * Checks if wp_mail() works. * * @uses sanitize_email() * @uses wp_mail() * @uses wp_send_json_success() * @uses wp_die() * * @return void */ public function run_mail_check() { check_ajax_referer( 'health-check-mail-check' ); if ( ! current_user_can( 'view_site_health_checks' ) ) { wp_send_json_error(); } add_action( 'wp_mail_failed', array( $this, 'mail_failed' ) ); $output = ''; $sendmail = false; $email = sanitize_email( $_POST['email'] ); $email_message = sanitize_text_field( $_POST['email_message'] ); $wp_address = get_bloginfo( 'url' ); $wp_name = get_bloginfo( 'name' ); $date = date_i18n( get_option( 'date_format' ), current_time( 'timestamp' ) ); // phpcs:ignore WordPress.DateTime.CurrentTimeTimestamp.Requested $time = date_i18n( get_option( 'time_format' ), current_time( 'timestamp' ) ); // phpcs:ignore WordPress.DateTime.CurrentTimeTimestamp.Requested // translators: %s: website url. $email_subject = sprintf( esc_html__( 'Health Check – Test Message from %s', 'health-check' ), $wp_address ); $email_body = sprintf( // translators: %1$s: website name. %2$s: website url. %3$s: The date the message was sent. %4$s: The time the message was sent. __( 'Hi! This test message was sent by the Health Check plugin from %1$s (%2$s) on %3$s at %4$s. Since you’re reading this, it obviously works.', 'health-check' ), $wp_name, $wp_address, $date, $time, $email_message ); if ( ! empty( $email_message ) ) { $email_body .= "\n\n" . sprintf( // translators: %s: The custom message that may be included with the email. __( 'Additional message from admin: %s', 'health-check' ), $email_message ); } // Store the time before we send the email. $pre_send_timer = microtime( true ); $sendmail = wp_mail( $email, $email_subject, $email_body ); // Store the time after we send the email. $post_send_timer = microtime( true ); if ( ! empty( $sendmail ) ) { $output .= '

'; $output .= __( 'We have just sent an e-mail using wp_mail() and it seems to work. Please check your inbox and spam folder to see if you received it.', 'health-check' ); $output .= '

'; // Check how long the `wp_mail` function took, if it exceeds 3 seconds, it may indicate that something is not working correctly. if ( ( $post_send_timer - $pre_send_timer ) > 3 ) { $output .= '

'; $output .= __( 'The e-mail took a while to send; this may indicate that your server is really busy, or that the sending of emails may be experiencing other unexpected issues. If you experience continued issues, consider reaching out to your hosting provider.', 'health-check' ); $output .= '

'; } } else { $output .= '

'; $output .= esc_html__( 'It seems there was a problem sending the e-mail.', 'health-check' ); $output .= '

' . $this->mail_error->get_error_message(); $output .= '

'; } $response = array( 'message' => $output, ); wp_send_json_success( $response ); wp_die(); } /** * Capture errors when sending emails from WordPress. * * @param \WP_Error $error A WP_Error object containing the PHPMailer error. * * @return void */ public function mail_failed( $error ) { $this->mail_error = $error; } /** * Add the Mail Checker to the tools tab. * * @return void */ public function tab_content() { ?>

label = __( 'robots.txt Viewer', 'health-check' ); $this->description = __( 'The robots.txt file tells search engines which directories are allowed to be crawled and which not. WordPress generates a virtual file if there is no physical file. If there is a non-virtual file, the content will be displayed here.', 'health-check' ); parent::__construct(); } public function tab_content() { global $wp_rewrite; if ( file_exists( ABSPATH . 'robots.txt' ) ) { printf( '
%s
', esc_html( file_get_contents( ABSPATH . 'robots.txt' ) ) ); } else { printf( '

%s

', __( 'Your site is using the virtual robots.txt file which is generated by WordPress.', 'health-check' ) ); } ?> label = __( '.htaccess Viewer', 'health-check' ); $this->description = __( 'The .htaccess file tells your server (if supported) how to handle links and file requests. This file usually requires direct server access to view, but if your system supports these files, you can verify its content here.', 'health-check' ); parent::__construct(); } public function tab_content() { global $wp_rewrite; if ( $wp_rewrite->using_mod_rewrite_permalinks() ) { if ( file_exists( ABSPATH . '.htaccess' ) ) { printf( '
%s
', esc_html( file_get_contents( ABSPATH . '.htaccess' ) ) ); } else { printf( '

%s

', __( 'Your site is using .htaccess rules to handle permalinks, but no .htaccess file was found. This means that your .htaccess file is not being used to handle requests.', 'health-check' ) ); } } else { printf( '

%s

', __( 'Your site is not using .htaccess to handle permalinks. This means that your .htaccess file is not being used to handle requests, and they are most likely handled directly by your web-server software.', 'health-check' ) ); } ?> label = __( 'File integrity', 'health-check' ); $this->description = __( 'The File Integrity checks all the core files with the checksums provided by the WordPress API to see if they are intact. If there are changes you will be able to make a Diff between the files hosted on WordPress.org and your installation to see what has been changed.', 'health-check' ); add_action( 'wp_ajax_health-check-files-integrity-check', array( $this, 'run_files_integrity_check' ) ); add_action( 'wp_ajax_health-check-view-file-diff', array( $this, 'view_file_diff' ) ); parent::__construct(); } /** * Gathers checksums from WordPress API and cross checks the core files in the current installation. * * @return void */ function run_files_integrity_check() { check_ajax_referer( 'health-check-files-integrity-check' ); $checksums = $this->call_checksum_api(); $files = $this->parse_checksum_results( $checksums ); $this->create_the_response( $files ); } /** * Calls the WordPress API on the checksums endpoint * * @uses get_bloginfo() * @uses get_locale() * @uses ABSPATH * @uses wp_remote_get() * @uses get_bloginfo() * @uses strpos() * @uses unset() * * @return array */ function call_checksum_api() { // Setup variables. $wpversion = get_bloginfo( 'version' ); $wplocale = get_locale(); // Setup API Call. $checksums = get_core_checksums( $wpversion, $wplocale ); if ( false === $checksums ) { return $checksums; } set_transient( 'health-check-checksums', $checksums, 2 * HOUR_IN_SECONDS ); // Remove the wp-content/ files from checking foreach ( $checksums as $file => $checksum ) { if ( false !== strpos( $file, 'wp-content/' ) ) { unset( $checksums[ $file ] ); } } return $checksums; } /** * Parses the results from the WordPress API call * * @uses file_exists() * @uses md5_file() * @uses ABSPATH * * @param array $checksums * * @return array|bool */ function parse_checksum_results( $checksums ) { // Check if the checksums are valid if ( false === $checksums ) { return false; } $filepath = ABSPATH; $files = array(); // Parse the results to validate checksums. foreach ( $checksums as $file => $checksum ) { // Check the files. if ( file_exists( $filepath . $file ) && md5_file( $filepath . $file ) !== $checksum ) { $reason = esc_html__( 'Content changed', 'health-check' ) . ' ' . esc_html__( '(View Diff)', 'health-check' ) . ''; array_push( $files, array( $file, $reason ) ); } elseif ( ! file_exists( $filepath . $file ) ) { $reason = esc_html__( 'File not found', 'health-check' ); array_push( $files, array( $file, $reason ) ); } } // Iterate over the core directories to see if any unexpected files exist, but only if the directory iterator is available. if ( class_exists( 'RecursiveDirectoryIterator' ) ) { $directories = array( untrailingslashit( ABSPATH ), // Root directory. untrailingslashit( ABSPATH . 'wp-admin' ), // Admin directory. untrailingslashit( ABSPATH . WPINC ), // Includes directory. ); // Files that will not exist in the checksum iterator, but are expected and should not cause a warning. $excluded_files = array( 'wp-config.php', ); foreach ( $directories as $directory ) { // For the root path, do not recursively iterate, to avoid false positives from the `wp-content` directory. if ( untrailingslashit( ABSPATH ) === $directory ) { $iterator = new DirectoryIterator( $directory ); foreach ( $iterator as $file ) { if ( $file->isFile() ) { $path = str_replace( ABSPATH, '', $file->getPathname() ); if ( ! isset( $checksums[ $path ] ) && ! in_array( $path, $excluded_files, true ) ) { $reason = esc_html__( 'This is an unknown file', 'health-check' ); array_push( $files, array( $path, $reason ) ); } } } } else { $iterator = new RecursiveIteratorIterator( new RecursiveDirectoryIterator( $directory ) ); foreach ( $iterator as $file ) { if ( $file->isFile() ) { $path = str_replace( ABSPATH, '', $file->getPathname() ); if ( ! isset( $checksums[ $path ] ) && ! in_array( $path, $excluded_files, true ) ) { $reason = esc_html__( 'This is an unknown file', 'health-check' ); array_push( $files, array( $path, $reason ) ); } } } } } } return $files; } /** * Generates the response * * @uses wp_send_json_success() * @uses wp_die() * @uses ABSPATH * * @param null|array $files * * @return void */ function create_the_response( $files ) { $filepath = ABSPATH; $output = ''; if ( empty( $files ) ) { $output .= '

'; $output .= esc_html__( 'All files passed the check. Everything seems to be ok!', 'health-check' ); $output .= '

'; } else { $output .= '

'; $output .= esc_html__( 'It appears as if some files may have been modified.', 'health-check' ); $output .= '
' . esc_html__( 'One possible reason for this may be that your installation contains translated versions. An easy way to clear this is to reinstall WordPress. Don\'t worry. This will only affect WordPress\' own files, not your themes, plugins or uploaded media.', 'health-check' ); $output .= '

'; foreach ( $files as $tampered ) { $output .= ''; $output .= ''; $output .= ''; $output .= ''; $output .= ''; } $output .= ''; $output .= '
'; $output .= esc_html__( 'Status', 'health-check' ); $output .= ''; $output .= esc_html__( 'File', 'health-check' ); $output .= ''; $output .= esc_html__( 'Reason', 'health-check' ); $output .= '
'; $output .= esc_html__( 'Status', 'health-check' ); $output .= ''; $output .= esc_html__( 'File', 'health-check' ); $output .= ''; $output .= esc_html__( 'Reason', 'health-check' ); $output .= '
' . esc_html__( 'Error', 'health-check' ) . '' . $filepath . $tampered[0] . '' . $tampered[1] . '
'; } $response = array( 'message' => $output, ); wp_send_json_success( $response ); wp_die(); } /** * Generates Diff view * * @uses get_bloginfo() * @uses wp_remote_get() * @uses wp_remote_retrieve_body() * @uses wp_send_json_success() * @uses wp_die() * @uses ABSPATH * @uses FILE_USE_INCLUDE_PATH * @uses wp_text_diff() * * * @return void */ function view_file_diff() { check_ajax_referer( 'health-check-view-file-diff' ); if ( ! current_user_can( 'view_site_health_checks' ) ) { wp_send_json_error(); } $filepath = ABSPATH; $file = $_POST['file']; $wpversion = get_bloginfo( 'version' ); if ( 0 !== validate_file( $file ) ) { wp_send_json_error( array( 'message' => esc_html__( 'You do not have access to this file.', 'health-check' ) ) ); } $allowed_files = get_transient( 'health-check-checksums' ); if ( false === $allowed_files ) { $allowed_files = $this->call_checksum_api(); } if ( ! isset( $allowed_files[ $file ] ) ) { wp_send_json_error( array( 'message' => esc_html__( 'You do not have access to this file.', 'health-check' ) ) ); } $local_file_body = file_get_contents( $filepath . $file, FILE_USE_INCLUDE_PATH ); $remote_file = wp_remote_get( 'https://core.svn.wordpress.org/tags/' . $wpversion . '/' . $file ); $remote_file_body = wp_remote_retrieve_body( $remote_file ); $diff_args = array( 'show_split_view' => true, ); $output = '
'; $output .= esc_html__( 'Original', 'health-check' ); $output .= ''; $output .= esc_html__( 'Modified', 'health-check' ); $output .= '
'; $output .= wp_text_diff( $remote_file_body, $local_file_body, $diff_args ); $response = array( 'message' => $output, ); wp_send_json_success( $response ); wp_die(); } /** * Add the Files integrity checker to the tools tab. * * @return void */ public function tab_content() { ?>

label = __( 'Debug logs', 'health-check' ); $this->description = __( 'The details below are gathered from your debug.log file, and is displayed because the WP_DEBUG_LOG constant has been set to allow logging of warnings and errors.', 'health-check' ); parent::__construct(); } private function read_debug_log() { if ( ! defined( 'WP_DEBUG_LOG' ) || false === WP_DEBUG_LOG ) { return ''; } $logfile = WP_DEBUG_LOG; /* * `WP_DEBUG_LOG` can be a boolean value, or a path to a file. * In the case of a boolean value of `true`, the default file location path will be used. */ if ( is_bool( $logfile ) ) { $logfile = WP_CONTENT_DIR . '/debug.log'; } if ( ! file_exists( $logfile ) ) { return ''; } $debug_log = @file_get_contents( $logfile ); if ( false === $debug_log ) { return sprintf( // translators: %s: The path to the debug log file. __( 'The debug log file found at `%s`, could not be read.', 'health-check' ), $logfile ); } return $debug_log; } public function tab_content() { if ( ! defined( 'WP_DEBUG_LOG' ) || false === WP_DEBUG_LOG ) : printf( '

%s

', __( 'Because the WP_DEBUG_LOG constant is not set to allow logging of errors and warnings, and there is therefore no more details here.', 'health-check' ) ); printf( '

%s

', sprintf( // translators: %s: The URL to the Debugging in WordPress article. __( 'You can read more about the WP_DEBUG_LOG constant, and how to enable it, in the Debugging in WordPress article.', 'health-check' ), // translators: The localized URL to the Debugging in WordPress article, if available. __( 'https://wordpress.org/documentation/article/debugging-in-wordpress/#wp_debug_log', 'health-check' ) ) ); ?> label = __( 'PHP Info', 'health-check' ); if ( ! function_exists( 'phpinfo' ) ) { $this->description = __( 'The phpinfo() function has been disabled by your host. Please contact the host if you need more information about your setup.', 'health-check' ); } else { $this->description = __( 'Some scenarios require you to look up more detailed server configurations than what is normally required. The PHP Info page allows you to view all available configuration options for your PHP setup. Please be advised that WordPress does not guarantee that any information shown on that page may not be considered sensitive.', 'health-check' ); } add_action( 'site_health_tab_content', array( $this, 'add_site_health_tab_content' ) ); parent::__construct(); } /** * Render the PHP Info tab content. * * @param string $tab The slug of the tab being requested. * @return void */ public function add_site_health_tab_content( $tab ) { // If the host has disabled `phpinfo()`, do not try to load the page.. if ( ! function_exists( 'phpinfo' ) ) { return; } if ( 'phpinfo' === $tab ) { include_once( HEALTH_CHECK_PLUGIN_DIRECTORY . '/pages/phpinfo.php' ); } } /** * Render the PHP Info tab content. * * @return void */ public function tab_content() { // If the host has disabled `phpinfo()`, do not offer a button alternative. if ( ! function_exists( 'phpinfo' ) ) { return; } $phpinfo_url = add_query_arg( array( 'tab' => 'phpinfo' ), admin_url( 'site-health.php' ) ); if ( defined( 'HEALTH_CHECK_BACKCOMPAT_LOADED' ) && HEALTH_CHECK_BACKCOMPAT_LOADED ) { $phpinfo_url = add_query_arg( array( 'page' => 'site-health', 'tab' => 'phpinfo', ), admin_url( 'tools.php' ) ); } ?>
%s', esc_url( $phpinfo_url ), __( 'View extended PHP information', 'health-check' ) ); ?>
label ) || empty( $this->label ) ) { return $tabs; } ob_start(); ?>
has_description() ) : ?>

get_description(); ?>

tab_content(); ?>
$this->label, 'content' => $tab_content, ); return $tabs; } public function tab_content() {} public function has_description() { return isset( $this->description ) && ! empty( $this->description ); } public function get_description() { return $this->description; } } PK!k6HealthCheck/Tools/class-health-check-beta-features.phpnu[label = __( 'Beta features', 'health-check' ); $this->description = __( 'The plugin may contain beta features, which you as the site owner can enable or disable as you wish.', 'health-check' ); parent::__construct(); add_action( 'admin_init', array( $this, 'toggle_beta_features' ) ); } public function toggle_beta_features() { if ( ! isset( $_GET['health-check-beta-features'] ) || ! current_user_can( 'view_site_health_checks' ) ) { return; } if ( ! isset( $_GET['_wpnonce'] ) ) { return; } if ( ! wp_verify_nonce( $_GET['_wpnonce'], 'health-check-beta-features' ) ) { return; } if ( 'enable' === $_GET['health-check-beta-features'] ) { update_option( 'health-check-beta-features', true ); } else { update_option( 'health-check-beta-features', false ); } wp_safe_redirect( admin_url( 'site-health.php?tab=tools' ) ); } public function tab_content() { $feature_status = get_option( 'health-check-beta-features', false ); if ( ! $feature_status ) { printf( '%s', esc_url( wp_nonce_url( add_query_arg( 'health-check-beta-features', 'enable' ), 'health-check-beta-features' ) ), esc_html__( 'Enable beta features', 'health-check' ) ); } else { printf( '%s', esc_url( wp_nonce_url( add_query_arg( 'health-check-beta-features', 'disable' ), 'health-check-beta-features' ) ), esc_html__( 'Disable beta features', 'health-check' ) ); } } } new Health_Check_Beta_Features(); PK!.HealthCheck/class-health-check-screenshots.phpnu[should_404 ) { return; } global $wp_query; $wp_query->set_404(); status_header( 404 ); nocache_headers(); } public function delete_screenshot() { if ( ! is_admin() || ! isset( $_GET['health-check-delete-screenshot'] ) || ! $this->user_can_screenshot() ) { return; } // Validate nonces. if ( ! isset( $_GET['_wpnonce'] ) ) { return; } if ( ! wp_verify_nonce( $_GET['_wpnonce'], 'health-check-delete-screenshot-' . absint( $_GET['health-check-delete-screenshot'] ) ) ) { return; } wp_delete_post( $_GET['health-check-delete-screenshot'], true ); wp_safe_redirect( admin_url( 'site-health.php?tab=screenshots' ) ); } public function display_screenshot() { if ( empty( $_GET['health-check-screenshot'] ) ) { return; } $screenshot_id = $_GET['health-check-screenshot']; $screenshot = get_posts( array( 'post_type' => 'health-check-images', 'posts_per_page' => 1, 'meta_key' => 'hash_id', 'meta_value' => $screenshot_id, ) ); if ( empty( $screenshot ) ) { $this->should_404 = true; return; } if ( is_array( $screenshot ) ) { $screenshot = $screenshot[0]; } $image = $screenshot->screenshot; $image = explode( ';', $image, 2 ); $image_type = str_replace( 'data:', '', $image[0] ); if ( ! in_array( $image_type, $this->allowed_image_mimes, true ) ) { return; } header( 'Content-Type: ' . $image_type ); if ( isset( $_GET['dl'] ) ) { header( 'Content-Disposition: attachment; filename="' . sanitize_title( $screenshot->post_title ) . '.jpeg"' ); } $data = str_replace( 'base64,', '', $image[1] ); echo base64_decode( $data ); die(); } public function add_site_health_tab_content( $tab ) { if ( 'screenshots' !== $tab ) { return; } include_once( HEALTH_CHECK_PLUGIN_DIRECTORY . '/pages/screenshots.php' ); } public function add_site_health_navigation_tabs( $tabs ) { return array_merge( $tabs, array( 'screenshots' => esc_html__( 'Screenshots', 'health-check' ), ) ); } public function user_can_screenshot() { return current_user_can( 'view_site_health_checks' ); } public function register_post_type() { register_post_type( 'health-check-images', array( 'labels' => array( 'name' => __( 'Screenshots', 'health-check' ), 'singular_name' => __( 'Screenshot', 'health-check' ), ), 'public' => false, 'show_ui' => false, 'show_in_menu' => false, 'show_in_nav_menus' => false, 'show_in_admin_bar' => false, 'exclude_from_search' => true, 'has_archive' => false, 'hierarchical' => false, 'rewrite' => false, 'query_var' => false, 'supports' => array( 'title' ), ) ); } public function register_rest_routes() { register_rest_route( 'health-check/v1', '/screenshot', array( 'methods' => 'POST', 'callback' => array( $this, 'store_screenshot' ), 'permission_callback' => array( $this, 'user_can_screenshot' ), 'args' => array( 'nonce' => array( 'required' => true, 'validate_callback' => function( $param, $request, $key ) { return wp_verify_nonce( $param, 'health-check-screenshot' ); }, ), 'label' => array( 'required' => true, 'validate_callback' => function( $param, $request, $key ) { return is_string( $param ) && ! empty( $param ); }, ), 'screenshot' => array( 'required' => true, 'validate_callback' => function( $param, $request, $key ) { return is_string( $param ) && 'data:image/jpeg;' === substr( $param, 0, 16 ); }, ), ), ) ); } public function store_screenshot( \WP_REST_Request $request ) { // Create a new post in the `health-check-images` post type. $post_id = wp_insert_post( array( 'post_type' => 'health-check-images', 'post_title' => sanitize_text_field( $request->get_param( 'label' ) ), 'post_status' => 'publish', 'meta_input' => array( 'screenshot' => $request->get_param( 'screenshot' ), 'hash_id' => wp_hash( $request->get_param( 'screenshot' ) ), ), ) ); } public function enqueue_scripts() { if ( ! $this->user_can_screenshot() ) { return; } $asset = include HEALTH_CHECK_PLUGIN_DIRECTORY . 'build/health-check-global.asset.php'; wp_enqueue_script( 'health-check-global', trailingslashit( HEALTH_CHECK_PLUGIN_URL ) . 'build/health-check-global.js', array( 'jquery', 'wp-a11y' ), $asset['version'] ); wp_localize_script( 'health-check-global', 'HealthCheckTools', array( 'nonce' => array( 'rest' => wp_create_nonce( 'wp_rest' ), 'screenshot' => wp_create_nonce( 'health-check-screenshot' ), ), 'rest' => array( 'screenshot' => rest_url( 'health-check/v1/screenshot' ), ), ) ); } public function admin_menubar_button( $wp_menu ) { if ( ! $this->user_can_screenshot() ) { return; } if ( ! is_admin() ) { require_once( trailingslashit( ABSPATH ) . 'wp-admin/includes/plugin.php' ); } // Add top-level menu item. $wp_menu->add_menu( array( 'id' => 'health-check-screenshot', 'title' => esc_html__( 'Take screenshot', 'health-check' ), 'href' => '#', 'meta' => array( 'class' => 'health-check-take-screenshot', ), ) ); } } new Health_Check_Screenshots(); PK!R 4HealthCheck/class-cli.phpnu[] * : Render the output in a particular format. * --- * default: table * options: * - table * - csv * - json * - yaml * --- */ public function status( $args, $assoc_args ) { $runner = new Status( WP_CLI\Utils\get_flag_value( $assoc_args, 'format' ) ); $runner->run(); } } WP_CLI::add_command( 'health-check', __NAMESPACE__ . '\\CLI' ); PK!_/HealthCheck/class-health-check-troubleshoot.phpnu[mkdir( WPMU_PLUGIN_DIR ) ) { Health_Check::display_notice( esc_html__( 'We were unable to create the mu-plugins directory.', 'health-check' ), 'error' ); return false; } } // Remove instances of the old plugin, to avoid collisions. if ( Health_Check_Troubleshoot::old_mu_plugin_exists() ) { if ( ! $wp_filesystem->delete( trailingslashit( WPMU_PLUGIN_DIR ) . 'health-check-disable-plugins.php' ) ) { Health_Check::display_notice( esc_html__( 'We could not remove the old must-use plugin.', 'health-check' ), 'error' ); return false; } } // Copy the must-use plugin to the local directory. if ( ! $wp_filesystem->copy( trailingslashit( HEALTH_CHECK_PLUGIN_DIRECTORY ) . 'mu-plugin/health-check-troubleshooting-mode.php', trailingslashit( WPMU_PLUGIN_DIR ) . 'health-check-troubleshooting-mode.php' ) ) { Health_Check::display_notice( esc_html__( 'We were unable to copy the plugin file required to enable the Troubleshooting Mode.', 'health-check' ), 'error' ); return false; } if ( $redirect ) { Health_Check_Troubleshoot::session_started(); } return true; } /** * Check if our Must-Use plugin needs updating, and do so if necessary. * * @global $wp_filesystem * * @uses Health_Check_Troubleshoot::mu_plugin_exists() * @uses Health_Check::get_filesystem_credentials() * @uses get_plugin_data() * @uses trailingslashit() * @uses version_compare() * @uses WP_Filesystem::copy() * @uses esc_html__() * * @return bool */ static function maybe_update_must_use_plugin() { if ( ! Health_Check_Troubleshoot::mu_plugin_exists() ) { return false; } if ( ! Health_Check::get_filesystem_credentials() ) { return false; } $current = get_plugin_data( trailingslashit( HEALTH_CHECK_PLUGIN_DIRECTORY ) . 'mu-plugin/health-check-troubleshooting-mode.php' ); $active = get_plugin_data( trailingslashit( WPMU_PLUGIN_DIR ) . 'health-check-troubleshooting-mode.php' ); $current_version = ( isset( $current['Version'] ) ? $current['Version'] : '0.0' ); $active_version = ( isset( $active['Version'] ) ? $active['Version'] : '0.0' ); if ( version_compare( $current_version, $active_version, '>' ) ) { global $wp_filesystem; if ( ! $wp_filesystem->copy( trailingslashit( HEALTH_CHECK_PLUGIN_DIRECTORY ) . 'mu-plugin/health-check-troubleshooting-mode.php', trailingslashit( WPMU_PLUGIN_DIR ) . 'health-check-troubleshooting-mode.php', true ) ) { Health_Check::display_notice( esc_html__( 'We were unable to replace the plugin file required to enable the Troubleshooting Mode.', 'health-check' ), 'error' ); return false; } } return true; } /** * Output a notice if our Troubleshooting Mode has been initiated. * * @uses Health_Check::display_notice() * @uses sprintf() * @uses esc_html__() * @uses esc_url() * @uses admin_url() * * @return void */ static function session_started() { Health_Check::display_notice( sprintf( '%s
%s', esc_html__( 'You have successfully enabled Troubleshooting Mode, all plugins will appear inactive until you disable Troubleshooting Mode, or log out and back in again.', 'health-check' ), sprintf( '%2$s', esc_url( admin_url( '/' ) ), esc_html__( 'Return to the Dashboard', 'health-check' ) ) ) ); } /** * Display the form for enabling troubleshooting mode. * * @uses printf() * @uses esc_html__() * @uses Health_Check_Troubleshoot::mu_plugin_exists() * @uses Health_Check_Troubleshoot::maybe_update_must_use_plugin() * @uses Health_Check_Troubleshoot::session_started() * @uses Health_Check::get_filesystem_credentials() * @uses Health_Check_Troubleshoot::setup_must_use_plugin() * @uses esc_html_e() * * @return void */ /** * Display the form for enabling troubleshooting mode. * * @uses printf() * @uses esc_html__() * @uses Health_Check_Troubleshoot::mu_plugin_exists() * @uses Health_Check_Troubleshoot::maybe_update_must_use_plugin() * @uses Health_Check_Troubleshoot::session_started() * @uses Health_Check::get_filesystem_credentials() * @uses Health_Check_Troubleshoot::setup_must_use_plugin() * @uses Health_Check_Troubleshooting_MU::is_troubleshooting() * @uses esc_url() * @uses add_query_arg() * @uses esc_html_e() * * @return void */ static function show_enable_troubleshoot_form() { if ( isset( $_POST['health-check-troubleshoot-mode'] ) ) { if ( Health_Check_Troubleshoot::mu_plugin_exists() ) { if ( ! Health_Check_Troubleshoot::maybe_update_must_use_plugin() ) { return; } Health_Check_Troubleshoot::session_started(); } else { if ( ! Health_Check::get_filesystem_credentials() ) { return; } else { Health_Check_Troubleshoot::setup_must_use_plugin(); } } } ?>
is_troubleshooting() ) : ?>

init(); } /** * Plugin initiation. * * A helper function, called by `HealthCheck::__construct()` to initiate actions, hooks and other features needed. * * @uses add_action() * @uses add_filter() * * @return void */ public function init() { add_action( 'plugins_loaded', array( $this, 'load_i18n' ) ); add_filter( 'plugin_action_links', array( $this, 'troubleshoot_plugin_action' ), 20, 4 ); add_filter( 'plugin_action_links_' . plugin_basename( HEALTH_CHECK_PLUGIN_FILE ), array( $this, 'page_plugin_action' ) ); add_action( 'admin_notices', array( $this, 'admin_notices' ) ); add_action( 'admin_enqueue_scripts', array( $this, 'enqueues' ) ); add_action( 'init', array( $this, 'start_troubleshoot_mode' ) ); add_action( 'load-plugins.php', array( $this, 'start_troubleshoot_single_plugin_mode' ) ); add_action( 'wp_ajax_health-check-loopback-no-plugins', array( 'Health_Check_Loopback', 'loopback_no_plugins' ) ); add_action( 'wp_ajax_health-check-loopback-individual-plugins', array( 'Health_Check_Loopback', 'loopback_test_individual_plugins' ) ); add_action( 'wp_ajax_health-check-loopback-default-theme', array( 'Health_Check_Loopback', 'loopback_test_default_theme' ) ); add_filter( 'user_has_cap', array( $this, 'maybe_grant_site_health_caps' ), 1, 4 ); add_filter( 'site_health_navigation_tabs', array( $this, 'add_site_health_navigation_tabs' ) ); add_action( 'site_health_tab_content', array( $this, 'add_site_health_tab_content' ) ); add_action( 'init', array( $this, 'maybe_remove_old_scheduled_events' ) ); } /** * Disable scheduled events previously used by the plugin, but now part of WordPress core. * * @return void */ public function maybe_remove_old_scheduled_events() { if ( wp_next_scheduled( 'health-check-scheduled-site-status-check' ) ) { wp_clear_scheduled_hook( 'health-check-scheduled-site-status-check' ); } } /** * Filters the user capabilities to grant the 'view_site_health_checks' capabilities as necessary. * * @since 5.2.2 * * @param bool[] $allcaps An array of all the user's capabilities. * @param string[] $caps Required primitive capabilities for the requested capability. * @param array $args { * Arguments that accompany the requested capability check. * * @type string $0 Requested capability. * @type int $1 Concerned user ID. * @type mixed ...$2 Optional second and further parameters, typically object ID. * } * @param WP_User $user The user object. * @return bool[] Filtered array of the user's capabilities. */ function maybe_grant_site_health_caps( $allcaps, $caps, $args, $user ) { if ( ! empty( $allcaps['install_plugins'] ) && ( ! is_multisite() || is_super_admin( $user->ID ) ) ) { $allcaps['view_site_health_checks'] = true; } return $allcaps; } /** * Initiate troubleshooting mode. * * Catch when the troubleshooting form has been submitted, and appropriately set required options and cookies. * * @uses current_user_can() * @uses Health_Check_Troubleshoot::initiate_troubleshooting_mode() * * @return void */ public function start_troubleshoot_mode() { if ( ! isset( $_POST['health-check-troubleshoot-mode'] ) || ! current_user_can( 'view_site_health_checks' ) ) { return; } // Don't enable troubleshooting if nonces are missing or do not match. if ( ! isset( $_POST['_wpnonce'] ) || ! wp_verify_nonce( $_POST['_wpnonce'], 'health-check-enable-troubleshooting' ) ) { return; } Health_Check_Troubleshoot::initiate_troubleshooting_mode(); } /** * Initiate troubleshooting mode for a specific plugin. * * Catch when the troubleshooting link on an individual plugin has been clicked, and appropriately sets the * required options and cookies. * * @uses current_user_can() * @uses ob_start() * @uses Health_Check_Troubleshoot::mu_plugin_exists() * @uses Health_Check::get_filesystem_credentials() * @uses Health_Check_Troubleshoot::setup_must_use_plugin() * @uses Health_Check_Troubleshoot::maybe_update_must_use_plugin() * @uses ob_get_clean() * @uses Health_Check_Troubleshoot::initiate_troubleshooting_mode() * @uses wp_redirect() * @uses admin_url() * * @return void */ public function start_troubleshoot_single_plugin_mode() { if ( ! isset( $_GET['health-check-troubleshoot-plugin'] ) || ! current_user_can( 'view_site_health_checks' ) ) { return; } // Don't enable troubleshooting for an individual plugin if the nonce is missing or invalid. if ( ! isset( $_GET['_wpnonce'] ) || ! wp_verify_nonce( $_GET['_wpnonce'], 'health-check-troubleshoot-plugin-' . $_GET['health-check-troubleshoot-plugin'] ) ) { return; } ob_start(); $needs_credentials = false; if ( ! Health_Check_Troubleshoot::mu_plugin_exists() ) { if ( ! Health_Check::get_filesystem_credentials() ) { $needs_credentials = true; } else { $check_output = Health_Check_Troubleshoot::setup_must_use_plugin( false ); if ( false === $check_output ) { $needs_credentials = true; } } } else { if ( ! Health_Check_Troubleshoot::maybe_update_must_use_plugin() ) { $needs_credentials = true; } } $result = ob_get_clean(); if ( $needs_credentials ) { $this->admin_notices[] = (object) array( 'message' => $result, 'type' => 'warning', ); return; } Health_Check_Troubleshoot::initiate_troubleshooting_mode( array( $_GET['health-check-troubleshoot-plugin'] => $_GET['health-check-troubleshoot-plugin'], ) ); wp_redirect( admin_url( 'plugins.php' ) ); } /** * Load translations. * * Loads the textdomain needed to get translations for our plugin. * * @uses load_plugin_textdomain() * @uses basename() * @uses dirname() * * @return void */ public function load_i18n() { load_plugin_textdomain( 'health-check', false, basename( dirname( __FILE__ ) ) . '/languages/' ); } /** * Enqueue assets. * * Conditionally enqueue our CSS and JavaScript when viewing plugin related pages in wp-admin. * * @uses wp_enqueue_style() * @uses plugins_url() * @uses wp_enqueue_script() * @uses wp_localize_script() * @uses esc_html__() * * @return void */ public function enqueues() { $screen = get_current_screen(); // Don't enqueue anything unless we're on the health check page. if ( 'tools_page_site-health' !== $screen->id && 'site-health' !== $screen->id ) { return; } $health_check = include HEALTH_CHECK_PLUGIN_DIRECTORY . 'build/health-check.asset.php'; wp_enqueue_style( 'health-check', trailingslashit( HEALTH_CHECK_PLUGIN_URL ) . 'build/health-check.css', array(), $health_check['version'] ); // If the WordPress 5.2+ version of Site Health is used, do some extra checks to not mess with core scripts and styles. if ( 'site-health' === $screen->id ) { $plugin_tabs = array( 'tools', 'troubleshoot', ); if ( ! isset( $_GET['tab'] ) || ! in_array( $_GET['tab'], $plugin_tabs, true ) ) { return; } } $health_check_tools = include HEALTH_CHECK_PLUGIN_DIRECTORY . 'build/health-check-tools.asset.php'; wp_enqueue_script( 'health-check-tools', trailingslashit( HEALTH_CHECK_PLUGIN_URL ) . 'build/health-check-tools.js', array( 'jquery' ), $health_check_tools['version'] ); wp_localize_script( 'health-check-tools', 'HealthCheck', array( 'rest_api' => array( 'tools' => array( 'plugin_compat' => rest_url( 'health-check/v1/plugin-compat' ), ), ), 'nonce' => array( 'rest_api' => wp_create_nonce( 'wp_rest' ), 'files_integrity_check' => wp_create_nonce( 'health-check-files-integrity-check' ), 'view_file_diff' => wp_create_nonce( 'health-check-view-file-diff' ), 'mail_check' => wp_create_nonce( 'health-check-mail-check' ), ), ) ); } /** * Add a troubleshooting action link to plugins. * * @param $actions * @param $plugin_file * @param $plugin_data * @param $context * * @return array */ public function troubleshoot_plugin_action( $actions, $plugin_file, $plugin_data, $context ) { // Don't add anything if this is a Must-Use plugin, we can't touch those. if ( 'mustuse' === $context ) { return $actions; } // Only add troubleshooting actions to active plugins. if ( ! is_plugin_active( $plugin_file ) ) { return $actions; } // Set a slug if the plugin lives in the plugins directory root. if ( ! stristr( $plugin_file, '/' ) ) { $plugin_slug = $plugin_file; } else { // Set the slug for plugin inside a folder. $plugin_slug = explode( '/', $plugin_file ); $plugin_slug = $plugin_slug[0]; } $actions['troubleshoot'] = sprintf( '%s', esc_url( add_query_arg( array( 'health-check-troubleshoot-plugin' => $plugin_slug, '_wpnonce' => wp_create_nonce( 'health-check-troubleshoot-plugin-' . $plugin_slug ), ), admin_url( 'plugins.php' ) ) ), esc_html__( 'Troubleshoot', 'health-check' ) ); return $actions; } /** * Add a quick-access action link to the Heath Check page. * * @param $actions * * @return array */ public function page_plugin_action( $actions ) { $page_link = sprintf( '%s', admin_url( 'site-health.php' ), _x( 'Health Check', 'Menu, Section and Page Title', 'health-check' ) ); array_unshift( $actions, $page_link ); return $actions; } static function tabs() { return array( '' => esc_html__( 'Status', 'health-check' ), // The status tab is the front page, and therefore has no tab key relation. 'debug' => esc_html__( 'Info', 'health-check' ), 'troubleshoot' => esc_html__( 'Troubleshooting', 'health-check' ), 'tools' => esc_html__( 'Tools', 'health-check' ), ); } public function add_site_health_navigation_tabs( $tabs ) { return array_merge( $tabs, array( 'troubleshoot' => esc_html__( 'Troubleshooting', 'health-check' ), 'tools' => esc_html__( 'Tools', 'health-check' ), ) ); } public function add_site_health_tab_content( $tab ) { switch ( $tab ) { case 'troubleshoot': include_once( HEALTH_CHECK_PLUGIN_DIRECTORY . '/pages/troubleshoot.php' ); break; case 'tools': include_once( HEALTH_CHECK_PLUGIN_DIRECTORY . '/pages/tools.php' ); break; } } static function current_tab() { return ( isset( $_GET['tab'] ) ? $_GET['tab'] : 'site-status' ); } /** * Display styled admin notices. * * @uses printf() * * @param string $message A sanitized string containing our notice message. * @param string $status A string representing the status type. * * @return void */ static function display_notice( $message, $status = 'success' ) { printf( '

%s

', esc_attr( $status ), $message ); } /** * Display admin notices if we have any queued. * * @return void */ public function admin_notices() { foreach ( $this->admin_notices as $admin_notice ) { printf( '

%s

', esc_attr( $admin_notice->type ), $admin_notice->message ); } } /** * Conditionally show a form for providing filesystem credentials when introducing our troubleshooting mode plugin. * * @uses wp_nonce_url() * @uses add_query_arg() * @uses admin_url() * @uses request_filesystem_credentials() * @uses WP_Filesystem * * @param array $args Any WP_Filesystem arguments you wish to pass. * * @return bool */ static function get_filesystem_credentials( $args = array() ) { $args = array_merge( array( 'page' => 'health-check', 'tab' => 'troubleshoot', ), $args ); $url = wp_nonce_url( add_query_arg( $args, admin_url() ) ); $creds = request_filesystem_credentials( $url, '', false, WP_CONTENT_DIR, array( 'health-check-troubleshoot-mode', 'action', '_wpnonce' ) ); if ( false === $creds ) { return false; } if ( ! WP_Filesystem( $creds ) ) { request_filesystem_credentials( $url, '', true, WPMU_PLUGIN_DIR, array( 'health-check-troubleshoot-mode', 'action', '_wpnonce' ) ); return false; } return true; } } PK! #HealthCheck/WP_CLI/class-status.phpnu[format = $format; } public function run() { $health_check_site_status = \WP_Site_Health::get_instance(); $tests = $health_check_site_status::get_tests(); $test_result = array(); foreach ( $tests['direct'] as $test ) { if ( is_string( $test['test'] ) ) { $test_function = sprintf( 'get_test_%s', $test['test'] ); if ( method_exists( $health_check_site_status, $test_function ) && is_callable( array( $health_check_site_status, $test_function ) ) ) { $test_output = apply_filters( 'site_status_test_result', call_user_func( array( $health_check_site_status, $test_function ) ) ); $test_result[] = array( 'test' => $test['label'], 'type' => wp_kses( $test_output['badge']['label'], array() ), 'result' => wp_kses( $test_output['status'], array() ), ); continue; } } if ( is_callable( $test['test'] ) ) { $test_output = apply_filters( 'site_status_test_result', call_user_func( $test['test'] ) ); $test_result[] = array( 'test' => $test['label'], 'type' => wp_kses( $test_output['badge']['label'], array() ), 'result' => wp_kses( $test_output['status'], array() ), ); } } foreach ( $tests['async'] as $test ) { if ( isset( $test['async_direct_test'] ) && is_callable( $test['async_direct_test'] ) ) { $test_output = apply_filters( 'site_status_test_result', call_user_func( $test['async_direct_test'] ) ); $test_result[] = array( 'test' => $test['label'], 'type' => wp_kses( $test_output['badge']['label'], array() ), 'result' => wp_kses( $test_output['status'], array() ), ); } } if ( 'json' === $this->format ) { \WP_CLI\Utils\format_items( 'json', $test_result, array( 'test', 'type', 'result' ) ); } elseif ( 'csv' === $this->format ) { \WP_CLI\Utils\format_items( 'csv', $test_result, array( 'test', 'type', 'result' ) ); } elseif ( 'yaml' === $this->format ) { \WP_CLI\Utils\format_items( 'yaml', $test_result, array( 'test', 'type', 'result' ) ); } else { \WP_CLI\Utils\format_items( 'table', $test_result, array( 'test', 'type', 'result' ) ); } } } PK!B readme.txtnu[=== Health Check & Troubleshooting === Tags: health check Contributors: wordpressdotorg, westi, pento, Clorith Requires at least: 4.4 Requires PHP: 5.6 Tested up to: 6.6 Stable tag: 1.7.1 License: GPLv2 License URI: https://www.gnu.org/licenses/gpl-2.0.html Health Check identifies common problems, and helps you troubleshoot plugin and theme conflicts. == Description == This plugin will perform a number of checks on your WordPress installation to detect common configuration errors and known issues, and also allows plugins and themes to add their own checks. The debug section, which allows you to gather information about your WordPress and server configuration that you may easily share with support representatives for themes, plugins or on the official WordPress.org support forums. Troubleshooting allows you to have a clean WordPress session, where all plugins are disabled, and a default theme is used, but only for your user until you disable it or log out. The Tools section allows you to check that WordPress files have not been tampered with, that emails can be sent, and if your plugins are compatible with any PHP version updates in the future. For a more extensive example of how to efficiently use the Health Check plugin, check out the [WordPress.org support team handbook page about this plugin](https://make.wordpress.org/support/handbook/appendix/troubleshooting-using-the-health-check/). Feedback is welcome both through the [WordPress.org forums](https://wordpress.org/support/plugin/health-check), the [GitHub project page](https://github.com/WordPress/health-check), or on [Slack](https://make.wordpress.org/chat) in either [#forums](https://wordpress.slack.com/messages/forums/) or [#core-site-health](https://wordpress.slack.com/messages/core-site-health/). == Frequently Asked Questions == = I am unable to access my site after enabling troubleshooting = If you should find your self stuck in Troubleshooting Mode for any reason, you can easily disable it by clearing your cookies. Are you unfamiliar with how to clear your cookies? No worries, you may also close all your browser windows, or perform a computer restart and it will clear this specific cookie automatically. = The PHP compatibility says this plugin only work with PHP version X? = The plugin is made to be a support tool for as many users as possible, this means it needs code that is written for older sites as well. Tools that check for PHP compatibility do not know how to separate this code from the real code, so it will give a false positive response. At this time, the plugin has been tested with every version of PHP from 5.2 through 7.3, and works with all of these. = Where can I report security bugs? = The Site Health team and WordPress community take security bugs seriously. We appreciate your efforts to responsibly disclose your findings, and will make every effort to acknowledge your contributions. To report a security issue, please visit the [WordPress HackerOne](https://hackerone.com/wordpress) program. == Screenshots == 1. The health check screen after the automated tests have gone over the system. 2. The debug information, with the copy and paste field expanded. 3. A selection of tools that can be ran on your site. 4. Troubleshooting mode enabled, showing your website Dashboard == Changelog == = 1.7.1 (2024-07-25) = * Security: Prevent a potential information disclosure from the screenshot beta feature, reported independently by Jarko Piironen. * Security hardening: Make each screenshot delete nonce unique to that image. * Security hardening: Add a capability check alongside the nonce validation when toggling beta features on or off. * General: Updated the `Tested up to` tag. * General: Added notice about future changes to the Troubleshooting and Tools sections. * Added Twenty Twenty Four as a known and valid default theme. * Tools: Fixed a PHP warning when checking for PHP version compatibility and no data was found. * Tools: Fixed a PHP warning when `WP_DEBUG` is disabled, or nothing has been written to the logfile yet. * Tools: Improved the description for the `robots.txt` file viewer. = 1.7.0 (2023-08-06) = * General: Improved styling inconsistency between the plugin and WordPress core. * General: Fixed an issue with plugin translations where language strings would get mixed when using third party language plugins, or a separate profile language. * Troubleshooting Mode: Fixed the URL used when disabling elements and having a subdirectory installation. * Troubleshooting Mode: Fixed a deprecation warning when disabling troubleshooting mode on PHP version 8.3 or higher. * Troubleshooting Mode: Added reference on how to troubleshoot as different users when testing scenarios. * Tools: Fixed integration with WPTide for the PHP Compatibility checker. * Tools: Added a viewer that will display debug log output when enabled. * Tools: Added a warning to the File Integrity tester if unexpected files are mixed in with WordPress core files. * Tools: Added a warning if sending emails is taking longer than expected. * Tools: Added beta feature toggle for those who wish to test new functionality that may not be fully ready yet. * CLI: Fixed the CLI commands, you can now `wp health-check status` to your hearts content! * Beta feature: Added a new beta feature, making it easier for non-technical users to grab screenshots of issues on their site, and share them. PK!@modals/diff.phpnu[

PK!<ӷ compat.phpnu[' ) ) { /** * Fallback function replicating core behavior from WordPress 5.1.0 to check PHP versions. * * @return array|bool|mixed|object|WP_Error */ function wp_check_php_version() { $version = phpversion(); $key = md5( $version ); $response = get_site_transient( 'php_check_' . $key ); if ( false === $response ) { $url = 'http://api.wordpress.org/core/serve-happy/1.0/'; if ( wp_http_supports( array( 'ssl' ) ) ) { $url = set_url_scheme( $url, 'https' ); } $url = add_query_arg( 'php_version', $version, $url ); $response = wp_remote_get( $url ); if ( is_wp_error( $response ) || 200 !== wp_remote_retrieve_response_code( $response ) ) { return false; } /** * Response should be an array with: * 'recommended_version' - string - The PHP version recommended by WordPress. * 'is_supported' - boolean - Whether the PHP version is actively supported. * 'is_secure' - boolean - Whether the PHP version receives security updates. * 'is_acceptable' - boolean - Whether the PHP version is still acceptable for WordPress. */ $response = json_decode( wp_remote_retrieve_body( $response ), true ); if ( ! is_array( $response ) ) { return false; } set_site_transient( 'php_check_' . $key, $response, WEEK_IN_SECONDS ); } if ( isset( $response['is_acceptable'] ) && $response['is_acceptable'] ) { /** * Filters whether the active PHP version is considered acceptable by WordPress. * * Returning false will trigger a PHP version warning to show up in the admin dashboard to administrators. * * This filter is only run if the wordpress.org Serve Happy API considers the PHP version acceptable, ensuring * that this filter can only make this check stricter, but not loosen it. * * @since 5.1.1 * * @param bool $is_acceptable Whether the PHP version is considered acceptable. Default true. * @param string $version PHP version checked. */ $response['is_acceptable'] = (bool) apply_filters( 'wp_is_php_version_acceptable', true, $version ); } return $response; } } if ( ! function_exists( 'wp_get_update_php_url' ) && version_compare( '5.1', $wp_version, '>' ) ) { /** * Fallback function replicating core behavior from WordPress 5.1.0 to check PHP versions. * * @return string URL to learn more about updating PHP. */ function wp_get_update_php_url() { $default_url = _x( 'https://wordpress.org/support/update-php/', 'localized PHP upgrade information page', 'health-check' ); $update_url = $default_url; if ( false !== getenv( 'WP_UPDATE_PHP_URL' ) ) { $update_url = getenv( 'WP_UPDATE_PHP_URL' ); } /** * Filters the URL to learn more about updating the PHP version the site is running on. * * Providing an empty string is not allowed and will result in the default URL being used. Furthermore * the page the URL links to should preferably be localized in the site language. * * @since 5.1.0 * * @param string $update_url URL to learn more about updating PHP. */ $update_url = apply_filters( 'wp_update_php_url', $update_url ); if ( empty( $update_url ) ) { $update_url = $default_url; } return $update_url; } } if ( ! function_exists( 'is_countable' ) && version_compare( '4.9.6', $wp_version, '>' ) ) { /** * Fallback function replicating core behavior from WordPress 4.9.6 to check PHP versions. * * Polyfill for is_countable() function added in PHP 7.3. * * Verify that the content of a variable is an array or an object * implementing the Countable interface. * * @param mixed $var The value to check. * * @return bool True if `$var` is countable, false otherwise. */ function is_countable( $var ) { return ( is_array( $var ) || $var instanceof Countable || $var instanceof SimpleXMLElement || $var instanceof ResourceBundle ); } } if ( ! function_exists( 'get_user_count' ) && version_compare( '4.8', $wp_version, '>' ) ) { /** * Fallback function replicating core behavior from WordPress 4.8.0 to check PHP versions. * * @return int Number of active users on the network. */ function get_user_count( $network_id = null ) { return get_network_option( $network_id, 'user_count' ); } } if ( ! function_exists( 'get_user_locale' ) && version_compare( '4.7', $wp_version, '>' ) ) { /** * Fallback function replicating core behavior from WordPress 4.7.0 to check PHP versions. * * @return string The locale of the user. */ function get_user_locale( $user_id = 0 ) { $user = false; if ( 0 === $user_id && function_exists( 'wp_get_current_user' ) ) { $user = wp_get_current_user(); } elseif ( $user_id instanceof WP_User ) { $user = $user_id; } elseif ( $user_id && is_numeric( $user_id ) ) { $user = get_user_by( 'id', $user_id ); } if ( ! $user ) { return get_locale(); } $locale = $user->locale; return $locale ? $locale : get_locale(); } } if ( ! function_exists( 'wp_get_upload_dir' ) && version_compare( '4.5', $wp_version, '>' ) ) { /** * Fallback function replicating core behavior from WordPress 4.5.0 to check PHP versions. * * @return array See `wp_upload_dir()` for description. */ function wp_get_upload_dir() { return wp_upload_dir( null, false ); } } PK!FNFFLICENSEnu[ GNU GENERAL PUBLIC LICENSE Version 2, June 1991 Copyright (C) 1989, 1991 Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. Preamble The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. This General Public License applies to most of the Free Software Foundation's software and to any other program whose authors commit to using it. (Some other Free Software Foundation software is covered by the GNU Lesser General Public License instead.) You can apply it to your programs, too. When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs; and that you know you can do these things. To protect your rights, we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights. These restrictions translate to certain responsibilities for you if you distribute copies of the software, or if you modify it. For example, if you distribute copies of such a program, whether gratis or for a fee, you must give the recipients all the rights that you have. You must make sure that they, too, receive or can get the source code. And you must show them these terms so they know their rights. We protect your rights with two steps: (1) copyright the software, and (2) offer you this license which gives you legal permission to copy, distribute and/or modify the software. Also, for each author's protection and ours, we want to make certain that everyone understands that there is no warranty for this free software. If the software is modified by someone else and passed on, we want its recipients to know that what they have is not the original, so that any problems introduced by others will not reflect on the original authors' reputations. Finally, any free program is threatened constantly by software patents. We wish to avoid the danger that redistributors of a free program will individually obtain patent licenses, in effect making the program proprietary. To prevent this, we have made it clear that any patent must be licensed for everyone's free use or not licensed at all. The precise terms and conditions for copying, distribution and modification follow. GNU GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. This License applies to any program or other work which contains a notice placed by the copyright holder saying it may be distributed under the terms of this General Public License. The "Program", below, refers to any such program or work, and a "work based on the Program" means either the Program or any derivative work under copyright law: that is to say, a work containing the Program or a portion of it, either verbatim or with modifications and/or translated into another language. (Hereinafter, translation is included without limitation in the term "modification".) Each licensee is addressed as "you". Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running the Program is not restricted, and the output from the Program is covered only if its contents constitute a work based on the Program (independent of having been made by running the Program). Whether that is true depends on what the Program does. 1. You may copy and distribute verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and give any other recipients of the Program a copy of this License along with the Program. You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee. 2. You may modify your copy or copies of the Program or any portion of it, thus forming a work based on the Program, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions: a) You must cause the modified files to carry prominent notices stating that you changed the files and the date of any change. b) You must cause any work that you distribute or publish, that in whole or in part contains or is derived from the Program or any part thereof, to be licensed as a whole at no charge to all third parties under the terms of this License. c) If the modified program normally reads commands interactively when run, you must cause it, when started running for such interactive use in the most ordinary way, to print or display an announcement including an appropriate copyright notice and a notice that there is no warranty (or else, saying that you provide a warranty) and that users may redistribute the program under these conditions, and telling the user how to view a copy of this License. (Exception: if the Program itself is interactive but does not normally print such an announcement, your work based on the Program is not required to print an announcement.) These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Program, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Program, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it. Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Program. In addition, mere aggregation of another work not based on the Program with the Program (or with a work based on the Program) on a volume of a storage or distribution medium does not bring the other work under the scope of this License. 3. You may copy and distribute the Program (or a work based on it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you also do one of the following: a) Accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, b) Accompany it with a written offer, valid for at least three years, to give any third party, for a charge no more than your cost of physically performing source distribution, a complete machine-readable copy of the corresponding source code, to be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, c) Accompany it with the information you received as to the offer to distribute corresponding source code. (This alternative is allowed only for noncommercial distribution and only if you received the program in object code or executable form with such an offer, in accord with Subsection b above.) The source code for a work means the preferred form of the work for making modifications to it. For an executable work, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the executable. However, as a special exception, the source code distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable. If distribution of executable or object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place counts as distribution of the source code, even though third parties are not compelled to copy the source along with the object code. 4. You may not copy, modify, sublicense, or distribute the Program except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense or distribute the Program is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance. 5. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Program or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Program (or any work based on the Program), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Program or works based on it. 6. Each time you redistribute the Program (or any work based on the Program), the recipient automatically receives a license from the original licensor to copy, distribute or modify the Program subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties to this License. 7. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Program at all. For example, if a patent license would not permit royalty-free redistribution of the Program by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Program. If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply and the section as a whole is intended to apply in other circumstances. It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system, which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice. This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License. 8. If the distribution and/or use of the Program is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Program under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License. 9. The Free Software Foundation may publish revised and/or new versions of the General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Program specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of this License, you may choose any version ever published by the Free Software Foundation. 10. If you wish to incorporate parts of the Program into other free programs whose distribution conditions are different, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. NO WARRANTY 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. END OF TERMS AND CONDITIONS How to Apply These Terms to Your New Programs If you develop a new program, and you want it to be of the greatest possible use to the public, the best way to achieve this is to make it free software which everyone can redistribute and change under these terms. To do so, attach the following notices to the program. It is safest to attach them to the start of each source file to most effectively convey the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. Copyright (C) This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Also add information on how to contact you by electronic and paper mail. If the program is interactive, make it output a short notice like this when it starts in an interactive mode: Gnomovision version 69, Copyright (C) year name of author Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. This is free software, and you are welcome to redistribute it under certain conditions; type `show c' for details. The hypothetical commands `show w' and `show c' should show the appropriate parts of the General Public License. Of course, the commands you use may be called something other than `show w' and `show c'; they could even be mouse-clicks or menu items--whatever suits your program. You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the program, if necessary. Here is a sample; alter the names: Yoyodyne, Inc., hereby disclaims all copyright interest in the program `Gnomovision' (which makes passes at compilers) written by James Hacker. , 1 April 1989 Ty Coon, President of Vice This General Public License does not permit incorporating your program into proprietary programs. If your program is a subroutine library, you may consider it more useful to permit linking proprietary applications with the library. If this is what you want to do, use the GNU Lesser General Public License instead of this License. PK!D܆O health-check.phpnu[ ABSPATH . '/wp-admin/includes/class-wp-site-health.php', 'class-wp-debug-data.php' => ABSPATH . '/wp-admin/includes/class-wp-debug-data.php', ); foreach ( $original_paths as $filename => $original_path ) { if ( file_exists( $original_path ) ) { require_once $original_path; } else { require_once __DIR__ . '/HealthCheck/BackCompat/' . $filename; if ( ! defined( 'HEALTH_CHECK_BACKCOMPAT_LOADED' ) ) { define( 'HEALTH_CHECK_BACKCOMPAT_LOADED', true ); } } } } add_action( 'plugins_loaded', function() { // Include class-files used by our plugin. require_once( dirname( __FILE__ ) . '/HealthCheck/class-health-check.php' ); require_once( dirname( __FILE__ ) . '/HealthCheck/class-health-check-loopback.php' ); require_once( dirname( __FILE__ ) . '/HealthCheck/class-health-check-screenshots.php' ); require_once( dirname( __FILE__ ) . '/HealthCheck/class-health-check-troubleshoot.php' ); // Tools section. require_once( dirname( __FILE__ ) . '/HealthCheck/Tools/class-health-check-tool.php' ); require_once( dirname( __FILE__ ) . '/HealthCheck/Tools/class-health-check-files-integrity.php' ); require_once( dirname( __FILE__ ) . '/HealthCheck/Tools/class-health-check-mail-check.php' ); require_once( dirname( __FILE__ ) . '/HealthCheck/Tools/class-health-check-debug-log-viewer.php' ); require_once( dirname( __FILE__ ) . '/HealthCheck/Tools/class-health-check-plugin-compatibility.php' ); require_once( dirname( __FILE__ ) . '/HealthCheck/Tools/class-health-check-phpinfo.php' ); require_once( dirname( __FILE__ ) . '/HealthCheck/Tools/class-health-check-htaccess.php' ); require_once( dirname( __FILE__ ) . '/HealthCheck/Tools/class-health-check-robotstxt.php' ); require_once( dirname( __FILE__ ) . '/HealthCheck/Tools/class-health-check-beta-features.php' ); // Initialize our plugin. new Health_Check(); if ( defined( 'WP_CLI' ) && WP_CLI ) { require_once( dirname( __FILE__ ) . '/HealthCheck/class-cli.php' ); } } ); PK!.cTT#build/health-check-global.asset.phpnu[ array(), 'version' => '950cce4a6a8a23c6400e'); PK!ɤVVbuild/health-check-global.jsnu[(()=>{var A={120:function(A){A.exports=function(){"use strict";var A=function(e,t){return A=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(A,e){A.__proto__=e}||function(A,e){for(var t in e)Object.prototype.hasOwnProperty.call(e,t)&&(A[t]=e[t])},A(e,t)};function e(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function __(){this.constructor=e}A(e,t),e.prototype=null===t?Object.create(t):(__.prototype=t.prototype,new __)}var t=function(){return t=Object.assign||function(A){for(var e,t=1,r=arguments.length;t0&&B[B.length-1])||6!==n[0]&&2!==n[0])){s=0;continue}if(3===n[0]&&(!B||n[1]>B[0]&&n[1]=55296&&B<=56319&&t>10),s%1024+56320)),(B+1===t||r.length>16384)&&(n+=String.fromCharCode.apply(String,r),r.length=0)}return n},Q="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",a="undefined"==typeof Uint8Array?[]:new Uint8Array(256),g=0;g<64;g++)a[Q.charCodeAt(g)]=g;for(var w="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",u="undefined"==typeof Uint8Array?[]:new Uint8Array(256),l=0;l<64;l++)u[w.charCodeAt(l)]=l;for(var U=function(A,e,t){return A.slice?A.slice(e,t):new Uint16Array(Array.prototype.slice.call(A,e,t))},C=function(){function A(A,e,t,r,B,n){this.initialValue=A,this.errorValue=e,this.highStart=t,this.highValueIndex=r,this.index=B,this.data=n}return A.prototype.get=function(A){var e;if(A>=0){if(A<55296||A>56319&&A<=65535)return e=((e=this.index[A>>5])<<2)+(31&A),this.data[e];if(A<=65535)return e=((e=this.index[2048+(A-55296>>5)])<<2)+(31&A),this.data[e];if(A>11),e=this.index[e],e+=A>>5&63,e=((e=this.index[e])<<2)+(31&A),this.data[e];if(A<=1114111)return this.data[this.highValueIndex]}return this.errorValue},A}(),F="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",h="undefined"==typeof Uint8Array?[]:new Uint8Array(256),d=0;d<64;d++)h[F.charCodeAt(d)]=d;var f=10,H=13,p=15,E=17,I=18,y=19,K=20,m=21,L=22,v=24,b=25,D=26,x=27,M=28,S=30,T=32,G=33,O=34,V=35,k=37,R=38,N=39,P=40,X=42,J=[9001,65288],Y="×",W="÷",Z=function(A,e){var t,r,B,n=function(A){var e,t,r,B,n,s=.75*A.length,o=A.length,i=0;"="===A[A.length-1]&&(s--,"="===A[A.length-2]&&s--);var c="undefined"!=typeof ArrayBuffer&&"undefined"!=typeof Uint8Array&&void 0!==Uint8Array.prototype.slice?new ArrayBuffer(s):new Array(s),Q=Array.isArray(c)?c:new Uint8Array(c);for(e=0;e>4,Q[i++]=(15&r)<<4|B>>2,Q[i++]=(3&B)<<6|63&n;return c}(A),s=Array.isArray(n)?function(A){for(var e=A.length,t=[],r=0;r0;){var s=r[--n];if(Array.isArray(A)?-1!==A.indexOf(s):A===s)for(var o=t;o<=r.length;){var i;if((i=r[++o])===e)return!0;if(i!==f)break}if(s!==f)break}return!1},rA=function(A,e){for(var t=A;t>=0;){var r=e[t];if(r!==f)return r;t--}return 0},BA=function(A,e,t,r,B){if(0===t[r])return Y;var n=r-1;if(Array.isArray(B)&&!0===B[n])return Y;var s=n-1,o=n+1,i=e[n],c=s>=0?e[s]:0,Q=e[o];if(2===i&&3===Q)return Y;if(-1!==q.indexOf(i))return"!";if(-1!==q.indexOf(Q))return Y;if(-1!==j.indexOf(Q))return Y;if(8===rA(n,e))return W;if(11===Z.get(A[n]))return Y;if((i===T||i===G)&&11===Z.get(A[o]))return Y;if(7===i||7===Q)return Y;if(9===i)return Y;if(-1===[f,H,p].indexOf(i)&&9===Q)return Y;if(-1!==[E,I,y,v,M].indexOf(Q))return Y;if(rA(n,e)===L)return Y;if(tA(23,L,n,e))return Y;if(tA([E,I],m,n,e))return Y;if(tA(12,12,n,e))return Y;if(i===f)return W;if(23===i||23===Q)return Y;if(16===Q||16===i)return W;if(-1!==[H,p,m].indexOf(Q)||14===i)return Y;if(36===c&&-1!==eA.indexOf(i))return Y;if(i===M&&36===Q)return Y;if(Q===K)return Y;if(-1!==_.indexOf(Q)&&i===b||-1!==_.indexOf(i)&&Q===b)return Y;if(i===x&&-1!==[k,T,G].indexOf(Q)||-1!==[k,T,G].indexOf(i)&&Q===D)return Y;if(-1!==_.indexOf(i)&&-1!==z.indexOf(Q)||-1!==z.indexOf(i)&&-1!==_.indexOf(Q))return Y;if(-1!==[x,D].indexOf(i)&&(Q===b||-1!==[L,p].indexOf(Q)&&e[o+1]===b)||-1!==[L,p].indexOf(i)&&Q===b||i===b&&-1!==[b,M,v].indexOf(Q))return Y;if(-1!==[b,M,v,E,I].indexOf(Q))for(var a=n;a>=0;){if((g=e[a])===b)return Y;if(-1===[M,v].indexOf(g))break;a--}if(-1!==[x,D].indexOf(Q))for(a=-1!==[E,I].indexOf(i)?s:n;a>=0;){var g;if((g=e[a])===b)return Y;if(-1===[M,v].indexOf(g))break;a--}if(R===i&&-1!==[R,N,O,V].indexOf(Q)||-1!==[N,O].indexOf(i)&&-1!==[N,P].indexOf(Q)||-1!==[P,V].indexOf(i)&&Q===P)return Y;if(-1!==AA.indexOf(i)&&-1!==[K,D].indexOf(Q)||-1!==AA.indexOf(Q)&&i===x)return Y;if(-1!==_.indexOf(i)&&-1!==_.indexOf(Q))return Y;if(i===v&&-1!==_.indexOf(Q))return Y;if(-1!==_.concat(b).indexOf(i)&&Q===L&&-1===J.indexOf(A[o])||-1!==_.concat(b).indexOf(Q)&&i===I)return Y;if(41===i&&41===Q){for(var w=t[n],u=1;w>0&&41===e[--w];)u++;if(u%2!=0)return Y}return i===T&&Q===G?Y:W},nA=function(A,e){e||(e={lineBreak:"normal",wordBreak:"normal"});var t=function(A,e){void 0===e&&(e="strict");var t=[],r=[],B=[];return A.forEach((function(A,n){var s=Z.get(A);if(s>50?(B.push(!0),s-=50):B.push(!1),-1!==["normal","auto","loose"].indexOf(e)&&-1!==[8208,8211,12316,12448].indexOf(A))return r.push(n),t.push(16);if(4===s||11===s){if(0===n)return r.push(n),t.push(S);var o=t[n-1];return-1===$.indexOf(o)?(r.push(r[n-1]),t.push(o)):(r.push(n),t.push(S))}return r.push(n),31===s?t.push("strict"===e?m:k):s===X||29===s?t.push(S):43===s?A>=131072&&A<=196605||A>=196608&&A<=262141?t.push(k):t.push(S):void t.push(s)})),[r,t,B]}(A,e.lineBreak),r=t[0],B=t[1],n=t[2];"break-all"!==e.wordBreak&&"break-word"!==e.wordBreak||(B=B.map((function(A){return-1!==[b,S,X].indexOf(A)?k:A})));var s="keep-all"===e.wordBreak?n.map((function(e,t){return e&&A[t]>=19968&&A[t]<=40959})):void 0;return[r,B,s]},sA=function(){function A(A,e,t,r){this.codePoints=A,this.required="!"===e,this.start=t,this.end=r}return A.prototype.slice=function(){return c.apply(void 0,this.codePoints.slice(this.start,this.end))},A}(),oA=45,iA=43,cA=-1,QA=function(A){return A>=48&&A<=57},aA=function(A){return QA(A)||A>=65&&A<=70||A>=97&&A<=102},gA=function(A){return 10===A||9===A||32===A},wA=function(A){return function(A){return function(A){return A>=97&&A<=122}(A)||function(A){return A>=65&&A<=90}(A)}(A)||function(A){return A>=128}(A)||95===A},uA=function(A){return wA(A)||QA(A)||A===oA},lA=function(A){return A>=0&&A<=8||11===A||A>=14&&A<=31||127===A},UA=function(A,e){return 92===A&&10!==e},CA=function(A,e,t){return A===oA?wA(e)||UA(e,t):!!wA(A)||!(92!==A||!UA(A,e))},FA=function(A,e,t){return A===iA||A===oA?!!QA(e)||46===e&&QA(t):QA(46===A?e:A)},hA=function(A){var e=0,t=1;A[e]!==iA&&A[e]!==oA||(A[e]===oA&&(t=-1),e++);for(var r=[];QA(A[e]);)r.push(A[e++]);var B=r.length?parseInt(c.apply(void 0,r),10):0;46===A[e]&&e++;for(var n=[];QA(A[e]);)n.push(A[e++]);var s=n.length,o=s?parseInt(c.apply(void 0,n),10):0;69!==A[e]&&101!==A[e]||e++;var i=1;A[e]!==iA&&A[e]!==oA||(A[e]===oA&&(i=-1),e++);for(var Q=[];QA(A[e]);)Q.push(A[e++]);var a=Q.length?parseInt(c.apply(void 0,Q),10):0;return t*(B+o*Math.pow(10,-s))*Math.pow(10,i*a)},dA={type:2},fA={type:3},HA={type:4},pA={type:13},EA={type:8},IA={type:21},yA={type:9},KA={type:10},mA={type:11},LA={type:12},vA={type:14},bA={type:23},DA={type:1},xA={type:25},MA={type:24},SA={type:26},TA={type:27},GA={type:28},OA={type:29},VA={type:31},kA={type:32},RA=function(){function A(){this._value=[]}return A.prototype.write=function(A){this._value=this._value.concat(i(A))},A.prototype.read=function(){for(var A=[],e=this.consumeToken();e!==kA;)A.push(e),e=this.consumeToken();return A},A.prototype.consumeToken=function(){var A=this.consumeCodePoint();switch(A){case 34:return this.consumeStringToken(34);case 35:var e=this.peekCodePoint(0),t=this.peekCodePoint(1),r=this.peekCodePoint(2);if(uA(e)||UA(t,r)){var B=CA(e,t,r)?2:1;return{type:5,value:this.consumeName(),flags:B}}break;case 36:if(61===this.peekCodePoint(0))return this.consumeCodePoint(),pA;break;case 39:return this.consumeStringToken(39);case 40:return dA;case 41:return fA;case 42:if(61===this.peekCodePoint(0))return this.consumeCodePoint(),vA;break;case iA:if(FA(A,this.peekCodePoint(0),this.peekCodePoint(1)))return this.reconsumeCodePoint(A),this.consumeNumericToken();break;case 44:return HA;case oA:var n=A,s=this.peekCodePoint(0),o=this.peekCodePoint(1);if(FA(n,s,o))return this.reconsumeCodePoint(A),this.consumeNumericToken();if(CA(n,s,o))return this.reconsumeCodePoint(A),this.consumeIdentLikeToken();if(s===oA&&62===o)return this.consumeCodePoint(),this.consumeCodePoint(),MA;break;case 46:if(FA(A,this.peekCodePoint(0),this.peekCodePoint(1)))return this.reconsumeCodePoint(A),this.consumeNumericToken();break;case 47:if(42===this.peekCodePoint(0))for(this.consumeCodePoint();;){var i=this.consumeCodePoint();if(42===i&&47===(i=this.consumeCodePoint()))return this.consumeToken();if(i===cA)return this.consumeToken()}break;case 58:return SA;case 59:return TA;case 60:if(33===this.peekCodePoint(0)&&this.peekCodePoint(1)===oA&&this.peekCodePoint(2)===oA)return this.consumeCodePoint(),this.consumeCodePoint(),xA;break;case 64:var Q=this.peekCodePoint(0),a=this.peekCodePoint(1),g=this.peekCodePoint(2);if(CA(Q,a,g))return{type:7,value:this.consumeName()};break;case 91:return GA;case 92:if(UA(A,this.peekCodePoint(0)))return this.reconsumeCodePoint(A),this.consumeIdentLikeToken();break;case 93:return OA;case 61:if(61===this.peekCodePoint(0))return this.consumeCodePoint(),EA;break;case 123:return mA;case 125:return LA;case 117:case 85:var w=this.peekCodePoint(0),u=this.peekCodePoint(1);return w!==iA||!aA(u)&&63!==u||(this.consumeCodePoint(),this.consumeUnicodeRangeToken()),this.reconsumeCodePoint(A),this.consumeIdentLikeToken();case 124:if(61===this.peekCodePoint(0))return this.consumeCodePoint(),yA;if(124===this.peekCodePoint(0))return this.consumeCodePoint(),IA;break;case 126:if(61===this.peekCodePoint(0))return this.consumeCodePoint(),KA;break;case cA:return kA}return gA(A)?(this.consumeWhiteSpace(),VA):QA(A)?(this.reconsumeCodePoint(A),this.consumeNumericToken()):wA(A)?(this.reconsumeCodePoint(A),this.consumeIdentLikeToken()):{type:6,value:c(A)}},A.prototype.consumeCodePoint=function(){var A=this._value.shift();return void 0===A?-1:A},A.prototype.reconsumeCodePoint=function(A){this._value.unshift(A)},A.prototype.peekCodePoint=function(A){return A>=this._value.length?-1:this._value[A]},A.prototype.consumeUnicodeRangeToken=function(){for(var A=[],e=this.consumeCodePoint();aA(e)&&A.length<6;)A.push(e),e=this.consumeCodePoint();for(var t=!1;63===e&&A.length<6;)A.push(e),e=this.consumeCodePoint(),t=!0;if(t)return{type:30,start:parseInt(c.apply(void 0,A.map((function(A){return 63===A?48:A}))),16),end:parseInt(c.apply(void 0,A.map((function(A){return 63===A?70:A}))),16)};var r=parseInt(c.apply(void 0,A),16);if(this.peekCodePoint(0)===oA&&aA(this.peekCodePoint(1))){this.consumeCodePoint(),e=this.consumeCodePoint();for(var B=[];aA(e)&&B.length<6;)B.push(e),e=this.consumeCodePoint();return{type:30,start:r,end:parseInt(c.apply(void 0,B),16)}}return{type:30,start:r,end:r}},A.prototype.consumeIdentLikeToken=function(){var A=this.consumeName();return"url"===A.toLowerCase()&&40===this.peekCodePoint(0)?(this.consumeCodePoint(),this.consumeUrlToken()):40===this.peekCodePoint(0)?(this.consumeCodePoint(),{type:19,value:A}):{type:20,value:A}},A.prototype.consumeUrlToken=function(){var A=[];if(this.consumeWhiteSpace(),this.peekCodePoint(0)===cA)return{type:22,value:""};var e=this.peekCodePoint(0);if(39===e||34===e){var t=this.consumeStringToken(this.consumeCodePoint());return 0===t.type&&(this.consumeWhiteSpace(),this.peekCodePoint(0)===cA||41===this.peekCodePoint(0))?(this.consumeCodePoint(),{type:22,value:t.value}):(this.consumeBadUrlRemnants(),bA)}for(;;){var r=this.consumeCodePoint();if(r===cA||41===r)return{type:22,value:c.apply(void 0,A)};if(gA(r))return this.consumeWhiteSpace(),this.peekCodePoint(0)===cA||41===this.peekCodePoint(0)?(this.consumeCodePoint(),{type:22,value:c.apply(void 0,A)}):(this.consumeBadUrlRemnants(),bA);if(34===r||39===r||40===r||lA(r))return this.consumeBadUrlRemnants(),bA;if(92===r){if(!UA(r,this.peekCodePoint(0)))return this.consumeBadUrlRemnants(),bA;A.push(this.consumeEscapedCodePoint())}else A.push(r)}},A.prototype.consumeWhiteSpace=function(){for(;gA(this.peekCodePoint(0));)this.consumeCodePoint()},A.prototype.consumeBadUrlRemnants=function(){for(;;){var A=this.consumeCodePoint();if(41===A||A===cA)return;UA(A,this.peekCodePoint(0))&&this.consumeEscapedCodePoint()}},A.prototype.consumeStringSlice=function(A){for(var e="";A>0;){var t=Math.min(5e4,A);e+=c.apply(void 0,this._value.splice(0,t)),A-=t}return this._value.shift(),e},A.prototype.consumeStringToken=function(A){for(var e="",t=0;;){var r=this._value[t];if(r===cA||void 0===r||r===A)return{type:0,value:e+=this.consumeStringSlice(t)};if(10===r)return this._value.splice(0,t),DA;if(92===r){var B=this._value[t+1];B!==cA&&void 0!==B&&(10===B?(e+=this.consumeStringSlice(t),t=-1,this._value.shift()):UA(r,B)&&(e+=this.consumeStringSlice(t),e+=c(this.consumeEscapedCodePoint()),t=-1))}t++}},A.prototype.consumeNumber=function(){var A=[],e=4,t=this.peekCodePoint(0);for(t!==iA&&t!==oA||A.push(this.consumeCodePoint());QA(this.peekCodePoint(0));)A.push(this.consumeCodePoint());t=this.peekCodePoint(0);var r=this.peekCodePoint(1);if(46===t&&QA(r))for(A.push(this.consumeCodePoint(),this.consumeCodePoint()),e=8;QA(this.peekCodePoint(0));)A.push(this.consumeCodePoint());t=this.peekCodePoint(0),r=this.peekCodePoint(1);var B=this.peekCodePoint(2);if((69===t||101===t)&&((r===iA||r===oA)&&QA(B)||QA(r)))for(A.push(this.consumeCodePoint(),this.consumeCodePoint()),e=8;QA(this.peekCodePoint(0));)A.push(this.consumeCodePoint());return[hA(A),e]},A.prototype.consumeNumericToken=function(){var A=this.consumeNumber(),e=A[0],t=A[1],r=this.peekCodePoint(0),B=this.peekCodePoint(1),n=this.peekCodePoint(2);return CA(r,B,n)?{type:15,number:e,flags:t,unit:this.consumeName()}:37===r?(this.consumeCodePoint(),{type:16,number:e,flags:t}):{type:17,number:e,flags:t}},A.prototype.consumeEscapedCodePoint=function(){var A=this.consumeCodePoint();if(aA(A)){for(var e=c(A);aA(this.peekCodePoint(0))&&e.length<6;)e+=c(this.consumeCodePoint());gA(this.peekCodePoint(0))&&this.consumeCodePoint();var t=parseInt(e,16);return 0===t||function(A){return A>=55296&&A<=57343}(t)||t>1114111?65533:t}return A===cA?65533:A},A.prototype.consumeName=function(){for(var A="";;){var e=this.consumeCodePoint();if(uA(e))A+=c(e);else{if(!UA(e,this.peekCodePoint(0)))return this.reconsumeCodePoint(e),A;A+=c(this.consumeEscapedCodePoint())}}},A}(),NA=function(){function A(A){this._tokens=A}return A.create=function(e){var t=new RA;return t.write(e),new A(t.read())},A.parseValue=function(e){return A.create(e).parseComponentValue()},A.parseValues=function(e){return A.create(e).parseComponentValues()},A.prototype.parseComponentValue=function(){for(var A=this.consumeToken();31===A.type;)A=this.consumeToken();if(32===A.type)throw new SyntaxError("Error parsing CSS component value, unexpected EOF");this.reconsumeToken(A);var e=this.consumeComponentValue();do{A=this.consumeToken()}while(31===A.type);if(32===A.type)return e;throw new SyntaxError("Error parsing CSS component value, multiple values found when expecting only one")},A.prototype.parseComponentValues=function(){for(var A=[];;){var e=this.consumeComponentValue();if(32===e.type)return A;A.push(e),A.push()}},A.prototype.consumeComponentValue=function(){var A=this.consumeToken();switch(A.type){case 11:case 28:case 2:return this.consumeSimpleBlock(A.type);case 19:return this.consumeFunction(A)}return A},A.prototype.consumeSimpleBlock=function(A){for(var e={type:A,values:[]},t=this.consumeToken();;){if(32===t.type||jA(t,A))return e;this.reconsumeToken(t),e.values.push(this.consumeComponentValue()),t=this.consumeToken()}},A.prototype.consumeFunction=function(A){for(var e={name:A.value,values:[],type:18};;){var t=this.consumeToken();if(32===t.type||3===t.type)return e;this.reconsumeToken(t),e.values.push(this.consumeComponentValue())}},A.prototype.consumeToken=function(){var A=this._tokens.shift();return void 0===A?kA:A},A.prototype.reconsumeToken=function(A){this._tokens.unshift(A)},A}(),PA=function(A){return 15===A.type},XA=function(A){return 17===A.type},JA=function(A){return 20===A.type},YA=function(A){return 0===A.type},WA=function(A,e){return JA(A)&&A.value===e},ZA=function(A){return 31!==A.type},_A=function(A){return 31!==A.type&&4!==A.type},qA=function(A){var e=[],t=[];return A.forEach((function(A){if(4===A.type){if(0===t.length)throw new Error("Error parsing function args, zero tokens for arg");return e.push(t),void(t=[])}31!==A.type&&t.push(A)})),t.length&&e.push(t),e},jA=function(A,e){return 11===e&&12===A.type||28===e&&29===A.type||2===e&&3===A.type},zA=function(A){return 17===A.type||15===A.type},$A=function(A){return 16===A.type||zA(A)},Ae=function(A){return A.length>1?[A[0],A[1]]:[A[0]]},ee={type:17,number:0,flags:4},te={type:16,number:50,flags:4},re={type:16,number:100,flags:4},Be=function(A,e,t){var r=A[0],B=A[1];return[ne(r,e),ne(void 0!==B?B:r,t)]},ne=function(A,e){if(16===A.type)return A.number/100*e;if(PA(A))switch(A.unit){case"rem":case"em":return 16*A.number;default:return A.number}return A.number},se="grad",oe="turn",ie=function(A,e){if(15===e.type)switch(e.unit){case"deg":return Math.PI*e.number/180;case se:return Math.PI/200*e.number;case"rad":return e.number;case oe:return 2*Math.PI*e.number}throw new Error("Unsupported angle type")},ce=function(A){return 15===A.type&&("deg"===A.unit||A.unit===se||"rad"===A.unit||A.unit===oe)},Qe=function(A){switch(A.filter(JA).map((function(A){return A.value})).join(" ")){case"to bottom right":case"to right bottom":case"left top":case"top left":return[ee,ee];case"to top":case"bottom":return ae(0);case"to bottom left":case"to left bottom":case"right top":case"top right":return[ee,re];case"to right":case"left":return ae(90);case"to top left":case"to left top":case"right bottom":case"bottom right":return[re,re];case"to bottom":case"top":return ae(180);case"to top right":case"to right top":case"left bottom":case"bottom left":return[re,ee];case"to left":case"right":return ae(270)}return 0},ae=function(A){return Math.PI*A/180},ge=function(A,e){if(18===e.type){var t=de[e.name];if(void 0===t)throw new Error('Attempting to parse an unsupported color function "'+e.name+'"');return t(A,e.values)}if(5===e.type){if(3===e.value.length){var r=e.value.substring(0,1),B=e.value.substring(1,2),n=e.value.substring(2,3);return le(parseInt(r+r,16),parseInt(B+B,16),parseInt(n+n,16),1)}if(4===e.value.length){r=e.value.substring(0,1),B=e.value.substring(1,2),n=e.value.substring(2,3);var s=e.value.substring(3,4);return le(parseInt(r+r,16),parseInt(B+B,16),parseInt(n+n,16),parseInt(s+s,16)/255)}if(6===e.value.length)return r=e.value.substring(0,2),B=e.value.substring(2,4),n=e.value.substring(4,6),le(parseInt(r,16),parseInt(B,16),parseInt(n,16),1);if(8===e.value.length)return r=e.value.substring(0,2),B=e.value.substring(2,4),n=e.value.substring(4,6),s=e.value.substring(6,8),le(parseInt(r,16),parseInt(B,16),parseInt(n,16),parseInt(s,16)/255)}if(20===e.type){var o=He[e.value.toUpperCase()];if(void 0!==o)return o}return He.TRANSPARENT},we=function(A){return 0==(255&A)},ue=function(A){var e=255&A,t=255&A>>8,r=255&A>>16,B=255&A>>24;return e<255?"rgba("+B+","+r+","+t+","+e/255+")":"rgb("+B+","+r+","+t+")"},le=function(A,e,t,r){return(A<<24|e<<16|t<<8|Math.round(255*r)<<0)>>>0},Ue=function(A,e){if(17===A.type)return A.number;if(16===A.type){var t=3===e?1:255;return 3===e?A.number/100*t:Math.round(A.number/100*t)}return 0},Ce=function(A,e){var t=e.filter(_A);if(3===t.length){var r=t.map(Ue),B=r[0],n=r[1],s=r[2];return le(B,n,s,1)}if(4===t.length){var o=t.map(Ue),i=(B=o[0],n=o[1],s=o[2],o[3]);return le(B,n,s,i)}return 0};function Fe(A,e,t){return t<0&&(t+=1),t>=1&&(t-=1),t<1/6?(e-A)*t*6+A:t<.5?e:t<2/3?6*(e-A)*(2/3-t)+A:A}var he=function(A,e){var t=e.filter(_A),r=t[0],B=t[1],n=t[2],s=t[3],o=(17===r.type?ae(r.number):ie(A,r))/(2*Math.PI),i=$A(B)?B.number/100:0,c=$A(n)?n.number/100:0,Q=void 0!==s&&$A(s)?ne(s,1):1;if(0===i)return le(255*c,255*c,255*c,1);var a=c<=.5?c*(i+1):c+i-c*i,g=2*c-a,w=Fe(g,a,o+1/3),u=Fe(g,a,o),l=Fe(g,a,o-1/3);return le(255*w,255*u,255*l,Q)},de={hsl:he,hsla:he,rgb:Ce,rgba:Ce},fe=function(A,e){return ge(A,NA.create(e).parseComponentValue())},He={ALICEBLUE:4042850303,ANTIQUEWHITE:4209760255,AQUA:16777215,AQUAMARINE:2147472639,AZURE:4043309055,BEIGE:4126530815,BISQUE:4293182719,BLACK:255,BLANCHEDALMOND:4293643775,BLUE:65535,BLUEVIOLET:2318131967,BROWN:2771004159,BURLYWOOD:3736635391,CADETBLUE:1604231423,CHARTREUSE:2147418367,CHOCOLATE:3530104575,CORAL:4286533887,CORNFLOWERBLUE:1687547391,CORNSILK:4294499583,CRIMSON:3692313855,CYAN:16777215,DARKBLUE:35839,DARKCYAN:9145343,DARKGOLDENROD:3095837695,DARKGRAY:2846468607,DARKGREEN:6553855,DARKGREY:2846468607,DARKKHAKI:3182914559,DARKMAGENTA:2332068863,DARKOLIVEGREEN:1433087999,DARKORANGE:4287365375,DARKORCHID:2570243327,DARKRED:2332033279,DARKSALMON:3918953215,DARKSEAGREEN:2411499519,DARKSLATEBLUE:1211993087,DARKSLATEGRAY:793726975,DARKSLATEGREY:793726975,DARKTURQUOISE:13554175,DARKVIOLET:2483082239,DEEPPINK:4279538687,DEEPSKYBLUE:12582911,DIMGRAY:1768516095,DIMGREY:1768516095,DODGERBLUE:512819199,FIREBRICK:2988581631,FLORALWHITE:4294635775,FORESTGREEN:579543807,FUCHSIA:4278255615,GAINSBORO:3705462015,GHOSTWHITE:4177068031,GOLD:4292280575,GOLDENROD:3668254975,GRAY:2155905279,GREEN:8388863,GREENYELLOW:2919182335,GREY:2155905279,HONEYDEW:4043305215,HOTPINK:4285117695,INDIANRED:3445382399,INDIGO:1258324735,IVORY:4294963455,KHAKI:4041641215,LAVENDER:3873897215,LAVENDERBLUSH:4293981695,LAWNGREEN:2096890111,LEMONCHIFFON:4294626815,LIGHTBLUE:2916673279,LIGHTCORAL:4034953471,LIGHTCYAN:3774873599,LIGHTGOLDENRODYELLOW:4210742015,LIGHTGRAY:3553874943,LIGHTGREEN:2431553791,LIGHTGREY:3553874943,LIGHTPINK:4290167295,LIGHTSALMON:4288707327,LIGHTSEAGREEN:548580095,LIGHTSKYBLUE:2278488831,LIGHTSLATEGRAY:2005441023,LIGHTSLATEGREY:2005441023,LIGHTSTEELBLUE:2965692159,LIGHTYELLOW:4294959359,LIME:16711935,LIMEGREEN:852308735,LINEN:4210091775,MAGENTA:4278255615,MAROON:2147483903,MEDIUMAQUAMARINE:1724754687,MEDIUMBLUE:52735,MEDIUMORCHID:3126187007,MEDIUMPURPLE:2473647103,MEDIUMSEAGREEN:1018393087,MEDIUMSLATEBLUE:2070474495,MEDIUMSPRINGGREEN:16423679,MEDIUMTURQUOISE:1221709055,MEDIUMVIOLETRED:3340076543,MIDNIGHTBLUE:421097727,MINTCREAM:4127193855,MISTYROSE:4293190143,MOCCASIN:4293178879,NAVAJOWHITE:4292783615,NAVY:33023,OLDLACE:4260751103,OLIVE:2155872511,OLIVEDRAB:1804477439,ORANGE:4289003775,ORANGERED:4282712319,ORCHID:3664828159,PALEGOLDENROD:4008225535,PALEGREEN:2566625535,PALETURQUOISE:2951671551,PALEVIOLETRED:3681588223,PAPAYAWHIP:4293907967,PEACHPUFF:4292524543,PERU:3448061951,PINK:4290825215,PLUM:3718307327,POWDERBLUE:2967529215,PURPLE:2147516671,REBECCAPURPLE:1714657791,RED:4278190335,ROSYBROWN:3163525119,ROYALBLUE:1097458175,SADDLEBROWN:2336560127,SALMON:4202722047,SANDYBROWN:4104413439,SEAGREEN:780883967,SEASHELL:4294307583,SIENNA:2689740287,SILVER:3233857791,SKYBLUE:2278484991,SLATEBLUE:1784335871,SLATEGRAY:1887473919,SLATEGREY:1887473919,SNOW:4294638335,SPRINGGREEN:16744447,STEELBLUE:1182971135,TAN:3535047935,TEAL:8421631,THISTLE:3636451583,TOMATO:4284696575,TRANSPARENT:0,TURQUOISE:1088475391,VIOLET:4001558271,WHEAT:4125012991,WHITE:4294967295,WHITESMOKE:4126537215,YELLOW:4294902015,YELLOWGREEN:2597139199},pe={name:"background-clip",initialValue:"border-box",prefix:!1,type:1,parse:function(A,e){return e.map((function(A){if(JA(A))switch(A.value){case"padding-box":return 1;case"content-box":return 2}return 0}))}},Ee={name:"background-color",initialValue:"transparent",prefix:!1,type:3,format:"color"},Ie=function(A,e){var t=ge(A,e[0]),r=e[1];return r&&$A(r)?{color:t,stop:r}:{color:t,stop:null}},ye=function(A,e){var t=A[0],r=A[A.length-1];null===t.stop&&(t.stop=ee),null===r.stop&&(r.stop=re);for(var B=[],n=0,s=0;sn?B.push(i):B.push(n),n=i}else B.push(null)}var c=null;for(s=0;sA.optimumDistance)?{optimumCorner:e,optimumDistance:o}:A}),{optimumDistance:B?1/0:-1/0,optimumCorner:null}).optimumCorner},ve=function(A,e){var t=ae(180),r=[];return qA(e).forEach((function(e,B){if(0===B){var n=e[0];if(20===n.type&&-1!==["top","left","right","bottom"].indexOf(n.value))return void(t=Qe(e));if(ce(n))return void(t=(ie(A,n)+ae(270))%ae(360))}var s=Ie(A,e);r.push(s)})),{angle:t,stops:r,type:1}},be="closest-side",De="farthest-side",xe="closest-corner",Me="farthest-corner",Se="circle",Te="ellipse",Ge="cover",Oe="contain",Ve=function(A,e){var t=0,r=3,B=[],n=[];return qA(e).forEach((function(e,s){var o=!0;if(0===s?o=e.reduce((function(A,e){if(JA(e))switch(e.value){case"center":return n.push(te),!1;case"top":case"left":return n.push(ee),!1;case"right":case"bottom":return n.push(re),!1}else if($A(e)||zA(e))return n.push(e),!1;return A}),o):1===s&&(o=e.reduce((function(A,e){if(JA(e))switch(e.value){case Se:return t=0,!1;case Te:return t=1,!1;case Oe:case be:return r=0,!1;case De:return r=1,!1;case xe:return r=2,!1;case Ge:case Me:return r=3,!1}else if(zA(e)||$A(e))return Array.isArray(r)||(r=[]),r.push(e),!1;return A}),o)),o){var i=Ie(A,e);B.push(i)}})),{size:r,shape:t,stops:B,position:n,type:2}},ke=function(A,e){if(22===e.type){var t={url:e.value,type:0};return A.cache.addImage(e.value),t}if(18===e.type){var r=Ne[e.name];if(void 0===r)throw new Error('Attempting to parse an unsupported image function "'+e.name+'"');return r(A,e.values)}throw new Error("Unsupported image type "+e.type)};var Re,Ne={"linear-gradient":function(A,e){var t=ae(180),r=[];return qA(e).forEach((function(e,B){if(0===B){var n=e[0];if(20===n.type&&"to"===n.value)return void(t=Qe(e));if(ce(n))return void(t=ie(A,n))}var s=Ie(A,e);r.push(s)})),{angle:t,stops:r,type:1}},"-moz-linear-gradient":ve,"-ms-linear-gradient":ve,"-o-linear-gradient":ve,"-webkit-linear-gradient":ve,"radial-gradient":function(A,e){var t=0,r=3,B=[],n=[];return qA(e).forEach((function(e,s){var o=!0;if(0===s){var i=!1;o=e.reduce((function(A,e){if(i)if(JA(e))switch(e.value){case"center":return n.push(te),A;case"top":case"left":return n.push(ee),A;case"right":case"bottom":return n.push(re),A}else($A(e)||zA(e))&&n.push(e);else if(JA(e))switch(e.value){case Se:return t=0,!1;case Te:return t=1,!1;case"at":return i=!0,!1;case be:return r=0,!1;case Ge:case De:return r=1,!1;case Oe:case xe:return r=2,!1;case Me:return r=3,!1}else if(zA(e)||$A(e))return Array.isArray(r)||(r=[]),r.push(e),!1;return A}),o)}if(o){var c=Ie(A,e);B.push(c)}})),{size:r,shape:t,stops:B,position:n,type:2}},"-moz-radial-gradient":Ve,"-ms-radial-gradient":Ve,"-o-radial-gradient":Ve,"-webkit-radial-gradient":Ve,"-webkit-gradient":function(A,e){var t=ae(180),r=[],B=1;return qA(e).forEach((function(e,t){var n=e[0];if(0===t){if(JA(n)&&"linear"===n.value)return void(B=1);if(JA(n)&&"radial"===n.value)return void(B=2)}if(18===n.type)if("from"===n.name){var s=ge(A,n.values[0]);r.push({stop:ee,color:s})}else if("to"===n.name)s=ge(A,n.values[0]),r.push({stop:re,color:s});else if("color-stop"===n.name){var o=n.values.filter(_A);if(2===o.length){s=ge(A,o[1]);var i=o[0];XA(i)&&r.push({stop:{type:16,number:100*i.number,flags:i.flags},color:s})}}})),1===B?{angle:(t+ae(180))%ae(360),stops:r,type:B}:{size:3,shape:0,stops:r,position:[],type:B}}},Pe={name:"background-image",initialValue:"none",type:1,prefix:!1,parse:function(A,e){if(0===e.length)return[];var t=e[0];return 20===t.type&&"none"===t.value?[]:e.filter((function(A){return _A(A)&&function(A){return!(20===A.type&&"none"===A.value||18===A.type&&!Ne[A.name])}(A)})).map((function(e){return ke(A,e)}))}},Xe={name:"background-origin",initialValue:"border-box",prefix:!1,type:1,parse:function(A,e){return e.map((function(A){if(JA(A))switch(A.value){case"padding-box":return 1;case"content-box":return 2}return 0}))}},Je={name:"background-position",initialValue:"0% 0%",type:1,prefix:!1,parse:function(A,e){return qA(e).map((function(A){return A.filter($A)})).map(Ae)}},Ye={name:"background-repeat",initialValue:"repeat",prefix:!1,type:1,parse:function(A,e){return qA(e).map((function(A){return A.filter(JA).map((function(A){return A.value})).join(" ")})).map(We)}},We=function(A){switch(A){case"no-repeat":return 1;case"repeat-x":case"repeat no-repeat":return 2;case"repeat-y":case"no-repeat repeat":return 3;default:return 0}};!function(A){A.AUTO="auto",A.CONTAIN="contain",A.COVER="cover"}(Re||(Re={}));var Ze,_e={name:"background-size",initialValue:"0",prefix:!1,type:1,parse:function(A,e){return qA(e).map((function(A){return A.filter(qe)}))}},qe=function(A){return JA(A)||$A(A)},je=function(A){return{name:"border-"+A+"-color",initialValue:"transparent",prefix:!1,type:3,format:"color"}},ze=je("top"),$e=je("right"),At=je("bottom"),et=je("left"),tt=function(A){return{name:"border-radius-"+A,initialValue:"0 0",prefix:!1,type:1,parse:function(A,e){return Ae(e.filter($A))}}},rt=tt("top-left"),Bt=tt("top-right"),nt=tt("bottom-right"),st=tt("bottom-left"),ot=function(A){return{name:"border-"+A+"-style",initialValue:"solid",prefix:!1,type:2,parse:function(A,e){switch(e){case"none":return 0;case"dashed":return 2;case"dotted":return 3;case"double":return 4}return 1}}},it=ot("top"),ct=ot("right"),Qt=ot("bottom"),at=ot("left"),gt=function(A){return{name:"border-"+A+"-width",initialValue:"0",type:0,prefix:!1,parse:function(A,e){return PA(e)?e.number:0}}},wt=gt("top"),ut=gt("right"),lt=gt("bottom"),Ut=gt("left"),Ct={name:"color",initialValue:"transparent",prefix:!1,type:3,format:"color"},Ft={name:"direction",initialValue:"ltr",prefix:!1,type:2,parse:function(A,e){return"rtl"===e?1:0}},ht={name:"display",initialValue:"inline-block",prefix:!1,type:1,parse:function(A,e){return e.filter(JA).reduce((function(A,e){return A|dt(e.value)}),0)}},dt=function(A){switch(A){case"block":case"-webkit-box":return 2;case"inline":return 4;case"run-in":return 8;case"flow":return 16;case"flow-root":return 32;case"table":return 64;case"flex":case"-webkit-flex":return 128;case"grid":case"-ms-grid":return 256;case"ruby":return 512;case"subgrid":return 1024;case"list-item":return 2048;case"table-row-group":return 4096;case"table-header-group":return 8192;case"table-footer-group":return 16384;case"table-row":return 32768;case"table-cell":return 65536;case"table-column-group":return 131072;case"table-column":return 262144;case"table-caption":return 524288;case"ruby-base":return 1048576;case"ruby-text":return 2097152;case"ruby-base-container":return 4194304;case"ruby-text-container":return 8388608;case"contents":return 16777216;case"inline-block":return 33554432;case"inline-list-item":return 67108864;case"inline-table":return 134217728;case"inline-flex":return 268435456;case"inline-grid":return 536870912}return 0},ft={name:"float",initialValue:"none",prefix:!1,type:2,parse:function(A,e){switch(e){case"left":return 1;case"right":return 2;case"inline-start":return 3;case"inline-end":return 4}return 0}},Ht={name:"letter-spacing",initialValue:"0",prefix:!1,type:0,parse:function(A,e){return 20===e.type&&"normal"===e.value?0:17===e.type||15===e.type?e.number:0}};!function(A){A.NORMAL="normal",A.STRICT="strict"}(Ze||(Ze={}));var pt,Et={name:"line-break",initialValue:"normal",prefix:!1,type:2,parse:function(A,e){return"strict"===e?Ze.STRICT:Ze.NORMAL}},It={name:"line-height",initialValue:"normal",prefix:!1,type:4},yt=function(A,e){return JA(A)&&"normal"===A.value?1.2*e:17===A.type?e*A.number:$A(A)?ne(A,e):e},Kt={name:"list-style-image",initialValue:"none",type:0,prefix:!1,parse:function(A,e){return 20===e.type&&"none"===e.value?null:ke(A,e)}},mt={name:"list-style-position",initialValue:"outside",prefix:!1,type:2,parse:function(A,e){return"inside"===e?0:1}},Lt={name:"list-style-type",initialValue:"none",prefix:!1,type:2,parse:function(A,e){switch(e){case"disc":return 0;case"circle":return 1;case"square":return 2;case"decimal":return 3;case"cjk-decimal":return 4;case"decimal-leading-zero":return 5;case"lower-roman":return 6;case"upper-roman":return 7;case"lower-greek":return 8;case"lower-alpha":return 9;case"upper-alpha":return 10;case"arabic-indic":return 11;case"armenian":return 12;case"bengali":return 13;case"cambodian":return 14;case"cjk-earthly-branch":return 15;case"cjk-heavenly-stem":return 16;case"cjk-ideographic":return 17;case"devanagari":return 18;case"ethiopic-numeric":return 19;case"georgian":return 20;case"gujarati":return 21;case"gurmukhi":case"hebrew":return 22;case"hiragana":return 23;case"hiragana-iroha":return 24;case"japanese-formal":return 25;case"japanese-informal":return 26;case"kannada":return 27;case"katakana":return 28;case"katakana-iroha":return 29;case"khmer":return 30;case"korean-hangul-formal":return 31;case"korean-hanja-formal":return 32;case"korean-hanja-informal":return 33;case"lao":return 34;case"lower-armenian":return 35;case"malayalam":return 36;case"mongolian":return 37;case"myanmar":return 38;case"oriya":return 39;case"persian":return 40;case"simp-chinese-formal":return 41;case"simp-chinese-informal":return 42;case"tamil":return 43;case"telugu":return 44;case"thai":return 45;case"tibetan":return 46;case"trad-chinese-formal":return 47;case"trad-chinese-informal":return 48;case"upper-armenian":return 49;case"disclosure-open":return 50;case"disclosure-closed":return 51;default:return-1}}},vt=function(A){return{name:"margin-"+A,initialValue:"0",prefix:!1,type:4}},bt=vt("top"),Dt=vt("right"),xt=vt("bottom"),Mt=vt("left"),St={name:"overflow",initialValue:"visible",prefix:!1,type:1,parse:function(A,e){return e.filter(JA).map((function(A){switch(A.value){case"hidden":return 1;case"scroll":return 2;case"clip":return 3;case"auto":return 4;default:return 0}}))}},Tt={name:"overflow-wrap",initialValue:"normal",prefix:!1,type:2,parse:function(A,e){return"break-word"===e?"break-word":"normal"}},Gt=function(A){return{name:"padding-"+A,initialValue:"0",prefix:!1,type:3,format:"length-percentage"}},Ot=Gt("top"),Vt=Gt("right"),kt=Gt("bottom"),Rt=Gt("left"),Nt={name:"text-align",initialValue:"left",prefix:!1,type:2,parse:function(A,e){switch(e){case"right":return 2;case"center":case"justify":return 1;default:return 0}}},Pt={name:"position",initialValue:"static",prefix:!1,type:2,parse:function(A,e){switch(e){case"relative":return 1;case"absolute":return 2;case"fixed":return 3;case"sticky":return 4}return 0}},Xt={name:"text-shadow",initialValue:"none",type:1,prefix:!1,parse:function(A,e){return 1===e.length&&WA(e[0],"none")?[]:qA(e).map((function(e){for(var t={color:He.TRANSPARENT,offsetX:ee,offsetY:ee,blur:ee},r=0,B=0;B1?1:0],this.overflowWrap=pr(A,Tt,e.overflowWrap),this.paddingTop=pr(A,Ot,e.paddingTop),this.paddingRight=pr(A,Vt,e.paddingRight),this.paddingBottom=pr(A,kt,e.paddingBottom),this.paddingLeft=pr(A,Rt,e.paddingLeft),this.paintOrder=pr(A,Cr,e.paintOrder),this.position=pr(A,Pt,e.position),this.textAlign=pr(A,Nt,e.textAlign),this.textDecorationColor=pr(A,tr,null!==(t=e.textDecorationColor)&&void 0!==t?t:e.color),this.textDecorationLine=pr(A,rr,null!==(r=e.textDecorationLine)&&void 0!==r?r:e.textDecoration),this.textShadow=pr(A,Xt,e.textShadow),this.textTransform=pr(A,Jt,e.textTransform),this.transform=pr(A,Yt,e.transform),this.transformOrigin=pr(A,qt,e.transformOrigin),this.visibility=pr(A,jt,e.visibility),this.webkitTextStrokeColor=pr(A,Fr,e.webkitTextStrokeColor),this.webkitTextStrokeWidth=pr(A,hr,e.webkitTextStrokeWidth),this.wordBreak=pr(A,zt,e.wordBreak),this.zIndex=pr(A,$t,e.zIndex)}return A.prototype.isVisible=function(){return this.display>0&&this.opacity>0&&0===this.visibility},A.prototype.isTransparent=function(){return we(this.backgroundColor)},A.prototype.isTransformed=function(){return null!==this.transform},A.prototype.isPositioned=function(){return 0!==this.position},A.prototype.isPositionedWithZIndex=function(){return this.isPositioned()&&!this.zIndex.auto},A.prototype.isFloating=function(){return 0!==this.float},A.prototype.isInlineLevel=function(){return cr(this.display,4)||cr(this.display,33554432)||cr(this.display,268435456)||cr(this.display,536870912)||cr(this.display,67108864)||cr(this.display,134217728)},A}(),fr=function(A,e){this.content=pr(A,Qr,e.content),this.quotes=pr(A,ur,e.quotes)},Hr=function(A,e){this.counterIncrement=pr(A,ar,e.counterIncrement),this.counterReset=pr(A,gr,e.counterReset)},pr=function(A,e,t){var r=new RA,B=null!=t?t.toString():e.initialValue;r.write(B);var n=new NA(r.read());switch(e.type){case 2:var s=n.parseComponentValue();return e.parse(A,JA(s)?s.value:e.initialValue);case 0:return e.parse(A,n.parseComponentValue());case 1:return e.parse(A,n.parseComponentValues());case 4:return n.parseComponentValue();case 3:switch(e.format){case"angle":return ie(A,n.parseComponentValue());case"color":return ge(A,n.parseComponentValue());case"image":return ke(A,n.parseComponentValue());case"length":var o=n.parseComponentValue();return zA(o)?o:ee;case"length-percentage":var i=n.parseComponentValue();return $A(i)?i:ee;case"time":return Ar.parse(A,n.parseComponentValue())}}},Er=function(A,e){var t=function(A){switch(A.getAttribute("data-html2canvas-debug")){case"all":return 1;case"clone":return 2;case"parse":return 3;case"render":return 4;default:return 0}}(A);return 1===t||e===t},Ir=function(A,e){this.context=A,this.textNodes=[],this.elements=[],this.flags=0,Er(e,3),this.styles=new dr(A,window.getComputedStyle(e,null)),LB(e)&&(this.styles.animationDuration.some((function(A){return A>0}))&&(e.style.animationDuration="0s"),null!==this.styles.transform&&(e.style.transform="none")),this.bounds=o(this.context,e),Er(e,4)&&(this.flags|=16)},yr="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Kr="undefined"==typeof Uint8Array?[]:new Uint8Array(256),mr=0;mr<64;mr++)Kr[yr.charCodeAt(mr)]=mr;for(var Lr=function(A,e,t){return A.slice?A.slice(e,t):new Uint16Array(Array.prototype.slice.call(A,e,t))},vr=function(){function A(A,e,t,r,B,n){this.initialValue=A,this.errorValue=e,this.highStart=t,this.highValueIndex=r,this.index=B,this.data=n}return A.prototype.get=function(A){var e;if(A>=0){if(A<55296||A>56319&&A<=65535)return e=((e=this.index[A>>5])<<2)+(31&A),this.data[e];if(A<=65535)return e=((e=this.index[2048+(A-55296>>5)])<<2)+(31&A),this.data[e];if(A>11),e=this.index[e],e+=A>>5&63,e=((e=this.index[e])<<2)+(31&A),this.data[e];if(A<=1114111)return this.data[this.highValueIndex]}return this.errorValue},A}(),br="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Dr="undefined"==typeof Uint8Array?[]:new Uint8Array(256),xr=0;xr<64;xr++)Dr[br.charCodeAt(xr)]=xr;var Mr,Sr=8,Tr=9,Gr=11,Or=12,Vr=function(){for(var A=[],e=0;e>10),s%1024+56320)),(B+1===t||r.length>16384)&&(n+=String.fromCharCode.apply(String,r),r.length=0)}return n},kr=function(A,e){var t,r,B,n=function(A){var e,t,r,B,n,s=.75*A.length,o=A.length,i=0;"="===A[A.length-1]&&(s--,"="===A[A.length-2]&&s--);var c="undefined"!=typeof ArrayBuffer&&"undefined"!=typeof Uint8Array&&void 0!==Uint8Array.prototype.slice?new ArrayBuffer(s):new Array(s),Q=Array.isArray(c)?c:new Uint8Array(c);for(e=0;e>4,Q[i++]=(15&r)<<4|B>>2,Q[i++]=(3&B)<<6|63&n;return c}(A),s=Array.isArray(n)?function(A){for(var e=A.length,t=[],r=0;r=55296&&B<=56319&&t=t)return{done:!0,value:null};for(var A=Rr;rs.x||B.y>s.y;return s=B,0===e||o}));return A.body.removeChild(e),o}(document);return Object.defineProperty(Zr,"SUPPORT_WORD_BREAKING",{value:A}),A},get SUPPORT_SVG_DRAWING(){var A=function(A){var e=new Image,t=A.createElement("canvas"),r=t.getContext("2d");if(!r)return!1;e.src="data:image/svg+xml,";try{r.drawImage(e,0,0),t.toDataURL()}catch(A){return!1}return!0}(document);return Object.defineProperty(Zr,"SUPPORT_SVG_DRAWING",{value:A}),A},get SUPPORT_FOREIGNOBJECT_DRAWING(){var A="function"==typeof Array.from&&"function"==typeof window.fetch?function(A){var e=A.createElement("canvas"),t=100;e.width=t,e.height=t;var r=e.getContext("2d");if(!r)return Promise.reject(!1);r.fillStyle="rgb(0, 255, 0)",r.fillRect(0,0,t,t);var B=new Image,n=e.toDataURL();B.src=n;var s=Yr(t,t,0,0,B);return r.fillStyle="red",r.fillRect(0,0,t,t),Wr(s).then((function(e){r.drawImage(e,0,0);var B=r.getImageData(0,0,t,t).data;r.fillStyle="red",r.fillRect(0,0,t,t);var s=A.createElement("div");return s.style.backgroundImage="url("+n+")",s.style.height=t+"px",Jr(B)?Wr(Yr(t,t,0,0,s)):Promise.reject(!1)})).then((function(A){return r.drawImage(A,0,0),Jr(r.getImageData(0,0,t,t).data)})).catch((function(){return!1}))}(document):Promise.resolve(!1);return Object.defineProperty(Zr,"SUPPORT_FOREIGNOBJECT_DRAWING",{value:A}),A},get SUPPORT_CORS_IMAGES(){var A=void 0!==(new Image).crossOrigin;return Object.defineProperty(Zr,"SUPPORT_CORS_IMAGES",{value:A}),A},get SUPPORT_RESPONSE_TYPE(){var A="string"==typeof(new XMLHttpRequest).responseType;return Object.defineProperty(Zr,"SUPPORT_RESPONSE_TYPE",{value:A}),A},get SUPPORT_CORS_XHR(){var A="withCredentials"in new XMLHttpRequest;return Object.defineProperty(Zr,"SUPPORT_CORS_XHR",{value:A}),A},get SUPPORT_NATIVE_TEXT_SEGMENTATION(){var A=!("undefined"==typeof Intl||!Intl.Segmenter);return Object.defineProperty(Zr,"SUPPORT_NATIVE_TEXT_SEGMENTATION",{value:A}),A}},_r=function(A,e){this.text=A,this.bounds=e},qr=function(A,e){var t=e.ownerDocument;if(t){var r=t.createElement("html2canvaswrapper");r.appendChild(e.cloneNode(!0));var B=e.parentNode;if(B){B.replaceChild(r,e);var n=o(A,r);return r.firstChild&&B.replaceChild(r.firstChild,r),n}}return s.EMPTY},jr=function(A,e,t){var r=A.ownerDocument;if(!r)throw new Error("Node has no owner document");var B=r.createRange();return B.setStart(A,e),B.setEnd(A,e+t),B},zr=function(A){if(Zr.SUPPORT_NATIVE_TEXT_SEGMENTATION){var e=new Intl.Segmenter(void 0,{granularity:"grapheme"});return Array.from(e.segment(A)).map((function(A){return A.segment}))}return function(A){for(var e,t=Xr(A),r=[];!(e=t.next()).done;)e.value&&r.push(e.value.slice());return r}(A)},$r=function(A,e){return 0!==e.letterSpacing?zr(A):function(A,e){if(Zr.SUPPORT_NATIVE_TEXT_SEGMENTATION){var t=new Intl.Segmenter(void 0,{granularity:"word"});return Array.from(t.segment(A)).map((function(A){return A.segment}))}return eB(A,e)}(A,e)},AB=[32,160,4961,65792,65793,4153,4241],eB=function(A,e){for(var t,r=function(A,e){var t=i(A),r=nA(t,e),B=r[0],n=r[1],s=r[2],o=t.length,c=0,Q=0;return{next:function(){if(Q>=o)return{done:!0,value:null};for(var A=Y;Q0)if(Zr.SUPPORT_RANGE_BOUNDS){var B=jr(r,o,e.length).getClientRects();if(B.length>1){var i=zr(e),c=0;i.forEach((function(e){n.push(new _r(e,s.fromDOMRectList(A,jr(r,c+o,e.length).getClientRects()))),c+=e.length}))}else n.push(new _r(e,s.fromDOMRectList(A,B)))}else{var Q=r.splitText(e.length);n.push(new _r(e,qr(A,r))),r=Q}else Zr.SUPPORT_RANGE_BOUNDS||(r=r.splitText(e.length));o+=e.length})),n}(A,this.text,t,e)},rB=function(A,e){switch(e){case 1:return A.toLowerCase();case 3:return A.replace(BB,nB);case 2:return A.toUpperCase();default:return A}},BB=/(^|\s|:|-|\(|\))([a-z])/g,nB=function(A,e,t){return A.length>0?e+t.toUpperCase():A},sB=function(A){function t(e,t){var r=A.call(this,e,t)||this;return r.src=t.currentSrc||t.src,r.intrinsicWidth=t.naturalWidth,r.intrinsicHeight=t.naturalHeight,r.context.cache.addImage(r.src),r}return e(t,A),t}(Ir),oB=function(A){function t(e,t){var r=A.call(this,e,t)||this;return r.canvas=t,r.intrinsicWidth=t.width,r.intrinsicHeight=t.height,r}return e(t,A),t}(Ir),iB=function(A){function t(e,t){var r=A.call(this,e,t)||this,B=new XMLSerializer,n=o(e,t);return t.setAttribute("width",n.width+"px"),t.setAttribute("height",n.height+"px"),r.svg="data:image/svg+xml,"+encodeURIComponent(B.serializeToString(t)),r.intrinsicWidth=t.width.baseVal.value,r.intrinsicHeight=t.height.baseVal.value,r.context.cache.addImage(r.svg),r}return e(t,A),t}(Ir),cB=function(A){function t(e,t){var r=A.call(this,e,t)||this;return r.value=t.value,r}return e(t,A),t}(Ir),QB=function(A){function t(e,t){var r=A.call(this,e,t)||this;return r.start=t.start,r.reversed="boolean"==typeof t.reversed&&!0===t.reversed,r}return e(t,A),t}(Ir),aB=[{type:15,flags:0,unit:"px",number:3}],gB=[{type:16,flags:0,number:50}],wB="checkbox",uB="radio",lB="password",UB=707406591,CB=function(A){function t(e,t){var r,B,n,o=A.call(this,e,t)||this;switch(o.type=t.type.toLowerCase(),o.checked=t.checked,o.value=0===(n=(B=t).type===lB?new Array(B.value.length+1).join("•"):B.value).length?B.placeholder||"":n,o.type!==wB&&o.type!==uB||(o.styles.backgroundColor=3739148031,o.styles.borderTopColor=o.styles.borderRightColor=o.styles.borderBottomColor=o.styles.borderLeftColor=2779096575,o.styles.borderTopWidth=o.styles.borderRightWidth=o.styles.borderBottomWidth=o.styles.borderLeftWidth=1,o.styles.borderTopStyle=o.styles.borderRightStyle=o.styles.borderBottomStyle=o.styles.borderLeftStyle=1,o.styles.backgroundClip=[0],o.styles.backgroundOrigin=[0],o.bounds=(r=o.bounds).width>r.height?new s(r.left+(r.width-r.height)/2,r.top,r.height,r.height):r.width0)t.textNodes.push(new tB(A,B,t.styles));else if(mB(B))if(PB(B)&&B.assignedNodes)B.assignedNodes().forEach((function(e){return HB(A,e,t,r)}));else{var s=pB(A,B);s.styles.isVisible()&&(IB(B,s,r)?s.flags|=4:yB(s.styles)&&(s.flags|=2),-1!==fB.indexOf(B.tagName)&&(s.flags|=8),t.elements.push(s),B.slot,B.shadowRoot?HB(A,B.shadowRoot,s,r):RB(B)||MB(B)||NB(B)||HB(A,B,s,r))}},pB=function(A,e){return OB(e)?new sB(A,e):TB(e)?new oB(A,e):MB(e)?new iB(A,e):bB(e)?new cB(A,e):DB(e)?new QB(A,e):xB(e)?new CB(A,e):NB(e)?new FB(A,e):RB(e)?new hB(A,e):VB(e)?new dB(A,e):new Ir(A,e)},EB=function(A,e){var t=pB(A,e);return t.flags|=4,HB(A,e,t,t),t},IB=function(A,e,t){return e.styles.isPositionedWithZIndex()||e.styles.opacity<1||e.styles.isTransformed()||SB(A)&&t.styles.isTransparent()},yB=function(A){return A.isPositioned()||A.isFloating()},KB=function(A){return A.nodeType===Node.TEXT_NODE},mB=function(A){return A.nodeType===Node.ELEMENT_NODE},LB=function(A){return mB(A)&&void 0!==A.style&&!vB(A)},vB=function(A){return"object"==typeof A.className},bB=function(A){return"LI"===A.tagName},DB=function(A){return"OL"===A.tagName},xB=function(A){return"INPUT"===A.tagName},MB=function(A){return"svg"===A.tagName},SB=function(A){return"BODY"===A.tagName},TB=function(A){return"CANVAS"===A.tagName},GB=function(A){return"VIDEO"===A.tagName},OB=function(A){return"IMG"===A.tagName},VB=function(A){return"IFRAME"===A.tagName},kB=function(A){return"STYLE"===A.tagName},RB=function(A){return"TEXTAREA"===A.tagName},NB=function(A){return"SELECT"===A.tagName},PB=function(A){return"SLOT"===A.tagName},XB=function(A){return A.tagName.indexOf("-")>0},JB=function(){function A(){this.counters={}}return A.prototype.getCounterValue=function(A){var e=this.counters[A];return e&&e.length?e[e.length-1]:1},A.prototype.getCounterValues=function(A){return this.counters[A]||[]},A.prototype.pop=function(A){var e=this;A.forEach((function(A){return e.counters[A].pop()}))},A.prototype.parse=function(A){var e=this,t=A.counterIncrement,r=A.counterReset,B=!0;null!==t&&t.forEach((function(A){var t=e.counters[A.counter];t&&0!==A.increment&&(B=!1,t.length||t.push(1),t[Math.max(0,t.length-1)]+=A.increment)}));var n=[];return B&&r.forEach((function(A){var t=e.counters[A.counter];n.push(A.counter),t||(t=e.counters[A.counter]=[]),t.push(A.reset)})),n},A}(),YB={integers:[1e3,900,500,400,100,90,50,40,10,9,5,4,1],values:["M","CM","D","CD","C","XC","L","XL","X","IX","V","IV","I"]},WB={integers:[9e3,8e3,7e3,6e3,5e3,4e3,3e3,2e3,1e3,900,800,700,600,500,400,300,200,100,90,80,70,60,50,40,30,20,10,9,8,7,6,5,4,3,2,1],values:["Ք","Փ","Ւ","Ց","Ր","Տ","Վ","Ս","Ռ","Ջ","Պ","Չ","Ո","Շ","Ն","Յ","Մ","Ճ","Ղ","Ձ","Հ","Կ","Ծ","Խ","Լ","Ի","Ժ","Թ","Ը","Է","Զ","Ե","Դ","Գ","Բ","Ա"]},ZB={integers:[1e4,9e3,8e3,7e3,6e3,5e3,4e3,3e3,2e3,1e3,400,300,200,100,90,80,70,60,50,40,30,20,19,18,17,16,15,10,9,8,7,6,5,4,3,2,1],values:["י׳","ט׳","ח׳","ז׳","ו׳","ה׳","ד׳","ג׳","ב׳","א׳","ת","ש","ר","ק","צ","פ","ע","ס","נ","מ","ל","כ","יט","יח","יז","טז","טו","י","ט","ח","ז","ו","ה","ד","ג","ב","א"]},_B={integers:[1e4,9e3,8e3,7e3,6e3,5e3,4e3,3e3,2e3,1e3,900,800,700,600,500,400,300,200,100,90,80,70,60,50,40,30,20,10,9,8,7,6,5,4,3,2,1],values:["ჵ","ჰ","ჯ","ჴ","ხ","ჭ","წ","ძ","ც","ჩ","შ","ყ","ღ","ქ","ფ","ჳ","ტ","ს","რ","ჟ","პ","ო","ჲ","ნ","მ","ლ","კ","ი","თ","ჱ","ზ","ვ","ე","დ","გ","ბ","ა"]},qB=function(A,e,t,r,B,n){return At?nn(A,B,n.length>0):r.integers.reduce((function(e,t,B){for(;A>=t;)A-=t,e+=r.values[B];return e}),"")+n},jB=function(A,e,t,r){var B="";do{t||A--,B=r(A)+B,A/=e}while(A*e>=e);return B},zB=function(A,e,t,r,B){var n=t-e+1;return(A<0?"-":"")+(jB(Math.abs(A),n,r,(function(A){return c(Math.floor(A%n)+e)}))+B)},$B=function(A,e,t){void 0===t&&(t=". ");var r=e.length;return jB(Math.abs(A),r,!1,(function(A){return e[Math.floor(A%r)]}))+t},An=function(A,e,t,r,B,n){if(A<-9999||A>9999)return nn(A,4,B.length>0);var s=Math.abs(A),o=B;if(0===s)return e[0]+o;for(var i=0;s>0&&i<=4;i++){var c=s%10;0===c&&cr(n,1)&&""!==o?o=e[c]+o:c>1||1===c&&0===i||1===c&&1===i&&cr(n,2)||1===c&&1===i&&cr(n,4)&&A>100||1===c&&i>1&&cr(n,8)?o=e[c]+(i>0?t[i-1]:"")+o:1===c&&i>0&&(o=t[i-1]+o),s=Math.floor(s/10)}return(A<0?r:"")+o},en="十百千萬",tn="拾佰仟萬",rn="マイナス",Bn="마이너스",nn=function(A,e,t){var r=t?". ":"",B=t?"、":"",n=t?", ":"",s=t?" ":"";switch(e){case 0:return"•"+s;case 1:return"◦"+s;case 2:return"◾"+s;case 5:var o=zB(A,48,57,!0,r);return o.length<4?"0"+o:o;case 4:return $B(A,"〇一二三四五六七八九",B);case 6:return qB(A,1,3999,YB,3,r).toLowerCase();case 7:return qB(A,1,3999,YB,3,r);case 8:return zB(A,945,969,!1,r);case 9:return zB(A,97,122,!1,r);case 10:return zB(A,65,90,!1,r);case 11:return zB(A,1632,1641,!0,r);case 12:case 49:return qB(A,1,9999,WB,3,r);case 35:return qB(A,1,9999,WB,3,r).toLowerCase();case 13:return zB(A,2534,2543,!0,r);case 14:case 30:return zB(A,6112,6121,!0,r);case 15:return $B(A,"子丑寅卯辰巳午未申酉戌亥",B);case 16:return $B(A,"甲乙丙丁戊己庚辛壬癸",B);case 17:case 48:return An(A,"零一二三四五六七八九",en,"負",B,14);case 47:return An(A,"零壹貳參肆伍陸柒捌玖",tn,"負",B,15);case 42:return An(A,"零一二三四五六七八九",en,"负",B,14);case 41:return An(A,"零壹贰叁肆伍陆柒捌玖",tn,"负",B,15);case 26:return An(A,"〇一二三四五六七八九","十百千万",rn,B,0);case 25:return An(A,"零壱弐参四伍六七八九","拾百千万",rn,B,7);case 31:return An(A,"영일이삼사오육칠팔구","십백천만",Bn,n,7);case 33:return An(A,"零一二三四五六七八九","十百千萬",Bn,n,0);case 32:return An(A,"零壹貳參四五六七八九","拾百千",Bn,n,7);case 18:return zB(A,2406,2415,!0,r);case 20:return qB(A,1,19999,_B,3,r);case 21:return zB(A,2790,2799,!0,r);case 22:return zB(A,2662,2671,!0,r);case 22:return qB(A,1,10999,ZB,3,r);case 23:return $B(A,"あいうえおかきくけこさしすせそたちつてとなにぬねのはひふへほまみむめもやゆよらりるれろわゐゑをん");case 24:return $B(A,"いろはにほへとちりぬるをわかよたれそつねならむうゐのおくやまけふこえてあさきゆめみしゑひもせす");case 27:return zB(A,3302,3311,!0,r);case 28:return $B(A,"アイウエオカキクケコサシスセソタチツテトナニヌネノハヒフヘホマミムメモヤユヨラリルレロワヰヱヲン",B);case 29:return $B(A,"イロハニホヘトチリヌルヲワカヨタレソツネナラムウヰノオクヤマケフコエテアサキユメミシヱヒモセス",B);case 34:return zB(A,3792,3801,!0,r);case 37:return zB(A,6160,6169,!0,r);case 38:return zB(A,4160,4169,!0,r);case 39:return zB(A,2918,2927,!0,r);case 40:return zB(A,1776,1785,!0,r);case 43:return zB(A,3046,3055,!0,r);case 44:return zB(A,3174,3183,!0,r);case 45:return zB(A,3664,3673,!0,r);case 46:return zB(A,3872,3881,!0,r);default:return zB(A,48,57,!0,r)}},sn="data-html2canvas-ignore",on=function(){function A(A,e,t){if(this.context=A,this.options=t,this.scrolledElements=[],this.referenceElement=e,this.counters=new JB,this.quoteDepth=0,!e.ownerDocument)throw new Error("Cloned element does not have an owner document");this.documentElement=this.cloneNode(e.ownerDocument.documentElement,!1)}return A.prototype.toIFrame=function(A,e){var t=this,n=Qn(A,e);if(!n.contentWindow)return Promise.reject("Unable to find iframe window");var s=A.defaultView.pageXOffset,o=A.defaultView.pageYOffset,i=n.contentWindow,c=i.document,Q=wn(n).then((function(){return r(t,void 0,void 0,(function(){var A,t;return B(this,(function(r){switch(r.label){case 0:return this.scrolledElements.forEach(Fn),i&&(i.scrollTo(e.left,e.top),!/(iPad|iPhone|iPod)/g.test(navigator.userAgent)||i.scrollY===e.top&&i.scrollX===e.left||(this.context.logger.warn("Unable to restore scroll position for cloned document"),this.context.windowBounds=this.context.windowBounds.add(i.scrollX-e.left,i.scrollY-e.top,0,0))),A=this.options.onclone,void 0===(t=this.clonedReferenceElement)?[2,Promise.reject("Error finding the "+this.referenceElement.nodeName+" in the cloned document")]:c.fonts&&c.fonts.ready?[4,c.fonts.ready]:[3,2];case 1:r.sent(),r.label=2;case 2:return/(AppleWebKit)/g.test(navigator.userAgent)?[4,gn(c)]:[3,4];case 3:r.sent(),r.label=4;case 4:return"function"==typeof A?[2,Promise.resolve().then((function(){return A(c,t)})).then((function(){return n}))]:[2,n]}}))}))}));return c.open(),c.write(Un(document.doctype)+""),Cn(this.referenceElement.ownerDocument,s,o),c.replaceChild(c.adoptNode(this.documentElement),c.documentElement),c.close(),Q},A.prototype.createElementClone=function(A){if(Er(A,2),TB(A))return this.createCanvasClone(A);if(GB(A))return this.createVideoClone(A);if(kB(A))return this.createStyleClone(A);var e=A.cloneNode(!1);return OB(e)&&(OB(A)&&A.currentSrc&&A.currentSrc!==A.src&&(e.src=A.currentSrc,e.srcset=""),"lazy"===e.loading&&(e.loading="eager")),XB(e)?this.createCustomElementClone(e):e},A.prototype.createCustomElementClone=function(A){var e=document.createElement("html2canvascustomelement");return ln(A.style,e),e},A.prototype.createStyleClone=function(A){try{var e=A.sheet;if(e&&e.cssRules){var t=[].slice.call(e.cssRules,0).reduce((function(A,e){return e&&"string"==typeof e.cssText?A+e.cssText:A}),""),r=A.cloneNode(!1);return r.textContent=t,r}}catch(A){if(this.context.logger.error("Unable to access cssRules property",A),"SecurityError"!==A.name)throw A}return A.cloneNode(!1)},A.prototype.createCanvasClone=function(A){var e;if(this.options.inlineImages&&A.ownerDocument){var t=A.ownerDocument.createElement("img");try{return t.src=A.toDataURL(),t}catch(e){this.context.logger.info("Unable to inline canvas contents, canvas is tainted",A)}}var r=A.cloneNode(!1);try{r.width=A.width,r.height=A.height;var B=A.getContext("2d"),n=r.getContext("2d");if(n)if(!this.options.allowTaint&&B)n.putImageData(B.getImageData(0,0,A.width,A.height),0,0);else{var s=null!==(e=A.getContext("webgl2"))&&void 0!==e?e:A.getContext("webgl");if(s){var o=s.getContextAttributes();!1===(null==o?void 0:o.preserveDrawingBuffer)&&this.context.logger.warn("Unable to clone WebGL context as it has preserveDrawingBuffer=false",A)}n.drawImage(A,0,0)}return r}catch(e){this.context.logger.info("Unable to clone canvas as it is tainted",A)}return r},A.prototype.createVideoClone=function(A){var e=A.ownerDocument.createElement("canvas");e.width=A.offsetWidth,e.height=A.offsetHeight;var t=e.getContext("2d");try{return t&&(t.drawImage(A,0,0,e.width,e.height),this.options.allowTaint||t.getImageData(0,0,e.width,e.height)),e}catch(e){this.context.logger.info("Unable to clone video as it is tainted",A)}var r=A.ownerDocument.createElement("canvas");return r.width=A.offsetWidth,r.height=A.offsetHeight,r},A.prototype.appendChildNode=function(A,e,t){mB(e)&&("SCRIPT"===e.tagName||e.hasAttribute(sn)||"function"==typeof this.options.ignoreElements&&this.options.ignoreElements(e))||this.options.copyStyles&&mB(e)&&kB(e)||A.appendChild(this.cloneNode(e,t))},A.prototype.cloneChildNodes=function(A,e,t){for(var r=this,B=A.shadowRoot?A.shadowRoot.firstChild:A.firstChild;B;B=B.nextSibling)if(mB(B)&&PB(B)&&"function"==typeof B.assignedNodes){var n=B.assignedNodes();n.length&&n.forEach((function(A){return r.appendChildNode(e,A,t)}))}else this.appendChildNode(e,B,t)},A.prototype.cloneNode=function(A,e){if(KB(A))return document.createTextNode(A.data);if(!A.ownerDocument)return A.cloneNode(!1);var t=A.ownerDocument.defaultView;if(t&&mB(A)&&(LB(A)||vB(A))){var r=this.createElementClone(A);r.style.transitionProperty="none";var B=t.getComputedStyle(A),n=t.getComputedStyle(A,":before"),s=t.getComputedStyle(A,":after");this.referenceElement===A&&LB(r)&&(this.clonedReferenceElement=r),SB(r)&&Hn(r);var o=this.counters.parse(new Hr(this.context,B)),i=this.resolvePseudoContent(A,r,n,Mr.BEFORE);XB(A)&&(e=!0),GB(A)||this.cloneChildNodes(A,r,e),i&&r.insertBefore(i,r.firstChild);var c=this.resolvePseudoContent(A,r,s,Mr.AFTER);return c&&r.appendChild(c),this.counters.pop(o),(B&&(this.options.copyStyles||vB(A))&&!VB(A)||e)&&ln(B,r),0===A.scrollTop&&0===A.scrollLeft||this.scrolledElements.push([r,A.scrollLeft,A.scrollTop]),(RB(A)||NB(A))&&(RB(r)||NB(r))&&(r.value=A.value),r}return A.cloneNode(!1)},A.prototype.resolvePseudoContent=function(A,e,t,r){var B=this;if(t){var n=t.content,s=e.ownerDocument;if(s&&n&&"none"!==n&&"-moz-alt-content"!==n&&"none"!==t.display){this.counters.parse(new Hr(this.context,t));var o=new fr(this.context,t),i=s.createElement("html2canvaspseudoelement");ln(t,i),o.content.forEach((function(e){if(0===e.type)i.appendChild(s.createTextNode(e.value));else if(22===e.type){var t=s.createElement("img");t.src=e.value,t.style.opacity="1",i.appendChild(t)}else if(18===e.type){if("attr"===e.name){var r=e.values.filter(JA);r.length&&i.appendChild(s.createTextNode(A.getAttribute(r[0].value)||""))}else if("counter"===e.name){var n=e.values.filter(_A),c=n[0],Q=n[1];if(c&&JA(c)){var a=B.counters.getCounterValue(c.value),g=Q&&JA(Q)?Lt.parse(B.context,Q.value):3;i.appendChild(s.createTextNode(nn(a,g,!1)))}}else if("counters"===e.name){var w=e.values.filter(_A),u=(c=w[0],w[1]);if(Q=w[2],c&&JA(c)){var l=B.counters.getCounterValues(c.value),U=Q&&JA(Q)?Lt.parse(B.context,Q.value):3,C=u&&0===u.type?u.value:"",F=l.map((function(A){return nn(A,U,!1)})).join(C);i.appendChild(s.createTextNode(F))}}}else if(20===e.type)switch(e.value){case"open-quote":i.appendChild(s.createTextNode(lr(o.quotes,B.quoteDepth++,!0)));break;case"close-quote":i.appendChild(s.createTextNode(lr(o.quotes,--B.quoteDepth,!1)));break;default:i.appendChild(s.createTextNode(e.value))}})),i.className=hn+" "+dn;var c=r===Mr.BEFORE?" "+hn:" "+dn;return vB(e)?e.className.baseValue+=c:e.className+=c,i}}},A.destroy=function(A){return!!A.parentNode&&(A.parentNode.removeChild(A),!0)},A}();!function(A){A[A.BEFORE=0]="BEFORE",A[A.AFTER=1]="AFTER"}(Mr||(Mr={}));var cn,Qn=function(A,e){var t=A.createElement("iframe");return t.className="html2canvas-container",t.style.visibility="hidden",t.style.position="fixed",t.style.left="-10000px",t.style.top="0px",t.style.border="0",t.width=e.width.toString(),t.height=e.height.toString(),t.scrolling="no",t.setAttribute(sn,"true"),A.body.appendChild(t),t},an=function(A){return new Promise((function(e){A.complete?e():A.src?(A.onload=e,A.onerror=e):e()}))},gn=function(A){return Promise.all([].slice.call(A.images,0).map(an))},wn=function(A){return new Promise((function(e,t){var r=A.contentWindow;if(!r)return t("No window assigned for iframe");var B=r.document;r.onload=A.onload=function(){r.onload=A.onload=null;var t=setInterval((function(){B.body.childNodes.length>0&&"complete"===B.readyState&&(clearInterval(t),e(A))}),50)}}))},un=["all","d","content"],ln=function(A,e){for(var t=A.length-1;t>=0;t--){var r=A.item(t);-1===un.indexOf(r)&&e.style.setProperty(r,A.getPropertyValue(r))}return e},Un=function(A){var e="";return A&&(e+=""),e},Cn=function(A,e,t){A&&A.defaultView&&(e!==A.defaultView.pageXOffset||t!==A.defaultView.pageYOffset)&&A.defaultView.scrollTo(e,t)},Fn=function(A){var e=A[0],t=A[1],r=A[2];e.scrollLeft=t,e.scrollTop=r},hn="___html2canvas___pseudoelement_before",dn="___html2canvas___pseudoelement_after",fn='{\n content: "" !important;\n display: none !important;\n}',Hn=function(A){pn(A,"."+hn+":before"+fn+"\n ."+dn+":after"+fn)},pn=function(A,e){var t=A.ownerDocument;if(t){var r=t.createElement("style");r.textContent=e,A.appendChild(r)}},En=function(){function A(){}return A.getOrigin=function(e){var t=A._link;return t?(t.href=e,t.href=t.href,t.protocol+t.hostname+t.port):"about:blank"},A.isSameOrigin=function(e){return A.getOrigin(e)===A._origin},A.setContext=function(e){A._link=e.document.createElement("a"),A._origin=A.getOrigin(e.location.href)},A._origin="about:blank",A}(),In=function(){function A(A,e){this.context=A,this._options=e,this._cache={}}return A.prototype.addImage=function(A){var e=Promise.resolve();return this.has(A)?e:Dn(A)||Ln(A)?((this._cache[A]=this.loadImage(A)).catch((function(){})),e):e},A.prototype.match=function(A){return this._cache[A]},A.prototype.loadImage=function(A){return r(this,void 0,void 0,(function(){var e,t,r,n,s=this;return B(this,(function(B){switch(B.label){case 0:return e=En.isSameOrigin(A),t=!vn(A)&&!0===this._options.useCORS&&Zr.SUPPORT_CORS_IMAGES&&!e,r=!vn(A)&&!e&&!Dn(A)&&"string"==typeof this._options.proxy&&Zr.SUPPORT_CORS_XHR&&!t,e||!1!==this._options.allowTaint||vn(A)||Dn(A)||r||t?(n=A,r?[4,this.proxy(n)]:[3,2]):[2];case 1:n=B.sent(),B.label=2;case 2:return this.context.logger.debug("Added image "+A.substring(0,256)),[4,new Promise((function(A,e){var r=new Image;r.onload=function(){return A(r)},r.onerror=e,(bn(n)||t)&&(r.crossOrigin="anonymous"),r.src=n,!0===r.complete&&setTimeout((function(){return A(r)}),500),s._options.imageTimeout>0&&setTimeout((function(){return e("Timed out ("+s._options.imageTimeout+"ms) loading image")}),s._options.imageTimeout)}))];case 3:return[2,B.sent()]}}))}))},A.prototype.has=function(A){return void 0!==this._cache[A]},A.prototype.keys=function(){return Promise.resolve(Object.keys(this._cache))},A.prototype.proxy=function(A){var e=this,t=this._options.proxy;if(!t)throw new Error("No proxy defined");var r=A.substring(0,256);return new Promise((function(B,n){var s=Zr.SUPPORT_RESPONSE_TYPE?"blob":"text",o=new XMLHttpRequest;o.onload=function(){if(200===o.status)if("text"===s)B(o.response);else{var A=new FileReader;A.addEventListener("load",(function(){return B(A.result)}),!1),A.addEventListener("error",(function(A){return n(A)}),!1),A.readAsDataURL(o.response)}else n("Failed to proxy resource "+r+" with status code "+o.status)},o.onerror=n;var i=t.indexOf("?")>-1?"&":"?";if(o.open("GET",""+t+i+"url="+encodeURIComponent(A)+"&responseType="+s),"text"!==s&&o instanceof XMLHttpRequest&&(o.responseType=s),e._options.imageTimeout){var c=e._options.imageTimeout;o.timeout=c,o.ontimeout=function(){return n("Timed out ("+c+"ms) proxying "+r)}}o.send()}))},A}(),yn=/^data:image\/svg\+xml/i,Kn=/^data:image\/.*;base64,/i,mn=/^data:image\/.*/i,Ln=function(A){return Zr.SUPPORT_SVG_DRAWING||!xn(A)},vn=function(A){return mn.test(A)},bn=function(A){return Kn.test(A)},Dn=function(A){return"blob"===A.substr(0,4)},xn=function(A){return"svg"===A.substr(-3).toLowerCase()||yn.test(A)},Mn=function(){function A(A,e){this.type=0,this.x=A,this.y=e}return A.prototype.add=function(e,t){return new A(this.x+e,this.y+t)},A}(),Sn=function(A,e,t){return new Mn(A.x+(e.x-A.x)*t,A.y+(e.y-A.y)*t)},Tn=function(){function A(A,e,t,r){this.type=1,this.start=A,this.startControl=e,this.endControl=t,this.end=r}return A.prototype.subdivide=function(e,t){var r=Sn(this.start,this.startControl,e),B=Sn(this.startControl,this.endControl,e),n=Sn(this.endControl,this.end,e),s=Sn(r,B,e),o=Sn(B,n,e),i=Sn(s,o,e);return t?new A(this.start,r,s,i):new A(i,o,n,this.end)},A.prototype.add=function(e,t){return new A(this.start.add(e,t),this.startControl.add(e,t),this.endControl.add(e,t),this.end.add(e,t))},A.prototype.reverse=function(){return new A(this.end,this.endControl,this.startControl,this.start)},A}(),Gn=function(A){return 1===A.type},On=function(A){var e=A.styles,t=A.bounds,r=Be(e.borderTopLeftRadius,t.width,t.height),B=r[0],n=r[1],s=Be(e.borderTopRightRadius,t.width,t.height),o=s[0],i=s[1],c=Be(e.borderBottomRightRadius,t.width,t.height),Q=c[0],a=c[1],g=Be(e.borderBottomLeftRadius,t.width,t.height),w=g[0],u=g[1],l=[];l.push((B+o)/t.width),l.push((w+Q)/t.width),l.push((n+u)/t.height),l.push((i+a)/t.height);var U=Math.max.apply(Math,l);U>1&&(B/=U,n/=U,o/=U,i/=U,Q/=U,a/=U,w/=U,u/=U);var C=t.width-o,F=t.height-a,h=t.width-Q,d=t.height-u,f=e.borderTopWidth,H=e.borderRightWidth,p=e.borderBottomWidth,E=e.borderLeftWidth,I=ne(e.paddingTop,A.bounds.width),y=ne(e.paddingRight,A.bounds.width),K=ne(e.paddingBottom,A.bounds.width),m=ne(e.paddingLeft,A.bounds.width);this.topLeftBorderDoubleOuterBox=B>0||n>0?Vn(t.left+E/3,t.top+f/3,B-E/3,n-f/3,cn.TOP_LEFT):new Mn(t.left+E/3,t.top+f/3),this.topRightBorderDoubleOuterBox=B>0||n>0?Vn(t.left+C,t.top+f/3,o-H/3,i-f/3,cn.TOP_RIGHT):new Mn(t.left+t.width-H/3,t.top+f/3),this.bottomRightBorderDoubleOuterBox=Q>0||a>0?Vn(t.left+h,t.top+F,Q-H/3,a-p/3,cn.BOTTOM_RIGHT):new Mn(t.left+t.width-H/3,t.top+t.height-p/3),this.bottomLeftBorderDoubleOuterBox=w>0||u>0?Vn(t.left+E/3,t.top+d,w-E/3,u-p/3,cn.BOTTOM_LEFT):new Mn(t.left+E/3,t.top+t.height-p/3),this.topLeftBorderDoubleInnerBox=B>0||n>0?Vn(t.left+2*E/3,t.top+2*f/3,B-2*E/3,n-2*f/3,cn.TOP_LEFT):new Mn(t.left+2*E/3,t.top+2*f/3),this.topRightBorderDoubleInnerBox=B>0||n>0?Vn(t.left+C,t.top+2*f/3,o-2*H/3,i-2*f/3,cn.TOP_RIGHT):new Mn(t.left+t.width-2*H/3,t.top+2*f/3),this.bottomRightBorderDoubleInnerBox=Q>0||a>0?Vn(t.left+h,t.top+F,Q-2*H/3,a-2*p/3,cn.BOTTOM_RIGHT):new Mn(t.left+t.width-2*H/3,t.top+t.height-2*p/3),this.bottomLeftBorderDoubleInnerBox=w>0||u>0?Vn(t.left+2*E/3,t.top+d,w-2*E/3,u-2*p/3,cn.BOTTOM_LEFT):new Mn(t.left+2*E/3,t.top+t.height-2*p/3),this.topLeftBorderStroke=B>0||n>0?Vn(t.left+E/2,t.top+f/2,B-E/2,n-f/2,cn.TOP_LEFT):new Mn(t.left+E/2,t.top+f/2),this.topRightBorderStroke=B>0||n>0?Vn(t.left+C,t.top+f/2,o-H/2,i-f/2,cn.TOP_RIGHT):new Mn(t.left+t.width-H/2,t.top+f/2),this.bottomRightBorderStroke=Q>0||a>0?Vn(t.left+h,t.top+F,Q-H/2,a-p/2,cn.BOTTOM_RIGHT):new Mn(t.left+t.width-H/2,t.top+t.height-p/2),this.bottomLeftBorderStroke=w>0||u>0?Vn(t.left+E/2,t.top+d,w-E/2,u-p/2,cn.BOTTOM_LEFT):new Mn(t.left+E/2,t.top+t.height-p/2),this.topLeftBorderBox=B>0||n>0?Vn(t.left,t.top,B,n,cn.TOP_LEFT):new Mn(t.left,t.top),this.topRightBorderBox=o>0||i>0?Vn(t.left+C,t.top,o,i,cn.TOP_RIGHT):new Mn(t.left+t.width,t.top),this.bottomRightBorderBox=Q>0||a>0?Vn(t.left+h,t.top+F,Q,a,cn.BOTTOM_RIGHT):new Mn(t.left+t.width,t.top+t.height),this.bottomLeftBorderBox=w>0||u>0?Vn(t.left,t.top+d,w,u,cn.BOTTOM_LEFT):new Mn(t.left,t.top+t.height),this.topLeftPaddingBox=B>0||n>0?Vn(t.left+E,t.top+f,Math.max(0,B-E),Math.max(0,n-f),cn.TOP_LEFT):new Mn(t.left+E,t.top+f),this.topRightPaddingBox=o>0||i>0?Vn(t.left+Math.min(C,t.width-H),t.top+f,C>t.width+H?0:Math.max(0,o-H),Math.max(0,i-f),cn.TOP_RIGHT):new Mn(t.left+t.width-H,t.top+f),this.bottomRightPaddingBox=Q>0||a>0?Vn(t.left+Math.min(h,t.width-E),t.top+Math.min(F,t.height-p),Math.max(0,Q-H),Math.max(0,a-p),cn.BOTTOM_RIGHT):new Mn(t.left+t.width-H,t.top+t.height-p),this.bottomLeftPaddingBox=w>0||u>0?Vn(t.left+E,t.top+Math.min(d,t.height-p),Math.max(0,w-E),Math.max(0,u-p),cn.BOTTOM_LEFT):new Mn(t.left+E,t.top+t.height-p),this.topLeftContentBox=B>0||n>0?Vn(t.left+E+m,t.top+f+I,Math.max(0,B-(E+m)),Math.max(0,n-(f+I)),cn.TOP_LEFT):new Mn(t.left+E+m,t.top+f+I),this.topRightContentBox=o>0||i>0?Vn(t.left+Math.min(C,t.width+E+m),t.top+f+I,C>t.width+E+m?0:o-E+m,i-(f+I),cn.TOP_RIGHT):new Mn(t.left+t.width-(H+y),t.top+f+I),this.bottomRightContentBox=Q>0||a>0?Vn(t.left+Math.min(h,t.width-(E+m)),t.top+Math.min(F,t.height+f+I),Math.max(0,Q-(H+y)),a-(p+K),cn.BOTTOM_RIGHT):new Mn(t.left+t.width-(H+y),t.top+t.height-(p+K)),this.bottomLeftContentBox=w>0||u>0?Vn(t.left+E+m,t.top+d,Math.max(0,w-(E+m)),u-(p+K),cn.BOTTOM_LEFT):new Mn(t.left+E+m,t.top+t.height-(p+K))};!function(A){A[A.TOP_LEFT=0]="TOP_LEFT",A[A.TOP_RIGHT=1]="TOP_RIGHT",A[A.BOTTOM_RIGHT=2]="BOTTOM_RIGHT",A[A.BOTTOM_LEFT=3]="BOTTOM_LEFT"}(cn||(cn={}));var Vn=function(A,e,t,r,B){var n=(Math.sqrt(2)-1)/3*4,s=t*n,o=r*n,i=A+t,c=e+r;switch(B){case cn.TOP_LEFT:return new Tn(new Mn(A,c),new Mn(A,c-o),new Mn(i-s,e),new Mn(i,e));case cn.TOP_RIGHT:return new Tn(new Mn(A,e),new Mn(A+s,e),new Mn(i,c-o),new Mn(i,c));case cn.BOTTOM_RIGHT:return new Tn(new Mn(i,e),new Mn(i,e+o),new Mn(A+s,c),new Mn(A,c));case cn.BOTTOM_LEFT:default:return new Tn(new Mn(i,c),new Mn(i-s,c),new Mn(A,e+o),new Mn(A,e))}},kn=function(A){return[A.topLeftBorderBox,A.topRightBorderBox,A.bottomRightBorderBox,A.bottomLeftBorderBox]},Rn=function(A){return[A.topLeftPaddingBox,A.topRightPaddingBox,A.bottomRightPaddingBox,A.bottomLeftPaddingBox]},Nn=function(A,e,t){this.offsetX=A,this.offsetY=e,this.matrix=t,this.type=0,this.target=6},Pn=function(A,e){this.path=A,this.target=e,this.type=1},Xn=function(A){this.opacity=A,this.type=2,this.target=6},Jn=function(A){return 1===A.type},Yn=function(A,e){return A.length===e.length&&A.some((function(A,t){return A===e[t]}))},Wn=function(A){this.element=A,this.inlineLevel=[],this.nonInlineLevel=[],this.negativeZIndex=[],this.zeroOrAutoZIndexOrTransformedOrOpacity=[],this.positiveZIndex=[],this.nonPositionedFloats=[],this.nonPositionedInlineLevel=[]},Zn=function(){function A(A,e){if(this.container=A,this.parent=e,this.effects=[],this.curves=new On(this.container),this.container.styles.opacity<1&&this.effects.push(new Xn(this.container.styles.opacity)),null!==this.container.styles.transform){var t=this.container.bounds.left+this.container.styles.transformOrigin[0].number,r=this.container.bounds.top+this.container.styles.transformOrigin[1].number,B=this.container.styles.transform;this.effects.push(new Nn(t,r,B))}if(0!==this.container.styles.overflowX){var n=kn(this.curves),s=Rn(this.curves);Yn(n,s)?this.effects.push(new Pn(n,6)):(this.effects.push(new Pn(n,2)),this.effects.push(new Pn(s,4)))}}return A.prototype.getEffects=function(A){for(var e=-1===[2,3].indexOf(this.container.styles.position),t=this.parent,r=this.effects.slice(0);t;){var B=t.effects.filter((function(A){return!Jn(A)}));if(e||0!==t.container.styles.position||!t.parent){if(r.unshift.apply(r,B),e=-1===[2,3].indexOf(t.container.styles.position),0!==t.container.styles.overflowX){var n=kn(t.curves),s=Rn(t.curves);Yn(n,s)||r.unshift(new Pn(s,6))}}else r.unshift.apply(r,B);t=t.parent}return r.filter((function(e){return cr(e.target,A)}))},A}(),qn=function(A,e,t,r){A.container.elements.forEach((function(B){var n=cr(B.flags,4),s=cr(B.flags,2),o=new Zn(B,A);cr(B.styles.display,2048)&&r.push(o);var i=cr(B.flags,8)?[]:r;if(n||s){var c=n||B.styles.isPositioned()?t:e,Q=new Wn(o);if(B.styles.isPositioned()||B.styles.opacity<1||B.styles.isTransformed()){var a=B.styles.zIndex.order;if(a<0){var g=0;c.negativeZIndex.some((function(A,e){return a>A.element.container.styles.zIndex.order?(g=e,!1):g>0})),c.negativeZIndex.splice(g,0,Q)}else if(a>0){var w=0;c.positiveZIndex.some((function(A,e){return a>=A.element.container.styles.zIndex.order?(w=e+1,!1):w>0})),c.positiveZIndex.splice(w,0,Q)}else c.zeroOrAutoZIndexOrTransformedOrOpacity.push(Q)}else B.styles.isFloating()?c.nonPositionedFloats.push(Q):c.nonPositionedInlineLevel.push(Q);qn(o,Q,n?Q:t,i)}else B.styles.isInlineLevel()?e.inlineLevel.push(o):e.nonInlineLevel.push(o),qn(o,e,t,i);cr(B.flags,8)&&jn(B,i)}))},jn=function(A,e){for(var t=A instanceof QB?A.start:1,r=A instanceof QB&&A.reversed,B=0;B0&&A.intrinsicHeight>0){var r=ts(A),B=Rn(e);this.path(B),this.ctx.save(),this.ctx.clip(),this.ctx.drawImage(t,0,0,A.intrinsicWidth,A.intrinsicHeight,r.left,r.top,r.width,r.height),this.ctx.restore()}},t.prototype.renderNodeContent=function(A){return r(this,void 0,void 0,(function(){var e,r,n,o,i,c,Q,a,g,w,u,l,U,C,F,h,d,f;return B(this,(function(B){switch(B.label){case 0:this.applyEffects(A.getEffects(4)),e=A.container,r=A.curves,n=e.styles,o=0,i=e.textNodes,B.label=1;case 1:return o0&&E>0&&(F=r.ctx.createPattern(l,"repeat"),r.renderRepeat(d,F,y,K))):function(A){return 2===A.type}(t)&&(h=rs(A,e,[null,null,null]),d=h[0],f=h[1],H=h[2],p=h[3],E=h[4],I=0===t.position.length?[te]:t.position,y=ne(I[0],p),K=ne(I[I.length-1],E),m=function(A,e,t,r,B){var n=0,s=0;switch(A.size){case 0:0===A.shape?n=s=Math.min(Math.abs(e),Math.abs(e-r),Math.abs(t),Math.abs(t-B)):1===A.shape&&(n=Math.min(Math.abs(e),Math.abs(e-r)),s=Math.min(Math.abs(t),Math.abs(t-B)));break;case 2:if(0===A.shape)n=s=Math.min(me(e,t),me(e,t-B),me(e-r,t),me(e-r,t-B));else if(1===A.shape){var o=Math.min(Math.abs(t),Math.abs(t-B))/Math.min(Math.abs(e),Math.abs(e-r)),i=Le(r,B,e,t,!0),c=i[0],Q=i[1];s=o*(n=me(c-e,(Q-t)/o))}break;case 1:0===A.shape?n=s=Math.max(Math.abs(e),Math.abs(e-r),Math.abs(t),Math.abs(t-B)):1===A.shape&&(n=Math.max(Math.abs(e),Math.abs(e-r)),s=Math.max(Math.abs(t),Math.abs(t-B)));break;case 3:if(0===A.shape)n=s=Math.max(me(e,t),me(e,t-B),me(e-r,t),me(e-r,t-B));else if(1===A.shape){o=Math.max(Math.abs(t),Math.abs(t-B))/Math.max(Math.abs(e),Math.abs(e-r));var a=Le(r,B,e,t,!1);c=a[0],Q=a[1],s=o*(n=me(c-e,(Q-t)/o))}}return Array.isArray(A.size)&&(n=ne(A.size[0],r),s=2===A.size.length?ne(A.size[1],B):n),[n,s]}(t,y,K,p,E),L=m[0],v=m[1],L>0&&v>0&&(b=r.ctx.createRadialGradient(f+y,H+K,0,f+y,H+K,L),ye(t.stops,2*L).forEach((function(A){return b.addColorStop(A.stop,ue(A.color))})),r.path(d),r.ctx.fillStyle=b,L!==v?(D=A.bounds.left+.5*A.bounds.width,x=A.bounds.top+.5*A.bounds.height,S=1/(M=v/L),r.ctx.save(),r.ctx.translate(D,x),r.ctx.transform(1,0,0,M,0,0),r.ctx.translate(-D,-x),r.ctx.fillRect(f,S*(H-x)+x,p,E*S),r.ctx.restore()):r.ctx.fill())),B.label=6;case 6:return e--,[2]}}))},r=this,n=0,s=A.styles.backgroundImage.slice(0).reverse(),i.label=1;case 1:return n0?2!==c.style?[3,5]:[4,this.renderDashedDottedBorder(c.color,c.width,s,A.curves,2)]:[3,11]:[3,13];case 4:return B.sent(),[3,11];case 5:return 3!==c.style?[3,7]:[4,this.renderDashedDottedBorder(c.color,c.width,s,A.curves,3)];case 6:return B.sent(),[3,11];case 7:return 4!==c.style?[3,9]:[4,this.renderDoubleBorder(c.color,c.width,s,A.curves)];case 8:return B.sent(),[3,11];case 9:return[4,this.renderSolidBorder(c.color,s,A.curves)];case 10:B.sent(),B.label=11;case 11:s++,B.label=12;case 12:return o++,[3,3];case 13:return[2]}}))}))},t.prototype.renderDashedDottedBorder=function(A,e,t,n,s){return r(this,void 0,void 0,(function(){var r,o,i,c,Q,a,g,w,u,l,U,C,F,h,d,f;return B(this,(function(B){return this.ctx.save(),r=function(A,e){switch(e){case 0:return $n(A.topLeftBorderStroke,A.topRightBorderStroke);case 1:return $n(A.topRightBorderStroke,A.bottomRightBorderStroke);case 2:return $n(A.bottomRightBorderStroke,A.bottomLeftBorderStroke);default:return $n(A.bottomLeftBorderStroke,A.topLeftBorderStroke)}}(n,t),o=zn(n,t),2===s&&(this.path(o),this.ctx.clip()),Gn(o[0])?(i=o[0].start.x,c=o[0].start.y):(i=o[0].x,c=o[0].y),Gn(o[1])?(Q=o[1].end.x,a=o[1].end.y):(Q=o[1].x,a=o[1].y),g=0===t||2===t?Math.abs(i-Q):Math.abs(c-a),this.ctx.beginPath(),3===s?this.formatPath(r):this.formatPath(o.slice(0,2)),w=e<3?3*e:2*e,u=e<3?2*e:e,3===s&&(w=e,u=e),l=!0,g<=2*w?l=!1:g<=2*w+u?(w*=U=g/(2*w+u),u*=U):(C=Math.floor((g+u)/(w+u)),F=(g-C*w)/(C-1),u=(h=(g-(C+1)*w)/C)<=0||Math.abs(u-F){var e=A&&A.__esModule?()=>A.default:()=>A;return t.d(e,{a:e}),e},t.d=(A,e)=>{for(var r in e)t.o(e,r)&&!t.o(A,r)&&Object.defineProperty(A,r,{enumerable:!0,get:e[r]})},t.o=(A,e)=>Object.prototype.hasOwnProperty.call(A,e),(()=>{"use strict";var A=t(120),e=t.n(A);jQuery(document).ready((function(A){const __=wp.i18n.__,t=new ClipboardJS(".health-check-screenshot-embed");let r;A(document).on("click",".health-check-take-screenshot",(function(t){t.preventDefault(),e()(document.body).then((function(e){A.ajax({url:HealthCheckTools.rest.screenshot,method:"POST",beforeSend:A=>{A.setRequestHeader("X-WP-Nonce",HealthCheckTools.nonce.rest)},data:{screenshot:e.toDataURL("image/jpeg"),label:document.title,nonce:HealthCheckTools.nonce.screenshot}})}))})),t.on("success",(function(e){const t=A(e.trigger),B=A(".prompt",t.closest("div")),n=A(".success",t.closest("div"));e.clearSelection(),t.trigger("focus"),clearTimeout(r),B.addClass("hidden"),n.removeClass("hidden"),r=setTimeout((function(){n.addClass("hidden"),B.removeClass("hidden")}),2e3),wp.a11y.speak(__("Site information has been copied to your clipboard.","health-check"))}))}))})()})();PK!TT$build/troubleshooting-mode.asset.phpnu[ array(), 'version' => '9fb4d8aebf14252d8925'); PK!F|uTTbuild/health-check.asset.phpnu[ array(), 'version' => '08c8fbc45ae19e9130e1'); PK!&TT"build/health-check-tools.asset.phpnu[ array(), 'version' => 'ecf8e9136e1f6b75ecdf'); PK!a3{T{Tbuild/health-check.cssnu[body.tools_page_site-health #wpcontent,body.wp-admin.site-health-php #wpcontent{padding-left:0}body.tools_page_site-health .notice,body.wp-admin.site-health-php .notice{margin:25px 20px 15px 2px}body.tools_page_site-health .update-nag,body.wp-admin.site-health-php .update-nag{margin-bottom:20px;margin-left:22px}body.tools_page_site-health h2,body.wp-admin.site-health-php h2{line-height:1.4}body.tools_page_site-health .wrap,body.wp-admin.site-health-php .wrap{margin-left:0;margin-right:0}body.tools_page_site-health .wrap h2,body.wp-admin.site-health-php .wrap h2{font-family:inherit;font-size:1.3rem;font-weight:600;padding:1rem .5rem}@media (min-width:960px){body.tools_page_site-health .wrap h2,body.wp-admin.site-health-php .wrap h2{padding:1rem 0}}body.tools_page_site-health ol li,body.tools_page_site-health ul li,body.wp-admin.site-health-php ol li,body.wp-admin.site-health-php ul li{font-size:13px;line-height:1.5}body.tools_page_site-health .wp-core-ui .button,body.wp-admin.site-health-php .wp-core-ui .button{font-size:13px}body.tools_page_site-health .health-check-header,body.wp-admin.site-health-php .health-check-header{background:#fff;border-bottom:1px solid #dcdcde;margin:0 0 1rem;text-align:center}body.tools_page_site-health .health-check-header .health-check-tabs-wrapper,body.wp-admin.site-health-php .health-check-header .health-check-tabs-wrapper{-ms-grid-columns:1fr 1fr 1fr 1fr;display:-ms-inline-grid;display:inline-grid;grid-template-columns:1fr 1fr 1fr 1fr;vertical-align:top}@media (max-width:500px){body.tools_page_site-health .health-check-header .health-check-tabs-wrapper,body.wp-admin.site-health-php .health-check-header .health-check-tabs-wrapper{grid-template-columns:1fr 1fr}}body.tools_page_site-health .health-check-header .health-check-tabs-wrapper .health-check-tab,body.wp-admin.site-health-php .health-check-header .health-check-tabs-wrapper .health-check-tab{color:inherit;display:block;margin:0 1rem;padding:.5rem 1rem 1rem;text-decoration:none;transition:box-shadow .5s ease-in-out}body.tools_page_site-health .health-check-header .health-check-tabs-wrapper .health-check-tab:first-child,body.wp-admin.site-health-php .health-check-header .health-check-tabs-wrapper .health-check-tab:first-child{-ms-grid-column:1}body.tools_page_site-health .health-check-header .health-check-tabs-wrapper .health-check-tab:nth-child(2),body.wp-admin.site-health-php .health-check-header .health-check-tabs-wrapper .health-check-tab:nth-child(2){-ms-grid-column:2}body.tools_page_site-health .health-check-header .health-check-tabs-wrapper .health-check-tab:nth-child(3),body.wp-admin.site-health-php .health-check-header .health-check-tabs-wrapper .health-check-tab:nth-child(3){-ms-grid-column:3}body.tools_page_site-health .health-check-header .health-check-tabs-wrapper .health-check-tab:nth-child(4),body.wp-admin.site-health-php .health-check-header .health-check-tabs-wrapper .health-check-tab:nth-child(4){-ms-grid-column:4}body.tools_page_site-health .health-check-header .health-check-tabs-wrapper .health-check-tab.active,body.wp-admin.site-health-php .health-check-header .health-check-tabs-wrapper .health-check-tab.active{box-shadow:inset 0 -3px #007cba;font-weight:600}body.tools_page_site-health .health-check-header .health-check-tabs-wrapper .health-check-tab:focus,body.wp-admin.site-health-php .health-check-header .health-check-tabs-wrapper .health-check-tab:focus{box-shadow:none;color:#191e23;outline:1px solid #6c7781}body.tools_page_site-health .health-check-body,body.wp-admin.site-health-php .health-check-body{margin:0 auto;max-width:800px}@media (max-width:1004px){body.tools_page_site-health .health-check-body,body.wp-admin.site-health-php .health-check-body{margin:0 22px}}body.tools_page_site-health .health-check-table,body.wp-admin.site-health-php .health-check-table{table-layout:fixed}body.tools_page_site-health .health-check-table thead td,body.tools_page_site-health .health-check-table thead th,body.wp-admin.site-health-php .health-check-table thead td,body.wp-admin.site-health-php .health-check-table thead th{font-size:13px}body.tools_page_site-health .health-check-table thead td:first-child,body.tools_page_site-health .health-check-table thead th:first-child,body.wp-admin.site-health-php .health-check-table thead td:first-child,body.wp-admin.site-health-php .health-check-table thead th:first-child{width:30%}body.tools_page_site-health .health-check-table tbody td,body.wp-admin.site-health-php .health-check-table tbody td{word-wrap:break-word;box-sizing:border-box;display:block;font-size:13px;width:100%}body.tools_page_site-health .health-check-table tbody td:first-child,body.wp-admin.site-health-php .health-check-table tbody td:first-child{font-weight:600;padding-bottom:0;width:100%}body.tools_page_site-health .health-check-table tbody td ol,body.tools_page_site-health .health-check-table tbody td ul,body.wp-admin.site-health-php .health-check-table tbody td ol,body.wp-admin.site-health-php .health-check-table tbody td ul{margin:0}body.tools_page_site-health .good:before,body.tools_page_site-health .pass:before,body.wp-admin.site-health-php .good:before,body.wp-admin.site-health-php .pass:before{color:#46b450;content:"";display:inline-block;font-family:dashicons}body.tools_page_site-health .warning:before,body.wp-admin.site-health-php .warning:before{color:#ffb900;content:"";display:inline-block;font-family:dashicons}body.tools_page_site-health .info:before,body.wp-admin.site-health-php .info:before{color:#00a0d2;content:"";display:inline-block;font-family:dashicons}body.tools_page_site-health .error:before,body.tools_page_site-health .fail:before,body.wp-admin.site-health-php .error:before,body.wp-admin.site-health-php .fail:before{color:#dc3232;content:"";display:inline-block;font-family:dashicons}body.tools_page_site-health .spinner,body.wp-admin.site-health-php .spinner{float:none}body.tools_page_site-health .site-health-copy-buttons,body.wp-admin.site-health-php .site-health-copy-buttons{display:block;margin:1rem 0}body.tools_page_site-health .site-health-copy-buttons .copy-button-wrapper,body.wp-admin.site-health-php .site-health-copy-buttons .copy-button-wrapper{margin:.5rem 0 1rem}body.tools_page_site-health .site-health-copy-buttons .success,body.wp-admin.site-health-php .site-health-copy-buttons .success{color:#40860a;display:none;height:28px;line-height:2.2;margin-left:.5rem}body.tools_page_site-health .site-health-copy-buttons .success.visible,body.wp-admin.site-health-php .site-health-copy-buttons .success.visible{display:inline-block}body.tools_page_site-health #health-check-debug,body.wp-admin.site-health-php #health-check-debug{margin-bottom:3rem}body.tools_page_site-health .health-check-wp-paths-sizes.spinner,body.wp-admin.site-health-php .health-check-wp-paths-sizes.spinner{float:none;margin:0 4px;position:absolute;visibility:visible}body.tools_page_site-health .file-integrity-table tbody td:first-child,body.tools_page_site-health .file-integrity-table tbody th:first-child,body.tools_page_site-health .file-integrity-table tfoot td:first-child,body.tools_page_site-health .file-integrity-table tfoot th:first-child,body.tools_page_site-health .file-integrity-table thead td:first-child,body.tools_page_site-health .file-integrity-table thead th:first-child,body.wp-admin.site-health-php .file-integrity-table tbody td:first-child,body.wp-admin.site-health-php .file-integrity-table tbody th:first-child,body.wp-admin.site-health-php .file-integrity-table tfoot td:first-child,body.wp-admin.site-health-php .file-integrity-table tfoot th:first-child,body.wp-admin.site-health-php .file-integrity-table thead td:first-child,body.wp-admin.site-health-php .file-integrity-table thead th:first-child{text-align:center;width:60px}body.tools_page_site-health .tools-email-table,body.wp-admin.site-health-php .tools-email-table{border:0;box-shadow:none}body.tools_page_site-health .tools-email-table td:first-child,body.wp-admin.site-health-php .tools-email-table td:first-child{width:280px}@media(max-width:768px){body.tools_page_site-health .tools-email-table td,body.wp-admin.site-health-php .tools-email-table td{display:block}}body.tools_page_site-health .tools-email-table input,body.wp-admin.site-health-php .tools-email-table input{width:100%}body.tools_page_site-health .tools-email-table label,body.wp-admin.site-health-php .tools-email-table label{clear:both;display:block}body.tools_page_site-health #health-check-file-integrity,body.tools_page_site-health #health-check-mail-check,body.wp-admin.site-health-php #health-check-file-integrity,body.wp-admin.site-health-php #health-check-mail-check{margin-bottom:15px}body.tools_page_site-health #health-check-diff-modal,body.wp-admin.site-health-php #health-check-diff-modal{background:rgba(0,0,0,.7);display:none;height:100%;left:0;position:fixed;top:0;width:100vw;z-index:99999}body.tools_page_site-health #health-check-diff-modal #health-check-diff-modal-content,body.wp-admin.site-health-php #health-check-diff-modal #health-check-diff-modal-content{background:#fff;display:block;height:calc(100% - 120px);margin-left:40px;margin-top:40px;padding:20px;width:calc(100% - 120px)}body.tools_page_site-health #health-check-diff-modal #health-check-diff-modal-diff,body.wp-admin.site-health-php #health-check-diff-modal #health-check-diff-modal-diff{display:block;height:calc(100% - 80px);overflow-y:auto;position:relative;width:100%}body.tools_page_site-health #health-check-diff-modal #health-check-diff-modal-diff table.diff td:nth-child(2),body.wp-admin.site-health-php #health-check-diff-modal #health-check-diff-modal-diff table.diff td:nth-child(2){background:#f3f3f3}body.tools_page_site-health #health-check-diff-modal-close-ref,body.wp-admin.site-health-php #health-check-diff-modal-close-ref{color:#000;display:block;float:right;position:relative;text-decoration:none}body.tools_page_site-health .site-health-issues-wrapper,body.wp-admin.site-health-php .site-health-issues-wrapper{margin-bottom:3rem;margin-top:2rem}body.tools_page_site-health .site-health-issues-wrapper:first-of-type,body.wp-admin.site-health-php .site-health-issues-wrapper:first-of-type{margin-top:3rem}body.tools_page_site-health .site-status-has-issues,body.wp-admin.site-health-php .site-status-has-issues{display:block}body.tools_page_site-health .site-status-has-issues.hide,body.wp-admin.site-health-php .site-status-has-issues.hide{display:none}body.tools_page_site-health h3,body.wp-admin.site-health-php h3{font-weight:400;padding:0}body.tools_page_site-health .site-health-view-more,body.wp-admin.site-health-php .site-health-view-more{text-align:center}body.tools_page_site-health .issues-wrapper,body.wp-admin.site-health-php .issues-wrapper{margin-bottom:5rem}body.tools_page_site-health .site-status-all-clear,body.wp-admin.site-health-php .site-status-all-clear{align-items:center;display:flex;flex-direction:column;height:100%;justify-content:center;margin-top:0;text-align:center;width:100%}@media (min-width:784px){body.tools_page_site-health .site-status-all-clear,body.wp-admin.site-health-php .site-status-all-clear{margin:5rem 0}}body.tools_page_site-health .site-status-all-clear.hide,body.wp-admin.site-health-php .site-status-all-clear.hide{display:none}body.tools_page_site-health .site-status-all-clear .dashicons,body.wp-admin.site-health-php .site-status-all-clear .dashicons{font-size:150px;height:130px;width:150px}body.tools_page_site-health .site-status-all-clear .wp-logo,body.wp-admin.site-health-php .site-status-all-clear .wp-logo{height:150px;width:150px}body.tools_page_site-health .site-status-all-clear .encouragement,body.wp-admin.site-health-php .site-status-all-clear .encouragement{font-family:inherit;font-size:1.5rem;font-weight:600}body.tools_page_site-health .site-status-all-clear p,body.wp-admin.site-health-php .site-status-all-clear p{margin:0}body.tools_page_site-health .site-health-view-passed,body.wp-admin.site-health-php .site-health-view-passed{padding-left:20px;padding-right:40px;position:relative}body.tools_page_site-health .site-health-view-passed .icon,body.wp-admin.site-health-php .site-health-view-passed .icon{border:solid #555d66;border-width:0 2px 2px 0;height:.5rem;pointer-events:none;position:absolute;right:1.5em;top:50%;transform:translateY(-70%) rotate(45deg);width:.5rem}body.tools_page_site-health .site-health-view-passed[aria-expanded=true] .icon,body.wp-admin.site-health-php .site-health-view-passed[aria-expanded=true] .icon{transform:translateY(-30%) rotate(-135deg)}body.tools_page_site-health .health-check-screenshots .screenshot,body.wp-admin.site-health-php .health-check-screenshots .screenshot{background:#fff;box-shadow:0 0 10px rgba(0,0,0,.2);display:grid;grid-template-columns:40% 55%;justify-content:space-between;margin-bottom:1rem;padding:10px}body.tools_page_site-health .health-check-screenshots .screenshot img,body.wp-admin.site-health-php .health-check-screenshots .screenshot img{height:auto;width:100%}body.tools_page_site-health .health-check-screenshots .screenshot .meta .title,body.wp-admin.site-health-php .health-check-screenshots .screenshot .meta .title{display:block;font-weight:600}body.tools_page_site-health .health-check-screenshots .screenshot .meta .date,body.wp-admin.site-health-php .health-check-screenshots .screenshot .meta .date{display:block}body.tools_page_site-health .health-check-screenshots .screenshot .meta .actions,body.wp-admin.site-health-php .health-check-screenshots .screenshot .meta .actions{grid-gap:10px;display:grid;grid-template-columns:1fr 1fr;margin-top:10px;text-align:center}body.tools_page_site-health .health-check-screenshots .screenshot .meta .actions a.button-delete,body.wp-admin.site-health-php .health-check-screenshots .screenshot .meta .actions a.button-delete{background-color:#d63638;border-color:#d63638;color:#fff}body.tools_page_site-health .health-check-screenshots .screenshot .meta .actions a.button-delete:hover,body.wp-admin.site-health-php .health-check-screenshots .screenshot .meta .actions a.button-delete:hover{background-color:#b52a2c;border-color:#b52a2c}body .health-check-accordion{border:1px solid #e2e4e7}body .health-check-accordion .health-check-accordion-heading{border-top:1px solid #e2e4e7;color:inherit;font-size:inherit;font-weight:600;line-height:inherit;margin:0}body .health-check-accordion .health-check-accordion-heading:first-child{border-top:none}body .health-check-accordion .health-check-accordion-trigger{align-items:center;background:#fff;border:0;color:#2c3338;cursor:pointer;display:flex;font-weight:400;justify-content:space-between;margin:0;min-height:46px;padding:1em 3.5em 1em 1.5em;position:relative;text-align:left;-webkit-user-select:auto;-moz-user-select:auto;user-select:auto;width:100%}@media (max-width:784px){body .health-check-accordion .health-check-accordion-trigger{align-items:flex-start;flex-direction:column}}body .health-check-accordion .health-check-accordion-trigger:active,body .health-check-accordion .health-check-accordion-trigger:hover{background:#f8f9f9}body .health-check-accordion .health-check-accordion-trigger:focus{border:none;box-shadow:none;color:#191e23;outline:1px dotted #555d66;outline-offset:-2px}body .health-check-accordion .health-check-accordion-trigger .title{display:inline-block;font-weight:600;pointer-events:none}body .health-check-accordion .health-check-accordion-trigger .icon{border:solid #555d66;border-width:0 2px 2px 0;height:.5rem;pointer-events:none;position:absolute;right:1.5em;top:50%;transform:translateY(-70%) rotate(45deg);width:.5rem}body .health-check-accordion .health-check-accordion-trigger .badge{color:#32373c;float:right;font-weight:600;margin-left:.5rem;padding:.1rem .5rem .15rem}body .health-check-accordion .health-check-accordion-trigger .badge.blue{border:1px solid #bfe7f3}body .health-check-accordion .health-check-accordion-trigger .badge.orange{border:1px solid #ffb900}body .health-check-accordion .health-check-accordion-trigger .badge.red{border:1px solid #dc3232}body .health-check-accordion .health-check-accordion-trigger .badge.green{border:1px solid #46b450}body .health-check-accordion .health-check-accordion-trigger .badge.purple{border:1px solid #826eb4}body .health-check-accordion .health-check-accordion-trigger .badge.gray{border:1px solid #ccd0d4}body .health-check-accordion .health-check-accordion-trigger[aria-expanded=true] .icon{transform:translateY(-30%) rotate(-135deg)}body .health-check-accordion .health-check-accordion-panel{background:#fff;margin:0;padding:1em 1.5em}body .health-check-accordion .health-check-accordion-panel>div{display:block}body .health-check-accordion .health-check-accordion-panel[hidden]{display:none}body .health-check-accordion .health-check-accordion-panel a .dashicons{text-decoration:none}body .health-check-accordion dl dd{margin:0 0 .5em 2em}.health-check-modal{background-color:#000;background-color:rgba(0,0,0,.4);display:none;height:100%;left:0;overflow:auto;padding-top:50px;position:absolute;top:0;width:100%;z-index:1000}@media (min-width:1024px){.health-check-modal{padding-top:100px}}.health-check-modal.show{display:block}.health-check-modal .modal-content{background-color:#fefefe;border:1px solid #888;margin:auto;padding:20px;width:90%}@media (min-width:1024px){.health-check-modal .modal-content{width:30%}}.health-check-modal .modal-content .modal-close{color:#aaa;cursor:pointer;float:right;font-size:28px;font-weight:600}.health-check-modal .modal-content #dynamic-content{display:block;width:100%}.health-check-modal .modal-close:focus,.health-check-modal .modal-close:hover{color:#aaa;float:right;font-size:28px;font-weight:600}.health-check-title-section{align-items:center;clear:both;display:flex;justify-content:center}.health-check-title-section h1{display:inline-block;font-family:inherit;font-size:23px;font-weight:600;line-height:1.3;margin:0 .8rem 1rem;padding:9px 0 4px}.health-check-title-section.site-health-progress-wrapper{margin-bottom:1rem}.health-check-title-section.site-health-progress-wrapper.loading .site-health-progress svg #bar{stroke-dashoffset:0;stroke:#adc5d2;animation:loadingPulse 3s ease-in-out infinite}@keyframes loadingPulse{0%{stroke:#adc5d2}50%{stroke:#00a0d2}to{stroke:#adc5d2}}.health-check-title-section.site-health-progress-wrapper.green #bar{stroke:#46b450}.health-check-title-section.site-health-progress-wrapper.green .site-health-progress-label{color:#46b450}.health-check-title-section.site-health-progress-wrapper.orange #bar{stroke:#ffb900}.health-check-title-section.site-health-progress-wrapper.orange .site-health-progress-label{color:#ffb900}.health-check-title-section.site-health-progress-wrapper .site-health-progress{border-radius:100%;display:inline-block;font-size:.4rem;font-weight:600;height:20px;margin:0;position:relative;width:20px}.health-check-title-section.site-health-progress-wrapper .site-health-progress svg circle{stroke-dashoffset:0;stroke:#ccc;stroke-width:3em;transition:stroke-dashoffset 1s linear}.health-check-title-section.site-health-progress-wrapper .site-health-progress svg #bar{stroke-dashoffset:565}.health-check-title-section.site-health-progress-wrapper .site-health-progress-label{font-weight:600;line-height:20px;margin-left:.3rem}#health-check-dashboard-widget{grid-gap:2%;background:#fff;box-shadow:0 1px 1px rgba(0,0,0,.1);display:grid;grid-template-columns:100%;padding:13px}@media (min-width:783px){#health-check-dashboard-widget{grid-template-columns:49% 49%;margin-top:3rem}}#health-check-dashboard-widget h2 .green{color:#40860a}#health-check-dashboard-widget .welcome-panel-content{display:block;max-width:none}#health-check-dashboard-widget #health-check-accordion-block-notices .no-notices p{color:#72777c;font-size:1.2rem}#health-check-dashboard-widget #health-check-accordion-block-notices .notice{color:#72777c;margin-left:0}#health-check-dashboard-widget #health-check-accordion-block-notices .notice p{font-size:13px}#health-check-dashboard-widget #health-check-accordion-block-notices .dismiss-notices{display:block;margin-right:1rem;text-align:right;width:100%}#health-check-dashboard-widget .disable-troubleshooting-mode{margin-bottom:1rem}@media (min-width:960px){#health-check-dashboard-widget .disable-troubleshooting-mode{bottom:1rem;position:absolute;right:1rem}}#health-check-dashboard-widget ul li{font-size:13px}@media (max-width:870px){#health-check-dashboard-widget ul li{display:inline-block;width:100%}}#health-check-dashboard-widget .about-description{display:inline-block;margin:1em 0}#health-check-dashboard-widget .about-description p{color:inherit;font-size:16px}#health-check-nonce-validator{height:100vh;left:0;position:fixed;top:0;width:100vw;z-index:9999}#health-check-nonce-validator .health-check-nonce-validator-wrapper{background:rgba(0,0,0,.5);height:100vh;left:0;position:absolute;top:0;width:100vw}#health-check-nonce-validator .health-check-nonce-validator-wrapper .health-check-nonce-validator-inner{background:#fff;border-radius:2px;box-shadow:0 0 10px rgba(0,0,0,.5);left:50%;max-width:800px;min-width:400px;padding:20px;position:absolute;top:50%;transform:translate(-50%,-50%);width:50%}#health-check-nonce-validator .health-check-nonce-validator-wrapper .health-check-nonce-validator-inner h2{font-size:20px;font-weight:400;margin:0 0 20px}#health-check-nonce-validator .health-check-nonce-validator-wrapper .health-check-nonce-validator-inner p{font-size:14px;font-weight:400;margin:10px 0 0}#health-check-nonce-validator .health-check-nonce-validator-wrapper .health-check-nonce-validator-inner p:first-of-type{margin:0} PK!z{var t={368:()=>{jQuery(document).ready((function(t){t(".health-check-accordion").on("click",".health-check-accordion-trigger",(function(){"true"===t(this).attr("aria-expanded")?(t(this).attr("aria-expanded","false"),t("#"+t(this).attr("aria-controls")).attr("hidden",!0)):(t(this).attr("aria-expanded","true"),t("#"+t(this).attr("aria-controls")).attr("hidden",!1))}))}))}},r={};function e(a){var o=r[a];if(void 0!==o)return o.exports;var n=r[a]={exports:{}};return t[a](n,n.exports,e),n.exports}e.n=t=>{var r=t&&t.__esModule?()=>t.default:()=>t;return e.d(r,{a:r}),r},e.d=(t,r)=>{for(var a in r)e.o(r,a)&&!e.o(t,a)&&Object.defineProperty(t,a,{enumerable:!0,get:r[a]})},e.o=(t,r)=>Object.prototype.hasOwnProperty.call(t,r),(()=>{"use strict";e(368)})()})();PK!!!!build/troubleshooting-mode.jsnu[(()=>{var e={407:()=>{jQuery(document).ready((function(e){e(".show-remaining").click((function(){e(".hidden",e(this).closest("ul")).removeClass("hidden")}))}))}},r={};function t(o){var n=r[o];if(void 0!==n)return n.exports;var i=r[o]={exports:{}};return e[o](i,i.exports,t),i.exports}t.n=e=>{var r=e&&e.__esModule?()=>e.default:()=>e;return t.d(r,{a:r}),r},t.d=(e,r)=>{for(var o in r)t.o(r,o)&&!t.o(e,o)&&Object.defineProperty(e,o,{enumerable:!0,get:r[o]})},t.o=(e,r)=>Object.prototype.hasOwnProperty.call(e,r),(()=>{"use strict";t(407)})()})();PK!gbuild/health-check-tools.jsnu[(()=>{var e={629:()=>{jQuery(document).ready((function(e){e("#health-check-file-integrity").on("submit",(function(t){const c={action:"health-check-files-integrity-check",_wpnonce:HealthCheck.nonce.files_integrity_check};t.preventDefault(),e("#tools-file-integrity-response-holder").html(''),e("#tools-file-integrity-response-holder .spinner").addClass("is-active"),e.post(ajaxurl,c,(function(t){e("#tools-file-integrity-response-holder .spinner").removeClass("is-active"),e("#tools-file-integrity-response-holder").parent().css("height","auto"),e("#tools-file-integrity-response-holder").html(t.data.message)}))})),e("#tools-file-integrity-response-holder").on("click",'a[href="#health-check-diff"]',(function(t){const c=e(this).data("file");t.preventDefault(),e("#health-check-diff-modal").toggle(),e("#health-check-diff-modal #health-check-diff-modal-content .spinner").addClass("is-active");const l={action:"health-check-view-file-diff",file:c,_wpnonce:HealthCheck.nonce.view_file_diff};e.post(ajaxurl,l,(function(t){e("#health-check-diff-modal #health-check-diff-modal-diff").html(t.data.message),e("#health-check-diff-modal #health-check-diff-modal-content h3").html(c),e("#health-check-diff-modal #health-check-diff-modal-content .spinner").removeClass("is-active")}))}))}))},593:()=>{jQuery(document).ready((function(e){e("#health-check-diff-modal").on("click",'a[href="#health-check-diff-modal-close"]',(function(t){t.preventDefault(),e("#health-check-diff-modal").toggle(),e("#health-check-diff-modal #health-check-diff-modal-diff").html(""),e("#health-check-diff-modal #health-check-diff-modal-content h3").html("")})),e(document).on("keyup",(function(t){27===t.which&&(e("#health-check-diff-modal").css("display","none"),e("#health-check-diff-modal #health-check-diff-modal-diff").html(""),e("#health-check-diff-modal #health-check-diff-modal-content h3").html(""))}))}))},433:()=>{jQuery(document).ready((function(e){e("#health-check-mail-check").on("submit",(function(t){const c=e("#health-check-mail-check #email").val(),l=e("#health-check-mail-check #email_message").val();t.preventDefault(),e("#tools-mail-check-response-holder").html(''),e("#tools-mail-check-response-holder .spinner").addClass("is-active");const a={action:"health-check-mail-check",email:c,email_message:l,_wpnonce:HealthCheck.nonce.mail_check};e.post(ajaxurl,a,(function(t){e("#tools-mail-check-response-holder .spinner").removeClass("is-active"),e("#tools-mail-check-response-holder").parent().css("height","auto"),e("#tools-mail-check-response-holder").html(t.data.message)}))}))}))},188:()=>{jQuery(document).ready((function(e){function t(){const c=e('[data-plugin-checked="false"]',"#health-check-tool-plugin-compat-list");if(c.length<=0)return;const l=e(c[0]);l.attr("data-plugin-checked","true");const a={slug:l.data("plugin-slug"),version:l.data("plugin-version"),_wpnonce:HealthCheck.nonce.rest_api};e.post(HealthCheck.rest_api.tools.plugin_compat,a,(function(c){e(".spinner",l).removeClass("is-active"),e(".supported-version",l).append(c.version),t()}))}e("#health-check-tool-plugin-compat").on("click",(function(){e("tr","#health-check-tool-plugin-compat-list").data("plugin-checked",!1),e(".spinner","#health-check-tool-plugin-compat-list").addClass("is-active"),e(this).attr("disabled",!0),t()}))}))}},t={};function c(l){var a=t[l];if(void 0!==a)return a.exports;var o=t[l]={exports:{}};return e[l](o,o.exports,c),o.exports}c.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return c.d(t,{a:t}),t},c.d=(e,t)=>{for(var l in t)c.o(t,l)&&!c.o(e,l)&&Object.defineProperty(e,l,{enumerable:!0,get:t[l]})},c.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),(()=>{"use strict";c(629),c(593),c(433),c(188)})()})();PK!Vnpages/tools.phpnu[PK! pages/debug-data.phpnu[PK!@Qpages/site-health-header.phpnu[PK!ZSpages/site-status.phpnu[PK!4$#pages/phpinfo.phpnu[PK!.E)pages/troubleshoot.phpnu[PK!%w 0pages/screenshots.phpnu[PK!e>vHH +>uninstall.phpnu[PK!*9*9 Cchangelog.txtnu[PK!/}mu-plugin/health-check-troubleshooting-mode.phpnu[PK!gzz/}JHealthCheck/BackCompat/class-wp-site-health.phpnu[PK!C;.VZHealthCheck/BackCompat/class-wp-debug-data.phpnu[PK!)s$$+HealthCheck/class-health-check-loopback.phpnu[PK!\=4  =,HealthCheck/Tools/class-health-check-plugin-compatibility.phpnu[PK!XVI3l?HealthCheck/Tools/class-health-check-mail-check.phpnu[PK!/2THealthCheck/Tools/class-health-check-robotstxt.phpnu[PK!Uh^CC1YHealthCheck/Tools/class-health-check-htaccess.phpnu[PK!$$8K`HealthCheck/Tools/class-health-check-files-integrity.phpnu[PK!DVx) ) 9̄HealthCheck/Tools/class-health-check-debug-log-viewer.phpnu[PK!Wh h 0^HealthCheck/Tools/class-health-check-phpinfo.phpnu[PK!Vvv-&HealthCheck/Tools/class-health-check-tool.phpnu[PK!k6HealthCheck/Tools/class-health-check-beta-features.phpnu[PK!.HealthCheck/class-health-check-screenshots.phpnu[PK!R 4HealthCheck/class-cli.phpnu[PK!_/VHealthCheck/class-health-check-troubleshoot.phpnu[PK!Gs(;2;2"~HealthCheck/class-health-check.phpnu[PK! # HealthCheck/WP_CLI/class-status.phpnu[PK!B C readme.txtnu[PK!@6modals/diff.phpnu[PK!<ӷ 18compat.phpnu[PK!FNFF"WLICENSEnu[PK!D܆O health-check.phpnu[PK!.cTT#build/health-check-global.asset.phpnu[PK!ɤVVbuild/health-check-global.jsnu[PK!TT$_build/troubleshooting-mode.asset.phpnu[PK!F|uTTbuild/health-check.asset.phpnu[PK!&TT"build/health-check-tools.asset.phpnu[PK!a3{T{TMbuild/health-check.cssnu[PK!z