[wp-trac] [WordPress Trac] #37677: Introduce WP_Plugin class analogous to WP_Theme

WordPress Trac noreply at wordpress.org
Tue Aug 16 15:51:02 UTC 2016


#37677: Introduce WP_Plugin class analogous to WP_Theme
--------------------------+-----------------------------
 Reporter:  swissspidy    |      Owner:
     Type:  defect (bug)  |     Status:  new
 Priority:  normal        |  Milestone:  Awaiting Review
Component:  Plugins       |    Version:
 Severity:  normal        |   Keywords:
  Focuses:                |
--------------------------+-----------------------------
 Background:

 This ticket emerged from #37656.

 A `WP_Plugin` class has been previously mentioned in #22256 and brought up
 with a patch in #21883, but only in regards of hooks and filters (i.e.
 `$GLOBALS['wp_global_hooks'] = new WP_Plugin();`. With #17817 in
 contention, that approach would need some more tweaking. Also, the class
 name isn't ideal too because of `WP_Theme`. Using `WP_Plugin` for hooks
 but themes can use hooks too? Confusing.

 Proposal:

 Introducing a new `WP_Plugin` class that does similar things as the
 already existing `WP_Theme` class but for plugins.

 This would mainly mean handling caching, retrieving data from plugin file
 headers and adding any needed helper methods. As a result, we're less
 prone to errors since we can use 1 reliable API instead of
 `get_plugin_data()`, `get_plugins()`, etc.

--
Ticket URL: <https://core.trac.wordpress.org/ticket/37677>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list