Contact Form Builder – a plugin for creating contact and feedback forms - Version 1.0.70

Version Description

  • Fixed: Conflict with common mod_security rules.
Download this release

Release Info

Developer webdorado
Plugin Icon 128x128 Contact Form Builder – a plugin for creating contact and feedback forms
Version 1.0.70
Comparing to
See all releases

Code changes from version 1.0.69 to 1.0.70

admin/controllers/CFMControllerManage_cfm.php CHANGED
@@ -292,7 +292,7 @@ class CFMControllerManage_cfm {
292
  $disabled_fields_array = explode(',', $disabled_fields);
293
  $disabled_fields_array = array_slice($disabled_fields_array, 0, count($disabled_fields_array) - 1);
294
  $subject = $wpdb->get_row($wpdb->prepare('SELECT mail_subject,mail_subject_user FROM ' . $wpdb->prefix . 'contactformmaker WHERE id="%d"', $id));
295
- if (!in_array($label_id[$default_subject], $disabled_fields_array)) {
296
  $mail_subject = ($subject->mail_subject == '') ? '%' . $label_label[$default_subject] . '%' : $subject->mail_subject;
297
  $mail_subject_user = ($subject->mail_subject_user == '') ? '%' . $label_label[$default_subject] . '%' : $subject->mail_subject_user;
298
  }
@@ -301,6 +301,10 @@ class CFMControllerManage_cfm {
301
  $mail_subject_user = $subject->mail_subject_user;
302
  }
303
 
 
 
 
 
304
  if ($id != 0) {
305
  $save = $wpdb->update($wpdb->prefix . 'contactformmaker', array(
306
  'title' => $title,
@@ -426,7 +430,7 @@ class CFMControllerManage_cfm {
426
  $title = (isset($_POST['title']) ? esc_html(stripslashes($_POST['title'])) : '');
427
  $form_front = (isset($_POST['form_front']) ? stripslashes($_POST['form_front']) : '');
428
  $counter = (isset($_POST['counter']) ? (int) stripslashes($_POST['counter']) : 0);
429
- $label_order = (isset($_POST['label_order']) ? esc_html(stripslashes($_POST['label_order'])) : '');
430
  $label_order_current = (isset($_POST['label_order_current']) ? esc_html(stripslashes($_POST['label_order_current'])) : '');
431
  $public_key = (isset($_POST['public_key']) ? esc_html(stripslashes($_POST['public_key'])) : '');
432
  $private_key = (isset($_POST['private_key']) ? esc_html(stripslashes($_POST['private_key'])) : '');
@@ -435,6 +439,11 @@ class CFMControllerManage_cfm {
435
  $disabled_fields = (isset($_POST['disabled_fields']) ? stripslashes($_POST['disabled_fields']) : '');
436
  $sortable = (isset($_POST['sortable']) ? esc_html(stripslashes($_POST['sortable'])) : 0);
437
 
 
 
 
 
 
438
  $save = $wpdb->insert($wpdb->prefix . 'contactformmaker', array(
439
  'title' => $title,
440
  'mail' => $row->mail,
292
  $disabled_fields_array = explode(',', $disabled_fields);
293
  $disabled_fields_array = array_slice($disabled_fields_array, 0, count($disabled_fields_array) - 1);
294
  $subject = $wpdb->get_row($wpdb->prepare('SELECT mail_subject,mail_subject_user FROM ' . $wpdb->prefix . 'contactformmaker WHERE id="%d"', $id));
295
+ if ( !empty($default_subject) && !in_array($label_id[$default_subject], $disabled_fields_array)) {
296
  $mail_subject = ($subject->mail_subject == '') ? '%' . $label_label[$default_subject] . '%' : $subject->mail_subject;
297
  $mail_subject_user = ($subject->mail_subject_user == '') ? '%' . $label_label[$default_subject] . '%' : $subject->mail_subject_user;
298
  }
301
  $mail_subject_user = $subject->mail_subject_user;
302
  }
303
 
304
+ $form_front = !empty($form_front) ? urldecode(base64_decode($form_front)) : '';
305
+ $label_order = !empty($label_order) ? urldecode(base64_decode($label_order)) : '';
306
+ $label_order_current = !empty($label_order_current) ? urldecode(base64_decode($label_order_current)) : '';
307
+ $form_fields = !empty($form_fields) ? urldecode(base64_decode($form_fields)) : '';
308
  if ($id != 0) {
309
  $save = $wpdb->update($wpdb->prefix . 'contactformmaker', array(
310
  'title' => $title,
430
  $title = (isset($_POST['title']) ? esc_html(stripslashes($_POST['title'])) : '');
431
  $form_front = (isset($_POST['form_front']) ? stripslashes($_POST['form_front']) : '');
432
  $counter = (isset($_POST['counter']) ? (int) stripslashes($_POST['counter']) : 0);
433
+ $label_order = (isset($_POST['label_order']) ? stripslashes($_POST['label_order']) : '');
434
  $label_order_current = (isset($_POST['label_order_current']) ? esc_html(stripslashes($_POST['label_order_current'])) : '');
435
  $public_key = (isset($_POST['public_key']) ? esc_html(stripslashes($_POST['public_key'])) : '');
436
  $private_key = (isset($_POST['private_key']) ? esc_html(stripslashes($_POST['private_key'])) : '');
439
  $disabled_fields = (isset($_POST['disabled_fields']) ? stripslashes($_POST['disabled_fields']) : '');
440
  $sortable = (isset($_POST['sortable']) ? esc_html(stripslashes($_POST['sortable'])) : 0);
441
 
442
+ $form_front = !empty($form_front) ? urldecode(base64_decode($form_front)) : '';
443
+ $label_order = !empty($label_order) ? urldecode(base64_decode($label_order)) : '';
444
+ $label_order_current = !empty($label_order_current) ? urldecode(base64_decode($label_order_current)) : '';
445
+ $form_fields = !empty($form_fields) ? urldecode(base64_decode($form_fields)) : '';
446
+
447
  $save = $wpdb->insert($wpdb->prefix . 'contactformmaker', array(
448
  'title' => $title,
449
  'mail' => $row->mail,
admin/views/CFMViewManage_cfm.php CHANGED
@@ -359,14 +359,14 @@ class CFMViewManage_cfm {
359
  }
360
  }
361
  document.getElementById('disabled_fields').value = disabled_ids;
362
- document.getElementById('label_order_current').value = tox;
363
  for (x = 0; x < l_id_array.length; x++) {
364
  if (l_id_removed[l_id_array[x]]) {
365
  tox = tox + l_id_array[x] + '#**id**#' + l_label_array[x] + '#**label**#' + l_type_array[x] + '#****#';
366
  }
367
  }
368
- document.getElementById('label_order').value = tox;
369
- document.getElementById('form_fields').value = form_fields;
370
  refresh_();
371
  return true;
372
  }
359
  }
360
  }
361
  document.getElementById('disabled_fields').value = disabled_ids;
362
+ document.getElementById('label_order_current').value = btoa(encodeURI(tox));
363
  for (x = 0; x < l_id_array.length; x++) {
364
  if (l_id_removed[l_id_array[x]]) {
365
  tox = tox + l_id_array[x] + '#**id**#' + l_label_array[x] + '#**label**#' + l_type_array[x] + '#****#';
366
  }
367
  }
368
+ document.getElementById('label_order').value = btoa(encodeURI(tox));
369
+ document.getElementById('form_fields').value = btoa(encodeURI(form_fields));
370
  refresh_();
371
  return true;
372
  }
contact-form-builder.php CHANGED
@@ -3,14 +3,14 @@
3
  * Plugin Name: Contact Form Builder
4
  * Plugin URI: https://web-dorado.com/products/wordpress-contact-form-builder.html
5
  * Description: Contact Form Builder is an advanced plugin to add contact forms into your website. It comes along with multiple default templates which can be customized.
6
- * Version: 1.0.69
7
  * Author: WebDorado
8
  * Author URI: https://web-dorado.com/wordpress-plugins-bundle.html
9
  * License: GNU/GPLv3 http://www.gnu.org/licenses/gpl-3.0.html
10
  */
11
  define('WD_CFM_DIR', WP_PLUGIN_DIR . "/" . plugin_basename(dirname(__FILE__)));
12
  define('WD_CFM_URL', plugins_url(plugin_basename(dirname(__FILE__))));
13
- define('WD_CFM_VERSION', '1.0.69');
14
  define('WD_CFM_PREFIX', 'cfm');
15
  define('WD_CFM_NICENAME', __( 'Contact Form Builder', WD_CFM_PREFIX ));
16
 
@@ -861,7 +861,7 @@ function cfm_bp_install_notice() {
861
  }
862
 
863
  if ( !is_dir(plugin_dir_path(__DIR__) . 'backup-wd') ) {
864
- add_action('admin_notices', 'cfm_bp_install_notice');
865
  }
866
 
867
  if ( !function_exists('wd_bps_install_notice_status') ) {
3
  * Plugin Name: Contact Form Builder
4
  * Plugin URI: https://web-dorado.com/products/wordpress-contact-form-builder.html
5
  * Description: Contact Form Builder is an advanced plugin to add contact forms into your website. It comes along with multiple default templates which can be customized.
6
+ * Version: 1.0.70
7
  * Author: WebDorado
8
  * Author URI: https://web-dorado.com/wordpress-plugins-bundle.html
9
  * License: GNU/GPLv3 http://www.gnu.org/licenses/gpl-3.0.html
10
  */
11
  define('WD_CFM_DIR', WP_PLUGIN_DIR . "/" . plugin_basename(dirname(__FILE__)));
12
  define('WD_CFM_URL', plugins_url(plugin_basename(dirname(__FILE__))));
13
+ define('WD_CFM_VERSION', '1.0.70');
14
  define('WD_CFM_PREFIX', 'cfm');
15
  define('WD_CFM_NICENAME', __( 'Contact Form Builder', WD_CFM_PREFIX ));
16
 
861
  }
862
 
863
  if ( !is_dir(plugin_dir_path(__DIR__) . 'backup-wd') ) {
864
+ // add_action('admin_notices', 'cfm_bp_install_notice');
865
  }
866
 
867
  if ( !function_exists('wd_bps_install_notice_status') ) {
css/style.css CHANGED
@@ -433,7 +433,7 @@ fieldset input, fieldset textarea, fieldset select, fieldset img, fieldset butto
433
  .fm-theme span {
434
  display: inline-block;
435
  min-width: 47px;
436
- }
437
 
438
  .fm-title input {
439
  width: 270px;
433
  .fm-theme span {
434
  display: inline-block;
435
  min-width: 47px;
436
+ }
437
 
438
  .fm-title input {
439
  width: 270px;
frontend/views/CFMViewForm_maker.php CHANGED
@@ -563,6 +563,7 @@ class CFMViewForm_maker {
563
  $w_first_val[0] = $user_display_name[0];
564
  $w_first_val[1] = isset($user_display_name[1]) ? $user_display_name[1] : $w_first_val[1];
565
  }
 
566
  if ($param['w_name_format'] == 'normal') {
567
  $w_name_format = '
568
  <div style="display: table-cell; width:50%">
563
  $w_first_val[0] = $user_display_name[0];
564
  $w_first_val[1] = isset($user_display_name[1]) ? $user_display_name[1] : $w_first_val[1];
565
  }
566
+ $w_title = explode('***', $param['w_title']);
567
  if ($param['w_name_format'] == 'normal') {
568
  $w_name_format = '
569
  <div style="display: table-cell; width:50%">
js/contact_form_maker_manage.js CHANGED
@@ -67,7 +67,7 @@ function all_sortable_events() {
67
  }
68
  else {
69
  jQuery(".wdform_arrows_show").addClass("wdform_arrows");
70
- jQuery(".wdform_arrows").hide();
71
  jQuery(".wdform_arrows_show").removeClass("wdform_arrows_show");
72
  jQuery(".wdform_field, .wdform_field_section_break").css("background-color","#fff");
73
  jQuery(".wdform_field").css("margin-top", "");
@@ -153,7 +153,7 @@ function refresh_() {
153
  if (document.getElementById('form_id_tempform_view1')) {
154
  document.getElementById('form_id_tempform_view1').removeAttribute('style');
155
  }
156
- document.getElementById('form_front').value = document.getElementById('take').innerHTML;
157
  }
158
 
159
  function form_maker_options_tabs(id) {
67
  }
68
  else {
69
  jQuery(".wdform_arrows_show").addClass("wdform_arrows");
70
+ jQuery(".wdform_arrows").hide();
71
  jQuery(".wdform_arrows_show").removeClass("wdform_arrows_show");
72
  jQuery(".wdform_field, .wdform_field_section_break").css("background-color","#fff");
73
  jQuery(".wdform_field").css("margin-top", "");
153
  if (document.getElementById('form_id_tempform_view1')) {
154
  document.getElementById('form_id_tempform_view1').removeAttribute('style');
155
  }
156
+ document.getElementById('form_front').value = btoa(encodeURI(document.getElementById('take').innerHTML));
157
  }
158
 
159
  function form_maker_options_tabs(id) {
js/contactformmaker.js CHANGED
@@ -8,7 +8,6 @@ if (ajaxurl.indexOf("://") != -1) {
8
  else {
9
  var url_for_ajax = location.protocol + '//' + location.host + ajaxurl;
10
  }
11
-
12
  function active_reset(val, id) {
13
  if (val) {
14
  document.getElementById(id+'_element_resetform_id_temp').style.display = "inline";
8
  else {
9
  var url_for_ajax = location.protocol + '//' + location.host + ajaxurl;
10
  }
 
11
  function active_reset(val, id) {
12
  if (val) {
13
  document.getElementById(id+'_element_resetform_id_temp').style.display = "inline";
readme.txt CHANGED
@@ -2,8 +2,8 @@
2
  Contributors: webdorado
3
  Tags: contact form, contact forms, contact, feedback, form manager, captcha, custom form, email, form, form builder, forms, survey
4
  Requires at least: 3.4
5
- Tested up to: 5.2
6
- Stable tag: 1.0.69
7
  License: GPLv2 or later
8
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
9
 
@@ -77,6 +77,10 @@ After downloading the ZIP file,
77
 
78
 
79
  == Changelog ==
 
 
 
 
80
  = 1.0.69 =
81
  * Fixed: CSRF issue.
82
  * Fixed: Captcha.
2
  Contributors: webdorado
3
  Tags: contact form, contact forms, contact, feedback, form manager, captcha, custom form, email, form, form builder, forms, survey
4
  Requires at least: 3.4
5
+ Tested up to: 5.2
6
+ Stable tag: 1.0.70
7
  License: GPLv2 or later
8
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
9
 
77
 
78
 
79
  == Changelog ==
80
+
81
+ = 1.0.70 =
82
+ * Fixed: Conflict with common mod_security rules.
83
+
84
  = 1.0.69 =
85
  * Fixed: CSRF issue.
86
  * Fixed: Captcha.
wd/README.md CHANGED
@@ -1,4 +1,4 @@
1
- Version: 1.0.13
2
 
3
 
4
 
1
+ Version: 1.0.16
2
 
3
 
4
 
wd/assets/css/deactivate_popup.css CHANGED
@@ -63,12 +63,20 @@
63
  margin: 14px 0px 5px;
64
  }
65
  .wd-popup-active1{
66
- height: 523px !important;
67
  }
68
 
69
  .wd-popup-active2{
70
  height: 426px !important
71
  }
 
 
 
 
 
 
 
 
72
  .wd-deactivate-popup-opacity{
73
  width: 100%;
74
  height: 100%;
@@ -87,4 +95,17 @@
87
  bottom: 0;
88
  margin: auto;
89
  z-index: 63;
 
 
 
 
 
 
 
 
 
 
 
 
 
90
  }
63
  margin: 14px 0px 5px;
64
  }
65
  .wd-popup-active1{
66
+ height: 583px !important;
67
  }
68
 
69
  .wd-popup-active2{
70
  height: 426px !important
71
  }
72
+
73
+ .wd-popup-active3{
74
+ height: 479px !important
75
+ }
76
+
77
+ .wd-popup-active4{
78
+ height: 340px !important
79
+ }
80
  .wd-deactivate-popup-opacity{
81
  width: 100%;
82
  height: 100%;
95
  bottom: 0;
96
  margin: auto;
97
  z-index: 63;
98
+ }
99
+
100
+ .wd-deactivate-popup-close-btn{
101
+ background-image: url(img/close.svg);
102
+ background-repeat: no-repeat;
103
+ background-size: 16px;
104
+ display: inline-block;
105
+ width: 16px;
106
+ height: 16px;
107
+ position: absolute;
108
+ top: 7px;
109
+ right: 8px;
110
+ cursor: pointer;
111
  }
wd/assets/css/img/close.svg ADDED
@@ -0,0 +1,16 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="6917.521 490.293 11.414 11.414">
2
+ <defs>
3
+ <style>
4
+ .cls-1 {
5
+ fill: none;
6
+ stroke: #cbcbcb;
7
+ stroke-linecap: round;
8
+ stroke-linejoin: round;
9
+ }
10
+ </style>
11
+ </defs>
12
+ <g id="if_misc-_close__1276877_3_" data-name="if_misc-_close__1276877 (3)" transform="translate(6917.229 490)">
13
+ <line id="Line_262" data-name="Line 262" class="cls-1" y1="10" x2="10" transform="translate(1 1)"/>
14
+ <line id="Line_263" data-name="Line 263" class="cls-1" x2="10" y2="10" transform="translate(1 1)"/>
15
+ </g>
16
+ </svg>
wd/assets/css/overview.css CHANGED
@@ -1,4 +1,3 @@
1
- /* general */
2
  .wd-table{
3
  display: table;
4
  width: 100%;
@@ -30,7 +29,6 @@ a:focus{
30
  box-shadow: none !important;
31
  }
32
 
33
- /*end general */
34
  .wd-video_container{
35
  text-align: center;
36
  }
@@ -328,7 +326,6 @@ a:focus{
328
  float: left;
329
  }
330
  .deal_desc_footer .download_btn{
331
- /*float: right;*/
332
  margin-top: 10px;
333
  text-align: center;
334
  }
@@ -417,7 +414,6 @@ a:focus{
417
  padding: 5px;
418
  }
419
 
420
- /* noteices */
421
  .notice_wrap{
422
  padding: 15px;
423
  border: 1px solid #C4C4C4;
 
1
  .wd-table{
2
  display: table;
3
  width: 100%;
29
  box-shadow: none !important;
30
  }
31
 
 
32
  .wd-video_container{
33
  text-align: center;
34
  }
326
  float: left;
327
  }
328
  .deal_desc_footer .download_btn{
 
329
  margin-top: 10px;
330
  text-align: center;
331
  }
414
  padding: 5px;
415
  }
416
 
 
417
  .notice_wrap{
418
  padding: 15px;
419
  border: 1px solid #C4C4C4;
wd/assets/js/deactivate_popup.js CHANGED
@@ -1,107 +1,104 @@
1
- ////////////////////////////////////////////////////////////////////////////////////////
2
- // Events //
3
- ////////////////////////////////////////////////////////////////////////////////////////
4
- ////////////////////////////////////////////////////////////////////////////////////////
5
- // Constants //
6
- ////////////////////////////////////////////////////////////////////////////////////////
7
- ////////////////////////////////////////////////////////////////////////////////////////
8
- // Variables //
9
- ////////////////////////////////////////////////////////////////////////////////////////
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
- }
30
-
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
- jQuery(".wd-deactivate-popup-opacity-" + prefix).show();
83
- if(jQuery(this).hasClass("wd-clicked") == false){
84
- jQuery(this).addClass("wd-clicked");
85
- jQuery("[name=" + prefix + "_submit_and_deactivate]").val(jQuery(this).attr("data-val"));
86
- jQuery("#" + prefix + "_deactivate_form").submit();
87
- }
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
- ////////////////////////////////////////////////////////////////////////////////////////
100
- // Getters & Setters //
101
- ////////////////////////////////////////////////////////////////////////////////////////
102
- ////////////////////////////////////////////////////////////////////////////////////////
103
- // Private Methods //
104
- ////////////////////////////////////////////////////////////////////////////////////////
105
- ////////////////////////////////////////////////////////////////////////////////////////
106
- // Listeners //
107
- ////////////////////////////////////////////////////////////////////////////////////////
 
 
 
 
 
 
 
 
 
1
  var deactivated = false;
2
  var additionalInfo = "";
3
  var btnVal = 3;
4
 
5
+ function wdReady(prefix) {
6
+ var agree_with_pp = false;
7
+ reset_popup();
8
+ jQuery(document).on("click", "." + window[prefix + "WDDeactivateVars"].deactivate_class, function () {
9
+ agree_with_pp = false;
10
+ if (!jQuery('#wd-' + prefix + '-submit-and-deactivate').hasClass('button-primary-disabled')) {
11
+ jQuery('#wd-' + prefix + '-submit-and-deactivate').addClass('button-primary-disabled')
12
+ }
13
+ jQuery(".wd-" + prefix + "-opacity").show();
14
+ jQuery(".wd-" + prefix + "-deactivate-popup").show();
15
+ if (jQuery(this).attr("data-uninstall") == "1") {
16
+ btnVal = 2;
17
+ }
18
+ return false;
19
+ });
20
+ jQuery(document).on("change", "[name=" + prefix + "_reasons]", function () {
21
+ var disabled_class = (agree_with_pp === false) ? "button-primary-disabled" : "";
22
+ jQuery("." + prefix + "_additional_details_wrap").html("");
23
+ jQuery(".wd-" + prefix + "-deactivate-popup").removeClass("wd-popup-active1 wd-popup-active2 wd-popup-active3 wd-popup-active4");
24
+ if (jQuery(this).val() == "reason_plugin_is_hard_to_use_technical_problems") {
25
+ additionalInfo = '<div class="wd-additional-active"><div><strong>Please describe your issue.</strong></div><br>' +
26
+ '<textarea name="' + prefix + '_additional_details" rows = "4"></textarea><br>' +
27
+ '<div>Our support will contact <input type="text" name="' + prefix + '_email" value="' + window[prefix + "WDDeactivateVars"].email + '"> shortly.</div>' +
28
+ '<br><div><button class="button button-primary ' + disabled_class + ' wd-' + prefix + '-deactivate" data-val="' + btnVal + '">Submit support ticket</button></div></div>';
29
+ jQuery("." + prefix + "_additional_details_wrap").append(additionalInfo);
30
+ jQuery(".wd-" + prefix + "-deactivate-popup").addClass("wd-popup-active1");
31
+ }
32
+ else if (jQuery(this).val() == "reason_free_version_limited") {
33
+ additionalInfo = '<div class="wd-additional-active">' +
34
+ '<div><strong>We believe our premium version will fit your needs.</strong></div>' +
35
+ '<div><a href="' + window[prefix + "WDDeactivateVars"].plugin_wd_url + '" target="_blank">Try with 30 day money back guarantee.</a></div>';
36
+ jQuery("." + prefix + "_additional_details_wrap").append(additionalInfo);
37
+ jQuery(".wd-" + prefix + "-deactivate-popup").addClass("wd-popup-active2");
38
+ }
39
+ else if (jQuery(this).val() == "reason_premium_expensive") {
40
+ additionalInfo = '<div class="wd-additional-active">' +
41
+ '<div><strong>We have a special offer for you.</strong></div>' +
42
+ '<div>Submit this form to get the offer to <input type="text" name="' + prefix + '_email" value="' + window[prefix + "WDDeactivateVars"].email + '"></div>' +
43
+ '<br><div><button class="button button-primary ' + disabled_class + ' wd-' + prefix + '-deactivate" data-val="' + btnVal + '">Submit</button></div></div>';
44
+ jQuery("." + prefix + "_additional_details_wrap").append(additionalInfo);
45
+ jQuery(".wd-" + prefix + "-deactivate-popup").addClass("wd-popup-active3");
46
+ }
47
+ else {
48
+ jQuery(".wd-" + prefix + "-deactivate-popup").addClass("wd-popup-active4");
49
+ }
50
+ var checked = (agree_with_pp === true) ? "checked" : "";
51
+ var agree_checkbox =
52
+ "<div style='margin-top: 5px;'>" +
53
+ "<input type='checkbox' " + checked + " name='" + prefix + "_agree_with_pp" + "' id='" + prefix + "_agree_with_pp" + "'/>" +
54
+ "By submitting this form your email and website URL will be sent to Web-Dorado. Click the checkbox if you consent to usage of mentioned data by Web-Dorado in accordance with our <a target='_blank' href='https://web-dorado.com/web-dorado-privacy-statement.html'>Privacy Policy</a>." +
55
+ "</div>";
56
+ jQuery("." + prefix + "_additional_details_wrap").prepend(agree_checkbox);
57
+ jQuery("#wd-" + prefix + "-submit-and-deactivate").show();
58
+ });
59
+ jQuery(document).on("keyup", "[name=" + prefix + "_additional_details]", function () {
60
+ if (jQuery(this).val().trim() || jQuery("[name=" + prefix + "_reasons]:checked").length > 0) {
61
+ jQuery("#wd-" + prefix + "-submit-and-deactivate").show();
62
+ }
63
+ else {
64
+ jQuery("#wd-" + prefix + "-submit-and-deactivate").hide();
65
+ }
66
+ });
67
+ jQuery(document).on("change", "[name=" + prefix + "_agree_with_pp]", function () {
68
+ if (jQuery(this).prop('checked')) {
69
+ jQuery(".wd-" + prefix + "-deactivate").removeClass('button-primary-disabled');
70
+ agree_with_pp = true;
71
+ }
72
+ else {
73
+ jQuery(".wd-" + prefix + "-deactivate").addClass('button-primary-disabled');
74
+ agree_with_pp = false;
75
+ }
76
+ });
77
+ jQuery(document).on("click", ".wd-" + prefix + "-deactivate", function (e) {
78
+ var data_val = jQuery(this).data('val');
79
+ var checkbox = jQuery("#" + prefix + "_agree_with_pp");
80
+ if (data_val !== 1 && (checkbox.length === 0 || checkbox.prop('checked') === false)) {
81
+ return false;
82
+ }
83
+ jQuery(".wd-deactivate-popup-opacity-" + prefix).show();
84
+ if (jQuery(this).hasClass("wd-clicked") == false) {
85
+ jQuery(this).addClass("wd-clicked");
86
+ jQuery("[name=" + prefix + "_submit_and_deactivate]").val(jQuery(this).attr("data-val"));
87
+ jQuery("#" + prefix + "_deactivate_form").submit();
88
+ }
89
+ return false;
90
+ });
91
+ jQuery(document).on("click", ".wd-" + prefix + "-cancel, .wd-opacity, .wd-deactivate-popup-close-btn", function () {
92
+ jQuery(".wd-" + prefix + "-opacity").hide();
93
+ jQuery(".wd-" + prefix + "-deactivate-popup").hide();
94
+ reset_popup();
95
+ return false;
96
+ });
97
 
98
+ function reset_popup() {
99
+ jQuery("." + prefix + "_additional_details_wrap").html("");
100
+ jQuery(".wd-" + prefix + "-deactivate-popup").removeClass("wd-popup-active1 wd-popup-active2 wd-popup-active3 wd-popup-active4");
101
+ jQuery("#wd-" + prefix + "-submit-and-deactivate").hide();
102
+ jQuery('#' + prefix + '_deactivate_form input[name="' + prefix + '_reasons' + '"]').prop('checked', false);
103
+ }
104
+ }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
wd/assets/js/overview.js CHANGED
@@ -1,56 +1,17 @@
1
- ////////////////////////////////////////////////////////////////////////////////////////
2
- // Events //
3
- ////////////////////////////////////////////////////////////////////////////////////////
4
- ////////////////////////////////////////////////////////////////////////////////////////
5
- // Constants //
6
- ////////////////////////////////////////////////////////////////////////////////////////
7
- ////////////////////////////////////////////////////////////////////////////////////////
8
- // Variables //
9
- ////////////////////////////////////////////////////////////////////////////////////////
10
- ////////////////////////////////////////////////////////////////////////////////////////
11
- // Constructor & Destructor //
12
- ////////////////////////////////////////////////////////////////////////////////////////
13
  jQuery(document).ready(function () {
14
- jQuery(".overview_content > div:not(#welcome)").hide();
15
- jQuery(".overview_tabs li a:not(.not_tab)").on("click", function(){
16
- jQuery(".overview_tabs li a").removeClass("overview_tab_active");
17
- jQuery(this).addClass("overview_tab_active");
18
- jQuery(".overview_content > div").hide();
19
- var id = jQuery(this).attr("href");
20
- jQuery(id).show();
21
- return false;
22
- });
23
-
24
- // rating
25
- // jQuery(".rating").each(function(){
26
- // var rate = jQuery(this).attr("data-rating");
27
- // jQuery("<span class='stars-container'>")
28
- // .addClass("stars-" + rate.toString())
29
- // .text("★★★★★")
30
- // .appendTo(jQuery(this));
31
- // jQuery("body").append('<style>.stars-' + rate.toString() + ':after{width:' + rate + '%;}</style>');
32
- // });
33
-
34
- jQuery("#wd-copy").on("click", function(){
35
- var selector = document.querySelector('#wd-site-deatils-textarea');
36
- selector.select();
37
- document.execCommand('copy');
38
-
39
- return false;
40
-
41
- });
42
-
43
- });
44
-
45
- ////////////////////////////////////////////////////////////////////////////////////////
46
- // Public Methods //
47
- ////////////////////////////////////////////////////////////////////////////////////////
48
- ////////////////////////////////////////////////////////////////////////////////////////
49
- // Getters & Setters //
50
- ////////////////////////////////////////////////////////////////////////////////////////
51
- ////////////////////////////////////////////////////////////////////////////////////////
52
- // Private Methods //
53
- ////////////////////////////////////////////////////////////////////////////////////////
54
- ////////////////////////////////////////////////////////////////////////////////////////
55
- // Listeners //
56
- ////////////////////////////////////////////////////////////////////////////////////////
 
 
 
 
 
 
 
 
 
 
 
 
1
  jQuery(document).ready(function () {
2
+ jQuery(".overview_content > div:not(#welcome)").hide();
3
+ jQuery(".overview_tabs li a:not(.not_tab)").on("click", function () {
4
+ jQuery(".overview_tabs li a").removeClass("overview_tab_active");
5
+ jQuery(this).addClass("overview_tab_active");
6
+ jQuery(".overview_content > div").hide();
7
+ var id = jQuery(this).attr("href");
8
+ jQuery(id).show();
9
+ return false;
10
+ });
11
+ jQuery("#wd-copy").on("click", function () {
12
+ var selector = document.querySelector('#wd-site-deatils-textarea');
13
+ selector.select();
14
+ document.execCommand('copy');
15
+ return false;
16
+ });
17
+ });
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
wd/assets/js/subsribe.js CHANGED
@@ -1,36 +1,10 @@
1
- ////////////////////////////////////////////////////////////////////////////////////////
2
- // Events //
3
- ////////////////////////////////////////////////////////////////////////////////////////
4
- ////////////////////////////////////////////////////////////////////////////////////////
5
- // Constants //
6
- ////////////////////////////////////////////////////////////////////////////////////////
7
- ////////////////////////////////////////////////////////////////////////////////////////
8
- // Variables //
9
- ////////////////////////////////////////////////////////////////////////////////////////
10
- ////////////////////////////////////////////////////////////////////////////////////////
11
- // Constructor & Destructor //
12
- ////////////////////////////////////////////////////////////////////////////////////////
13
  jQuery(document).on("ready", function () {
14
- jQuery(".permissions").on("click", function(){
15
- jQuery(".list").toggle();
16
- return false;
17
- });
18
-
19
- jQuery(".allow_and_continue").on("click", function(){
20
- jQuery(this).css("opacity", "0.5");
21
- jQuery(".wd_loader").css("visibility", "visible");
22
- });
23
- });
24
-
25
- ////////////////////////////////////////////////////////////////////////////////////////
26
- // Public Methods //
27
- ////////////////////////////////////////////////////////////////////////////////////////
28
- ////////////////////////////////////////////////////////////////////////////////////////
29
- // Getters & Setters //
30
- ////////////////////////////////////////////////////////////////////////////////////////
31
- ////////////////////////////////////////////////////////////////////////////////////////
32
- // Private Methods //
33
- ////////////////////////////////////////////////////////////////////////////////////////
34
- ////////////////////////////////////////////////////////////////////////////////////////
35
- // Listeners //
36
- ////////////////////////////////////////////////////////////////////////////////////////
 
 
 
 
 
 
 
 
 
 
 
 
1
  jQuery(document).on("ready", function () {
2
+ jQuery(".permissions").on("click", function () {
3
+ jQuery(".list").toggle();
4
+ return false;
5
+ });
6
+ jQuery(".allow_and_continue").on("click", function () {
7
+ jQuery(this).css("opacity", "0.5");
8
+ jQuery(".wd_loader").css("visibility", "visible");
9
+ });
10
+ });
 
 
 
 
 
 
 
 
 
 
 
 
 
 
wd/config.php CHANGED
@@ -1,127 +1,124 @@
1
  <?php
2
- if ( ! defined( 'ABSPATH' ) ) {
3
- exit;
4
- }
5
-
6
- class DoradoWebConfig {
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 $overview_welcome_image = null;
19
- public $video_youtube_id = null;
20
- public $plugin_wd_url = null;
21
- public $plugin_wd_demo_link = null;
22
- public $plugin_wd_addons_link = null;
23
- public $plugin_wizard_link = null;
24
- public $after_subscribe = null;
25
- public $plugin_menu_title = null;
26
- public $plugin_menu_icon = null;
27
- public $wd_dir = null;
28
- public $wd_dir_includes = null;
29
- public $wd_dir_templates = null;
30
- public $wd_dir_assets = null;
31
- public $wd_url_css = null;
32
- public $wd_url_js = null;
33
- public $wd_url_img = null;
34
- public $deactivate = null;
35
- public $subscribe = null;
36
- public $custom_post = null;
37
- public $menu_capability = null;
38
- public $menu_position = null;
39
-
40
- public function set_options( $options ){
41
 
42
- if(isset( $options["prefix"] )) {
43
- $this->prefix = $options["prefix"];
44
- }
45
- if(isset( $options["wd_plugin_id"] )) {
46
- $this->wd_plugin_id = $options["wd_plugin_id"];
47
- }
48
- if(isset( $options["plugin_title"] )) {
49
- $this->plugin_title = $options["plugin_title"];
50
- }
51
- if(isset( $options["plugin_wordpress_slug"] )) {
52
- $this->plugin_wordpress_slug = $options["plugin_wordpress_slug"];
53
- }
54
- if(isset( $options["plugin_dir"] )) {
55
- $this->plugin_dir = $options["plugin_dir"];
56
- }
57
- if(isset( $options["plugin_main_file"] )) {
58
- $this->plugin_main_file = $options["plugin_main_file"];
59
- }
60
-
61
- if(isset( $options["description"] )) {
62
- $this->description = $options["description"];
63
- }
64
- if(isset( $options["plugin_features"] )) {
65
- $this->plugin_features = $options["plugin_features"];
66
- }
67
- if(isset( $options["user_guide"] )) {
68
- $this->user_guide = $options["user_guide"];
69
- }
70
- if(isset( $options["video_youtube_id"] )) {
71
- $this->video_youtube_id = $options["video_youtube_id"];
72
- }
73
- if(isset( $options["overview_welcome_image"] )) {
74
- $this->overview_welcome_image = $options["overview_welcome_image"];
75
- }
76
- if(isset( $options["plugin_wd_url"] )) {
77
- $this->plugin_wd_url = $options["plugin_wd_url"];
78
- }
79
- if(isset( $options["plugin_wd_demo_link"] )) {
80
- $this->plugin_wd_demo_link = $options["plugin_wd_demo_link"];
81
- }
82
- if(isset( $options["plugin_wd_addons_link"] )) {
83
- $this->plugin_wd_addons_link = $options["plugin_wd_addons_link"];
84
- }
85
- if(isset( $options["plugin_wizard_link"] )) {
86
- $this->plugin_wizard_link = $options["plugin_wizard_link"];
87
- }
88
- if(isset( $options["after_subscribe"] )) {
89
- $this->after_subscribe = $options["after_subscribe"];
90
- }
91
- if(isset( $options["plugin_menu_title"] )) {
92
- $this->plugin_menu_title = $options["plugin_menu_title"];
93
- }
94
- if(isset( $options["plugin_menu_icon"] )) {
95
- $this->plugin_menu_icon = $options["plugin_menu_icon"];
96
- }
97
- if(isset( $options["deactivate"] )) {
98
- $this->deactivate = $options["deactivate"];
99
- }
100
- if(isset( $options["subscribe"] )) {
101
- $this->subscribe = $options["subscribe"];
102
- }
103
- if(isset( $options["custom_post"] )) {
104
- $this->custom_post = $options["custom_post"];
105
- }
106
- if(isset( $options["menu_capability"] )) {
107
- $this->menu_capability = $options["menu_capability"];
108
- }
109
- if(isset( $options["menu_position"] )) {
110
- $this->menu_position = $options["menu_position"];
111
- }
112
-
113
- // directories
114
- $this->wd_dir = dirname( $this->plugin_main_file ) . '/wd';
115
- $this->wd_dir_includes = $this->wd_dir . '/includes';
116
- $this->wd_dir_templates = $this->wd_dir . '/templates';
117
- $this->wd_dir_assets = $this->wd_dir . '/assets';
118
- $this->wd_url_css = plugins_url( plugin_basename( $this->wd_dir ) ) . '/assets/css';
119
- $this->wd_url_js = plugins_url( plugin_basename( $this->wd_dir ) ) . '/assets/js';
120
- $this->wd_url_img = plugins_url( plugin_basename( $this->wd_dir ) ) . '/assets/img';
121
- }
122
 
 
123
 
 
 
124
  }
125
-
126
-
127
-
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
  <?php
2
+ if ( !defined('ABSPATH') ) {
3
+ exit;
4
+ }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
5
 
6
+ class DoradoWebConfig {
7
+ public static $instance;
8
+ public $prefix = NULL;
9
+ public $plugin_id = 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 $overview_welcome_image = NULL;
19
+ public $video_youtube_id = NULL;
20
+ public $plugin_wd_url = NULL;
21
+ public $plugin_wd_demo_link = NULL;
22
+ public $plugin_wd_addons_link = NULL;
23
+ public $plugin_wizard_link = NULL;
24
+ public $after_subscribe = NULL;
25
+ public $plugin_menu_title = NULL;
26
+ public $plugin_menu_icon = NULL;
27
+ public $wd_dir = NULL;
28
+ public $wd_dir_includes = NULL;
29
+ public $wd_dir_templates = NULL;
30
+ public $wd_dir_assets = NULL;
31
+ public $wd_url_css = NULL;
32
+ public $wd_url_js = NULL;
33
+ public $wd_url_img = NULL;
34
+ public $deactivate = NULL;
35
+ public $subscribe = NULL;
36
+ public $custom_post = NULL;
37
+ public $menu_capability = NULL;
38
+ public $menu_position = NULL;
39
+ public $start_using_url = NULL;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
40
 
41
+ public function set_options( $options ) {
42
 
43
+ if ( isset($options["prefix"]) ) {
44
+ $this->prefix = $options["prefix"];
45
  }
46
+ if ( isset($options["wd_plugin_id"]) ) {
47
+ $this->wd_plugin_id = $options["wd_plugin_id"];
48
+ }
49
+ if ( isset($options["plugin_title"]) ) {
50
+ $this->plugin_title = $options["plugin_title"];
51
+ }
52
+ if ( isset($options["plugin_wordpress_slug"]) ) {
53
+ $this->plugin_wordpress_slug = $options["plugin_wordpress_slug"];
54
+ }
55
+ if ( isset($options["plugin_dir"]) ) {
56
+ $this->plugin_dir = $options["plugin_dir"];
57
+ }
58
+ if ( isset($options["plugin_main_file"]) ) {
59
+ $this->plugin_main_file = $options["plugin_main_file"];
60
+ }
61
+ if ( isset($options["description"]) ) {
62
+ $this->description = $options["description"];
63
+ }
64
+ if ( isset($options["plugin_features"]) ) {
65
+ $this->plugin_features = $options["plugin_features"];
66
+ }
67
+ if ( isset($options["user_guide"]) ) {
68
+ $this->user_guide = $options["user_guide"];
69
+ }
70
+ if ( isset($options["video_youtube_id"]) ) {
71
+ $this->video_youtube_id = $options["video_youtube_id"];
72
+ }
73
+ if ( isset($options["overview_welcome_image"]) ) {
74
+ $this->overview_welcome_image = $options["overview_welcome_image"];
75
+ }
76
+ if ( isset($options["plugin_wd_url"]) ) {
77
+ $this->plugin_wd_url = $options["plugin_wd_url"];
78
+ }
79
+ if ( isset($options["plugin_wd_demo_link"]) ) {
80
+ $this->plugin_wd_demo_link = $options["plugin_wd_demo_link"];
81
+ }
82
+ if ( isset($options["plugin_wd_addons_link"]) ) {
83
+ $this->plugin_wd_addons_link = $options["plugin_wd_addons_link"];
84
+ }
85
+ if ( isset($options["plugin_wizard_link"]) ) {
86
+ $this->plugin_wizard_link = $options["plugin_wizard_link"];
87
+ }
88
+ if ( isset($options["after_subscribe"]) ) {
89
+ $this->after_subscribe = $options["after_subscribe"];
90
+ }
91
+ if ( isset($options["plugin_menu_title"]) ) {
92
+ $this->plugin_menu_title = $options["plugin_menu_title"];
93
+ }
94
+ if ( isset($options["plugin_menu_icon"]) ) {
95
+ $this->plugin_menu_icon = $options["plugin_menu_icon"];
96
+ }
97
+ if ( isset($options["deactivate"]) ) {
98
+ $this->deactivate = $options["deactivate"];
99
+ }
100
+ if ( isset($options["subscribe"]) ) {
101
+ $this->subscribe = $options["subscribe"];
102
+ }
103
+ if ( isset($options["custom_post"]) ) {
104
+ $this->custom_post = $options["custom_post"];
105
+ }
106
+ if ( isset($options["menu_capability"]) ) {
107
+ $this->menu_capability = $options["menu_capability"];
108
+ }
109
+ if ( isset($options["menu_position"]) ) {
110
+ $this->menu_position = $options["menu_position"];
111
+ }
112
+ if ( isset($options["start_using_url"]) ) {
113
+ $this->start_using_url = $options["start_using_url"];
114
+ }
115
+ // directories
116
+ $this->wd_dir = dirname($this->plugin_main_file) . '/wd';
117
+ $this->wd_dir_includes = $this->wd_dir . '/includes';
118
+ $this->wd_dir_templates = $this->wd_dir . '/templates';
119
+ $this->wd_dir_assets = $this->wd_dir . '/assets';
120
+ $this->wd_url_css = plugins_url(plugin_basename($this->wd_dir)) . '/assets/css';
121
+ $this->wd_url_js = plugins_url(plugin_basename($this->wd_dir)) . '/assets/js';
122
+ $this->wd_url_img = plugins_url(plugin_basename($this->wd_dir)) . '/assets/img';
123
+ }
124
+ }
wd/includes/api.php CHANGED
@@ -1,81 +1,49 @@
1
  <?php
2
- if ( !defined( 'ABSPATH' ) ) {
3
- exit;
4
- }
 
 
 
 
5
 
6
- class DoradoWebApi{
7
- ////////////////////////////////////////////////////////////////////////////////////////
8
- // Events //
9
- ////////////////////////////////////////////////////////////////////////////////////////
10
- ////////////////////////////////////////////////////////////////////////////////////////
11
- // Constants //
12
- ////////////////////////////////////////////////////////////////////////////////////////
13
- ////////////////////////////////////////////////////////////////////////////////////////
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
- ////////////////////////////////////////////////////////////////////////////////////////
29
- // Public Methods //
30
- ////////////////////////////////////////////////////////////////////////////////////////
31
 
32
-
33
- public function get_remote_data( $id ) {
34
- $remote_data_path = DORADO_WEB_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 ) {
38
- return json_decode($request['body'], true);
39
- }
40
- return false;
41
- }
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' );
49
- $userhash = fgets( $f );
50
- fclose( $f );
51
- }
52
- return $userhash;
53
- }
54
-
55
- public function get_hash(){
56
- $response = wp_remote_get("https://api.web-dorado.com/hash/" . $_SERVER['REMOTE_ADDR'] . "/" . $_SERVER['HTTP_HOST']);
57
-
58
- $response_body = ( !is_wp_error($response) && isset($response["body"])) ? json_decode($response["body"], true) : null;
59
-
60
- if(is_array($response_body)){
61
- $hash = $response_body["body"]["hash"];
62
- }
63
- else{
64
- $hash = null;
65
- }
66
 
67
- return $hash;
68
- }
69
-
70
-
71
- ////////////////////////////////////////////////////////////////////////////////////////
72
- // Getters & Setters //
73
- ////////////////////////////////////////////////////////////////////////////////////////
74
- ////////////////////////////////////////////////////////////////////////////////////////
75
- // Private Methods //
76
- ////////////////////////////////////////////////////////////////////////////////////////
77
- ////////////////////////////////////////////////////////////////////////////////////////
78
- // Listeners //
79
- ////////////////////////////////////////////////////////////////////////////////////////
80
-
81
- }
1
  <?php
2
+ if ( !defined('ABSPATH') ) {
3
+ exit;
4
+ }
5
+
6
+ class DoradoWebApi {
7
+ public $config;
8
+ public $userhash = array();
9
 
10
+ public function __construct( $config = array() ) {
11
+ $this->config = $config;
12
+ $this->userhash = $this->get_userhash();
13
+ }
 
 
 
 
 
 
14
 
15
+ public function get_remote_data( $id ) {
16
+ $remote_data_path = DORADO_WEB_API_PLUGIN_DATA_PATH . '/' . $this->userhash;
17
+ $request = wp_remote_get((str_replace('_id_', $id, $remote_data_path)));
18
+ if ( !is_wp_error($request) || wp_remote_retrieve_response_code($request) === 200 ) {
19
+ return json_decode($request['body'], TRUE);
20
+ }
 
 
 
 
 
 
 
 
21
 
22
+ return FALSE;
23
+ }
 
 
 
 
 
 
 
 
24
 
25
+ public function get_userhash() {
26
+ $wd_options = $this->config;
27
+ $userhash = 'nohash';
28
+ if ( file_exists($wd_options->plugin_dir . '/.keep') && is_readable($wd_options->plugin_dir . '/.keep') ) {
29
+ $f = fopen($wd_options->plugin_dir . '/.keep', 'r');
30
+ $userhash = fgets($f);
31
+ fclose($f);
32
+ }
33
 
34
+ return $userhash;
35
+ }
36
+
37
+ public function get_hash() {
38
+ $response = wp_remote_get("https://api.web-dorado.com/hash/" . $_SERVER['REMOTE_ADDR'] . "/" . $_SERVER['HTTP_HOST']);
39
+ $response_body = (!is_wp_error($response) && isset($response["body"])) ? json_decode($response["body"], TRUE) : NULL;
40
+ if ( is_array($response_body) ) {
41
+ $hash = $response_body["body"]["hash"];
42
+ }
43
+ else {
44
+ $hash = NULL;
45
+ }
 
 
 
 
 
 
 
 
 
 
46
 
47
+ return $hash;
48
+ }
49
+ }
 
 
 
 
 
 
 
 
 
 
 
 
wd/includes/deactivate.php CHANGED
@@ -1,179 +1,117 @@
1
  <?php
2
- if ( ! defined( 'ABSPATH' ) ) {
3
- exit;
4
- }
5
-
6
- class DoradoWebDeactivate{
7
- ////////////////////////////////////////////////////////////////////////////////////////
8
- // Events //
9
- ////////////////////////////////////////////////////////////////////////////////////////
10
- ////////////////////////////////////////////////////////////////////////////////////////
11
- // Constants //
12
- ////////////////////////////////////////////////////////////////////////////////////////
13
- ////////////////////////////////////////////////////////////////////////////////////////
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";
21
- const REASON_PRO_EXPENSIVE = "reason_premium_expensive";
22
- const REASON_UPGRADING_TO_PAID_VERSION = "reason_upgrading_to_paid_version";
23
- const REASON_TEMPORARY_DEACTIVATION = "reason_temporary_deactivation";
24
 
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,
35
- 'text' => __( 'Technical problems / hard to use', $wd_options->prefix ),
36
- ),
37
- 2 => array(
38
- 'id' => self::REASON_FREE_VERSION_IS_LIMITED,
39
- 'text' => __( 'Free version is limited', $wd_options->prefix ),
40
- ),
41
- 3 => array(
42
- 'id' => self::REASON_PRO_EXPENSIVE,
43
- 'text' => __( 'Premium is expensive', $wd_options->prefix ),
44
- ),
45
- 4 => array(
46
- 'id' => self::REASON_UPGRADING_TO_PAID_VERSION,
47
- 'text' => __( 'Upgrading to paid version', $wd_options->prefix ),
48
- ),
49
- 5 => array(
50
- 'id' => self::REASON_TEMPORARY_DEACTIVATION,
51
- 'text' => __( 'Temporary deactivation', $wd_options->prefix ),
52
- ),
53
- );
54
-
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
- ////////////////////////////////////////////////////////////////////////////////////////
66
- // Public Methods //
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
 
80
- $deactivate_url =
81
- add_query_arg(
82
- array(
83
- 'action' => 'deactivate',
84
- 'plugin' => plugin_basename( $wd_options->plugin_main_file ),
85
- '_wpnonce' => wp_create_nonce( 'deactivate-plugin_' . plugin_basename( $wd_options->plugin_main_file ) )
86
- ),
87
- admin_url( 'plugins.php' )
88
- );
89
-
90
- require ( $wd_options->wd_dir_templates . '/display_deactivation_popup.php' );
91
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
92
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
93
 
94
-
95
- public function scripts(){
96
- $wd_options = $this->config;
97
- wp_enqueue_style( 'wd-deactivate-popup', $wd_options->wd_url_css . '/deactivate_popup.css', array(), get_option($wd_options->prefix . "_version" ) );
98
- wp_enqueue_script( 'wd-deactivate-popup', $wd_options->wd_url_js . '/deactivate_popup.js', array(), get_option($wd_options->prefix . "_version" ));
99
-
100
- $admin_data = wp_get_current_user();
101
- wp_localize_script( 'wd-deactivate-popup', $wd_options->prefix . 'WDDeactivateVars' , array(
102
- "prefix" => $wd_options->prefix ,
103
- "deactivate_class" => $wd_options->prefix . '_deactivate_link',
104
- "email" => $admin_data->data->user_email,
105
- "plugin_wd_url" => $wd_options->plugin_wd_url,
106
- ));
107
 
108
-
109
- }
110
- public function submit_and_deactivate(){
111
- $wd_options = $this->config;
112
- if( isset( $_POST[$wd_options->prefix . "_submit_and_deactivate"] ) ){
113
-
114
- if( $_POST[$wd_options->prefix . "_submit_and_deactivate"] == 2 || $_POST[$wd_options->prefix . "_submit_and_deactivate"] == 3 ){
115
- $api = new DoradoWebApi( $wd_options );
116
- $hash = $api->get_hash();
117
- if($hash != null){
118
- $data = array();
119
-
120
- $data["reason"] = isset($_POST[$wd_options->prefix . "_reasons"]) ? $_POST[$wd_options->prefix . "_reasons"] : "";
121
- $data["site_url"] = site_url();
122
- $data["plugin_id"] = $wd_options->wd_plugin_id;
123
-
124
- $data["additional_details"] = isset($_POST[$wd_options->prefix . "_additional_details"]) ? $_POST[$wd_options->prefix . "_additional_details"] : "";
125
- $admin_data = wp_get_current_user();
126
- $data["email"] = isset($_POST[$wd_options->prefix . "_email"]) ? $_POST[$wd_options->prefix . "_email"] : $admin_data->data->user_email;
127
- $user_first_name = get_user_meta( $admin_data->ID, "first_name", true );
128
- $user_last_name = get_user_meta( $admin_data->ID, "last_name", true );
129
-
130
- $data["name"] = $user_first_name || $user_last_name ? $user_first_name . " " . $user_last_name : $admin_data->data->user_login;
131
- $data["hash"] = $hash;
132
- $response = wp_remote_post( "https://api.web-dorado.com/deactivatereasons", array(
133
- 'method' => 'POST',
134
- 'timeout' => 45,
135
- 'redirection' => 5,
136
- 'httpversion' => '1.0',
137
- 'blocking' => true,
138
- 'headers' => array(),
139
- 'body' => json_encode($data),
140
- 'cookies' => array()
141
- )
142
- );
143
 
144
- $response_body = (!is_wp_error($response) && isset( $response["body"] )) ? json_decode( $response["body"], true ) : null;
145
- if( is_array( $response_body ) && $response_body["body"]["msg"] == "Access" ) {
146
-
147
- }
148
- }
149
- }
150
- if($_POST[$wd_options->prefix . "_submit_and_deactivate"] == 2 || $_POST[$wd_options->prefix . "_submit_and_deactivate"] == 1 ){
151
- $deactivate_url =
152
- add_query_arg(
153
- array(
154
- 'action' => 'deactivate',
155
- 'plugin' => plugin_basename( $wd_options->plugin_main_file ),
156
- '_wpnonce' => wp_create_nonce( 'deactivate-plugin_' . plugin_basename( $wd_options->plugin_main_file ) )
157
- ),
158
- admin_url( 'plugins.php' )
159
- );
160
- echo '<script>window.location.href="' . $deactivate_url . '";</script>';
161
- }
162
-
163
- }
164
- }
165
-
166
- ////////////////////////////////////////////////////////////////////////////////////////
167
- // Getters & Setters //
168
- ////////////////////////////////////////////////////////////////////////////////////////
169
- ////////////////////////////////////////////////////////////////////////////////////////
170
- // Private Methods //
171
- ////////////////////////////////////////////////////////////////////////////////////////
172
-
173
- ////////////////////////////////////////////////////////////////////////////////////////
174
- // Listeners //
175
- ////////////////////////////////////////////////////////////////////////////////////////
176
 
 
 
 
 
 
 
 
 
 
 
 
177
  }
178
-
179
-
1
  <?php
2
+ if ( !defined('ABSPATH') ) {
3
+ exit;
4
+ }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
5
 
6
+ class DoradoWebDeactivate {
7
+ public $deactivate_reasons = array();
8
+ public $config;
9
+ // Reason IDs
10
+ const REASON_PLUGIN_IS_HARD_TO_USE_TECHNICAL_PROBLEMS = "reason_plugin_is_hard_to_use_technical_problems";
11
+ const REASON_FREE_VERSION_IS_LIMITED = "reason_free_version_limited";
12
+ const REASON_PRO_EXPENSIVE = "reason_premium_expensive";
13
+ const REASON_TEMPORARY_DEACTIVATION = "reason_temporary_deactivation";
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
14
 
15
+ public function __construct( $config = array() ) {
16
+ $this->config = $config;
17
+ $wd_options = $this->config;
18
+ $this->deactivate_reasons = array(
19
+ 1 => array(
20
+ 'id' => self::REASON_PLUGIN_IS_HARD_TO_USE_TECHNICAL_PROBLEMS,
21
+ 'text' => __('Technical problems / hard to use', $wd_options->prefix),
22
+ ),
23
+ 2 => array(
24
+ 'id' => self::REASON_FREE_VERSION_IS_LIMITED,
25
+ 'text' => __('Free version is limited', $wd_options->prefix),
26
+ ),
27
+ 3 => array(
28
+ 'id' => self::REASON_PRO_EXPENSIVE,
29
+ 'text' => __('Premium is expensive', $wd_options->prefix),
30
+ ),
31
+ 4 => array(
32
+ 'id' => self::REASON_TEMPORARY_DEACTIVATION,
33
+ 'text' => __('Temporary deactivation', $wd_options->prefix),
34
+ ),
35
+ );
36
+ add_action('admin_footer', array( $this, 'add_deactivation_feedback_dialog_box' ));
37
+ add_action('admin_init', array( $this, 'submit_and_deactivate' ));
38
+ add_action('admin_enqueue_scripts', array( $this, 'scripts' ));
39
+ }
40
 
41
+ public function add_deactivation_feedback_dialog_box() {
42
+ $deactivate_reasons = $this->deactivate_reasons;
43
+ $wd_options = $this->config;
44
+ ?>
45
+ <script>
46
+ jQuery(document).ready(function () {
47
+ wdReady("<?php echo $wd_options->prefix; ?>");
48
+ });
49
+ </script>
50
+ <?php
51
+ $deactivate_url = add_query_arg(array(
52
+ 'action' => 'deactivate',
53
+ 'plugin' => plugin_basename($wd_options->plugin_main_file),
54
+ '_wpnonce' => wp_create_nonce('deactivate-plugin_' . plugin_basename($wd_options->plugin_main_file)),
55
+ ), admin_url('plugins.php'));
56
+ require($wd_options->wd_dir_templates . '/display_deactivation_popup.php');
57
+ }
58
 
59
+ public function scripts() {
60
+ $wd_options = $this->config;
61
+ wp_enqueue_style('wd-deactivate-popup', $wd_options->wd_url_css . '/deactivate_popup.css', array(), get_option($wd_options->prefix . "_version"));
62
+ wp_enqueue_script('wd-deactivate-popup', $wd_options->wd_url_js . '/deactivate_popup.js', array(), get_option($wd_options->prefix . "_version"));
63
+ $admin_data = wp_get_current_user();
64
+ wp_localize_script('wd-deactivate-popup', $wd_options->prefix . 'WDDeactivateVars', array(
65
+ "prefix" => $wd_options->prefix,
66
+ "deactivate_class" => $wd_options->prefix . '_deactivate_link',
67
+ "email" => $admin_data->data->user_email,
68
+ "plugin_wd_url" => $wd_options->plugin_wd_url,
69
+ ));
70
+ }
 
71
 
72
+ public function submit_and_deactivate() {
73
+ $wd_options = $this->config;
74
+ if ( isset($_POST[$wd_options->prefix . "_submit_and_deactivate"]) ) {
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
75
 
76
+ if ( $_POST[$wd_options->prefix . "_submit_and_deactivate"] == 2 || $_POST[$wd_options->prefix . "_submit_and_deactivate"] == 3 ) {
77
+ $api = new DoradoWebApi($wd_options);
78
+ $hash = $api->get_hash();
79
+ if ( $hash != NULL ) {
80
+ $data = array();
81
+ $data["reason"] = isset($_POST[$wd_options->prefix . "_reasons"]) ? sanitize_text_field($_POST[$wd_options->prefix . "_reasons"]) : "";
82
+ $data["site_url"] = site_url();
83
+ $data["plugin_id"] = $wd_options->wd_plugin_id;
84
+ $data["additional_details"] = isset($_POST[$wd_options->prefix . "_additional_details"]) ? sanitize_text_field($_POST[$wd_options->prefix . "_additional_details"]) : "";
85
+ $admin_data = wp_get_current_user();
86
+ $data["email"] = isset($_POST[$wd_options->prefix . "_email"]) ? sanitize_email($_POST[$wd_options->prefix . "_email"]) : $admin_data->data->user_email;
87
+ $user_first_name = get_user_meta($admin_data->ID, "first_name", TRUE);
88
+ $user_last_name = get_user_meta($admin_data->ID, "last_name", TRUE);
89
+ $data["name"] = $user_first_name || $user_last_name ? $user_first_name . " " . $user_last_name : $admin_data->data->user_login;
90
+ $data["hash"] = $hash;
91
+ $response = wp_remote_post("https://api.web-dorado.com/deactivatereasons", array(
92
+ 'method' => 'POST',
93
+ 'timeout' => 45,
94
+ 'redirection' => 5,
95
+ 'httpversion' => '1.0',
96
+ 'blocking' => TRUE,
97
+ 'headers' => array(),
98
+ 'body' => json_encode($data),
99
+ 'cookies' => array(),
100
+ ));
101
+ $response_body = (!is_wp_error($response) && isset($response["body"])) ? json_decode($response["body"], TRUE) : NULL;
102
+ if ( is_array($response_body) && $response_body["body"]["msg"] == "Access" ) {
 
 
 
 
 
103
 
104
+ }
105
+ }
106
+ }
107
+ if ( $_POST[$wd_options->prefix . "_submit_and_deactivate"] == 2 || $_POST[$wd_options->prefix . "_submit_and_deactivate"] == 1 ) {
108
+ $deactivate_url = add_query_arg(array(
109
+ 'action' => 'deactivate',
110
+ 'plugin' => plugin_basename($wd_options->plugin_main_file),
111
+ '_wpnonce' => wp_create_nonce('deactivate-plugin_' . plugin_basename($wd_options->plugin_main_file)),
112
+ ), admin_url('plugins.php'));
113
+ echo '<script>window.location.href="' . $deactivate_url . '";</script>';
114
+ }
115
  }
116
+ }
117
+ }
wd/includes/notices.php CHANGED
@@ -1,223 +1,219 @@
1
  <?php
2
- if ( !defined( 'ABSPATH' ) ) {
3
- exit;
4
  }
5
 
6
  class DoradoWebNotices {
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
7
 
8
- protected $promo_link = '';
9
-
10
- public $config;
11
- public $notice_spam = 0;
12
- public $notice_spam_max = 2;
13
 
14
- // Basic actions to run
15
- public function __construct( $config = array() ) {
16
- $this->config = $config;
17
- // Runs the admin notice ignore function incase a dismiss button has been clicked
18
- add_action( 'admin_init', array( $this, 'admin_notice_ignore' ) );
19
- // Runs the admin notice temp ignore function incase a temp dismiss link has been clicked
20
- add_action( 'admin_init', array( $this, 'admin_notice_temp_ignore' ) );
21
- add_action( 'admin_notices', array( $this, 'wd_admin_notices' ) );
22
  }
23
-
24
- // Checks to ensure notices aren't disabled and the user has the correct permissions.
25
- public function wd_admin_notice() {
26
- $wd_options = $this->config;
27
- $settings = get_option($wd_options->prefix . '_admin_notice');
28
- if ( !isset( $settings['disable_admin_notices'] ) || ( isset( $settings['disable_admin_notices'] ) && $settings['disable_admin_notices'] == 0 ) ) {
29
- if ( current_user_can( 'manage_options' ) ) {
30
- return true;
31
- }
32
  }
33
- return false;
34
- }
35
-
36
- // Primary notice function that can be called from an outside function sending necessary variables
37
- public function admin_notice( $admin_notices ) {
38
- $wd_options = $this->config;
39
- // Check options
40
- if ( !$this->wd_admin_notice() ) {
41
- return false;
 
 
 
 
 
 
 
 
 
 
42
  }
43
- foreach ( $admin_notices as $slug => $admin_notice ) {
44
- // Call for spam protection
45
- if ( $this->anti_notice_spam() ) {
46
- return false;
47
- }
48
-
49
- // Check for proper page to display on
50
- if (isset( $admin_notices[$slug]['pages']) && is_array( $admin_notices[$slug]['pages'])) {
51
- if ( !$this->admin_notice_pages( $admin_notices[$slug]['pages'] ) ) {
52
- return false;
53
- }
54
- }
55
-
56
- // Check for required fields
57
- if ( !$this->required_fields( $admin_notices[$slug] ) ) {
58
-
59
- // Get the current date then set start date to either passed value or current date value and add interval
60
- $current_date = current_time( "n/j/Y" );
61
- $start = ( isset( $admin_notices[$slug]['start'] ) ? $admin_notices[$slug]['start'] : $current_date );
62
- $start = date( "n/j/Y", strtotime( $start ) );
63
- $date_array = explode( '/', $start );
64
- $interval = ( isset( $admin_notices[$slug]['int'] ) ? $admin_notices[$slug]['int'] : 0 );
65
-
66
- $date_array[1] += $interval;
67
- $start = date( "n/j/Y", mktime( 0, 0, 0, $date_array[0], $date_array[1], $date_array[2] ) );
68
-
69
- // This is the main notices storage option
70
- $admin_notices_option = get_option( $wd_options->prefix . '_admin_notice', array() );
71
- // Check if the message is already stored and if so just grab the key otherwise store the message and its associated date information
72
- if ( !array_key_exists( $slug, $admin_notices_option ) ) {
73
- $admin_notices_option[$slug]['start'] = $start;
74
- $admin_notices_option[$slug]['int'] = $interval;
75
- update_option( $wd_options->prefix . '_admin_notice', $admin_notices_option );
76
- }
77
-
78
- // Sanity check to ensure we have accurate information
79
- // New date information will not overwrite old date information
80
- $admin_display_check = ( isset( $admin_notices_option[$slug]['dismissed'] ) ? $admin_notices_option[$slug]['dismissed'] : 0 );
81
- $admin_display_start = ( isset( $admin_notices_option[$slug]['start'] ) ? $admin_notices_option[$slug]['start'] : $start );
82
- $admin_display_interval = ( isset($admin_notices_option[$slug]['int'] ) ? $admin_notices_option[$slug]['int'] : $interval );
83
- $admin_display_msg = ( isset($admin_notices[$slug]['msg'] ) ? $admin_notices[$slug]['msg'] : '' );
84
- $admin_display_title = ( isset($admin_notices[$slug]['title'] ) ? $admin_notices[$slug]['title'] : '' );
85
- $admin_display_link = ( isset( $admin_notices[$slug]['link'] ) ? $admin_notices[$slug]['link'] : '' );
86
- $output_css = false;
87
-
88
- // Ensure the notice hasn't been hidden and that the current date is after the start date
89
- if ( $admin_display_check == 0 && strtotime($admin_display_start) <= strtotime($current_date ) ) {
90
-
91
- // Get remaining query string
92
- $query_str = ( isset( $admin_notices[$slug]['later_link'] ) ? $admin_notices[$slug]['later_link'] : esc_url(add_query_arg( $wd_options->prefix . '_admin_notice_ignore', $slug ) ) );
93
- if ( strpos($slug, 'promo' ) === FALSE ) {
94
- // Admin notice display output
95
- echo '<div class="update-nag wd-admin-notice">
96
  <div class="wd-notice-logo" style="background-image: url(' . $wd_options->wd_url_img . '/' . $wd_options->prefix . '_main_plugin.png);"></div>
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>
100
  <a href="' . $query_str . '" class="dashicons dashicons-dismiss"></a>
101
  </div>';
102
- }
103
- else {
104
- echo '<div class="admin-notice-promo">';
105
- echo $admin_display_msg;
106
- echo '<ul class="notice-body-promo blue">
107
  ' . $admin_display_link . '
108
  </ul>';
109
- echo '<a href="' . $query_str . '" class="dashicons dashicons-dismiss close-promo"></a>';
110
- echo '</div>';
111
- }
112
- $this->notice_spam += 1;
113
- $output_css = true;
114
- }
115
- if ( $output_css ) {
116
- wp_enqueue_style( $wd_options->prefix . '-admin-notices', $wd_options->wd_url_css . '/notices.css', array(), get_option($wd_options->prefix . "_version" ) );
117
- }
118
- }
119
  }
120
- }
121
-
122
- // Spam protection check
123
- public function anti_notice_spam() {
124
- if ( $this->notice_spam >= $this->notice_spam_max ) {
125
- return true;
126
  }
127
- return false;
128
  }
 
129
 
130
- // Ignore function that gets ran at admin init to ensure any messages that were dismissed get marked
131
- public function admin_notice_ignore() {
132
- $wd_options = $this->config;
133
- // If user clicks to ignore the notice, update the option to not show it again
134
- if ( isset( $_GET[$wd_options->prefix . '_admin_notice_ignore'] ) ) {
135
- $admin_notices_option = get_option( $wd_options->prefix . '_admin_notice', array() );
136
- $admin_notices_option[$_GET[$wd_options->prefix . '_admin_notice_ignore']]['dismissed'] = 1;
137
- update_option( $wd_options->prefix . '_admin_notice', $admin_notices_option );
138
- $query_str = remove_query_arg( $wd_options->prefix . '_admin_notice_ignore' );
139
- wp_redirect( $query_str );
140
- exit;
141
- }
142
  }
143
 
144
- // Temp Ignore function that gets ran at admin init to ensure any messages that were temp dismissed get their start date changed
145
- public function admin_notice_temp_ignore() {
146
- $wd_options = $this->config;
147
- // If user clicks to temp ignore the notice, update the option to change the start date - default interval of 14 days
148
- if ( isset( $_GET[$wd_options->prefix . '_admin_notice_temp_ignore'] ) ) {
149
- $admin_notices_option = get_option( $wd_options->prefix . '_admin_notice', array() );
150
- $current_date = current_time( "n/j/Y" );
151
- $date_array = explode( '/', $current_date );
152
- $interval = (isset($_GET['wd_int']) ? $_GET['wd_int'] : 14);
153
- $date_array[1] += $interval;
154
- $new_start = date( "n/j/Y", mktime( 0, 0, 0, $date_array[0], $date_array[1], $date_array[2] ) );
155
-
156
- $admin_notices_option[$_GET[$wd_options->prefix . '_admin_notice_temp_ignore']]['start'] = $new_start;
157
- $admin_notices_option[$_GET[$wd_options->prefix . '_admin_notice_temp_ignore']]['dismissed'] = 0;
158
- update_option( $wd_options->prefix . '_admin_notice', $admin_notices_option );
159
- $query_str = remove_query_arg( array( $wd_options->prefix . '_admin_notice_temp_ignore', 'wd_int' ) );
160
- wp_redirect( $query_str );
161
- exit;
162
- }
163
  }
164
-
165
- public function admin_notice_pages($pages) {
166
- $wd_options = $this->config;
167
- foreach ( $pages as $key => $page ) {
168
- if (is_array($page)) {
169
- if ( isset( $_GET['page'] ) && $_GET['page'] == $page[0] && isset($_GET['tab']) && $_GET['tab'] == $page[1] ) {
170
- return true;
171
- }
172
- }
173
- else {
174
- if ( $page == 'all' ) {
175
- return true;
176
- }
177
- if ( get_current_screen()->id === $page ) {
178
- return true;
179
- }
180
- if ( isset($_GET['page']) && $_GET['page'] == $page ) {
181
- return true;
182
- }
183
- }
184
- return false;
185
- }
186
  }
187
-
188
- // Required fields check
189
- public function required_fields( $fields ) {
190
- if ( !isset( $fields['msg'] ) || ( isset($fields['msg'] ) && empty( $fields['msg'] ) ) ) {
191
- return true;
 
 
 
192
  }
193
- if ( !isset( $fields['title'] ) || ( isset( $fields['title'] ) && empty( $fields['title'] ) ) ) {
194
- return true;
 
 
195
  }
196
- return false;
197
- }
 
 
 
 
 
198
 
199
- // Special parameters function that is to be used in any extension of this class
200
- public function special_parameters($admin_notices) {
201
- // Intentionally left blank
202
  }
 
203
 
204
- public function wd_admin_notices() {
205
- $wd_options = $this->config;
206
- $two_week_review_ignore = add_query_arg( array( $wd_options->prefix . '_admin_notice_ignore' => 'two_week_review' ) );
207
- $two_week_review_temp = add_query_arg( array( $wd_options->prefix . '_admin_notice_temp_ignore' => 'two_week_review', 'int' => 14 ) );
208
- $promo_close = add_query_arg( array( $wd_options->prefix . '_admin_notice_ignore' => 'ecommerce_promo' ) );
 
 
 
209
 
210
- $notices['two_week_review'] = array(
211
- 'title' => __('Leave A Review?', $wd_options->prefix),
212
- 'msg' => sprintf(__('We hope you\'ve enjoyed using WordPress %s! Would you consider leaving us a review on WordPress.org?', $wd_options->prefix), $wd_options->plugin_title),
213
- 'link' => '<li><span class="dashicons dashicons-external"></span><a href="https://wordpress.org/support/plugin/' . $wd_options->plugin_wordpress_slug . '/reviews?filter=5&rate=5#new-post" target="_blank">' . __('Sure! I\'d love to!', $wd_options->prefix) . '</a></li>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
214
  <li><span class="dashicons dashicons-smiley"></span><a href="' . $two_week_review_ignore . '"> ' . __('I\'ve already left a review', $wd_options->prefix) . '</a></li>
215
  <li><span class="dashicons dashicons-calendar-alt"></span><a href="' . $two_week_review_temp . '">' . __('Maybe Later', $wd_options->prefix) . '</a></li>
216
  <li><span class="dashicons dashicons-dismiss"></span><a href="' . $two_week_review_ignore . '">' . __('Never show again', $wd_options->prefix) . '</a></li>',
217
- 'later_link' => $two_week_review_temp,
218
- 'int' => 14
219
- );
220
-
221
- $this->admin_notice($notices);
222
- }
223
  }
1
  <?php
2
+ if ( !defined('ABSPATH') ) {
3
+ exit;
4
  }
5
 
6
  class DoradoWebNotices {
7
+ protected $promo_link = '';
8
+ public $config;
9
+ public $notice_spam = 0;
10
+ public $notice_spam_max = 2;
11
+
12
+ // Basic actions to run
13
+ public function __construct( $config = array() ) {
14
+ $this->config = $config;
15
+ // Runs the admin notice ignore function incase a dismiss button has been clicked
16
+ add_action('admin_init', array( $this, 'admin_notice_ignore' ));
17
+ // Runs the admin notice temp ignore function incase a temp dismiss link has been clicked
18
+ add_action('admin_init', array( $this, 'admin_notice_temp_ignore' ));
19
+ add_action('admin_notices', array( $this, 'wd_admin_notices' ));
20
+ }
21
+
22
+ // Checks to ensure notices aren't disabled and the user has the correct permissions.
23
+ public function wd_admin_notice() {
24
+ $wd_options = $this->config;
25
+ $settings = get_option($wd_options->prefix . '_admin_notice');
26
+ if ( !isset($settings['disable_admin_notices']) || (isset($settings['disable_admin_notices']) && $settings['disable_admin_notices'] == 0) ) {
27
+ if ( current_user_can('manage_options') ) {
28
+ return TRUE;
29
+ }
30
+ }
31
 
32
+ return FALSE;
33
+ }
 
 
 
34
 
35
+ // Primary notice function that can be called from an outside function sending necessary variables
36
+ public function admin_notice( $admin_notices ) {
37
+ $wd_options = $this->config;
38
+ // Check options
39
+ if ( !$this->wd_admin_notice() ) {
40
+ return FALSE;
 
 
41
  }
42
+ foreach ( $admin_notices as $slug => $admin_notice ) {
43
+ // Call for spam protection
44
+ if ( $this->anti_notice_spam() ) {
45
+ return FALSE;
46
+ }
47
+ // Check for proper page to display on
48
+ if ( isset($admin_notices[$slug]['pages']) && is_array($admin_notices[$slug]['pages']) ) {
49
+ if ( !$this->admin_notice_pages($admin_notices[$slug]['pages']) ) {
50
+ return FALSE;
51
  }
52
+ }
53
+ // Check for required fields
54
+ if ( !$this->required_fields($admin_notices[$slug]) ) {
55
+
56
+ // Get the current date then set start date to either passed value or current date value and add interval
57
+ $current_date = current_time("n/j/Y");
58
+ $start = (isset($admin_notices[$slug]['start']) ? $admin_notices[$slug]['start'] : $current_date);
59
+ $start = date("n/j/Y", strtotime($start));
60
+ $date_array = explode('/', $start);
61
+ $interval = (isset($admin_notices[$slug]['int']) ? $admin_notices[$slug]['int'] : 0);
62
+ $date_array[1] += $interval;
63
+ $start = date("n/j/Y", mktime(0, 0, 0, $date_array[0], $date_array[1], $date_array[2]));
64
+ // This is the main notices storage option
65
+ $admin_notices_option = get_option($wd_options->prefix . '_admin_notice', array());
66
+ // Check if the message is already stored and if so just grab the key otherwise store the message and its associated date information
67
+ if ( !array_key_exists($slug, $admin_notices_option) ) {
68
+ $admin_notices_option[$slug]['start'] = $start;
69
+ $admin_notices_option[$slug]['int'] = $interval;
70
+ update_option($wd_options->prefix . '_admin_notice', $admin_notices_option);
71
  }
72
+ // Sanity check to ensure we have accurate information
73
+ // New date information will not overwrite old date information
74
+ $admin_display_check = (isset($admin_notices_option[$slug]['dismissed']) ? $admin_notices_option[$slug]['dismissed'] : 0);
75
+ $admin_display_start = (isset($admin_notices_option[$slug]['start']) ? $admin_notices_option[$slug]['start'] : $start);
76
+ $admin_display_interval = (isset($admin_notices_option[$slug]['int']) ? $admin_notices_option[$slug]['int'] : $interval);
77
+ $admin_display_msg = (isset($admin_notices[$slug]['msg']) ? $admin_notices[$slug]['msg'] : '');
78
+ $admin_display_title = (isset($admin_notices[$slug]['title']) ? $admin_notices[$slug]['title'] : '');
79
+ $admin_display_link = (isset($admin_notices[$slug]['link']) ? $admin_notices[$slug]['link'] : '');
80
+ $output_css = FALSE;
81
+ // Ensure the notice hasn't been hidden and that the current date is after the start date
82
+ if ( $admin_display_check == 0 && strtotime($admin_display_start) <= strtotime($current_date) ) {
83
+
84
+ // Get remaining query string
85
+ $query_str = (isset($admin_notices[$slug]['later_link']) ? $admin_notices[$slug]['later_link'] : esc_url(add_query_arg($wd_options->prefix . '_admin_notice_ignore', $slug)));
86
+ if ( strpos($slug, 'promo') === FALSE ) {
87
+ // Admin notice display output
88
+ echo '<div class="update-nag wd-admin-notice">
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
89
  <div class="wd-notice-logo" style="background-image: url(' . $wd_options->wd_url_img . '/' . $wd_options->prefix . '_main_plugin.png);"></div>
90
  <p class="wd-notice-title">' . $admin_display_title . '</p>
91
  <p class="wd-notice-body">' . $admin_display_msg . '</p>
92
  <ul class="wd-notice-body wd-blue">' . $admin_display_link . '</ul>
93
  <a href="' . $query_str . '" class="dashicons dashicons-dismiss"></a>
94
  </div>';
95
+ }
96
+ else {
97
+ echo '<div class="admin-notice-promo">';
98
+ echo $admin_display_msg;
99
+ echo '<ul class="notice-body-promo blue">
100
  ' . $admin_display_link . '
101
  </ul>';
102
+ echo '<a href="' . $query_str . '" class="dashicons dashicons-dismiss close-promo"></a>';
103
+ echo '</div>';
104
+ }
105
+ $this->notice_spam += 1;
106
+ $output_css = TRUE;
 
 
 
 
 
107
  }
108
+ if ( $output_css ) {
109
+ wp_enqueue_style($wd_options->prefix . '-admin-notices', $wd_options->wd_url_css . '/notices.css', array(), get_option($wd_options->prefix . "_version"));
 
 
 
 
110
  }
111
+ }
112
  }
113
+ }
114
 
115
+ // Spam protection check
116
+ public function anti_notice_spam() {
117
+ if ( $this->notice_spam >= $this->notice_spam_max ) {
118
+ return TRUE;
 
 
 
 
 
 
 
 
119
  }
120
 
121
+ return FALSE;
122
+ }
123
+
124
+ // Ignore function that gets ran at admin init to ensure any messages that were dismissed get marked
125
+ public function admin_notice_ignore() {
126
+ $wd_options = $this->config;
127
+ // If user clicks to ignore the notice, update the option to not show it again
128
+ if ( isset($_GET[$wd_options->prefix . '_admin_notice_ignore']) ) {
129
+ $admin_notices_option = get_option($wd_options->prefix . '_admin_notice', array());
130
+ $admin_notices_option[sanitize_text_field($_GET[$wd_options->prefix . '_admin_notice_ignore'])]['dismissed'] = 1;
131
+ update_option($wd_options->prefix . '_admin_notice', $admin_notices_option);
132
+ $query_str = remove_query_arg($wd_options->prefix . '_admin_notice_ignore');
133
+ wp_redirect($query_str);
134
+ exit;
 
 
 
 
 
135
  }
136
+ }
137
+
138
+ // Temp Ignore function that gets ran at admin init to ensure any messages that were temp dismissed get their start date changed
139
+ public function admin_notice_temp_ignore() {
140
+ $wd_options = $this->config;
141
+ // If user clicks to temp ignore the notice, update the option to change the start date - default interval of 14 days
142
+ if ( isset($_GET[$wd_options->prefix . '_admin_notice_temp_ignore']) ) {
143
+ $admin_notices_option = get_option($wd_options->prefix . '_admin_notice', array());
144
+ $current_date = current_time("n/j/Y");
145
+ $date_array = explode('/', $current_date);
146
+ $interval = (isset($_GET['wd_int']) ? intval($_GET['wd_int']) : 14);
147
+ $date_array[1] += $interval;
148
+ $new_start = date("n/j/Y", mktime(0, 0, 0, $date_array[0], $date_array[1], $date_array[2]));
149
+ $admin_notices_option[sanitize_text_field($_GET[$wd_options->prefix . '_admin_notice_temp_ignore'])]['start'] = $new_start;
150
+ $admin_notices_option[sanitize_text_field($_GET[$wd_options->prefix . '_admin_notice_temp_ignore'])]['dismissed'] = 0;
151
+ update_option($wd_options->prefix . '_admin_notice', $admin_notices_option);
152
+ $query_str = remove_query_arg(array( $wd_options->prefix . '_admin_notice_temp_ignore', 'wd_int' ));
153
+ wp_redirect($query_str);
154
+ exit;
 
 
 
155
  }
156
+ }
157
+
158
+ public function admin_notice_pages( $pages ) {
159
+ $wd_options = $this->config;
160
+ foreach ( $pages as $key => $page ) {
161
+ if ( is_array($page) ) {
162
+ if ( isset($_GET['page']) && $_GET['page'] == $page[0] && isset($_GET['tab']) && $_GET['tab'] == $page[1] ) {
163
+ return TRUE;
164
  }
165
+ }
166
+ else {
167
+ if ( $page == 'all' ) {
168
+ return TRUE;
169
  }
170
+ if ( get_current_screen()->id === $page ) {
171
+ return TRUE;
172
+ }
173
+ if ( isset($_GET['page']) && $_GET['page'] == $page ) {
174
+ return TRUE;
175
+ }
176
+ }
177
 
178
+ return FALSE;
 
 
179
  }
180
+ }
181
 
182
+ // Required fields check
183
+ public function required_fields( $fields ) {
184
+ if ( !isset($fields['msg']) || (isset($fields['msg']) && empty($fields['msg'])) ) {
185
+ return TRUE;
186
+ }
187
+ if ( !isset($fields['title']) || (isset($fields['title']) && empty($fields['title'])) ) {
188
+ return TRUE;
189
+ }
190
 
191
+ return FALSE;
192
+ }
193
+
194
+ // Special parameters function that is to be used in any extension of this class
195
+ public function special_parameters( $admin_notices ) {
196
+ // Intentionally left blank
197
+ }
198
+
199
+ public function wd_admin_notices() {
200
+ $wd_options = $this->config;
201
+ $two_week_review_ignore = add_query_arg(array( $wd_options->prefix . '_admin_notice_ignore' => 'two_week_review' ));
202
+ $two_week_review_temp = add_query_arg(array(
203
+ $wd_options->prefix . '_admin_notice_temp_ignore' => 'two_week_review',
204
+ 'int' => 14,
205
+ ));
206
+ $promo_close = add_query_arg(array( $wd_options->prefix . '_admin_notice_ignore' => 'ecommerce_promo' ));
207
+ $notices['two_week_review'] = array(
208
+ 'title' => __('Leave A Review?', $wd_options->prefix),
209
+ '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),
210
+ 'link' => '<li><span class="dashicons dashicons-external"></span><a href="https://wordpress.org/support/plugin/' . $wd_options->plugin_wordpress_slug . '/reviews?filter=5&rate=5#new-post" target="_blank">' . __('Sure! I\'d love to!', $wd_options->prefix) . '</a></li>
211
  <li><span class="dashicons dashicons-smiley"></span><a href="' . $two_week_review_ignore . '"> ' . __('I\'ve already left a review', $wd_options->prefix) . '</a></li>
212
  <li><span class="dashicons dashicons-calendar-alt"></span><a href="' . $two_week_review_temp . '">' . __('Maybe Later', $wd_options->prefix) . '</a></li>
213
  <li><span class="dashicons dashicons-dismiss"></span><a href="' . $two_week_review_ignore . '">' . __('Never show again', $wd_options->prefix) . '</a></li>',
214
+ 'later_link' => $two_week_review_temp,
215
+ 'int' => 14,
216
+ );
217
+ $this->admin_notice($notices);
218
+ }
 
219
  }
wd/includes/overview.php CHANGED
@@ -1,312 +1,292 @@
1
  <?php
2
- if ( !defined( 'ABSPATH' ) ) {
3
- exit;
4
- }
5
-
6
- class DoradoWebOverview{
7
- ////////////////////////////////////////////////////////////////////////////////////////
8
- // Events //
9
- ////////////////////////////////////////////////////////////////////////////////////////
10
- ////////////////////////////////////////////////////////////////////////////////////////
11
- // Constants //
12
- ////////////////////////////////////////////////////////////////////////////////////////
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 ),
28
- 'view' => array( $this, 'wd_overview_welcome' )
29
- ),
30
- 'user_guide' => array(
31
- 'name' => __( "User Guide", $wd_options->prefix ),
32
- 'view' => array( $this, 'wd_overview_user_guide' )
33
- ),
34
- 'deals' => array(
35
- 'name' => __( 'Deals', $wd_options->prefix ),
36
- 'view' => array( $this, 'wd_overview_deals' )
37
- ),
38
- 'support' => array(
39
- 'name' => __( "Support", $wd_options->prefix ),
40
- 'view' => array( $this, 'wd_overview_support' )
41
- ),
42
- 'https://web-dorado.com/support/submit-your-idea.html' => array(
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
- );
51
-
52
-
53
-
54
- }
55
- ////////////////////////////////////////////////////////////////////////////////////////
56
- // Public Methods //
57
- ////////////////////////////////////////////////////////////////////////////////////////
58
- public function display_overview_page(){
59
- $wd_options = $this->config;
60
- $tabs = $this->tabs;
61
- $start_using_url = "";
62
- if(!empty($this->config->custom_post)) {
63
- if (strpos($this->config->custom_post, 'post_type', 0) !== false) {
64
- $start_using_url = admin_url($this->config->custom_post);
65
- } else {
66
- $start_using_url = menu_page_url($this->config->custom_post, false);
67
- }
68
- }
69
- require_once( $wd_options->wd_dir_templates . "/display_overview.php" );
70
- }
71
- public function wd_overview_welcome(){
72
- $wd_options = $this->config;
73
- //http://api.wordpress.org/plugins/info/1.0/wd-google-maps
74
- require_once( $wd_options->wd_dir_templates . "/display_overview_welcome.php" );
75
- }
76
- public function wd_overview_user_guide(){
77
- $wd_options = $this->config;
78
- $user_guide = $wd_options->user_guide;
79
- require_once( $wd_options->wd_dir_templates . "/display_overview_user_guide.php" );
80
- }
81
- public function wd_overview_deals(){
82
-
83
- $wd_options = $this->config;
84
- $plugins = array(
85
- "form-maker" => array(
86
- 'title' => 'Form Maker',
87
- 'text' => __( 'Wordpress form builder plugin', $wd_options->prefix ),
88
- 'content' => __( 'Form Maker is a modern and advanced tool for creating WordPress forms easily and fast.', $wd_options->prefix ),
89
- 'href' => 'https://web-dorado.com/products/wordpress-form.html'
90
- ),
91
- "photo-gallery" => array(
92
- 'title' => 'Photo Gallery',
93
- 'text' => __( 'WordPress Photo Gallery plugin', $wd_options->prefix ),
94
- 'content' => __( 'Photo Gallery is a fully responsive WordPress Gallery plugin with advanced functionality.', $wd_options->prefix ),
95
- 'href' => 'https://web-dorado.com/products/wordpress-photo-gallery-plugin.html'
96
- ),
97
- "event-calendar-wd" => array(
98
- 'title' => 'Event Calendar WD',
99
- 'text' => __( 'WordPress calendar plugin', $wd_options->prefix ),
100
- 'content' => __( 'Organize and publish your events in an easy and elegant way using Event Calendar WD.', $wd_options->prefix ),
101
- 'href' => 'https://web-dorado.com/products/wordpress-event-calendar-wd.html'
102
- ),
103
- "wd-google-maps" => array(
104
- 'title' => 'WD Google Maps',
105
- 'text' => __( 'WD Google Maps plugin', $wd_options->prefix ),
106
- 'content' => __( 'Google Maps WD is an intuitive tool for creating Google maps with advanced markers, custom layers and overlays for your website.', $wd_options->prefix ),
107
- 'href' => 'https://web-dorado.com/products/wordpress-google-maps-plugin.html'
108
- ),
109
- "slider-wd" => array(
110
- 'title' => 'Slider WD',
111
- 'text' => __( 'WordPress slider plugin', $wd_options->prefix ),
112
- 'content' => __( 'Create responsive, highly configurable sliders with various effects for your WordPress site.', $wd_options->prefix ),
113
- 'href' => 'https://web-dorado.com/products/wordpress-slider-plugin.html'
114
- ),
115
- "spider-event-calendar" => array(
116
- 'title' => 'Spider Calendar',
117
- 'text' => __( 'WordPress event calendar plugin', $wd_options->prefix ),
118
- 'content' => __( 'Spider Event Calendar is a highly configurable product which allows you to have multiple organized events.', $wd_options->prefix ),
119
- 'href' => 'https://web-dorado.com/products/wordpress-calendar.html'
120
- ),
121
- "wd-instagram-feed" => array(
122
- 'title' => 'Instagram Feed WD',
123
- 'text' => __( 'WordPress Instagram Feed plugin', $wd_options->prefix ),
124
- 'content' => __( 'WD Instagram Feed is a user-friendly tool for displaying user or hashtag-based feeds on your website.', $wd_options->prefix ),
125
- 'href' => 'https://web-dorado.com/products/wordpress-instagram-feed-wd.html'
126
- ),
127
- );
128
- unset($plugins[$wd_options->plugin_wordpress_slug]) ;
129
-
130
- // foreach ( $plugins as $wp_slug => &$plugin ){
131
- // $wp_data = $this->
132
- //remote_get($wp_slug);
133
- // $plugin["downloaded"] = $wp_data["downloaded"];
134
- // $plugin["rating"] = $wp_data["rating"];
135
- // }
136
-
137
- $themes = array(
138
- "business_elite" => array(
139
- 'title' => 'Business Elite Theme',
140
- 'href' => 'https://web-dorado.com/wordpress-themes/business-elite.html'
141
- ),
142
- "portfolio_gallery" => array(
143
- 'title' => 'Portfolio Gallery Theme',
144
- 'href' => 'https://web-dorado.com/wordpress-themes/portfolio-gallery.html'
145
- ),
146
- "sauron" => array(
147
- 'title' => 'Sauron Theme',
148
- 'href' => 'https://web-dorado.com/wordpress-themes/sauron.html'
149
- ),
150
- "business_world" => array(
151
- 'title' => 'Business World Theme',
152
- 'href' => 'https://web-dorado.com/wordpress-themes/business-world.html'
153
- ),
154
- );
155
-
156
- require_once( $wd_options->wd_dir_templates . "/display_overview_deals.php" );
157
- }
158
- public function wd_overview_support(){
159
- $wd_options = $this->config;
160
- global $wpdb;
161
- $server_info = array();
162
-
163
- // Get PHP Version
164
- $server_info["Operating System"] = PHP_OS . " (" . ( PHP_INT_SIZE * 8 ) . ")";
165
- $server_info["PHP Version"] = PHP_VERSION;
166
- $server_info["Server"] = $_SERVER["SERVER_SOFTWARE"];
167
-
168
- // Get MYSQL Version
169
- $sql_version = $wpdb->get_var( "SELECT VERSION() AS version" );
170
- $server_info["MySQL Version"] = $sql_version;
171
-
172
- // GET SQL Mode
173
- $mysqlinfo = $wpdb->get_results( "SHOW VARIABLES LIKE 'sql_mode'" );
174
- if ( is_array( $mysqlinfo ) )
175
- $sql_mode = $mysqlinfo[0]->Value;
176
- if ( empty( $sql_mode ) )
177
- $sql_mode = __( 'Not set', $wd_options->prefix );
178
- $server_info["SQL Mode"] = $sql_mode;
179
-
180
- // Get PHP allow_url_fopen
181
- if( ini_get( 'allow_url_fopen' ) )
182
- $allow_url_fopen = __( 'On', $wd_options->prefix );
183
- else
184
- $allow_url_fopen = __( 'Off', $wd_options->prefix );
185
- $server_info["PHP Allow URL fopen"] = $allow_url_fopen;
186
-
187
- // Get PHP Max Upload Size
188
- if (function_exists('wp_max_upload_size'))
189
- $upload_max = strval(round((int) wp_max_upload_size() / (1024 * 1024))) . 'M';
190
- else if(ini_get('upload_max_filesize'))
191
- $upload_max = ini_get('upload_max_filesize');
192
- else
193
- $upload_max = __('N/A', $wd_options->prefix);
194
 
195
- $server_info["PHP Max Upload Size"] = $upload_max;
 
 
196
 
197
- // Get PHP Output buffer Size
198
- if( ini_get( 'pcre.backtrack_limit' ) )
199
- $backtrack_limit = ini_get( 'pcre.backtrack_limit' );
200
- else
201
- $backtrack_limit = __( 'N/A', $wd_options->prefix );
202
- $server_info["PCRE Backtracking Limit"] = $backtrack_limit;
203
-
204
- // Get PHP Max Post Size
205
- if( ini_get( 'post_max_size' ) )
206
- $post_max = ini_get( 'post_max_size' );
207
- else
208
- $post_max = __( 'N/A', $wd_options->prefix );
209
- $server_info["PHP Max Post Size"] = $post_max;
210
-
211
- // Get PHP Max execution time
212
- if( ini_get( 'max_execution_time' ) )
213
- $max_execute = ini_get( 'max_execution_time' );
214
- else
215
- $max_execute = __( 'N/A', $wd_options->prefix );
216
- $server_info["PHP Max Script Execute Time"] = $max_execute;
 
 
 
 
 
 
 
 
 
 
217
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
218
 
219
- // Get PHP Memory Limit
220
- if( ini_get( 'memory_limit' ) )
221
- $memory_limit = ini_get( 'memory_limit' );
222
- else
223
- $memory_limit = __( 'N/A', $wd_options->prefix );
224
- $server_info["PHP Memory Limit"] = $memory_limit;
225
 
226
- // Get actual memory_get_usage
227
- if ( function_exists( 'memory_get_usage' ) )
228
- $memory_usage = round( memory_get_usage() / 1024 / 1024, 2 ) . __( ' MByte', $wd_options->prefix );
229
- else
230
- $memory_usage = __( 'N/A', $wd_options->prefix );
231
- $server_info["Memory usage"] = $memory_usage;
232
 
233
- // required for EXIF read
234
- if ( is_callable( 'exif_read_data' ) )
235
- $exif = __( 'Yes', $wd_options->prefix ). " (V" . substr( phpversion( 'exif' ), 0, 4 ) . ")" ;
236
- else
237
- $exif = __( 'No', $wd_options->prefix );
238
- $server_info["PHP Exif support"] = $exif;
239
 
240
- // required for meta data
241
- if ( is_callable( 'iptcparse' ) )
242
- $iptc = __( 'Yes', $wd_options->prefix );
243
- else
244
- $iptc = __( 'No', $wd_options->prefix );
245
- $server_info["PHP IPTC support"] = $iptc;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
246
 
247
- // required for meta data
248
- if ( is_callable( 'xml_parser_create' ) )
249
- $xml = __( 'Yes', $wd_options->prefix );
250
- else
251
- $xml = __( 'No', $wd_options->prefix );
252
- $server_info["PHP XML support"] = $xml;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
253
 
254
- $gd_info = array( "GD support" => __( 'No', $wd_options->prefix ) );
255
- if( function_exists( "gd_info" ) ){
256
- $gd_info = array();
257
- foreach( gd_info() as $key => $val ){
258
- if( is_bool($val) ){
259
- $gd_info[$key] = $val ? __( 'Yes', $wd_options->prefix ) : __( 'No', $wd_options->prefix );
260
- }
261
- else{
262
- $gd_info[$key] = $val;
263
- }
264
- }
265
- }
266
 
267
- require_once( $wd_options->wd_dir_templates . "/display_overview_support.php" );
268
- }
 
 
 
269
 
270
- public function overview_styles() {
271
- $wd_options = $this->config;
272
- $version = get_option( $wd_options->prefix . "_version" );
273
- wp_enqueue_style( $wd_options->prefix . '_overview_css', $wd_options->wd_url_css . '/overview.css', array(), $version );
 
 
 
 
 
 
 
 
 
 
274
 
275
- }
276
- public function overview_scripts() {
277
- $wd_options = $this->config;
278
- $version = get_option( $wd_options->prefix . "_version" );
279
- wp_enqueue_script( $wd_options->prefix . '_overview_js', $wd_options->wd_url_js . '/overview.js', array(), $version );
280
 
281
- }
282
- ////////////////////////////////////////////////////////////////////////////////////////
283
- // Getters & Setters //
284
- ////////////////////////////////////////////////////////////////////////////////////////
285
- ////////////////////////////////////////////////////////////////////////////////////////
286
- // Private Methods //
287
- ////////////////////////////////////////////////////////////////////////////////////////
288
- private function remote_get($plugin_wp_slug){
289
- $request = wp_remote_get(" http://api.wordpress.org/plugins/info/1.0/" . $plugin_wp_slug);
290
- $data = array();
291
- if (!is_wp_error($request) || wp_remote_retrieve_response_code($request) === 200) {
292
- $body = unserialize($request['body']);
293
- $data["downloaded"] = $body->downloaded;
294
- $ratings = $body->ratings;
295
- if( $ratings[5] == 0 && $ratings[4] == 0 && $ratings[3] == 0 && $ratings[2] == 0 && $ratings[1] == 0){
296
- $data["rating"] = 100;
297
- }
298
- else{
299
- $data["rating"] = round( ( ( $ratings[5] * 5 + $ratings[4] * 4 + $ratings[3] * 3 + $ratings[2] * 2 + $ratings[1] * 1 ) / $body->num_ratings ) , 1 );
300
-
301
- $data["rating"] = round( ( $data["rating"] / 5 ) * 100 );
302
- }
303
- return $data;
304
- }
305
- return false;
306
-
307
- }
308
- ////////////////////////////////////////////////////////////////////////////////////////
309
- // Listeners //
310
- ////////////////////////////////////////////////////////////////////////////////////////
311
-
312
- }
1
  <?php
2
+ if ( !defined('ABSPATH') ) {
3
+ exit;
4
+ }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
5
 
6
+ class DoradoWebOverview {
7
+ public $config;
8
+ private $tabs = array();
9
 
10
+ public function __construct( $config = array() ) {
11
+ $this->config = $config;
12
+ $wd_options = $this->config;
13
+ $this->tabs = array(
14
+ 'welcome' => array(
15
+ 'name' => __("Welcome", $wd_options->prefix),
16
+ 'view' => array( $this, 'wd_overview_welcome' ),
17
+ ),
18
+ 'user_guide' => array(
19
+ 'name' => __("User Guide", $wd_options->prefix),
20
+ 'view' => array( $this, 'wd_overview_user_guide' ),
21
+ ),
22
+ 'deals' => array(
23
+ 'name' => __('Deals', $wd_options->prefix),
24
+ 'view' => array( $this, 'wd_overview_deals' ),
25
+ ),
26
+ 'support' => array(
27
+ 'name' => __("Support", $wd_options->prefix),
28
+ 'view' => array( $this, 'wd_overview_support' ),
29
+ ),
30
+ 'https://web-dorado.com/support/submit-your-idea.html' => array(
31
+ 'name' => __("Submit Your Idea", $wd_options->prefix),
32
+ 'view' => FALSE,
33
+ ),
34
+ 'https://wordpress.org/support/plugin/' . $wd_options->plugin_wordpress_slug => array(
35
+ 'name' => __("Forum", $wd_options->prefix),
36
+ 'view' => FALSE,
37
+ ),
38
+ );
39
+ }
40
 
41
+ public function display_overview_page() {
42
+ $wd_options = $this->config;
43
+ $tabs = $this->tabs;
44
+ $start_using_url = "";
45
+ if ( !empty($this->config->custom_post) ) {
46
+ if ( strpos($this->config->custom_post, 'post_type', 0) !== FALSE ) {
47
+ $start_using_url = admin_url($this->config->custom_post);
48
+ }
49
+ else {
50
+ $start_using_url = menu_page_url($this->config->custom_post, FALSE);
51
+ }
52
+ }
53
+ if ( !empty($this->config->start_using_url) ) {
54
+ $start_using_url = $this->config->start_using_url;
55
+ }
56
+ require_once($wd_options->wd_dir_templates . "/display_overview.php");
57
+ }
58
 
59
+ public function wd_overview_welcome() {
60
+ $wd_options = $this->config;
61
+ //http://api.wordpress.org/plugins/info/1.0/wd-google-maps
62
+ require_once($wd_options->wd_dir_templates . "/display_overview_welcome.php");
63
+ }
 
64
 
65
+ public function wd_overview_user_guide() {
66
+ $wd_options = $this->config;
67
+ $user_guide = $wd_options->user_guide;
68
+ require_once($wd_options->wd_dir_templates . "/display_overview_user_guide.php");
69
+ }
 
70
 
71
+ public function wd_overview_deals() {
 
 
 
 
 
72
 
73
+ $wd_options = $this->config;
74
+ $plugins = array(
75
+ "form-maker" => array(
76
+ 'title' => 'Form Maker',
77
+ 'text' => __('Wordpress form builder plugin', $wd_options->prefix),
78
+ 'content' => __('Form Maker is a modern and advanced tool for creating WordPress forms easily and fast.', $wd_options->prefix),
79
+ 'href' => 'https://web-dorado.com/files/fromFormMaker.php',
80
+ ),
81
+ "photo-gallery" => array(
82
+ 'title' => 'Photo Gallery',
83
+ 'text' => __('WordPress Photo Gallery plugin', $wd_options->prefix),
84
+ 'content' => __('Photo Gallery is a fully responsive WordPress Gallery plugin with advanced functionality.', $wd_options->prefix),
85
+ 'href' => 'https://web-dorado.com/products/wordpress-photo-gallery-plugin.html',
86
+ ),
87
+ "event-calendar-wd" => array(
88
+ 'title' => 'Event Calendar WD',
89
+ 'text' => __('WordPress calendar plugin', $wd_options->prefix),
90
+ 'content' => __('Organize and publish your events in an easy and elegant way using Event Calendar WD.', $wd_options->prefix),
91
+ 'href' => 'https://web-dorado.com/products/wordpress-event-calendar-wd.html',
92
+ ),
93
+ "wd-google-maps" => array(
94
+ 'title' => 'WD Google Maps',
95
+ 'text' => __('WD Google Maps plugin', $wd_options->prefix),
96
+ 'content' => __('Google Maps WD is an intuitive tool for creating Google maps with advanced markers, custom layers and overlays for your website.', $wd_options->prefix),
97
+ 'href' => 'https://web-dorado.com/products/wordpress-google-maps-plugin.html',
98
+ ),
99
+ "slider-wd" => array(
100
+ 'title' => 'Slider WD',
101
+ 'text' => __('WordPress slider plugin', $wd_options->prefix),
102
+ 'content' => __('Create responsive, highly configurable sliders with various effects for your WordPress site.', $wd_options->prefix),
103
+ 'href' => 'https://web-dorado.com/products/wordpress-slider-plugin.html',
104
+ ),
105
+ "spider-event-calendar" => array(
106
+ 'title' => 'Spider Calendar',
107
+ 'text' => __('WordPress event calendar plugin', $wd_options->prefix),
108
+ 'content' => __('Spider Event Calendar is a highly configurable product which allows you to have multiple organized events.', $wd_options->prefix),
109
+ 'href' => 'https://web-dorado.com/products/wordpress-calendar.html',
110
+ ),
111
+ "wd-instagram-feed" => array(
112
+ 'title' => 'Instagram Feed WD',
113
+ 'text' => __('WordPress Instagram Feed plugin', $wd_options->prefix),
114
+ 'content' => __('WD Instagram Feed is a user-friendly tool for displaying user or hashtag-based feeds on your website.', $wd_options->prefix),
115
+ 'href' => 'https://web-dorado.com/products/wordpress-instagram-feed-wd.html',
116
+ ),
117
+ );
118
+ unset($plugins[$wd_options->plugin_wordpress_slug]);
119
+ $themes = array(
120
+ "business_elite" => array(
121
+ 'title' => 'Business Elite Theme',
122
+ 'href' => 'https://web-dorado.com/wordpress-themes/business-elite.html',
123
+ ),
124
+ "portfolio_gallery" => array(
125
+ 'title' => 'Portfolio Gallery Theme',
126
+ 'href' => 'https://web-dorado.com/wordpress-themes/portfolio-gallery.html',
127
+ ),
128
+ "sauron" => array(
129
+ 'title' => 'Sauron Theme',
130
+ 'href' => 'https://web-dorado.com/wordpress-themes/sauron.html',
131
+ ),
132
+ "business_world" => array(
133
+ 'title' => 'Business World Theme',
134
+ 'href' => 'https://web-dorado.com/wordpress-themes/business-world.html',
135
+ ),
136
+ );
137
+ require_once($wd_options->wd_dir_templates . "/display_overview_deals.php");
138
+ }
139
 
140
+ public function wd_overview_support() {
141
+ $wd_options = $this->config;
142
+ global $wpdb;
143
+ $server_info = array();
144
+ // Get PHP Version
145
+ $server_info["Operating System"] = PHP_OS . " (" . (PHP_INT_SIZE * 8) . ")";
146
+ $server_info["PHP Version"] = PHP_VERSION;
147
+ $server_info["Server"] = $_SERVER["SERVER_SOFTWARE"];
148
+ // Get MYSQL Version
149
+ $sql_version = $wpdb->get_var("SELECT VERSION() AS version");
150
+ $server_info["MySQL Version"] = $sql_version;
151
+ // GET SQL Mode
152
+ $mysqlinfo = $wpdb->get_results("SHOW VARIABLES LIKE 'sql_mode'");
153
+ if ( is_array($mysqlinfo) ) {
154
+ $sql_mode = $mysqlinfo[0]->Value;
155
+ }
156
+ if ( empty($sql_mode) ) {
157
+ $sql_mode = __('Not set', $wd_options->prefix);
158
+ }
159
+ $server_info["SQL Mode"] = $sql_mode;
160
+ // Get PHP allow_url_fopen
161
+ if ( ini_get('allow_url_fopen') ) {
162
+ $allow_url_fopen = __('On', $wd_options->prefix);
163
+ }
164
+ else {
165
+ $allow_url_fopen = __('Off', $wd_options->prefix);
166
+ }
167
+ $server_info["PHP Allow URL fopen"] = $allow_url_fopen;
168
+ // Get PHP Max Upload Size
169
+ if ( function_exists('wp_max_upload_size') ) {
170
+ $upload_max = strval(round((int) wp_max_upload_size() / (1024 * 1024))) . 'M';
171
+ }
172
+ else {
173
+ if ( ini_get('upload_max_filesize') ) {
174
+ $upload_max = ini_get('upload_max_filesize');
175
+ }
176
+ else {
177
+ $upload_max = __('N/A', $wd_options->prefix);
178
+ }
179
+ }
180
+ $server_info["PHP Max Upload Size"] = $upload_max;
181
+ // Get PHP Output buffer Size
182
+ if ( ini_get('pcre.backtrack_limit') ) {
183
+ $backtrack_limit = ini_get('pcre.backtrack_limit');
184
+ }
185
+ else {
186
+ $backtrack_limit = __('N/A', $wd_options->prefix);
187
+ }
188
+ $server_info["PCRE Backtracking Limit"] = $backtrack_limit;
189
+ // Get PHP Max Post Size
190
+ if ( ini_get('post_max_size') ) {
191
+ $post_max = ini_get('post_max_size');
192
+ }
193
+ else {
194
+ $post_max = __('N/A', $wd_options->prefix);
195
+ }
196
+ $server_info["PHP Max Post Size"] = $post_max;
197
+ // Get PHP Max execution time
198
+ if ( ini_get('max_execution_time') ) {
199
+ $max_execute = ini_get('max_execution_time');
200
+ }
201
+ else {
202
+ $max_execute = __('N/A', $wd_options->prefix);
203
+ }
204
+ $server_info["PHP Max Script Execute Time"] = $max_execute;
205
+ // Get PHP Memory Limit
206
+ if ( ini_get('memory_limit') ) {
207
+ $memory_limit = ini_get('memory_limit');
208
+ }
209
+ else {
210
+ $memory_limit = __('N/A', $wd_options->prefix);
211
+ }
212
+ $server_info["PHP Memory Limit"] = $memory_limit;
213
+ // Get actual memory_get_usage
214
+ if ( function_exists('memory_get_usage') ) {
215
+ $memory_usage = round(memory_get_usage() / 1024 / 1024, 2) . __(' MByte', $wd_options->prefix);
216
+ }
217
+ else {
218
+ $memory_usage = __('N/A', $wd_options->prefix);
219
+ }
220
+ $server_info["Memory usage"] = $memory_usage;
221
+ // required for EXIF read
222
+ if ( is_callable('exif_read_data') ) {
223
+ $exif = __('Yes', $wd_options->prefix) . " (V" . substr(phpversion('exif'), 0, 4) . ")";
224
+ }
225
+ else {
226
+ $exif = __('No', $wd_options->prefix);
227
+ }
228
+ $server_info["PHP Exif support"] = $exif;
229
+ // required for meta data
230
+ if ( is_callable('iptcparse') ) {
231
+ $iptc = __('Yes', $wd_options->prefix);
232
+ }
233
+ else {
234
+ $iptc = __('No', $wd_options->prefix);
235
+ }
236
+ $server_info["PHP IPTC support"] = $iptc;
237
+ // required for meta data
238
+ if ( is_callable('xml_parser_create') ) {
239
+ $xml = __('Yes', $wd_options->prefix);
240
+ }
241
+ else {
242
+ $xml = __('No', $wd_options->prefix);
243
+ }
244
+ $server_info["PHP XML support"] = $xml;
245
+ $gd_info = array( "GD support" => __('No', $wd_options->prefix) );
246
+ if ( function_exists("gd_info") ) {
247
+ $gd_info = array();
248
+ foreach ( gd_info() as $key => $val ) {
249
+ if ( is_bool($val) ) {
250
+ $gd_info[$key] = $val ? __('Yes', $wd_options->prefix) : __('No', $wd_options->prefix);
251
+ }
252
+ else {
253
+ $gd_info[$key] = $val;
254
+ }
255
+ }
256
+ }
257
+ require_once($wd_options->wd_dir_templates . "/display_overview_support.php");
258
+ }
259
 
260
+ public function overview_styles() {
261
+ $wd_options = $this->config;
262
+ $version = get_option($wd_options->prefix . "_version");
263
+ wp_enqueue_style($wd_options->prefix . '_overview_css', $wd_options->wd_url_css . '/overview.css', array(), $version);
264
+ }
 
 
 
 
 
 
 
265
 
266
+ public function overview_scripts() {
267
+ $wd_options = $this->config;
268
+ $version = get_option($wd_options->prefix . "_version");
269
+ wp_enqueue_script($wd_options->prefix . '_overview_js', $wd_options->wd_url_js . '/overview.js', array(), $version);
270
+ }
271
 
272
+ private function remote_get( $plugin_wp_slug ) {
273
+ $request = wp_remote_get(" http://api.wordpress.org/plugins/info/1.0/" . $plugin_wp_slug);
274
+ $data = array();
275
+ if ( !is_wp_error($request) || wp_remote_retrieve_response_code($request) === 200 ) {
276
+ $body = unserialize($request['body']);
277
+ $data["downloaded"] = $body->downloaded;
278
+ $ratings = $body->ratings;
279
+ if ( $ratings[5] == 0 && $ratings[4] == 0 && $ratings[3] == 0 && $ratings[2] == 0 && $ratings[1] == 0 ) {
280
+ $data["rating"] = 100;
281
+ }
282
+ else {
283
+ $data["rating"] = round((($ratings[5] * 5 + $ratings[4] * 4 + $ratings[3] * 3 + $ratings[2] * 2 + $ratings[1] * 1) / $body->num_ratings), 1);
284
+ $data["rating"] = round(($data["rating"] / 5) * 100);
285
+ }
286
 
287
+ return $data;
288
+ }
 
 
 
289
 
290
+ return FALSE;
291
+ }
292
+ }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
wd/includes/subscribe.php CHANGED
@@ -1,138 +1,115 @@
1
  <?php
2
- if ( ! defined( 'ABSPATH' ) ) {
3
- exit;
4
- }
5
- class DoradoWebSubscribe {
6
- // //////////////////////////////////////////////////////////////////////////////////////
7
- // Events //
8
- // //////////////////////////////////////////////////////////////////////////////////////
9
- // //////////////////////////////////////////////////////////////////////////////////////
10
- // Constants //
11
- // //////////////////////////////////////////////////////////////////////////////////////
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
- // //////////////////////////////////////////////////////////////////////////////////////
24
- // Public Methods //
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 DoradoWebApi($wd_options);
67
- $hash = $api->get_hash();
68
-
69
- if( $hash != null ){
70
- $all_plugins = array();
71
- $plugins = get_plugins();
72
- foreach ( $plugins as $slug => $data ) {
73
- $plugin = array(
74
- "Name" => $data["Name"],
75
- "PluginURI" => $data["PluginURI"],
76
- "Author" => $data["Author"],
77
- "AuthorURI" => $data["AuthorURI"]
78
- );
79
- $all_plugins[$slug] = $plugin;
80
- }
81
-
82
- $data = array();
83
- $data["site_url"] = site_url();
84
 
85
- $admin_data = wp_get_current_user();
 
 
 
 
86
 
87
- $user_first_name = get_user_meta( $admin_data->ID, "first_name", true );
88
- $user_last_name = get_user_meta( $admin_data->ID, "last_name", true );
89
-
90
- $data["name"] = $user_first_name || $user_last_name ? $user_first_name . " " . $user_last_name : $admin_data->data->user_login;
91
-
92
- $data["email"] = $admin_data->data->user_email;
93
- $data["wp_version"] = get_bloginfo( 'version' );
94
- $data["plugin_id"] = $wd_options->wd_plugin_id;
95
- $data["hash"] = $hash;
96
- $data["all_plugins"] = $all_plugins;
97
-
98
 
99
- $response = wp_remote_post( "https://api.web-dorado.com/collectuserdata", array(
100
- 'method' => 'POST',
101
- 'timeout' => 45,
102
- 'redirection' => 5,
103
- 'httpversion' => '1.0',
104
- 'blocking' => true,
105
- 'headers' => array(),
106
- 'body' => json_encode($data),
107
- 'cookies' => array()
108
- )
109
- );
110
-
111
- $response_body = (!is_wp_error($response) && isset( $response["body"] )) ? json_decode( $response["body"], true ) : null;
112
-
113
- if( is_array( $response_body ) && $response_body["body"]["msg"] == "Access" ) {
114
-
115
- }
116
- }
117
- }
118
- if ( get_option( $wd_options->prefix . "_subscribe_done" ) != 1 ) {
119
- update_option( $wd_options->prefix . "_subscribe_done", 1 );
120
- }
121
- else {
122
- add_option( $wd_options->prefix . "_subscribe_done" , "1", '', 'no');
123
- }
124
-
125
- wp_safe_redirect( $wd_options->after_subscribe );
126
- }
127
 
128
- }
129
- // //////////////////////////////////////////////////////////////////////////////////////
130
- // Getters & Setters //
131
- // //////////////////////////////////////////////////////////////////////////////////////
132
- // //////////////////////////////////////////////////////////////////////////////////////
133
- // Private Methods //
134
- // //////////////////////////////////////////////////////////////////////////////////////
135
- // //////////////////////////////////////////////////////////////////////////////////////
136
- // Listeners //
137
- // //////////////////////////////////////////////////////////////////////////////////////
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
138
  }
 
 
1
  <?php
2
+ if ( !defined('ABSPATH') ) {
3
+ exit;
4
+ }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
5
 
6
+ class DoradoWebSubscribe {
7
+ public $config;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
8
 
9
+ public function __construct( $config = array() ) {
10
+ $this->config = $config;
11
+ add_action('admin_init', array( $this, 'after_subscribe' ));
12
+ }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
13
 
14
+ public function subscribe_scripts() {
15
+ $wd_options = $this->config;
16
+ wp_register_script('subscribe_js', $wd_options->wd_url_js . '/subsribe.js');
17
+ wp_enqueue_script('subscribe_js');
18
+ }
19
 
20
+ public function subscribe_styles() {
21
+ $wd_options = $this->config;
22
+ wp_enqueue_style($wd_options->prefix . 'subscribe', $wd_options->wd_url_css . '/subscribe.css');
23
+ }
 
 
 
 
 
 
 
24
 
25
+ public function subscribe_display_page() {
26
+ $wd_options = $this->config;
27
+ $list = array(
28
+ 0 => array(
29
+ "title" => __("Your name &", $wd_options->prefix),
30
+ "small_text" => __("Email address", $wd_options->prefix),
31
+ "img" => $wd_options->wd_url_img . '/sub_1.png',
32
+ ),
33
+ 1 => array(
34
+ "title" => __("Site URL", $wd_options->prefix),
35
+ "small_text" => __("Wordpress version", $wd_options->prefix),
36
+ "img" => $wd_options->wd_url_img . '/sub_2.png',
37
+ ),
38
+ 2 => array(
39
+ "title" => __("List of plugins", $wd_options->prefix),
40
+ "small_text" => "",
41
+ "img" => $wd_options->wd_url_img . '/sub_4.png',
42
+ ),
43
+ );
44
+ require_once($wd_options->wd_dir_templates . "/display_subscribe.php");
45
+ }
 
 
 
 
 
 
 
46
 
47
+ public function after_subscribe() {
48
+ $wd_options = $this->config;
49
+ if ( isset($_GET[$wd_options->prefix . "_sub_action"]) ) {
50
+ if ( $_GET[$wd_options->prefix . "_sub_action"] == "allow" ) {
51
+ try {
52
+ $api = new DoradoWebApi($wd_options);
53
+ if ( empty($api) ) {
54
+ throw new Exception('Error: Not Dorado Web Api');
55
+ }
56
+ $hash = $api->get_hash();
57
+ if ( empty($hash) ) {
58
+ throw new Exception('Error: Not get hash method');
59
+ }
60
+ if ( !empty($hash) ) {
61
+ $all_plugins = array();
62
+ $plugins = get_plugins();
63
+ foreach ( $plugins as $slug => $data ) {
64
+ $plugin = array(
65
+ "Name" => $data["Name"],
66
+ "PluginURI" => $data["PluginURI"],
67
+ "Author" => $data["Author"],
68
+ "AuthorURI" => $data["AuthorURI"],
69
+ );
70
+ $all_plugins[$slug] = $plugin;
71
+ }
72
+ $data = array();
73
+ $data["site_url"] = site_url();
74
+ $admin_data = wp_get_current_user();
75
+ $user_first_name = get_user_meta($admin_data->ID, "first_name", TRUE);
76
+ $user_last_name = get_user_meta($admin_data->ID, "last_name", TRUE);
77
+ $data["name"] = $user_first_name || $user_last_name ? $user_first_name . " " . $user_last_name : $admin_data->data->user_login;
78
+ $data["email"] = $admin_data->data->user_email;
79
+ $data["wp_version"] = get_bloginfo('version');
80
+ $data["plugin_id"] = $wd_options->wd_plugin_id;
81
+ $data["hash"] = $hash;
82
+ $data["all_plugins"] = $all_plugins;
83
+ $response = wp_remote_post("https://api.web-dorado.com/collectuserdata", array(
84
+ 'method' => 'POST',
85
+ 'timeout' => 45,
86
+ 'redirection' => 5,
87
+ 'httpversion' => '1.0',
88
+ 'blocking' => TRUE,
89
+ 'headers' => array(),
90
+ 'body' => json_encode($data),
91
+ 'cookies' => array(),
92
+ ));
93
+ $response_body = (!is_wp_error($response) && isset($response["body"])) ? json_decode($response["body"], TRUE) : NULL;
94
+ if ( $response_body == NULL ) {
95
+ throw new Exception('Error: Not remote post');
96
+ }
97
+ if ( is_array($response_body) && $response_body["body"]["msg"] == "Access" ) {
98
+ // code
99
+ }
100
+ }
101
+ }
102
+ catch ( Error $e ) {
103
+ update_option($wd_options->prefix . "_subscribe_done", 1);
104
+ wp_safe_redirect($wd_options->after_subscribe);
105
+ }
106
+ catch ( Exception $e ) {
107
+ update_option($wd_options->prefix . "_subscribe_done", 1);
108
+ wp_safe_redirect($wd_options->after_subscribe);
109
+ }
110
+ }
111
+ update_option($wd_options->prefix . "_subscribe_done", 1);
112
+ wp_safe_redirect($wd_options->after_subscribe);
113
  }
114
+ }
115
+ }
wd/start.php CHANGED
@@ -1,41 +1,32 @@
1
- <?php
2
- if ( ! defined( 'ABSPATH' ) ) {
3
- exit;
4
- }
5
- define( 'DORADO_WEB_API_PLUGIN_DATA_PATH', 'https://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 dorado_web_init( $options ) {
30
-
31
- // load files
32
- require_once dirname( __FILE__ ) . '/wd.php';
33
-
34
- $wd = new DoradoWeb();
35
- $wd->wd_init( $options );
36
-
37
- }
38
-
39
-
40
-
41
-
1
+ <?php
2
+ if ( !defined('ABSPATH') ) {
3
+ exit;
4
+ }
5
+ define('DORADO_WEB_API_PLUGIN_DATA_PATH', 'https://api.web-dorado.com/v2/_id_/plugindata');
6
+ require_once dirname(__FILE__) . '/config.php';
7
+ /**
8
+ * @param options for Plugin details.
9
+ * prefix;
10
+ * wd_plugin_id;
11
+ * plugin_title;
12
+ * plugin_dir;
13
+ * plugin_main_file;
14
+ * description;
15
+ * plugin_features;
16
+ * video_youtube_id;
17
+ * plugin_wd_url;
18
+ * plugin_wd_demo_link;
19
+ * plugin_wd_addons_link;
20
+ * plugin_wizard_link;
21
+ * after_subscribe;
22
+ * plugin_menu_title;
23
+ * plugin_menu_icon;
24
+ * custom_post;
25
+ */
26
+ function dorado_web_init( $options ) {
27
 
28
+ // load files
29
+ require_once dirname(__FILE__) . '/wd.php';
30
+ $wd = new DoradoWeb();
31
+ $wd->wd_init($options);
32
+ }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
wd/templates/display_deactivation_popup.php CHANGED
@@ -1,27 +1,28 @@
1
  <div class="wd-opacity wd-<?php echo $wd_options->prefix; ?>-opacity"></div>
2
  <div class="wd-deactivate-popup wd-<?php echo $wd_options->prefix; ?>-deactivate-popup">
3
- <div class="wd-deactivate-popup-opacity wd-deactivate-popup-opacity-<?php echo $wd_options->prefix; ?>">
4
- <img src="<?php echo $wd_options->wd_url_img . '/spinner.gif'; ?>" class="wd-img-loader" >
5
- </div>
6
- <form method="post" id="<?php echo $wd_options->prefix; ?>_deactivate_form">
7
- <div class="wd-deactivate-popup-header">
8
- <?php _e( "Please let us know why you are deactivating. Your answer will help us to serve you better (Optional)", $wd_options->prefix ); ?>:
9
- </div>
 
10
 
11
- <div class="wd-deactivate-popup-body">
12
- <?php foreach( $deactivate_reasons as $deactivate_reason_slug => $deactivate_reason ) { ?>
13
- <div class="wd-<?php echo $wd_options->prefix; ?>-reasons">
14
- <input type="radio" value="<?php echo $deactivate_reason["id"];?>" id="<?php echo $wd_options->prefix . "-" .$deactivate_reason["id"]; ?>" name="<?php echo $wd_options->prefix; ?>_reasons" >
15
- <label for="<?php echo $wd_options->prefix . "-" . $deactivate_reason["id"]; ?>"><?php echo $deactivate_reason["text"];?></label>
16
- </div>
17
- <?php } ?>
18
- <div class="<?php echo $wd_options->prefix; ?>_additional_details_wrap"></div>
19
- </div>
20
- <div class="wd-btns">
21
- <a href="<?php echo $deactivate_url; ?>" data-val="1" class="button button-primary button-close wd-<?php echo $wd_options->prefix; ?>-deactivate" id="wd-<?php echo $wd_options->prefix; ?>-deactivate"><?php _e( "Skip and Deactivate" , $wd_options->prefix ); ?></a>
22
- <a href="<?php echo $deactivate_url; ?>" data-val="2" class="button button-primary button-close wd-<?php echo $wd_options->prefix; ?>-deactivate" id="wd-<?php echo $wd_options->prefix; ?>-submit-and-deactivate" style="display:none;"><?php _e( "Submit and Deactivate" , $wd_options->prefix ); ?></a>
23
- </div>
24
- <input type="hidden" name="<?php echo $wd_options->prefix . "_submit_and_deactivate"; ?>" value="" >
25
- <?php wp_nonce_field( $wd_options->prefix . '_save_form', $wd_options->prefix . '_save_form_fild'); ?>
26
- </form>
27
- </div>
1
  <div class="wd-opacity wd-<?php echo $wd_options->prefix; ?>-opacity"></div>
2
  <div class="wd-deactivate-popup wd-<?php echo $wd_options->prefix; ?>-deactivate-popup">
3
+ <div class="wd-deactivate-popup-opacity wd-deactivate-popup-opacity-<?php echo $wd_options->prefix; ?>">
4
+ <img src="<?php echo $wd_options->wd_url_img . '/spinner.gif'; ?>" class="wd-img-loader">
5
+ </div>
6
+ <form method="post" id="<?php echo $wd_options->prefix; ?>_deactivate_form">
7
+ <div class="wd-deactivate-popup-header">
8
+ <?php _e("Please let us know why you are deactivating. Your answer will help us to provide you support or sometimes offer discounts. (Optional)", $wd_options->prefix); ?>:
9
+ <span class="wd-deactivate-popup-close-btn"></span>
10
+ </div>
11
 
12
+ <div class="wd-deactivate-popup-body">
13
+ <?php foreach ( $deactivate_reasons as $deactivate_reason_slug => $deactivate_reason ) { ?>
14
+ <div class="wd-<?php echo $wd_options->prefix; ?>-reasons">
15
+ <input type="radio" value="<?php echo $deactivate_reason["id"]; ?>" id="<?php echo $wd_options->prefix . "-" . $deactivate_reason["id"]; ?>" name="<?php echo $wd_options->prefix; ?>_reasons">
16
+ <label for="<?php echo $wd_options->prefix . "-" . $deactivate_reason["id"]; ?>"><?php echo $deactivate_reason["text"]; ?></label>
17
+ </div>
18
+ <?php } ?>
19
+ <div class="<?php echo $wd_options->prefix; ?>_additional_details_wrap"></div>
20
+ </div>
21
+ <div class="wd-btns">
22
+ <a href="<?php echo $deactivate_url; ?>" data-val="1" class="button button-secondary button-close" id="wd-<?php echo $wd_options->prefix; ?>-deactivate"><?php _e("Skip and Deactivate", $wd_options->prefix); ?></a>
23
+ <a href="<?php echo $deactivate_url; ?>" data-val="2" class="button button-primary button-primary-disabled button-close wd-<?php echo $wd_options->prefix; ?>-deactivate" id="wd-<?php echo $wd_options->prefix; ?>-submit-and-deactivate"><?php _e("Submit and Deactivate", $wd_options->prefix); ?></a>
24
+ </div>
25
+ <input type="hidden" name="<?php echo $wd_options->prefix . "_submit_and_deactivate"; ?>" value="">
26
+ <?php wp_nonce_field($wd_options->prefix . '_save_form', $wd_options->prefix . '_save_form_fild'); ?>
27
+ </form>
28
+ </div>
wd/templates/display_overview.php CHANGED
@@ -5,7 +5,7 @@
5
  </div>
6
  <div class="wd-cell wd-valign-middle">
7
 
8
- <h2><?php echo sprintf(__("Welcome to %s", $wd_options->prefix), $wd_options->plugin_title); ?> <?php if (!empty($start_using_url)) { ?>
9
  <div class="wd-start-using-button">
10
  <a href="<?php echo $start_using_url; ?>" class="button button-primary button-large">Start using</a>
11
  </div>
@@ -21,9 +21,9 @@
21
  <div class="overview_wrap">
22
  <ul class="overview_tabs">
23
  <?php
24
- foreach ($tabs as $tab_key => $tab) {
25
- $href = $tab['view'] !== false ? "#" . $tab_key : $tab_key;
26
- $target = $tab['view'] == false ? 'target="_blank" class="not_tab"' : '';
27
  $overview_tab_active_class = $tab_key == 'welcome' ? 'class="overview_tab_active"' : ''
28
  ?>
29
  <li class=""><a
@@ -33,8 +33,8 @@
33
  </ul>
34
  <div class="overview_content">
35
  <?php
36
- foreach ($tabs as $tab_key => $tab) {
37
- if ($tab['view'] !== false) {
38
  echo call_user_func($tab['view']);
39
  }
40
  }
5
  </div>
6
  <div class="wd-cell wd-valign-middle">
7
 
8
+ <h2><?php echo sprintf(__("Welcome to %s", $wd_options->prefix), $wd_options->plugin_title); ?> <?php if ( !empty($start_using_url) ) { ?>
9
  <div class="wd-start-using-button">
10
  <a href="<?php echo $start_using_url; ?>" class="button button-primary button-large">Start using</a>
11
  </div>
21
  <div class="overview_wrap">
22
  <ul class="overview_tabs">
23
  <?php
24
+ foreach ( $tabs as $tab_key => $tab ) {
25
+ $href = $tab['view'] !== FALSE ? "#" . $tab_key : $tab_key;
26
+ $target = $tab['view'] == FALSE ? 'target="_blank" class="not_tab"' : '';
27
  $overview_tab_active_class = $tab_key == 'welcome' ? 'class="overview_tab_active"' : ''
28
  ?>
29
  <li class=""><a
33
  </ul>
34
  <div class="overview_content">
35
  <?php
36
+ foreach ( $tabs as $tab_key => $tab ) {
37
+ if ( $tab['view'] !== FALSE ) {
38
  echo call_user_func($tab['view']);
39
  }
40
  }
wd/templates/display_overview_deals.php CHANGED
@@ -1,81 +1,84 @@
1
  <div id="deals">
2
 
3
- <div id="plugins">
4
- <div class="deals_header deals_header_plugins">
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">
12
- <div class="deals_main_title"><?php echo sprintf( __( "Get %s", $wd_options->prefix ), $wd_options->plugin_title ); ?></div>
13
- <div class="deals_main_title"><span class="higlight">+27 </span><?php echo __( "plugins", $wd_options->prefix ); ?></div>
14
- <div class="deals_secondary_title"><?php echo __( "for", $wd_options->prefix ); ?><span class="higlight"> $99 </span><?php echo __( "only", $wd_options->prefix ); ?></div>
15
- </div>
16
- <div class="deals_save"><?php echo __( "Save 80%", $wd_options->prefix ); ?></div>
17
- </div>
18
- </div>
19
- </a>
20
  </div>
21
- <div class="deals_content">
22
- <?php foreach( $plugins as $wp_slug => &$plugin ){ ?>
23
-
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>
31
- <div class="deal_desc">
32
- <p><?php echo $plugin["content"]; ?></p>
33
- <div class="deal_desc_footer">
34
- <div class="download_btn">
35
- <a href="<?php echo $plugin["href"]; ?>" target="_blank" ><?php _e( "Download", $wd_options->prefix ); ?></a>
36
- </div>
37
- </div>
38
- </div>
39
-
40
- </div>
41
- <?php } ?>
42
- </div>
43
- <div class="get_all_deals">
44
- <a href="https://web-dorado.com/wordpress-plugins-bundle.html" target="_blank" >
45
- <?php _e( "Get all plugins", $wd_options->prefix ); ?>
46
  </a>
 
 
 
 
 
 
 
 
 
 
47
  </div>
 
 
 
 
 
 
48
  </div>
49
- <div id="themes">
50
- <div class="deals_header deals_header_themes">
51
- <a href="https://web-dorado.com/wordpress-themes-bundle.html" target="_blank">
52
- <div class="wd-table">
53
- <div class="wd-cell wd-text-right wd-valign-middle">
54
- </div>
55
- <div class="wd-cell wd-valign-middle">
56
- <div class="titles_wrap">
57
- <div class="deals_main_title"><?php echo __( "Get all 11 themes", $wd_options->prefix ); ?></div>
58
- <div class="deals_main_title"><?php echo __( "for", $wd_options->prefix ); ?><span class="higlight"> $40 </span><?php echo __( "only", $wd_options->prefix ); ?></div>
59
- </div>
60
- <div class="deals_save"><?php echo __( "Save 70%", $wd_options->prefix ); ?></div>
61
- </div>
62
- </div>
63
- </a>
64
- </div>
65
- <div class="deals_content">
66
- <?php foreach( $themes as $slug => $theme ){ ?>
67
- <div class="theme_block">
68
- <a href="<?php echo $theme["href"]; ?>" target="_blank" >
69
- <img src = "<?php echo $wd_options->wd_url_img . '/plugins/' . $slug . '.png'; ?>" width="100%;">
70
- <div><?php echo $theme["title"]; ?></div>
71
- </a>
72
- </div>
73
- <?php } ?>
74
  </div>
75
- <div class="get_all_deals">
76
- <a href="https://web-dorado.com/wordpress-themes-bundle.html" target="_blank" >
77
- <?php _e( "Find out more", $wd_options->prefix ); ?>
78
- </a>
79
- </div>
 
 
 
 
 
 
 
 
 
 
 
80
  </div>
 
81
  </div>
1
  <div id="deals">
2
 
3
+ <div id="plugins">
4
+ <div class="deals_header deals_header_plugins">
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">
12
+ <div class="deals_main_title"><?php echo sprintf(__("Get %s", $wd_options->prefix), $wd_options->plugin_title); ?></div>
13
+ <div class="deals_main_title">
14
+ <span class="higlight">+27 </span><?php echo __("plugins", $wd_options->prefix); ?></div>
15
+ <div class="deals_secondary_title"><?php echo __("for", $wd_options->prefix); ?>
16
+ <span class="higlight"> $99 </span><?php echo __("only", $wd_options->prefix); ?></div>
17
+ </div>
18
+ <div class="deals_save"><?php echo __("Save 80%", $wd_options->prefix); ?></div>
19
+ </div>
20
  </div>
21
+ </a>
22
+ </div>
23
+ <div class="deals_content">
24
+ <?php foreach ( $plugins as $wp_slug => &$plugin ) { ?>
25
+
26
+ <div class="deal_block">
27
+ <div class="deal_title">
28
+ <a href="<?php echo $plugin["href"]; ?>" target="_blank">
29
+ <img src="<?php echo $wd_options->wd_url_img . '/plugins/' . $wp_slug . '.png'; ?>">
30
+ <h2><?php echo $plugin["title"]; ?></h2>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
31
  </a>
32
+ </div>
33
+ <div class="deal_desc">
34
+ <p><?php echo $plugin["content"]; ?></p>
35
+ <div class="deal_desc_footer">
36
+ <div class="download_btn">
37
+ <a href="<?php echo $plugin["href"]; ?>" target="_blank"><?php _e("Download", $wd_options->prefix); ?></a>
38
+ </div>
39
+ </div>
40
+ </div>
41
+
42
  </div>
43
+ <?php } ?>
44
+ </div>
45
+ <div class="get_all_deals">
46
+ <a href="https://web-dorado.com/wordpress-plugins-bundle.html" target="_blank">
47
+ <?php _e("Get all plugins", $wd_options->prefix); ?>
48
+ </a>
49
  </div>
50
+ </div>
51
+ <div id="themes">
52
+ <div class="deals_header deals_header_themes">
53
+ <a href="https://web-dorado.com/wordpress-themes-bundle.html" target="_blank">
54
+ <div class="wd-table">
55
+ <div class="wd-cell wd-text-right wd-valign-middle">
56
+ </div>
57
+ <div class="wd-cell wd-valign-middle">
58
+ <div class="titles_wrap">
59
+ <div class="deals_main_title"><?php echo __("Get all 11 themes", $wd_options->prefix); ?></div>
60
+ <div class="deals_main_title"><?php echo __("for", $wd_options->prefix); ?>
61
+ <span class="higlight"> $40 </span><?php echo __("only", $wd_options->prefix); ?></div>
62
+ </div>
63
+ <div class="deals_save"><?php echo __("Save 70%", $wd_options->prefix); ?></div>
64
+ </div>
 
 
 
 
 
 
 
 
 
 
65
  </div>
66
+ </a>
67
+ </div>
68
+ <div class="deals_content">
69
+ <?php foreach ( $themes as $slug => $theme ) { ?>
70
+ <div class="theme_block">
71
+ <a href="<?php echo $theme["href"]; ?>" target="_blank">
72
+ <img src="<?php echo $wd_options->wd_url_img . '/plugins/' . $slug . '.png'; ?>" width="100%;">
73
+ <div><?php echo $theme["title"]; ?></div>
74
+ </a>
75
+ </div>
76
+ <?php } ?>
77
+ </div>
78
+ <div class="get_all_deals">
79
+ <a href="https://web-dorado.com/wordpress-themes-bundle.html" target="_blank">
80
+ <?php _e("Find out more", $wd_options->prefix); ?>
81
+ </a>
82
  </div>
83
+ </div>
84
  </div>
wd/templates/display_overview_support.php CHANGED
@@ -1,43 +1,59 @@
1
  <div id="support">
2
- <p class="wd-support-main">
3
- <?php echo sprintf( __("You may contact us by filling in this form or by email %s any time you need professional support or have any questions. You can also fill in the form to leave your comments or feedback.", $wd_options->prefix), "<span class='support_email'>(support@web-dorado.com)</span>") ;?>
 
 
 
 
 
 
 
4
  </p>
5
- <div class="wd-overview-site-deatils">
6
- <h2><?php _e( "Site Details", $wd_options->prefix ); ?></h2>
7
- <p>
8
- <?php _e( "When contacting support, consider copying and pasting this information in your support request.", $wd_options->prefix ); ?>
9
- <br>
10
- <?php _e( "It helps us troubleshoot more quickly.", $wd_options->prefix ); ?>
11
- </p>
12
- <?php
13
- if ( function_exists('current_user_can' ) ) {
14
- if ( current_user_can('manage_options') ) {
15
- ?>
16
- <div class="wd-site-deatils wd-table">
17
- <button id="wd-copy"><?php _e( "Copy to Clipboard", $wd_options->prefix ); ?></button>
18
- <div id="wd-site-deatils">
19
  <textarea rows="10" id="wd-site-deatils-textarea"><?php
20
- _e( "Server Settings", $wd_options->prefix );
21
- echo '&#13;&#10;&#13;&#10;';
22
- foreach( $server_info as $key => $val ){
23
- echo $key . ": " . $val . '&#13;&#10;';
24
- }
25
- echo '&#13;&#10;';
26
- _e( "Graphic Library", $wd_options->prefix );
27
- echo '&#13;&#10;&#13;&#10;';
28
- foreach( $gd_info as $key => $val ){
29
- echo $key . ": " . $val . '&#13;&#10;';
30
- }
31
- ?></textarea>
32
- </div>
33
- </div>
34
- <?php
35
- }
36
- }
37
- ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
38
 
39
- </div>
40
- <div class="contact_us_wrap">
41
- <a href="https://web-dorado.com/support/contact-us.html" target="_blank" class="contact_us"><?php _e("Contact us", $wd_options->prefix); ?></a>
42
- </div>
43
  </div>
1
  <div id="support">
2
+ <p class="wd-support-main">
3
+ <?php echo sprintf(__("You may contact us by filling in this form or by email %s any time you need professional support or have any questions. You can also fill in the form to leave your comments or feedback.", $wd_options->prefix), "<span class='support_email'>(support@web-dorado.com)</span>"); ?>
4
+ </p>
5
+ <div class="wd-overview-site-deatils">
6
+ <h2><?php _e("Site Details", $wd_options->prefix); ?></h2>
7
+ <p>
8
+ <?php _e("When contacting support, consider copying and pasting this information in your support request.", $wd_options->prefix); ?>
9
+ <br>
10
+ <?php _e("It helps us troubleshoot more quickly.", $wd_options->prefix); ?>
11
  </p>
12
+ <?php
13
+ if ( function_exists('current_user_can') ) {
14
+ if ( current_user_can('manage_options') ) {
15
+ ?>
16
+ <div class="wd-site-deatils wd-table">
17
+ <button id="wd-copy"><?php _e("Copy to Clipboard", $wd_options->prefix); ?></button>
18
+ <div id="wd-site-deatils">
 
 
 
 
 
 
 
19
  <textarea rows="10" id="wd-site-deatils-textarea"><?php
20
+ _e("Server Settings", $wd_options->prefix);
21
+ echo '&#13;&#10;&#13;&#10;';
22
+ foreach ( $server_info as $key => $val ) {
23
+ echo $key . ": " . $val . '&#13;&#10;';
24
+ }
25
+ echo '&#13;&#10;';
26
+ _e("Graphic Library", $wd_options->prefix);
27
+ echo '&#13;&#10;&#13;&#10;';
28
+ foreach ( $gd_info as $key => $val ) {
29
+ echo $key . ": " . $val . '&#13;&#10;';
30
+ }
31
+ echo '&#13;&#10;';
32
+ _e("Active Plugins", $wd_options->prefix);
33
+ echo '&#13;&#10;';
34
+ $activepl = get_option('active_plugins');
35
+ $plugins = get_plugins();
36
+ $activated_plugins = array();
37
+ foreach ( $activepl as $p ) {
38
+ if ( isset($plugins[$p]) ) {
39
+ array_push($activated_plugins, $plugins[$p]);
40
+ echo '&#13;&#10;' . $plugins[$p]['Name'];
41
+ }
42
+ }
43
+ echo '&#13;&#10;&#13;&#10;';
44
+ _e("Active theme", $wd_options->prefix);
45
+ echo '&#13;&#10;&#13;&#10;';
46
+ echo wp_get_theme();
47
+ ?></textarea>
48
+ </div>
49
+ </div>
50
+ <?php
51
+ }
52
+ }
53
+ ?>
54
 
55
+ </div>
56
+ <div class="contact_us_wrap">
57
+ <a href="https://web-dorado.com/support/contact-us.html" target="_blank" class="contact_us"><?php _e("Contact us", $wd_options->prefix); ?></a>
58
+ </div>
59
  </div>
wd/templates/display_overview_user_guide.php CHANGED
@@ -1,46 +1,50 @@
1
  <div id="user_guide">
2
- <div class="wd-table">
3
- <div class="wd-cell">
4
- <?php for( $i = 0; $i < ceil( count($user_guide) / 2 ); $i++) { ?>
5
- <div class="user_guide_item">
6
- <a href="<?php echo $user_guide[$i]["url"]; ?>" class="user_guide_title" target="_blank"><?php echo $user_guide[$i]["main_title"]; ?></a>
7
- <?php foreach( $user_guide[$i]["titles"] as $title ) { ?>
8
- <div><a href="<?php echo $title["url"]; ?>" target="_blank" class="user_guide_titles"><?php echo $title["title"]; ?></a></div>
9
- <?php } ?>
10
- </div>
11
- <?php } ?>
12
  </div>
13
- <div class="wd-cell">
14
- <?php for( $i = $i; $i < count($user_guide); $i++) { ?>
15
- <div class="user_guide_item">
16
- <a href="<?php echo $user_guide[$i]["url"]; ?>" class="user_guide_title" target="_blank"><?php echo $user_guide[$i]["main_title"]; ?></a>
17
- <?php foreach( $user_guide[$i]["titles"] as $title ) { ?>
18
- <div><a href="<?php echo $title["url"]; ?>" target="_blank" class="user_guide_titles"><?php echo $title["title"]; ?></a></div>
19
- <?php } ?>
20
- </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>
46
 
1
  <div id="user_guide">
2
+ <div class="wd-table">
3
+ <div class="wd-cell">
4
+ <?php for ( $i = 0; $i < ceil(count($user_guide) / 2); $i++ ) { ?>
5
+ <div class="user_guide_item">
6
+ <a href="<?php echo $user_guide[$i]["url"]; ?>" class="user_guide_title" target="_blank"><?php echo $user_guide[$i]["main_title"]; ?></a>
7
+ <?php foreach ( $user_guide[$i]["titles"] as $title ) { ?>
8
+ <div>
9
+ <a href="<?php echo $title["url"]; ?>" target="_blank" class="user_guide_titles"><?php echo $title["title"]; ?></a>
10
+ </div>
11
+ <?php } ?>
12
  </div>
13
+ <?php } ?>
14
+ </div>
15
+ <div class="wd-cell">
16
+ <?php for ( $i = $i; $i < count($user_guide); $i++ ) { ?>
17
+ <div class="user_guide_item">
18
+ <a href="<?php echo $user_guide[$i]["url"]; ?>" class="user_guide_title" target="_blank"><?php echo $user_guide[$i]["main_title"]; ?></a>
19
+ <?php foreach ( $user_guide[$i]["titles"] as $title ) { ?>
20
+ <div>
21
+ <a href="<?php echo $title["url"]; ?>" target="_blank" class="user_guide_titles"><?php echo $title["title"]; ?></a>
22
+ </div>
23
+ <?php } ?>
24
  </div>
25
+ <?php } ?>
26
+ </div>
27
+ <div class="wd-cell">
28
+ <?php if ( $wd_options->plugin_wd_demo_link ) { ?>
29
+ <a href="<?php echo $wd_options->plugin_wd_demo_link; ?>" class="user_guide_demo" target="_blank">
30
+ <?php _e("Demo", $wd_options->prefix); ?>
31
+ </a>
32
+ <?php } ?>
33
+ <a href="<?php echo $wd_options->plugin_wd_url; ?>" class="user_guide_plugin" target="_blank">
34
+ <?php echo $wd_options->plugin_title; ?>
35
+ </a>
36
+ <a href="https://wordpress.org/support/plugin/<?php echo $wd_options->plugin_wordpress_slug; ?>" class="user_guide_support_forum" target="_blank">
37
+ <?php _e("Support Forum", $wd_options->prefix); ?>
38
+ </a>
39
+ <a href="https://web-dorado.com/support/faq.html" class="user_guide_faq" target="_blank">
40
+ <?php _e("FAQ", $wd_options->prefix); ?>
41
+ </a>
42
+ <?php if ( $wd_options->plugin_wd_addons_link ) { ?>
43
+ <a href="<?php echo $wd_options->plugin_wd_addons_link; ?>" class="user_guide_addons" target="_blank">
44
+ <?php _e("Addons", $wd_options->prefix); ?>
45
+ </a>
46
+ <?php } ?>
47
  </div>
48
+ </div>
49
  </div>
50
 
wd/templates/display_overview_welcome.php CHANGED
@@ -1,31 +1,30 @@
1
  <div id="welcome">
2
- <!-- display plugin video -->
3
- <?php if( $wd_options->video_youtube_id ){ ?>
4
- <div class="wd-video_container">
5
- <iframe width="100%" height="400" src="//www.youtube.com/embed/<?php echo $wd_options->video_youtube_id; ?>?rel=0" frameborder="0" allowfullscreen></iframe>
6
- </div>
7
- <?php }
8
- else if( $wd_options->overview_welcome_image ) { ?>
9
- <img src="<?php echo $wd_options->overview_welcome_image; ?>" width="100%" />
 
10
 
 
 
 
 
 
 
 
 
 
11
  <?php } ?>
12
-
13
- <!-- display plugin features -->
14
- <div class="plugin_features">
15
- <!-- if your plugin has a wizard-->
16
- <?php if( $wd_options->plugin_wizard_link ) { ?>
17
- <div class="wd-tour">
18
- <a class="wd-tour-btn" href="<?php echo $wd_options->plugin_wizard_link;?>"><?php _e( "Run Install Wizard ",$wd_options->prefix); ?></a>
19
- </div>
20
- <?php } ?>
21
- <?php foreach( $wd_options->plugin_features as $feature ){ ?>
22
- <h2 class="plugin_feature_title"><?php echo $feature["title"]; ?></h2>
23
- <div class="plugin_feature_description"><?php echo $feature["description"]; ?></div>
24
- <?php } ?>
25
- <div class="more_features_wrap">
26
- <a href="<?php echo $wd_options->plugin_wd_url; ?>" class="more_features" target="_blank"><?php _e( "More features", $wd_options->prefix ); ?></a>
27
- </div>
28
  </div>
29
-
30
- </div>
31
-
1
  <div id="welcome">
2
+ <!-- display plugin video -->
3
+ <?php if ( $wd_options->video_youtube_id ) { ?>
4
+ <div class="wd-video_container">
5
+ <iframe width="100%" height="400" src="//www.youtube.com/embed/<?php echo $wd_options->video_youtube_id; ?>?rel=0" frameborder="0" allowfullscreen></iframe>
6
+ </div>
7
+ <?php }
8
+ else {
9
+ if ( $wd_options->overview_welcome_image ) { ?>
10
+ <img src="<?php echo $wd_options->overview_welcome_image; ?>" width="100%" />
11
 
12
+ <?php }
13
+ } ?>
14
+ <!-- display plugin features -->
15
+ <div class="plugin_features">
16
+ <!-- if your plugin has a wizard-->
17
+ <?php if ( $wd_options->plugin_wizard_link ) { ?>
18
+ <div class="wd-tour">
19
+ <a class="wd-tour-btn" href="<?php echo $wd_options->plugin_wizard_link; ?>"><?php _e("Run Install Wizard ", $wd_options->prefix); ?></a>
20
+ </div>
21
  <?php } ?>
22
+ <?php foreach ( $wd_options->plugin_features as $feature ) { ?>
23
+ <h2 class="plugin_feature_title"><?php echo $feature["title"]; ?></h2>
24
+ <div class="plugin_feature_description"><?php echo $feature["description"]; ?></div>
25
+ <?php } ?>
26
+ <div class="more_features_wrap">
27
+ <a href="<?php echo $wd_options->plugin_wd_url; ?>" class="more_features" target="_blank"><?php _e("More features", $wd_options->prefix); ?></a>
 
 
 
 
 
 
 
 
 
 
28
  </div>
29
+ </div>
30
+ </div>
 
wd/templates/display_subscribe.php CHANGED
@@ -1,47 +1,50 @@
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>
10
- <p>
11
- <?php echo sprintf( __( "Allow %s to collect some usage data. This will allow you to get more out of your plugin experience - get awesome customer support, receive exclusive deals and discounts on premium products and more. You can choose to skip this step, %s will still work just fine.", $wd_options->prefix ), '<strong>Web-Dorado</strong>', $wd_options->plugin_title ); ?>
12
- </p>
13
- </div>
14
- <div class="btns">
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">
21
- <?php foreach( $list as $list_item ) { ?>
22
- <div class="list_item">
23
- <div class="list_img_wrap"><img src="<?php echo $list_item["img"]; ?>"></div>
24
- <div class="list_text_wrap">
25
- <div class="list_title"><?php echo $list_item["title"]; ?></div>
26
- <div class="list_text"><?php echo $list_item["small_text"]; ?></div>
27
- </div>
28
- </div>
29
- <?php } ?>
30
- </div>
31
  </div>
32
- <div class="wd-subscribe-footer">
33
- <ul class="wd-footer-menu">
34
- <li>
35
- <a href="https://web-dorado.com/web-dorado-privacy-statement.html" target="_blank">
36
- <?php _e( "Privacy Policy", $wd_options->prefix ); ?>
37
- </a>
38
- <span>.</span>
39
- </li>
40
- <li>
41
- <a href="https://web-dorado.com/terms-of-service.html" target="_blank">
42
- <?php _e( "Terms of Use", $wd_options->prefix ); ?>
43
- </a>
44
- </li>
45
- </ul>
46
- </div>
47
  </div>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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>
10
+ <p>
11
+ <?php
12
+ $pp_text = "<a target='_blank' href='https://web-dorado.com/web-dorado-privacy-statement.html'>" . __("Privacy Policy", $wd_options->prefix) . "</a>";
13
+ echo sprintf(__("Allow %s to collect some usage data, to be able to provide you more out of your plugin experience - awesome customer support and more. Check how we handle your personal data in our %s. You can always customize your preferences from the emails your receive from us. You can choose to skip this step, %s will still work just fine.", $wd_options->prefix), '<strong>Web-Dorado</strong>', $pp_text, $wd_options->plugin_title);
14
+ ?>
15
+ </p>
16
+ </div>
17
+ <div class="btns">
18
+ <a href="<?php echo "admin.php?page=" . $wd_options->prefix . "_subscribe&" . $wd_options->prefix . "_sub_action=allow"; ?>" class="allow_and_continue"></a>
19
+ <img src="<?php echo $wd_options->wd_url_img . '/loader.gif'; ?>" class="wd_loader">
20
+ <a href="<?php echo "admin.php?page=" . $wd_options->prefix . "_subscribe&" . $wd_options->prefix . "_sub_action=skip"; ?>" class="skip"></a>
21
+ </div>
22
+ <a href="#" class="permissions"><?php _e("What data is being collected?", $wd_options->prefix); ?></a>
23
+ <div class="list">
24
+ <?php foreach ( $list as $list_item ) { ?>
25
+ <div class="list_item">
26
+ <div class="list_img_wrap"><img src="<?php echo $list_item["img"]; ?>"></div>
27
+ <div class="list_text_wrap">
28
+ <div class="list_title"><?php echo $list_item["title"]; ?></div>
29
+ <div class="list_text"><?php echo $list_item["small_text"]; ?></div>
30
+ </div>
31
  </div>
32
+ <?php } ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
33
  </div>
34
+ </div>
35
+ <div class="wd-subscribe-footer">
36
+ <ul class="wd-footer-menu">
37
+ <li>
38
+ <a href="https://web-dorado.com/web-dorado-privacy-statement.html" target="_blank">
39
+ <?php _e("Privacy Policy", $wd_options->prefix); ?>
40
+ </a>
41
+ <span>.</span>
42
+ </li>
43
+ <li>
44
+ <a href="https://web-dorado.com/terms-of-service.html" target="_blank">
45
+ <?php _e("Terms of Use", $wd_options->prefix); ?>
46
+ </a>
47
+ </li>
48
+ </ul>
49
+ </div>
50
+ </div>
wd/wd.php CHANGED
@@ -1,156 +1,116 @@
1
  <?php
2
- if ( ! defined( 'ABSPATH' ) ) {
3
- exit;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
4
  }
5
-
6
- class DoradoWeb {
7
- ////////////////////////////////////////////////////////////////////////////////////////
8
- // Events //
9
- ////////////////////////////////////////////////////////////////////////////////////////
10
- ////////////////////////////////////////////////////////////////////////////////////////
11
- // Constants //
12
- ////////////////////////////////////////////////////////////////////////////////////////
13
- ////////////////////////////////////////////////////////////////////////////////////////
14
- // Variables //
15
- ////////////////////////////////////////////////////////////////////////////////////////
16
- public static $instance;
17
- public $overview_instance;
18
- public $subscribe_instance;
19
- public $config;
20
- private $version = "1.0.13";
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 DoradoWebConfig();
41
- $config->set_options( $options );
42
- $this->config = $config;
43
- if( !class_exists("DoradoWebApi") ){
44
- $this->wd_includes();
45
- }
46
-
47
- $this->init_classes();
48
- $this->register_hooks();
49
-
50
- }
51
-
52
- // Create overview menu page
53
- public function wd_overview_menu_page() {
54
- $wd_options = $this->config;
55
-
56
- $capability = $wd_options->menu_capability ? $wd_options->menu_capability : "manage_options";
57
- if( get_option( $wd_options->prefix . "_subscribe_done" ) == 1 || $wd_options->subscribe === false ){
58
- $parent_slug = $wd_options->custom_post;
59
- }
60
- else{
61
-
62
- $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, $wd_options->menu_position );
63
-
64
- $subscribe_instance = new DoradoWebSubscribe($this->config);
65
- $this->subscribe_instance = $subscribe_instance;
66
- add_action( 'admin_print_styles-' . $subscribe_page, array( $subscribe_instance, 'subscribe_styles' ) );
67
- add_action( 'admin_print_scripts-' . $subscribe_page, array( $subscribe_instance, 'subscribe_scripts' ) );
68
-
69
- $parent_slug = null;
70
- }
71
-
72
- $overview_page = add_submenu_page( $parent_slug, __( 'Overview', $wd_options->prefix ), __( 'Overview', $wd_options->prefix ), $capability, 'overview_' . $wd_options->prefix, array( $this, 'display_overview_page' ));
73
-
74
-
75
- $overview_instance = new DoradoWebOverview($this->config);
76
- $this->overview_instance = $overview_instance;
77
- add_action( 'admin_print_styles-' . $overview_page, array( $overview_instance, 'overview_styles' ) );
78
- add_action( 'admin_print_scripts-' . $overview_page, array( $overview_instance, 'overview_scripts' ) );
79
- }
80
-
81
- public function display_subscribew_page(){
82
- $this->subscribe_instance->subscribe_display_page();
83
- }
84
-
85
- // Display overview page
86
- public function display_overview_page() {
87
- $this->overview_instance->display_overview_page();
88
- }
89
-
90
-
91
- // Includs
92
- public function wd_includes(){
93
- $wd_options = $this->config;
94
-
95
- require_once $wd_options->wd_dir_includes . '/deactivate.php' ;
96
- // notices
97
- require_once $wd_options->wd_dir_includes . '/api.php';
98
- require_once $wd_options->wd_dir_includes . '/notices.php';
99
- require_once $wd_options->wd_dir_includes . "/overview.php";
100
- require_once $wd_options->wd_dir_includes . "/subscribe.php";
101
-
102
- }
103
- public function init_classes(){
104
- $wd_options = $this->config;
105
-
106
- $current_url = $_SERVER['REQUEST_URI'];
107
- if( $wd_options->deactivate === true ){
108
- if(strpos( $current_url, "plugins.php" ) !== false ){
109
- new DoradoWebDeactivate( $this->config );
110
- }
111
- }
112
-
113
- new DoradoWebNotices( $this->config );
114
-
115
- }
116
-
117
- public function register_hooks(){
118
- $wd_options = $this->config;
119
- if( $wd_options->deactivate === true ){
120
- add_filter( 'plugin_action_links_' . plugin_basename( $wd_options->plugin_main_file ), array( $this, 'change_deactivation_link' ) );
121
- }
122
-
123
- }
124
-
125
-
126
- public function change_deactivation_link ( $links ) {
127
- $wd_options = $this->config;
128
- $deactivate_url =
129
- add_query_arg(
130
- array(
131
- 'action' => 'deactivate',
132
- 'plugin' => plugin_basename( $wd_options->plugin_main_file ),
133
- '_wpnonce' => wp_create_nonce( 'deactivate-plugin_' . plugin_basename( $wd_options->plugin_main_file ) )
134
- ),
135
- admin_url( 'plugins.php' )
136
- );
137
-
138
- $links["deactivate"] = '<a href="'.$deactivate_url.'" class="' . $wd_options->prefix . '_deactivate_link">Deactivate</a>';
139
- return $links;
140
- }
141
-
142
- ////////////////////////////////////////////////////////////////////////////////////////
143
- // Getters & Setters //
144
- ////////////////////////////////////////////////////////////////////////////////////////
145
- ////////////////////////////////////////////////////////////////////////////////////////
146
- // Private Methods //
147
- ////////////////////////////////////////////////////////////////////////////////////////
148
-
149
- ////////////////////////////////////////////////////////////////////////////////////////
150
- // Listeners //
151
- ////////////////////////////////////////////////////////////////////////////////////////
152
-
153
  }
154
-
155
-
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
156
 
1
  <?php
2
+ if ( !defined('ABSPATH') ) {
3
+ exit;
4
+ }
5
+
6
+ class DoradoWeb {
7
+ public static $instance;
8
+ public $overview_instance;
9
+ public $subscribe_instance;
10
+ public $config;
11
+ private $version = "1.0.16";
12
+
13
+ public function __construct() {
14
+ // Add menu for Overview page
15
+ add_action('admin_menu', array( $this, 'wd_overview_menu_page' ), 10);
16
+ }
17
+
18
+ // Init plugin data
19
+ public function wd_init( $options ) {
20
+
21
+ if ( !is_array($options) ) {
22
+ return FALSE;
23
  }
24
+ $config = new DoradoWebConfig();
25
+ $config->set_options($options);
26
+ $this->config = $config;
27
+ if ( !class_exists("DoradoWebApi") ) {
28
+ $this->wd_includes();
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
29
  }
30
+ $this->init_classes();
31
+ $this->register_hooks();
32
+ }
33
+
34
+ // Create overview menu page
35
+ public function wd_overview_menu_page() {
36
+ $wd_options = $this->config;
37
+ $capability = $wd_options->menu_capability ? $wd_options->menu_capability : "manage_options";
38
+ if ( get_option($wd_options->prefix . "_subscribe_done") == 1 || $wd_options->subscribe === FALSE ) {
39
+ $parent_slug = $wd_options->custom_post;
40
+ }
41
+ else {
42
+
43
+ $subscribe_page = add_menu_page($wd_options->plugin_menu_title, $wd_options->plugin_menu_title, "manage_options", $wd_options->prefix . '_subscribe', array(
44
+ $this,
45
+ 'display_subscribew_page',
46
+ ), $wd_options->plugin_menu_icon, $wd_options->menu_position);
47
+ $subscribe_instance = new DoradoWebSubscribe($this->config);
48
+ $this->subscribe_instance = $subscribe_instance;
49
+ add_action('admin_print_styles-' . $subscribe_page, array( $subscribe_instance, 'subscribe_styles' ));
50
+ add_action('admin_print_scripts-' . $subscribe_page, array( $subscribe_instance, 'subscribe_scripts' ));
51
+ $parent_slug = NULL;
52
+ }
53
+ $overview_page = add_submenu_page($parent_slug, __('Overview', $wd_options->prefix), __('Overview', $wd_options->prefix), $capability, 'overview_' . $wd_options->prefix, array(
54
+ $this,
55
+ 'display_overview_page',
56
+ ));
57
+ $overview_instance = new DoradoWebOverview($this->config);
58
+ $this->overview_instance = $overview_instance;
59
+ add_action('admin_print_styles-' . $overview_page, array( $overview_instance, 'overview_styles' ));
60
+ add_action('admin_print_scripts-' . $overview_page, array( $overview_instance, 'overview_scripts' ));
61
+ }
62
+
63
+ public function display_subscribew_page() {
64
+ $this->subscribe_instance->subscribe_display_page();
65
+ }
66
+
67
+ // Display overview page
68
+ public function display_overview_page() {
69
+ $this->overview_instance->display_overview_page();
70
+ }
71
+
72
+ // Includes
73
+ public function wd_includes() {
74
+ $wd_options = $this->config;
75
+ require_once $wd_options->wd_dir_includes . '/deactivate.php';
76
+ // notices
77
+ require_once $wd_options->wd_dir_includes . '/api.php';
78
+ require_once $wd_options->wd_dir_includes . '/notices.php';
79
+ require_once $wd_options->wd_dir_includes . "/overview.php";
80
+ require_once $wd_options->wd_dir_includes . "/subscribe.php";
81
+ }
82
+
83
+ public function init_classes() {
84
+ $wd_options = $this->config;
85
+ $current_url = $_SERVER['REQUEST_URI'];
86
+ if ( $wd_options->deactivate === TRUE ) {
87
+ if ( strpos($current_url, "plugins.php") !== FALSE ) {
88
+ new DoradoWebDeactivate($this->config);
89
+ }
90
+ }
91
+ new DoradoWebNotices($this->config);
92
+ }
93
+
94
+ public function register_hooks() {
95
+ $wd_options = $this->config;
96
+ if ( $wd_options->deactivate === TRUE ) {
97
+ add_filter('plugin_action_links_' . plugin_basename($wd_options->plugin_main_file), array(
98
+ $this,
99
+ 'change_deactivation_link',
100
+ ));
101
+ }
102
+ }
103
+
104
+ public function change_deactivation_link( $links ) {
105
+ $wd_options = $this->config;
106
+ $deactivate_url = add_query_arg(array(
107
+ 'action' => 'deactivate',
108
+ 'plugin' => plugin_basename($wd_options->plugin_main_file),
109
+ '_wpnonce' => wp_create_nonce('deactivate-plugin_' . plugin_basename($wd_options->plugin_main_file)),
110
+ ), admin_url('plugins.php'));
111
+ $links["deactivate"] = '<a href="' . $deactivate_url . '" class="' . $wd_options->prefix . '_deactivate_link">Deactivate</a>';
112
+
113
+ return $links;
114
+ }
115
+ }
116