tinify / wordpress-plugin

Speed up your WordPress website. Optimize your JPEG and PNG images automatically with TinyPNG.
GNU General Public License v2.0
88 stars 36 forks source link

[Feature request] Add WP CLI commands #22

Open mklepaczewski opened 3 years ago

mklepaczewski commented 3 years ago

Sometimes it's just easier to do things from CLI. Please consider adding WP CLI commands to:

If the feature is accepted, I'll submit PR (I need to clean up my code before I do it, so I don't want to invest time into something that might be rejected).

mattijsvandruenen commented 3 years ago

Hi Matt,

Similarly to https://github.com/tinify/wordpress-plugin/issues/21, I think it's fine to provide easier to use options to compress images from code outside of the plugin (ie. via the CLI tool).

I'm not exactly sure what the use cases are of compressing individual image sizes though. In the case that you add a new image size to be compressed, it's much more efficient to use the bulk compression tool to process all your existing images. It also makes the change required quite a bit larger than just offering an easy way to compress all configured image sizes of one image. In any case, feel free to submit a PR. We'd welcome anything that improves the code base!

knofte commented 2 years ago

I'm +1 to having a wp-cli command available as it's the first thing tried when having issues with bulk optimiser or wanting to optimise one specific image.