kirby-seo icon indicating copy to clipboard operation
kirby-seo copied to clipboard

Split Schema.org feature set in plugin addon

Open afbora opened this issue 2 years ago • 10 comments
trafficstars

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?

afbora avatar Oct 26 '23 18:10 afbora

Too much effort to maintain two separate versions of this plugin

tobimori avatar Oct 26 '23 18:10 tobimori

Thanks. Can I create/fork lite version of your plugin?

afbora avatar Oct 26 '23 19:10 afbora

Sure

tobimori avatar Oct 26 '23 19:10 tobimori

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?

tobimori avatar Oct 26 '23 19:10 tobimori

Make sense. I think it can be enabled by making a secondary plugin and checking option (tobimori.seo.schema => true) or existing class.

afbora avatar Oct 26 '23 19:10 afbora

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.

afbora avatar Oct 26 '23 19:10 afbora

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.

tobimori avatar Oct 26 '23 19:10 tobimori

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.

andreasba avatar Mar 17 '24 13:03 andreasba

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.

tobimori avatar Mar 17 '24 13:03 tobimori

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:

  1. Functions relying on the schema package would have to check for its availabililty first.
  2. 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.

nilshoerrmann avatar Aug 19 '24 08:08 nilshoerrmann