Calendar by WD – Responsive Event Calendar - Version 1.5.57

Version Description

Changed: Deactivation popup

Download this release

Release Info

Developer webdorado
Plugin Icon 128x128 Calendar by WD – Responsive Event Calendar
Version 1.5.57
Comparing to
See all releases

Code changes from version 1.5.56 to 1.5.57

calendar.php CHANGED
@@ -3,12 +3,12 @@
3
  Plugin Name: Spider Event Calendar
4
  Plugin URI: https://web-dorado.com/products/wordpress-calendar.html
5
  Description: Spider Event Calendar is a highly configurable product which allows you to have multiple organized events. Spider Event Calendar is an extraordinary user friendly extension.
6
- Version: 1.5.56
7
  Author: WebDorado
8
  Author URI: https://web-dorado.com/wordpress-plugins-bundle.html
9
  License: GNU/GPLv3 http://www.gnu.org/licenses/gpl-3.0.html
10
  */
11
- $wd_spider_calendar_version="1.5.56";
12
  // LANGUAGE localization.
13
  function sp_calendar_language_load() {
14
  load_plugin_textdomain('sp_calendar', FALSE, basename(dirname(__FILE__)) . '/languages');
3
  Plugin Name: Spider Event Calendar
4
  Plugin URI: https://web-dorado.com/products/wordpress-calendar.html
5
  Description: Spider Event Calendar is a highly configurable product which allows you to have multiple organized events. Spider Event Calendar is an extraordinary user friendly extension.
6
+ Version: 1.5.57
7
  Author: WebDorado
8
  Author URI: https://web-dorado.com/wordpress-plugins-bundle.html
9
  License: GNU/GPLv3 http://www.gnu.org/licenses/gpl-3.0.html
10
  */
11
+ $wd_spider_calendar_version="1.5.57";
12
  // LANGUAGE localization.
13
  function sp_calendar_language_load() {
14
  load_plugin_textdomain('sp_calendar', FALSE, basename(dirname(__FILE__)) . '/languages');
readme.txt CHANGED
@@ -1,19 +1,20 @@
1
- === Calendar by WD - Responsive Event Calendar for WordPress ===
2
- Contributors: webdorado, wdsupport
3
- Donate link: https://web-dorado.com/products/wordpress-calendar.html
4
  Tags: calendar, event, event calendar, events, events calendar, calendars, event manager, calendar widget, event management, free calendar, Calender, upcoming events
5
  Requires at least: 3.4
6
  Tested up to: 4.9
7
- Stable tag: 1.5.56
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
11
  Event Calendar by WD is a responsive calendar plugin for organizing events. This calendar calendar lets you manage and publish unlimited event calendars on your site.
12
 
13
- == Description ==
 
 
 
14
  WordPress event calendar is a FREE user-friendly responsive calendar plugin to manage multiple recurring events and various display options. This free calendar plugin makes event registration and events management easy and lets you display beautiful responsive calendars, upcoming events and calendar widget. It’s perfect for websites organising seminars,summits, conferences, concerts,meetings, who want to have it displayed in an attractive calendar.
15
 
16
- [Special Offer for all Premium Plugins](https://web-dorado.com/wordpress-plugins-bundle.html)
17
  [WordPress Calendar](https://web-dorado.com/products/wordpress-calendar.html)
18
  [Demo](http://wpdemo.web-dorado.com/spider-calendar/)
19
  [Demo Admin](http://wpdemo.web-dorado.com/wp-admin/admin.php?page=SpiderCalendar)
@@ -152,8 +153,11 @@ Vietnamese (vi)
152
 
153
  == Changelog ==
154
 
 
 
 
155
  = 1.5.56 =
156
- * Changed: Web-Dorado links
157
 
158
  = 1.5.55 =
159
  Fixed: Load admin styles only on calendar pages
1
+ === Calendar by WD - Responsive Event Calendar ===
2
+ Contributors: webdorado, wdsupport, 10web
 
3
  Tags: calendar, event, event calendar, events, events calendar, calendars, event manager, calendar widget, event management, free calendar, Calender, upcoming events
4
  Requires at least: 3.4
5
  Tested up to: 4.9
6
+ Stable tag: 1.5.57
7
  License: GPLv2 or later
8
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
9
 
10
  Event Calendar by WD is a responsive calendar plugin for organizing events. This calendar calendar lets you manage and publish unlimited event calendars on your site.
11
 
12
+ == Description ==
13
+ [Special offer: Try Spider Event Calendar premium and 60+ other plugins for free at 10Web](https://10web.io/plugins/wordpress-spider-calendar/)
14
+ 10Web is a new platform from WebDorado
15
+
16
  WordPress event calendar is a FREE user-friendly responsive calendar plugin to manage multiple recurring events and various display options. This free calendar plugin makes event registration and events management easy and lets you display beautiful responsive calendars, upcoming events and calendar widget. It’s perfect for websites organising seminars,summits, conferences, concerts,meetings, who want to have it displayed in an attractive calendar.
17
 
 
18
  [WordPress Calendar](https://web-dorado.com/products/wordpress-calendar.html)
19
  [Demo](http://wpdemo.web-dorado.com/spider-calendar/)
20
  [Demo Admin](http://wpdemo.web-dorado.com/wp-admin/admin.php?page=SpiderCalendar)
153
 
154
  == Changelog ==
155
 
156
+ = 1.5.57 =
157
+ Changed: Deactivation popup
158
+
159
  = 1.5.56 =
160
+ Changed: Web-Dorado links
161
 
162
  = 1.5.55 =
163
  Fixed: Load admin styles only on calendar pages
spidercalendar_upcoming_events_widget.php CHANGED
@@ -4,6 +4,24 @@ add_action( 'wp_print_scripts', 'cal_scripts' );
4
 
5
  function cal_scripts(){
6
  global $wd_spider_calendar_version;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
7
  wp_enqueue_script("Calendar", plugins_url("elements/calendar.js", __FILE__), array(), $wd_spider_calendar_version, FALSE);
8
  wp_enqueue_script("calendar-setup", plugins_url("elements/calendar-setup.js", __FILE__), array(), $wd_spider_calendar_version, FALSE);
9
  wp_enqueue_script("calendar_function", plugins_url("elements/calendar_function.js", __FILE__), array(), $wd_spider_calendar_version, FALSE);
4
 
5
  function cal_scripts(){
6
  global $wd_spider_calendar_version;
7
+ $spider_cal_pages = array(
8
+ 'toplevel_page_SpiderCalendar',
9
+ 'calendar_page_spider_calendar_event_category',
10
+ 'calendar_page_spider_calendar_themes',
11
+ 'calendar_page_spider_widget_calendar_themes',
12
+ 'calendar_page_calendar_export',
13
+ 'calendar_page_Spider_calendar_Licensing',
14
+ 'calendar_page_Uninstall_sp_calendar',
15
+ 'calendar_page_overview_sp_calendar'
16
+ );
17
+
18
+ if(function_exists('get_current_screen')) {
19
+ $current_screen = get_current_screen();
20
+ if(is_admin() && !in_array($current_screen->id, $spider_cal_pages)) {
21
+ return;
22
+ }
23
+ }
24
+
25
  wp_enqueue_script("Calendar", plugins_url("elements/calendar.js", __FILE__), array(), $wd_spider_calendar_version, FALSE);
26
  wp_enqueue_script("calendar-setup", plugins_url("elements/calendar-setup.js", __FILE__), array(), $wd_spider_calendar_version, FALSE);
27
  wp_enqueue_script("calendar_function", plugins_url("elements/calendar_function.js", __FILE__), array(), $wd_spider_calendar_version, FALSE);
wd/README.md CHANGED
@@ -1,4 +1,5 @@
1
- Version: 1.0.7
 
2
 
3
 
4
  Usage:
1
+ Version: 1.0.13
2
+
3
 
4
 
5
  Usage:
wd/assets/css/deactivate_popup.css CHANGED
@@ -1,3 +1,7 @@
 
 
 
 
1
  .wd-opacity{
2
  position: fixed;
3
  top: 0px;
@@ -83,4 +87,4 @@
83
  bottom: 0;
84
  margin: auto;
85
  z-index: 63;
86
- }
1
+ .wd-bwg-reasons:nth-child(3) {
2
+ display: none;
3
+ }
4
+
5
  .wd-opacity{
6
  position: fixed;
7
  top: 0px;
87
  bottom: 0;
88
  margin: auto;
89
  z-index: 63;
90
+ }
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/assets/img/{fwd_main_plugin.png → fm_main_plugin.png} RENAMED
File without changes
wd/assets/img/sp_calendar_main_plugin.png DELETED
Binary file
wd/assets/js/deactivate_popup.js CHANGED
@@ -20,7 +20,7 @@ var btnVal = 3;
20
  // Public Methods //
21
  ////////////////////////////////////////////////////////////////////////////////////////
22
  function wdReady(prefix){
23
-
24
  jQuery(document).on("click", "." + window[prefix + "WDDeactivateVars"].deactivate_class, function(){
25
  jQuery(".wd-" + prefix + "-opacity").show();
26
  jQuery(".wd-" + prefix + "-deactivate-popup").show();
@@ -32,6 +32,7 @@ function wdReady(prefix){
32
  });
33
 
34
  jQuery(document).on("change", "[name=" + prefix + "_reasons]", function(){
 
35
  jQuery("." + prefix + "_additional_details_wrap").html("");
36
  jQuery(".wd-" + prefix + "-deactivate-popup").removeClass("wd-popup-active1 wd-popup-active2");
37
  if(jQuery(this).val() == "reason_plugin_is_hard_to_use_technical_problems"){
@@ -80,6 +81,7 @@ function wdReady(prefix){
80
  jQuery(document).on("click", ".wd-" + prefix + "-deactivate", function(){
81
  jQuery(".wd-deactivate-popup-opacity-" + prefix).show();
82
  if(jQuery(this).hasClass("wd-clicked") == false){
 
83
  jQuery("[name=" + prefix + "_submit_and_deactivate]").val(jQuery(this).attr("data-val"));
84
  jQuery("#" + prefix + "_deactivate_form").submit();
85
  }
@@ -93,6 +95,7 @@ function wdReady(prefix){
93
  });
94
 
95
  }
 
96
  ////////////////////////////////////////////////////////////////////////////////////////
97
  // Getters & Setters //
98
  ////////////////////////////////////////////////////////////////////////////////////////
20
  // Public Methods //
21
  ////////////////////////////////////////////////////////////////////////////////////////
22
  function wdReady(prefix){
23
+
24
  jQuery(document).on("click", "." + window[prefix + "WDDeactivateVars"].deactivate_class, function(){
25
  jQuery(".wd-" + prefix + "-opacity").show();
26
  jQuery(".wd-" + prefix + "-deactivate-popup").show();
32
  });
33
 
34
  jQuery(document).on("change", "[name=" + prefix + "_reasons]", function(){
35
+
36
  jQuery("." + prefix + "_additional_details_wrap").html("");
37
  jQuery(".wd-" + prefix + "-deactivate-popup").removeClass("wd-popup-active1 wd-popup-active2");
38
  if(jQuery(this).val() == "reason_plugin_is_hard_to_use_technical_problems"){
81
  jQuery(document).on("click", ".wd-" + prefix + "-deactivate", function(){
82
  jQuery(".wd-deactivate-popup-opacity-" + prefix).show();
83
  if(jQuery(this).hasClass("wd-clicked") == false){
84
+ jQuery(this).addClass("wd-clicked");
85
  jQuery("[name=" + prefix + "_submit_and_deactivate]").val(jQuery(this).attr("data-val"));
86
  jQuery("#" + prefix + "_deactivate_form").submit();
87
  }
95
  });
96
 
97
  }
98
+
99
  ////////////////////////////////////////////////////////////////////////////////////////
100
  // Getters & Setters //
101
  ////////////////////////////////////////////////////////////////////////////////////////
wd/assets/js/overview.js CHANGED
@@ -12,7 +12,7 @@
12
  ////////////////////////////////////////////////////////////////////////////////////////
13
  jQuery(document).ready(function () {
14
  jQuery(".overview_content > div:not(#welcome)").hide();
15
- jQuery(".overview_tabs li a:not(.not_tab)").click(function(){
16
  jQuery(".overview_tabs li a").removeClass("overview_tab_active");
17
  jQuery(this).addClass("overview_tab_active");
18
  jQuery(".overview_content > div").hide();
@@ -31,7 +31,7 @@ jQuery(document).ready(function () {
31
  // jQuery("body").append('<style>.stars-' + rate.toString() + ':after{width:' + rate + '%;}</style>');
32
  // });
33
 
34
- jQuery("#wd-copy").click(function(){
35
  var selector = document.querySelector('#wd-site-deatils-textarea');
36
  selector.select();
37
  document.execCommand('copy');
12
  ////////////////////////////////////////////////////////////////////////////////////////
13
  jQuery(document).ready(function () {
14
  jQuery(".overview_content > div:not(#welcome)").hide();
15
+ jQuery(".overview_tabs li a:not(.not_tab)").on("click", function(){
16
  jQuery(".overview_tabs li a").removeClass("overview_tab_active");
17
  jQuery(this).addClass("overview_tab_active");
18
  jQuery(".overview_content > div").hide();
31
  // jQuery("body").append('<style>.stars-' + rate.toString() + ':after{width:' + rate + '%;}</style>');
32
  // });
33
 
34
+ jQuery("#wd-copy").on("click", function(){
35
  var selector = document.querySelector('#wd-site-deatils-textarea');
36
  selector.select();
37
  document.execCommand('copy');
wd/assets/js/subsribe.js CHANGED
@@ -10,13 +10,13 @@
10
  ////////////////////////////////////////////////////////////////////////////////////////
11
  // Constructor & Destructor //
12
  ////////////////////////////////////////////////////////////////////////////////////////
13
- jQuery(document).ready(function () {
14
- jQuery(".permissions").click(function(){
15
  jQuery(".list").toggle();
16
  return false;
17
  });
18
 
19
- jQuery(".allow_and_continue").click(function(){
20
  jQuery(this).css("opacity", "0.5");
21
  jQuery(".wd_loader").css("visibility", "visible");
22
  });
10
  ////////////////////////////////////////////////////////////////////////////////////////
11
  // Constructor & Destructor //
12
  ////////////////////////////////////////////////////////////////////////////////////////
13
+ jQuery(document).on("ready", function () {
14
+ jQuery(".permissions").on("click", function(){
15
  jQuery(".list").toggle();
16
  return false;
17
  });
18
 
19
+ jQuery(".allow_and_continue").on("click", function(){
20
  jQuery(this).css("opacity", "0.5");
21
  jQuery(".wd_loader").css("visibility", "visible");
22
  });
wd/includes/api.php CHANGED
@@ -55,7 +55,7 @@
55
  public function get_hash(){
56
  $response = wp_remote_get("https://api.web-dorado.com/hash/" . $_SERVER['REMOTE_ADDR'] . "/" . $_SERVER['HTTP_HOST']);
57
 
58
- $response_body = isset($response["body"]) ? json_decode($response["body"], true) : null;
59
 
60
  if(is_array($response_body)){
61
  $hash = $response_body["body"]["hash"];
55
  public function get_hash(){
56
  $response = wp_remote_get("https://api.web-dorado.com/hash/" . $_SERVER['REMOTE_ADDR'] . "/" . $_SERVER['HTTP_HOST']);
57
 
58
+ $response_body = ( !is_wp_error($response) && isset($response["body"])) ? json_decode($response["body"], true) : null;
59
 
60
  if(is_array($response_body)){
61
  $hash = $response_body["body"]["hash"];
wd/includes/deactivate.php CHANGED
@@ -76,7 +76,18 @@
76
  });
77
  </script>
78
  <?php
79
- require ( $wd_options->wd_dir_templates . '/display_deactivation_popup.php' );
 
 
 
 
 
 
 
 
 
 
 
80
  }
81
 
82
 
@@ -129,8 +140,8 @@
129
  'cookies' => array()
130
  )
131
  );
132
-
133
- $response_body = isset( $response["body"] ) ? json_decode( $response["body"], true ) : null;
134
  if( is_array( $response_body ) && $response_body["body"]["msg"] == "Access" ) {
135
 
136
  }
76
  });
77
  </script>
78
  <?php
79
+
80
+ $deactivate_url =
81
+ add_query_arg(
82
+ array(
83
+ 'action' => 'deactivate',
84
+ 'plugin' => plugin_basename( $wd_options->plugin_main_file ),
85
+ '_wpnonce' => wp_create_nonce( 'deactivate-plugin_' . plugin_basename( $wd_options->plugin_main_file ) )
86
+ ),
87
+ admin_url( 'plugins.php' )
88
+ );
89
+
90
+ require ( $wd_options->wd_dir_templates . '/display_deactivation_popup.php' );
91
  }
92
 
93
 
140
  'cookies' => array()
141
  )
142
  );
143
+
144
+ $response_body = (!is_wp_error($response) && isset( $response["body"] )) ? json_decode( $response["body"], true ) : null;
145
  if( is_array( $response_body ) && $response_body["body"]["msg"] == "Access" ) {
146
 
147
  }
wd/includes/notices.php CHANGED
@@ -1,96 +1,96 @@
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,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
- else {
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
- // 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/view/plugin-reviews/' . $wd_options->plugin_wordpress_slug . '?filter=5" 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
  }
 
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(){
@@ -120,7 +128,8 @@
120
  unset($plugins[$wd_options->plugin_wordpress_slug]) ;
121
 
122
  // foreach ( $plugins as $wp_slug => &$plugin ){
123
- // $wp_data = $this->remote_get($wp_slug);
 
124
  // $plugin["downloaded"] = $wp_data["downloaded"];
125
  // $plugin["rating"] = $wp_data["rating"];
126
  // }
@@ -167,13 +176,6 @@
167
  if ( empty( $sql_mode ) )
168
  $sql_mode = __( 'Not set', $wd_options->prefix );
169
  $server_info["SQL Mode"] = $sql_mode;
170
-
171
- // Get PHP Safe Mode
172
- if( ini_get( 'safe_mode' ) )
173
- $safe_mode = __( 'On', $wd_options->prefix );
174
- else
175
- $safe_mode = __( 'Off', $wd_options->prefix );
176
- $server_info["PHP Safe Mode"] = $safe_mode;
177
 
178
  // Get PHP allow_url_fopen
179
  if( ini_get( 'allow_url_fopen' ) )
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(){
128
  unset($plugins[$wd_options->plugin_wordpress_slug]) ;
129
 
130
  // foreach ( $plugins as $wp_slug => &$plugin ){
131
+ // $wp_data = $this->
132
+ //remote_get($wp_slug);
133
  // $plugin["downloaded"] = $wp_data["downloaded"];
134
  // $plugin["rating"] = $wp_data["rating"];
135
  // }
176
  if ( empty( $sql_mode ) )
177
  $sql_mode = __( 'Not set', $wd_options->prefix );
178
  $server_info["SQL Mode"] = $sql_mode;
 
 
 
 
 
 
 
179
 
180
  // Get PHP allow_url_fopen
181
  if( ini_get( 'allow_url_fopen' ) )
wd/includes/subscribe.php CHANGED
@@ -108,7 +108,7 @@
108
  )
109
  );
110
 
111
- $response_body = isset( $response["body"] ) ? json_decode( $response["body"], true ) : null;
112
 
113
  if( is_array( $response_body ) && $response_body["body"]["msg"] == "Access" ) {
114
 
108
  )
109
  );
110
 
111
+ $response_body = (!is_wp_error($response) && isset( $response["body"] )) ? json_decode( $response["body"], true ) : null;
112
 
113
  if( is_array( $response_body ) && $response_body["body"]["msg"] == "Access" ) {
114
 
wd/templates/display_deactivation_popup.php CHANGED
@@ -1,28 +1,27 @@
1
- <div class="wd-opacity wd-<?php echo $wd_options->prefix; ?>-opacity"></div>
2
- <div class="wd-deactivate-popup wd-<?php echo $wd_options->prefix; ?>-deactivate-popup">
3
- <div class="wd-deactivate-popup-opacity wd-deactivate-popup-opacity-<?php echo $wd_options->prefix; ?>">
4
- <img src="<?php echo $wd_options->wd_url_img . '/spinner.gif'; ?>" class="wd-img-loader" >
 
 
 
 
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">
12
- <?php foreach( $deactivate_reasons as $deactivate_reason_slug => $deactivate_reason ) { ?>
13
- <div class="wd-<?php echo $wd_options->prefix; ?>-reasons">
14
- <input type="radio" value="<?php echo $deactivate_reason["id"];?>" id="<?php echo $wd_options->prefix . "-" .$deactivate_reason["id"]; ?>" name="<?php echo $wd_options->prefix; ?>_reasons" >
15
- <label for="<?php echo $wd_options->prefix . "-" . $deactivate_reason["id"]; ?>"><?php echo $deactivate_reason["text"];?></label>
16
- </div>
17
- <?php } ?>
18
- <div class="<?php echo $wd_options->prefix; ?>_additional_details_wrap"></div>
19
- </div>
20
- <div class="wd-btns">
21
- <a href="#" data-val="1" class="button button-secondary button-close wd-<?php echo $wd_options->prefix; ?>-deactivate" id="wd-<?php echo $wd_options->prefix; ?>-deactivate"><?php _e( "Deactivate" , $wd_options->prefix ); ?></a>
22
- <a href="#" data-val="2" class="button button-secondary 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
- <a href="#" 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'); ?>
27
- </form>
28
- </div>
1
+ <div class="wd-opacity wd-<?php echo $wd_options->prefix; ?>-opacity"></div>
2
+ <div class="wd-deactivate-popup wd-<?php echo $wd_options->prefix; ?>-deactivate-popup">
3
+ <div class="wd-deactivate-popup-opacity wd-deactivate-popup-opacity-<?php echo $wd_options->prefix; ?>">
4
+ <img src="<?php echo $wd_options->wd_url_img . '/spinner.gif'; ?>" class="wd-img-loader" >
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">
12
+ <?php foreach( $deactivate_reasons as $deactivate_reason_slug => $deactivate_reason ) { ?>
13
+ <div class="wd-<?php echo $wd_options->prefix; ?>-reasons">
14
+ <input type="radio" value="<?php echo $deactivate_reason["id"];?>" id="<?php echo $wd_options->prefix . "-" .$deactivate_reason["id"]; ?>" name="<?php echo $wd_options->prefix; ?>_reasons" >
15
+ <label for="<?php echo $wd_options->prefix . "-" . $deactivate_reason["id"]; ?>"><?php echo $deactivate_reason["text"];?></label>
16
+ </div>
17
+ <?php } ?>
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'); ?>
26
+ </form>
27
+ </div>
 
 
 
 
 
wd/templates/display_overview.php CHANGED
@@ -1,33 +1,43 @@
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 src="<?php echo $wd_options->wd_url_img . '/' . $wd_options->prefix . '_main_plugin.png'; ?>"></a>
4
- </div>
5
- <div class="wd-cell wd-valign-middle">
6
- <h2><?php echo sprintf( __( "Welcome to %s", $wd_options->prefix ), $wd_options->plugin_title ); ?></h2>
7
- <div class="overview_welcome_text">
8
- <div><?php echo sprintf( __( "CONGRATS! You've successfully installed %s WordPress plugin.", $wd_options->prefix ), $wd_options->plugin_title ) ; ?></div>
9
- <div><?php echo $wd_options->description ; ?></div>
10
- </div>
11
- </div>
 
 
 
 
 
 
 
 
12
  </div>
13
  <div class="overview_wrap">
14
- <ul class="overview_tabs">
15
- <?php
16
- foreach ( $tabs as $tab_key => $tab ) {
17
- $href = $tab['view'] !== false ? "#" . $tab_key : $tab_key;
18
- $target = $tab['view'] == false ? 'target="_blank" class="not_tab"' : '';
19
- $overview_tab_active_class = $tab_key == 'welcome' ? 'class="overview_tab_active"' : ''
20
- ?>
21
- <li class=""><a href="<?php echo $href; ?>" <?php echo $overview_tab_active_class; ?> <?php echo $target; ?>><?php echo esc_html( $tab['name'] ); ?></a></li>
22
- <?php } ?>
23
- </ul>
24
- <div class="overview_content">
25
- <?php
26
- foreach ( $tabs as $tab_key => $tab ) {
27
- if( $tab['view'] !== false ){
28
- echo call_user_func( $tab['view'] );
29
- }
30
- }
31
- ?>
32
- </div>
 
 
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/templates/display_overview_deals.php CHANGED
@@ -31,13 +31,6 @@
31
  <div class="deal_desc">
32
  <p><?php echo $plugin["content"]; ?></p>
33
  <div class="deal_desc_footer">
34
- <!--<div class="downloads">
35
- <div class="rating" data-rating="<?php echo $plugin["rating"]; ?>"></div>
36
- <div class="spans">
37
- <span><?php _e( "Downloads", $wd_options->prefix ); ?></span>
38
- <span><?php echo number_format($plugin["downloaded"], 0); ?></span>
39
- </div>
40
- </div>-->
41
  <div class="download_btn">
42
  <a href="<?php echo $plugin["href"]; ?>" target="_blank" ><?php _e( "Download", $wd_options->prefix ); ?></a>
43
  </div>
31
  <div class="deal_desc">
32
  <p><?php echo $plugin["content"]; ?></p>
33
  <div class="deal_desc_footer">
 
 
 
 
 
 
 
34
  <div class="download_btn">
35
  <a href="<?php echo $plugin["href"]; ?>" target="_blank" ><?php _e( "Download", $wd_options->prefix ); ?></a>
36
  </div>
wd/templates/display_subscribe.php CHANGED
@@ -8,7 +8,7 @@
8
  <div class="texts">
9
  <p><?php _e( "Hi there", $wd_options->prefix ); ?>,</p>
10
  <p>
11
- <?php echo sprintf( __( "Allow %s to collect some usage data. This will allow you to get more out of your plugin experience get awesome customer support, receive exclusive deals and discounts on premium products and more. You can choose to skip this step, %s will still work just fine.", $wd_options->prefix ), '<strong>Web-Dorado</strong>', $wd_options->plugin_title ); ?>
12
  </p>
13
  </div>
14
  <div class="btns">
8
  <div class="texts">
9
  <p><?php _e( "Hi there", $wd_options->prefix ); ?>,</p>
10
  <p>
11
+ <?php echo sprintf( __( "Allow %s to collect some usage data. This will allow you to get more out of your plugin experience - get awesome customer support, receive exclusive deals and discounts on premium products and more. You can choose to skip this step, %s will still work just fine.", $wd_options->prefix ), '<strong>Web-Dorado</strong>', $wd_options->plugin_title ); ?>
12
  </p>
13
  </div>
14
  <div class="btns">
wd/wd.php CHANGED
@@ -17,7 +17,7 @@
17
  public $overview_instance;
18
  public $subscribe_instance;
19
  public $config;
20
- private $version = "1.0.2";
21
 
22
  ////////////////////////////////////////////////////////////////////////////////////////
23
  // Constructor & Destructor //
@@ -52,7 +52,7 @@
52
  // Create overview menu page
53
  public function wd_overview_menu_page() {
54
  $wd_options = $this->config;
55
-
56
  $capability = $wd_options->menu_capability ? $wd_options->menu_capability : "manage_options";
57
  if( get_option( $wd_options->prefix . "_subscribe_done" ) == 1 || $wd_options->subscribe === false ){
58
  $parent_slug = $wd_options->custom_post;
@@ -125,7 +125,17 @@
125
 
126
  public function change_deactivation_link ( $links ) {
127
  $wd_options = $this->config;
128
- $links["deactivate"] = '<a href="#" class="' . $wd_options->prefix . '_deactivate_link">Deactivate</a>';
 
 
 
 
 
 
 
 
 
 
129
  return $links;
130
  }
131
 
17
  public $overview_instance;
18
  public $subscribe_instance;
19
  public $config;
20
+ private $version = "1.0.13";
21
 
22
  ////////////////////////////////////////////////////////////////////////////////////////
23
  // Constructor & Destructor //
52
  // Create overview menu page
53
  public function wd_overview_menu_page() {
54
  $wd_options = $this->config;
55
+
56
  $capability = $wd_options->menu_capability ? $wd_options->menu_capability : "manage_options";
57
  if( get_option( $wd_options->prefix . "_subscribe_done" ) == 1 || $wd_options->subscribe === false ){
58
  $parent_slug = $wd_options->custom_post;
125
 
126
  public function change_deactivation_link ( $links ) {
127
  $wd_options = $this->config;
128
+ $deactivate_url =
129
+ add_query_arg(
130
+ array(
131
+ 'action' => 'deactivate',
132
+ 'plugin' => plugin_basename( $wd_options->plugin_main_file ),
133
+ '_wpnonce' => wp_create_nonce( 'deactivate-plugin_' . plugin_basename( $wd_options->plugin_main_file ) )
134
+ ),
135
+ admin_url( 'plugins.php' )
136
+ );
137
+
138
+ $links["deactivate"] = '<a href="'.$deactivate_url.'" class="' . $wd_options->prefix . '_deactivate_link">Deactivate</a>';
139
  return $links;
140
  }
141