Form Maker by WD – user-friendly drag & drop Form Builder plugin - Version 1.11.8

Version Description

  • Updated: WD Library.
Download this release

Release Info

Developer webdorado
Plugin Icon 128x128 Form Maker by WD – user-friendly drag & drop Form Builder plugin
Version 1.11.8
Comparing to
See all releases

Code changes from version 1.11.7 to 1.11.8

form-maker.php CHANGED
@@ -3,7 +3,7 @@
3
  * Plugin Name: Form Maker
4
  * Plugin URI: https://web-dorado.com/products/form-maker-wordpress.html
5
  * Description: This plugin is a modern and advanced tool for easy and fast creating of a WordPress Form. The backend interface is intuitive and user friendly which allows users far from scripting and programming to create WordPress Forms.
6
- * Version: 1.11.7
7
  * Author: WebDorado Form Builder Team
8
  * Author URI: https://web-dorado.com/
9
  * License: GNU/GPLv3 http://www.gnu.org/licenses/gpl-3.0.html
@@ -11,7 +11,7 @@
11
  define('WD_FM_DIR', WP_PLUGIN_DIR . "/" . plugin_basename(dirname(__FILE__)));
12
  define('WD_FM_URL', plugins_url(plugin_basename(dirname(__FILE__))));
13
  define('WD_MAIN_FILE', plugin_basename(__FILE__));
14
- define('WD_FM_VERSION', '1.11.7');
15
  // Plugin menu.
16
  function form_maker_options_panel() {
17
  $parent_slug = null;
@@ -782,4 +782,4 @@ function fm_overview() {
782
  dorado_web_init($fm_options);
783
  }
784
  }
785
- add_action('init', 'fm_overview');
3
  * Plugin Name: Form Maker
4
  * Plugin URI: https://web-dorado.com/products/form-maker-wordpress.html
5
  * Description: This plugin is a modern and advanced tool for easy and fast creating of a WordPress Form. The backend interface is intuitive and user friendly which allows users far from scripting and programming to create WordPress Forms.
6
+ * Version: 1.11.8
7
  * Author: WebDorado Form Builder Team
8
  * Author URI: https://web-dorado.com/
9
  * License: GNU/GPLv3 http://www.gnu.org/licenses/gpl-3.0.html
11
  define('WD_FM_DIR', WP_PLUGIN_DIR . "/" . plugin_basename(dirname(__FILE__)));
12
  define('WD_FM_URL', plugins_url(plugin_basename(dirname(__FILE__))));
13
  define('WD_MAIN_FILE', plugin_basename(__FILE__));
14
+ define('WD_FM_VERSION', '1.11.8');
15
  // Plugin menu.
16
  function form_maker_options_panel() {
17
  $parent_slug = null;
782
  dorado_web_init($fm_options);
783
  }
784
  }
785
+ add_action('init', 'fm_overview', 9);
readme.txt CHANGED
@@ -4,7 +4,7 @@ Donate link: https://web-dorado.com/products/wordpress-form.html
4
  Tags: form, form builder, contact form, custom form, feedback, contact, contact forms, captcha, email, form manager, forms, survey
5
  Requires at least: 3.4
6
  Tested up to: 4.8
7
- Stable tag: 1.11.7
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
@@ -290,8 +290,11 @@ MailChimp form add-on of Form Maker lets you build up a customer database on you
290
 
291
  == Changelog ==
292
 
 
 
 
293
  = 1.11.7 =
294
- * Fixed: Theme version control.
295
 
296
  = 1.11.6 =
297
  * Fixed: Shortcode editor pop-up styles.
@@ -305,18 +308,18 @@ MailChimp form add-on of Form Maker lets you build up a customer database on you
305
  * Fixed: File upload field styles with "Inherit from website theme".
306
 
307
  = 1.11.4 =
308
- * Fixed: Bug on submissions edit
309
  * Fixed: Bug on color picker when choosing transparency
310
- * Fixed: Bug on Paypal notifications
311
  * Fixed: Bug on "Inherit from website" theme
 
312
  * Changed: Form Options tab id to avoid conflict with some plugins
313
 
314
 
315
  = 1.11.3 =
316
- * Fixed: Uninstall bug in free version
317
  * Added: Global option to enable Advanced Layout
318
  * Changed: Themes table field name: `params` to `css`
319
  * Fixed: Bug on PHP 5.2
 
320
  * Fixed: bug on generating Theme css
321
  * Fixed: CSS conflict with some ajax themes
322
 
@@ -332,8 +335,8 @@ MailChimp form add-on of Form Maker lets you build up a customer database on you
332
  * Added: Form Header
333
  * Added: New Themes
334
  * Added: New Theme Editor
335
- * Fixed: Database creation on some versions of MySQL
336
  * Added: Form Display Options (Embedded, Popup, Topbar, Scrollbox)
 
337
  * Fixed: Removed html tags from csv and xml
338
 
339
  = 1.10.11 =
4
  Tags: form, form builder, contact form, custom form, feedback, contact, contact forms, captcha, email, form manager, forms, survey
5
  Requires at least: 3.4
6
  Tested up to: 4.8
7
+ Stable tag: 1.11.8
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
290
 
291
  == Changelog ==
292
 
293
+ = 1.11.8 =
294
+ * Updated: WD Library.
295
+
296
  = 1.11.7 =
297
+ * Fixed: Theme version control.
298
 
299
  = 1.11.6 =
300
  * Fixed: Shortcode editor pop-up styles.
308
  * Fixed: File upload field styles with "Inherit from website theme".
309
 
310
  = 1.11.4 =
 
311
  * Fixed: Bug on color picker when choosing transparency
312
+ * Fixed: Bug on submissions edit
313
  * Fixed: Bug on "Inherit from website" theme
314
+ * Fixed: Bug on Paypal notifications
315
  * Changed: Form Options tab id to avoid conflict with some plugins
316
 
317
 
318
  = 1.11.3 =
 
319
  * Added: Global option to enable Advanced Layout
320
  * Changed: Themes table field name: `params` to `css`
321
  * Fixed: Bug on PHP 5.2
322
+ * Fixed: Uninstall bug in free version
323
  * Fixed: bug on generating Theme css
324
  * Fixed: CSS conflict with some ajax themes
325
 
335
  * Added: Form Header
336
  * Added: New Themes
337
  * Added: New Theme Editor
 
338
  * Added: Form Display Options (Embedded, Popup, Topbar, Scrollbox)
339
+ * Fixed: Database creation on some versions of MySQL
340
  * Fixed: Removed html tags from csv and xml
341
 
342
  = 1.10.11 =
wd/README.md CHANGED
@@ -1,129 +1,130 @@
1
- Version: 1.0.8
2
-
3
-
4
- Usage:
5
-
6
- Copy and paste wd library into your plugin folder.
7
- In your plugin main file check if library main DoradoWeb class doesn't exist, include it
8
- if( !class_exists("DoradoWeb") ){
9
- require_once(PATH_TO_YOUR_PLUGIN_DIR . '/wd/start.php');
10
- }
11
-
12
- Then call dorado_web_init($options) function.
13
- $options = array (
14
- "prefix" => "your_plugin_prefix",
15
- "wd_plugin_id" => your_plugin_id,
16
- "plugin_title" => "your plugin titile",
17
- "plugin_wordpress_slug" => "your plugin wordpress slug",
18
- "plugin_dir" => 'path to your plugin dir',
19
- "plugin_main_file" => 'path to your plugin main file',
20
- "description" => 'your plugin description',
21
-
22
- "plugin_features" => array(
23
- 0 => array(
24
- "title" => "feature title 1",
25
- "description" => "feature 1 description",
26
- ),
27
- 1 => array(
28
- "title" => "feature title 2",
29
- "description" => "feature 2 description",
30
- ),
31
- ...
32
- ),
33
- "user_guide" => array(
34
- 0 => array(
35
- "main_title" => "user guide step 1",
36
- "url" => "link to step 1",
37
- "titles" => array(
38
- array(
39
- "title" => "step 1 sub title",
40
- "url" => "link to step 1 sub"
41
- )
42
- )
43
- ),
44
- ...
45
- ),
46
- "overview_welcome_image" => null,
47
- "video_youtube_id" => "your plugin youtube video id", // e.g. https://www.youtube.com/watch?v=acaexefeP7o youtube id is the acaexefeP7o
48
- "plugin_wd_url" => "https://web-dorado.com/products/your plugin",
49
- "plugin_wd_demo_link" => "http://wpdemo.web-dorado.com/your plugin",
50
- "plugin_wd_addons_link" => "https://web-dorado.com/products/your plugin addons",
51
- "after_subscribe" => "after subsribe page", // this can be plagin overview page or set up page admin.php?page=overview_YOUR_PREFIX
52
- "plugin_wizard_link" => "your plugin wizard page",
53
- "plugin_menu_title" => "Your plugin menu title",
54
- "plugin_menu_icon" => "path to menu icon",
55
- "deactivate" => true,
56
- "subscribe" => true,
57
- "custom_post" => false, // if true => edit.php?post_type=contact
58
- "menu_capability" => "manage_options",
59
- "menu_position" => null,
60
- );
61
-
62
- Fully documentation of dorado_web_init options:
63
-
64
- prefix - (type string) your plugin prefix
65
- wd_plugin_id - (type int) plugin id ( in web-dorado database, you use it for update functionality)
66
- plugin_wd_zip_name - (type string) plugin zip name (in web-dorado database, ask Armen or Sergey )
67
- plugin_title - type string) plugin title (
68
- plugin_wordpress_slug - (type string) plugin slug
69
- plugin_dir - (type string) full file path to your plugin directory
70
- plugin_main_file - (type string) path to your plugin main file (__FILE__)
71
- description - (type string) plugin short description
72
-
73
- plugin_features - (type array) plugin top 5 features from web-dorado.com
74
- e.g. (for google maps plugin)
75
- array(
76
- 0 => array(
77
- "title" => __("Easy set up", "gmwd"),
78
- "description" => __("After installation a set-up guide will help you configure general options and get started on the dashboard. The plugin also displays tooltips in the whole admin area and settings. Moreover, you get instant live previews of changes you make in the working area, so you don’t have to save and publish maps to see the results.", "gmwd"),
79
- ),
80
- 1 => array(
81
- "title" => __("Unlimited Everything", "gmwd"),
82
- "description" => __("Display unlimited maps on any page or post. Same is true for markers, rectangles, circles, polygons and polylines.", "gmwd"),
83
- ),
84
- ....
85
- )
86
-
87
- user_guide - (type array) plugin user guide links from web-dorado.com
88
- e.g. (for google maps plugin)
89
- array(
90
- 0 => array(
91
- "main_title" => __("Installation Wizard/ Options Menu", "gmwd"),
92
- "url" => "https://web-dorado.com/wordpress-google-maps/installation-wizard-options-menu.html",
93
- "titles" => array(
94
- array(
95
- "title" => __("Configuring Map API Key", "gmwd"),
96
- "url" => "https://web-dorado.com/wordpress-google-maps/installation-wizard-options-menu/configuring-api-key.html"
97
- )
98
- )
99
- ),
100
- 1 => array(
101
- "main_title" => __("Creating Map", "gmwd"),
102
- "url" => "https://web-dorado.com/wordpress-google-maps/creating-map.html",
103
- "titles" => array()
104
- ),
105
- )
106
-
107
- video_youtube_id - (type string) if your plugin has video, video's id, else null
108
- ( e.g. for https://www.youtube.com/watch?v=acaexefeP7o , youtube id is the 'acaexefeP7o' )
109
-
110
- plugin_wd_url - (type string) plugin page url
111
- (e.g. https://web-dorado.com/products/wordpress-google-maps-plugin.html)
112
-
113
- plugin_wd_demo_link - (type string) plugin demo url
114
- plugin_wd_addons_link - (type string) if plugin has addons , plugin addons link, else null
115
- plugin_wizard_link - (type string) if plugin has wizard, wizard page , else null
116
- ( e.g. admin_url( 'index.php?page=gmwd_setup' ) )
117
-
118
- plugin_menu_title - (type string) plugin wordpress backend menu title
119
- plugin_menu_icon - (type string) path to plugin wordpress backend menu icon
120
- ( e.g. GMWD_URL . '/images/icon-map-20.png' )
121
- deactivate - (type bool) if plugin free deactivate = true, else deactivate = false
122
- subscribe - (type bool) if plugin free subscribe = true, else subscribe = false
123
- custom_post - ( type string) if plugin has not custom posts it must be top level menu slug, else toplevel menu url , e.g. edit.php?post_type=contact
124
- menu_capability - (type string) top level menu capability e.g. manage_options
125
- menu_position - (type string) top level menu position , default is null
126
-
127
-
128
-
129
-
 
1
+ Version: 1.0.10
2
+
3
+
4
+
5
+ Usage:
6
+
7
+ Copy and paste wd library into your plugin folder.
8
+ In your plugin main file check if library main DoradoWeb class doesn't exist, include it
9
+ if( !class_exists("DoradoWeb") ){
10
+ require_once(PATH_TO_YOUR_PLUGIN_DIR . '/wd/start.php');
11
+ }
12
+
13
+ Then call dorado_web_init($options) function.
14
+ $options = array (
15
+ "prefix" => "your_plugin_prefix",
16
+ "wd_plugin_id" => your_plugin_id,
17
+ "plugin_title" => "your plugin titile",
18
+ "plugin_wordpress_slug" => "your plugin wordpress slug",
19
+ "plugin_dir" => 'path to your plugin dir',
20
+ "plugin_main_file" => 'path to your plugin main file',
21
+ "description" => 'your plugin description',
22
+
23
+ "plugin_features" => array(
24
+ 0 => array(
25
+ "title" => "feature title 1",
26
+ "description" => "feature 1 description",
27
+ ),
28
+ 1 => array(
29
+ "title" => "feature title 2",
30
+ "description" => "feature 2 description",
31
+ ),
32
+ ...
33
+ ),
34
+ "user_guide" => array(
35
+ 0 => array(
36
+ "main_title" => "user guide step 1",
37
+ "url" => "link to step 1",
38
+ "titles" => array(
39
+ array(
40
+ "title" => "step 1 sub title",
41
+ "url" => "link to step 1 sub"
42
+ )
43
+ )
44
+ ),
45
+ ...
46
+ ),
47
+ "overview_welcome_image" => null,
48
+ "video_youtube_id" => "your plugin youtube video id", // e.g. https://www.youtube.com/watch?v=acaexefeP7o youtube id is the acaexefeP7o
49
+ "plugin_wd_url" => "https://web-dorado.com/products/your plugin",
50
+ "plugin_wd_demo_link" => "http://wpdemo.web-dorado.com/your plugin",
51
+ "plugin_wd_addons_link" => "https://web-dorado.com/products/your plugin addons",
52
+ "after_subscribe" => "after subsribe page", // this can be plagin overview page or set up page admin.php?page=overview_YOUR_PREFIX
53
+ "plugin_wizard_link" => "your plugin wizard page",
54
+ "plugin_menu_title" => "Your plugin menu title",
55
+ "plugin_menu_icon" => "path to menu icon",
56
+ "deactivate" => true,
57
+ "subscribe" => true,
58
+ "custom_post" => false, // if true => edit.php?post_type=contact
59
+ "menu_capability" => "manage_options",
60
+ "menu_position" => null,
61
+ );
62
+
63
+ Fully documentation of dorado_web_init options:
64
+
65
+ prefix - (type string) your plugin prefix
66
+ wd_plugin_id - (type int) plugin id ( in web-dorado database, you use it for update functionality)
67
+ plugin_wd_zip_name - (type string) plugin zip name (in web-dorado database, ask Armen or Sergey )
68
+ plugin_title - type string) plugin title (
69
+ plugin_wordpress_slug - (type string) plugin slug
70
+ plugin_dir - (type string) full file path to your plugin directory
71
+ plugin_main_file - (type string) path to your plugin main file (__FILE__)
72
+ description - (type string) plugin short description
73
+
74
+ plugin_features - (type array) plugin top 5 features from web-dorado.com
75
+ e.g. (for google maps plugin)
76
+ array(
77
+ 0 => array(
78
+ "title" => __("Easy set up", "gmwd"),
79
+ "description" => __("After installation a set-up guide will help you configure general options and get started on the dashboard. The plugin also displays tooltips in the whole admin area and settings. Moreover, you get instant live previews of changes you make in the working area, so you don’t have to save and publish maps to see the results.", "gmwd"),
80
+ ),
81
+ 1 => array(
82
+ "title" => __("Unlimited Everything", "gmwd"),
83
+ "description" => __("Display unlimited maps on any page or post. Same is true for markers, rectangles, circles, polygons and polylines.", "gmwd"),
84
+ ),
85
+ ....
86
+ )
87
+
88
+ user_guide - (type array) plugin user guide links from web-dorado.com
89
+ e.g. (for google maps plugin)
90
+ array(
91
+ 0 => array(
92
+ "main_title" => __("Installation Wizard/ Options Menu", "gmwd"),
93
+ "url" => "https://web-dorado.com/wordpress-google-maps/installation-wizard-options-menu.html",
94
+ "titles" => array(
95
+ array(
96
+ "title" => __("Configuring Map API Key", "gmwd"),
97
+ "url" => "https://web-dorado.com/wordpress-google-maps/installation-wizard-options-menu/configuring-api-key.html"
98
+ )
99
+ )
100
+ ),
101
+ 1 => array(
102
+ "main_title" => __("Creating Map", "gmwd"),
103
+ "url" => "https://web-dorado.com/wordpress-google-maps/creating-map.html",
104
+ "titles" => array()
105
+ ),
106
+ )
107
+
108
+ video_youtube_id - (type string) if your plugin has video, video's id, else null
109
+ ( e.g. for https://www.youtube.com/watch?v=acaexefeP7o , youtube id is the 'acaexefeP7o' )
110
+
111
+ plugin_wd_url - (type string) plugin page url
112
+ (e.g. https://web-dorado.com/products/wordpress-google-maps-plugin.html)
113
+
114
+ plugin_wd_demo_link - (type string) plugin demo url
115
+ plugin_wd_addons_link - (type string) if plugin has addons , plugin addons link, else null
116
+ plugin_wizard_link - (type string) if plugin has wizard, wizard page , else null
117
+ ( e.g. admin_url( 'index.php?page=gmwd_setup' ) )
118
+
119
+ plugin_menu_title - (type string) plugin wordpress backend menu title
120
+ plugin_menu_icon - (type string) path to plugin wordpress backend menu icon
121
+ ( e.g. GMWD_URL . '/images/icon-map-20.png' )
122
+ deactivate - (type bool) if plugin free deactivate = true, else deactivate = false
123
+ subscribe - (type bool) if plugin free subscribe = true, else subscribe = false
124
+ custom_post - ( type string) if plugin has not custom posts it must be top level menu slug, else toplevel menu url , e.g. edit.php?post_type=contact
125
+ menu_capability - (type string) top level menu capability e.g. manage_options
126
+ menu_position - (type string) top level menu position , default is null
127
+
128
+
129
+
130
+
wd/assets/css/deactivate_popup.css CHANGED
@@ -1,86 +1,86 @@
1
- .wd-opacity{
2
- position: fixed;
3
- top: 0px;
4
- bottom: 0px;
5
- left: 0px;
6
- right: 0px;
7
- z-index: 9999;
8
- background: #000;
9
- opacity: 0.5;
10
- display: none;
11
- }
12
-
13
- .wd-deactivate-popup{
14
- position: fixed;
15
- top: 0px;
16
- bottom: 0px;
17
- left: 0px;
18
- right: 0px;
19
- background: #fff;
20
- z-index: 999999;
21
- width: 600px;
22
- height: 281px;
23
- margin: auto;
24
- display: none;
25
- box-sizing: border-box;
26
- }
27
-
28
-
29
- .wd-deactivate-popup-header{
30
- border-bottom: 1px solid #ccc;
31
- padding: 18px 40px;
32
- font-size: 16px;
33
- background: rgba(221, 221, 221, 0.14);
34
- }
35
- .wd-deactivate-popup-body{
36
- padding: 20px 40px;
37
- border-bottom: 1px solid #ccc;
38
- }
39
- .wd-deactivate-popup-body input[type=text]{
40
- width: 220px;
41
- }
42
- .wd-deactivate-popup-body textarea{
43
- width: 100%;
44
- }
45
-
46
- .wd-btns{
47
- position: absolute;
48
- bottom: 19px;
49
- right: 19px
50
- }
51
-
52
- .additional_details_wrap{
53
- margin-top: 20px;
54
- }
55
-
56
- .wd-additional-active{
57
- background: rgba(204, 204, 204, 0.18);
58
- padding: 15px;
59
- margin: 14px 0px 5px;
60
- }
61
- .wd-popup-active1{
62
- height: 523px !important;
63
- }
64
-
65
- .wd-popup-active2{
66
- height: 426px !important
67
- }
68
- .wd-deactivate-popup-opacity{
69
- width: 100%;
70
- height: 100%;
71
- background: #D9D9D9;
72
- opacity: 0.3;
73
- z-index: 45;
74
- position: absolute;
75
- display: none;
76
- }
77
-
78
- .wd-deactivate-popup-opacity .wd-img-loader{
79
- position: absolute;
80
- top: 0;
81
- left: 0;
82
- right: 0;
83
- bottom: 0;
84
- margin: auto;
85
- z-index: 63;
86
- }
1
+ .wd-opacity{
2
+ position: fixed;
3
+ top: 0px;
4
+ bottom: 0px;
5
+ left: 0px;
6
+ right: 0px;
7
+ z-index: 9999;
8
+ background: #000;
9
+ opacity: 0.5;
10
+ display: none;
11
+ }
12
+
13
+ .wd-deactivate-popup{
14
+ position: fixed;
15
+ top: 0px;
16
+ bottom: 0px;
17
+ left: 0px;
18
+ right: 0px;
19
+ background: #fff;
20
+ z-index: 999999;
21
+ width: 600px;
22
+ height: 281px;
23
+ margin: auto;
24
+ display: none;
25
+ box-sizing: border-box;
26
+ }
27
+
28
+
29
+ .wd-deactivate-popup-header{
30
+ border-bottom: 1px solid #ccc;
31
+ padding: 18px 40px;
32
+ font-size: 16px;
33
+ background: rgba(221, 221, 221, 0.14);
34
+ }
35
+ .wd-deactivate-popup-body{
36
+ padding: 20px 40px;
37
+ border-bottom: 1px solid #ccc;
38
+ }
39
+ .wd-deactivate-popup-body input[type=text]{
40
+ width: 220px;
41
+ }
42
+ .wd-deactivate-popup-body textarea{
43
+ width: 100%;
44
+ }
45
+
46
+ .wd-btns{
47
+ position: absolute;
48
+ bottom: 19px;
49
+ right: 19px
50
+ }
51
+
52
+ .additional_details_wrap{
53
+ margin-top: 20px;
54
+ }
55
+
56
+ .wd-additional-active{
57
+ background: rgba(204, 204, 204, 0.18);
58
+ padding: 15px;
59
+ margin: 14px 0px 5px;
60
+ }
61
+ .wd-popup-active1{
62
+ height: 523px !important;
63
+ }
64
+
65
+ .wd-popup-active2{
66
+ height: 426px !important
67
+ }
68
+ .wd-deactivate-popup-opacity{
69
+ width: 100%;
70
+ height: 100%;
71
+ background: #D9D9D9;
72
+ opacity: 0.3;
73
+ z-index: 45;
74
+ position: absolute;
75
+ display: none;
76
+ }
77
+
78
+ .wd-deactivate-popup-opacity .wd-img-loader{
79
+ position: absolute;
80
+ top: 0;
81
+ left: 0;
82
+ right: 0;
83
+ bottom: 0;
84
+ margin: auto;
85
+ z-index: 63;
86
+ }
wd/assets/js/deactivate_popup.js CHANGED
@@ -1,106 +1,107 @@
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
- // Getters & Setters //
100
- ////////////////////////////////////////////////////////////////////////////////////////
101
- ////////////////////////////////////////////////////////////////////////////////////////
102
- // Private Methods //
103
- ////////////////////////////////////////////////////////////////////////////////////////
104
- ////////////////////////////////////////////////////////////////////////////////////////
105
- // Listeners //
 
106
  ////////////////////////////////////////////////////////////////////////////////////////
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
  ////////////////////////////////////////////////////////////////////////////////////////
wd/includes/api.php CHANGED
@@ -1,81 +1,81 @@
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 = 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
+ ////////////////////////////////////////////////////////////////////////////////////////
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
  }
wd/includes/deactivate.php CHANGED
@@ -1,168 +1,179 @@
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
- require ( $wd_options->wd_dir_templates . '/display_deactivation_popup.php' );
80
- }
81
-
82
-
83
-
84
- public function scripts(){
85
- $wd_options = $this->config;
86
- wp_enqueue_style( 'wd-deactivate-popup', $wd_options->wd_url_css . '/deactivate_popup.css', array(), get_option($wd_options->prefix . "_version" ) );
87
- wp_enqueue_script( 'wd-deactivate-popup', $wd_options->wd_url_js . '/deactivate_popup.js', array(), get_option($wd_options->prefix . "_version" ));
88
-
89
- $admin_data = wp_get_current_user();
90
- wp_localize_script( 'wd-deactivate-popup', $wd_options->prefix . 'WDDeactivateVars' , array(
91
- "prefix" => $wd_options->prefix ,
92
- "deactivate_class" => $wd_options->prefix . '_deactivate_link',
93
- "email" => $admin_data->data->user_email,
94
- "plugin_wd_url" => $wd_options->plugin_wd_url,
95
- ));
96
-
97
-
98
- }
99
- public function submit_and_deactivate(){
100
- $wd_options = $this->config;
101
- if( isset( $_POST[$wd_options->prefix . "_submit_and_deactivate"] ) ){
102
-
103
- if( $_POST[$wd_options->prefix . "_submit_and_deactivate"] == 2 || $_POST[$wd_options->prefix . "_submit_and_deactivate"] == 3 ){
104
- $api = new DoradoWebApi( $wd_options );
105
- $hash = $api->get_hash();
106
- if($hash != null){
107
- $data = array();
108
-
109
- $data["reason"] = isset($_POST[$wd_options->prefix . "_reasons"]) ? $_POST[$wd_options->prefix . "_reasons"] : "";
110
- $data["site_url"] = site_url();
111
- $data["plugin_id"] = $wd_options->wd_plugin_id;
112
-
113
- $data["additional_details"] = isset($_POST[$wd_options->prefix . "_additional_details"]) ? $_POST[$wd_options->prefix . "_additional_details"] : "";
114
- $admin_data = wp_get_current_user();
115
- $data["email"] = isset($_POST[$wd_options->prefix . "_email"]) ? $_POST[$wd_options->prefix . "_email"] : $admin_data->data->user_email;
116
- $user_first_name = get_user_meta( $admin_data->ID, "first_name", true );
117
- $user_last_name = get_user_meta( $admin_data->ID, "last_name", true );
118
-
119
- $data["name"] = $user_first_name || $user_last_name ? $user_first_name . " " . $user_last_name : $admin_data->data->user_login;
120
- $data["hash"] = $hash;
121
- $response = wp_remote_post( "https://api.web-dorado.com/deactivatereasons", array(
122
- 'method' => 'POST',
123
- 'timeout' => 45,
124
- 'redirection' => 5,
125
- 'httpversion' => '1.0',
126
- 'blocking' => true,
127
- 'headers' => array(),
128
- 'body' => json_encode($data),
129
- 'cookies' => array()
130
- )
131
- );
132
-
133
- $response_body = isset( $response["body"] ) ? json_decode( $response["body"], true ) : null;
134
- if( is_array( $response_body ) && $response_body["body"]["msg"] == "Access" ) {
135
-
136
- }
137
- }
138
- }
139
- if($_POST[$wd_options->prefix . "_submit_and_deactivate"] == 2 || $_POST[$wd_options->prefix . "_submit_and_deactivate"] == 1 ){
140
- $deactivate_url =
141
- add_query_arg(
142
- array(
143
- 'action' => 'deactivate',
144
- 'plugin' => plugin_basename( $wd_options->plugin_main_file ),
145
- '_wpnonce' => wp_create_nonce( 'deactivate-plugin_' . plugin_basename( $wd_options->plugin_main_file ) )
146
- ),
147
- admin_url( 'plugins.php' )
148
- );
149
- echo '<script>window.location.href="' . $deactivate_url . '";</script>';
150
- }
151
-
152
- }
153
- }
154
-
155
- ////////////////////////////////////////////////////////////////////////////////////////
156
- // Getters & Setters //
157
- ////////////////////////////////////////////////////////////////////////////////////////
158
- ////////////////////////////////////////////////////////////////////////////////////////
159
- // Private Methods //
160
- ////////////////////////////////////////////////////////////////////////////////////////
161
-
162
- ////////////////////////////////////////////////////////////////////////////////////////
163
- // Listeners //
164
- ////////////////////////////////////////////////////////////////////////////////////////
165
-
166
- }
167
-
168
-
 
 
 
 
 
 
 
 
 
 
 
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
+
wd/includes/overview.php CHANGED
@@ -1,310 +1,304 @@
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
- require_once( $wd_options->wd_dir_templates . "/display_overview.php" );
62
- }
63
- public function wd_overview_welcome(){
64
- $wd_options = $this->config;
65
- //http://api.wordpress.org/plugins/info/1.0/wd-google-maps
66
- require_once( $wd_options->wd_dir_templates . "/display_overview_welcome.php" );
67
- }
68
- public function wd_overview_user_guide(){
69
- $wd_options = $this->config;
70
- $user_guide = $wd_options->user_guide;
71
- require_once( $wd_options->wd_dir_templates . "/display_overview_user_guide.php" );
72
- }
73
- public function wd_overview_deals(){
74
-
75
- $wd_options = $this->config;
76
- $plugins = array(
77
- "form-maker" => array(
78
- 'title' => 'Form Maker',
79
- 'text' => __( 'Wordpress form builder plugin', $wd_options->prefix ),
80
- 'content' => __( 'Form Maker is a modern and advanced tool for creating WordPress forms easily and fast.', $wd_options->prefix ),
81
- 'href' => 'https://web-dorado.com/products/wordpress-form.html'
82
- ),
83
- "photo-gallery" => array(
84
- 'title' => 'Photo Gallery',
85
- 'text' => __( 'WordPress Photo Gallery plugin', $wd_options->prefix ),
86
- 'content' => __( 'Photo Gallery is a fully responsive WordPress Gallery plugin with advanced functionality.', $wd_options->prefix ),
87
- 'href' => 'https://web-dorado.com/products/wordpress-photo-gallery-plugin.html'
88
- ),
89
- "event-calendar-wd" => array(
90
- 'title' => 'Event Calendar WD',
91
- 'text' => __( 'WordPress calendar plugin', $wd_options->prefix ),
92
- 'content' => __( 'Organize and publish your events in an easy and elegant way using Event Calendar WD.', $wd_options->prefix ),
93
- 'href' => 'https://web-dorado.com/products/wordpress-event-calendar-wd.html'
94
- ),
95
- "wd-google-maps" => array(
96
- 'title' => 'WD Google Maps',
97
- 'text' => __( 'WD Google Maps plugin', $wd_options->prefix ),
98
- '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 ),
99
- 'href' => 'https://web-dorado.com/products/wordpress-google-maps-plugin.html'
100
- ),
101
- "slider-wd" => array(
102
- 'title' => 'Slider WD',
103
- 'text' => __( 'WordPress slider plugin', $wd_options->prefix ),
104
- 'content' => __( 'Create responsive, highly configurable sliders with various effects for your WordPress site.', $wd_options->prefix ),
105
- 'href' => 'https://web-dorado.com/products/wordpress-slider-plugin.html'
106
- ),
107
- "spider-event-calendar" => array(
108
- 'title' => 'Spider Calendar',
109
- 'text' => __( 'WordPress event calendar plugin', $wd_options->prefix ),
110
- 'content' => __( 'Spider Event Calendar is a highly configurable product which allows you to have multiple organized events.', $wd_options->prefix ),
111
- 'href' => 'https://web-dorado.com/products/wordpress-calendar.html'
112
- ),
113
- "wd-instagram-feed" => array(
114
- 'title' => 'Instagram Feed WD',
115
- 'text' => __( 'WordPress Instagram Feed plugin', $wd_options->prefix ),
116
- 'content' => __( 'WD Instagram Feed is a user-friendly tool for displaying user or hashtag-based feeds on your website.', $wd_options->prefix ),
117
- 'href' => 'https://web-dorado.com/products/wordpress-instagram-feed-wd.html'
118
- ),
119
- );
120
- unset($plugins[$wd_options->plugin_wordpress_slug]) ;
121
-
122
- // foreach ( $plugins as $wp_slug => &$plugin ){
123
- // $wp_data = $this->remote_get($wp_slug);
124
- // $plugin["downloaded"] = $wp_data["downloaded"];
125
- // $plugin["rating"] = $wp_data["rating"];
126
- // }
127
-
128
- $themes = array(
129
- "business_elite" => array(
130
- 'title' => 'Business Elite Theme',
131
- 'href' => 'https://web-dorado.com/wordpress-themes/business-elite.html'
132
- ),
133
- "portfolio_gallery" => array(
134
- 'title' => 'Portfolio Gallery Theme',
135
- 'href' => 'https://web-dorado.com/wordpress-themes/portfolio-gallery.html'
136
- ),
137
- "sauron" => array(
138
- 'title' => 'Sauron Theme',
139
- 'href' => 'https://web-dorado.com/wordpress-themes/sauron.html'
140
- ),
141
- "business_world" => array(
142
- 'title' => 'Business World Theme',
143
- 'href' => 'https://web-dorado.com/wordpress-themes/business-world.html'
144
- ),
145
- );
146
-
147
- require_once( $wd_options->wd_dir_templates . "/display_overview_deals.php" );
148
- }
149
- public function wd_overview_support(){
150
- $wd_options = $this->config;
151
- global $wpdb;
152
- $server_info = array();
153
-
154
- // Get PHP Version
155
- $server_info["Operating System"] = PHP_OS . " (" . ( PHP_INT_SIZE * 8 ) . ")";
156
- $server_info["PHP Version"] = PHP_VERSION;
157
- $server_info["Server"] = $_SERVER["SERVER_SOFTWARE"];
158
-
159
- // Get MYSQL Version
160
- $sql_version = $wpdb->get_var( "SELECT VERSION() AS version" );
161
- $server_info["MySQL Version"] = $sql_version;
162
-
163
- // GET SQL Mode
164
- $mysqlinfo = $wpdb->get_results( "SHOW VARIABLES LIKE 'sql_mode'" );
165
- if ( is_array( $mysqlinfo ) )
166
- $sql_mode = $mysqlinfo[0]->Value;
167
- if ( empty( $sql_mode ) )
168
- $sql_mode = __( 'Not set', $wd_options->prefix );
169
- $server_info["SQL Mode"] = $sql_mode;
170
-
171
- // Get PHP Safe Mode
172
- if( ini_get( 'safe_mode' ) )
173
- $safe_mode = __( 'On', $wd_options->prefix );
174
- else
175
- $safe_mode = __( 'Off', $wd_options->prefix );
176
- $server_info["PHP Safe Mode"] = $safe_mode;
177
-
178
- // Get PHP allow_url_fopen
179
- if( ini_get( 'allow_url_fopen' ) )
180
- $allow_url_fopen = __( 'On', $wd_options->prefix );
181
- else
182
- $allow_url_fopen = __( 'Off', $wd_options->prefix );
183
- $server_info["PHP Allow URL fopen"] = $allow_url_fopen;
184
-
185
- // Get PHP Max Upload Size
186
- if (function_exists('wp_max_upload_size'))
187
- $upload_max = strval(round((int) wp_max_upload_size() / (1024 * 1024))) . 'M';
188
- else if(ini_get('upload_max_filesize'))
189
- $upload_max = ini_get('upload_max_filesize');
190
- else
191
- $upload_max = __('N/A', $wd_options->prefix);
192
-
193
- $server_info["PHP Max Upload Size"] = $upload_max;
194
-
195
- // Get PHP Output buffer Size
196
- if( ini_get( 'pcre.backtrack_limit' ) )
197
- $backtrack_limit = ini_get( 'pcre.backtrack_limit' );
198
- else
199
- $backtrack_limit = __( 'N/A', $wd_options->prefix );
200
- $server_info["PCRE Backtracking Limit"] = $backtrack_limit;
201
-
202
- // Get PHP Max Post Size
203
- if( ini_get( 'post_max_size' ) )
204
- $post_max = ini_get( 'post_max_size' );
205
- else
206
- $post_max = __( 'N/A', $wd_options->prefix );
207
- $server_info["PHP Max Post Size"] = $post_max;
208
-
209
- // Get PHP Max execution time
210
- if( ini_get( 'max_execution_time' ) )
211
- $max_execute = ini_get( 'max_execution_time' );
212
- else
213
- $max_execute = __( 'N/A', $wd_options->prefix );
214
- $server_info["PHP Max Script Execute Time"] = $max_execute;
215
-
216
-
217
- // Get PHP Memory Limit
218
- if( ini_get( 'memory_limit' ) )
219
- $memory_limit = ini_get( 'memory_limit' );
220
- else
221
- $memory_limit = __( 'N/A', $wd_options->prefix );
222
- $server_info["PHP Memory Limit"] = $memory_limit;
223
-
224
- // Get actual memory_get_usage
225
- if ( function_exists( 'memory_get_usage' ) )
226
- $memory_usage = round( memory_get_usage() / 1024 / 1024, 2 ) . __( ' MByte', $wd_options->prefix );
227
- else
228
- $memory_usage = __( 'N/A', $wd_options->prefix );
229
- $server_info["Memory usage"] = $memory_usage;
230
-
231
- // required for EXIF read
232
- if ( is_callable( 'exif_read_data' ) )
233
- $exif = __( 'Yes', $wd_options->prefix ). " (V" . substr( phpversion( 'exif' ), 0, 4 ) . ")" ;
234
- else
235
- $exif = __( 'No', $wd_options->prefix );
236
- $server_info["PHP Exif support"] = $exif;
237
-
238
- // required for meta data
239
- if ( is_callable( 'iptcparse' ) )
240
- $iptc = __( 'Yes', $wd_options->prefix );
241
- else
242
- $iptc = __( 'No', $wd_options->prefix );
243
- $server_info["PHP IPTC support"] = $iptc;
244
-
245
- // required for meta data
246
- if ( is_callable( 'xml_parser_create' ) )
247
- $xml = __( 'Yes', $wd_options->prefix );
248
- else
249
- $xml = __( 'No', $wd_options->prefix );
250
- $server_info["PHP XML support"] = $xml;
251
-
252
- $gd_info = array( "GD support" => __( 'No', $wd_options->prefix ) );
253
- if( function_exists( "gd_info" ) ){
254
- $gd_info = array();
255
- foreach( gd_info() as $key => $val ){
256
- if( is_bool($val) ){
257
- $gd_info[$key] = $val ? __( 'Yes', $wd_options->prefix ) : __( 'No', $wd_options->prefix );
258
- }
259
- else{
260
- $gd_info[$key] = $val;
261
- }
262
- }
263
- }
264
-
265
- require_once( $wd_options->wd_dir_templates . "/display_overview_support.php" );
266
- }
267
-
268
- public function overview_styles() {
269
- $wd_options = $this->config;
270
- $version = get_option( $wd_options->prefix . "_version" );
271
- wp_enqueue_style( $wd_options->prefix . '_overview_css', $wd_options->wd_url_css . '/overview.css', array(), $version );
272
-
273
- }
274
- public function overview_scripts() {
275
- $wd_options = $this->config;
276
- $version = get_option( $wd_options->prefix . "_version" );
277
- wp_enqueue_script( $wd_options->prefix . '_overview_js', $wd_options->wd_url_js . '/overview.js', array(), $version );
278
-
279
- }
280
- ////////////////////////////////////////////////////////////////////////////////////////
281
- // Getters & Setters //
282
- ////////////////////////////////////////////////////////////////////////////////////////
283
- ////////////////////////////////////////////////////////////////////////////////////////
284
- // Private Methods //
285
- ////////////////////////////////////////////////////////////////////////////////////////
286
- private function remote_get($plugin_wp_slug){
287
- $request = wp_remote_get(" http://api.wordpress.org/plugins/info/1.0/" . $plugin_wp_slug);
288
- $data = array();
289
- if (!is_wp_error($request) || wp_remote_retrieve_response_code($request) === 200) {
290
- $body = unserialize($request['body']);
291
- $data["downloaded"] = $body->downloaded;
292
- $ratings = $body->ratings;
293
- if( $ratings[5] == 0 && $ratings[4] == 0 && $ratings[3] == 0 && $ratings[2] == 0 && $ratings[1] == 0){
294
- $data["rating"] = 100;
295
- }
296
- else{
297
- $data["rating"] = round( ( ( $ratings[5] * 5 + $ratings[4] * 4 + $ratings[3] * 3 + $ratings[2] * 2 + $ratings[1] * 1 ) / $body->num_ratings ) , 1 );
298
-
299
- $data["rating"] = round( ( $data["rating"] / 5 ) * 100 );
300
- }
301
- return $data;
302
- }
303
- return false;
304
-
305
- }
306
- ////////////////////////////////////////////////////////////////////////////////////////
307
- // Listeners //
308
- ////////////////////////////////////////////////////////////////////////////////////////
309
-
310
  }
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
+ require_once( $wd_options->wd_dir_templates . "/display_overview.php" );
62
+ }
63
+ public function wd_overview_welcome(){
64
+ $wd_options = $this->config;
65
+ //http://api.wordpress.org/plugins/info/1.0/wd-google-maps
66
+ require_once( $wd_options->wd_dir_templates . "/display_overview_welcome.php" );
67
+ }
68
+ public function wd_overview_user_guide(){
69
+ $wd_options = $this->config;
70
+ $user_guide = $wd_options->user_guide;
71
+ require_once( $wd_options->wd_dir_templates . "/display_overview_user_guide.php" );
72
+ }
73
+ public function wd_overview_deals(){
74
+
75
+ $wd_options = $this->config;
76
+ $plugins = array(
77
+ "form-maker" => array(
78
+ 'title' => 'Form Maker',
79
+ 'text' => __( 'Wordpress form builder plugin', $wd_options->prefix ),
80
+ 'content' => __( 'Form Maker is a modern and advanced tool for creating WordPress forms easily and fast.', $wd_options->prefix ),
81
+ 'href' => 'https://web-dorado.com/products/wordpress-form.html'
82
+ ),
83
+ "photo-gallery" => array(
84
+ 'title' => 'Photo Gallery',
85
+ 'text' => __( 'WordPress Photo Gallery plugin', $wd_options->prefix ),
86
+ 'content' => __( 'Photo Gallery is a fully responsive WordPress Gallery plugin with advanced functionality.', $wd_options->prefix ),
87
+ 'href' => 'https://web-dorado.com/products/wordpress-photo-gallery-plugin.html'
88
+ ),
89
+ "event-calendar-wd" => array(
90
+ 'title' => 'Event Calendar WD',
91
+ 'text' => __( 'WordPress calendar plugin', $wd_options->prefix ),
92
+ 'content' => __( 'Organize and publish your events in an easy and elegant way using Event Calendar WD.', $wd_options->prefix ),
93
+ 'href' => 'https://web-dorado.com/products/wordpress-event-calendar-wd.html'
94
+ ),
95
+ "wd-google-maps" => array(
96
+ 'title' => 'WD Google Maps',
97
+ 'text' => __( 'WD Google Maps plugin', $wd_options->prefix ),
98
+ '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 ),
99
+ 'href' => 'https://web-dorado.com/products/wordpress-google-maps-plugin.html'
100
+ ),
101
+ "slider-wd" => array(
102
+ 'title' => 'Slider WD',
103
+ 'text' => __( 'WordPress slider plugin', $wd_options->prefix ),
104
+ 'content' => __( 'Create responsive, highly configurable sliders with various effects for your WordPress site.', $wd_options->prefix ),
105
+ 'href' => 'https://web-dorado.com/products/wordpress-slider-plugin.html'
106
+ ),
107
+ "spider-event-calendar" => array(
108
+ 'title' => 'Spider Calendar',
109
+ 'text' => __( 'WordPress event calendar plugin', $wd_options->prefix ),
110
+ 'content' => __( 'Spider Event Calendar is a highly configurable product which allows you to have multiple organized events.', $wd_options->prefix ),
111
+ 'href' => 'https://web-dorado.com/products/wordpress-calendar.html'
112
+ ),
113
+ "wd-instagram-feed" => array(
114
+ 'title' => 'Instagram Feed WD',
115
+ 'text' => __( 'WordPress Instagram Feed plugin', $wd_options->prefix ),
116
+ 'content' => __( 'WD Instagram Feed is a user-friendly tool for displaying user or hashtag-based feeds on your website.', $wd_options->prefix ),
117
+ 'href' => 'https://web-dorado.com/products/wordpress-instagram-feed-wd.html'
118
+ ),
119
+ );
120
+ unset($plugins[$wd_options->plugin_wordpress_slug]) ;
121
+
122
+ // foreach ( $plugins as $wp_slug => &$plugin ){
123
+ // $wp_data = $this->
124
+ //remote_get($wp_slug);
125
+ // $plugin["downloaded"] = $wp_data["downloaded"];
126
+ // $plugin["rating"] = $wp_data["rating"];
127
+ // }
128
+
129
+ $themes = array(
130
+ "business_elite" => array(
131
+ 'title' => 'Business Elite Theme',
132
+ 'href' => 'https://web-dorado.com/wordpress-themes/business-elite.html'
133
+ ),
134
+ "portfolio_gallery" => array(
135
+ 'title' => 'Portfolio Gallery Theme',
136
+ 'href' => 'https://web-dorado.com/wordpress-themes/portfolio-gallery.html'
137
+ ),
138
+ "sauron" => array(
139
+ 'title' => 'Sauron Theme',
140
+ 'href' => 'https://web-dorado.com/wordpress-themes/sauron.html'
141
+ ),
142
+ "business_world" => array(
143
+ 'title' => 'Business World Theme',
144
+ 'href' => 'https://web-dorado.com/wordpress-themes/business-world.html'
145
+ ),
146
+ );
147
+
148
+ require_once( $wd_options->wd_dir_templates . "/display_overview_deals.php" );
149
+ }
150
+ public function wd_overview_support(){
151
+ $wd_options = $this->config;
152
+ global $wpdb;
153
+ $server_info = array();
154
+
155
+ // Get PHP Version
156
+ $server_info["Operating System"] = PHP_OS . " (" . ( PHP_INT_SIZE * 8 ) . ")";
157
+ $server_info["PHP Version"] = PHP_VERSION;
158
+ $server_info["Server"] = $_SERVER["SERVER_SOFTWARE"];
159
+
160
+ // Get MYSQL Version
161
+ $sql_version = $wpdb->get_var( "SELECT VERSION() AS version" );
162
+ $server_info["MySQL Version"] = $sql_version;
163
+
164
+ // GET SQL Mode
165
+ $mysqlinfo = $wpdb->get_results( "SHOW VARIABLES LIKE 'sql_mode'" );
166
+ if ( is_array( $mysqlinfo ) )
167
+ $sql_mode = $mysqlinfo[0]->Value;
168
+ if ( empty( $sql_mode ) )
169
+ $sql_mode = __( 'Not set', $wd_options->prefix );
170
+ $server_info["SQL Mode"] = $sql_mode;
171
+
172
+ // Get PHP allow_url_fopen
173
+ if( ini_get( 'allow_url_fopen' ) )
174
+ $allow_url_fopen = __( 'On', $wd_options->prefix );
175
+ else
176
+ $allow_url_fopen = __( 'Off', $wd_options->prefix );
177
+ $server_info["PHP Allow URL fopen"] = $allow_url_fopen;
178
+
179
+ // Get PHP Max Upload Size
180
+ if (function_exists('wp_max_upload_size'))
181
+ $upload_max = strval(round((int) wp_max_upload_size() / (1024 * 1024))) . 'M';
182
+ else if(ini_get('upload_max_filesize'))
183
+ $upload_max = ini_get('upload_max_filesize');
184
+ else
185
+ $upload_max = __('N/A', $wd_options->prefix);
186
+
187
+ $server_info["PHP Max Upload Size"] = $upload_max;
188
+
189
+ // Get PHP Output buffer Size
190
+ if( ini_get( 'pcre.backtrack_limit' ) )
191
+ $backtrack_limit = ini_get( 'pcre.backtrack_limit' );
192
+ else
193
+ $backtrack_limit = __( 'N/A', $wd_options->prefix );
194
+ $server_info["PCRE Backtracking Limit"] = $backtrack_limit;
195
+
196
+ // Get PHP Max Post Size
197
+ if( ini_get( 'post_max_size' ) )
198
+ $post_max = ini_get( 'post_max_size' );
199
+ else
200
+ $post_max = __( 'N/A', $wd_options->prefix );
201
+ $server_info["PHP Max Post Size"] = $post_max;
202
+
203
+ // Get PHP Max execution time
204
+ if( ini_get( 'max_execution_time' ) )
205
+ $max_execute = ini_get( 'max_execution_time' );
206
+ else
207
+ $max_execute = __( 'N/A', $wd_options->prefix );
208
+ $server_info["PHP Max Script Execute Time"] = $max_execute;
209
+
210
+
211
+ // Get PHP Memory Limit
212
+ if( ini_get( 'memory_limit' ) )
213
+ $memory_limit = ini_get( 'memory_limit' );
214
+ else
215
+ $memory_limit = __( 'N/A', $wd_options->prefix );
216
+ $server_info["PHP Memory Limit"] = $memory_limit;
217
+
218
+ // Get actual memory_get_usage
219
+ if ( function_exists( 'memory_get_usage' ) )
220
+ $memory_usage = round( memory_get_usage() / 1024 / 1024, 2 ) . __( ' MByte', $wd_options->prefix );
221
+ else
222
+ $memory_usage = __( 'N/A', $wd_options->prefix );
223
+ $server_info["Memory usage"] = $memory_usage;
224
+
225
+ // required for EXIF read
226
+ if ( is_callable( 'exif_read_data' ) )
227
+ $exif = __( 'Yes', $wd_options->prefix ). " (V" . substr( phpversion( 'exif' ), 0, 4 ) . ")" ;
228
+ else
229
+ $exif = __( 'No', $wd_options->prefix );
230
+ $server_info["PHP Exif support"] = $exif;
231
+
232
+ // required for meta data
233
+ if ( is_callable( 'iptcparse' ) )
234
+ $iptc = __( 'Yes', $wd_options->prefix );
235
+ else
236
+ $iptc = __( 'No', $wd_options->prefix );
237
+ $server_info["PHP IPTC support"] = $iptc;
238
+
239
+ // required for meta data
240
+ if ( is_callable( 'xml_parser_create' ) )
241
+ $xml = __( 'Yes', $wd_options->prefix );
242
+ else
243
+ $xml = __( 'No', $wd_options->prefix );
244
+ $server_info["PHP XML support"] = $xml;
245
+
246
+ $gd_info = array( "GD support" => __( 'No', $wd_options->prefix ) );
247
+ if( function_exists( "gd_info" ) ){
248
+ $gd_info = array();
249
+ foreach( gd_info() as $key => $val ){
250
+ if( is_bool($val) ){
251
+ $gd_info[$key] = $val ? __( 'Yes', $wd_options->prefix ) : __( 'No', $wd_options->prefix );
252
+ }
253
+ else{
254
+ $gd_info[$key] = $val;
255
+ }
256
+ }
257
+ }
258
+
259
+ require_once( $wd_options->wd_dir_templates . "/display_overview_support.php" );
260
+ }
261
+
262
+ public function overview_styles() {
263
+ $wd_options = $this->config;
264
+ $version = get_option( $wd_options->prefix . "_version" );
265
+ wp_enqueue_style( $wd_options->prefix . '_overview_css', $wd_options->wd_url_css . '/overview.css', array(), $version );
266
+
267
+ }
268
+ public function overview_scripts() {
269
+ $wd_options = $this->config;
270
+ $version = get_option( $wd_options->prefix . "_version" );
271
+ wp_enqueue_script( $wd_options->prefix . '_overview_js', $wd_options->wd_url_js . '/overview.js', array(), $version );
272
+
273
+ }
274
+ ////////////////////////////////////////////////////////////////////////////////////////
275
+ // Getters & Setters //
276
+ ////////////////////////////////////////////////////////////////////////////////////////
277
+ ////////////////////////////////////////////////////////////////////////////////////////
278
+ // Private Methods //
279
+ ////////////////////////////////////////////////////////////////////////////////////////
280
+ private function remote_get($plugin_wp_slug){
281
+ $request = wp_remote_get(" http://api.wordpress.org/plugins/info/1.0/" . $plugin_wp_slug);
282
+ $data = array();
283
+ if (!is_wp_error($request) || wp_remote_retrieve_response_code($request) === 200) {
284
+ $body = unserialize($request['body']);
285
+ $data["downloaded"] = $body->downloaded;
286
+ $ratings = $body->ratings;
287
+ if( $ratings[5] == 0 && $ratings[4] == 0 && $ratings[3] == 0 && $ratings[2] == 0 && $ratings[1] == 0){
288
+ $data["rating"] = 100;
289
+ }
290
+ else{
291
+ $data["rating"] = round( ( ( $ratings[5] * 5 + $ratings[4] * 4 + $ratings[3] * 3 + $ratings[2] * 2 + $ratings[1] * 1 ) / $body->num_ratings ) , 1 );
292
+
293
+ $data["rating"] = round( ( $data["rating"] / 5 ) * 100 );
294
+ }
295
+ return $data;
296
+ }
297
+ return false;
298
+
299
+ }
300
+ ////////////////////////////////////////////////////////////////////////////////////////
301
+ // Listeners //
302
+ ////////////////////////////////////////////////////////////////////////////////////////
303
+
 
 
 
 
 
 
304
  }
wd/includes/subscribe.php CHANGED
@@ -1,138 +1,138 @@
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 = 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
+ 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
+ }
wd/templates/display_deactivation_popup.php CHANGED
@@ -1,28 +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", $wd_options->prefix ); ?>:
9
- </div>
10
-
11
- <div class="wd-deactivate-popup-body">
12
- <?php foreach( $deactivate_reasons as $deactivate_reason_slug => $deactivate_reason ) { ?>
13
- <div class="wd-<?php echo $wd_options->prefix; ?>-reasons">
14
- <input type="radio" value="<?php echo $deactivate_reason["id"];?>" id="<?php echo $wd_options->prefix . "-" .$deactivate_reason["id"]; ?>" name="<?php echo $wd_options->prefix; ?>_reasons" >
15
- <label for="<?php echo $wd_options->prefix . "-" . $deactivate_reason["id"]; ?>"><?php echo $deactivate_reason["text"];?></label>
16
- </div>
17
- <?php } ?>
18
- <div class="<?php echo $wd_options->prefix; ?>_additional_details_wrap"></div>
19
- </div>
20
- <div class="wd-btns">
21
- <a href="#" data-val="1" class="button button-secondary button-close wd-<?php echo $wd_options->prefix; ?>-deactivate" id="wd-<?php echo $wd_options->prefix; ?>-deactivate"><?php _e( "Deactivate" , $wd_options->prefix ); ?></a>
22
- <a href="#" data-val="2" class="button button-secondary button-close wd-<?php echo $wd_options->prefix; ?>-deactivate" id="wd-<?php echo $wd_options->prefix; ?>-submit-and-deactivate" style="display:none;"><?php _e( "Submit and deactivate" , $wd_options->prefix ); ?></a>
23
- <a href="#" class="button button-primary wd-<?php echo $wd_options->prefix; ?>-cancel"><?php _e( "Cancel" , $wd_options->prefix ); ?></a>
24
- </div>
25
- <input type="hidden" name="<?php echo $wd_options->prefix . "_submit_and_deactivate"; ?>" value="" >
26
- <?php wp_nonce_field( $wd_options->prefix . '_save_form', $wd_options->prefix . '_save_form_fild'); ?>
27
- </form>
28
- </div>
1
+ <div class="wd-opacity wd-<?php echo $wd_options->prefix; ?>-opacity"></div>
2
+ <div class="wd-deactivate-popup wd-<?php echo $wd_options->prefix; ?>-deactivate-popup">
3
+ <div class="wd-deactivate-popup-opacity wd-deactivate-popup-opacity-<?php echo $wd_options->prefix; ?>">
4
+ <img src="<?php echo $wd_options->wd_url_img . '/spinner.gif'; ?>" class="wd-img-loader" >
5
+ </div>
6
+ <form method="post" id="<?php echo $wd_options->prefix; ?>_deactivate_form">
7
+ <div class="wd-deactivate-popup-header">
8
+ <?php _e( "Please let us know why you are deactivating. Your answer will help us to serve you better", $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-secondary button-close wd-<?php echo $wd_options->prefix; ?>-deactivate" id="wd-<?php echo $wd_options->prefix; ?>-deactivate"><?php _e( "Deactivate" , $wd_options->prefix ); ?></a>
22
+ <a href="<?php echo $deactivate_url; ?>" data-val="2" class="button button-secondary button-close wd-<?php echo $wd_options->prefix; ?>-deactivate" id="wd-<?php echo $wd_options->prefix; ?>-submit-and-deactivate" style="display:none;"><?php _e( "Submit and deactivate" , $wd_options->prefix ); ?></a>
23
+ <a href="<?php echo admin_url( 'plugins.php' ); ?>" class="button button-primary wd-<?php echo $wd_options->prefix; ?>-cancel"><?php _e( "Cancel" , $wd_options->prefix ); ?></a>
24
+ </div>
25
+ <input type="hidden" name="<?php echo $wd_options->prefix . "_submit_and_deactivate"; ?>" value="" >
26
+ <?php wp_nonce_field( $wd_options->prefix . '_save_form', $wd_options->prefix . '_save_form_fild'); ?>
27
+ </form>
28
+ </div>
wd/templates/display_overview_deals.php CHANGED
@@ -1,88 +1,81 @@
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="downloads">
35
- <div class="rating" data-rating="<?php echo $plugin["rating"]; ?>"></div>
36
- <div class="spans">
37
- <span><?php _e( "Downloads", $wd_options->prefix ); ?></span>
38
- <span><?php echo number_format($plugin["downloaded"], 0); ?></span>
39
- </div>
40
- </div>-->
41
- <div class="download_btn">
42
- <a href="<?php echo $plugin["href"]; ?>" target="_blank" ><?php _e( "Download", $wd_options->prefix ); ?></a>
43
- </div>
44
- </div>
45
- </div>
46
-
47
- </div>
48
- <?php } ?>
49
- </div>
50
- <div class="get_all_deals">
51
- <a href="https://web-dorado.com/wordpress-plugins-bundle.html" target="_blank" >
52
- <?php _e( "Get all plugins", $wd_options->prefix ); ?>
53
- </a>
54
- </div>
55
- </div>
56
- <div id="themes">
57
- <div class="deals_header deals_header_themes">
58
- <a href="https://web-dorado.com/wordpress-themes-bundle.html" target="_blank">
59
- <div class="wd-table">
60
- <div class="wd-cell wd-text-right wd-valign-middle">
61
- </div>
62
- <div class="wd-cell wd-valign-middle">
63
- <div class="titles_wrap">
64
- <div class="deals_main_title"><?php echo __( "Get all 11 themes", $wd_options->prefix ); ?></div>
65
- <div class="deals_main_title"><?php echo __( "for", $wd_options->prefix ); ?><span class="higlight"> $40 </span><?php echo __( "only", $wd_options->prefix ); ?></div>
66
- </div>
67
- <div class="deals_save"><?php echo __( "Save 70%", $wd_options->prefix ); ?></div>
68
- </div>
69
- </div>
70
- </a>
71
- </div>
72
- <div class="deals_content">
73
- <?php foreach( $themes as $slug => $theme ){ ?>
74
- <div class="theme_block">
75
- <a href="<?php echo $theme["href"]; ?>" target="_blank" >
76
- <img src = "<?php echo $wd_options->wd_url_img . '/plugins/' . $slug . '.png'; ?>" width="100%;">
77
- <div><?php echo $theme["title"]; ?></div>
78
- </a>
79
- </div>
80
- <?php } ?>
81
- </div>
82
- <div class="get_all_deals">
83
- <a href="https://web-dorado.com/wordpress-themes-bundle.html" target="_blank" >
84
- <?php _e( "Find out more", $wd_options->prefix ); ?>
85
- </a>
86
- </div>
87
- </div>
88
  </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"><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>
wd/wd.php CHANGED
@@ -1,146 +1,156 @@
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.2";
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
- $links["deactivate"] = '<a href="#" class="' . $wd_options->prefix . '_deactivate_link">Deactivate</a>';
129
- return $links;
130
- }
131
-
132
- ////////////////////////////////////////////////////////////////////////////////////////
133
- // Getters & Setters //
134
- ////////////////////////////////////////////////////////////////////////////////////////
135
- ////////////////////////////////////////////////////////////////////////////////////////
136
- // Private Methods //
137
- ////////////////////////////////////////////////////////////////////////////////////////
138
-
139
- ////////////////////////////////////////////////////////////////////////////////////////
140
- // Listeners //
141
- ////////////////////////////////////////////////////////////////////////////////////////
142
-
143
- }
144
-
145
-
146
-
 
 
 
 
 
 
 
 
 
 
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.2";
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
+