[wp-trac] [WordPress Trac] #60414: Core PHP autoloader proposal
WordPress Trac
noreply at wordpress.org
Fri Sep 13 00:55:32 UTC 2024
#60414: Core PHP autoloader proposal
-------------------------------------+-------------------------------------
Reporter: aristath | Owner: (none)
Type: enhancement | Status: new
Priority: normal | Milestone: Future Release
Component: General | Version:
Severity: normal | Resolution:
Keywords: has-patch has-unit- | Focuses: performance,
tests early | sustainability
-------------------------------------+-------------------------------------
Comment (by peterwilsoncc):
> But is it beneficial to the majority of users?
>
> These are the questions to answer IMO.
Coming back to @hellofromTonya's question, I've been considering where
this could be beneficial beyond developers:
1. Performance: if it is shown that the performance of the front-end of a
site improves with an autoloader then it becomes a benefit for all users.
2. Increased likelihood of catching bugs in Gutenberg and other feature
plugins.
While the Core (and, I imagine, theme and plugin teams) wouldn't want
developers overridding core classes, it could prove beneficial for
features developed via a plugin.
In Gutenberg and other feature plugins, core classes are often extended
and essentially replaced during the development process. For example
[https://github.com/WordPress/gutenberg/blob/a89527495af5969b7a5670e6814a06682543ae14/lib/compat/wordpress-6.6
/class-gutenberg-rest-templates-controller-6-6.php
Gutenberg_REST_Templates_Controller_6_6 extends
WP_REST_Templates_Controller] and subsequently replaces the endpoint.
This often complicates the merge process and increases the risk that a bug
will be introduced during that process or an order of operations issue is
discovered post merge.
If feature plugins can override the core classes, then I think it's a
benefit to users when it comes to the stability of code eventually merged
in to WordPress-Develop.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/60414#comment:46>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list