AJAX Thumbnail Rebuild - Version 1.2

Version Description

  • Compatibility with PHP7
Download this release

Release Info

Developer RistoNiinemets
Plugin Icon wp plugin AJAX Thumbnail Rebuild
Version 1.2
Comparing to
See all releases

Code changes from version 1.12 to 1.2

ajax-thumbnail-rebuild.php CHANGED
@@ -1,346 +1,372 @@
1
- <?php
2
- /* Plugin name: AJAX Thumbnail Rebuild
3
- Plugin URI: http://breiti.cc/wordpress/ajax-thumbnail-rebuild
4
- Author: junkcoder
5
- Author URI: http://breiti.cc
6
- Version: 1.12
7
- Description: Rebuild all thumbnails
8
- Max WP Version: 3.9
9
- Text Domain: ajax-thumbnail-rebuild
10
-
11
- This program is free software; you can redistribute it and/or modify
12
- it under the terms of the GNU General Public License as published by
13
- the Free Software Foundation; either version 2 of the License, or
14
- (at your option) any later version.
15
-
16
- This program is distributed in the hope that it will be useful,
17
- but WITHOUT ANY WARRANTY; without even the implied warranty of
18
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19
- GNU General Public License for more details.
20
-
21
- You should have received a copy of the GNU General Public License
22
- along with this program; if not, write to the Free Software
23
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
24
- */
25
-
26
- class AjaxThumbnailRebuild {
27
-
28
- function AjaxThumbnailRebuild() {
29
- add_action( 'admin_menu', array(&$this, 'addAdminMenu') );
30
- add_filter( 'attachment_fields_to_edit', array(&$this, 'addRebuildSingle'), 10, 2 );
31
- }
32
-
33
- function addAdminMenu() {
34
- add_management_page( __( 'Rebuild all Thumbnails', 'ajax-thumbnail-rebuild' ), __( 'Rebuild Thumbnails', 'ajax-thumbnail-rebuild'
35
- ), 'manage_options', 'ajax-thumbnail-rebuild', array(&$this, 'ManagementPage') );
36
- }
37
-
38
- /**
39
- * Add rebuild thumbnails button to the media page
40
- *
41
- * @param array $fields
42
- * @param object $post
43
- * @return array
44
- */
45
- function addRebuildSingle($fields, $post) {
46
- $thumbnails = array();
47
- foreach ( ajax_thumbnail_rebuild_get_sizes() as $s )
48
- $thumbnails[] = 'thumbnails[]='.$s['name'];
49
- $thumbnails = '&'.implode('&', $thumbnails);
50
- ob_start();
51
- ?>
52
- <script>
53
- function setMessage(msg) {
54
- jQuery("#atr-message").html(msg);
55
- jQuery("#atr-message").show();
56
- }
57
-
58
- function regenerate() {
59
- jQuery("#ajax_thumbnail_rebuild").prop("disabled", true);
60
- setMessage("<?php _e('Reading attachments...', 'ajax-thumbnail-rebuild') ?>");
61
- thumbnails = '<?php echo $thumbnails ?>';
62
- jQuery.ajax({
63
- url: "<?php echo admin_url('admin-ajax.php'); ?>",
64
- type: "POST",
65
- data: "action=ajax_thumbnail_rebuild&do=regen&id=<?php echo $post->ID ?>" + thumbnails,
66
- success: function(result) {
67
- if (result != '-1') {
68
- setMessage("<?php _e('Done.', 'ajax-thumbnail-rebuild') ?>");
69
- }
70
- },
71
- error: function(request, status, error) {
72
- setMessage("<?php _e('Error', 'ajax-thumbnail-rebuild') ?>" + request.status);
73
- },
74
- complete: function() {
75
- jQuery("#ajax_thumbnail_rebuild").prop("disabled", false);
76
- }
77
- });
78
- }
79
- </script>
80
- <input type='button' onclick='javascript:regenerate();' class='button' name='ajax_thumbnail_rebuild' id='ajax_thumbnail_rebuild' value='Rebuild Thumbnails'>
81
- <span id="atr-message" class="updated fade" style="clear:both;display:none;line-height:28px;padding-left:10px;"></span>
82
- <?php
83
- $html = ob_get_clean();
84
- $fields["ajax-thumbnail-rebuild"] = array(
85
- "label" => __('Ajax Thumbnail Rebuild', 'ajax-thumbnail-rebuild'),
86
- "input" => "html",
87
- "html" => $html
88
- );
89
- return $fields;
90
- }
91
-
92
- function ManagementPage() {
93
- ?>
94
- <div id="message" class="updated fade" style="display:none"></div>
95
- <script type="text/javascript">
96
- // <![CDATA[
97
-
98
- function setMessage(msg) {
99
- jQuery("#message").html(msg);
100
- jQuery("#message").show();
101
- }
102
-
103
- function regenerate() {
104
- jQuery("#ajax_thumbnail_rebuild").prop("disabled", true);
105
- setMessage("<p><?php _e('Reading attachments...', 'ajax-thumbnail-rebuild') ?></p>");
106
-
107
- inputs = jQuery( 'input:checked' );
108
- var thumbnails= '';
109
- if( inputs.length != jQuery( 'input[type=checkbox]' ).length ){
110
- inputs.each( function(){
111
- thumbnails += '&thumbnails[]='+jQuery(this).val();
112
- } );
113
- }
114
-
115
- var onlyfeatured = jQuery("#onlyfeatured").prop('checked') ? 1 : 0;
116
-
117
- jQuery.ajax({
118
- url: "<?php echo admin_url('admin-ajax.php'); ?>",
119
- type: "POST",
120
- data: "action=ajax_thumbnail_rebuild&do=getlist&onlyfeatured="+onlyfeatured,
121
- success: function(result) {
122
- var list = eval(result);
123
- var curr = 0;
124
-
125
- if (!list) {
126
- setMessage("<?php _e('No attachments found.', 'ajax-thumbnail-rebuild')?>");
127
- jQuery("#ajax_thumbnail_rebuild").prop("disabled", false);
128
- return;
129
- }
130
-
131
- function regenItem() {
132
- if (curr >= list.length) {
133
- jQuery("#ajax_thumbnail_rebuild").prop("disabled", false);
134
- setMessage("<?php _e('Done.', 'ajax-thumbnail-rebuild') ?>");
135
- return;
136
- }
137
- setMessage(<?php printf( __('"Rebuilding " + %s + " of " + %s + " (" + %s + ")..."', 'ajax-thumbnail-rebuild'), "(curr+1)", "list.length", "list[curr].title"); ?>);
138
-
139
- jQuery.ajax({
140
- url: "<?php echo admin_url('admin-ajax.php'); ?>",
141
- type: "POST",
142
- data: "action=ajax_thumbnail_rebuild&do=regen&id=" + list[curr].id + thumbnails,
143
- success: function(result) {
144
- curr = curr + 1;
145
- if (result != '-1') {
146
- jQuery("#thumb").show();
147
- jQuery("#thumb-img").attr("src",result);
148
- }
149
- regenItem();
150
- }
151
- });
152
- }
153
-
154
- regenItem();
155
- },
156
- error: function(request, status, error) {
157
- setMessage("<?php _e('Error', 'ajax-thumbnail-rebuild') ?>" + request.status);
158
- }
159
- });
160
- }
161
-
162
- jQuery(document).ready(function() {
163
- jQuery('#size-toggle').click(function() {
164
- jQuery("#sizeselect").find("input[type=checkbox]").each(function() {
165
- jQuery(this).prop("checked", !jQuery(this).prop("checked"));
166
- });
167
- });
168
- });
169
-
170
- // ]]>
171
- </script>
172
-
173
- <form method="post" action="" style="display:inline; float:left; padding-right:30px;">
174
- <h4><?php _e('Select which thumbnails you want to rebuild', 'ajax-thumbnail-rebuild'); ?>:</h4>
175
- <a href="javascript:void(0);" id="size-toggle"><?php _e('Toggle all', 'ajax-thumbnail-rebuild'); ?></a>
176
- <div id="sizeselect">
177
- <?php
178
- foreach ( ajax_thumbnail_rebuild_get_sizes() as $s ):
179
- ?>
180
-
181
- <label>
182
- <input type="checkbox" name="thumbnails[]" id="sizeselect" checked="checked" value="<?php echo $s['name'] ?>" />
183
- <em><?php echo $s['name'] ?></em>
184
- &nbsp;(<?php echo $s['width'] ?>x<?php echo $s['height'] ?>
185
- <?php if ($s['crop']) _e('cropped', 'ajax-thumbnail-rebuild'); ?>)
186
- </label>
187
- <br/>
188
- <?php endforeach;?>
189
- </div>
190
- <p>
191
- <label>
192
- <input type="checkbox" id="onlyfeatured" name="onlyfeatured" />
193
- <?php _e('Only rebuild featured images', 'ajax-thumbnail-rebuild'); ?>
194
- </label>
195
- </p>
196
-
197
- <p><?php _e("Note: If you've changed the dimensions of your thumbnails, existing thumbnail images will not be deleted.",
198
- 'ajax-thumbnail-rebuild'); ?></p>
199
- <input type="button" onClick="javascript:regenerate();" class="button"
200
- name="ajax_thumbnail_rebuild" id="ajax_thumbnail_rebuild"
201
- value="<?php _e( 'Rebuild All Thumbnails', 'ajax-thumbnail-rebuild' ) ?>" />
202
- <br />
203
- </form>
204
-
205
- <div id="thumb" style="display:none;"><h4><?php _e('Last image', 'ajax-thumbnail-rebuild'); ?>:</h4><img id="thumb-img" /></div>
206
-
207
- <p style="clear:both; padding-top:2em;">
208
- <?php printf( __("If you find this plugin useful, I'd be happy to read your comments on the %splugin homepage%s. If you experience any problems, feel free to leave a comment too.",
209
- 'ajax-thumbnail-rebuild'),
210
- '<a href="http://breiti.cc/wordpress/ajax-thumbnail-rebuild" target="_blank">', '</a>');
211
- ?>
212
- </p>
213
-
214
- <?php
215
- }
216
-
217
- };
218
-
219
- function ajax_thumbnail_rebuild_ajax() {
220
- global $wpdb;
221
-
222
- $action = $_POST["do"];
223
- $thumbnails = isset( $_POST['thumbnails'] )? $_POST['thumbnails'] : NULL;
224
- $onlyfeatured = isset( $_POST['onlyfeatured'] ) ? $_POST['onlyfeatured'] : 0;
225
-
226
- if ($action == "getlist") {
227
-
228
- if ($onlyfeatured) {
229
- /* Get all featured images */
230
- $featured_images = $wpdb->get_results( "SELECT meta_value,{$wpdb->posts}.post_title AS title FROM {$wpdb->postmeta}, {$wpdb->posts}
231
- WHERE meta_key = '_thumbnail_id' AND {$wpdb->postmeta}.post_id={$wpdb->posts}.ID");
232
-
233
- foreach($featured_images as $image) {
234
- $res[] = array('id' => $image->meta_value, 'title' => $image->title);
235
- }
236
- } else {
237
- $attachments = get_children( array(
238
- 'post_type' => 'attachment',
239
- 'post_mime_type' => 'image',
240
- 'numberposts' => -1,
241
- 'post_status' => null,
242
- 'post_parent' => null, // any parent
243
- 'output' => 'object',
244
- ) );
245
- foreach ( $attachments as $attachment ) {
246
- $res[] = array('id' => $attachment->ID, 'title' => $attachment->post_title);
247
- }
248
- }
249
-
250
- die( json_encode($res) );
251
- } else if ($action == "regen") {
252
- $id = $_POST["id"];
253
-
254
- $fullsizepath = get_attached_file( $id );
255
-
256
- if ( FALSE !== $fullsizepath && @file_exists($fullsizepath) ) {
257
- set_time_limit( 30 );
258
- wp_update_attachment_metadata( $id, wp_generate_attachment_metadata_custom( $id, $fullsizepath, $thumbnails ) );
259
- die( wp_get_attachment_thumb_url( $id ));
260
- }
261
-
262
- die('-1');
263
- }
264
- }
265
- add_action('wp_ajax_ajax_thumbnail_rebuild', 'ajax_thumbnail_rebuild_ajax');
266
-
267
- add_action( 'plugins_loaded', create_function( '', 'global $AjaxThumbnailRebuild; $AjaxThumbnailRebuild = new AjaxThumbnailRebuild();' ) );
268
-
269
- function ajax_thumbnail_rebuild_get_sizes() {
270
- global $_wp_additional_image_sizes;
271
-
272
- foreach ( get_intermediate_image_sizes() as $s ) {
273
- $sizes[$s] = array( 'name' => '', 'width' => '', 'height' => '', 'crop' => FALSE );
274
-
275
- /* Read theme added sizes or fall back to default sizes set in options... */
276
-
277
- $sizes[$s]['name'] = $s;
278
-
279
- if ( isset( $_wp_additional_image_sizes[$s]['width'] ) )
280
- $sizes[$s]['width'] = intval( $_wp_additional_image_sizes[$s]['width'] );
281
- else
282
- $sizes[$s]['width'] = get_option( "{$s}_size_w" );
283
-
284
- if ( isset( $_wp_additional_image_sizes[$s]['height'] ) )
285
- $sizes[$s]['height'] = intval( $_wp_additional_image_sizes[$s]['height'] );
286
- else
287
- $sizes[$s]['height'] = get_option( "{$s}_size_h" );
288
-
289
- if ( isset( $_wp_additional_image_sizes[$s]['crop'] ) )
290
- $sizes[$s]['crop'] = intval( $_wp_additional_image_sizes[$s]['crop'] );
291
- else
292
- $sizes[$s]['crop'] = get_option( "{$s}_crop" );
293
- }
294
-
295
- return $sizes;
296
- }
297
-
298
- /**
299
- * Generate post thumbnail attachment meta data.
300
- *
301
- * @since 2.1.0
302
- *
303
- * @param int $attachment_id Attachment Id to process.
304
- * @param string $file Filepath of the Attached image.
305
- * @return mixed Metadata for attachment.
306
- */
307
- function wp_generate_attachment_metadata_custom( $attachment_id, $file, $thumbnails = NULL ) {
308
- $attachment = get_post( $attachment_id );
309
-
310
- $metadata = array();
311
- if ( preg_match('!^image/!', get_post_mime_type( $attachment )) && file_is_displayable_image($file) ) {
312
- $imagesize = getimagesize( $file );
313
- $metadata['width'] = $imagesize[0];
314
- $metadata['height'] = $imagesize[1];
315
- list($uwidth, $uheight) = wp_constrain_dimensions($metadata['width'], $metadata['height'], 128, 96);
316
- $metadata['hwstring_small'] = "height='$uheight' width='$uwidth'";
317
-
318
- // Make the file path relative to the upload dir
319
- $metadata['file'] = _wp_relative_upload_path($file);
320
-
321
- $sizes = ajax_thumbnail_rebuild_get_sizes();
322
- $sizes = apply_filters( 'intermediate_image_sizes_advanced', $sizes );
323
-
324
- foreach ($sizes as $size => $size_data ) {
325
- if( isset( $thumbnails ) && !in_array( $size, $thumbnails ))
326
- $intermediate_size = image_get_intermediate_size( $attachment_id, $size_data['name'] );
327
- else
328
- $intermediate_size = image_make_intermediate_size( $file, $size_data['width'], $size_data['height'], $size_data['crop'] );
329
-
330
- if ($intermediate_size)
331
- $metadata['sizes'][$size] = $intermediate_size;
332
- }
333
-
334
- // fetch additional metadata from exif/iptc
335
- $image_meta = wp_read_image_metadata( $file );
336
- if ( $image_meta )
337
- $metadata['image_meta'] = $image_meta;
338
-
339
- }
340
-
341
- return apply_filters( 'wp_generate_attachment_metadata', $metadata, $attachment_id );
342
- }
343
-
344
- load_plugin_textdomain('ajax-thumbnail-rebuild', false, basename( dirname( __FILE__ ) ) . '/languages' );
345
-
346
- ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /*
3
+ Plugin name: AJAX Thumbnail Rebuild
4
+ Plugin URI: http://breiti.cc/wordpress/ajax-thumbnail-rebuild
5
+ Author: junkcoder
6
+ Author URI: http://breiti.cc
7
+ Version: 1.2
8
+ Description: Rebuild all thumbnails
9
+ Tested up to: 4.8.2
10
+ Text Domain: ajax-thumbnail-rebuild
11
+
12
+ This program is free software; you can redistribute it and/or modify
13
+ it under the terms of the GNU General Public License as published by
14
+ the Free Software Foundation; either version 2 of the License, or
15
+ (at your option) any later version.
16
+
17
+ This program is distributed in the hope that it will be useful,
18
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
19
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20
+ GNU General Public License for more details.
21
+
22
+ You should have received a copy of the GNU General Public License
23
+ along with this program; if not, write to the Free Software
24
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
25
+ */
26
+
27
+ class AjaxThumbnailRebuild {
28
+
29
+ function __construct() {
30
+ add_action( 'admin_menu', array( $this, 'addAdminMenu' ) );
31
+ add_filter( 'attachment_fields_to_edit', array( $this, 'addRebuildSingle' ), 10, 2 );
32
+ }
33
+
34
+ function addAdminMenu() {
35
+ add_management_page( __( 'Rebuild all Thumbnails', 'ajax-thumbnail-rebuild' ), __( 'Rebuild Thumbnails', 'ajax-thumbnail-rebuild' ), 'manage_options', 'ajax-thumbnail-rebuild', array( $this, 'ManagementPage' ) );
36
+ }
37
+
38
+ /**
39
+ * Add rebuild thumbnails button to the media page
40
+ *
41
+ * @param array $fields
42
+ * @param object $post
43
+ * @return array
44
+ */
45
+ function addRebuildSingle( $fields, $post ) {
46
+ $thumbnails = array();
47
+
48
+ foreach ( ajax_thumbnail_rebuild_get_sizes() as $s ) {
49
+ $thumbnails[] = 'thumbnails[]=' . $s['name'];
50
+ }
51
+
52
+ $thumbnails = '&' . implode( '&', $thumbnails );
53
+
54
+ ob_start();
55
+ ?>
56
+ <script>
57
+ function setMessage(msg) {
58
+ jQuery("#atr-message").html(msg);
59
+ jQuery("#atr-message").show();
60
+ }
61
+
62
+ function regenerate() {
63
+ jQuery("#ajax_thumbnail_rebuild").prop("disabled", true);
64
+ setMessage("<?php _e('Reading attachments...', 'ajax-thumbnail-rebuild') ?>");
65
+ thumbnails = '<?php echo $thumbnails ?>';
66
+ jQuery.ajax({
67
+ url: "<?php echo admin_url('admin-ajax.php'); ?>",
68
+ type: "POST",
69
+ data: "action=ajax_thumbnail_rebuild&do=regen&id=<?php echo $post->ID ?>" + thumbnails,
70
+ success: function(result) {
71
+ if (result != '-1') {
72
+ setMessage("<?php _e('Done.', 'ajax-thumbnail-rebuild') ?>");
73
+ }
74
+ },
75
+ error: function(request, status, error) {
76
+ setMessage("<?php _e('Error', 'ajax-thumbnail-rebuild') ?>" + request.status);
77
+ },
78
+ complete: function() {
79
+ jQuery("#ajax_thumbnail_rebuild").prop("disabled", false);
80
+ }
81
+ });
82
+ }
83
+ </script>
84
+ <input type='button' onclick='javascript:regenerate();' class='button' name='ajax_thumbnail_rebuild' id='ajax_thumbnail_rebuild' value='Rebuild Thumbnails'>
85
+ <span id="atr-message" class="updated fade" style="clear:both;display:none;line-height:28px;padding-left:10px;"></span>
86
+ <?php
87
+ $html = ob_get_clean();
88
+
89
+ $fields['ajax-thumbnail-rebuild'] = array(
90
+ 'label' => __( 'Ajax Thumbnail Rebuild', 'ajax-thumbnail-rebuild' ),
91
+ 'input' => 'html',
92
+ 'html' => $html
93
+ );
94
+
95
+ return $fields;
96
+ }
97
+
98
+ function ManagementPage() {
99
+ ?>
100
+ <div id="message" class="updated fade" style="display:none"></div>
101
+ <script type="text/javascript">
102
+ // <![CDATA[
103
+ function setMessage(msg) {
104
+ jQuery("#message").html(msg);
105
+ jQuery("#message").show();
106
+ }
107
+
108
+ function regenerate() {
109
+ jQuery("#ajax_thumbnail_rebuild").prop("disabled", true);
110
+ setMessage("<p><?php _e('Reading attachments...', 'ajax-thumbnail-rebuild') ?></p>");
111
+
112
+ inputs = jQuery( 'input:checked' );
113
+ var thumbnails= '';
114
+ if( inputs.length != jQuery( 'input[type=checkbox]' ).length ){
115
+ inputs.each( function(){
116
+ thumbnails += '&thumbnails[]='+jQuery(this).val();
117
+ } );
118
+ }
119
+
120
+ var onlyfeatured = jQuery("#onlyfeatured").prop('checked') ? 1 : 0;
121
+
122
+ jQuery.ajax({
123
+ url: "<?php echo admin_url( 'admin-ajax.php' ); ?>",
124
+ type: "POST",
125
+ data: "action=ajax_thumbnail_rebuild&do=getlist&onlyfeatured=" + onlyfeatured,
126
+ success: function(result) {
127
+ var list = eval(result);
128
+ var curr = 0;
129
+
130
+ if (!list) {
131
+ setMessage("<?php _e( 'No attachments found.', 'ajax-thumbnail-rebuild' ) ?>");
132
+ jQuery("#ajax_thumbnail_rebuild").prop("disabled", false);
133
+ return;
134
+ }
135
+
136
+ function regenItem() {
137
+ if (curr >= list.length) {
138
+ jQuery("#ajax_thumbnail_rebuild").prop("disabled", false);
139
+ setMessage("<?php _e('Done.', 'ajax-thumbnail-rebuild') ?>");
140
+ return;
141
+ }
142
+
143
+ setMessage( '<?php printf( __( 'Rebuilding %s of %s (%s)...', 'ajax-thumbnail-rebuild' ), "' + (curr + 1) + '", "' + list.length + '", "' + list[curr].title + '" ); ?>' );
144
+
145
+ jQuery.ajax({
146
+ url: "<?php echo admin_url('admin-ajax.php'); ?>",
147
+ type: "POST",
148
+ data: "action=ajax_thumbnail_rebuild&do=regen&id=" + list[curr].id + thumbnails,
149
+ success: function(result) {
150
+ curr = curr + 1;
151
+ if (result != '-1') {
152
+ jQuery("#thumb").show();
153
+ jQuery("#thumb-img").attr("src",result);
154
+ }
155
+ regenItem();
156
+ }
157
+ });
158
+ }
159
+
160
+ regenItem();
161
+ },
162
+ error: function(request, status, error) {
163
+ setMessage("<?php _e( 'Error', 'ajax-thumbnail-rebuild' ) ?>" + request.status);
164
+ }
165
+ });
166
+ }
167
+
168
+ jQuery(document).ready(function() {
169
+ jQuery('#size-toggle').click(function() {
170
+ jQuery("#sizeselect").find("input[type=checkbox]").each(function() {
171
+ jQuery(this).prop("checked", !jQuery(this).prop("checked"));
172
+ });
173
+ });
174
+ });
175
+
176
+ // ]]>
177
+ </script>
178
+
179
+ <form method="post" action="" style="display:inline; float:left; padding-right:30px;">
180
+ <h4><?php _e( 'Select which thumbnails you want to rebuild', 'ajax-thumbnail-rebuild' ); ?>:</h4>
181
+ <a href="javascript:void(0);" id="size-toggle"><?php _e( 'Toggle all', 'ajax-thumbnail-rebuild' ); ?></a>
182
+
183
+ <div id="sizeselect">
184
+
185
+ <?php foreach ( ajax_thumbnail_rebuild_get_sizes() as $s ) : ?>
186
+
187
+ <label>
188
+ <input type="checkbox" name="thumbnails[]" id="sizeselect" checked="checked" value="<?php echo $s['name'] ?>" />
189
+ <em><?php echo $s['name'] ?></em>
190
+ &nbsp;(<?php echo $s['width'] ?>x<?php echo $s['height'] ?>
191
+ <?php if ($s['crop']) _e( 'cropped', 'ajax-thumbnail-rebuild' ); ?>)
192
+ </label>
193
+ <br/>
194
+
195
+ <?php endforeach; ?>
196
+
197
+ </div>
198
+
199
+ <p>
200
+ <label>
201
+ <input type="checkbox" id="onlyfeatured" name="onlyfeatured" />
202
+ <?php _e( 'Only rebuild featured images', 'ajax-thumbnail-rebuild' ); ?>
203
+ </label>
204
+ </p>
205
+
206
+ <p><?php _e( 'Note: If you\'ve changed the dimensions of your thumbnails, existing thumbnail images will not be deleted.',
207
+ 'ajax-thumbnail-rebuild' ); ?></p>
208
+
209
+ <input type="button" onClick="javascript:regenerate();" class="button" name="ajax_thumbnail_rebuild" id="ajax_thumbnail_rebuild" value="<?php _e( 'Rebuild All Thumbnails', 'ajax-thumbnail-rebuild' ) ?>" />
210
+ <br />
211
+ </form>
212
+
213
+ <div id="thumb" style="display:none;"><h4><?php _e( 'Last image', 'ajax-thumbnail-rebuild' ); ?>:</h4><img id="thumb-img" /></div>
214
+
215
+ <p style="clear:both; padding-top:2em;">
216
+ <?php printf( __( 'If you find this plugin useful, I\'d be happy to read your comments on the %splugin homepage%s. If you experience any problems, feel free to leave a comment too.', 'ajax-thumbnail-rebuild' ), '<a href="http://breiti.cc/wordpress/ajax-thumbnail-rebuild" target="_blank">', '</a>'); ?>
217
+ </p>
218
+ <?php
219
+ }
220
+
221
+ };
222
+
223
+ function ajax_thumbnail_rebuild_ajax() {
224
+ global $wpdb;
225
+
226
+ $action = $_POST["do"];
227
+ $thumbnails = isset( $_POST['thumbnails'] )? $_POST['thumbnails'] : NULL;
228
+ $onlyfeatured = isset( $_POST['onlyfeatured'] ) ? $_POST['onlyfeatured'] : 0;
229
+
230
+ if ($action == "getlist") {
231
+ $res = array();
232
+
233
+ if ( $onlyfeatured ) {
234
+ /* Get all featured images */
235
+ $featured_images = $wpdb->get_results( "SELECT meta_value, {$wpdb->posts}.post_title AS title FROM {$wpdb->postmeta}, {$wpdb->posts} WHERE meta_key = '_thumbnail_id' AND {$wpdb->postmeta}.post_id={$wpdb->posts}.ID ORDER BY post_date DESC");
236
+
237
+ foreach( $featured_images as $image ) {
238
+ $res[] = array(
239
+ 'id' => $image->meta_value,
240
+ 'title' => $image->title
241
+ );
242
+ }
243
+ }
244
+ else {
245
+ $attachments = get_children( array(
246
+ 'post_type' => 'attachment',
247
+ 'post_mime_type' => 'image',
248
+ 'numberposts' => -1,
249
+ 'post_status' => null,
250
+ 'post_parent' => null, // any parent
251
+ 'output' => 'object',
252
+ 'orderby' => 'post_date',
253
+ 'order' => 'desc'
254
+ ) );
255
+
256
+ foreach ( $attachments as $attachment ) {
257
+ $res[] = array(
258
+ 'id' => $attachment->ID,
259
+ 'title' => $attachment->post_title
260
+ );
261
+ }
262
+ }
263
+
264
+ die( json_encode( $res ) );
265
+ }
266
+ else if ($action == "regen") {
267
+ $id = $_POST["id"];
268
+
269
+ $fullsizepath = get_attached_file( $id );
270
+
271
+ if ( FALSE !== $fullsizepath && @file_exists( $fullsizepath ) ) {
272
+ set_time_limit( 30 );
273
+ wp_update_attachment_metadata( $id, wp_generate_attachment_metadata_custom( $id, $fullsizepath, $thumbnails ) );
274
+
275
+ die( wp_get_attachment_thumb_url( $id ));
276
+ }
277
+
278
+ die( '-1' );
279
+ }
280
+ }
281
+ add_action( 'wp_ajax_ajax_thumbnail_rebuild', 'ajax_thumbnail_rebuild_ajax' );
282
+
283
+ add_action( 'plugins_loaded', create_function( '', 'global $AjaxThumbnailRebuild; $AjaxThumbnailRebuild = new AjaxThumbnailRebuild();' ) );
284
+
285
+ function ajax_thumbnail_rebuild_get_sizes() {
286
+ global $_wp_additional_image_sizes;
287
+
288
+ foreach ( get_intermediate_image_sizes() as $s ) {
289
+ $sizes[$s] = array( 'name' => '', 'width' => '', 'height' => '', 'crop' => FALSE );
290
+
291
+ /* Read theme added sizes or fall back to default sizes set in options... */
292
+
293
+ $sizes[$s]['name'] = $s;
294
+
295
+ if ( isset( $_wp_additional_image_sizes[$s]['width'] ) ) {
296
+ $sizes[$s]['width'] = intval( $_wp_additional_image_sizes[$s]['width'] );
297
+ }
298
+ else {
299
+ $sizes[$s]['width'] = get_option( "{$s}_size_w" );
300
+ }
301
+
302
+ if ( isset( $_wp_additional_image_sizes[$s]['height'] ) ) {
303
+ $sizes[$s]['height'] = intval( $_wp_additional_image_sizes[$s]['height'] );
304
+ }
305
+ else {
306
+ $sizes[$s]['height'] = get_option( "{$s}_size_h" );
307
+ }
308
+
309
+ if ( isset( $_wp_additional_image_sizes[$s]['crop'] ) ) {
310
+ $sizes[$s]['crop'] = intval( $_wp_additional_image_sizes[$s]['crop'] );
311
+ }
312
+ else {
313
+ $sizes[$s]['crop'] = get_option( "{$s}_crop" );
314
+ }
315
+ }
316
+
317
+ $sizes = apply_filters( 'intermediate_image_sizes_advanced', $sizes );
318
+
319
+ return $sizes;
320
+ }
321
+
322
+ /**
323
+ * Generate post thumbnail attachment meta data.
324
+ *
325
+ * @since 2.1.0
326
+ *
327
+ * @param int $attachment_id Attachment Id to process.
328
+ * @param string $file Filepath of the Attached image.
329
+ * @return mixed Metadata for attachment.
330
+ */
331
+ function wp_generate_attachment_metadata_custom( $attachment_id, $file, $thumbnails = NULL ) {
332
+ $attachment = get_post( $attachment_id );
333
+
334
+ $metadata = array();
335
+ if ( preg_match( '!^image/!', get_post_mime_type( $attachment ) ) && file_is_displayable_image( $file ) ) {
336
+ $imagesize = getimagesize( $file );
337
+ $metadata['width'] = $imagesize[0];
338
+ $metadata['height'] = $imagesize[1];
339
+ list($uwidth, $uheight) = wp_constrain_dimensions($metadata['width'], $metadata['height'], 128, 96);
340
+ $metadata['hwstring_small'] = sprintf( "height='%s' width='%s'", $uheight, $uwidth );
341
+
342
+ // Make the file path relative to the upload dir
343
+ $metadata['file'] = _wp_relative_upload_path( $file );
344
+
345
+ $sizes = ajax_thumbnail_rebuild_get_sizes();
346
+
347
+ foreach ( $sizes as $size => $size_data ) {
348
+ if( isset( $thumbnails ) && ! in_array( $size, $thumbnails ) ) {
349
+ $intermediate_size = image_get_intermediate_size( $attachment_id, $size_data['name'] );
350
+ }
351
+ else {
352
+ $intermediate_size = image_make_intermediate_size( $file, $size_data['width'], $size_data['height'], $size_data['crop'] );
353
+ }
354
+
355
+ if ( $intermediate_size ) {
356
+ $metadata['sizes'][$size] = $intermediate_size;
357
+ }
358
+ }
359
+
360
+ // fetch additional metadata from exif/iptc
361
+ $image_meta = wp_read_image_metadata( $file );
362
+
363
+ if ( $image_meta ) {
364
+ $metadata['image_meta'] = $image_meta;
365
+ }
366
+ }
367
+
368
+ return apply_filters( 'wp_generate_attachment_metadata', $metadata, $attachment_id );
369
+ }
370
+
371
+ load_plugin_textdomain( 'ajax-thumbnail-rebuild', false, basename( dirname( __FILE__ ) ) . '/languages' );
372
+
languages/ajax-thumbnail-rebuild-de_DE.mo CHANGED
Binary file
languages/ajax-thumbnail-rebuild-de_DE.po CHANGED
@@ -4,74 +4,85 @@ msgid ""
4
  msgstr ""
5
  "Project-Id-Version: AJAX Thumbnail Rebuild 1.05\n"
6
  "Report-Msgid-Bugs-To: http://wordpress.org/tag/ajax-thumbnail-rebuild\n"
7
- "POT-Creation-Date: 2011-12-02 18:02:56+00:00\n"
 
 
 
 
8
  "MIME-Version: 1.0\n"
9
  "Content-Type: text/plain; charset=UTF-8\n"
10
  "Content-Transfer-Encoding: 8bit\n"
11
- "PO-Revision-Date: 2010-MO-DA HO:MI+ZONE\n"
12
 
13
- #: ajax-thumbnail-rebuild.php:33
14
  msgid "Rebuild all Thumbnails"
15
  msgstr "Alle Miniaturbilder neu erstellen"
16
 
17
- #: ajax-thumbnail-rebuild.php:33
18
  msgid "Rebuild Thumbnails"
19
  msgstr "Miniaturbilder neu erstellen"
20
 
21
- #: ajax-thumbnail-rebuild.php:50
22
  msgid "Reading attachments..."
23
  msgstr "Anhänge lesen..."
24
 
25
- #: ajax-thumbnail-rebuild.php:71
26
- msgid "No attachments found."
27
- msgstr "Keine Anhänge gefunden."
28
-
29
- #: ajax-thumbnail-rebuild.php:79
30
  msgid "Done."
31
  msgstr "Fertig."
32
 
33
- #: ajax-thumbnail-rebuild.php:82
34
- msgid "\"Rebuilding \" + %s + \" of \" + %s + \" (\" + %s + \")...\""
35
- msgstr "\"Erzeuge \" + %s + \" von \" + %s + \" (\" + %s + \") neu...\""
36
-
37
- #: ajax-thumbnail-rebuild.php:101
38
  msgid "Error"
39
  msgstr "Fehler"
40
 
41
- #: ajax-thumbnail-rebuild.php:118
 
 
 
 
 
 
 
 
 
 
 
 
 
42
  msgid "Select which thumbnails you want to rebuild"
43
  msgstr "Neu zu erstellende Miniaturbilder auswählen"
44
 
45
- #: ajax-thumbnail-rebuild.php:119
46
  msgid "Toggle all"
47
  msgstr "Auswahl umkehren"
48
 
49
- #: ajax-thumbnail-rebuild.php:129
50
  msgid "cropped"
51
  msgstr "beschneiden"
52
 
53
- #: ajax-thumbnail-rebuild.php:136
54
  msgid "Only rebuild featured images"
55
  msgstr "Nur Artikelbilder neu erstellen"
56
 
57
- #: ajax-thumbnail-rebuild.php:139
58
  msgid ""
59
  "Note: If you've changed the dimensions of your thumbnails, existing "
60
  "thumbnail images will not be deleted."
61
- msgstr "Hinweis: Bei Änderung der Dimensionen werden alte Bilder nicht gelöscht."
 
62
 
63
- #: ajax-thumbnail-rebuild.php:143
64
  msgid "Rebuild All Thumbnails"
65
  msgstr "Alle Miniaturbilder neu erzeugen"
66
 
67
- #: ajax-thumbnail-rebuild.php:147
68
  msgid "Last image"
69
  msgstr "Letztes Bild"
70
 
71
- #: ajax-thumbnail-rebuild.php:150
 
72
  msgid ""
73
- "If you find this plugin useful, I'd be happy to read your comments on the %"
74
- "splugin homepage%s. If you experience any problems, feel free to leave a "
75
  "comment too."
76
  msgstr ""
77
 
4
  msgstr ""
5
  "Project-Id-Version: AJAX Thumbnail Rebuild 1.05\n"
6
  "Report-Msgid-Bugs-To: http://wordpress.org/tag/ajax-thumbnail-rebuild\n"
7
+ "POT-Creation-Date: 2017-09-26 09:37+0300\n"
8
+ "PO-Revision-Date: 2017-09-26 09:39+0300\n"
9
+ "Last-Translator: \n"
10
+ "Language-Team: \n"
11
+ "Language: de_DE\n"
12
  "MIME-Version: 1.0\n"
13
  "Content-Type: text/plain; charset=UTF-8\n"
14
  "Content-Transfer-Encoding: 8bit\n"
15
+ "X-Generator: Poedit 2.0.3\n"
16
 
17
+ #: ajax-thumbnail-rebuild.php:35
18
  msgid "Rebuild all Thumbnails"
19
  msgstr "Alle Miniaturbilder neu erstellen"
20
 
21
+ #: ajax-thumbnail-rebuild.php:35
22
  msgid "Rebuild Thumbnails"
23
  msgstr "Miniaturbilder neu erstellen"
24
 
25
+ #: ajax-thumbnail-rebuild.php:64 ajax-thumbnail-rebuild.php:110
26
  msgid "Reading attachments..."
27
  msgstr "Anhänge lesen..."
28
 
29
+ #: ajax-thumbnail-rebuild.php:72 ajax-thumbnail-rebuild.php:139
 
 
 
 
30
  msgid "Done."
31
  msgstr "Fertig."
32
 
33
+ #: ajax-thumbnail-rebuild.php:76 ajax-thumbnail-rebuild.php:163
 
 
 
 
34
  msgid "Error"
35
  msgstr "Fehler"
36
 
37
+ #: ajax-thumbnail-rebuild.php:90
38
+ msgid "Ajax Thumbnail Rebuild"
39
+ msgstr ""
40
+
41
+ #: ajax-thumbnail-rebuild.php:131
42
+ msgid "No attachments found."
43
+ msgstr "Keine Anhänge gefunden."
44
+
45
+ #: ajax-thumbnail-rebuild.php:143
46
+ #, php-format
47
+ msgid "Rebuilding %s of %s (%s)..."
48
+ msgstr "Erzeuge %s von %s (%s) neu..."
49
+
50
+ #: ajax-thumbnail-rebuild.php:180
51
  msgid "Select which thumbnails you want to rebuild"
52
  msgstr "Neu zu erstellende Miniaturbilder auswählen"
53
 
54
+ #: ajax-thumbnail-rebuild.php:181
55
  msgid "Toggle all"
56
  msgstr "Auswahl umkehren"
57
 
58
+ #: ajax-thumbnail-rebuild.php:191
59
  msgid "cropped"
60
  msgstr "beschneiden"
61
 
62
+ #: ajax-thumbnail-rebuild.php:202
63
  msgid "Only rebuild featured images"
64
  msgstr "Nur Artikelbilder neu erstellen"
65
 
66
+ #: ajax-thumbnail-rebuild.php:206
67
  msgid ""
68
  "Note: If you've changed the dimensions of your thumbnails, existing "
69
  "thumbnail images will not be deleted."
70
+ msgstr ""
71
+ "Hinweis: Bei Änderung der Dimensionen werden alte Bilder nicht gelöscht."
72
 
73
+ #: ajax-thumbnail-rebuild.php:209
74
  msgid "Rebuild All Thumbnails"
75
  msgstr "Alle Miniaturbilder neu erzeugen"
76
 
77
+ #: ajax-thumbnail-rebuild.php:213
78
  msgid "Last image"
79
  msgstr "Letztes Bild"
80
 
81
+ #: ajax-thumbnail-rebuild.php:216
82
+ #, php-format
83
  msgid ""
84
+ "If you find this plugin useful, I'd be happy to read your comments on the "
85
+ "%splugin homepage%s. If you experience any problems, feel free to leave a "
86
  "comment too."
87
  msgstr ""
88
 
languages/ajax-thumbnail-rebuild-et.mo ADDED
Binary file
languages/ajax-thumbnail-rebuild-et.po ADDED
@@ -0,0 +1,95 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ msgid ""
2
+ msgstr ""
3
+ "Project-Id-Version: Ajax Thumbnail Rebuild\n"
4
+ "Report-Msgid-Bugs-To: http://wordpress.org/support/theme/style\n"
5
+ "POT-Creation-Date: 2017-09-26 09:29+0300\n"
6
+ "PO-Revision-Date: 2017-09-26 09:37+0300\n"
7
+ "Last-Translator: Risto Niinemets <risto@konekt.ee>\n"
8
+ "Language-Team: \n"
9
+ "Language: et_EE\n"
10
+ "MIME-Version: 1.0\n"
11
+ "Content-Type: text/plain; charset=UTF-8\n"
12
+ "Content-Transfer-Encoding: 8bit\n"
13
+ "X-Generator: Poedit 2.0.3\n"
14
+ "X-Poedit-Basepath: .\n"
15
+ "Plural-Forms: nplurals=2; plural=(n != 1);\n"
16
+ "X-Poedit-KeywordsList: __;_e;_n:1,2;_x:1,2c;_ex:1,2c\n"
17
+ "X-Poedit-SourceCharset: UTF-8\n"
18
+ "X-Poedit-SearchPath-0: ..\n"
19
+ "X-Poedit-SearchPathExcluded-0: ../.git\n"
20
+ "X-Poedit-SearchPathExcluded-1: .git\n"
21
+
22
+ #: ../ajax-thumbnail-rebuild.php:35
23
+ msgid "Rebuild all Thumbnails"
24
+ msgstr "Uuenda valitud suurused"
25
+
26
+ #: ../ajax-thumbnail-rebuild.php:35
27
+ msgid "Rebuild Thumbnails"
28
+ msgstr "Pisipiltide uuendamine"
29
+
30
+ #: ../ajax-thumbnail-rebuild.php:64 ../ajax-thumbnail-rebuild.php:110
31
+ msgid "Reading attachments..."
32
+ msgstr "Laeme sisse pilte..."
33
+
34
+ #: ../ajax-thumbnail-rebuild.php:72 ../ajax-thumbnail-rebuild.php:139
35
+ msgid "Done."
36
+ msgstr "Uuendatud!"
37
+
38
+ #: ../ajax-thumbnail-rebuild.php:76 ../ajax-thumbnail-rebuild.php:163
39
+ msgid "Error"
40
+ msgstr "Viga"
41
+
42
+ #: ../ajax-thumbnail-rebuild.php:90
43
+ msgid "Ajax Thumbnail Rebuild"
44
+ msgstr "Ajax Thumbnail Rebuild"
45
+
46
+ #: ../ajax-thumbnail-rebuild.php:131
47
+ msgid "No attachments found."
48
+ msgstr "Pilte ei leitud."
49
+
50
+ #: ../ajax-thumbnail-rebuild.php:143
51
+ #, php-format
52
+ msgid "Rebuilding %s of %s (%s)..."
53
+ msgstr "Uuendame pilti %s/%s (%s)..."
54
+
55
+ #: ../ajax-thumbnail-rebuild.php:180
56
+ msgid "Select which thumbnails you want to rebuild"
57
+ msgstr "Vali piltide suurused, mida soovid uuendada"
58
+
59
+ #: ../ajax-thumbnail-rebuild.php:181
60
+ msgid "Toggle all"
61
+ msgstr "Vali kõik"
62
+
63
+ #: ../ajax-thumbnail-rebuild.php:191
64
+ msgid "cropped"
65
+ msgstr "lõigatud"
66
+
67
+ #: ../ajax-thumbnail-rebuild.php:202
68
+ msgid "Only rebuild featured images"
69
+ msgstr "Uuenda ainult tunnuspilte"
70
+
71
+ #: ../ajax-thumbnail-rebuild.php:206
72
+ msgid ""
73
+ "Note: If you've changed the dimensions of your thumbnails, existing "
74
+ "thumbnail images will not be deleted."
75
+ msgstr ""
76
+ "Märkus: kui sa oled muutnud pisipiltide suuruseid, siis olemasolevaid "
77
+ "pisipilte ei kustutata."
78
+
79
+ #: ../ajax-thumbnail-rebuild.php:209
80
+ msgid "Rebuild All Thumbnails"
81
+ msgstr "Uuenda valitud suurused"
82
+
83
+ #: ../ajax-thumbnail-rebuild.php:213
84
+ msgid "Last image"
85
+ msgstr "Eelmine pilt"
86
+
87
+ #: ../ajax-thumbnail-rebuild.php:216
88
+ #, php-format
89
+ msgid ""
90
+ "If you find this plugin useful, I'd be happy to read your comments on the "
91
+ "%splugin homepage%s. If you experience any problems, feel free to leave a "
92
+ "comment too."
93
+ msgstr ""
94
+ "Kui see plugin on sulle kasulik, anna sellest teada %smeie kodulehel%s. "
95
+ "Probleemide korral anna ka nendest teada."
languages/ajax-thumbnail-rebuild-ja.mo ADDED
Binary file
languages/ajax-thumbnail-rebuild-ja.po ADDED
@@ -0,0 +1,65 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Copyright (C) 2010 AJAX Thumbnail Rebuild
2
+ # This file is distributed under the same license as the AJAX Thumbnail Rebuild package.
3
+ msgid ""
4
+ msgstr ""
5
+ "Project-Id-Version: AJAX Thumbnail Rebuild 1.05\n"
6
+ "Report-Msgid-Bugs-To: http://wordpress.org/tag/ajax-thumbnail-rebuild\n"
7
+ "POT-Creation-Date: 2014-03-23 18:13+0900\n"
8
+ "PO-Revision-Date: 2014-03-23 18:19+0900\n"
9
+ "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
10
+ "Language-Team: michie <michieyamamoto.design@gmail.com>\n"
11
+ "Language: ja_JP\n"
12
+ "MIME-Version: 1.0\n"
13
+ "Content-Type: text/plain; charset=UTF-8\n"
14
+ "Content-Transfer-Encoding: 8bit\n"
15
+ "X-Generator: Poedit 1.6.4\n"
16
+ "X-Poedit-KeywordsList: __;_e\n"
17
+ "X-Poedit-Basepath: ..\n"
18
+ "X-Poedit-SearchPath-0: ..\n"
19
+
20
+ #: ../ajax-thumbnail-rebuild/ajax-thumbnail-rebuild.php:50
21
+ msgid "Reading attachments..."
22
+ msgstr "画像を読み込んでいます..."
23
+
24
+ #: ../ajax-thumbnail-rebuild/ajax-thumbnail-rebuild.php:71
25
+ msgid "No attachments found."
26
+ msgstr "画像が見つかりません"
27
+
28
+ #: ../ajax-thumbnail-rebuild/ajax-thumbnail-rebuild.php:79
29
+ msgid "Done."
30
+ msgstr "完了です"
31
+
32
+ #: ../ajax-thumbnail-rebuild/ajax-thumbnail-rebuild.php:101
33
+ msgid "Error"
34
+ msgstr "エラー"
35
+
36
+ #: ../ajax-thumbnail-rebuild/ajax-thumbnail-rebuild.php:118
37
+ msgid "Select which thumbnails you want to rebuild"
38
+ msgstr "再生成したいサムネイルを選んでください"
39
+
40
+ #: ../ajax-thumbnail-rebuild/ajax-thumbnail-rebuild.php:119
41
+ msgid "Toggle all"
42
+ msgstr "すべてを選択"
43
+
44
+ #: ../ajax-thumbnail-rebuild/ajax-thumbnail-rebuild.php:129
45
+ msgid "cropped"
46
+ msgstr "トリミング"
47
+
48
+ #: ../ajax-thumbnail-rebuild/ajax-thumbnail-rebuild.php:137
49
+ msgid "Only rebuild featured images"
50
+ msgstr "アイキャッチ画像のみ再生成"
51
+
52
+ #: ../ajax-thumbnail-rebuild/ajax-thumbnail-rebuild.php:141
53
+ msgid ""
54
+ "Note: If you've changed the dimensions of your thumbnails, existing "
55
+ "thumbnail images will not be deleted."
56
+ msgstr ""
57
+ "参考:サムネイルの寸法を変更した場合、現在のサムネイル画像は削除されません"
58
+
59
+ #: ../ajax-thumbnail-rebuild/ajax-thumbnail-rebuild.php:145
60
+ msgid "Rebuild All Thumbnails"
61
+ msgstr "サムネイルの再生成"
62
+
63
+ #: ../ajax-thumbnail-rebuild/ajax-thumbnail-rebuild.php:149
64
+ msgid "Last image"
65
+ msgstr "最後の画像"
languages/ajax-thumbnail-rebuild.pot CHANGED
@@ -1,79 +1,94 @@
1
- # Copyright (C) 2010 AJAX Thumbnail Rebuild
2
- # This file is distributed under the same license as the AJAX Thumbnail Rebuild package.
3
  msgid ""
4
  msgstr ""
5
- "Project-Id-Version: AJAX Thumbnail Rebuild 1.05\n"
6
- "Report-Msgid-Bugs-To: http://wordpress.org/tag/ajax-thumbnail-rebuild\n"
7
- "POT-Creation-Date: 2011-12-02 18:11:04+00:00\n"
 
 
 
8
  "MIME-Version: 1.0\n"
9
  "Content-Type: text/plain; charset=UTF-8\n"
10
  "Content-Transfer-Encoding: 8bit\n"
11
- "PO-Revision-Date: 2010-MO-DA HO:MI+ZONE\n"
12
- "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
13
- "Language-Team: LANGUAGE <LL@li.org>\n"
14
-
15
- #: ajax-thumbnail-rebuild.php:33
 
 
 
 
 
 
 
16
  msgid "Rebuild all Thumbnails"
17
  msgstr ""
18
 
19
- #: ajax-thumbnail-rebuild.php:33
20
  msgid "Rebuild Thumbnails"
21
  msgstr ""
22
 
23
- #: ajax-thumbnail-rebuild.php:50
24
  msgid "Reading attachments..."
25
  msgstr ""
26
 
27
- #: ajax-thumbnail-rebuild.php:71
28
- msgid "No attachments found."
29
  msgstr ""
30
 
31
- #: ajax-thumbnail-rebuild.php:79
32
- msgid "Done."
33
  msgstr ""
34
 
35
- #: ajax-thumbnail-rebuild.php:82
36
- msgid "\"Rebuilding \" + %s + \" of \" + %s + \" (\" + %s + \")...\""
37
  msgstr ""
38
 
39
- #: ajax-thumbnail-rebuild.php:101
40
- msgid "Error"
41
  msgstr ""
42
 
43
- #: ajax-thumbnail-rebuild.php:118
 
 
 
 
 
44
  msgid "Select which thumbnails you want to rebuild"
45
  msgstr ""
46
 
47
- #: ajax-thumbnail-rebuild.php:119
48
  msgid "Toggle all"
49
  msgstr ""
50
 
51
- #: ajax-thumbnail-rebuild.php:129
52
  msgid "cropped"
53
  msgstr ""
54
 
55
- #: ajax-thumbnail-rebuild.php:136
56
  msgid "Only rebuild featured images"
57
  msgstr ""
58
 
59
- #: ajax-thumbnail-rebuild.php:139
60
  msgid ""
61
  "Note: If you've changed the dimensions of your thumbnails, existing "
62
  "thumbnail images will not be deleted."
63
  msgstr ""
64
 
65
- #: ajax-thumbnail-rebuild.php:143
66
  msgid "Rebuild All Thumbnails"
67
  msgstr ""
68
 
69
- #: ajax-thumbnail-rebuild.php:147
70
  msgid "Last image"
71
  msgstr ""
72
 
73
- #: ajax-thumbnail-rebuild.php:150
 
74
  msgid ""
75
- "If you find this plugin useful, I'd be happy to read your comments on the %"
76
- "splugin homepage%s. If you experience any problems, feel free to leave a "
77
  "comment too."
78
  msgstr ""
79
 
1
+ #, fuzzy
 
2
  msgid ""
3
  msgstr ""
4
+ "Plural-Forms: nplurals=INTEGER; plural=EXPRESSION;\n"
5
+ "Project-Id-Version: AJAX Thumbnail Rebuild\n"
6
+ "POT-Creation-Date: 2017-09-26 09:37+0300\n"
7
+ "PO-Revision-Date: 2017-09-26 09:37+0300\n"
8
+ "Last-Translator: \n"
9
+ "Language-Team: \n"
10
  "MIME-Version: 1.0\n"
11
  "Content-Type: text/plain; charset=UTF-8\n"
12
  "Content-Transfer-Encoding: 8bit\n"
13
+ "X-Generator: Poedit 2.0.3\n"
14
+ "X-Poedit-Basepath: ..\n"
15
+ "X-Poedit-Flags-xgettext: --add-comments=translators:\n"
16
+ "X-Poedit-WPHeader: ajax-thumbnail-rebuild.php\n"
17
+ "X-Poedit-SourceCharset: UTF-8\n"
18
+ "X-Poedit-KeywordsList: __;_e;_n:1,2;_x:1,2c;_ex:1,2c;_nx:4c,1,2;esc_attr__;"
19
+ "esc_attr_e;esc_attr_x:1,2c;esc_html__;esc_html_e;esc_html_x:1,2c;_n_noop:1,2;"
20
+ "_nx_noop:3c,1,2;__ngettext_noop:1,2\n"
21
+ "X-Poedit-SearchPath-0: .\n"
22
+ "X-Poedit-SearchPathExcluded-0: *.js\n"
23
+
24
+ #: ajax-thumbnail-rebuild.php:35
25
  msgid "Rebuild all Thumbnails"
26
  msgstr ""
27
 
28
+ #: ajax-thumbnail-rebuild.php:35
29
  msgid "Rebuild Thumbnails"
30
  msgstr ""
31
 
32
+ #: ajax-thumbnail-rebuild.php:64 ajax-thumbnail-rebuild.php:110
33
  msgid "Reading attachments..."
34
  msgstr ""
35
 
36
+ #: ajax-thumbnail-rebuild.php:72 ajax-thumbnail-rebuild.php:139
37
+ msgid "Done."
38
  msgstr ""
39
 
40
+ #: ajax-thumbnail-rebuild.php:76 ajax-thumbnail-rebuild.php:163
41
+ msgid "Error"
42
  msgstr ""
43
 
44
+ #: ajax-thumbnail-rebuild.php:90
45
+ msgid "Ajax Thumbnail Rebuild"
46
  msgstr ""
47
 
48
+ #: ajax-thumbnail-rebuild.php:131
49
+ msgid "No attachments found."
50
  msgstr ""
51
 
52
+ #: ajax-thumbnail-rebuild.php:143
53
+ #, php-format
54
+ msgid "Rebuilding %s of %s (%s)..."
55
+ msgstr ""
56
+
57
+ #: ajax-thumbnail-rebuild.php:180
58
  msgid "Select which thumbnails you want to rebuild"
59
  msgstr ""
60
 
61
+ #: ajax-thumbnail-rebuild.php:181
62
  msgid "Toggle all"
63
  msgstr ""
64
 
65
+ #: ajax-thumbnail-rebuild.php:191
66
  msgid "cropped"
67
  msgstr ""
68
 
69
+ #: ajax-thumbnail-rebuild.php:202
70
  msgid "Only rebuild featured images"
71
  msgstr ""
72
 
73
+ #: ajax-thumbnail-rebuild.php:206
74
  msgid ""
75
  "Note: If you've changed the dimensions of your thumbnails, existing "
76
  "thumbnail images will not be deleted."
77
  msgstr ""
78
 
79
+ #: ajax-thumbnail-rebuild.php:209
80
  msgid "Rebuild All Thumbnails"
81
  msgstr ""
82
 
83
+ #: ajax-thumbnail-rebuild.php:213
84
  msgid "Last image"
85
  msgstr ""
86
 
87
+ #: ajax-thumbnail-rebuild.php:216
88
+ #, php-format
89
  msgid ""
90
+ "If you find this plugin useful, I'd be happy to read your comments on the "
91
+ "%splugin homepage%s. If you experience any problems, feel free to leave a "
92
  "comment too."
93
  msgstr ""
94
 
languages/ajax-thumbnail-rebuild_sk_SK.po CHANGED
@@ -1,100 +1,100 @@
1
- # Copyright (C) 2010 AJAX Thumbnail Rebuild
2
- # This file is distributed under the same license as the AJAX Thumbnail Rebuild package.
3
- msgid ""
4
- msgstr ""
5
- "Project-Id-Version: AJAX Thumbnail Rebuild 1.05\n"
6
- "Report-Msgid-Bugs-To: http://wordpress.org/tag/ajax-thumbnail-rebuild\n"
7
- "POT-Creation-Date: 2011-12-02 18:11:04+00:00\n"
8
- "MIME-Version: 1.0\n"
9
- "Content-Type: text/plain; charset=UTF-8\n"
10
- "Content-Transfer-Encoding: 8bit\n"
11
- "PO-Revision-Date: 2013-01-16 12:23+0300\n"
12
- "Last-Translator: \n"
13
- "Language-Team: LANGUAGE <LL@li.org>\n"
14
- "X-Generator: Poedit 1.5.4\n"
15
-
16
- #: ajax-thumbnail-rebuild.php:33
17
- msgid "Rebuild all Thumbnails"
18
- msgstr "Obnoviť všetky miniatúry"
19
-
20
- #: ajax-thumbnail-rebuild.php:33
21
- msgid "Rebuild Thumbnails"
22
- msgstr "Prestavať miniatúry"
23
-
24
- #: ajax-thumbnail-rebuild.php:50
25
- msgid "Reading attachments..."
26
- msgstr "Čítanie prílohy..."
27
-
28
- #: ajax-thumbnail-rebuild.php:71
29
- msgid "No attachments found."
30
- msgstr "Žiadne prílohy našiel."
31
-
32
- #: ajax-thumbnail-rebuild.php:79
33
- msgid "Done."
34
- msgstr "Hotovo."
35
-
36
- #: ajax-thumbnail-rebuild.php:101
37
- msgid "Error"
38
- msgstr "Chyba"
39
-
40
- #: ajax-thumbnail-rebuild.php:118
41
- msgid "Select which thumbnails you want to rebuild"
42
- msgstr "Vyberte ktoré miniatúry chcete obnoviť"
43
-
44
- #: ajax-thumbnail-rebuild.php:119
45
- msgid "Toggle all"
46
- msgstr "Prepnúť všetky"
47
-
48
- #: ajax-thumbnail-rebuild.php:129
49
- msgid "cropped"
50
- msgstr "orezané"
51
-
52
- #: ajax-thumbnail-rebuild.php:136
53
- msgid "Only rebuild featured images"
54
- msgstr "Len obnovu obrázkov"
55
-
56
- #: ajax-thumbnail-rebuild.php:139
57
- msgid ""
58
- "Note: If you've changed the dimensions of your thumbnails, existing "
59
- "thumbnail images will not be deleted."
60
- msgstr ""
61
- "Poznámka: Ak ste zmenili rozmery miniatúr, existujúce náhľadmi sa "
62
- "neodstránia."
63
-
64
- #: ajax-thumbnail-rebuild.php:143
65
- msgid "Rebuild All Thumbnails"
66
- msgstr "Obnoviť všetky miniatúry"
67
-
68
- #: ajax-thumbnail-rebuild.php:147
69
- msgid "Last image"
70
- msgstr "Posledný obrázok"
71
-
72
- #: ajax-thumbnail-rebuild.php:150
73
- msgid ""
74
- "If you find this plugin useful, I'd be happy to read your comments on the % "
75
- "splugin homepage%s. If you experience any problems, feel free to leave a "
76
- "comment too."
77
- msgstr ""
78
- "Ak zistíte, že tento plugin užitočné, budem rád, že čítať vaše komentáre na "
79
- "domovskej stránke % splugin % s. Ak sa vyskytnú nejaké problémy, neváhajte a "
80
- "zanechať komentár príliš."
81
-
82
- #. Plugin Name of the plugin/theme
83
- msgid "AJAX Thumbnail Rebuild"
84
- msgstr "AJAX náhľad prestavať"
85
-
86
- #. Plugin URI of the plugin/theme
87
- msgid "http://breiti.cc/wordpress/ajax-thumbnail-rebuild"
88
- msgstr "http://breiti.cc/wordpress/ajax-thumbnail-rebuild"
89
-
90
- #. Description of the plugin/theme
91
- msgid "Rebuild all thumbnails"
92
- msgstr "Obnoviť všetky miniatúry"
93
-
94
- #. Author of the plugin/theme
95
- msgid "junkcoder"
96
- msgstr "junkcoder"
97
-
98
- #. Author URI of the plugin/theme
99
- msgid "http://breiti.cc"
100
- msgstr "http://breiti.cc"
1
+ # Copyright (C) 2010 AJAX Thumbnail Rebuild
2
+ # This file is distributed under the same license as the AJAX Thumbnail Rebuild package.
3
+ msgid ""
4
+ msgstr ""
5
+ "Project-Id-Version: AJAX Thumbnail Rebuild 1.05\n"
6
+ "Report-Msgid-Bugs-To: http://wordpress.org/tag/ajax-thumbnail-rebuild\n"
7
+ "POT-Creation-Date: 2011-12-02 18:11:04+00:00\n"
8
+ "MIME-Version: 1.0\n"
9
+ "Content-Type: text/plain; charset=UTF-8\n"
10
+ "Content-Transfer-Encoding: 8bit\n"
11
+ "PO-Revision-Date: 2013-01-16 12:23+0300\n"
12
+ "Last-Translator: \n"
13
+ "Language-Team: LANGUAGE <LL@li.org>\n"
14
+ "X-Generator: Poedit 1.5.4\n"
15
+
16
+ #: ajax-thumbnail-rebuild.php:33
17
+ msgid "Rebuild all Thumbnails"
18
+ msgstr "Obnoviť všetky miniatúry"
19
+
20
+ #: ajax-thumbnail-rebuild.php:33
21
+ msgid "Rebuild Thumbnails"
22
+ msgstr "Prestavať miniatúry"
23
+
24
+ #: ajax-thumbnail-rebuild.php:50
25
+ msgid "Reading attachments..."
26
+ msgstr "Čítanie prílohy..."
27
+
28
+ #: ajax-thumbnail-rebuild.php:71
29
+ msgid "No attachments found."
30
+ msgstr "Žiadne prílohy našiel."
31
+
32
+ #: ajax-thumbnail-rebuild.php:79
33
+ msgid "Done."
34
+ msgstr "Hotovo."
35
+
36
+ #: ajax-thumbnail-rebuild.php:101
37
+ msgid "Error"
38
+ msgstr "Chyba"
39
+
40
+ #: ajax-thumbnail-rebuild.php:118
41
+ msgid "Select which thumbnails you want to rebuild"
42
+ msgstr "Vyberte ktoré miniatúry chcete obnoviť"
43
+
44
+ #: ajax-thumbnail-rebuild.php:119
45
+ msgid "Toggle all"
46
+ msgstr "Prepnúť všetky"
47
+
48
+ #: ajax-thumbnail-rebuild.php:129
49
+ msgid "cropped"
50
+ msgstr "orezané"
51
+
52
+ #: ajax-thumbnail-rebuild.php:136
53
+ msgid "Only rebuild featured images"
54
+ msgstr "Len obnovu obrázkov"
55
+
56
+ #: ajax-thumbnail-rebuild.php:139
57
+ msgid ""
58
+ "Note: If you've changed the dimensions of your thumbnails, existing "
59
+ "thumbnail images will not be deleted."
60
+ msgstr ""
61
+ "Poznámka: Ak ste zmenili rozmery miniatúr, existujúce náhľadmi sa "
62
+ "neodstránia."
63
+
64
+ #: ajax-thumbnail-rebuild.php:143
65
+ msgid "Rebuild All Thumbnails"
66
+ msgstr "Obnoviť všetky miniatúry"
67
+
68
+ #: ajax-thumbnail-rebuild.php:147
69
+ msgid "Last image"
70
+ msgstr "Posledný obrázok"
71
+
72
+ #: ajax-thumbnail-rebuild.php:150
73
+ msgid ""
74
+ "If you find this plugin useful, I'd be happy to read your comments on the % "
75
+ "splugin homepage%s. If you experience any problems, feel free to leave a "
76
+ "comment too."
77
+ msgstr ""
78
+ "Ak zistíte, že tento plugin užitočné, budem rád, že čítať vaše komentáre na "
79
+ "domovskej stránke % splugin % s. Ak sa vyskytnú nejaké problémy, neváhajte a "
80
+ "zanechať komentár príliš."
81
+
82
+ #. Plugin Name of the plugin/theme
83
+ msgid "AJAX Thumbnail Rebuild"
84
+ msgstr "AJAX náhľad prestavať"
85
+
86
+ #. Plugin URI of the plugin/theme
87
+ msgid "http://breiti.cc/wordpress/ajax-thumbnail-rebuild"
88
+ msgstr "http://breiti.cc/wordpress/ajax-thumbnail-rebuild"
89
+
90
+ #. Description of the plugin/theme
91
+ msgid "Rebuild all thumbnails"
92
+ msgstr "Obnoviť všetky miniatúry"
93
+
94
+ #. Author of the plugin/theme
95
+ msgid "junkcoder"
96
+ msgstr "junkcoder"
97
+
98
+ #. Author URI of the plugin/theme
99
+ msgid "http://breiti.cc"
100
+ msgstr "http://breiti.cc"
readme.txt CHANGED
@@ -1,10 +1,10 @@
1
  === AJAX Thumbnail Rebuild ===
2
- Contributors: junkcoder
3
- Donate link: http://breiti.cc/wordpress/ajax-thumbnail-rebuild/#donate
4
  Tags: ajax, thumbnail, rebuild, regenerate, admin, image, photo
5
  Requires at least: 2.8
6
- Tested up to: 3.9
7
- Stable tag: 1.12
8
 
9
  AJAX Thumbnail Rebuild allows you to rebuild all thumbnails at once without script timeouts on your server.
10
 
@@ -18,29 +18,37 @@ You can also select the thumbnail sizes you want to rebuild, so that you don't n
18
 
19
  This plugin requires JavaScript to be enabled.
20
 
 
 
 
 
21
  == Installation ==
22
 
23
  Upload the plugin to your blog, activate it, done. You can then rebuild all thumbnails in the tools section (Tools -> Rebuild Thumbnails).
24
 
25
  == Changelog ==
26
 
27
- = 1.12 =
28
-
29
- * FIX: An issue where rebuilding thumbnails in the media gallery
30
- would not work
31
-
32
- = 1.11 =
33
-
34
- * FIX: An issue where the plugin would sometimes break the media gallery.
35
-
36
- = 1.10 =
37
-
38
- * NEW: Rebuild thumbnails of single images on the media attachment page.
39
-
40
- = 1.09 =
41
-
42
- * NEW: Checkboxes can be activated by clicking on text.
43
-
 
 
 
 
44
  = 1.08 =
45
 
46
  * NEW: Slovak translation, provided by Branco Radenovich.
1
  === AJAX Thumbnail Rebuild ===
2
+ Contributors: junkcoder, RistoNiinemets
3
+ Donate link: http://breiti.cc/wordpress/ajax-thumbnail-rebuild/#donate
4
  Tags: ajax, thumbnail, rebuild, regenerate, admin, image, photo
5
  Requires at least: 2.8
6
+ Tested up to: 4.8.2
7
+ Stable tag: 1.2
8
 
9
  AJAX Thumbnail Rebuild allows you to rebuild all thumbnails at once without script timeouts on your server.
10
 
18
 
19
  This plugin requires JavaScript to be enabled.
20
 
21
+
22
+ Contributions are welcome at:
23
+ https://github.com/breiti/ajax-thumbnail-rebuild
24
+
25
  == Installation ==
26
 
27
  Upload the plugin to your blog, activate it, done. You can then rebuild all thumbnails in the tools section (Tools -> Rebuild Thumbnails).
28
 
29
  == Changelog ==
30
 
31
+ = 1.2 =
32
+
33
+ * Compatibility with PHP7
34
+
35
+ = 1.12 =
36
+
37
+ * FIX: An issue where rebuilding thumbnails in the media gallery
38
+ would not work
39
+
40
+ = 1.11 =
41
+
42
+ * FIX: An issue where the plugin would sometimes break the media gallery.
43
+
44
+ = 1.10 =
45
+
46
+ * NEW: Rebuild thumbnails of single images on the media attachment page.
47
+
48
+ = 1.09 =
49
+
50
+ * NEW: Checkboxes can be activated by clicking on text.
51
+
52
  = 1.08 =
53
 
54
  * NEW: Slovak translation, provided by Branco Radenovich.