Slider by WD – Responsive Slider - Version 1.0.37

Version Description

Added: Support/rate us messages.

Download this release

Release Info

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

Code changes from version 1.0.36 to 1.0.37

Files changed (5) hide show
  1. css/notices.css +54 -0
  2. images/notice.png +0 -0
  3. readme.txt +4 -1
  4. slider-wd.php +6 -2
  5. sliders-notices.php +207 -0
css/notices.css ADDED
@@ -0,0 +1,54 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ .wd-admin-notice {
2
+ background: #fff;
3
+ border: 4px;
4
+ display: block;
5
+ min-height: 68px;
6
+ padding: 10px 40px 10px 125px;
7
+ position: relative;
8
+ }
9
+ .wd-admin-notice a {
10
+ color: #10738B;
11
+ }
12
+ .wd-notice-logo {
13
+ clear: both;
14
+ content: "";
15
+ display: block;
16
+ background-image: url("../images/notice.png");
17
+ background-size: 108px auto;
18
+ background-repeat: no-repeat;
19
+ background-position: 0 45%;
20
+ width: 125px;
21
+ position: absolute;
22
+ top: 0;
23
+ bottom: 0;
24
+ left: 5px;
25
+ }
26
+ .wd-admin-notice > .dashicons {
27
+ color: #424242;
28
+ position: absolute;
29
+ right: 20px;
30
+ top: 40%;
31
+ }
32
+ .wd-notice-title {
33
+ font-size: 24px;
34
+ margin: 0;
35
+ }
36
+ .wd-notice-body {
37
+ font-weight: normal;
38
+ margin: 5px 0;
39
+ }
40
+ .wd-notice-body:after {
41
+ clear: both;
42
+ content: "";
43
+ display: block;
44
+ }
45
+ .wd-notice-body li {
46
+ float: left;
47
+ margin-right: 20px;
48
+ }
49
+ .wd-notice-body .dashicons {
50
+ font-size: 17px;
51
+ }
52
+ .wd-blue {
53
+ color: #10738B;
54
+ }
images/notice.png ADDED
Binary file
readme.txt CHANGED
@@ -4,7 +4,7 @@ Donate link: https://web-dorado.com/products/wordpress-slider-plugin.html
4
  Tags: best slider plugin, carousel, carousel slider, coin slider, content slider, content slideshow, custom video slider, flex slider, free video slider, free video slideshow, Horizontal slider, Image Rotator, image slider, image slideshow, javascript slider, javascript slideshow, jquery slider, jquery slideshow, Photo Slider, posts slider, responsive slider, responsive slideshow, sidebar, slide, slide show, slider, slider plugin, slider widget, slides, slideshow,slideshow manager, slideshow plugin, vertical slider, video slider, video slideshow,vimeo slideshow, vimeo slider, widget slider, widget slideshow, wordpress slider, wordpress slideshow, wp slider, youtube slider, youtube slideshow, post slider, fullscreen Slider, css3 slider, responsive image slider, banner slider, social slider, cycle slider, text slider, revolution slider, thumbnail slider, touch slider, sliders, parallax slider, 3D slider, coinslider, featured-content-slider, image, images, picture, pictures, picture slider, responsive, shortcode, widget, vertical slides, autoplay, auto, jquery, rotate, flexslider, gallery, photo gallery, javascript, rotator, wordpress picture slider, wordpress responsive slider, animation, best slider, fullwidth slider, mobile slider, swipe, layer, layer slider, product slider
5
  Requires at least: 3.4
6
  Tested up to: 4.3
7
- Stable tag: 1.0.36
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
@@ -142,6 +142,9 @@ After downloading the ZIP file of the slider plugin,
142
 
143
  == Changelog ==
144
 
 
 
 
145
  = 1.0.36 =
146
  Changed: Filmstrip navigation arrows show on hover.
147
 
4
  Tags: best slider plugin, carousel, carousel slider, coin slider, content slider, content slideshow, custom video slider, flex slider, free video slider, free video slideshow, Horizontal slider, Image Rotator, image slider, image slideshow, javascript slider, javascript slideshow, jquery slider, jquery slideshow, Photo Slider, posts slider, responsive slider, responsive slideshow, sidebar, slide, slide show, slider, slider plugin, slider widget, slides, slideshow,slideshow manager, slideshow plugin, vertical slider, video slider, video slideshow,vimeo slideshow, vimeo slider, widget slider, widget slideshow, wordpress slider, wordpress slideshow, wp slider, youtube slider, youtube slideshow, post slider, fullscreen Slider, css3 slider, responsive image slider, banner slider, social slider, cycle slider, text slider, revolution slider, thumbnail slider, touch slider, sliders, parallax slider, 3D slider, coinslider, featured-content-slider, image, images, picture, pictures, picture slider, responsive, shortcode, widget, vertical slides, autoplay, auto, jquery, rotate, flexslider, gallery, photo gallery, javascript, rotator, wordpress picture slider, wordpress responsive slider, animation, best slider, fullwidth slider, mobile slider, swipe, layer, layer slider, product slider
5
  Requires at least: 3.4
6
  Tested up to: 4.3
7
+ Stable tag: 1.0.37
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
142
 
143
  == Changelog ==
144
 
145
+ = 1.0.37 =
146
+ Added: Support/rate us messages.
147
+
148
  = 1.0.36 =
149
  Changed: Filmstrip navigation arrows show on hover.
150
 
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.0.36
8
  * Author: WebDorado
9
  * Author URI: https://web-dorado.com/
10
  * License: GNU/GPLv3 http://www.gnu.org/licenses/gpl-3.0.html
@@ -389,7 +389,7 @@ register_activation_hook(__FILE__, 'wds_activate');
389
 
390
  function wds_install() {
391
  $version = get_option("wds_version");
392
- $new_version = '1.0.36';
393
  if ($version && version_compare($version, $new_version, '<')) {
394
  require_once WD_S_DIR . "/sliders-update.php";
395
  wds_update($version);
@@ -463,4 +463,8 @@ function wds_language_load() {
463
  }
464
  add_action('init', 'wds_language_load');
465
 
 
 
 
 
466
  ?>
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.0.37
8
  * Author: WebDorado
9
  * Author URI: https://web-dorado.com/
10
  * License: GNU/GPLv3 http://www.gnu.org/licenses/gpl-3.0.html
389
 
390
  function wds_install() {
391
  $version = get_option("wds_version");
392
+ $new_version = '1.0.37';
393
  if ($version && version_compare($version, $new_version, '<')) {
394
  require_once WD_S_DIR . "/sliders-update.php";
395
  wds_update($version);
463
  }
464
  add_action('init', 'wds_language_load');
465
 
466
+ if (is_admin() && (!defined('DOING_AJAX') || !DOING_AJAX)) {
467
+ include_once(WD_S_DIR . '/sliders-notices.php');
468
+ new WDS_Notices();
469
+ }
470
  ?>
sliders-notices.php ADDED
@@ -0,0 +1,207 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ if (!defined('ABSPATH')) {
3
+ exit;
4
+ }
5
+
6
+ class WDS_Notices {
7
+ protected $prefix = 'wds';
8
+ protected $plugin_url = WD_S_URL;
9
+ protected $plugin_version = "wds_version";
10
+ protected $plugin_name = 'Slider WD';
11
+
12
+ public $notice_spam = 0;
13
+ public $notice_spam_max = 1;
14
+
15
+ // Basic actions to run
16
+ public function __construct() {
17
+ // Runs the admin notice ignore function incase a dismiss button has been clicked
18
+ add_action('admin_init', array($this, 'admin_notice_ignore'));
19
+ // Runs the admin notice temp ignore function incase a temp dismiss link has been clicked
20
+ add_action('admin_init', array($this, 'admin_notice_temp_ignore'));
21
+ add_action('admin_notices', array($this, 'wd_admin_notices'));
22
+ }
23
+
24
+ // Checks to ensure notices aren't disabled and the user has the correct permissions.
25
+ public function wd_admin_notice() {
26
+ $settings = get_option($this->prefix . '_admin_notice');
27
+ if (!isset($settings['disable_admin_notices']) || (isset($settings['disable_admin_notices']) && $settings['disable_admin_notices'] == 0)) {
28
+ if (current_user_can('manage_options')) {
29
+ return true;
30
+ }
31
+ }
32
+ return false;
33
+ }
34
+
35
+ // Primary notice function that can be called from an outside function sending necessary variables
36
+ public function admin_notice($admin_notices) {
37
+ // Check options
38
+ if (!$this->wd_admin_notice()) {
39
+ return false;
40
+ }
41
+ foreach ($admin_notices as $slug => $admin_notice) {
42
+ // Call for spam protection
43
+ if ($this->anti_notice_spam()) {
44
+ return false;
45
+ }
46
+
47
+ // Check for proper page to display on
48
+ if (isset( $admin_notices[$slug]['pages']) && is_array( $admin_notices[$slug]['pages'])) {
49
+ if (!$this->admin_notice_pages($admin_notices[$slug]['pages'])) {
50
+ return false;
51
+ }
52
+ }
53
+
54
+ // Check for required fields
55
+ if (!$this->required_fields($admin_notices[$slug])) {
56
+ // Get the current date then set start date to either passed value or current date value and add interval
57
+ $current_date = current_time("n/j/Y");
58
+ $start = (isset($admin_notices[$slug]['start']) ? $admin_notices[$slug]['start'] : $current_date);
59
+ $start = date("n/j/Y", strtotime($start));
60
+ $date_array = explode('/', $start);
61
+ $interval = (isset($admin_notices[$slug]['int']) ? $admin_notices[$slug]['int'] : 0);
62
+ $date_array[1] += $interval;
63
+ $start = date("n/j/Y", mktime(0, 0, 0, $date_array[0], $date_array[1], $date_array[2]));
64
+
65
+ // This is the main notices storage option
66
+ $admin_notices_option = get_option($this->prefix . '_admin_notice', array());
67
+ // Check if the message is already stored and if so just grab the key otherwise store the message and its associated date information
68
+ if (!array_key_exists( $slug, $admin_notices_option)) {
69
+ $admin_notices_option[$slug]['start'] = $start;
70
+ $admin_notices_option[$slug]['int'] = $interval;
71
+ update_option($this->prefix . '_admin_notice', $admin_notices_option);
72
+ }
73
+
74
+ // Sanity check to ensure we have accurate information
75
+ // New date information will not overwrite old date information
76
+ $admin_display_check = (isset($admin_notices_option[$slug]['dismissed']) ? $admin_notices_option[$slug]['dismissed'] : 0);
77
+ $admin_display_start = (isset($admin_notices_option[$slug]['start']) ? $admin_notices_option[$slug]['start'] : $start);
78
+ $admin_display_interval = (isset($admin_notices_option[$slug]['int']) ? $admin_notices_option[$slug]['int'] : $interval);
79
+ $admin_display_msg = (isset($admin_notices[$slug]['msg']) ? $admin_notices[$slug]['msg'] : '');
80
+ $admin_display_title = (isset($admin_notices[$slug]['title']) ? $admin_notices[$slug]['title'] : '');
81
+ $admin_display_link = (isset($admin_notices[$slug]['link']) ? $admin_notices[$slug]['link'] : '');
82
+ $output_css = false;
83
+ // Ensure the notice hasn't been hidden and that the current date is after the start date
84
+ if ($admin_display_check == 0 && strtotime($admin_display_start) <= strtotime($current_date)) {
85
+ // Get remaining query string
86
+ $query_str = esc_url(add_query_arg($this->prefix . '_admin_notice_ignore', $slug));
87
+ // Admin notice display output
88
+ echo '<div class="update-nag wd-admin-notice">
89
+ <div class="wd-notice-logo"></div>
90
+ <p class="wd-notice-title">' . $admin_display_title . '</p>
91
+ <p class="wd-notice-body">' . $admin_display_msg . '</p>
92
+ <ul class="wd-notice-body wd-blue">' . $admin_display_link . '</ul>
93
+ <a href="' . $query_str . '" class="dashicons dashicons-dismiss"></a>
94
+ </div>';
95
+ $this->notice_spam += 1;
96
+ $output_css = true;
97
+ }
98
+ if ($output_css) {
99
+ wp_enqueue_style($this->prefix . '-admin-notices', $this->plugin_url . '/css/notices.css', array(), get_option($this->plugin_version));
100
+ }
101
+ }
102
+ }
103
+ }
104
+
105
+ // Spam protection check
106
+ public function anti_notice_spam() {
107
+ if ($this->notice_spam >= $this->notice_spam_max) {
108
+ return true;
109
+ }
110
+ return false;
111
+ }
112
+
113
+ // Ignore function that gets ran at admin init to ensure any messages that were dismissed get marked
114
+ public function admin_notice_ignore() {
115
+ // If user clicks to ignore the notice, update the option to not show it again
116
+ if (isset($_GET[$this->prefix . '_admin_notice_ignore'])) {
117
+ $admin_notices_option = get_option($this->prefix . '_admin_notice', array());
118
+ $admin_notices_option[$_GET[$this->prefix . '_admin_notice_ignore']]['dismissed'] = 1;
119
+ update_option($this->prefix . '_admin_notice', $admin_notices_option);
120
+ $query_str = remove_query_arg($this->prefix . '_admin_notice_ignore');
121
+ wp_redirect($query_str);
122
+ exit;
123
+ }
124
+ }
125
+
126
+ // Temp Ignore function that gets ran at admin init to ensure any messages that were temp dismissed get their start date changed
127
+ public function admin_notice_temp_ignore() {
128
+ // If user clicks to temp ignore the notice, update the option to change the start date - default interval of 14 days
129
+ if (isset($_GET[$this->prefix . '_admin_notice_temp_ignore'])) {
130
+ $admin_notices_option = get_option($this->prefix . '_admin_notice', array());
131
+ $current_date = current_time("n/j/Y");
132
+ $date_array = explode('/', $current_date);
133
+ $interval = (isset($_GET['wd_int']) ? $_GET['wd_int'] : 14);
134
+ $date_array[1] += $interval;
135
+ $new_start = date("n/j/Y", mktime(0, 0, 0, $date_array[0], $date_array[1], $date_array[2]));
136
+
137
+ $admin_notices_option[$_GET[$this->prefix . '_admin_notice_temp_ignore']]['start'] = $new_start;
138
+ $admin_notices_option[$_GET[$this->prefix . '_admin_notice_temp_ignore']]['dismissed'] = 0;
139
+ update_option($this->prefix . '_admin_notice', $admin_notices_option);
140
+ $query_str = remove_query_arg(array($this->prefix . '_admin_notice_temp_ignore', 'wd_int'));
141
+ wp_redirect( $query_str );
142
+ exit;
143
+ }
144
+ }
145
+
146
+ public function admin_notice_pages($pages) {
147
+ foreach ($pages as $key => $page) {
148
+ if (is_array($page)) {
149
+ if (isset($_GET['page']) && $_GET['page'] == $page[0] && isset($_GET['tab']) && $_GET['tab'] == $page[1]) {
150
+ return true;
151
+ }
152
+ }
153
+ else {
154
+ if ($page == 'all') {
155
+ return true;
156
+ }
157
+ if (get_current_screen()->id === $page) {
158
+ return true;
159
+ }
160
+ if (isset($_GET['page']) && $_GET['page'] == $page) {
161
+ return true;
162
+ }
163
+ }
164
+ return false;
165
+ }
166
+ }
167
+
168
+ // Required fields check
169
+ public function required_fields( $fields ) {
170
+ if (!isset( $fields['msg']) || (isset($fields['msg']) && empty($fields['msg']))) {
171
+ return true;
172
+ }
173
+ if (!isset( $fields['title']) || (isset($fields['title']) && empty($fields['title']))) {
174
+ return true;
175
+ }
176
+ return false;
177
+ }
178
+
179
+ // Special parameters function that is to be used in any extension of this class
180
+ public function special_parameters($admin_notices) {
181
+ // Intentionally left blank
182
+ }
183
+
184
+ public function wd_admin_notices() {
185
+ $one_week_support = add_query_arg(array($this->prefix . '_admin_notice_ignore' => 'one_week_support'));
186
+ $notices['one_week_support'] = array(
187
+ 'title' => __('Hey! How\'s It Going?', $this->prefix),
188
+ 'msg' => sprintf(__('Thank you for using WordPress %s! We hope that you\'ve found everything you need, but if you have any questions:', $this->prefix), $this->plugin_name),
189
+ 'link' => '<li><span class="dashicons dashicons-media-text"></span><a target="_blank" href="https://web-dorado.com/wordpress-slider-wd/installing.html">' . __('Check out User Guide', $this->prefix) . '</a></li>
190
+ <li><span class="dashicons dashicons-sos"></span><a target="_blank" href="https://web-dorado.com/forum/slider-plugin.html">' . __('Get Some Help', $this->prefix) . '</a></li>
191
+ <li><span class="dashicons dashicons-dismiss"></span><a href="' . $one_week_support . '">' . __('Never show again', $this->prefix) . '</a></li>',
192
+ 'int' => 7
193
+ );
194
+ $two_week_review_ignore = add_query_arg(array($this->prefix . '_admin_notice_ignore' => 'two_week_review'));
195
+ $two_week_review_temp = add_query_arg(array($this->prefix . '_admin_notice_temp_ignore' => 'two_week_review', 'int' => 14));
196
+ $notices['two_week_review'] = array(
197
+ 'title' => __('Leave A Review?', $this->prefix),
198
+ 'msg' => sprintf(__('We hope you\'ve enjoyed using WordPress %s! Would you consider leaving us a review on WordPress.org?', $this->prefix), $this->plugin_name),
199
+ 'link' => '<li><span class="dashicons dashicons-external"></span><a href="https://wordpress.org/support/view/plugin-reviews/slider-wd?filter=5" target="_blank">' . __('Sure! I\'d love to!', $this->prefix) . '</a></li>
200
+ <li><span class="dashicons dashicons-smiley"></span><a href="' . $two_week_review_ignore . '"> ' . __('I\'ve already left a review', $this->prefix) . '</a></li>
201
+ <li><span class="dashicons dashicons-calendar-alt"></span><a href="' . $two_week_review_temp . '">' . __('Maybe Later', $this->prefix) . '</a></li>
202
+ <li><span class="dashicons dashicons-dismiss"></span><a href="' . $two_week_review_ignore . '">' . __('Never show again', $this->prefix) . '</a></li>',
203
+ 'int' => 14
204
+ );
205
+ $this->admin_notice($notices);
206
+ }
207
+ }