Open xsynaptic opened 7 years ago
Hi,
It is not recommended to bundle a plugin directly with a theme. Doing this means that it won't be updatable via the WordPress admin should any important updates become available, such as security fixes.
One method which many themes now use is to provide prompts to install and activate required plugins when a theme is activate which requires certain plugins. The TGM Plugin Activation PHP library can help with this.
See: https://make.wordpress.org/themes/handbook/review/required/#plugins http://tgmpluginactivation.com https://wordimpress.com/how-to-easily-require-plugins-for-your-wordpress-themes/
I will consider making the plugin less dependent on being in the plugins folder, perhaps via a filter, but I would advise against this for the reasons above.
I encountered a minor issue while directly integrating this plugin into a theme using Composer + WPackagist: admin-side resources (CSS/images) don't load properly, something I traced back to the
taxonomy_image_plugin_url
function. It turns out the coreplugin_dir_path
function returns a malformed URL (absolute URL + relative path) when the file calling it isn't in the WP plugins folder. An easy fix would be to add a filter to thetaxonomy_image_plugin_url
function... but for the time being, and in case anyone else encounters the issue, this little workaround seems to do the trick: