-
Notifications
You must be signed in to change notification settings - Fork 889
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Shut down the classes surface #19322
Comments
👋 ~2yrs ago we changed our plugin's rewrite slug from That caused issues for some of our users who were also using Yoast SEO, because Yoast SEO caches the permalinks in the database. That meant stories created prior to that change had outdated canonical URLs and the like. To solve that, we added a custom upgrade routine to our plugin for a one-time index rebuild of all stories with outdated rewrite slugs. For newer sites it's effectively a no-op. At the time, using the builder like this was the recommended approach. We also added some safeguards to see if the classes and functions we're using from Yoast SEO really exist. So if you would simply remove those from your code base, I think we should be safe. |
thanks @swissspidy !! But... if we deprecate the endpoint, you might get deprecation notices... Maybe you could consider just removing the code in a future version? :) |
Sure, yeah, we will look into that |
The code will be removed in our next release |
The
classes
part of theYoastSEO()
surface basically makes our entire code base public, something we don't think is maintainable, so we have to shut it down.I've been doing some analysis as to how people use that surface right now.
Current usage
1. Getting the repository
I've seen the Web Stories plugin, the Visual Composer plugin and aHrefs SEO all do this:
2. Getting the Indexable builder
The Web Stories plugin on top of that uses the builder, we should probably find out why ( @swissspidy, can you enlighten us? :) )
3. Shutting down Yoast SEO output
The Events Made Easy plugin and Expertfile plugin both do this:
4. Internal uses in Yoast SEO
We still use this surface in multiple places inside Yoast SEO because we don't do DI properly everywhere yet. We should fix that before deprecating.
Proposed solution
We should:
YoastSEO()->classes
inside the codebase with a new function marked private explicitly, fixes 4.classes
surface and remove all classes not listed above from what it returns so we don't create new problemsThe text was updated successfully, but these errors were encountered: