kirby-seo
kirby-seo copied to clipboard
Split Schema.org feature set in plugin addon
My client website size is 50mb and 33mb (1.867 Files) of it is the SEO plugin 🙂. 99% of this is due to spatie/schema-org dependency. Just thinking out loud. How does another light/lite version without schema (or lightweight schema library) sound to you?
Too much effort to maintain two separate versions of this plugin
Thanks. Can I create/fork lite version of your plugin?
Sure
Is there a thing such as peer dependencies in PHP? Could we eventually realize this by omitting the dependency from the plugin, and only having the feature availalbe if the user has installed the package themselves?
Make sense. I think it can be enabled by making a secondary plugin and checking option (tobimori.seo.schema => true) or existing class.
I ask because I don't know very well: Is schema a very used feature in terms of SEO? If so, it doesn't make sense to separate it? If it is a little or rarely used feature, separating it may be more beneficial in terms of performance.
I guess most websites don't use it. There are things where it make sense so having it as a different plugin is totally valid.
I second this - especially if there is no GUI/snippet for a panel to set the specific schema for each site manually, I think in 99.999% of the cases the default will apply.
IHMO it makes sense to keep the top 10-15 schema classes in the package and outsource the rest to a different plugin, if needed.
Unfortunately it's not really possible to keep only a part of the schema classes since they're automatically generated. I'd have to maintain a separate version, which would be a lot of work that's not worth it for me. Code size is a veryyy minimal benefit.
A panel UI is not included since IMO it's too complicated to make it feature-complete and/or accessible to editors as well.
My Composer knowledge is very basic but would it be an idea to make the schema dependency optional by moving it from require to suggest and ignoring the Spatie package in the vendor folder in Git? This would require two changes:
- Functions relying on the schema package would have to check for its availabililty first.
- Users in need of the schema stuff would have to take the additional step of installing the optional requirements.
This would reduce the plugins' footprint by almost 40 MB.