WD Google Maps – Google Maps builder Plugin - Version 1.0.35

Version Description

  • Fixed: Minor bugs
Download this release

Release Info

Developer webdorado
Plugin Icon 128x128 WD Google Maps – Google Maps builder Plugin
Version 1.0.35
Comparing to
See all releases

Code changes from version 1.0.34 to 1.0.35

admin/controllers/GMWDControllerUninstall_gmwd.php CHANGED
@@ -15,10 +15,19 @@ class GMWDControllerUninstall_gmwd extends GMWDController{
15
  ////////////////////////////////////////////////////////////////////////////////////////
16
  public function __construct(){
17
  parent::__construct();
 
 
 
 
 
18
  include_once (GMWD_DIR . "/wd/includes/deactivate.php");
19
- $deactivate_reasons = new WDDeactivate();
20
- $deactivate_reasons->add_deactivation_feedback_dialog_box();
21
- $deactivate_reasons->submit_and_deactivate();
 
 
 
 
22
 
23
  }
24
  ////////////////////////////////////////////////////////////////////////////////////////
15
  ////////////////////////////////////////////////////////////////////////////////////////
16
  public function __construct(){
17
  parent::__construct();
18
+ global $gmwd_options;
19
+ if(!class_exists("WDConfig")){
20
+ include_once (GMWD_DIR . "/wd/config.php");
21
+ }
22
+
23
  include_once (GMWD_DIR . "/wd/includes/deactivate.php");
24
+ $config = new WDConfig();
25
+
26
+ $config->set_options( $gmwd_options );
27
+
28
+ $deactivate_reasons = new WebDoradoDeactivate($config);
29
+ //$deactivate_reasons->add_deactivation_feedback_dialog_box();
30
+ $deactivate_reasons->submit_and_deactivate();
31
 
32
  }
33
  ////////////////////////////////////////////////////////////////////////////////////////
admin/views/GMWDViewUninstall_gmwd.php CHANGED
@@ -112,9 +112,10 @@ class GMWDViewUninstall_gmwd extends GMWDView{
112
  </div>
113
  <div class="wrap">
114
  <h2><?php _e("Uninstall Google Maps WD","gmwd"); ?></h2>
115
- <p><strong><a href="<?php echo $deactivate_url; ?>" class="gmwd_deactivate_link" data-uninstall="1"><?php _e("Click Here","gmwd"); ?></a><?php _e(" To Finish the Uninstallation and Google Maps WD will be Deactivated Automatically.","gmwd"); ?></strong></p>
116
 
117
  </div>
 
118
  <?php
119
 
120
  }
112
  </div>
113
  <div class="wrap">
114
  <h2><?php _e("Uninstall Google Maps WD","gmwd"); ?></h2>
115
+ <p><strong><a href="#" class="gmwd_deactivate_link" data-uninstall="1"><?php _e("Click Here","gmwd"); ?></a><?php _e(" To Finish the Uninstallation and Google Maps WD will be Deactivated Automatically.","gmwd"); ?></strong></p>
116
 
117
  </div>
118
+
119
  <?php
120
 
121
  }
gmwd_admin_class.php CHANGED
@@ -11,7 +11,7 @@ class GMWDAdmin{
11
  // Variables //
12
  ////////////////////////////////////////////////////////////////////////////////////////
13
  protected static $instance = null;
14
- private static $version = '1.0.34';
15
  ////////////////////////////////////////////////////////////////////////////////////////
16
  // Constructor & Destructor //
17
  ////////////////////////////////////////////////////////////////////////////////////////
@@ -114,9 +114,10 @@ class GMWDAdmin{
114
  // Admin menu
115
  public function gmwd_options_panel() {
116
  $parent_slug = null;
117
- if( get_option( "gmwd_subscribe_done" ) == 1 || (isset($_GET["page"]) && $_GET["page"] == "uninstall_gmwd")){
118
  $parent_slug = "overview_gmwd";
119
  }
 
120
  $gmwd_page = add_submenu_page($parent_slug, __('Maps','gmwd'), __('Maps','gmwd'), 'manage_options', 'maps_gmwd', array($this,'gmwd'));
121
  add_action('load-' . $gmwd_page, array($this,'gmwd_maps_per_page_option'));
122
 
@@ -237,7 +238,7 @@ class GMWDAdmin{
237
  wp_enqueue_script('gmwd-deactivate-popup', GMWD_URL.'/wd/assets/js/deactivate_popup.js', array(), self::$version, true );
238
  $admin_data = wp_get_current_user();
239
 
240
- wp_localize_script( 'gmwd-deactivate-popup', 'WDDeactivateVars', array(
241
  "prefix" => "gmwd" ,
242
  "deactivate_class" => 'gmwd_deactivate_link',
243
  "email" => $admin_data->data->user_email,
11
  // Variables //
12
  ////////////////////////////////////////////////////////////////////////////////////////
13
  protected static $instance = null;
14
+ private static $version = '1.0.35';
15
  ////////////////////////////////////////////////////////////////////////////////////////
16
  // Constructor & Destructor //
17
  ////////////////////////////////////////////////////////////////////////////////////////
114
  // Admin menu
115
  public function gmwd_options_panel() {
116
  $parent_slug = null;
117
+ if( get_option( "gmwd_subscribe_done" ) == 1 ){
118
  $parent_slug = "overview_gmwd";
119
  }
120
+
121
  $gmwd_page = add_submenu_page($parent_slug, __('Maps','gmwd'), __('Maps','gmwd'), 'manage_options', 'maps_gmwd', array($this,'gmwd'));
122
  add_action('load-' . $gmwd_page, array($this,'gmwd_maps_per_page_option'));
123
 
238
  wp_enqueue_script('gmwd-deactivate-popup', GMWD_URL.'/wd/assets/js/deactivate_popup.js', array(), self::$version, true );
239
  $admin_data = wp_get_current_user();
240
 
241
+ wp_localize_script( 'gmwd-deactivate-popup', 'gmwdWDDeactivateVars', array(
242
  "prefix" => "gmwd" ,
243
  "deactivate_class" => 'gmwd_deactivate_link',
244
  "email" => $admin_data->data->user_email,
{wd/assets/img → images}/marker_clusters.png RENAMED
File without changes
readme.txt CHANGED
@@ -4,7 +4,7 @@ Donate link: https://web-dorado.com/products/wordpress-google-maps-plugin.html
4
  Tags: directions, google map, google map plugin, google maps, google maps plugin, map, map markers, map plugin, map widget, maps, wp google map, wp google maps
5
  Requires at least: 3.4
6
  Tested up to: 4.7
7
- Stable tag: 1.0.34
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
@@ -113,6 +113,9 @@ After downloading the ZIP file of the Google Maps WD plugin,
113
 
114
  == Changelog ==
115
 
 
 
 
116
  = 1.0.34 =
117
  * Changed: Deactivation
118
 
4
  Tags: directions, google map, google map plugin, google maps, google maps plugin, map, map markers, map plugin, map widget, maps, wp google map, wp google maps
5
  Requires at least: 3.4
6
  Tested up to: 4.7
7
+ Stable tag: 1.0.35
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
113
 
114
  == Changelog ==
115
 
116
+ = 1.0.35 =
117
+ * Fixed: Minor bugs
118
+
119
  = 1.0.34 =
120
  * Changed: Deactivation
121
 
wd-google-maps.php CHANGED
@@ -4,7 +4,7 @@
4
  * Plugin Name: Google Maps WD
5
  * Plugin URI: https://web-dorado.com/products/wordpress-google-maps-plugin.html
6
  * Description: Google Maps WD is an intuitive tool for creating Google maps with advanced markers, custom layers and overlays for your website.
7
- * Version: 1.0.34
8
  * Author: WebDorado
9
  * Author URI: http://web-dorado.com/
10
  * License: GNU/GPLv3 http://www.gnu.org/licenses/gpl-3.0.html
@@ -55,26 +55,19 @@ require_once( GMWD_DIR. '/widgets.php' );
55
 
56
 
57
  if(!isset($_REQUEST['ajax'])){
58
- require_once(GMWD_DIR . '/wd/start.php');
59
- wd_init( array (
 
 
 
 
60
  "prefix" => "gmwd",
61
  "wd_plugin_id" => 147,
62
  "plugin_title" => "Google Maps WD",
63
  "plugin_wordpress_slug" => "wd-google-maps",
64
  "plugin_dir" => GMWD_DIR,
65
- "plugin_url" => GMWD_URL,
66
- "plugin_main_file" => __FILE__,
67
- "wd_plugin_name_personal" => "Google Maps WD Personal (WordPress)",
68
- "wd_plugin_name_business" => "Google Maps WD Business (WordPress)",
69
- "wd_plugin_name_developer" => "Google Maps WD Developer (WordPress)",
70
  "description" => __('Plugin for creating Google maps with advanced markers, custom layers and overlays for your website.', 'gmwd'),
71
- "addons" => array(
72
- "wd-google-maps-marker-clustering" => array(
73
- "id" => 160,
74
- "description" => __('GMWD Marker Clustering is designed for grouping close markers for more user-friendly display over the map.', 'gmwd'),
75
- "image" => GMWD_URL . '/wd/assets/img/marker_clusters.png'
76
- )
77
- ),
78
  // from web-dorado.com
79
  "plugin_features" => array(
80
  0 => array(
@@ -184,11 +177,18 @@ if(!isset($_REQUEST['ajax'])){
184
  ),
185
  "video_youtube_id" => "acaexefeP7o", // e.g. https://www.youtube.com/watch?v=acaexefeP7o youtube id is the acaexefeP7o
186
  "plugin_wd_url" => "https://web-dorado.com/products/wordpress-google-maps-plugin.html",
187
- "plugin_wd_demo_link" => "http://wpdemo.web-dorado.com/google-maps/?_ga=1.55907819.1794949467.1468394897",
188
- "plugin_wd_forum_link" => "https://web-dorado.com/forum/wordpress-google-maps-wd.html",
189
  "plugin_wd_addons_link" => "https://web-dorado.com/products/wordpress-google-maps-plugin/add-ons/marker-clustering.html",
190
  "after_subscribe" => "overview_gmwd", // this can be plagin overview page or set up page
191
- ));
 
 
 
 
 
 
 
 
192
 
193
  }
194
 
4
  * Plugin Name: Google Maps WD
5
  * Plugin URI: https://web-dorado.com/products/wordpress-google-maps-plugin.html
6
  * Description: Google Maps WD is an intuitive tool for creating Google maps with advanced markers, custom layers and overlays for your website.
7
+ * Version: 1.0.35
8
  * Author: WebDorado
9
  * Author URI: http://web-dorado.com/
10
  * License: GNU/GPLv3 http://www.gnu.org/licenses/gpl-3.0.html
55
 
56
 
57
  if(!isset($_REQUEST['ajax'])){
58
+
59
+ if( !class_exists("WebDorado") ){
60
+ require_once(GMWD_DIR . '/wd/start.php');
61
+ }
62
+ global $gmwd_options;
63
+ $gmwd_options = array (
64
  "prefix" => "gmwd",
65
  "wd_plugin_id" => 147,
66
  "plugin_title" => "Google Maps WD",
67
  "plugin_wordpress_slug" => "wd-google-maps",
68
  "plugin_dir" => GMWD_DIR,
69
+ "plugin_main_file" => __FILE__,
 
 
 
 
70
  "description" => __('Plugin for creating Google maps with advanced markers, custom layers and overlays for your website.', 'gmwd'),
 
 
 
 
 
 
 
71
  // from web-dorado.com
72
  "plugin_features" => array(
73
  0 => array(
177
  ),
178
  "video_youtube_id" => "acaexefeP7o", // e.g. https://www.youtube.com/watch?v=acaexefeP7o youtube id is the acaexefeP7o
179
  "plugin_wd_url" => "https://web-dorado.com/products/wordpress-google-maps-plugin.html",
180
+ "plugin_wd_demo_link" => "http://wpdemo.web-dorado.com/google-maps/?_ga=1.55907819.1794949467.1468394897",
 
181
  "plugin_wd_addons_link" => "https://web-dorado.com/products/wordpress-google-maps-plugin/add-ons/marker-clustering.html",
182
  "after_subscribe" => "overview_gmwd", // this can be plagin overview page or set up page
183
+ "plugin_wizard_link" => admin_url('index.php?page=gmwd_setup'),
184
+ "plugin_menu_title" => "Google Maps WD",
185
+ "plugin_menu_icon" => GMWD_URL . '/images/icon-map-20.png',
186
+ "deactivate" => true,
187
+ "subscribe" => true,
188
+ "custom_post" => false, // if true => edit.php?post_type=contact
189
+ );
190
+
191
+ web_dorado_init($gmwd_options);
192
 
193
  }
194
 
wd/assets/css/deactivate_popup.css CHANGED
@@ -19,7 +19,7 @@
19
  background: #fff;
20
  z-index: 999999;
21
  width: 600px;
22
- height: 280px;
23
  margin: auto;
24
  display: none;
25
  box-sizing: border-box;
@@ -39,10 +39,14 @@
39
  .wd-deactivate-popup-body input[type=text]{
40
  width: 220px;
41
  }
 
 
 
 
42
  .wd-btns{
43
- padding: 20px 40px;
44
- text-align: right;
45
-
46
  }
47
 
48
  .additional_details_wrap{
@@ -55,9 +59,9 @@
55
  margin: 14px 0px 5px;
56
  }
57
  .wd-popup-active1{
58
- height: 522px !important;
59
  }
60
 
61
  .wd-popup-active2{
62
- height: 425px !important
63
  }
19
  background: #fff;
20
  z-index: 999999;
21
  width: 600px;
22
+ height: 281px;
23
  margin: auto;
24
  display: none;
25
  box-sizing: border-box;
39
  .wd-deactivate-popup-body input[type=text]{
40
  width: 220px;
41
  }
42
+ .wd-deactivate-popup-body textarea{
43
+ width: 100%;
44
+ }
45
+
46
  .wd-btns{
47
+ position: absolute;
48
+ bottom: 19px;
49
+ right: 19px
50
  }
51
 
52
  .additional_details_wrap{
59
  margin: 14px 0px 5px;
60
  }
61
  .wd-popup-active1{
62
+ height: 523px !important;
63
  }
64
 
65
  .wd-popup-active2{
66
+ height: 426px !important
67
  }
wd/assets/css/notices.css CHANGED
@@ -9,11 +9,10 @@
9
  .wd-admin-notice a {
10
  color: #10738B;
11
  }
12
- .gmwd-notice-logo {
13
  clear: both;
14
  content: "";
15
  display: block;
16
- background-image: url("../img/notice_img.png");
17
  background-size: 108px auto;
18
  background-repeat: no-repeat;
19
  background-position: 0 45%;
9
  .wd-admin-notice a {
10
  color: #10738B;
11
  }
12
+ .wd-notice-logo {
13
  clear: both;
14
  content: "";
15
  display: block;
 
16
  background-size: 108px auto;
17
  background-repeat: no-repeat;
18
  background-position: 0 45%;
wd/assets/img/awd_main_plugin.png ADDED
Binary file
wd/assets/img/bwg_main_plugin.png ADDED
Binary file
wd/assets/img/ecwd_main_plugin.png ADDED
Binary file
wd/assets/img/ewd_main_plugin.png ADDED
Binary file
wd/assets/img/fbwd_main_plugin.png ADDED
Binary file
wd/assets/img/fwd_main_plugin.png ADDED
Binary file
wd/assets/img/gawd_main_plugin.png ADDED
Binary file
wd/assets/img/gmwd_main_plugin.png ADDED
Binary file
wd/assets/img/iwd_main_plugin.png ADDED
Binary file
wd/assets/img/main_plugin.png DELETED
Binary file
wd/assets/img/mwd_main_plugin.png ADDED
Binary file
wd/assets/img/notice_img.png DELETED
Binary file
wd/assets/img/swd_main_plugin.png ADDED
Binary file
wd/assets/img/twd_main_plugin.png ADDED
Binary file
wd/assets/img/ytwd_main_plugin.png ADDED
Binary file
wd/assets/js/deactivate_popup.js CHANGED
@@ -10,13 +10,20 @@
10
  var deactivated = false;
11
  var additionalInfo = "";
12
  var btnVal = 3;
 
13
  ////////////////////////////////////////////////////////////////////////////////////////
14
  // Constructor & Destructor //
15
  ////////////////////////////////////////////////////////////////////////////////////////
16
- jQuery(document).ready(function () {
17
- jQuery(document).on("click", "." + WDDeactivateVars.deactivate_class, function(){
18
- jQuery(".wd-" + WDDeactivateVars.prefix + "-opacity").show();
19
- jQuery(".wd-" + WDDeactivateVars.prefix + "-deactivate-popup").show();
 
 
 
 
 
 
20
  if(jQuery(this).attr("data-uninstall") == "1"){
21
  btnVal = 2 ;
22
  }
@@ -24,69 +31,70 @@ jQuery(document).ready(function () {
24
  return false;
25
  });
26
 
27
- jQuery(document).on("change", "[name=" + WDDeactivateVars.prefix + "_reasons]", function(){
28
 
29
- jQuery("." + WDDeactivateVars.prefix + "_additional_details_wrap").html("");
30
- jQuery(".wd-" + WDDeactivateVars.prefix + "-deactivate-popup").removeClass("wd-popup-active1 wd-popup-active2");
31
  if(jQuery(this).val() == "reason_plugin_is_hard_to_use_technical_problems"){
32
 
33
  additionalInfo = '<div class="wd-additional-active"><div><strong>Please describe your issue.</strong></div><br>' +
34
- '<textarea name="' + WDDeactivateVars.prefix + '_additional_details" cols = "70" rows = "4"></textarea><br>' +
35
- '<div>Our support will contact <input type="text" name="' + WDDeactivateVars.prefix + '_email" value="' +WDDeactivateVars.email + '"> shortly.</div>'+
36
- '<br><div><button class="button button-primary wd-' + WDDeactivateVars.prefix + '-deactivate" data-val="' + btnVal + '">Submit support ticket</button></div></div>';
37
- jQuery("." + WDDeactivateVars.prefix + "_additional_details_wrap").append(additionalInfo);
38
- jQuery(".wd-" + WDDeactivateVars.prefix + "-deactivate-popup").addClass("wd-popup-active1");
39
 
40
  }
41
  else if(jQuery(this).val() == "reason_free_version_limited"){
42
  additionalInfo = '<div class="wd-additional-active">' +
43
  '<div><strong>We believe our premium version will fit your needs.</strong></div>' +
44
- '<div><a href="' + WDDeactivateVars.plugin_wd_url+ '" target="_blank">Try with 30 day money back guarantee.</a></div>';
45
 
46
- jQuery("." + WDDeactivateVars.prefix + "_additional_details_wrap").append(additionalInfo);
47
- jQuery(".wd-" + WDDeactivateVars.prefix + "-deactivate-popup").addClass("wd-popup-active2");
48
  }
49
  else if(jQuery(this).val() == "reason_premium_expensive"){
50
  additionalInfo = '<div class="wd-additional-active">' +
51
  '<div><strong>We have a special offer for you.</strong></div>' +
52
- '<div>Submit this form to get the offer to <input type="text" name="' + WDDeactivateVars.prefix + '_email" value="' + WDDeactivateVars.email + '"></div>' +
53
- '<br><div><button class="button button-primary wd-' + WDDeactivateVars.prefix + '-deactivate" data-val="' + btnVal + '">Submit</button></div></div>';
54
 
55
- jQuery("." + WDDeactivateVars.prefix + "_additional_details_wrap").append(additionalInfo);
56
- jQuery(".wd-" + WDDeactivateVars.prefix + "-deactivate-popup").addClass("wd-popup-active2");
57
  }
58
 
59
- jQuery("#wd-" + WDDeactivateVars.prefix + "-deactivate").hide();
60
- jQuery("#wd-" + WDDeactivateVars.prefix + "-submit-and-deactivate").show();
61
 
62
  });
63
- jQuery(document).on("keyup", "[name=" + WDDeactivateVars.prefix + "_additional_details]", function(){
64
- if(jQuery(this).val().trim() || jQuery("[name=" + WDDeactivateVars.prefix + "_reasons]:checked").length > 0){
65
- jQuery("#wd-" + WDDeactivateVars.prefix + "-deactivate").hide();
66
- jQuery("#wd-" + WDDeactivateVars.prefix + "-submit-and-deactivate").show();
67
  }
68
  else{
69
- jQuery("#wd-" + WDDeactivateVars.prefix + "-deactivate").show();
70
- jQuery("#wd-" + WDDeactivateVars.prefix + "-submit-and-deactivate").hide();
71
  }
72
 
73
  });
74
- jQuery(document).on("click", ".wd-" + WDDeactivateVars.prefix + "-deactivate", function(){
75
- jQuery("[name=" + WDDeactivateVars.prefix + "_submit_and_deactivate]").val(jQuery(this).attr("data-val"));
76
- jQuery("#" + WDDeactivateVars.prefix + "_deactivate_form").submit();
 
 
 
 
77
  return false;
78
  });
79
 
80
- jQuery(document).on("click", ".wd-" + WDDeactivateVars.prefix + "-cancel, .wd-opacity", function(){
81
- jQuery(".wd-" + WDDeactivateVars.prefix + "-opacity").hide();
82
- jQuery(".wd-" + WDDeactivateVars.prefix + "-deactivate-popup").hide();
83
  return false;
84
  });
85
- });
86
 
87
- ////////////////////////////////////////////////////////////////////////////////////////
88
- // Public Methods //
89
- ////////////////////////////////////////////////////////////////////////////////////////
90
  ////////////////////////////////////////////////////////////////////////////////////////
91
  // Getters & Setters //
92
  ////////////////////////////////////////////////////////////////////////////////////////
10
  var deactivated = false;
11
  var additionalInfo = "";
12
  var btnVal = 3;
13
+
14
  ////////////////////////////////////////////////////////////////////////////////////////
15
  // Constructor & Destructor //
16
  ////////////////////////////////////////////////////////////////////////////////////////
17
+
18
+
19
+ ////////////////////////////////////////////////////////////////////////////////////////
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();
27
  if(jQuery(this).attr("data-uninstall") == "1"){
28
  btnVal = 2 ;
29
  }
31
  return false;
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"){
39
 
40
  additionalInfo = '<div class="wd-additional-active"><div><strong>Please describe your issue.</strong></div><br>' +
41
+ '<textarea name="' + prefix + '_additional_details" rows = "4"></textarea><br>' +
42
+ '<div>Our support will contact <input type="text" name="' + prefix + '_email" value="' + window[prefix + "WDDeactivateVars"].email + '"> shortly.</div>'+
43
+ '<br><div><button class="button button-primary wd-' + prefix + '-deactivate" data-val="' + btnVal + '">Submit support ticket</button></div></div>';
44
+ jQuery("." + prefix + "_additional_details_wrap").append(additionalInfo);
45
+ jQuery(".wd-" + prefix + "-deactivate-popup").addClass("wd-popup-active1");
46
 
47
  }
48
  else if(jQuery(this).val() == "reason_free_version_limited"){
49
  additionalInfo = '<div class="wd-additional-active">' +
50
  '<div><strong>We believe our premium version will fit your needs.</strong></div>' +
51
+ '<div><a href="' + window[prefix + "WDDeactivateVars"].plugin_wd_url+ '" target="_blank">Try with 30 day money back guarantee.</a></div>';
52
 
53
+ jQuery("." + prefix + "_additional_details_wrap").append(additionalInfo);
54
+ jQuery(".wd-" + prefix + "-deactivate-popup").addClass("wd-popup-active2");
55
  }
56
  else if(jQuery(this).val() == "reason_premium_expensive"){
57
  additionalInfo = '<div class="wd-additional-active">' +
58
  '<div><strong>We have a special offer for you.</strong></div>' +
59
+ '<div>Submit this form to get the offer to <input type="text" name="' + prefix + '_email" value="' + window[prefix + "WDDeactivateVars"].email + '"></div>' +
60
+ '<br><div><button class="button button-primary wd-' + prefix + '-deactivate" data-val="' + btnVal + '">Submit</button></div></div>';
61
 
62
+ jQuery("." + prefix + "_additional_details_wrap").append(additionalInfo);
63
+ jQuery(".wd-" + prefix + "-deactivate-popup").addClass("wd-popup-active2");
64
  }
65
 
66
+ jQuery("#wd-" + prefix + "-deactivate").hide();
67
+ jQuery("#wd-" + prefix + "-submit-and-deactivate").show();
68
 
69
  });
70
+ jQuery(document).on("keyup", "[name=" + prefix + "_additional_details]", function(){
71
+ if(jQuery(this).val().trim() || jQuery("[name=" + prefix + "_reasons]:checked").length > 0){
72
+ jQuery("#wd-" + prefix + "-deactivate").hide();
73
+ jQuery("#wd-" + prefix + "-submit-and-deactivate").show();
74
  }
75
  else{
76
+ jQuery("#wd-" + prefix + "-deactivate").show();
77
+ jQuery("#wd-" + prefix + "-submit-and-deactivate").hide();
78
  }
79
 
80
  });
81
+ jQuery(document).on("click", ".wd-" + prefix + "-deactivate", function(){
82
+
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
+ }
88
  return false;
89
  });
90
 
91
+ jQuery(document).on("click", ".wd-" + prefix + "-cancel, .wd-opacity", function(){
92
+ jQuery(".wd-" + prefix + "-opacity").hide();
93
+ jQuery(".wd-" + prefix + "-deactivate-popup").hide();
94
  return false;
95
  });
 
96
 
97
+ }
 
 
98
  ////////////////////////////////////////////////////////////////////////////////////////
99
  // Getters & Setters //
100
  ////////////////////////////////////////////////////////////////////////////////////////
wd/config.php CHANGED
@@ -2,47 +2,114 @@
2
  if ( ! defined( 'ABSPATH' ) ) {
3
  exit;
4
  }
5
-
6
- /**
7
- * Directories
8
- */
9
-
10
- define( 'WD_DIR', dirname( __FILE__ ) );
11
- define( 'WD_DIR_INCLUDES', WD_DIR . '/includes' );
12
- define( 'WD_DIR_TEMPLATES', WD_DIR . '/templates' );
13
- define( 'WD_DIR_ASSETS', WD_DIR . '/assets' );
14
- define( 'WD_URL_CSS', plugins_url( plugin_basename( dirname( __FILE__ ) ) ) . '/assets/css' );
15
- define( 'WD_URL_JS', plugins_url( plugin_basename( dirname( __FILE__ ) ) ) . '/assets/js' );
16
- define( 'WD_URL_IMG', plugins_url( plugin_basename( dirname( __FILE__ ) ) ) . '/assets/img' );
17
-
18
- /**
19
- * Domain / URL / Address
20
- */
21
-
22
- define( 'WD_API_PLUGIN_DATA_PATH', 'http://api.web-dorado.com/v2/_id_/plugindata' );
23
-
24
- // global options
25
- global $wd_options;
26
- $wd_options = new StdClass();
27
- $wd_options->prefix = null;
28
- $wd_options->wd_plugin_id = null;
29
- $wd_options->plugin_title = null;
30
- $wd_options->plugin_wordpress_slug = null;
31
- $wd_options->plugin_dir = null;
32
- $wd_options->plugin_url = null;
33
- $wd_options->plugin_main_file = null;
34
- $wd_options->wd_plugin_name_personal = null;
35
- $wd_options->wd_plugin_name_business = null;
36
- $wd_options->wd_plugin_name_developer = null;
37
- $wd_options->description = null;
38
- $wd_options->addons = null;
39
- $wd_options->plugin_features = null;
40
- $wd_options->user_guide = null;
41
- $wd_options->video_youtube_id = null;
42
- $wd_options->plugin_wd_url = null;
43
- $wd_options->plugin_wd_demo_link = null;
44
- $wd_options->plugin_wd_forum_link = null;
45
- $wd_options->plugin_wd_addons_link = null;
46
- $wd_options->after_subscribe = null;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
47
 
48
 
2
  if ( ! defined( 'ABSPATH' ) ) {
3
  exit;
4
  }
5
+
6
+ class WDConfig {
7
+ public static $instance;
8
+
9
+ public $prefix = null;
10
+ public $wd_plugin_id = null;
11
+ public $plugin_title = null;
12
+ public $plugin_wordpress_slug = null;
13
+ public $plugin_dir = null;
14
+ public $plugin_main_file = null;
15
+ public $description = null;
16
+ public $plugin_features = null;
17
+ public $user_guide = null;
18
+ public $video_youtube_id = null;
19
+ public $plugin_wd_url = null;
20
+ public $plugin_wd_demo_link = null;
21
+ public $plugin_wd_addons_link = null;
22
+ public $plugin_wizard_link = null;
23
+ public $after_subscribe = null;
24
+ public $plugin_menu_title = null;
25
+ public $plugin_menu_icon = null;
26
+ public $wd_dir = null;
27
+ public $wd_dir_includes = null;
28
+ public $wd_dir_templates = null;
29
+ public $wd_dir_assets = null;
30
+ public $wd_url_css = null;
31
+ public $wd_url_js = null;
32
+ public $wd_url_img = null;
33
+ public $deactivate = null;
34
+ public $subscribe = null;
35
+ public $custom_post = null;
36
+
37
+ public function set_options( $options ){
38
+
39
+ if(isset( $options["prefix"] )) {
40
+ $this->prefix = $options["prefix"];
41
+ }
42
+ if(isset( $options["wd_plugin_id"] )) {
43
+ $this->wd_plugin_id = $options["wd_plugin_id"];
44
+ }
45
+ if(isset( $options["plugin_title"] )) {
46
+ $this->plugin_title = $options["plugin_title"];
47
+ }
48
+ if(isset( $options["plugin_wordpress_slug"] )) {
49
+ $this->plugin_wordpress_slug = $options["plugin_wordpress_slug"];
50
+ }
51
+ if(isset( $options["plugin_dir"] )) {
52
+ $this->plugin_dir = $options["plugin_dir"];
53
+ }
54
+ if(isset( $options["plugin_main_file"] )) {
55
+ $this->plugin_main_file = $options["plugin_main_file"];
56
+ }
57
+
58
+ if(isset( $options["description"] )) {
59
+ $this->description = $options["description"];
60
+ }
61
+ if(isset( $options["plugin_features"] )) {
62
+ $this->plugin_features = $options["plugin_features"];
63
+ }
64
+ if(isset( $options["user_guide"] )) {
65
+ $this->user_guide = $options["user_guide"];
66
+ }
67
+ if(isset( $options["video_youtube_id"] )) {
68
+ $this->video_youtube_id = $options["video_youtube_id"];
69
+ }
70
+ if(isset( $options["plugin_wd_url"] )) {
71
+ $this->plugin_wd_url = $options["plugin_wd_url"];
72
+ }
73
+ if(isset( $options["plugin_wd_demo_link"] )) {
74
+ $this->plugin_wd_demo_link = $options["plugin_wd_demo_link"];
75
+ }
76
+ if(isset( $options["plugin_wd_addons_link"] )) {
77
+ $this->plugin_wd_addons_link = $options["plugin_wd_addons_link"];
78
+ }
79
+ if(isset( $options["plugin_wizard_link"] )) {
80
+ $this->plugin_wizard_link = $options["plugin_wizard_link"];
81
+ }
82
+ if(isset( $options["after_subscribe"] )) {
83
+ $this->after_subscribe = $options["after_subscribe"];
84
+ }
85
+ if(isset( $options["plugin_menu_title"] )) {
86
+ $this->plugin_menu_title = $options["plugin_menu_title"];
87
+ }
88
+ if(isset( $options["plugin_menu_icon"] )) {
89
+ $this->plugin_menu_icon = $options["plugin_menu_icon"];
90
+ }
91
+ if(isset( $options["deactivate"] )) {
92
+ $this->deactivate = $options["deactivate"];
93
+ }
94
+ if(isset( $options["subscribe"] )) {
95
+ $this->subscribe = $options["subscribe"];
96
+ }
97
+ if(isset( $options["custom_post"] )) {
98
+ $this->custom_post = $options["custom_post"];
99
+ }
100
+
101
+ // directories
102
+ $this->wd_dir = dirname( __FILE__ );
103
+ $this->wd_dir_includes = $this->wd_dir . '/includes';
104
+ $this->wd_dir_templates = $this->wd_dir . '/templates';
105
+ $this->wd_dir_assets = $this->wd_dir . '/assets';
106
+ $this->wd_url_css = plugins_url( plugin_basename( dirname( __FILE__ ) ) ) . '/assets/css';
107
+ $this->wd_url_js = plugins_url( plugin_basename( dirname( __FILE__ ) ) ) . '/assets/js';
108
+ $this->wd_url_img = plugins_url( plugin_basename( dirname( __FILE__ ) ) ) . '/assets/img';
109
+ }
110
+
111
+
112
+ }
113
+
114
 
115
 
wd/includes/api.php CHANGED
@@ -3,7 +3,7 @@
3
  exit;
4
  }
5
 
6
- class WDApi{
7
  ////////////////////////////////////////////////////////////////////////////////////////
8
  // Events //
9
  ////////////////////////////////////////////////////////////////////////////////////////
@@ -14,13 +14,15 @@
14
  // Variables //
15
  ////////////////////////////////////////////////////////////////////////////////////////
16
 
 
17
  public $userhash = array();
18
 
19
 
20
  ////////////////////////////////////////////////////////////////////////////////////////
21
  // Constructor & Destructor //
22
  ////////////////////////////////////////////////////////////////////////////////////////
23
- public function __construct() {
 
24
  $this->userhash = $this->get_userhash();
25
  }
26
  ////////////////////////////////////////////////////////////////////////////////////////
@@ -29,7 +31,7 @@
29
 
30
 
31
  public function get_remote_data( $id ) {
32
- $remote_data_path = WD_API_PLUGIN_DATA_PATH . '/' . $this->userhash;
33
  $request = wp_remote_get( ( str_replace( '_id_', $id, $remote_data_path ) ) );
34
 
35
  if ( !is_wp_error($request) || wp_remote_retrieve_response_code($request) === 200 ) {
@@ -40,7 +42,7 @@
40
 
41
 
42
  public function get_userhash(){
43
- global $wd_options;
44
  $userhash = 'nohash';
45
  if ( file_exists( $wd_options->plugin_dir . '/.keep') && is_readable( $wd_options->plugin_dir . '/.keep' ) ) {
46
  $f = fopen( $wd_options->plugin_dir . '/.keep', 'r' );
3
  exit;
4
  }
5
 
6
+ class WebDoradoApi{
7
  ////////////////////////////////////////////////////////////////////////////////////////
8
  // Events //
9
  ////////////////////////////////////////////////////////////////////////////////////////
14
  // Variables //
15
  ////////////////////////////////////////////////////////////////////////////////////////
16
 
17
+ public $config ;
18
  public $userhash = array();
19
 
20
 
21
  ////////////////////////////////////////////////////////////////////////////////////////
22
  // Constructor & Destructor //
23
  ////////////////////////////////////////////////////////////////////////////////////////
24
+ public function __construct( $config = array() ) {
25
+ $this->config = $config;
26
  $this->userhash = $this->get_userhash();
27
  }
28
  ////////////////////////////////////////////////////////////////////////////////////////
31
 
32
 
33
  public function get_remote_data( $id ) {
34
+ $remote_data_path = WEB_DORADO_API_PLUGIN_DATA_PATH . '/' . $this->userhash;
35
  $request = wp_remote_get( ( str_replace( '_id_', $id, $remote_data_path ) ) );
36
 
37
  if ( !is_wp_error($request) || wp_remote_retrieve_response_code($request) === 200 ) {
42
 
43
 
44
  public function get_userhash(){
45
+ $wd_options = $this->config;
46
  $userhash = 'nohash';
47
  if ( file_exists( $wd_options->plugin_dir . '/.keep') && is_readable( $wd_options->plugin_dir . '/.keep' ) ) {
48
  $f = fopen( $wd_options->plugin_dir . '/.keep', 'r' );
wd/includes/deactivate.php CHANGED
@@ -3,7 +3,7 @@
3
  exit;
4
  }
5
 
6
- class WDDeactivate{
7
  ////////////////////////////////////////////////////////////////////////////////////////
8
  // Events //
9
  ////////////////////////////////////////////////////////////////////////////////////////
@@ -14,6 +14,7 @@
14
  // Variables //
15
  ////////////////////////////////////////////////////////////////////////////////////////
16
  public $deactivate_reasons = array();
 
17
  // Reason IDs
18
  const REASON_PLUGIN_IS_HARD_TO_USE_TECHNICAL_PROBLEMS = "reason_plugin_is_hard_to_use_technical_problems";
19
  const REASON_FREE_VERSION_IS_LIMITED = "reason_free_version_limited";
@@ -24,9 +25,10 @@
24
  ////////////////////////////////////////////////////////////////////////////////////////
25
  // Constructor & Destructor //
26
  ////////////////////////////////////////////////////////////////////////////////////////
27
- public function __construct() {
28
- global $wd_options;
29
-
 
30
  $this->deactivate_reasons = array(
31
  1 => array(
32
  'id' => self::REASON_PLUGIN_IS_HARD_TO_USE_TECHNICAL_PROBLEMS,
@@ -53,7 +55,11 @@
53
  add_action( 'admin_footer', array( $this, 'add_deactivation_feedback_dialog_box' ) );
54
  add_action( 'admin_init', array( $this, 'submit_and_deactivate' ) );
55
 
56
- add_action( 'admin_enqueue_scripts', array( $this, 'scripts' ) );
 
 
 
 
57
 
58
  }
59
  ////////////////////////////////////////////////////////////////////////////////////////
@@ -61,29 +67,41 @@
61
  ////////////////////////////////////////////////////////////////////////////////////////
62
  public function add_deactivation_feedback_dialog_box(){
63
  $deactivate_reasons = $this->deactivate_reasons;
64
- global $wd_options;
65
- require_once( WD_DIR_TEMPLATES . '/display_deactivation_popup.php' );
 
 
 
 
 
 
 
 
66
  }
67
 
 
 
68
  public function scripts(){
69
- global $wd_options;
70
- wp_enqueue_style( $wd_options->prefix . '-deactivate-popup', WD_URL_CSS . '/deactivate_popup.css', array(), get_option($wd_options->prefix . "_version" ) );
71
- wp_enqueue_script( $wd_options->prefix . '-deactivate-popup', WD_URL_JS . '/deactivate_popup.js');
 
72
  $admin_data = wp_get_current_user();
73
- wp_localize_script( $wd_options->prefix . '-deactivate-popup', 'WDDeactivateVars', array(
74
  "prefix" => $wd_options->prefix ,
75
  "deactivate_class" => $wd_options->prefix . '_deactivate_link',
76
  "email" => $admin_data->data->user_email,
77
  "plugin_wd_url" => $wd_options->plugin_wd_url,
78
  ));
 
79
 
80
  }
81
  public function submit_and_deactivate(){
82
- global $wd_options;
83
  if( isset( $_POST[$wd_options->prefix . "_submit_and_deactivate"] ) ){
84
 
85
  if( $_POST[$wd_options->prefix . "_submit_and_deactivate"] == 2 || $_POST[$wd_options->prefix . "_submit_and_deactivate"] == 3 ){
86
- $api = new WDApi();
87
  $hash = $api->get_hash();
88
  if($hash != null){
89
  $data = array();
@@ -128,7 +146,7 @@
128
  ),
129
  admin_url( 'plugins.php' )
130
  );
131
- wp_redirect( $deactivate_url );
132
  }
133
 
134
  }
@@ -146,5 +164,5 @@
146
  ////////////////////////////////////////////////////////////////////////////////////////
147
 
148
  }
149
- new WDDeactivate();
150
 
3
  exit;
4
  }
5
 
6
+ class WebDoradoDeactivate{
7
  ////////////////////////////////////////////////////////////////////////////////////////
8
  // Events //
9
  ////////////////////////////////////////////////////////////////////////////////////////
14
  // Variables //
15
  ////////////////////////////////////////////////////////////////////////////////////////
16
  public $deactivate_reasons = array();
17
+ public $config;
18
  // Reason IDs
19
  const REASON_PLUGIN_IS_HARD_TO_USE_TECHNICAL_PROBLEMS = "reason_plugin_is_hard_to_use_technical_problems";
20
  const REASON_FREE_VERSION_IS_LIMITED = "reason_free_version_limited";
25
  ////////////////////////////////////////////////////////////////////////////////////////
26
  // Constructor & Destructor //
27
  ////////////////////////////////////////////////////////////////////////////////////////
28
+ public function __construct( $config = array() ) {
29
+ $this->config = $config;
30
+ $wd_options = $this->config;
31
+
32
  $this->deactivate_reasons = array(
33
  1 => array(
34
  'id' => self::REASON_PLUGIN_IS_HARD_TO_USE_TECHNICAL_PROBLEMS,
55
  add_action( 'admin_footer', array( $this, 'add_deactivation_feedback_dialog_box' ) );
56
  add_action( 'admin_init', array( $this, 'submit_and_deactivate' ) );
57
 
58
+
59
+ add_action( 'admin_enqueue_scripts', array( $this, 'scripts' ) );
60
+
61
+
62
+
63
 
64
  }
65
  ////////////////////////////////////////////////////////////////////////////////////////
67
  ////////////////////////////////////////////////////////////////////////////////////////
68
  public function add_deactivation_feedback_dialog_box(){
69
  $deactivate_reasons = $this->deactivate_reasons;
70
+ $wd_options = $this->config;
71
+
72
+ ?>
73
+ <script>
74
+ jQuery(document).ready(function () {
75
+ wdReady("<?php echo $wd_options->prefix; ?>");
76
+ });
77
+ </script>
78
+ <?php
79
+ require ( $wd_options->wd_dir_templates . '/display_deactivation_popup.php' );
80
  }
81
 
82
+
83
+
84
  public function scripts(){
85
+ $wd_options = $this->config;
86
+ wp_enqueue_style( 'wd-deactivate-popup', $wd_options->wd_url_css . '/deactivate_popup.css', array(), get_option($wd_options->prefix . "_version" ) );
87
+ wp_enqueue_script( 'wd-deactivate-popup', $wd_options->wd_url_js . '/deactivate_popup.js', array(), get_option($wd_options->prefix . "_version" ));
88
+
89
  $admin_data = wp_get_current_user();
90
+ wp_localize_script( 'wd-deactivate-popup', $wd_options->prefix . 'WDDeactivateVars' , array(
91
  "prefix" => $wd_options->prefix ,
92
  "deactivate_class" => $wd_options->prefix . '_deactivate_link',
93
  "email" => $admin_data->data->user_email,
94
  "plugin_wd_url" => $wd_options->plugin_wd_url,
95
  ));
96
+
97
 
98
  }
99
  public function submit_and_deactivate(){
100
+ $wd_options = $this->config;
101
  if( isset( $_POST[$wd_options->prefix . "_submit_and_deactivate"] ) ){
102
 
103
  if( $_POST[$wd_options->prefix . "_submit_and_deactivate"] == 2 || $_POST[$wd_options->prefix . "_submit_and_deactivate"] == 3 ){
104
+ $api = new WebDoradoApi( $wd_options );
105
  $hash = $api->get_hash();
106
  if($hash != null){
107
  $data = array();
146
  ),
147
  admin_url( 'plugins.php' )
148
  );
149
+ echo '<script>window.location.href="' . $deactivate_url . '";</script>';
150
  }
151
 
152
  }
164
  ////////////////////////////////////////////////////////////////////////////////////////
165
 
166
  }
167
+
168
 
wd/includes/notices.php CHANGED
@@ -3,16 +3,17 @@
3
  exit;
4
  }
5
 
6
- class WDNotices {
7
 
8
  protected $promo_link = '';
9
 
 
10
  public $notice_spam = 0;
11
  public $notice_spam_max = 2;
12
 
13
  // Basic actions to run
14
- public function __construct() {
15
-
16
  // Runs the admin notice ignore function incase a dismiss button has been clicked
17
  add_action( 'admin_init', array( $this, 'admin_notice_ignore' ) );
18
  // Runs the admin notice temp ignore function incase a temp dismiss link has been clicked
@@ -22,7 +23,7 @@
22
 
23
  // Checks to ensure notices aren't disabled and the user has the correct permissions.
24
  public function wd_admin_notice() {
25
- global $wd_options;
26
  $settings = get_option($wd_options->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' ) ) {
@@ -34,7 +35,7 @@
34
 
35
  // Primary notice function that can be called from an outside function sending necessary variables
36
  public function admin_notice( $admin_notices ) {
37
- global $wd_options;
38
  // Check options
39
  if ( !$this->wd_admin_notice() ) {
40
  return false;
@@ -92,7 +93,7 @@
92
  if ( strpos($slug, 'promo' ) === FALSE ) {
93
  // Admin notice display output
94
  echo '<div class="update-nag wd-admin-notice">
95
- <div class="' . $wd_options->prefix . '-notice-logo"></div>
96
  <p class="wd-notice-title">' . $admin_display_title . '</p>
97
  <p class="wd-notice-body">' . $admin_display_msg . '</p>
98
  <ul class="wd-notice-body wd-blue">' . $admin_display_link . '</ul>
@@ -112,7 +113,7 @@
112
  $output_css = true;
113
  }
114
  if ( $output_css ) {
115
- wp_enqueue_style( $wd_options->prefix . '-admin-notices', WD_URL_CSS . '/notices.css', array(), get_option($wd_options->prefix . "_version" ) );
116
  }
117
  }
118
  }
@@ -128,7 +129,7 @@
128
 
129
  // Ignore function that gets ran at admin init to ensure any messages that were dismissed get marked
130
  public function admin_notice_ignore() {
131
- global $wd_options;
132
  // If user clicks to ignore the notice, update the option to not show it again
133
  if ( isset( $_GET[$wd_options->prefix . '_admin_notice_ignore'] ) ) {
134
  $admin_notices_option = get_option( $wd_options->prefix . '_admin_notice', array() );
@@ -142,7 +143,7 @@
142
 
143
  // Temp Ignore function that gets ran at admin init to ensure any messages that were temp dismissed get their start date changed
144
  public function admin_notice_temp_ignore() {
145
- global $wd_options;
146
  // If user clicks to temp ignore the notice, update the option to change the start date - default interval of 14 days
147
  if ( isset( $_GET[$wd_options->prefix . '_admin_notice_temp_ignore'] ) ) {
148
  $admin_notices_option = get_option( $wd_options->prefix . '_admin_notice', array() );
@@ -162,7 +163,7 @@
162
  }
163
 
164
  public function admin_notice_pages($pages) {
165
- global $wd_options;
166
  foreach ( $pages as $key => $page ) {
167
  if (is_array($page)) {
168
  if ( isset( $_GET['page'] ) && $_GET['page'] == $page[0] && isset($_GET['tab']) && $_GET['tab'] == $page[1] ) {
@@ -201,7 +202,7 @@
201
  }
202
 
203
  public function wd_admin_notices() {
204
- global $wd_options;
205
  $two_week_review_ignore = add_query_arg( array( $wd_options->prefix . '_admin_notice_ignore' => 'two_week_review' ) );
206
  $two_week_review_temp = add_query_arg( array( $wd_options->prefix . '_admin_notice_temp_ignore' => 'two_week_review', 'int' => 14 ) );
207
  $promo_close = add_query_arg( array( $wd_options->prefix . '_admin_notice_ignore' => 'ecommerce_promo' ) );
@@ -209,43 +210,14 @@
209
  $notices['two_week_review'] = array(
210
  'title' => __('Leave A Review?', $wd_options->prefix),
211
  '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),
212
- 'link' => '<li><span class="dashicons dashicons-external"></span><a href="https://wordpress.org/support/view/plugin-reviews/wd-google-maps?filter=5" target="_blank">' . __('Sure! I\'d love to!', $wd_options->prefix) . '</a></li>
213
  <li><span class="dashicons dashicons-smiley"></span><a href="' . $two_week_review_ignore . '"> ' . __('I\'ve already left a review', $wd_options->prefix) . '</a></li>
214
  <li><span class="dashicons dashicons-calendar-alt"></span><a href="' . $two_week_review_temp . '">' . __('Maybe Later', $wd_options->prefix) . '</a></li>
215
  <li><span class="dashicons dashicons-dismiss"></span><a href="' . $two_week_review_ignore . '">' . __('Never show again', $wd_options->prefix) . '</a></li>',
216
  'later_link' => $two_week_review_temp,
217
  'int' => 14
218
  );
219
- // $remote_agreement_data = get_transient( $wd_options->prefix . '_remote_data' );
220
- // if( isset( $remote_agreement_data["agreements"] ) && $remote_agreement_data["agreements"] ){
221
- // $date_diff = floor(strtotime(date("Y-m-d H:i:s")) - strtotime($remote_agreement_data["agreements"][0]["subscr_date"]))/3600/24;
222
- // if( ( $remote_agreement_data["agreements"][0]["item_name"] == $wd_options->wd_plugin_name_business || $remote_agreement_data["item_name"] == $wd_options->wd_plugin_name_personal ) && $date_diff <= 15 ){
223
- // $upsell_ignore = add_query_arg( array( $wd_options->prefix . '_admin_notice_ignore' => 'upsell_higher_plan' ) );
224
- // $upsell_ignore_temp = add_query_arg( array( $wd_options->prefix . '_admin_notice_temp_ignore' => 'upsell_higher_plan', 'wd_int' => 1 ) );
225
-
226
- // $notices['upsell_higher_plan'] = array(
227
- // 'title' => __( 'Buy Higher Price Plan', $wd_options->prefix ),
228
- // 'msg' => sprintf( __( 'We hope you\'ve enjoyed using WordPress %s! Would you consider buy higher price plan?', $wd_options->prefix ), $wd_options->plugin_title ),
229
- // 'link' => '<li><span class="dashicons dashicons-external"></span><a href="https://web-dorado.com/subscriptions.html" target="_blank">' . __( 'Sure! I\'d love to!', $wd_options->prefix ) . '</a></li>
230
- // <li><span class="dashicons dashicons-calendar-alt"></span><a href="' . $upsell_ignore_temp . '">' . __('Maybe Later', $wd_options->prefix ) . '</a></li>
231
- // <li><span class="dashicons dashicons-dismiss"></span><a href="' . $upsell_ignore . '">' . __( 'Never show again', $wd_options->prefix ) . '</a></li>',
232
- // 'later_link' => $upsell_ignore_temp,
233
- // 'int' => 1
234
- // );
235
- // }
236
- // }
237
- /*$one_week_support = add_query_arg(array($wd_options->prefix . '_admin_notice_ignore' => 'one_week_support'));
238
- $notices['one_week_support'] = array(
239
- 'title' => __('Hey! How\'s It Going?', $wd_options->prefix),
240
- 'msg' => sprintf(__('Thank you for using WordPress %s! We hope that you\'ve found everything you need, but if you have any questions:', $wd_options->prefix), $this->plugin_name),
241
- 'link' => '<li><span class="dashicons dashicons-media-text"></span><a target="_blank" href="https://web-dorado.com/wordpress-google-maps/installing.html">' . __('Check out User Guide', $wd_options->prefix) . '</a></li>
242
- <li><span class="dashicons dashicons-sos"></span><a target="_blank" href="https://web-dorado.com/forum/wordpress-google-maps-wd.html">' . __('Get Some Help', $wd_options->prefix) . '</a></li>
243
- <li><span class="dashicons dashicons-dismiss"></span><a href="' . $one_week_support . '">' . __('Never show again', $wd_options->prefix) . '</a></li>',
244
- 'int' => 7
245
- );*/
246
 
247
  $this->admin_notice($notices);
248
  }
249
  }
250
-
251
- new WDNotices();
3
  exit;
4
  }
5
 
6
+ class WebDoradoNotices {
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
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' ) ) {
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;
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>
97
  <p class="wd-notice-title">' . $admin_display_title . '</p>
98
  <p class="wd-notice-body">' . $admin_display_msg . '</p>
99
  <ul class="wd-notice-body wd-blue">' . $admin_display_link . '</ul>
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
  }
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() );
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() );
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] ) {
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' ) );
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
  }
 
 
wd/includes/overview.php CHANGED
@@ -3,7 +3,7 @@
3
  exit;
4
  }
5
 
6
- class WDOverview{
7
  ////////////////////////////////////////////////////////////////////////////////////////
8
  // Events //
9
  ////////////////////////////////////////////////////////////////////////////////////////
@@ -13,12 +13,15 @@
13
  ////////////////////////////////////////////////////////////////////////////////////////
14
  // Variables //
15
  ////////////////////////////////////////////////////////////////////////////////////////
 
16
  private $tabs = array();
 
17
  ////////////////////////////////////////////////////////////////////////////////////////
18
  // Constructor & Destructor //
19
  ////////////////////////////////////////////////////////////////////////////////////////
20
- public function __construct() {
21
- global $wd_options;
 
22
  $this->tabs = array(
23
  'welcome' => array(
24
  'name' => __( "Welcome", $wd_options->prefix ),
@@ -40,8 +43,8 @@
40
  'name' => __( "Submit Your Idea", $wd_options->prefix ),
41
  'view' => false
42
  ),
43
- 'https://web-dorado.com/support/solutions.html' => array(
44
- 'name' => __( "Solutions", $wd_options->prefix ),
45
  'view' => false
46
  )
47
  );
@@ -53,23 +56,23 @@
53
  // Public Methods //
54
  ////////////////////////////////////////////////////////////////////////////////////////
55
  public function display_overview_page(){
56
- global $wd_options;
57
  $tabs = $this->tabs;
58
- require_once( WD_DIR_TEMPLATES . "/display_overview.php" );
59
  }
60
  public function wd_overview_welcome(){
61
- global $wd_options;
62
  //http://api.wordpress.org/plugins/info/1.0/wd-google-maps
63
- require_once( WD_DIR_TEMPLATES . "/display_overview_welcome.php" );
64
- }
65
  public function wd_overview_user_guide(){
66
- global $wd_options;
67
  $user_guide = $wd_options->user_guide;
68
- require_once( WD_DIR_TEMPLATES . "/display_overview_user_guide.php" );
69
  }
70
  public function wd_overview_deals(){
71
 
72
- global $wd_options;
73
  $plugins = array(
74
  "form-maker" => array(
75
  'title' => 'Form Maker',
@@ -141,136 +144,137 @@
141
  ),
142
  );
143
 
144
- require_once( WD_DIR_TEMPLATES . "/display_overview_deals.php" );
145
  }
146
  public function wd_overview_support(){
147
- global $wpdb, $wd_options;
148
- $server_info = array();
149
-
150
- // Get PHP Version
151
- $server_info["Operating System"] = PHP_OS . " (" . ( PHP_INT_SIZE * 8 ) . ")";
152
- $server_info["PHP Version"] = PHP_VERSION;
153
- $server_info["Server"] = $_SERVER["SERVER_SOFTWARE"];
154
-
155
- // Get MYSQL Version
156
- $sql_version = $wpdb->get_var( "SELECT VERSION() AS version" );
157
- $server_info["MySQL Version"] = $sql_version;
158
-
159
- // GET SQL Mode
160
- $mysqlinfo = $wpdb->get_results( "SHOW VARIABLES LIKE 'sql_mode'" );
161
- if ( is_array( $mysqlinfo ) )
162
- $sql_mode = $mysqlinfo[0]->Value;
163
- if ( empty( $sql_mode ) )
164
- $sql_mode = __( 'Not set', $wd_options->prefix );
165
- $server_info["SQL Mode"] = $sql_mode;
166
-
167
- // Get PHP Safe Mode
168
- if( ini_get( 'safe_mode' ) )
169
- $safe_mode = __( 'On', $wd_options->prefix );
170
- else
171
- $safe_mode = __( 'Off', $wd_options->prefix );
172
- $server_info["PHP Safe Mode"] = $safe_mode;
173
-
174
- // Get PHP allow_url_fopen
175
- if( ini_get( 'allow_url_fopen' ) )
176
- $allow_url_fopen = __( 'On', $wd_options->prefix );
177
- else
178
- $allow_url_fopen = __( 'Off', $wd_options->prefix );
179
- $server_info["PHP Allow URL fopen"] = $allow_url_fopen;
180
-
181
- // Get PHP Max Upload Size
182
- if (function_exists('wp_max_upload_size'))
183
- $upload_max = strval(round((int) wp_max_upload_size() / (1024 * 1024))) . 'M';
184
- else if(ini_get('upload_max_filesize'))
185
- $upload_max = ini_get('upload_max_filesize');
186
- else
187
- $upload_max = __('N/A', $wd_options->prefix);
188
-
189
- $server_info["PHP Max Upload Size"] = $upload_max;
190
-
191
- // Get PHP Output buffer Size
192
- if( ini_get( 'pcre.backtrack_limit' ) )
193
- $backtrack_limit = ini_get( 'pcre.backtrack_limit' );
194
- else
195
- $backtrack_limit = __( 'N/A', $wd_options->prefix );
196
- $server_info["PCRE Backtracking Limit"] = $backtrack_limit;
197
-
198
- // Get PHP Max Post Size
199
- if( ini_get( 'post_max_size' ) )
200
- $post_max = ini_get( 'post_max_size' );
201
- else
202
- $post_max = __( 'N/A', $wd_options->prefix );
203
- $server_info["PHP Max Post Size"] = $post_max;
204
-
205
- // Get PHP Max execution time
206
- if( ini_get( 'max_execution_time' ) )
207
- $max_execute = ini_get( 'max_execution_time' );
208
- else
209
- $max_execute = __( 'N/A', $wd_options->prefix );
210
- $server_info["PHP Max Script Execute Time"] = $max_execute;
211
-
212
-
213
- // Get PHP Memory Limit
214
- if( ini_get( 'memory_limit' ) )
215
- $memory_limit = ini_get( 'memory_limit' );
216
- else
217
- $memory_limit = __( 'N/A', $wd_options->prefix );
218
- $server_info["PHP Memory Limit"] = $memory_limit;
219
-
220
- // Get actual memory_get_usage
221
- if ( function_exists( 'memory_get_usage' ) )
222
- $memory_usage = round( memory_get_usage() / 1024 / 1024, 2 ) . __( ' MByte', $wd_options->prefix );
223
- else
224
- $memory_usage = __( 'N/A', $wd_options->prefix );
225
- $server_info["Memory usage"] = $memory_usage;
226
-
227
- // required for EXIF read
228
- if ( is_callable( 'exif_read_data' ) )
229
- $exif = __( 'Yes', $wd_options->prefix ). " (V" . substr( phpversion( 'exif' ), 0, 4 ) . ")" ;
230
- else
231
- $exif = __( 'No', $wd_options->prefix );
232
- $server_info["PHP Exif support"] = $exif;
233
-
234
- // required for meta data
235
- if ( is_callable( 'iptcparse' ) )
236
- $iptc = __( 'Yes', $wd_options->prefix );
237
- else
238
- $iptc = __( 'No', $wd_options->prefix );
239
- $server_info["PHP IPTC support"] = $iptc;
240
-
241
- // required for meta data
242
- if ( is_callable( 'xml_parser_create' ) )
243
- $xml = __( 'Yes', $wd_options->prefix );
244
- else
245
- $xml = __( 'No', $wd_options->prefix );
246
- $server_info["PHP XML support"] = $xml;
247
-
248
- $gd_info = array( "GD support" => __( 'No', $wd_options->prefix ) );
249
- if( function_exists( "gd_info" ) ){
250
- $gd_info = array();
251
- foreach( gd_info() as $key => $val ){
252
- if( is_bool($val) ){
253
- $gd_info[$key] = $val ? __( 'Yes', $wd_options->prefix ) : __( 'No', $wd_options->prefix );
254
- }
255
- else{
256
- $gd_info[$key] = $val;
257
- }
258
- }
259
- }
 
260
 
261
- require_once( WD_DIR_TEMPLATES . "/display_overview_support.php" );
262
  }
263
 
264
  public function overview_styles() {
265
- global $wd_options;
266
  $version = get_option( $wd_options->prefix . "_version" );
267
- wp_enqueue_style( $wd_options->prefix . '_overview_css', WD_URL_CSS . '/overview.css', array(), $version );
268
 
269
  }
270
  public function overview_scripts() {
271
- global $wd_options;
272
  $version = get_option( $wd_options->prefix . "_version" );
273
- wp_enqueue_script( $wd_options->prefix . '_overview_js', WD_URL_JS . '/overview.js', array(), $version );
274
 
275
  }
276
  ////////////////////////////////////////////////////////////////////////////////////////
3
  exit;
4
  }
5
 
6
+ class WebDoradoOverview{
7
  ////////////////////////////////////////////////////////////////////////////////////////
8
  // Events //
9
  ////////////////////////////////////////////////////////////////////////////////////////
13
  ////////////////////////////////////////////////////////////////////////////////////////
14
  // Variables //
15
  ////////////////////////////////////////////////////////////////////////////////////////
16
+ public $config ;
17
  private $tabs = array();
18
+
19
  ////////////////////////////////////////////////////////////////////////////////////////
20
  // Constructor & Destructor //
21
  ////////////////////////////////////////////////////////////////////////////////////////
22
+ public function __construct( $config = array() ) {
23
+ $this->config = $config;
24
+ $wd_options = $this->config;
25
  $this->tabs = array(
26
  'welcome' => array(
27
  'name' => __( "Welcome", $wd_options->prefix ),
43
  'name' => __( "Submit Your Idea", $wd_options->prefix ),
44
  'view' => false
45
  ),
46
+ 'https://wordpress.org/support/plugin/' . $wd_options->plugin_wordpress_slug => array(
47
+ 'name' => __( "Forum", $wd_options->prefix ),
48
  'view' => false
49
  )
50
  );
56
  // Public Methods //
57
  ////////////////////////////////////////////////////////////////////////////////////////
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(){
64
+ $wd_options = $this->config;
65
  //http://api.wordpress.org/plugins/info/1.0/wd-google-maps
66
+ require_once( $wd_options->wd_dir_templates . "/display_overview_welcome.php" );
67
+ }
68
  public function wd_overview_user_guide(){
69
+ $wd_options = $this->config;
70
  $user_guide = $wd_options->user_guide;
71
+ require_once( $wd_options->wd_dir_templates . "/display_overview_user_guide.php" );
72
  }
73
  public function wd_overview_deals(){
74
 
75
+ $wd_options = $this->config;
76
  $plugins = array(
77
  "form-maker" => array(
78
  'title' => 'Form Maker',
144
  ),
145
  );
146
 
147
+ require_once( $wd_options->wd_dir_templates . "/display_overview_deals.php" );
148
  }
149
  public function wd_overview_support(){
150
+ $wd_options = $this->config;
151
+ global $wpdb;
152
+ $server_info = array();
153
+
154
+ // Get PHP Version
155
+ $server_info["Operating System"] = PHP_OS . " (" . ( PHP_INT_SIZE * 8 ) . ")";
156
+ $server_info["PHP Version"] = PHP_VERSION;
157
+ $server_info["Server"] = $_SERVER["SERVER_SOFTWARE"];
158
+
159
+ // Get MYSQL Version
160
+ $sql_version = $wpdb->get_var( "SELECT VERSION() AS version" );
161
+ $server_info["MySQL Version"] = $sql_version;
162
+
163
+ // GET SQL Mode
164
+ $mysqlinfo = $wpdb->get_results( "SHOW VARIABLES LIKE 'sql_mode'" );
165
+ if ( is_array( $mysqlinfo ) )
166
+ $sql_mode = $mysqlinfo[0]->Value;
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' ) )
180
+ $allow_url_fopen = __( 'On', $wd_options->prefix );
181
+ else
182
+ $allow_url_fopen = __( 'Off', $wd_options->prefix );
183
+ $server_info["PHP Allow URL fopen"] = $allow_url_fopen;
184
+
185
+ // Get PHP Max Upload Size
186
+ if (function_exists('wp_max_upload_size'))
187
+ $upload_max = strval(round((int) wp_max_upload_size() / (1024 * 1024))) . 'M';
188
+ else if(ini_get('upload_max_filesize'))
189
+ $upload_max = ini_get('upload_max_filesize');
190
+ else
191
+ $upload_max = __('N/A', $wd_options->prefix);
192
+
193
+ $server_info["PHP Max Upload Size"] = $upload_max;
194
+
195
+ // Get PHP Output buffer Size
196
+ if( ini_get( 'pcre.backtrack_limit' ) )
197
+ $backtrack_limit = ini_get( 'pcre.backtrack_limit' );
198
+ else
199
+ $backtrack_limit = __( 'N/A', $wd_options->prefix );
200
+ $server_info["PCRE Backtracking Limit"] = $backtrack_limit;
201
+
202
+ // Get PHP Max Post Size
203
+ if( ini_get( 'post_max_size' ) )
204
+ $post_max = ini_get( 'post_max_size' );
205
+ else
206
+ $post_max = __( 'N/A', $wd_options->prefix );
207
+ $server_info["PHP Max Post Size"] = $post_max;
208
+
209
+ // Get PHP Max execution time
210
+ if( ini_get( 'max_execution_time' ) )
211
+ $max_execute = ini_get( 'max_execution_time' );
212
+ else
213
+ $max_execute = __( 'N/A', $wd_options->prefix );
214
+ $server_info["PHP Max Script Execute Time"] = $max_execute;
215
+
216
+
217
+ // Get PHP Memory Limit
218
+ if( ini_get( 'memory_limit' ) )
219
+ $memory_limit = ini_get( 'memory_limit' );
220
+ else
221
+ $memory_limit = __( 'N/A', $wd_options->prefix );
222
+ $server_info["PHP Memory Limit"] = $memory_limit;
223
+
224
+ // Get actual memory_get_usage
225
+ if ( function_exists( 'memory_get_usage' ) )
226
+ $memory_usage = round( memory_get_usage() / 1024 / 1024, 2 ) . __( ' MByte', $wd_options->prefix );
227
+ else
228
+ $memory_usage = __( 'N/A', $wd_options->prefix );
229
+ $server_info["Memory usage"] = $memory_usage;
230
+
231
+ // required for EXIF read
232
+ if ( is_callable( 'exif_read_data' ) )
233
+ $exif = __( 'Yes', $wd_options->prefix ). " (V" . substr( phpversion( 'exif' ), 0, 4 ) . ")" ;
234
+ else
235
+ $exif = __( 'No', $wd_options->prefix );
236
+ $server_info["PHP Exif support"] = $exif;
237
+
238
+ // required for meta data
239
+ if ( is_callable( 'iptcparse' ) )
240
+ $iptc = __( 'Yes', $wd_options->prefix );
241
+ else
242
+ $iptc = __( 'No', $wd_options->prefix );
243
+ $server_info["PHP IPTC support"] = $iptc;
244
+
245
+ // required for meta data
246
+ if ( is_callable( 'xml_parser_create' ) )
247
+ $xml = __( 'Yes', $wd_options->prefix );
248
+ else
249
+ $xml = __( 'No', $wd_options->prefix );
250
+ $server_info["PHP XML support"] = $xml;
251
+
252
+ $gd_info = array( "GD support" => __( 'No', $wd_options->prefix ) );
253
+ if( function_exists( "gd_info" ) ){
254
+ $gd_info = array();
255
+ foreach( gd_info() as $key => $val ){
256
+ if( is_bool($val) ){
257
+ $gd_info[$key] = $val ? __( 'Yes', $wd_options->prefix ) : __( 'No', $wd_options->prefix );
258
+ }
259
+ else{
260
+ $gd_info[$key] = $val;
261
+ }
262
+ }
263
+ }
264
 
265
+ require_once( $wd_options->wd_dir_templates . "/display_overview_support.php" );
266
  }
267
 
268
  public function overview_styles() {
269
+ $wd_options = $this->config;
270
  $version = get_option( $wd_options->prefix . "_version" );
271
+ wp_enqueue_style( $wd_options->prefix . '_overview_css', $wd_options->wd_url_css . '/overview.css', array(), $version );
272
 
273
  }
274
  public function overview_scripts() {
275
+ $wd_options = $this->config;
276
  $version = get_option( $wd_options->prefix . "_version" );
277
+ wp_enqueue_script( $wd_options->prefix . '_overview_js', $wd_options->wd_url_js . '/overview.js', array(), $version );
278
 
279
  }
280
  ////////////////////////////////////////////////////////////////////////////////////////
wd/includes/subscribe.php CHANGED
@@ -2,7 +2,7 @@
2
  if ( ! defined( 'ABSPATH' ) ) {
3
  exit;
4
  }
5
- class WDSubscribe {
6
  // //////////////////////////////////////////////////////////////////////////////////////
7
  // Events //
8
  // //////////////////////////////////////////////////////////////////////////////////////
@@ -12,10 +12,12 @@
12
  // //////////////////////////////////////////////////////////////////////////////////////
13
  // Variables //
14
  // //////////////////////////////////////////////////////////////////////////////////////
 
15
  // //////////////////////////////////////////////////////////////////////////////////////
16
  // Constructor & Destructor //
17
  // //////////////////////////////////////////////////////////////////////////////////////
18
- public function __construct(){
 
19
  add_action( 'admin_init', array( $this, 'after_subscribe' ) );
20
  }
21
  // //////////////////////////////////////////////////////////////////////////////////////
@@ -23,44 +25,45 @@
23
  // //////////////////////////////////////////////////////////////////////////////////////
24
 
25
  public function subscribe_scripts() {
26
- global $wd_options;
27
- wp_register_script ( 'subscribe_js', WD_URL_JS . '/subsribe.js' );
28
  wp_enqueue_script ( 'subscribe_js' );
29
 
30
  }
31
  public function subscribe_styles() {
32
- global $wd_options;
33
- wp_enqueue_style( $wd_options->prefix . 'subscribe', WD_URL_CSS . '/subscribe.css' );
34
 
35
  }
36
 
37
  public function subscribe_display_page() {
38
- global $wd_options;
39
  $list = array(
40
  0 => array(
41
  "title" => __( "Your name &", $wd_options->prefix ),
42
  "small_text" => __( "Email address", $wd_options->prefix ),
43
- "img" => WD_URL_IMG . '/sub_1.png',
44
  ),
45
  1 => array(
46
  "title" => __( "Site URL", $wd_options->prefix ),
47
  "small_text" => __( "Wordpress version", $wd_options->prefix ),
48
- "img" => WD_URL_IMG . '/sub_2.png',
49
  ),
50
  2 => array(
51
  "title" => __( "List of plugins", $wd_options->prefix ),
52
  "small_text" => "",
53
- "img" => WD_URL_IMG . '/sub_4.png',
54
  ),
55
  );
56
 
57
- require_once ( WD_DIR_TEMPLATES . "/display_subscribe.php" );
58
  }
59
  public function after_subscribe(){
60
- if( isset( $_GET["sub_action"] ) ){
61
- global $wd_options;
62
- if( $_GET["sub_action"] == "allow" ){
63
- $api = new WDApi();
 
64
  $hash = $api->get_hash();
65
 
66
  if( $hash != null ){
2
  if ( ! defined( 'ABSPATH' ) ) {
3
  exit;
4
  }
5
+ class WebDoradoSubscribe {
6
  // //////////////////////////////////////////////////////////////////////////////////////
7
  // Events //
8
  // //////////////////////////////////////////////////////////////////////////////////////
12
  // //////////////////////////////////////////////////////////////////////////////////////
13
  // Variables //
14
  // //////////////////////////////////////////////////////////////////////////////////////
15
+ public $config;
16
  // //////////////////////////////////////////////////////////////////////////////////////
17
  // Constructor & Destructor //
18
  // //////////////////////////////////////////////////////////////////////////////////////
19
+ public function __construct( $config = array() ){
20
+ $this->config = $config;
21
  add_action( 'admin_init', array( $this, 'after_subscribe' ) );
22
  }
23
  // //////////////////////////////////////////////////////////////////////////////////////
25
  // //////////////////////////////////////////////////////////////////////////////////////
26
 
27
  public function subscribe_scripts() {
28
+ $wd_options = $this->config;
29
+ wp_register_script ( 'subscribe_js', $wd_options->wd_url_js . '/subsribe.js' );
30
  wp_enqueue_script ( 'subscribe_js' );
31
 
32
  }
33
  public function subscribe_styles() {
34
+ $wd_options = $this->config;
35
+ wp_enqueue_style( $wd_options->prefix . 'subscribe', $wd_options->wd_url_css . '/subscribe.css' );
36
 
37
  }
38
 
39
  public function subscribe_display_page() {
40
+ $wd_options = $this->config;
41
  $list = array(
42
  0 => array(
43
  "title" => __( "Your name &", $wd_options->prefix ),
44
  "small_text" => __( "Email address", $wd_options->prefix ),
45
+ "img" => $wd_options->wd_url_img . '/sub_1.png',
46
  ),
47
  1 => array(
48
  "title" => __( "Site URL", $wd_options->prefix ),
49
  "small_text" => __( "Wordpress version", $wd_options->prefix ),
50
+ "img" => $wd_options->wd_url_img . '/sub_2.png',
51
  ),
52
  2 => array(
53
  "title" => __( "List of plugins", $wd_options->prefix ),
54
  "small_text" => "",
55
+ "img" => $wd_options->wd_url_img . '/sub_4.png',
56
  ),
57
  );
58
 
59
+ require_once ( $wd_options->wd_dir_templates . "/display_subscribe.php" );
60
  }
61
  public function after_subscribe(){
62
+ $wd_options = $this->config;
63
+ if( isset( $_GET[ $wd_options->prefix . "_sub_action"] ) ){
64
+
65
+ if( $_GET[$wd_options->prefix . "_sub_action"] == "allow" ){
66
+ $api = new WebDoradoApi($wd_options);
67
  $hash = $api->get_hash();
68
 
69
  if( $hash != null ){
wd/require.php DELETED
@@ -1,14 +0,0 @@
1
- <?php
2
- if ( ! defined( 'ABSPATH' ) ) {
3
- exit;
4
- }
5
- // configuration should be loaded first.
6
- require_once dirname( __FILE__ ) . '/config.php';
7
-
8
- // load other files
9
- require_once WD_DIR . '/wd.php';
10
- // notices
11
- require_once WD_DIR_INCLUDES . '/api.php';
12
- require_once WD_DIR_INCLUDES . '/notices.php';
13
-
14
-
 
 
 
 
 
 
 
 
 
 
 
 
 
 
wd/start.php CHANGED
@@ -2,29 +2,36 @@
2
  if ( ! defined( 'ABSPATH' ) ) {
3
  exit;
4
  }
 
 
5
 
6
-
7
- // load files
8
- require_once dirname( __FILE__ ) . '/require.php';
9
-
10
  /**
11
  * @param options for Plugin details.
12
  * prefix;
13
  * wd_plugin_id;
14
  * plugin_title;
15
- * plugin_dir;
16
- * plugin_url;
17
- * wd_plugin_name_personal;
18
- * wd_plugin_name_business;
19
- * wd_plugin_name_developer;
20
- * description;
21
- * addons;
22
  * plugin_features;
23
  * user_guide;
 
 
 
 
 
 
 
 
 
24
  */
25
 
26
- function wd_init( $options ) {
27
- $wd = WD::get_instance();
 
 
 
 
28
  $wd->wd_init( $options );
29
 
30
  }
2
  if ( ! defined( 'ABSPATH' ) ) {
3
  exit;
4
  }
5
+ define( 'WEB_DORADO_API_PLUGIN_DATA_PATH', 'http://api.web-dorado.com/v2/_id_/plugindata' );
6
+ require_once dirname( __FILE__ ) . '/config.php';
7
 
 
 
 
 
8
  /**
9
  * @param options for Plugin details.
10
  * prefix;
11
  * wd_plugin_id;
12
  * plugin_title;
13
+ * plugin_dir;
14
+ * plugin_main_file;
15
+ * description;
 
 
 
 
16
  * plugin_features;
17
  * user_guide;
18
+ * video_youtube_id;
19
+ * plugin_wd_url;
20
+ * plugin_wd_demo_link;
21
+ * plugin_wd_addons_link;
22
+ * plugin_wizard_link;
23
+ * after_subscribe;
24
+ * plugin_menu_title;
25
+ * plugin_menu_icon;
26
+ * custom_post;
27
  */
28
 
29
+ function web_dorado_init( $options ) {
30
+
31
+ // load files
32
+ require_once dirname( __FILE__ ) . '/wd.php';
33
+
34
+ $wd = new WebDorado();
35
  $wd->wd_init( $options );
36
 
37
  }
wd/templates/display_deactivation_popup.php CHANGED
@@ -19,6 +19,7 @@
19
  <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>
20
  <a href="#" class="button button-primary wd-<?php echo $wd_options->prefix; ?>-cancel"><?php _e( "Cancel" , $wd_options->prefix ); ?></a>
21
  </div>
22
- <input type="hidden" name="<?php echo $wd_options->prefix . "_submit_and_deactivate"; ?>" value="" >
 
23
  </form>
24
  </div>
19
  <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>
20
  <a href="#" class="button button-primary wd-<?php echo $wd_options->prefix; ?>-cancel"><?php _e( "Cancel" , $wd_options->prefix ); ?></a>
21
  </div>
22
+ <input type="hidden" name="<?php echo $wd_options->prefix . "_submit_and_deactivate"; ?>" value="" >
23
+ <?php wp_nonce_field( $wd_options->prefix . '_save_form', $wd_options->prefix . '_save_form_fild'); ?>
24
  </form>
25
  </div>
wd/templates/display_overview.php CHANGED
@@ -1,6 +1,6 @@
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_URL_IMG . '/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>
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>
wd/templates/display_overview_deals.php CHANGED
@@ -5,7 +5,7 @@
5
  <a href="https://web-dorado.com/wordpress-plugins-bundle.html" target="_blank">
6
  <div class="wd-table">
7
  <div class="wd-cell wd-text-right wd-valign-middle">
8
- <img src="<?php echo WD_URL_IMG . '/main_plugin.png'; ?>" width="100px">
9
  </div>
10
  <div class="wd-cell wd-valign-middle">
11
  <div class="titles_wrap">
@@ -24,7 +24,7 @@
24
  <div class="deal_block">
25
  <div class="deal_title">
26
  <a href="<?php echo $plugin["href"]; ?>" target="_blank" >
27
- <img src = "<?php echo WD_URL_IMG . '/plugins/' . $wp_slug . '.png'; ?>">
28
  <h2><?php echo $plugin["title"]; ?></h2>
29
  </a>
30
  </div>
@@ -73,7 +73,7 @@
73
  <?php foreach( $themes as $slug => $theme ){ ?>
74
  <div class="theme_block">
75
  <a href="<?php echo $theme["href"]; ?>" target="_blank" >
76
- <img src = "<?php echo WD_URL_IMG . '/plugins/' . $slug . '.png'; ?>" width="100%;">
77
  <div><?php echo $theme["title"]; ?></div>
78
  </a>
79
  </div>
5
  <a href="https://web-dorado.com/wordpress-plugins-bundle.html" target="_blank">
6
  <div class="wd-table">
7
  <div class="wd-cell wd-text-right wd-valign-middle">
8
+ <img src="<?php echo $wd_options->wd_url_img . '/' . $wd_options->prefix . '_main_plugin.png'; ?>" width="100px">
9
  </div>
10
  <div class="wd-cell wd-valign-middle">
11
  <div class="titles_wrap">
24
  <div class="deal_block">
25
  <div class="deal_title">
26
  <a href="<?php echo $plugin["href"]; ?>" target="_blank" >
27
+ <img src = "<?php echo $wd_options->wd_url_img . '/plugins/' . $wp_slug . '.png'; ?>">
28
  <h2><?php echo $plugin["title"]; ?></h2>
29
  </a>
30
  </div>
73
  <?php foreach( $themes as $slug => $theme ){ ?>
74
  <div class="theme_block">
75
  <a href="<?php echo $theme["href"]; ?>" target="_blank" >
76
+ <img src = "<?php echo $wd_options->wd_url_img . '/plugins/' . $slug . '.png'; ?>" width="100%;">
77
  <div><?php echo $theme["title"]; ?></div>
78
  </a>
79
  </div>
wd/templates/display_overview_user_guide.php CHANGED
@@ -21,22 +21,25 @@
21
  <?php } ?>
22
  </div>
23
  <div class="wd-cell">
24
- <a href="<?php echo $wd_options->plugin_wd_demo_link; ?>" class="user_guide_demo" target="_blank">
25
- <?php _e( "Demo", $wd_options->prefix ); ?>
26
- </a>
 
 
27
  <a href="<?php echo $wd_options->plugin_wd_url; ?>" class="user_guide_plugin" target="_blank">
28
  <?php echo $wd_options->plugin_title; ?>
29
  </a>
30
- <a href="<?php echo $wd_options->plugin_wd_forum_link; ?>" class="user_guide_support_forum" target="_blank">
31
  <?php _e( "Support Forum", $wd_options->prefix ); ?>
32
  </a>
33
  <a href="https://web-dorado.com/support/faq.html" class="user_guide_faq" target="_blank">
34
  <?php _e( "FAQ", $wd_options->prefix ); ?>
35
- </a>
36
- <a href="<?php echo $wd_options->plugin_wd_addons_link; ?>" class="user_guide_addons" target="_blank">
37
- <?php _e( "Addons", $wd_options->prefix ); ?>
38
  </a>
39
-
 
 
 
 
40
  </div>
41
  </div>
42
  </div>
21
  <?php } ?>
22
  </div>
23
  <div class="wd-cell">
24
+ <?php if($wd_options->plugin_wd_demo_link) { ?>
25
+ <a href="<?php echo $wd_options->plugin_wd_demo_link; ?>" class="user_guide_demo" target="_blank">
26
+ <?php _e( "Demo", $wd_options->prefix ); ?>
27
+ </a>
28
+ <?php } ?>
29
  <a href="<?php echo $wd_options->plugin_wd_url; ?>" class="user_guide_plugin" target="_blank">
30
  <?php echo $wd_options->plugin_title; ?>
31
  </a>
32
+ <a href="https://wordpress.org/support/plugin/<?php echo $wd_options->plugin_wordpress_slug; ?>" class="user_guide_support_forum" target="_blank">
33
  <?php _e( "Support Forum", $wd_options->prefix ); ?>
34
  </a>
35
  <a href="https://web-dorado.com/support/faq.html" class="user_guide_faq" target="_blank">
36
  <?php _e( "FAQ", $wd_options->prefix ); ?>
 
 
 
37
  </a>
38
+ <?php if($wd_options->plugin_wd_addons_link) { ?>
39
+ <a href="<?php echo $wd_options->plugin_wd_addons_link; ?>" class="user_guide_addons" target="_blank">
40
+ <?php _e( "Addons", $wd_options->prefix ); ?>
41
+ </a>
42
+ <?php } ?>
43
  </div>
44
  </div>
45
  </div>
wd/templates/display_overview_welcome.php CHANGED
@@ -6,10 +6,12 @@
6
 
7
  <!-- display plugin features -->
8
  <div class="plugin_features">
9
- <!-- if your plugin has a wizard-->
10
- <div class="wd-tour">
11
- <a class="wd-tour-btn" href="<?php echo admin_url( 'index.php?page=gmwd_setup' );?>"><?php _e( "Run Install Wizard ",$wd_options->prefix); ?></a>
12
- </div>
 
 
13
  <?php foreach( $wd_options->plugin_features as $feature ){ ?>
14
  <h2 class="plugin_feature_title"><?php echo $feature["title"]; ?></h2>
15
  <div class="plugin_feature_description"><?php echo $feature["description"]; ?></div>
6
 
7
  <!-- display plugin features -->
8
  <div class="plugin_features">
9
+ <!-- if your plugin has a wizard-->
10
+ <?php if( $wd_options->plugin_wizard_link ) { ?>
11
+ <div class="wd-tour">
12
+ <a class="wd-tour-btn" href="<?php echo $wd_options->plugin_wizard_link;?>"><?php _e( "Run Install Wizard ",$wd_options->prefix); ?></a>
13
+ </div>
14
+ <?php } ?>
15
  <?php foreach( $wd_options->plugin_features as $feature ){ ?>
16
  <h2 class="plugin_feature_title"><?php echo $feature["title"]; ?></h2>
17
  <div class="plugin_feature_description"><?php echo $feature["description"]; ?></div>
wd/templates/display_subscribe.php CHANGED
@@ -1,9 +1,9 @@
1
  <div class="wd-subscribe">
2
  <div class="wd-subscribe-content">
3
  <div class="imgs">
4
- <img src="<?php echo WD_URL_IMG . '/wp_logo.png'; ?>">
5
  <span>+</span>
6
- <img src="<?php echo WD_URL_IMG . '/main_plugin.png'; ?>">
7
  </div>
8
  <div class="texts">
9
  <p><?php _e( "Hi there", $wd_options->prefix ); ?>,</p>
@@ -12,9 +12,9 @@
12
  </p>
13
  </div>
14
  <div class="btns">
15
- <a href="<?php echo "admin.php?page=" . $wd_options->prefix . "_subscribe&sub_action=allow" ;?>" class="allow_and_continue"></a>
16
- <img src="<?php echo WD_URL_IMG . '/loader.gif';?>" class="wd_loader">
17
- <a href="<?php echo "admin.php?page=" . $wd_options->prefix . "_subscribe&sub_action=skip" ;?>" class="skip" ></a>
18
  </div>
19
  <a href="#" class="permissions"><?php _e( "What data is being collected?" , $wd_options->prefix ); ?></a>
20
  <div class="list">
1
  <div class="wd-subscribe">
2
  <div class="wd-subscribe-content">
3
  <div class="imgs">
4
+ <img src="<?php echo $wd_options->wd_url_img . '/wp_logo.png'; ?>">
5
  <span>+</span>
6
+ <img src="<?php echo $wd_options->wd_url_img . '/' . $wd_options->prefix . '_main_plugin.png'; ?>">
7
  </div>
8
  <div class="texts">
9
  <p><?php _e( "Hi there", $wd_options->prefix ); ?>,</p>
12
  </p>
13
  </div>
14
  <div class="btns">
15
+ <a href="<?php echo "admin.php?page=" . $wd_options->prefix . "_subscribe&". $wd_options->prefix . "_sub_action=allow" ;?>" class="allow_and_continue"></a>
16
+ <img src="<?php echo $wd_options->wd_url_img . '/loader.gif';?>" class="wd_loader">
17
+ <a href="<?php echo "admin.php?page=" . $wd_options->prefix . "_subscribe&" . $wd_options->prefix . "_sub_action=skip" ;?>" class="skip" ></a>
18
  </div>
19
  <a href="#" class="permissions"><?php _e( "What data is being collected?" , $wd_options->prefix ); ?></a>
20
  <div class="list">
wd/wd.php CHANGED
@@ -3,7 +3,7 @@
3
  exit;
4
  }
5
 
6
- class WD{
7
  ////////////////////////////////////////////////////////////////////////////////////////
8
  // Events //
9
  ////////////////////////////////////////////////////////////////////////////////////////
@@ -15,126 +15,68 @@
15
  ////////////////////////////////////////////////////////////////////////////////////////
16
  public static $instance;
17
  public $overview_instance;
18
- public $subscribe_instance;
 
 
19
 
20
  ////////////////////////////////////////////////////////////////////////////////////////
21
  // Constructor & Destructor //
22
  ////////////////////////////////////////////////////////////////////////////////////////
23
- protected function __construct() {
24
  // Add menu for Overview page
25
- add_action( 'admin_menu', array( $this, 'wd_overview_menu_page' ), 10 );
26
 
27
  }
28
  ////////////////////////////////////////////////////////////////////////////////////////
29
  // Public Methods //
30
  ////////////////////////////////////////////////////////////////////////////////////////
31
 
32
- // Return an instance of this class.
33
- public static function get_instance() {
34
- if ( null == self::$instance ) {
35
- self::$instance = new self;
36
- }
37
- return self::$instance;
38
- }
39
-
40
  // Init plugin data
41
  public function wd_init( $options ) {
 
42
  if(!is_array($options)){
43
  return false;
44
  }
45
- global $wd_options;
46
-
47
- if(isset( $options["prefix"] )) {
48
- $wd_options->prefix = $options["prefix"];
49
- }
50
- if(isset( $options["wd_plugin_id"] )) {
51
- $wd_options->wd_plugin_id = $options["wd_plugin_id"];
52
- }
53
-
54
- if(isset( $options["plugin_title"] )) {
55
- $wd_options->plugin_title = $options["plugin_title"];
56
- }
57
- if(isset( $options["plugin_wordpress_slug"] )) {
58
- $wd_options->plugin_wordpress_slug = $options["plugin_wordpress_slug"];
59
- }
60
- if(isset( $options["plugin_dir"] )) {
61
- $wd_options->plugin_dir = $options["plugin_dir"];
62
- }
63
- if(isset( $options["plugin_url"] )) {
64
- $wd_options->plugin_url = $options["plugin_url"];
65
- }
66
- if(isset( $options["plugin_main_file"] )) {
67
- $wd_options->plugin_main_file = $options["plugin_main_file"];
68
- }
69
-
70
- if(isset( $options["wd_plugin_name_personal"] )) {
71
- $wd_options->wd_plugin_name_personal = $options["wd_plugin_name_personal"];
72
- }
73
- if(isset( $options["wd_plugin_name_business"] )) {
74
- $wd_options->wd_plugin_name_business = $options["wd_plugin_name_business"];
75
- }
76
- if(isset( $options["wd_plugin_name_developer"] )) {
77
- $wd_options->wd_plugin_name_developer = $options["wd_plugin_name_developer"];
78
- }
79
-
80
- if(isset( $options["description"] )) {
81
- $wd_options->description = $options["description"];
82
- }
83
- if(isset( $options["addons"] )) {
84
- $wd_options->addons = $options["addons"];
85
- }
86
- if(isset( $options["plugin_features"] )) {
87
- $wd_options->plugin_features = $options["plugin_features"];
88
- }
89
- if(isset( $options["user_guide"] )) {
90
- $wd_options->user_guide = $options["user_guide"];
91
- }
92
- if(isset( $options["video_youtube_id"] )) {
93
- $wd_options->video_youtube_id = $options["video_youtube_id"];
94
- }
95
- if(isset( $options["plugin_wd_url"] )) {
96
- $wd_options->plugin_wd_url = $options["plugin_wd_url"];
97
- }
98
- if(isset( $options["plugin_wd_demo_link"] )) {
99
- $wd_options->plugin_wd_demo_link = $options["plugin_wd_demo_link"];
100
- }
101
- if(isset( $options["plugin_wd_forum_link"] )) {
102
- $wd_options->plugin_wd_forum_link = $options["plugin_wd_forum_link"];
103
- }
104
- if(isset( $options["plugin_wd_addons_link"] )) {
105
- $wd_options->plugin_wd_addons_link = $options["plugin_wd_addons_link"];
106
- }
107
- if(isset( $options["after_subscribe"] )) {
108
- $wd_options->after_subscribe = $options["after_subscribe"];
109
- }
110
 
111
  $this->wd_includes();
112
  $this->register_hooks();
 
113
  }
114
 
115
  // Create overview menu page
116
  public function wd_overview_menu_page() {
117
- global $wd_options;
118
-
119
- if( get_option( $wd_options->prefix . "_subscribe_done" ) == 1 ){
120
- $overview_page = add_menu_page( 'Google Maps WD', 'Google Maps WD', 'manage_options', 'overview_' . $wd_options->prefix , array( $this, 'display_overview_page' ), $wd_options->plugin_url . '/images/icon-map-20.png', 11 );
121
- $parent_slug = 'overview_' . $wd_options->prefix;
122
- }
123
- else{
124
- $subscribe_page = add_menu_page( 'Google Maps WD', 'Google Maps WD', 'manage_options', $wd_options->prefix . '_subscribe' , array( $this, 'display_subscribew_page' ), $wd_options->plugin_url . '/images/icon-map-20.png', 11 );
125
-
126
- require_once ( WD_DIR_INCLUDES . "/subscribe.php" );
127
- $subscribe_instance = new WDSubscribe();
128
- $this->subscribe_instance = $subscribe_instance;
129
- add_action( 'admin_print_styles-' . $subscribe_page, array( $subscribe_instance, 'subscribe_styles' ) );
130
- add_action( 'admin_print_scripts-' . $subscribe_page, array( $subscribe_instance, 'subscribe_scripts' ) );
131
-
132
- $parent_slug = null;
133
- }
 
 
 
 
 
 
 
 
134
  $overview_page = add_submenu_page( $parent_slug, __( 'Overview', $wd_options->prefix ), __( 'Overview', $wd_options->prefix ), 'manage_options', 'overview_' . $wd_options->prefix, array( $this, 'display_overview_page' ));
135
 
136
- require_once ( WD_DIR_INCLUDES . "/overview.php" );
137
- $overview_instance = new WDOverview();
138
  $this->overview_instance = $overview_instance;
139
  add_action( 'admin_print_styles-' . $overview_page, array( $overview_instance, 'overview_styles' ) );
140
  add_action( 'admin_print_scripts-' . $overview_page, array( $overview_instance, 'overview_scripts' ) );
@@ -152,27 +94,37 @@
152
 
153
  // Includs
154
  public function wd_includes(){
155
- global $wd_options;
 
156
  $current_url = $_SERVER['REQUEST_URI'];
157
- if(strpos( $current_url, "plugins.php" ) !== false ){
158
- require_once( WD_DIR_INCLUDES . '/deactivate.php' );
159
- }
 
 
 
 
 
 
 
 
160
  }
161
 
162
  public function register_hooks(){
163
- global $wd_options;
164
-
165
- add_filter( 'plugin_action_links_' . plugin_basename( $wd_options->plugin_main_file ), array( $this, 'change_deactivation_link' ) );
 
166
 
167
  }
168
 
169
 
170
  public function change_deactivation_link ( $links ) {
171
- global $wd_options;
172
-
173
  $links["deactivate"] = '<a href="#" class="' . $wd_options->prefix . '_deactivate_link">Deactivate</a>';
174
  return $links;
175
- }
 
176
  ////////////////////////////////////////////////////////////////////////////////////////
177
  // Getters & Setters //
178
  ////////////////////////////////////////////////////////////////////////////////////////
3
  exit;
4
  }
5
 
6
+ class WebDorado {
7
  ////////////////////////////////////////////////////////////////////////////////////////
8
  // Events //
9
  ////////////////////////////////////////////////////////////////////////////////////////
15
  ////////////////////////////////////////////////////////////////////////////////////////
16
  public static $instance;
17
  public $overview_instance;
18
+ public $subscribe_instance;
19
+ public $config;
20
+ private $version = "1.0.0";
21
 
22
  ////////////////////////////////////////////////////////////////////////////////////////
23
  // Constructor & Destructor //
24
  ////////////////////////////////////////////////////////////////////////////////////////
25
+ public function __construct() {
26
  // Add menu for Overview page
27
+ add_action( 'admin_menu', array( $this, 'wd_overview_menu_page' ), 10 );
28
 
29
  }
30
  ////////////////////////////////////////////////////////////////////////////////////////
31
  // Public Methods //
32
  ////////////////////////////////////////////////////////////////////////////////////////
33
 
 
 
 
 
 
 
 
 
34
  // Init plugin data
35
  public function wd_init( $options ) {
36
+
37
  if(!is_array($options)){
38
  return false;
39
  }
40
+ $config = new WDConfig();
41
+ $config->set_options( $options );
42
+ $this->config = $config;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
43
 
44
  $this->wd_includes();
45
  $this->register_hooks();
46
+
47
  }
48
 
49
  // Create overview menu page
50
  public function wd_overview_menu_page() {
51
+ $wd_options = $this->config;
52
+
53
+ if( get_option( $wd_options->prefix . "_subscribe_done" ) == 1 || $wd_options->subscribe === false ){
54
+ if( !$wd_options->custom_post ){
55
+ $overview_page = add_menu_page( $wd_options->plugin_menu_title, $wd_options->plugin_menu_title, 'manage_options', 'overview_' . $wd_options->prefix , array( $this, 'display_overview_page' ), $wd_options->plugin_menu_icon, 11 );
56
+ $parent_slug = 'overview_' . $wd_options->prefix;
57
+ }
58
+ else{
59
+ $parent_slug = $wd_options->custom_post;
60
+ }
61
+
62
+ }
63
+ else{
64
+
65
+ $subscribe_page = add_menu_page( $wd_options->plugin_menu_title, $wd_options->plugin_menu_title, 'manage_options', $wd_options->prefix . '_subscribe' , array( $this, 'display_subscribew_page' ), $wd_options->plugin_menu_icon, 11 );
66
+
67
+ require_once ( $wd_options->wd_dir_includes . "/subscribe.php" );
68
+ $subscribe_instance = new WebDoradoSubscribe($this->config);
69
+ $this->subscribe_instance = $subscribe_instance;
70
+ add_action( 'admin_print_styles-' . $subscribe_page, array( $subscribe_instance, 'subscribe_styles' ) );
71
+ add_action( 'admin_print_scripts-' . $subscribe_page, array( $subscribe_instance, 'subscribe_scripts' ) );
72
+
73
+ $parent_slug = null;
74
+ }
75
+
76
  $overview_page = add_submenu_page( $parent_slug, __( 'Overview', $wd_options->prefix ), __( 'Overview', $wd_options->prefix ), 'manage_options', 'overview_' . $wd_options->prefix, array( $this, 'display_overview_page' ));
77
 
78
+ require_once ( $wd_options->wd_dir_includes . "/overview.php" );
79
+ $overview_instance = new WebDoradoOverview($this->config);
80
  $this->overview_instance = $overview_instance;
81
  add_action( 'admin_print_styles-' . $overview_page, array( $overview_instance, 'overview_styles' ) );
82
  add_action( 'admin_print_scripts-' . $overview_page, array( $overview_instance, 'overview_scripts' ) );
94
 
95
  // Includs
96
  public function wd_includes(){
97
+ $wd_options = $this->config;
98
+
99
  $current_url = $_SERVER['REQUEST_URI'];
100
+ if( $wd_options->deactivate === true ){
101
+ if(strpos( $current_url, "plugins.php" ) !== false ){
102
+ require_once $wd_options->wd_dir_includes . '/deactivate.php' ;
103
+ new WebDoradoDeactivate( $this->config );
104
+ }
105
+ }
106
+
107
+ // notices
108
+ require_once $wd_options->wd_dir_includes . '/api.php';
109
+ require_once $wd_options->wd_dir_includes . '/notices.php';
110
+ new WebDoradoNotices( $this->config );
111
  }
112
 
113
  public function register_hooks(){
114
+ $wd_options = $this->config;
115
+ if( $wd_options->deactivate === true ){
116
+ add_filter( 'plugin_action_links_' . plugin_basename( $wd_options->plugin_main_file ), array( $this, 'change_deactivation_link' ) );
117
+ }
118
 
119
  }
120
 
121
 
122
  public function change_deactivation_link ( $links ) {
123
+ $wd_options = $this->config;
 
124
  $links["deactivate"] = '<a href="#" class="' . $wd_options->prefix . '_deactivate_link">Deactivate</a>';
125
  return $links;
126
+ }
127
+
128
  ////////////////////////////////////////////////////////////////////////////////////////
129
  // Getters & Setters //
130
  ////////////////////////////////////////////////////////////////////////////////////////