diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 150f28b17..24d83863d 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -82,7 +82,7 @@ These are the steps to take to release a new version of Query Monitor (for contr 1. Check [the milestone on GitHub](https://github.com/johnbillion/query-monitor/milestones) for open issues or PRs. Fix or reassign as necessary. 1. If this is a non-patch release, check issues and PRs assigned to the patch or minor milestones that will get skipped. Reassign as necessary. 1. Ensure you're on the `develop` branch and all the changes for this release have been merged in. -1. Ensure both `README.md` and `readme.txt` contain up to date descriptions, "Tested up to" versions, FAQs, screenshots, etc. +1. Ensure `phpstan.neon.dist`, `README.md`, `readme.txt` contain up to date "Tested up to" versions, descriptions, FAQs, screenshots, etc. - Query Monitor supports the last nine versions of WordPress (support for versions up to approximately three years old) 1. Ensure `.gitattributes` is up to date with all files that shouldn't be part of the build. - To do this, run `git archive --output=qm.zip HEAD` then check the contents for files that shouldn't be part of the package. diff --git a/README.md b/README.md index de2e34181..c8ea24467 100644 --- a/README.md +++ b/README.md @@ -247,9 +247,7 @@ Debugging is rarely done with just one tool. Along with Query Monitor you should * [Log HTTP Requests](https://wordpress.org/plugins/log-http-requests/) * [Rewrite Rules Inspector](https://wordpress.org/plugins/rewrite-rules-inspector/) * [Snitch](https://wordpress.org/plugins/snitch/) - * [Time Stack](https://github.com/joehoyle/Time-Stack) * [User Switching](https://wordpress.org/plugins/user-switching/) - * [Variable Inspector](https://wordpress.org/plugins/variable-inspector/) * [WP Crontrol](https://wordpress.org/plugins/wp-crontrol/) Query Monitor also has [several add-on plugins](https://querymonitor.com/help/add-on-plugins/) which extend its functionality, and transparently supports add-ons for the Debug Bar plugin (see the FAQ for more info). diff --git a/assets/_styles.scss b/assets/_styles.scss index 2067cf113..d347cd3df 100644 --- a/assets/_styles.scss +++ b/assets/_styles.scss @@ -1500,14 +1500,20 @@ body.admin-color-light #wp-admin-bar-query-monitor:not(.qm-all-clear):not(:hover } li { - margin: 0 0 0.7em !important; - list-style: none !important; + margin: 0 0 0.7em 1em !important; } .qm-info { /* @TODO */ color: #666 !important; } + + a.qm-edit-link { + svg { + display: none; + } + } + } body#error-page { diff --git a/collectors/block_editor.php b/collectors/block_editor.php index 36af54da5..89ca2c148 100644 --- a/collectors/block_editor.php +++ b/collectors/block_editor.php @@ -135,7 +135,13 @@ public function process() { $content = $_wp_current_template_content; } elseif ( is_singular() ) { // Post editor: - $content = get_post( get_queried_object_id() )->post_content; + $post = get_post( get_queried_object_id() ); + + if ( ! $post ) { + return; + } + + $content = $post->post_content; } else { // Nada: return; diff --git a/collectors/languages.php b/collectors/languages.php index 87fc49f63..b14f0ad8e 100644 --- a/collectors/languages.php +++ b/collectors/languages.php @@ -177,8 +177,10 @@ public function log_mo_file_load( $file, $domain ) { * @phpstan-return T */ public function log_translation_file_load( $file, $domain, string $locale = null ) { + // @phpstan-ignore WPCompat.methodNotAvailable $i18n_controller = \WP_Translation_Controller::get_instance(); + // @phpstan-ignore WPCompat.methodNotAvailable $found = $i18n_controller->load_file( $file, $domain, $locale ?? determine_locale() ); return $this->log_file_load( $file, $domain, $found ); diff --git a/collectors/php_errors.php b/collectors/php_errors.php index 9aaf0149b..7c0dc3abe 100644 --- a/collectors/php_errors.php +++ b/collectors/php_errors.php @@ -359,9 +359,32 @@ protected function output_fatal( $error, array $e ) { continue; } + $args = array_map( function( $value ) { + $type = gettype( $value ); + + switch ( $type ) { + case 'object': + return get_class( $value ); + case 'boolean': + return $value ? 'true' : 'false'; + case 'integer': + case 'double': + return $value; + case 'string': + if ( strlen( $value ) > 50 ) { + return "'" . substr( $value, 0, 20 ) . '...' . substr( $value, -20 ) . "'"; + } + return "'" . $value . "'"; + } + + return $type; + }, $frame['args'] ?? array() ); + + $name = str_replace( '()', '(' . implode( ', ', $args ) . ')', $callback['name'] ); + printf( '