Version Description
- Updated: WD Library.
- Updated: Support forum link.
Download this release
Release Info
Developer | webdorado |
Plugin | Form Maker by WD – user-friendly drag & drop Form Builder plugin |
Version | 1.12.8 |
Comparing to | |
See all releases |
Code changes from version 1.12.7 to 1.12.8
- form-maker.php +4 -4
- readme.txt +5 -1
- wd/README.md +1 -1
- wd/assets/css/deactivate_popup.css +4 -0
- wd/assets/css/overview.css +8 -1
- wd/assets/img/cfm_main_plugin.png +0 -0
- wd/includes/notices.php +170 -170
- wd/includes/overview.php +8 -0
- wd/templates/display_deactivation_popup.php +3 -4
- wd/templates/display_overview.php +39 -29
- wd/wd.php +1 -1
form-maker.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
* Plugin Name: Form Maker
|
4 |
* Plugin URI: https://web-dorado.com/products/form-maker-wordpress.html
|
5 |
* Description: This plugin is a modern and advanced tool for easy and fast creating of a WordPress Form. The backend interface is intuitive and user friendly which allows users far from scripting and programming to create WordPress Forms.
|
6 |
-
* Version: 1.12.
|
7 |
* Author: WebDorado Form Builder Team
|
8 |
* Author URI: https://web-dorado.com/wordpress-plugins-bundle.html
|
9 |
* License: GNU/GPLv3 http://www.gnu.org/licenses/gpl-3.0.html
|
@@ -89,8 +89,8 @@ final class WDFM {
|
|
89 |
$this->plugin_dir = WP_PLUGIN_DIR . "/" . plugin_basename(dirname(__FILE__));
|
90 |
$this->plugin_url = plugins_url(plugin_basename(dirname(__FILE__)));
|
91 |
$this->main_file = plugin_basename(__FILE__);
|
92 |
-
$this->plugin_version = '1.12.
|
93 |
-
$this->db_version = '2.12.
|
94 |
$this->menu_slug = 'manage_fm';
|
95 |
$this->prefix = 'form_maker';
|
96 |
$this->css_prefix = 'fm_';
|
@@ -920,7 +920,7 @@ final class WDFM {
|
|
920 |
</div>
|
921 |
<?php
|
922 |
}
|
923 |
-
if (
|
924 |
?>
|
925 |
<span class="wd_support">
|
926 |
<a target="_blank" href="<?php echo $support_forum_link; ?>">
|
3 |
* Plugin Name: Form Maker
|
4 |
* Plugin URI: https://web-dorado.com/products/form-maker-wordpress.html
|
5 |
* Description: This plugin is a modern and advanced tool for easy and fast creating of a WordPress Form. The backend interface is intuitive and user friendly which allows users far from scripting and programming to create WordPress Forms.
|
6 |
+
* Version: 1.12.8
|
7 |
* Author: WebDorado Form Builder Team
|
8 |
* Author URI: https://web-dorado.com/wordpress-plugins-bundle.html
|
9 |
* License: GNU/GPLv3 http://www.gnu.org/licenses/gpl-3.0.html
|
89 |
$this->plugin_dir = WP_PLUGIN_DIR . "/" . plugin_basename(dirname(__FILE__));
|
90 |
$this->plugin_url = plugins_url(plugin_basename(dirname(__FILE__)));
|
91 |
$this->main_file = plugin_basename(__FILE__);
|
92 |
+
$this->plugin_version = '1.12.8';
|
93 |
+
$this->db_version = '2.12.8';
|
94 |
$this->menu_slug = 'manage_fm';
|
95 |
$this->prefix = 'form_maker';
|
96 |
$this->css_prefix = 'fm_';
|
920 |
</div>
|
921 |
<?php
|
922 |
}
|
923 |
+
if (TRUE) {
|
924 |
?>
|
925 |
<span class="wd_support">
|
926 |
<a target="_blank" href="<?php echo $support_forum_link; ?>">
|
readme.txt
CHANGED
@@ -4,7 +4,7 @@ Donate link: https://web-dorado.com/products/wordpress-form.html
|
|
4 |
Tags: form, form builder, contact form, custom form, feedback, contact, contact forms, captcha, email, form manager, forms, survey
|
5 |
Requires at least: 3.4
|
6 |
Tested up to: 4.9
|
7 |
-
Stable tag: 1.12.
|
8 |
License: GPLv2 or later
|
9 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
10 |
|
@@ -290,6 +290,10 @@ MailChimp form add-on of Form Maker lets you build up a customer database on you
|
|
290 |
|
291 |
== Changelog ==
|
292 |
|
|
|
|
|
|
|
|
|
293 |
= 1.12.7 =
|
294 |
* Added: Invisibe reCAPTCHA.
|
295 |
* Improved: Compatibility with Contact Form Maker.
|
4 |
Tags: form, form builder, contact form, custom form, feedback, contact, contact forms, captcha, email, form manager, forms, survey
|
5 |
Requires at least: 3.4
|
6 |
Tested up to: 4.9
|
7 |
+
Stable tag: 1.12.8
|
8 |
License: GPLv2 or later
|
9 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
10 |
|
290 |
|
291 |
== Changelog ==
|
292 |
|
293 |
+
= 1.12.8 =
|
294 |
+
* Updated: WD Library.
|
295 |
+
* Updated: Support forum link.
|
296 |
+
|
297 |
= 1.12.7 =
|
298 |
* Added: Invisibe reCAPTCHA.
|
299 |
* Improved: Compatibility with Contact Form Maker.
|
wd/README.md
CHANGED
@@ -1,4 +1,4 @@
|
|
1 |
-
Version: 1.0.
|
2 |
|
3 |
|
4 |
|
1 |
+
Version: 1.0.13
|
2 |
|
3 |
|
4 |
|
wd/assets/css/deactivate_popup.css
CHANGED
@@ -1,3 +1,7 @@
|
|
|
|
|
|
|
|
|
|
1 |
.wd-opacity{
|
2 |
position: fixed;
|
3 |
top: 0px;
|
1 |
+
.wd-bwg-reasons:nth-child(3) {
|
2 |
+
display: none;
|
3 |
+
}
|
4 |
+
|
5 |
.wd-opacity{
|
6 |
position: fixed;
|
7 |
top: 0px;
|
wd/assets/css/overview.css
CHANGED
@@ -451,5 +451,12 @@ a:focus{
|
|
451 |
font-size: 16px;
|
452 |
}
|
453 |
|
|
|
|
|
|
|
|
|
454 |
|
455 |
-
|
|
|
|
|
|
451 |
font-size: 16px;
|
452 |
}
|
453 |
|
454 |
+
.wd-start-using-button .button{
|
455 |
+
margin-left: 7px;
|
456 |
+
margin-top: 7px;
|
457 |
+
}
|
458 |
|
459 |
+
.wd-start-using-button{
|
460 |
+
margin-right:10px;
|
461 |
+
float: right;
|
462 |
+
}
|
wd/assets/img/cfm_main_plugin.png
ADDED
Binary file
|
wd/includes/notices.php
CHANGED
@@ -1,96 +1,96 @@
|
|
1 |
<?php
|
2 |
-
|
3 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
4 |
}
|
5 |
|
6 |
-
|
7 |
-
|
8 |
-
|
9 |
-
|
10 |
-
|
11 |
-
|
12 |
-
|
13 |
-
|
14 |
-
// Basic actions to run
|
15 |
-
public function __construct( $config = array() ) {
|
16 |
-
$this->config = $config;
|
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 |
-
|
25 |
-
|
26 |
-
|
27 |
-
|
28 |
-
|
29 |
-
if ( current_user_can( 'manage_options' ) ) {
|
30 |
-
return true;
|
31 |
-
}
|
32 |
-
}
|
33 |
return false;
|
34 |
}
|
35 |
-
|
36 |
-
|
37 |
-
|
38 |
-
$wd_options = $this->config;
|
39 |
-
// Check options
|
40 |
-
if ( !$this->wd_admin_notice() ) {
|
41 |
return false;
|
42 |
}
|
43 |
-
|
44 |
-
|
45 |
-
|
|
|
46 |
return false;
|
47 |
}
|
|
|
48 |
|
49 |
-
|
50 |
-
|
51 |
-
if ( !$this->admin_notice_pages( $admin_notices[$slug]['pages'] ) ) {
|
52 |
-
return false;
|
53 |
-
}
|
54 |
-
}
|
55 |
|
56 |
-
//
|
57 |
-
|
58 |
-
|
59 |
-
|
60 |
-
|
61 |
-
|
62 |
-
$start = date( "n/j/Y", strtotime( $start ) );
|
63 |
-
$date_array = explode( '/', $start );
|
64 |
-
$interval = ( isset( $admin_notices[$slug]['int'] ) ? $admin_notices[$slug]['int'] : 0 );
|
65 |
-
|
66 |
-
$date_array[1] += $interval;
|
67 |
-
$start = date( "n/j/Y", mktime( 0, 0, 0, $date_array[0], $date_array[1], $date_array[2] ) );
|
68 |
-
|
69 |
-
// This is the main notices storage option
|
70 |
-
$admin_notices_option = get_option( $wd_options->prefix . '_admin_notice', array() );
|
71 |
-
// Check if the message is already stored and if so just grab the key otherwise store the message and its associated date information
|
72 |
-
if ( !array_key_exists( $slug, $admin_notices_option ) ) {
|
73 |
-
$admin_notices_option[$slug]['start'] = $start;
|
74 |
-
$admin_notices_option[$slug]['int'] = $interval;
|
75 |
-
update_option( $wd_options->prefix . '_admin_notice', $admin_notices_option );
|
76 |
-
}
|
77 |
|
78 |
-
|
79 |
-
|
80 |
-
|
81 |
-
|
82 |
-
|
83 |
-
|
84 |
-
|
85 |
-
$
|
86 |
-
$
|
87 |
-
|
88 |
-
|
89 |
-
|
90 |
-
|
91 |
-
|
92 |
-
|
93 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
94 |
// Admin notice display output
|
95 |
echo '<div class="update-nag wd-admin-notice">
|
96 |
<div class="wd-notice-logo" style="background-image: url(' . $wd_options->wd_url_img . '/' . $wd_options->prefix . '_main_plugin.png);"></div>
|
@@ -99,8 +99,8 @@
|
|
99 |
<ul class="wd-notice-body wd-blue">' . $admin_display_link . '</ul>
|
100 |
<a href="' . $query_str . '" class="dashicons dashicons-dismiss"></a>
|
101 |
</div>';
|
102 |
-
|
103 |
-
|
104 |
echo '<div class="admin-notice-promo">';
|
105 |
echo $admin_display_msg;
|
106 |
echo '<ul class="notice-body-promo blue">
|
@@ -108,116 +108,116 @@
|
|
108 |
</ul>';
|
109 |
echo '<a href="' . $query_str . '" class="dashicons dashicons-dismiss close-promo"></a>';
|
110 |
echo '</div>';
|
111 |
-
}
|
112 |
-
$this->notice_spam += 1;
|
113 |
-
$output_css = true;
|
114 |
-
}
|
115 |
-
if ( $output_css ) {
|
116 |
-
wp_enqueue_style( $wd_options->prefix . '-admin-notices', $wd_options->wd_url_css . '/notices.css', array(), get_option($wd_options->prefix . "_version" ) );
|
117 |
}
|
|
|
|
|
|
|
|
|
|
|
118 |
}
|
119 |
}
|
120 |
}
|
|
|
121 |
|
122 |
-
|
123 |
-
|
124 |
-
|
125 |
-
|
126 |
-
}
|
127 |
-
return false;
|
128 |
}
|
|
|
|
|
129 |
|
130 |
-
|
131 |
-
|
132 |
-
|
133 |
-
|
134 |
-
|
135 |
-
|
136 |
-
|
137 |
-
|
138 |
-
|
139 |
-
|
140 |
-
|
141 |
-
}
|
142 |
}
|
|
|
143 |
|
144 |
-
|
145 |
-
|
146 |
-
|
147 |
-
|
148 |
-
|
149 |
-
|
150 |
-
|
151 |
-
|
152 |
-
|
153 |
-
|
154 |
-
|
155 |
-
|
156 |
-
|
157 |
-
|
158 |
-
|
159 |
-
|
160 |
-
|
161 |
-
|
162 |
-
}
|
163 |
}
|
|
|
164 |
|
165 |
-
|
166 |
-
|
167 |
-
|
168 |
-
|
169 |
-
|
170 |
-
|
171 |
-
}
|
172 |
-
}
|
173 |
-
else {
|
174 |
-
if ( $page == 'all' ) {
|
175 |
-
return true;
|
176 |
-
}
|
177 |
-
if ( get_current_screen()->id === $page ) {
|
178 |
-
return true;
|
179 |
-
}
|
180 |
-
if ( isset($_GET['page']) && $_GET['page'] == $page ) {
|
181 |
-
return true;
|
182 |
-
}
|
183 |
}
|
184 |
-
return false;
|
185 |
}
|
186 |
-
|
187 |
-
|
188 |
-
|
189 |
-
|
190 |
-
|
191 |
-
|
192 |
-
|
193 |
-
|
194 |
-
|
|
|
195 |
}
|
196 |
return false;
|
197 |
}
|
|
|
198 |
|
199 |
-
|
200 |
-
|
201 |
-
|
|
|
|
|
|
|
|
|
202 |
}
|
|
|
|
|
203 |
|
204 |
-
|
205 |
-
|
206 |
-
|
207 |
-
|
208 |
-
$promo_close = add_query_arg( array( $wd_options->prefix . '_admin_notice_ignore' => 'ecommerce_promo' ) );
|
209 |
|
210 |
-
|
211 |
-
|
212 |
-
|
213 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
214 |
<li><span class="dashicons dashicons-smiley"></span><a href="' . $two_week_review_ignore . '"> ' . __('I\'ve already left a review', $wd_options->prefix) . '</a></li>
|
215 |
<li><span class="dashicons dashicons-calendar-alt"></span><a href="' . $two_week_review_temp . '">' . __('Maybe Later', $wd_options->prefix) . '</a></li>
|
216 |
<li><span class="dashicons dashicons-dismiss"></span><a href="' . $two_week_review_ignore . '">' . __('Never show again', $wd_options->prefix) . '</a></li>',
|
217 |
-
|
218 |
-
|
219 |
-
|
220 |
-
|
221 |
-
|
222 |
-
}
|
223 |
}
|
|
1 |
<?php
|
2 |
+
if ( !defined( 'ABSPATH' ) ) {
|
3 |
+
exit;
|
4 |
+
}
|
5 |
+
|
6 |
+
class DoradoWebNotices {
|
7 |
+
|
8 |
+
protected $promo_link = '';
|
9 |
+
|
10 |
+
public $config;
|
11 |
+
public $notice_spam = 0;
|
12 |
+
public $notice_spam_max = 2;
|
13 |
+
|
14 |
+
// Basic actions to run
|
15 |
+
public function __construct( $config = array() ) {
|
16 |
+
$this->config = $config;
|
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 |
+
$wd_options = $this->config;
|
27 |
+
$settings = get_option($wd_options->prefix . '_admin_notice');
|
28 |
+
if ( !isset( $settings['disable_admin_notices'] ) || ( isset( $settings['disable_admin_notices'] ) && $settings['disable_admin_notices'] == 0 ) ) {
|
29 |
+
if ( current_user_can( 'manage_options' ) ) {
|
30 |
+
return true;
|
31 |
+
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
32 |
}
|
33 |
+
return false;
|
34 |
+
}
|
35 |
|
36 |
+
// Primary notice function that can be called from an outside function sending necessary variables
|
37 |
+
public function admin_notice( $admin_notices ) {
|
38 |
+
$wd_options = $this->config;
|
39 |
+
// Check options
|
40 |
+
if ( !$this->wd_admin_notice() ) {
|
|
|
|
|
|
|
|
|
41 |
return false;
|
42 |
}
|
43 |
+
foreach ( $admin_notices as $slug => $admin_notice ) {
|
44 |
+
// Call for spam protection
|
45 |
+
if ( $this->anti_notice_spam() ) {
|
|
|
|
|
|
|
46 |
return false;
|
47 |
}
|
48 |
+
|
49 |
+
// Check for proper page to display on
|
50 |
+
if (isset( $admin_notices[$slug]['pages']) && is_array( $admin_notices[$slug]['pages'])) {
|
51 |
+
if ( !$this->admin_notice_pages( $admin_notices[$slug]['pages'] ) ) {
|
52 |
return false;
|
53 |
}
|
54 |
+
}
|
55 |
|
56 |
+
// Check for required fields
|
57 |
+
if ( !$this->required_fields( $admin_notices[$slug] ) ) {
|
|
|
|
|
|
|
|
|
58 |
|
59 |
+
// Get the current date then set start date to either passed value or current date value and add interval
|
60 |
+
$current_date = current_time( "n/j/Y" );
|
61 |
+
$start = ( isset( $admin_notices[$slug]['start'] ) ? $admin_notices[$slug]['start'] : $current_date );
|
62 |
+
$start = date( "n/j/Y", strtotime( $start ) );
|
63 |
+
$date_array = explode( '/', $start );
|
64 |
+
$interval = ( isset( $admin_notices[$slug]['int'] ) ? $admin_notices[$slug]['int'] : 0 );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
65 |
|
66 |
+
$date_array[1] += $interval;
|
67 |
+
$start = date( "n/j/Y", mktime( 0, 0, 0, $date_array[0], $date_array[1], $date_array[2] ) );
|
68 |
+
|
69 |
+
// This is the main notices storage option
|
70 |
+
$admin_notices_option = get_option( $wd_options->prefix . '_admin_notice', array() );
|
71 |
+
// Check if the message is already stored and if so just grab the key otherwise store the message and its associated date information
|
72 |
+
if ( !array_key_exists( $slug, $admin_notices_option ) ) {
|
73 |
+
$admin_notices_option[$slug]['start'] = $start;
|
74 |
+
$admin_notices_option[$slug]['int'] = $interval;
|
75 |
+
update_option( $wd_options->prefix . '_admin_notice', $admin_notices_option );
|
76 |
+
}
|
77 |
+
|
78 |
+
// Sanity check to ensure we have accurate information
|
79 |
+
// New date information will not overwrite old date information
|
80 |
+
$admin_display_check = ( isset( $admin_notices_option[$slug]['dismissed'] ) ? $admin_notices_option[$slug]['dismissed'] : 0 );
|
81 |
+
$admin_display_start = ( isset( $admin_notices_option[$slug]['start'] ) ? $admin_notices_option[$slug]['start'] : $start );
|
82 |
+
$admin_display_interval = ( isset($admin_notices_option[$slug]['int'] ) ? $admin_notices_option[$slug]['int'] : $interval );
|
83 |
+
$admin_display_msg = ( isset($admin_notices[$slug]['msg'] ) ? $admin_notices[$slug]['msg'] : '' );
|
84 |
+
$admin_display_title = ( isset($admin_notices[$slug]['title'] ) ? $admin_notices[$slug]['title'] : '' );
|
85 |
+
$admin_display_link = ( isset( $admin_notices[$slug]['link'] ) ? $admin_notices[$slug]['link'] : '' );
|
86 |
+
$output_css = false;
|
87 |
+
|
88 |
+
// Ensure the notice hasn't been hidden and that the current date is after the start date
|
89 |
+
if ( $admin_display_check == 0 && strtotime($admin_display_start) <= strtotime($current_date ) ) {
|
90 |
+
|
91 |
+
// Get remaining query string
|
92 |
+
$query_str = ( isset( $admin_notices[$slug]['later_link'] ) ? $admin_notices[$slug]['later_link'] : esc_url(add_query_arg( $wd_options->prefix . '_admin_notice_ignore', $slug ) ) );
|
93 |
+
if ( strpos($slug, 'promo' ) === FALSE ) {
|
94 |
// Admin notice display output
|
95 |
echo '<div class="update-nag wd-admin-notice">
|
96 |
<div class="wd-notice-logo" style="background-image: url(' . $wd_options->wd_url_img . '/' . $wd_options->prefix . '_main_plugin.png);"></div>
|
99 |
<ul class="wd-notice-body wd-blue">' . $admin_display_link . '</ul>
|
100 |
<a href="' . $query_str . '" class="dashicons dashicons-dismiss"></a>
|
101 |
</div>';
|
102 |
+
}
|
103 |
+
else {
|
104 |
echo '<div class="admin-notice-promo">';
|
105 |
echo $admin_display_msg;
|
106 |
echo '<ul class="notice-body-promo blue">
|
108 |
</ul>';
|
109 |
echo '<a href="' . $query_str . '" class="dashicons dashicons-dismiss close-promo"></a>';
|
110 |
echo '</div>';
|
|
|
|
|
|
|
|
|
|
|
|
|
111 |
}
|
112 |
+
$this->notice_spam += 1;
|
113 |
+
$output_css = true;
|
114 |
+
}
|
115 |
+
if ( $output_css ) {
|
116 |
+
wp_enqueue_style( $wd_options->prefix . '-admin-notices', $wd_options->wd_url_css . '/notices.css', array(), get_option($wd_options->prefix . "_version" ) );
|
117 |
}
|
118 |
}
|
119 |
}
|
120 |
+
}
|
121 |
|
122 |
+
// Spam protection check
|
123 |
+
public function anti_notice_spam() {
|
124 |
+
if ( $this->notice_spam >= $this->notice_spam_max ) {
|
125 |
+
return true;
|
|
|
|
|
126 |
}
|
127 |
+
return false;
|
128 |
+
}
|
129 |
|
130 |
+
// Ignore function that gets ran at admin init to ensure any messages that were dismissed get marked
|
131 |
+
public function admin_notice_ignore() {
|
132 |
+
$wd_options = $this->config;
|
133 |
+
// If user clicks to ignore the notice, update the option to not show it again
|
134 |
+
if ( isset( $_GET[$wd_options->prefix . '_admin_notice_ignore'] ) ) {
|
135 |
+
$admin_notices_option = get_option( $wd_options->prefix . '_admin_notice', array() );
|
136 |
+
$admin_notices_option[$_GET[$wd_options->prefix . '_admin_notice_ignore']]['dismissed'] = 1;
|
137 |
+
update_option( $wd_options->prefix . '_admin_notice', $admin_notices_option );
|
138 |
+
$query_str = remove_query_arg( $wd_options->prefix . '_admin_notice_ignore' );
|
139 |
+
wp_redirect( $query_str );
|
140 |
+
exit;
|
|
|
141 |
}
|
142 |
+
}
|
143 |
|
144 |
+
// Temp Ignore function that gets ran at admin init to ensure any messages that were temp dismissed get their start date changed
|
145 |
+
public function admin_notice_temp_ignore() {
|
146 |
+
$wd_options = $this->config;
|
147 |
+
// If user clicks to temp ignore the notice, update the option to change the start date - default interval of 14 days
|
148 |
+
if ( isset( $_GET[$wd_options->prefix . '_admin_notice_temp_ignore'] ) ) {
|
149 |
+
$admin_notices_option = get_option( $wd_options->prefix . '_admin_notice', array() );
|
150 |
+
$current_date = current_time( "n/j/Y" );
|
151 |
+
$date_array = explode( '/', $current_date );
|
152 |
+
$interval = (isset($_GET['wd_int']) ? $_GET['wd_int'] : 14);
|
153 |
+
$date_array[1] += $interval;
|
154 |
+
$new_start = date( "n/j/Y", mktime( 0, 0, 0, $date_array[0], $date_array[1], $date_array[2] ) );
|
155 |
+
|
156 |
+
$admin_notices_option[$_GET[$wd_options->prefix . '_admin_notice_temp_ignore']]['start'] = $new_start;
|
157 |
+
$admin_notices_option[$_GET[$wd_options->prefix . '_admin_notice_temp_ignore']]['dismissed'] = 0;
|
158 |
+
update_option( $wd_options->prefix . '_admin_notice', $admin_notices_option );
|
159 |
+
$query_str = remove_query_arg( array( $wd_options->prefix . '_admin_notice_temp_ignore', 'wd_int' ) );
|
160 |
+
wp_redirect( $query_str );
|
161 |
+
exit;
|
|
|
162 |
}
|
163 |
+
}
|
164 |
|
165 |
+
public function admin_notice_pages($pages) {
|
166 |
+
$wd_options = $this->config;
|
167 |
+
foreach ( $pages as $key => $page ) {
|
168 |
+
if (is_array($page)) {
|
169 |
+
if ( isset( $_GET['page'] ) && $_GET['page'] == $page[0] && isset($_GET['tab']) && $_GET['tab'] == $page[1] ) {
|
170 |
+
return true;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
171 |
}
|
|
|
172 |
}
|
173 |
+
else {
|
174 |
+
if ( $page == 'all' ) {
|
175 |
+
return true;
|
176 |
+
}
|
177 |
+
if ( get_current_screen()->id === $page ) {
|
178 |
+
return true;
|
179 |
+
}
|
180 |
+
if ( isset($_GET['page']) && $_GET['page'] == $page ) {
|
181 |
+
return true;
|
182 |
+
}
|
183 |
}
|
184 |
return false;
|
185 |
}
|
186 |
+
}
|
187 |
|
188 |
+
// Required fields check
|
189 |
+
public function required_fields( $fields ) {
|
190 |
+
if ( !isset( $fields['msg'] ) || ( isset($fields['msg'] ) && empty( $fields['msg'] ) ) ) {
|
191 |
+
return true;
|
192 |
+
}
|
193 |
+
if ( !isset( $fields['title'] ) || ( isset( $fields['title'] ) && empty( $fields['title'] ) ) ) {
|
194 |
+
return true;
|
195 |
}
|
196 |
+
return false;
|
197 |
+
}
|
198 |
|
199 |
+
// Special parameters function that is to be used in any extension of this class
|
200 |
+
public function special_parameters($admin_notices) {
|
201 |
+
// Intentionally left blank
|
202 |
+
}
|
|
|
203 |
|
204 |
+
public function wd_admin_notices() {
|
205 |
+
$wd_options = $this->config;
|
206 |
+
$two_week_review_ignore = add_query_arg( array( $wd_options->prefix . '_admin_notice_ignore' => 'two_week_review' ) );
|
207 |
+
$two_week_review_temp = add_query_arg( array( $wd_options->prefix . '_admin_notice_temp_ignore' => 'two_week_review', 'int' => 14 ) );
|
208 |
+
$promo_close = add_query_arg( array( $wd_options->prefix . '_admin_notice_ignore' => 'ecommerce_promo' ) );
|
209 |
+
|
210 |
+
$notices['two_week_review'] = array(
|
211 |
+
'title' => __('Leave A Review?', $wd_options->prefix),
|
212 |
+
'msg' => sprintf(__('We hope you\'ve enjoyed using WordPress %s! Would you consider leaving us a review on WordPress.org?', $wd_options->prefix), $wd_options->plugin_title),
|
213 |
+
'link' => '<li><span class="dashicons dashicons-external"></span><a href="https://wordpress.org/support/plugin/' . $wd_options->plugin_wordpress_slug . '/reviews?filter=5&rate=5#new-post" target="_blank">' . __('Sure! I\'d love to!', $wd_options->prefix) . '</a></li>
|
214 |
<li><span class="dashicons dashicons-smiley"></span><a href="' . $two_week_review_ignore . '"> ' . __('I\'ve already left a review', $wd_options->prefix) . '</a></li>
|
215 |
<li><span class="dashicons dashicons-calendar-alt"></span><a href="' . $two_week_review_temp . '">' . __('Maybe Later', $wd_options->prefix) . '</a></li>
|
216 |
<li><span class="dashicons dashicons-dismiss"></span><a href="' . $two_week_review_ignore . '">' . __('Never show again', $wd_options->prefix) . '</a></li>',
|
217 |
+
'later_link' => $two_week_review_temp,
|
218 |
+
'int' => 14
|
219 |
+
);
|
220 |
+
|
221 |
+
$this->admin_notice($notices);
|
|
|
222 |
}
|
223 |
+
}
|
wd/includes/overview.php
CHANGED
@@ -58,6 +58,14 @@
|
|
58 |
public function display_overview_page(){
|
59 |
$wd_options = $this->config;
|
60 |
$tabs = $this->tabs;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
61 |
require_once( $wd_options->wd_dir_templates . "/display_overview.php" );
|
62 |
}
|
63 |
public function wd_overview_welcome(){
|
58 |
public function display_overview_page(){
|
59 |
$wd_options = $this->config;
|
60 |
$tabs = $this->tabs;
|
61 |
+
$start_using_url = "";
|
62 |
+
if(!empty($this->config->custom_post)) {
|
63 |
+
if (strpos($this->config->custom_post, 'post_type', 0) !== false) {
|
64 |
+
$start_using_url = admin_url($this->config->custom_post);
|
65 |
+
} else {
|
66 |
+
$start_using_url = menu_page_url($this->config->custom_post, false);
|
67 |
+
}
|
68 |
+
}
|
69 |
require_once( $wd_options->wd_dir_templates . "/display_overview.php" );
|
70 |
}
|
71 |
public function wd_overview_welcome(){
|
wd/templates/display_deactivation_popup.php
CHANGED
@@ -5,7 +5,7 @@
|
|
5 |
</div>
|
6 |
<form method="post" id="<?php echo $wd_options->prefix; ?>_deactivate_form">
|
7 |
<div class="wd-deactivate-popup-header">
|
8 |
-
<?php _e( "Please let us know why you are deactivating. Your answer will help us to serve you better", $wd_options->prefix ); ?>:
|
9 |
</div>
|
10 |
|
11 |
<div class="wd-deactivate-popup-body">
|
@@ -18,9 +18,8 @@
|
|
18 |
<div class="<?php echo $wd_options->prefix; ?>_additional_details_wrap"></div>
|
19 |
</div>
|
20 |
<div class="wd-btns">
|
21 |
-
<a href="<?php echo $deactivate_url; ?>" data-val="1" class="button button-
|
22 |
-
<a href="<?php echo $deactivate_url; ?>" data-val="2" class="button button-
|
23 |
-
<a href="<?php echo admin_url( 'plugins.php' ); ?>" class="button button-primary wd-<?php echo $wd_options->prefix; ?>-cancel"><?php _e( "Cancel" , $wd_options->prefix ); ?></a>
|
24 |
</div>
|
25 |
<input type="hidden" name="<?php echo $wd_options->prefix . "_submit_and_deactivate"; ?>" value="" >
|
26 |
<?php wp_nonce_field( $wd_options->prefix . '_save_form', $wd_options->prefix . '_save_form_fild'); ?>
|
5 |
</div>
|
6 |
<form method="post" id="<?php echo $wd_options->prefix; ?>_deactivate_form">
|
7 |
<div class="wd-deactivate-popup-header">
|
8 |
+
<?php _e( "Please let us know why you are deactivating. Your answer will help us to serve you better (Optional)", $wd_options->prefix ); ?>:
|
9 |
</div>
|
10 |
|
11 |
<div class="wd-deactivate-popup-body">
|
18 |
<div class="<?php echo $wd_options->prefix; ?>_additional_details_wrap"></div>
|
19 |
</div>
|
20 |
<div class="wd-btns">
|
21 |
+
<a href="<?php echo $deactivate_url; ?>" data-val="1" class="button button-primary button-close wd-<?php echo $wd_options->prefix; ?>-deactivate" id="wd-<?php echo $wd_options->prefix; ?>-deactivate"><?php _e( "Skip and Deactivate" , $wd_options->prefix ); ?></a>
|
22 |
+
<a href="<?php echo $deactivate_url; ?>" data-val="2" class="button button-primary button-close wd-<?php echo $wd_options->prefix; ?>-deactivate" id="wd-<?php echo $wd_options->prefix; ?>-submit-and-deactivate" style="display:none;"><?php _e( "Submit and Deactivate" , $wd_options->prefix ); ?></a>
|
|
|
23 |
</div>
|
24 |
<input type="hidden" name="<?php echo $wd_options->prefix . "_submit_and_deactivate"; ?>" value="" >
|
25 |
<?php wp_nonce_field( $wd_options->prefix . '_save_form', $wd_options->prefix . '_save_form_fild'); ?>
|
wd/templates/display_overview.php
CHANGED
@@ -1,33 +1,43 @@
|
|
1 |
<div class="overview_welcome">
|
2 |
-
|
3 |
-
|
4 |
-
|
5 |
-
|
6 |
-
|
7 |
-
|
8 |
-
|
9 |
-
|
10 |
-
|
11 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
12 |
</div>
|
13 |
<div class="overview_wrap">
|
14 |
-
|
15 |
-
|
16 |
-
|
17 |
-
|
18 |
-
|
19 |
-
|
20 |
-
|
21 |
-
|
22 |
-
|
23 |
-
|
24 |
-
|
25 |
-
|
26 |
-
|
27 |
-
|
28 |
-
|
29 |
-
|
30 |
-
|
31 |
-
|
32 |
-
|
|
|
|
|
33 |
</div>
|
1 |
<div class="overview_welcome">
|
2 |
+
<div class="wd-cell wd-valign-middle">
|
3 |
+
<a href="<?php echo $wd_options->plugin_wd_url; ?>" target="_blank"><img
|
4 |
+
src="<?php echo $wd_options->wd_url_img . '/' . $wd_options->prefix . '_main_plugin.png'; ?>"></a>
|
5 |
+
</div>
|
6 |
+
<div class="wd-cell wd-valign-middle">
|
7 |
+
|
8 |
+
<h2><?php echo sprintf(__("Welcome to %s", $wd_options->prefix), $wd_options->plugin_title); ?> <?php if (!empty($start_using_url)) { ?>
|
9 |
+
<div class="wd-start-using-button">
|
10 |
+
<a href="<?php echo $start_using_url; ?>" class="button button-primary button-large">Start using</a>
|
11 |
+
</div>
|
12 |
+
<?php } ?></h2>
|
13 |
+
|
14 |
+
<div class="overview_welcome_text">
|
15 |
+
|
16 |
+
<div><?php echo sprintf(__("CONGRATS! You've successfully installed %s WordPress plugin.", $wd_options->prefix), $wd_options->plugin_title); ?></div>
|
17 |
+
<div><?php echo $wd_options->description; ?></div>
|
18 |
+
</div>
|
19 |
+
</div>
|
20 |
</div>
|
21 |
<div class="overview_wrap">
|
22 |
+
<ul class="overview_tabs">
|
23 |
+
<?php
|
24 |
+
foreach ($tabs as $tab_key => $tab) {
|
25 |
+
$href = $tab['view'] !== false ? "#" . $tab_key : $tab_key;
|
26 |
+
$target = $tab['view'] == false ? 'target="_blank" class="not_tab"' : '';
|
27 |
+
$overview_tab_active_class = $tab_key == 'welcome' ? 'class="overview_tab_active"' : ''
|
28 |
+
?>
|
29 |
+
<li class=""><a
|
30 |
+
href="<?php echo $href; ?>" <?php echo $overview_tab_active_class; ?> <?php echo $target; ?>><?php echo esc_html($tab['name']); ?></a>
|
31 |
+
</li>
|
32 |
+
<?php } ?>
|
33 |
+
</ul>
|
34 |
+
<div class="overview_content">
|
35 |
+
<?php
|
36 |
+
foreach ($tabs as $tab_key => $tab) {
|
37 |
+
if ($tab['view'] !== false) {
|
38 |
+
echo call_user_func($tab['view']);
|
39 |
+
}
|
40 |
+
}
|
41 |
+
?>
|
42 |
+
</div>
|
43 |
</div>
|
wd/wd.php
CHANGED
@@ -17,7 +17,7 @@
|
|
17 |
public $overview_instance;
|
18 |
public $subscribe_instance;
|
19 |
public $config;
|
20 |
-
private $version = "1.0.
|
21 |
|
22 |
////////////////////////////////////////////////////////////////////////////////////////
|
23 |
// Constructor & Destructor //
|
17 |
public $overview_instance;
|
18 |
public $subscribe_instance;
|
19 |
public $config;
|
20 |
+
private $version = "1.0.13";
|
21 |
|
22 |
////////////////////////////////////////////////////////////////////////////////////////
|
23 |
// Constructor & Destructor //
|