You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[](https://typist.tech/donate/image-optimize-command/)
-[Restoring the originals](#restoring-the-originals)
29
-
-[Migrating from image-optimize-command v0.1.x](#migrating-from-image-optimize-command-v01x)
30
-
-[FAQs](#faqs)
31
-
-[What kind of optimization it does?](#what-kind-of-optimization-it-does)
32
-
-[How to customize the optimization?](#how-to-customize-the-optimization)
33
-
-[How to skip backups / restorations?](#how-to-skip-backups--restorations)
34
-
-[Does running `wp image-optimize attachment / batch` multiple times trigger multiple optimization for the same attachments?](#does-running-wp-image-optimize-attachment--batch-multiple-times-trigger-multiple-optimization-for-the-same-attachments)
35
-
-[Will the images look different after optimization?](#will-the-images-look-different-after-optimization)
36
-
-[Why my GIFs stopped animating?](#why-my-gifs-stopped-animating)
37
-
-[Can I use this on managed hosting?](#can-i-use-this-on-managed-hosting)
38
-
-[Do I have to install `SVGO` or `cwebp`?](#do-i-have-to-install-svgo-or-cwebp)
39
-
-[`PHP Fatal error: Allowed memory size of 999999 bytes exhausted (tried to allocate 99 bytes)`](#php-fatal-error-allowed-memory-size-of-999999-bytes-exhausted-tried-to-allocate-99-bytes)
40
-
-[Does it have a limits or quotas?](#does-it-have-a-limits-or-quotas)
41
-
-[Is it for everyone?](#is-it-for-everyone)
42
-
-[Will you add support for older PHP versions?](#will-you-add-support-for-older-php-versions)
43
-
-[It looks awesome. Where can I find some more goodies like this?](#it-looks-awesome-where-can-i-find-some-more-goodies-like-this)
44
-
-[Where can I give :star::star::star::star::star: reviews?](#where-can-i-give-starstarstarstarstar-reviews)
-[Want to help in other way? Want to be a sponsor?](#want-to-help-in-other-way-want-to-be-a-sponsor)
49
-
-[Running the Tests](#running-the-tests)
50
-
-[Feedback](#feedback)
51
-
-[Change log](#change-log)
52
-
-[Security](#security)
53
-
-[Credits](#credits)
54
-
-[License](#license)
55
-
56
-
<!-- END doctoc generated TOC please keep comment here to allow auto update -->
57
-
58
-
WP CLI wrapper for [spatie/image-optimizer](https://github.com/spatie/image-optimizer). **Optimizing `gif`, `jpeg`, `jpg`, `png`, `svg`, `webp` images by running them through a chain of various image [optimization tools](#optimization-tools).** Check this project's [introductory blog post](https://typist.tech/articles/easily-optimize-wordpress-images-using-wp-cli-and-some-binaries/) about why I built it.
32
+
However, the amount of effort needed to maintain and develop new features is not sustainable without proper financial backing. If you have the capability, please consider donating using the links below:
33
+
34
+
<divalign="center">
35
+
36
+
[](https://github.com/sponsors/TangRufus)
37
+
[](https://typist.tech/go/paypal-donate/)
**Image Optimize Command** is a WP CLI wrapper for [spatie/image-optimizer](https://github.com/spatie/image-optimizer) which **optimize `gif`, `jpeg`, `jpg`, `png`, `svg`, `webp` images by running them through a chain of various image <ahref="https://github.com/spatie/image-optimizer#optimization-tools">optimization tools</a>.** Read [the introductory blog post](https://typist.tech/articles/easily-optimize-wordpress-images-using-wp-cli-and-some-binaries/) about why I built it.
59
45
60
46
61
47
## Usage
62
48
63
-
```bash
49
+
```sh-session
64
50
# optimize specific attachments
65
51
$ wp image-optimize attachment 123 223 323
66
52
@@ -90,6 +76,14 @@ $ wp help image-optimize
90
76
$ wp help image-optimize <subcommand>
91
77
```
92
78
79
+
---
80
+
81
+
<palign="center">
82
+
<strong>Typist Tech is ready to build your next awesome WordPress site. <ahref="https://typist.tech/contact/">Hire us!</a></strong>
83
+
</p>
84
+
85
+
---
86
+
93
87
## Requirements
94
88
95
89
- PHP v7.2 or later
@@ -99,7 +93,7 @@ Since [`wp-cli/wp-cli-bundle` bundles an older version of `symfony/process`](htt
@@ -123,7 +117,7 @@ Note that `spatie/image-optimizer` only supports Pngquant 2.5 and lower. See: `s
123
117
Note that [WordPress doesn't support svg files](https://core.trac.wordpress.org/ticket/24251) out of the box. You can omit [SVGO](https://github.com/svg/svgo).
124
118
However, if you have [enabled WordPress svg support](https://kinsta.com/blog/wordpress-svg/?kaid=CGCHYHJJJMMF) and uploaded svg files to WordPress media library, you must install SVGO. Otherwise, the command will fail.
125
119
126
-
Same goes to cwebp.
120
+
Same goes for cwebp.
127
121
128
122
## Use Cases
129
123
@@ -139,7 +133,7 @@ Chances are the thumbnails are missing or never generated:
139
133
140
134
Simplest solution is to regenerate thumbnails then optimize:
This command backs up the full sized images before optimizing attachments. If you want to restore them:
166
160
167
-
```bash
161
+
```sh-session
168
162
# optimize
169
163
$ wp image-optimize attachment 123
170
164
@@ -178,7 +172,7 @@ $ wp media regenerate 123
178
172
179
173
Starting from v0.2, this command backs up the full sized images before optimizing attachments. To migrate from image-optimize-command v0.1.x:
180
174
181
-
```bash
175
+
```sh-session
182
176
$ wp image-optimize reset
183
177
$ wp media regenerate
184
178
$ wp image-optimize batch --limit=9999999
@@ -259,7 +253,7 @@ Luckily for you, Lasse M. Tvedt showed [how to stop WordPress from resizing GIFs
259
253
260
254
### Can I use this on managed hosting?
261
255
262
-
No, you can't use this on managed hosting such as [Kinsta](http://bit.ly/kinsta-com), [Flywheel](https://typist.tech/go/flywheel) or [WP Engine](https://typist.tech/go/wp-engine) because they prohibit installing the binaries.
256
+
No, you can't use this on managed hosting such as [Kinsta](https://typist.tech/go/kinsta), [Flywheel](https://typist.tech/go/flywheel) or [WP Engine](https://typist.tech/go/wp-engine) because they prohibit installing the binaries.
263
257
264
258
If you must use it on managed hosting, [hire a developer](https://typist.tech/contact/) to add SaaS provider integration:
265
259
@@ -279,7 +273,7 @@ If you must use it on managed hosting, [hire a developer](https://typist.tech/co
279
273
- uploaded SVGs to WordPress media library
280
274
- using the `find` subcommand (or its shortcuts) with `--extensions=svg`
281
275
282
-
Same goes to cwebp.
276
+
Same goes for cwebp.
283
277
284
278
### `PHP Fatal error: Allowed memory size of 999999 bytes exhausted (tried to allocate 99 bytes)`
285
279
@@ -301,76 +295,53 @@ Never! This plugin will only work on [actively supported PHP versions](https://s
301
295
302
296
Don't use it on **end of life** or **security fixes only** PHP versions.
303
297
304
-
### It looks awesome. Where can I find some more goodies like this?
298
+
### It looks awesome. Where can I find some more goodies like this
305
299
306
-
- Articles on Typist Tech's [blog](https://typist.tech)
307
-
-More projects on [Typist Tech's GitHub profile](https://github.com/TypistTech/)
308
-
- More plugins on [TangRufus'](https://profiles.wordpress.org/tangrufus/#content-plugins) wp.org profiles
300
+
- Articles on [Typist Tech's blog](https://typist.tech)
301
+
-[Tang Rufus' WordPress plugins](https://profiles.wordpress.org/tangrufus#content-plugins) on wp.org
302
+
- More projects on [Typist Tech's GitHub profile](https://github.com/TypistTech)
309
303
- Stay tuned on [Typist Tech's newsletter](https://typist.tech/go/newsletter)
310
-
- Follow [@TangRufus](https://twitter.com/tangrufus) on Twitter
311
-
- Hire [Tang Rufus](https://typist.tech/contact) to build your next awesome site
-[sponsor](https://github.com/sponsors/TangRufus) Tang Rufus to maintain his open source projects
323
-
- hire [Tang Rufus](https://typist.tech/contact) to build your next awesome site
311
+
-[tweet](https://twitter.com/intent/tweet?text=Image%20Optimize%20Command%20-%20%40wpcli%20wrapper%20for%20%40spatie_be%20image%20optimizer&url=https://github.com/TypistTech/image-optimize-command&hashtags=webdev,wordpress&via=TangRufus&url=https://github.com/TypistTech/image-optimize-command&hashtags=webdev,wordpress&via=TangRufus) something good with mentioning [@TangRufus](https://twitter.com/tangrufus)
312
+
- ★ star [the Github repo](https://github.com/TypistTech/image-optimize-command)
313
+
-[👀 watch](https://github.com/TypistTech/image-optimize-command/subscription) the Github repo
Love `WP Contained Hook`? Help me maintain it, a [sponsorship here](https://typist.tech/donation/) can help with it.
328
-
329
-
### GitHub Sponsors Matching Fund
330
-
331
-
Do you know [GitHub is going to match your sponsorship](https://help.github.com/en/github/supporting-the-open-source-community-with-github-sponsors/about-github-sponsors#about-the-github-sponsors-matching-fund)?
332
-
333
-
[Sponsor now via GitHub](https://github.com/sponsors/TangRufus) to double your greatness.
334
-
335
-
### Why don't you hire me?
336
-
337
-
Ready to take freelance WordPress jobs. Contact me via the contact form [here](https://typist.tech/contact/) or, via email [[email protected]](mailto:[email protected])
338
-
339
-
### Want to help in other way? Want to be a sponsor?
**Please provide feedback!** We want to make this library useful in as many projects as possible.
355
-
Please submit an [issue](https://github.com/TypistTech/image-optimize-command/issues/new) and point out what you do and don't like, or fork the project and make suggestions.
328
+
**Please provide feedback!** We want to make this project as useful as possible.
329
+
Please [submit an issue](https://github.com/TypistTech/image-optimize-command/issues/new) and point out what you do and don't like, or fork the project and [send pull requests](https://github.com/TypistTech/image-optimize-command/pulls/).
356
330
**No issue is too small.**
357
331
358
-
## Change log
359
-
360
-
Please see [CHANGELOG](./CHANGELOG.md) for more information on what has changed recently.
332
+
## Security Vulnerabilities
361
333
362
-
## Security
363
-
364
-
If you discover any security related issues, please email [[email protected]](mailto:[email protected]) instead of using the issue tracker.
All security vulnerabilities will be promptly addressed.
365
336
366
337
## Credits
367
338
368
-
[`image-optimize-command`](https://github.com/TypistTech/image-optimize-command) is a [Typist Tech](https://typist.tech) project and maintained by [Tang Rufus](https://twitter.com/TangRufus), freelance developer for [hire](https://www.typist.tech/contact/).
369
-
370
-
Full list of contributors can be found [here](https://github.com/TypistTech/image-optimize-command/graphs/contributors).
339
+
[Image Optimize Command](https://github.com/TypistTech/image-optimize-command) is a [Typist Tech](https://www.typist.tech) project and maintained by [Tang Rufus](https://twitter.com/Tangrufus), freelance developer for [hire](https://www.typist.tech/contact/).
371
340
372
341
Special thanks to [Freek Van der Herten](https://github.com/freekmurze/) whose [`spatie/image-optimizer`](https://github.com/spatie/image-optimizer) package makes this project possible.
373
342
343
+
Full list of contributors can be found [here](https://github.com/TypistTech/image-optimize-command/graphs/contributors).
344
+
374
345
## License
375
346
376
-
The MIT License (MIT). Please see [License File](./LICENSE.md) for more information.
347
+
[Image Optimize Command](https://github.com/TypistTech/image-optimize-command) is released under the [MIT License](https://opensource.org/licenses/MIT).
0 commit comments