Automattic / studio

Studio by WordPress.com, a free desktop app that helps developers streamline their local WordPress development workflow.
https://developer.wordpress.com/studio/
GNU General Public License v2.0
193 stars 18 forks source link

Consider importing mu-plugins directories #500

Open danielbachhuber opened 2 months ago

danielbachhuber commented 2 months ago

We currently ignore mu-plugins directories in our import workflow. We should consider properly importing them.

wojtekn commented 2 months ago

From https://developer.wordpress.org/advanced-administration/plugins/mu-plugins/:

[...] For web hosts, mu-plugins are commonly used to add support for host-specific features, especially those where their absence could break the site.

It makes sense to treat those as host-specific features. Studio puts different polyfills there, and any host or local app could do the same.

@danielbachhuber how this addition would help you?

danielbachhuber commented 2 months ago

@wojtekn I'm not sure I agree with that description. I think mu-plugins can often be use for site-specific code.

wojtekn commented 1 month ago

@danielbachhuber Now Playground supports loading polyfill my-plugins from Playground-specific directory (/internal/shared/mu-plugins), so they won't clutter WordPress WP Admin: https://github.com/WordPress/wordpress-playground/blob/b81c81d9636989acfcbb7102e618ee840072b958/packages/playground/wordpress/src/index.ts#L17

We could move our polyfills there and support importing and exporting the default mu-plugins/ directory. Users who don't want them can always delete them manually after the import.

danielbachhuber commented 1 month ago

@wojtekn Nice!