Photo Gallery by WD – Responsive Photo Gallery - Version 1.2.108

Version Description

  • Added: Save as copy themes.
  • Fixed: Delete folder with single quote in name.
  • Fixed: Add facebook album with images more than 100.
Download this release

Release Info

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

Code changes from version 1.2.107 to 1.2.108

admin/controllers/BWGControllerThemes_bwg.php CHANGED
@@ -548,6 +548,9 @@ class BWGControllerThemes_bwg {
548
  $mosaic_thumb_transition = (isset($_POST['mosaic_thumb_transition']) ? esc_html(stripslashes( $_POST['mosaic_thumb_transition'])) : 1);
549
 
550
  $default_theme = (isset($_POST['default_theme']) ? esc_html(stripslashes( $_POST['default_theme'])) : 0);
 
 
 
551
  $themes = array(
552
  'thumb_margin' => $thumb_margin,
553
  'thumb_padding' => $thumb_padding,
@@ -669,7 +672,7 @@ class BWGControllerThemes_bwg {
669
  'lightbox_bg_color' => $lightbox_bg_color,
670
  'lightbox_overlay_bg_color' => $lightbox_overlay_bg_color,
671
  'lightbox_rl_btn_style' => $lightbox_rl_btn_style,
672
- 'lightbox_bg_transparent' => $lightbox_bg_transparent,
673
 
674
  'blog_style_margin' => $blog_style_margin,
675
  'blog_style_padding' => $blog_style_padding,
@@ -994,23 +997,22 @@ class BWGControllerThemes_bwg {
994
  'carousel_caption_p_color' => $carousel_caption_p_color,
995
  'carousel_title_opacity' => $carousel_title_opacity,
996
  'carousel_title_border_radius' => $carousel_title_border_radius,
997
- 'default_theme' => $default_theme,
998
  'mosaic_thumb_transition' => $mosaic_thumb_transition,
999
  );
1000
  $themes = json_encode($themes);
1001
- if ($id != 0) {
1002
- $save = $wpdb->update($wpdb->prefix . 'bwg_theme', array(
 
1003
  'name' => $name,
1004
  'options' => $themes,
1005
- 'default_theme' => $default_theme,
1006
- ), array('id' => $id));
1007
  }
1008
  else {
1009
- $save = $wpdb->insert($wpdb->prefix . 'bwg_theme', array(
1010
  'name' => $name,
1011
  'options' => $themes,
1012
- 'default_theme' => $default_theme,
1013
- ));
1014
  }
1015
  if ($save !== FALSE) {
1016
  return 1;
@@ -1087,7 +1089,6 @@ class BWGControllerThemes_bwg {
1087
  $query_url = add_query_arg(array('page' => $page, 'task' => 'display', 'message' => $message), $query_url);
1088
  WDWLibrary::spider_redirect($query_url);
1089
  }
1090
-
1091
  ////////////////////////////////////////////////////////////////////////////////////////
1092
  // Getters & Setters //
1093
  ////////////////////////////////////////////////////////////////////////////////////////
548
  $mosaic_thumb_transition = (isset($_POST['mosaic_thumb_transition']) ? esc_html(stripslashes( $_POST['mosaic_thumb_transition'])) : 1);
549
 
550
  $default_theme = (isset($_POST['default_theme']) ? esc_html(stripslashes( $_POST['default_theme'])) : 0);
551
+
552
+ $save_as_copy = (isset($_POST['save_as_copy']) ? esc_html(stripslashes( $_POST['save_as_copy'])) : 0);
553
+
554
  $themes = array(
555
  'thumb_margin' => $thumb_margin,
556
  'thumb_padding' => $thumb_padding,
672
  'lightbox_bg_color' => $lightbox_bg_color,
673
  'lightbox_overlay_bg_color' => $lightbox_overlay_bg_color,
674
  'lightbox_rl_btn_style' => $lightbox_rl_btn_style,
675
+ 'lightbox_bg_transparent' => $lightbox_bg_transparent,
676
 
677
  'blog_style_margin' => $blog_style_margin,
678
  'blog_style_padding' => $blog_style_padding,
997
  'carousel_caption_p_color' => $carousel_caption_p_color,
998
  'carousel_title_opacity' => $carousel_title_opacity,
999
  'carousel_title_border_radius' => $carousel_title_border_radius,
 
1000
  'mosaic_thumb_transition' => $mosaic_thumb_transition,
1001
  );
1002
  $themes = json_encode($themes);
1003
+
1004
+ if ($id == 0 || $save_as_copy == 1) {
1005
+ $save = $wpdb->insert($wpdb->prefix . 'bwg_theme', array(
1006
  'name' => $name,
1007
  'options' => $themes,
1008
+ 'default_theme' => 0,
1009
+ ));
1010
  }
1011
  else {
1012
+ $save = $wpdb->update($wpdb->prefix . 'bwg_theme', array(
1013
  'name' => $name,
1014
  'options' => $themes,
1015
+ ), array('id' => $id));
 
1016
  }
1017
  if ($save !== FALSE) {
1018
  return 1;
1089
  $query_url = add_query_arg(array('page' => $page, 'task' => 'display', 'message' => $message), $query_url);
1090
  WDWLibrary::spider_redirect($query_url);
1091
  }
 
1092
  ////////////////////////////////////////////////////////////////////////////////////////
1093
  // Getters & Setters //
1094
  ////////////////////////////////////////////////////////////////////////////////////////
admin/models/BWGModelThemes_bwg.php CHANGED
@@ -522,6 +522,13 @@ class BWGModelThemes_bwg {
522
  $row->id = 0;
523
  $row->name = '';
524
  $row->default_theme = 0;
 
 
 
 
 
 
 
525
  }
526
  return $row;
527
  }
522
  $row->id = 0;
523
  $row->name = '';
524
  $row->default_theme = 0;
525
+ $themes = json_decode($row->options);
526
+ foreach ($themes as $key => $value) {
527
+ $row->$key = $value;
528
+ }
529
+ if (!isset($row->lightbox_bg_transparent)) {
530
+ $row->lightbox_bg_transparent = 100;
531
+ }
532
  }
533
  return $row;
534
  }
admin/views/BWGViewThemes_bwg.php CHANGED
@@ -262,6 +262,10 @@ class BWGViewThemes_bwg {
262
  <h2><?php echo $page_title; ?></h2>
263
  <div style="float: right; margin: 0 5px 0 0;">
264
  <input class="button-secondary" type="submit" onclick="if (spider_check_required('name', 'Name')) {return false;}; spider_set_input_value('task', 'save')" value="<?php _e("Save", 'bwg_back'); ?>"/>
 
 
 
 
265
  <input class="button-secondary" type="submit" onclick="if (spider_check_required('name', 'Name')) {return false;}; spider_set_input_value('task', 'apply')" value="<?php _e("Apply", 'bwg_back'); ?>"/>
266
  <input class="button-secondary" type="submit" onclick="spider_set_input_value('task', 'cancel')" value="<?php _e("Cancel", 'bwg_back'); ?>"/>
267
  <input title="Reset to default theme" class="button-primary" type="submit" onclick="if (confirm('<?php echo addslashes(__("Do you want to reset to default?", 'bwg_back')); ?>')) {
262
  <h2><?php echo $page_title; ?></h2>
263
  <div style="float: right; margin: 0 5px 0 0;">
264
  <input class="button-secondary" type="submit" onclick="if (spider_check_required('name', 'Name')) {return false;}; spider_set_input_value('task', 'save')" value="<?php _e("Save", 'bwg_back'); ?>"/>
265
+ <?php if ($id) { ?>
266
+ <input class="button-secondary" type="submit" onclick="if (spider_check_required('name', 'Name')) {return false;}; spider_set_input_value('task', 'save');
267
+ spider_set_input_value('save_as_copy', 1)" value="<?php echo __('Save as Copy', 'bwg_back'); ?>" />
268
+ <?php } ?>
269
  <input class="button-secondary" type="submit" onclick="if (spider_check_required('name', 'Name')) {return false;}; spider_set_input_value('task', 'apply')" value="<?php _e("Apply", 'bwg_back'); ?>"/>
270
  <input class="button-secondary" type="submit" onclick="spider_set_input_value('task', 'cancel')" value="<?php _e("Cancel", 'bwg_back'); ?>"/>
271
  <input title="Reset to default theme" class="button-primary" type="submit" onclick="if (confirm('<?php echo addslashes(__("Do you want to reset to default?", 'bwg_back')); ?>')) {
filemanager/UploadHandler.php CHANGED
@@ -23,8 +23,8 @@ require_once(WD_BWG_DIR . '/filemanager/controller.php');
23
  $controller = new FilemanagerController();
24
 
25
  $upload_handler = new UploadHandler(array(
26
- 'upload_dir' => $controller->uploads_dir . (isset($_GET['dir']) ? esc_html($_GET['dir']) : ''),
27
- 'accept_file_types' => '/\.(gif|jpe?g|png|bmp|mp4|flv|webm|ogg|mp3|wav|pdf|zip)$/i'
28
  ));
29
 
30
  class UploadHandler {
@@ -510,7 +510,7 @@ class UploadHandler {
510
  // into different directories or replacing hidden system files.
511
  // Also remove control characters and spaces (\x00..\x20) around the filename:
512
  $name = trim(stripslashes($name), ".\x00..\x20");
513
- $name = str_replace(' ', '_', $name);
514
  // Use a timestamp for empty filenames:
515
  if (!$name) {
516
  $name = str_replace('.', '-', microtime(true));
23
  $controller = new FilemanagerController();
24
 
25
  $upload_handler = new UploadHandler(array(
26
+ 'upload_dir' => $controller->uploads_dir . (isset($_GET['dir']) ? str_replace('\\', '', ($_GET['dir'])) : ''),
27
+ 'accept_file_types' => '/\.(gif|jpe?g|png|bmp|mp4|flv|webm|ogg|mp3|wav|pdf|zip)$/i'
28
  ));
29
 
30
  class UploadHandler {
510
  // into different directories or replacing hidden system files.
511
  // Also remove control characters and spaces (\x00..\x20) around the filename:
512
  $name = trim(stripslashes($name), ".\x00..\x20");
513
+ $name = str_replace(" ", "_", $name);
514
  // Use a timestamp for empty filenames:
515
  if (!$name) {
516
  $name = str_replace('.', '-', microtime(true));
filemanager/controller.php CHANGED
@@ -71,11 +71,12 @@ class FilemanagerController {
71
  }
72
 
73
  public function make_dir() {
74
- $input_dir = (isset($_REQUEST['dir']) ? stripslashes(esc_html($_REQUEST['dir'])) : '');
 
75
  $cur_dir_path = $input_dir == '' ? $this->uploads_dir : $this->uploads_dir . '/' . $input_dir;
76
 
77
  $new_dir_path = $cur_dir_path . '/' . (isset($_REQUEST['new_dir_name']) ? stripslashes(esc_html($_REQUEST['new_dir_name'])) : '');
78
-
79
  $msg = '';
80
  if (file_exists($new_dir_path) == true) {
81
  $msg = "Directory already exists.";
@@ -84,21 +85,22 @@ class FilemanagerController {
84
  mkdir($new_dir_path);
85
  }
86
  $query_url = wp_nonce_url( admin_url('admin-ajax.php'), 'addImages', 'bwg_nonce' );
87
- $query_url = add_query_arg(array('action' => 'addImages', 'filemanager_msg' => $msg, 'width' => '650', 'height' => '500', 'task' => 'display', 'extensions' => esc_html($_REQUEST['extensions']), 'callback' => esc_html($_REQUEST['callback']), 'dir' => esc_html($_REQUEST['dir']), 'TB_iframe' => '1'), $query_url);
88
  header('Location: ' . $query_url);
89
  exit;
90
  }
91
 
92
  public function rename_item() {
93
- $input_dir = (isset($_REQUEST['dir']) ? stripslashes(esc_html($_REQUEST['dir'])) : '');
 
94
  $cur_dir_path = $input_dir == '' ? $this->uploads_dir : $this->uploads_dir . '/' . $input_dir;
95
- $cur_dir_path = htmlspecialchars_decode($cur_dir_path, ENT_COMPAT | ENT_QUOTES);
96
 
97
  $file_names = explode('**#**', (isset($_REQUEST['file_names']) ? stripslashes(esc_html($_REQUEST['file_names'])) : ''));
98
  $file_name = $file_names[0];
99
  $file_name = htmlspecialchars_decode($file_name, ENT_COMPAT | ENT_QUOTES);
100
 
101
  $file_new_name = (isset($_REQUEST['file_new_name']) ? stripslashes(esc_html($_REQUEST['file_new_name'])) : '');
 
102
 
103
  $file_path = $cur_dir_path . '/' . $file_name;
104
  $thumb_file_path = $cur_dir_path . '/thumb/' . $file_name;
@@ -110,13 +112,13 @@ class FilemanagerController {
110
  }
111
  elseif (is_dir($file_path) == true) {
112
  if (rename($file_path, $cur_dir_path . '/' . $file_new_name) == false) {
113
- $msg = "Can't rename the file.";
114
  }
115
  }
116
  elseif ((strrpos($file_name, '.') !== false)) {
117
  $file_extension = substr($file_name, strrpos($file_name, '.') + 1);
118
  if (rename($file_path, $cur_dir_path . '/' . $file_new_name . '.' . $file_extension) == false) {
119
- $msg = "Can't rename the file.";
120
  }
121
  rename($thumb_file_path, $cur_dir_path . '/thumb/' . $file_new_name . '.' . $file_extension);
122
  rename($original_file_path, $cur_dir_path . '/.original/' . $file_new_name . '.' . $file_extension);
@@ -126,15 +128,15 @@ class FilemanagerController {
126
  }
127
  $_REQUEST['file_names'] = '';
128
  $query_url = wp_nonce_url( admin_url('admin-ajax.php'), 'addImages', 'bwg_nonce' );
129
- $query_url = add_query_arg(array('action' => 'addImages', 'filemanager_msg' => $msg, 'width' => '650', 'height' => '500', 'task' => 'display', 'extensions' => esc_html($_REQUEST['extensions']), 'callback' => esc_html($_REQUEST['callback']), 'dir' => esc_html($_REQUEST['dir']), 'TB_iframe' => '1'), $query_url);
130
  header('Location: ' . $query_url);
131
  exit;
132
  }
133
 
134
  public function remove_items() {
135
- $input_dir = (isset($_REQUEST['dir']) ? stripslashes(esc_html($_REQUEST['dir'])) : '');
 
136
  $cur_dir_path = $input_dir == '' ? $this->uploads_dir : $this->uploads_dir . '/' . $input_dir;
137
- $cur_dir_path = htmlspecialchars_decode($cur_dir_path, ENT_COMPAT | ENT_QUOTES);
138
 
139
  $file_names = explode('**#**', (isset($_REQUEST['file_names']) ? stripslashes(esc_html($_REQUEST['file_names'])) : ''));
140
 
@@ -159,12 +161,14 @@ class FilemanagerController {
159
  }
160
  $_REQUEST['file_names'] = '';
161
  $query_url = wp_nonce_url( admin_url('admin-ajax.php'), 'addImages', 'bwg_nonce' );
162
- $query_url = add_query_arg(array('action' => 'addImages', 'filemanager_msg' => $msg, 'width' => '650', 'height' => '500', 'task' => 'show_file_manager', 'extensions' => esc_html($_REQUEST['extensions']), 'callback' => esc_html($_REQUEST['callback']), 'dir' => esc_html($_REQUEST['dir']), 'TB_iframe' => '1'), $query_url);
163
  header('Location: ' . $query_url);
164
  exit;
165
  }
166
 
167
  public function paste_items() {
 
 
168
  $msg = '';
169
 
170
  $file_names = explode('**#**', (isset($_REQUEST['clipboard_files']) ? stripslashes($_REQUEST['clipboard_files']) : ''));
@@ -251,7 +255,7 @@ class FilemanagerController {
251
  break;
252
  }
253
  $query_url = wp_nonce_url( admin_url('admin-ajax.php'), 'addImages', 'bwg_nonce' );
254
- $query_url = add_query_arg(array('action' => 'addImages', 'filemanager_msg' => $msg, 'width' => '650', 'height' => '500', 'task' => 'show_file_manager', 'extensions' => esc_html($_REQUEST['extensions']), 'callback' => esc_html($_REQUEST['callback']), 'dir' => esc_html($_REQUEST['dir']), 'TB_iframe' => '1'), $query_url);
255
  header('Location: ' . $query_url);
256
  exit;
257
  }
@@ -263,7 +267,6 @@ class FilemanagerController {
263
  exit;
264
  }
265
 
266
-
267
  ////////////////////////////////////////////////////////////////////////////////////////
268
  // Getters & Setters //
269
  ////////////////////////////////////////////////////////////////////////////////////////
71
  }
72
 
73
  public function make_dir() {
74
+ $input_dir = (isset($_REQUEST['dir']) ? str_replace('\\', '', esc_html($_REQUEST['dir'])) : '');
75
+ $input_dir = htmlspecialchars_decode($input_dir, ENT_COMPAT | ENT_QUOTES);
76
  $cur_dir_path = $input_dir == '' ? $this->uploads_dir : $this->uploads_dir . '/' . $input_dir;
77
 
78
  $new_dir_path = $cur_dir_path . '/' . (isset($_REQUEST['new_dir_name']) ? stripslashes(esc_html($_REQUEST['new_dir_name'])) : '');
79
+ $new_dir_path = htmlspecialchars_decode($new_dir_path, ENT_COMPAT | ENT_QUOTES);
80
  $msg = '';
81
  if (file_exists($new_dir_path) == true) {
82
  $msg = "Directory already exists.";
85
  mkdir($new_dir_path);
86
  }
87
  $query_url = wp_nonce_url( admin_url('admin-ajax.php'), 'addImages', 'bwg_nonce' );
88
+ $query_url = add_query_arg(array('action' => 'addImages', 'filemanager_msg' => $msg, 'width' => '650', 'height' => '500', 'task' => 'display', 'extensions' => esc_html($_REQUEST['extensions']), 'callback' => esc_html($_REQUEST['callback']), 'dir' => $input_dir, 'TB_iframe' => '1'), $query_url);
89
  header('Location: ' . $query_url);
90
  exit;
91
  }
92
 
93
  public function rename_item() {
94
+ $input_dir = (isset($_REQUEST['dir']) ? str_replace('\\', '', esc_html($_REQUEST['dir'])) : '');
95
+ $input_dir = htmlspecialchars_decode($input_dir, ENT_COMPAT | ENT_QUOTES);
96
  $cur_dir_path = $input_dir == '' ? $this->uploads_dir : $this->uploads_dir . '/' . $input_dir;
 
97
 
98
  $file_names = explode('**#**', (isset($_REQUEST['file_names']) ? stripslashes(esc_html($_REQUEST['file_names'])) : ''));
99
  $file_name = $file_names[0];
100
  $file_name = htmlspecialchars_decode($file_name, ENT_COMPAT | ENT_QUOTES);
101
 
102
  $file_new_name = (isset($_REQUEST['file_new_name']) ? stripslashes(esc_html($_REQUEST['file_new_name'])) : '');
103
+ $file_new_name = htmlspecialchars_decode($file_new_name, ENT_COMPAT | ENT_QUOTES);
104
 
105
  $file_path = $cur_dir_path . '/' . $file_name;
106
  $thumb_file_path = $cur_dir_path . '/thumb/' . $file_name;
112
  }
113
  elseif (is_dir($file_path) == true) {
114
  if (rename($file_path, $cur_dir_path . '/' . $file_new_name) == false) {
115
+ $msg = "Can't rename the file.";
116
  }
117
  }
118
  elseif ((strrpos($file_name, '.') !== false)) {
119
  $file_extension = substr($file_name, strrpos($file_name, '.') + 1);
120
  if (rename($file_path, $cur_dir_path . '/' . $file_new_name . '.' . $file_extension) == false) {
121
+ $msg = "Can't rename the file.";
122
  }
123
  rename($thumb_file_path, $cur_dir_path . '/thumb/' . $file_new_name . '.' . $file_extension);
124
  rename($original_file_path, $cur_dir_path . '/.original/' . $file_new_name . '.' . $file_extension);
128
  }
129
  $_REQUEST['file_names'] = '';
130
  $query_url = wp_nonce_url( admin_url('admin-ajax.php'), 'addImages', 'bwg_nonce' );
131
+ $query_url = add_query_arg(array('action' => 'addImages', 'filemanager_msg' => $msg, 'width' => '650', 'height' => '500', 'task' => 'display', 'extensions' => esc_html($_REQUEST['extensions']), 'callback' => esc_html($_REQUEST['callback']), 'dir' => $input_dir, 'TB_iframe' => '1'), $query_url);
132
  header('Location: ' . $query_url);
133
  exit;
134
  }
135
 
136
  public function remove_items() {
137
+ $input_dir = (isset($_REQUEST['dir']) ? str_replace('\\', '', ($_REQUEST['dir'])) : '');
138
+ $input_dir = htmlspecialchars_decode($input_dir, ENT_COMPAT | ENT_QUOTES);
139
  $cur_dir_path = $input_dir == '' ? $this->uploads_dir : $this->uploads_dir . '/' . $input_dir;
 
140
 
141
  $file_names = explode('**#**', (isset($_REQUEST['file_names']) ? stripslashes(esc_html($_REQUEST['file_names'])) : ''));
142
 
161
  }
162
  $_REQUEST['file_names'] = '';
163
  $query_url = wp_nonce_url( admin_url('admin-ajax.php'), 'addImages', 'bwg_nonce' );
164
+ $query_url = add_query_arg(array('action' => 'addImages', 'filemanager_msg' => $msg, 'width' => '650', 'height' => '500', 'task' => 'show_file_manager', 'extensions' => esc_html($_REQUEST['extensions']), 'callback' => esc_html($_REQUEST['callback']), 'dir' => $input_dir, 'TB_iframe' => '1'), $query_url);
165
  header('Location: ' . $query_url);
166
  exit;
167
  }
168
 
169
  public function paste_items() {
170
+ $input_dir = (isset($_REQUEST['dir']) ? str_replace('\\', '', ($_REQUEST['dir'])) : '');
171
+ $input_dir = htmlspecialchars_decode($input_dir, ENT_COMPAT | ENT_QUOTES);
172
  $msg = '';
173
 
174
  $file_names = explode('**#**', (isset($_REQUEST['clipboard_files']) ? stripslashes($_REQUEST['clipboard_files']) : ''));
255
  break;
256
  }
257
  $query_url = wp_nonce_url( admin_url('admin-ajax.php'), 'addImages', 'bwg_nonce' );
258
+ $query_url = add_query_arg(array('action' => 'addImages', 'filemanager_msg' => $msg, 'width' => '650', 'height' => '500', 'task' => 'show_file_manager', 'extensions' => esc_html($_REQUEST['extensions']), 'callback' => esc_html($_REQUEST['callback']), 'dir' => $input_dir, 'TB_iframe' => '1'), $query_url);
259
  header('Location: ' . $query_url);
260
  exit;
261
  }
267
  exit;
268
  }
269
 
 
270
  ////////////////////////////////////////////////////////////////////////////////////////
271
  // Getters & Setters //
272
  ////////////////////////////////////////////////////////////////////////////////////////
filemanager/css/default.css CHANGED
@@ -529,6 +529,7 @@ html, body, div, span, th, td, a {
529
  -ms-user-select: none;
530
  user-select: none;
531
  }
 
532
  .wp-pointer.wp-pointer-aligned-left .wp-pointer-arrow {
533
  left: 88px;
534
  right: auto;
529
  -ms-user-select: none;
530
  user-select: none;
531
  }
532
+
533
  .wp-pointer.wp-pointer-aligned-left .wp-pointer-arrow {
534
  left: 88px;
535
  right: auto;
filemanager/js/default.js CHANGED
@@ -329,7 +329,14 @@ function onBtnBackClick(event, obj) {
329
  }
330
 
331
 
332
- function onPathComponentClick(event, obj, path) {
 
 
 
 
 
 
 
333
  submit("", null, null, null, path, null, null, null, null, null, null);
334
  }
335
 
329
  }
330
 
331
 
332
+ function onPathComponentClick(event, obj, key) {
333
+ if (typeof key != "undefined" && key == 0) {
334
+ path = "";
335
+ }
336
+ else {
337
+ path = jQuery(obj).html();
338
+ path = path.trim();
339
+ }
340
  submit("", null, null, null, path, null, null, null, null, null, null);
341
  }
342
 
filemanager/model.php CHANGED
@@ -20,7 +20,6 @@ class FilemanagerModel {
20
  ////////////////////////////////////////////////////////////////////////////////////////
21
  private $controller;
22
 
23
-
24
  ////////////////////////////////////////////////////////////////////////////////////////
25
  // Constructor & Destructor //
26
  ////////////////////////////////////////////////////////////////////////////////////////
@@ -28,7 +27,6 @@ class FilemanagerModel {
28
  $this->controller = $controller;
29
  }
30
 
31
-
32
  ////////////////////////////////////////////////////////////////////////////////////////
33
  // Public Methods //
34
  ////////////////////////////////////////////////////////////////////////////////////////
@@ -54,7 +52,6 @@ class FilemanagerModel {
54
  return $data;
55
  }
56
 
57
-
58
  ////////////////////////////////////////////////////////////////////////////////////////
59
  // Getters & Setters //
60
  ////////////////////////////////////////////////////////////////////////////////////////
@@ -106,9 +103,9 @@ class FilemanagerModel {
106
  $icons_dir_path = WD_BWG_DIR . '/filemanager/images/file_icons';
107
  $icons_dir_url = WD_BWG_URL . '/filemanager/images/file_icons';
108
  $valid_types = explode(',', isset($_REQUEST['extensions']) ? strtolower(esc_html($_REQUEST['extensions'])) : '*');
109
- $parent_dir = $this->controller->get_uploads_dir() . (isset($_REQUEST['dir']) ? '/' . esc_html($_REQUEST['dir']) : '');
110
- $parent_dir_url = $this->controller->get_uploads_url() . (isset($_REQUEST['dir']) ? '/' . esc_html($_REQUEST['dir']) : '');
111
-
112
 
113
  $file_names = $this->get_sorted_file_names($parent_dir, $sort_by, $sort_order);
114
 
@@ -170,7 +167,7 @@ class FilemanagerModel {
170
  $result = $sort_order == 'asc' ? array_merge($dirs, $files) : array_merge($files, $dirs);
171
  return $result;
172
  }
173
-
174
  function get_media_library_files($sort_by, $sort_order) {
175
  $icons_dir_path = WD_BWG_DIR . '/filemanager/images/file_icons';
176
  $icons_dir_url = WD_BWG_URL . '/filemanager/images/file_icons';
@@ -180,9 +177,8 @@ class FilemanagerModel {
180
  $parent_dir_url = $upload_dir['baseurl'];
181
 
182
  $query_images_args = array(
183
- 'post_type' => 'attachment', 'post_mime_type' =>'image', 'post_status' => 'inherit', 'posts_per_page' => -1,
184
  );
185
-
186
  $query_images = new WP_Query( $query_images_args );
187
 
188
  $files = array();
20
  ////////////////////////////////////////////////////////////////////////////////////////
21
  private $controller;
22
 
 
23
  ////////////////////////////////////////////////////////////////////////////////////////
24
  // Constructor & Destructor //
25
  ////////////////////////////////////////////////////////////////////////////////////////
27
  $this->controller = $controller;
28
  }
29
 
 
30
  ////////////////////////////////////////////////////////////////////////////////////////
31
  // Public Methods //
32
  ////////////////////////////////////////////////////////////////////////////////////////
52
  return $data;
53
  }
54
 
 
55
  ////////////////////////////////////////////////////////////////////////////////////////
56
  // Getters & Setters //
57
  ////////////////////////////////////////////////////////////////////////////////////////
103
  $icons_dir_path = WD_BWG_DIR . '/filemanager/images/file_icons';
104
  $icons_dir_url = WD_BWG_URL . '/filemanager/images/file_icons';
105
  $valid_types = explode(',', isset($_REQUEST['extensions']) ? strtolower(esc_html($_REQUEST['extensions'])) : '*');
106
+ $dir = (isset($_REQUEST['dir']) ? '/' . htmlspecialchars_decode(stripslashes(esc_html($_REQUEST['dir'])), ENT_COMPAT | ENT_QUOTES) : '');
107
+ $parent_dir = $this->controller->get_uploads_dir() . $dir;
108
+ $parent_dir_url = $this->controller->get_uploads_url() . $dir;
109
 
110
  $file_names = $this->get_sorted_file_names($parent_dir, $sort_by, $sort_order);
111
 
167
  $result = $sort_order == 'asc' ? array_merge($dirs, $files) : array_merge($files, $dirs);
168
  return $result;
169
  }
170
+
171
  function get_media_library_files($sort_by, $sort_order) {
172
  $icons_dir_path = WD_BWG_DIR . '/filemanager/images/file_icons';
173
  $icons_dir_url = WD_BWG_URL . '/filemanager/images/file_icons';
177
  $parent_dir_url = $upload_dir['baseurl'];
178
 
179
  $query_images_args = array(
180
+ 'post_type' => 'attachment', 'post_mime_type' =>'image', 'post_status' => 'inherit', 'posts_per_page' => -1,
181
  );
 
182
  $query_images = new WP_Query( $query_images_args );
183
 
184
  $files = array();
filemanager/view.php CHANGED
@@ -55,12 +55,6 @@ class FilemanagerView {
55
  wp_print_scripts('jquery');
56
  wp_print_scripts('jquery-ui-widget');
57
  wp_print_scripts('wp-pointer');
58
- wp_print_styles('admin-bar');
59
- wp_print_styles('dashicons');
60
- wp_print_styles('wp-admin');
61
- wp_print_styles('buttons');
62
- wp_print_styles('wp-auth-check');
63
- wp_print_styles('wp-pointer');
64
  ?>
65
  <script src="<?php echo WD_BWG_URL; ?>/filemanager/js/jq_uploader/jquery.iframe-transport.js"></script>
66
  <script src="<?php echo WD_BWG_URL; ?>/filemanager/js/jq_uploader/jquery.fileupload.js"></script>
@@ -78,7 +72,7 @@ class FilemanagerView {
78
  var messageFilesUploadComplete = "<?php echo __('Processing uploaded files...', 'bwg_back'); ?>";
79
 
80
  var root = "<?php echo addslashes($this->controller->get_uploads_dir()); ?>";
81
- var dir = "<?php echo (isset($_REQUEST['dir']) ? addslashes(esc_html($_REQUEST['dir'])) : ''); ?>";
82
  var dirUrl = "<?php echo $this->controller->get_uploads_url() . (isset($_REQUEST['dir']) ? esc_html($_REQUEST['dir']) . '/' : ''); ?>";
83
  var callback = "<?php echo (isset($_REQUEST['callback']) ? esc_html($_REQUEST['callback']) : ''); ?>";
84
  var sortBy = "<?php echo $sort_by; ?>";
@@ -133,7 +127,7 @@ class FilemanagerView {
133
  <a class="ctrl_bar_btn btn_remove_items" onclick="onBtnRemoveItemsClick(event, this);" title="<?php echo __('Remove items', 'bwg_back'); ?>"></a>
134
  <span class="ctrl_bar_divider"></span>
135
  <span class="ctrl_bar_btn btn_primary">
136
- <a class="ctrl_bar_btn btn_upload_files" id='upload_images' onclick="onBtnShowUploaderClick(event, this);"><?php echo __('Upload files', 'bwg_back'); ?></a>
137
  </span>
138
  <?php if ($bwg_options->enable_ML_import) { ?>
139
  <span class="ctrl_bar_divider"></span>
@@ -141,7 +135,7 @@ class FilemanagerView {
141
  <a class="ctrl_bar_btn btn_import_files" onclick="onBtnShowImportClick(event, this);"><?php echo __('Media library', 'bwg_back'); ?></a>
142
  </span>
143
  <?php } ?>
144
- <span class="ctrl_bar_divider"></span>
145
  <span id="search_by_name" class="ctrl_bar_btn">
146
  <input type="search" placeholder="Search" class="ctrl_bar_btn search_by_name">
147
  </span>
@@ -156,8 +150,8 @@ class FilemanagerView {
156
  foreach ($file_manager_data['path_components'] as $key => $path_component) {
157
  ?>
158
  <a <?php echo ($key == 0) ? 'title="'. __("To change upload directory go to Options page.", 'bwg_back').'"' : ''; ?> class="path_component path_dir"
159
- onclick="onPathComponentClick(event, this, '<?php echo addslashes($path_component['path']); ?>');">
160
- <?php echo $path_component['name']; ?></a>
161
  <a class="path_component path_separator"><?php echo '/'; ?></a>
162
  <?php
163
  }
@@ -273,14 +267,14 @@ class FilemanagerView {
273
  </div>
274
  <div class="ctrls_bar ctrls_bar_footer">
275
  <div class="ctrls_left">
276
- <a class="ctrl_bar_btn btn_open btn_primary none_select" id='select_all_images' onclick="onBtnSelectAllClick();"><?php echo __('Select All', 'bwg_back'); ?></a>
277
  </div>
278
  <div class="ctrls_right">
279
  <span id="file_names_span">
280
  <span>
281
  </span>
282
  </span>
283
- <a class="ctrl_bar_btn btn_open btn_primary none_select" id='add_selectid_img' onclick="onBtnOpenClick(event, this);"><?php echo ((isset($_REQUEST['callback']) && esc_html($_REQUEST['callback']) == 'bwg_add_image') ? __('Add selected images to gallery', 'bwg_back') : __('Add', 'bwg_back')); ?></a>
284
  <span class="ctrl_bar_empty_devider"></span>
285
  <a class="ctrl_bar_btn btn_cancel btn_secondary none_select" onclick="onBtnCancelClick(event, this);"><?php echo 'Cancel'; ?></a>
286
  </div>
@@ -395,8 +389,6 @@ class FilemanagerView {
395
  <?php
396
  $query_url = wp_nonce_url( admin_url('admin-ajax.php'), 'bwg_UploadHandler', 'bwg_nonce' );
397
  $query_url = add_query_arg(array('action' => 'bwg_UploadHandler', 'dir' => (isset($_REQUEST['dir']) ? esc_html($_REQUEST['dir']) : '') . '/'), $query_url);
398
-
399
-
400
  ?>
401
 
402
 
@@ -469,7 +461,7 @@ class FilemanagerView {
469
  <input type="hidden" name="sort_by" value="<?php echo $sort_by; ?>">
470
  <input type="hidden" name="sort_order" value="<?php echo $sort_order; ?>">
471
  <input type="hidden" name="items_view" value="<?php echo $items_view; ?>">
472
- <input type="hidden" name="dir" value="<?php echo (isset($_REQUEST['dir']) ? esc_html($_REQUEST['dir']) : ''); ?>"/>
473
  <input type="hidden" name="file_names" value=""/>
474
  <input type="hidden" name="file_namesML" value=""/>
475
  <input type="hidden" name="file_new_name" value=""/>
55
  wp_print_scripts('jquery');
56
  wp_print_scripts('jquery-ui-widget');
57
  wp_print_scripts('wp-pointer');
 
 
 
 
 
 
58
  ?>
59
  <script src="<?php echo WD_BWG_URL; ?>/filemanager/js/jq_uploader/jquery.iframe-transport.js"></script>
60
  <script src="<?php echo WD_BWG_URL; ?>/filemanager/js/jq_uploader/jquery.fileupload.js"></script>
72
  var messageFilesUploadComplete = "<?php echo __('Processing uploaded files...', 'bwg_back'); ?>";
73
 
74
  var root = "<?php echo addslashes($this->controller->get_uploads_dir()); ?>";
75
+ var dir = "<?php echo (isset($_REQUEST['dir']) ? trim(esc_html($_REQUEST['dir'])) : ''); ?>";
76
  var dirUrl = "<?php echo $this->controller->get_uploads_url() . (isset($_REQUEST['dir']) ? esc_html($_REQUEST['dir']) . '/' : ''); ?>";
77
  var callback = "<?php echo (isset($_REQUEST['callback']) ? esc_html($_REQUEST['callback']) : ''); ?>";
78
  var sortBy = "<?php echo $sort_by; ?>";
127
  <a class="ctrl_bar_btn btn_remove_items" onclick="onBtnRemoveItemsClick(event, this);" title="<?php echo __('Remove items', 'bwg_back'); ?>"></a>
128
  <span class="ctrl_bar_divider"></span>
129
  <span class="ctrl_bar_btn btn_primary">
130
+ <a id="upload_images" class="ctrl_bar_btn btn_upload_files" onclick="onBtnShowUploaderClick(event, this);"><?php echo __('Upload files', 'bwg_back'); ?></a>
131
  </span>
132
  <?php if ($bwg_options->enable_ML_import) { ?>
133
  <span class="ctrl_bar_divider"></span>
135
  <a class="ctrl_bar_btn btn_import_files" onclick="onBtnShowImportClick(event, this);"><?php echo __('Media library', 'bwg_back'); ?></a>
136
  </span>
137
  <?php } ?>
138
+ <span class="ctrl_bar_divider"></span>
139
  <span id="search_by_name" class="ctrl_bar_btn">
140
  <input type="search" placeholder="Search" class="ctrl_bar_btn search_by_name">
141
  </span>
150
  foreach ($file_manager_data['path_components'] as $key => $path_component) {
151
  ?>
152
  <a <?php echo ($key == 0) ? 'title="'. __("To change upload directory go to Options page.", 'bwg_back').'"' : ''; ?> class="path_component path_dir"
153
+ onclick="onPathComponentClick(event, this, <?php echo $key; ?>);">
154
+ <?php echo str_replace('\\', '', $path_component['name']); ?></a>
155
  <a class="path_component path_separator"><?php echo '/'; ?></a>
156
  <?php
157
  }
267
  </div>
268
  <div class="ctrls_bar ctrls_bar_footer">
269
  <div class="ctrls_left">
270
+ <a id="select_all_images" class="ctrl_bar_btn btn_open btn_primary none_select" onclick="onBtnSelectAllClick();"><?php echo __('Select All', 'bwg_back'); ?></a>
271
  </div>
272
  <div class="ctrls_right">
273
  <span id="file_names_span">
274
  <span>
275
  </span>
276
  </span>
277
+ <a id="add_selectid_img" class="ctrl_bar_btn btn_open btn_primary none_select" onclick="onBtnOpenClick(event, this);"><?php echo ((isset($_REQUEST['callback']) && esc_html($_REQUEST['callback']) == 'bwg_add_image') ? __('Add selected images to gallery', 'bwg_back') : __('Add', 'bwg_back')); ?></a>
278
  <span class="ctrl_bar_empty_devider"></span>
279
  <a class="ctrl_bar_btn btn_cancel btn_secondary none_select" onclick="onBtnCancelClick(event, this);"><?php echo 'Cancel'; ?></a>
280
  </div>
389
  <?php
390
  $query_url = wp_nonce_url( admin_url('admin-ajax.php'), 'bwg_UploadHandler', 'bwg_nonce' );
391
  $query_url = add_query_arg(array('action' => 'bwg_UploadHandler', 'dir' => (isset($_REQUEST['dir']) ? esc_html($_REQUEST['dir']) : '') . '/'), $query_url);
 
 
392
  ?>
393
 
394
 
461
  <input type="hidden" name="sort_by" value="<?php echo $sort_by; ?>">
462
  <input type="hidden" name="sort_order" value="<?php echo $sort_order; ?>">
463
  <input type="hidden" name="items_view" value="<?php echo $items_view; ?>">
464
+ <input type="hidden" name="dir" value="<?php echo (isset($_REQUEST['dir']) ? str_replace('\\', '', ($_REQUEST['dir'])) : ''); ?>"/>
465
  <input type="hidden" name="file_names" value=""/>
466
  <input type="hidden" name="file_namesML" value=""/>
467
  <input type="hidden" name="file_new_name" value=""/>
framework/WDWLibrary.php CHANGED
@@ -144,6 +144,18 @@ class WDWLibrary {
144
  break;
145
 
146
  }
 
 
 
 
 
 
 
 
 
 
 
 
147
  }
148
  return '<div style="width:99%"><div class="' . $type . '"><p><strong>' . $message . '</strong></p></div></div>';
149
  }
144
  break;
145
 
146
  }
147
+ case 18: {
148
+ $message = __('Theme successfully copied.', 'bwg_back');
149
+ $type = 'updated';
150
+ break;
151
+
152
+ }
153
+ case 19: {
154
+ $message = __('Failed.', 'bwg_back');
155
+ $type = 'error';
156
+ break;
157
+
158
+ }
159
  }
160
  return '<div style="width:99%"><div class="' . $type . '"><p><strong>' . $message . '</strong></p></div></div>';
161
  }
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.107
8
  * Author: WebDorado
9
  * Author URI: https://web-dorado.com/
10
  * License: GNU/GPLv3 http://www.gnu.org/licenses/gpl-3.0.html
@@ -1903,7 +1903,6 @@ function bwg_activate() {
1903
  'carousel_caption_p_color' => 'white',
1904
  'carousel_title_opacity' => 100,
1905
  'carousel_title_border_radius' => '5px',
1906
- 'default_theme' => 0,
1907
  'mosaic_thumb_transition' => 1
1908
  );
1909
  $theme1 = json_encode($theme1);
@@ -1924,7 +1923,7 @@ function bwg_activate() {
1924
  ));
1925
  }
1926
  $version = WD_BWG_VERSION;
1927
- $new_version = '1.2.107';
1928
  if ($version && version_compare($version, $new_version, '<')) {
1929
  require_once WD_BWG_DIR . "/update/bwg_update.php";
1930
  bwg_update($version);
@@ -1978,7 +1977,7 @@ wp_oembed_add_provider( '#https://instagr(\.am|am\.com)/p/.*#i', 'https://api.in
1978
 
1979
  function bwg_update_hook() {
1980
  $version = WD_BWG_VERSION;
1981
- $new_version = '1.2.107';
1982
  if ($version && version_compare($version, $new_version, '<')) {
1983
  require_once WD_BWG_DIR . "/update/bwg_update.php";
1984
  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.108
8
  * Author: WebDorado
9
  * Author URI: https://web-dorado.com/
10
  * License: GNU/GPLv3 http://www.gnu.org/licenses/gpl-3.0.html
1903
  'carousel_caption_p_color' => 'white',
1904
  'carousel_title_opacity' => 100,
1905
  'carousel_title_border_radius' => '5px',
 
1906
  'mosaic_thumb_transition' => 1
1907
  );
1908
  $theme1 = json_encode($theme1);
1923
  ));
1924
  }
1925
  $version = WD_BWG_VERSION;
1926
+ $new_version = '1.2.108';
1927
  if ($version && version_compare($version, $new_version, '<')) {
1928
  require_once WD_BWG_DIR . "/update/bwg_update.php";
1929
  bwg_update($version);
1977
 
1978
  function bwg_update_hook() {
1979
  $version = WD_BWG_VERSION;
1980
+ $new_version = '1.2.108';
1981
  if ($version && version_compare($version, $new_version, '<')) {
1982
  require_once WD_BWG_DIR . "/update/bwg_update.php";
1983
  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.107
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.107 =
229
  * Fixed: Responsiveness
230
  * Fixed: Bug on full-size and fullscreen lightbox
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.108
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.108 =
229
+ * Added: Save as copy themes.
230
+ * Fixed: Delete folder with single quote in name.
231
+ * Fixed: Add facebook album with images more than 100.
232
+
233
  = 1.2.107 =
234
  * Fixed: Responsiveness
235
  * Fixed: Bug on full-size and fullscreen lightbox