Skip to content

Commit d342d71

Browse files
committed
Merge branch 'develop' into more-conditionals
2 parents 8900731 + a9d0f80 commit d342d71

29 files changed

+100
-113
lines changed

.github/workflows/acceptance-tests.yml

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -46,21 +46,22 @@ jobs:
4646
matrix:
4747
wp:
4848
# Latest three stable:
49+
- '6.6'
4950
- '6.5'
5051
- '6.4'
51-
- '6.3'
5252
php:
5353
- '8.2'
5454
- '7.4'
5555
include:
5656
# Latest stable on PHP 8.3:
57-
- wp: '6.5'
57+
- wp: '6.6'
5858
php: '8.3'
5959
# Oldest supported on PHP 7.4:
60-
- wp: '5.7'
60+
- wp: '5.8'
6161
php: '7.4'
6262
fail-fast: false
6363
uses: johnbillion/plugin-infrastructure/.github/workflows/reusable-acceptance-tests.yml@trunk
6464
with:
65-
wp: ${{ matrix.wp }}
65+
node: true
6666
php: ${{ matrix.php }}
67+
wp: ${{ matrix.wp }}

.github/workflows/build.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,4 +15,6 @@ jobs:
1515
name: Build
1616
uses: johnbillion/plugin-infrastructure/.github/workflows/reusable-build.yml@trunk
1717
with:
18+
node: true
1819
tag: ${{ github.event_name != 'workflow_dispatch' }}
20+
vendor: true

.github/workflows/deploy-assets.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,10 @@ jobs:
1414
name: WordPress.org
1515
uses: johnbillion/plugin-infrastructure/.github/workflows/reusable-deploy-assets.yml@trunk
1616
with:
17+
node: true
1718
plugin: query-monitor
1819
readme: readme.txt
20+
vendor: true
1921
secrets:
2022
WPORG_SVN_USERNAME: ${{ secrets.WPORG_SVN_USERNAME }}
2123
WPORG_SVN_PASSWORD: ${{ secrets.WPORG_SVN_PASSWORD }}

.github/workflows/deploy-tag.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,10 @@ jobs:
2222
name: Deploy Tag
2323
uses: johnbillion/plugin-infrastructure/.github/workflows/reusable-deploy-tag.yml@trunk
2424
with:
25+
deploy: ${{ github.event_name != 'workflow_dispatch' }}
2526
plugin: query-monitor
2627
readme: readme.txt
2728
version: ${{ github.event_name != 'workflow_dispatch' && github.event.release.tag_name || github.event.inputs.version }}
28-
deploy: ${{ github.event_name != 'workflow_dispatch' }}
2929
secrets:
3030
WPORG_SVN_USERNAME: ${{ secrets.WPORG_SVN_USERNAME }}
3131
WPORG_SVN_PASSWORD: ${{ secrets.WPORG_SVN_PASSWORD }}

.github/workflows/integration-tests.yml

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -47,20 +47,21 @@ jobs:
4747
matrix:
4848
wp:
4949
# Latest three stable:
50+
- '6.6'
5051
- '6.5'
5152
- '6.4'
52-
- '6.3'
5353
php:
5454
- '8.2'
5555
- '7.4'
5656
include:
5757
# Latest stable on PHP 8.3:
58-
- wp: '6.5'
58+
- wp: '6.6'
5959
php: '8.3'
6060
# Oldest supported on PHP 7.4:
61-
- wp: '5.7'
61+
- wp: '5.8'
6262
php: '7.4'
6363
fail-fast: false
6464
with:
65-
wp: ${{ matrix.wp }}
65+
node: true
6666
php: ${{ matrix.php }}
67+
wp: ${{ matrix.wp }}

.github/workflows/nightly-tests.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,9 @@ jobs:
3535
fail-fast: false
3636
uses: johnbillion/plugin-infrastructure/.github/workflows/reusable-acceptance-tests.yml@trunk
3737
with:
38-
wp: 'nightly'
38+
node: true
3939
php: ${{ matrix.php }}
40+
wp: 'nightly'
4041
integration:
4142
name: Nightly integration / PHP ${{ matrix.php }}
4243
uses: johnbillion/plugin-infrastructure/.github/workflows/reusable-integration-tests.yml@trunk
@@ -47,5 +48,6 @@ jobs:
4748
- '7.4'
4849
fail-fast: false
4950
with:
50-
wp: 'nightly'
51+
node: true
5152
php: ${{ matrix.php }}
53+
wp: 'nightly'

CODE_OF_CONDUCT.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ representative at an online or offline event.
6161

6262
Instances of abusive, harassing, or otherwise unacceptable behavior may be
6363
reported to the community leaders responsible for enforcement at
64-
https://johnblackbourn.com/about/ .
64+
https://querymonitor.com/about/ .
6565
All complaints will be reviewed and investigated promptly and fairly.
6666

6767
All community leaders are obligated to respect the privacy and security of the

CONTRIBUTING.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ If you enjoy using Query Monitor I would greatly appreciate it <a href="https://
1010

1111
## Reporting Security Issues
1212

13-
You can report security bugs through the Patchstack Vulnerability Disclosure Program. The Patchstack team helps validate, triage, and handle any security vulnerabilities. [Report a security vulnerability here](https://patchstack.com/database/vdp/query-monitor).
13+
[You can report security bugs through the official Query Monitor Vulnerability Disclosure Program on Patchstack](https://patchstack.com/database/vdp/query-monitor). The Patchstack team helps validate, triage, and handle any security vulnerabilities.
1414

1515
Do not report security issues on GitHub or the WordPress.org support forums. Thank you.
1616

@@ -108,7 +108,8 @@ New milestones are automatically created for the next major, minor, and patch re
108108

109109
1. Close the milestone.
110110
1. If this is a non-patch release, manually delete any [unused patch and minor milestones on GitHub](https://github.com/johnbillion/query-monitor/milestones).
111-
1. Check the new version has appeared [on the WordPress.org plugin page](https://wordpress.org/plugins/query-monitor/) (it'll take a few minutes).
111+
1. Approve the release on [the WordPress.org release management dashboard](https://wordpress.org/plugins/developers/releases/).
112+
1. Check the new version has appeared [on the WordPress.org plugin page](https://wordpress.org/plugins/query-monitor/).
112113
1. Resolve relevant threads on [the plugin's support forums](https://wordpress.org/support/plugin/query-monitor/).
113114
1. Consume tea and cake as necessary.
114115

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -267,7 +267,7 @@ Yes. You can enable this on the Settings panel.
267267

268268
### How can I report a security bug?
269269

270-
You can report security bugs through the Patchstack Vulnerability Disclosure Program. The Patchstack team helps validate, triage, and handle any security vulnerabilities. [Report a security vulnerability here](https://patchstack.com/database/vdp/query-monitor).
270+
[You can report security bugs through the official Query Monitor Vulnerability Disclosure Program on Patchstack](https://patchstack.com/database/vdp/query-monitor). The Patchstack team helps validate, triage, and handle any security vulnerabilities.
271271

272272
### Do you accept donations?
273273

@@ -302,6 +302,7 @@ Debugging is rarely done with just one tool. Along with Query Monitor you should
302302
* [Laps](https://github.com/Rarst/laps)
303303
* [Log HTTP Requests](https://wordpress.org/plugins/log-http-requests/)
304304
* [Rewrite Rules Inspector](https://wordpress.org/plugins/rewrite-rules-inspector/)
305+
* [Snitch](https://wordpress.org/plugins/snitch/)
305306
* [Time Stack](https://github.com/joehoyle/Time-Stack)
306307
* [User Switching](https://wordpress.org/plugins/user-switching/)
307308
* [Variable Inspector](https://wordpress.org/plugins/variable-inspector/)

SECURITY.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# Security Policy
22

3-
### How can I report a security bug?
3+
## How can I report a security bug?
44

5-
You can report security bugs through the Patchstack Vulnerability Disclosure Program. The Patchstack team helps validate, triage, and handle any security vulnerabilities. [Report a security vulnerability here](https://patchstack.com/database/vdp/query-monitor).
5+
[You can report security bugs through the official Query Monitor Vulnerability Disclosure Program on Patchstack](https://patchstack.com/database/vdp/query-monitor). The Patchstack team helps validate, triage, and handle any security vulnerabilities.
66

77
Do not report security issues on GitHub or the WordPress.org support forums. Thank you.

collectors/block_editor.php

Lines changed: 3 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -130,8 +130,6 @@ public function filter_render_block( $block_content, array $block ) {
130130
public function process() {
131131
global $_wp_current_template_content;
132132

133-
$this->data->block_editor_enabled = self::wp_block_editor_enabled();
134-
135133
if ( ! empty( $_wp_current_template_content ) ) {
136134
// Full site editor:
137135
$content = $_wp_current_template_content;
@@ -143,9 +141,9 @@ public function process() {
143141
return;
144142
}
145143

146-
$this->data->post_has_blocks = self::wp_has_blocks( $content );
147-
$this->data->post_blocks = self::wp_parse_blocks( $content );
148-
$this->data->all_dynamic_blocks = self::wp_get_dynamic_block_names();
144+
$this->data->post_has_blocks = has_blocks( $content );
145+
$this->data->post_blocks = array_values( parse_blocks( $content ) );
146+
$this->data->all_dynamic_blocks = get_dynamic_block_names();
149147
$this->data->total_blocks = 0;
150148
$this->data->has_block_context = false;
151149
$this->data->has_block_timing = false;
@@ -204,57 +202,6 @@ protected function process_block( array $block ) {
204202

205203
return $block;
206204
}
207-
208-
/**
209-
* @return bool
210-
*/
211-
protected static function wp_block_editor_enabled() {
212-
// WP 5.0
213-
return ( function_exists( 'parse_blocks' ) || function_exists( 'gutenberg_parse_blocks' ) );
214-
}
215-
216-
/**
217-
* @param string $content
218-
* @return bool
219-
*/
220-
protected static function wp_has_blocks( $content ) {
221-
// WP 5.0
222-
if ( function_exists( 'has_blocks' ) ) {
223-
return has_blocks( $content );
224-
} elseif ( function_exists( 'gutenberg_has_blocks' ) ) {
225-
return gutenberg_has_blocks( $content );
226-
}
227-
228-
return false;
229-
}
230-
231-
/**
232-
* @param string $content
233-
* @return array<int, mixed>|null
234-
*/
235-
protected static function wp_parse_blocks( $content ) {
236-
// WP 5.0
237-
if ( function_exists( 'parse_blocks' ) ) {
238-
return parse_blocks( $content );
239-
} elseif ( function_exists( 'gutenberg_parse_blocks' ) ) {
240-
return gutenberg_parse_blocks( $content );
241-
}
242-
243-
return null;
244-
}
245-
246-
/**
247-
* @return array<int, string>|null
248-
*/
249-
protected static function wp_get_dynamic_block_names() {
250-
// WP 5.0
251-
if ( function_exists( 'get_dynamic_block_names' ) ) {
252-
return get_dynamic_block_names();
253-
}
254-
255-
return array();
256-
}
257-
258205
}
259206

260207
/**

collectors/environment.php

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -187,10 +187,7 @@ public function process() {
187187
'WP_DEVELOPMENT_MODE' => self::format_bool_constant( 'WP_DEVELOPMENT_MODE' ),
188188
);
189189

190-
// WP 5.5
191-
if ( function_exists( 'wp_get_environment_type' ) ) {
192-
$this->data->wp['environment_type'] = wp_get_environment_type();
193-
}
190+
$this->data->wp['environment_type'] = wp_get_environment_type();
194191

195192
// WP 6.3
196193
if ( function_exists( 'wp_get_development_mode' ) ) {

collectors/languages.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,7 @@ public function tear_down() {
5252
public function collect_locale_data() {
5353
$this->data->locale = get_locale();
5454
$this->data->user_locale = get_user_locale();
55-
// WP 5.0
56-
$this->data->determined_locale = function_exists( 'determine_locale' ) ? determine_locale() : get_locale();
55+
$this->data->determined_locale = determine_locale();
5756
$this->data->language_attributes = get_language_attributes();
5857

5958
if ( function_exists( '\Inpsyde\MultilingualPress\siteLanguageTag' ) ) {
@@ -83,6 +82,7 @@ public function get_concerned_filters() {
8382
'determine_locale',
8483
'gettext',
8584
'gettext_with_context',
85+
'lang_dir_for_domain',
8686
'language_attributes',
8787
'load_script_textdomain_relative_path',
8888
'load_script_translation_file',

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@
3939
"roots/wordpress-core-installer": "1.100.0",
4040
"roots/wordpress-full": "*",
4141
"squizlabs/php_codesniffer": "3.7.1",
42-
"szepeviktor/phpstan-wordpress": "1.3.0",
42+
"szepeviktor/phpstan-wordpress": "1.3.5",
4343
"wp-coding-standards/wpcs": "2.3.0"
4444
},
4545
"autoload": {

data/block_editor.php

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,6 @@ class QM_Data_Block_Editor extends QM_Data {
1111
*/
1212
public $all_dynamic_blocks;
1313

14-
/**
15-
* @var bool
16-
*/
17-
public $block_editor_enabled;
18-
1914
/**
2015
* @var bool
2116
*/

data/environment.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ class QM_Data_Environment extends QM_Data {
4545
* @var array<string, mixed>
4646
* @phpstan-var array{
4747
* version: string,
48-
* environment_type?: string,
48+
* environment_type: string,
4949
* development_mode?: string,
5050
* constants: array<string, string>,
5151
* }>

docs/.vitepress/config.mts

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,10 @@ export default defineConfig({
2020
rewrites: {
2121
'help/:page.md': 'help/:page/index.md',
2222
'wordpress-debugging/:page.md': 'wordpress-debugging/:page/index.md',
23+
'about.md': 'about/index.md',
24+
'accessibility.md': 'accessibility/index.md',
2325
'privacy.md': 'privacy/index.md',
26+
'security.md': 'security/index.md',
2427
},
2528
head: [
2629
[
@@ -139,10 +142,22 @@ export default defineConfig({
139142
text: 'Download on WordPress.org',
140143
link: wpURL,
141144
},
145+
{
146+
text: 'About the author',
147+
link: '/about/',
148+
},
142149
{
143150
text: 'Privacy statement',
144151
link: '/privacy/',
145152
},
153+
{
154+
text: 'Accessibility statement',
155+
link: '/accessibility/',
156+
},
157+
{
158+
text: 'Security policy',
159+
link: '/security/',
160+
},
146161
],
147162

148163
socialLinks: [
@@ -168,7 +183,7 @@ export default defineConfig({
168183
},
169184

170185
footer: {
171-
copyright: `© 2009-${year}, <a href="https://johnblackbourn.com">John Blackbourn</a>`,
186+
copyright: `© 2009-${year}, <a href="/about/">John Blackbourn</a>`,
172187
},
173188
},
174189
lastUpdated: true,

docs/about.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
---
2+
publish: false
3+
---
4+
5+
# About the author
6+
7+
<img src="/john.jpeg" align="right" width="280" height="280" alt="" style="margin: 0 0 1em 2em">
8+
9+
Query Monitor is maintained by [John Blackbourn](https://johnblackbourn.com/), one of the team of core committers to the WordPress open source project which he's been involved with for over fifteen years.
10+
11+
John works as a Principal Web Engineer at [Human Made](https://humanmade.com/), one of the world's leading WordPress specialist development agencies, where he leads large scale web publishing platform redevelopment projects for enterprise organisations. He has previously worked at [WordPress VIP](https://wpvip.com/) and [Code For The People](http://codeforthepeople.com/).
12+
13+
John maintains [many other plugins, tools, and resources for WordPress developers](https://johnblackbourn.com/wordpress-developer-tools/).

docs/privacy.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ Please note that in a future version of Query Monitor, opt-in features may be in
2020
## querymonitor.com website privacy statement
2121

2222
* The querymonitor.com website makes no use of cookies and collects no data from visitors.
23-
* The querymonitor.com website is operated by [John Blackbourn](https://johnblackbourn.com/about/).
23+
* The querymonitor.com website is operated by [John Blackbourn](/about/).
2424
* The querymonitor.com website is hosted on [Netlify](https://www.netlify.com/).
2525

26-
This privacy statement is subject to change and was last updated on April 2, 2024.
26+
This privacy statement is subject to change and was last updated on June 28, 2024.

docs/public/john.jpeg

58.9 KB
Loading

docs/security.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
---
2+
nav_exclude: true
3+
publish: false
4+
---
5+
6+
# Security policy
7+
8+
## How can I report a security bug?
9+
10+
[You can report security bugs through the official Query Monitor Vulnerability Disclosure Program on Patchstack](https://patchstack.com/database/vdp/query-monitor). The Patchstack team helps validate, triage, and handle any security vulnerabilities.
11+
12+
Do not report security issues on GitHub or the WordPress.org support forums. Thank you.

output/html/block_editor.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ public function output() {
3737
/** @var QM_Data_Block_Editor */
3838
$data = $this->collector->get_data();
3939

40-
if ( empty( $data->block_editor_enabled ) || empty( $data->post_blocks ) ) {
40+
if ( empty( $data->post_blocks ) ) {
4141
return;
4242
}
4343

0 commit comments

Comments
 (0)