Skip to content

Commit 1704d92

Browse files
committed
Bump the minimum supported WordPress version to 5.7.
1 parent b3cee3b commit 1704d92

10 files changed

+20
-9
lines changed

.github/workflows/acceptance-tests.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ jobs:
5757
- wp: '6.5'
5858
php: '8.3'
5959
# Oldest supported on PHP 7.4:
60-
- wp: '5.6'
60+
- wp: '5.7'
6161
php: '7.4'
6262
fail-fast: false
6363
uses: johnbillion/plugin-infrastructure/.github/workflows/reusable-acceptance-tests.yml@trunk

.github/workflows/integration-tests.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ jobs:
5858
- wp: '6.5'
5959
php: '8.3'
6060
# Oldest supported on PHP 7.4:
61-
- wp: '5.6'
61+
- wp: '5.7'
6262
php: '7.4'
6363
fail-fast: false
6464
with:

classes/Collector_Assets.php

+1
Original file line numberDiff line numberDiff line change
@@ -269,6 +269,7 @@ public function process() {
269269
* }>|null
270270
*/
271271
protected static function get_script_modules(): ?array {
272+
// WP 6.5
272273
if ( ! function_exists( 'wp_script_modules' ) ) {
273274
return null;
274275
}

classes/Dispatcher.php

+4-4
Original file line numberDiff line numberDiff line change
@@ -203,15 +203,15 @@ public static function verify_cookie( $value ) {
203203
* Attempts to switch to the given locale.
204204
*
205205
* This is a wrapper around `switch_to_locale()` which is safe to call at any point, even
206-
* before the `$wp_locale_switcher` global is initialised or if the function does not exist.
206+
* before the `$wp_locale_switcher` global is initialised.
207207
*
208208
* @param string $locale The locale.
209209
* @return bool True on success, false on failure.
210210
*/
211211
public static function switch_to_locale( $locale ) {
212212
global $wp_locale_switcher;
213213

214-
if ( function_exists( 'switch_to_locale' ) && ( $wp_locale_switcher instanceof WP_Locale_Switcher ) ) {
214+
if ( $wp_locale_switcher instanceof WP_Locale_Switcher ) {
215215
return switch_to_locale( $locale );
216216
}
217217

@@ -222,14 +222,14 @@ public static function switch_to_locale( $locale ) {
222222
* Attempts to restore the previous locale.
223223
*
224224
* This is a wrapper around `restore_previous_locale()` which is safe to call at any point, even
225-
* before the `$wp_locale_switcher` global is initialised or if the function does not exist.
225+
* before the `$wp_locale_switcher` global is initialised.
226226
*
227227
* @return string|false Locale on success, false on error.
228228
*/
229229
public static function restore_previous_locale() {
230230
global $wp_locale_switcher;
231231

232-
if ( function_exists( 'restore_previous_locale' ) && ( $wp_locale_switcher instanceof WP_Locale_Switcher ) ) {
232+
if ( $wp_locale_switcher instanceof WP_Locale_Switcher ) {
233233
return restore_previous_locale();
234234
}
235235

collectors/block_editor.php

+4
Original file line numberDiff line numberDiff line change
@@ -209,6 +209,7 @@ protected function process_block( array $block ) {
209209
* @return bool
210210
*/
211211
protected static function wp_block_editor_enabled() {
212+
// WP 5.0
212213
return ( function_exists( 'parse_blocks' ) || function_exists( 'gutenberg_parse_blocks' ) );
213214
}
214215

@@ -217,6 +218,7 @@ protected static function wp_block_editor_enabled() {
217218
* @return bool
218219
*/
219220
protected static function wp_has_blocks( $content ) {
221+
// WP 5.0
220222
if ( function_exists( 'has_blocks' ) ) {
221223
return has_blocks( $content );
222224
} elseif ( function_exists( 'gutenberg_has_blocks' ) ) {
@@ -231,6 +233,7 @@ protected static function wp_has_blocks( $content ) {
231233
* @return array<int, mixed>|null
232234
*/
233235
protected static function wp_parse_blocks( $content ) {
236+
// WP 5.0
234237
if ( function_exists( 'parse_blocks' ) ) {
235238
return parse_blocks( $content );
236239
} elseif ( function_exists( 'gutenberg_parse_blocks' ) ) {
@@ -244,6 +247,7 @@ protected static function wp_parse_blocks( $content ) {
244247
* @return array<int, string>|null
245248
*/
246249
protected static function wp_get_dynamic_block_names() {
250+
// WP 5.0
247251
if ( function_exists( 'get_dynamic_block_names' ) ) {
248252
return get_dynamic_block_names();
249253
}

collectors/environment.php

+2
Original file line numberDiff line numberDiff line change
@@ -187,10 +187,12 @@ public function process() {
187187
'WP_DEVELOPMENT_MODE' => self::format_bool_constant( 'WP_DEVELOPMENT_MODE' ),
188188
);
189189

190+
// WP 5.5
190191
if ( function_exists( 'wp_get_environment_type' ) ) {
191192
$this->data->wp['environment_type'] = wp_get_environment_type();
192193
}
193194

195+
// WP 6.3
194196
if ( function_exists( 'wp_get_development_mode' ) ) {
195197
$this->data->wp['development_mode'] = wp_get_development_mode();
196198
}

collectors/languages.php

+2-1
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,8 @@ public function tear_down() {
5151
*/
5252
public function collect_locale_data() {
5353
$this->data->locale = get_locale();
54-
$this->data->user_locale = function_exists( 'get_user_locale' ) ? get_user_locale() : get_locale();
54+
$this->data->user_locale = get_user_locale();
55+
// WP 5.0
5556
$this->data->determined_locale = function_exists( 'determine_locale' ) ? determine_locale() : get_locale();
5657
$this->data->language_attributes = get_language_attributes();
5758

collectors/theme.php

+3
Original file line numberDiff line numberDiff line change
@@ -543,13 +543,15 @@ public function process() {
543543
* @return bool
544544
*/
545545
protected static function wp_is_block_theme() {
546+
// WP 5.9
546547
return function_exists( 'wp_is_block_theme' ) && wp_is_block_theme();
547548
}
548549

549550
/**
550551
* @return array<string, string>
551552
*/
552553
protected static function wp_get_block_theme_folders() {
554+
// WP 5.9
553555
if ( ! function_exists( 'get_block_theme_folders' ) ) {
554556
return array(
555557
'wp_template' => 'templates',
@@ -567,6 +569,7 @@ protected static function wp_get_block_theme_folders() {
567569
* @return WP_Block_Template|null template A template object, or null if none could be found.
568570
*/
569571
protected static function wp_resolve_block_template( $template_type, $template_hierarchy, $fallback_template ) {
572+
// WP 5.8
570573
if ( ! function_exists( 'resolve_block_template' ) ) {
571574
return null;
572575
}

phpcs.xml.dist

+1-1
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@
6464

6565
<rule ref="WordPress.WP.DeprecatedFunctions">
6666
<properties>
67-
<property name="minimum_supported_version" value="5.6" />
67+
<property name="minimum_supported_version" value="5.7" />
6868
</properties>
6969
</rule>
7070

query-monitor.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
* Author URI: https://querymonitor.com/
1717
* Text Domain: query-monitor
1818
* Domain Path: /languages/
19-
* Requires at least: 5.6
19+
* Requires at least: 5.7
2020
* Requires PHP: 7.4
2121
* License URI: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html
2222
* License: GPL v2 or later

0 commit comments

Comments
 (0)