Photo Gallery by WD – Responsive Photo Gallery - Version 1.5.54

Version Description

  • Fixed: Memory leak for users with non default uploads directory.
Download this release

Release Info

Developer 10web
Plugin Icon 128x128 Photo Gallery by WD – Responsive Photo Gallery
Version 1.5.54
Comparing to
See all releases

Code changes from version 1.5.56 to 1.5.54

framework/BWGOptions.php CHANGED
@@ -350,7 +350,7 @@ class WD_BWG_Options {
350
  else {
351
  // For old users, who have changed images directory.
352
  // Using ABSPATH here instead of BWG()->abspath to avoid memory leak.
353
- $this->upload_dir = BWG::get_abspath() . '/' . $this->images_directory . '/photo-gallery';
354
  $this->upload_url = site_url() . '/' . $this->images_directory . '/photo-gallery';
355
  }
356
 
350
  else {
351
  // For old users, who have changed images directory.
352
  // Using ABSPATH here instead of BWG()->abspath to avoid memory leak.
353
+ $this->upload_dir = ABSPATH . '/' . $this->images_directory . '/photo-gallery';
354
  $this->upload_url = site_url() . '/' . $this->images_directory . '/photo-gallery';
355
  }
356
 
framework/WDWLibrary.php CHANGED
@@ -1229,8 +1229,8 @@ class WDWLibrary {
1229
  $alt_search = '(';
1230
  $description_search = '(';
1231
  foreach( $bwg_search_keys as $search_key) {
1232
- $alt_search .= $wpdb->prepare( '`image`.`alt` LIKE "%s" AND ', '%' . trim( $search_key ) . '%' );
1233
- $description_search .= $wpdb->prepare( '`image`.`description` LIKE "%s" AND ', '%' . trim( $search_key ) . '%' );
1234
  }
1235
  $alt_search = rtrim($alt_search, 'AND ');
1236
  $alt_search .= ')';
@@ -1273,7 +1273,7 @@ class WDWLibrary {
1273
  $join = $tag ? 'LEFT JOIN ' . $wpdb->prefix . 'bwg_image_tag as tag ON image.id=tag.image_id' : '';
1274
  if ( self::get($tag_input_name) ) {
1275
  $join .= ' LEFT JOIN (SELECT GROUP_CONCAT(tag_id SEPARATOR ",") AS tags_combined, image_id FROM ' . $wpdb->prefix . 'bwg_image_tag' . ($gallery_id ? ' WHERE gallery_id="' . $gallery_id . '"' : '') . ' GROUP BY image_id) AS tags ON image.id=tags.image_id';
1276
- $where .= $wpdb->prepare(' AND CONCAT(",", tags.tags_combined, ",") REGEXP ",%s," ', '(' . implode("|", self::get($tag_input_name) ) . ')');
1277
  }
1278
  $join .= ' LEFT JOIN '. $wpdb->prefix .'bwg_gallery as gallery ON gallery.id = image.gallery_id';
1279
  $where .= ' AND gallery.published = 1 ';
@@ -1317,7 +1317,7 @@ class WDWLibrary {
1317
  $where = (($gallery_id) ? ' `gallery_id`=' . $gallery_id . ($image_id ? ' AND `id`=' . $image_id : '') : 1);
1318
  $search = WDWLibrary::get( 's', '' );
1319
  if ( $search ) {
1320
- $where .= $wpdb->prepare(' AND `filename` LIKE "%s"', '%' . $search . '%');
1321
  }
1322
  $images = $wpdb->get_results( 'SELECT * FROM `' . $wpdb->prefix . 'bwg_image` WHERE ' . $where . $limitstart );
1323
 
@@ -1506,7 +1506,7 @@ class WDWLibrary {
1506
  $where = ($gallery_id) ? ' `gallery_id` = ' . $gallery_id : 1;
1507
  $search = WDWLibrary::get('s', '');
1508
  if ( $search ) {
1509
- $where .= $wpdb->prepare(' AND `filename` LIKE "%s"', '%' . $search . '%');
1510
  }
1511
  $limitstart = '';
1512
  if ( !$limit ) {
1229
  $alt_search = '(';
1230
  $description_search = '(';
1231
  foreach( $bwg_search_keys as $search_key) {
1232
+ $alt_search .= '`image`.`alt` LIKE "%' . trim($search_key) . '%" AND ';
1233
+ $description_search .= '`image`.`description` LIKE "%' . trim($search_key) . '%" AND ';
1234
  }
1235
  $alt_search = rtrim($alt_search, 'AND ');
1236
  $alt_search .= ')';
1273
  $join = $tag ? 'LEFT JOIN ' . $wpdb->prefix . 'bwg_image_tag as tag ON image.id=tag.image_id' : '';
1274
  if ( self::get($tag_input_name) ) {
1275
  $join .= ' LEFT JOIN (SELECT GROUP_CONCAT(tag_id SEPARATOR ",") AS tags_combined, image_id FROM ' . $wpdb->prefix . 'bwg_image_tag' . ($gallery_id ? ' WHERE gallery_id="' . $gallery_id . '"' : '') . ' GROUP BY image_id) AS tags ON image.id=tags.image_id';
1276
+ $where .= ' AND CONCAT(",", tags.tags_combined, ",") REGEXP ",(' . implode("|", self::get($tag_input_name) ) . ')," ';
1277
  }
1278
  $join .= ' LEFT JOIN '. $wpdb->prefix .'bwg_gallery as gallery ON gallery.id = image.gallery_id';
1279
  $where .= ' AND gallery.published = 1 ';
1317
  $where = (($gallery_id) ? ' `gallery_id`=' . $gallery_id . ($image_id ? ' AND `id`=' . $image_id : '') : 1);
1318
  $search = WDWLibrary::get( 's', '' );
1319
  if ( $search ) {
1320
+ $where .= ' AND `filename` LIKE "%' . $search . '%"';
1321
  }
1322
  $images = $wpdb->get_results( 'SELECT * FROM `' . $wpdb->prefix . 'bwg_image` WHERE ' . $where . $limitstart );
1323
 
1506
  $where = ($gallery_id) ? ' `gallery_id` = ' . $gallery_id : 1;
1507
  $search = WDWLibrary::get('s', '');
1508
  if ( $search ) {
1509
+ $where .= ' AND `filename` LIKE "%' . $search . '%"';
1510
  }
1511
  $limitstart = '';
1512
  if ( !$limit ) {
frontend/models/BWGModelGalleryBox.php CHANGED
@@ -68,8 +68,8 @@ class BWGModelGalleryBox {
68
  $alt_search = '(';
69
  $description_search = '(';
70
  foreach( $bwg_search_keys as $search_key) {
71
- $alt_search .= $wpdb->prepare('`image`.`alt` LIKE "%s" AND ', '%' . trim($search_key) . '%');
72
- $description_search .= $wpdb->prepare('`image`.`description` LIKE "%s" AND ', '%' . trim($search_key) . '%');
73
  }
74
  $alt_search = rtrim($alt_search, 'AND ');
75
  $alt_search .= ')';
68
  $alt_search = '(';
69
  $description_search = '(';
70
  foreach( $bwg_search_keys as $search_key) {
71
+ $alt_search .= '`image`.`alt` LIKE "%' . trim($search_key) . '%" AND ';
72
+ $description_search .= '`image`.`description` LIKE "%' . trim($search_key) . '%" AND ';
73
  }
74
  $alt_search = rtrim($alt_search, 'AND ');
75
  $alt_search .= ')';
frontend/models/model.php CHANGED
@@ -87,8 +87,8 @@ class BWGModelSite {
87
  $alt_search = '(';
88
  $description_search = '(';
89
  foreach( $bwg_search_keys as $search_key) {
90
- $alt_search .= $wpdb->prepare('`image`.`alt` LIKE "%s" AND ', '%' . trim($search_key) . '%');
91
- $description_search .= $wpdb->prepare('`image`.`description` LIKE "%s" AND ', '%' . trim($search_key) . '%');
92
  }
93
  $alt_search = rtrim($alt_search, 'AND ');
94
  $alt_search .= ')';
@@ -143,7 +143,7 @@ class BWGModelSite {
143
  $compare_sign = ",";
144
  }
145
  $join .= ' LEFT JOIN (SELECT GROUP_CONCAT(tag_id order by tag_id SEPARATOR ",") AS tags_combined, image_id FROM ' . $wpdb->prefix . 'bwg_image_tag' . ($gallery_id ? ' WHERE gallery_id="' . $gallery_id . '"' : '') . ' GROUP BY image_id) AS tags ON image.id=tags.image_id';
146
- $where .= $wpdb->prepare(' AND CONCAT(",", tags.tags_combined, ",") REGEXP "%s" ', ',(' . implode( $compare_sign, $filter_tags_name ) . '),');
147
  }
148
  $join .= ' LEFT JOIN '. $wpdb->prefix .'bwg_gallery as gallery ON gallery.id = image.gallery_id';
149
  $where .= ' AND gallery.published = 1 ';
@@ -196,40 +196,40 @@ class BWGModelSite {
196
  }
197
 
198
  public function get_alb_gals_row( $bwg, $id, $albums_per_page, $sort_by, $order_by, $pagination_type = 0, $from = '' ) {
199
- if ( $albums_per_page < 0 ) {
200
  $albums_per_page = 0;
201
  }
202
  global $wpdb;
203
- $order_by = 'ORDER BY `' . ( ( !empty( $from ) && $from === 'widget' ) ? 'id' : $sort_by ) . '` ' . $order_by;
204
- if ( $sort_by == 'random' || $sort_by == 'RAND()' ) {
205
- $order_by = 'ORDER BY RAND()';
206
- }
207
- $search_where = '';
208
- $search_value = trim( WDWLibrary::get( 'bwg_search_' . $bwg ) );
209
- if ( !empty( $search_value ) ) {
210
- $search_keys = explode( ' ', $search_value );
211
  $alt_search = '(';
212
  $description_search = '(';
213
- foreach ( $search_keys as $search_key ) {
214
- $alt_search .= $wpdb->prepare( '`{{table}}`.`name` LIKE "%s" AND ', '%' . trim( $search_key ) . '%' );
215
- $description_search .= $wpdb->prepare( '`{{table}}`.`description` LIKE "%s" AND ', '%' . trim( $search_key ) . '%' );
216
  }
217
- $alt_search = rtrim( $alt_search, 'AND ' );
218
  $alt_search .= ')';
219
- $description_search = rtrim( $description_search, 'AND ' );
220
  $description_search .= ')';
221
  $search_where = ' AND (' . $alt_search . ' OR ' . $description_search . ')';
222
  }
223
- $limit = 0;
224
- $page_number = WDWLibrary::get( 'page_number_' . $bwg, 0, 'intval' );
225
  if ( $page_number ) {
226
- $limit = ( (int)$page_number - 1 ) * $albums_per_page;
227
  }
228
  $limit_str = '';
229
  if ( $albums_per_page ) {
230
  $limit_str = 'LIMIT ' . $limit . ',' . $albums_per_page;
231
  }
232
- if ( WDWLibrary::get( 'action_' . $bwg ) == 'back' && ( $pagination_type == 2 || $pagination_type == 3 ) ) {
233
  if ( $page_number ) {
234
  if ( $albums_per_page ) {
235
  $limit = $albums_per_page * $page_number;
@@ -239,53 +239,53 @@ class BWGModelSite {
239
  }
240
  // Select all galleries.
241
  if ( $id == 0 ) {
242
- $query = 'SELECT * FROM `' . $wpdb->prefix . 'bwg_gallery` WHERE `published`=1' . str_replace( '{{table}}', $wpdb->prefix . 'bwg_gallery', $search_where );
243
  $limitation = ' ' . $order_by . ' ' . $limit_str;
244
  $sql = $query . $limitation;
245
- $rows = $wpdb->get_results( $sql );
246
- $total = $wpdb->get_var( 'SELECT count(*) FROM `' . $wpdb->prefix . 'bwg_gallery` WHERE `published`=1' . str_replace( '{{table}}', $wpdb->prefix . 'bwg_gallery', $search_where ) );
247
  }
248
  else {
249
- $query = '( SELECT t.*, t1.preview_image, t1.random_preview_image, t1.name, t1.description, t1.slug, t1.modified_date FROM `' . $wpdb->prefix . 'bwg_album_gallery` as t';
250
  $query .= ' LEFT JOIN `' . $wpdb->prefix . 'bwg_album` as t1 ON (t.is_album=1 AND t.alb_gal_id = t1.id)';
251
  $query .= ' WHERE t.album_id="' . $id . '"';
252
- $query .= ' AND t1.published=1' . str_replace( '{{table}}', 't1', $search_where );
253
- $query .= ') ';
254
- $query .= ' UNION ';
255
- $query .= '( SELECT t.*, t2.preview_image, t2.random_preview_image, t2.name, t2.description, t2.slug, t2.modified_date FROM `' . $wpdb->prefix . 'bwg_album_gallery` as t';
256
  $query .= ' LEFT JOIN `' . $wpdb->prefix . 'bwg_gallery` as t2 ON (t.is_album=0 AND t.alb_gal_id = t2.id)';
257
  $query .= ' WHERE t.album_id="' . $id . '"';
258
- $query .= ' AND t2.published=1' . str_replace( '{{table}}', 't2', $search_where );
259
  $query .= ')';
260
  $limitation = ' ' . $order_by . ' ' . $limit_str;
261
  $sql = $query . $limitation;
262
- $rows = $wpdb->get_results( $sql );
263
- $total = count( $wpdb->get_results( $query ) );
264
  }
265
  if ( $rows ) {
266
  foreach ( $rows as $row ) {
267
- $row->def_type = isset( $row->is_album ) && $row->is_album ? 'album' : 'gallery';
268
  if ( $from ) {
269
- $row->permalink = WDWLibrary::get_custom_post_permalink( array( 'slug' => $row->slug, 'post_type' => $row->def_type ) );
270
  }
271
  else {
272
  $row->permalink = '';
273
  }
274
 
275
- if ( !empty( $row->preview_image ) ) {
276
- $row->resolution_thumb = WDWLibrary::get_thumb_size( $row->preview_image );
277
  if ( $row->resolution_thumb == "" ) {
278
- $row->resolution_thumb = $this->get_album_preview_thumb_dimensions( $row->preview_image );
279
  }
280
 
281
- $row->preview_image = WDWLibrary::image_url_version( $row->preview_image, $row->modified_date );
282
  }
283
- if ( !empty( $row->random_preview_image ) ) {
284
- $row->resolution_thumb = WDWLibrary::get_thumb_size( $row->random_preview_image );
285
  if ( $row->resolution_thumb == "" ) {
286
- $row->resolution_thumb = $this->get_album_preview_thumb_dimensions( $row->random_preview_image );
287
  }
288
- $row->random_preview_image = WDWLibrary::image_url_version( $row->random_preview_image, $row->modified_date );
289
  }
290
  if ( !$row->preview_image ) {
291
  $row->preview_image = $row->random_preview_image;
@@ -296,7 +296,7 @@ class BWGModelSite {
296
  $row->preview_path = BWG()->plugin_dir . '/images/no-image.png';
297
  }
298
  else {
299
- $parsed_prev_url = parse_url( $row->preview_image, PHP_URL_SCHEME );
300
  if ( $parsed_prev_url == 'http' || $parsed_prev_url == 'https' ) {
301
  $row->preview_path = $row->preview_image;
302
  $row->preview_image = $row->preview_image;
@@ -307,15 +307,15 @@ class BWGModelSite {
307
  }
308
  }
309
 
310
- $row->description = wpautop( $row->description );
311
  }
312
  }
313
 
314
- $page_nav[ 'limit' ] = 1;
315
- $page_nav[ 'total' ] = $total;
316
- $page_number = WDWLibrary::get( 'page_number_' . $bwg, 0, 'intval' );
317
  if ( $page_number ) {
318
- $page_nav[ 'limit' ] = (int)$page_number;
319
  }
320
 
321
  return array( 'rows' => $rows, 'page_nav' => $page_nav );
87
  $alt_search = '(';
88
  $description_search = '(';
89
  foreach( $bwg_search_keys as $search_key) {
90
+ $alt_search .= '`image`.`alt` LIKE "%' . trim($search_key) . '%" AND ';
91
+ $description_search .= '`image`.`description` LIKE "%' . trim($search_key) . '%" AND ';
92
  }
93
  $alt_search = rtrim($alt_search, 'AND ');
94
  $alt_search .= ')';
143
  $compare_sign = ",";
144
  }
145
  $join .= ' LEFT JOIN (SELECT GROUP_CONCAT(tag_id order by tag_id SEPARATOR ",") AS tags_combined, image_id FROM ' . $wpdb->prefix . 'bwg_image_tag' . ($gallery_id ? ' WHERE gallery_id="' . $gallery_id . '"' : '') . ' GROUP BY image_id) AS tags ON image.id=tags.image_id';
146
+ $where .= ' AND CONCAT(",", tags.tags_combined, ",") REGEXP ",(' . implode( $compare_sign, $filter_tags_name ) . ')," ';
147
  }
148
  $join .= ' LEFT JOIN '. $wpdb->prefix .'bwg_gallery as gallery ON gallery.id = image.gallery_id';
149
  $where .= ' AND gallery.published = 1 ';
196
  }
197
 
198
  public function get_alb_gals_row( $bwg, $id, $albums_per_page, $sort_by, $order_by, $pagination_type = 0, $from = '' ) {
199
+ if ( $albums_per_page < 0 ) {
200
  $albums_per_page = 0;
201
  }
202
  global $wpdb;
203
+ $order_by = 'ORDER BY `' . ( (!empty($from) && $from === 'widget') ? 'id' : $sort_by ) . '` ' . $order_by;
204
+ if( $sort_by == 'random' || $sort_by == 'RAND()' ) {
205
+ $order_by = 'ORDER BY RAND()';
206
+ }
207
+ $search_where = '';
208
+ $search_value = trim( WDWLibrary::get('bwg_search_' . $bwg) );
209
+ if ( !empty($search_value) ) {
210
+ $search_keys = explode(' ', $search_value);
211
  $alt_search = '(';
212
  $description_search = '(';
213
+ foreach( $search_keys as $search_key) {
214
+ $alt_search .= '`{{table}}`.`name` LIKE "%' . trim($search_key) . '%" AND ';
215
+ $description_search .= '`{{table}}`.`description` LIKE "%' . trim($search_key) . '%" AND ';
216
  }
217
+ $alt_search = rtrim($alt_search, 'AND ');
218
  $alt_search .= ')';
219
+ $description_search = rtrim($description_search, 'AND ');
220
  $description_search .= ')';
221
  $search_where = ' AND (' . $alt_search . ' OR ' . $description_search . ')';
222
  }
223
+ $limit = 0;
224
+ $page_number = WDWLibrary::get('page_number_' . $bwg, 0, 'intval');
225
  if ( $page_number ) {
226
+ $limit = ( (int) $page_number - 1) * $albums_per_page;
227
  }
228
  $limit_str = '';
229
  if ( $albums_per_page ) {
230
  $limit_str = 'LIMIT ' . $limit . ',' . $albums_per_page;
231
  }
232
+ if ( WDWLibrary::get('action_' . $bwg) == 'back' && ($pagination_type == 2 || $pagination_type == 3) ) {
233
  if ( $page_number ) {
234
  if ( $albums_per_page ) {
235
  $limit = $albums_per_page * $page_number;
239
  }
240
  // Select all galleries.
241
  if ( $id == 0 ) {
242
+ $query = 'SELECT * FROM `' . $wpdb->prefix . 'bwg_gallery` WHERE `published`=1' . str_replace('{{table}}', $wpdb->prefix . 'bwg_gallery', $search_where);
243
  $limitation = ' ' . $order_by . ' ' . $limit_str;
244
  $sql = $query . $limitation;
245
+ $rows = $wpdb->get_results( $sql );
246
+ $total = $wpdb->get_var('SELECT count(*) FROM `' . $wpdb->prefix . 'bwg_gallery` WHERE `published`=1' . str_replace('{{table}}', $wpdb->prefix . 'bwg_gallery', $search_where) );
247
  }
248
  else {
249
+ $query = '( SELECT t.*, t1.preview_image, t1.random_preview_image, t1.name, t1.description, t1.slug, t1.modified_date FROM `' . $wpdb->prefix . 'bwg_album_gallery` as t';
250
  $query .= ' LEFT JOIN `' . $wpdb->prefix . 'bwg_album` as t1 ON (t.is_album=1 AND t.alb_gal_id = t1.id)';
251
  $query .= ' WHERE t.album_id="' . $id . '"';
252
+ $query .= ' AND t1.published=1' . str_replace('{{table}}', 't1', $search_where);
253
+ $query .= ') ';
254
+ $query .= ' UNION ';
255
+ $query .= '( SELECT t.*, t2.preview_image, t2.random_preview_image, t2.name, t2.description, t2.slug, t2.modified_date FROM `' . $wpdb->prefix . 'bwg_album_gallery` as t';
256
  $query .= ' LEFT JOIN `' . $wpdb->prefix . 'bwg_gallery` as t2 ON (t.is_album=0 AND t.alb_gal_id = t2.id)';
257
  $query .= ' WHERE t.album_id="' . $id . '"';
258
+ $query .= ' AND t2.published=1' . str_replace('{{table}}', 't2', $search_where);
259
  $query .= ')';
260
  $limitation = ' ' . $order_by . ' ' . $limit_str;
261
  $sql = $query . $limitation;
262
+ $rows = $wpdb->get_results($sql);
263
+ $total = count($wpdb->get_results($query));
264
  }
265
  if ( $rows ) {
266
  foreach ( $rows as $row ) {
267
+ $row->def_type = isset($row->is_album) && $row->is_album ? 'album' : 'gallery';
268
  if ( $from ) {
269
+ $row->permalink = WDWLibrary::get_custom_post_permalink(array( 'slug' => $row->slug, 'post_type' => $row->def_type ));
270
  }
271
  else {
272
  $row->permalink = '';
273
  }
274
 
275
+ if ( !empty($row->preview_image) ) {
276
+ $row->resolution_thumb = WDWLibrary::get_thumb_size($row->preview_image);
277
  if ( $row->resolution_thumb == "" ) {
278
+ $row->resolution_thumb = $this->get_album_preview_thumb_dimensions($row->preview_image);
279
  }
280
 
281
+ $row->preview_image = WDWLibrary::image_url_version($row->preview_image, $row->modified_date);
282
  }
283
+ if ( !empty($row->random_preview_image) ) {
284
+ $row->resolution_thumb = WDWLibrary::get_thumb_size($row->random_preview_image);
285
  if ( $row->resolution_thumb == "" ) {
286
+ $row->resolution_thumb = $this->get_album_preview_thumb_dimensions($row->random_preview_image);
287
  }
288
+ $row->random_preview_image = WDWLibrary::image_url_version($row->random_preview_image, $row->modified_date);
289
  }
290
  if ( !$row->preview_image ) {
291
  $row->preview_image = $row->random_preview_image;
296
  $row->preview_path = BWG()->plugin_dir . '/images/no-image.png';
297
  }
298
  else {
299
+ $parsed_prev_url = parse_url($row->preview_image, PHP_URL_SCHEME);
300
  if ( $parsed_prev_url == 'http' || $parsed_prev_url == 'https' ) {
301
  $row->preview_path = $row->preview_image;
302
  $row->preview_image = $row->preview_image;
307
  }
308
  }
309
 
310
+ $row->description = wpautop($row->description);
311
  }
312
  }
313
 
314
+ $page_nav['limit'] = 1;
315
+ $page_nav['total'] = $total;
316
+ $page_number = WDWLibrary::get('page_number_' . $bwg, 0, 'intval');
317
  if ( $page_number ) {
318
+ $page_nav[ 'limit' ] = (int) $page_number;
319
  }
320
 
321
  return array( 'rows' => $rows, 'page_nav' => $page_nav );
photo-gallery.php CHANGED
@@ -3,7 +3,7 @@
3
  * Plugin Name: Photo Gallery
4
  * Plugin URI: https://10web.io/plugins/wordpress-photo-gallery/?utm_source=photo_gallery&utm_medium=free_plugin
5
  * 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.
6
- * Version: 1.5.56
7
  * Author: Photo Gallery Team
8
  * Author URI: https://10web.io/plugins/?utm_source=photo_gallery&utm_medium=free_plugin
9
  * License: GNU/GPLv3 http://www.gnu.org/licenses/gpl-3.0.html
@@ -87,7 +87,7 @@ final class BWG {
87
  *
88
  * @return string
89
  */
90
- public static function get_abspath() {
91
  $dirpath = defined( 'WP_CONTENT_DIR' ) ? WP_CONTENT_DIR : ABSPATH;
92
  $array = explode( "wp-content", $dirpath );
93
  if( isset( $array[0] ) && $array[0] != "" ) {
@@ -100,13 +100,13 @@ final class BWG {
100
  * Define Constants.
101
  */
102
  private function define_constants() {
103
- $this->abspath = self::get_abspath();
104
  $this->plugin_dir = WP_PLUGIN_DIR . "/" . plugin_basename(dirname(__FILE__));
105
  $this->plugin_url = plugins_url(plugin_basename(dirname(__FILE__)));
106
  $this->front_url = $this->plugin_url;
107
  $this->main_file = plugin_basename(__FILE__);
108
- $this->plugin_version = '1.5.56';
109
- $this->db_version = '1.5.56';
110
  $this->prefix = 'bwg';
111
  $this->nicename = __('Photo Gallery', $this->prefix);
112
 
3
  * Plugin Name: Photo Gallery
4
  * Plugin URI: https://10web.io/plugins/wordpress-photo-gallery/?utm_source=photo_gallery&utm_medium=free_plugin
5
  * 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.
6
+ * Version: 1.5.54
7
  * Author: Photo Gallery Team
8
  * Author URI: https://10web.io/plugins/?utm_source=photo_gallery&utm_medium=free_plugin
9
  * License: GNU/GPLv3 http://www.gnu.org/licenses/gpl-3.0.html
87
  *
88
  * @return string
89
  */
90
+ public function get_abspath() {
91
  $dirpath = defined( 'WP_CONTENT_DIR' ) ? WP_CONTENT_DIR : ABSPATH;
92
  $array = explode( "wp-content", $dirpath );
93
  if( isset( $array[0] ) && $array[0] != "" ) {
100
  * Define Constants.
101
  */
102
  private function define_constants() {
103
+ $this->abspath = $this->get_abspath();
104
  $this->plugin_dir = WP_PLUGIN_DIR . "/" . plugin_basename(dirname(__FILE__));
105
  $this->plugin_url = plugins_url(plugin_basename(dirname(__FILE__)));
106
  $this->front_url = $this->plugin_url;
107
  $this->main_file = plugin_basename(__FILE__);
108
+ $this->plugin_version = '1.5.54';
109
+ $this->db_version = '1.5.54';
110
  $this->prefix = 'bwg';
111
  $this->nicename = __('Photo Gallery', $this->prefix);
112
 
readme.txt CHANGED
@@ -3,7 +3,7 @@ Contributors: webdorado,wdsupport,photogallerysupport,10web
3
  Tags: gallery, photo gallery, image gallery, responsive gallery, wordpress gallery plugin, photo albums, gallery slider, gallery lightbox, wordpress photo gallery plugin, fullscreen gallery, watermarking, video gallery
4
  Requires at least: 4.6
5
  Tested up to: 5.4
6
- Stable tag: 1.5.56
7
  License: GPLv2 or later
8
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
9
 
@@ -281,13 +281,6 @@ Choose whether to display random or the first/last specific number of images.
281
  **Theme.** Choose the theme, which will be applied to the gallery/album.
282
 
283
  == Changelog ==
284
- = 1.5.56 =
285
- * Fixed: Security issue.
286
-
287
- = 1.5.55 =
288
- * Fixed: Security issue.
289
- * Fixed: Minor bug.
290
-
291
  = 1.5.54 =
292
  * Fixed: Memory leak for users with non default uploads directory.
293
 
3
  Tags: gallery, photo gallery, image gallery, responsive gallery, wordpress gallery plugin, photo albums, gallery slider, gallery lightbox, wordpress photo gallery plugin, fullscreen gallery, watermarking, video gallery
4
  Requires at least: 4.6
5
  Tested up to: 5.4
6
+ Stable tag: 1.5.54
7
  License: GPLv2 or later
8
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
9
 
281
  **Theme.** Choose the theme, which will be applied to the gallery/album.
282
 
283
  == Changelog ==
 
 
 
 
 
 
 
284
  = 1.5.54 =
285
  * Fixed: Memory leak for users with non default uploads directory.
286