Photo Gallery by WD – Responsive Photo Gallery - Version 1.2.99

Version Description

  • Fixed: Open lightbox from blog style, image browser and albums views.
  • Fixed: Vertical filmstrip with control buttons.
  • Added: Recreate all thumbnails at once.
Download this release

Release Info

Developer webdorado
Plugin Icon 128x128 Photo Gallery by WD – Responsive Photo Gallery
Version 1.2.99
Comparing to
See all releases

Code changes from version 1.2.98 to 1.2.99

admin/controllers/BWGControllerOptions_bwg.php CHANGED
@@ -381,14 +381,90 @@ class BWGControllerOptions_bwg {
381
  if (!is_dir(ABSPATH . $images_directory . '/photo-gallery')) {
382
  mkdir(ABSPATH . $images_directory . '/photo-gallery', 0777);
383
  }
384
- echo WDWLibrary::message(__('Item Succesfully Saved.', 'bwg_back'), 'updated');
385
-
 
 
 
 
 
386
  }
387
  else {
388
  echo WDWLibrary::message('Error. Please install plugin again.', 'error');
389
  }
390
  }
391
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
392
  ////////////////////////////////////////////////////////////////////////////////////////
393
  // Getters & Setters //
394
  ////////////////////////////////////////////////////////////////////////////////////////
381
  if (!is_dir(ABSPATH . $images_directory . '/photo-gallery')) {
382
  mkdir(ABSPATH . $images_directory . '/photo-gallery', 0777);
383
  }
384
+ if (isset($_POST['recreate']) && $_POST['recreate'] == "resize_image_thumb") {
385
+ $this->resize_image_thumb();
386
+ echo WDWLibrary::message(__('All thumbnails are successfully recreated.', 'bwg_back'), 'updated');
387
+ }
388
+ else {
389
+ echo WDWLibrary::message(__('Item Succesfully Saved.', 'bwg_back'), 'updated');
390
+ }
391
  }
392
  else {
393
  echo WDWLibrary::message('Error. Please install plugin again.', 'error');
394
  }
395
  }
396
 
397
+ public function resize_image_thumb() {
398
+ global $WD_BWG_UPLOAD_DIR;
399
+ global $wpdb;
400
+ $img_ids = $wpdb->get_results('SELECT id, thumb_url FROM ' . $wpdb->prefix . 'bwg_image');
401
+ $options = $wpdb->get_row('SELECT * FROM ' . $wpdb->prefix . 'bwg_option');
402
+ foreach ($img_ids as $img_id) {
403
+ $file_path = str_replace("thumb", ".original", htmlspecialchars_decode(ABSPATH . $WD_BWG_UPLOAD_DIR . $img_id->thumb_url, ENT_COMPAT | ENT_QUOTES));
404
+ $new_file_path = htmlspecialchars_decode(ABSPATH . $WD_BWG_UPLOAD_DIR . $img_id->thumb_url, ENT_COMPAT | ENT_QUOTES);
405
+ list($img_width, $img_height, $type) = @getimagesize(htmlspecialchars_decode($file_path, ENT_COMPAT | ENT_QUOTES));
406
+ if (!$img_width || !$img_height) {
407
+ continue;
408
+ }
409
+ $max_width = $options->upload_thumb_width;
410
+ $max_height = $options->upload_thumb_height;
411
+ $scale = min(
412
+ $max_width / $img_width,
413
+ $max_height / $img_height
414
+ );
415
+ @ini_set('memory_limit', '-1');
416
+ if (!function_exists('imagecreatetruecolor')) {
417
+ error_log('Function not found: imagecreatetruecolor');
418
+ return FALSE;
419
+ }
420
+ $new_width = $img_width * $scale;
421
+ $new_height = $img_height * $scale;
422
+ $dst_x = 0;
423
+ $dst_y = 0;
424
+ $new_img = @imagecreatetruecolor($new_width, $new_height);
425
+ switch ($type) {
426
+ case 2:
427
+ $src_img = @imagecreatefromjpeg($file_path);
428
+ $write_image = 'imagejpeg';
429
+ $image_quality = isset($options->jpeg_quality) ? $options->jpeg_quality : 75;
430
+ break;
431
+ case 1:
432
+ @imagecolortransparent($new_img, @imagecolorallocate($new_img, 0, 0, 0));
433
+ $src_img = @imagecreatefromgif($file_path);
434
+ $write_image = 'imagegif';
435
+ $image_quality = null;
436
+ break;
437
+ case 3:
438
+ @imagecolortransparent($new_img, @imagecolorallocate($new_img, 0, 0, 0));
439
+ @imagealphablending($new_img, false);
440
+ @imagesavealpha($new_img, true);
441
+ $src_img = @imagecreatefrompng($file_path);
442
+ $write_image = 'imagepng';
443
+ $image_quality = isset($options->png_quality) ? $options->png_quality : 9;
444
+ break;
445
+ default:
446
+ $src_img = null;
447
+ break;
448
+ }
449
+ $success = $src_img && @imagecopyresampled(
450
+ $new_img,
451
+ $src_img,
452
+ $dst_x,
453
+ $dst_y,
454
+ 0,
455
+ 0,
456
+ $new_width,
457
+ $new_height,
458
+ $img_width,
459
+ $img_height
460
+ ) && $write_image($new_img, $new_file_path, $image_quality);
461
+ // Free up memory (imagedestroy does not delete files):
462
+ @imagedestroy($src_img);
463
+ @imagedestroy($new_img);
464
+ @ini_restore('memory_limit');
465
+ }
466
+ }
467
+
468
  ////////////////////////////////////////////////////////////////////////////////////////
469
  // Getters & Setters //
470
  ////////////////////////////////////////////////////////////////////////////////////////
admin/views/BWGViewOptions_bwg.php CHANGED
@@ -1347,6 +1347,7 @@ class BWGViewOptions_bwg {
1347
  <td>
1348
  <input type="text" name="upload_thumb_width" id="upload_thumb_width" value="<?php echo $row->upload_thumb_width; ?>" class="spider_int_input" /> x
1349
  <input type="text" name="upload_thumb_height" id="upload_thumb_height" value="<?php echo $row->upload_thumb_height; ?>" class="spider_int_input" /> px
 
1350
  <div class="spider_description"><?php _e("The maximum size of the generated thumbnail. Its dimensions should be larger than the ones of the frontend thumbnail.", 'bwg_back'); ?></div>
1351
  </td>
1352
  </tr>
@@ -1646,12 +1647,11 @@ class BWGViewOptions_bwg {
1646
  </td>
1647
  </tr>
1648
  </table>
1649
- <div class="spider_description spider_free_version"><?php _e("Carousel view is disabled in free version.", 'bwg_back'); ?></div>
1650
  </div>
1651
-
1652
  </div>
1653
-
1654
  <input id="task" name="task" type="hidden" value="" />
 
1655
  <input id="current_id" name="current_id" type="hidden" value="<?php echo $row->id; ?>" />
1656
  <script>
1657
  window.onload = bwg_change_option_type('<?php echo isset($_POST['type']) ? esc_html($_POST['type']) : '1'; ?>');
1347
  <td>
1348
  <input type="text" name="upload_thumb_width" id="upload_thumb_width" value="<?php echo $row->upload_thumb_width; ?>" class="spider_int_input" /> x
1349
  <input type="text" name="upload_thumb_height" id="upload_thumb_height" value="<?php echo $row->upload_thumb_height; ?>" class="spider_int_input" /> px
1350
+ <input type="submit" class="button-secondary" onclick="spider_set_input_value('task', 'save'); spider_set_input_value('recreate', 'resize_image_thumb');" value="<?php echo __('Recreate', 'bwg_back'); ?>" />
1351
  <div class="spider_description"><?php _e("The maximum size of the generated thumbnail. Its dimensions should be larger than the ones of the frontend thumbnail.", 'bwg_back'); ?></div>
1352
  </td>
1353
  </tr>
1647
  </td>
1648
  </tr>
1649
  </table>
1650
+ <div class="spider_description spider_free_version"><?php _e("Carousel view is disabled in free version.", 'bwg_back'); ?></div>
1651
  </div>
 
1652
  </div>
 
1653
  <input id="task" name="task" type="hidden" value="" />
1654
+ <input id="recreate" name="recreate" type="hidden" value="" />
1655
  <input id="current_id" name="current_id" type="hidden" value="<?php echo $row->id; ?>" />
1656
  <script>
1657
  window.onload = bwg_change_option_type('<?php echo isset($_POST['type']) ? esc_html($_POST['type']) : '1'; ?>');
photo-gallery.php CHANGED
@@ -4,7 +4,7 @@
4
  * Plugin Name: Photo Gallery
5
  * Plugin URI: https://web-dorado.com/products/wordpress-photo-gallery-plugin.html
6
  * Description: This plugin is a fully responsive gallery plugin with advanced functionality. It allows having different image galleries for your posts and pages. You can create unlimited number of galleries, combine them into albums, and provide descriptions and tags.
7
- * Version: 1.2.98
8
  * Author: WebDorado
9
  * Author URI: https://web-dorado.com/
10
  * License: GNU/GPLv3 http://www.gnu.org/licenses/gpl-3.0.html
@@ -1911,7 +1911,7 @@ function bwg_activate() {
1911
  ));
1912
  }
1913
  $version = get_option("wd_bwg_version");
1914
- $new_version = '1.2.98';
1915
  if ($version && version_compare($version, $new_version, '<')) {
1916
  require_once WD_BWG_DIR . "/update/bwg_update.php";
1917
  bwg_update($version);
@@ -1965,7 +1965,7 @@ wp_oembed_add_provider( '#https://instagr(\.am|am\.com)/p/.*#i', 'https://api.in
1965
 
1966
  function bwg_update_hook() {
1967
  $version = get_option("wd_bwg_version");
1968
- $new_version = '1.2.98';
1969
  if ($version && version_compare($version, $new_version, '<')) {
1970
  require_once WD_BWG_DIR . "/update/bwg_update.php";
1971
  bwg_update($version);
4
  * Plugin Name: Photo Gallery
5
  * Plugin URI: https://web-dorado.com/products/wordpress-photo-gallery-plugin.html
6
  * Description: This plugin is a fully responsive gallery plugin with advanced functionality. It allows having different image galleries for your posts and pages. You can create unlimited number of galleries, combine them into albums, and provide descriptions and tags.
7
+ * Version: 1.2.99
8
  * Author: WebDorado
9
  * Author URI: https://web-dorado.com/
10
  * License: GNU/GPLv3 http://www.gnu.org/licenses/gpl-3.0.html
1911
  ));
1912
  }
1913
  $version = get_option("wd_bwg_version");
1914
+ $new_version = '1.2.99';
1915
  if ($version && version_compare($version, $new_version, '<')) {
1916
  require_once WD_BWG_DIR . "/update/bwg_update.php";
1917
  bwg_update($version);
1965
 
1966
  function bwg_update_hook() {
1967
  $version = get_option("wd_bwg_version");
1968
+ $new_version = '1.2.99';
1969
  if ($version && version_compare($version, $new_version, '<')) {
1970
  require_once WD_BWG_DIR . "/update/bwg_update.php";
1971
  bwg_update($version);
readme.txt CHANGED
@@ -4,7 +4,7 @@ Donate link: https://web-dorado.com/products/wordpress-photo-gallery-plugin.html
4
  Tags: photo, photo gallery, image gallery, video gallery, gallery, galleries, wordpress gallery plugin, images gallery, album, photo albums, simple gallery, best gallery plugin, free photo gallery, wp gallery, wordpress gallery, website gallery, gallery shortcode, best gallery, picture, pictures, gallery slider, photo album, photogallery, widget gallery, image, images, photos, gallery lightbox, photoset, wordpress photo gallery plugin, wp gallery plugins, responsive wordpress photo gallery, media, image album, filterable gallery, banner rotator, fullscreen gallery, responsive gallery, add album, add gallery, add pictures, fotoalbum, foto, gallery decription, multiple pictures, photoalbum, upload images, upload photos, view images, view pictures, admin, AJAX, comments, gallery image, image lightbox, image rotate, image slideshow, image slider, jquery, jquery gallery, slide show, slideshow, thumbnail, thumbnail view, thumbnails, thumbs, responsive, watermarking, watermarks,fullscreen slider, lightbox, photography, sidebar, slide, youtube, vimeo, videos, instagram, facebook, mosaic, facebook integration, instagram feed, Flickr, Dailymotion, widget, youtube gallery, ecommerce
5
  Requires at least: 3.4
6
  Tested up to: 4.5
7
- Stable tag: 1.2.98
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
@@ -225,6 +225,11 @@ To enable the feature of adding Media Library images, go to Photo Gallery > Opti
225
 
226
  == Changelog ==
227
 
 
 
 
 
 
228
  = 1.2.98 =
229
  * Added: Backend translation on Icelandic (thanks to Eggert Johannesson).
230
  * Fixed: Backend translation on Dutch.
4
  Tags: photo, photo gallery, image gallery, video gallery, gallery, galleries, wordpress gallery plugin, images gallery, album, photo albums, simple gallery, best gallery plugin, free photo gallery, wp gallery, wordpress gallery, website gallery, gallery shortcode, best gallery, picture, pictures, gallery slider, photo album, photogallery, widget gallery, image, images, photos, gallery lightbox, photoset, wordpress photo gallery plugin, wp gallery plugins, responsive wordpress photo gallery, media, image album, filterable gallery, banner rotator, fullscreen gallery, responsive gallery, add album, add gallery, add pictures, fotoalbum, foto, gallery decription, multiple pictures, photoalbum, upload images, upload photos, view images, view pictures, admin, AJAX, comments, gallery image, image lightbox, image rotate, image slideshow, image slider, jquery, jquery gallery, slide show, slideshow, thumbnail, thumbnail view, thumbnails, thumbs, responsive, watermarking, watermarks,fullscreen slider, lightbox, photography, sidebar, slide, youtube, vimeo, videos, instagram, facebook, mosaic, facebook integration, instagram feed, Flickr, Dailymotion, widget, youtube gallery, ecommerce
5
  Requires at least: 3.4
6
  Tested up to: 4.5
7
+ Stable tag: 1.2.99
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
225
 
226
  == Changelog ==
227
 
228
+ = 1.2.99 =
229
+ * Fixed: Open lightbox from blog style, image browser and albums views.
230
+ * Fixed: Vertical filmstrip with control buttons.
231
+ * Added: Recreate all thumbnails at once.
232
+
233
  = 1.2.98 =
234
  * Added: Backend translation on Icelandic (thanks to Eggert Johannesson).
235
  * Fixed: Backend translation on Dutch.