Skip to:
Content

BuddyPress.org

Opened 2 years ago

Closed 2 years ago

#8571 closed task (fixed)

Raise WordPress required version to 5.4

Reported by: imath's profile imath Owned by: imath's profile imath
Milestone: 10.0.0 Priority: normal
Severity: normal Version: 7.0.0
Component: Core Keywords: has-patch
Cc:

Description

It's been a while we haven't updated the WordPress required version. That's mainly because WordPress 5.9 is still used by more than 5% of users see: https://wordpress.org/about/stats/

But, WP 4.9.8 was released 3 years ago. Next WordPress version will be 5.9 and we'd support back to 10 WP versions.

I suggest to raise this required version to 5.4 as 5.0 to 5.3 are below 5%.

Attachments (4)

8571.patch (17.3 KB) - added by imath 2 years ago.
8571.2.patch (21.4 KB) - added by imath 2 years ago.
8571.3.patch (893 bytes) - added by imath 2 years ago.
8571.4.patch (196.5 KB) - added by imath 2 years ago.

Download all attachments as: .zip

Change History (19)

This ticket was mentioned in Slack in #buddypress by imath. View the logs.


2 years ago

This ticket was mentioned in Slack in #buddypress by imath. View the logs.


2 years ago

@imath
2 years ago

#3 @imath
2 years ago

  • Keywords has-patch dev-feedback added; 2nd-opinion needs-patch removed

8571.patch is raising WP required version to 5.4 and deprecates functions that are no more needed now we support up to 4.9. For instance, we don't need the bp.apiRequest function that were used as a wp.apiRequest polyfill.

It also adds the WP 5.4 to the WP version our PHPunit GitHub action is testing.

#4 @oztaser
2 years ago

Hi @imath,

Your patch looks good to me. I just want to mention, do we still need to check version before register block components?

https://github.com/buddypress/buddypress/blob/master/src/bp-core/bp-core-blocks.php#L34
https://github.com/buddypress/buddypress/blob/master/src/bp-core/bp-core-blocks.php#L21

#5 @imath
2 years ago

  • Keywords needs-patch added; has-patch removed

Thanks for your feedback @oztaser: good catch, you're totally right. I'll update the patch asap.

@imath
2 years ago

#6 @imath
2 years ago

  • Keywords has-patch added; dev-feedback needs-patch removed

8571.2.patch improves the first patch, removing no more needed WP version 5.0.0 checks. I still need to work on a last WP version 5.3.0 check as in 9.0.0 I've introduced a new rest component to be back compatible with 5.3.0 and lower versions. I'll do some tests about it from the BP Blocks plugin.

#7 @imath
2 years ago

In 13140:

Raise WordPress required version to 5.4

BuddyPress 10.0.0 will require at least WordPress 5.4. The BP Development team took this decision on October 6 (2021) according to our guideline about WordPress version compatibility.

  • Add WordPress 5.4 to the WordPress versions tested into our PHPUnit GitHub action.
  • Deprecate the bp.apiRequest script which was introduced to polyfill the wp.apiRequest one. Plugin developers are encouraged to directly use the wp.apiRequest script. Please note the bp.apiRequest script will be completely removed in a next major BuddyPress version.
  • Deprecate the bp_insert_site_hook() and bp_delete_site_hook() function which were introduced to make sure to use the best hook according to the installed WordPress version when creating a new site or deleting an existing one.

At least one more commit is required to finish this "raising" process, as BP Blocks do not need anymore the CompatibiltyServerSideRender component we introduced to preserve back compatibility with WordPress version older than 5.3.

Props oztaser

See #8571

#8 @imath
2 years ago

PHPUnit tests about WP 5.4 failed. See https://github.com/buddypress/buddypress/runs/4131848278.

I believe it is due to the fact we are using a too high version of the wp-phpunit/wp-phpunit composer package when running WP 5.4 tests.

@imath
2 years ago

#9 @imath
2 years ago

  • Keywords needs-patch added; has-patch removed

In 8571.3.patch I'm adding a new step "Adjust wp-phpunit version" to the GitHub action to use version 5.4 of wp-phpunit when the tested WordPress version is 5.4.

Let's see if this is fixing the PHPUnit issue.

#10 @imath
2 years ago

In 13141:

Use version 5.4 of wp-phpunit to test WordPress version 5.4

Edits the PHPUnit GitHub action to include a step to force the use of version 5.4 of wp-phpunit when the tested WordPress version is 5.4.

See #8571

#11 @imath
2 years ago

In 13142:

Update the composer.lock file

This step was missed in [13141]

See #8571

#12 @imath
2 years ago

In 13143:

Revert changes to composer.json & composer.lock files

See #8571

#13 @imath
2 years ago

I've just tested the last step of the process: removing the Compatibility ServerSideRender BP Component from the BP Blocks plugin. Everything looks fine from there, I'll add a patch here shortly.

@imath
2 years ago

#14 @imath
2 years ago

  • Keywords has-patch added; needs-patch removed

8571.4.patch includes the needed changes to remove the Compatibility ServerSideRender BP Component and directly use WordPress one.

#15 @imath
2 years ago

  • Owner set to imath
  • Resolution set to fixed
  • Status changed from new to closed

In 13144:

Remove the BP Compat ServerSideRender component & use WordPress one

As BuddyPress required WordPress version is now 5.4, this compatibility component which was introduced to maintain backward compatibility with WP version from 5.0 to 5.2 is no more needed.

Props oztaser

Fixes #8571

Note: See TracTickets for help on using tickets.