The plugin appends two custom buttons that allow you to regenerate and crop the images, provides details about the image sizes registered in the application and the status of each image sizes for images. The plugin also appends a sub-menu to “Settings” that allows you to configure the plugin for global or particular post type attached images and to enable the developer mode for debugging if necessary.
The “Details/Options” button will open a lightbox where you can see all the image sizes registered in the application and details about the status of each image sizes for that image. If one of the image sizes has not been found, you will see more details about this and, if possible, the option to manually generate this (for example the image size width and height are compatible with the original image). For the image sizes that are of “crop” type, you will be able to re-crop in one click the image using a specific portion of the original image: left/top, center/top, right/top, left/center, center/center, right/center, left/bottom, center/bottom, right/bottom. The preview of the result is shown right away, so you can re-crop if necessary.
The “Regenerate” button allows you to regenerate in one click all the image sizes for that specific image. This is really useful when during development you registered various image sizes and the already uploaded images are “left behind”.
The plugin does not require any additional code, it hooks in the admin_post_thumbnail_html and edit_form_top filter and appends two custom buttons that will be shown in “Edit Media” page and in the “Edit Post” and “Edit Page” where there is a featured image. This works also for custom post types. Also, it can be used in different resolutions and responsive layout.
admin_enqueue_scripts, init, add_meta_boxes, wp_ajax_, plugins_loaded, admin_menu, intermediate_image_sizes_advanced, added_post_meta, image_downsize, admin_post_thumbnail_html, edit_form_top, image_regenerate_select_crop_button
If you want to display the custom buttons in your plugins, you can use the custom action with $attachmentId parameter as the image post->ID you want the button for. Usage example :
do_action( 'image_regenerate_select_crop_button', $attachmentId );
Images Placeholders Developer Mode
This option allows you to display placeholders for front-side images called programmatically (that are not embedded in content with their src, but retrieved with the wp_get_attachment_image_src, and the other related WP native functions). If there is no placeholder set, then the default behavior would be to display the full size image instead of a missing image size.
If you activate the “force global” option, all the images on the front side that are related to posts will be replaced with the placeholders that mention the image size required. This is useful for debugging, to quickly identify the image sizes used for each layout. If you activate the “only missing images” option, all the images on the front side that are related to posts and do not have the requested image size generated will be replaced with the placeholders that mention the image size required. This is useful for showing smaller images instead of full-size images.
This option allows you to exclude globally from the application some of the image sizes that are registered through various plugins and themes options, but you don’t need these in your application at all (these are just stored in your folders and database but not used).
By excluding these, the unnecessary image sizes will not be generated at all.
This option allows you to exclude from the “Image Regenerate & Select Crop Settings” lightbox the details and options for the selected image sizes.
This is useful when you want to restrict from other users the functionality of crop or resize for particular image sizes.
This option means that the original image will be scaled to a max width or a max height specified by the image size you select.
This might be useful if you do not use the original image in any of the layouts at the full size, and this might save some storage space. Leave “nothing selected” to keep the original image as what you upload.
Clean Up All
This option allows you to clean up all the image sizes you already have in the application but you don’t use these at all.
Please be careful, once you click to remove the selected image size, the action is irreversible, the images generated will be deleted from your folders and database records.
This option allows you to regenerate all the image for the selected image size Please be careful, once you click to regenerate the selected image size, the action is irreversible, the images already generated will be overwritten.
This option allows you to set a default crop position for the images generated for particular image size. This default option will be used when you chose to regenerate an individual image or all of these and also when a new image is uploaded.
The available methods are “regenerate” and “clean up”. The arguments for both methods are the site id (1 for single site install, or if you are using the plugin in multi-site environment then you should specify the site id), the post type (post, page, or one of your custom post types), image size name (thumbnail, medium, etc.).
However, if you do not know all the options you have you can simply start by running the command “sirsc regenerate 1” and for each argument that is not mentioned the plugin will present the list of available values. If you want to regenerate the images for only one post, then the 4th argument can be passed and this should be the post ID.
So, for example, if I would want to regenerate just the thumbnails for a post with the ID = 7, my command would be
sirsc regenerate 1 post thumbnail 7
If I would want to regenerate just the medium images for a post with the id 7, my command would be
sirsc regenerate 1 post medium 7
You can regenerate all images sizes for all the pages like this:
sirsc regenerate 1 page all
Or, you can regenerate all images sizes for the page with the ID = 3 type like this:
sirsc regenerate 1 page all 3
The cleanup command works with the exact parameters order and types as the regenerate one.
See other plugins