Yoast / wordpress-seo

Yoast SEO for WordPress
https://yoast.com/wordpress/plugins/seo/
Other
1.75k stars 885 forks source link

global $typenow; causes Yoast SEO to die #5926

Closed tacoverdo closed 7 years ago

tacoverdo commented 7 years ago

Reported by @ipstenu on twitter:

Well THAT is weird… If I have this in a plugin file, Yoast SEO dies - global $typenow;

Please investigate and resolve if necessary.

Ipstenu commented 7 years ago

To clarify, since I learned more, if I have it in a file outside of a function, this plugin dies.

As soon as I moved it to admin_init, things got better, but I also properly restricted the mu-plugin to only post editing pages.

Ipstenu commented 7 years ago

You can probably close this.

https://halfelf.org/2016/yoast-seo-selective-stopwords/ details my initial fix and the current one is mostly like that.

Moving everything to a function called on admin_init solved all the issues - https://gitlist.lezwatchtv.com/lwtv-plugin.git/blob/master/plugins/yoast-seo.php is the current code.

Pretty sure it's actually a WP issue :)

atimmer commented 7 years ago

Thank you for the investigation 👍🏻