[buddypress-trac] [BuddyPress Trac] #9181: Improve check for BP Classic Plugin

buddypress-trac noreply at wordpress.org
Wed Jun 12 17:08:37 UTC 2024


#9181: Improve check for BP Classic Plugin
--------------------------+-----------------------------
 Reporter:  samedwards    |      Owner:  (none)
     Type:  defect (bug)  |     Status:  new
 Priority:  normal        |  Milestone:  Awaiting Review
Component:  Core          |    Version:  12.5.1
 Severity:  normal        |   Keywords:
--------------------------+-----------------------------
 Right now, checks for the BP classic plugin are done with a
 `function_exists( 'bp_classic' )` conditional, which is checking for the
 existence of this function as defined in the BP Classic plugin. This
 relies on the alphabetical ordering of the `active_plugins` array (and of
 course the sorting of `bp-classic` before `buddypress`).

 I ran across a situation where I was enabling the BP Classic plugin via a
 [https://github.com/PrimeTimeCode/wp-plugin-activation-manifest plugin
 manifest], which did not cause the `active_plugins` array to be sorted,
 and thus I got redefined function errors when BP Classic loaded after
 Buddypress.

 A check to `is_plugin_active()` has the downside of requiring the BP
 Classic plugin to be installed in the correctly named folder, which is
 also not always a given, but I would suggest that the gating conditional
 being changed to `function_exists() || is_plugin_active()` should cover
 more possible circumstances.

-- 
Ticket URL: <https://buddypress.trac.wordpress.org/ticket/9181>
BuddyPress Trac <http://buddypress.org/>
BuddyPress Trac


More information about the buddypress-trac mailing list