[wp-trac] [WordPress Trac] #33413: most PHP classes should be in their own file

WordPress Trac noreply at wordpress.org
Tue Sep 8 23:28:15 UTC 2015


#33413: most PHP classes should be in their own file
----------------------------+-----------------------------
 Reporter:  wonderboymusic  |       Owner:  wonderboymusic
     Type:  enhancement     |      Status:  assigned
 Priority:  normal          |   Milestone:  4.4
Component:  General         |     Version:  trunk
 Severity:  normal          |  Resolution:
 Keywords:  dev-feedback    |     Focuses:
----------------------------+-----------------------------

Comment (by wonderboymusic):

 [attachment:33413.3.diff 33413.3.diff] handles the Customizer, and I
 promised @westonruter that I would do a breakdown before moving forward.
 Follows the same tenets/principles as above. Makes the code a LOT easier
 to understand. Existing files are way too huge.

 Highlights:

 * Moves classes to `wp-includes/customize/`
 * `_wp_customize_include()` now loads `wp-includes/customize-
 functions.php` and `wp-includes/customize/class-wp-customize-manager.php`
 - I found no use cases of these files being loaded by plugins:
 https://github.com/search?utf8=%E2%9C%93&q=user%3Awp-plugins+class-wp-
 customize&type=Code&ref=searchresults .... compared to:
 https://github.com/search?utf8=%E2%9C%93&q=user%3Awp-plugins+class-
 http&type=Code&ref=searchresults
 * `WP_Customize_Manager::__construct()` loads `wp-includes/customize.php`,
 which is a manifest that loads all of the files in `wp-
 includes/customize/*` - this could probably change to not have to do this.
 The file should just load in `theme.php`. In the past, it looked like the
 `__construct()` was just loading a few classes, but each of those files
 was loading in aggregate 3 dozen classes.

 Screenshot above shows new files.

--
Ticket URL: <https://core.trac.wordpress.org/ticket/33413#comment:57>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list