Version Description
- Added: Message during import for PHP XML and ZipArchive PHP extensions.
- Added: The Separate section for 10Web Plugins in Elementor.
- Fixed: Add Layer click action.
- Changed: User guide links.
- Changed: Analytics trackable links.
Download this release
Release Info
Developer | webdorado |
Plugin | Slider by WD – Responsive Slider |
Version | 1.2.20 |
Comparing to | |
See all releases |
Code changes from version 1.2.19 to 1.2.20
- admin/controllers/elementorWidget.php +1 -1
- demo_sliders/demo_sliders.php +16 -179
- framework/WDW_S_Library.php +215 -6
- frontend/views/WDSViewSlider.php +1 -1
- readme.txt +16 -5
- slider-wd.php +9 -5
admin/controllers/elementorWidget.php
CHANGED
@@ -34,7 +34,7 @@ class WDSElementor extends \Elementor\Widget_Base {
|
|
34 |
* @return array Widget categories.
|
35 |
*/
|
36 |
public function get_categories() {
|
37 |
-
return [ 'tenweb-widgets' ];
|
38 |
}
|
39 |
|
40 |
/**
|
34 |
* @return array Widget categories.
|
35 |
*/
|
36 |
public function get_categories() {
|
37 |
+
return [ 'tenweb-plugins-widgets' ];
|
38 |
}
|
39 |
|
40 |
/**
|
demo_sliders/demo_sliders.php
CHANGED
@@ -1,185 +1,22 @@
|
|
1 |
<?php
|
2 |
if( isset($_REQUEST['wds_import_submit']) && ! empty($_FILES['fileimport']) ) {
|
3 |
-
|
4 |
-
|
5 |
-
|
6 |
-
|
7 |
-
|
8 |
-
|
9 |
-
|
10 |
-
|
11 |
-
|
12 |
-
|
13 |
-
|
14 |
-
if ( !is_dir($dest_dir . '/import/arrows') ) {
|
15 |
-
mkdir($dest_dir . '/import/arrows', 0777, TRUE);
|
16 |
-
}
|
17 |
-
if ( !is_dir($dest_dir . '/import/arrows/thumb') ) {
|
18 |
-
mkdir($dest_dir . '/import/arrows/thumb', 0777, TRUE);
|
19 |
-
}
|
20 |
-
if ( !is_dir($dest_dir . '/import/arrows/.original') ) {
|
21 |
-
mkdir($dest_dir . '/import/arrows/.original', 0777, TRUE);
|
22 |
-
}
|
23 |
-
if ( !is_dir($dest_dir . '/import/.original') ) {
|
24 |
-
mkdir($dest_dir . '/import/.original', 0777, TRUE);
|
25 |
-
}
|
26 |
-
if ( !is_dir($dest_dir . '/import/thumb') ) {
|
27 |
-
mkdir($dest_dir . '/import/thumb', 0777, TRUE);
|
28 |
-
}
|
29 |
-
$upload_dir = wp_upload_dir();
|
30 |
-
$dest_url = $upload_dir['baseurl'] . '/slider-wd/';
|
31 |
-
while ( $zip_entry = zip_read($zip) ) {
|
32 |
-
if ( strripos(zip_entry_name($zip_entry), ".xml") ) {
|
33 |
-
if ( zip_entry_open($zip, $zip_entry, "r") ) {
|
34 |
-
$buf = zip_entry_read($zip_entry, zip_entry_filesize($zip_entry));
|
35 |
-
$buf = preg_replace('~\s*(<([^>]*)>[^<]*</\2>|<[^>]*>)\s*~', '$1', $buf);
|
36 |
-
$xml = simplexml_load_string($buf);
|
37 |
-
$slider_fields = array();
|
38 |
-
$slide_fields = array();
|
39 |
-
$slides = array();
|
40 |
-
$layer_fields = array();
|
41 |
-
$layers = array();
|
42 |
-
$sliders = $xml->slider;
|
43 |
-
foreach ( $sliders as $slider ) {
|
44 |
-
foreach ( $slider as $key_slider => $value_slider ) {
|
45 |
-
$flag = TRUE;
|
46 |
-
if ( strpos($value_slider["value"], WDS()->site_url_buttons_placeholder) === 0 ) {
|
47 |
-
$slider_fields[$key_slider] = trim(str_replace(WDS()->site_url_buttons_placeholder, $dest_url . '/import/arrows/', $value_slider["value"]));
|
48 |
-
$slider_fields[$key_slider] = trim(str_replace(site_url(), '{site_url}', $slider_fields[$key_slider]));
|
49 |
-
}
|
50 |
-
elseif ( strpos($value_slider["value"], WDS()->site_url_placeholder) === 0 ) {
|
51 |
-
$slider_fields[$key_slider] = trim(str_replace(WDS()->site_url_placeholder, site_url(), $value_slider["value"]));
|
52 |
-
$slider_fields[$key_slider] = trim(str_replace(site_url(), '{site_url}', $slider_fields[$key_slider]));
|
53 |
-
}
|
54 |
-
elseif ( $key_slider != "slide" && $key_slider != "id" ) {
|
55 |
-
$slider_fields[$key_slider] = trim($value_slider["value"]);
|
56 |
-
}
|
57 |
-
elseif ( $key_slider == "slide" ) {
|
58 |
-
foreach ( $value_slider->children() as $key_slide => $slide ) {
|
59 |
-
if ( $key_slide != "layer" && $key_slide != "id" ) {
|
60 |
-
$slide_fields[$key_slide] = trim($slide["value"]);
|
61 |
-
}
|
62 |
-
elseif ( $key_slide == "layer" ) {
|
63 |
-
foreach ( $slide->children() as $key_layer => $layer ) {
|
64 |
-
if ( $key_layer != "id" ) {
|
65 |
-
$layer_fields[$key_layer] = isset($layer["value"]) ? trim($layer["value"]) : trim($layer);
|
66 |
-
}
|
67 |
-
}
|
68 |
-
array_push($layers, $layer_fields);
|
69 |
-
}
|
70 |
-
}
|
71 |
-
array_push($slides, array( "slide" => $slide_fields, "layers" => $layers ));
|
72 |
-
$layers = array();
|
73 |
-
}
|
74 |
-
}
|
75 |
-
// Column doesn't exist in DB
|
76 |
-
unset($slider_fields['bg_fit']);
|
77 |
-
$wpdb->insert($wpdb->prefix . 'wdsslider', $slider_fields);
|
78 |
-
$slider_id = $wpdb->insert_id;
|
79 |
-
foreach ( $slides as $slide ) {
|
80 |
-
$slide["slide"]["slider_id"] = $slider_id;
|
81 |
-
if ( strpos($slide["slide"]["image_url"], WDS()->site_url_placeholder) === 0 ) {
|
82 |
-
$slide["slide"]["image_url"] = trim(str_replace(WDS()->site_url_placeholder, $dest_url . '/import/', $slide["slide"]["image_url"]));
|
83 |
-
$slide["slide"]["image_url"] = trim(str_replace(site_url(), '{site_url}', $slide["slide"]["image_url"]));
|
84 |
-
}
|
85 |
-
if ( strpos($slide["slide"]["thumb_url"], WDS()->site_url_placeholder) === 0 ) {
|
86 |
-
$slide["slide"]["thumb_url"] = trim(str_replace(WDS()->site_url_placeholder, $dest_url . '/import/thumb/', $slide["slide"]["thumb_url"]));
|
87 |
-
$slide["slide"]["thumb_url"] = trim(str_replace(site_url(), '{site_url}', $slide["slide"]["thumb_url"]));
|
88 |
-
}
|
89 |
-
$wpdb->insert($wpdb->prefix . 'wdsslide', $slide["slide"]);
|
90 |
-
$slide_id = $wpdb->insert_id;
|
91 |
-
foreach ( $slide["layers"] as $layer ) {
|
92 |
-
$layer["slide_id"] = $slide_id;
|
93 |
-
if ( strpos($layer["image_url"], WDS()->site_url_placeholder) === 0 ) {
|
94 |
-
$layer["image_url"] = trim(str_replace(WDS()->site_url_placeholder, $dest_url . '/import/', $layer["image_url"]));
|
95 |
-
$layer["image_url"] = trim(str_replace(site_url(), '{site_url}', $layer["image_url"]));
|
96 |
-
}
|
97 |
-
$wpdb->insert($wpdb->prefix . 'wdslayer', $layer);
|
98 |
-
}
|
99 |
-
}
|
100 |
-
$slides = array();
|
101 |
-
}
|
102 |
-
zip_entry_close($zip_entry);
|
103 |
-
}
|
104 |
-
}
|
105 |
-
else {
|
106 |
-
$zip_r = zip_entry_read($zip_entry, zip_entry_filesize($zip_entry));
|
107 |
-
$zip_name = zip_entry_name($zip_entry);
|
108 |
-
if ( strpos($zip_name, 'featured_') === 0 ) {
|
109 |
-
$zip_name = str_replace('featured_', '', $zip_name);
|
110 |
-
$zip_name = get_unique_file_name($zip_name, $dest_dir . '/import/thumb/', $zip_name);
|
111 |
-
if ( $handlethumb = fopen($dest_dir . '/import/thumb/' . $zip_name, "w") ) {
|
112 |
-
fwrite($handlethumb, $zip_r);
|
113 |
-
fclose($handlethumb);
|
114 |
-
}
|
115 |
-
}
|
116 |
-
if ( strpos($zip_name, 'thumb_') === 0 ) {
|
117 |
-
$zip_name = str_replace('thumb_', '', $zip_name);
|
118 |
-
$zip_name = get_unique_file_name($zip_name, $dest_dir . '/import/thumb/', $zip_name);
|
119 |
-
if ( $handlethumb = fopen($dest_dir . '/import/thumb/' . $zip_name, "w") ) {
|
120 |
-
fwrite($handlethumb, $zip_r);
|
121 |
-
fclose($handlethumb);
|
122 |
-
}
|
123 |
-
}
|
124 |
-
elseif ( strpos($zip_name, WDS()->site_url_buttons_placeholder . '_thumb_') === 0 ) {
|
125 |
-
$zip_name = str_replace(WDS()->site_url_buttons_placeholder . '_thumb_', '', $zip_name);
|
126 |
-
$zip_name = get_unique_file_name($zip_name, $dest_dir . '/import/arrows/thumb/', $zip_name);
|
127 |
-
if ( $handlethumb = fopen($dest_dir . '/import/arrows/thumb/' . $zip_name, "w") ) {
|
128 |
-
fwrite($handlethumb, $zip_r);
|
129 |
-
fclose($handlethumb);
|
130 |
-
}
|
131 |
-
}
|
132 |
-
elseif ( strpos($zip_name, WDS()->site_url_buttons_placeholder) === 0 ) {
|
133 |
-
$zip_name = str_replace(WDS()->site_url_buttons_placeholder, '', $zip_name);
|
134 |
-
$zip_name = get_unique_file_name($zip_name, $dest_dir . '/import/arrows/.original/', $zip_name);
|
135 |
-
if ( $handleorg = fopen($dest_dir . '/import/arrows/.original/' . $zip_name, "w") ) {
|
136 |
-
fwrite($handleorg, $zip_r);
|
137 |
-
fclose($handleorg);
|
138 |
-
}
|
139 |
-
$zip_name = get_unique_file_name($zip_name, $dest_dir . '/import/arrows/', $zip_name);
|
140 |
-
if ( $handleorg = fopen($dest_dir . '/import/arrows/' . $zip_name, "w") ) {
|
141 |
-
fwrite($handleorg, $zip_r);
|
142 |
-
fclose($handleorg);
|
143 |
-
}
|
144 |
-
}
|
145 |
-
else {
|
146 |
-
$zip_name = get_unique_file_name($zip_name, $dest_dir . '/import/.original/', $zip_name);
|
147 |
-
if ( $handleorg = fopen($dest_dir . '/import/.original/' . $zip_name, "w") ) {
|
148 |
-
fwrite($handleorg, $zip_r);
|
149 |
-
fclose($handleorg);
|
150 |
-
}
|
151 |
-
$zip_name = get_unique_file_name($zip_name, $dest_dir . '/import/', $zip_name);
|
152 |
-
if ( $handleorg = fopen($dest_dir . '/import/' . $zip_name, "w") ) {
|
153 |
-
fwrite($handleorg, $zip_r);
|
154 |
-
fclose($handleorg);
|
155 |
-
}
|
156 |
-
}
|
157 |
-
}
|
158 |
-
}
|
159 |
-
zip_close($zip);
|
160 |
-
}
|
161 |
-
unlink($dest_dir . $file["name"]);
|
162 |
-
}
|
163 |
-
|
164 |
-
$message_id = 24;
|
165 |
-
if ( $flag ) {
|
166 |
-
$message_id = 23;
|
167 |
-
}
|
168 |
-
WDW_S_Library::spider_redirect( add_query_arg( array( 'page' => 'sliders_wds', 'message' => $message_id), admin_url('admin.php') ) );
|
169 |
-
}
|
170 |
|
171 |
-
|
172 |
-
|
173 |
-
|
174 |
-
|
175 |
-
|
176 |
-
$to = strrpos($fileName1, '.');
|
177 |
-
$fileName1 = substr($fileName1, 0, $to) . '(' . $p . ')' . substr($fileName1, $to);
|
178 |
-
$p++;
|
179 |
-
}
|
180 |
-
$zip_name = $fileName1;
|
181 |
-
}
|
182 |
-
return $zip_name;
|
183 |
}
|
184 |
|
185 |
function spider_demo_sliders() {
|
1 |
<?php
|
2 |
if( isset($_REQUEST['wds_import_submit']) && ! empty($_FILES['fileimport']) ) {
|
3 |
+
require_once(WDS()->plugin_dir . '/framework/WDW_S_Library.php');
|
4 |
+
global $wpdb;
|
5 |
+
$flag = FALSE;
|
6 |
+
$file = $_FILES['fileimport'];
|
7 |
+
$dest_dir = ABSPATH . WDS()->upload_dir;
|
8 |
+
if ( ! file_exists( $dest_dir ) ) {
|
9 |
+
mkdir( $dest_dir, 0777, true );
|
10 |
+
}
|
11 |
+
if ( move_uploaded_file($file["tmp_name"], $dest_dir .'/'. $file["name"]) ) {
|
12 |
+
$flag = WDW_S_Library::wds_import_zip_action( $dest_dir, $file["name"] );
|
13 |
+
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
14 |
|
15 |
+
$message_id = 24;
|
16 |
+
if ( $flag ) {
|
17 |
+
$message_id = 23;
|
18 |
+
}
|
19 |
+
WDW_S_Library::spider_redirect( add_query_arg( array( 'page' => 'sliders_wds', 'message' => $message_id), admin_url('admin.php') ) );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
20 |
}
|
21 |
|
22 |
function spider_demo_sliders() {
|
framework/WDW_S_Library.php
CHANGED
@@ -2428,25 +2428,25 @@ class WDW_S_Library {
|
|
2428 |
*/
|
2429 |
public static function topbar() {
|
2430 |
$page = isset($_GET['page']) ? esc_html($_GET['page']) : '';
|
2431 |
-
$user_guide_link = 'https://
|
2432 |
$show_content = true;
|
2433 |
$show_guide_link = true;
|
2434 |
$show_head = false;
|
2435 |
switch ($page) {
|
2436 |
case 'sliders_wds': {
|
2437 |
-
$user_guide_link .= '
|
2438 |
break;
|
2439 |
}
|
2440 |
case 'goptions_wds': {
|
2441 |
-
$user_guide_link .= '
|
2442 |
break;
|
2443 |
}
|
2444 |
case 'demo_sliders_wds': {
|
2445 |
-
$user_guide_link .= '
|
2446 |
break;
|
2447 |
}
|
2448 |
case 'licensing_wds': {
|
2449 |
-
$user_guide_link .= '
|
2450 |
break;
|
2451 |
}
|
2452 |
default: {
|
@@ -2456,7 +2456,7 @@ class WDW_S_Library {
|
|
2456 |
}
|
2457 |
$show_content = $show_content && WDS()->is_free;
|
2458 |
$support_forum_link = 'https://wordpress.org/support/plugin/slider-wd';
|
2459 |
-
$premium_link = 'https://
|
2460 |
wp_enqueue_style(WDS()->prefix . '-roboto');
|
2461 |
wp_enqueue_style(WDS()->prefix . '-pricing');
|
2462 |
ob_start();
|
@@ -2567,4 +2567,213 @@ class WDW_S_Library {
|
|
2567 |
return $unique;
|
2568 |
}
|
2569 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2570 |
}
|
2428 |
*/
|
2429 |
public static function topbar() {
|
2430 |
$page = isset($_GET['page']) ? esc_html($_GET['page']) : '';
|
2431 |
+
$user_guide_link = 'https://help.10web.io/hc/en-us/articles/';
|
2432 |
$show_content = true;
|
2433 |
$show_guide_link = true;
|
2434 |
$show_head = false;
|
2435 |
switch ($page) {
|
2436 |
case 'sliders_wds': {
|
2437 |
+
$user_guide_link .= '360016084351-Creating-Sliders-on-WordPress';
|
2438 |
break;
|
2439 |
}
|
2440 |
case 'goptions_wds': {
|
2441 |
+
$user_guide_link .= '360016084831-Editing-General-Options';
|
2442 |
break;
|
2443 |
}
|
2444 |
case 'demo_sliders_wds': {
|
2445 |
+
$user_guide_link .= '360015864972-Importing-and-Exporting-Sliders';
|
2446 |
break;
|
2447 |
}
|
2448 |
case 'licensing_wds': {
|
2449 |
+
$user_guide_link .= '360015864212-Introducing-WordPress-Slider';
|
2450 |
break;
|
2451 |
}
|
2452 |
default: {
|
2456 |
}
|
2457 |
$show_content = $show_content && WDS()->is_free;
|
2458 |
$support_forum_link = 'https://wordpress.org/support/plugin/slider-wd';
|
2459 |
+
$premium_link = 'https://10web.io/plugins/wordpress-slider/?utm_source=slider&utm_medium=free_plugin';
|
2460 |
wp_enqueue_style(WDS()->prefix . '-roboto');
|
2461 |
wp_enqueue_style(WDS()->prefix . '-pricing');
|
2462 |
ob_start();
|
2567 |
return $unique;
|
2568 |
}
|
2569 |
}
|
2570 |
+
|
2571 |
+
/**
|
2572 |
+
* Import slider using path of the file
|
2573 |
+
*
|
2574 |
+
* @param $zipfilepath string
|
2575 |
+
*
|
2576 |
+
* @return array
|
2577 |
+
*/
|
2578 |
+
public static function twbb_wds_import( $zipfilepath ) {
|
2579 |
+
if( ! file_exists( $zipfilepath ) ) {
|
2580 |
+
return false;
|
2581 |
+
}
|
2582 |
+
$data_slider_id = array();
|
2583 |
+
$dest_dir = ABSPATH . WDS()->upload_dir;
|
2584 |
+
$filename = basename( $zipfilepath );
|
2585 |
+
if ( ! file_exists( $dest_dir ) ) {
|
2586 |
+
mkdir( $dest_dir, 0777, true );
|
2587 |
+
}
|
2588 |
+
if( copy( $zipfilepath, $dest_dir.'/'.$filename ) ) {
|
2589 |
+
$data_slider_id = self::wds_import_zip_action( $dest_dir, $filename );
|
2590 |
+
}
|
2591 |
+
return $data_slider_id;
|
2592 |
+
}
|
2593 |
+
|
2594 |
+
/**
|
2595 |
+
* Read ZIP file and inser to DB
|
2596 |
+
*
|
2597 |
+
* @param $dest_dir string
|
2598 |
+
* @param $filename string
|
2599 |
+
*
|
2600 |
+
* @return array
|
2601 |
+
*/
|
2602 |
+
public static function wds_import_zip_action( $dest_dir, $filename ) {
|
2603 |
+
$flag = FALSE;
|
2604 |
+
$data_slider_id = array();
|
2605 |
+
global $wpdb;
|
2606 |
+
$zip = zip_open($dest_dir.'/'.$filename);
|
2607 |
+
if ( $zip ) {
|
2608 |
+
if ( !is_dir($dest_dir . '/import') ) {
|
2609 |
+
mkdir($dest_dir . '/import', 0777, TRUE);
|
2610 |
+
}
|
2611 |
+
if ( !is_dir($dest_dir . '/import/arrows') ) {
|
2612 |
+
mkdir($dest_dir . '/import/arrows', 0777, TRUE);
|
2613 |
+
}
|
2614 |
+
if ( !is_dir($dest_dir . '/import/arrows/thumb') ) {
|
2615 |
+
mkdir($dest_dir . '/import/arrows/thumb', 0777, TRUE);
|
2616 |
+
}
|
2617 |
+
if ( !is_dir($dest_dir . '/import/arrows/.original') ) {
|
2618 |
+
mkdir($dest_dir . '/import/arrows/.original', 0777, TRUE);
|
2619 |
+
}
|
2620 |
+
if ( !is_dir($dest_dir . '/import/.original') ) {
|
2621 |
+
mkdir($dest_dir . '/import/.original', 0777, TRUE);
|
2622 |
+
}
|
2623 |
+
if ( !is_dir($dest_dir . '/import/thumb') ) {
|
2624 |
+
mkdir($dest_dir . '/import/thumb', 0777, TRUE);
|
2625 |
+
}
|
2626 |
+
$upload_dir = wp_upload_dir();
|
2627 |
+
$dest_url = $upload_dir['baseurl'] . '/slider-wd/';
|
2628 |
+
while ( $zip_entry = zip_read($zip) ) {
|
2629 |
+
if ( strripos(zip_entry_name($zip_entry), ".xml") ) {
|
2630 |
+
if ( zip_entry_open($zip, $zip_entry, "r") ) {
|
2631 |
+
$buf = zip_entry_read($zip_entry, zip_entry_filesize($zip_entry));
|
2632 |
+
$buf = preg_replace('~\s*(<([^>]*)>[^<]*</\2>|<[^>]*>)\s*~', '$1', $buf);
|
2633 |
+
$xml = simplexml_load_string($buf);
|
2634 |
+
$slider_fields = array();
|
2635 |
+
$slide_fields = array();
|
2636 |
+
$slides = array();
|
2637 |
+
$layer_fields = array();
|
2638 |
+
$layers = array();
|
2639 |
+
$sliders = $xml->slider;
|
2640 |
+
foreach ( $sliders as $slider ) {
|
2641 |
+
foreach ( $slider as $key_slider => $value_slider ) {
|
2642 |
+
$flag = TRUE;
|
2643 |
+
if ( strpos($value_slider["value"], WDS()->site_url_buttons_placeholder) === 0 ) {
|
2644 |
+
$slider_fields[$key_slider] = trim(str_replace(WDS()->site_url_buttons_placeholder, $dest_url . '/import/arrows/', $value_slider["value"]));
|
2645 |
+
$slider_fields[$key_slider] = trim(str_replace(site_url(), '{site_url}', $slider_fields[$key_slider]));
|
2646 |
+
}
|
2647 |
+
elseif ( strpos($value_slider["value"], WDS()->site_url_placeholder) === 0 ) {
|
2648 |
+
$slider_fields[$key_slider] = trim(str_replace(WDS()->site_url_placeholder, site_url(), $value_slider["value"]));
|
2649 |
+
$slider_fields[$key_slider] = trim(str_replace(site_url(), '{site_url}', $slider_fields[$key_slider]));
|
2650 |
+
}
|
2651 |
+
elseif ( $key_slider != "slide" && $key_slider != "id" ) {
|
2652 |
+
$slider_fields[$key_slider] = trim($value_slider["value"]);
|
2653 |
+
}
|
2654 |
+
elseif ( $key_slider == "slide" ) {
|
2655 |
+
foreach ( $value_slider->children() as $key_slide => $slide ) {
|
2656 |
+
if ( $key_slide != "layer" && $key_slide != "id" ) {
|
2657 |
+
$slide_fields[$key_slide] = trim($slide["value"]);
|
2658 |
+
}
|
2659 |
+
elseif ( $key_slide == "layer" ) {
|
2660 |
+
foreach ( $slide->children() as $key_layer => $layer ) {
|
2661 |
+
if ( $key_layer != "id" ) {
|
2662 |
+
$layer_fields[$key_layer] = isset($layer["value"]) ? trim($layer["value"]) : trim($layer);
|
2663 |
+
}
|
2664 |
+
}
|
2665 |
+
array_push($layers, $layer_fields);
|
2666 |
+
}
|
2667 |
+
}
|
2668 |
+
array_push($slides, array( "slide" => $slide_fields, "layers" => $layers ));
|
2669 |
+
$layers = array();
|
2670 |
+
}
|
2671 |
+
}
|
2672 |
+
// Column doesn't exist in DB
|
2673 |
+
unset($slider_fields['bg_fit']);
|
2674 |
+
$wpdb->insert($wpdb->prefix . 'wdsslider', $slider_fields);
|
2675 |
+
$slider_id = $wpdb->insert_id;
|
2676 |
+
$data_slider_id[] = $slider_id;
|
2677 |
+
foreach ( $slides as $slide ) {
|
2678 |
+
$slide["slide"]["slider_id"] = $slider_id;
|
2679 |
+
if ( strpos($slide["slide"]["image_url"], WDS()->site_url_placeholder) === 0 ) {
|
2680 |
+
$slide["slide"]["image_url"] = trim(str_replace(WDS()->site_url_placeholder, $dest_url . '/import/', $slide["slide"]["image_url"]));
|
2681 |
+
$slide["slide"]["image_url"] = trim(str_replace(site_url(), '{site_url}', $slide["slide"]["image_url"]));
|
2682 |
+
}
|
2683 |
+
if ( strpos($slide["slide"]["thumb_url"], WDS()->site_url_placeholder) === 0 ) {
|
2684 |
+
$slide["slide"]["thumb_url"] = trim(str_replace(WDS()->site_url_placeholder, $dest_url . '/import/thumb/', $slide["slide"]["thumb_url"]));
|
2685 |
+
$slide["slide"]["thumb_url"] = trim(str_replace(site_url(), '{site_url}', $slide["slide"]["thumb_url"]));
|
2686 |
+
}
|
2687 |
+
$wpdb->insert($wpdb->prefix . 'wdsslide', $slide["slide"]);
|
2688 |
+
$slide_id = $wpdb->insert_id;
|
2689 |
+
foreach ( $slide["layers"] as $layer ) {
|
2690 |
+
$layer["slide_id"] = $slide_id;
|
2691 |
+
if ( strpos($layer["image_url"], WDS()->site_url_placeholder) === 0 ) {
|
2692 |
+
$layer["image_url"] = trim(str_replace(WDS()->site_url_placeholder, $dest_url . '/import/', $layer["image_url"]));
|
2693 |
+
$layer["image_url"] = trim(str_replace(site_url(), '{site_url}', $layer["image_url"]));
|
2694 |
+
}
|
2695 |
+
$wpdb->insert($wpdb->prefix . 'wdslayer', $layer);
|
2696 |
+
}
|
2697 |
+
}
|
2698 |
+
$slides = array();
|
2699 |
+
}
|
2700 |
+
zip_entry_close($zip_entry);
|
2701 |
+
}
|
2702 |
+
}
|
2703 |
+
else {
|
2704 |
+
$zip_r = zip_entry_read($zip_entry, zip_entry_filesize($zip_entry));
|
2705 |
+
$zip_name = zip_entry_name($zip_entry);
|
2706 |
+
if ( strpos($zip_name, 'featured_') === 0 ) {
|
2707 |
+
$zip_name = str_replace('featured_', '', $zip_name);
|
2708 |
+
$zip_name = self::get_unique_file_name($zip_name, $dest_dir . '/import/thumb/', $zip_name);
|
2709 |
+
if ( $handlethumb = fopen($dest_dir . '/import/thumb/' . $zip_name, "w") ) {
|
2710 |
+
fwrite($handlethumb, $zip_r);
|
2711 |
+
fclose($handlethumb);
|
2712 |
+
}
|
2713 |
+
}
|
2714 |
+
if ( strpos($zip_name, 'thumb_') === 0 ) {
|
2715 |
+
$zip_name = str_replace('thumb_', '', $zip_name);
|
2716 |
+
$zip_name = self::get_unique_file_name($zip_name, $dest_dir . '/import/thumb/', $zip_name);
|
2717 |
+
if ( $handlethumb = fopen($dest_dir . '/import/thumb/' . $zip_name, "w") ) {
|
2718 |
+
fwrite($handlethumb, $zip_r);
|
2719 |
+
fclose($handlethumb);
|
2720 |
+
}
|
2721 |
+
}
|
2722 |
+
elseif ( strpos($zip_name, WDS()->site_url_buttons_placeholder . '_thumb_') === 0 ) {
|
2723 |
+
$zip_name = str_replace(WDS()->site_url_buttons_placeholder . '_thumb_', '', $zip_name);
|
2724 |
+
$zip_name = self::get_unique_file_name($zip_name, $dest_dir . '/import/arrows/thumb/', $zip_name);
|
2725 |
+
if ( $handlethumb = fopen($dest_dir . '/import/arrows/thumb/' . $zip_name, "w") ) {
|
2726 |
+
fwrite($handlethumb, $zip_r);
|
2727 |
+
fclose($handlethumb);
|
2728 |
+
}
|
2729 |
+
}
|
2730 |
+
elseif ( strpos($zip_name, WDS()->site_url_buttons_placeholder) === 0 ) {
|
2731 |
+
$zip_name = str_replace(WDS()->site_url_buttons_placeholder, '', $zip_name);
|
2732 |
+
$zip_name = self::get_unique_file_name($zip_name, $dest_dir . '/import/arrows/.original/', $zip_name);
|
2733 |
+
if ( $handleorg = fopen($dest_dir . '/import/arrows/.original/' . $zip_name, "w") ) {
|
2734 |
+
fwrite($handleorg, $zip_r);
|
2735 |
+
fclose($handleorg);
|
2736 |
+
}
|
2737 |
+
$zip_name = self::get_unique_file_name($zip_name, $dest_dir . '/import/arrows/', $zip_name);
|
2738 |
+
if ( $handleorg = fopen($dest_dir . '/import/arrows/' . $zip_name, "w") ) {
|
2739 |
+
fwrite($handleorg, $zip_r);
|
2740 |
+
fclose($handleorg);
|
2741 |
+
}
|
2742 |
+
}
|
2743 |
+
else {
|
2744 |
+
$zip_name = self::get_unique_file_name($zip_name, $dest_dir . '/import/.original/', $zip_name);
|
2745 |
+
if ( $handleorg = fopen($dest_dir . '/import/.original/' . $zip_name, "w") ) {
|
2746 |
+
fwrite($handleorg, $zip_r);
|
2747 |
+
fclose($handleorg);
|
2748 |
+
}
|
2749 |
+
$zip_name = self::get_unique_file_name($zip_name, $dest_dir . '/import/', $zip_name);
|
2750 |
+
if ( $handleorg = fopen($dest_dir . '/import/' . $zip_name, "w") ) {
|
2751 |
+
fwrite($handleorg, $zip_r);
|
2752 |
+
fclose($handleorg);
|
2753 |
+
}
|
2754 |
+
}
|
2755 |
+
}
|
2756 |
+
}
|
2757 |
+
zip_close($zip);
|
2758 |
+
}
|
2759 |
+
unlink($dest_dir.'/'.$filename);
|
2760 |
+
if( $flag ) {
|
2761 |
+
return $data_slider_id;
|
2762 |
+
} else return $flag;
|
2763 |
+
}
|
2764 |
+
|
2765 |
+
public static function get_unique_file_name($filename, $foldername, $zip_name) {
|
2766 |
+
if (file_exists($foldername . $filename)) {
|
2767 |
+
$p = 1;
|
2768 |
+
$fileName1 = $zip_name;
|
2769 |
+
while (file_exists($foldername . $fileName1)) {
|
2770 |
+
$to = strrpos($fileName1, '.');
|
2771 |
+
$fileName1 = substr($fileName1, 0, $to) . '(' . $p . ')' . substr($fileName1, $to);
|
2772 |
+
$p++;
|
2773 |
+
}
|
2774 |
+
$zip_name = $fileName1;
|
2775 |
+
}
|
2776 |
+
return $zip_name;
|
2777 |
+
}
|
2778 |
+
|
2779 |
}
|
frontend/views/WDSViewSlider.php
CHANGED
@@ -317,7 +317,7 @@ class WDSViewSlider {
|
|
317 |
$video_height_percent = $slider_row->height ? 100 * $layer->image_height / $slider_row->height : 0;
|
318 |
$layer_add_class = isset($layer->add_class) ? $layer->add_class : '';
|
319 |
$link_to_slide = (isset($layer->link_to_slide)) ? $layer->link_to_slide : 0;
|
320 |
-
$layer_callback_list = (isset($layer->layer_callback_list) && ($layer->layer_callback_list != '')) ? "wds_callbackItems('" . $layer->layer_callback_list . "', '" . $link_to_slide . "');" : '';
|
321 |
$hotspot_text_display = (isset($layer->hotspot_text_display) && $layer->hotspot_text_display == 'click') ? 'click' : 'hover';
|
322 |
switch ($layer->type) {
|
323 |
case 'text': {
|
317 |
$video_height_percent = $slider_row->height ? 100 * $layer->image_height / $slider_row->height : 0;
|
318 |
$layer_add_class = isset($layer->add_class) ? $layer->add_class : '';
|
319 |
$link_to_slide = (isset($layer->link_to_slide)) ? $layer->link_to_slide : 0;
|
320 |
+
$layer_callback_list = (isset($layer->layer_callback_list) && ($layer->layer_callback_list != '')) ? "wds_callbackItems('" . $wds . "', '" . $layer->layer_callback_list . "', '" . $link_to_slide . "');" : '';
|
321 |
$hotspot_text_display = (isset($layer->hotspot_text_display) && $layer->hotspot_text_display == 'click') ? 'click' : 'hover';
|
322 |
switch ($layer->type) {
|
323 |
case 'text': {
|
readme.txt
CHANGED
@@ -2,9 +2,9 @@
|
|
2 |
Contributors: webdorado,10web
|
3 |
Tags: responsive slider, slider, slideshow, wordpress slider, image slider, gallery slider, images slider, Photo Slider, post slider, slider plugin
|
4 |
Requires at least: 3.4
|
5 |
-
Tested up to:
|
6 |
Requires PHP: 5.2
|
7 |
-
Stable tag: 1.2.
|
8 |
License: GPLv2 or later
|
9 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
10 |
|
@@ -16,7 +16,7 @@ Slider by 10Web plugin is the perfect slider solution for Wordpress. Create a gr
|
|
16 |
https://www.youtube.com/watch?v=xebpM_-GwG0&index=1&list=PLnxWPiY5tLFWQf5XaEYYPZj0gdggUrVxP
|
17 |
|
18 |
= Useful Links: =
|
19 |
-
[Special Offer for all Premium Plugins](https://10web.io/pricing/)
|
20 |
[WordPress Slider Plugin](https://10web.io/plugins/wordpress-slider/)
|
21 |
[Demo](https://demo.10web.io/slider/)
|
22 |
[User Manual](https://docs.10web.io/docs/slider-wd/indroduction.html)
|
@@ -351,7 +351,11 @@ Yes, you can create unlimited number of sliders with unlimited amount of slides.
|
|
351 |
|
352 |
In case you use custom PHP templates and would like to display your slideshow on these pages, you can use **PHP function** Slider by 10Web plugin provides. You just need to add the function, e.g.:
|
353 |
|
354 |
-
*<?php wd_slider
|
|
|
|
|
|
|
|
|
355 |
|
356 |
into the necessary .php file. For instance, if you wish to display the slideshow along with the header, simply add the code to header.php file of your website theme. You can find the function and copy it from **Slider by 10Web > Sliders** page, under **PHP function** column.
|
357 |
|
@@ -440,7 +444,14 @@ The plugin takes the full width of the widget area if the **Boxed Layout** in **
|
|
440 |
6. Slider by 10Web - Settings
|
441 |
|
442 |
|
443 |
-
== Changelog ==
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
444 |
|
445 |
= 1.2.19 =
|
446 |
* Fixed: WD library.
|
2 |
Contributors: webdorado,10web
|
3 |
Tags: responsive slider, slider, slideshow, wordpress slider, image slider, gallery slider, images slider, Photo Slider, post slider, slider plugin
|
4 |
Requires at least: 3.4
|
5 |
+
Tested up to: 5.0
|
6 |
Requires PHP: 5.2
|
7 |
+
Stable tag: 1.2.20
|
8 |
License: GPLv2 or later
|
9 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
10 |
|
16 |
https://www.youtube.com/watch?v=xebpM_-GwG0&index=1&list=PLnxWPiY5tLFWQf5XaEYYPZj0gdggUrVxP
|
17 |
|
18 |
= Useful Links: =
|
19 |
+
[Special Offer for all Premium Plugins](https://10web.io/plugins-bundle-pricing/)
|
20 |
[WordPress Slider Plugin](https://10web.io/plugins/wordpress-slider/)
|
21 |
[Demo](https://demo.10web.io/slider/)
|
22 |
[User Manual](https://docs.10web.io/docs/slider-wd/indroduction.html)
|
351 |
|
352 |
In case you use custom PHP templates and would like to display your slideshow on these pages, you can use **PHP function** Slider by 10Web plugin provides. You just need to add the function, e.g.:
|
353 |
|
354 |
+
*<?php if (function_exists('wd_slider'))
|
355 |
+
{
|
356 |
+
wd_slider(2);
|
357 |
+
}
|
358 |
+
?>*
|
359 |
|
360 |
into the necessary .php file. For instance, if you wish to display the slideshow along with the header, simply add the code to header.php file of your website theme. You can find the function and copy it from **Slider by 10Web > Sliders** page, under **PHP function** column.
|
361 |
|
444 |
6. Slider by 10Web - Settings
|
445 |
|
446 |
|
447 |
+
== Changelog ==
|
448 |
+
|
449 |
+
= 1.2.20 =
|
450 |
+
* Added: Message during import for PHP XML and ZipArchive PHP extensions.
|
451 |
+
* Added: The Separate section for 10Web Plugins in Elementor.
|
452 |
+
* Fixed: Add Layer click action.
|
453 |
+
* Changed: User guide links.
|
454 |
+
* Changed: Analytics trackable links.
|
455 |
|
456 |
= 1.2.19 =
|
457 |
* Fixed: WD library.
|
slider-wd.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
* Plugin Name: Slider by 10Web
|
4 |
* Plugin URI: https://10web.io/plugins/wordpress-slider/
|
5 |
* 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.
|
6 |
-
* Version: 1.2.
|
7 |
* Author: 10Web
|
8 |
* Author URI: https://10web.io/pricing/
|
9 |
* License: GNU/GPLv3 http://www.gnu.org/licenses/gpl-3.0.html
|
@@ -78,8 +78,8 @@ final class WDS {
|
|
78 |
$this->plugin_dir = WP_PLUGIN_DIR . "/" . plugin_basename(dirname(__FILE__));
|
79 |
$this->plugin_url = plugins_url(plugin_basename(dirname(__FILE__)));
|
80 |
$this->main_file = plugin_basename(__FILE__);
|
81 |
-
$this->plugin_version = '1.2.
|
82 |
-
$this->db_version = '1.2.
|
83 |
$this->prefix = 'wds';
|
84 |
$this->nicename = __('Slider', $this->prefix);
|
85 |
$this->use_home_url();
|
@@ -185,6 +185,10 @@ final class WDS {
|
|
185 |
add_action('elementor/widgets/widgets_registered', array($this, 'register_elementor_widget'));
|
186 |
// Register 10Web category for Elementor widget if 10Web builder doesn't installed.
|
187 |
add_action('elementor/elements/categories_registered', array($this, 'register_widget_category'), 1, 1);
|
|
|
|
|
|
|
|
|
188 |
}
|
189 |
|
190 |
/**
|
@@ -202,8 +206,8 @@ final class WDS {
|
|
202 |
* @param $elements_manager
|
203 |
*/
|
204 |
public function register_widget_category( $elements_manager ) {
|
205 |
-
$elements_manager->add_category('tenweb-widgets', array(
|
206 |
-
'title' => __('10WEB', 'tenweb-builder'),
|
207 |
'icon' => 'fa fa-plug',
|
208 |
));
|
209 |
}
|
3 |
* Plugin Name: Slider by 10Web
|
4 |
* Plugin URI: https://10web.io/plugins/wordpress-slider/
|
5 |
* 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.
|
6 |
+
* Version: 1.2.20
|
7 |
* Author: 10Web
|
8 |
* Author URI: https://10web.io/pricing/
|
9 |
* License: GNU/GPLv3 http://www.gnu.org/licenses/gpl-3.0.html
|
78 |
$this->plugin_dir = WP_PLUGIN_DIR . "/" . plugin_basename(dirname(__FILE__));
|
79 |
$this->plugin_url = plugins_url(plugin_basename(dirname(__FILE__)));
|
80 |
$this->main_file = plugin_basename(__FILE__);
|
81 |
+
$this->plugin_version = '1.2.20';
|
82 |
+
$this->db_version = '1.2.20';
|
83 |
$this->prefix = 'wds';
|
84 |
$this->nicename = __('Slider', $this->prefix);
|
85 |
$this->use_home_url();
|
185 |
add_action('elementor/widgets/widgets_registered', array($this, 'register_elementor_widget'));
|
186 |
// Register 10Web category for Elementor widget if 10Web builder doesn't installed.
|
187 |
add_action('elementor/elements/categories_registered', array($this, 'register_widget_category'), 1, 1);
|
188 |
+
|
189 |
+
// Import slider from builder
|
190 |
+
add_filter('builder_import_slider', array('WDW_S_Library', 'twbb_wds_import'));
|
191 |
+
|
192 |
}
|
193 |
|
194 |
/**
|
206 |
* @param $elements_manager
|
207 |
*/
|
208 |
public function register_widget_category( $elements_manager ) {
|
209 |
+
$elements_manager->add_category('tenweb-plugins-widgets', array(
|
210 |
+
'title' => __('10WEB Plugins', 'tenweb-builder'),
|
211 |
'icon' => 'fa fa-plug',
|
212 |
));
|
213 |
}
|