[buddypress-trac] [BuddyPress Trac] #9210: Review the way we load 12.0.0 deprecated code

buddypress-trac noreply at wordpress.org
Mon Jul 29 01:12:37 UTC 2024


#9210: Review the way we load 12.0.0 deprecated code
---------------------------------------------------+---------------------
 Reporter:  imath                                  |       Owner:  (none)
     Type:  defect (bug)                           |      Status:  new
 Priority:  normal                                 |   Milestone:  14.1.0
Component:  Core                                   |     Version:  14.0.0
 Severity:  normal                                 |  Resolution:
 Keywords:  has-patch has-unit-tests dev-feedback  |
---------------------------------------------------+---------------------
Changes (by emaralive):

 * cc: emaralive (added)


Comment:

 @imath,

 I offer the opposite thought, we should continue to include/load 12.0
 deprecated code based on the fact that when I search the plugin directory
 for plugins that should be relevant to **!BuddyPress** ({{{site.url/wp-
 admin/plugin-install.php}}}) the result is approximately 30 pages with,
 let's say, 36 plugins per page begets a number of 1,088 potential plugins.
 The question, to me, is: How many plugins use functions that were
 deprecated with 12.0 that would cause fatal errors, if 12.0 deprecated
 code were not included/loaded?

 Since the number of potential plugins is quite large, a smaller arbitrary
 sampling netted the following results (it's all I had time to process, at
 the moment):

 === [https://wordpress.org/plugins/bp-toolkit/ Block, Suspend, Report for
 BuddyPress]
 Steps to reproduce:
 1. Activate plugin
 2. Switch/login to a non-administrator account, e.g., subscriber
 3. Visit another user's profile area who is also a non-administrator
 account, e.g., subscriber
 {{{
 Fatal error: Uncaught Error: Call to undefined function
 bp_core_get_user_domain() in /wp-content/plugins/bp-toolkit/includes
 /class-bp-toolkit-report.php:189

 Stack Trace
 1.
 BPTK_Report->add_profile_report_button()
 /wp-includes/class-wp-hook.php:324
 2.
 WP_Hook->apply_filters()
 /wp-includes/class-wp-hook.php:348
 3.
 WP_Hook->do_action()
 /wp-includes/plugin.php:517
 4.
 do_action()
 /wp-content/plugins/buddypress/bp-templates/bp-nouveau/includes/members
 /template-tags.php:148
 5.
 bp_nouveau_member_header_buttons()
 /wp-content/plugins/buddypress/bp-templates/bp-
 nouveau/buddypress/members/single/cover-image-header.php:28
 6.
 require_once('/var/www/html/z...')
 /wp-includes/template.php:810
 7.
 load_template()
 /wp-content/plugins/buddypress/bp-templates/bp-
 nouveau/includes/members/functions.php:341
 8.
 /wp-content/plugins/buddypress/bp-templates/bp-nouveau in /wp-
 content/plugins/bp-toolkit/includes/class-bp-toolkit-report.php on line
 189
 }}}
 [[br]]
 === [https://wordpress.org/plugins/buddypress-simple-events/ BuddyPress
 Simple Events]
 Steps to reproduce:
 1. Activate plugin
 2. As adminstrator visit {{{site.url/wp-admin/options-general.php?page=bp-
 simple-events}}}
 3. Select a non-administrator user role that coincides with an active user
 with same assigned user role, e.g., subscriber, and then "Save Roles"
 4. As administrator or user that has a user role selected in step 3, visit
 a user's profile area, e.g., administrator, or role from step 3
 5. Click on "Events" menu item
 {{{
 Fatal error: Uncaught Error: Call to undefined function
 bp_core_get_user_domain() in /wp-content/plugins/buddypress-simple-
 events/templates/members/single/profile-events-loop.php:33

 Stack Trace
 1.
 require()
 /wp-includes/template.php:812
 2.
 load_template()
 /wp-content/plugins/buddypress/bp-core/bp-core-template-loader.php:225
 3.
 bp_locate_template()
 /wp-content/plugins/buddypress/bp-core/bp-core-template-loader.php:67
 4.
 bp_get_template_part()
 /wp-content/plugins/buddypress-simple-events/inc/pp-events-screens.php:15
 5.
 pp_events_profile_screen()
 /wp-includes/class-wp-hook.php:324
 6.
 WP_Hook->apply_filters()
 /wp-includes/class-wp-hook.php:348
 7.
 WP_Hook->do_action()
 /wp-includes/plugin.php:517
 8.
 do_action()
 /wp-content/plugins/buddypress/bp-templates/bp-nouveau/includes/template-
 tags.php:36
 9.
 /wp-content/plugins/buddyp in /wp-content/plugins/buddypress-simple-
 events/templates/members/single/profile-events-loop.php on line 33
 }}}
 [[br]]
 === [https://wordpress.org/plugins/bbpress/ bbPress]
 Steps to reproduce:
 1. Activate plugin - default settings will suffice
 2. If no groups are created, enable groups component, create a group and
 enable forums for group.
 3. Visit {{{site.url//wp-admin/edit.php?post_type=forum}}}, you should
 notice text that indicates a critical error has occurred where the Group
 description should be.
 4. Clicking the group link will also provide proof that a critical error
 has occurred.
 {{{
 Fatal error: Uncaught Error: Call to undefined function
 bp_get_group_permalink() in /wp-
 content/plugins/bbpress/includes/extend/buddypress/groups.php:1499

 Stack Trace
 1.
 BBP_Forums_Group_Extension->maybe_map_permalink_to_group()
 /wp-content/plugins/bbpress/includes/extend/buddypress/groups.php:1603
 2.
 BBP_Forums_Group_Extension->post_type_link()
 /wp-includes/class-wp-hook.php:326
 3.
 WP_Hook->apply_filters()
 /wp-includes/plugin.php:205
 4.
 apply_filters()
 /wp-includes/link-template.php:375
 5.
 get_post_permalink()
 /wp-includes/link-template.php:201
 6.
 get_permalink()
 /wp-admin/includes/class-wp-posts-list-table.php:1548
 7.
 WP_Posts_List_Table->handle_row_actions()
 /wp-admin/includes/class-wp-posts-list-table.php:1073
 8.
 WP_Posts_List_Table->_column_title()
 /wp-admin/includes/class-wp-list-table.php:1793
 9.
 /wp-admin/inclu in /wp-
 content/plugins/bbpress/includes/extend/buddypress/groups.php on line 1499
 }}}
 [[br]]
 As noted previously, this is just a small sample that would not be
 considered statistically significant, but they do indicate that exclusion
 of 12.0 deprecated code would have undesirable consequences. So, let's do
 this; have this as a discussion topic (agenda item) for the upcoming dev-
 chat that should occur on July 31, 2024. In the meantime, given that I
 have time, I believe it would be pertinent to generate a list of plugins
 from the potential 1088 that would cause grief to end users due to the
 exclusion of 12.0 deprecated code (IOW, extend the list of 3, if there are
 others and improve upon the "**steps to reproduce**"). Thoughts?

 Furthermore, I haven't had a chance to look at the PR, in depth, so I'll
 try to do so during this upcoming week (week 31 of 2024).

-- 
Ticket URL: <https://buddypress.trac.wordpress.org/ticket/9210#comment:7>
BuddyPress Trac <http://buddypress.org/>
BuddyPress Trac


More information about the buddypress-trac mailing list