Skip to content

Commit

Permalink
Remove Jetpack loader conditionals for WP < 6.0 (#5919)
Browse files Browse the repository at this point in the history
* Remove Jetpack loader conditionals for WP < 6.0

* Fix tests
  • Loading branch information
rinatkhaziev authored Oct 11, 2024
1 parent 7508ea9 commit ad5b330
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 16 deletions.
8 changes: 1 addition & 7 deletions jetpack.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,7 @@
function vip_default_jetpack_version() {
global $wp_version;

if ( version_compare( $wp_version, '5.9', '<' ) ) {
// WordPress 5.8.x and older. Not including 5.9.
return '10.9';
} elseif ( version_compare( $wp_version, '6.0', '<' ) ) {
// WordPress 5.9.x
return '11.4';
} elseif ( version_compare( $wp_version, '6.1', '<' ) ) {
if ( version_compare( $wp_version, '6.1', '<' ) ) {
// WordPress 6.0.x
return '12.0';
} elseif ( version_compare( $wp_version, '6.2', '<' ) ) {
Expand Down
16 changes: 7 additions & 9 deletions tests/test-jetpack.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,13 @@ public function test__vip_default_jetpack_version() {

$versions_map = [
// WordPress version => Jetpack version
'5.8.6' => '10.9',
'5.9' => '11.4',
'5.9.5' => '11.4',
'6.0' => '12.0',
'6.1' => '12.5',
'6.2' => '12.8',
'6.3' => '13.1',
'6.4' => '13.6',
'6.5' => $latest,
'6.0' => '12.0',
'6.1' => '12.5',
'6.2' => '12.8',
'6.3' => '13.1',
'6.4' => '13.6',
'6.5' => $latest,
'6.6' => $latest,
];

foreach ( $versions_map as $wordpress_version => $jetpack_version ) {
Expand Down

0 comments on commit ad5b330

Please sign in to comment.