Skip to:
Content

BuddyPress.org

Opened 5 years ago

Closed 4 years ago

#6191 closed enhancement (fixed)

Akismet integration using deprecated functions

Reported by: r-a-y Owned by: r-a-y
Milestone: 2.3 Priority: normal
Severity: normal Version:
Component: Activity Keywords: has-patch commit
Cc: chris@…

Description

The following notices are popping up when using the latest version of Akismet with the BP activity component:

  • akismet_get_user_roles is deprecated since version 3.0! Use Akismet::get_user_roles()
  • akismet_test_mode is deprecated since version 3.0! Use Akismet::is_test_mode() instead.
  • akismet_http_post is deprecated since version 3.0! Use Akismet::http_post() instead.
  • akismet_microtime is deprecated since version 3.0! Use Akismet::_get_microtime() instead.

I've attached a patch to fix this. Do you think anyone is running Akismet less than v3.0?

For reference:

  • Akismet 3.0 was released back on April 15th, 2014. WordPress 3.9 and BuddyPress 2.0 was released the day after.
  • We support down to WordPress 3.6, which was released back on August 1st, 2013. Akismet 2.5.9 was released on the same day.

Attachments (2)

6191.02.patch (2.7 KB) - added by r-a-y 5 years ago.
6191.03.patch (4.9 KB) - added by r-a-y 4 years ago.

Download all attachments as: .zip

Change History (16)

#1 @johnjamesjacoby
5 years ago

I am sure many people are using out of date versions of both Akismet and BuddyPress. We should probably make sure we have both scenarios covered.

#2 @boonebgorges
5 years ago

Deeply, deeply annoying :( But johnjamesjacoby is right - we'll have to do method_exists() checks.

@r-a-y
5 years ago

#3 @r-a-y
5 years ago

02.patch uses a wrapper method to do all the appropriate switching.

#4 @johnjamesjacoby
5 years ago

Interesting approach. It's nauseating, but only if you look at it.

Works for me.

#5 @DJPaul
5 years ago

We support out-of-date versions of WordPress, but I don't understand why we should support out-of-date versions of Akismet. I think we should just update BuddyPress to use the current/non-deprecated functions, and call it a day.

This "fix" would only be received by upgrading their BuddyPress, and if they're upgrading BuddyPress, then it's probably the sort of person who would keep Akismet up to date, too.

#6 follow-up: @boonebgorges
5 years ago

We support out-of-date versions of WordPress, but I don't understand why we should support out-of-date versions of Akismet. I think we should just update BuddyPress to use the current/non-deprecated functions, and call it a day.

I'm assuming that the non-deprecated versions do not exist in older versions of Akismet, which means that anyone with the old version will get a fatal error. In principle, I agree with DJPaul that we shouldn't bend over backward to support old versions of stuff like Akismet. However, causing fatal errors on BP upgrade - especially when we have no failsafe or even documentation in place to warn against the problem - seems unacceptable. On balance, I think it's better to add a bit of baroqueness to BP.

It would be good to have more concrete rules about this going forward, though. There are very few plugins that we interact directly with in BP core, and it should be possible to come up with general rules for version support. (Akismet may actually be the only one - bbPress compatibility comes completely from bbPress.)

#7 in reply to: ↑ 6 @johnjamesjacoby
5 years ago

Replying to boonebgorges:

We support out-of-date versions of WordPress, but I don't understand why we should support out-of-date versions of Akismet. I think we should just update BuddyPress to use the current/non-deprecated functions, and call it a day.

Agree.

I'm assuming that the non-deprecated versions do not exist in older versions of Akismet, which means that anyone with the old version will get a fatal error. In principle, I agree with DJPaul that we shouldn't bend over backward to support old versions of stuff like Akismet. However, causing fatal errors on BP upgrade - especially when we have no failsafe or even documentation in place to warn against the problem - seems unacceptable. On balance, I think it's better to add a bit of baroqueness to BP.

Agree.

It would be good to have more concrete rules about this going forward, though. There are very few plugins that we interact directly with in BP core, and it should be possible to come up with general rules for version support. (Akismet may actually be the only one - bbPress compatibility comes completely from bbPress.)

Correct, and agree. I created a stub codex page to help with the educational side of this, should there be any questions. Please feel free to move or modify this page at will: https://codex.buddypress.org/releases/version-1-7/akismet/

#8 @DJPaul
5 years ago

  • Milestone changed from Awaiting Review to 2.3

#9 @r-a-y
4 years ago

There are very few plugins that we interact directly with in BP core, and it should be possible to come up with general rules for version support. (Akismet may actually be the only one - bbPress compatibility comes completely from bbPress.)

We also clear the cache for WP Super Cache (see bp_core_clear_cache()), although it would probably make sense to remove it.


So what is the consensus for this ticket? Do we want to support older versions of Akismet < 3.0?

Or do we want to do something after we've discussed bumping the minimum version for WP (#6258)?

#10 @boonebgorges
4 years ago

At this point, 3.0+ has been out long enough that I'm fine with not supporting it. But we should avoid fatal errors by bailing out of our Akismet integration if a lower version is detected.

#11 @cfinke
4 years ago

  • Cc chris@… added

Deprecating those functions was the wrong move on our (Akismet's) part; they were un-deprecated in 3.1.

Any function that doesn't throw a deprecation notice in 3.1 should be safe to use for a long time.

@r-a-y
4 years ago

#12 @r-a-y
4 years ago

I just added a patch to support only Akismet 3+ before I saw cfinke's comment :)

Do we still want to do anything?

#13 @boonebgorges
4 years ago

  • Keywords commit added

I'm OK with 6191.03.patch, even with cfinke's "long time" promise in mind. Anyone updating BP is also updating Akismet, I'd think, so silently dropping older versions in BP 2.3 is going to affect next to no one.

#14 @r-a-y
4 years ago

  • Owner set to r-a-y
  • Resolution set to fixed
  • Status changed from new to closed

In 9843:

Activity: Support only Akismet v3+.

For those using Akismet v3.0.x, notices started appearing due to Akismet
deprecating some older functions that were in use by the BP Activity
Akismet module.

Since Akismet 2.6.0 was released more than a year ago, we are upgrading
all calls in the BP Activity Akismet module to the new Akismet API. For
BuddyPress 2.3+, the BP Activity Akismet module will require at least
Akismet v3+.

Fixes #6191.

Note: See TracTickets for help on using tickets.