breiti / ajax-thumbnail-rebuild Goto Github PK
View Code? Open in Web Editor NEWAJAX Thumbnail rebuild plugin for Wordpress
AJAX Thumbnail rebuild plugin for Wordpress
=== AJAX Thumbnail Rebuild === Contributors: junkcoder, RistoNiinemets Donate link: http://breiti.cc/wordpress/ajax-thumbnail-rebuild/#donate Tags: ajax, thumbnail, rebuild, regenerate, admin, image, photo Requires at least: 2.8 Tested up to: 6.2 Stable tag: 1.14 [AJAX Thumbnail Rebuild](https://wordpress.org/plugins/ajax-thumbnail-rebuild/) allows you to rebuild all thumbnails at once without script timeouts on your server. == Description == AJAX Thumbnail Rebuild allows you to rebuild all thumbnails on your site. There are already some plugins available for this, but they have one thing in common: All thumbnails are rebuilt in a single step. This works fine when you don’t have that many photos on your site. When you have a lot of full-size photos, the script on the server side takes a long time to run. Unfortunately the time a script is allowed to run is limited, which sets an upper limit to the number of thumbnails you can regenerate. This number depends on the server configuration and the computing power your server has available. When you get over this limit, you won’t be able to rebuild your thumbnails. Why would you want to rebuild your thumbnails? Wordpress allows you to change the size of thumbnails. This way, you can make the size of thumbnails fit the design of your website. When you change the size to fit for a new theme, all future photos you are going to upload will have this new size. Your old thumbnails won’t be resized. That’s where this plugin comes into action. After changing the image sizes, you can rebuild all thumbnails. But instead of telling the server to recreate all thumbnails at once, they are rebuilt one after another. Rebuilding thumbnails for one photo won’t take all too long, so you won’t run into any script timeouts. Note that you still have to wait until all thumbnails have been rebuilt. If you close the page before the task is completed, you have to start all over again. You can also select the thumbnail sizes you want to rebuild, so that you don't need to recreate all images if you've just changed one thumbnail-size. You can also choose to only rebuild post thumbnails (featured images). This plugin requires JavaScript to be enabled. Contributions are welcome at [Github](https://github.com/breiti/ajax-thumbnail-rebuild) == Installation == Upload the plugin to your blog, activate it, done. You can then rebuild all thumbnails in the tools section (Tools -> Rebuild Thumbnails). == Changelog == = 1.14 = * Fix security issues (props @patchstack) * Fix Github link (props @Julix91 @garretthyder) * Fix crop-settings for additional sizes (props @karlkowald) = 1.2.2 = * Compatibility with PHP 7.2 (props @thomas-gordon) * Implemented throttling and retries for image regeneration (props @da2x) = 1.2.1 = * NEW: Allow custom crop areas, [read more](https://developer.wordpress.org/reference/functions/add_image_size/#parameters) = 1.2 = * Compatibility with PHP7 = 1.12 = * FIX: An issue where rebuilding thumbnails in the media gallery would not work = 1.11 = * FIX: An issue where the plugin would sometimes break the media gallery. = 1.10 = * NEW: Rebuild thumbnails of single images on the media attachment page. = 1.09 = * NEW: Checkboxes can be activated by clicking on text. = 1.08 = * NEW: Slovak translation, provided by Branco Radenovich. = 1.07 = * FIX: Don't create metadata with empty size when original image is smaller than the target size. = 1.06 = * FIX: Don't forget metadata for sizes that aren't rebuilt. * FIX: Option to only rebuild featured images should now work correctly. * FIX: Don't fail if there are no attachments. * NEW: It's now possible to toggle all selected sizes. * NEW: Added translation: German. = 1.05 = * Add option to only rebuild post thumbnails (featured images) = 1.04 = * Tested with Wordpress 3.2 = 1.03 = * Fixed: Show correct height value for thumbnails. = 1.02 = * You can now select which thumbnail sizes you want to rebuild. Thanks to Nicolas Juen! = 1.01 = * Tested with Wordpress 3.0 = 1.0 = * Initial release == Screenshots == 1. Plugin in action
Is this the official repo? If so I can try to submit a PR.
The crop parameter isn't being respected when adding an image size: add_image_size( 'screenshot', 500, 500, array( 'center', 'top' ) );
. The resized image will be cropped to the vertical center of the image instead of the top.
See: https://wordpress.org/support/topic/feature-request-use-new-crop-parameter
image_make_intermediate_size()
will return FALSE
if the uploaded file is smaller than the focused image-size. In this case, you write an empty item in the sizes-array.
I've fixed it quck'n'dirty with these two lines:
if ( ! $metadata[ 'sizes' ][ $size ] )
unset( $metadata[ 'sizes' ][ $size ] );
after https://github.com/breiti/ajax-thumbnail-rebuild/blob/master/ajax-thumbnail-rebuild.php#L269
Just creating an issue so I can submit my pull request against it.
Title is self explanatory. I'm rebuilding the thumbnails of a 57000 posts website. Imagine how long is taking and until the process is not finished I will not see any change on my most recent posts.
Please consider it.
Just FYI,
AH01071: Got error 'PHP message: PHP Strict Standards: Only variables should be assigned by reference in /home/user/wordpress/wp -content/plugins/ajax-thumbnail-rebuild/ajax-thumbnail-rebuild.php on line 188\n'
Plugin Version 1.09
I removed the & locally since it doesn't look like you're doing any in-place editing anyways.
WP 4.8.3, ATR 1.2.1
About 700+ images mostly 7MB
When all were selected it got stuck after about 8 or 12 images.
Then I selected only thumbnail (150x999) and that worked
then I selected only medium (500x9999) and that worked.
Now I selected only large (900x9999) and it got stuck at image 11
I restarted the plugin and it seems to work further now. Just wondering if a 2nd admin session with WP could be influencing the conversion. If so maybe a warning?
2nd try: Sorry, got stuck at image 43 this time. Is something timing out?
3rd try: got stuck at image 57, not sure what this might be.
Many of us use a naming convention for sliders or header(banner) images. So it would be nice to have a filter where you can specify filenames. example "ban_."
then you select "post-thumbnail (1400x320 cropped)" and it would only convert those images.
Would you be able to add PHP7 support? I'm getting the following error:
<b>Deprecated</b>: Methods with the same name as their class will not be constructors in a future version of PHP; AjaxThumbnailRebuild has a deprecated constructor in <b>/var/www/html/wp-content/plugins/ajax-thumbnail-rebuild/ajax-thumbnail-rebuild.php</b> on line <b>26</b><br />
Thanks!
in tags 1.07 and 1.08, the version in the main php file still says 1.06
Hi, just descripted the problem (and solution) there:
https://wordpress.org/support/topic/bug-found-in-plugincode/
Hi, within your Plugin you made a small bug, which disallows to set the Crop-Parameter as an array.
In Line 337 you check, if your own crop-information which is per default set to false is not an array and after that you return the the array as (intval).
so you have to change the line from:
if( ! is_array( $sizes[$s][‘crop’] ) ) {
to
if( ! is_array( $_wp_additional_image_sizes[$s][‘crop’] ) ) {
After that its correct and working as intended. please update your plugin with this fix. thanks 🙂
Another hint: update the link to github, cause now its referencing back to wordpress plugin directory.
You might want to think about counting how many are ticked, and then according to that ticking them all or unticking all of them.
Hello @breiti,
First of all, I want to thank you for the great plugin.
I tried looking up your contacts to get a hold of you, but did not find any, so I'll write here and hope you will see it.
"Ajax Thumbnail Rebuild" has a lot of installations (over 100 000 based on WordPress.org statistics), so it is quite popular. I like that it is really simple and does the trick. However, the plugin's code is outdated and needs to be updated.
As I use this plugin quite often, I am willing to take over the development and maintaining of the plugin. My promise is, that I will not make it a "premium" plugin, nor will advertise myself or allow any kind of advertisements in the plugin.
There are people out there also wanting this plugin developed and updated (as seen from the pull requests).
To get the things rolling, I need you to add me to the admin, moderator or what ever role is here on Github for this repostory, so I could make direct commits to it and merge pull requests. Also a contributor status to WordPress.org repository, so I could do the same things there.
Github - Repository - Settings - Collaborators & Teams - Add "RistoNiinemets"
WordPress.org - add "ristoniinemets" to the plugins readme.txt file through SVN
Looking forward to your reply.
Best of wishes,
Risto
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.