Photo Gallery by WD – Responsive Photo Gallery - Version 1.2.34

Version Description

New: Recreate thumbnail button in gallery page.

Download this release

Release Info

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

Code changes from version 1.2.33 to 1.2.34

admin/controllers/BWGControllerGalleries_bwg.php CHANGED
@@ -1004,6 +1004,86 @@ class BWGControllerGalleries_bwg {
1004
  }
1005
  $this->display();
1006
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1007
 
1008
  ////////////////////////////////////////////////////////////////////////////////////////
1009
  // Getters & Setters //
1004
  }
1005
  $this->display();
1006
  }
1007
+ public function resize_image_thumb() {
1008
+ global $WD_BWG_UPLOAD_DIR;
1009
+ global $wpdb;
1010
+ $flag = FALSE;
1011
+ $img_ids = $wpdb->get_results('SELECT * FROM ' . $wpdb->prefix . 'bwg_image');
1012
+ foreach ($img_ids as $img_id) {
1013
+ if (isset($_POST['check_' . $img_id->id]) || isset($_POST['check_all_items'])) {
1014
+ $flag = TRUE;
1015
+ $file_path = str_replace("thumb", ".original", htmlspecialchars_decode(ABSPATH . $WD_BWG_UPLOAD_DIR . $img_id->thumb_url, ENT_COMPAT | ENT_QUOTES));
1016
+ $new_file_path = htmlspecialchars_decode(ABSPATH . $WD_BWG_UPLOAD_DIR . $img_id->thumb_url, ENT_COMPAT | ENT_QUOTES);
1017
+ $options = $wpdb->get_row('SELECT * FROM ' . $wpdb->prefix . 'bwg_option');
1018
+ list($img_width, $img_height, $type) = @getimagesize(htmlspecialchars_decode($file_path, ENT_COMPAT | ENT_QUOTES));
1019
+ if (!$img_width || !$img_height) {
1020
+ return FALSE;
1021
+ }
1022
+ $max_width = $options->upload_thumb_width;
1023
+ $max_height = $options->upload_thumb_height;
1024
+ $scale = min(
1025
+ $max_width / $img_width,
1026
+ $max_height / $img_height
1027
+ );
1028
+ ini_set('memory_limit', '-1');
1029
+ if (!function_exists('imagecreatetruecolor')) {
1030
+ error_log('Function not found: imagecreatetruecolor');
1031
+ return FALSE;
1032
+ }
1033
+ $new_width = $img_width * $scale;
1034
+ $new_height = $img_height * $scale;
1035
+ $dst_x = 0;
1036
+ $dst_y = 0;
1037
+ $new_img = @imagecreatetruecolor($new_width, $new_height);
1038
+ switch ($type) {
1039
+ case 2:
1040
+ $src_img = @imagecreatefromjpeg($file_path);
1041
+ $write_image = 'imagejpeg';
1042
+ $image_quality = isset($options->jpeg_quality) ? $options->jpeg_quality : 75;
1043
+ break;
1044
+ case 1:
1045
+ @imagecolortransparent($new_img, @imagecolorallocate($new_img, 0, 0, 0));
1046
+ $src_img = @imagecreatefromgif($file_path);
1047
+ $write_image = 'imagegif';
1048
+ $image_quality = null;
1049
+ break;
1050
+ case 3:
1051
+ @imagecolortransparent($new_img, @imagecolorallocate($new_img, 0, 0, 0));
1052
+ @imagealphablending($new_img, false);
1053
+ @imagesavealpha($new_img, true);
1054
+ $src_img = @imagecreatefrompng($file_path);
1055
+ $write_image = 'imagepng';
1056
+ $image_quality = isset($options->png_quality) ? $options->png_quality : 9;
1057
+ break;
1058
+ default:
1059
+ $src_img = null;
1060
+ break;
1061
+ }
1062
+ $success = $src_img && @imagecopyresampled(
1063
+ $new_img,
1064
+ $src_img,
1065
+ $dst_x,
1066
+ $dst_y,
1067
+ 0,
1068
+ 0,
1069
+ $new_width,
1070
+ $new_height,
1071
+ $img_width,
1072
+ $img_height
1073
+ ) && $write_image($new_img, $new_file_path, $image_quality);
1074
+ // Free up memory (imagedestroy does not delete files):
1075
+ @imagedestroy($src_img);
1076
+ @imagedestroy($new_img);
1077
+ ini_restore('memory_limit');
1078
+ }
1079
+ }
1080
+ if ($flag == false) {
1081
+ echo WDWLibrary::message('You must select at least one item.', 'error');
1082
+ }
1083
+ else {
1084
+ echo WDWLibrary::message('Thumb Succesfully Resized', 'updated');
1085
+ }
1086
+ }
1087
 
1088
  ////////////////////////////////////////////////////////////////////////////////////////
1089
  // Getters & Setters //
admin/views/BWGViewGalleries_bwg.php CHANGED
@@ -727,6 +727,7 @@ class BWGViewGalleries_bwg {
727
  spider_ajax_save('galleries_form');
728
  return false;" value="Set Watermark" />
729
  <input class="button-secondary" id='spider_resize_button' type="submit" onclick="jQuery('.opacity_resize_image').show(); return false;" value="Resize" />
 
730
  <input class="button-secondary" id='spider_reset_button' type="submit" onclick="spider_set_input_value('ajax_task', 'image_recover_all');
731
  spider_ajax_save('galleries_form');
732
  return false;" value="Reset" />
727
  spider_ajax_save('galleries_form');
728
  return false;" value="Set Watermark" />
729
  <input class="button-secondary" id='spider_resize_button' type="submit" onclick="jQuery('.opacity_resize_image').show(); return false;" value="Resize" />
730
+ <input class="button-secondary" type="submit" onclick="spider_set_input_value('ajax_task', 'resize_image_thumb'); spider_ajax_save('galleries_form');return false;" value="Recreate Thumbnail" />
731
  <input class="button-secondary" id='spider_reset_button' type="submit" onclick="spider_set_input_value('ajax_task', 'image_recover_all');
732
  spider_ajax_save('galleries_form');
733
  return false;" value="Reset" />
js/bwg.js CHANGED
@@ -197,7 +197,7 @@ function spider_ajax_save(form_id, tr_group) {
197
  jQuery('#draganddrop').html("<strong><p>Item Succesfully Deleted.</p></strong>");
198
  jQuery('#draganddrop').show();
199
  }
200
- else if (!flag && ((ajax_task == 'image_publish_all') || (ajax_task == 'image_unpublish_all') || (ajax_task == 'image_delete_all') || (ajax_task == 'image_set_watermark') || (ajax_task == 'image_recover_all') || (ajax_task == 'image_resize'))) {
201
  jQuery('#draganddrop').html("<strong><p>You must select at least one item.</p></strong>");
202
  jQuery('#draganddrop').show();
203
  }
@@ -213,6 +213,10 @@ function spider_ajax_save(form_id, tr_group) {
213
  jQuery('#draganddrop').html("<strong><p>Items Succesfully Deleted.</p></strong>");
214
  jQuery('#draganddrop').show();
215
  }
 
 
 
 
216
  else if (ajax_task == 'image_set_watermark') {
217
  jQuery('#draganddrop').html("<strong><p>Watermarks Succesfully Set.</p></strong>");
218
  jQuery('#draganddrop').show();
197
  jQuery('#draganddrop').html("<strong><p>Item Succesfully Deleted.</p></strong>");
198
  jQuery('#draganddrop').show();
199
  }
200
+ else if (!flag && ((ajax_task == 'image_publish_all') || (ajax_task == 'image_unpublish_all') || (ajax_task == 'image_delete_all') || (ajax_task == 'image_set_watermark') || (ajax_task == 'image_recover_all') || (ajax_task == 'image_resize') || (ajax_task == 'resize_image_thumb'))) {
201
  jQuery('#draganddrop').html("<strong><p>You must select at least one item.</p></strong>");
202
  jQuery('#draganddrop').show();
203
  }
213
  jQuery('#draganddrop').html("<strong><p>Items Succesfully Deleted.</p></strong>");
214
  jQuery('#draganddrop').show();
215
  }
216
+ else if (ajax_task == 'resize_image_thumb') {
217
+ jQuery('#draganddrop').html("<strong><p>Items Succesfully resized.</p></strong>");
218
+ jQuery('#draganddrop').show();
219
+ }
220
  else if (ajax_task == 'image_set_watermark') {
221
  jQuery('#draganddrop').html("<strong><p>Watermarks Succesfully Set.</p></strong>");
222
  jQuery('#draganddrop').show();
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.33
8
  * Author: WebDorado
9
  * Author URI: https://web-dorado.com/
10
  * License: GNU/GPLv3 http://www.gnu.org/licenses/gpl-3.0.html
@@ -3158,7 +3158,7 @@ function bwg_activate() {
3158
  ));
3159
  }
3160
  $version = get_option("wd_bwg_version");
3161
- $new_version = '1.2.33';
3162
  if ($version && version_compare($version, $new_version, '<')) {
3163
  require_once WD_BWG_DIR . "/update/bwg_update.php";
3164
  bwg_update($version);
@@ -3176,7 +3176,7 @@ wp_oembed_add_provider( '#https://instagr(\.am|am\.com)/p/.*#i', 'https://api.in
3176
 
3177
  function bwg_update_hook() {
3178
  $version = get_option("wd_bwg_version");
3179
- $new_version = '1.2.33';
3180
  if ($version && version_compare($version, $new_version, '<')) {
3181
  require_once WD_BWG_DIR . "/update/bwg_update.php";
3182
  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.34
8
  * Author: WebDorado
9
  * Author URI: https://web-dorado.com/
10
  * License: GNU/GPLv3 http://www.gnu.org/licenses/gpl-3.0.html
3158
  ));
3159
  }
3160
  $version = get_option("wd_bwg_version");
3161
+ $new_version = '1.2.34';
3162
  if ($version && version_compare($version, $new_version, '<')) {
3163
  require_once WD_BWG_DIR . "/update/bwg_update.php";
3164
  bwg_update($version);
3176
 
3177
  function bwg_update_hook() {
3178
  $version = get_option("wd_bwg_version");
3179
+ $new_version = '1.2.34';
3180
  if ($version && version_compare($version, $new_version, '<')) {
3181
  require_once WD_BWG_DIR . "/update/bwg_update.php";
3182
  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, fotogalerie, galleria, galerie, galeri, 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, mosaic
5
  Requires at least: 3.4
6
  Tested up to: 4.2
7
- Stable tag: 1.2.33
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
@@ -207,6 +207,9 @@ Yes, it is possible to add advertising and/or watermark over the images. In both
207
 
208
  == Changelog ==
209
 
 
 
 
210
  = 1.2.33 =
211
  Fixed: Delete/update custom posts on gallery/album edit.
212
  Fixed: Image width/height size with open commetns.
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, fotogalerie, galleria, galerie, galeri, 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, mosaic
5
  Requires at least: 3.4
6
  Tested up to: 4.2
7
+ Stable tag: 1.2.34
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
207
 
208
  == Changelog ==
209
 
210
+ = 1.2.34 =
211
+ New: Recreate thumbnail button in gallery page.
212
+
213
  = 1.2.33 =
214
  Fixed: Delete/update custom posts on gallery/album edit.
215
  Fixed: Image width/height size with open commetns.