#5108 closed defect (bug) (fixed)
PHP 5.4+ strict standards warnings
Reported by: | boonebgorges | Owned by: | |
---|---|---|---|
Milestone: | 1.9 | Priority: | normal |
Severity: | normal | Version: | |
Component: | Core | Keywords: | |
Cc: | slava.abakumov@… |
Description
In [WP24288], WP_DEBUG was changed so that it always shows E_STRICT
warnings. This has uncovered a number of strict standards violations in BP. Let's fix them for 1.9.
See also r7277
Change History (21)
#4
@
11 years ago
The biggest remaining offender in BP has to do with our invoking methods statically without using the static
keyword. There's an existing ticket for this issue in #3886. Before a sweep can be done, I would like to have some testing to make sure that adding the keyword doesn't break cases where BP or other plugins are calling the methods *non*-statically.
#5
@
11 years ago
- Cc slava.abakumov@… added
We don't need them, but it's possible that existing plugins are calling BP_Groups_Widget::bp_groups_widget()
I didn't see such direct calling, but ok, perhaps someone does this...
Backward compatibility is the WordPress way.
Even when users are suffering because more server resources needed to handle exact the same amount of traffic? Lets write even more unused code.
Perhaps we should make even the very first unupdated for years plugins work properly on the latest WP version? Everything should have its end.
WordPress defined minimum requirements. It won't work on earlier PHP versions. So in this case one individual plugin's working or not working state is nothing - the whole engine will produce errors.
So, supporting BuddyPress-dependent plugins that relies on BuddyPress that relies on WordPress that relies on PHP 5.2.4. I don't see the logic to support PHP 4 for those plugins.
I absolutely understand your position and can even understand Automattic position (hey, I'm a developer too!), but I strongly disagree that developers should write legacy code that *might* be used by some developers. Old plugins will anyway break, because of lots of other things, but new one will 100% use the right logic and way to init that same BP_Groups_Widget
class.
P.S. And I do not want offend you or whatever negative feeling you might get after my words, I do appreciate your work and code. Sorry if in some words I was not very polite. I just disagree with some particular things.
#12
follow-up:
↓ 13
@
11 years ago
And you are using this: buddypress()->activity
This will break in PHP 4, so this http://buddypress.trac.wordpress.org/changeset/7290 just doesn't make any sense.
#13
in reply to:
↑ 12
@
11 years ago
Replying to slaFFik:
And you are using this:
buddypress()->activity
This will break in PHP 4, so this http://buddypress.trac.wordpress.org/changeset/7290 just doesn't make any sense.
Again, we are *not* trying to maintain compatibility with PHP 4. Instead, we are trying to ensure compatibility with existing plugins by not removing existing methods that may be called explicitly. This has nothing to do with PHP versions. (It's true that, in the case of a class constructor, what I'm talking about is an edge case, because few people call them explicitly. But it does happen, and I remember BP plugins breaking for this reason before.)
#17
@
11 years ago
Groups directory, non-admin user:
PHP Strict standards: Non-static method BP_Groups_Member::check_is_banned() should not be called statically in /plugins/buddypress/bp-groups/bp-groups-functions.php on line 572
In 7288: