Slider by WD – Responsive Slider - Version 1.1.71

Version Description

  • Fixed: Save as copy.
Download this release

Release Info

Developer webdorado
Plugin Icon 128x128 Slider by WD – Responsive Slider
Version 1.1.71
Comparing to
See all releases

Code changes from version 1.1.70 to 1.1.71

admin/controllers/WDSControllerSliders_wds.php CHANGED
@@ -84,7 +84,7 @@ class WDSControllerSliders_wds {
84
  $params_array = json_decode($slider_data, TRUE);
85
  $del_slide_ids_string = (isset($params_array['del_slide_ids_string']) ? substr(esc_html(stripslashes($params_array['del_slide_ids_string'])), 0, -1) : '');
86
  if ($del_slide_ids_string) {
87
- $wpdb->query('DELETE FROM ' . $wpdb->prefix . 'wdsslide WHERE id IN (' . $del_slide_ids_string . ')');
88
  }
89
  $name = ((isset($params_array['name'])) ? esc_html(stripslashes($params_array['name'])) : '');
90
  $published = ((isset($params_array['published'])) ? (int) esc_html(stripslashes($params_array['published'])) : 1);
@@ -358,6 +358,7 @@ class WDSControllerSliders_wds {
358
  public function save_slide_db() {
359
  global $wpdb;
360
  $slider_id = (isset($_POST['current_id']) ? (int) $_POST['current_id'] : 0);
 
361
  if (!$slider_id) {
362
  $slider_id = $wpdb->get_var('SELECT MAX(id) FROM ' . $wpdb->prefix . 'wdsslider');
363
  }
@@ -372,7 +373,7 @@ class WDSControllerSliders_wds {
372
  $params_array = json_decode(stripslashes($slide_data), TRUE);
373
  $slide_id = (isset($params_array['id']) ? $params_array['id'] : 0);
374
  if ($slide_id) {
375
- $del_layer_ids_string = (isset($params_array['slide' . $slide_id . '_del_layer_ids_string']) ? substr(esc_html(stripslashes($params_array['slide' . $slide_id . '_del_layer_ids_string'])), 0, -1) : '');
376
  if ($del_layer_ids_string) {
377
  $wpdb->query('DELETE FROM ' . $wpdb->prefix . 'wdslayer WHERE id IN (' . $del_layer_ids_string . ')');
378
  }
@@ -386,7 +387,7 @@ class WDSControllerSliders_wds {
386
  $image_url = str_replace(site_url(), '{site_url}', $image_url);
387
  $thumb_url = ((isset($params_array['thumb_url' . $slide_id])) ? esc_html(stripslashes($params_array['thumb_url' . $slide_id])) : '');
388
  $thumb_url = str_replace(site_url(), '{site_url}', $thumb_url);
389
- if (strpos($slide_id, 'pr') !== FALSE) {
390
  $save = $wpdb->insert($wpdb->prefix . 'wdsslide', array(
391
  'slider_id' => $slider_id,
392
  'title' => $title,
@@ -427,6 +428,7 @@ class WDSControllerSliders_wds {
427
 
428
  public function save_layer_db($slide_id, $slide_id_pr, $params_array) {
429
  global $wpdb;
 
430
  $layer_ids_string = (isset($params_array['slide' . $slide_id . '_layer_ids_string']) ? esc_html(stripslashes($params_array['slide' . $slide_id . '_layer_ids_string'])) : '');
431
  $layer_id_array = explode(',', $layer_ids_string);
432
  foreach ($layer_id_array as $layer_id) {
@@ -489,7 +491,7 @@ class WDSControllerSliders_wds {
489
  $infinite_in = ((isset($params_array_layer['infinite_in'])) ? (int) esc_html(stripslashes($params_array_layer['infinite_in'])) : 1);
490
  $infinite_out = ((isset($params_array_layer['infinite_out'])) ? (int) esc_html(stripslashes($params_array_layer['infinite_out'])) : 1);
491
  if ($title) {
492
- if (strpos($layer_id, 'pr_') !== FALSE) {
493
  $save = $wpdb->insert($wpdb->prefix . 'wdslayer', array(
494
  'slide_id' => $slide_id_pr,
495
  'title' => $title,
84
  $params_array = json_decode($slider_data, TRUE);
85
  $del_slide_ids_string = (isset($params_array['del_slide_ids_string']) ? substr(esc_html(stripslashes($params_array['del_slide_ids_string'])), 0, -1) : '');
86
  if ($del_slide_ids_string) {
87
+ $wpdb->query('DELETE FROM ' . $wpdb->prefix . 'wdsslide WHERE slider_id=' . $slider_id . ' AND id IN (' . $del_slide_ids_string . ')');
88
  }
89
  $name = ((isset($params_array['name'])) ? esc_html(stripslashes($params_array['name'])) : '');
90
  $published = ((isset($params_array['published'])) ? (int) esc_html(stripslashes($params_array['published'])) : 1);
358
  public function save_slide_db() {
359
  global $wpdb;
360
  $slider_id = (isset($_POST['current_id']) ? (int) $_POST['current_id'] : 0);
361
+ $save_as_copy = (isset($_POST['save_as_copy']) ? (int) $_POST['save_as_copy'] : 0);
362
  if (!$slider_id) {
363
  $slider_id = $wpdb->get_var('SELECT MAX(id) FROM ' . $wpdb->prefix . 'wdsslider');
364
  }
373
  $params_array = json_decode(stripslashes($slide_data), TRUE);
374
  $slide_id = (isset($params_array['id']) ? $params_array['id'] : 0);
375
  if ($slide_id) {
376
+ $del_layer_ids_string = ((isset($params_array['slide' . $slide_id . '_del_layer_ids_string']) && !$save_as_copy) ? substr(esc_html(stripslashes($params_array['slide' . $slide_id . '_del_layer_ids_string'])), 0, -1) : '');
377
  if ($del_layer_ids_string) {
378
  $wpdb->query('DELETE FROM ' . $wpdb->prefix . 'wdslayer WHERE id IN (' . $del_layer_ids_string . ')');
379
  }
387
  $image_url = str_replace(site_url(), '{site_url}', $image_url);
388
  $thumb_url = ((isset($params_array['thumb_url' . $slide_id])) ? esc_html(stripslashes($params_array['thumb_url' . $slide_id])) : '');
389
  $thumb_url = str_replace(site_url(), '{site_url}', $thumb_url);
390
+ if (strpos($slide_id, 'pr') !== FALSE || $save_as_copy) {
391
  $save = $wpdb->insert($wpdb->prefix . 'wdsslide', array(
392
  'slider_id' => $slider_id,
393
  'title' => $title,
428
 
429
  public function save_layer_db($slide_id, $slide_id_pr, $params_array) {
430
  global $wpdb;
431
+ $save_as_copy = (isset($_POST['save_as_copy']) ? (int) $_POST['save_as_copy'] : 0);
432
  $layer_ids_string = (isset($params_array['slide' . $slide_id . '_layer_ids_string']) ? esc_html(stripslashes($params_array['slide' . $slide_id . '_layer_ids_string'])) : '');
433
  $layer_id_array = explode(',', $layer_ids_string);
434
  foreach ($layer_id_array as $layer_id) {
491
  $infinite_in = ((isset($params_array_layer['infinite_in'])) ? (int) esc_html(stripslashes($params_array_layer['infinite_in'])) : 1);
492
  $infinite_out = ((isset($params_array_layer['infinite_out'])) ? (int) esc_html(stripslashes($params_array_layer['infinite_out'])) : 1);
493
  if ($title) {
494
+ if (strpos($layer_id, 'pr_') !== FALSE || $save_as_copy) {
495
  $save = $wpdb->insert($wpdb->prefix . 'wdslayer', array(
496
  'slide_id' => $slide_id_pr,
497
  'title' => $title,
admin/models/WDSModelSliders_wds.php CHANGED
@@ -25,9 +25,9 @@ class WDSModelSliders_wds {
25
  return $count;
26
  }
27
 
28
- public function get_slides_row_data($slider_id, $order_dir = 'asc') {
29
  global $wpdb;
30
- $rows = $wpdb->get_results($wpdb->prepare("SELECT * FROM " . $wpdb->prefix . "wdsslide WHERE slider_id='%d' ORDER BY `order` " . esc_sql($order_dir), $slider_id));
31
  if (!$rows) {
32
  $rows = array();
33
  $rows[0] = new stdClass();
@@ -63,9 +63,9 @@ class WDSModelSliders_wds {
63
  return $rows;
64
  }
65
 
66
- public function get_slider_prev_img($slider_id, $order_dir = 'asc') {
67
  global $wpdb;
68
- $slider = $wpdb->get_row($wpdb->prepare("SELECT `thumb_url`, `type` FROM " . $wpdb->prefix . "wdsslide WHERE slider_id='%d' ORDER BY `order` " . esc_sql($order_dir), $slider_id));
69
  $prev_img_url = $slider->type == 'video' && ctype_digit($slider->thumb_url) ? (wp_get_attachment_url(get_post_thumbnail_id($slider->thumb_url)) ? wp_get_attachment_url(get_post_thumbnail_id($slider->thumb_url)) : WD_S_URL . '/images/no-video.png' ) : $slider->thumb_url;
70
  $prev_img_url = $prev_img_url ? $prev_img_url : WD_S_URL . '/images/no-image.png';
71
  $prev_img_url = str_replace('{site_url}', site_url(), $prev_img_url);
25
  return $count;
26
  }
27
 
28
+ public function get_slides_row_data($slider_id) {
29
  global $wpdb;
30
+ $rows = $wpdb->get_results($wpdb->prepare("SELECT * FROM " . $wpdb->prefix . "wdsslide WHERE slider_id='%d' ORDER BY `order` ASC", $slider_id));
31
  if (!$rows) {
32
  $rows = array();
33
  $rows[0] = new stdClass();
63
  return $rows;
64
  }
65
 
66
+ public function get_slider_prev_img($slider_id) {
67
  global $wpdb;
68
+ $slider = $wpdb->get_row($wpdb->prepare("SELECT `thumb_url`, `type` FROM " . $wpdb->prefix . "wdsslide WHERE slider_id='%d' ORDER BY `order` ASC", $slider_id));
69
  $prev_img_url = $slider->type == 'video' && ctype_digit($slider->thumb_url) ? (wp_get_attachment_url(get_post_thumbnail_id($slider->thumb_url)) ? wp_get_attachment_url(get_post_thumbnail_id($slider->thumb_url)) : WD_S_URL . '/images/no-video.png' ) : $slider->thumb_url;
70
  $prev_img_url = $prev_img_url ? $prev_img_url : WD_S_URL . '/images/no-image.png';
71
  $prev_img_url = str_replace('{site_url}', site_url(), $prev_img_url);
admin/views/WDSViewSliders_wds.php CHANGED
@@ -180,8 +180,7 @@ class WDSViewSliders_wds {
180
  $alternate = ($alternate == 'class="wds_alternate"') ? '' : 'class="wds_alternate"';
181
  $published_image = (($row_data->published) ? 'publish_slide' : 'unpublish_slide');
182
  $published = (($row_data->published) ? 'unpublish' : 'publish');
183
- $order_dir = isset($row_data->order_dir) ? $row_data->order_dir : 'asc';
184
- $prev_img_url = $this->model->get_slider_prev_img($row_data->id, $order_dir);
185
  $slides_count = $this->model->get_slides_count($row_data->id);
186
  ?>
187
  <tr id="tr_<?php echo $row_data->id; ?>" <?php echo $alternate; ?>>
@@ -256,8 +255,7 @@ class WDSViewSliders_wds {
256
  $query_url = wp_nonce_url($query_url, 'addImage', 'nonce_wd');
257
 
258
  $row = $this->model->get_row_data($id, $reset);
259
- $order_dir = isset($row->order_dir) ? $row->order_dir : 'asc';
260
- $slides_row = $this->model->get_slides_row_data($id, $order_dir);
261
  $slide_ids_string = '';
262
  $sub_tab_type = WDW_S_Library::get('sub_tab', '');
263
 
@@ -605,9 +603,10 @@ class WDSViewSliders_wds {
605
  </div>
606
  <div class="wds_button_wrap">
607
  <input class="wds_button-secondary wds_dublicate_slide" type="button" onclick="if (wds_check_required('name', 'Name')) {return false;};
608
- spider_set_input_value('task', 'duplicate');
609
- spider_set_input_value('sub_tab', '');
610
- spider_ajax_save('sliders_form', event);" value="Save as Copy" />
 
611
  </div>
612
  <div class="wds_button_wrap">
613
  <input id="wds_preview" type="button" class="action_buttons" value="Preview"
@@ -3204,6 +3203,7 @@ class WDSViewSliders_wds {
3204
  </div>
3205
  <div class="wds_task_cont">
3206
  <input id="current_id" name="current_id" type="hidden" value="<?php echo $row->id; ?>" />
 
3207
  <input id="slide_ids_string" name="slide_ids_string" type="hidden" value="<?php echo $slide_ids_string; ?>" />
3208
  <input id="del_slide_ids_string" name="del_slide_ids_string" type="hidden" value="" />
3209
  <input id="nav_tab" name="nav_tab" type="hidden" value="<?php echo WDW_S_Library::get('nav_tab', 'global'); ?>" />
180
  $alternate = ($alternate == 'class="wds_alternate"') ? '' : 'class="wds_alternate"';
181
  $published_image = (($row_data->published) ? 'publish_slide' : 'unpublish_slide');
182
  $published = (($row_data->published) ? 'unpublish' : 'publish');
183
+ $prev_img_url = $this->model->get_slider_prev_img($row_data->id);
 
184
  $slides_count = $this->model->get_slides_count($row_data->id);
185
  ?>
186
  <tr id="tr_<?php echo $row_data->id; ?>" <?php echo $alternate; ?>>
255
  $query_url = wp_nonce_url($query_url, 'addImage', 'nonce_wd');
256
 
257
  $row = $this->model->get_row_data($id, $reset);
258
+ $slides_row = $this->model->get_slides_row_data($id);
 
259
  $slide_ids_string = '';
260
  $sub_tab_type = WDW_S_Library::get('sub_tab', '');
261
 
603
  </div>
604
  <div class="wds_button_wrap">
605
  <input class="wds_button-secondary wds_dublicate_slide" type="button" onclick="if (wds_check_required('name', 'Name')) {return false;};
606
+ spider_set_input_value('current_id', '0' );
607
+ spider_set_input_value('save_as_copy', '1');
608
+ spider_set_input_value('task', 'apply');
609
+ spider_ajax_save('sliders_form', event);" value="Save as Copy" />
610
  </div>
611
  <div class="wds_button_wrap">
612
  <input id="wds_preview" type="button" class="action_buttons" value="Preview"
3203
  </div>
3204
  <div class="wds_task_cont">
3205
  <input id="current_id" name="current_id" type="hidden" value="<?php echo $row->id; ?>" />
3206
+ <input id="save_as_copy" name="save_as_copy" type="hidden" value="" />
3207
  <input id="slide_ids_string" name="slide_ids_string" type="hidden" value="<?php echo $slide_ids_string; ?>" />
3208
  <input id="del_slide_ids_string" name="del_slide_ids_string" type="hidden" value="" />
3209
  <input id="nav_tab" name="nav_tab" type="hidden" value="<?php echo WDW_S_Library::get('nav_tab', 'global'); ?>" />
frontend/views/WDSViewSlider.php CHANGED
@@ -1825,9 +1825,9 @@ class WDSViewSlider {
1825
  jQuery(current_key + " .wds_slideshow_image_<?php echo $wds; ?>").css({
1826
  backgroundPosition: bgPosX + " " + bgPosY,
1827
  backgroundSize : (100 + bgSize) + "% " + (100 + bgSize) + "%",
1828
- webkitAnimation: ' wdszoom' + bgSize + ' <?php echo $slideshow_interval; ?>s linear 0s alternate infinite',
1829
- mozAnimation: ' wdszoom' + bgSize + ' <?php echo $slideshow_interval; ?>s linear 0s alternate infinite',
1830
- animation: ' wdszoom' + bgSize + ' <?php echo $slideshow_interval; ?>s linear 0s alternate infinite'
1831
  });
1832
  }
1833
  jQuery(window).resize(function () {
1825
  jQuery(current_key + " .wds_slideshow_image_<?php echo $wds; ?>").css({
1826
  backgroundPosition: bgPosX + " " + bgPosY,
1827
  backgroundSize : (100 + bgSize) + "% " + (100 + bgSize) + "%",
1828
+ webkitAnimation: ' wdszoom' + bgSize + ' <?php echo 1.1 * $slideshow_interval; ?>s linear 0s alternate infinite',
1829
+ mozAnimation: ' wdszoom' + bgSize + ' <?php echo 1.1 * $slideshow_interval; ?>s linear 0s alternate infinite',
1830
+ animation: ' wdszoom' + bgSize + ' <?php echo 1.1 * $slideshow_interval; ?>s linear 0s alternate infinite'
1831
  });
1832
  }
1833
  jQuery(window).resize(function () {
js/wds.js CHANGED
@@ -10,6 +10,7 @@ function spider_ajax_save(form_id, event) {
10
  post_data["task"] = "apply";
11
  /* Global.*/
12
  post_data["current_id"] = jQuery("#current_id").val();
 
13
  post_data["nonce_wd"] = jQuery("#nonce_wd").val();
14
  post_data["nav_tab"] = jQuery("#nav_tab").val();
15
  post_data["tab"] = jQuery("#tab").val();
10
  post_data["task"] = "apply";
11
  /* Global.*/
12
  post_data["current_id"] = jQuery("#current_id").val();
13
+ post_data["save_as_copy"] = jQuery("#save_as_copy").val();
14
  post_data["nonce_wd"] = jQuery("#nonce_wd").val();
15
  post_data["nav_tab"] = jQuery("#nav_tab").val();
16
  post_data["tab"] = jQuery("#tab").val();
readme.txt CHANGED
@@ -4,7 +4,7 @@ Donate link: https://web-dorado.com/products/wordpress-slider-plugin.html
4
  Tags: easy slider, gallery slider, image slider, images slider, Photo Slider, post slider, responsive slider, slider, slider plugin, video slider, wordpress slider, youtube slider
5
  Requires at least: 3.4
6
  Tested up to: 4.7
7
- Stable tag: 1.1.70
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
@@ -125,6 +125,9 @@ After downloading the ZIP file of the slider plugin,
125
 
126
  == Changelog ==
127
 
 
 
 
128
  = 1.1.70 =
129
  * Added: Slides order direction (optional).
130
  * Fixed: Filemanager allowed file types.
4
  Tags: easy slider, gallery slider, image slider, images slider, Photo Slider, post slider, responsive slider, slider, slider plugin, video slider, wordpress slider, youtube slider
5
  Requires at least: 3.4
6
  Tested up to: 4.7
7
+ Stable tag: 1.1.71
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
125
 
126
  == Changelog ==
127
 
128
+ = 1.1.71 =
129
+ * Fixed: Save as copy.
130
+
131
  = 1.1.70 =
132
  * Added: Slides order direction (optional).
133
  * Fixed: Filemanager allowed file types.
slider-wd.php CHANGED
@@ -4,7 +4,7 @@
4
  * Plugin Name: Slider WD
5
  * Plugin URI: https://web-dorado.com/products/wordpress-slider-plugin.html
6
  * Description: This is a responsive plugin, which allows adding sliders to your posts/pages and to custom location. It uses large number of transition effects and supports various types of layers.
7
- * Version: 1.1.70
8
  * Author: WebDorado
9
  * Author URI: https://web-dorado.com/
10
  * License: GNU/GPLv3 http://www.gnu.org/licenses/gpl-3.0.html
@@ -14,7 +14,7 @@ define('WD_S_NAME', plugin_basename(dirname(__FILE__)));
14
  define('WD_S_DIR', WP_PLUGIN_DIR . "/" . WD_S_NAME);
15
  define('WD_S_URL', plugins_url(WD_S_NAME));
16
 
17
- define('WD_S_VERSION', '1.1.70');
18
 
19
  function wds_use_home_url() {
20
  $home_url = str_replace("http://", "", home_url());
4
  * Plugin Name: Slider WD
5
  * Plugin URI: https://web-dorado.com/products/wordpress-slider-plugin.html
6
  * Description: This is a responsive plugin, which allows adding sliders to your posts/pages and to custom location. It uses large number of transition effects and supports various types of layers.
7
+ * Version: 1.1.71
8
  * Author: WebDorado
9
  * Author URI: https://web-dorado.com/
10
  * License: GNU/GPLv3 http://www.gnu.org/licenses/gpl-3.0.html
14
  define('WD_S_DIR', WP_PLUGIN_DIR . "/" . WD_S_NAME);
15
  define('WD_S_URL', plugins_url(WD_S_NAME));
16
 
17
+ define('WD_S_VERSION', '1.1.71');
18
 
19
  function wds_use_home_url() {
20
  $home_url = str_replace("http://", "", home_url());