sybrew / the-seo-framework

The SEO Framework WordPress plugin.
https://theseoframework.com/
GNU General Public License v3.0
421 stars 47 forks source link

Too early apply_filters calls #635

Closed szepeviktor closed 1 year ago

szepeviktor commented 1 year ago

Describe the bug

apply_filters calls in bootstrap/define.php are executed before plugins_loaded thus almost always return their default values.

szepeviktor commented 1 year ago

A WordPress plugin should boot after plugins_loaded.

source

sybrew commented 1 year ago

Those filters can be written to by mu-plugins.

szepeviktor commented 1 year ago

Yes. But that is a not a plugin area.

Please consider moving them after plugins_loaded.

sybrew commented 1 year ago

I'll remove the filters in 5.0. There's no reason these constants must be filterable; the filters only cause overhead and code debt.

This affects constants:

And affects filters:

I may want to consider adding a "is defined" check, but filtering WordPress Core's option/user/term handlers is more suitable for end-users.