Skip to:
Content

Opened 9 months ago

Closed 5 months ago

Last modified 5 months ago

#7277 closed defect (bug) (fixed)

BP 2.8 - Prevent loading if PHP < 5.3

Reported by: r-a-y Owned by: boonebgorges
Milestone: 2.8 Priority: highest
Severity: blocker Version:
Component: Core Keywords: has-patch 2nd-opinion
Cc:

Description

Work was done in #7196 to prevent those on BP 2.7 to upgrade to BP 2.8 if PHP < 5.3.

However, if someone attempts to upgrade from < BP 2.7 to BP 2.8, we currently do not have any protection here.

We'll need to add something for BP 2.8.

See https://buddypress.trac.wordpress.org/ticket/7196#comment:25 and on for some suggestions.

Attachments (2)

7277.diff (48.8 KB) - added by boonebgorges 6 months ago.
Screenshot_2016-12-29_14-20-23.png (23.8 KB) - added by boonebgorges 6 months ago.

Download all attachments as: .zip

Change History (13)

#1 @DJPaul
9 months ago

  • Milestone changed from Under Consideration to 2.8

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


6 months ago

@boonebgorges
6 months ago

#3 @boonebgorges
6 months ago

  • Keywords has-patch 2nd-opinion added; needs-patch removed
  • Priority changed from high to highest
  • Severity changed from critical to blocker

7277.diff is a first pass. There's a lot of red and green because I moved the BuddyPress class to its own file. This independently seems like a good thing. It also allows us to keep bp-loader.php minimal, which makes it easier to ensure that it remains compatible with PHP 5.2 (or whatever WP's minimum version is in the future).

BP 2.8 should be able to drop all of the stuff introduced in #7196 - since you'll need to be running PHP 5.3 to run BuddyPress 2.8, BP 2.8 doesn't need to warn 5.2 sites about upgrading anymore :-D

Thoughts welcome - especially @DJPaul and @johnjamesjacoby

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


5 months ago

#5 @r-a-y
5 months ago

I like the separation of the BuddyPress class into its own file.

A few minor things:

  • We should show the notice in the network admin as well with the 'network_admin_notices' hook.
  • Should we should show the notice on every admin page?

#6 @boonebgorges
5 months ago

  • Owner set to boonebgorges
  • Status changed from new to assigned

Thanks, @r-a-y!

Good call about 'network_admin_notices'. I'll make the change.

I think we can show the notice on every admin page. It's annoying, but it's also critical.

I'm going to go ahead with the change so we can be sure to get testing during the beta period.

#7 @boonebgorges
5 months ago

In 11389:

Prevent BuddyPress from loading when the minimum PHP version is not met.

When the server is running a version of PHP lower than 5.3.0, an
admin notice is thrown, and the rest of BuddyPress is not loaded.

The bp-loader.php file must remain compatible with WP's minimum PHP
version, to prevent fatal errors when activating BuddyPress. In order
to reduce the cognitive overhead involved in maintaining PHP compat
for this file, the BuddyPress class has been moved into its own
class-buddypress.php file.

Props r-a-y.
See #7277.

#8 @boonebgorges
5 months ago

Looking over the stuff introduced in #7196, we probably should've chosen better function names. Much of this stuff will be reusable in similar ways next time we bump our minimum PHP requirements, assuming that WP's plugin UI doesn't change too much.

For the time being, I'm going to deprecate all of these functions. If we need them again in the future, we can build version-agnostic versions.

#9 @boonebgorges
5 months ago

  • Resolution set to fixed
  • Status changed from assigned to closed

In 11390:

Deprecate 2.7 functions protect against BP upgrades on PHP 5.2.x.

BuddyPress 2.8 will not load on systems running PHP 5.2.x, so that
these functions will do nothing. In the future, their logic can be
repurposed for further PHP requirement upgrades.

Fixes #7277.

#10 @boonebgorges
5 months ago

I've marked this as fixed, but please feel free to reopen if we find bugs during beta.

#11 @boonebgorges
5 months ago

In 11394:

Fix sentence that are not grammatical in PHP minimum notice.

Introduced in [11389].

Props dcavins.
See #7277.

Note: See TracTickets for help on using tickets.