Version Description
- Improved: Add slider images to the XML generated with Yoast or Seo by 10Web.
Download this release
Release Info
Developer | webdorado |
Plugin | Slider by WD – Responsive Slider |
Version | 1.2.29 |
Comparing to | |
See all releases |
Code changes from version 1.2.28 to 1.2.29
- admin/controllers/elementorWidget.php +7 -2
- admin/views/Sliders.php +1 -1
- css/wds_tables.css +2 -2
- framework/WDW_S_Library.php +1 -1
- framework/WDW_S_Sitemap.php +92 -0
- frontend/models/WDSModelSlider.php +30 -30
- js/wds.js +1 -1
- readme.txt +5 -2
- slider-wd.php +7 -3
admin/controllers/elementorWidget.php
CHANGED
@@ -64,7 +64,7 @@ class WDSElementor extends \Elementor\Widget_Base {
|
|
64 |
[
|
65 |
'label_block' => TRUE,
|
66 |
'show_label' => FALSE,
|
67 |
-
'description' => __('Select the slider to display.', WDS()->prefix) . ' <a target="
|
68 |
'type' => \Elementor\Controls_Manager::SELECT,
|
69 |
'default' => 0,
|
70 |
'options' => $sliders,
|
@@ -79,7 +79,12 @@ class WDSElementor extends \Elementor\Widget_Base {
|
|
79 |
protected function render() {
|
80 |
$settings = $this->get_settings_for_display();
|
81 |
|
82 |
-
|
|
|
|
|
|
|
|
|
|
|
83 |
}
|
84 |
}
|
85 |
|
64 |
[
|
65 |
'label_block' => TRUE,
|
66 |
'show_label' => FALSE,
|
67 |
+
'description' => __('Select the slider to display.', WDS()->prefix) . ' <a target="_blank" href="' . $wds_edit_link . '">' . __('Edit slider', WDS()->prefix) . '</a>',
|
68 |
'type' => \Elementor\Controls_Manager::SELECT,
|
69 |
'default' => 0,
|
70 |
'options' => $sliders,
|
79 |
protected function render() {
|
80 |
$settings = $this->get_settings_for_display();
|
81 |
|
82 |
+
if ( doing_filter('wd_seo_sitemap_images') || doing_filter('wpseo_sitemap_urlimages') ) {
|
83 |
+
WDW_S_Sitemap::instance()->shortcode($settings['sliders']);
|
84 |
+
}
|
85 |
+
else {
|
86 |
+
echo WDS()->front_end($settings['sliders']);
|
87 |
+
}
|
88 |
}
|
89 |
}
|
90 |
|
admin/views/Sliders.php
CHANGED
@@ -1862,7 +1862,7 @@ class SlidersView_wds extends AdminView_wds {
|
|
1862 |
</div>
|
1863 |
<input type="hidden" name="order<?php echo $slide_row->id; ?>" id="order<?php echo $slide_row->id; ?>" value="<?php echo $slide_row->order; ?>" />
|
1864 |
</div>
|
1865 |
-
<div class="
|
1866 |
<div id="hover_buttons">
|
1867 |
<span class="wds_change_thumbnail" onclick="wds_media_uploader_add_slide(event, '<?php echo $slide_row->id; ?>', false); return false;" title="<?php _e('Edit Image', WDS()->prefix); ?>" value="<?php _e('Edit Image', WDS()->prefix); ?>"></span>
|
1868 |
<span class="wds_slide_dublicate" title="<?php _e('Duplicate Slide', WDS()->prefix); ?>" onclick="wds_duplicate_slide('<?php echo $slide_row->id; ?>');"></span>
|
1862 |
</div>
|
1863 |
<input type="hidden" name="order<?php echo $slide_row->id; ?>" id="order<?php echo $slide_row->id; ?>" value="<?php echo $slide_row->order; ?>" />
|
1864 |
</div>
|
1865 |
+
<div class="wds_overlay" >
|
1866 |
<div id="hover_buttons">
|
1867 |
<span class="wds_change_thumbnail" onclick="wds_media_uploader_add_slide(event, '<?php echo $slide_row->id; ?>', false); return false;" title="<?php _e('Edit Image', WDS()->prefix); ?>" value="<?php _e('Edit Image', WDS()->prefix); ?>"></span>
|
1868 |
<span class="wds_slide_dublicate" title="<?php _e('Duplicate Slide', WDS()->prefix); ?>" onclick="wds_duplicate_slide('<?php echo $slide_row->id; ?>');"></span>
|
css/wds_tables.css
CHANGED
@@ -1239,14 +1239,14 @@ tbody .action_buttons {
|
|
1239 |
width: 28%;
|
1240 |
}
|
1241 |
|
1242 |
-
.
|
1243 |
display: none;
|
1244 |
width: 100%;
|
1245 |
height: 100%;
|
1246 |
background-color: rgba(0,0,0,0.6);
|
1247 |
}
|
1248 |
|
1249 |
-
.tab_image:hover .
|
1250 |
display: block;
|
1251 |
}
|
1252 |
|
1239 |
width: 28%;
|
1240 |
}
|
1241 |
|
1242 |
+
.wds_overlay {
|
1243 |
display: none;
|
1244 |
width: 100%;
|
1245 |
height: 100%;
|
1246 |
background-color: rgba(0,0,0,0.6);
|
1247 |
}
|
1248 |
|
1249 |
+
.tab_image:hover .wds_overlay {
|
1250 |
display: block;
|
1251 |
}
|
1252 |
|
framework/WDW_S_Library.php
CHANGED
@@ -1009,7 +1009,7 @@ class WDW_S_Library {
|
|
1009 |
* Create frontend js file.
|
1010 |
*
|
1011 |
* @param int $slider_id
|
1012 |
-
* @
|
1013 |
*/
|
1014 |
public static function create_frontend_js_file( $slider_id ) {
|
1015 |
global $wpdb;
|
1009 |
* Create frontend js file.
|
1010 |
*
|
1011 |
* @param int $slider_id
|
1012 |
+
* @return bool $bool
|
1013 |
*/
|
1014 |
public static function create_frontend_js_file( $slider_id ) {
|
1015 |
global $wpdb;
|
framework/WDW_S_Sitemap.php
ADDED
@@ -0,0 +1,92 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
|
4 |
+
final class WDW_S_Sitemap {
|
5 |
+
/**
|
6 |
+
* The single instance of the class.
|
7 |
+
*/
|
8 |
+
protected static $_instance = null;
|
9 |
+
|
10 |
+
private $images;
|
11 |
+
|
12 |
+
/**
|
13 |
+
* Main WDW_S_Sitemap Instance.
|
14 |
+
*
|
15 |
+
* Ensures only one instance is loaded or can be loaded.
|
16 |
+
*
|
17 |
+
* @static
|
18 |
+
* @return WDW_S_Sitemap - Main instance.
|
19 |
+
*/
|
20 |
+
public static function instance() {
|
21 |
+
if ( is_null( self::$_instance ) ) {
|
22 |
+
self::$_instance = new self();
|
23 |
+
}
|
24 |
+
return self::$_instance;
|
25 |
+
}
|
26 |
+
|
27 |
+
public function add_wpseo_xml_sitemap_images( $images, $post_id ) {
|
28 |
+
$this->images = $images;
|
29 |
+
|
30 |
+
$post = get_post($post_id);
|
31 |
+
|
32 |
+
remove_all_shortcodes();
|
33 |
+
if ( defined('ELEMENTOR_VERSION') ) {
|
34 |
+
\Elementor\Plugin::instance()->frontend->get_builder_content($post->ID);
|
35 |
+
}
|
36 |
+
add_shortcode('wds', array($this, 'shortcode'));
|
37 |
+
do_shortcode($post->post_content);
|
38 |
+
|
39 |
+
return $this->images;
|
40 |
+
}
|
41 |
+
|
42 |
+
public function shortcode( $params = array() ) {
|
43 |
+
if ( is_array( $params ) ) {
|
44 |
+
$id = shortcode_atts(array('id' => WDW_S_Library::get('slider_id', 0)), $params);
|
45 |
+
$id = $id['id'];
|
46 |
+
}
|
47 |
+
else {
|
48 |
+
$id = $params;
|
49 |
+
}
|
50 |
+
if ( 0 < $id ) {
|
51 |
+
$images = $this->get_shortcode_images( $id );
|
52 |
+
foreach ( $images as $image ) {
|
53 |
+
// Include in sitemap self hosted images only.
|
54 |
+
if ( strpos($image, site_url()) !== FALSE ) {
|
55 |
+
$this->images[] = array(
|
56 |
+
'src' => $image,
|
57 |
+
'title' => '',
|
58 |
+
'alt' => ''
|
59 |
+
);
|
60 |
+
}
|
61 |
+
}
|
62 |
+
}
|
63 |
+
}
|
64 |
+
|
65 |
+
private function get_shortcode_images( $id ) {
|
66 |
+
$images = array();
|
67 |
+
// Get slider.
|
68 |
+
$slider = WDW_S_Library::get_slider_by_id( $id );
|
69 |
+
if ( !empty($slider) ) {
|
70 |
+
// Get slider slides.
|
71 |
+
$slides = WDW_S_Library::get_slides_by_slider_id( $id, 'asc' );
|
72 |
+
if ( !empty($slides) ) {
|
73 |
+
foreach ( $slides as $slide ) {
|
74 |
+
$slide_ids[] = $slide->id;
|
75 |
+
if ( 'image' == $slide->type ) {
|
76 |
+
$images[] = $slide->image_url;
|
77 |
+
}
|
78 |
+
}
|
79 |
+
// Get slider slides layers.
|
80 |
+
$layers_rows = WDW_S_Library::get_layers_by_slider_id_slide_ids( $id, $slide_ids );
|
81 |
+
foreach ( $layers_rows as $slide_layers ) {
|
82 |
+
foreach ( $slide_layers as $layer ) {
|
83 |
+
if ('image' == $layer->type) {
|
84 |
+
$images[] = $layer->image_url;
|
85 |
+
}
|
86 |
+
}
|
87 |
+
}
|
88 |
+
}
|
89 |
+
}
|
90 |
+
return $images;
|
91 |
+
}
|
92 |
+
}
|
frontend/models/WDSModelSlider.php
CHANGED
@@ -159,7 +159,7 @@ class WDSModelSlider {
|
|
159 |
|
160 |
public function get_layers_row_data($slide_id, $id) {
|
161 |
global $wpdb;
|
162 |
-
|
163 |
$rows = $wpdb->get_results($wpdb->prepare($sql_query, $slide_id, $id));
|
164 |
foreach ($rows as $row) {
|
165 |
$title_dimension = json_decode($row->title);
|
@@ -239,36 +239,36 @@ class WDSModelSlider {
|
|
239 |
|
240 |
public function get_layers_by_slider_id_slide_ids($slider_id, $slide_ids) {
|
241 |
global $wpdb;
|
242 |
-
|
243 |
-
|
244 |
-
|
245 |
-
|
246 |
-
|
247 |
-
|
248 |
-
|
249 |
-
|
250 |
-
|
251 |
-
|
252 |
-
|
253 |
-
|
254 |
-
|
255 |
-
|
256 |
-
|
257 |
-
|
258 |
-
|
259 |
-
|
260 |
-
|
261 |
-
|
262 |
-
|
263 |
-
|
264 |
-
|
265 |
-
|
266 |
-
|
267 |
|
268 |
-
|
269 |
-
|
270 |
-
|
271 |
-
|
272 |
return $layers;
|
273 |
}
|
274 |
}
|
159 |
|
160 |
public function get_layers_row_data($slide_id, $id) {
|
161 |
global $wpdb;
|
162 |
+
$sql_query = "SELECT layer.* FROM " . $wpdb->prefix . "wdslayer as layer INNER JOIN " . $wpdb->prefix . "wdsslide as slide on layer.slide_id=slide.id INNER JOIN " . $wpdb->prefix . "wdsslider as slider on slider.id=slide.slider_id WHERE layer.slide_id = %d OR (slider.id=%d AND layer.static_layer=1) ORDER BY layer.`depth` ASC";
|
163 |
$rows = $wpdb->get_results($wpdb->prepare($sql_query, $slide_id, $id));
|
164 |
foreach ($rows as $row) {
|
165 |
$title_dimension = json_decode($row->title);
|
239 |
|
240 |
public function get_layers_by_slider_id_slide_ids($slider_id, $slide_ids) {
|
241 |
global $wpdb;
|
242 |
+
$sql_query = 'SELECT
|
243 |
+
`layer`.*
|
244 |
+
FROM
|
245 |
+
`'. $wpdb->prefix .'wdslayer` AS `layer`
|
246 |
+
INNER JOIN `'. $wpdb->prefix .'wdsslide` AS `slide` ON `layer`.`slide_id` = `slide`.`id`
|
247 |
+
INNER JOIN `'. $wpdb->prefix .'wdsslider` AS `slider` ON `slider`.`id` = `slide`.`slider_id`
|
248 |
+
WHERE
|
249 |
+
`layer`.`slide_id` IN ('. implode( $slide_ids, ',' ) .')
|
250 |
+
OR (
|
251 |
+
`slider`.`id` = '. $slider_id .' AND
|
252 |
+
`layer`.`static_layer` = 1
|
253 |
+
)
|
254 |
+
ORDER BY
|
255 |
+
`layer`.`depth` ASC
|
256 |
+
';
|
257 |
+
$rows = $wpdb->get_results($sql_query);
|
258 |
+
$layers = array();
|
259 |
+
if ( !empty($rows) ) {
|
260 |
+
foreach ($rows as $row) {
|
261 |
+
$row->attr_width = 0;
|
262 |
+
$row->attr_height = 0;
|
263 |
+
$title_dimension = json_decode($row->title);
|
264 |
+
if ($title_dimension) {
|
265 |
+
$row->title = $title_dimension->title;
|
266 |
+
}
|
267 |
|
268 |
+
$row->image_url = str_replace('{site_url}', site_url(), $row->image_url);
|
269 |
+
$layers[$row->slide_id][] = $row;
|
270 |
+
}
|
271 |
+
}
|
272 |
return $layers;
|
273 |
}
|
274 |
}
|
js/wds.js
CHANGED
@@ -3452,7 +3452,7 @@ function wds_add_slide() {
|
|
3452 |
'<div class="tab_buttons">' +
|
3453 |
'<div class="handle_wrap"><div class="handle" title="Drag to re-order"></div></div>' +
|
3454 |
'<div class="wds_tab_title_wrap"><input type="text" id="title' + slideID + '" name="title' + slideID + '" value="'+ new_slide_name + '" class="wds_tab_title" tab_type="slide' + slideID + '" onchange="wds_set_slide_title(\'' + slideID + '\');"/></div><input type="hidden" name="order' + slideID + '" id="order' + slideID + '" value="' + order_id + '" /></div>' +
|
3455 |
-
'<div class="
|
3456 |
edit_slide_by +
|
3457 |
' <span class="wds_slide_dublicate" onclick="wds_duplicate_slide(\'' + slideID + '\');" title="'+ wds_object.translate.duplicate_slide +'"></span>' +
|
3458 |
' <span class="wds_tab_remove" title="'+ wds_object.translate.delete_slide +'" onclick="wds_remove_slide(\'' + slideID + '\')"></span></div></div>' +
|
3452 |
'<div class="tab_buttons">' +
|
3453 |
'<div class="handle_wrap"><div class="handle" title="Drag to re-order"></div></div>' +
|
3454 |
'<div class="wds_tab_title_wrap"><input type="text" id="title' + slideID + '" name="title' + slideID + '" value="'+ new_slide_name + '" class="wds_tab_title" tab_type="slide' + slideID + '" onchange="wds_set_slide_title(\'' + slideID + '\');"/></div><input type="hidden" name="order' + slideID + '" id="order' + slideID + '" value="' + order_id + '" /></div>' +
|
3455 |
+
'<div class="wds_overlay"><div id="hover_buttons">' +
|
3456 |
edit_slide_by +
|
3457 |
' <span class="wds_slide_dublicate" onclick="wds_duplicate_slide(\'' + slideID + '\');" title="'+ wds_object.translate.duplicate_slide +'"></span>' +
|
3458 |
' <span class="wds_tab_remove" title="'+ wds_object.translate.delete_slide +'" onclick="wds_remove_slide(\'' + slideID + '\')"></span></div></div>' +
|
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: 5.
|
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 |
|
@@ -445,6 +445,9 @@ The plugin takes the full width of the widget area if the **Boxed Layout** in **
|
|
445 |
|
446 |
== Changelog ==
|
447 |
|
|
|
|
|
|
|
448 |
= 1.2.28 =
|
449 |
* Added: Ask a question button.
|
450 |
|
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.3
|
6 |
Requires PHP: 5.2
|
7 |
+
Stable tag: 1.2.29
|
8 |
License: GPLv2 or later
|
9 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
10 |
|
445 |
|
446 |
== Changelog ==
|
447 |
|
448 |
+
= 1.2.29 =
|
449 |
+
* Improved: Add slider images to the XML generated with Yoast or Seo by 10Web.
|
450 |
+
|
451 |
= 1.2.28 =
|
452 |
* Added: Ask a question button.
|
453 |
|
slider-wd.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
* Plugin Name: Slider by 10Web
|
4 |
* Plugin URI: https://10web.io/plugins/wordpress-slider/?utm_source=slider&utm_medium=free_plugin
|
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/?utm_source=slider&utm_medium=free_plugin
|
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();
|
@@ -197,6 +197,10 @@ final class WDS {
|
|
197 |
add_filter('plugin_action_links_' . plugin_basename(__FILE__), array( $this, 'add_ask_question_links' ));
|
198 |
}
|
199 |
|
|
|
|
|
|
|
|
|
200 |
}
|
201 |
|
202 |
/**
|
3 |
* Plugin Name: Slider by 10Web
|
4 |
* Plugin URI: https://10web.io/plugins/wordpress-slider/?utm_source=slider&utm_medium=free_plugin
|
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.29
|
7 |
* Author: 10Web
|
8 |
* Author URI: https://10web.io/pricing/?utm_source=slider&utm_medium=free_plugin
|
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.29';
|
82 |
+
$this->db_version = '1.2.29';
|
83 |
$this->prefix = 'wds';
|
84 |
$this->nicename = __('Slider', $this->prefix);
|
85 |
$this->use_home_url();
|
197 |
add_filter('plugin_action_links_' . plugin_basename(__FILE__), array( $this, 'add_ask_question_links' ));
|
198 |
}
|
199 |
|
200 |
+
// Add Slider images to sitemap xml.
|
201 |
+
require_once ($this->plugin_dir . '/framework/WDW_S_Sitemap.php');
|
202 |
+
add_filter('wd_seo_sitemap_images', array( WDW_S_Sitemap::instance(), 'add_wpseo_xml_sitemap_images'), 10, 2);
|
203 |
+
add_filter('wpseo_sitemap_urlimages', array( WDW_S_Sitemap::instance(), 'add_wpseo_xml_sitemap_images'), 10, 2);
|
204 |
}
|
205 |
|
206 |
/**
|