[wp-trac] [WordPress Trac] #32470: Abstracting the Widget Classes
WordPress Trac
noreply at wordpress.org
Fri Jun 12 07:39:12 UTC 2015
#32470: Abstracting the Widget Classes
------------------------------------+------------------------------
Reporter: welcher | Owner:
Type: enhancement | Status: new
Priority: normal | Milestone: Awaiting Review
Component: Widgets | Version:
Severity: normal | Resolution:
Keywords: dev-feedback has-patch | Focuses:
------------------------------------+------------------------------
Comment (by Frank Klein):
The proposed patch by @jacobsantos seems interesting, but it also is a lot
of code movement. This means that it probably won't make it into a release
very fast, as a lot of testing would have to be done.
Also when working on new abstractions, we need to keep in mind which
classes and methods are currently public. We would need to ensure that
some form of backwards compatibility is maintained, because currently
nothing keeps developers from directly accessing this code in their
projects.
In the meantime, I think we could have tangible benefits by doing smaller
changes, like for example:
- Making `WP_Widget` an abstract class.
- Marking the methods that need to be overriden as `abstract`.
- Marking functions that should not be overriden as `final`.
- Marking private functions as `private`.
Like that we could progress while working on a larger refactoring.
Why not keep this ticket around for the larger overall planning, and have
a ticket with a smaller scope to go along with #23012, focussing on
improvements to `WP_Widgets` and `WP_Widget_Factory` that can be done
right now.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/32470#comment:27>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list