Under Construction / Maintenance Mode from Acurax - Version 2.5.2

Version Description

Fix - Perfomance Improvements Fix - Code Improvements Fix - Several Bug Fixes Feature - Better Option to Manage Addons Feature - One Click Addon Installer Support

Download this release

Release Info

Developer Acurax
Plugin Icon 128x128 Under Construction / Maintenance Mode from Acurax
Version 2.5.2
Comparing to
See all releases

Code changes from version 2.5.1 to 2.5.2

acx_csma.php CHANGED
@@ -4,7 +4,7 @@ Plugin Name: Under Construction / Maintenance Mode From Acurax
4
  Plugin URI: http://www.acurax.com/products/under-construction-maintenance-mode-wordpress-plugin
5
  Description: Simple and the best Coming Soon or Maintenance Mode Plugin Which Supports Practically Unlimited Responsive Designs.
6
  Author: Acurax
7
- Version: 2.5.1
8
  Author URI: http://wordpress.acurax.com
9
  License: GPLv2 or later
10
  Text Domain: coming-soon-maintenance-mode-from-acurax
@@ -27,7 +27,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
27
  ?>
28
  <?php
29
  /*************** Admin function ***************/
30
- define("ACX_CSMA_CURRENT_VERSION","2.5.1");
31
  define("ACX_CSMA_TOTAL_THEMES",5);
32
  define("ACX_CSMA_BASE_LOCATION",plugin_dir_url( __FILE__ ));
33
 
@@ -35,67 +35,66 @@ include_once(plugin_dir_path( __FILE__ ).'function.php');
35
  include_once(plugin_dir_path( __FILE__ ).'includes/defaults.php');
36
  include_once(plugin_dir_path( __FILE__ ).'includes/hooks.php');
37
  include_once(plugin_dir_path( __FILE__ ).'includes/hook_functions.php');
 
38
 
39
- $filename = plugin_dir_path( __FILE__ ) . 'backward_compactability_file.php';
40
- if( file_exists( $filename ) === true )
41
- {
42
- include(plugin_dir_path( __FILE__ ).'backward_compactability_file.php');
43
- }
44
- function acx_csma_admin()
45
- {
46
- include(plugin_dir_path( __FILE__ ).'includes/acx_csma_admin.php');
47
- }
48
- function acx_csma_subscribers()
49
- {
50
- include(plugin_dir_path( __FILE__ ).'includes/acx_csma_subscribers.php');
51
- }
52
- function acx_csma_addons()
53
- {
54
- include(plugin_dir_path( __FILE__ ).'includes/acx_csma_addons.php');
55
- }
56
 
57
- function acx_csma_misc()
58
- {
59
- include(plugin_dir_path( __FILE__ ).'includes/acx_csma_misc.php');
60
- }
61
-
62
- function acx_csma_display_variable_menu()
63
- {
64
- include(plugin_dir_path( __FILE__ ).'includes/acx_csma_display_variables.php');
65
- }
66
-
67
- function acx_csma_help()
68
- {
69
- include(plugin_dir_path( __FILE__ ).'includes/acx_csma_help.php');
70
- }
71
 
72
- function acx_csma_expert_support()
73
- {
74
- include(plugin_dir_path( __FILE__ ).'includes/acx_csma_expert_support.php');
75
- }
76
 
 
 
 
 
77
 
78
- $acx_csma_hide_expert_support_menu = get_option('acx_csma_hide_expert_support_menu');
79
- if ($acx_csma_hide_expert_support_menu == "") { $acx_csma_hide_expert_support_menu = "no"; }
80
- function acx_csma_admin_actions()
81
- {
82
- global $acx_csma_hide_expert_support_menu;
83
- add_menu_page( __('Maintenance Mode / Coming Soon Configuration','coming-soon-maintenance-mode-from-acurax'), __('Maintenance Mode','coming-soon-maintenance-mode-from-acurax'), 'manage_options', 'Acurax-Coming-Soon-Maintenance-Mode-Settings','acx_csma_admin',plugin_dir_url( __FILE__ ).'/images/admin.png' ); // manage_options for admin
84
- add_submenu_page('Acurax-Coming-Soon-Maintenance-Mode-Settings', __('Coming Soon/Maintenance From Acurax Subscribers List','coming-soon-maintenance-mode-from-acurax'), __('View All Subscribers','coming-soon-maintenance-mode-from-acurax'), 'manage_options', 'Acurax-Coming-Soon-Maintenance-Mode-Subscribers' ,'acx_csma_subscribers');
85
- add_submenu_page('Acurax-Coming-Soon-Maintenance-Mode-Settings', __('Coming Soon/Maintenance From Acurax Misc Settings','coming-soon-maintenance-mode-from-acurax'), __('Misc','coming-soon-maintenance-mode-from-acurax'), 'manage_options', 'Acurax-Coming-Soon-Maintenance-Mode-Misc' ,'acx_csma_misc');
86
-
87
- add_submenu_page('Acurax-Coming-Soon-Maintenance-Mode-Settings', __('Coming Soon/Maintenance From Acurax Available Add-ons','coming-soon-maintenance-mode-from-acurax'), __('Add-ons','coming-soon-maintenance-mode-from-acurax'), 'manage_options', 'Acurax-Coming-Soon-Maintenance-Mode-Add-ons' ,'acx_csma_addons');
88
-
89
- if($acx_csma_hide_expert_support_menu == "no") {
90
- add_submenu_page('Acurax-Coming-Soon-Maintenance-Mode-Settings', __('Acurax Expert Support','coming-soon-maintenance-mode-from-acurax'), __('Expert Support','coming-soon-maintenance-mode-from-acurax'), 'manage_options', 'Acurax-Coming-Soon-Maintenance-Mode-Expert-Support' ,'acx_csma_expert_support');
91
- }
92
- add_submenu_page('Acurax-Coming-Soon-Maintenance-Mode-Settings', __('Coming Soon/Maintenance From Acurax Display Variables','coming-soon-maintenance-mode-from-acurax'), __('Display Variables','coming-soon-maintenance-mode-from-acurax'), 'manage_options', 'Acurax-Coming-Soon-Maintenance-Mode-Variables' ,'acx_csma_display_variable_menu');
93
-
94
- add_submenu_page('Acurax-Coming-Soon-Maintenance-Mode-Settings', __('Coming Soon/Maintenance From Acurax Help and Support','coming-soon-maintenance-mode-from-acurax'), __('Help','coming-soon-maintenance-mode-from-acurax'), 'manage_options', 'Acurax-Coming-Soon-Maintenance-Mode-Help' ,'acx_csma_help');
95
- }
96
- if ( is_admin() )
97
- {
98
- add_action('admin_menu', 'acx_csma_admin_actions');
99
  }
100
- include_once(plugin_dir_path( __FILE__ ).'includes/updates.php');
 
 
 
 
 
 
 
 
101
  ?>
4
  Plugin URI: http://www.acurax.com/products/under-construction-maintenance-mode-wordpress-plugin
5
  Description: Simple and the best Coming Soon or Maintenance Mode Plugin Which Supports Practically Unlimited Responsive Designs.
6
  Author: Acurax
7
+ Version: 2.5.2
8
  Author URI: http://wordpress.acurax.com
9
  License: GPLv2 or later
10
  Text Domain: coming-soon-maintenance-mode-from-acurax
27
  ?>
28
  <?php
29
  /*************** Admin function ***************/
30
+ define("ACX_CSMA_CURRENT_VERSION","2.5.2");
31
  define("ACX_CSMA_TOTAL_THEMES",5);
32
  define("ACX_CSMA_BASE_LOCATION",plugin_dir_url( __FILE__ ));
33
 
35
  include_once(plugin_dir_path( __FILE__ ).'includes/defaults.php');
36
  include_once(plugin_dir_path( __FILE__ ).'includes/hooks.php');
37
  include_once(plugin_dir_path( __FILE__ ).'includes/hook_functions.php');
38
+ include_once(plugin_dir_path( __FILE__ ).'includes/acx-csma-licence-activation.php');
39
 
40
+ $filename = plugin_dir_path( __FILE__ ) . 'backward_compactability_file.php';
41
+ if( file_exists( $filename ) === true )
42
+ {
43
+ include(plugin_dir_path( __FILE__ ).'backward_compactability_file.php');
44
+ }
45
+ function acx_csma_admin()
46
+ {
47
+ include(plugin_dir_path( __FILE__ ).'includes/acx_csma_admin.php');
48
+ }
49
+ function acx_csma_subscribers()
50
+ {
51
+ include(plugin_dir_path( __FILE__ ).'includes/acx_csma_subscribers.php');
52
+ }
53
+ function acx_csma_addons()
54
+ {
55
+ include(plugin_dir_path( __FILE__ ).'includes/acx_csma_addons.php');
56
+ }
57
 
58
+ function acx_csma_misc()
59
+ {
60
+ include(plugin_dir_path( __FILE__ ).'includes/acx_csma_misc.php');
61
+ }
 
 
 
 
 
 
 
 
 
 
62
 
63
+ function acx_csma_display_variable_menu()
64
+ {
65
+ include(plugin_dir_path( __FILE__ ).'includes/acx_csma_display_variables.php');
66
+ }
67
 
68
+ function acx_csma_help()
69
+ {
70
+ include(plugin_dir_path( __FILE__ ).'includes/acx_csma_help.php');
71
+ }
72
 
73
+ function acx_csma_expert_support()
74
+ {
75
+ include(plugin_dir_path( __FILE__ ).'includes/acx_csma_expert_support.php');
76
+ }
77
+ $acx_csma_hide_expert_support_menu = get_option('acx_csma_hide_expert_support_menu');
78
+ if ($acx_csma_hide_expert_support_menu == "") { $acx_csma_hide_expert_support_menu = "no"; }
79
+ function acx_csma_admin_actions()
80
+ {
81
+ global $acx_csma_hide_expert_support_menu;
82
+ add_menu_page( __('Maintenance Mode / Coming Soon Configuration','coming-soon-maintenance-mode-from-acurax'), __('Maintenance Mode','coming-soon-maintenance-mode-from-acurax'), 'manage_options', 'Acurax-Coming-Soon-Maintenance-Mode-Settings','acx_csma_admin',plugin_dir_url( __FILE__ ).'/images/admin.png' ); // manage_options for admin
83
+ add_submenu_page('Acurax-Coming-Soon-Maintenance-Mode-Settings', __('Coming Soon/Maintenance From Acurax Subscribers List','coming-soon-maintenance-mode-from-acurax'), __('View All Subscribers','coming-soon-maintenance-mode-from-acurax'), 'manage_options', 'Acurax-Coming-Soon-Maintenance-Mode-Subscribers' ,'acx_csma_subscribers');
84
+ add_submenu_page('Acurax-Coming-Soon-Maintenance-Mode-Settings', __('Coming Soon/Maintenance From Acurax Misc Settings','coming-soon-maintenance-mode-from-acurax'), __('Misc','coming-soon-maintenance-mode-from-acurax'), 'manage_options', 'Acurax-Coming-Soon-Maintenance-Mode-Misc' ,'acx_csma_misc');
85
+
86
+ add_submenu_page('Acurax-Coming-Soon-Maintenance-Mode-Settings', __('Coming Soon/Maintenance From Acurax Available Add-ons','coming-soon-maintenance-mode-from-acurax'), __('Add-ons','coming-soon-maintenance-mode-from-acurax'), 'manage_options', 'Acurax-Coming-Soon-Maintenance-Mode-Add-ons' ,'acx_csma_addons');
87
+
88
+ if($acx_csma_hide_expert_support_menu == "no") {
89
+ add_submenu_page('Acurax-Coming-Soon-Maintenance-Mode-Settings', __('Acurax Expert Support','coming-soon-maintenance-mode-from-acurax'), __('Expert Support','coming-soon-maintenance-mode-from-acurax'), 'manage_options', 'Acurax-Coming-Soon-Maintenance-Mode-Expert-Support' ,'acx_csma_expert_support');
 
 
 
 
90
  }
91
+ add_submenu_page('Acurax-Coming-Soon-Maintenance-Mode-Settings', __('Coming Soon/Maintenance From Acurax Display Variables','coming-soon-maintenance-mode-from-acurax'), __('Display Variables','coming-soon-maintenance-mode-from-acurax'), 'manage_options', 'Acurax-Coming-Soon-Maintenance-Mode-Variables' ,'acx_csma_display_variable_menu');
92
+
93
+ add_submenu_page('Acurax-Coming-Soon-Maintenance-Mode-Settings', __('Coming Soon/Maintenance From Acurax Help and Support','coming-soon-maintenance-mode-from-acurax'), __('Help','coming-soon-maintenance-mode-from-acurax'), 'manage_options', 'Acurax-Coming-Soon-Maintenance-Mode-Help' ,'acx_csma_help');
94
+ }
95
+ if ( is_admin() )
96
+ {
97
+ add_action('admin_menu', 'acx_csma_admin_actions');
98
+ }
99
+ include_once(plugin_dir_path( __FILE__ ).'includes/updates.php');
100
  ?>
css/admin.css CHANGED
@@ -806,7 +806,7 @@ position: relative;
806
 
807
  .acx_csma_disp_edit_close_btn
808
  {
809
- background:url(../images/close_btn.png) no-repeat center center;
810
  width:40px;
811
  height:40px;
812
  position:absolute;
@@ -906,4 +906,4 @@ cursor:pointer;
906
  }
907
  #acx_csma_display_variable_content #acx_disp_edit_link a, #acx_csma_display_variable_content #acx_disp_reset_link a {
908
  cursor: pointer;
909
- }
806
 
807
  .acx_csma_disp_edit_close_btn
808
  {
809
+ background:url(../images/close.png) no-repeat center center;
810
  width:40px;
811
  height:40px;
812
  position:absolute;
906
  }
907
  #acx_csma_display_variable_content #acx_disp_edit_link a, #acx_csma_display_variable_content #acx_disp_reset_link a {
908
  cursor: pointer;
909
+ }
css/csma_addons.css CHANGED
@@ -55,4 +55,98 @@ width: 22%;
55
  }
56
  .csma_addons_intro .csma_addon_button:hover {
57
  background:#f8f8f8;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
58
  }
55
  }
56
  .csma_addons_intro .csma_addon_button:hover {
57
  background:#f8f8f8;
58
+ }
59
+ /* Addon Page*/
60
+ .acx_csma_add_p_licen > a {
61
+ background-color: #0052db;
62
+ color: #e3e3e3;
63
+ padding: 10px;
64
+ cursor: pointer;
65
+ }
66
+ .acx_csma_add_p_licence_light_cvr {
67
+ background-color: rgba(0, 0, 0, 0.9);
68
+ height: 100%;
69
+ left: 0;
70
+ position: fixed;
71
+ top: 0;
72
+ width: 100%;
73
+ z-index: 9999;
74
+ display:none;
75
+ }
76
+ .acx_csma_add_p_licence_light_cls
77
+ {
78
+ background:url(../images/close.png) no-repeat center center;
79
+ width:40px;
80
+ height:40px;
81
+ position:absolute;
82
+ right: 0;
83
+ top: 0;
84
+ cursor:pointer;
85
+ }
86
+ .acx_csma_add_p_licence_li_cn {
87
+ background-color: #fff;
88
+ left: 50%;
89
+ border-radius: 5px;
90
+ position: absolute;
91
+ top: 50%;
92
+ -webkit-transform: translate(-50%, -50%);
93
+ -moz-transform: translate(-50%, -50%);
94
+ -ms-transform: translate(-50%, -50%);
95
+ -o-transform: translate(-50%, -50%);
96
+ transform: translate(-50%, -50%);
97
+ width: 370px;
98
+ padding:40px 25px;
99
+ }
100
+ .acx_csma_p_li_span {
101
+ display: block;
102
+ float: left;
103
+ width: 100%;
104
+ }
105
+ .acx_csma_p_li_span input {
106
+ width: 100%;
107
+ padding:8px;
108
+ }
109
+ .acx_csma_add_p_li_cls {
110
+ clear: both;
111
+ color: #fff;
112
+ cursor: pointer;
113
+ float: right;
114
+ margin-left: auto !important;
115
+ margin-right: auto !important;
116
+ text-align: center;
117
+ width: 25%;
118
+ }
119
+ .acx_csma_pu_li_error {
120
+ color: red;
121
+ display: block;
122
+ margin-top: 10px;
123
+ }
124
+ .acx_csma_install_ignore {
125
+ float: right;
126
+ cursor:pointer;
127
+ }
128
+ .acx_csma_lic_del
129
+ {
130
+ background: url("../images/delete.png") no-repeat center center;
131
+ }
132
+ .acx_csma_lic_refresh
133
+ {
134
+ background: url("../images/refresh.png") no-repeat center center;
135
+ }
136
+ .ax_csma_action_icon {
137
+ background-size: 21px auto;
138
+ display: inline-block;
139
+ height: 21px;
140
+ margin: 0 5px;
141
+ vertical-align: middle;
142
+ width: 21px;
143
+ cursor: pointer;
144
+ }
145
+ .acx_csma_hide_refresh
146
+ {
147
+ display:none;
148
+ }
149
+ .acx_csma_show_refresh
150
+ {
151
+ display:inline-block;
152
  }
function.php CHANGED
@@ -8,9 +8,8 @@ function acx_csma_display_template_array_filter_hook()
8
  } add_action('init','acx_csma_display_template_array_filter_hook');
9
  function acx_csma_filter_lw_pr($acx_csma_template_array)
10
  {
11
- return $acx_csma_template_array;
12
  } add_filter('acx_csma_display_template_array_filter','acx_csma_filter_lw_pr',5);
13
-
14
  function acx_csma_appearence_array_default_filter_hook()
15
  {
16
  global $acx_csma_appearence_array_default;
@@ -18,10 +17,9 @@ function acx_csma_appearence_array_default_filter_hook()
18
  $acx_csma_appearence_array_default = apply_filters('acx_csma_appearence_array_default_filter',$acx_csma_appearence_array_default);
19
 
20
  } add_action('init','acx_csma_appearence_array_default_filter_hook');
21
-
22
  function acx_csma_appearence_array_default_lw_pr($acx_csma_appearence_array_default)
23
  {
24
- return $acx_csma_appearence_array_default;
25
  } add_filter('acx_csma_appearence_array_default_filter','acx_csma_appearence_array_default_lw_pr',5);
26
 
27
  $acx_csma_display_var_arr = get_option('acx_csma_display_var_arr');
@@ -87,15 +85,15 @@ if(empty($acx_csma_display_var_arr))
87
  }
88
  function acx_csma_styles()
89
  {
90
- wp_register_style('acx_csmaadmin_style', plugins_url('css/admin.css', __FILE__));
91
  wp_enqueue_style('acx_csmaadmin_style');
92
- wp_register_style('acx_csmaaddons_style', plugins_url('css/csma_addons.css', __FILE__));
93
  wp_enqueue_style('acx_csmaaddons_style');
94
- wp_register_style('acx_csma_layout_style', plugins_url('css/layout.css', __FILE__));
95
  wp_enqueue_style('acx_csma_layout_style');
96
- wp_register_style('acx_csmabox_style', plugins_url('css/acx_csma_box.css', __FILE__));
97
  wp_enqueue_style('acx_csmabox_style');
98
- wp_register_style('acx_datepick_style', plugins_url('css/jquery.datetimepicker.css', __FILE__));
99
  wp_enqueue_style('acx_datepick_style');
100
  }
101
  add_action('admin_enqueue_scripts', 'acx_csma_styles');
@@ -105,13 +103,11 @@ function acx_csma_date_picker_scripts()
105
  wp_enqueue_script('jquery-ui-core');
106
  }
107
  add_action('admin_enqueue_scripts','acx_csma_date_picker_scripts');
108
-
109
  function acx_csma_colorpicker_scripts()
110
  {
111
  wp_enqueue_style( 'farbtastic' );
112
  wp_enqueue_script( 'farbtastic','',array( 'jquery' ) );
113
  }
114
-
115
  // color picker
116
  if(ISSET($_GET['page']))
117
  {
@@ -142,80 +138,79 @@ if($acx_csma_page == "Acurax-Coming-Soon-Maintenance-Mode-Settings")
142
  }
143
  function filter_acx_csma_template_array($acx_csma_template_array)
144
  {
145
-
146
- $acx_site_url = get_site_url();
147
- $acx_csma_parent_folder = basename(dirname(__FILE__));
148
- $acx_csma_template_array['0'] = array(
149
- 'id' => 0,
150
- 'name' =>__('Custom Html','coming-soon-maintenance-mode-from-acurax'),
151
- 'index' =>'acx_csma_custom_template',
152
- 'description' => '',
153
- 'parent' => $acx_csma_parent_folder,
154
- 'path' => $acx_site_url,
155
- 'thumb' => ACX_CSMA_BASE_LOCATION
156
- );
157
- $acx_csma_template_array['1'] = array(
158
- 'id' => 1,
159
- 'name' =>__('Template 1','coming-soon-maintenance-mode-from-acurax'),
160
- 'index' =>'acx_csma_template1',
161
- 'description' => '',
162
- 'parent' => $acx_csma_parent_folder,
163
- 'path' => $acx_site_url,
164
- 'thumb' => ACX_CSMA_BASE_LOCATION
165
- );
166
- $acx_csma_template_array['2'] = array(
167
- 'id' => 2,
168
- 'name' =>__('Template 2','coming-soon-maintenance-mode-from-acurax'),
169
- 'index' =>'acx_csma_template2',
170
- 'description' => '',
171
- 'parent' => $acx_csma_parent_folder,
172
- 'path' => $acx_site_url,
173
- 'thumb' => ACX_CSMA_BASE_LOCATION
174
- );
175
- $acx_csma_template_array['3'] = array(
176
- 'id' => 3,
177
- 'name' =>__('Template 3','coming-soon-maintenance-mode-from-acurax'),
178
- 'index' =>'acx_csma_template3',
179
- 'description' => '',
180
- 'parent' => $acx_csma_parent_folder,
181
- 'path' => $acx_site_url,
182
- 'thumb' => ACX_CSMA_BASE_LOCATION
183
- );
184
- $acx_csma_template_array['4'] = array(
185
- 'id' => 4,
186
- 'name' =>__('Template 4','coming-soon-maintenance-mode-from-acurax'),
187
- 'index' =>'acx_csma_template4',
188
- 'description' => '',
189
- 'parent' => $acx_csma_parent_folder,
190
- 'path' => $acx_site_url,
191
- 'thumb' => ACX_CSMA_BASE_LOCATION
192
- );
193
- $acx_csma_template_array['5'] = array(
194
- 'id' => 5,
195
- 'name' =>__('Template 5','coming-soon-maintenance-mode-from-acurax'),
196
- 'index' =>'acx_csma_template5',
197
- 'description' => '',
198
- 'parent' => $acx_csma_parent_folder,
199
- 'path' => $acx_site_url,
200
- 'thumb' => ACX_CSMA_BASE_LOCATION
201
- );
202
 
203
  return $acx_csma_template_array;
204
  }
205
  add_filter('acx_csma_display_template_array_filter','filter_acx_csma_template_array');
206
 
207
  $acx_csma_activation_status = get_option('acx_csma_activation_status');
208
- if($acx_csma_activation_status=='')
209
  {
210
  update_option('acx_csma_activation_status',0);
211
  }
212
- if($acx_csma_activation_status==1)
213
  {
214
  $acx_csma_display_template=true;
215
  }
216
  else
217
  {
218
- $acx_csma_display_template=false;
219
  }
220
  if($acx_csma_display_template == true)
221
  {
@@ -227,14 +222,14 @@ if($acx_csma_display_template == true)
227
  {
228
  if($acx_csma_auto_launch==0)
229
  {
230
- $acx_csma_display_template=true;
231
  } else
232
  {
233
- $acx_csma_display_template=false;
234
  }
235
  }
236
  }
237
- if($acx_csma_display_template==true)
238
  {
239
  add_action('template_redirect','acx_csma_plugin_activation');
240
  }
@@ -304,8 +299,8 @@ function acx_csma_plugin_activation()
304
  $end_time = get_option('acx_csma_date_time');
305
  if($end_time != "")
306
  {
307
- $end_time = date_i18n("D, j M Y H:i:s e", $end_time);
308
- header( "Retry-After: $end_time" );
309
  }
310
  $acx_csma_template=get_option('acx_csma_template');
311
  if($acx_csma_template == "" || !is_numeric($acx_csma_template))
@@ -322,7 +317,6 @@ function acx_csma_plugin_activation()
322
  include_once($acx_csma_template_path);
323
  exit;
324
  }
325
-
326
  }
327
  function filter_acx_csma_template($acx_csma_display_template)
328
  {
@@ -331,7 +325,6 @@ function filter_acx_csma_template($acx_csma_display_template)
331
  return $acx_csma_display_template;
332
  }
333
  }
334
-
335
  add_filter('acx_csma_display_template_filter','filter_acx_csma_template',5);
336
  function acx_csma_template_preview()
337
  {
@@ -340,7 +333,7 @@ function acx_csma_template_preview()
340
  if ($acx_csma_send_header_option == "") { $acx_csma_send_header_option = "yes"; }
341
  if(ISSET($_GET['acx_csma_preview']) && current_user_can( 'manage_options' )){
342
  $acx_csma_preview=$_GET['acx_csma_preview'];
343
- if(array_key_exists($acx_csma_preview,$acx_csma_template_array))
344
  {
345
  $protocol = "HTTP/1.0";
346
  if ( "HTTP/1.1" == $_SERVER["SERVER_PROTOCOL"] )
@@ -352,8 +345,8 @@ function acx_csma_template_preview()
352
  $end_time = get_option('acx_csma_date_time');
353
  if($end_time != "")
354
  {
355
- $end_time = date_i18n("D, j M Y H:i:s e", $end_time);
356
- header( "Retry-After: $end_time" );
357
  }
358
  $acx_csma_template_path_loc = WP_CONTENT_DIR."/plugins/".$acx_csma_template_array[$acx_csma_preview]['parent'];
359
  include_once($acx_csma_template_path_loc."/templates/".$acx_csma_preview."/index.php");
@@ -363,19 +356,19 @@ function acx_csma_template_preview()
363
  }
364
  add_action('template_redirect','acx_csma_template_preview');
365
  // changing launch text
366
- $acx_csma_appearence_array=acx_csma_get_db_array_value();
367
- if(is_array($acx_csma_appearence_array))
 
 
368
  {
369
- if(array_key_exists('3',$acx_csma_appearence_array) && array_key_exists('acx_csma_inside_title3',$acx_csma_appearence_array['3']))
 
370
  {
371
- $acx_csma_inside_title3 = $acx_csma_appearence_array['3']['acx_csma_inside_title3'];
372
- if(strcmp($acx_csma_inside_title3,"Estimate Time Before Lunching") === 0 )
373
- {
374
- $acx_csma_appearence_array['3']['acx_csma_inside_title3'] = __("Estimate Time Before Launching","coming-soon-maintenance-mode-from-acurax");
375
- }
376
  }
377
- acx_csma_update_array_value($acx_csma_appearence_array);
378
  }
 
 
379
  // upload images and logos
380
  function acx_csma_upload_images_template_1()
381
  {
@@ -389,23 +382,23 @@ function acx_csma_upload_images_template_loader(button_id,uploader_title,uploade
389
  {
390
  if(button_id)
391
  {
392
- button_id = "#"+button_id;
393
  }
394
  if(uploader_title == "")
395
  {
396
- uploader_title = "Choose Image";
397
  }
398
  if(uploader_button == "")
399
  {
400
- uploader_button = "Select";
401
  }
402
  if(hidden_field_id)
403
  {
404
- hidden_field_id = "#"+hidden_field_id;
405
  }
406
  if(preview_id)
407
  {
408
- preview_id = "#"+preview_id;
409
  }
410
  var custom_uploader_template_1_1;
411
  jQuery(button_id).click(function(e)
@@ -414,30 +407,30 @@ function acx_csma_upload_images_template_loader(button_id,uploader_title,uploade
414
  //If the uploader object has already been created, reopen the dialog
415
  if (custom_uploader_template_1_1)
416
  {
417
- custom_uploader_template_1_1.open();
418
- return;
419
  }
420
  //Extend the wp.media object
421
  custom_uploader_template_1_1 = wp.media.frames.file_frame = wp.media({
422
  title: uploader_title,
423
  button:
424
  {
425
- text: uploader_button
426
  },
427
  multiple: false });
428
  //When a file is selected, grab the URL and set it as the text field's value
429
  custom_uploader_template_1_1.on('select', function()
430
  {
431
- attachment = custom_uploader_template_1_1.state().get('selection').first().toJSON();
432
- // console.log(attachment);
433
- if(hidden_field_id)
434
- {
435
- jQuery(hidden_field_id).val(attachment.id);
436
- }
437
- if(preview_id != "")
438
- {
439
- jQuery(preview_id).attr('src',attachment.url);
440
- }
441
  });
442
  //Open the uploader dialog
443
  custom_uploader_template_1_1.open();
@@ -447,10 +440,10 @@ function acx_csma_upload_images_template_loader(button_id,uploader_title,uploade
447
  <?php
448
  }
449
  add_action('admin_head', 'acx_csma_upload_images_template_1');
450
-
451
  //Quick Request Form
452
  function acx_csma_quick_request_submit_callback()
453
  {
 
454
  $acx_name = $_POST['acx_name'];
455
  $acx_email = $_POST['acx_email'];
456
  $acx_phone = $_POST['acx_phone'];
@@ -460,50 +453,48 @@ function acx_csma_quick_request_submit_callback()
460
  $acx_question = stripslashes($_POST['acx_question']);
461
  if (!wp_verify_nonce($acx_csma_es,'acx_csma_es'))
462
  {
463
- $acx_csma_es == "";
464
  }
465
  if(!current_user_can('manage_options'))
466
  {
467
- $acx_csma_es == "";
468
  }
469
  if($acx_csma_es == "" || $acx_name == "" || $acx_phone == "" || $acx_email == "" || $acx_weburl == "" || $acx_subject == "" || $acx_question == "")
470
  {
471
  echo 2;
472
  }
473
- else
474
- {
475
- $current_user = wp_get_current_user();
476
- $current_user_acx = $current_user->user_email;
477
- if($current_user_acx == "")
478
- {
479
- $current_user_acx = $acx_email;
480
- }
481
- $headers[] = __('From: ','coming-soon-maintenance-mode-from-acurax') . $acx_name . ' <' . $current_user_acx . '>';
482
- $headers[] = __('Content-Type: text/html; charset=UTF-8','coming-soon-maintenance-mode-from-acurax');
483
- $message = __('Name: ','coming-soon-maintenance-mode-from-acurax').$acx_name . "\r\n <br>";
484
- $message = $message . __('Email: ','coming-soon-maintenance-mode-from-acurax').$acx_email . "\r\n <br>";
485
- if($acx_phone != "")
486
- {
487
- $message = $message . __('Phone:','coming-soon-maintenance-mode-from-acurax').$acx_phone . "\r\n <br>";
488
- }
489
- // In case any of our lines are larger than 70 characters, we should use wordwrap()
490
- $acx_question = wordwrap($acx_question, 70, "\r\n <br>");
491
- $message = $message . __('Request From: CSMA - Expert Help Request Form','coming-soon-maintenance-mode-from-acurax').' \r\n <br>';
492
- $message = $message . __('Website: ','coming-soon-maintenance-mode-from-acurax').$acx_weburl . "\r\n <br>";
493
- $message = $message . __('Question: ','coming-soon-maintenance-mode-from-acurax').$acx_question . "\r\n <br>";
494
- $emailed = wp_mail( 'info@acurax.com', $acx_subject, $message, $headers );
495
- if($emailed)
496
- {
497
- echo 1;
498
- } else
499
  {
500
- echo 0;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
501
  }
502
- }
503
  die(); // this is required to return a proper result
504
  }add_action('wp_ajax_acx_csma_quick_request_submit','acx_csma_quick_request_submit_callback');
505
-
506
-
507
  function acx_csma_add_items($admin_bar)
508
  {
509
  $args = array(
@@ -522,43 +513,28 @@ if($acx_csma_activation_status == 1 && is_admin())
522
  {
523
  add_action('admin_bar_menu', 'acx_csma_add_items');
524
  }
525
-
526
  function acx_csma_subscribe_email()
527
  {
528
- if (!isset($_POST['acx_csma_subscribe_es'])) die("<br><br>Unknown Error Occurred, Try Again... <a href=''>Click Here</a>");
529
- if (!wp_verify_nonce($_POST['acx_csma_subscribe_es'],'acx_csma_subscribe_es')) die("<br><br>Unknown Error Occurred, Try Again... <a href=''>Click Here</a>");
530
-
531
  if(ISSET($_POST['name']))
532
  {
533
- $name=$_POST['name'];
534
- }
535
- else{
536
- $name="";
537
  }
538
  if(ISSET($_POST['email']))
539
  {
540
- $email=$_POST['email'];
541
- }
542
- else{
543
- $email="";
544
  }
545
  if(ISSET($_POST['ip']))
546
  {
547
- $ip=$_POST['ip'];
548
- }
549
- else{
550
- $ip="";
551
  }
552
-
553
  if(ISSET($_POST['timestamp']))
554
  {
555
- $timestamp=$_POST['timestamp'];
556
- }
557
- else{
558
- $timestamp = "";
559
  }
560
-
561
- $acx_csma_subscribe_details=get_option('acx_csma_subscribe_user_details');
562
  if($acx_csma_subscribe_details != "")
563
  {
564
  if(is_serialized($acx_csma_subscribe_details))
@@ -567,14 +543,14 @@ function acx_csma_subscribe_email()
567
  }
568
  }
569
  else{
570
- $acx_csma_subscribe_details=array();
571
  }
572
- $found=0;
573
  foreach($acx_csma_subscribe_details as $key => $value)
574
  {
575
  if($value['email'] == $email)
576
  {
577
- $found=1;
578
  }
579
  }
580
  if($found == 1)
@@ -582,18 +558,18 @@ function acx_csma_subscribe_email()
582
  echo "Exists";
583
  }
584
  else{
585
- $acx_csma_subscribe_details[]= array (
586
- 'name'=> $name,
587
- 'email' => sanitize_email($email),
588
- 'ip' => $ip,
589
- 'timestamp' => $timestamp
590
- );
591
- if(!is_serialized($acx_csma_subscribe_details))
592
- {
593
- $acx_csma_subscribe_details = serialize($acx_csma_subscribe_details);
594
- }
595
- update_option('acx_csma_subscribe_user_details',$acx_csma_subscribe_details);
596
- echo "success";
597
  }
598
  die(); // this is required to return a proper result
599
  }
@@ -633,7 +609,6 @@ function acx_csma_subscribe_ajax()
633
  add_action( 'wp_ajax_acx_csma_subscribe_ajax', 'acx_csma_subscribe_ajax' );
634
  function acx_csma_addon_ua_demo()
635
  {
636
-
637
  echo "<div id='acx_csma_addon_demo_ua'><br><hr>
638
  <img src='".plugins_url('/images/addon_ua_demo.png',__FILE__)."' style='border:0px;width:100%;height:auto;' class='acx_csma_info_lb' lb_title='".__('Private Access URL Feature - Premium Addon Plugin','coming-soon-maintenance-mode-from-acurax')."' lb_content='<p style=\"font-size:13px;\">".__('You may needs to showcase the website to your friends, contacts or clients to get approval, or get suggestions.','coming-soon-maintenance-mode-from-acurax')."<br><br>".__('When website is in under construction mode, they may needs to login or provide you their ip address to grand them access.','coming-soon-maintenance-mode-from-acurax')."<br><br>".__('But using Private Access URL Addon, You will get the option to generate a private URL which you can provide to anyone, and they can access your website, They wont see the under construction page until the url expire.','coming-soon-maintenance-mode-from-acurax')."<br><br>". __('While generating a URL, You can set expiry, It can be Never, So URL is valid until you delete it. Can set expiry as Hours, So URL will be active for specified hours from their first visit.','coming-soon-maintenance-mode-from-acurax')."<br><br>".__('Can also set expiry as page views. Lets say, you generated a URL for 10 Page views, and when someone visit the URL and access 10 pages or visited 10 times.URL will automatically gets expired.','coming-soon-maintenance-mode-from-acurax')."<br><br><a style=\"float: left; color: black; border: 1px solid black; border-radius: 3px; padding: 4px; font-size: 13px; opacity: 0.8;\"href=\"http://www.acurax.com/products/under-construction-maintenance-mode-wordpress-plugin/?feature=url-access&utm_source=link_1&utm_medium=csma_1&utm_campaign=csma\" style=\"float:right;\" target=\"_blank\">".__('View Screenshots/More Details','coming-soon-maintenance-mode-from-acurax')."</a><a href=\"https://clients.acurax.com/order.php?pid=csmauapa&utm_source=link_1&utm_medium=csma_1&utm_campaign=csma\" style=\"float:right;\" target=\"_blank\">".__('Order Now','coming-soon-maintenance-mode-from-acurax')."</a></p><p><br></p>'>
639
  </div>";
@@ -642,7 +617,6 @@ add_action('acx_csma_hook_mainoptions_below_general_settings','acx_csma_addon_ua
642
  function acx_csma_service_addon_demo()
643
  {
644
  $acx_theme_addon_demo_array['STPA1'] = array(
645
-
646
  'STP1_A' => array(
647
  'image' => plugins_url('/images/csma_01.png',__FILE__),
648
  'preview' => 'https://clients.acurax.com/link.php?id=18',
@@ -685,160 +659,158 @@ function acx_csm_info_lb()
685
  ?>
686
  <script type="text/javascript">
687
  jQuery( ".img_holder_demo .acx_csma_info_lb_demo" ).click(function() {
688
- jQuery(this).attr('checked', false);
689
  });
690
  jQuery( ".acx_csma_info_lb" ).click(function() {
691
- var lb_title = jQuery(this).attr('lb_title');
692
- var lb_content = jQuery(this).attr('lb_content');
693
- var html= '<div id="acx_csma_c_icon_p_info_lb_h" style="display:none;"><div class="acx_csma_c_icon_p_info_c"><span class="acx_csma_c_icon_p_info_close" onclick="acx_csma_remove_info()"></span><h4>'+lb_title+'</h4><div class="acx_csma_c_icon_p_info_content">'+lb_content+'</div></div></div> <!-- acx_csma_c_icon_p_info_lb_h -->';
694
- jQuery( "body" ).append(html)
695
- jQuery( "#acx_csma_c_icon_p_info_lb_h" ).fadeIn();
696
  });
697
 
698
  function acx_csma_remove_info()
699
  {
700
- jQuery( "#acx_csma_c_icon_p_info_lb_h" ).fadeOut()
701
- jQuery( "#acx_csma_c_icon_p_info_lb_h" ).remove();
702
- var lb_title = "";
703
- var lb_content = "";
704
  };
705
  </script>
706
  <?php
707
  }
708
  add_action('acx_csma_hook_mainoptions_below_general_settings','acx_csm_info_lb');
709
  add_action('acx_csma_hook_mainoptions_below_javascript','acx_csm_info_lb');
710
-
711
  function acx_csma_updated_fields_content()
712
  {
713
- $acx_csma_appearence_array=acx_csma_get_db_array_value();
714
  if(is_array($acx_csma_appearence_array))
715
  {
716
- if(ISSET($acx_csma_appearence_array['1']))
717
- {
718
- if(!array_key_exists('acx_csma_show_subscription',$acx_csma_appearence_array['1']))
719
- {
720
- $acx_csma_appearence_array['1']['acx_csma_show_subscription'] = 1;
721
- }
722
- if(!array_key_exists('acx_csma_custom_html_top_sub1',$acx_csma_appearence_array['1']))
723
- {
724
- $acx_csma_appearence_array['1']['acx_csma_custom_html_top_sub1'] = "";
725
- }
726
- if(!array_key_exists('acx_csma_custom_html_bottom_sub1',$acx_csma_appearence_array['1']))
727
- {
728
- $acx_csma_appearence_array['1']['acx_csma_custom_html_bottom_sub1'] = "";
729
- }
730
- if(!array_key_exists('acx_csma_custom_css_temp1',$acx_csma_appearence_array['1']))
731
- {
732
- $acx_csma_appearence_array['1']['acx_csma_custom_css_temp1'] = "";
733
- }
734
- if(!array_key_exists('acx_csma_custom_html_top_temp1_title',$acx_csma_appearence_array['1']))
735
- {
736
- $acx_csma_appearence_array['1']['acx_csma_custom_html_top_temp1_title'] = "";
737
- }
738
- }
739
- if(ISSET($acx_csma_appearence_array['2']))
740
- {
741
- if(!array_key_exists('acx_csma_custom_html_top_timer',$acx_csma_appearence_array['2']))
742
- {
743
- $acx_csma_appearence_array['2']['acx_csma_custom_html_top_timer'] = "";
744
- }
745
- if(!array_key_exists('acx_csma_show_subscription2',$acx_csma_appearence_array['2']))
746
- {
747
- $acx_csma_appearence_array['2']['acx_csma_show_subscription2'] = 1;
748
- }
749
- if(!array_key_exists('acx_csma_subscribe_btn_text2',$acx_csma_appearence_array['2']))
750
- {
751
- $acx_csma_appearence_array['2']['acx_csma_subscribe_btn_text2'] = __("Submit","coming-soon-maintenance-mode-from-acurax");
752
- }
753
- if(!array_key_exists('acx_csma_custom_html_above_timer',$acx_csma_appearence_array['2']))
754
- {
755
- $acx_csma_appearence_array['2']['acx_csma_custom_html_above_timer'] = "";
756
- }
757
- if(!array_key_exists('acx_csma_show_timer2',$acx_csma_appearence_array['2']))
758
- {
759
- $acx_csma_appearence_array['2']['acx_csma_show_timer2'] = 1;
760
- }
761
- if(!array_key_exists('acx_csma_custom_css_temp2',$acx_csma_appearence_array['2']))
762
- {
763
- $acx_csma_appearence_array['2']['acx_csma_custom_css_temp2'] = "";
764
- }
765
- }
766
- if(ISSET($acx_csma_appearence_array['3']))
767
- {
768
- if(!array_key_exists('acx_csma_primary_color3',$acx_csma_appearence_array['3']))
769
- {
770
- $acx_csma_appearence_array['3']['acx_csma_primary_color3'] = "#ffffff";
771
- }
772
- if(!array_key_exists('acx_csma_secondary_color3',$acx_csma_appearence_array['3']))
773
- {
774
- $acx_csma_appearence_array['3']['acx_csma_secondary_color3'] = "#fe7e01";
775
- }
776
- if(!array_key_exists('acx_csma_left_bar_color3',$acx_csma_appearence_array['3']))
777
- {
778
- $acx_csma_appearence_array['3']['acx_csma_left_bar_color3'] = "#000000";
779
- }
780
- if(!array_key_exists('acx_csma_timer_color3',$acx_csma_appearence_array['3']))
781
- {
782
- $acx_csma_appearence_array['3']['acx_csma_timer_color3'] = "#ffffff";
783
- }
784
- if(!array_key_exists('acx_csma_show_subscription3',$acx_csma_appearence_array['3']))
785
- {
786
- $acx_csma_appearence_array['3']['acx_csma_show_subscription3'] = 1;
787
- }
788
- if(!array_key_exists('acx_csma_show_timer3',$acx_csma_appearence_array['3']))
789
- {
790
- $acx_csma_appearence_array['3']['acx_csma_show_timer3'] = 1;
791
- }
792
- if(!array_key_exists('acx_csma_custom_html_top_timer_temp3',$acx_csma_appearence_array['3']))
793
- {
794
- $acx_csma_appearence_array['3']['acx_csma_custom_html_top_timer_temp3'] = "";
795
- }
796
- if(!array_key_exists('acx_csma_custom_html_bottom_temp3',$acx_csma_appearence_array['3']))
797
- {
798
- $acx_csma_appearence_array['3']['acx_csma_custom_html_bottom_temp3'] = "";
799
- }
800
- if(!array_key_exists('acx_csma_custom_css_temp3',$acx_csma_appearence_array['3']))
801
- {
802
- $acx_csma_appearence_array['3']['acx_csma_custom_css_temp3'] = "";
803
- }
804
- }
805
- if(ISSET($acx_csma_appearence_array['4']))
806
- {
807
- if(!array_key_exists('acx_csma_custom_css_temp4',$acx_csma_appearence_array['4']))
808
- {
809
- $acx_csma_appearence_array['4']['acx_csma_custom_css_temp4'] = "";
810
- }
811
- }
812
- if(ISSET($acx_csma_appearence_array['5']))
813
- {
814
- if(!array_key_exists('acx_csma_show_subscription5',$acx_csma_appearence_array['5']))
815
- {
816
- $acx_csma_appearence_array['5']['acx_csma_show_subscription5'] = 1;
817
- }
818
- if(!array_key_exists('acx_csma_subscribe_btn_text5',$acx_csma_appearence_array['5']))
819
  {
820
- $acx_csma_appearence_array['5']['acx_csma_subscribe_btn_text5'] = __("Submit","coming-soon-maintenance-mode-from-acurax");
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
821
  }
822
- if(!array_key_exists('acx_csma_custom_html_top_sub',$acx_csma_appearence_array['5']))
823
  {
824
- $acx_csma_appearence_array['5']['acx_csma_custom_html_top_sub'] = "";
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
825
  }
826
- if(!array_key_exists('acx_csma_custom_html_bottom_sub',$acx_csma_appearence_array['5']))
827
  {
828
- $acx_csma_appearence_array['5']['acx_csma_custom_html_bottom_sub'] = "";
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
829
  }
830
- if(!array_key_exists('acx_csma_launch_title_color5',$acx_csma_appearence_array['5']))
831
  {
832
- $acx_csma_appearence_array['5']['acx_csma_launch_title_color5'] = "#4b4b4b";
 
 
 
833
  }
834
- if(!array_key_exists('acx_csma_custom_css_temp5',$acx_csma_appearence_array['5']))
835
  {
836
- $acx_csma_appearence_array['5']['acx_csma_custom_css_temp5'] = "";
837
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
838
  }
839
-
840
-
841
- }$acx_csma_appearence_array=acx_csma_get_db_array_value();
842
  }
843
  add_action('acx_csma_hook_mainoptions_inside_else_submit','acx_csma_updated_fields_content');
844
  function acx_csma_getrealip()
@@ -896,7 +868,7 @@ function acx_customhtml_stripslashes($name,$value)
896
  {
897
  if($_POST[$name] == $value)
898
  {
899
- $value = stripslashes($_POST[$name]);
900
  }
901
  }
902
  return $value;
@@ -933,7 +905,6 @@ function acx_stripslashes_text_after_save($value)
933
  return $value;
934
  }
935
  add_filter('acx_csma_text_after_save_hook','acx_stripslashes_text_after_save',20,1);
936
-
937
  function acx_esc_attr_text_after_save($value)
938
  {
939
  $value = esc_attr($value);
@@ -967,7 +938,6 @@ function acx_csma_display_var_content()
967
  $display_content.="<hr />";
968
  ksort($acx_csma_display_var_arr);
969
  $display_content.="<table class='wp-list-table widefat fixed striped'><th>".__('Text','coming-soon-maintenance-mode-from-acurax')."</th><th>".__('Variable','coming-soon-maintenance-mode-from-acurax')."</th><th>".__('Action','coming-soon-maintenance-mode-from-acurax')."</th>";
970
-
971
  foreach($acx_csma_display_var_arr as $key => $values)
972
  {
973
  $singular = '';
@@ -998,7 +968,6 @@ function acx_csma_display_var_content()
998
  }
999
  function acx_csma_display_variables()
1000
  {
1001
-
1002
  echo "<div id='acx_csma_display_variable_content'>";
1003
  $acx_csma_dis_cont=acx_csma_display_var_content();
1004
  echo $acx_csma_dis_cont;
@@ -1036,8 +1005,8 @@ function acx_csma_display_variables()
1036
  }
1037
  function acx_csma_edit_disp_var()
1038
  {
1039
- var key=jQuery('#acx_csma_edit_key').val();
1040
- if(key=="")
1041
  {
1042
  alert('<?php _e('Something Went Wrong\nTry Again!!!','coming-soon-maintenance-mode-from-acurax');?>');
1043
  return false;
@@ -1092,14 +1061,11 @@ function acx_csma_reset_disp_var_callback()
1092
  if (!isset($_POST['acx_csma_reset_var'])) die("<br><br>__('Unknown Error Occurred, Try Again... ','coming-soon-maintenance-mode-from-acurax')<a href = ''>__('Click Here','coming-soon-maintenance-mode-from-acurax')</a>");
1093
  if (!wp_verify_nonce($_POST['acx_csma_reset_var'],'acx_csma_reset_var')) die("<br><br>__('Unknown Error Occurred, Try Again... ,'coming-soon-maintenance-mode-from-acurax')<a href = ''>__('Click Here,'coming-soon-maintenance-mode-from-acurax')</a>");
1094
  if(!current_user_can('manage_options')) die("<br><br>__('Sorry, You have no permission to do this action...','coming-soon-maintenance-mode-from-acurax')</a>");
 
1095
  if (isset($_POST['key']))
1096
  {
1097
  $acx_csma_reset_key = $_POST['key'];
1098
  }
1099
- else
1100
- {
1101
- $acx_csma_reset_key = '';
1102
- }
1103
  $acx_csma_display_var_arr=get_option('acx_csma_display_var_arr');
1104
  if(is_serialized($acx_csma_display_var_arr))
1105
  {
@@ -1111,51 +1077,36 @@ function acx_csma_reset_disp_var_callback()
1111
  }
1112
  if(ISSET($acx_csma_display_var_arr[$acx_csma_reset_key]['default_plural']))
1113
  {
1114
- $acx_csma_display_var_arr[$acx_csma_reset_key]['plural']=$acx_csma_display_var_arr[$acx_csma_reset_key]['default_plural'];
1115
  }
1116
  if(!is_serialized($acx_csma_display_var_arr))
1117
  {
1118
  $acx_csma_display_var_arr = serialize($acx_csma_display_var_arr);
1119
  }
1120
-
1121
  update_option('acx_csma_display_var_arr',$acx_csma_display_var_arr);
1122
  $acx_csma_dis_cont=acx_csma_display_var_content();
1123
  echo $acx_csma_dis_cont;
1124
-
1125
  die();
1126
  }
1127
  add_action( 'wp_ajax_acx_csma_reset_disp_var', 'acx_csma_reset_disp_var_callback' );
1128
-
1129
-
1130
  function acx_csma_edit_disp_var_callback()
1131
  {
1132
- if (!isset($_POST['acx_csma_edit_var'])) die("<br><br>__('Unknown Error Occurred, Try Again... ','coming-soon-maintenance-mode-from-acurax')<a href = ''>__('Click Here','coming-soon-maintenance-mode-from-acurax')</a>");
1133
- if (!wp_verify_nonce($_POST['acx_csma_edit_var'],'acx_csma_edit_var')) die("<br><br>__('Unknown Error Occurred, Try Again... ','coming-soon-maintenance-mode-from-acurax')<a href = ''>Click Here</a>");
1134
- if(!current_user_can('manage_options')) die("<br><br>__('Sorry, You have no permission to do this action...','coming-soon-maintenance-mode-from-acurax')</a>");
 
1135
  if (isset($_POST['key']))
1136
  {
1137
  $acx_csma_edit_key = $_POST['key'];
1138
  }
1139
- else
1140
- {
1141
- $acx_csma_edit_key = '';
1142
- }
1143
  if (isset($_POST['singular']))
1144
  {
1145
  $acx_csma_edit_singular = $_POST['singular'];
1146
  }
1147
- else
1148
- {
1149
- $acx_csma_edit_singular = '';
1150
- }
1151
  if (isset($_POST['plural']))
1152
  {
1153
  $acx_csma_edit_plural = $_POST['plural'];
1154
  }
1155
- else
1156
- {
1157
- $acx_csma_edit_plural = '';
1158
- }
1159
  $acx_csma_display_var_arr=get_option('acx_csma_display_var_arr');
1160
  if(is_serialized($acx_csma_display_var_arr))
1161
  {
@@ -1173,9 +1124,7 @@ function acx_csma_edit_disp_var_callback()
1173
  {
1174
  $acx_csma_display_var_arr = serialize($acx_csma_display_var_arr);
1175
  }
1176
-
1177
  update_option('acx_csma_display_var_arr',$acx_csma_display_var_arr);
1178
-
1179
  $acx_csma_dis_cont=acx_csma_display_var_content();
1180
  echo $acx_csma_dis_cont;
1181
  die();
@@ -1183,34 +1132,22 @@ function acx_csma_edit_disp_var_callback()
1183
  add_action( 'wp_ajax_acx_csma_edit_disp_var', 'acx_csma_edit_disp_var_callback' );
1184
  function acx_csma_open_disp_var_callback()
1185
  {
1186
- if (!isset($_POST['acx_csma_open_disp_var_e'])) die("<br><br>__('Unknown Error Occurred, Try Again... ','coming-soon-maintenance-mode-from-acurax')<a href = ''>__('Click Here','coming-soon-maintenance-mode-from-acurax')</a>");
1187
- if (!wp_verify_nonce($_POST['acx_csma_open_disp_var_e'],'acx_csma_open_disp_var_e')) die("<br><br>__('Unknown Error Occurred, Try Again... ','coming-soon-maintenance-mode-from-acurax')<a href = ''>__('Click Here','coming-soon-maintenance-mode-from-acurax')</a>");
1188
- if(!current_user_can('manage_options')) die("<br><br>__('Sorry, You have no permission to do this action...','coming-soon-maintenance-mode-from-acurax')</a>");
1189
- $response ='';
1190
  if (isset($_POST['key']))
1191
  {
1192
  $acx_csma_key = $_POST['key'];
1193
  }
1194
- else
1195
- {
1196
- $acx_csma_key = '';
1197
- }
1198
  if (isset($_POST['singular']))
1199
  {
1200
  $acx_csma_singular = $_POST['singular'];
1201
  }
1202
- else
1203
- {
1204
- $acx_csma_singular = '';
1205
- }
1206
  if (isset($_POST['plural']))
1207
  {
1208
  $acx_csma_plural = $_POST['plural'];
1209
  }
1210
- else
1211
- {
1212
- $acx_csma_plural = '';
1213
- }
1214
  $acx_csma_display_var_arr=get_option('acx_csma_display_var_arr');
1215
  if(is_serialized($acx_csma_display_var_arr))
1216
  {
@@ -1228,8 +1165,6 @@ function acx_csma_open_disp_var_callback()
1228
  }
1229
  $response .= "<span class='acx_csma_disp_input'><input type='hidden' name='acx_csma_edit_key' id='acx_csma_edit_key' value='".$acx_csma_key."'></span><span class='acx_csma_disp_btn'><button type='button' class='button' onclick='acx_csma_edit_disp_var();'>".__('Save','coming-soon-maintenance-mode-from-acurax')."</button></span></div></div></div>";
1230
  echo $response;
1231
-
1232
-
1233
  die();
1234
  }
1235
  add_action( 'wp_ajax_acx_csma_open_disp_var', 'acx_csma_open_disp_var_callback' );
@@ -1237,10 +1172,9 @@ if(!function_exists('acx_csma_disp_var_to_show'))
1237
  {
1238
  function acx_csma_disp_var_to_show($acx_csma_disp_key)
1239
  {
1240
-
1241
- $display_response=array();
1242
- $acx_csma_edit_plural="";
1243
- $acx_csma_edit_singular="";
1244
  $acx_csma_display_var_arr=get_option('acx_csma_display_var_arr');
1245
  if(is_serialized($acx_csma_display_var_arr))
1246
  {
@@ -1274,7 +1208,7 @@ function acx_csma_get_db_array_value()
1274
  }
1275
  function acx_csma_demo_get_array_filter_low_priority($acx_csma_appearence_array)
1276
  {
1277
- return $acx_csma_appearence_array;
1278
  }
1279
  add_filter('acx_csma_demo_get_array_filter','acx_csma_demo_get_array_filter_low_priority',5);
1280
  function acx_csma_update_array_value($acx_csma_appearence_array)
@@ -1286,8 +1220,6 @@ function acx_csma_update_array_value($acx_csma_appearence_array)
1286
  }
1287
  update_option('acx_csma_appearence_array',$acx_csma_appearence_array);
1288
  }
1289
-
1290
-
1291
  // --- Making Sure acx_csma_appearence_array has all indexes starts here -----
1292
  function acx_csma_appearence_array_refresh()
1293
  {
@@ -1301,7 +1233,7 @@ function acx_csma_appearence_array_refresh()
1301
  $acx_csma_appearence_array_cloned = $acx_csma_appearence_array;
1302
  foreach($acx_csma_appearence_array_default as $key => $value)
1303
  {
1304
- if(!array_key_exists($key,$acx_csma_appearence_array_cloned)) // If Template Not Available then add
1305
  {
1306
  $acx_csma_appearence_array_cloned[$key] = $acx_csma_appearence_array_default[$key];
1307
  $changes_happened = true;
@@ -1311,7 +1243,7 @@ function acx_csma_appearence_array_refresh()
1311
  {
1312
  foreach($value as $key2 => $value2)
1313
  {
1314
- if(!array_key_exists($key2,$acx_csma_appearence_array_cloned[$key])) // If Template Not Available then add
1315
  {
1316
  $acx_csma_appearence_array_cloned[$key][$key2] = $acx_csma_appearence_array_default[$key][$key2];
1317
  $changes_happened = true;
@@ -1326,68 +1258,67 @@ function acx_csma_appearence_array_refresh()
1326
  }
1327
  }
1328
  add_action( 'init', 'acx_csma_appearence_array_refresh');
1329
- function update_acx_csma_display_var_array()
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1330
  {
1331
- $acx_csma_display_var_arr=get_option('acx_csma_display_var_arr');
1332
- $change_status = false;
1333
- if(is_serialized($acx_csma_display_var_arr))
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1334
  {
1335
- $acx_csma_display_var_arr=unserialize($acx_csma_display_var_arr);
1336
- }
1337
- if(is_array($acx_csma_display_var_arr))
1338
- {
1339
- if(!ISSET($acx_csma_display_var_arr['Subscription Name Placeholder']))
1340
- {
1341
- $acx_csma_display_var_arr['Subscription Name Placeholder'] = array(
1342
- 'singular'=>__('Enter Your Name Here','coming-soon-maintenance-mode-from-acurax'),
1343
- 'default_singular'=>__('Enter Your Name Here','coming-soon-maintenance-mode-from-acurax'),
1344
- );
1345
- $change_status = true;
1346
- }
1347
- if(!ISSET($acx_csma_display_var_arr['Subscription Email Placeholder']))
1348
- {
1349
- $acx_csma_display_var_arr['Subscription Email Placeholder'] = array(
1350
- 'singular'=>__('Enter Your Email Here','coming-soon-maintenance-mode-from-acurax'),
1351
- 'default_singular'=>__('Enter Your Email Here','coming-soon-maintenance-mode-from-acurax'),
1352
- );
1353
- $change_status = true;
1354
- }
1355
- if(!ISSET($acx_csma_display_var_arr['Subscription Name Error Message']))
1356
- {
1357
- $acx_csma_display_var_arr['Subscription Name Error Message'] = array(
1358
- 'singular'=>__('Please Enter Your Name Here','coming-soon-maintenance-mode-from-acurax'),
1359
- 'default_singular'=>__('Please Enter Your Name Here','coming-soon-maintenance-mode-from-acurax'),
1360
- );
1361
- $change_status = true;
1362
- }
1363
- if(!ISSET($acx_csma_display_var_arr['Subscription Email Error Message']))
1364
- {
1365
- $acx_csma_display_var_arr['Subscription Email Error Message'] = array(
1366
- 'singular'=>__('Please Enter Your Email Here','coming-soon-maintenance-mode-from-acurax'),
1367
- 'default_singular'=>__('Please Enter Your Email Here','coming-soon-maintenance-mode-from-acurax'),
1368
- );
1369
- $change_status = true;
1370
- }
1371
- if(!ISSET($acx_csma_display_var_arr['Subscription Email Exists Message']))
1372
- {
1373
- $acx_csma_display_var_arr['Subscription Email Exists Message'] = array(
1374
- 'singular'=>__('Email Already Exists','coming-soon-maintenance-mode-from-acurax'),
1375
- 'default_singular'=>__('Email Already Exists','coming-soon-maintenance-mode-from-acurax'),
1376
- );
1377
- $change_status = true;
1378
- }
1379
-
1380
- if($change_status == true)
1381
- {
1382
- if(!is_serialized($acx_csma_display_var_arr))
1383
- {
1384
- $acx_csma_display_var_arr = serialize($acx_csma_display_var_arr);
1385
- }
1386
- update_option('acx_csma_display_var_arr',$acx_csma_display_var_arr);
1387
- }
1388
  }
 
1389
  }
1390
- add_action('init','update_acx_csma_display_var_array');
 
 
1391
  // --- Making Sure acx_csma_appearence_array has all indexes ends here -----
1392
  function print_acx_csma_option_heading($heading)
1393
  {
@@ -1401,7 +1332,7 @@ function print_acx_csma_option_block_start($title,$pre_fix="",$suf_fix="")
1401
  global $acx_csma_options_uid;
1402
  if(!$acx_csma_options_uid || $acx_csma_options_uid == "")
1403
  {
1404
- $acx_csma_options_uid = 0;
1405
  }
1406
  $acx_csma_options_uid = $acx_csma_options_uid+1;
1407
  echo "<div class='acx_csma_q_holder acx_csma_q_holder_".$acx_csma_options_uid."'>";
@@ -1434,7 +1365,6 @@ function acx_csma_misc_service_info_html()
1434
  echo "<span class='acx_csma_q_sep'></span>";
1435
  print_acx_csma_option_block_end();
1436
  } add_action('acx_csma_misc_hook_option_fields','acx_csma_misc_service_info_html',100);
1437
-
1438
  function acx_csma_service_info_option()
1439
  {
1440
  global $acx_csma_service_banners;
@@ -1445,10 +1375,8 @@ function acx_csma_service_info_option()
1445
  </select>
1446
  <?php
1447
  echo "<span class='acx_csma_q_sep'></span>";
1448
-
1449
  }
1450
  add_action('acx_csma_misc_service_info','acx_csma_service_info_option',100);
1451
-
1452
  function acx_csma_service_info_if()
1453
  {
1454
  global $acx_csma_service_banners;
@@ -1485,8 +1413,6 @@ function acx_csma_misc_expert_support_option()
1485
 
1486
  }
1487
  add_action('acx_csma_misc_service_info','acx_csma_misc_expert_support_option',300);
1488
-
1489
-
1490
  function acx_csma_expert_support_if()
1491
  {
1492
  global $acx_csma_hide_expert_support_menu;
@@ -1520,11 +1446,8 @@ function acx_csma_send_header_option()
1520
  </select>
1521
  <?php
1522
  echo "<span class='acx_csma_q_sep'></span>";
1523
-
1524
  }
1525
  add_action('acx_csma_misc_service_info','acx_csma_send_header_option',300);
1526
-
1527
-
1528
  function acx_csma_send_header_if()
1529
  {
1530
  global $acx_csma_send_header_option;
@@ -1557,6 +1480,191 @@ echo "<span class='acx_csma_q_sep'></span>";
1557
  }
1558
  add_action('acx_csma_misc_hook_option_fields','acx_csma_misc_submit_button_html',300);
1559
  /* Define Misc Submit Button Ends Here */
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1560
  function acx_csma_load_plugin_textdomain() {
1561
  load_plugin_textdomain( 'coming-soon-maintenance-mode-from-acurax', FALSE, basename( dirname( __FILE__ ) ) . '/lang/' );
1562
  }
8
  } add_action('init','acx_csma_display_template_array_filter_hook');
9
  function acx_csma_filter_lw_pr($acx_csma_template_array)
10
  {
11
+ return $acx_csma_template_array;
12
  } add_filter('acx_csma_display_template_array_filter','acx_csma_filter_lw_pr',5);
 
13
  function acx_csma_appearence_array_default_filter_hook()
14
  {
15
  global $acx_csma_appearence_array_default;
17
  $acx_csma_appearence_array_default = apply_filters('acx_csma_appearence_array_default_filter',$acx_csma_appearence_array_default);
18
 
19
  } add_action('init','acx_csma_appearence_array_default_filter_hook');
 
20
  function acx_csma_appearence_array_default_lw_pr($acx_csma_appearence_array_default)
21
  {
22
+ return $acx_csma_appearence_array_default;
23
  } add_filter('acx_csma_appearence_array_default_filter','acx_csma_appearence_array_default_lw_pr',5);
24
 
25
  $acx_csma_display_var_arr = get_option('acx_csma_display_var_arr');
85
  }
86
  function acx_csma_styles()
87
  {
88
+ wp_register_style('acx_csmaadmin_style', plugins_url('css/admin.css?v='.ACX_CSMA_CURRENT_VERSION, __FILE__));
89
  wp_enqueue_style('acx_csmaadmin_style');
90
+ wp_register_style('acx_csmaaddons_style', plugins_url('css/csma_addons.css?v='.ACX_CSMA_CURRENT_VERSION, __FILE__));
91
  wp_enqueue_style('acx_csmaaddons_style');
92
+ wp_register_style('acx_csma_layout_style', plugins_url('css/layout.css?v='.ACX_CSMA_CURRENT_VERSION, __FILE__));
93
  wp_enqueue_style('acx_csma_layout_style');
94
+ wp_register_style('acx_csmabox_style', plugins_url('css/acx_csma_box.css?v='.ACX_CSMA_CURRENT_VERSION, __FILE__));
95
  wp_enqueue_style('acx_csmabox_style');
96
+ wp_register_style('acx_datepick_style', plugins_url('css/jquery.datetimepicker.css?v='.ACX_CSMA_CURRENT_VERSION, __FILE__));
97
  wp_enqueue_style('acx_datepick_style');
98
  }
99
  add_action('admin_enqueue_scripts', 'acx_csma_styles');
103
  wp_enqueue_script('jquery-ui-core');
104
  }
105
  add_action('admin_enqueue_scripts','acx_csma_date_picker_scripts');
 
106
  function acx_csma_colorpicker_scripts()
107
  {
108
  wp_enqueue_style( 'farbtastic' );
109
  wp_enqueue_script( 'farbtastic','',array( 'jquery' ) );
110
  }
 
111
  // color picker
112
  if(ISSET($_GET['page']))
113
  {
138
  }
139
  function filter_acx_csma_template_array($acx_csma_template_array)
140
  {
141
+ $acx_site_url = get_site_url();
142
+ $acx_csma_parent_folder = basename(dirname(__FILE__));
143
+ $acx_csma_template_array['0'] = array(
144
+ 'id' => 0,
145
+ 'name' =>__('Custom Html','coming-soon-maintenance-mode-from-acurax'),
146
+ 'index' =>'acx_csma_custom_template',
147
+ 'description' => '',
148
+ 'parent' => $acx_csma_parent_folder,
149
+ 'path' => $acx_site_url,
150
+ 'thumb' => ACX_CSMA_BASE_LOCATION
151
+ );
152
+ $acx_csma_template_array['1'] = array(
153
+ 'id' => 1,
154
+ 'name' =>__('Template 1','coming-soon-maintenance-mode-from-acurax'),
155
+ 'index' =>'acx_csma_template1',
156
+ 'description' => '',
157
+ 'parent' => $acx_csma_parent_folder,
158
+ 'path' => $acx_site_url,
159
+ 'thumb' => ACX_CSMA_BASE_LOCATION
160
+ );
161
+ $acx_csma_template_array['2'] = array(
162
+ 'id' => 2,
163
+ 'name' =>__('Template 2','coming-soon-maintenance-mode-from-acurax'),
164
+ 'index' =>'acx_csma_template2',
165
+ 'description' => '',
166
+ 'parent' => $acx_csma_parent_folder,
167
+ 'path' => $acx_site_url,
168
+ 'thumb' => ACX_CSMA_BASE_LOCATION
169
+ );
170
+ $acx_csma_template_array['3'] = array(
171
+ 'id' => 3,
172
+ 'name' =>__('Template 3','coming-soon-maintenance-mode-from-acurax'),
173
+ 'index' =>'acx_csma_template3',
174
+ 'description' => '',
175
+ 'parent' => $acx_csma_parent_folder,
176
+ 'path' => $acx_site_url,
177
+ 'thumb' => ACX_CSMA_BASE_LOCATION
178
+ );
179
+ $acx_csma_template_array['4'] = array(
180
+ 'id' => 4,
181
+ 'name' =>__('Template 4','coming-soon-maintenance-mode-from-acurax'),
182
+ 'index' =>'acx_csma_template4',
183
+ 'description' => '',
184
+ 'parent' => $acx_csma_parent_folder,
185
+ 'path' => $acx_site_url,
186
+ 'thumb' => ACX_CSMA_BASE_LOCATION
187
+ );
188
+ $acx_csma_template_array['5'] = array(
189
+ 'id' => 5,
190
+ 'name' =>__('Template 5','coming-soon-maintenance-mode-from-acurax'),
191
+ 'index' =>'acx_csma_template5',
192
+ 'description' => '',
193
+ 'parent' => $acx_csma_parent_folder,
194
+ 'path' => $acx_site_url,
195
+ 'thumb' => ACX_CSMA_BASE_LOCATION
196
+ );
 
197
 
198
  return $acx_csma_template_array;
199
  }
200
  add_filter('acx_csma_display_template_array_filter','filter_acx_csma_template_array');
201
 
202
  $acx_csma_activation_status = get_option('acx_csma_activation_status');
203
+ if($acx_csma_activation_status == '')
204
  {
205
  update_option('acx_csma_activation_status',0);
206
  }
207
+ if($acx_csma_activation_status == 1)
208
  {
209
  $acx_csma_display_template=true;
210
  }
211
  else
212
  {
213
+ $acx_csma_display_template = false;
214
  }
215
  if($acx_csma_display_template == true)
216
  {
222
  {
223
  if($acx_csma_auto_launch==0)
224
  {
225
+ $acx_csma_display_template = true;
226
  } else
227
  {
228
+ $acx_csma_display_template = false;
229
  }
230
  }
231
  }
232
+ if($acx_csma_display_template == true)
233
  {
234
  add_action('template_redirect','acx_csma_plugin_activation');
235
  }
299
  $end_time = get_option('acx_csma_date_time');
300
  if($end_time != "")
301
  {
302
+ $end_time = date_i18n("D, j M Y H:i:s e", $end_time);
303
+ header( "Retry-After: $end_time" );
304
  }
305
  $acx_csma_template=get_option('acx_csma_template');
306
  if($acx_csma_template == "" || !is_numeric($acx_csma_template))
317
  include_once($acx_csma_template_path);
318
  exit;
319
  }
 
320
  }
321
  function filter_acx_csma_template($acx_csma_display_template)
322
  {
325
  return $acx_csma_display_template;
326
  }
327
  }
 
328
  add_filter('acx_csma_display_template_filter','filter_acx_csma_template',5);
329
  function acx_csma_template_preview()
330
  {
333
  if ($acx_csma_send_header_option == "") { $acx_csma_send_header_option = "yes"; }
334
  if(ISSET($_GET['acx_csma_preview']) && current_user_can( 'manage_options' )){
335
  $acx_csma_preview=$_GET['acx_csma_preview'];
336
+ if(is_array($acx_csma_template_array) && array_key_exists($acx_csma_preview,$acx_csma_template_array))
337
  {
338
  $protocol = "HTTP/1.0";
339
  if ( "HTTP/1.1" == $_SERVER["SERVER_PROTOCOL"] )
345
  $end_time = get_option('acx_csma_date_time');
346
  if($end_time != "")
347
  {
348
+ $end_time = date_i18n("D, j M Y H:i:s e", $end_time);
349
+ header( "Retry-After: $end_time" );
350
  }
351
  $acx_csma_template_path_loc = WP_CONTENT_DIR."/plugins/".$acx_csma_template_array[$acx_csma_preview]['parent'];
352
  include_once($acx_csma_template_path_loc."/templates/".$acx_csma_preview."/index.php");
356
  }
357
  add_action('template_redirect','acx_csma_template_preview');
358
  // changing launch text
359
+ $acx_csma_appearence_array=acx_csma_get_db_array_value();
360
+ if(is_array($acx_csma_appearence_array))
361
+ {
362
+ if(array_key_exists('3',$acx_csma_appearence_array) && array_key_exists('acx_csma_inside_title3',$acx_csma_appearence_array['3']))
363
  {
364
+ $acx_csma_inside_title3 = $acx_csma_appearence_array['3']['acx_csma_inside_title3'];
365
+ if(strcmp($acx_csma_inside_title3,"Estimate Time Before Lunching") === 0 )
366
  {
367
+ $acx_csma_appearence_array['3']['acx_csma_inside_title3'] = __("Estimate Time Before Launching","coming-soon-maintenance-mode-from-acurax");
 
 
 
 
368
  }
 
369
  }
370
+ acx_csma_update_array_value($acx_csma_appearence_array);
371
+ }
372
  // upload images and logos
373
  function acx_csma_upload_images_template_1()
374
  {
382
  {
383
  if(button_id)
384
  {
385
+ button_id = "#"+button_id;
386
  }
387
  if(uploader_title == "")
388
  {
389
+ uploader_title = "<?php _e('Choose Image','coming-soon-maintenance-mode-from-acurax');?>";
390
  }
391
  if(uploader_button == "")
392
  {
393
+ uploader_button = "<?php _e('Select','coming-soon-maintenance-mode-from-acurax');?>";
394
  }
395
  if(hidden_field_id)
396
  {
397
+ hidden_field_id = "#"+hidden_field_id;
398
  }
399
  if(preview_id)
400
  {
401
+ preview_id = "#"+preview_id;
402
  }
403
  var custom_uploader_template_1_1;
404
  jQuery(button_id).click(function(e)
407
  //If the uploader object has already been created, reopen the dialog
408
  if (custom_uploader_template_1_1)
409
  {
410
+ custom_uploader_template_1_1.open();
411
+ return;
412
  }
413
  //Extend the wp.media object
414
  custom_uploader_template_1_1 = wp.media.frames.file_frame = wp.media({
415
  title: uploader_title,
416
  button:
417
  {
418
+ text: uploader_button
419
  },
420
  multiple: false });
421
  //When a file is selected, grab the URL and set it as the text field's value
422
  custom_uploader_template_1_1.on('select', function()
423
  {
424
+ attachment = custom_uploader_template_1_1.state().get('selection').first().toJSON();
425
+ // console.log(attachment);
426
+ if(hidden_field_id)
427
+ {
428
+ jQuery(hidden_field_id).val(attachment.id);
429
+ }
430
+ if(preview_id != "")
431
+ {
432
+ jQuery(preview_id).attr('src',attachment.url);
433
+ }
434
  });
435
  //Open the uploader dialog
436
  custom_uploader_template_1_1.open();
440
  <?php
441
  }
442
  add_action('admin_head', 'acx_csma_upload_images_template_1');
 
443
  //Quick Request Form
444
  function acx_csma_quick_request_submit_callback()
445
  {
446
+ $acx_name = $acx_email = $acx_phone = $acx_csma_es = $acx_weburl = $acx_subject = $acx_question = "";
447
  $acx_name = $_POST['acx_name'];
448
  $acx_email = $_POST['acx_email'];
449
  $acx_phone = $_POST['acx_phone'];
453
  $acx_question = stripslashes($_POST['acx_question']);
454
  if (!wp_verify_nonce($acx_csma_es,'acx_csma_es'))
455
  {
456
+ $acx_csma_es == "";
457
  }
458
  if(!current_user_can('manage_options'))
459
  {
460
+ $acx_csma_es == "";
461
  }
462
  if($acx_csma_es == "" || $acx_name == "" || $acx_phone == "" || $acx_email == "" || $acx_weburl == "" || $acx_subject == "" || $acx_question == "")
463
  {
464
  echo 2;
465
  }
466
+ else
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
467
  {
468
+ $current_user = wp_get_current_user();
469
+ $current_user_acx = $current_user->user_email;
470
+ if($current_user_acx == "")
471
+ {
472
+ $current_user_acx = $acx_email;
473
+ }
474
+ $headers[] = __('From: ','coming-soon-maintenance-mode-from-acurax') . $acx_name . ' <' . $current_user_acx . '>';
475
+ $headers[] = __('Content-Type: text/html; charset=UTF-8','coming-soon-maintenance-mode-from-acurax');
476
+ $message = __('Name: ','coming-soon-maintenance-mode-from-acurax').$acx_name . "\r\n <br>";
477
+ $message = $message . __('Email: ','coming-soon-maintenance-mode-from-acurax').$acx_email . "\r\n <br>";
478
+ if($acx_phone != "")
479
+ {
480
+ $message = $message . __('Phone:','coming-soon-maintenance-mode-from-acurax').$acx_phone . "\r\n <br>";
481
+ }
482
+ // In case any of our lines are larger than 70 characters, we should use wordwrap()
483
+ $acx_question = wordwrap($acx_question, 70, "\r\n <br>");
484
+ $message = $message . __('Request From: CSMA - Expert Help Request Form','coming-soon-maintenance-mode-from-acurax').' \r\n <br>';
485
+ $message = $message . __('Website: ','coming-soon-maintenance-mode-from-acurax').$acx_weburl . "\r\n <br>";
486
+ $message = $message . __('Question: ','coming-soon-maintenance-mode-from-acurax').$acx_question . "\r\n <br>";
487
+ $emailed = wp_mail( 'info@acurax.com', $acx_subject, $message, $headers );
488
+ if($emailed)
489
+ {
490
+ echo 1;
491
+ } else
492
+ {
493
+ echo 0;
494
+ }
495
  }
 
496
  die(); // this is required to return a proper result
497
  }add_action('wp_ajax_acx_csma_quick_request_submit','acx_csma_quick_request_submit_callback');
 
 
498
  function acx_csma_add_items($admin_bar)
499
  {
500
  $args = array(
513
  {
514
  add_action('admin_bar_menu', 'acx_csma_add_items');
515
  }
 
516
  function acx_csma_subscribe_email()
517
  {
518
+ if (!isset($_POST['acx_csma_subscribe_es'])) die("<br><br>".__('Unknown Error Occurred, Try Again...','coming-soon-maintenance-mode-from-acurax')." <a href=''>".__('Click Here','coming-soon-maintenance-mode-from-acurax')."</a>");
519
+ if (!wp_verify_nonce($_POST['acx_csma_subscribe_es'],'acx_csma_subscribe_es')) die("<br><br>".__('Unknown Error Occurred, Try Again... ','coming-soon-maintenance-mode-from-acurax')."<a href=''>".__('Click Here','coming-soon-maintenance-mode-from-acurax')."</a>");
520
+ $name = $email = $ip = $timestamp = "";
521
  if(ISSET($_POST['name']))
522
  {
523
+ $name = $_POST['name'];
 
 
 
524
  }
525
  if(ISSET($_POST['email']))
526
  {
527
+ $email = $_POST['email'];
 
 
 
528
  }
529
  if(ISSET($_POST['ip']))
530
  {
531
+ $ip = $_POST['ip'];
 
 
 
532
  }
 
533
  if(ISSET($_POST['timestamp']))
534
  {
535
+ $timestamp = $_POST['timestamp'];
 
 
 
536
  }
537
+ $acx_csma_subscribe_details = get_option('acx_csma_subscribe_user_details');
 
538
  if($acx_csma_subscribe_details != "")
539
  {
540
  if(is_serialized($acx_csma_subscribe_details))
543
  }
544
  }
545
  else{
546
+ $acx_csma_subscribe_details = array();
547
  }
548
+ $found = 0;
549
  foreach($acx_csma_subscribe_details as $key => $value)
550
  {
551
  if($value['email'] == $email)
552
  {
553
+ $found = 1;
554
  }
555
  }
556
  if($found == 1)
558
  echo "Exists";
559
  }
560
  else{
561
+ $acx_csma_subscribe_details[]= array (
562
+ 'name' => $name,
563
+ 'email' => sanitize_email($email),
564
+ 'ip' => $ip,
565
+ 'timestamp' => $timestamp
566
+ );
567
+ if(!is_serialized($acx_csma_subscribe_details))
568
+ {
569
+ $acx_csma_subscribe_details = serialize($acx_csma_subscribe_details);
570
+ }
571
+ update_option('acx_csma_subscribe_user_details',$acx_csma_subscribe_details);
572
+ echo "success";
573
  }
574
  die(); // this is required to return a proper result
575
  }
609
  add_action( 'wp_ajax_acx_csma_subscribe_ajax', 'acx_csma_subscribe_ajax' );
610
  function acx_csma_addon_ua_demo()
611
  {
 
612
  echo "<div id='acx_csma_addon_demo_ua'><br><hr>
613
  <img src='".plugins_url('/images/addon_ua_demo.png',__FILE__)."' style='border:0px;width:100%;height:auto;' class='acx_csma_info_lb' lb_title='".__('Private Access URL Feature - Premium Addon Plugin','coming-soon-maintenance-mode-from-acurax')."' lb_content='<p style=\"font-size:13px;\">".__('You may needs to showcase the website to your friends, contacts or clients to get approval, or get suggestions.','coming-soon-maintenance-mode-from-acurax')."<br><br>".__('When website is in under construction mode, they may needs to login or provide you their ip address to grand them access.','coming-soon-maintenance-mode-from-acurax')."<br><br>".__('But using Private Access URL Addon, You will get the option to generate a private URL which you can provide to anyone, and they can access your website, They wont see the under construction page until the url expire.','coming-soon-maintenance-mode-from-acurax')."<br><br>". __('While generating a URL, You can set expiry, It can be Never, So URL is valid until you delete it. Can set expiry as Hours, So URL will be active for specified hours from their first visit.','coming-soon-maintenance-mode-from-acurax')."<br><br>".__('Can also set expiry as page views. Lets say, you generated a URL for 10 Page views, and when someone visit the URL and access 10 pages or visited 10 times.URL will automatically gets expired.','coming-soon-maintenance-mode-from-acurax')."<br><br><a style=\"float: left; color: black; border: 1px solid black; border-radius: 3px; padding: 4px; font-size: 13px; opacity: 0.8;\"href=\"http://www.acurax.com/products/under-construction-maintenance-mode-wordpress-plugin/?feature=url-access&utm_source=link_1&utm_medium=csma_1&utm_campaign=csma\" style=\"float:right;\" target=\"_blank\">".__('View Screenshots/More Details','coming-soon-maintenance-mode-from-acurax')."</a><a href=\"https://clients.acurax.com/order.php?pid=csmauapa&utm_source=link_1&utm_medium=csma_1&utm_campaign=csma\" style=\"float:right;\" target=\"_blank\">".__('Order Now','coming-soon-maintenance-mode-from-acurax')."</a></p><p><br></p>'>
614
  </div>";
617
  function acx_csma_service_addon_demo()
618
  {
619
  $acx_theme_addon_demo_array['STPA1'] = array(
 
620
  'STP1_A' => array(
621
  'image' => plugins_url('/images/csma_01.png',__FILE__),
622
  'preview' => 'https://clients.acurax.com/link.php?id=18',
659
  ?>
660
  <script type="text/javascript">
661
  jQuery( ".img_holder_demo .acx_csma_info_lb_demo" ).click(function() {
662
+ jQuery(this).attr('checked', false);
663
  });
664
  jQuery( ".acx_csma_info_lb" ).click(function() {
665
+ var lb_title = jQuery(this).attr('lb_title');
666
+ var lb_content = jQuery(this).attr('lb_content');
667
+ var html= '<div id="acx_csma_c_icon_p_info_lb_h" style="display:none;"><div class="acx_csma_c_icon_p_info_c"><span class="acx_csma_c_icon_p_info_close" onclick="acx_csma_remove_info()"></span><h4>'+lb_title+'</h4><div class="acx_csma_c_icon_p_info_content">'+lb_content+'</div></div></div> <!-- acx_csma_c_icon_p_info_lb_h -->';
668
+ jQuery( "body" ).append(html)
669
+ jQuery( "#acx_csma_c_icon_p_info_lb_h" ).fadeIn();
670
  });
671
 
672
  function acx_csma_remove_info()
673
  {
674
+ jQuery( "#acx_csma_c_icon_p_info_lb_h" ).fadeOut()
675
+ jQuery( "#acx_csma_c_icon_p_info_lb_h" ).remove();
676
+ var lb_title = "";
677
+ var lb_content = "";
678
  };
679
  </script>
680
  <?php
681
  }
682
  add_action('acx_csma_hook_mainoptions_below_general_settings','acx_csm_info_lb');
683
  add_action('acx_csma_hook_mainoptions_below_javascript','acx_csm_info_lb');
 
684
  function acx_csma_updated_fields_content()
685
  {
686
+ $acx_csma_appearence_array=acx_csma_get_db_array_value();
687
  if(is_array($acx_csma_appearence_array))
688
  {
689
+ if(ISSET($acx_csma_appearence_array['1']))
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
690
  {
691
+ if(!array_key_exists('acx_csma_show_subscription',$acx_csma_appearence_array['1']))
692
+ {
693
+ $acx_csma_appearence_array['1']['acx_csma_show_subscription'] = 1;
694
+ }
695
+ if(!array_key_exists('acx_csma_custom_html_top_sub1',$acx_csma_appearence_array['1']))
696
+ {
697
+ $acx_csma_appearence_array['1']['acx_csma_custom_html_top_sub1'] = "";
698
+ }
699
+ if(!array_key_exists('acx_csma_custom_html_bottom_sub1',$acx_csma_appearence_array['1']))
700
+ {
701
+ $acx_csma_appearence_array['1']['acx_csma_custom_html_bottom_sub1'] = "";
702
+ }
703
+ if(!array_key_exists('acx_csma_custom_css_temp1',$acx_csma_appearence_array['1']))
704
+ {
705
+ $acx_csma_appearence_array['1']['acx_csma_custom_css_temp1'] = "";
706
+ }
707
+ if(!array_key_exists('acx_csma_custom_html_top_temp1_title',$acx_csma_appearence_array['1']))
708
+ {
709
+ $acx_csma_appearence_array['1']['acx_csma_custom_html_top_temp1_title'] = "";
710
+ }
711
  }
712
+ if(ISSET($acx_csma_appearence_array['2']))
713
  {
714
+ if(!array_key_exists('acx_csma_custom_html_top_timer',$acx_csma_appearence_array['2']))
715
+ {
716
+ $acx_csma_appearence_array['2']['acx_csma_custom_html_top_timer'] = "";
717
+ }
718
+ if(!array_key_exists('acx_csma_show_subscription2',$acx_csma_appearence_array['2']))
719
+ {
720
+ $acx_csma_appearence_array['2']['acx_csma_show_subscription2'] = 1;
721
+ }
722
+ if(!array_key_exists('acx_csma_subscribe_btn_text2',$acx_csma_appearence_array['2']))
723
+ {
724
+ $acx_csma_appearence_array['2']['acx_csma_subscribe_btn_text2'] = __("Submit","coming-soon-maintenance-mode-from-acurax");
725
+ }
726
+ if(!array_key_exists('acx_csma_custom_html_above_timer',$acx_csma_appearence_array['2']))
727
+ {
728
+ $acx_csma_appearence_array['2']['acx_csma_custom_html_above_timer'] = "";
729
+ }
730
+ if(!array_key_exists('acx_csma_show_timer2',$acx_csma_appearence_array['2']))
731
+ {
732
+ $acx_csma_appearence_array['2']['acx_csma_show_timer2'] = 1;
733
+ }
734
+ if(!array_key_exists('acx_csma_custom_css_temp2',$acx_csma_appearence_array['2']))
735
+ {
736
+ $acx_csma_appearence_array['2']['acx_csma_custom_css_temp2'] = "";
737
+ }
738
  }
739
+ if(ISSET($acx_csma_appearence_array['3']))
740
  {
741
+ if(!array_key_exists('acx_csma_primary_color3',$acx_csma_appearence_array['3']))
742
+ {
743
+ $acx_csma_appearence_array['3']['acx_csma_primary_color3'] = "#ffffff";
744
+ }
745
+ if(!array_key_exists('acx_csma_secondary_color3',$acx_csma_appearence_array['3']))
746
+ {
747
+ $acx_csma_appearence_array['3']['acx_csma_secondary_color3'] = "#fe7e01";
748
+ }
749
+ if(!array_key_exists('acx_csma_left_bar_color3',$acx_csma_appearence_array['3']))
750
+ {
751
+ $acx_csma_appearence_array['3']['acx_csma_left_bar_color3'] = "#000000";
752
+ }
753
+ if(!array_key_exists('acx_csma_timer_color3',$acx_csma_appearence_array['3']))
754
+ {
755
+ $acx_csma_appearence_array['3']['acx_csma_timer_color3'] = "#ffffff";
756
+ }
757
+ if(!array_key_exists('acx_csma_show_subscription3',$acx_csma_appearence_array['3']))
758
+ {
759
+ $acx_csma_appearence_array['3']['acx_csma_show_subscription3'] = 1;
760
+ }
761
+ if(!array_key_exists('acx_csma_show_timer3',$acx_csma_appearence_array['3']))
762
+ {
763
+ $acx_csma_appearence_array['3']['acx_csma_show_timer3'] = 1;
764
+ }
765
+ if(!array_key_exists('acx_csma_custom_html_top_timer_temp3',$acx_csma_appearence_array['3']))
766
+ {
767
+ $acx_csma_appearence_array['3']['acx_csma_custom_html_top_timer_temp3'] = "";
768
+ }
769
+ if(!array_key_exists('acx_csma_custom_html_bottom_temp3',$acx_csma_appearence_array['3']))
770
+ {
771
+ $acx_csma_appearence_array['3']['acx_csma_custom_html_bottom_temp3'] = "";
772
+ }
773
+ if(!array_key_exists('acx_csma_custom_css_temp3',$acx_csma_appearence_array['3']))
774
+ {
775
+ $acx_csma_appearence_array['3']['acx_csma_custom_css_temp3'] = "";
776
+ }
777
  }
778
+ if(ISSET($acx_csma_appearence_array['4']))
779
  {
780
+ if(!array_key_exists('acx_csma_custom_css_temp4',$acx_csma_appearence_array['4']))
781
+ {
782
+ $acx_csma_appearence_array['4']['acx_csma_custom_css_temp4'] = "";
783
+ }
784
  }
785
+ if(ISSET($acx_csma_appearence_array['5']))
786
  {
787
+ if(!array_key_exists('acx_csma_show_subscription5',$acx_csma_appearence_array['5']))
788
+ {
789
+ $acx_csma_appearence_array['5']['acx_csma_show_subscription5'] = 1;
790
+ }
791
+ if(!array_key_exists('acx_csma_subscribe_btn_text5',$acx_csma_appearence_array['5']))
792
+ {
793
+ $acx_csma_appearence_array['5']['acx_csma_subscribe_btn_text5'] = __("Submit","coming-soon-maintenance-mode-from-acurax");
794
+ }
795
+ if(!array_key_exists('acx_csma_custom_html_top_sub',$acx_csma_appearence_array['5']))
796
+ {
797
+ $acx_csma_appearence_array['5']['acx_csma_custom_html_top_sub'] = "";
798
+ }
799
+ if(!array_key_exists('acx_csma_custom_html_bottom_sub',$acx_csma_appearence_array['5']))
800
+ {
801
+ $acx_csma_appearence_array['5']['acx_csma_custom_html_bottom_sub'] = "";
802
+ }
803
+ if(!array_key_exists('acx_csma_launch_title_color5',$acx_csma_appearence_array['5']))
804
+ {
805
+ $acx_csma_appearence_array['5']['acx_csma_launch_title_color5'] = "#4b4b4b";
806
+ }
807
+ if(!array_key_exists('acx_csma_custom_css_temp5',$acx_csma_appearence_array['5']))
808
+ {
809
+ $acx_csma_appearence_array['5']['acx_csma_custom_css_temp5'] = "";
810
+ }
811
+ }
812
  }
813
+ $acx_csma_appearence_array=acx_csma_get_db_array_value();
 
 
814
  }
815
  add_action('acx_csma_hook_mainoptions_inside_else_submit','acx_csma_updated_fields_content');
816
  function acx_csma_getrealip()
868
  {
869
  if($_POST[$name] == $value)
870
  {
871
+ $value = stripslashes($_POST[$name]);
872
  }
873
  }
874
  return $value;
905
  return $value;
906
  }
907
  add_filter('acx_csma_text_after_save_hook','acx_stripslashes_text_after_save',20,1);
 
908
  function acx_esc_attr_text_after_save($value)
909
  {
910
  $value = esc_attr($value);
938
  $display_content.="<hr />";
939
  ksort($acx_csma_display_var_arr);
940
  $display_content.="<table class='wp-list-table widefat fixed striped'><th>".__('Text','coming-soon-maintenance-mode-from-acurax')."</th><th>".__('Variable','coming-soon-maintenance-mode-from-acurax')."</th><th>".__('Action','coming-soon-maintenance-mode-from-acurax')."</th>";
 
941
  foreach($acx_csma_display_var_arr as $key => $values)
942
  {
943
  $singular = '';
968
  }
969
  function acx_csma_display_variables()
970
  {
 
971
  echo "<div id='acx_csma_display_variable_content'>";
972
  $acx_csma_dis_cont=acx_csma_display_var_content();
973
  echo $acx_csma_dis_cont;
1005
  }
1006
  function acx_csma_edit_disp_var()
1007
  {
1008
+ var key = jQuery('#acx_csma_edit_key').val();
1009
+ if(key == "")
1010
  {
1011
  alert('<?php _e('Something Went Wrong\nTry Again!!!','coming-soon-maintenance-mode-from-acurax');?>');
1012
  return false;
1061
  if (!isset($_POST['acx_csma_reset_var'])) die("<br><br>__('Unknown Error Occurred, Try Again... ','coming-soon-maintenance-mode-from-acurax')<a href = ''>__('Click Here','coming-soon-maintenance-mode-from-acurax')</a>");
1062
  if (!wp_verify_nonce($_POST['acx_csma_reset_var'],'acx_csma_reset_var')) die("<br><br>__('Unknown Error Occurred, Try Again... ,'coming-soon-maintenance-mode-from-acurax')<a href = ''>__('Click Here,'coming-soon-maintenance-mode-from-acurax')</a>");
1063
  if(!current_user_can('manage_options')) die("<br><br>__('Sorry, You have no permission to do this action...','coming-soon-maintenance-mode-from-acurax')</a>");
1064
+ $acx_csma_reset_key = '';
1065
  if (isset($_POST['key']))
1066
  {
1067
  $acx_csma_reset_key = $_POST['key'];
1068
  }
 
 
 
 
1069
  $acx_csma_display_var_arr=get_option('acx_csma_display_var_arr');
1070
  if(is_serialized($acx_csma_display_var_arr))
1071
  {
1077
  }
1078
  if(ISSET($acx_csma_display_var_arr[$acx_csma_reset_key]['default_plural']))
1079
  {
1080
+ $acx_csma_display_var_arr[$acx_csma_reset_key]['plural']=$acx_csma_display_var_arr[$acx_csma_reset_key]['default_plural'];
1081
  }
1082
  if(!is_serialized($acx_csma_display_var_arr))
1083
  {
1084
  $acx_csma_display_var_arr = serialize($acx_csma_display_var_arr);
1085
  }
 
1086
  update_option('acx_csma_display_var_arr',$acx_csma_display_var_arr);
1087
  $acx_csma_dis_cont=acx_csma_display_var_content();
1088
  echo $acx_csma_dis_cont;
 
1089
  die();
1090
  }
1091
  add_action( 'wp_ajax_acx_csma_reset_disp_var', 'acx_csma_reset_disp_var_callback' );
 
 
1092
  function acx_csma_edit_disp_var_callback()
1093
  {
1094
+ if (!isset($_POST['acx_csma_edit_var'])) die("<br><br>".__('Unknown Error Occurred, Try Again... ','coming-soon-maintenance-mode-from-acurax')."<a href = ''>".__('Click Here','coming-soon-maintenance-mode-from-acurax')."</a>");
1095
+ if (!wp_verify_nonce($_POST['acx_csma_edit_var'],'acx_csma_edit_var')) die("<br><br>".__('Unknown Error Occurred, Try Again... ','coming-soon-maintenance-mode-from-acurax')."<a href = ''>".__('Click Here','coming-soon-maintenance-mode-from-acurax')."</a>");
1096
+ if(!current_user_can('manage_options')) die("<br><br>".__('Sorry, You have no permission to do this action...','coming-soon-maintenance-mode-from-acurax')."</a>");
1097
+ $acx_csma_edit_key = $acx_csma_edit_singular = $acx_csma_edit_plural = '';
1098
  if (isset($_POST['key']))
1099
  {
1100
  $acx_csma_edit_key = $_POST['key'];
1101
  }
 
 
 
 
1102
  if (isset($_POST['singular']))
1103
  {
1104
  $acx_csma_edit_singular = $_POST['singular'];
1105
  }
 
 
 
 
1106
  if (isset($_POST['plural']))
1107
  {
1108
  $acx_csma_edit_plural = $_POST['plural'];
1109
  }
 
 
 
 
1110
  $acx_csma_display_var_arr=get_option('acx_csma_display_var_arr');
1111
  if(is_serialized($acx_csma_display_var_arr))
1112
  {
1124
  {
1125
  $acx_csma_display_var_arr = serialize($acx_csma_display_var_arr);
1126
  }
 
1127
  update_option('acx_csma_display_var_arr',$acx_csma_display_var_arr);
 
1128
  $acx_csma_dis_cont=acx_csma_display_var_content();
1129
  echo $acx_csma_dis_cont;
1130
  die();
1132
  add_action( 'wp_ajax_acx_csma_edit_disp_var', 'acx_csma_edit_disp_var_callback' );
1133
  function acx_csma_open_disp_var_callback()
1134
  {
1135
+ if (!isset($_POST['acx_csma_open_disp_var_e'])) die("<br><br>".__('Unknown Error Occurred, Try Again... ','coming-soon-maintenance-mode-from-acurax')."<a href = ''>".__('Click Here','coming-soon-maintenance-mode-from-acurax')."</a>");
1136
+ if (!wp_verify_nonce($_POST['acx_csma_open_disp_var_e'],'acx_csma_open_disp_var_e')) die("<br><br>".__('Unknown Error Occurred, Try Again... ','coming-soon-maintenance-mode-from-acurax')."<a href = ''>".__('Click Here','coming-soon-maintenance-mode-from-acurax')."</a>");
1137
+ if(!current_user_can('manage_options')) die("<br><br>".__('Sorry, You have no permission to do this action...','coming-soon-maintenance-mode-from-acurax')."</a>");
1138
+ $response = $acx_csma_key = $acx_csma_singular = $acx_csma_plural = '';
1139
  if (isset($_POST['key']))
1140
  {
1141
  $acx_csma_key = $_POST['key'];
1142
  }
 
 
 
 
1143
  if (isset($_POST['singular']))
1144
  {
1145
  $acx_csma_singular = $_POST['singular'];
1146
  }
 
 
 
 
1147
  if (isset($_POST['plural']))
1148
  {
1149
  $acx_csma_plural = $_POST['plural'];
1150
  }
 
 
 
 
1151
  $acx_csma_display_var_arr=get_option('acx_csma_display_var_arr');
1152
  if(is_serialized($acx_csma_display_var_arr))
1153
  {
1165
  }
1166
  $response .= "<span class='acx_csma_disp_input'><input type='hidden' name='acx_csma_edit_key' id='acx_csma_edit_key' value='".$acx_csma_key."'></span><span class='acx_csma_disp_btn'><button type='button' class='button' onclick='acx_csma_edit_disp_var();'>".__('Save','coming-soon-maintenance-mode-from-acurax')."</button></span></div></div></div>";
1167
  echo $response;
 
 
1168
  die();
1169
  }
1170
  add_action( 'wp_ajax_acx_csma_open_disp_var', 'acx_csma_open_disp_var_callback' );
1172
  {
1173
  function acx_csma_disp_var_to_show($acx_csma_disp_key)
1174
  {
1175
+ $display_response = array();
1176
+ $acx_csma_edit_plural = "";
1177
+ $acx_csma_edit_singular = "";
 
1178
  $acx_csma_display_var_arr=get_option('acx_csma_display_var_arr');
1179
  if(is_serialized($acx_csma_display_var_arr))
1180
  {
1208
  }
1209
  function acx_csma_demo_get_array_filter_low_priority($acx_csma_appearence_array)
1210
  {
1211
+ return $acx_csma_appearence_array;
1212
  }
1213
  add_filter('acx_csma_demo_get_array_filter','acx_csma_demo_get_array_filter_low_priority',5);
1214
  function acx_csma_update_array_value($acx_csma_appearence_array)
1220
  }
1221
  update_option('acx_csma_appearence_array',$acx_csma_appearence_array);
1222
  }
 
 
1223
  // --- Making Sure acx_csma_appearence_array has all indexes starts here -----
1224
  function acx_csma_appearence_array_refresh()
1225
  {
1233
  $acx_csma_appearence_array_cloned = $acx_csma_appearence_array;
1234
  foreach($acx_csma_appearence_array_default as $key => $value)
1235
  {
1236
+ if(is_array($acx_csma_appearence_array_cloned) && !array_key_exists($key,$acx_csma_appearence_array_cloned)) // If Template Not Available then add
1237
  {
1238
  $acx_csma_appearence_array_cloned[$key] = $acx_csma_appearence_array_default[$key];
1239
  $changes_happened = true;
1243
  {
1244
  foreach($value as $key2 => $value2)
1245
  {
1246
+ if(is_array($acx_csma_appearence_array_cloned[$key]) && !array_key_exists($key2,$acx_csma_appearence_array_cloned[$key])) // If Template Not Available then add
1247
  {
1248
  $acx_csma_appearence_array_cloned[$key][$key2] = $acx_csma_appearence_array_default[$key][$key2];
1249
  $changes_happened = true;
1258
  }
1259
  }
1260
  add_action( 'init', 'acx_csma_appearence_array_refresh');
1261
+ function update_acx_csma_display_var_array()
1262
+ {
1263
+ $acx_csma_display_var_arr=get_option('acx_csma_display_var_arr');
1264
+ $change_status = false;
1265
+ if(is_serialized($acx_csma_display_var_arr))
1266
+ {
1267
+ $acx_csma_display_var_arr=unserialize($acx_csma_display_var_arr);
1268
+ }
1269
+ if(is_array($acx_csma_display_var_arr))
1270
+ {
1271
+ if(!ISSET($acx_csma_display_var_arr['Subscription Name Placeholder']))
1272
+ {
1273
+ $acx_csma_display_var_arr['Subscription Name Placeholder'] = array(
1274
+ 'singular'=>__('Enter Your Name Here','coming-soon-maintenance-mode-from-acurax'),
1275
+ 'default_singular'=>__('Enter Your Name Here','coming-soon-maintenance-mode-from-acurax'),
1276
+ );
1277
+ $change_status = true;
1278
+ }
1279
+ if(!ISSET($acx_csma_display_var_arr['Subscription Email Placeholder']))
1280
  {
1281
+ $acx_csma_display_var_arr['Subscription Email Placeholder'] = array(
1282
+ 'singular'=>__('Enter Your Email Here','coming-soon-maintenance-mode-from-acurax'),
1283
+ 'default_singular'=>__('Enter Your Email Here','coming-soon-maintenance-mode-from-acurax'),
1284
+ );
1285
+ $change_status = true;
1286
+ }
1287
+ if(!ISSET($acx_csma_display_var_arr['Subscription Name Error Message']))
1288
+ {
1289
+ $acx_csma_display_var_arr['Subscription Name Error Message'] = array(
1290
+ 'singular'=>__('Please Enter Your Name Here','coming-soon-maintenance-mode-from-acurax'),
1291
+ 'default_singular'=>__('Please Enter Your Name Here','coming-soon-maintenance-mode-from-acurax'),
1292
+ );
1293
+ $change_status = true;
1294
+ }
1295
+ if(!ISSET($acx_csma_display_var_arr['Subscription Email Error Message']))
1296
+ {
1297
+ $acx_csma_display_var_arr['Subscription Email Error Message'] = array(
1298
+ 'singular'=>__('Please Enter Your Email Here','coming-soon-maintenance-mode-from-acurax'),
1299
+ 'default_singular'=>__('Please Enter Your Email Here','coming-soon-maintenance-mode-from-acurax'),
1300
+ );
1301
+ $change_status = true;
1302
+ }
1303
+ if(!ISSET($acx_csma_display_var_arr['Subscription Email Exists Message']))
1304
+ {
1305
+ $acx_csma_display_var_arr['Subscription Email Exists Message'] = array(
1306
+ 'singular'=>__('Email Already Exists','coming-soon-maintenance-mode-from-acurax'),
1307
+ 'default_singular'=>__('Email Already Exists','coming-soon-maintenance-mode-from-acurax'),
1308
+ );
1309
+ $change_status = true;
1310
+ }
1311
+ if($change_status == true)
1312
+ {
1313
+ if(!is_serialized($acx_csma_display_var_arr))
1314
  {
1315
+ $acx_csma_display_var_arr = serialize($acx_csma_display_var_arr);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1316
  }
1317
+ update_option('acx_csma_display_var_arr',$acx_csma_display_var_arr);
1318
  }
1319
+ }
1320
+ }
1321
+ add_action('init','update_acx_csma_display_var_array');
1322
  // --- Making Sure acx_csma_appearence_array has all indexes ends here -----
1323
  function print_acx_csma_option_heading($heading)
1324
  {
1332
  global $acx_csma_options_uid;
1333
  if(!$acx_csma_options_uid || $acx_csma_options_uid == "")
1334
  {
1335
+ $acx_csma_options_uid = 0;
1336
  }
1337
  $acx_csma_options_uid = $acx_csma_options_uid+1;
1338
  echo "<div class='acx_csma_q_holder acx_csma_q_holder_".$acx_csma_options_uid."'>";
1365
  echo "<span class='acx_csma_q_sep'></span>";
1366
  print_acx_csma_option_block_end();
1367
  } add_action('acx_csma_misc_hook_option_fields','acx_csma_misc_service_info_html',100);
 
1368
  function acx_csma_service_info_option()
1369
  {
1370
  global $acx_csma_service_banners;
1375
  </select>
1376
  <?php
1377
  echo "<span class='acx_csma_q_sep'></span>";
 
1378
  }
1379
  add_action('acx_csma_misc_service_info','acx_csma_service_info_option',100);
 
1380
  function acx_csma_service_info_if()
1381
  {
1382
  global $acx_csma_service_banners;
1413
 
1414
  }
1415
  add_action('acx_csma_misc_service_info','acx_csma_misc_expert_support_option',300);
 
 
1416
  function acx_csma_expert_support_if()
1417
  {
1418
  global $acx_csma_hide_expert_support_menu;
1446
  </select>
1447
  <?php
1448
  echo "<span class='acx_csma_q_sep'></span>";
 
1449
  }
1450
  add_action('acx_csma_misc_service_info','acx_csma_send_header_option',300);
 
 
1451
  function acx_csma_send_header_if()
1452
  {
1453
  global $acx_csma_send_header_option;
1480
  }
1481
  add_action('acx_csma_misc_hook_option_fields','acx_csma_misc_submit_button_html',300);
1482
  /* Define Misc Submit Button Ends Here */
1483
+ // refresh
1484
+ function acx_csma_install_licence_refresh_callback()
1485
+ {
1486
+ if (!isset($_POST['acx_csma_install_licence_refresh_w_c_n'])) die("<br><br>".__('Unknown Error Occurred, Try Again... ','coming-soon-maintenance-mode-from-acurax')."<a href=''>".__('Click Here','coming-soon-maintenance-mode-from-acurax')."</a>");
1487
+ if (!wp_verify_nonce($_POST['acx_csma_install_licence_refresh_w_c_n'],'acx_csma_install_licence_refresh_w_c_n')) die("<br><br>".__('Unknown Error Occurred, Try Again... ','coming-soon-maintenance-mode-from-acurax')."<a href=''>".__('Click Here','coming-soon-maintenance-mode-from-acurax')."</a>");
1488
+
1489
+ $key = $licence = $id = "";
1490
+ $response_stat = "failed";
1491
+ if(ISSET($_POST['key']))
1492
+ {
1493
+ $key = $_POST['key'];
1494
+ }
1495
+ if(ISSET($_POST['licence']))
1496
+ {
1497
+ $licence = $_POST['licence'];
1498
+ }
1499
+ $result = acx_csma_p_check_license($licence,'',true,$id);
1500
+ if(ISSET($result["localkey"]))
1501
+ {
1502
+ $local_key = $result["localkey"];
1503
+ }
1504
+ else{
1505
+ $local_key = "";
1506
+ }
1507
+ $acx_csma_p_licence_array = get_option('acx_csma_p_licence_array');
1508
+ if(is_serialized($acx_csma_p_licence_array))
1509
+ {
1510
+ $acx_csma_p_licence_array = unserialize($acx_csma_p_licence_array);
1511
+ }
1512
+ if($acx_csma_p_licence_array == "" || !is_array($acx_csma_p_licence_array))
1513
+ {
1514
+ $acx_csma_p_licence_array = array();
1515
+ }
1516
+ $acx_csma_purchased_li_array = get_option('acx_csma_purchased_li_array');
1517
+ if(is_serialized($acx_csma_purchased_li_array))
1518
+ {
1519
+ $acx_csma_purchased_li_array = unserialize($acx_csma_purchased_li_array);
1520
+ }
1521
+ if($acx_csma_purchased_li_array == "" || !is_array($acx_csma_purchased_li_array))
1522
+ {
1523
+ $acx_csma_purchased_li_array = array();
1524
+ }
1525
+ if(ISSET($result["status"]))
1526
+ {
1527
+ if($result["status"] == 'Active')
1528
+ {
1529
+ if(ISSET($acx_csma_p_licence_array[$key]))
1530
+ {
1531
+ if($local_key != "")
1532
+ {
1533
+ $acx_csma_p_licence_array[$key]['local_key'] = $local_key;
1534
+
1535
+ if(!is_serialized($acx_csma_p_licence_array))
1536
+ {
1537
+ $acx_csma_p_licence_array = serialize($acx_csma_p_licence_array);
1538
+ }
1539
+ update_option('acx_csma_p_licence_array',$acx_csma_p_licence_array);
1540
+
1541
+ }
1542
+ }
1543
+
1544
+ }
1545
+ $acx_csma_purchased_li_array[$licence]['status'] = $result['status'];
1546
+ if(!is_serialized($acx_csma_purchased_li_array))
1547
+ {
1548
+ $acx_csma_purchased_li_array = serialize($acx_csma_purchased_li_array);
1549
+ }
1550
+ update_option('acx_csma_purchased_li_array',$acx_csma_purchased_li_array);
1551
+ $response_stat = "success";
1552
+ }
1553
+ echo $response_stat;
1554
+ die();
1555
+ }
1556
+ add_action("wp_ajax_acx_csma_install_licence_refresh","acx_csma_install_licence_refresh_callback");
1557
+ function acx_csma_license_refresh_with_forcing($acx_license,$addon_key)
1558
+ {
1559
+ $acx_csma_ip = isset($_SERVER['SERVER_ADDR']) ? $_SERVER['SERVER_ADDR'] : $_SERVER['LOCAL_ADDR'];
1560
+ $acx_csma_domain = $_SERVER['SERVER_NAME'];
1561
+ $acx_csma_directory = dirname(__FILE__);
1562
+ $acx_csma_args = array(
1563
+ 'action' => 'acx-li-check-latest-version',
1564
+ 'method' => 'addon_activation',
1565
+ 'directory' => $acx_csma_directory,
1566
+ 'unique_id' => $addon_key,
1567
+ 'domain' => $acx_csma_domain,
1568
+ 'ip' => $acx_csma_ip,
1569
+ 'licence' => $acx_license
1570
+ );
1571
+ $acx_csma_unique_id = "";
1572
+ $response_stat = "failed";
1573
+ $retry = true;
1574
+ $acx_csma_p_licence_array = get_option('acx_csma_p_licence_array');
1575
+ if(is_serialized($acx_csma_p_licence_array))
1576
+ {
1577
+ $acx_csma_p_licence_array = unserialize($acx_csma_p_licence_array);
1578
+ }
1579
+ if($acx_csma_p_licence_array == "" || !is_array($acx_csma_p_licence_array))
1580
+ {
1581
+ $acx_csma_p_licence_array = array();
1582
+ }
1583
+ $acx_csmap_retry_array = get_option('acx_csmap_retry_array');
1584
+ if(is_serialized($acx_csmap_retry_array))
1585
+ {
1586
+ $acx_csmap_retry_array = unserialize($acx_csmap_retry_array);
1587
+ }
1588
+ if($acx_csmap_retry_array == "")
1589
+ {
1590
+ $acx_csmap_retry_array = array();
1591
+ }
1592
+ if(!is_array($acx_csmap_retry_array))
1593
+ {
1594
+ $acx_csmap_retry_array = array();
1595
+ }
1596
+ if(ISSET($acx_csmap_retry_array[$acx_license]['activation_licence_check']))
1597
+ {
1598
+ if($acx_csmap_retry_array[$acx_license]['activation_licence_check'] >= 3)
1599
+ {
1600
+ $retry = false;
1601
+ }
1602
+ }
1603
+ // Send request checking for an update
1604
+ if($retry == true)
1605
+ {
1606
+ $response = acx_csma_licence_activation_api_request( $acx_csma_args );
1607
+ $response = json_decode($response, true);
1608
+ }
1609
+ if(!ISSET($response['response_status']) && !ISSET($response['status']))
1610
+ {
1611
+ if(ISSET($acx_csmap_retry_array[$acx_license]['activation_licence_check']))
1612
+ {
1613
+ $acx_csmap_retry_array[$acx_license]['activation_licence_check'] = $acx_csmap_retry_array[$acx_license]['activation_licence_check'] + 1;
1614
+ }
1615
+ else{
1616
+ $acx_csmap_retry_array[$acx_license]['activation_licence_check'] = 1;
1617
+ }
1618
+ }
1619
+ else
1620
+ {
1621
+ if($response['response_status'] == "success" && $response['status'] == "Active")
1622
+ {
1623
+ $acx_csma_purchased_li_array = get_option('acx_csma_purchased_li_array');
1624
+ if(is_serialized($acx_csma_purchased_li_array))
1625
+ {
1626
+ $acx_csma_purchased_li_array = unserialize($acx_csma_purchased_li_array);
1627
+ }
1628
+ if($acx_csma_purchased_li_array == "" || !is_array($acx_csma_purchased_li_array))
1629
+ {
1630
+ $acx_csma_purchased_li_array = array();
1631
+ }
1632
+ $acx_csma_unique_id = trim($response['unique_id']);
1633
+ $acx_csma_purchased_li_array[$acx_license] = array(
1634
+ 'slug' => $response['slug'],
1635
+ 'status' => $response['status'],
1636
+ 'download_dynamic_url' => $response['download_dynamic_url']
1637
+ );
1638
+ // update licence array
1639
+
1640
+ $acx_csma_p_licence_array[$acx_csma_unique_id]['addon_name'] = $response['name'];
1641
+ $acx_csma_p_licence_array[$acx_csma_unique_id]['licence_code'] = $acx_license;
1642
+ if($response['localkey'] != "")
1643
+ {
1644
+ $acx_csma_p_licence_array[$acx_csma_unique_id]['local_key'] = $response['localkey'];
1645
+ }
1646
+ if(!is_serialized($acx_csma_p_licence_array))
1647
+ {
1648
+ $acx_csma_p_licence_array = serialize($acx_csma_p_licence_array);
1649
+ }
1650
+ update_option('acx_csma_p_licence_array',$acx_csma_p_licence_array);
1651
+ if(!is_serialized($acx_csma_purchased_li_array))
1652
+ {
1653
+ $acx_csma_purchased_li_array = serialize($acx_csma_purchased_li_array);
1654
+ }
1655
+ update_option('acx_csma_purchased_li_array',$acx_csma_purchased_li_array);
1656
+ $acx_csmap_retry_array[$acx_license]['activation_licence_check'] = 0;
1657
+ if(!is_serialized($acx_csmap_retry_array))
1658
+ {
1659
+ $acx_csmap_retry_array = serialize($acx_csmap_retry_array);
1660
+ }
1661
+ update_option('acx_csmap_retry_array',$acx_csmap_retry_array);
1662
+ $response_stat = $response['response_status'];
1663
+ }
1664
+ }
1665
+
1666
+ return $response_stat;
1667
+ }
1668
  function acx_csma_load_plugin_textdomain() {
1669
  load_plugin_textdomain( 'coming-soon-maintenance-mode-from-acurax', FALSE, basename( dirname( __FILE__ ) ) . '/lang/' );
1670
  }
images/delete.png ADDED
Binary file
images/loading.gif CHANGED
Binary file
images/refresh.png ADDED
Binary file
includes/acx-csma-licence-activation.php ADDED
@@ -0,0 +1,4422 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ $acx_csma_purchased_li_array = get_option('acx_csma_purchased_li_array');
3
+ if(is_serialized($acx_csma_purchased_li_array))
4
+ {
5
+ $acx_csma_purchased_li_array = unserialize($acx_csma_purchased_li_array);
6
+ }
7
+ if($acx_csma_purchased_li_array == "" || !is_array($acx_csma_purchased_li_array))
8
+ {
9
+ $acx_csma_purchased_li_array = array();
10
+ }
11
+ if ( ! class_exists( 'ACX_CSMA_LICENCE_TGM_Plugin_Activation' ) ) {
12
+
13
+ /**
14
+ * Automatic plugin installation and activation library.
15
+ *
16
+ * Creates a way to automatically install and activate plugins from within themes.
17
+ * The plugins can be either bundled, downloaded from the WordPress
18
+ * Plugin Repository or downloaded from another external source.
19
+ *
20
+ * @since 1.0.0
21
+ *
22
+ * @package ACX_CSMA_LICENCE_TGM-Plugin-Activation
23
+ * @author Thomas Griffin
24
+ * @author Gary Jones
25
+ */
26
+ class ACX_CSMA_LICENCE_TGM_Plugin_Activation {
27
+ /**
28
+ * ACX_CSMA_LICENCE_TGMPA version number.
29
+ *
30
+ * @since 2.5.0
31
+ *
32
+ * @const string Version number.
33
+ */
34
+ const ACX_CSMA_LICENCE_TGMPA_VERSION = '2.6.1';
35
+
36
+ /**
37
+ * Regular expression to test if a URL is a WP plugin repo URL.
38
+ *
39
+ * @const string Regex.
40
+ *
41
+ * @since 2.5.0
42
+ */
43
+ const WP_REPO_REGEX = '|^http[s]?://wordpress\.org/(?:extend/)?plugins/|';
44
+
45
+ /**
46
+ * Arbitrary regular expression to test if a string starts with a URL.
47
+ *
48
+ * @const string Regex.
49
+ *
50
+ * @since 2.5.0
51
+ */
52
+ const IS_URL_REGEX = '|^http[s]?://|';
53
+
54
+ /**
55
+ * Holds a copy of itself, so it can be referenced by the class name.
56
+ *
57
+ * @since 1.0.0
58
+ *
59
+ * @var ACX_CSMA_LICENCE_TGM_Plugin_Activation
60
+ */
61
+ public static $instance;
62
+
63
+ /**
64
+ * Holds arrays of plugin details.
65
+ *
66
+ * @since 1.0.0
67
+ * @since 2.5.0 the array has the plugin slug as an associative key.
68
+ *
69
+ * @var array
70
+ */
71
+ public $plugins = array();
72
+
73
+ /**
74
+ * Holds arrays of plugin names to use to sort the plugins array.
75
+ *
76
+ * @since 2.5.0
77
+ *
78
+ * @var array
79
+ */
80
+ protected $sort_order = array();
81
+
82
+ /**
83
+ * Whether any plugins have the 'force_activation' setting set to true.
84
+ *
85
+ * @since 2.5.0
86
+ *
87
+ * @var bool
88
+ */
89
+ protected $has_forced_activation = false;
90
+
91
+ /**
92
+ * Whether any plugins have the 'force_deactivation' setting set to true.
93
+ *
94
+ * @since 2.5.0
95
+ *
96
+ * @var bool
97
+ */
98
+ protected $has_forced_deactivation = false;
99
+
100
+ /**
101
+ * Name of the unique ID to hash notices.
102
+ *
103
+ * @since 2.4.0
104
+ *
105
+ * @var string
106
+ */
107
+ public $id = 'acx_csma_licence_tgmpa';
108
+
109
+ /**
110
+ * Name of the query-string argument for the admin page.
111
+ *
112
+ * @since 1.0.0
113
+ *
114
+ * @var string
115
+ */
116
+ protected $menu = 'Acurax-Coming-Soon-Maintenance-Mode-Settings-Install-Addons';
117
+
118
+ /**
119
+ * Parent menu file slug.
120
+ *
121
+ * @since 2.5.0
122
+ *
123
+ * @var string
124
+ */
125
+ public $parent_slug = 'themes.php';
126
+
127
+ /**
128
+ * Capability needed to view the plugin installation menu item.
129
+ *
130
+ * @since 2.5.0
131
+ *
132
+ * @var string
133
+ */
134
+ public $capability = 'edit_theme_options';
135
+
136
+ /**
137
+ * Default absolute path to folder containing bundled plugin zip files.
138
+ *
139
+ * @since 2.0.0
140
+ *
141
+ * @var string Absolute path prefix to zip file location for bundled plugins. Default is empty string.
142
+ */
143
+ public $default_path = '';
144
+
145
+ /**
146
+ * Flag to show admin notices or not.
147
+ *
148
+ * @since 2.1.0
149
+ *
150
+ * @var boolean
151
+ */
152
+ public $has_notices = true;
153
+
154
+ /**
155
+ * Flag to determine if the user can dismiss the notice nag.
156
+ *
157
+ * @since 2.4.0
158
+ *
159
+ * @var boolean
160
+ */
161
+ public $dismissable = true;
162
+
163
+ /**
164
+ * Message to be output above nag notice if dismissable is false.
165
+ *
166
+ * @since 2.4.0
167
+ *
168
+ * @var string
169
+ */
170
+ public $dismiss_msg = '';
171
+
172
+ /**
173
+ * Flag to set automatic activation of plugins. Off by default.
174
+ *
175
+ * @since 2.2.0
176
+ *
177
+ * @var boolean
178
+ */
179
+ public $is_automatic = false;
180
+
181
+ /**
182
+ * Optional message to display before the plugins table.
183
+ *
184
+ * @since 2.2.0
185
+ *
186
+ * @var string Message filtered by wp_kses_post(). Default is empty string.
187
+ */
188
+ public $message = '';
189
+
190
+ /**
191
+ * Holds configurable array of strings.
192
+ *
193
+ * Default values are added in the constructor.
194
+ *
195
+ * @since 2.0.0
196
+ *
197
+ * @var array
198
+ */
199
+ public $strings = array();
200
+
201
+ /**
202
+ * Holds the version of WordPress.
203
+ *
204
+ * @since 2.4.0
205
+ *
206
+ * @var int
207
+ */
208
+ public $wp_version;
209
+
210
+ /**
211
+ * Holds the hook name for the admin page.
212
+ *
213
+ * @since 2.5.0
214
+ *
215
+ * @var string
216
+ */
217
+ public $page_hook;
218
+
219
+ /**
220
+ * Adds a reference of this object to $instance, populates default strings,
221
+ * does the acx_csma_licence_tgmpa_init action hook, and hooks in the interactions to init.
222
+ *
223
+ * {@internal This method should be `protected`, but as too many ACX_CSMA_LICENCE_TGMPA implementations
224
+ * haven't upgraded beyond v2.3.6 yet, this gives backward compatibility issues.
225
+ * Reverted back to public for the time being.}}
226
+ *
227
+ * @since 1.0.0
228
+ *
229
+ * @see ACX_CSMA_LICENCE_TGM_Plugin_Activation::init()
230
+ */
231
+ public function __construct() {
232
+ // Set the current WordPress version.
233
+ $this->wp_version = $GLOBALS['wp_version'];
234
+
235
+ // Announce that the class is ready, and pass the object (for advanced use).
236
+ do_action_ref_array( 'acx_csma_licence_tgmpa_init', array( $this ) );
237
+
238
+ /*
239
+ * Load our text domain and allow for overloading the fall-back file.
240
+ *
241
+ * {@internal IMPORTANT! If this code changes, review the regex in the custom ACX_CSMA_LICENCE_TGMPA
242
+ * generator on the website.}}
243
+ */
244
+ add_action( 'init', array( $this, 'load_textdomain' ), 5 );
245
+ add_filter( 'load_textdomain_mofile', array( $this, 'overload_textdomain_mofile' ), 10, 2 );
246
+
247
+ // When the rest of WP has loaded, kick-start the rest of the class.
248
+ add_action( 'init', array( $this, 'init' ) );
249
+ }
250
+
251
+ /**
252
+ * Magic method to (not) set protected properties from outside of this class.
253
+ *
254
+ * {@internal hackedihack... There is a serious bug in v2.3.2 - 2.3.6 where the `menu` property
255
+ * is being assigned rather than tested in a conditional, effectively rendering it useless.
256
+ * This 'hack' prevents this from happening.}}
257
+ *
258
+ * @see https://github.com/ACX_CSMA_LICENCE_TGMPA/ACX_CSMA_LICENCE_TGM-Plugin-Activation/blob/2.3.6/acx_csma_licence_tgm-plugin-activation/class-acx_csma_licence_tgm-plugin-activation.php#L1593
259
+ *
260
+ * @since 2.5.2
261
+ *
262
+ * @param string $name Name of an inaccessible property.
263
+ * @param mixed $value Value to assign to the property.
264
+ * @return void Silently fail to set the property when this is tried from outside of this class context.
265
+ * (Inside this class context, the __set() method if not used as there is direct access.)
266
+ */
267
+ public function __set( $name, $value ) {
268
+ return;
269
+ }
270
+
271
+ /**
272
+ * Magic method to get the value of a protected property outside of this class context.
273
+ *
274
+ * @since 2.5.2
275
+ *
276
+ * @param string $name Name of an inaccessible property.
277
+ * @return mixed The property value.
278
+ */
279
+ public function __get( $name ) {
280
+ return $this->{$name};
281
+ }
282
+
283
+ /**
284
+ * Initialise the interactions between this class and WordPress.
285
+ *
286
+ * Hooks in three new methods for the class: admin_menu, notices and styles.
287
+ *
288
+ * @since 2.0.0
289
+ *
290
+ * @see ACX_CSMA_LICENCE_TGM_Plugin_Activation::admin_menu()
291
+ * @see ACX_CSMA_LICENCE_TGM_Plugin_Activation::notices()
292
+ * @see ACX_CSMA_LICENCE_TGM_Plugin_Activation::styles()
293
+ */
294
+ public function init() {
295
+ /**
296
+ * By default ACX_CSMA_LICENCE_TGMPA only loads on the WP back-end and not in an Ajax call. Using this filter
297
+ * you can overrule that behaviour.
298
+ *
299
+ * @since 2.5.0
300
+ *
301
+ * @param bool $load Whether or not ACX_CSMA_LICENCE_TGMPA should load.
302
+ * Defaults to the return of `is_admin() && ! defined( 'DOING_AJAX' )`.
303
+ */
304
+ if ( true !== apply_filters( 'acx_csma_licence_tgmpa_load', ( is_admin() && ! defined( 'DOING_AJAX' ) ) ) ) {
305
+ return;
306
+ }
307
+
308
+ // Load class strings.
309
+ $this->strings = array(
310
+ 'page_title' => __( 'Install Addons', 'acx_csma_licence_tgmpa' ),
311
+ 'menu_title' => __( 'Install Addons', 'acx_csma_licence_tgmpa' ),
312
+ 'installing' => __( 'Installing Plugin: %s', 'acx_csma_licence_tgmpa' ),
313
+ 'updating' => __( 'Updating Plugin: %s', 'acx_csma_licence_tgmpa' ),
314
+ 'oops' => __( 'Something went wrong with the plugin API.', 'acx_csma_licence_tgmpa' ),
315
+ 'notice_can_install_required' => _n_noop(
316
+ 'This theme requires the following plugin: %1$s.',
317
+ 'This theme requires the following plugins: %1$s.',
318
+ 'acx_csma_licence_tgmpa'
319
+ ),
320
+ 'notice_can_install_recommended' => _n_noop(
321
+ 'This theme recommends the following plugin: %1$s.',
322
+ 'This theme recommends the following plugins: %1$s.',
323
+ 'acx_csma_licence_tgmpa'
324
+ ),
325
+ 'notice_ask_to_update' => _n_noop(
326
+ 'The following plugin needs to be updated to its latest version to ensure maximum compatibility with this theme: %1$s.',
327
+ 'The following plugins need to be updated to their latest version to ensure maximum compatibility with this theme: %1$s.',
328
+ 'acx_csma_licence_tgmpa'
329
+ ),
330
+ 'notice_ask_to_update_maybe' => _n_noop(
331
+ 'There is an update available for: %1$s.',
332
+ 'There are updates available for the following plugins: %1$s.',
333
+ 'acx_csma_licence_tgmpa'
334
+ ),
335
+ 'notice_can_activate_required' => _n_noop(
336
+ 'The following required plugin is currently inactive: %1$s.',
337
+ 'The following required plugins are currently inactive: %1$s.',
338
+ 'acx_csma_licence_tgmpa'
339
+ ),
340
+ 'notice_can_activate_recommended' => _n_noop(
341
+ 'The following recommended plugin is currently inactive: %1$s.',
342
+ 'The following recommended plugins are currently inactive: %1$s.',
343
+ 'acx_csma_licence_tgmpa'
344
+ ),
345
+ 'install_link' => _n_noop(
346
+ 'Begin installing plugin',
347
+ 'Begin installing plugins',
348
+ 'acx_csma_licence_tgmpa'
349
+ ),
350
+ 'update_link' => _n_noop(
351
+ 'Begin updating plugin',
352
+ 'Begin updating plugins',
353
+ 'acx_csma_licence_tgmpa'
354
+ ),
355
+ 'activate_link' => _n_noop(
356
+ 'Begin activating plugin',
357
+ 'Begin activating plugins',
358
+ 'acx_csma_licence_tgmpa'
359
+ ),
360
+ 'return' => __( 'Return to Required Plugins Installer', 'acx_csma_licence_tgmpa' ),
361
+ 'dashboard' => __( 'Return to the Dashboard', 'acx_csma_licence_tgmpa' ),
362
+ 'plugin_activated' => __( 'Plugin activated successfully.', 'acx_csma_licence_tgmpa' ),
363
+ 'activated_successfully' => __( 'The following plugin was activated successfully:', 'acx_csma_licence_tgmpa' ),
364
+ 'plugin_already_active' => __( 'No action taken. Plugin %1$s was already active.', 'acx_csma_licence_tgmpa' ),
365
+ 'plugin_needs_higher_version' => __( 'Plugin not activated. A higher version of %s is needed for this theme. Please update the plugin.', 'acx_csma_licence_tgmpa' ),
366
+ 'complete' => __( 'All plugins installed and activated successfully. %1$s', 'acx_csma_licence_tgmpa' ),
367
+ 'dismiss' => __( 'Dismiss this notice', 'acx_csma_licence_tgmpa' ),
368
+ 'notice_cannot_install_activate' => __( 'There are one or more required or recommended plugins to install, update or activate.', 'acx_csma_licence_tgmpa' ),
369
+ 'contact_admin' => __( 'Please contact the administrator of this site for help.', 'acx_csma_licence_tgmpa' ),
370
+ );
371
+
372
+ do_action( 'acx_csma_licence_tgmpa_register' );
373
+
374
+ /* After this point, the plugins should be registered and the configuration set. */
375
+
376
+ // Proceed only if we have plugins to handle.
377
+ if ( empty( $this->plugins ) || ! is_array( $this->plugins ) ) {
378
+ return;
379
+ }
380
+
381
+ // Set up the menu and notices if we still have outstanding actions.
382
+ if ( true !== $this->is_acx_csma_licence_tgmpa_complete() ) {
383
+ // Sort the plugins.
384
+ array_multisort( $this->sort_order, SORT_ASC, $this->plugins );
385
+
386
+ add_action( 'admin_menu', array( $this, 'admin_menu' ) );
387
+ add_action( 'admin_head', array( $this, 'dismiss' ) );
388
+
389
+ // Prevent the normal links from showing underneath a single install/update page.
390
+ add_filter( 'install_plugin_complete_actions', array( $this, 'actions' ) );
391
+ add_filter( 'update_plugin_complete_actions', array( $this, 'actions' ) );
392
+
393
+ if ( $this->has_notices ) {
394
+ add_action( 'admin_notices', array( $this, 'notices' ) );
395
+ add_action( 'admin_init', array( $this, 'admin_init' ), 1 );
396
+ add_action( 'admin_enqueue_scripts', array( $this, 'thickbox' ) );
397
+ }
398
+ }
399
+
400
+ // If needed, filter plugin action links.
401
+ add_action( 'load-plugins.php', array( $this, 'add_plugin_action_link_filters' ), 1 );
402
+
403
+ // Make sure things get reset on switch theme.
404
+ add_action( 'switch_theme', array( $this, 'flush_plugins_cache' ) );
405
+
406
+ if ( $this->has_notices ) {
407
+ add_action( 'switch_theme', array( $this, 'update_dismiss' ) );
408
+ }
409
+
410
+ // Setup the force activation hook.
411
+ if ( true === $this->has_forced_activation ) {
412
+ add_action( 'admin_init', array( $this, 'force_activation' ) );
413
+ }
414
+
415
+ // Setup the force deactivation hook.
416
+ if ( true === $this->has_forced_deactivation ) {
417
+ add_action( 'switch_theme', array( $this, 'force_deactivation' ) );
418
+ }
419
+ }
420
+
421
+ /**
422
+ * Load translations.
423
+ *
424
+ * @since 2.6.0
425
+ *
426
+ * (@internal Uses `load_theme_textdomain()` rather than `load_plugin_textdomain()` to
427
+ * get round the different ways of handling the path and deprecated notices being thrown
428
+ * and such. For plugins, the actual file name will be corrected by a filter.}}
429
+ *
430
+ * {@internal IMPORTANT! If this function changes, review the regex in the custom acx_csma_licence_tgmpa
431
+ * generator on the website.}}
432
+ */
433
+ public function load_textdomain() {
434
+ if ( is_textdomain_loaded( 'acx_csma_licence_tgmpa' ) ) {
435
+ return;
436
+ }
437
+
438
+ if ( false !== strpos( __FILE__, WP_PLUGIN_DIR ) || false !== strpos( __FILE__, WPMU_PLUGIN_DIR ) ) {
439
+ // Plugin, we'll need to adjust the file name.
440
+ add_action( 'load_textdomain_mofile', array( $this, 'correct_plugin_mofile' ), 10, 2 );
441
+ load_theme_textdomain( 'acx_csma_licence_tgmpa', dirname( __FILE__ ) . '/languages' );
442
+ remove_action( 'load_textdomain_mofile', array( $this, 'correct_plugin_mofile' ), 10 );
443
+ } else {
444
+ load_theme_textdomain( 'acx_csma_licence_tgmpa', dirname( __FILE__ ) . '/languages' );
445
+ }
446
+ }
447
+
448
+ /**
449
+ * Correct the .mo file name for (must-use) plugins.
450
+ *
451
+ * Themese use `/path/{locale}.mo` while plugins use `/path/{text-domain}-{locale}.mo`.
452
+ *
453
+ * {@internal IMPORTANT! If this function changes, review the regex in the custom ACX_CSMA_LICENCE_TGMPA
454
+ * generator on the website.}}
455
+ *
456
+ * @since 2.6.0
457
+ *
458
+ * @param string $mofile Full path to the target mofile.
459
+ * @param string $domain The domain for which a language file is being loaded.
460
+ * @return string $mofile
461
+ */
462
+ public function correct_plugin_mofile( $mofile, $domain ) {
463
+ // Exit early if not our domain (just in case).
464
+ if ( 'acx_csma_licence_tgmpa' !== $domain ) {
465
+ return $mofile;
466
+ }
467
+ return preg_replace( '`/([a-z]{2}_[A-Z]{2}.mo)$`', '/acx_csma_licence_tgmpa-$1', $mofile );
468
+ }
469
+
470
+ /**
471
+ * Potentially overload the fall-back translation file for the current language.
472
+ *
473
+ * WP, by default since WP 3.7, will load a local translation first and if none
474
+ * can be found, will try and find a translation in the /wp-content/languages/ directory.
475
+ * As this library is theme/plugin agnostic, translation files for ACX_CSMA_LICENCE_TGMPA can exist both
476
+ * in the WP_LANG_DIR /plugins/ subdirectory as well as in the /themes/ subdirectory.
477
+ *
478
+ * This method makes sure both directories are checked.
479
+ *
480
+ * {@internal IMPORTANT! If this function changes, review the regex in the custom ACX_CSMA_LICENCE_TGMPA
481
+ * generator on the website.}}
482
+ *
483
+ * @since 2.6.0
484
+ *
485
+ * @param string $mofile Full path to the target mofile.
486
+ * @param string $domain The domain for which a language file is being loaded.
487
+ * @return string $mofile
488
+ */
489
+ public function overload_textdomain_mofile( $mofile, $domain ) {
490
+ // Exit early if not our domain, not a WP_LANG_DIR load or if the file exists and is readable.
491
+ if ( 'acx_csma_licence_tgmpa' !== $domain || false === strpos( $mofile, WP_LANG_DIR ) || @is_readable( $mofile ) ) {
492
+ return $mofile;
493
+ }
494
+
495
+ // Current fallback file is not valid, let's try the alternative option.
496
+ if ( false !== strpos( $mofile, '/themes/' ) ) {
497
+ return str_replace( '/themes/', '/plugins/', $mofile );
498
+ } elseif ( false !== strpos( $mofile, '/plugins/' ) ) {
499
+ return str_replace( '/plugins/', '/themes/', $mofile );
500
+ } else {
501
+ return $mofile;
502
+ }
503
+ }
504
+
505
+ /**
506
+ * Hook in plugin action link filters for the WP native plugins page.
507
+ *
508
+ * - Prevent activation of plugins which don't meet the minimum version requirements.
509
+ * - Prevent deactivation of force-activated plugins.
510
+ * - Add update notice if update available.
511
+ *
512
+ * @since 2.5.0
513
+ */
514
+ public function add_plugin_action_link_filters() {
515
+ foreach ( $this->plugins as $slug => $plugin ) {
516
+ if ( false === $this->can_plugin_activate( $slug ) ) {
517
+ add_filter( 'plugin_action_links_' . $plugin['file_path'], array( $this, 'filter_plugin_action_links_activate' ), 20 );
518
+ }
519
+
520
+ if ( true === $plugin['force_activation'] ) {
521
+ add_filter( 'plugin_action_links_' . $plugin['file_path'], array( $this, 'filter_plugin_action_links_deactivate' ), 20 );
522
+ }
523
+
524
+ if ( false !== $this->does_plugin_require_update( $slug ) ) {
525
+ add_filter( 'plugin_action_links_' . $plugin['file_path'], array( $this, 'filter_plugin_action_links_update' ), 20 );
526
+ }
527
+ }
528
+ }
529
+
530
+ /**
531
+ * Remove the 'Activate' link on the WP native plugins page if the plugin does not meet the
532
+ * minimum version requirements.
533
+ *
534
+ * @since 2.5.0
535
+ *
536
+ * @param array $actions Action links.
537
+ * @return array
538
+ */
539
+ public function filter_plugin_action_links_activate( $actions ) {
540
+ unset( $actions['activate'] );
541
+
542
+ return $actions;
543
+ }
544
+
545
+ /**
546
+ * Remove the 'Deactivate' link on the WP native plugins page if the plugin has been set to force activate.
547
+ *
548
+ * @since 2.5.0
549
+ *
550
+ * @param array $actions Action links.
551
+ * @return array
552
+ */
553
+ public function filter_plugin_action_links_deactivate( $actions ) {
554
+ unset( $actions['deactivate'] );
555
+
556
+ return $actions;
557
+ }
558
+
559
+ /**
560
+ * Add a 'Requires update' link on the WP native plugins page if the plugin does not meet the
561
+ * minimum version requirements.
562
+ *
563
+ * @since 2.5.0
564
+ *
565
+ * @param array $actions Action links.
566
+ * @return array
567
+ */
568
+ public function filter_plugin_action_links_update( $actions ) {
569
+ $actions['update'] = sprintf(
570
+ '<a href="%1$s" title="%2$s" class="edit">%3$s</a>',
571
+ esc_url( $this->get_acx_csma_licence_tgmpa_status_url( 'update' ) ),
572
+ esc_attr__( 'This plugin needs to be updated to be compatible with your theme.', 'acx_csma_licence_tgmpa' ),
573
+ esc_html__( 'Update Required', 'acx_csma_licence_tgmpa' )
574
+ );
575
+
576
+ return $actions;
577
+ }
578
+
579
+ /**
580
+ * Handles calls to show plugin information via links in the notices.
581
+ *
582
+ * We get the links in the admin notices to point to the ACX_CSMA_LICENCE_TGMPA page, rather
583
+ * than the typical plugin-install.php file, so we can prepare everything
584
+ * beforehand.
585
+ *
586
+ * WP does not make it easy to show the plugin information in the thickbox -
587
+ * here we have to require a file that includes a function that does the
588
+ * main work of displaying it, enqueue some styles, set up some globals and
589
+ * finally call that function before exiting.
590
+ *
591
+ * Down right easy once you know how...
592
+ *
593
+ * Returns early if not the ACX_CSMA_LICENCE_TGMPA page.
594
+ *
595
+ * @since 2.1.0
596
+ *
597
+ * @global string $tab Used as iframe div class names, helps with styling
598
+ * @global string $body_id Used as the iframe body ID, helps with styling
599
+ *
600
+ * @return null Returns early if not the ACX_CSMA_LICENCE_TGMPA page.
601
+ */
602
+ public function admin_init() {
603
+ if ( ! $this->is_acx_csma_licence_tgmpa_page() ) {
604
+ return;
605
+ }
606
+
607
+ if ( isset( $_REQUEST['tab'] ) && 'plugin-information' === $_REQUEST['tab'] ) {
608
+ // Needed for install_plugin_information().
609
+ require_once ABSPATH . 'wp-admin/includes/plugin-install.php';
610
+
611
+ wp_enqueue_style( 'plugin-install' );
612
+
613
+ global $tab, $body_id;
614
+ $body_id = 'plugin-information';
615
+ // @codingStandardsIgnoreStart
616
+ $tab = 'plugin-information';
617
+ // @codingStandardsIgnoreEnd
618
+
619
+ install_plugin_information();
620
+
621
+ exit;
622
+ }
623
+ }
624
+
625
+ /**
626
+ * Enqueue thickbox scripts/styles for plugin info.
627
+ *
628
+ * Thickbox is not automatically included on all admin pages, so we must
629
+ * manually enqueue it for those pages.
630
+ *
631
+ * Thickbox is only loaded if the user has not dismissed the admin
632
+ * notice or if there are any plugins left to install and activate.
633
+ *
634
+ * @since 2.1.0
635
+ */
636
+ public function thickbox() {
637
+ if ( ! get_user_meta( get_current_user_id(), 'acx_csma_licence_tgmpa_dismissed_notice_' . $this->id, true ) ) {
638
+ add_thickbox();
639
+ }
640
+ }
641
+
642
+ /**
643
+ * Adds submenu page if there are plugin actions to take.
644
+ *
645
+ * This method adds the submenu page letting users know that a required
646
+ * plugin needs to be installed.
647
+ *
648
+ * This page disappears once the plugin has been installed and activated.
649
+ *
650
+ * @since 1.0.0
651
+ *
652
+ * @see ACX_CSMA_LICENCE_TGM_Plugin_Activation::init()
653
+ * @see ACX_CSMA_LICENCE_TGM_Plugin_Activation::install_plugins_page()
654
+ *
655
+ * @return null Return early if user lacks capability to install a plugin.
656
+ */
657
+ public function admin_menu() {
658
+ // Make sure privileges are correct to see the page.
659
+ if ( ! current_user_can( 'install_plugins' ) ) {
660
+ return;
661
+ }
662
+
663
+ $args = apply_filters(
664
+ 'acx_csma_licence_tgmpa_admin_menu_args',
665
+ array(
666
+ 'parent_slug' => $this->parent_slug, // Parent Menu slug.
667
+ 'page_title' => $this->strings['page_title'], // Page title.
668
+ 'menu_title' => $this->strings['menu_title'], // Menu title.
669
+ 'capability' => $this->capability, // Capability.
670
+ 'menu_slug' => $this->menu, // Menu slug.
671
+ 'function' => array( $this, 'install_plugins_page' ), // Callback.
672
+ )
673
+ );
674
+
675
+ $this->add_admin_menu( $args );
676
+ }
677
+
678
+ /**
679
+ * Add the menu item.
680
+ *
681
+ * {@internal IMPORTANT! If this function changes, review the regex in the custom ACX_CSMA_LICENCE_TGMPA
682
+ * generator on the website.}}
683
+ *
684
+ * @since 2.5.0
685
+ *
686
+ * @param array $args Menu item configuration.
687
+ */
688
+ protected function add_admin_menu( array $args ) {
689
+ if ( has_filter( 'acx_csma_licence_tgmpa_admin_menu_use_add_theme_page' ) ) {
690
+ _deprecated_function( 'The "acx_csma_licence_tgmpa_admin_menu_use_add_theme_page" filter', '2.5.0', esc_html__( 'Set the parent_slug config variable instead.', 'acx_csma_licence_tgmpa' ) );
691
+ }
692
+
693
+ if ( 'themes.php' === $this->parent_slug ) {
694
+ $this->page_hook = call_user_func( 'add_theme_page', $args['page_title'], $args['menu_title'], $args['capability'], $args['menu_slug'], $args['function'] );
695
+ } else {
696
+ $this->page_hook = call_user_func( 'add_submenu_page', $args['parent_slug'], $args['page_title'], $args['menu_title'], $args['capability'], $args['menu_slug'], $args['function'] );
697
+ }
698
+ }
699
+
700
+ /**
701
+ * Echoes plugin installation form.
702
+ *
703
+ * This method is the callback for the admin_menu method function.
704
+ * This displays the admin page and form area where the user can select to install and activate the plugin.
705
+ * Aborts early if we're processing a plugin installation action.
706
+ *
707
+ * @since 1.0.0
708
+ *
709
+ * @return null Aborts early if we're processing a plugin installation action.
710
+ */
711
+ public function install_plugins_page() {
712
+ // Store new instance of plugin table in object.
713
+ $plugin_table = new ACX_CSMA_LICENCE_TGMPA_List_Table;
714
+
715
+ // Return early if processing a plugin installation action.
716
+ if ( ( ( 'acx_csma_licence_tgmpa-bulk-install' === $plugin_table->current_action() || 'acx_csma_licence_tgmpa-bulk-update' === $plugin_table->current_action() ) && $plugin_table->process_bulk_actions() ) || $this->do_plugin_install() ) {
717
+ return;
718
+ }
719
+
720
+ // Force refresh of available plugin information so we'll know about manual updates/deletes.
721
+ wp_clean_plugins_cache( false );
722
+
723
+ ?>
724
+ <div class="acx_csma_licence_tgmpa wrap">
725
+ <h1><?php echo esc_html( get_admin_page_title() ); ?></h1>
726
+ <?php $plugin_table->prepare_items(); ?>
727
+
728
+ <?php
729
+ if ( ! empty( $this->message ) && is_string( $this->message ) ) {
730
+ echo wp_kses_post( $this->message );
731
+ }
732
+ ?>
733
+ <?php $plugin_table->views(); ?>
734
+
735
+ <form id="acx_csma_licence_tgmpa-plugins" action="" method="post">
736
+ <input type="hidden" name="acx_csma_licence_tgmpa-page" value="<?php echo esc_attr( $this->menu ); ?>" />
737
+ <input type="hidden" name="plugin_status" value="<?php echo esc_attr( $plugin_table->view_context ); ?>" />
738
+ <?php $plugin_table->display(); ?>
739
+ </form>
740
+ </div>
741
+ <?php
742
+ }
743
+
744
+ /**
745
+ * Installs, updates or activates a plugin depending on the action link clicked by the user.
746
+ *
747
+ * Checks the $_GET variable to see which actions have been
748
+ * passed and responds with the appropriate method.
749
+ *
750
+ * Uses WP_Filesystem to process and handle the plugin installation
751
+ * method.
752
+ *
753
+ * @since 1.0.0
754
+ *
755
+ * @uses WP_Filesystem
756
+ * @uses WP_Error
757
+ * @uses WP_Upgrader
758
+ * @uses Plugin_Upgrader
759
+ * @uses Plugin_Installer_Skin
760
+ * @uses Plugin_Upgrader_Skin
761
+ *
762
+ * @return boolean True on success, false on failure.
763
+ */
764
+ protected function do_plugin_install() {
765
+ if ( empty( $_GET['plugin'] ) ) {
766
+ return false;
767
+ }
768
+
769
+ // All plugin information will be stored in an array for processing.
770
+ $slug = $this->sanitize_key( urldecode( $_GET['plugin'] ) );
771
+
772
+ if ( ! isset( $this->plugins[ $slug ] ) ) {
773
+ return false;
774
+ }
775
+
776
+ // Was an install or upgrade action link clicked?
777
+ if ( ( isset( $_GET['acx_csma_licence_tgmpa-install'] ) && 'install-plugin' === $_GET['acx_csma_licence_tgmpa-install'] ) || ( isset( $_GET['acx_csma_licence_tgmpa-update'] ) && 'update-plugin' === $_GET['acx_csma_licence_tgmpa-update'] ) ) {
778
+
779
+ $install_type = 'install';
780
+ if ( isset( $_GET['acx_csma_licence_tgmpa-update'] ) && 'update-plugin' === $_GET['acx_csma_licence_tgmpa-update'] ) {
781
+ $install_type = 'update';
782
+ }
783
+
784
+ check_admin_referer( 'acx_csma_licence_tgmpa-' . $install_type, 'acx_csma_licence_tgmpa-nonce' );
785
+
786
+ // Pass necessary information via URL if WP_Filesystem is needed.
787
+ $url = wp_nonce_url(
788
+ add_query_arg(
789
+ array(
790
+ 'plugin' => urlencode( $slug ),
791
+ 'acx_csma_licence_tgmpa-' . $install_type => $install_type . '-plugin',
792
+ ),
793
+ $this->get_acx_csma_licence_tgmpa_url()
794
+ ),
795
+ 'acx_csma_licence_tgmpa-' . $install_type,
796
+ 'acx_csma_licence_tgmpa-nonce'
797
+ );
798
+
799
+ $method = ''; // Leave blank so WP_Filesystem can populate it as necessary.
800
+
801
+ if ( false === ( $creds = request_filesystem_credentials( esc_url_raw( $url ), $method, false, false, array() ) ) ) {
802
+ return true;
803
+ }
804
+
805
+ if ( ! WP_Filesystem( $creds ) ) {
806
+ request_filesystem_credentials( esc_url_raw( $url ), $method, true, false, array() ); // Setup WP_Filesystem.
807
+ return true;
808
+ }
809
+
810
+ /* If we arrive here, we have the filesystem. */
811
+
812
+ // Prep variables for Plugin_Installer_Skin class.
813
+ $extra = array();
814
+ $extra['slug'] = $slug; // Needed for potentially renaming of directory name.
815
+ $source = $this->get_download_url( $slug );
816
+ $api = ( 'repo' === $this->plugins[ $slug ]['source_type'] ) ? $this->get_plugins_api( $slug ) : null;
817
+ $api = ( false !== $api ) ? $api : null;
818
+
819
+ $url = add_query_arg(
820
+ array(
821
+ 'action' => $install_type . '-plugin',
822
+ 'plugin' => urlencode( $slug ),
823
+ ),
824
+ 'update.php'
825
+ );
826
+
827
+ if ( ! class_exists( 'Plugin_Upgrader', false ) ) {
828
+ require_once ABSPATH . 'wp-admin/includes/class-wp-upgrader.php';
829
+ }
830
+
831
+ $title = ( 'update' === $install_type ) ? $this->strings['updating'] : $this->strings['installing'];
832
+ $skin_args = array(
833
+ 'type' => ( 'bundled' !== $this->plugins[ $slug ]['source_type'] ) ? 'web' : 'upload',
834
+ 'title' => sprintf( $title, $this->plugins[ $slug ]['name'] ),
835
+ 'url' => esc_url_raw( $url ),
836
+ 'nonce' => $install_type . '-plugin_' . $slug,
837
+ 'plugin' => '',
838
+ 'api' => $api,
839
+ 'extra' => $extra,
840
+ );
841
+ unset( $title );
842
+
843
+ if ( 'update' === $install_type ) {
844
+ $skin_args['plugin'] = $this->plugins[ $slug ]['file_path'];
845
+ $skin = new Plugin_Upgrader_Skin( $skin_args );
846
+ } else {
847
+ $skin = new Plugin_Installer_Skin( $skin_args );
848
+ }
849
+
850
+ // Create a new instance of Plugin_Upgrader.
851
+ $upgrader = new Plugin_Upgrader( $skin );
852
+
853
+ // Perform the action and install the plugin from the $source urldecode().
854
+ add_filter( 'upgrader_source_selection', array( $this, 'maybe_adjust_source_dir' ), 1, 3 );
855
+
856
+ if ( 'update' === $install_type ) {
857
+ // Inject our info into the update transient.
858
+ $to_inject = array( $slug => $this->plugins[ $slug ] );
859
+ $to_inject[ $slug ]['source'] = $source;
860
+ $this->inject_update_info( $to_inject );
861
+
862
+ $upgrader->upgrade( $this->plugins[ $slug ]['file_path'] );
863
+ } else {
864
+ $upgrader->install( $source );
865
+ }
866
+
867
+ remove_filter( 'upgrader_source_selection', array( $this, 'maybe_adjust_source_dir' ), 1 );
868
+
869
+ // Make sure we have the correct file path now the plugin is installed/updated.
870
+ $this->populate_file_path( $slug );
871
+
872
+ // Only activate plugins if the config option is set to true and the plugin isn't
873
+ // already active (upgrade).
874
+ if ( $this->is_automatic && ! $this->is_plugin_active( $slug ) ) {
875
+ $plugin_activate = $upgrader->plugin_info(); // Grab the plugin info from the Plugin_Upgrader method.
876
+ if ( false === $this->activate_single_plugin( $plugin_activate, $slug, true ) ) {
877
+ return true; // Finish execution of the function early as we encountered an error.
878
+ }
879
+ }
880
+
881
+ $this->show_acx_csma_licence_tgmpa_version();
882
+
883
+ // Display message based on if all plugins are now active or not.
884
+ if ( $this->is_acx_csma_licence_tgmpa_complete() ) {
885
+ echo '<p>', sprintf( esc_html( $this->strings['complete'] ), '<a href="' . esc_url( self_admin_url() ) . '">' . esc_html__( 'Return to the Dashboard', 'acx_csma_licence_tgmpa' ) . '</a>' ), '</p>';
886
+ echo '<style type="text/css">#adminmenu .wp-submenu li.current { display: none !important; }</style>';
887
+ } else {
888
+ echo '<p><a href="', esc_url( $this->get_acx_csma_licence_tgmpa_url() ), '" target="_parent">', esc_html( $this->strings['return'] ), '</a></p>';
889
+ }
890
+
891
+ return true;
892
+ } elseif ( isset( $this->plugins[ $slug ]['file_path'], $_GET['acx_csma_licence_tgmpa-activate'] ) && 'activate-plugin' === $_GET['acx_csma_licence_tgmpa-activate'] ) {
893
+ // Activate action link was clicked.
894
+ check_admin_referer( 'acx_csma_licence_tgmpa-activate', 'acx_csma_licence_tgmpa-nonce' );
895
+
896
+ if ( false === $this->activate_single_plugin( $this->plugins[ $slug ]['file_path'], $slug ) ) {
897
+ return true; // Finish execution of the function early as we encountered an error.
898
+ }
899
+ }
900
+
901
+ return false;
902
+ }
903
+
904
+ /**
905
+ * Inject information into the 'update_plugins' site transient as WP checks that before running an update.
906
+ *
907
+ * @since 2.5.0
908
+ *
909
+ * @param array $plugins The plugin information for the plugins which are to be updated.
910
+ */
911
+ public function inject_update_info( $plugins ) {
912
+ $repo_updates = get_site_transient( 'update_plugins' );
913
+
914
+ if ( ! is_object( $repo_updates ) ) {
915
+ $repo_updates = new stdClass;
916
+ }
917
+
918
+ foreach ( $plugins as $slug => $plugin ) {
919
+ $file_path = $plugin['file_path'];
920
+
921
+ if ( empty( $repo_updates->response[ $file_path ] ) ) {
922
+ $repo_updates->response[ $file_path ] = new stdClass;
923
+ }
924
+
925
+ // We only really need to set package, but let's do all we can in case WP changes something.
926
+ $repo_updates->response[ $file_path ]->slug = $slug;
927
+ $repo_updates->response[ $file_path ]->plugin = $file_path;
928
+ $repo_updates->response[ $file_path ]->new_version = $plugin['version'];
929
+ $repo_updates->response[ $file_path ]->package = $plugin['source'];
930
+ if ( empty( $repo_updates->response[ $file_path ]->url ) && ! empty( $plugin['external_url'] ) ) {
931
+ $repo_updates->response[ $file_path ]->url = $plugin['external_url'];
932
+ }
933
+ }
934
+
935
+ set_site_transient( 'update_plugins', $repo_updates );
936
+ }
937
+
938
+ /**
939
+ * Adjust the plugin directory name if necessary.
940
+ *
941
+ * The final destination directory of a plugin is based on the subdirectory name found in the
942
+ * (un)zipped source. In some cases - most notably GitHub repository plugin downloads -, this
943
+ * subdirectory name is not the same as the expected slug and the plugin will not be recognized
944
+ * as installed. This is fixed by adjusting the temporary unzipped source subdirectory name to
945
+ * the expected plugin slug.
946
+ *
947
+ * @since 2.5.0
948
+ *
949
+ * @param string $source Path to upgrade/zip-file-name.tmp/subdirectory/.
950
+ * @param string $remote_source Path to upgrade/zip-file-name.tmp.
951
+ * @param \WP_Upgrader $upgrader Instance of the upgrader which installs the plugin.
952
+ * @return string $source
953
+ */
954
+ public function maybe_adjust_source_dir( $source, $remote_source, $upgrader ) {
955
+ if ( ! $this->is_acx_csma_licence_tgmpa_page() || ! is_object( $GLOBALS['wp_filesystem'] ) ) {
956
+ return $source;
957
+ }
958
+
959
+ // Check for single file plugins.
960
+ $source_files = array_keys( $GLOBALS['wp_filesystem']->dirlist( $remote_source ) );
961
+ if ( 1 === count( $source_files ) && false === $GLOBALS['wp_filesystem']->is_dir( $source ) ) {
962
+ return $source;
963
+ }
964
+
965
+ // Multi-file plugin, let's see if the directory is correctly named.
966
+ $desired_slug = '';
967
+
968
+ // Figure out what the slug is supposed to be.
969
+ if ( false === $upgrader->bulk && ! empty( $upgrader->skin->options['extra']['slug'] ) ) {
970
+ $desired_slug = $upgrader->skin->options['extra']['slug'];
971
+ } else {
972
+ // Bulk installer contains less info, so fall back on the info registered here.
973
+ foreach ( $this->plugins as $slug => $plugin ) {
974
+ if ( ! empty( $upgrader->skin->plugin_names[ $upgrader->skin->i ] ) && $plugin['name'] === $upgrader->skin->plugin_names[ $upgrader->skin->i ] ) {
975
+ $desired_slug = $slug;
976
+ break;
977
+ }
978
+ }
979
+ unset( $slug, $plugin );
980
+ }
981
+
982
+ if ( ! empty( $desired_slug ) ) {
983
+ $subdir_name = untrailingslashit( str_replace( trailingslashit( $remote_source ), '', $source ) );
984
+
985
+ if ( ! empty( $subdir_name ) && $subdir_name !== $desired_slug ) {
986
+ $from_path = untrailingslashit( $source );
987
+ $to_path = trailingslashit( $remote_source ) . $desired_slug;
988
+
989
+ if ( true === $GLOBALS['wp_filesystem']->move( $from_path, $to_path ) ) {
990
+ return trailingslashit( $to_path );
991
+ } else {
992
+ return new WP_Error( 'rename_failed', esc_html__( 'The remote plugin package does not contain a folder with the desired slug and renaming did not work.', 'acx_csma_licence_tgmpa' ) . ' ' . esc_html__( 'Please contact the plugin provider and ask them to package their plugin according to the WordPress guidelines.', 'acx_csma_licence_tgmpa' ), array( 'found' => $subdir_name, 'expected' => $desired_slug ) );
993
+ }
994
+ } elseif ( empty( $subdir_name ) ) {
995
+ return new WP_Error( 'packaged_wrong', esc_html__( 'The remote plugin package consists of more than one file, but the files are not packaged in a folder.', 'acx_csma_licence_tgmpa' ) . ' ' . esc_html__( 'Please contact the plugin provider and ask them to package their plugin according to the WordPress guidelines.', 'acx_csma_licence_tgmpa' ), array( 'found' => $subdir_name, 'expected' => $desired_slug ) );
996
+ }
997
+ }
998
+
999
+ return $source;
1000
+ }
1001
+
1002
+ /**
1003
+ * Activate a single plugin and send feedback about the result to the screen.
1004
+ *
1005
+ * @since 2.5.0
1006
+ *
1007
+ * @param string $file_path Path within wp-plugins/ to main plugin file.
1008
+ * @param string $slug Plugin slug.
1009
+ * @param bool $automatic Whether this is an automatic activation after an install. Defaults to false.
1010
+ * This determines the styling of the output messages.
1011
+ * @return bool False if an error was encountered, true otherwise.
1012
+ */
1013
+ protected function activate_single_plugin( $file_path, $slug, $automatic = false ) {
1014
+ if ( $this->can_plugin_activate( $slug ) ) {
1015
+ $activate = activate_plugin( $file_path );
1016
+
1017
+ if ( is_wp_error( $activate ) ) {
1018
+ echo '<div id="message" class="error"><p>', wp_kses_post( $activate->get_error_message() ), '</p></div>',
1019
+ '<p><a href="', esc_url( $this->get_acx_csma_licence_tgmpa_url() ), '" target="_parent">', esc_html( $this->strings['return'] ), '</a></p>';
1020
+
1021
+ return false; // End it here if there is an error with activation.
1022
+ } else {
1023
+ if ( ! $automatic ) {
1024
+ // Make sure message doesn't display again if bulk activation is performed
1025
+ // immediately after a single activation.
1026
+ if ( ! isset( $_POST['action'] ) ) { // WPCS: CSRF OK.
1027
+ echo '<div id="message" class="updated"><p>', esc_html( $this->strings['activated_successfully'] ), ' <strong>', esc_html( $this->plugins[ $slug ]['name'] ), '.</strong></p></div>';
1028
+ }
1029
+ } else {
1030
+ // Simpler message layout for use on the plugin install page.
1031
+ echo '<p>', esc_html( $this->strings['plugin_activated'] ), '</p>';
1032
+ }
1033
+ }
1034
+ } elseif ( $this->is_plugin_active( $slug ) ) {
1035
+ // No simpler message format provided as this message should never be encountered
1036
+ // on the plugin install page.
1037
+ echo '<div id="message" class="error"><p>',
1038
+ sprintf(
1039
+ esc_html( $this->strings['plugin_already_active'] ),
1040
+ '<strong>' . esc_html( $this->plugins[ $slug ]['name'] ) . '</strong>'
1041
+ ),
1042
+ '</p></div>';
1043
+ } elseif ( $this->does_plugin_require_update( $slug ) ) {
1044
+ if ( ! $automatic ) {
1045
+ // Make sure message doesn't display again if bulk activation is performed
1046
+ // immediately after a single activation.
1047
+ if ( ! isset( $_POST['action'] ) ) { // WPCS: CSRF OK.
1048
+ echo '<div id="message" class="error"><p>',
1049
+ sprintf(
1050
+ esc_html( $this->strings['plugin_needs_higher_version'] ),
1051
+ '<strong>' . esc_html( $this->plugins[ $slug ]['name'] ) . '</strong>'
1052
+ ),
1053
+ '</p></div>';
1054
+ }
1055
+ } else {
1056
+ // Simpler message layout for use on the plugin install page.
1057
+ echo '<p>', sprintf( esc_html( $this->strings['plugin_needs_higher_version'] ), esc_html( $this->plugins[ $slug ]['name'] ) ), '</p>';
1058
+ }
1059
+ }
1060
+
1061
+ return true;
1062
+ }
1063
+
1064
+ /**
1065
+ * Echoes required plugin notice.
1066
+ *
1067
+ * Outputs a message telling users that a specific plugin is required for
1068
+ * their theme. If appropriate, it includes a link to the form page where
1069
+ * users can install and activate the plugin.
1070
+ *
1071
+ * Returns early if we're on the Install page.
1072
+ *
1073
+ * @since 1.0.0
1074
+ *
1075
+ * @global object $current_screen
1076
+ *
1077
+ * @return null Returns early if we're on the Install page.
1078
+ */
1079
+ public function notices() {
1080
+ // Remove nag on the install page / Return early if the nag message has been dismissed or user < author.
1081
+ if ( ( $this->is_acx_csma_licence_tgmpa_page() || $this->is_core_update_page() ) || get_user_meta( get_current_user_id(), 'ACX_CSMA_LICENCE_TGMPA_dismissed_notice_' . $this->id, true ) || ! current_user_can( apply_filters( 'ACX_CSMA_LICENCE_TGMPA_show_admin_notice_capability', 'publish_posts' ) ) ) {
1082
+ return;
1083
+ }
1084
+
1085
+ // Store for the plugin slugs by message type.
1086
+ $message = array();
1087
+
1088
+ // Initialize counters used to determine plurality of action link texts.
1089
+ $install_link_count = 0;
1090
+ $update_link_count = 0;
1091
+ $activate_link_count = 0;
1092
+ $total_required_action_count = 0;
1093
+
1094
+ foreach ( $this->plugins as $slug => $plugin ) {
1095
+ if ( $this->is_plugin_active( $slug ) && false === $this->does_plugin_have_update( $slug ) ) {
1096
+ continue;
1097
+ }
1098
+
1099
+ if ( ! $this->is_plugin_installed( $slug ) ) {
1100
+ if ( current_user_can( 'install_plugins' ) ) {
1101
+ $install_link_count++;
1102
+
1103
+ if ( true === $plugin['required'] ) {
1104
+ $message['notice_can_install_required'][] = $slug;
1105
+ } else {
1106
+ $message['notice_can_install_recommended'][] = $slug;
1107
+ }
1108
+ }
1109
+ if ( true === $plugin['required'] ) {
1110
+ $total_required_action_count++;
1111
+ }
1112
+ } else {
1113
+ if ( ! $this->is_plugin_active( $slug ) && $this->can_plugin_activate( $slug ) ) {
1114
+ if ( current_user_can( 'activate_plugins' ) ) {
1115
+ $activate_link_count++;
1116
+
1117
+ if ( true === $plugin['required'] ) {
1118
+ $message['notice_can_activate_required'][] = $slug;
1119
+ } else {
1120
+ $message['notice_can_activate_recommended'][] = $slug;
1121
+ }
1122
+ }
1123
+ if ( true === $plugin['required'] ) {
1124
+ $total_required_action_count++;
1125
+ }
1126
+ }
1127
+
1128
+ if ( $this->does_plugin_require_update( $slug ) || false !== $this->does_plugin_have_update( $slug ) ) {
1129
+
1130
+ if ( current_user_can( 'update_plugins' ) ) {
1131
+ $update_link_count++;
1132
+
1133
+ if ( $this->does_plugin_require_update( $slug ) ) {
1134
+ $message['notice_ask_to_update'][] = $slug;
1135
+ } elseif ( false !== $this->does_plugin_have_update( $slug ) ) {
1136
+ $message['notice_ask_to_update_maybe'][] = $slug;
1137
+ }
1138
+ }
1139
+ if ( true === $plugin['required'] ) {
1140
+ $total_required_action_count++;
1141
+ }
1142
+ }
1143
+ }
1144
+ }
1145
+ unset( $slug, $plugin );
1146
+
1147
+ // If we have notices to display, we move forward.
1148
+ if ( ! empty( $message ) || $total_required_action_count > 0 ) {
1149
+ krsort( $message ); // Sort messages.
1150
+ $rendered = '';
1151
+
1152
+ // As add_settings_error() wraps the final message in a <p> and as the final message can't be
1153
+ // filtered, using <p>'s in our html would render invalid html output.
1154
+ $line_template = '<span style="display: block; margin: 0.5em 0.5em 0 0; clear: both;">%s</span>' . "\n";
1155
+
1156
+ if ( ! current_user_can( 'activate_plugins' ) && ! current_user_can( 'install_plugins' ) && ! current_user_can( 'update_plugins' ) ) {
1157
+ $rendered = esc_html( $this->strings['notice_cannot_install_activate'] ) . ' ' . esc_html( $this->strings['contact_admin'] );
1158
+ $rendered .= $this->create_user_action_links_for_notice( 0, 0, 0, $line_template );
1159
+ } else {
1160
+
1161
+ // If dismissable is false and a message is set, output it now.
1162
+ if ( ! $this->dismissable && ! empty( $this->dismiss_msg ) ) {
1163
+ $rendered .= sprintf( $line_template, wp_kses_post( $this->dismiss_msg ) );
1164
+ }
1165
+
1166
+ // Render the individual message lines for the notice.
1167
+ foreach ( $message as $type => $plugin_group ) {
1168
+ $linked_plugins = array();
1169
+
1170
+ // Get the external info link for a plugin if one is available.
1171
+ foreach ( $plugin_group as $plugin_slug ) {
1172
+ $linked_plugins[] = $this->get_info_link( $plugin_slug );
1173
+ }
1174
+ unset( $plugin_slug );
1175
+
1176
+ $count = count( $plugin_group );
1177
+ $linked_plugins = array_map( array( 'ACX_CSMA_LICENCE_TGMPA_Utils', 'wrap_in_em' ), $linked_plugins );
1178
+ $last_plugin = array_pop( $linked_plugins ); // Pop off last name to prep for readability.
1179
+ $imploded = empty( $linked_plugins ) ? $last_plugin : ( implode( ', ', $linked_plugins ) . ' ' . esc_html_x( 'and', 'plugin A *and* plugin B', 'acx_csma_licence_tgmpa' ) . ' ' . $last_plugin );
1180
+
1181
+ $rendered .= sprintf(
1182
+ $line_template,
1183
+ sprintf(
1184
+ translate_nooped_plural( $this->strings[ $type ], $count, 'acx_csma_licence_tgmpa' ),
1185
+ $imploded,
1186
+ $count
1187
+ )
1188
+ );
1189
+
1190
+ }
1191
+ unset( $type, $plugin_group, $linked_plugins, $count, $last_plugin, $imploded );
1192
+
1193
+ $rendered .= $this->create_user_action_links_for_notice( $install_link_count, $update_link_count, $activate_link_count, $line_template );
1194
+ }
1195
+
1196
+ // Register the nag messages and prepare them to be processed.
1197
+ add_settings_error( 'acx_csma_licence_tgmpa', 'acx_csma_licence_tgmpa', $rendered, $this->get_admin_notice_class() );
1198
+ }
1199
+
1200
+ // Admin options pages already output settings_errors, so this is to avoid duplication.
1201
+ if ( 'options-general' !== $GLOBALS['current_screen']->parent_base ) {
1202
+ $this->display_settings_errors();
1203
+ }
1204
+ }
1205
+
1206
+ /**
1207
+ * Generate the user action links for the admin notice.
1208
+ *
1209
+ * @since 2.6.0
1210
+ *
1211
+ * @param int $install_count Number of plugins to install.
1212
+ * @param int $update_count Number of plugins to update.
1213
+ * @param int $activate_count Number of plugins to activate.
1214
+ * @param int $line_template Template for the HTML tag to output a line.
1215
+ * @return string Action links.
1216
+ */
1217
+ protected function create_user_action_links_for_notice( $install_count, $update_count, $activate_count, $line_template ) {
1218
+ // Setup action links.
1219
+ $action_links = array(
1220
+ 'install' => '',
1221
+ 'update' => '',
1222
+ 'activate' => '',
1223
+ 'dismiss' => $this->dismissable ? '<a href="' . esc_url( wp_nonce_url( add_query_arg( 'acx_csma_licence_tgmpa-dismiss', 'dismiss_admin_notices' ), 'acx_csma_licence_tgmpa-dismiss-' . get_current_user_id() ) ) . '" class="dismiss-notice" target="_parent">' . esc_html( $this->strings['dismiss'] ) . '</a>' : '',
1224
+ );
1225
+
1226
+ $link_template = '<a href="%2$s">%1$s</a>';
1227
+
1228
+ if ( current_user_can( 'install_plugins' ) ) {
1229
+ if ( $install_count > 0 ) {
1230
+ $action_links['install'] = sprintf(
1231
+ $link_template,
1232
+ translate_nooped_plural( $this->strings['install_link'], $install_count, 'acx_csma_licence_tgmpa' ),
1233
+ esc_url( $this->get_acx_csma_licence_tgmpa_status_url( 'install' ) )
1234
+ );
1235
+ }
1236
+ if ( $update_count > 0 ) {
1237
+ $action_links['update'] = sprintf(
1238
+ $link_template,
1239
+ translate_nooped_plural( $this->strings['update_link'], $update_count, 'acx_csma_licence_tgmpa' ),
1240
+ esc_url( $this->get_acx_csma_licence_tgmpa_status_url( 'update' ) )
1241
+ );
1242
+ }
1243
+ }
1244
+
1245
+ if ( current_user_can( 'activate_plugins' ) && $activate_count > 0 ) {
1246
+ $action_links['activate'] = sprintf(
1247
+ $link_template,
1248
+ translate_nooped_plural( $this->strings['activate_link'], $activate_count, 'acx_csma_licence_tgmpa' ),
1249
+ esc_url( $this->get_acx_csma_licence_tgmpa_status_url( 'activate' ) )
1250
+ );
1251
+ }
1252
+
1253
+ $action_links = apply_filters( 'acx_csma_licence_tgmpa_notice_action_links', $action_links );
1254
+
1255
+ $action_links = array_filter( (array) $action_links ); // Remove any empty array items.
1256
+
1257
+ if ( ! empty( $action_links ) ) {
1258
+ $action_links = sprintf( $line_template, implode( ' | ', $action_links ) );
1259
+ return apply_filters( 'acx_csma_licence_tgmpa_notice_rendered_action_links', $action_links );
1260
+ } else {
1261
+ return '';
1262
+ }
1263
+ }
1264
+
1265
+ /**
1266
+ * Get admin notice class.
1267
+ *
1268
+ * Work around all the changes to the various admin notice classes between WP 4.4 and 3.7
1269
+ * (lowest supported version by ACX_CSMA_LICENCE_TGMPA).
1270
+ *
1271
+ * @since 2.6.0
1272
+ *
1273
+ * @return string
1274
+ */
1275
+ protected function get_admin_notice_class() {
1276
+ if ( ! empty( $this->strings['nag_type'] ) ) {
1277
+ return sanitize_html_class( strtolower( $this->strings['nag_type'] ) );
1278
+ } else {
1279
+ if ( version_compare( $this->wp_version, '4.2', '>=' ) ) {
1280
+ return 'notice-warning';
1281
+ } elseif ( version_compare( $this->wp_version, '4.1', '>=' ) ) {
1282
+ return 'notice';
1283
+ } else {
1284
+ return 'updated';
1285
+ }
1286
+ }
1287
+ }
1288
+
1289
+ /**
1290
+ * Display settings errors and remove those which have been displayed to avoid duplicate messages showing
1291
+ *
1292
+ * @since 2.5.0
1293
+ */
1294
+ protected function display_settings_errors() {
1295
+ global $wp_settings_errors;
1296
+
1297
+ settings_errors( 'acx_csma_licence_tgmpa' );
1298
+
1299
+ foreach ( (array) $wp_settings_errors as $key => $details ) {
1300
+ if ( 'acx_csma_licence_tgmpa' === $details['setting'] ) {
1301
+ unset( $wp_settings_errors[ $key ] );
1302
+ break;
1303
+ }
1304
+ }
1305
+ }
1306
+
1307
+ /**
1308
+ * Register dismissal of admin notices.
1309
+ *
1310
+ * Acts on the dismiss link in the admin nag messages.
1311
+ * If clicked, the admin notice disappears and will no longer be visible to this user.
1312
+ *
1313
+ * @since 2.1.0
1314
+ */
1315
+ public function dismiss() {
1316
+ if ( isset( $_GET['acx_csma_licence_tgmpa-dismiss'] ) && check_admin_referer( 'acx_csma_licence_tgmpa-dismiss-' . get_current_user_id() ) ) {
1317
+ update_user_meta( get_current_user_id(), 'acx_csma_licence_tgmpa_dismissed_notice_' . $this->id, 1 );
1318
+ }
1319
+ }
1320
+
1321
+ /**
1322
+ * Add individual plugin to our collection of plugins.
1323
+ *
1324
+ * If the required keys are not set or the plugin has already
1325
+ * been registered, the plugin is not added.
1326
+ *
1327
+ * @since 2.0.0
1328
+ *
1329
+ * @param array|null $plugin Array of plugin arguments or null if invalid argument.
1330
+ * @return null Return early if incorrect argument.
1331
+ */
1332
+ public function register( $plugin ) {
1333
+ if ( empty( $plugin['slug'] ) || empty( $plugin['name'] ) ) {
1334
+ return;
1335
+ }
1336
+
1337
+ if ( empty( $plugin['slug'] ) || ! is_string( $plugin['slug'] ) || isset( $this->plugins[ $plugin['slug'] ] ) ) {
1338
+ return;
1339
+ }
1340
+
1341
+ $defaults = array(
1342
+ 'name' => '', // String
1343
+ 'slug' => '', // String
1344
+ 'source' => 'repo', // String
1345
+ 'required' => false, // Boolean
1346
+ 'version' => '', // String
1347
+ 'force_activation' => false, // Boolean
1348
+ 'force_deactivation' => false, // Boolean
1349
+ 'external_url' => '', // String
1350
+ 'is_callable' => '', // String|Array.
1351
+ );
1352
+
1353
+ // Prepare the received data.
1354
+ $plugin = wp_parse_args( $plugin, $defaults );
1355
+
1356
+ // Standardize the received slug.
1357
+ $plugin['slug'] = $this->sanitize_key( $plugin['slug'] );
1358
+
1359
+ // Forgive users for using string versions of booleans or floats for version number.
1360
+ $plugin['version'] = (string) $plugin['version'];
1361
+ $plugin['source'] = empty( $plugin['source'] ) ? 'repo' : $plugin['source'];
1362
+ $plugin['required'] = ACX_CSMA_LICENCE_TGMPA_Utils::validate_bool( $plugin['required'] );
1363
+ $plugin['force_activation'] = ACX_CSMA_LICENCE_TGMPA_Utils::validate_bool( $plugin['force_activation'] );
1364
+ $plugin['force_deactivation'] = ACX_CSMA_LICENCE_TGMPA_Utils::validate_bool( $plugin['force_deactivation'] );
1365
+
1366
+ // Enrich the received data.
1367
+ $plugin['file_path'] = $this->_get_plugin_basename_from_slug( $plugin['slug'] );
1368
+ $plugin['source_type'] = $this->get_plugin_source_type( $plugin['source'] );
1369
+
1370
+ // Set the class properties.
1371
+ $this->plugins[ $plugin['slug'] ] = $plugin;
1372
+ $this->sort_order[ $plugin['slug'] ] = $plugin['name'];
1373
+
1374
+ // Should we add the force activation hook ?
1375
+ if ( true === $plugin['force_activation'] ) {
1376
+ $this->has_forced_activation = true;
1377
+ }
1378
+
1379
+ // Should we add the force deactivation hook ?
1380
+ if ( true === $plugin['force_deactivation'] ) {
1381
+ $this->has_forced_deactivation = true;
1382
+ }
1383
+ }
1384
+
1385
+ /**
1386
+ * Determine what type of source the plugin comes from.
1387
+ *
1388
+ * @since 2.5.0
1389
+ *
1390
+ * @param string $source The source of the plugin as provided, either empty (= WP repo), a file path
1391
+ * (= bundled) or an external URL.
1392
+ * @return string 'repo', 'external', or 'bundled'
1393
+ */
1394
+ protected function get_plugin_source_type( $source ) {
1395
+ if ( 'repo' === $source || preg_match( self::WP_REPO_REGEX, $source ) ) {
1396
+ return 'repo';
1397
+ } elseif ( preg_match( self::IS_URL_REGEX, $source ) ) {
1398
+ return 'external';
1399
+ } else {
1400
+ return 'bundled';
1401
+ }
1402
+ }
1403
+
1404
+ /**
1405
+ * Sanitizes a string key.
1406
+ *
1407
+ * Near duplicate of WP Core `sanitize_key()`. The difference is that uppercase characters *are*
1408
+ * allowed, so as not to break upgrade paths from non-standard bundled plugins using uppercase
1409
+ * characters in the plugin directory path/slug. Silly them.
1410
+ *
1411
+ * @see https://developer.wordpress.org/reference/hooks/sanitize_key/
1412
+ *
1413
+ * @since 2.5.0
1414
+ *
1415
+ * @param string $key String key.
1416
+ * @return string Sanitized key
1417
+ */
1418
+ public function sanitize_key( $key ) {
1419
+ $raw_key = $key;
1420
+ $key = preg_replace( '`[^A-Za-z0-9_-]`', '', $key );
1421
+
1422
+ /**
1423
+ * Filter a sanitized key string.
1424
+ *
1425
+ * @since 2.5.0
1426
+ *
1427
+ * @param string $key Sanitized key.
1428
+ * @param string $raw_key The key prior to sanitization.
1429
+ */
1430
+ return apply_filters( 'acx_csma_licence_tgmpa_sanitize_key', $key, $raw_key );
1431
+ }
1432
+
1433
+ /**
1434
+ * Amend default configuration settings.
1435
+ *
1436
+ * @since 2.0.0
1437
+ *
1438
+ * @param array $config Array of config options to pass as class properties.
1439
+ */
1440
+ public function config( $config ) {
1441
+ $keys = array(
1442
+ 'id',
1443
+ 'default_path',
1444
+ 'has_notices',
1445
+ 'dismissable',
1446
+ 'dismiss_msg',
1447
+ 'menu',
1448
+ 'parent_slug',
1449
+ 'capability',
1450
+ 'is_automatic',
1451
+ 'message',
1452
+ 'strings',
1453
+ );
1454
+
1455
+ foreach ( $keys as $key ) {
1456
+ if ( isset( $config[ $key ] ) ) {
1457
+ if ( is_array( $config[ $key ] ) ) {
1458
+ $this->$key = array_merge( $this->$key, $config[ $key ] );
1459
+ } else {
1460
+ $this->$key = $config[ $key ];
1461
+ }
1462
+ }
1463
+ }
1464
+ }
1465
+
1466
+ /**
1467
+ * Amend action link after plugin installation.
1468
+ *
1469
+ * @since 2.0.0
1470
+ *
1471
+ * @param array $install_actions Existing array of actions.
1472
+ * @return false|array Amended array of actions.
1473
+ */
1474
+ public function actions( $install_actions ) {
1475
+ // Remove action links on the ACX_CSMA_LICENCE_TGMPA install page.
1476
+ if ( $this->is_acx_csma_licence_tgmpa_page() ) {
1477
+ return false;
1478
+ }
1479
+
1480
+ return $install_actions;
1481
+ }
1482
+
1483
+ /**
1484
+ * Flushes the plugins cache on theme switch to prevent stale entries
1485
+ * from remaining in the plugin table.
1486
+ *
1487
+ * @since 2.4.0
1488
+ *
1489
+ * @param bool $clear_update_cache Optional. Whether to clear the Plugin updates cache.
1490
+ * Parameter added in v2.5.0.
1491
+ */
1492
+ public function flush_plugins_cache( $clear_update_cache = true ) {
1493
+ wp_clean_plugins_cache( $clear_update_cache );
1494
+ }
1495
+
1496
+ /**
1497
+ * Set file_path key for each installed plugin.
1498
+ *
1499
+ * @since 2.1.0
1500
+ *
1501
+ * @param string $plugin_slug Optional. If set, only (re-)populates the file path for that specific plugin.
1502
+ * Parameter added in v2.5.0.
1503
+ */
1504
+ public function populate_file_path( $plugin_slug = '' ) {
1505
+ if ( ! empty( $plugin_slug ) && is_string( $plugin_slug ) && isset( $this->plugins[ $plugin_slug ] ) ) {
1506
+ $this->plugins[ $plugin_slug ]['file_path'] = $this->_get_plugin_basename_from_slug( $plugin_slug );
1507
+ } else {
1508
+ // Add file_path key for all plugins.
1509
+ foreach ( $this->plugins as $slug => $values ) {
1510
+ $this->plugins[ $slug ]['file_path'] = $this->_get_plugin_basename_from_slug( $slug );
1511
+ }
1512
+ }
1513
+ }
1514
+
1515
+ /**
1516
+ * Helper function to extract the file path of the plugin file from the
1517
+ * plugin slug, if the plugin is installed.
1518
+ *
1519
+ * @since 2.0.0
1520
+ *
1521
+ * @param string $slug Plugin slug (typically folder name) as provided by the developer.
1522
+ * @return string Either file path for plugin if installed, or just the plugin slug.
1523
+ */
1524
+ protected function _get_plugin_basename_from_slug( $slug ) {
1525
+ $keys = array_keys( $this->get_plugins() );
1526
+
1527
+ foreach ( $keys as $key ) {
1528
+ if ( preg_match( '|^' . $slug . '/|', $key ) ) {
1529
+ return $key;
1530
+ }
1531
+ }
1532
+
1533
+ return $slug;
1534
+ }
1535
+
1536
+ /**
1537
+ * Retrieve plugin data, given the plugin name.
1538
+ *
1539
+ * Loops through the registered plugins looking for $name. If it finds it,
1540
+ * it returns the $data from that plugin. Otherwise, returns false.
1541
+ *
1542
+ * @since 2.1.0
1543
+ *
1544
+ * @param string $name Name of the plugin, as it was registered.
1545
+ * @param string $data Optional. Array key of plugin data to return. Default is slug.
1546
+ * @return string|boolean Plugin slug if found, false otherwise.
1547
+ */
1548
+ public function _get_plugin_data_from_name( $name, $data = 'slug' ) {
1549
+ foreach ( $this->plugins as $values ) {
1550
+ if ( $name === $values['name'] && isset( $values[ $data ] ) ) {
1551
+ return $values[ $data ];
1552
+ }
1553
+ }
1554
+
1555
+ return false;
1556
+ }
1557
+
1558
+ /**
1559
+ * Retrieve the download URL for a package.
1560
+ *
1561
+ * @since 2.5.0
1562
+ *
1563
+ * @param string $slug Plugin slug.
1564
+ * @return string Plugin download URL or path to local file or empty string if undetermined.
1565
+ */
1566
+ public function get_download_url( $slug ) {
1567
+ $dl_source = '';
1568
+
1569
+ switch ( $this->plugins[ $slug ]['source_type'] ) {
1570
+ case 'repo':
1571
+ return $this->get_wp_repo_download_url( $slug );
1572
+ case 'external':
1573
+ return $this->plugins[ $slug ]['source'];
1574
+ case 'bundled':
1575
+ return $this->default_path . $this->plugins[ $slug ]['source'];
1576
+ }
1577
+
1578
+ return $dl_source; // Should never happen.
1579
+ }
1580
+
1581
+ /**
1582
+ * Retrieve the download URL for a WP repo package.
1583
+ *
1584
+ * @since 2.5.0
1585
+ *
1586
+ * @param string $slug Plugin slug.
1587
+ * @return string Plugin download URL.
1588
+ */
1589
+ protected function get_wp_repo_download_url( $slug ) {
1590
+ $source = '';
1591
+ $api = $this->get_plugins_api( $slug );
1592
+
1593
+ if ( false !== $api && isset( $api->download_link ) ) {
1594
+ $source = $api->download_link;
1595
+ }
1596
+
1597
+ return $source;
1598
+ }
1599
+
1600
+ /**
1601
+ * Try to grab information from WordPress API.
1602
+ *
1603
+ * @since 2.5.0
1604
+ *
1605
+ * @param string $slug Plugin slug.
1606
+ * @return object Plugins_api response object on success, WP_Error on failure.
1607
+ */
1608
+ protected function get_plugins_api( $slug ) {
1609
+ static $api = array(); // Cache received responses.
1610
+
1611
+ if ( ! isset( $api[ $slug ] ) ) {
1612
+ if ( ! function_exists( 'plugins_api' ) ) {
1613
+ require_once ABSPATH . 'wp-admin/includes/plugin-install.php';
1614
+ }
1615
+
1616
+ $response = plugins_api( 'plugin_information', array( 'slug' => $slug, 'fields' => array( 'sections' => false ) ) );
1617
+
1618
+ $api[ $slug ] = false;
1619
+
1620
+ if ( is_wp_error( $response ) ) {
1621
+ wp_die( esc_html( $this->strings['oops'] ) );
1622
+ } else {
1623
+ $api[ $slug ] = $response;
1624
+ }
1625
+ }
1626
+
1627
+ return $api[ $slug ];
1628
+ }
1629
+
1630
+ /**
1631
+ * Retrieve a link to a plugin information page.
1632
+ *
1633
+ * @since 2.5.0
1634
+ *
1635
+ * @param string $slug Plugin slug.
1636
+ * @return string Fully formed html link to a plugin information page if available
1637
+ * or the plugin name if not.
1638
+ */
1639
+ public function get_info_link( $slug ) {
1640
+ if ( ! empty( $this->plugins[ $slug ]['external_url'] ) && preg_match( self::IS_URL_REGEX, $this->plugins[ $slug ]['external_url'] ) ) {
1641
+ $link = sprintf(
1642
+ '<a href="%1$s" target="_blank">%2$s</a>',
1643
+ esc_url( $this->plugins[ $slug ]['external_url'] ),
1644
+ esc_html( $this->plugins[ $slug ]['name'] )
1645
+ );
1646
+ } elseif ( 'repo' === $this->plugins[ $slug ]['source_type'] ) {
1647
+ $url = add_query_arg(
1648
+ array(
1649
+ 'tab' => 'plugin-information',
1650
+ 'plugin' => urlencode( $slug ),
1651
+ 'TB_iframe' => 'true',
1652
+ 'width' => '640',
1653
+ 'height' => '500',
1654
+ ),
1655
+ self_admin_url( 'plugin-install.php' )
1656
+ );
1657
+
1658
+ $link = sprintf(
1659
+ '<a href="%1$s" class="thickbox">%2$s</a>',
1660
+ esc_url( $url ),
1661
+ esc_html( $this->plugins[ $slug ]['name'] )
1662
+ );
1663
+ } else {
1664
+ $link = esc_html( $this->plugins[ $slug ]['name'] ); // No hyperlink.
1665
+ }
1666
+
1667
+ return $link;
1668
+ }
1669
+
1670
+ /**
1671
+ * Determine if we're on the ACX_CSMA_LICENCE_TGMPA Install page.
1672
+ *
1673
+ * @since 2.1.0
1674
+ *
1675
+ * @return boolean True when on the ACX_CSMA_LICENCE_TGMPA page, false otherwise.
1676
+ */
1677
+ protected function is_acx_csma_licence_tgmpa_page() {
1678
+ return isset( $_GET['page'] ) && $this->menu === $_GET['page'];
1679
+ }
1680
+
1681
+ /**
1682
+ * Determine if we're on a WP Core installation/upgrade page.
1683
+ *
1684
+ * @since 2.6.0
1685
+ *
1686
+ * @return boolean True when on a WP Core installation/upgrade page, false otherwise.
1687
+ */
1688
+ protected function is_core_update_page() {
1689
+ // Current screen is not always available, most notably on the customizer screen.
1690
+ if ( ! function_exists( 'get_current_screen' ) ) {
1691
+ return false;
1692
+ }
1693
+
1694
+ $screen = get_current_screen();
1695
+
1696
+ if ( 'update-core' === $screen->base ) {
1697
+ // Core update screen.
1698
+ return true;
1699
+ } elseif ( 'plugins' === $screen->base && ! empty( $_POST['action'] ) ) { // WPCS: CSRF ok.
1700
+ // Plugins bulk update screen.
1701
+ return true;
1702
+ } elseif ( 'update' === $screen->base && ! empty( $_POST['action'] ) ) { // WPCS: CSRF ok.
1703
+ // Individual updates (ajax call).
1704
+ return true;
1705
+ }
1706
+
1707
+ return false;
1708
+ }
1709
+
1710
+ /**
1711
+ * Retrieve the URL to the ACX_CSMA_LICENCE_TGMPA Install page.
1712
+ *
1713
+ * I.e. depending on the config settings passed something along the lines of:
1714
+ * http://example.com/wp-admin/themes.php?page=Acurax-Coming-Soon-Maintenance-Mode-Settings-Install-Addons
1715
+ *
1716
+ * @since 2.5.0
1717
+ *
1718
+ * @return string Properly encoded URL (not escaped).
1719
+ */
1720
+ public function get_acx_csma_licence_tgmpa_url() {
1721
+ static $url;
1722
+
1723
+ if ( ! isset( $url ) ) {
1724
+ $parent = $this->parent_slug;
1725
+ if ( false === strpos( $parent, '.php' ) ) {
1726
+ $parent = 'admin.php';
1727
+ }
1728
+ $url = add_query_arg(
1729
+ array(
1730
+ 'page' => urlencode( $this->menu ),
1731
+ ),
1732
+ self_admin_url( $parent )
1733
+ );
1734
+ }
1735
+
1736
+ return $url;
1737
+ }
1738
+
1739
+ /**
1740
+ * Retrieve the URL to the ACX_CSMA_LICENCE_TGMPA Install page for a specific plugin status (view).
1741
+ *
1742
+ * I.e. depending on the config settings passed something along the lines of:
1743
+ * http://example.com/wp-admin/themes.php?page=Acurax-Coming-Soon-Maintenance-Mode-Settings-Install-Addons&plugin_status=install
1744
+ *
1745
+ * @since 2.5.0
1746
+ *
1747
+ * @param string $status Plugin status - either 'install', 'update' or 'activate'.
1748
+ * @return string Properly encoded URL (not escaped).
1749
+ */
1750
+ public function get_acx_csma_licence_tgmpa_status_url( $status ) {
1751
+ return add_query_arg(
1752
+ array(
1753
+ 'plugin_status' => urlencode( $status ),
1754
+ ),
1755
+ $this->get_acx_csma_licence_tgmpa_url()
1756
+ );
1757
+ }
1758
+
1759
+ /**
1760
+ * Determine whether there are open actions for plugins registered with ACX_CSMA_LICENCE_TGMPA.
1761
+ *
1762
+ * @since 2.5.0
1763
+ *
1764
+ * @return bool True if complete, i.e. no outstanding actions. False otherwise.
1765
+ */
1766
+ public function is_acx_csma_licence_tgmpa_complete() {
1767
+ $complete = true;
1768
+ foreach ( $this->plugins as $slug => $plugin ) {
1769
+ if ( ! $this->is_plugin_active( $slug ) || false !== $this->does_plugin_have_update( $slug ) ) {
1770
+ $complete = false;
1771
+ break;
1772
+ }
1773
+ }
1774
+
1775
+ return $complete;
1776
+ }
1777
+
1778
+ /**
1779
+ * Check if a plugin is installed. Does not take must-use plugins into account.
1780
+ *
1781
+ * @since 2.5.0
1782
+ *
1783
+ * @param string $slug Plugin slug.
1784
+ * @return bool True if installed, false otherwise.
1785
+ */
1786
+ public function is_plugin_installed( $slug ) {
1787
+ $installed_plugins = $this->get_plugins(); // Retrieve a list of all installed plugins (WP cached).
1788
+
1789
+ return ( ! empty( $installed_plugins[ $this->plugins[ $slug ]['file_path'] ] ) );
1790
+ }
1791
+
1792
+ /**
1793
+ * Check if a plugin is active.
1794
+ *
1795
+ * @since 2.5.0
1796
+ *
1797
+ * @param string $slug Plugin slug.
1798
+ * @return bool True if active, false otherwise.
1799
+ */
1800
+ public function is_plugin_active( $slug ) {
1801
+ return ( ( ! empty( $this->plugins[ $slug ]['is_callable'] ) && is_callable( $this->plugins[ $slug ]['is_callable'] ) ) || is_plugin_active( $this->plugins[ $slug ]['file_path'] ) );
1802
+ }
1803
+
1804
+ /**
1805
+ * Check if a plugin can be updated, i.e. if we have information on the minimum WP version required
1806
+ * available, check whether the current install meets them.
1807
+ *
1808
+ * @since 2.5.0
1809
+ *
1810
+ * @param string $slug Plugin slug.
1811
+ * @return bool True if OK to update, false otherwise.
1812
+ */
1813
+ public function can_plugin_update( $slug ) {
1814
+ // We currently can't get reliable info on non-WP-repo plugins - issue #380.
1815
+ if ( 'repo' !== $this->plugins[ $slug ]['source_type'] ) {
1816
+ return true;
1817
+ }
1818
+
1819
+ $api = $this->get_plugins_api( $slug );
1820
+
1821
+ if ( false !== $api && isset( $api->requires ) ) {
1822
+ return version_compare( $this->wp_version, $api->requires, '>=' );
1823
+ }
1824
+
1825
+ // No usable info received from the plugins API, presume we can update.
1826
+ return true;
1827
+ }
1828
+
1829
+ /**
1830
+ * Check to see if the plugin is 'updatetable', i.e. installed, with an update available
1831
+ * and no WP version requirements blocking it.
1832
+ *
1833
+ * @since 2.6.0
1834
+ *
1835
+ * @param string $slug Plugin slug.
1836
+ * @return bool True if OK to proceed with update, false otherwise.
1837
+ */
1838
+ public function is_plugin_updatetable( $slug ) {
1839
+ if ( ! $this->is_plugin_installed( $slug ) ) {
1840
+ return false;
1841
+ } else {
1842
+ return ( false !== $this->does_plugin_have_update( $slug ) && $this->can_plugin_update( $slug ) );
1843
+ }
1844
+ }
1845
+
1846
+ /**
1847
+ * Check if a plugin can be activated, i.e. is not currently active and meets the minimum
1848
+ * plugin version requirements set in ACX_CSMA_LICENCE_TGMPA (if any).
1849
+ *
1850
+ * @since 2.5.0
1851
+ *
1852
+ * @param string $slug Plugin slug.
1853
+ * @return bool True if OK to activate, false otherwise.
1854
+ */
1855
+ public function can_plugin_activate( $slug ) {
1856
+ return ( ! $this->is_plugin_active( $slug ) && ! $this->does_plugin_require_update( $slug ) );
1857
+ }
1858
+
1859
+ /**
1860
+ * Retrieve the version number of an installed plugin.
1861
+ *
1862
+ * @since 2.5.0
1863
+ *
1864
+ * @param string $slug Plugin slug.
1865
+ * @return string Version number as string or an empty string if the plugin is not installed
1866
+ * or version unknown (plugins which don't comply with the plugin header standard).
1867
+ */
1868
+ public function get_installed_version( $slug ) {
1869
+ $installed_plugins = $this->get_plugins(); // Retrieve a list of all installed plugins (WP cached).
1870
+
1871
+ if ( ! empty( $installed_plugins[ $this->plugins[ $slug ]['file_path'] ]['Version'] ) ) {
1872
+ return $installed_plugins[ $this->plugins[ $slug ]['file_path'] ]['Version'];
1873
+ }
1874
+
1875
+ return '';
1876
+ }
1877
+
1878
+ /**
1879
+ * Check whether a plugin complies with the minimum version requirements.
1880
+ *
1881
+ * @since 2.5.0
1882
+ *
1883
+ * @param string $slug Plugin slug.
1884
+ * @return bool True when a plugin needs to be updated, otherwise false.
1885
+ */
1886
+ public function does_plugin_require_update( $slug ) {
1887
+ $installed_version = $this->get_installed_version( $slug );
1888
+ $minimum_version = $this->plugins[ $slug ]['version'];
1889
+
1890
+ return version_compare( $minimum_version, $installed_version, '>' );
1891
+ }
1892
+
1893
+ /**
1894
+ * Check whether there is an update available for a plugin.
1895
+ *
1896
+ * @since 2.5.0
1897
+ *
1898
+ * @param string $slug Plugin slug.
1899
+ * @return false|string Version number string of the available update or false if no update available.
1900
+ */
1901
+ public function does_plugin_have_update( $slug ) {
1902
+ // Presume bundled and external plugins will point to a package which meets the minimum required version.
1903
+ if ( 'repo' !== $this->plugins[ $slug ]['source_type'] ) {
1904
+ if ( $this->does_plugin_require_update( $slug ) ) {
1905
+ return $this->plugins[ $slug ]['version'];
1906
+ }
1907
+
1908
+ return false;
1909
+ }
1910
+
1911
+ $repo_updates = get_site_transient( 'update_plugins' );
1912
+
1913
+ if ( isset( $repo_updates->response[ $this->plugins[ $slug ]['file_path'] ]->new_version ) ) {
1914
+ return $repo_updates->response[ $this->plugins[ $slug ]['file_path'] ]->new_version;
1915
+ }
1916
+
1917
+ return false;
1918
+ }
1919
+
1920
+ /**
1921
+ * Retrieve potential upgrade notice for a plugin.
1922
+ *
1923
+ * @since 2.5.0
1924
+ *
1925
+ * @param string $slug Plugin slug.
1926
+ * @return string The upgrade notice or an empty string if no message was available or provided.
1927
+ */
1928
+ public function get_upgrade_notice( $slug ) {
1929
+ // We currently can't get reliable info on non-WP-repo plugins - issue #380.
1930
+ if ( 'repo' !== $this->plugins[ $slug ]['source_type'] ) {
1931
+ return '';
1932
+ }
1933
+
1934
+ $repo_updates = get_site_transient( 'update_plugins' );
1935
+
1936
+ if ( ! empty( $repo_updates->response[ $this->plugins[ $slug ]['file_path'] ]->upgrade_notice ) ) {
1937
+ return $repo_updates->response[ $this->plugins[ $slug ]['file_path'] ]->upgrade_notice;
1938
+ }
1939
+
1940
+ return '';
1941
+ }
1942
+
1943
+ /**
1944
+ * Wrapper around the core WP get_plugins function, making sure it's actually available.
1945
+ *
1946
+ * @since 2.5.0
1947
+ *
1948
+ * @param string $plugin_folder Optional. Relative path to single plugin folder.
1949
+ * @return array Array of installed plugins with plugin information.
1950
+ */
1951
+ public function get_plugins( $plugin_folder = '' ) {
1952
+ if ( ! function_exists( 'get_plugins' ) ) {
1953
+ require_once ABSPATH . 'wp-admin/includes/plugin.php';
1954
+ }
1955
+
1956
+ return get_plugins( $plugin_folder );
1957
+ }
1958
+
1959
+ /**
1960
+ * Delete dismissable nag option when theme is switched.
1961
+ *
1962
+ * This ensures that the user(s) is/are again reminded via nag of required
1963
+ * and/or recommended plugins if they re-activate the theme.
1964
+ *
1965
+ * @since 2.1.1
1966
+ */
1967
+ public function update_dismiss() {
1968
+ delete_metadata( 'user', null, 'acx_csma_licence_tgmpa_dismissed_notice_' . $this->id, null, true );
1969
+ }
1970
+
1971
+ /**
1972
+ * Forces plugin activation if the parameter 'force_activation' is
1973
+ * set to true.
1974
+ *
1975
+ * This allows theme authors to specify certain plugins that must be
1976
+ * active at all times while using the current theme.
1977
+ *
1978
+ * Please take special care when using this parameter as it has the
1979
+ * potential to be harmful if not used correctly. Setting this parameter
1980
+ * to true will not allow the specified plugin to be deactivated unless
1981
+ * the user switches themes.
1982
+ *
1983
+ * @since 2.2.0
1984
+ */
1985
+ public function force_activation() {
1986
+ foreach ( $this->plugins as $slug => $plugin ) {
1987
+ if ( true === $plugin['force_activation'] ) {
1988
+ if ( ! $this->is_plugin_installed( $slug ) ) {
1989
+ // Oops, plugin isn't there so iterate to next condition.
1990
+ continue;
1991
+ } elseif ( $this->can_plugin_activate( $slug ) ) {
1992
+ // There we go, activate the plugin.
1993
+ activate_plugin( $plugin['file_path'] );
1994
+ }
1995
+ }
1996
+ }
1997
+ }
1998
+
1999
+ /**
2000
+ * Forces plugin deactivation if the parameter 'force_deactivation'
2001
+ * is set to true and adds the plugin to the 'recently active' plugins list.
2002
+ *
2003
+ * This allows theme authors to specify certain plugins that must be
2004
+ * deactivated upon switching from the current theme to another.
2005
+ *
2006
+ * Please take special care when using this parameter as it has the
2007
+ * potential to be harmful if not used correctly.
2008
+ *
2009
+ * @since 2.2.0
2010
+ */
2011
+ public function force_deactivation() {
2012
+ $deactivated = array();
2013
+
2014
+ foreach ( $this->plugins as $slug => $plugin ) {
2015
+ /*
2016
+ * Only proceed forward if the parameter is set to true and plugin is active
2017
+ * as a 'normal' (not must-use) plugin.
2018
+ */
2019
+ if ( true === $plugin['force_deactivation'] && is_plugin_active( $plugin['file_path'] ) ) {
2020
+ deactivate_plugins( $plugin['file_path'] );
2021
+ $deactivated[ $plugin['file_path'] ] = time();
2022
+ }
2023
+ }
2024
+
2025
+ if ( ! empty( $deactivated ) ) {
2026
+ update_option( 'recently_activated', $deactivated + (array) get_option( 'recently_activated' ) );
2027
+ }
2028
+ }
2029
+
2030
+ /**
2031
+ * Echo the current ACX_CSMA_LICENCE_TGMPA version number to the page.
2032
+ *
2033
+ * @since 2.5.0
2034
+ */
2035
+ public function show_acx_csma_licence_tgmpa_version() {
2036
+ echo '<p style="float: right; padding: 0em 1.5em 0.5em 0;"><strong><small>',
2037
+ esc_html(
2038
+ sprintf(
2039
+ __( 'ACX_CSMA_LICENCE_TGMPA v%s', 'acx_csma_licence_tgmpa' ),
2040
+ self::ACX_CSMA_LICENCE_TGMPA_VERSION
2041
+ )
2042
+ ),
2043
+ '</small></strong></p>';
2044
+ }
2045
+
2046
+ /**
2047
+ * Returns the singleton instance of the class.
2048
+ *
2049
+ * @since 2.4.0
2050
+ *
2051
+ * @return \ACX_CSMA_LICENCE_TGM_Plugin_Activation The ACX_CSMA_LICENCE_TGM_Plugin_Activation object.
2052
+ */
2053
+ public static function get_instance() {
2054
+ if ( ! isset( self::$instance ) && ! ( self::$instance instanceof self ) ) {
2055
+ self::$instance = new self();
2056
+ }
2057
+
2058
+ return self::$instance;
2059
+ }
2060
+ }
2061
+
2062
+ if ( ! function_exists( 'load_acx_csma_licence_tgm_plugin_activation' ) ) {
2063
+ /**
2064
+ * Ensure only one instance of the class is ever invoked.
2065
+ *
2066
+ * @since 2.5.0
2067
+ */
2068
+ function load_acx_csma_licence_tgm_plugin_activation() {
2069
+ $GLOBALS['acx_csma_licence_tgmpa'] = ACX_CSMA_LICENCE_TGM_Plugin_Activation::get_instance();
2070
+ }
2071
+ }
2072
+
2073
+ if ( did_action( 'plugins_loaded' ) ) {
2074
+ load_acx_csma_licence_tgm_plugin_activation();
2075
+ } else {
2076
+ add_action( 'plugins_loaded', 'load_acx_csma_licence_tgm_plugin_activation' );
2077
+ }
2078
+ }
2079
+
2080
+ if ( ! function_exists( 'acx_csma_licence_tgmpa' ) ) {
2081
+ /**
2082
+ * Helper function to register a collection of required plugins.
2083
+ *
2084
+ * @since 2.0.0
2085
+ * @api
2086
+ *
2087
+ * @param array $plugins An array of plugin arrays.
2088
+ * @param array $config Optional. An array of configuration values.
2089
+ */
2090
+ function acx_csma_licence_tgmpa( $plugins, $config = array() ) {
2091
+ $instance = call_user_func( array( get_class( $GLOBALS['acx_csma_licence_tgmpa'] ), 'get_instance' ) );
2092
+
2093
+ foreach ( $plugins as $plugin ) {
2094
+ call_user_func( array( $instance, 'register' ), $plugin );
2095
+ }
2096
+
2097
+ if ( ! empty( $config ) && is_array( $config ) ) {
2098
+ // Send out notices for deprecated arguments passed.
2099
+ if ( isset( $config['notices'] ) ) {
2100
+ _deprecated_argument( __FUNCTION__, '2.2.0', 'The `notices` config parameter was renamed to `has_notices` in ACX_CSMA_LICENCE_TGMPA 2.2.0. Please adjust your configuration.' );
2101
+ if ( ! isset( $config['has_notices'] ) ) {
2102
+ $config['has_notices'] = $config['notices'];
2103
+ }
2104
+ }
2105
+
2106
+ if ( isset( $config['parent_menu_slug'] ) ) {
2107
+ _deprecated_argument( __FUNCTION__, '2.4.0', 'The `parent_menu_slug` config parameter was removed in ACX_CSMA_LICENCE_TGMPA 2.4.0. In ACX_CSMA_LICENCE_TGMPA 2.5.0 an alternative was (re-)introduced. Please adjust your configuration. For more information visit the website: http://tgmpluginactivation.com/configuration/#h-configuration-options.' );
2108
+ }
2109
+ if ( isset( $config['parent_url_slug'] ) ) {
2110
+ _deprecated_argument( __FUNCTION__, '2.4.0', 'The `parent_url_slug` config parameter was removed in ACX_CSMA_LICENCE_TGMPA 2.4.0. In ACX_CSMA_LICENCE_TGMPA 2.5.0 an alternative was (re-)introduced. Please adjust your configuration. For more information visit the website: http://tgmpluginactivation.com/configuration/#h-configuration-options.' );
2111
+ }
2112
+
2113
+ call_user_func( array( $instance, 'config' ), $config );
2114
+ }
2115
+ }
2116
+ }
2117
+
2118
+ /**
2119
+ * WP_List_Table isn't always available. If it isn't available,
2120
+ * we load it here.
2121
+ *
2122
+ * @since 2.2.0
2123
+ */
2124
+ if ( ! class_exists( 'WP_List_Table' ) ) {
2125
+ require_once ABSPATH . 'wp-admin/includes/class-wp-list-table.php';
2126
+ }
2127
+
2128
+ if ( ! class_exists( 'ACX_CSMA_LICENCE_TGMPA_List_Table' ) ) {
2129
+
2130
+ /**
2131
+ * List table class for handling plugins.
2132
+ *
2133
+ * Extends the WP_List_Table class to provide a future-compatible
2134
+ * way of listing out all required/recommended plugins.
2135
+ *
2136
+ * Gives users an interface similar to the Plugin Administration
2137
+ * area with similar (albeit stripped down) capabilities.
2138
+ *
2139
+ * This class also allows for the bulk install of plugins.
2140
+ *
2141
+ * @since 2.2.0
2142
+ *
2143
+ * @package ACX_CSMA_LICENCE_TGM-Plugin-Activation
2144
+ * @author Thomas Griffin
2145
+ * @author Gary Jones
2146
+ */
2147
+ class ACX_CSMA_LICENCE_TGMPA_List_Table extends WP_List_Table {
2148
+ /**
2149
+ * ACX_CSMA_LICENCE_TGMPA instance.
2150
+ *
2151
+ * @since 2.5.0
2152
+ *
2153
+ * @var object
2154
+ */
2155
+ protected $acx_csma_licence_tgmpa;
2156
+
2157
+ /**
2158
+ * The currently chosen view.
2159
+ *
2160
+ * @since 2.5.0
2161
+ *
2162
+ * @var string One of: 'all', 'install', 'update', 'activate'
2163
+ */
2164
+ public $view_context = 'all';
2165
+
2166
+ /**
2167
+ * The plugin counts for the various views.
2168
+ *
2169
+ * @since 2.5.0
2170
+ *
2171
+ * @var array
2172
+ */
2173
+ protected $view_totals = array(
2174
+ 'all' => 0,
2175
+ 'install' => 0,
2176
+ 'update' => 0,
2177
+ 'activate' => 0,
2178
+ );
2179
+
2180
+ /**
2181
+ * References parent constructor and sets defaults for class.
2182
+ *
2183
+ * @since 2.2.0
2184
+ */
2185
+ public function __construct() {
2186
+ $this->acx_csma_licence_tgmpa = call_user_func( array( get_class( $GLOBALS['acx_csma_licence_tgmpa'] ), 'get_instance' ) );
2187
+
2188
+ parent::__construct(
2189
+ array(
2190
+ 'singular' => 'plugin',
2191
+ 'plural' => 'plugins',
2192
+ 'ajax' => false,
2193
+ )
2194
+ );
2195
+
2196
+ if ( isset( $_REQUEST['plugin_status'] ) && in_array( $_REQUEST['plugin_status'], array( 'install', 'update', 'activate' ), true ) ) {
2197
+ $this->view_context = sanitize_key( $_REQUEST['plugin_status'] );
2198
+ }
2199
+
2200
+ add_filter( 'acx_csma_licence_tgmpa_table_data_items', array( $this, 'sort_table_items' ) );
2201
+ }
2202
+
2203
+ /**
2204
+ * Get a list of CSS classes for the <table> tag.
2205
+ *
2206
+ * Overruled to prevent the 'plural' argument from being added.
2207
+ *
2208
+ * @since 2.5.0
2209
+ *
2210
+ * @return array CSS classnames.
2211
+ */
2212
+ public function get_table_classes() {
2213
+ return array( 'widefat', 'fixed' );
2214
+ }
2215
+
2216
+ /**
2217
+ * Gathers and renames all of our plugin information to be used by WP_List_Table to create our table.
2218
+ *
2219
+ * @since 2.2.0
2220
+ *
2221
+ * @return array $table_data Information for use in table.
2222
+ */
2223
+ protected function _gather_plugin_data() {
2224
+ // Load thickbox for plugin links.
2225
+ $this->acx_csma_licence_tgmpa->admin_init();
2226
+ $this->acx_csma_licence_tgmpa->thickbox();
2227
+
2228
+ // Categorize the plugins which have open actions.
2229
+ $plugins = $this->categorize_plugins_to_views();
2230
+
2231
+ // Set the counts for the view links.
2232
+ $this->set_view_totals( $plugins );
2233
+
2234
+ // Prep variables for use and grab list of all installed plugins.
2235
+ $table_data = array();
2236
+ $i = 0;
2237
+
2238
+ // Redirect to the 'all' view if no plugins were found for the selected view context.
2239
+ if ( empty( $plugins[ $this->view_context ] ) ) {
2240
+ $this->view_context = 'all';
2241
+ }
2242
+
2243
+ foreach ( $plugins[ $this->view_context ] as $slug => $plugin ) {
2244
+ $table_data[ $i ]['sanitized_plugin'] = $plugin['name'];
2245
+ $table_data[ $i ]['slug'] = $slug;
2246
+ $table_data[ $i ]['plugin'] = '<strong>' . $this->acx_csma_licence_tgmpa->get_info_link( $slug ) . '</strong>';
2247
+ $table_data[ $i ]['source'] = $this->get_plugin_source_type_text( $plugin['source_type'] );
2248
+ $table_data[ $i ]['type'] = $this->get_plugin_advise_type_text( $plugin['required'] );
2249
+ $table_data[ $i ]['status'] = $this->get_plugin_status_text( $slug );
2250
+ $table_data[ $i ]['installed_version'] = $this->acx_csma_licence_tgmpa->get_installed_version( $slug );
2251
+ $table_data[ $i ]['minimum_version'] = $plugin['version'];
2252
+ $table_data[ $i ]['available_version'] = $this->acx_csma_licence_tgmpa->does_plugin_have_update( $slug );
2253
+
2254
+ // Prep the upgrade notice info.
2255
+ $upgrade_notice = $this->acx_csma_licence_tgmpa->get_upgrade_notice( $slug );
2256
+ if ( ! empty( $upgrade_notice ) ) {
2257
+ $table_data[ $i ]['upgrade_notice'] = $upgrade_notice;
2258
+
2259
+ add_action( "acx_csma_licence_tgmpa_after_plugin_row_{$slug}", array( $this, 'wp_plugin_update_row' ), 10, 2 );
2260
+ }
2261
+
2262
+ $table_data[ $i ] = apply_filters( 'acx_csma_licence_tgmpa_table_data_item', $table_data[ $i ], $plugin );
2263
+
2264
+ $i++;
2265
+ }
2266
+
2267
+ return $table_data;
2268
+ }
2269
+
2270
+ /**
2271
+ * Categorize the plugins which have open actions into views for the ACX_CSMA_LICENCE_TGMPA page.
2272
+ *
2273
+ * @since 2.5.0
2274
+ */
2275
+ protected function categorize_plugins_to_views() {
2276
+ $plugins = array(
2277
+ 'all' => array(), // Meaning: all plugins which still have open actions.
2278
+ 'install' => array(),
2279
+ 'update' => array(),
2280
+ 'activate' => array(),
2281
+ );
2282
+
2283
+ foreach ( $this->acx_csma_licence_tgmpa->plugins as $slug => $plugin ) {
2284
+ if ( $this->acx_csma_licence_tgmpa->is_plugin_active( $slug ) && false === $this->acx_csma_licence_tgmpa->does_plugin_have_update( $slug ) ) {
2285
+ // No need to display plugins if they are installed, up-to-date and active.
2286
+ continue;
2287
+ } else {
2288
+ $plugins['all'][ $slug ] = $plugin;
2289
+
2290
+ if ( ! $this->acx_csma_licence_tgmpa->is_plugin_installed( $slug ) ) {
2291
+ $plugins['install'][ $slug ] = $plugin;
2292
+ } else {
2293
+ if ( false !== $this->acx_csma_licence_tgmpa->does_plugin_have_update( $slug ) ) {
2294
+ $plugins['update'][ $slug ] = $plugin;
2295
+ }
2296
+
2297
+ if ( $this->acx_csma_licence_tgmpa->can_plugin_activate( $slug ) ) {
2298
+ $plugins['activate'][ $slug ] = $plugin;
2299
+ }
2300
+ }
2301
+ }
2302
+ }
2303
+
2304
+ return $plugins;
2305
+ }
2306
+
2307
+ /**
2308
+ * Set the counts for the view links.
2309
+ *
2310
+ * @since 2.5.0
2311
+ *
2312
+ * @param array $plugins Plugins order by view.
2313
+ */
2314
+ protected function set_view_totals( $plugins ) {
2315
+ foreach ( $plugins as $type => $list ) {
2316
+ $this->view_totals[ $type ] = count( $list );
2317
+ }
2318
+ }
2319
+
2320
+ /**
2321
+ * Get the plugin required/recommended text string.
2322
+ *
2323
+ * @since 2.5.0
2324
+ *
2325
+ * @param string $required Plugin required setting.
2326
+ * @return string
2327
+ */
2328
+ protected function get_plugin_advise_type_text( $required ) {
2329
+ if ( true === $required ) {
2330
+ return __( 'Required', 'acx_csma_licence_tgmpa' );
2331
+ }
2332
+
2333
+ return __( 'Recommended', 'acx_csma_licence_tgmpa' );
2334
+ }
2335
+
2336
+ /**
2337
+ * Get the plugin source type text string.
2338
+ *
2339
+ * @since 2.5.0
2340
+ *
2341
+ * @param string $type Plugin type.
2342
+ * @return string
2343
+ */
2344
+ protected function get_plugin_source_type_text( $type ) {
2345
+ $string = '';
2346
+
2347
+ switch ( $type ) {
2348
+ case 'repo':
2349
+ $string = __( 'WordPress Repository', 'acx_csma_licence_tgmpa' );
2350
+ break;
2351
+ case 'external':
2352
+ $string = __( 'External Source', 'acx_csma_licence_tgmpa' );
2353
+ break;
2354
+ case 'bundled':
2355
+ $string = __( 'Pre-Packaged', 'acx_csma_licence_tgmpa' );
2356
+ break;
2357
+ }
2358
+
2359
+ return $string;
2360
+ }
2361
+
2362
+ /**
2363
+ * Determine the plugin status message.
2364
+ *
2365
+ * @since 2.5.0
2366
+ *
2367
+ * @param string $slug Plugin slug.
2368
+ * @return string
2369
+ */
2370
+ protected function get_plugin_status_text( $slug ) {
2371
+ if ( ! $this->acx_csma_licence_tgmpa->is_plugin_installed( $slug ) ) {
2372
+ return __( 'Not Installed', 'acx_csma_licence_tgmpa' );
2373
+ }
2374
+
2375
+ if ( ! $this->acx_csma_licence_tgmpa->is_plugin_active( $slug ) ) {
2376
+ $install_status = __( 'Installed But Not Activated', 'acx_csma_licence_tgmpa' );
2377
+ } else {
2378
+ $install_status = __( 'Active', 'acx_csma_licence_tgmpa' );
2379
+ }
2380
+
2381
+ $update_status = '';
2382
+
2383
+ if ( $this->acx_csma_licence_tgmpa->does_plugin_require_update( $slug ) && false === $this->acx_csma_licence_tgmpa->does_plugin_have_update( $slug ) ) {
2384
+ $update_status = __( 'Required Update not Available', 'acx_csma_licence_tgmpa' );
2385
+
2386
+ } elseif ( $this->acx_csma_licence_tgmpa->does_plugin_require_update( $slug ) ) {
2387
+ $update_status = __( 'Requires Update', 'acx_csma_licence_tgmpa' );
2388
+
2389
+ } elseif ( false !== $this->acx_csma_licence_tgmpa->does_plugin_have_update( $slug ) ) {
2390
+ $update_status = __( 'Update recommended', 'acx_csma_licence_tgmpa' );
2391
+ }
2392
+
2393
+ if ( '' === $update_status ) {
2394
+ return $install_status;
2395
+ }
2396
+
2397
+ return sprintf(
2398
+ _x( '%1$s, %2$s', 'Install/Update Status', 'acx_csma_licence_tgmpa' ),
2399
+ $install_status,
2400
+ $update_status
2401
+ );
2402
+ }
2403
+
2404
+ /**
2405
+ * Sort plugins by Required/Recommended type and by alphabetical plugin name within each type.
2406
+ *
2407
+ * @since 2.5.0
2408
+ *
2409
+ * @param array $items Prepared table items.
2410
+ * @return array Sorted table items.
2411
+ */
2412
+ public function sort_table_items( $items ) {
2413
+ $type = array();
2414
+ $name = array();
2415
+
2416
+ foreach ( $items as $i => $plugin ) {
2417
+ $type[ $i ] = $plugin['type']; // Required / recommended.
2418
+ $name[ $i ] = $plugin['sanitized_plugin'];
2419
+ }
2420
+
2421
+ array_multisort( $type, SORT_DESC, $name, SORT_ASC, $items );
2422
+
2423
+ return $items;
2424
+ }
2425
+
2426
+ /**
2427
+ * Get an associative array ( id => link ) of the views available on this table.
2428
+ *
2429
+ * @since 2.5.0
2430
+ *
2431
+ * @return array
2432
+ */
2433
+ public function get_views() {
2434
+ $status_links = array();
2435
+
2436
+ foreach ( $this->view_totals as $type => $count ) {
2437
+ if ( $count < 1 ) {
2438
+ continue;
2439
+ }
2440
+
2441
+ switch ( $type ) {
2442
+ case 'all':
2443
+ $text = _nx( 'All <span class="count">(%s)</span>', 'All <span class="count">(%s)</span>', $count, 'plugins', 'acx_csma_licence_tgmpa' );
2444
+ break;
2445
+ case 'install':
2446
+ $text = _n( 'To Install <span class="count">(%s)</span>', 'To Install <span class="count">(%s)</span>', $count, 'acx_csma_licence_tgmpa' );
2447
+ break;
2448
+ case 'update':
2449
+ $text = _n( 'Update Available <span class="count">(%s)</span>', 'Update Available <span class="count">(%s)</span>', $count, 'acx_csma_licence_tgmpa' );
2450
+ break;
2451
+ case 'activate':
2452
+ $text = _n( 'To Activate <span class="count">(%s)</span>', 'To Activate <span class="count">(%s)</span>', $count, 'acx_csma_licence_tgmpa' );
2453
+ break;
2454
+ default:
2455
+ $text = '';
2456
+ break;
2457
+ }
2458
+
2459
+ if ( ! empty( $text ) ) {
2460
+
2461
+ $status_links[ $type ] = sprintf(
2462
+ '<a href="%s"%s>%s</a>',
2463
+ esc_url( $this->acx_csma_licence_tgmpa->get_acx_csma_licence_tgmpa_status_url( $type ) ),
2464
+ ( $type === $this->view_context ) ? ' class="current"' : '',
2465
+ sprintf( $text, number_format_i18n( $count ) )
2466
+ );
2467
+ }
2468
+ }
2469
+
2470
+ return $status_links;
2471
+ }
2472
+
2473
+ /**
2474
+ * Create default columns to display important plugin information
2475
+ * like type, action and status.
2476
+ *
2477
+ * @since 2.2.0
2478
+ *
2479
+ * @param array $item Array of item data.
2480
+ * @param string $column_name The name of the column.
2481
+ * @return string
2482
+ */
2483
+ public function column_default( $item, $column_name ) {
2484
+ return $item[ $column_name ];
2485
+ }
2486
+
2487
+ /**
2488
+ * Required for bulk installing.
2489
+ *
2490
+ * Adds a checkbox for each plugin.
2491
+ *
2492
+ * @since 2.2.0
2493
+ *
2494
+ * @param array $item Array of item data.
2495
+ * @return string The input checkbox with all necessary info.
2496
+ */
2497
+ public function column_cb( $item ) {
2498
+ return sprintf(
2499
+ '<input type="checkbox" name="%1$s[]" value="%2$s" id="%3$s" />',
2500
+ esc_attr( $this->_args['singular'] ),
2501
+ esc_attr( $item['slug'] ),
2502
+ esc_attr( $item['sanitized_plugin'] )
2503
+ );
2504
+ }
2505
+
2506
+ /**
2507
+ * Create default title column along with the action links.
2508
+ *
2509
+ * @since 2.2.0
2510
+ *
2511
+ * @param array $item Array of item data.
2512
+ * @return string The plugin name and action links.
2513
+ */
2514
+ public function column_plugin( $item ) {
2515
+ return sprintf(
2516
+ '%1$s %2$s',
2517
+ $item['plugin'],
2518
+ $this->row_actions( $this->get_row_actions( $item ), true )
2519
+ );
2520
+ }
2521
+
2522
+ /**
2523
+ * Create version information column.
2524
+ *
2525
+ * @since 2.5.0
2526
+ *
2527
+ * @param array $item Array of item data.
2528
+ * @return string HTML-formatted version information.
2529
+ */
2530
+ public function column_version( $item ) {
2531
+ $output = array();
2532
+
2533
+ if ( $this->acx_csma_licence_tgmpa->is_plugin_installed( $item['slug'] ) ) {
2534
+ $installed = ! empty( $item['installed_version'] ) ? $item['installed_version'] : _x( 'unknown', 'as in: "version nr unknown"', 'acx_csma_licence_tgmpa' );
2535
+
2536
+ $color = '';
2537
+ if ( ! empty( $item['minimum_version'] ) && $this->acx_csma_licence_tgmpa->does_plugin_require_update( $item['slug'] ) ) {
2538
+ $color = ' color: #ff0000; font-weight: bold;';
2539
+ }
2540
+
2541
+ $output[] = sprintf(
2542
+ '<p><span style="min-width: 32px; text-align: right; float: right;%1$s">%2$s</span>' . __( 'Installed version:', 'acx_csma_licence_tgmpa' ) . '</p>',
2543
+ $color,
2544
+ $installed
2545
+ );
2546
+ }
2547
+
2548
+ if ( ! empty( $item['minimum_version'] ) ) {
2549
+ $output[] = sprintf(
2550
+ '<p><span style="min-width: 32px; text-align: right; float: right;">%1$s</span>' . __( 'Minimum required version:', 'acx_csma_licence_tgmpa' ) . '</p>',
2551
+ $item['minimum_version']
2552
+ );
2553
+ }
2554
+
2555
+ if ( ! empty( $item['available_version'] ) ) {
2556
+ $color = '';
2557
+ if ( ! empty( $item['minimum_version'] ) && version_compare( $item['available_version'], $item['minimum_version'], '>=' ) ) {
2558
+ $color = ' color: #71C671; font-weight: bold;';
2559
+ }
2560
+
2561
+ $output[] = sprintf(
2562
+ '<p><span style="min-width: 32px; text-align: right; float: right;%1$s">%2$s</span>' . __( 'Available version:', 'acx_csma_licence_tgmpa' ) . '</p>',
2563
+ $color,
2564
+ $item['available_version']
2565
+ );
2566
+ }
2567
+
2568
+ if ( empty( $output ) ) {
2569
+ return '&nbsp;'; // Let's not break the table layout.
2570
+ } else {
2571
+ return implode( "\n", $output );
2572
+ }
2573
+ }
2574
+
2575
+ /**
2576
+ * Sets default message within the plugins table if no plugins
2577
+ * are left for interaction.
2578
+ *
2579
+ * Hides the menu item to prevent the user from clicking and
2580
+ * getting a permissions error.
2581
+ *
2582
+ * @since 2.2.0
2583
+ */
2584
+ public function no_items() {
2585
+ echo esc_html__( 'No plugins to install, update or activate.', 'acx_csma_licence_tgmpa' ) . ' <a href="' . esc_url( self_admin_url() ) . '"> ' . esc_html__( 'Return to the Dashboard', 'acx_csma_licence_tgmpa' ) . '</a>';
2586
+ echo '<style type="text/css">#adminmenu .wp-submenu li.current { display: none !important; }</style>';
2587
+ }
2588
+
2589
+ /**
2590
+ * Output all the column information within the table.
2591
+ *
2592
+ * @since 2.2.0
2593
+ *
2594
+ * @return array $columns The column names.
2595
+ */
2596
+ public function get_columns() {
2597
+ $columns = array(
2598
+ 'cb' => '<input type="checkbox" />',
2599
+ 'plugin' => __( 'Plugin', 'acx_csma_licence_tgmpa' ),
2600
+ 'source' => __( 'Source', 'acx_csma_licence_tgmpa' ),
2601
+ 'type' => __( 'Type', 'acx_csma_licence_tgmpa' ),
2602
+ );
2603
+
2604
+ if ( 'all' === $this->view_context || 'update' === $this->view_context ) {
2605
+ $columns['version'] = __( 'Version', 'acx_csma_licence_tgmpa' );
2606
+ $columns['status'] = __( 'Status', 'acx_csma_licence_tgmpa' );
2607
+ }
2608
+
2609
+ return apply_filters( 'acx_csma_licence_tgmpa_table_columns', $columns );
2610
+ }
2611
+
2612
+ /**
2613
+ * Get name of default primary column
2614
+ *
2615
+ * @since 2.5.0 / WP 4.3+ compatibility
2616
+ * @access protected
2617
+ *
2618
+ * @return string
2619
+ */
2620
+ protected function get_default_primary_column_name() {
2621
+ return 'plugin';
2622
+ }
2623
+
2624
+ /**
2625
+ * Get the name of the primary column.
2626
+ *
2627
+ * @since 2.5.0 / WP 4.3+ compatibility
2628
+ * @access protected
2629
+ *
2630
+ * @return string The name of the primary column.
2631
+ */
2632
+ protected function get_primary_column_name() {
2633
+ if ( method_exists( 'WP_List_Table', 'get_primary_column_name' ) ) {
2634
+ return parent::get_primary_column_name();
2635
+ } else {
2636
+ return $this->get_default_primary_column_name();
2637
+ }
2638
+ }
2639
+
2640
+ /**
2641
+ * Get the actions which are relevant for a specific plugin row.
2642
+ *
2643
+ * @since 2.5.0
2644
+ *
2645
+ * @param array $item Array of item data.
2646
+ * @return array Array with relevant action links.
2647
+ */
2648
+ protected function get_row_actions( $item ) {
2649
+ $actions = array();
2650
+ $action_links = array();
2651
+
2652
+ // Display the 'Install' action link if the plugin is not yet available.
2653
+ if ( ! $this->acx_csma_licence_tgmpa->is_plugin_installed( $item['slug'] ) ) {
2654
+ $actions['install'] = __( 'Install %2$s', 'acx_csma_licence_tgmpa' );
2655
+ } else {
2656
+ // Display the 'Update' action link if an update is available and WP complies with plugin minimum.
2657
+ if ( false !== $this->acx_csma_licence_tgmpa->does_plugin_have_update( $item['slug'] ) && $this->acx_csma_licence_tgmpa->can_plugin_update( $item['slug'] ) ) {
2658
+ $actions['update'] = __( 'Update %2$s', 'acx_csma_licence_tgmpa' );
2659
+ }
2660
+
2661
+ // Display the 'Activate' action link, but only if the plugin meets the minimum version.
2662
+ if ( $this->acx_csma_licence_tgmpa->can_plugin_activate( $item['slug'] ) ) {
2663
+ $actions['activate'] = __( 'Activate %2$s', 'acx_csma_licence_tgmpa' );
2664
+ }
2665
+ }
2666
+
2667
+ // Create the actual links.
2668
+ foreach ( $actions as $action => $text ) {
2669
+ $nonce_url = wp_nonce_url(
2670
+ add_query_arg(
2671
+ array(
2672
+ 'plugin' => urlencode( $item['slug'] ),
2673
+ 'acx_csma_licence_tgmpa-' . $action => $action . '-plugin',
2674
+ ),
2675
+ $this->acx_csma_licence_tgmpa->get_acx_csma_licence_tgmpa_url()
2676
+ ),
2677
+ 'acx_csma_licence_tgmpa-' . $action,
2678
+ 'acx_csma_licence_tgmpa-nonce'
2679
+ );
2680
+
2681
+ $action_links[ $action ] = sprintf(
2682
+ '<a href="%1$s">' . esc_html( $text ) . '</a>', // $text contains the second placeholder.
2683
+ esc_url( $nonce_url ),
2684
+ '<span class="screen-reader-text">' . esc_html( $item['sanitized_plugin'] ) . '</span>'
2685
+ );
2686
+ }
2687
+
2688
+ $prefix = ( defined( 'WP_NETWORK_ADMIN' ) && WP_NETWORK_ADMIN ) ? 'network_admin_' : '';
2689
+ return apply_filters( "acx_csma_licence_tgmpa_{$prefix}plugin_action_links", array_filter( $action_links ), $item['slug'], $item, $this->view_context );
2690
+ }
2691
+
2692
+ /**
2693
+ * Generates content for a single row of the table.
2694
+ *
2695
+ * @since 2.5.0
2696
+ *
2697
+ * @param object $item The current item.
2698
+ */
2699
+ public function single_row( $item ) {
2700
+ parent::single_row( $item );
2701
+
2702
+ /**
2703
+ * Fires after each specific row in the ACX_CSMA_LICENCE_TGMPA Plugins list table.
2704
+ *
2705
+ * The dynamic portion of the hook name, `$item['slug']`, refers to the slug
2706
+ * for the plugin.
2707
+ *
2708
+ * @since 2.5.0
2709
+ */
2710
+ do_action( "acx_csma_licence_tgmpa_after_plugin_row_{$item['slug']}", $item['slug'], $item, $this->view_context );
2711
+ }
2712
+
2713
+ /**
2714
+ * Show the upgrade notice below a plugin row if there is one.
2715
+ *
2716
+ * @since 2.5.0
2717
+ *
2718
+ * @see /wp-admin/includes/update.php
2719
+ *
2720
+ * @param string $slug Plugin slug.
2721
+ * @param array $item The information available in this table row.
2722
+ * @return null Return early if upgrade notice is empty.
2723
+ */
2724
+ public function wp_plugin_update_row( $slug, $item ) {
2725
+ if ( empty( $item['upgrade_notice'] ) ) {
2726
+ return;
2727
+ }
2728
+
2729
+ echo '
2730
+ <tr class="plugin-update-tr">
2731
+ <td colspan="', absint( $this->get_column_count() ), '" class="plugin-update colspanchange">
2732
+ <div class="update-message">',
2733
+ esc_html__( 'Upgrade message from the plugin author:', 'acx_csma_licence_tgmpa' ),
2734
+ ' <strong>', wp_kses_data( $item['upgrade_notice'] ), '</strong>
2735
+ </div>
2736
+ </td>
2737
+ </tr>';
2738
+ }
2739
+
2740
+ /**
2741
+ * Extra controls to be displayed between bulk actions and pagination.
2742
+ *
2743
+ * @since 2.5.0
2744
+ *
2745
+ * @param string $which 'top' or 'bottom' table navigation.
2746
+ */
2747
+ public function extra_tablenav( $which ) {
2748
+ if ( 'bottom' === $which ) {
2749
+ $this->acx_csma_licence_tgmpa->show_acx_csma_licence_tgmpa_version();
2750
+ }
2751
+ }
2752
+
2753
+ /**
2754
+ * Defines the bulk actions for handling registered plugins.
2755
+ *
2756
+ * @since 2.2.0
2757
+ *
2758
+ * @return array $actions The bulk actions for the plugin install table.
2759
+ */
2760
+ public function get_bulk_actions() {
2761
+
2762
+ $actions = array();
2763
+
2764
+ if ( 'update' !== $this->view_context && 'activate' !== $this->view_context ) {
2765
+ if ( current_user_can( 'install_plugins' ) ) {
2766
+ $actions['acx_csma_licence_tgmpa-bulk-install'] = __( 'Install', 'acx_csma_licence_tgmpa' );
2767
+ }
2768
+ }
2769
+
2770
+ if ( 'install' !== $this->view_context ) {
2771
+ if ( current_user_can( 'update_plugins' ) ) {
2772
+ $actions['acx_csma_licence_tgmpa-bulk-update'] = __( 'Update', 'acx_csma_licence_tgmpa' );
2773
+ }
2774
+ if ( current_user_can( 'activate_plugins' ) ) {
2775
+ $actions['acx_csma_licence_tgmpa-bulk-activate'] = __( 'Activate', 'acx_csma_licence_tgmpa' );
2776
+ }
2777
+ }
2778
+
2779
+ return $actions;
2780
+ }
2781
+
2782
+ /**
2783
+ * Processes bulk installation and activation actions.
2784
+ *
2785
+ * The bulk installation process looks for the $_POST information and passes that
2786
+ * through if a user has to use WP_Filesystem to enter their credentials.
2787
+ *
2788
+ * @since 2.2.0
2789
+ */
2790
+ public function process_bulk_actions() {
2791
+ // Bulk installation process.
2792
+ if ( 'acx_csma_licence_tgmpa-bulk-install' === $this->current_action() || 'acx_csma_licence_tgmpa-bulk-update' === $this->current_action() ) {
2793
+
2794
+ check_admin_referer( 'bulk-' . $this->_args['plural'] );
2795
+
2796
+ $install_type = 'install';
2797
+ if ( 'acx_csma_licence_tgmpa-bulk-update' === $this->current_action() ) {
2798
+ $install_type = 'update';
2799
+ }
2800
+
2801
+ $plugins_to_install = array();
2802
+
2803
+ // Did user actually select any plugins to install/update ?
2804
+ if ( empty( $_POST['plugin'] ) ) {
2805
+ if ( 'install' === $install_type ) {
2806
+ $message = __( 'No plugins were selected to be installed. No action taken.', 'acx_csma_licence_tgmpa' );
2807
+ } else {
2808
+ $message = __( 'No plugins were selected to be updated. No action taken.', 'acx_csma_licence_tgmpa' );
2809
+ }
2810
+
2811
+ echo '<div id="message" class="error"><p>', esc_html( $message ), '</p></div>';
2812
+
2813
+ return false;
2814
+ }
2815
+
2816
+ if ( is_array( $_POST['plugin'] ) ) {
2817
+ $plugins_to_install = (array) $_POST['plugin'];
2818
+ } elseif ( is_string( $_POST['plugin'] ) ) {
2819
+ // Received via Filesystem page - un-flatten array (WP bug #19643).
2820
+ $plugins_to_install = explode( ',', $_POST['plugin'] );
2821
+ }
2822
+
2823
+ // Sanitize the received input.
2824
+ $plugins_to_install = array_map( 'urldecode', $plugins_to_install );
2825
+ $plugins_to_install = array_map( array( $this->acx_csma_licence_tgmpa, 'sanitize_key' ), $plugins_to_install );
2826
+
2827
+ // Validate the received input.
2828
+ foreach ( $plugins_to_install as $key => $slug ) {
2829
+ // Check if the plugin was registered with ACX_CSMA_LICENCE_TGMPA and remove if not.
2830
+ if ( ! isset( $this->acx_csma_licence_tgmpa->plugins[ $slug ] ) ) {
2831
+ unset( $plugins_to_install[ $key ] );
2832
+ continue;
2833
+ }
2834
+
2835
+ // For install: make sure this is a plugin we *can* install and not one already installed.
2836
+ if ( 'install' === $install_type && true === $this->acx_csma_licence_tgmpa->is_plugin_installed( $slug ) ) {
2837
+ unset( $plugins_to_install[ $key ] );
2838
+ }
2839
+
2840
+ // For updates: make sure this is a plugin we *can* update (update available and WP version ok).
2841
+ if ( 'update' === $install_type && false === $this->acx_csma_licence_tgmpa->is_plugin_updatetable( $slug ) ) {
2842
+ unset( $plugins_to_install[ $key ] );
2843
+ }
2844
+ }
2845
+
2846
+ // No need to proceed further if we have no plugins to handle.
2847
+ if ( empty( $plugins_to_install ) ) {
2848
+ if ( 'install' === $install_type ) {
2849
+ $message = __( 'No plugins are available to be installed at this time.', 'acx_csma_licence_tgmpa' );
2850
+ } else {
2851
+ $message = __( 'No plugins are available to be updated at this time.', 'acx_csma_licence_tgmpa' );
2852
+ }
2853
+
2854
+ echo '<div id="message" class="error"><p>', esc_html( $message ), '</p></div>';
2855
+
2856
+ return false;
2857
+ }
2858
+
2859
+ // Pass all necessary information if WP_Filesystem is needed.
2860
+ $url = wp_nonce_url(
2861
+ $this->acx_csma_licence_tgmpa->get_acx_csma_licence_tgmpa_url(),
2862
+ 'bulk-' . $this->_args['plural']
2863
+ );
2864
+
2865
+ // Give validated data back to $_POST which is the only place the filesystem looks for extra fields.
2866
+ $_POST['plugin'] = implode( ',', $plugins_to_install ); // Work around for WP bug #19643.
2867
+
2868
+ $method = ''; // Leave blank so WP_Filesystem can populate it as necessary.
2869
+ $fields = array_keys( $_POST ); // Extra fields to pass to WP_Filesystem.
2870
+
2871
+ if ( false === ( $creds = request_filesystem_credentials( esc_url_raw( $url ), $method, false, false, $fields ) ) ) {
2872
+ return true; // Stop the normal page form from displaying, credential request form will be shown.
2873
+ }
2874
+
2875
+ // Now we have some credentials, setup WP_Filesystem.
2876
+ if ( ! WP_Filesystem( $creds ) ) {
2877
+ // Our credentials were no good, ask the user for them again.
2878
+ request_filesystem_credentials( esc_url_raw( $url ), $method, true, false, $fields );
2879
+
2880
+ return true;
2881
+ }
2882
+
2883
+ /* If we arrive here, we have the filesystem */
2884
+
2885
+ // Store all information in arrays since we are processing a bulk installation.
2886
+ $names = array();
2887
+ $sources = array(); // Needed for installs.
2888
+ $file_paths = array(); // Needed for upgrades.
2889
+ $to_inject = array(); // Information to inject into the update_plugins transient.
2890
+
2891
+ // Prepare the data for validated plugins for the install/upgrade.
2892
+ foreach ( $plugins_to_install as $slug ) {
2893
+ $name = $this->acx_csma_licence_tgmpa->plugins[ $slug ]['name'];
2894
+ $source = $this->acx_csma_licence_tgmpa->get_download_url( $slug );
2895
+
2896
+ if ( ! empty( $name ) && ! empty( $source ) ) {
2897
+ $names[] = $name;
2898
+
2899
+ switch ( $install_type ) {
2900
+
2901
+ case 'install':
2902
+ $sources[] = $source;
2903
+ break;
2904
+
2905
+ case 'update':
2906
+ $file_paths[] = $this->acx_csma_licence_tgmpa->plugins[ $slug ]['file_path'];
2907
+ $to_inject[ $slug ] = $this->acx_csma_licence_tgmpa->plugins[ $slug ];
2908
+ $to_inject[ $slug ]['source'] = $source;
2909
+ break;
2910
+ }
2911
+ }
2912
+ }
2913
+ unset( $slug, $name, $source );
2914
+
2915
+ // Create a new instance of ACX_CSMA_LICENCE_TGMPA_Bulk_Installer.
2916
+ $installer = new ACX_CSMA_LICENCE_TGMPA_Bulk_Installer(
2917
+ new ACX_CSMA_LICENCE_TGMPA_Bulk_Installer_Skin(
2918
+ array(
2919
+ 'url' => esc_url_raw( $this->acx_csma_licence_tgmpa->get_acx_csma_licence_tgmpa_url() ),
2920
+ 'nonce' => 'bulk-' . $this->_args['plural'],
2921
+ 'names' => $names,
2922
+ 'install_type' => $install_type,
2923
+ )
2924
+ )
2925
+ );
2926
+
2927
+ // Wrap the install process with the appropriate HTML.
2928
+ echo '<div class="acx_csma_licence_tgmpa">',
2929
+ '<h2 style="font-size: 23px; font-weight: 400; line-height: 29px; margin: 0; padding: 9px 15px 4px 0;">', esc_html( get_admin_page_title() ), '</h2>
2930
+ <div class="update-php" style="width: 100%; height: 98%; min-height: 850px; padding-top: 1px;">';
2931
+
2932
+ // Process the bulk installation submissions.
2933
+ add_filter( 'upgrader_source_selection', array( $this->acx_csma_licence_tgmpa, 'maybe_adjust_source_dir' ), 1, 3 );
2934
+
2935
+ if ( 'acx_csma_licence_tgmpa-bulk-update' === $this->current_action() ) {
2936
+ // Inject our info into the update transient.
2937
+ $this->acx_csma_licence_tgmpa->inject_update_info( $to_inject );
2938
+
2939
+ $installer->bulk_upgrade( $file_paths );
2940
+ } else {
2941
+ $installer->bulk_install( $sources );
2942
+ }
2943
+
2944
+ remove_filter( 'upgrader_source_selection', array( $this->acx_csma_licence_tgmpa, 'maybe_adjust_source_dir' ), 1 );
2945
+
2946
+ echo '</div></div>';
2947
+
2948
+ return true;
2949
+ }
2950
+
2951
+ // Bulk activation process.
2952
+ if ( 'acx_csma_licence_tgmpa-bulk-activate' === $this->current_action() ) {
2953
+ check_admin_referer( 'bulk-' . $this->_args['plural'] );
2954
+
2955
+ // Did user actually select any plugins to activate ?
2956
+ if ( empty( $_POST['plugin'] ) ) {
2957
+ echo '<div id="message" class="error"><p>', esc_html__( 'No plugins were selected to be activated. No action taken.', 'acx_csma_licence_tgmpa' ), '</p></div>';
2958
+
2959
+ return false;
2960
+ }
2961
+
2962
+ // Grab plugin data from $_POST.
2963
+ $plugins = array();
2964
+ if ( isset( $_POST['plugin'] ) ) {
2965
+ $plugins = array_map( 'urldecode', (array) $_POST['plugin'] );
2966
+ $plugins = array_map( array( $this->acx_csma_licence_tgmpa, 'sanitize_key' ), $plugins );
2967
+ }
2968
+
2969
+ $plugins_to_activate = array();
2970
+ $plugin_names = array();
2971
+
2972
+ // Grab the file paths for the selected & inactive plugins from the registration array.
2973
+ foreach ( $plugins as $slug ) {
2974
+ if ( $this->acx_csma_licence_tgmpa->can_plugin_activate( $slug ) ) {
2975
+ $plugins_to_activate[] = $this->acx_csma_licence_tgmpa->plugins[ $slug ]['file_path'];
2976
+ $plugin_names[] = $this->acx_csma_licence_tgmpa->plugins[ $slug ]['name'];
2977
+ }
2978
+ }
2979
+ unset( $slug );
2980
+
2981
+ // Return early if there are no plugins to activate.
2982
+ if ( empty( $plugins_to_activate ) ) {
2983
+ echo '<div id="message" class="error"><p>', esc_html__( 'No plugins are available to be activated at this time.', 'acx_csma_licence_tgmpa' ), '</p></div>';
2984
+
2985
+ return false;
2986
+ }
2987
+
2988
+ // Now we are good to go - let's start activating plugins.
2989
+ $activate = activate_plugins( $plugins_to_activate );
2990
+
2991
+ if ( is_wp_error( $activate ) ) {
2992
+ echo '<div id="message" class="error"><p>', wp_kses_post( $activate->get_error_message() ), '</p></div>';
2993
+ } else {
2994
+ $count = count( $plugin_names ); // Count so we can use _n function.
2995
+ $plugin_names = array_map( array( 'ACX_CSMA_LICENCE_TGMPA_Utils', 'wrap_in_strong' ), $plugin_names );
2996
+ $last_plugin = array_pop( $plugin_names ); // Pop off last name to prep for readability.
2997
+ $imploded = empty( $plugin_names ) ? $last_plugin : ( implode( ', ', $plugin_names ) . ' ' . esc_html_x( 'and', 'plugin A *and* plugin B', 'acx_csma_licence_tgmpa' ) . ' ' . $last_plugin );
2998
+
2999
+ printf( // WPCS: xss ok.
3000
+ '<div id="message" class="updated"><p>%1$s %2$s.</p></div>',
3001
+ esc_html( _n( 'The following plugin was activated successfully:', 'The following plugins were activated successfully:', $count, 'acx_csma_licence_tgmpa' ) ),
3002
+ $imploded
3003
+ );
3004
+
3005
+ // Update recently activated plugins option.
3006
+ $recent = (array) get_option( 'recently_activated' );
3007
+ foreach ( $plugins_to_activate as $plugin => $time ) {
3008
+ if ( isset( $recent[ $plugin ] ) ) {
3009
+ unset( $recent[ $plugin ] );
3010
+ }
3011
+ }
3012
+ update_option( 'recently_activated', $recent );
3013
+ }
3014
+
3015
+ unset( $_POST ); // Reset the $_POST variable in case user wants to perform one action after another.
3016
+
3017
+ return true;
3018
+ }
3019
+
3020
+ return false;
3021
+ }
3022
+
3023
+ /**
3024
+ * Prepares all of our information to be outputted into a usable table.
3025
+ *
3026
+ * @since 2.2.0
3027
+ */
3028
+ public function prepare_items() {
3029
+ $columns = $this->get_columns(); // Get all necessary column information.
3030
+ $hidden = array(); // No columns to hide, but we must set as an array.
3031
+ $sortable = array(); // No reason to make sortable columns.
3032
+ $primary = $this->get_primary_column_name(); // Column which has the row actions.
3033
+ $this->_column_headers = array( $columns, $hidden, $sortable, $primary ); // Get all necessary column headers.
3034
+
3035
+ // Process our bulk activations here.
3036
+ if ( 'acx_csma_licence_tgmpa-bulk-activate' === $this->current_action() ) {
3037
+ $this->process_bulk_actions();
3038
+ }
3039
+
3040
+ // Store all of our plugin data into $items array so WP_List_Table can use it.
3041
+ $this->items = apply_filters( 'acx_csma_licence_tgmpa_table_data_items', $this->_gather_plugin_data() );
3042
+ }
3043
+
3044
+ /* *********** DEPRECATED METHODS *********** */
3045
+
3046
+ /**
3047
+ * Retrieve plugin data, given the plugin name.
3048
+ *
3049
+ * @since 2.2.0
3050
+ * @deprecated 2.5.0 use {@see ACX_CSMA_LICENCE_TGM_Plugin_Activation::_get_plugin_data_from_name()} instead.
3051
+ * @see ACX_CSMA_LICENCE_TGM_Plugin_Activation::_get_plugin_data_from_name()
3052
+ *
3053
+ * @param string $name Name of the plugin, as it was registered.
3054
+ * @param string $data Optional. Array key of plugin data to return. Default is slug.
3055
+ * @return string|boolean Plugin slug if found, false otherwise.
3056
+ */
3057
+ protected function _get_plugin_data_from_name( $name, $data = 'slug' ) {
3058
+ _deprecated_function( __FUNCTION__, 'ACX_CSMA_LICENCE_TGMPA 2.5.0', 'ACX_CSMA_LICENCE_TGM_Plugin_Activation::_get_plugin_data_from_name()' );
3059
+
3060
+ return $this->acx_csma_licence_tgmpa->_get_plugin_data_from_name( $name, $data );
3061
+ }
3062
+ }
3063
+ }
3064
+
3065
+
3066
+ if ( ! class_exists( 'ACX_CSMA_LICENCE_TGM_Bulk_Installer' ) ) {
3067
+
3068
+ /**
3069
+ * Hack: Prevent ACX_CSMA_LICENCE_TGMPA v2.4.1- bulk installer class from being loaded if 2.4.1- is loaded after 2.5+.
3070
+ *
3071
+ * @since 2.5.2
3072
+ *
3073
+ * {@internal The ACX_CSMA_LICENCE_TGMPA_Bulk_Installer class was originally called ACX_CSMA_LICENCE_TGM_Bulk_Installer.
3074
+ * For more information, see that class.}}
3075
+ */
3076
+ class ACX_CSMA_LICENCE_TGM_Bulk_Installer {
3077
+ }
3078
+ }
3079
+ if ( ! class_exists( 'ACX_CSMA_LICENCE_TGM_Bulk_Installer_Skin' ) ) {
3080
+
3081
+ /**
3082
+ * Hack: Prevent ACX_CSMA_LICENCE_TGMPA v2.4.1- bulk installer skin class from being loaded if 2.4.1- is loaded after 2.5+.
3083
+ *
3084
+ * @since 2.5.2
3085
+ *
3086
+ * {@internal The ACX_CSMA_LICENCE_TGMPA_Bulk_Installer_Skin class was originally called ACX_CSMA_LICENCE_TGM_Bulk_Installer_Skin.
3087
+ * For more information, see that class.}}
3088
+ */
3089
+ class ACX_CSMA_LICENCE_TGM_Bulk_Installer_Skin {
3090
+ }
3091
+ }
3092
+
3093
+ /**
3094
+ * The WP_Upgrader file isn't always available. If it isn't available,
3095
+ * we load it here.
3096
+ *
3097
+ * We check to make sure no action or activation keys are set so that WordPress
3098
+ * does not try to re-include the class when processing upgrades or installs outside
3099
+ * of the class.
3100
+ *
3101
+ * @since 2.2.0
3102
+ */
3103
+ add_action( 'admin_init', 'acx_csma_licence_tgmpa_load_bulk_installer' );
3104
+ if ( ! function_exists( 'acx_csma_licence_tgmpa_load_bulk_installer' ) ) {
3105
+ /**
3106
+ * Load bulk installer
3107
+ */
3108
+ function acx_csma_licence_tgmpa_load_bulk_installer() {
3109
+ // Silently fail if 2.5+ is loaded *after* an older version.
3110
+ if ( ! isset( $GLOBALS['acx_csma_licence_tgmpa'] ) ) {
3111
+ return;
3112
+ }
3113
+
3114
+ // Get ACX_CSMA_LICENCE_TGMPA class instance.
3115
+ $acx_csma_licence_tgmpa_instance = call_user_func( array( get_class( $GLOBALS['acx_csma_licence_tgmpa'] ), 'get_instance' ) );
3116
+
3117
+ if ( isset( $_GET['page'] ) && $acx_csma_licence_tgmpa_instance ->menu === $_GET['page'] ) {
3118
+ if ( ! class_exists( 'Plugin_Upgrader', false ) ) {
3119
+ require_once ABSPATH . 'wp-admin/includes/class-wp-upgrader.php';
3120
+ }
3121
+
3122
+ if ( ! class_exists( 'ACX_CSMA_LICENCE_TGMPA_Bulk_Installer' ) ) {
3123
+
3124
+ /**
3125
+ * Installer class to handle bulk plugin installations.
3126
+ *
3127
+ * Extends WP_Upgrader and customizes to suit the installation of multiple
3128
+ * plugins.
3129
+ *
3130
+ * @since 2.2.0
3131
+ *
3132
+ * {@internal Since 2.5.0 the class is an extension of Plugin_Upgrader rather than WP_Upgrader.}}
3133
+ * {@internal Since 2.5.2 the class has been renamed from ACX_CSMA_LICENCE_TGM_Bulk_Installer to ACX_CSMA_LICENCE_TGMPA_Bulk_Installer.
3134
+ * This was done to prevent backward compatibility issues with v2.3.6.}}
3135
+ *
3136
+ * @package ACX_CSMA_LICENCE_TGM-Plugin-Activation
3137
+ * @author Thomas Griffin
3138
+ * @author Gary Jones
3139
+ */
3140
+ class ACX_CSMA_LICENCE_TGMPA_Bulk_Installer extends Plugin_Upgrader {
3141
+ /**
3142
+ * Holds result of bulk plugin installation.
3143
+ *
3144
+ * @since 2.2.0
3145
+ *
3146
+ * @var string
3147
+ */
3148
+ public $result;
3149
+
3150
+ /**
3151
+ * Flag to check if bulk installation is occurring or not.
3152
+ *
3153
+ * @since 2.2.0
3154
+ *
3155
+ * @var boolean
3156
+ */
3157
+ public $bulk = false;
3158
+
3159
+ /**
3160
+ * ACX_CSMA_LICENCE_TGMPA instance
3161
+ *
3162
+ * @since 2.5.0
3163
+ *
3164
+ * @var object
3165
+ */
3166
+ protected $acx_csma_licence_tgmpa;
3167
+
3168
+ /**
3169
+ * Whether or not the destination directory needs to be cleared ( = on update).
3170
+ *
3171
+ * @since 2.5.0
3172
+ *
3173
+ * @var bool
3174
+ */
3175
+ protected $clear_destination = false;
3176
+
3177
+ /**
3178
+ * References parent constructor and sets defaults for class.
3179
+ *
3180
+ * @since 2.2.0
3181
+ *
3182
+ * @param \Bulk_Upgrader_Skin|null $skin Installer skin.
3183
+ */
3184
+ public function __construct( $skin = null ) {
3185
+ // Get ACX_CSMA_LICENCE_TGMPA class instance.
3186
+ $this->acx_csma_licence_tgmpa = call_user_func( array( get_class( $GLOBALS['acx_csma_licence_tgmpa'] ), 'get_instance' ) );
3187
+
3188
+ parent::__construct( $skin );
3189
+
3190
+ if ( isset( $this->skin->options['install_type'] ) && 'update' === $this->skin->options['install_type'] ) {
3191
+ $this->clear_destination = true;
3192
+ }
3193
+
3194
+ if ( $this->acx_csma_licence_tgmpa->is_automatic ) {
3195
+ $this->activate_strings();
3196
+ }
3197
+
3198
+ add_action( 'upgrader_process_complete', array( $this->acx_csma_licence_tgmpa, 'populate_file_path' ) );
3199
+ }
3200
+
3201
+ /**
3202
+ * Sets the correct activation strings for the installer skin to use.
3203
+ *
3204
+ * @since 2.2.0
3205
+ */
3206
+ public function activate_strings() {
3207
+ $this->strings['activation_failed'] = __( 'Plugin activation failed.', 'acx_csma_licence_tgmpa' );
3208
+ $this->strings['activation_success'] = __( 'Plugin activated successfully.', 'acx_csma_licence_tgmpa' );
3209
+ }
3210
+
3211
+ /**
3212
+ * Performs the actual installation of each plugin.
3213
+ *
3214
+ * @since 2.2.0
3215
+ *
3216
+ * @see WP_Upgrader::run()
3217
+ *
3218
+ * @param array $options The installation config options.
3219
+ * @return null|array Return early if error, array of installation data on success.
3220
+ */
3221
+ public function run( $options ) {
3222
+ $result = parent::run( $options );
3223
+
3224
+ // Reset the strings in case we changed one during automatic activation.
3225
+ if ( $this->acx_csma_licence_tgmpa->is_automatic ) {
3226
+ if ( 'update' === $this->skin->options['install_type'] ) {
3227
+ $this->upgrade_strings();
3228
+ } else {
3229
+ $this->install_strings();
3230
+ }
3231
+ }
3232
+
3233
+ return $result;
3234
+ }
3235
+
3236
+ /**
3237
+ * Processes the bulk installation of plugins.
3238
+ *
3239
+ * @since 2.2.0
3240
+ *
3241
+ * {@internal This is basically a near identical copy of the WP Core
3242
+ * Plugin_Upgrader::bulk_upgrade() method, with minor adjustments to deal with
3243
+ * new installs instead of upgrades.
3244
+ * For ease of future synchronizations, the adjustments are clearly commented, but no other
3245
+ * comments are added. Code style has been made to comply.}}
3246
+ *
3247
+ * @see Plugin_Upgrader::bulk_upgrade()
3248
+ * @see https://core.trac.wordpress.org/browser/tags/4.2.1/src/wp-admin/includes/class-wp-upgrader.php#L838
3249
+ * (@internal Last synced: Dec 31st 2015 against https://core.trac.wordpress.org/browser/trunk?rev=36134}}
3250
+ *
3251
+ * @param array $plugins The plugin sources needed for installation.
3252
+ * @param array $args Arbitrary passed extra arguments.
3253
+ * @return array|false Install confirmation messages on success, false on failure.
3254
+ */
3255
+ public function bulk_install( $plugins, $args = array() ) {
3256
+ // [ACX_CSMA_LICENCE_TGMPA + ] Hook auto-activation in.
3257
+ add_filter( 'upgrader_post_install', array( $this, 'auto_activate' ), 10 );
3258
+
3259
+ $defaults = array(
3260
+ 'clear_update_cache' => true,
3261
+ );
3262
+ $parsed_args = wp_parse_args( $args, $defaults );
3263
+
3264
+ $this->init();
3265
+ $this->bulk = true;
3266
+
3267
+ $this->install_strings(); // [ACX_CSMA_LICENCE_TGMPA + ] adjusted.
3268
+
3269
+ /* [ACX_CSMA_LICENCE_TGMPA - ] $current = get_site_transient( 'update_plugins' ); */
3270
+
3271
+ /* [ACX_CSMA_LICENCE_TGMPA - ] add_filter('upgrader_clear_destination', array($this, 'delete_old_plugin'), 10, 4); */
3272
+
3273
+ $this->skin->header();
3274
+
3275
+ // Connect to the Filesystem first.
3276
+ $res = $this->fs_connect( array( WP_CONTENT_DIR, WP_PLUGIN_DIR ) );
3277
+ if ( ! $res ) {
3278
+ $this->skin->footer();
3279
+ return false;
3280
+ }
3281
+
3282
+ $this->skin->bulk_header();
3283
+
3284
+ /*
3285
+ * Only start maintenance mode if:
3286
+ * - running Multisite and there are one or more plugins specified, OR
3287
+ * - a plugin with an update available is currently active.
3288
+ * @TODO: For multisite, maintenance mode should only kick in for individual sites if at all possible.
3289
+ */
3290
+ $maintenance = ( is_multisite() && ! empty( $plugins ) );
3291
+
3292
+ /*
3293
+ [ACX_CSMA_LICENCE_TGMPA - ]
3294
+ foreach ( $plugins as $plugin )
3295
+ $maintenance = $maintenance || ( is_plugin_active( $plugin ) && isset( $current->response[ $plugin] ) );
3296
+ */
3297
+ if ( $maintenance ) {
3298
+ $this->maintenance_mode( true );
3299
+ }
3300
+
3301
+ $results = array();
3302
+
3303
+ $this->update_count = count( $plugins );
3304
+ $this->update_current = 0;
3305
+ foreach ( $plugins as $plugin ) {
3306
+ $this->update_current++;
3307
+
3308
+ /*
3309
+ [ACX_CSMA_LICENCE_TGMPA - ]
3310
+ $this->skin->plugin_info = get_plugin_data( WP_PLUGIN_DIR . '/' . $plugin, false, true);
3311
+
3312
+ if ( !isset( $current->response[ $plugin ] ) ) {
3313
+ $this->skin->set_result('up_to_date');
3314
+ $this->skin->before();
3315
+ $this->skin->feedback('up_to_date');
3316
+ $this->skin->after();
3317
+ $results[$plugin] = true;
3318
+ continue;
3319
+ }
3320
+
3321
+ // Get the URL to the zip file.
3322
+ $r = $current->response[ $plugin ];
3323
+
3324
+ $this->skin->plugin_active = is_plugin_active($plugin);
3325
+ */
3326
+
3327
+ $result = $this->run(
3328
+ array(
3329
+ 'package' => $plugin, // [ACX_CSMA_LICENCE_TGMPA + ] adjusted.
3330
+ 'destination' => WP_PLUGIN_DIR,
3331
+ 'clear_destination' => false, // [ACX_CSMA_LICENCE_TGMPA + ] adjusted.
3332
+ 'clear_working' => true,
3333
+ 'is_multi' => true,
3334
+ 'hook_extra' => array(
3335
+ 'plugin' => $plugin,
3336
+ ),
3337
+ )
3338
+ );
3339
+
3340
+ $results[ $plugin ] = $this->result;
3341
+
3342
+ // Prevent credentials auth screen from displaying multiple times.
3343
+ if ( false === $result ) {
3344
+ break;
3345
+ }
3346
+ } //end foreach $plugins
3347
+
3348
+ $this->maintenance_mode( false );
3349
+
3350
+ /**
3351
+ * Fires when the bulk upgrader process is complete.
3352
+ *
3353
+ * @since WP 3.6.0 / ACX_CSMA_LICENCE_TGMPA 2.5.0
3354
+ *
3355
+ * @param Plugin_Upgrader $this Plugin_Upgrader instance. In other contexts, $this, might
3356
+ * be a Theme_Upgrader or Core_Upgrade instance.
3357
+ * @param array $data {
3358
+ * Array of bulk item update data.
3359
+ *
3360
+ * @type string $action Type of action. Default 'update'.
3361
+ * @type string $type Type of update process. Accepts 'plugin', 'theme', or 'core'.
3362
+ * @type bool $bulk Whether the update process is a bulk update. Default true.
3363
+ * @type array $packages Array of plugin, theme, or core packages to update.
3364
+ * }
3365
+ */
3366
+ do_action( 'upgrader_process_complete', $this, array(
3367
+ 'action' => 'install', // [ACX_CSMA_LICENCE_TGMPA + ] adjusted.
3368
+ 'type' => 'plugin',
3369
+ 'bulk' => true,
3370
+ 'plugins' => $plugins,
3371
+ ) );
3372
+
3373
+ $this->skin->bulk_footer();
3374
+
3375
+ $this->skin->footer();
3376
+
3377
+ // Cleanup our hooks, in case something else does a upgrade on this connection.
3378
+ /* [ACX_CSMA_LICENCE_TGMPA - ] remove_filter('upgrader_clear_destination', array($this, 'delete_old_plugin')); */
3379
+
3380
+ // [ACX_CSMA_LICENCE_TGMPA + ] Remove our auto-activation hook.
3381
+ remove_filter( 'upgrader_post_install', array( $this, 'auto_activate' ), 10 );
3382
+
3383
+ // Force refresh of plugin update information.
3384
+ wp_clean_plugins_cache( $parsed_args['clear_update_cache'] );
3385
+
3386
+ return $results;
3387
+ }
3388
+
3389
+ /**
3390
+ * Handle a bulk upgrade request.
3391
+ *
3392
+ * @since 2.5.0
3393
+ *
3394
+ * @see Plugin_Upgrader::bulk_upgrade()
3395
+ *
3396
+ * @param array $plugins The local WP file_path's of the plugins which should be upgraded.
3397
+ * @param array $args Arbitrary passed extra arguments.
3398
+ * @return string|bool Install confirmation messages on success, false on failure.
3399
+ */
3400
+ public function bulk_upgrade( $plugins, $args = array() ) {
3401
+
3402
+ add_filter( 'upgrader_post_install', array( $this, 'auto_activate' ), 10 );
3403
+
3404
+ $result = parent::bulk_upgrade( $plugins, $args );
3405
+
3406
+ remove_filter( 'upgrader_post_install', array( $this, 'auto_activate' ), 10 );
3407
+
3408
+ return $result;
3409
+ }
3410
+
3411
+ /**
3412
+ * Abuse a filter to auto-activate plugins after installation.
3413
+ *
3414
+ * Hooked into the 'upgrader_post_install' filter hook.
3415
+ *
3416
+ * @since 2.5.0
3417
+ *
3418
+ * @param bool $bool The value we need to give back (true).
3419
+ * @return bool
3420
+ */
3421
+ public function auto_activate( $bool ) {
3422
+ // Only process the activation of installed plugins if the automatic flag is set to true.
3423
+ if ( $this->acx_csma_licence_tgmpa->is_automatic ) {
3424
+ // Flush plugins cache so the headers of the newly installed plugins will be read correctly.
3425
+ wp_clean_plugins_cache();
3426
+
3427
+ // Get the installed plugin file.
3428
+ $plugin_info = $this->plugin_info();
3429
+
3430
+ // Don't try to activate on upgrade of active plugin as WP will do this already.
3431
+ if ( ! is_plugin_active( $plugin_info ) ) {
3432
+ $activate = activate_plugin( $plugin_info );
3433
+
3434
+ // Adjust the success string based on the activation result.
3435
+ $this->strings['process_success'] = $this->strings['process_success'] . "<br />\n";
3436
+
3437
+ if ( is_wp_error( $activate ) ) {
3438
+ $this->skin->error( $activate );
3439
+ $this->strings['process_success'] .= $this->strings['activation_failed'];
3440
+ } else {
3441
+ $this->strings['process_success'] .= $this->strings['activation_success'];
3442
+ }
3443
+ }
3444
+ }
3445
+
3446
+ return $bool;
3447
+ }
3448
+ }
3449
+ }
3450
+
3451
+ if ( ! class_exists( 'ACX_CSMA_LICENCE_TGMPA_Bulk_Installer_Skin' ) ) {
3452
+
3453
+ /**
3454
+ * Installer skin to set strings for the bulk plugin installations..
3455
+ *
3456
+ * Extends Bulk_Upgrader_Skin and customizes to suit the installation of multiple
3457
+ * plugins.
3458
+ *
3459
+ * @since 2.2.0
3460
+ *
3461
+ * {@internal Since 2.5.2 the class has been renamed from ACX_CSMA_LICENCE_TGM_Bulk_Installer_Skin to
3462
+ * ACX_CSMA_LICENCE_TGMPA_Bulk_Installer_Skin.
3463
+ * This was done to prevent backward compatibility issues with v2.3.6.}}
3464
+ *
3465
+ * @see https://core.trac.wordpress.org/browser/trunk/src/wp-admin/includes/class-wp-upgrader-skins.php
3466
+ *
3467
+ * @package ACX_CSMA_LICENCE_TGM-Plugin-Activation
3468
+ * @author Thomas Griffin
3469
+ * @author Gary Jones
3470
+ */
3471
+ class ACX_CSMA_LICENCE_TGMPA_Bulk_Installer_Skin extends Bulk_Upgrader_Skin {
3472
+ /**
3473
+ * Holds plugin info for each individual plugin installation.
3474
+ *
3475
+ * @since 2.2.0
3476
+ *
3477
+ * @var array
3478
+ */
3479
+ public $plugin_info = array();
3480
+
3481
+ /**
3482
+ * Holds names of plugins that are undergoing bulk installations.
3483
+ *
3484
+ * @since 2.2.0
3485
+ *
3486
+ * @var array
3487
+ */
3488
+ public $plugin_names = array();
3489
+
3490
+ /**
3491
+ * Integer to use for iteration through each plugin installation.
3492
+ *
3493
+ * @since 2.2.0
3494
+ *
3495
+ * @var integer
3496
+ */
3497
+ public $i = 0;
3498
+
3499
+ /**
3500
+ * ACX_CSMA_LICENCE_TGMPA instance
3501
+ *
3502
+ * @since 2.5.0
3503
+ *
3504
+ * @var object
3505
+ */
3506
+ protected $acx_csma_licence_tgmpa;
3507
+
3508
+ /**
3509
+ * Constructor. Parses default args with new ones and extracts them for use.
3510
+ *
3511
+ * @since 2.2.0
3512
+ *
3513
+ * @param array $args Arguments to pass for use within the class.
3514
+ */
3515
+ public function __construct( $args = array() ) {
3516
+ // Get ACX_CSMA_LICENCE_TGMPA class instance.
3517
+ $this->acx_csma_licence_tgmpa = call_user_func( array( get_class( $GLOBALS['acx_csma_licence_tgmpa'] ), 'get_instance' ) );
3518
+
3519
+ // Parse default and new args.
3520
+ $defaults = array(
3521
+ 'url' => '',
3522
+ 'nonce' => '',
3523
+ 'names' => array(),
3524
+ 'install_type' => 'install',
3525
+ );
3526
+ $args = wp_parse_args( $args, $defaults );
3527
+
3528
+ // Set plugin names to $this->plugin_names property.
3529
+ $this->plugin_names = $args['names'];
3530
+
3531
+ // Extract the new args.
3532
+ parent::__construct( $args );
3533
+ }
3534
+
3535
+ /**
3536
+ * Sets install skin strings for each individual plugin.
3537
+ *
3538
+ * Checks to see if the automatic activation flag is set and uses the
3539
+ * the proper strings accordingly.
3540
+ *
3541
+ * @since 2.2.0
3542
+ */
3543
+ public function add_strings() {
3544
+ if ( 'update' === $this->options['install_type'] ) {
3545
+ parent::add_strings();
3546
+ $this->upgrader->strings['skin_before_update_header'] = __( 'Updating Plugin %1$s (%2$d/%3$d)', 'acx_csma_licence_tgmpa' );
3547
+ } else {
3548
+ $this->upgrader->strings['skin_update_failed_error'] = __( 'An error occurred while installing %1$s: <strong>%2$s</strong>.', 'acx_csma_licence_tgmpa' );
3549
+ $this->upgrader->strings['skin_update_failed'] = __( 'The installation of %1$s failed.', 'acx_csma_licence_tgmpa' );
3550
+
3551
+ if ( $this->acx_csma_licence_tgmpa->is_automatic ) {
3552
+ // Automatic activation strings.
3553
+ $this->upgrader->strings['skin_upgrade_start'] = __( 'The installation and activation process is starting. This process may take a while on some hosts, so please be patient.', 'acx_csma_licence_tgmpa' );
3554
+ $this->upgrader->strings['skin_update_successful'] = __( '%1$s installed and activated successfully.', 'acx_csma_licence_tgmpa' ) . ' <a href="#" class="hide-if-no-js" onclick="%2$s"><span>' . esc_html__( 'Show Details', 'acx_csma_licence_tgmpa' ) . '</span><span class="hidden">' . esc_html__( 'Hide Details', 'acx_csma_licence_tgmpa' ) . '</span>.</a>';
3555
+ $this->upgrader->strings['skin_upgrade_end'] = __( 'All installations and activations have been completed.', 'acx_csma_licence_tgmpa' );
3556
+ $this->upgrader->strings['skin_before_update_header'] = __( 'Installing and Activating Plugin %1$s (%2$d/%3$d)', 'acx_csma_licence_tgmpa' );
3557
+ } else {
3558
+ // Default installation strings.
3559
+ $this->upgrader->strings['skin_upgrade_start'] = __( 'The installation process is starting. This process may take a while on some hosts, so please be patient.', 'acx_csma_licence_tgmpa' );
3560
+ $this->upgrader->strings['skin_update_successful'] = esc_html__( '%1$s installed successfully.', 'acx_csma_licence_tgmpa' ) . ' <a href="#" class="hide-if-no-js" onclick="%2$s"><span>' . esc_html__( 'Show Details', 'acx_csma_licence_tgmpa' ) . '</span><span class="hidden">' . esc_html__( 'Hide Details', 'acx_csma_licence_tgmpa' ) . '</span>.</a>';
3561
+ $this->upgrader->strings['skin_upgrade_end'] = __( 'All installations have been completed.', 'acx_csma_licence_tgmpa' );
3562
+ $this->upgrader->strings['skin_before_update_header'] = __( 'Installing Plugin %1$s (%2$d/%3$d)', 'acx_csma_licence_tgmpa' );
3563
+ }
3564
+ }
3565
+ }
3566
+
3567
+ /**
3568
+ * Outputs the header strings and necessary JS before each plugin installation.
3569
+ *
3570
+ * @since 2.2.0
3571
+ *
3572
+ * @param string $title Unused in this implementation.
3573
+ */
3574
+ public function before( $title = '' ) {
3575
+ if ( empty( $title ) ) {
3576
+ $title = esc_html( $this->plugin_names[ $this->i ] );
3577
+ }
3578
+ parent::before( $title );
3579
+ }
3580
+
3581
+ /**
3582
+ * Outputs the footer strings and necessary JS after each plugin installation.
3583
+ *
3584
+ * Checks for any errors and outputs them if they exist, else output
3585
+ * success strings.
3586
+ *
3587
+ * @since 2.2.0
3588
+ *
3589
+ * @param string $title Unused in this implementation.
3590
+ */
3591
+ public function after( $title = '' ) {
3592
+ if ( empty( $title ) ) {
3593
+ $title = esc_html( $this->plugin_names[ $this->i ] );
3594
+ }
3595
+ parent::after( $title );
3596
+
3597
+ $this->i++;
3598
+ }
3599
+
3600
+ /**
3601
+ * Outputs links after bulk plugin installation is complete.
3602
+ *
3603
+ * @since 2.2.0
3604
+ */
3605
+ public function bulk_footer() {
3606
+ // Serve up the string to say installations (and possibly activations) are complete.
3607
+ parent::bulk_footer();
3608
+
3609
+ // Flush plugins cache so we can make sure that the installed plugins list is always up to date.
3610
+ wp_clean_plugins_cache();
3611
+
3612
+ $this->acx_csma_licence_tgmpa->show_acx_csma_licence_tgmpa_version();
3613
+
3614
+ // Display message based on if all plugins are now active or not.
3615
+ $update_actions = array();
3616
+
3617
+ if ( $this->acx_csma_licence_tgmpa->is_acx_csma_licence_tgmpa_complete() ) {
3618
+ // All plugins are active, so we display the complete string and hide the menu to protect users.
3619
+ echo '<style type="text/css">#adminmenu .wp-submenu li.current { display: none !important; }</style>';
3620
+ $update_actions['dashboard'] = sprintf(
3621
+ esc_html( $this->acx_csma_licence_tgmpa->strings['complete'] ),
3622
+ '<a href="' . esc_url( self_admin_url() ) . '">' . esc_html__( 'Return to the Dashboard', 'acx_csma_licence_tgmpa' ) . '</a>'
3623
+ );
3624
+ } else {
3625
+ $update_actions['acx_csma_licence_tgmpa_page'] = '<a href="' . esc_url( $this->acx_csma_licence_tgmpa->get_acx_csma_licence_tgmpa_url() ) . '" target="_parent">' . esc_html( $this->acx_csma_licence_tgmpa->strings['return'] ) . '</a>';
3626
+ }
3627
+
3628
+ /**
3629
+ * Filter the list of action links available following bulk plugin installs/updates.
3630
+ *
3631
+ * @since 2.5.0
3632
+ *
3633
+ * @param array $update_actions Array of plugin action links.
3634
+ * @param array $plugin_info Array of information for the last-handled plugin.
3635
+ */
3636
+ $update_actions = apply_filters( 'acx_csma_licence_tgmpa_update_bulk_plugins_complete_actions', $update_actions, $this->plugin_info );
3637
+
3638
+ if ( ! empty( $update_actions ) ) {
3639
+ $this->feedback( implode( ' | ', (array) $update_actions ) );
3640
+ }
3641
+ }
3642
+
3643
+ /* *********** DEPRECATED METHODS *********** */
3644
+
3645
+ /**
3646
+ * Flush header output buffer.
3647
+ *
3648
+ * @since 2.2.0
3649
+ * @deprecated 2.5.0 use {@see Bulk_Upgrader_Skin::flush_output()} instead
3650
+ * @see Bulk_Upgrader_Skin::flush_output()
3651
+ */
3652
+ public function before_flush_output() {
3653
+ _deprecated_function( __FUNCTION__, 'ACX_CSMA_LICENCE_TGMPA 2.5.0', 'Bulk_Upgrader_Skin::flush_output()' );
3654
+ $this->flush_output();
3655
+ }
3656
+
3657
+ /**
3658
+ * Flush footer output buffer and iterate $this->i to make sure the
3659
+ * installation strings reference the correct plugin.
3660
+ *
3661
+ * @since 2.2.0
3662
+ * @deprecated 2.5.0 use {@see Bulk_Upgrader_Skin::flush_output()} instead
3663
+ * @see Bulk_Upgrader_Skin::flush_output()
3664
+ */
3665
+ public function after_flush_output() {
3666
+ _deprecated_function( __FUNCTION__, 'ACX_CSMA_LICENCE_TGMPA 2.5.0', 'Bulk_Upgrader_Skin::flush_output()' );
3667
+ $this->flush_output();
3668
+ $this->i++;
3669
+ }
3670
+ }
3671
+ }
3672
+ }
3673
+ }
3674
+ }
3675
+
3676
+ if ( ! class_exists( 'ACX_CSMA_LICENCE_TGMPA_Utils' ) ) {
3677
+
3678
+ /**
3679
+ * Generic utilities for ACX_CSMA_LICENCE_TGMPA.
3680
+ *
3681
+ * All methods are static, poor-dev name-spacing class wrapper.
3682
+ *
3683
+ * Class was called ACX_CSMA_LICENCE_TGM_Utils in 2.5.0 but renamed ACX_CSMA_LICENCE_TGMPA_Utils in 2.5.1 as this was conflicting with Soliloquy.
3684
+ *
3685
+ * @since 2.5.0
3686
+ *
3687
+ * @package ACX_CSMA_LICENCE_TGM-Plugin-Activation
3688
+ * @author Juliette Reinders Folmer
3689
+ */
3690
+ class ACX_CSMA_LICENCE_TGMPA_Utils {
3691
+ /**
3692
+ * Whether the PHP filter extension is enabled.
3693
+ *
3694
+ * @see http://php.net/book.filter
3695
+ *
3696
+ * @since 2.5.0
3697
+ *
3698
+ * @static
3699
+ *
3700
+ * @var bool $has_filters True is the extension is enabled.
3701
+ */
3702
+ public static $has_filters;
3703
+
3704
+ /**
3705
+ * Wrap an arbitrary string in <em> tags. Meant to be used in combination with array_map().
3706
+ *
3707
+ * @since 2.5.0
3708
+ *
3709
+ * @static
3710
+ *
3711
+ * @param string $string Text to be wrapped.
3712
+ * @return string
3713
+ */
3714
+ public static function wrap_in_em( $string ) {
3715
+ return '<em>' . wp_kses_post( $string ) . '</em>';
3716
+ }
3717
+
3718
+ /**
3719
+ * Wrap an arbitrary string in <strong> tags. Meant to be used in combination with array_map().
3720
+ *
3721
+ * @since 2.5.0
3722
+ *
3723
+ * @static
3724
+ *
3725
+ * @param string $string Text to be wrapped.
3726
+ * @return string
3727
+ */
3728
+ public static function wrap_in_strong( $string ) {
3729
+ return '<strong>' . wp_kses_post( $string ) . '</strong>';
3730
+ }
3731
+
3732
+ /**
3733
+ * Helper function: Validate a value as boolean
3734
+ *
3735
+ * @since 2.5.0
3736
+ *
3737
+ * @static
3738
+ *
3739
+ * @param mixed $value Arbitrary value.
3740
+ * @return bool
3741
+ */
3742
+ public static function validate_bool( $value ) {
3743
+ if ( ! isset( self::$has_filters ) ) {
3744
+ self::$has_filters = extension_loaded( 'filter' );
3745
+ }
3746
+
3747
+ if ( self::$has_filters ) {
3748
+ return filter_var( $value, FILTER_VALIDATE_BOOLEAN );
3749
+ } else {
3750
+ return self::emulate_filter_bool( $value );
3751
+ }
3752
+ }
3753
+
3754
+ /**
3755
+ * Helper function: Cast a value to bool
3756
+ *
3757
+ * @since 2.5.0
3758
+ *
3759
+ * @static
3760
+ *
3761
+ * @param mixed $value Value to cast.
3762
+ * @return bool
3763
+ */
3764
+ protected static function emulate_filter_bool( $value ) {
3765
+ // @codingStandardsIgnoreStart
3766
+ static $true = array(
3767
+ '1',
3768
+ 'true', 'True', 'TRUE',
3769
+ 'y', 'Y',
3770
+ 'yes', 'Yes', 'YES',
3771
+ 'on', 'On', 'ON',
3772
+ );
3773
+ static $false = array(
3774
+ '0',
3775
+ 'false', 'False', 'FALSE',
3776
+ 'n', 'N',
3777
+ 'no', 'No', 'NO',
3778
+ 'off', 'Off', 'OFF',
3779
+ );
3780
+ // @codingStandardsIgnoreEnd
3781
+
3782
+ if ( is_bool( $value ) ) {
3783
+ return $value;
3784
+ } elseif ( is_int( $value ) && ( 0 === $value || 1 === $value ) ) {
3785
+ return (bool) $value;
3786
+ } elseif ( ( is_float( $value ) && ! is_nan( $value ) ) && ( (float) 0 === $value || (float) 1 === $value ) ) {
3787
+ return (bool) $value;
3788
+ } elseif ( is_string( $value ) ) {
3789
+ $value = trim( $value );
3790
+ if ( in_array( $value, $true, true ) ) {
3791
+ return true;
3792
+ } elseif ( in_array( $value, $false, true ) ) {
3793
+ return false;
3794
+ } else {
3795
+ return false;
3796
+ }
3797
+ }
3798
+
3799
+ return false;
3800
+ }
3801
+ } // End of class ACX_CSMA_LICENCE_TGMPA_Utils
3802
+ } // End of class_exists wrapper
3803
+
3804
+ function acx_csma_purachase_licence_form()
3805
+ {
3806
+ $acx_csma_p_licence_array = get_option('acx_csma_p_licence_array');
3807
+ if(is_serialized($acx_csma_p_licence_array))
3808
+ {
3809
+ $acx_csma_p_licence_array = unserialize($acx_csma_p_licence_array);
3810
+ }
3811
+ if($acx_csma_p_licence_array == "" || !is_array($acx_csma_p_licence_array))
3812
+ {
3813
+ $acx_csma_p_licence_array = array();
3814
+ }
3815
+ $acx_csma_purchased_li_array = get_option('acx_csma_purchased_li_array');
3816
+ if(is_serialized($acx_csma_purchased_li_array))
3817
+ {
3818
+ $acx_csma_purchased_li_array = unserialize($acx_csma_purchased_li_array);
3819
+ }
3820
+ if($acx_csma_purchased_li_array == "" || !is_array($acx_csma_purchased_li_array))
3821
+ {
3822
+ $acx_csma_purchased_li_array = array();
3823
+ }
3824
+ ?>
3825
+ <div class="acx_csma_purchased_li_cvr">
3826
+ <div id="acx_csma_license_table_list" style="width:98%;float:left;">
3827
+ <h4><?php _e("Purchased Addons List","coming-soon-maintenance-mode-from-acurax"); ?></h4>
3828
+ <table class="wp-list-table widefat fixed striped">
3829
+ <tr>
3830
+ <th class="manage-column"><?php _e('Plugin Name','coming-soon-maintenance-mode-from-acurax');?></th>
3831
+ <th class="manage-column"><?php _e('Licence Code','coming-soon-maintenance-mode-from-acurax');?></th>
3832
+ <th class="manage-column"><?php _e('Version','coming-soon-maintenance-mode-from-acurax');?></th>
3833
+ <th class="manage-column"><?php _e('Licence Status','coming-soon-maintenance-mode-from-acurax');?></th>
3834
+ <th class="manage-column"><?php _e('Plugin Status','coming-soon-maintenance-mode-from-acurax');?></th>
3835
+ <th class="manage-column"><?php _e('Action','coming-soon-maintenance-mode-from-acurax');?></th>
3836
+ </tr>
3837
+
3838
+ <?php
3839
+ if(empty($acx_csma_p_licence_array))
3840
+ {
3841
+ ?>
3842
+ <tr><td colspan="5"><?php _e('No Licence found','coming-soon-maintenance-mode-from-acurax');?></td></tr>
3843
+ <?php
3844
+ }
3845
+ foreach($acx_csma_p_licence_array as $key => $value)
3846
+ {
3847
+ if(!array_key_exists($value['licence_code'],$acx_csma_purchased_li_array))
3848
+ {
3849
+ $response_stat = acx_csma_license_refresh_with_forcing($value['licence_code'],$key);
3850
+ }
3851
+ }
3852
+ $acx_li_slug = "";
3853
+ $version_to_print = "-";
3854
+ $acx_csma_plugin_stat = "";
3855
+ $acx_refresh_stat = 'acx_csma_hide_refresh';
3856
+ foreach($acx_csma_p_licence_array as $key => $value)
3857
+ {
3858
+
3859
+ $acx_plugin_array = acx_csma_get_purchased_plugin_details($value['licence_code']);
3860
+ if(ISSET($acx_plugin_array['slug']) && ISSET($acx_plugin_array['download_dynamic_url']))
3861
+ {
3862
+
3863
+ $acx_license_status = $acx_plugin_array['status'];
3864
+ $acx_li_slug = $acx_plugin_array['slug'];
3865
+ $version_to_print = acx_csma_get_plugin_version_number($acx_li_slug);
3866
+ $acx_active_plugin_stat = acx_csma_get_active_plugin_status($acx_li_slug);
3867
+ if($acx_active_plugin_stat == true)
3868
+ {
3869
+ $acx_csma_plugin_stat = __('Active','coming-soon-maintenance-mode-from-acurax');
3870
+ }
3871
+ else
3872
+ {
3873
+ $acx_csma_plugin_stat = __('Not Active <a href="'.wp_nonce_url(admin_url("admin.php?page=Acurax-Coming-Soon-Maintenance-Mode-Settings-Install-Addons")).'">[Install Now]</a>','coming-soon-maintenance-mode-from-acurax');
3874
+ }
3875
+ }
3876
+ if(function_exists('acx_csma_p_check_license') && !function_exists('acx_check_csmap_offline_license'))
3877
+ {
3878
+ $acx_refresh_stat = 'acx_csma_show_refresh';
3879
+ }
3880
+ ?>
3881
+ <tr><td><?php echo $value['addon_name']; ?></td>
3882
+ <td><?php echo $value['licence_code']; ?></td>
3883
+ <td><?php echo $version_to_print; ?></td>
3884
+ <td><?php echo $acx_license_status; ?></td>
3885
+ <td><?php echo $acx_csma_plugin_stat; ?></td>
3886
+ <td data-licence="<?php echo $value['licence_code']; ?>" data-key="<?php echo $key;?>"><span class="ax_csma_action_icon acx_csma_lic_refresh <?php echo $acx_refresh_stat; ?>" title="<?php _e("Refresh","coming-soon-maintenance-mode-from-acurax");?>"></span><span class="ax_csma_action_icon acx_csma_lic_del" title="<?php _e("Delete","coming-soon-maintenance-mode-from-acurax");?>"></span></td>
3887
+ </tr>
3888
+ <?php
3889
+ }
3890
+ ?>
3891
+ </table>
3892
+ </div><!-- acx_csma_license_table_list -->
3893
+ </div><!-- acx_csma_purchased_li_cvr -->
3894
+ <?php
3895
+ }
3896
+ add_action("acx_csma_show_purchased_li_table","acx_csma_purachase_licence_form",10);
3897
+ if(!function_exists('acx_csma_get_purchased_plugin_details'))
3898
+ {
3899
+ function acx_csma_get_purchased_plugin_details($licence)
3900
+ {
3901
+ $licence = trim($licence);
3902
+ $response_array = array(
3903
+ "download_dynamic_url" => "",
3904
+ "slug" => '',
3905
+ "status" => ""
3906
+ );
3907
+ if($licence != "")
3908
+ {
3909
+ $acx_csma_purchased_li_array = get_option('acx_csma_purchased_li_array');
3910
+ if(is_serialized($acx_csma_purchased_li_array))
3911
+ {
3912
+ $acx_csma_purchased_li_array = unserialize($acx_csma_purchased_li_array);
3913
+ }
3914
+ if($acx_csma_purchased_li_array == "" || !is_array($acx_csma_purchased_li_array))
3915
+ {
3916
+ $acx_csma_purchased_li_array = array();
3917
+ }
3918
+ foreach($acx_csma_purchased_li_array as $key => $value)
3919
+ {
3920
+ if($licence == $key)
3921
+ {
3922
+ $response_array = array(
3923
+ "download_dynamic_url" => $value['download_dynamic_url'],
3924
+ "slug" => $value['slug'],
3925
+ "status" => $value['status']
3926
+ );
3927
+ }
3928
+ }
3929
+ }
3930
+ return $response_array;
3931
+ }
3932
+
3933
+ }
3934
+ function acx_csma_license_notice_install_pending() {
3935
+ ?>
3936
+ <div class="notice notice-info is-dismissible">
3937
+ <p><?php _e( 'You have saved license code for one or more addons of Under Construction / Maintenance Mode From Acurax, Please <a href="'.wp_nonce_url(admin_url("admin.php?page=Acurax-Coming-Soon-Maintenance-Mode-Settings-Install-Addons")).'">click here</a> to visit the premium addon installation screen - <a href="'.wp_nonce_url(admin_url("admin.php?page=Acurax-Coming-Soon-Maintenance-Mode-Settings-Install-Addons")).'" class="button button-secondary activate">[Install Addons]</a>', 'coming-soon-maintenance-mode-from-acurax' ); ?></p>
3938
+ </div>
3939
+ <?php
3940
+ }
3941
+ // hook to show installation using tgmpa
3942
+ //-------------------------------------------------------------------------------------
3943
+ function acx_csma_licnece_install_required_plugins() {
3944
+ $acx_csma_p_licence_array = get_option('acx_csma_p_licence_array');
3945
+ if(is_serialized($acx_csma_p_licence_array))
3946
+ {
3947
+ $acx_csma_p_licence_array = unserialize($acx_csma_p_licence_array);
3948
+ }
3949
+ if($acx_csma_p_licence_array == "" || !is_array($acx_csma_p_licence_array))
3950
+ {
3951
+ $acx_csma_p_licence_array = array();
3952
+ }
3953
+ $display_notice = false;
3954
+ $acx_li_slug = $acx_li_download_url = '';
3955
+ $acx_active_plugin_stat = '';
3956
+ foreach($acx_csma_p_licence_array as $key => $value)
3957
+ {
3958
+ $acx_plugin_array = acx_csma_get_purchased_plugin_details($value['licence_code']);
3959
+ if(ISSET($acx_plugin_array['slug']) && ISSET($acx_plugin_array['download_dynamic_url']))
3960
+ {
3961
+ $acx_li_download_url = $acx_plugin_array['download_dynamic_url'];
3962
+ $acx_li_slug = $acx_plugin_array['slug'];
3963
+ $acx_active_plugin_stat = acx_csma_get_active_plugin_status($acx_li_slug);
3964
+ }
3965
+ $plugins = array(
3966
+ array(
3967
+ 'name' => $value['addon_name'], // The plugin name.
3968
+ 'slug' => $acx_li_slug, // The plugin slug (typically the folder name).
3969
+ 'source' => $acx_li_download_url, // The plugin source.
3970
+ 'required' => true, // If false, the plugin is only 'recommended' instead of required.
3971
+ ),
3972
+ );
3973
+ $config = array(
3974
+ 'id' => $acx_li_slug,
3975
+ 'default_path' => '',
3976
+ 'menu' => 'Acurax-Coming-Soon-Maintenance-Mode-Settings-Install-Addons',
3977
+ 'parent_slug' => 'Acurax-Coming-Soon-Maintenance-Mode-Settings',
3978
+ 'capability' => 'manage_options',
3979
+ 'has_notices' => false,
3980
+ 'dismissable' => false,
3981
+ 'dismiss_msg' => '',
3982
+ 'is_automatic' => true,
3983
+ 'message' => '<h4>'.__('Install ','coming-soon-maintenance-mode-from-acurax').$value['addon_name'].'</h4>',
3984
+ 'strings' => array(
3985
+ 'notice_can_install_required' => _n_noop(
3986
+ 'You have entered the licence for the following plugin: %1$s.',
3987
+ 'You have entered the licence for the following plugin: %1$s.',
3988
+ 'coming-soon-maintenance-mode-from-acurax'
3989
+ ),
3990
+ 'install_link' => _n_noop(
3991
+ 'Click Here To Install',
3992
+ 'Click Here To Install',
3993
+ 'acx_csma_licence_tgmpa'
3994
+ ),
3995
+ ),
3996
+ );
3997
+ if($acx_active_plugin_stat == false)
3998
+ {
3999
+ acx_csma_licence_tgmpa( $plugins, $config );
4000
+ $display_notice = true;
4001
+ }
4002
+ }
4003
+ if($display_notice == true)
4004
+ {
4005
+ add_action( 'admin_notices', 'acx_csma_license_notice_install_pending' );
4006
+ }
4007
+ }
4008
+ add_action( 'acx_csma_licence_tgmpa_register', 'acx_csma_licnece_install_required_plugins' );
4009
+ // get plugin activation status
4010
+ function acx_csma_get_active_plugin_status($acx_slug)
4011
+ {
4012
+ $acx_return = false;
4013
+ if($acx_slug != "")
4014
+ {
4015
+ $acx_csma_active_plugin_arr = get_option('active_plugins');
4016
+ foreach($acx_csma_active_plugin_arr as $key => $value)
4017
+ {
4018
+ if(strpos($value,$acx_slug) !== false)
4019
+ {
4020
+ $acx_return = true;
4021
+ }
4022
+ }
4023
+
4024
+ }
4025
+ return $acx_return;
4026
+ }
4027
+ function acx_csma_get_plugin_version_number($acx_slug)
4028
+ {
4029
+ $acx_version_return = '-';
4030
+ $acx_plugin_data_array = array();
4031
+ if($acx_slug != "")
4032
+ {
4033
+ if ( ! function_exists( 'get_plugins' ) )
4034
+ require_once( ABSPATH . 'wp-admin/includes/plugin.php' );
4035
+ $plugin_folder = get_plugins( );
4036
+ $plugin_file ='';
4037
+ $acx_csma_active_plugin_arr = get_option('active_plugins');
4038
+ foreach($acx_csma_active_plugin_arr as $key => $value)
4039
+ {
4040
+ if(strpos($value,$acx_slug) !== false)
4041
+ {
4042
+ $plugin_file = $value ;
4043
+ $acx_version_return = $plugin_folder[$plugin_file]['Version'];
4044
+ }
4045
+ }
4046
+
4047
+ }
4048
+ return $acx_version_return;
4049
+ }
4050
+ function acx_csma_licence_btn_fn()
4051
+ {
4052
+ do_action("acx_csma_show_purchased_li_table");
4053
+
4054
+ }
4055
+ add_action("acx_csma_purachase_licence_form_hook","acx_csma_licence_btn_fn");
4056
+ function acx_csma_show_purchased_licence_html()
4057
+ {
4058
+ ?>
4059
+ <div class="acx_csma_add_p_licen_cvr" style="width:100%;float:left;margin-top:25px;">
4060
+ <span class="acx_csma_add_p_licen"><a class="acx_csma_purchas_lic_add button button-primary"><?php _e('CLICK HERE TO ADD LICENCE','coming-soon-maintenance-mode-from-acurax');?></a></span><!-- acx_csma_add_p_licen -->
4061
+ </div><!-- acx_csma_add_p_licen_cvr -->
4062
+
4063
+ <div class="acx_csma_add_p_licence_light_cvr">
4064
+
4065
+ <div class="acx_csma_add_p_licence_li_cn">
4066
+ <div class="acx_csma_add_p_licence_light_cls"></div><!-- acx_csma_add_p_licence_light_cls -->
4067
+ <div class="acx_csma_add_p_licence_light_content">
4068
+ <span class="acx_csma_p_li_span">
4069
+ <input type="text" id="acx_csma_purchased_licence" placeholder="<?php _e('Enter Your Licence Code','coming-soon-maintenance-mode-from-acurax');?>" value=""/>
4070
+ <span class="acx_csma_pu_li_error"></span>
4071
+ <a class="acx_csma_add_p_li_cls button button-primary"><?php _e('SUBMIT','coming-soon-maintenance-mode-from-acurax');?></a>
4072
+ </span><!-- acx_csma_p_li_span -->
4073
+ </div><!-- acx_csma_add_p_licence_light_content -->
4074
+ </div><!-- acx_csma_add_p_licence_li_cn -->
4075
+
4076
+ </div><!-- acx_csma_add_p_licence_light_cvr -->
4077
+ <script>
4078
+ jQuery(".acx_csma_purchas_lic_add").click(function()
4079
+ {
4080
+ jQuery(".acx_csma_add_p_licence_light_cvr").fadeIn();
4081
+ });
4082
+ jQuery(".acx_csma_add_p_licence_light_cls").click(function()
4083
+ {
4084
+ jQuery("#acx_csma_purchased_licence").val('');
4085
+ jQuery(".acx_csma_pu_li_error").html('');
4086
+ jQuery(".acx_csma_add_p_licence_light_cvr").fadeOut();
4087
+ });
4088
+ jQuery(".acx_csma_add_p_li_cls").click(function()
4089
+ {
4090
+ var acx_csma_purchased_licence = jQuery("#acx_csma_purchased_licence").val();
4091
+ if(acx_csma_purchased_licence == "")
4092
+ {
4093
+ jQuery(".acx_csma_pu_li_error").html('<?php _e('Invalid Licence Code','coming-soon-maintenance-mode-from-acurax');?>');
4094
+ return false;
4095
+ }
4096
+
4097
+ jQuery(".acx_csma_pu_li_error").html('');
4098
+ var acx_load = '<div id="acx_csmap_loading_1"><div class="load_1"></div></div>';
4099
+ jQuery('.acx_csma_add_p_licence_light_cvr').append(acx_load);
4100
+ var ajaxurl = '<?php echo admin_url('admin-ajax.php'); ?>';
4101
+ var acx_csmap_order = '&acx_csma_purchased_licence='+acx_csma_purchased_licence+'&action=acx_csma_purchased_licence_add'+'&acx_csma_purchased_licence_w_c_n=<?php echo wp_create_nonce('acx_csma_purchased_licence_w_c_n'); ?>';
4102
+ jQuery.post(ajaxurl, acx_csmap_order, function(theResponse)
4103
+ {
4104
+ jQuery("#acx_csmap_loading_1").remove();
4105
+ if(theResponse == "success")
4106
+ {
4107
+ alert('<?php _e('Successfully Added !!','coming-soon-maintenance-mode-from-acurax');?>');
4108
+ var link = window.location.href;
4109
+ if(link !== '')
4110
+ {
4111
+ window.location=link;
4112
+ }
4113
+ }
4114
+
4115
+ else
4116
+ {
4117
+ alert(theResponse);
4118
+ jQuery("#acx_csma_purchased_licence").val('');
4119
+ jQuery(".acx_csma_add_p_licence_light_cvr").fadeOut();
4120
+ }
4121
+ });
4122
+
4123
+
4124
+ });
4125
+
4126
+ jQuery(".acx_csma_lic_del").click(function()
4127
+ {
4128
+ var acx_confirm = confirm("<?php _e('Are you sure to delete this license?','coming-soon-maintenance-mode-from-acurax')?>");
4129
+ if(acx_confirm == true)
4130
+ {
4131
+ var key_to_del = jQuery(this).parent().attr("data-key");
4132
+ var li_to_del = jQuery(this).parent().attr("data-licence");
4133
+ var acx_load = '<div id="acx_csmap_loading_1"><div class="load_1"></div></div>';
4134
+ jQuery('body').append(acx_load);
4135
+ var ajaxurl = '<?php echo admin_url('admin-ajax.php'); ?>';
4136
+ var acx_csmap_del_order = '&key_to_del='+key_to_del+'&li_to_del='+li_to_del+'&action=acx_csma_install_licence_del'+'&acx_csma_install_licence_del_w_c_n=<?php echo wp_create_nonce('acx_csma_install_licence_del_w_c_n'); ?>';
4137
+ jQuery.post(ajaxurl, acx_csmap_del_order, function(theResponse)
4138
+ {
4139
+ jQuery("#acx_csmap_loading_1").remove();
4140
+ if(theResponse == "success")
4141
+ {
4142
+ alert('<?php _e('Successfully deleted the licence !!','coming-soon-maintenance-mode-from-acurax');?>');
4143
+ var link = window.location.href;
4144
+ if(link !== '')
4145
+ {
4146
+ window.location=link;
4147
+ }
4148
+ }
4149
+ });
4150
+ }
4151
+ });
4152
+ // refresh
4153
+ jQuery(".acx_csma_lic_refresh").click(function()
4154
+ {
4155
+ var acx_confirm = confirm("<?php _e('Are you sure to refresh this license?','coming-soon-maintenance-mode-from-acurax')?>");
4156
+ if(acx_confirm == true)
4157
+ {
4158
+ var key = jQuery(this).parent().attr("data-key");
4159
+ var licence = jQuery(this).parent().attr("data-licence");
4160
+ var acx_load = '<div id="acx_csmap_loading_1"><div class="load_1"></div></div>';
4161
+ jQuery('body').append(acx_load);
4162
+ var ajaxurl = '<?php echo admin_url('admin-ajax.php'); ?>';
4163
+ var acx_csmap_refresh_order = '&key='+key+'&licence='+licence+'&action=acx_csma_install_licence_refresh'+'&acx_csma_install_licence_refresh_w_c_n=<?php echo wp_create_nonce('acx_csma_install_licence_refresh_w_c_n'); ?>';
4164
+ jQuery.post(ajaxurl, acx_csmap_refresh_order, function(theResponse)
4165
+ {
4166
+ jQuery("#acx_csmap_loading_1").remove();
4167
+ if(theResponse == "success")
4168
+ {
4169
+ alert('<?php _e('Successfully refreshed the licence !!','coming-soon-maintenance-mode-from-acurax');?>');
4170
+ var link = window.location.href;
4171
+ if(link !== '')
4172
+ {
4173
+ window.location=link;
4174
+ }
4175
+ }
4176
+ });
4177
+ }
4178
+ });
4179
+ </script>
4180
+ <?php
4181
+ }
4182
+ add_action("acx_csma_show_purchased_li_table","acx_csma_show_purchased_licence_html",20);
4183
+ // delete installed licence
4184
+ function acx_csma_install_licence_del_callback()
4185
+ {
4186
+ if (!isset($_POST['acx_csma_install_licence_del_w_c_n'])) die("<br><br>".__('Unknown Error Occurred, Try Again... ','coming-soon-maintenance-mode-from-acurax')."<a href=''>".__('Click Here','coming-soon-maintenance-mode-from-acurax')."</a>");
4187
+ if (!wp_verify_nonce($_POST['acx_csma_install_licence_del_w_c_n'],'acx_csma_install_licence_del_w_c_n')) die("<br><br>".__('Unknown Error Occurred, Try Again... ','coming-soon-maintenance-mode-from-acurax')."<a href=''>".__('Click Here','coming-soon-maintenance-mode-from-acurax')."</a>");
4188
+ $key_to_del = $li_to_del = $id_to_del = "";
4189
+ $response_stat = "failed";
4190
+ if(ISSET($_POST['key_to_del']))
4191
+ {
4192
+ $key_to_del = $_POST['key_to_del'];
4193
+ }
4194
+ if(ISSET($_POST['li_to_del']))
4195
+ {
4196
+ $li_to_del = $_POST['li_to_del'];
4197
+ }
4198
+
4199
+ $acx_csma_p_licence_array = get_option('acx_csma_p_licence_array');
4200
+ if(is_serialized($acx_csma_p_licence_array))
4201
+ {
4202
+ $acx_csma_p_licence_array = unserialize($acx_csma_p_licence_array);
4203
+ }
4204
+ if($acx_csma_p_licence_array == "")
4205
+ {
4206
+ $acx_csma_p_licence_array = array();
4207
+ }
4208
+ if(!is_array($acx_csma_p_licence_array))
4209
+ {
4210
+ $acx_csma_p_licence_array = array();
4211
+ }
4212
+ $del_stat = false;
4213
+ foreach($acx_csma_p_licence_array as $key => $value)
4214
+ {
4215
+ if($key == $key_to_del && $value['licence_code'] == $li_to_del )
4216
+ {
4217
+ unset($acx_csma_p_licence_array[$key]);
4218
+ acx_csma_delete_purchased_li($value['licence_code']);
4219
+ $response_stat = "success";
4220
+ }
4221
+ }
4222
+
4223
+ if(!is_serialized($acx_csma_p_licence_array))
4224
+ {
4225
+ $acx_csma_p_licence_array = serialize($acx_csma_p_licence_array);
4226
+ }
4227
+ update_option('acx_csma_p_licence_array',$acx_csma_p_licence_array);
4228
+
4229
+
4230
+ echo $response_stat;
4231
+
4232
+ die();
4233
+ }
4234
+ add_action("wp_ajax_acx_csma_install_licence_del","acx_csma_install_licence_del_callback");
4235
+ function acx_csma_delete_purchased_li($licence_code)
4236
+ {
4237
+ $acx_csma_purchased_li_array = get_option('acx_csma_purchased_li_array');
4238
+ if(is_serialized($acx_csma_purchased_li_array))
4239
+ {
4240
+ $acx_csma_purchased_li_array = unserialize($acx_csma_purchased_li_array);
4241
+ }
4242
+ if($acx_csma_purchased_li_array == "" || !is_array($acx_csma_purchased_li_array))
4243
+ {
4244
+ $acx_csma_purchased_li_array = array();
4245
+ }
4246
+ if($licence_code != "")
4247
+ {
4248
+ foreach($acx_csma_purchased_li_array as $pkey => $pvalue)
4249
+ {
4250
+ if($pkey == $licence_code)
4251
+ {
4252
+ unset($acx_csma_purchased_li_array[$pkey]);
4253
+ }
4254
+ }
4255
+ if(!is_serialized($acx_csma_purchased_li_array))
4256
+ {
4257
+ $acx_csma_purchased_li_array = serialize($acx_csma_purchased_li_array);
4258
+ }
4259
+ update_option('acx_csma_purchased_li_array',$acx_csma_purchased_li_array);
4260
+
4261
+
4262
+ }
4263
+ }
4264
+
4265
+ // add purchased licence callback
4266
+ function acx_csma_purchased_licence_add_callback()
4267
+ {
4268
+ if (!isset($_POST['acx_csma_purchased_licence_w_c_n'])) die("<br><br>".__('Unknown Error Occurred, Try Again... ','coming-soon-maintenance-mode-from-acurax')."<a href=''>".__('Click Here','coming-soon-maintenance-mode-from-acurax')."</a>");
4269
+ if (!wp_verify_nonce($_POST['acx_csma_purchased_licence_w_c_n'],'acx_csma_purchased_licence_w_c_n')) die("<br><br>".__('Unknown Error Occurred, Try Again... ','coming-soon-maintenance-mode-from-acurax')."<a href=''>".__('Click Here','coming-soon-maintenance-mode-from-acurax')."</a>");
4270
+ $acx_csma_purchased_licence = "";
4271
+ $retry = true;
4272
+ if(ISSET($_POST['acx_csma_purchased_licence']))
4273
+ {
4274
+ $acx_csma_purchased_licence = trim($_POST['acx_csma_purchased_licence']);
4275
+ }
4276
+ $acx_csma_p_licence_array = get_option('acx_csma_p_licence_array');
4277
+ if(is_serialized($acx_csma_p_licence_array))
4278
+ {
4279
+ $acx_csma_p_licence_array = unserialize($acx_csma_p_licence_array);
4280
+ }
4281
+ if($acx_csma_purchased_licence != "")
4282
+ {
4283
+ $licence_code_arr = explode('-',$acx_csma_purchased_licence);
4284
+ if(is_array($licence_code_arr))
4285
+ {
4286
+ if(ISSET($licence_code_arr[0]) && ISSET($licence_code_arr[1]))
4287
+ {
4288
+ $acx_csmap_index = $licence_code_arr[0].'_'.$licence_code_arr[1];
4289
+ }
4290
+ else{
4291
+ $acx_csmap_index = '';
4292
+ }
4293
+ }
4294
+ else{
4295
+ $acx_csmap_index = '';
4296
+ }
4297
+ $acx_csmap_retry_array = get_option('acx_csmap_retry_array');
4298
+ if(is_serialized($acx_csmap_retry_array))
4299
+ {
4300
+ $acx_csmap_retry_array = unserialize($acx_csmap_retry_array);
4301
+ }
4302
+ if($acx_csmap_retry_array == "")
4303
+ {
4304
+ $acx_csmap_retry_array = array();
4305
+ }
4306
+ if(!is_array($acx_csmap_retry_array))
4307
+ {
4308
+ $acx_csmap_retry_array = array();
4309
+ }
4310
+ if(ISSET($acx_csmap_retry_array[$acx_csma_purchased_licence]['activation_licence_check']))
4311
+ {
4312
+ if($acx_csmap_retry_array[$acx_csma_purchased_licence]['activation_licence_check'] >= 3)
4313
+ {
4314
+ $retry = false;
4315
+ }
4316
+ }
4317
+ if($acx_csmap_index != "")
4318
+ {
4319
+
4320
+ $acx_csma_ip = isset($_SERVER['SERVER_ADDR']) ? $_SERVER['SERVER_ADDR'] : $_SERVER['LOCAL_ADDR'];
4321
+ $acx_csma_domain = $_SERVER['SERVER_NAME'];
4322
+ $acx_csma_directory = dirname(__FILE__);
4323
+ $acx_csma_args = array(
4324
+ 'action' => 'acx-li-check-latest-version',
4325
+ 'method' => 'addon_activation',
4326
+ 'directory' => $acx_csma_directory,
4327
+ 'unique_id' => $acx_csmap_index,
4328
+ 'domain' => $acx_csma_domain,
4329
+ 'ip' => $acx_csma_ip,
4330
+ 'licence' => $acx_csma_purchased_licence
4331
+ );
4332
+ $acx_csma_unique_id = "";
4333
+ // Send request checking for an update
4334
+ if($retry == true)
4335
+ {
4336
+ $response = acx_csma_licence_activation_api_request( $acx_csma_args );
4337
+ $response = json_decode($response, true);
4338
+ }
4339
+ if(!ISSET($response['response_status']) && !ISSET($response['status']))
4340
+ {
4341
+ if(ISSET($acx_csmap_retry_array[$acx_csma_purchased_licence]['activation_licence_check']))
4342
+ {
4343
+ $acx_csmap_retry_array[$acx_csma_purchased_licence]['activation_licence_check'] = $acx_csmap_retry_array[$acx_csma_purchased_licence]['activation_licence_check'] + 1;
4344
+ }
4345
+ else{
4346
+ $acx_csmap_retry_array[$acx_csma_purchased_licence]['activation_licence_check'] = 1;
4347
+ }
4348
+ }
4349
+ else
4350
+ {
4351
+ if($response['response_status'] == "success" && $response['status'] == "Active")
4352
+ {
4353
+ $acx_csma_purchased_li_array = get_option('acx_csma_purchased_li_array');
4354
+ if(is_serialized($acx_csma_purchased_li_array))
4355
+ {
4356
+ $acx_csma_purchased_li_array = unserialize($acx_csma_purchased_li_array);
4357
+ }
4358
+ if($acx_csma_purchased_li_array == "" || !is_array($acx_csma_purchased_li_array))
4359
+ {
4360
+ $acx_csma_purchased_li_array = array();
4361
+ }
4362
+ $acx_csma_unique_id = trim($response['unique_id']);
4363
+ $acx_csma_purchased_li_array[$acx_csma_purchased_licence] = array(
4364
+ 'slug' => $response['slug'],
4365
+ 'status' => $response['status'],
4366
+ 'download_dynamic_url' => $response['download_dynamic_url']
4367
+ );
4368
+ // update licence array
4369
+
4370
+ $acx_csma_p_licence_array[$acx_csma_unique_id]['addon_name'] = $response['name'];
4371
+ $acx_csma_p_licence_array[$acx_csma_unique_id]['version'] = $response['new_version'];
4372
+ $acx_csma_p_licence_array[$acx_csma_unique_id]['licence_code'] = $acx_csma_purchased_licence;
4373
+ if($response['localkey'] != "")
4374
+ {
4375
+ $acx_csma_p_licence_array[$acx_csma_unique_id]['local_key'] = $response['localkey'];
4376
+ }
4377
+ if(!is_serialized($acx_csma_p_licence_array))
4378
+ {
4379
+ $acx_csma_p_licence_array = serialize($acx_csma_p_licence_array);
4380
+ }
4381
+ update_option('acx_csma_p_licence_array',$acx_csma_p_licence_array);
4382
+ if(!is_serialized($acx_csma_purchased_li_array))
4383
+ {
4384
+ $acx_csma_purchased_li_array = serialize($acx_csma_purchased_li_array);
4385
+ }
4386
+ update_option('acx_csma_purchased_li_array',$acx_csma_purchased_li_array);
4387
+ $acx_csmap_retry_array[$acx_csma_purchased_licence]['activation_licence_check'] = 0;
4388
+ if(!is_serialized($acx_csmap_retry_array))
4389
+ {
4390
+ $acx_csmap_retry_array = serialize($acx_csmap_retry_array);
4391
+ }
4392
+ update_option('acx_csmap_retry_array',$acx_csmap_retry_array);
4393
+ echo "success";
4394
+ }
4395
+ else
4396
+ {
4397
+ echo __("Sorry, Your license code is invalid, Please contact support","coming-soon-maintenance-mode-from-acurax");
4398
+ }
4399
+ }
4400
+ }
4401
+ else
4402
+ {
4403
+ echo __("Sorry, Your license code is invalid, Please contact support","coming-soon-maintenance-mode-from-acurax");
4404
+ }
4405
+ }
4406
+ else
4407
+ {
4408
+ echo __("Invalid Licence Code","coming-soon-maintenance-mode-from-acurax");
4409
+ }
4410
+ die();
4411
+ }
4412
+ add_action("wp_ajax_acx_csma_purchased_licence_add","acx_csma_purchased_licence_add_callback");
4413
+ function acx_csma_licence_activation_api_request($args)
4414
+ {
4415
+ // Send request
4416
+ $request = wp_remote_post( 'http://updates.acurax.com/licence_activation.php',array( 'body' => $args ) );
4417
+ if ( is_wp_error( $request ) || 200 != wp_remote_retrieve_response_code( $request ) )
4418
+ return false;
4419
+ $response = wp_remote_retrieve_body( $request ) ;
4420
+ return $response;
4421
+ }
4422
+ ?>
includes/acx_csma_addons.php CHANGED
@@ -1,25 +1,25 @@
1
  <?php
2
  $csma_addons_intro = array();
3
  $csma_addons_intro[] = array(
4
- 'name' => 'URL Access Addon',
5
  'img' => plugins_url('/images/addon_private_url.jpg',dirname(__FILE__)),
6
- 'desc' => 'Allows you to generate private urls which you can provide to your clients or contacts, So they can view your website even if under maintenance is active. You can define the URL expiry while generating the URL',
7
  'url' => 'http://www.acurax.com/products/under-construction-maintenance-mode-wordpress-plugin/?feature=url-access&utm_source=csma&utm_campaign=addon-page',
8
- 'button' => 'View Details'
9
  );
10
  $csma_addons_intro[] = array(
11
- 'name' => 'Service Theme Pack 1',
12
  'img' => plugins_url('/images/addon_stp_1.gif',dirname(__FILE__)),
13
- 'desc' => 'Its a theme pack, consisting of 4 entirely differant premium under maintenance themes which you can use when your website is under construction mode. It acts like your website, You can list your services, add contact form etc...',
14
  'url' => 'http://www.acurax.com/products/under-construction-maintenance-mode-wordpress-plugin/?feature=service-theme-pack-1&utm_source=csma&utm_campaign=addon-page',
15
- 'button' => 'View Demo and More'
16
  );
17
  $csma_addons_intro[] = array(
18
- 'name' => 'Page Policy Manager',
19
  'img' => plugins_url('/images/addon_ppm.png',dirname(__FILE__)),
20
- 'desc' => 'Page Policy Manager is a simple and easy addon which helps you to Include/Exclude Pages/Posts from showing Under Construction/Maintenance Pages. Choose a list of Pages/Posts & set the condition as Show/Not to Show Maintenance Mode for the Selected Pages',
21
  'url' => 'http://www.acurax.com/products/under-construction-maintenance-mode-wordpress-plugin/?feature=page-policy-manager&utm_source=csma&utm_campaign=addon-page',
22
- 'button' => 'Screenshots and More'
23
  );
24
  ?>
25
  <h2><?php _e("Coming Soon/Maintenance - Available Addons","coming-soon-maintenance-mode-from-acurax"); ?></h2>
@@ -37,4 +37,7 @@ foreach($csma_addons_intro as $key => $value)
37
  <a class="csma_addon_button" href="<?php echo $value['url']; ?>" target="_blank"><?php echo $value['button']; ?></a>
38
  </div> <!-- csma_addons_intro -->
39
  <?php } ?>
40
- </div> <!-- csma_addons_intro_holder -->
 
 
 
1
  <?php
2
  $csma_addons_intro = array();
3
  $csma_addons_intro[] = array(
4
+ 'name' => __('URL Access Addon','coming-soon-maintenance-mode-from-acurax'),
5
  'img' => plugins_url('/images/addon_private_url.jpg',dirname(__FILE__)),
6
+ 'desc' => __('Allows you to generate private urls which you can provide to your clients or contacts, So they can view your website even if under maintenance is active. You can define the URL expiry while generating the URL','coming-soon-maintenance-mode-from-acurax'),
7
  'url' => 'http://www.acurax.com/products/under-construction-maintenance-mode-wordpress-plugin/?feature=url-access&utm_source=csma&utm_campaign=addon-page',
8
+ 'button' => __('View Details','coming-soon-maintenance-mode-from-acurax')
9
  );
10
  $csma_addons_intro[] = array(
11
+ 'name' => __('Service Theme Pack 1','coming-soon-maintenance-mode-from-acurax'),
12
  'img' => plugins_url('/images/addon_stp_1.gif',dirname(__FILE__)),
13
+ 'desc' => __('Its a theme pack, consisting of 4 entirely differant premium under maintenance themes which you can use when your website is under construction mode. It acts like your website, You can list your services, add contact form etc...','coming-soon-maintenance-mode-from-acurax'),
14
  'url' => 'http://www.acurax.com/products/under-construction-maintenance-mode-wordpress-plugin/?feature=service-theme-pack-1&utm_source=csma&utm_campaign=addon-page',
15
+ 'button' => __('View Demo and More','coming-soon-maintenance-mode-from-acurax')
16
  );
17
  $csma_addons_intro[] = array(
18
+ 'name' => __('Page Policy Manager','coming-soon-maintenance-mode-from-acurax'),
19
  'img' => plugins_url('/images/addon_ppm.png',dirname(__FILE__)),
20
+ 'desc' => __('Page Policy Manager is a simple and easy addon which helps you to Include/Exclude Pages/Posts from showing Under Construction/Maintenance Pages. Choose a list of Pages/Posts & set the condition as Show/Not to Show Maintenance Mode for the Selected Pages','coming-soon-maintenance-mode-from-acurax'),
21
  'url' => 'http://www.acurax.com/products/under-construction-maintenance-mode-wordpress-plugin/?feature=page-policy-manager&utm_source=csma&utm_campaign=addon-page',
22
+ 'button' => __('Screenshots and More','coming-soon-maintenance-mode-from-acurax')
23
  );
24
  ?>
25
  <h2><?php _e("Coming Soon/Maintenance - Available Addons","coming-soon-maintenance-mode-from-acurax"); ?></h2>
37
  <a class="csma_addon_button" href="<?php echo $value['url']; ?>" target="_blank"><?php echo $value['button']; ?></a>
38
  </div> <!-- csma_addons_intro -->
39
  <?php } ?>
40
+ </div> <!-- csma_addons_intro_holder -->
41
+ <?php
42
+ do_action("acx_csma_purachase_licence_form_hook");
43
+ ?>
includes/acx_csma_admin.php CHANGED
@@ -70,7 +70,7 @@ if($acx_csma_hidden == 'Y')
70
 
71
  if(ISSET($_POST['acx_csma_ip_list']))
72
  {
73
- $acx_csma_ip_list= $_POST['acx_csma_ip_list'];
74
  }
75
  else{
76
  $acx_csma_ip_list=array();
@@ -81,8 +81,6 @@ if($acx_csma_hidden == 'Y')
81
  }
82
 
83
  update_option('acx_csma_ip_list', $acx_csma_ip_list);
84
-
85
-
86
  if(ISSET($_POST['acx_csma_restrict_role']))
87
  {
88
  $acx_csma_restrict_role = $_POST['acx_csma_restrict_role'];
@@ -102,9 +100,8 @@ if($acx_csma_hidden == 'Y')
102
  }
103
  update_option('acx_csma_restrict_role', $acx_csma_restrict_role);
104
  }
105
-
106
  //************************************************template 1 ********************************************
107
- $acx_csma_appearence_array=acx_csma_get_db_array_value();
108
 
109
  $acx_csma_background_image1=$_POST['acx_csma_background_image1'];
110
  $acx_csma_background_image1 = acx_csma_text_before_save_hook_fn('acx_csma_background_image1',$acx_csma_background_image1);
@@ -247,6 +244,11 @@ $acx_csma_appearence_array=acx_csma_get_db_array_value();
247
  $acx_csma_logo_text_color2=$_POST['acx_csma_logo_text_color2'];
248
  $acx_csma_logo_text_color2 = acx_csma_text_before_save_hook_fn('acx_csma_logo_text_color2',$acx_csma_logo_text_color2);
249
  if($acx_csma_logo_text_color2==""){$acx_csma_logo_text_color2=$acx_csma_appearence_array['2']['acx_csma_logo_text_color2'];}
 
 
 
 
 
250
  $acx_csma_title2=$_POST['acx_csma_title2'];
251
  $acx_csma_title2 = acx_csma_text_before_save_hook_fn('acx_csma_title2',$acx_csma_title2);
252
  $acx_csma_title_color2=$_POST['acx_csma_title_color2'];
@@ -260,28 +262,37 @@ $acx_csma_appearence_array=acx_csma_get_db_array_value();
260
  $acx_csma_inside_bg_color2=$_POST['acx_csma_inside_bg_color2'];
261
  $acx_csma_inside_bg_color2 = acx_csma_text_before_save_hook_fn('acx_csma_inside_bg_color2',$acx_csma_inside_bg_color2);
262
  if($acx_csma_inside_bg_color2==""){$acx_csma_inside_bg_color2=$acx_csma_appearence_array['2']['acx_csma_inside_bg_color2'];}
 
 
 
 
263
  $acx_csma_show_timer2=$_POST['acx_csma_show_timer2'];
264
  $acx_csma_show_timer2 = acx_csma_text_before_save_hook_fn('acx_csma_show_timer2',$acx_csma_show_timer2);
265
  if($acx_csma_show_timer2==""){ $acx_csma_show_timer2=$acx_csma_appearence_array['2']['acx_csma_show_timer2'];}
266
- $acx_csma_show_subscription2=$_POST['acx_csma_show_subscription2'];
267
  $acx_csma_show_subscription2 = acx_csma_text_before_save_hook_fn('acx_csma_show_subscription2',$acx_csma_show_subscription2);
268
- if($acx_csma_show_subscription2==""){ $acx_csma_show_subscription2=$acx_csma_appearence_array['2']['acx_csma_show_subscription2'];}
269
- $acx_csma_show_subscription_name2=$_POST['acx_csma_show_subscription_name2'];
270
  $acx_csma_show_subscription_name2 = acx_csma_text_before_save_hook_fn('acx_csma_show_subscription_name2',$acx_csma_show_subscription_name2);
271
- if($acx_csma_show_subscription_name2==""){ $acx_csma_show_subscription_name2=$acx_csma_appearence_array['2']['acx_csma_show_subscription_name2'];}
272
 
273
- $acx_csma_subscribe_btn_text2=$_POST['acx_csma_subscribe_btn_text2'];
274
- $acx_csma_subscribe_btn_text2 = acx_csma_text_before_save_hook_fn('acx_csma_subscribe_btn_text2',$acx_csma_subscribe_btn_text2);
275
- if($acx_csma_subscribe_btn_text2==""){$acx_csma_subscribe_btn_text2=$acx_csma_appearence_array['2']['acx_csma_subscribe_btn_text2'];}
276
  $acx_csma_timer_title2=$_POST['acx_csma_timer_title2'];
277
  $acx_csma_timer_title2 = acx_csma_text_before_save_hook_fn('acx_csma_timer_title2',$acx_csma_timer_title2);
278
 
279
- $acx_csma_timer_title_color2=$_POST['acx_csma_timer_title_color2'];
280
  $acx_csma_timer_title_color2 = acx_csma_text_before_save_hook_fn('acx_csma_timer_title_color2',$acx_csma_timer_title_color2);
281
  if($acx_csma_timer_title_color2==""){$acx_csma_timer_title_color2=$acx_csma_appearence_array['2']['acx_csma_timer_title_color2'];}
282
  $acx_csma_subscribe_btn_color2=$_POST['acx_csma_subscribe_btn_color2'];
283
  $acx_csma_subscribe_btn_color2 = acx_csma_text_before_save_hook_fn('acx_csma_subscribe_btn_color2',$acx_csma_subscribe_btn_color2);
284
  if($acx_csma_subscribe_btn_color2==""){$acx_csma_subscribe_btn_color2=$acx_csma_appearence_array['2']['acx_csma_subscribe_btn_color2'];}
 
 
 
 
 
285
  $acx_csma_subscribe_success2=$_POST['acx_csma_subscribe_success2'];
286
 
287
  $acx_csma_subscribe_success2 = acx_csma_text_before_save_hook_fn('acx_csma_subscribe_success2',$acx_csma_subscribe_success2);
@@ -315,6 +326,9 @@ $acx_csma_timer_title_color2=$_POST['acx_csma_timer_title_color2'];
315
  $acx_csma_desc_content_color2=$_POST['acx_csma_desc_content_color2'];
316
  $acx_csma_desc_content_color2 = acx_csma_text_before_save_hook_fn('acx_csma_desc_content_color2',$acx_csma_desc_content_color2);
317
  if($acx_csma_desc_content_color2==""){$acx_csma_desc_content_color2=$acx_csma_appearence_array['2']['acx_csma_desc_content_color2'];}
 
 
 
318
  $acx_csma_social_link_color2=$_POST['acx_csma_social_link_color2'];
319
  $acx_csma_social_link_color2 = acx_csma_text_before_save_hook_fn('acx_csma_social_link_color2',$acx_csma_social_link_color2);
320
  if($acx_csma_social_link_color2==""){$acx_csma_social_link_color2=$acx_csma_appearence_array['2']['acx_csma_social_link_color2'];}
@@ -714,11 +728,13 @@ $acx_csma_timer_title_color2=$_POST['acx_csma_timer_title_color2'];
714
  'acx_csma_logo2'=>$acx_csma_logo2,
715
  'acx_csma_logo_text2' =>$acx_csma_logo_text2,
716
  'acx_csma_logo_text_color2' =>$acx_csma_logo_text_color2,
 
717
  'acx_csma_title2'=>$acx_csma_title2,
718
  'acx_csma_title_color2'=>$acx_csma_title_color2,
719
  'acx_csma_subtitle_text2'=>$acx_csma_subtitle_text2,
720
  'acx_csma_subtitle_color2'=>$acx_csma_subtitle_color2,
721
  'acx_csma_inside_bg_color2'=>$acx_csma_inside_bg_color2,
 
722
  'acx_csma_custom_html_top_timer'=>$acx_csma_custom_html_top_timer,
723
  'acx_csma_show_subscription2'=>$acx_csma_show_subscription2,
724
  'acx_csma_show_subscription_name2'=>$acx_csma_show_subscription_name2,
@@ -728,6 +744,7 @@ $acx_csma_timer_title_color2=$_POST['acx_csma_timer_title_color2'];
728
  'acx_csma_timer_title2'=>$acx_csma_timer_title2,
729
  'acx_csma_timer_title_color2'=>$acx_csma_timer_title_color2,
730
  'acx_csma_subscribe_btn_color2'=>$acx_csma_subscribe_btn_color2,
 
731
  'acx_csma_subscribe_success2'=>$acx_csma_subscribe_success2,
732
  'acx_csma_subscribe_invalid2'=>$acx_csma_subscribe_invalid2,
733
  'acx_csma_timer_input_bg_color2'=>$acx_csma_timer_input_bg_color2,
@@ -739,6 +756,7 @@ $acx_csma_timer_title_color2=$_POST['acx_csma_timer_title_color2'];
739
  'acx_csma_desc_text_color2'=>$acx_csma_desc_text_color2,
740
  'acx_csma_desc_content_color2'=>$acx_csma_desc_content_color2,
741
  'acx_csma_social_link_title2'=>$acx_csma_social_link_title2,
 
742
  'acx_csma_social_link_color2'=>$acx_csma_social_link_color2,
743
  'acx_csma_fb_link2'=>$acx_csma_fb_link2,
744
  'acx_csma_twitter_link2'=>$acx_csma_twitter_link2,
@@ -1163,9 +1181,6 @@ acx_csma_hook_function('acx_csma_hook_mainoptions_outside_if_submit');
1163
 
1164
  <?php acx_csma_hook_function('acx_csma_hook_mainoptions_below_add_template'); ?>
1165
  </div> <!-- main -->
1166
-
1167
-
1168
-
1169
  <?php
1170
  $acx_csma_appearence_array=acx_csma_get_db_array_value();
1171
  ?>
@@ -1228,7 +1243,6 @@ acx_csma_hook_function('acx_csma_hook_mainoptions_outside_if_submit');
1228
  $logo1_attachment_url = parse_url( wp_get_attachment_url($acx_csma_logo1_id) );
1229
  $logo1_url = $logo1_attachment_url [ 'scheme' ] . '://' .rawurlencode( basename( $logo1_attachment_url[ 'host' ])). $logo1_attachment_url[ 'path' ];
1230
  }
1231
-
1232
  ?>
1233
  <label>
1234
  <?php _e("Logo Image:","coming-soon-maintenance-mode-from-acurax"); ?> <span id="acx_csma_span">(<?php _e("Recommended size 231x67","coming-soon-maintenance-mode-from-acurax"); ?>)</span>
@@ -1709,6 +1723,18 @@ acx_csma_hook_function('acx_csma_hook_mainoptions_outside_if_submit');
1709
  <div style="position: absolute;" id="acx_csma_logo_text_color2_div"></div>
1710
  </div> <!-- acx_qa_field -->
1711
  </div> <!-- acx_show_logo_text -->
 
 
 
 
 
 
 
 
 
 
 
 
1712
 
1713
  </div> <!-- acx_csmap_q_and_a_inside -->
1714
  </div> <!-- acx_csmap_q_and_a -->
@@ -1761,6 +1787,13 @@ acx_csma_hook_function('acx_csma_hook_mainoptions_outside_if_submit');
1761
  <input type="text" name="acx_csma_inside_bg_color2" id="acx_csma_inside_bg_color2" onblur="acx_csma_validate(this.value);" value="<?php echo $acx_csma_appearence_array['2']['acx_csma_inside_bg_color2']; ?>" size="20"/>
1762
  <div style="position: absolute;" id="acx_csma_inside_bg_color2_div"></div>
1763
  </div> <!-- acx_qa_field -->
 
 
 
 
 
 
 
1764
  </div> <!-- acx_csmap_q_and_a_inside -->
1765
  </div> <!-- acx_csmap_q_and_a -->
1766
  </div> <!-- acx_csmap_q_and_a_h -->
@@ -1844,6 +1877,12 @@ acx_csma_hook_function('acx_csma_hook_mainoptions_outside_if_submit');
1844
  <input type="text" name="acx_csma_subscribe_btn_color2" id="acx_csma_subscribe_btn_color2" onblur="acx_csma_validate(this.value);" value="<?php echo $acx_csma_appearence_array['2']['acx_csma_subscribe_btn_color2']; ?>" size="20"/>
1845
  <div style="position: absolute;" id="acx_csma_subscribe_btn_color2_div"></div>
1846
  </div> <!-- acx_qa_field -->
 
 
 
 
 
 
1847
  <label>
1848
  <?php _e("Subscribe Success Message:","coming-soon-maintenance-mode-from-acurax"); ?>
1849
  </label>
@@ -1938,6 +1977,13 @@ acx_csma_hook_function('acx_csma_hook_mainoptions_outside_if_submit');
1938
  <input type="text" name="acx_csma_social_link_title2" value="<?php echo $acx_csma_social_link_title2 = acx_csma_option_text_after_save_hook_fn($acx_csma_social_link_title2 ); ?>" size="20"/>
1939
  </div> <!-- acx_qa_field -->
1940
  <label>
 
 
 
 
 
 
 
1941
  <?php _e("Social Media TextColor:","coming-soon-maintenance-mode-from-acurax"); ?><a onclick="acx_csma_restore_default('','#ffffff','acx_csma_social_link_color2');" class="acx_csmap_button_reset">[<?php _e("Reset To Default","coming-soon-maintenance-mode-from-acurax"); ?>]</a>
1942
  </label>
1943
  <div class="acx_qa_field">
@@ -3244,13 +3290,7 @@ acx_csma_hook_function('acx_csma_hook_mainoptions_outside_if_submit');
3244
  </td></tr>
3245
  </table>
3246
  </form>
3247
-
3248
- <div id="acx_csma_sidebar">
3249
  <?php acx_csma_hook_function('acx_csma_hook_sidebar_widget'); ?>
3250
- </div> <!-- acx_csma_sidebar -->
3251
-
3252
-
3253
-
3254
  </div> </div><!-- class wrap-->
3255
  <?php
3256
  $acx_csma_template = get_option('acx_csma_template');
@@ -3262,7 +3302,6 @@ if(is_array($acx_csma_template_array) && !array_key_exists($acx_csma_template,$a
3262
  }
3263
  if($acx_csma_template != "")
3264
  {
3265
-
3266
  ?>
3267
  <script type="text/javascript">
3268
  jQuery(document).ready(function()
@@ -3436,13 +3475,13 @@ function acx_csma_restore_default(img_id,default_value,text_id,set_bg)
3436
 
3437
  if(set_bg!="")
3438
  {
3439
- var text_id_j="#"+text_id;
3440
- jQuery(text_id_j).css('background',default_value);
3441
  }
3442
  if(img_id!="")
3443
  {
3444
- var acx_csma_bg_img_id=document.getElementById(img_id);
3445
- acx_csma_bg_img_id.src = default_value;
3446
  }
3447
  document.getElementById(text_id).value = default_value;
3448
  }
70
 
71
  if(ISSET($_POST['acx_csma_ip_list']))
72
  {
73
+ $acx_csma_ip_list = $_POST['acx_csma_ip_list'];
74
  }
75
  else{
76
  $acx_csma_ip_list=array();
81
  }
82
 
83
  update_option('acx_csma_ip_list', $acx_csma_ip_list);
 
 
84
  if(ISSET($_POST['acx_csma_restrict_role']))
85
  {
86
  $acx_csma_restrict_role = $_POST['acx_csma_restrict_role'];
100
  }
101
  update_option('acx_csma_restrict_role', $acx_csma_restrict_role);
102
  }
 
103
  //************************************************template 1 ********************************************
104
+ $acx_csma_appearence_array=acx_csma_get_db_array_value();
105
 
106
  $acx_csma_background_image1=$_POST['acx_csma_background_image1'];
107
  $acx_csma_background_image1 = acx_csma_text_before_save_hook_fn('acx_csma_background_image1',$acx_csma_background_image1);
244
  $acx_csma_logo_text_color2=$_POST['acx_csma_logo_text_color2'];
245
  $acx_csma_logo_text_color2 = acx_csma_text_before_save_hook_fn('acx_csma_logo_text_color2',$acx_csma_logo_text_color2);
246
  if($acx_csma_logo_text_color2==""){$acx_csma_logo_text_color2=$acx_csma_appearence_array['2']['acx_csma_logo_text_color2'];}
247
+ $acx_csma_logo_bg_color2=$_POST['acx_csma_logo_bg_color2'];
248
+ $acx_csma_logo_bg_color2 = acx_csma_text_before_save_hook_fn('acx_csma_logo_bg_color2',$acx_csma_logo_bg_color2);
249
+ if($acx_csma_logo_bg_color2==""){$acx_csma_logo_bg_color2=$acx_csma_appearence_array['2']['acx_csma_logo_bg_color2'];}
250
+
251
+
252
  $acx_csma_title2=$_POST['acx_csma_title2'];
253
  $acx_csma_title2 = acx_csma_text_before_save_hook_fn('acx_csma_title2',$acx_csma_title2);
254
  $acx_csma_title_color2=$_POST['acx_csma_title_color2'];
262
  $acx_csma_inside_bg_color2=$_POST['acx_csma_inside_bg_color2'];
263
  $acx_csma_inside_bg_color2 = acx_csma_text_before_save_hook_fn('acx_csma_inside_bg_color2',$acx_csma_inside_bg_color2);
264
  if($acx_csma_inside_bg_color2==""){$acx_csma_inside_bg_color2=$acx_csma_appearence_array['2']['acx_csma_inside_bg_color2'];}
265
+ $acx_csma_divider_bg_color2=$_POST['acx_csma_divider_bg_color2'];
266
+ $acx_csma_divider_bg_color2 = acx_csma_text_before_save_hook_fn('acx_csma_divider_bg_color2',$acx_csma_divider_bg_color2);
267
+ if($acx_csma_divider_bg_color2==""){$acx_csma_divider_bg_color2=$acx_csma_appearence_array['2']['acx_csma_divider_bg_color2'];}
268
+
269
  $acx_csma_show_timer2=$_POST['acx_csma_show_timer2'];
270
  $acx_csma_show_timer2 = acx_csma_text_before_save_hook_fn('acx_csma_show_timer2',$acx_csma_show_timer2);
271
  if($acx_csma_show_timer2==""){ $acx_csma_show_timer2=$acx_csma_appearence_array['2']['acx_csma_show_timer2'];}
272
+ $acx_csma_show_subscription2=$_POST['acx_csma_show_subscription2'];
273
  $acx_csma_show_subscription2 = acx_csma_text_before_save_hook_fn('acx_csma_show_subscription2',$acx_csma_show_subscription2);
274
+ if($acx_csma_show_subscription2==""){ $acx_csma_show_subscription2=$acx_csma_appearence_array['2']['acx_csma_show_subscription2'];}
275
+ $acx_csma_show_subscription_name2=$_POST['acx_csma_show_subscription_name2'];
276
  $acx_csma_show_subscription_name2 = acx_csma_text_before_save_hook_fn('acx_csma_show_subscription_name2',$acx_csma_show_subscription_name2);
277
+ if($acx_csma_show_subscription_name2==""){ $acx_csma_show_subscription_name2=$acx_csma_appearence_array['2']['acx_csma_show_subscription_name2'];}
278
 
279
+ $acx_csma_subscribe_btn_text2=$_POST['acx_csma_subscribe_btn_text2'];
280
+ $acx_csma_subscribe_btn_text2 = acx_csma_text_before_save_hook_fn('acx_csma_subscribe_btn_text2',$acx_csma_subscribe_btn_text2);
281
+ if($acx_csma_subscribe_btn_text2==""){$acx_csma_subscribe_btn_text2=$acx_csma_appearence_array['2']['acx_csma_subscribe_btn_text2'];}
282
  $acx_csma_timer_title2=$_POST['acx_csma_timer_title2'];
283
  $acx_csma_timer_title2 = acx_csma_text_before_save_hook_fn('acx_csma_timer_title2',$acx_csma_timer_title2);
284
 
285
+ $acx_csma_timer_title_color2=$_POST['acx_csma_timer_title_color2'];
286
  $acx_csma_timer_title_color2 = acx_csma_text_before_save_hook_fn('acx_csma_timer_title_color2',$acx_csma_timer_title_color2);
287
  if($acx_csma_timer_title_color2==""){$acx_csma_timer_title_color2=$acx_csma_appearence_array['2']['acx_csma_timer_title_color2'];}
288
  $acx_csma_subscribe_btn_color2=$_POST['acx_csma_subscribe_btn_color2'];
289
  $acx_csma_subscribe_btn_color2 = acx_csma_text_before_save_hook_fn('acx_csma_subscribe_btn_color2',$acx_csma_subscribe_btn_color2);
290
  if($acx_csma_subscribe_btn_color2==""){$acx_csma_subscribe_btn_color2=$acx_csma_appearence_array['2']['acx_csma_subscribe_btn_color2'];}
291
+ $acx_csma_subscribe_btn_bg_color2=$_POST['acx_csma_subscribe_btn_bg_color2'];
292
+ $acx_csma_subscribe_btn_bg_color2 = acx_csma_text_before_save_hook_fn('acx_csma_subscribe_btn_bg_color2',$acx_csma_subscribe_btn_bg_color2);
293
+ if($acx_csma_subscribe_btn_bg_color2==""){$acx_csma_subscribe_btn_bg_color2=$acx_csma_appearence_array['2']['acx_csma_subscribe_btn_bg_color2'];}
294
+
295
+
296
  $acx_csma_subscribe_success2=$_POST['acx_csma_subscribe_success2'];
297
 
298
  $acx_csma_subscribe_success2 = acx_csma_text_before_save_hook_fn('acx_csma_subscribe_success2',$acx_csma_subscribe_success2);
326
  $acx_csma_desc_content_color2=$_POST['acx_csma_desc_content_color2'];
327
  $acx_csma_desc_content_color2 = acx_csma_text_before_save_hook_fn('acx_csma_desc_content_color2',$acx_csma_desc_content_color2);
328
  if($acx_csma_desc_content_color2==""){$acx_csma_desc_content_color2=$acx_csma_appearence_array['2']['acx_csma_desc_content_color2'];}
329
+ $acx_csma_social_bg_color2=$_POST['acx_csma_social_bg_color2'];
330
+ $acx_csma_social_bg_color2 = acx_csma_text_before_save_hook_fn('acx_csma_social_bg_color2',$acx_csma_social_bg_color2);
331
+ if($acx_csma_social_bg_color2==""){$acx_csma_social_bg_color2=$acx_csma_appearence_array['2']['acx_csma_social_bg_color2'];}
332
  $acx_csma_social_link_color2=$_POST['acx_csma_social_link_color2'];
333
  $acx_csma_social_link_color2 = acx_csma_text_before_save_hook_fn('acx_csma_social_link_color2',$acx_csma_social_link_color2);
334
  if($acx_csma_social_link_color2==""){$acx_csma_social_link_color2=$acx_csma_appearence_array['2']['acx_csma_social_link_color2'];}
728
  'acx_csma_logo2'=>$acx_csma_logo2,
729
  'acx_csma_logo_text2' =>$acx_csma_logo_text2,
730
  'acx_csma_logo_text_color2' =>$acx_csma_logo_text_color2,
731
+ 'acx_csma_logo_bg_color2' =>$acx_csma_logo_bg_color2,
732
  'acx_csma_title2'=>$acx_csma_title2,
733
  'acx_csma_title_color2'=>$acx_csma_title_color2,
734
  'acx_csma_subtitle_text2'=>$acx_csma_subtitle_text2,
735
  'acx_csma_subtitle_color2'=>$acx_csma_subtitle_color2,
736
  'acx_csma_inside_bg_color2'=>$acx_csma_inside_bg_color2,
737
+ 'acx_csma_divider_bg_color2'=>$acx_csma_divider_bg_color2,
738
  'acx_csma_custom_html_top_timer'=>$acx_csma_custom_html_top_timer,
739
  'acx_csma_show_subscription2'=>$acx_csma_show_subscription2,
740
  'acx_csma_show_subscription_name2'=>$acx_csma_show_subscription_name2,
744
  'acx_csma_timer_title2'=>$acx_csma_timer_title2,
745
  'acx_csma_timer_title_color2'=>$acx_csma_timer_title_color2,
746
  'acx_csma_subscribe_btn_color2'=>$acx_csma_subscribe_btn_color2,
747
+ 'acx_csma_subscribe_btn_bg_color2'=>$acx_csma_subscribe_btn_bg_color2,
748
  'acx_csma_subscribe_success2'=>$acx_csma_subscribe_success2,
749
  'acx_csma_subscribe_invalid2'=>$acx_csma_subscribe_invalid2,
750
  'acx_csma_timer_input_bg_color2'=>$acx_csma_timer_input_bg_color2,
756
  'acx_csma_desc_text_color2'=>$acx_csma_desc_text_color2,
757
  'acx_csma_desc_content_color2'=>$acx_csma_desc_content_color2,
758
  'acx_csma_social_link_title2'=>$acx_csma_social_link_title2,
759
+ 'acx_csma_social_bg_color2'=>$acx_csma_social_bg_color2,
760
  'acx_csma_social_link_color2'=>$acx_csma_social_link_color2,
761
  'acx_csma_fb_link2'=>$acx_csma_fb_link2,
762
  'acx_csma_twitter_link2'=>$acx_csma_twitter_link2,
1181
 
1182
  <?php acx_csma_hook_function('acx_csma_hook_mainoptions_below_add_template'); ?>
1183
  </div> <!-- main -->
 
 
 
1184
  <?php
1185
  $acx_csma_appearence_array=acx_csma_get_db_array_value();
1186
  ?>
1243
  $logo1_attachment_url = parse_url( wp_get_attachment_url($acx_csma_logo1_id) );
1244
  $logo1_url = $logo1_attachment_url [ 'scheme' ] . '://' .rawurlencode( basename( $logo1_attachment_url[ 'host' ])). $logo1_attachment_url[ 'path' ];
1245
  }
 
1246
  ?>
1247
  <label>
1248
  <?php _e("Logo Image:","coming-soon-maintenance-mode-from-acurax"); ?> <span id="acx_csma_span">(<?php _e("Recommended size 231x67","coming-soon-maintenance-mode-from-acurax"); ?>)</span>
1723
  <div style="position: absolute;" id="acx_csma_logo_text_color2_div"></div>
1724
  </div> <!-- acx_qa_field -->
1725
  </div> <!-- acx_show_logo_text -->
1726
+ <div class="f_w"></div>
1727
+ <label>
1728
+ <?php _e("Logo Background Color:","coming-soon-maintenance-mode-from-acurax"); ?>
1729
+ <a onclick="acx_csma_restore_default('','#000000','acx_csma_logo_bg_color2');" class="acx_csmap_button_reset">[<?php _e("Reset To Default","coming-soon-maintenance-mode-from-acurax"); ?>]</a>
1730
+
1731
+ </label>
1732
+ <div class="acx_qa_field">
1733
+ <input type="text" name="acx_csma_logo_bg_color2" id="acx_csma_logo_bg_color2" value="<?php echo $acx_csma_appearence_array['2']['acx_csma_logo_bg_color2']; ?>" onblur="acx_csma_validate(this.value);" size="20"/>
1734
+ <div style="position: absolute;" id="acx_csma_logo_bg_color2_div"></div>
1735
+ </div> <!-- acx_qa_field -->
1736
+
1737
+
1738
 
1739
  </div> <!-- acx_csmap_q_and_a_inside -->
1740
  </div> <!-- acx_csmap_q_and_a -->
1787
  <input type="text" name="acx_csma_inside_bg_color2" id="acx_csma_inside_bg_color2" onblur="acx_csma_validate(this.value);" value="<?php echo $acx_csma_appearence_array['2']['acx_csma_inside_bg_color2']; ?>" size="20"/>
1788
  <div style="position: absolute;" id="acx_csma_inside_bg_color2_div"></div>
1789
  </div> <!-- acx_qa_field -->
1790
+ <label>
1791
+ <?php _e("Divider Background Color:","coming-soon-maintenance-mode-from-acurax"); ?><a onclick="acx_csma_restore_default('','#000000','acx_csma_divider_bg_color2');" class="acx_csmap_button_reset">[<?php _e("Reset To Default","coming-soon-maintenance-mode-from-acurax"); ?>]</a>
1792
+ </label>
1793
+ <div class="acx_qa_field">
1794
+ <input type="text" name="acx_csma_divider_bg_color2" id="acx_csma_divider_bg_color2" onblur="acx_csma_validate(this.value);" value="<?php echo $acx_csma_appearence_array['2']['acx_csma_divider_bg_color2']; ?>" size="20"/>
1795
+ <div style="position: absolute;" id="acx_csma_divider_bg_color2_div"></div>
1796
+ </div> <!-- acx_qa_field -->
1797
  </div> <!-- acx_csmap_q_and_a_inside -->
1798
  </div> <!-- acx_csmap_q_and_a -->
1799
  </div> <!-- acx_csmap_q_and_a_h -->
1877
  <input type="text" name="acx_csma_subscribe_btn_color2" id="acx_csma_subscribe_btn_color2" onblur="acx_csma_validate(this.value);" value="<?php echo $acx_csma_appearence_array['2']['acx_csma_subscribe_btn_color2']; ?>" size="20"/>
1878
  <div style="position: absolute;" id="acx_csma_subscribe_btn_color2_div"></div>
1879
  </div> <!-- acx_qa_field -->
1880
+ <label><?php _e("Subscribe Button BackgroundColor:","coming-soon-maintenance-mode-from-acurax"); ?><a onclick="acx_csma_restore_default('','#000000','acx_csma_subscribe_btn_bg_color2');" class="acx_csmap_button_reset">[<?php _e("Reset To Default","coming-soon-maintenance-mode-from-acurax"); ?>]</a>
1881
+ </label>
1882
+ <div class="acx_qa_field">
1883
+ <input type="text" name="acx_csma_subscribe_btn_bg_color2" id="acx_csma_subscribe_btn_bg_color2" onblur="acx_csma_validate(this.value);" value="<?php echo $acx_csma_appearence_array['2']['acx_csma_subscribe_btn_bg_color2']; ?>" size="20"/>
1884
+ <div style="position: absolute;" id="acx_csma_subscribe_btn_bg_color2_div"></div>
1885
+ </div> <!-- acx_qa_field -->
1886
  <label>
1887
  <?php _e("Subscribe Success Message:","coming-soon-maintenance-mode-from-acurax"); ?>
1888
  </label>
1977
  <input type="text" name="acx_csma_social_link_title2" value="<?php echo $acx_csma_social_link_title2 = acx_csma_option_text_after_save_hook_fn($acx_csma_social_link_title2 ); ?>" size="20"/>
1978
  </div> <!-- acx_qa_field -->
1979
  <label>
1980
+ <?php _e("Social Media BackgroundColor:","coming-soon-maintenance-mode-from-acurax"); ?><a onclick="acx_csma_restore_default('','#000000','acx_csma_social_bg_color2');" class="acx_csmap_button_reset">[<?php _e("Reset To Default","coming-soon-maintenance-mode-from-acurax"); ?>]</a>
1981
+ </label>
1982
+ <div class="acx_qa_field">
1983
+ <input type="text" name="acx_csma_social_bg_color2" id="acx_csma_social_bg_color2" onblur="acx_csma_validate(this.value);" value="<?php echo $acx_csma_appearence_array['2']['acx_csma_social_bg_color2']; ?>" size="20"/>
1984
+ <div style="position: absolute;" id="acx_csma_social_bg_color2_div"></div>
1985
+ </div> <!-- acx_qa_field -->
1986
+ <label>
1987
  <?php _e("Social Media TextColor:","coming-soon-maintenance-mode-from-acurax"); ?><a onclick="acx_csma_restore_default('','#ffffff','acx_csma_social_link_color2');" class="acx_csmap_button_reset">[<?php _e("Reset To Default","coming-soon-maintenance-mode-from-acurax"); ?>]</a>
1988
  </label>
1989
  <div class="acx_qa_field">
3290
  </td></tr>
3291
  </table>
3292
  </form>
 
 
3293
  <?php acx_csma_hook_function('acx_csma_hook_sidebar_widget'); ?>
 
 
 
 
3294
  </div> </div><!-- class wrap-->
3295
  <?php
3296
  $acx_csma_template = get_option('acx_csma_template');
3302
  }
3303
  if($acx_csma_template != "")
3304
  {
 
3305
  ?>
3306
  <script type="text/javascript">
3307
  jQuery(document).ready(function()
3475
 
3476
  if(set_bg!="")
3477
  {
3478
+ var text_id_j="#"+text_id;
3479
+ jQuery(text_id_j).css('background',default_value);
3480
  }
3481
  if(img_id!="")
3482
  {
3483
+ var acx_csma_bg_img_id=document.getElementById(img_id);
3484
+ acx_csma_bg_img_id.src = default_value;
3485
  }
3486
  document.getElementById(text_id).value = default_value;
3487
  }
includes/acx_csma_display_variables.php CHANGED
@@ -6,8 +6,6 @@
6
  <div id="acx_csma_form">
7
  <?php acx_csma_display_variables(); ?>
8
  </div> <!-- acx_csma_form -->
9
- <div id="acx_csma_sidebar">
10
  <?php acx_csma_hook_function('acx_csma_hook_sidebar_widget'); ?>
11
- </div> <!-- acx_csma_sidebar -->
12
  </div>
13
  </div>
6
  <div id="acx_csma_form">
7
  <?php acx_csma_display_variables(); ?>
8
  </div> <!-- acx_csma_form -->
 
9
  <?php acx_csma_hook_function('acx_csma_hook_sidebar_widget'); ?>
 
10
  </div>
11
  </div>
includes/acx_csma_expert_support.php CHANGED
@@ -60,44 +60,43 @@ $acx_installation_url = "";
60
  var request_acx_form_status = 0;
61
  function acx_quick_form_reset()
62
  {
63
- jQuery("#acx_subject").val('');
64
- jQuery("#acx_question").val('');
65
  }
66
  acx_quick_form_reset();
67
  function acx_csma_quick_request_submit()
68
  {
69
- var acx_name = jQuery("#acx_name").val();
70
- var acx_email = jQuery("#acx_email").val();
71
- var acx_phone = jQuery("#acx_phone").val();
72
- var acx_weburl = jQuery("#acx_weburl").val();
73
- var acx_subject = jQuery("#acx_subject").val();
74
- var acx_question = jQuery("#acx_question").val();
75
- var order = '&action=acx_csma_quick_request_submit&acx_name='+acx_name+'&acx_email='+acx_email+'&acx_phone='+acx_phone+'&acx_weburl='+acx_weburl+'&acx_subject='+acx_subject+'&acx_question='+acx_question+'&acx_csma_es=<?php echo wp_create_nonce("acx_csma_es"); ?>';
76
- if(request_acx_form_status == 0)
77
- {
78
- request_acx_form_status = 1;
79
- jQuery.post(ajaxurl, order, function(quick_request_acx_response)
80
- {
81
- if(quick_request_acx_response == 1)
82
- {
83
- alert('<?php _e("Your Request Submitted Successfully!","coming-soon-maintenance-mode-from-acurax");?>');
84
- acx_quick_form_reset();
85
- request_acx_form_status = 0;
86
- } else if(quick_request_acx_response == 2)
87
- {
88
- alert('<?php _e("Please Fill Mandatory Fields.","coming-soon-maintenance-mode-from-acurax");?>');
89
- request_acx_form_status = 0;
90
- } else
91
- {
92
- alert('<?php _e("There was an error processing the request, Please try again.","coming-soon-maintenance-mode-from-acurax");?>');
93
- acx_quick_form_reset();
94
- request_acx_form_status = 0;
95
- }
96
- });
97
- } else
98
- {
99
- alert('<?php _e("A request is already in progress.","coming-soon-maintenance-mode-from-acurax");?>');
100
- }
101
  }
102
- </script>
103
- <?php ?>
60
  var request_acx_form_status = 0;
61
  function acx_quick_form_reset()
62
  {
63
+ jQuery("#acx_subject").val('');
64
+ jQuery("#acx_question").val('');
65
  }
66
  acx_quick_form_reset();
67
  function acx_csma_quick_request_submit()
68
  {
69
+ var acx_name = jQuery("#acx_name").val();
70
+ var acx_email = jQuery("#acx_email").val();
71
+ var acx_phone = jQuery("#acx_phone").val();
72
+ var acx_weburl = jQuery("#acx_weburl").val();
73
+ var acx_subject = jQuery("#acx_subject").val();
74
+ var acx_question = jQuery("#acx_question").val();
75
+ var order = '&action=acx_csma_quick_request_submit&acx_name='+acx_name+'&acx_email='+acx_email+'&acx_phone='+acx_phone+'&acx_weburl='+acx_weburl+'&acx_subject='+acx_subject+'&acx_question='+acx_question+'&acx_csma_es=<?php echo wp_create_nonce("acx_csma_es"); ?>';
76
+ if(request_acx_form_status == 0)
77
+ {
78
+ request_acx_form_status = 1;
79
+ jQuery.post(ajaxurl, order, function(quick_request_acx_response)
80
+ {
81
+ if(quick_request_acx_response == 1)
82
+ {
83
+ alert('<?php _e("Your Request Submitted Successfully!","coming-soon-maintenance-mode-from-acurax");?>');
84
+ acx_quick_form_reset();
85
+ request_acx_form_status = 0;
86
+ } else if(quick_request_acx_response == 2)
87
+ {
88
+ alert('<?php _e("Please Fill Mandatory Fields.","coming-soon-maintenance-mode-from-acurax");?>');
89
+ request_acx_form_status = 0;
90
+ } else
91
+ {
92
+ alert('<?php _e("There was an error processing the request, Please try again.","coming-soon-maintenance-mode-from-acurax");?>');
93
+ acx_quick_form_reset();
94
+ request_acx_form_status = 0;
95
+ }
96
+ });
97
+ } else
98
+ {
99
+ alert('<?php _e("A request is already in progress.","coming-soon-maintenance-mode-from-acurax");?>');
100
+ }
101
  }
102
+ </script>
 
includes/acx_csma_subscribers.php CHANGED
@@ -22,15 +22,15 @@ if(is_serialized($acx_csma_subscribe_details ))
22
  }
23
  if(ISSET($_GET['action']))
24
  {
25
- $del=$_GET['action'];
26
  }
27
  else
28
  {
29
- $del='';
30
  }
31
  if(ISSET($_GET['ID']))
32
  {
33
- $id=$_GET['ID'];
34
  }
35
  else
36
  {
22
  }
23
  if(ISSET($_GET['action']))
24
  {
25
+ $del = $_GET['action'];
26
  }
27
  else
28
  {
29
+ $del = '';
30
  }
31
  if(ISSET($_GET['ID']))
32
  {
33
+ $id = $_GET['ID'];
34
  }
35
  else
36
  {
includes/defaults.php CHANGED
@@ -28,7 +28,7 @@ function acx_csma_appearence_array_default_value_setting($acx_csma_appearence_ar
28
  $acx_csma_custom_html_top_sub1 = "";
29
  $acx_csma_custom_html_bottom_sub1= "";
30
  $acx_csma_subscribe_bg_color1="#0b1c2c";
31
- $acx_csma_subscribe_btn_text1=__("submit","coming-soon-maintenance-mode-from-acurax");;
32
  $acx_csma_subscribe_btn_text_color1="#ffffff";
33
  $acx_csma_subscribe_btn_color1="#ff7800";
34
  $acx_csma_subscribe_btn_hover_color1="#0b1c2c";
@@ -47,11 +47,13 @@ function acx_csma_appearence_array_default_value_setting($acx_csma_appearence_ar
47
  $acx_csma_logo_choice2="image";
48
  $acx_csma_logo_text2=get_bloginfo('name');
49
  $acx_csma_logo_text_color2="#ffffff";
 
50
  $acx_csma_title2=__("Hello","coming-soon-maintenance-mode-from-acurax");
51
  $acx_csma_title_color2="#000000";
52
  $acx_csma_subtitle_text2=__("We are Coming Very Soon","coming-soon-maintenance-mode-from-acurax");
53
  $acx_csma_subtitle_color2="#000000";
54
  $acx_csma_inside_bg_color2="#ffd800";
 
55
  $acx_csma_custom_html_above_timer="";
56
  $acx_csma_custom_html_top_timer="";
57
  $acx_csma_show_subscription2 = 1;
@@ -61,6 +63,7 @@ function acx_csma_appearence_array_default_value_setting($acx_csma_appearence_ar
61
  $acx_csma_timer_title2=__("Estimate time for launching","coming-soon-maintenance-mode-from-acurax");
62
  $acx_csma_timer_title_color2="#000000";
63
  $acx_csma_subscribe_btn_color2="#ffd800";
 
64
  $acx_csma_subscribe_success2=__("Successfully Subscribed","coming-soon-maintenance-mode-from-acurax");
65
  $acx_csma_subscribe_invalid2=__("Invalid Email","coming-soon-maintenance-mode-from-acurax");
66
  $acx_csma_timer_input_bg_color2="#ffffff";
@@ -70,6 +73,7 @@ function acx_csma_appearence_array_default_value_setting($acx_csma_appearence_ar
70
  $acx_csma_desc_title2=__("What is Coming","coming-soon-maintenance-mode-from-acurax");
71
  $acx_csma_desc_subtitle2=stripslashes(trim(__("Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat. Ut wisi enim ad minim veniam, quis nostrud exerci tation ullamcorper suscipit lobortis nisl ut aliquip ex ea commodo consequat.","coming-soon-maintenance-mode-from-acurax")));
72
  $acx_csma_desc_text_color2="#000000";
 
73
  $acx_csma_social_link_color2="#ffffff";
74
  $acx_csma_desc_content_color2="#000000";
75
  $acx_csma_social_link_title2=__("Follow Us ON","coming-soon-maintenance-mode-from-acurax");
@@ -233,11 +237,13 @@ $acx_csma_appearence_array_default['2'] = array(
233
  'acx_csma_logo2'=>$acx_csma_logo2,
234
  'acx_csma_logo_text2' =>sanitize_text_field($acx_csma_logo_text2),
235
  'acx_csma_logo_text_color2' =>sanitize_text_field($acx_csma_logo_text_color2),
 
236
  'acx_csma_title2'=>sanitize_text_field($acx_csma_title2),
237
  'acx_csma_title_color2'=>sanitize_text_field($acx_csma_title_color2),
238
  'acx_csma_subtitle_text2'=>sanitize_text_field($acx_csma_subtitle_text2),
239
  'acx_csma_subtitle_color2'=>sanitize_text_field($acx_csma_subtitle_color2),
240
  'acx_csma_inside_bg_color2'=>sanitize_text_field($acx_csma_inside_bg_color2),
 
241
  'acx_csma_custom_html_above_timer'=>$acx_csma_custom_html_above_timer,
242
  'acx_csma_custom_html_top_timer'=>$acx_csma_custom_html_top_timer,
243
  'acx_csma_show_subscription2'=>sanitize_text_field($acx_csma_show_subscription2),
@@ -247,6 +253,7 @@ $acx_csma_appearence_array_default['2'] = array(
247
  'acx_csma_timer_title2'=>sanitize_text_field($acx_csma_timer_title2),
248
  'acx_csma_timer_title_color2'=>sanitize_text_field($acx_csma_timer_title_color2),
249
  'acx_csma_subscribe_btn_color2'=>sanitize_text_field($acx_csma_subscribe_btn_color2),
 
250
  'acx_csma_subscribe_success2'=>sanitize_text_field($acx_csma_subscribe_success2),
251
  'acx_csma_subscribe_invalid2'=>sanitize_text_field($acx_csma_subscribe_invalid2),
252
  'acx_csma_timer_input_bg_color2'=>sanitize_text_field($acx_csma_timer_input_bg_color2),
@@ -256,6 +263,7 @@ $acx_csma_appearence_array_default['2'] = array(
256
  'acx_csma_desc_title2'=>sanitize_text_field($acx_csma_desc_title2),
257
  'acx_csma_desc_subtitle2'=>sanitize_text_field($acx_csma_desc_subtitle2),
258
  'acx_csma_desc_text_color2'=>sanitize_text_field($acx_csma_desc_text_color2),
 
259
  'acx_csma_social_link_color2'=>sanitize_text_field($acx_csma_social_link_color2),
260
  'acx_csma_desc_content_color2'=>sanitize_text_field($acx_csma_desc_content_color2),
261
  'acx_csma_social_link_title2'=>sanitize_text_field($acx_csma_social_link_title2),
28
  $acx_csma_custom_html_top_sub1 = "";
29
  $acx_csma_custom_html_bottom_sub1= "";
30
  $acx_csma_subscribe_bg_color1="#0b1c2c";
31
+ $acx_csma_subscribe_btn_text1=__("submit","coming-soon-maintenance-mode-from-acurax");
32
  $acx_csma_subscribe_btn_text_color1="#ffffff";
33
  $acx_csma_subscribe_btn_color1="#ff7800";
34
  $acx_csma_subscribe_btn_hover_color1="#0b1c2c";
47
  $acx_csma_logo_choice2="image";
48
  $acx_csma_logo_text2=get_bloginfo('name');
49
  $acx_csma_logo_text_color2="#ffffff";
50
+ $acx_csma_logo_bg_color2="#000000";
51
  $acx_csma_title2=__("Hello","coming-soon-maintenance-mode-from-acurax");
52
  $acx_csma_title_color2="#000000";
53
  $acx_csma_subtitle_text2=__("We are Coming Very Soon","coming-soon-maintenance-mode-from-acurax");
54
  $acx_csma_subtitle_color2="#000000";
55
  $acx_csma_inside_bg_color2="#ffd800";
56
+ $acx_csma_divider_bg_color2="#000000";
57
  $acx_csma_custom_html_above_timer="";
58
  $acx_csma_custom_html_top_timer="";
59
  $acx_csma_show_subscription2 = 1;
63
  $acx_csma_timer_title2=__("Estimate time for launching","coming-soon-maintenance-mode-from-acurax");
64
  $acx_csma_timer_title_color2="#000000";
65
  $acx_csma_subscribe_btn_color2="#ffd800";
66
+ $acx_csma_subscribe_btn_bg_color2="#000000";
67
  $acx_csma_subscribe_success2=__("Successfully Subscribed","coming-soon-maintenance-mode-from-acurax");
68
  $acx_csma_subscribe_invalid2=__("Invalid Email","coming-soon-maintenance-mode-from-acurax");
69
  $acx_csma_timer_input_bg_color2="#ffffff";
73
  $acx_csma_desc_title2=__("What is Coming","coming-soon-maintenance-mode-from-acurax");
74
  $acx_csma_desc_subtitle2=stripslashes(trim(__("Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat. Ut wisi enim ad minim veniam, quis nostrud exerci tation ullamcorper suscipit lobortis nisl ut aliquip ex ea commodo consequat.","coming-soon-maintenance-mode-from-acurax")));
75
  $acx_csma_desc_text_color2="#000000";
76
+ $acx_csma_social_bg_color2="#000000";
77
  $acx_csma_social_link_color2="#ffffff";
78
  $acx_csma_desc_content_color2="#000000";
79
  $acx_csma_social_link_title2=__("Follow Us ON","coming-soon-maintenance-mode-from-acurax");
237
  'acx_csma_logo2'=>$acx_csma_logo2,
238
  'acx_csma_logo_text2' =>sanitize_text_field($acx_csma_logo_text2),
239
  'acx_csma_logo_text_color2' =>sanitize_text_field($acx_csma_logo_text_color2),
240
+ 'acx_csma_logo_bg_color2' =>sanitize_text_field($acx_csma_logo_bg_color2),
241
  'acx_csma_title2'=>sanitize_text_field($acx_csma_title2),
242
  'acx_csma_title_color2'=>sanitize_text_field($acx_csma_title_color2),
243
  'acx_csma_subtitle_text2'=>sanitize_text_field($acx_csma_subtitle_text2),
244
  'acx_csma_subtitle_color2'=>sanitize_text_field($acx_csma_subtitle_color2),
245
  'acx_csma_inside_bg_color2'=>sanitize_text_field($acx_csma_inside_bg_color2),
246
+ 'acx_csma_divider_bg_color2'=>sanitize_text_field($acx_csma_divider_bg_color2),
247
  'acx_csma_custom_html_above_timer'=>$acx_csma_custom_html_above_timer,
248
  'acx_csma_custom_html_top_timer'=>$acx_csma_custom_html_top_timer,
249
  'acx_csma_show_subscription2'=>sanitize_text_field($acx_csma_show_subscription2),
253
  'acx_csma_timer_title2'=>sanitize_text_field($acx_csma_timer_title2),
254
  'acx_csma_timer_title_color2'=>sanitize_text_field($acx_csma_timer_title_color2),
255
  'acx_csma_subscribe_btn_color2'=>sanitize_text_field($acx_csma_subscribe_btn_color2),
256
+ 'acx_csma_subscribe_btn_bg_color2'=>sanitize_text_field($acx_csma_subscribe_btn_bg_color2),
257
  'acx_csma_subscribe_success2'=>sanitize_text_field($acx_csma_subscribe_success2),
258
  'acx_csma_subscribe_invalid2'=>sanitize_text_field($acx_csma_subscribe_invalid2),
259
  'acx_csma_timer_input_bg_color2'=>sanitize_text_field($acx_csma_timer_input_bg_color2),
263
  'acx_csma_desc_title2'=>sanitize_text_field($acx_csma_desc_title2),
264
  'acx_csma_desc_subtitle2'=>sanitize_text_field($acx_csma_desc_subtitle2),
265
  'acx_csma_desc_text_color2'=>sanitize_text_field($acx_csma_desc_text_color2),
266
+ 'acx_csma_social_bg_color2'=>sanitize_text_field($acx_csma_social_bg_color2),
267
  'acx_csma_social_link_color2'=>sanitize_text_field($acx_csma_social_link_color2),
268
  'acx_csma_desc_content_color2'=>sanitize_text_field($acx_csma_desc_content_color2),
269
  'acx_csma_social_link_title2'=>sanitize_text_field($acx_csma_social_link_title2),
includes/hook_functions.php CHANGED
@@ -2,82 +2,68 @@
2
  function acx_csma_service_banners()
3
  {
4
  ?>
5
- <div id="acx_ad_banners_csma">
6
- <?php
7
- $acx_csma_service_banners = get_option('acx_csma_service_banners');
8
  if ($acx_csma_service_banners != "no") { ?>
9
  <div id="acx_ad_banners_csma">
10
- <a href="http://wordpress.acurax.com/partner-with-us/?utm_source=csma&utm_campaign=agency_banner" target="_blank" class="acx_ad_csma_1">
11
- <div class="acx_ad_csma_title"><?php _e("Are You an Agency?","coming-soon-maintenance-mode-from-acurax");?></div> <!-- acx_ad_csma_title -->
12
- <div class="acx_ad_csma_desc_partner" style="padding-top: 0px; height: 32px; font-size: 13px; text-align: center;"><?php _e("Outsourcing Solutions From Acurax Can Add Value to Your Business","coming-soon-maintenance-mode-from-acurax");?></div> <!-- acx_ad_csma_desc -->
13
- </a> <!-- acx_ad_csma_1 -->
14
-
15
-
16
- <a href="http://wordpress.acurax.com/?utm_source=csma&utm_campaign=sidebar_banner_1" target="_blank" class="acx_ad_csma_1">
17
- <div class="acx_ad_csma_title"><?php _e("Need Help on Wordpress?","coming-soon-maintenance-mode-from-acurax");?></div> <!-- acx_ad_csma_title -->
18
- <div class="acx_ad_csma_desc"><?php _e("Instant Solutions for your wordpress Issues","coming-soon-maintenance-mode-from-acurax");?></div> <!-- acx_ad_csma_desc -->
19
  </a> <!-- acx_ad_csma_1 -->
20
 
21
- <a href="http://wordpress.acurax.com/?utm_source=csma&utm_campaign=sidebar_banner_2" target="_blank" class="acx_ad_csma_1">
22
- <div class="acx_ad_csma_title"><?php _e("Unique Design For Better Branding","coming-soon-maintenance-mode-from-acurax");?></div> <!-- acx_ad_csma_title -->
23
- <div class="acx_ad_csma_desc acx_ad_csma_desc2" style="padding-top: 0px; padding-left: 50px; height: 41px; font-size: 13px; text-align: center;"><?php _e("Get Responsive Custom Designed Website For High Conversion","coming-soon-maintenance-mode-from-acurax");?></div> <!-- acx_ad_csma_desc -->
24
  </a> <!-- acx_ad_csma_1 -->
25
 
26
- <a href="http://wordpress.acurax.com/?utm_source=csma&utm_campaign=sidebar_banner_3" target="_blank" class="acx_ad_csma_1">
27
- <div class="acx_ad_csma_title"><?php _e("Affordable Website Packages","coming-soon-maintenance-mode-from-acurax");?></div> <!-- acx_ad_csma_title -->
28
- <div class="acx_ad_csma_desc acx_ad_csma_desc3" style="padding-top: 0px; height: 32px; font-size: 13px; text-align: center;"><?php _e("Get Feature Rich Packages For a Custom Designed Website","coming-soon-maintenance-mode-from-acurax");?></div> <!-- acx_ad_csma_desc -->
29
  </a> <!-- acx_ad_csma_1 -->
30
 
31
  </div> <!-- acx_ad_banners_csma -->
32
  <?php } else { ?>
33
-
34
-
35
  <div class="acx_csma_sidebar_widget">
36
- <div class="acx_csma_sidebar_w_title"><?php _e("Partner With Us","coming-soon-maintenance-mode-from-acurax");?></div> <!-- acx_ad_csma_title -->
37
  <div class="acx_csma_sidebar_w_content">
38
- <?php _e("Acurax offers a strong partnership program for agencies which has a strong sales channel. Our team of creative designers and developers will be surely an added value to your services. We can completely take care of the projects or can work with your existing team.","coming-soon-maintenance-mode-from-acurax");?> <a href="http://wordpress.acurax.com/partner-with-us/?utm_source=csma&utm_campaign=agency_text" target="_blank"><?php _e("Get in touch","coming-soon-maintenance-mode-from-acurax");?></a>
39
  </div>
40
  </div> <!-- acx_csma_sidebar_widget -->
41
-
42
-
43
  <div class="acx_csma_sidebar_widget">
44
- <div class="acx_csma_sidebar_w_title"><?php _e("We Are Always Available","coming-soon-maintenance-mode-from-acurax");?></div> <!-- acx_ad_csma_title -->
45
- <div class="acx_csma_sidebar_w_content">
46
- <?php _e("We know you are in the process of improving your website, and we the team at Acurax is always available for any help or support that you need. ","coming-soon-maintenance-mode-from-acurax");?><a href="http://wordpress.acurax.com/?utm_source=csma&utm_campaign=sidebar_text_1" target="_blank"><?php _e("Get in touch","coming-soon-maintenance-mode-from-acurax");?></a>
47
- </div>
48
  </div> <!-- acx_csma_sidebar_widget -->
49
-
50
-
51
  <div class="acx_csma_sidebar_widget">
52
- <div class="acx_csma_sidebar_w_title"><?php _e("Do You Know?","coming-soon-maintenance-mode-from-acurax");?></div> <!-- acx_ad_csma_title -->
53
  <div class="acx_csma_sidebar_w_content acx_csma_sidebar_w_content_p_slide">
54
  </div>
55
  </div> <!-- acx_csma_sidebar_widget -->
56
  <script type="text/javascript">
57
- var acx_csma = new Array("<?php _e('A professionally designed website is the most cost effective marketing tool available in the world today...','coming-soon-maintenance-mode-from-acurax'); ?>","<?php _e('Personalizing your website can create a unique one to one experience and convert your visitors into customers.','coming-soon-maintenance-mode-from-acurax'); ?>","<?php _e('70% of searches from mobile devices are followed up with an action within 1 hour.','coming-soon-maintenance-mode-from-acurax'); ?>");
58
-
59
- // jQuery(".acx_csma_sidebar_w_content_p_slide p").height('30px');
60
  function acx_csma_t_rotate()
61
  {
62
- acx_csma_text = acx_csma[Math.floor(Math.random()*acx_csma.length)];
63
- jQuery(".acx_csma_sidebar_w_content_p_slide").fadeOut('slow')
64
- jQuery(".acx_csma_sidebar_w_content_p_slide").text(acx_csma_text);
65
- jQuery(".acx_csma_sidebar_w_content_p_slide").fadeIn('fast');
 
 
 
 
 
 
66
  }
67
  jQuery(document).ready(function() {
68
- acx_csma_t_rotate();
69
- setInterval(function(){ acx_csma_t_rotate(); }, 8000);
70
  });
71
  </script>
72
- <div class="acx_csma_sidebar_widget">
73
- <div class="acx_csma_sidebar_w_title"><?php _e("Grab The Blending Creativity","coming-soon-maintenance-mode-from-acurax");?></div>
74
- <div class="acx_csma_sidebar_w_content"><?php _e("Make your website user friendly and optimized for mobile devices for better user interaction and satisfaction ","coming-soon-maintenance-mode-from-acurax");?><a href="http://wordpress.acurax.com/?utm_source=csma&utm_campaign=sidebar_text_2" target="_blank"><?php _e("Click Here","coming-soon-maintenance-mode-from-acurax");?></a></div>
75
- </div> <!-- acx_csma_sidebar_widget -->
76
  <?php } ?>
77
  <div class="acx_csma_sidebar_widget">
78
- <div class="acx_csma_sidebar_w_title"><?php _e("Rate us on wordpress.org","coming-soon-maintenance-mode-from-acurax");?></div>
79
- <div class="acx_csma_sidebar_w_content" style="text-align:center;font-size:13px;"><b><?php _e("Thank you for being with us... If you like our plugin then please show us some love ","coming-soon-maintenance-mode-from-acurax");?></b></br>
80
- <a href="https://wordpress.org/support/view/plugin-reviews/coming-soon-maintenance-mode-from-acurax" target="_blank" style="text-decoration:none;">
81
  <span id="acx_csma_stars">
82
  <span class="dashicons dashicons-star-filled"></span>
83
  <span class="dashicons dashicons-star-filled"></span>
@@ -85,77 +71,58 @@ acx_csma_t_rotate();
85
  <span class="dashicons dashicons-star-filled"></span>
86
  <span class="dashicons dashicons-star-filled"></span>
87
  </span>
88
- <span class="acx_csma_star_button button button-primary"><?php _e("Click Here","coming-soon-maintenance-mode-from-acurax");?></span>
89
  </a>
90
- <p><?php _e("If you are facing any issues, kindly post them at plugins support forum ","coming-soon-maintenance-mode-from-acurax");?><a href="http://wordpress.org/support/plugin/coming-soon-maintenance-mode-from-acurax" target="_blank"><?php _e("here","coming-soon-maintenance-mode-from-acurax");?></a>
91
  </div>
92
  </div> <!-- acx_csma_sidebar_widget -->
93
-
94
-
95
-
96
- </div> <!-- acx_ad_banners_csma -->
97
-
98
- <?php
99
  }
100
- add_action('acx_csma_hook_sidebar_widget','acx_csma_service_banners',100);
101
- add_action('acx_csma_misc_hook_option_sidebar','acx_csma_service_banners',100);
102
  /********************************************************** MISC PAGE ************************************************************/
103
-
104
- /********************************************** MISC Page*********************************************/
105
  function acx_csma_misc_nonce_check()
106
  {
107
  if (!isset($_POST['acx_csma_misc_nonce'])) die("<br><br>".__('Unknown Error Occurred, Try Again... ','coming-soon-maintenance-mode-from-acurax')."<a href=''>Click Here</a>");
108
  if (!wp_verify_nonce($_POST['acx_csma_misc_nonce'],'acx_csma_misc_nonce')) die("<br><br>".__('Unknown Error Occurred, Try Again... ','coming-soon-maintenance-mode-from-acurax')."<a href=''>Click Here</a>");
109
  if(!current_user_can('manage_options')) die("<br><br>".__('Sorry, You have no permission to do this action...','coming-soon-maintenance-mode-from-acurax')."</a>");
110
  } add_action('acx_csma_misc_hook_option_onpost','acx_csma_misc_nonce_check',1);
111
-
112
-
113
  function acx_csma_misc_nonce_field()
114
  {
115
  echo "<input name='acx_csma_misc_nonce' type='hidden' value='".wp_create_nonce('acx_csma_misc_nonce')."' />";
116
  echo "<input name='acx_csma_misc_hidden' type='hidden' value='Y' />";
117
  } add_action('acx_csma_misc_hook_option_fields','acx_csma_misc_nonce_field',10);
118
-
119
  function acx_csma_misc_option_form_start()
120
  {
121
- echo "<form name='acurax_csma_misc_form' id='acurax_csma_misc_form' method='post' action='".str_replace( '%7E', '~',$_SERVER['REQUEST_URI'])."'>";
122
  } add_action('acx_csma_misc_hook_option_form_head','acx_csma_misc_option_form_start',100);
123
-
124
-
125
  function acx_csma_misc_option_form_end()
126
  {
127
  echo "</form>";
128
  } add_action('acx_csma_misc_hook_option_form_footer','acx_csma_misc_option_form_end',100);
129
-
130
  function acx_csma_misc_option_div_start()
131
  {
132
  echo "<div id=\"acx_csma_option_page_holder\"> \n";
133
  acx_csma_hook_function('acx_csma_misc_hook_option_above_page_left');
134
  echo "<div class=\"acx_csma_option_page_left\"> \n";
135
  } add_action('acx_csma_misc_hook_option_form_head','acx_csma_misc_option_div_start',30);
136
-
137
  function acx_csma_misc_option_sidebar_start()
138
  {
139
  echo "</div> <!-- acx_csma_option_page_left --> \n";
140
  echo "<div class=\"acx_csma_option_page_right\"> \n";
141
- echo "<div id=\"acx_csma_sidebar\"> \n";
142
  } add_action('acx_csma_misc_hook_option_sidebar','acx_csma_misc_option_sidebar_start',10);
143
-
144
-
145
  function acx_csma_misc_option_sidebar_end()
146
  {
147
- echo "</div> <!-- acx_csma_sidebar --> \n";
148
  echo "</div> <!-- acx_csma_option_page_right --> \n";
149
  acx_csma_hook_function('acx_csma_misc_hook_option_footer');
150
  echo "</div> <!-- acx_csma_option_page_holder --> \n";
151
  } add_action('acx_csma_misc_hook_option_sidebar','acx_csma_misc_option_sidebar_end',500);
152
-
153
  function acx_csma_misc_print_option_page_title()
154
  {
155
  $acx_string = __("Misc Settings","coming-soon-maintenance-mode-from-acurax");
156
  echo print_acx_csma_option_heading($acx_string);
157
  } add_action('acx_csma_misc_hook_option_form_head','acx_csma_misc_print_option_page_title',50);
158
-
159
  function display_acx_csma_misc_saved_success()
160
  { ?>
161
  <div class="updated"><p><strong><?php _e('Misc Settings Saved!.','coming-soon-maintenance-mode-from-acurax' ); ?></strong></p></div>
@@ -166,10 +133,7 @@ function display_acx_csma_misc_saved_success()
166
  }, 4000);
167
 
168
  </script>
169
-
170
  <?php
171
  } add_action('acx_csma_misc_hook_option_onpost','display_acx_csma_misc_saved_success',5000);
172
-
173
-
174
  /********************************************************** MISC PAGE ************************************************************/
175
  ?>
2
  function acx_csma_service_banners()
3
  {
4
  ?>
5
+ <div id="acx_csma_sidebar">
6
+ <?php $acx_csma_service_banners = get_option('acx_csma_service_banners');
 
7
  if ($acx_csma_service_banners != "no") { ?>
8
  <div id="acx_ad_banners_csma">
9
+ <a href="http://www.acurax.com/?utm_source=csma&utm_campaign=sidebar_banner_1" target="_blank" class="acx_ad_csma_1">
10
+ <div class="acx_ad_csma_title"><?php _e('Need Help on Wordpress?','floating-social-media-icon'); ?></div> <!-- acx_ad_csma_title -->
11
+ <div class="acx_ad_csma_desc"><?php _e('Instant Solutions for your wordpress Issues','floating-social-media-icon'); ?></div> <!-- acx_ad_csma_desc -->
 
 
 
 
 
 
12
  </a> <!-- acx_ad_csma_1 -->
13
 
14
+ <a href="http://www.acurax.com/branding/?utm_source=csma&utm_campaign=sidebar_banner_2" target="_blank" class="acx_ad_csma_1">
15
+ <div class="acx_ad_csma_title"><?php _e('Unique Design For Better Branding','floating-social-media-icon'); ?></div> <!-- acx_ad_csma_title -->
16
+ <div class="acx_ad_csma_desc acx_ad_csma_desc2" style="padding-top: 0px; padding-left: 50px; height: 41px; font-size: 13px; text-align: center;"><?php _e('Get Responsive Custom Designed Website For High Conversion','floating-social-media-icon'); ?></div> <!-- acx_ad_csma_desc -->
17
  </a> <!-- acx_ad_csma_1 -->
18
 
19
+ <a href="http://www.acurax.com/social-profile-design/?utm_source=csma&utm_campaign=sidebar_banner_3" target="_blank" class="acx_ad_csma_1">
20
+ <div class="acx_ad_csma_title"><?php _e('Brand Your Social Media Profiles','floating-social-media-icon'); ?></div> <!-- acx_ad_csma_title -->
21
+ <div class="acx_ad_csma_desc acx_ad_csma_desc3" style="padding-top: 0px; height: 110px; text-align: left; font-size: 12px; line-height: 20px;"><?php _e('Social Profile Design means customizing and designing your online presence across many social networks in a professional way to maximize your customer engagement.<br><br>Order and Get Social Media Elements in 24 Hours','floating-social-media-icon'); ?></div> <!-- acx_ad_csma_desc -->
22
  </a> <!-- acx_ad_csma_1 -->
23
 
24
  </div> <!-- acx_ad_banners_csma -->
25
  <?php } else { ?>
 
 
26
  <div class="acx_csma_sidebar_widget">
27
+ <div class="acx_csma_sidebar_w_title"><?php _e('Affordable Website Services','floating-social-media-icon');?></div> <!-- acx_ad_csma_title -->
28
  <div class="acx_csma_sidebar_w_content">
29
+ <?php _e('We know you are in the process of improving your website, and we the team at Acurax is always available for hire. ','floating-social-media-icon'); ?><a href="http://www.acurax.com/webdesigning/?utm_source=csma&utm_campaign=sidebar_text_1" target="_blank"><?php _e('Get in touch','floating-social-media-icon') ;?></a>
30
  </div>
31
  </div> <!-- acx_csma_sidebar_widget -->
 
 
32
  <div class="acx_csma_sidebar_widget">
33
+ <div class="acx_csma_sidebar_w_title"><?php _e('Brand Your Social Media Profiles','floating-social-media-icon');?></div>
34
+ <div class="acx_csma_sidebar_w_content"><?php _e('Social Profile Design means customizing and designing your online presence across many social networks in a professional way to maximize your customer engagement.','floating-social-media-icon');?> <br><br><a href="http://www.acurax.com/social-profile-design/?utm_source=csma&utm_campaign=sidebar_text_2" target="_blank"><?php _e('Order and Get Social Media Elements in 24 Hours','floating-social-media-icon'); ?></a></div>
 
 
35
  </div> <!-- acx_csma_sidebar_widget -->
 
 
36
  <div class="acx_csma_sidebar_widget">
37
+ <div class="acx_csma_sidebar_w_title"><?php _e('Partner With Us','floating-social-media-icon'); ?></div> <!-- acx_ad_csma_title -->
38
  <div class="acx_csma_sidebar_w_content acx_csma_sidebar_w_content_p_slide">
39
  </div>
40
  </div> <!-- acx_csma_sidebar_widget -->
41
  <script type="text/javascript">
42
+ var acx_csma = new Array("<?php _e('<b>Are you an Agency?</b>, You can Outsource your projects to the team at Acurax...<br><br><a href=\'http://www.acurax.com/partner-with-us/?utm_source=csma&utm_campaign=sidebar_text_partner\' target=\'_blank\'>Know More...</a>','floating-social-media-icon'); ?>","<?php _e('<ul><li>- Expert team with timely delivery</li><li>- Reducing the project cost</li><li>- Single Point of contact</li><li>- 100% White-label + Non disclosed agreement</li></ul><a href=\'http://www.acurax.com/partner-with-us/?utm_source=csma&utm_campaign=sidebar_text_partner\' target=\'_blank\'>Know More...</a>','floating-social-media-icon'); ?>","<?php _e('<ul><li>- Ability to handle multiple projects at a time</li><li>- Well documented project management on project management system</li><li>- No Communication Barriers. Email/support ticket/IM via Skype, Yahoo, Hangouts and Phone etc...</li></ul><a href=\'http://www.acurax.com/partner-with-us/?utm_source=csma&utm_campaign=sidebar_text_partner\' target=\'_blank\'>Know More...</a>','floating-social-media-icon'); ?>");
43
+ var current_loaded = 0;
 
44
  function acx_csma_t_rotate()
45
  {
46
+ acx_csma_count = (acx_csma.length-1);
47
+ acx_csma_text = acx_csma[current_loaded];
48
+ jQuery(".acx_csma_sidebar_w_content_p_slide").fadeOut('fast');
49
+ jQuery(".acx_csma_sidebar_w_content_p_slide").html(acx_csma_text);
50
+ jQuery(".acx_csma_sidebar_w_content_p_slide").fadeIn('slow');
51
+ current_loaded = current_loaded+1;
52
+ if(current_loaded > acx_csma_count)
53
+ {
54
+ current_loaded = 0;
55
+ }
56
  }
57
  jQuery(document).ready(function() {
58
+ acx_csma_t_rotate();
59
+ setInterval(function(){ acx_csma_t_rotate(); }, 4000);
60
  });
61
  </script>
 
 
 
 
62
  <?php } ?>
63
  <div class="acx_csma_sidebar_widget">
64
+ <div class="acx_csma_sidebar_w_title"><?php _e('Rate us on wordpress.org','floating-social-media-icon'); ?></div>
65
+ <div class="acx_csma_sidebar_w_content" style="text-align:center;font-size:13px;"><b><?php _e('Thank you for being with us... If you like our plugin then please show us some love','floating-social-media-icon');?> </b></br>
66
+ <a href="https://wordpress.org/support/view/plugin-reviews/<?php echo ACX_FSMI_WP_SLUG; ?>/" target="_blank" style="text-decoration:none;">
67
  <span id="acx_csma_stars">
68
  <span class="dashicons dashicons-star-filled"></span>
69
  <span class="dashicons dashicons-star-filled"></span>
71
  <span class="dashicons dashicons-star-filled"></span>
72
  <span class="dashicons dashicons-star-filled"></span>
73
  </span>
74
+ <span class="acx_csma_star_button button button-primary"><?php _e('Click Here','floating-social-media-icon'); ?></span>
75
  </a>
76
+ <p><?php _e('If you are facing any issues, kindly post them at plugins support forum','floating-social-media-icon');?> <a href="http://wordpress.org/support/plugin/<?php echo ACX_FSMI_WP_SLUG; ?>/" target="_blank"><?php _e('here','floating-social-media-icon'); ?></a>
77
  </div>
78
  </div> <!-- acx_csma_sidebar_widget -->
79
+ </div> <!-- acx_csma_sidebar -->
80
+ <?php
 
 
 
 
81
  }
82
+ add_action('acx_csma_hook_sidebar_widget','acx_csma_service_banners',100);
83
+ add_action('acx_csma_misc_hook_option_sidebar','acx_csma_service_banners',100);
84
  /********************************************************** MISC PAGE ************************************************************/
 
 
85
  function acx_csma_misc_nonce_check()
86
  {
87
  if (!isset($_POST['acx_csma_misc_nonce'])) die("<br><br>".__('Unknown Error Occurred, Try Again... ','coming-soon-maintenance-mode-from-acurax')."<a href=''>Click Here</a>");
88
  if (!wp_verify_nonce($_POST['acx_csma_misc_nonce'],'acx_csma_misc_nonce')) die("<br><br>".__('Unknown Error Occurred, Try Again... ','coming-soon-maintenance-mode-from-acurax')."<a href=''>Click Here</a>");
89
  if(!current_user_can('manage_options')) die("<br><br>".__('Sorry, You have no permission to do this action...','coming-soon-maintenance-mode-from-acurax')."</a>");
90
  } add_action('acx_csma_misc_hook_option_onpost','acx_csma_misc_nonce_check',1);
 
 
91
  function acx_csma_misc_nonce_field()
92
  {
93
  echo "<input name='acx_csma_misc_nonce' type='hidden' value='".wp_create_nonce('acx_csma_misc_nonce')."' />";
94
  echo "<input name='acx_csma_misc_hidden' type='hidden' value='Y' />";
95
  } add_action('acx_csma_misc_hook_option_fields','acx_csma_misc_nonce_field',10);
 
96
  function acx_csma_misc_option_form_start()
97
  {
98
+ echo "<form name='acurax_csma_misc_form' id='acurax_csma_misc_form' method='post' action='".esc_url(str_replace( '%7E', '~',$_SERVER['REQUEST_URI']))."'>";
99
  } add_action('acx_csma_misc_hook_option_form_head','acx_csma_misc_option_form_start',100);
 
 
100
  function acx_csma_misc_option_form_end()
101
  {
102
  echo "</form>";
103
  } add_action('acx_csma_misc_hook_option_form_footer','acx_csma_misc_option_form_end',100);
 
104
  function acx_csma_misc_option_div_start()
105
  {
106
  echo "<div id=\"acx_csma_option_page_holder\"> \n";
107
  acx_csma_hook_function('acx_csma_misc_hook_option_above_page_left');
108
  echo "<div class=\"acx_csma_option_page_left\"> \n";
109
  } add_action('acx_csma_misc_hook_option_form_head','acx_csma_misc_option_div_start',30);
 
110
  function acx_csma_misc_option_sidebar_start()
111
  {
112
  echo "</div> <!-- acx_csma_option_page_left --> \n";
113
  echo "<div class=\"acx_csma_option_page_right\"> \n";
 
114
  } add_action('acx_csma_misc_hook_option_sidebar','acx_csma_misc_option_sidebar_start',10);
 
 
115
  function acx_csma_misc_option_sidebar_end()
116
  {
 
117
  echo "</div> <!-- acx_csma_option_page_right --> \n";
118
  acx_csma_hook_function('acx_csma_misc_hook_option_footer');
119
  echo "</div> <!-- acx_csma_option_page_holder --> \n";
120
  } add_action('acx_csma_misc_hook_option_sidebar','acx_csma_misc_option_sidebar_end',500);
 
121
  function acx_csma_misc_print_option_page_title()
122
  {
123
  $acx_string = __("Misc Settings","coming-soon-maintenance-mode-from-acurax");
124
  echo print_acx_csma_option_heading($acx_string);
125
  } add_action('acx_csma_misc_hook_option_form_head','acx_csma_misc_print_option_page_title',50);
 
126
  function display_acx_csma_misc_saved_success()
127
  { ?>
128
  <div class="updated"><p><strong><?php _e('Misc Settings Saved!.','coming-soon-maintenance-mode-from-acurax' ); ?></strong></p></div>
133
  }, 4000);
134
 
135
  </script>
 
136
  <?php
137
  } add_action('acx_csma_misc_hook_option_onpost','display_acx_csma_misc_saved_success',5000);
 
 
138
  /********************************************************** MISC PAGE ************************************************************/
139
  ?>
js/color.js CHANGED
@@ -94,6 +94,11 @@ jQuery(document).ready(function($)
94
  jQuery('#acx_csma_logo_text_color2').click(function(){jQuery('#acx_csma_logo_text_color2_div').slideDown()});
95
  jQuery('#acx_csma_logo_text_color2').blur(function(){jQuery('#acx_csma_logo_text_color2_div').slideUp()});
96
 
 
 
 
 
 
97
  jQuery('#acx_csma_bg_color2_div').hide();
98
  jQuery('#acx_csma_bg_color2_div').farbtastic('#acx_csma_bg_color2');
99
  jQuery('#acx_csma_bg_color2').click(function(){jQuery('#acx_csma_bg_color2_div').slideDown()});
@@ -114,6 +119,11 @@ jQuery(document).ready(function($)
114
  jQuery('#acx_csma_inside_bg_color2').click(function(){jQuery('#acx_csma_inside_bg_color2_div').slideDown()});
115
  jQuery('#acx_csma_inside_bg_color2').blur(function(){jQuery('#acx_csma_inside_bg_color2_div').slideUp()});
116
 
 
 
 
 
 
117
  jQuery('#acx_csma_timer_title_color2_div').hide();
118
  jQuery('#acx_csma_timer_title_color2_div').farbtastic('#acx_csma_timer_title_color2');
119
  jQuery('#acx_csma_timer_title_color2').click(function(){jQuery('#acx_csma_timer_title_color2_div').slideDown()});
@@ -124,6 +134,11 @@ jQuery(document).ready(function($)
124
  jQuery('#acx_csma_subscribe_btn_color2').click(function(){jQuery('#acx_csma_subscribe_btn_color2_div').slideDown()});
125
  jQuery('#acx_csma_subscribe_btn_color2').blur(function(){jQuery('#acx_csma_subscribe_btn_color2_div').slideUp()});
126
 
 
 
 
 
 
127
  jQuery('#acx_csma_timer_input_bg_color2_div').hide();
128
  jQuery('#acx_csma_timer_input_bg_color2_div').farbtastic('#acx_csma_timer_input_bg_color2');
129
  jQuery('#acx_csma_timer_input_bg_color2').click(function(){jQuery('#acx_csma_timer_input_bg_color2_div').slideDown()});
@@ -149,6 +164,11 @@ jQuery(document).ready(function($)
149
  jQuery('#acx_csma_desc_content_color2').click(function(){jQuery('#acx_csma_desc_content_color2_div').slideDown()});
150
  jQuery('#acx_csma_desc_content_color2').blur(function(){jQuery('#acx_csma_desc_content_color2_div').slideUp()});
151
 
 
 
 
 
 
152
  jQuery('#acx_csma_social_link_color2_div').hide();
153
  jQuery('#acx_csma_social_link_color2_div').farbtastic('#acx_csma_social_link_color2');
154
  jQuery('#acx_csma_social_link_color2').click(function(){jQuery('#acx_csma_social_link_color2_div').slideDown()});
94
  jQuery('#acx_csma_logo_text_color2').click(function(){jQuery('#acx_csma_logo_text_color2_div').slideDown()});
95
  jQuery('#acx_csma_logo_text_color2').blur(function(){jQuery('#acx_csma_logo_text_color2_div').slideUp()});
96
 
97
+ jQuery('#acx_csma_logo_bg_color2_div').hide();
98
+ jQuery('#acx_csma_logo_bg_color2_div').farbtastic('#acx_csma_logo_bg_color2');
99
+ jQuery('#acx_csma_logo_bg_color2').click(function(){jQuery('#acx_csma_logo_bg_color2_div').slideDown()});
100
+ jQuery('#acx_csma_logo_bg_color2').blur(function(){jQuery('#acx_csma_logo_bg_color2_div').slideUp()});
101
+
102
  jQuery('#acx_csma_bg_color2_div').hide();
103
  jQuery('#acx_csma_bg_color2_div').farbtastic('#acx_csma_bg_color2');
104
  jQuery('#acx_csma_bg_color2').click(function(){jQuery('#acx_csma_bg_color2_div').slideDown()});
119
  jQuery('#acx_csma_inside_bg_color2').click(function(){jQuery('#acx_csma_inside_bg_color2_div').slideDown()});
120
  jQuery('#acx_csma_inside_bg_color2').blur(function(){jQuery('#acx_csma_inside_bg_color2_div').slideUp()});
121
 
122
+ jQuery('#acx_csma_divider_bg_color2_div').hide();
123
+ jQuery('#acx_csma_divider_bg_color2_div').farbtastic('#acx_csma_divider_bg_color2');
124
+ jQuery('#acx_csma_divider_bg_color2').click(function(){jQuery('#acx_csma_divider_bg_color2_div').slideDown()});
125
+ jQuery('#acx_csma_divider_bg_color2').blur(function(){jQuery('#acx_csma_divider_bg_color2_div').slideUp()});
126
+
127
  jQuery('#acx_csma_timer_title_color2_div').hide();
128
  jQuery('#acx_csma_timer_title_color2_div').farbtastic('#acx_csma_timer_title_color2');
129
  jQuery('#acx_csma_timer_title_color2').click(function(){jQuery('#acx_csma_timer_title_color2_div').slideDown()});
134
  jQuery('#acx_csma_subscribe_btn_color2').click(function(){jQuery('#acx_csma_subscribe_btn_color2_div').slideDown()});
135
  jQuery('#acx_csma_subscribe_btn_color2').blur(function(){jQuery('#acx_csma_subscribe_btn_color2_div').slideUp()});
136
 
137
+ jQuery('#acx_csma_subscribe_btn_bg_color2_div').hide();
138
+ jQuery('#acx_csma_subscribe_btn_bg_color2_div').farbtastic('#acx_csma_subscribe_btn_bg_color2');
139
+ jQuery('#acx_csma_subscribe_btn_bg_color2').click(function(){jQuery('#acx_csma_subscribe_btn_bg_color2_div').slideDown()});
140
+ jQuery('#acx_csma_subscribe_btn_bg_color2').blur(function(){jQuery('#acx_csma_subscribe_btn_bg_color2_div').slideUp()});
141
+
142
  jQuery('#acx_csma_timer_input_bg_color2_div').hide();
143
  jQuery('#acx_csma_timer_input_bg_color2_div').farbtastic('#acx_csma_timer_input_bg_color2');
144
  jQuery('#acx_csma_timer_input_bg_color2').click(function(){jQuery('#acx_csma_timer_input_bg_color2_div').slideDown()});
164
  jQuery('#acx_csma_desc_content_color2').click(function(){jQuery('#acx_csma_desc_content_color2_div').slideDown()});
165
  jQuery('#acx_csma_desc_content_color2').blur(function(){jQuery('#acx_csma_desc_content_color2_div').slideUp()});
166
 
167
+ jQuery('#acx_csma_social_bg_color2_div').hide();
168
+ jQuery('#acx_csma_social_bg_color2_div').farbtastic('#acx_csma_social_bg_color2');
169
+ jQuery('#acx_csma_social_bg_color2').click(function(){jQuery('#acx_csma_social_bg_color2_div').slideDown()});
170
+ jQuery('#acx_csma_social_bg_color2').blur(function(){jQuery('#acx_csma_social_bg_color2_div').slideUp()});
171
+
172
  jQuery('#acx_csma_social_link_color2_div').hide();
173
  jQuery('#acx_csma_social_link_color2_div').farbtastic('#acx_csma_social_link_color2');
174
  jQuery('#acx_csma_social_link_color2').click(function(){jQuery('#acx_csma_social_link_color2_div').slideDown()});
readme.txt CHANGED
@@ -1,10 +1,10 @@
1
  === Under Construction / Maintenance Mode from Acurax ===
2
  Contributors: Acurax
3
- Donate link: http://www.acurax.com/happy-clients.php
4
 
5
  Tags: under construction,coming soon,under maintenance,maintenance mode,site offline,work in progress,website launch,launching page
6
  Requires at least: 2.8
7
- Tested up to: 4.7
8
  Stable tag: trunk
9
  License: GPLv2 or later
10
 
@@ -187,6 +187,13 @@ Yes, From Version 2.5.1, you have the option in Misc page to enable/disable send
187
 
188
  == Upgrade Notice ==
189
 
 
 
 
 
 
 
 
190
  = 2.5.1 =
191
  Added option to enable/disable sending 503 header, Added more flexibility in customizing templates,Subscription form added to template 4, Several bugs fixed, Improved code, Translation supported. Check https://wordpress.org/plugins/coming-soon-maintenance-mode-from-acurax/changelog/ for more info.
192
 
@@ -257,6 +264,13 @@ Stable Release
257
 
258
  == Changelog ==
259
 
 
 
 
 
 
 
 
260
  = 2.5.1 =
261
  *Release Date - 1 August 2016*
262
 
1
  === Under Construction / Maintenance Mode from Acurax ===
2
  Contributors: Acurax
3
+ Donate link: http://www.acurax.com/
4
 
5
  Tags: under construction,coming soon,under maintenance,maintenance mode,site offline,work in progress,website launch,launching page
6
  Requires at least: 2.8
7
+ Tested up to: 4.7.3
8
  Stable tag: trunk
9
  License: GPLv2 or later
10
 
187
 
188
  == Upgrade Notice ==
189
 
190
+ = 2.5.2 =
191
+ Fix - Perfomance Improvements
192
+ Fix - Code Improvements
193
+ Fix - Several Bug Fixes
194
+ Feature - Better Option to Manage Addons
195
+ Feature - One Click Addon Installer Support
196
+
197
  = 2.5.1 =
198
  Added option to enable/disable sending 503 header, Added more flexibility in customizing templates,Subscription form added to template 4, Several bugs fixed, Improved code, Translation supported. Check https://wordpress.org/plugins/coming-soon-maintenance-mode-from-acurax/changelog/ for more info.
199
 
264
 
265
  == Changelog ==
266
 
267
+ = 2.5.2 =
268
+ * Fix - Perfomance Improvements
269
+ * Fix - Code Improvements
270
+ * Fix - Several Bug Fixes
271
+ * New Feature - Better Option to Manage Addons
272
+ * New Feature - One Click Addon Installer Support
273
+
274
  = 2.5.1 =
275
  *Release Date - 1 August 2016*
276
 
templates/1/index.php CHANGED
@@ -22,7 +22,6 @@ $acx_csma_timestamp=current_time('timestamp');
22
  <head>
23
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
24
  <meta name="viewport" content="width=device-width, initial-scale=1">
25
-
26
  <?php
27
  if($acx_csma_meta_title!="")
28
  {
@@ -44,7 +43,6 @@ if($acx_csma_meta_keywords!="")
44
  }
45
  ?>
46
  <style>
47
-
48
  <?php echo $acx_csma_appearence_array_1[$acx_csma_template_id]['acx_csma_custom_css_temp1']; ?>
49
  .submit:hover
50
  {
@@ -75,8 +73,6 @@ if(is_numeric($acx_csma_background_image1_id))
75
  $image1_attachment_url = parse_url( wp_get_attachment_url($acx_csma_background_image1_id) );
76
  $bg_image1_url = $image1_attachment_url [ 'scheme' ] . '://' .rawurlencode( basename( $image1_attachment_url[ 'host' ])). $image1_attachment_url[ 'path' ];
77
  }
78
-
79
-
80
  ?>
81
  <body style="background: url('<?php echo $bg_image1_url; ?>') no-repeat fixed center center transparent; background-size:cover; ">
82
 
@@ -122,9 +118,9 @@ else
122
  </div><!-- header -->
123
  <?php
124
  $acx_csma_title1 = $acx_csma_appearence_array_1[$acx_csma_template_id]['acx_csma_title1'];
125
- $acx_csma_title1 = acx_csma_text_after_save_hook_fn($acx_csma_title1);
126
- $acx_csma_subtitle_text1 = $acx_csma_appearence_array_1[$acx_csma_template_id]['acx_csma_subtitle_text1'];
127
- $acx_csma_subtitle_text1 = acx_csma_text_after_save_hook_fn($acx_csma_subtitle_text1);
128
  ?>
129
  <div class="inline_block">
130
  <h2 style="color:<?php echo $acx_csma_appearence_array_1[$acx_csma_template_id]['acx_csma_title_color1']; ?>"><?php echo $acx_csma_title1; ?></h2>
@@ -297,9 +293,7 @@ else
297
  }
298
  }
299
  ?>
300
-
301
  </div>
302
-
303
  <!-- form -->
304
  <?php $acx_csma_footer_text1 = $acx_csma_appearence_array_1[$acx_csma_template_id]['acx_csma_footer_text1'];
305
  $acx_csma_footer_text1 = acx_csma_text_after_save_hook_fn($acx_csma_footer_text1);
@@ -308,7 +302,6 @@ else
308
  </div><!-- inline_block -->
309
  </div><!-- canvas960 -->
310
  </div><!-- wrapper -->
311
-
312
  <script type="text/javascript">
313
  jQuery(document).ready(function() {
314
  jQuery(window).keydown(function(event){
@@ -392,8 +385,6 @@ function acx_csma_validate_email()
392
  jQuery("#acx_csma_success").hide();
393
  jQuery("#acx_csma_email").show();
394
  jQuery("#acx_csma_submit").show();
395
- // acx_csma_form_status=1;
396
-
397
  }, 3000);
398
  }
399
  else{
@@ -408,8 +399,6 @@ function acx_csma_validate_email()
408
  jQuery("#acx_csma_error").hide();
409
  jQuery("#acx_csma_email").show();
410
  jQuery("#acx_csma_submit").show();
411
- //acx_csma_form_status=1;
412
-
413
  }, 3000);
414
 
415
  }
@@ -430,94 +419,91 @@ function acx_csma_validate_email()
430
  return false;
431
  }
432
  else{
433
- document.getElementById('acx_csma_name_hidden').type = 'hidden';
434
- document.getElementById('acx_csma_email').type = 'email';
435
- jQuery("#acx_csma_email").show();
436
- document.getElementById('acx_csma_submit').value="<?php echo $acx_csma_subscribe_btn_text1; ?>";
437
- acx_csma_form_status=2;
438
- return false;
439
  }
440
  }
441
  else if(acx_csma_form_status==2)
442
  {
443
  var acx_csma_email = document.getElementById('acx_csma_email').value;
444
- var expr = /^([\w-\.]+)@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.)|(([\w-]+\.)+))([a-zA-Z]{2,4}|[0-9]{1,3})(\]?)$/;
445
- if (acx_csma_email=='')
446
- {
447
- alert('<?php echo $acx_email_val_singular; ?>');
448
- return false;
449
- }
450
- else if (!expr.test(acx_csma_email))
451
- {
452
- document.getElementById('acx_csma_email').value="";
453
- document.getElementById('acx_csma_name_hidden').value="";
454
- jQuery("#acx_csma_email").hide();
455
- jQuery("#acx_csma_submit").hide();
456
- jQuery("#acx_csma_invalid").show();
457
- setTimeout(function()
458
- {
459
- jQuery("#acx_csma_invalid").hide();
460
- document.getElementById('acx_csma_name_hidden').type = 'text';
461
- document.getElementById('acx_csma_submit').value="<?php echo $acx_next_singular; ?>";
462
- jQuery("#acx_csma_submit").show();
463
- acx_csma_form_status=1;
464
-
465
- }, 3000);
466
-
467
-
468
- return false;
469
- }
470
- else
471
- {
472
- var acx_load="<div id='acx_csma_loading'><div class='load_1'></div></div>";
473
- jQuery('body').append(acx_load);
474
-
475
- var timestamp = Math.floor(<?php echo current_time('timestamp'); ?>);
476
- var ip="<?php echo $_SERVER['REMOTE_ADDR']; ?>";
477
- var acx_csma_ajaxurl ="<?php echo admin_url('admin-ajax.php'); ?>";
478
- var order = 'name='+acx_csma_name_hidden+'&email='+acx_csma_email+'&ip='+ip+'&timestamp='+timestamp+'&action=acx_csma_subscribe_email'+'&acx_csma_subscribe_es=<?php echo wp_create_nonce('acx_csma_subscribe_es'); ?>';
479
- jQuery.post(acx_csma_ajaxurl, order, function(theResponse)
480
  {
481
- jQuery("#acx_csma_loading").remove();
482
- if(theResponse == "success")
483
- {
484
- document.getElementById('acx_csma_email').value="";
485
- document.getElementById('acx_csma_name_hidden').value="";
486
- jQuery("#acx_csma_email").hide();
487
- jQuery("#acx_csma_submit").hide();
488
-
489
- jQuery("#acx_csma_success").show();
490
- setTimeout(function()
491
- {
492
- jQuery("#acx_csma_success").hide();
493
- document.getElementById('acx_csma_name_hidden').type = 'text';
494
- document.getElementById('acx_csma_submit').value="<?php echo $acx_next_singular; ?>";
495
- jQuery("#acx_csma_submit").show();
496
- acx_csma_form_status=1;
497
-
498
- }, 3000);
499
- }
500
- else{
501
  document.getElementById('acx_csma_email').value="";
502
  document.getElementById('acx_csma_name_hidden').value="";
503
  jQuery("#acx_csma_email").hide();
504
  jQuery("#acx_csma_submit").hide();
505
- jQuery("#acx_csma_error").show();
506
- jQuery("#acx_csma_error").html("<?php echo $acx_email_singular; ?>");
507
  setTimeout(function()
508
- {
509
- jQuery("#acx_csma_error").html('');
510
- jQuery("#acx_csma_error").hide();
511
- document.getElementById('acx_csma_name_hidden').type = 'text';
512
- document.getElementById('acx_csma_submit').value="<?php echo $acx_next_singular; ?>";
513
- jQuery("#acx_csma_submit").show();
514
- acx_csma_form_status=1;
515
-
516
- }, 3000);
517
 
518
- }
519
- });
520
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
521
  }
522
  <?php
523
  }?>
@@ -536,144 +522,138 @@ var end_date =<?php echo $acx_csma_date_time; ?>;
536
  var current = Math.floor(<?php echo current_time('timestamp'); ?>);
537
  updateCounter();
538
  function updateCounter()
 
 
539
  {
540
- if(current < end_date)
541
- {
542
- current = current+1;
543
- seconds = (end_date - current);
544
-
545
- days = Math.floor(seconds / (60 * 60 * 24));
546
- seconds -= days * 60 * 60 * 24;
547
-
548
- hours = Math.floor(seconds / (60 * 60));
549
- seconds -= hours * 60 * 60;
550
-
551
- minutes = Math.floor(seconds / 60);
552
- seconds -= minutes * 60;
553
-
554
 
555
- for(var i=0;i< seconds.toString().length;i++)
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
556
  {
557
-
558
- if(seconds < 2)
559
- {
560
- jQuery('#acx_sec_disp').html('<?php echo $acx_sec_singular; ?>');
561
- }
562
- else
563
- {
564
- jQuery('#acx_sec_disp').html('<?php echo $acx_sec_plural; ?>');
565
- }
566
- if(seconds < 10 && seconds.toString().length == 1 )
567
- {
568
- seconds = "0"+seconds;
569
- }
570
- if(seconds > 60)
571
- {
572
  seconds = 60;
573
- }
574
- var res_sec = seconds.toString().charAt(i);
575
- if(seconds.toString().length == 1)
576
- {
577
- var a=i+1;
578
- document.getElementById("seconds_"+a).innerHTML = res_sec;
579
- }
580
- else if(seconds.toString().length == 2)
581
- {
582
- document.getElementById("seconds_"+i).innerHTML = res_sec;
583
- }
584
  }
585
- for(var j=0;j< minutes.toString().length;j++)
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
586
  {
587
-
588
- if(minutes < 2)
589
- {
590
- jQuery('#acx_min_disp').html('<?php echo $acx_minute_singular; ?>');
591
- }
592
- else
593
- {
594
- jQuery('#acx_min_disp').html('<?php echo $acx_minute_plural; ?>');
595
- }
596
- if(minutes < 10 && minutes.toString().length == 1 )
597
- {
598
- minutes = "0"+minutes;
599
- }
600
- if(minutes > 60)
601
- {
602
  minutes = 60;
603
- }
604
- var res_min = minutes.toString().charAt(j);
605
- if(minutes.toString().length == 1)
606
- {
607
- var b=j+1;
608
- document.getElementById("minutes_"+b).innerHTML = res_min;
609
- }
610
- else if(minutes.toString().length == 2)
611
- {
612
- document.getElementById("minutes_"+j).innerHTML = res_min;
613
- }
614
  }
615
-
616
- for(var k=0;k< hours.toString().length;k++)
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
617
  {
618
- if(hours < 2)
619
- {
620
- jQuery('#acx_hour_disp').html('<?php echo $acx_hour_singular; ?>');
621
- }
622
- else
623
- {
624
- jQuery('#acx_hour_disp').html('<?php echo $acx_hour_plural; ?>');
625
- }
626
- if(hours < 10 && hours.toString().length == 1 )
627
- {
628
- hours = "0"+hours;
629
- }
630
- if(hours > 60)
631
- {
632
  hours = 60;
633
- }
634
- var res_hour = hours.toString().charAt(k);
635
- if(hours.toString().length == 1)
636
- {
637
  var c=k+1;
638
  document.getElementById("hours_"+c).innerHTML = res_hour;
639
- }
640
- else if(hours.toString().length == 2)
641
- {
642
  document.getElementById("hours_"+k).innerHTML = res_hour;
643
- }
644
  }
645
-
646
- for(var m = 0; m < days.toString().length; m++)
 
 
647
  {
648
- if(days < 2)
649
- {
650
- jQuery('#acx_day_disp').html('<?php echo $acx_day_singular; ?>');
651
- }
652
- else
653
- {
654
- jQuery('#acx_day_disp').html('<?php echo $acx_day_plural; ?>');
655
- }
656
- var res_day = days.toString().charAt(m);
657
- if(days.toString().length == 1)
658
- {
659
- var n=m+2;
660
- document.getElementById("days_"+n).innerHTML = res_day;
661
- }
662
- else if(days.toString().length == 2)
663
- {
664
- var n=m+1;
665
- document.getElementById("days_"+n).innerHTML = res_day;
666
- }
667
- else if(days.toString().length == 3)
668
- {
669
- document.getElementById("days_"+m).innerHTML = res_day;
670
- }
671
  }
672
- setTimeout( function(){
673
- updateCounter();
674
- }, 1000 );
675
- }
676
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
677
  <?php
678
  }
679
  }
@@ -681,4 +661,4 @@ function updateCounter()
681
  </script>
682
  <?php do_action('acx_csma_bottom_inside_body_tag',$acx_csma_template_id); ?>
683
  </body>
684
- </html>
22
  <head>
23
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
24
  <meta name="viewport" content="width=device-width, initial-scale=1">
 
25
  <?php
26
  if($acx_csma_meta_title!="")
27
  {
43
  }
44
  ?>
45
  <style>
 
46
  <?php echo $acx_csma_appearence_array_1[$acx_csma_template_id]['acx_csma_custom_css_temp1']; ?>
47
  .submit:hover
48
  {
73
  $image1_attachment_url = parse_url( wp_get_attachment_url($acx_csma_background_image1_id) );
74
  $bg_image1_url = $image1_attachment_url [ 'scheme' ] . '://' .rawurlencode( basename( $image1_attachment_url[ 'host' ])). $image1_attachment_url[ 'path' ];
75
  }
 
 
76
  ?>
77
  <body style="background: url('<?php echo $bg_image1_url; ?>') no-repeat fixed center center transparent; background-size:cover; ">
78
 
118
  </div><!-- header -->
119
  <?php
120
  $acx_csma_title1 = $acx_csma_appearence_array_1[$acx_csma_template_id]['acx_csma_title1'];
121
+ $acx_csma_title1 = acx_csma_text_after_save_hook_fn($acx_csma_title1);
122
+ $acx_csma_subtitle_text1 = $acx_csma_appearence_array_1[$acx_csma_template_id]['acx_csma_subtitle_text1'];
123
+ $acx_csma_subtitle_text1 = acx_csma_text_after_save_hook_fn($acx_csma_subtitle_text1);
124
  ?>
125
  <div class="inline_block">
126
  <h2 style="color:<?php echo $acx_csma_appearence_array_1[$acx_csma_template_id]['acx_csma_title_color1']; ?>"><?php echo $acx_csma_title1; ?></h2>
293
  }
294
  }
295
  ?>
 
296
  </div>
 
297
  <!-- form -->
298
  <?php $acx_csma_footer_text1 = $acx_csma_appearence_array_1[$acx_csma_template_id]['acx_csma_footer_text1'];
299
  $acx_csma_footer_text1 = acx_csma_text_after_save_hook_fn($acx_csma_footer_text1);
302
  </div><!-- inline_block -->
303
  </div><!-- canvas960 -->
304
  </div><!-- wrapper -->
 
305
  <script type="text/javascript">
306
  jQuery(document).ready(function() {
307
  jQuery(window).keydown(function(event){
385
  jQuery("#acx_csma_success").hide();
386
  jQuery("#acx_csma_email").show();
387
  jQuery("#acx_csma_submit").show();
 
 
388
  }, 3000);
389
  }
390
  else{
399
  jQuery("#acx_csma_error").hide();
400
  jQuery("#acx_csma_email").show();
401
  jQuery("#acx_csma_submit").show();
 
 
402
  }, 3000);
403
 
404
  }
419
  return false;
420
  }
421
  else{
422
+ document.getElementById('acx_csma_name_hidden').type = 'hidden';
423
+ document.getElementById('acx_csma_email').type = 'email';
424
+ jQuery("#acx_csma_email").show();
425
+ document.getElementById('acx_csma_submit').value="<?php echo $acx_csma_subscribe_btn_text1; ?>";
426
+ acx_csma_form_status=2;
427
+ return false;
428
  }
429
  }
430
  else if(acx_csma_form_status==2)
431
  {
432
  var acx_csma_email = document.getElementById('acx_csma_email').value;
433
+ var expr = /^([\w-\.]+)@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.)|(([\w-]+\.)+))([a-zA-Z]{2,4}|[0-9]{1,3})(\]?)$/;
434
+ if (acx_csma_email=='')
435
+ {
436
+ alert('<?php echo $acx_email_val_singular; ?>');
437
+ return false;
438
+ }
439
+ else if (!expr.test(acx_csma_email))
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
440
  {
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
441
  document.getElementById('acx_csma_email').value="";
442
  document.getElementById('acx_csma_name_hidden').value="";
443
  jQuery("#acx_csma_email").hide();
444
  jQuery("#acx_csma_submit").hide();
445
+ jQuery("#acx_csma_invalid").show();
 
446
  setTimeout(function()
447
+ {
448
+ jQuery("#acx_csma_invalid").hide();
449
+ document.getElementById('acx_csma_name_hidden').type = 'text';
450
+ document.getElementById('acx_csma_submit').value="<?php echo $acx_next_singular; ?>";
451
+ jQuery("#acx_csma_submit").show();
452
+ acx_csma_form_status=1;
 
 
 
453
 
454
+ }, 3000);
455
+ return false;
456
+ }
457
+ else
458
+ {
459
+ var acx_load="<div id='acx_csma_loading'><div class='load_1'></div></div>";
460
+ jQuery('body').append(acx_load);
461
+
462
+ var timestamp = Math.floor(<?php echo current_time('timestamp'); ?>);
463
+ var ip="<?php echo $_SERVER['REMOTE_ADDR']; ?>";
464
+ var acx_csma_ajaxurl ="<?php echo admin_url('admin-ajax.php'); ?>";
465
+ var order = 'name='+acx_csma_name_hidden+'&email='+acx_csma_email+'&ip='+ip+'&timestamp='+timestamp+'&action=acx_csma_subscribe_email'+'&acx_csma_subscribe_es=<?php echo wp_create_nonce('acx_csma_subscribe_es'); ?>';
466
+ jQuery.post(acx_csma_ajaxurl, order, function(theResponse)
467
+ {
468
+ jQuery("#acx_csma_loading").remove();
469
+ if(theResponse == "success")
470
+ {
471
+ document.getElementById('acx_csma_email').value="";
472
+ document.getElementById('acx_csma_name_hidden').value="";
473
+ jQuery("#acx_csma_email").hide();
474
+ jQuery("#acx_csma_submit").hide();
475
+
476
+ jQuery("#acx_csma_success").show();
477
+ setTimeout(function()
478
+ {
479
+ jQuery("#acx_csma_success").hide();
480
+ document.getElementById('acx_csma_name_hidden').type = 'text';
481
+ document.getElementById('acx_csma_submit').value="<?php echo $acx_next_singular; ?>";
482
+ jQuery("#acx_csma_submit").show();
483
+ acx_csma_form_status=1;
484
+
485
+ }, 3000);
486
+ }
487
+ else{
488
+ document.getElementById('acx_csma_email').value="";
489
+ document.getElementById('acx_csma_name_hidden').value="";
490
+ jQuery("#acx_csma_email").hide();
491
+ jQuery("#acx_csma_submit").hide();
492
+ jQuery("#acx_csma_error").show();
493
+ jQuery("#acx_csma_error").html("<?php echo $acx_email_singular; ?>");
494
+ setTimeout(function()
495
+ {
496
+ jQuery("#acx_csma_error").html('');
497
+ jQuery("#acx_csma_error").hide();
498
+ document.getElementById('acx_csma_name_hidden').type = 'text';
499
+ document.getElementById('acx_csma_submit').value="<?php echo $acx_next_singular; ?>";
500
+ jQuery("#acx_csma_submit").show();
501
+ acx_csma_form_status=1;
502
+
503
+ }, 3000);
504
+ }
505
+ });
506
+ }
507
  }
508
  <?php
509
  }?>
522
  var current = Math.floor(<?php echo current_time('timestamp'); ?>);
523
  updateCounter();
524
  function updateCounter()
525
+ {
526
+ if(current < end_date)
527
  {
528
+ current = current+1;
529
+ seconds = (end_date - current);
530
+
531
+ days = Math.floor(seconds / (60 * 60 * 24));
532
+ seconds -= days * 60 * 60 * 24;
 
 
 
 
 
 
 
 
 
533
 
534
+ hours = Math.floor(seconds / (60 * 60));
535
+ seconds -= hours * 60 * 60;
536
+
537
+ minutes = Math.floor(seconds / 60);
538
+ seconds -= minutes * 60;
539
+ for(var i=0;i< seconds.toString().length;i++)
540
+ {
541
+ if(seconds < 2)
542
+ {
543
+ jQuery('#acx_sec_disp').html('<?php echo $acx_sec_singular; ?>');
544
+ }
545
+ else
546
+ {
547
+ jQuery('#acx_sec_disp').html('<?php echo $acx_sec_plural; ?>');
548
+ }
549
+ if(seconds < 10 && seconds.toString().length == 1 )
550
+ {
551
+ seconds = "0"+seconds;
552
+ }
553
+ if(seconds > 60)
554
  {
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
555
  seconds = 60;
 
 
 
 
 
 
 
 
 
 
 
556
  }
557
+ var res_sec = seconds.toString().charAt(i);
558
+ if(seconds.toString().length == 1)
559
+ {
560
+ var a=i+1;
561
+ document.getElementById("seconds_"+a).innerHTML = res_sec;
562
+ }
563
+ else if(seconds.toString().length == 2)
564
+ {
565
+ document.getElementById("seconds_"+i).innerHTML = res_sec;
566
+ }
567
+ }
568
+ for(var j=0;j< minutes.toString().length;j++)
569
+ {
570
+ if(minutes < 2)
571
+ {
572
+ jQuery('#acx_min_disp').html('<?php echo $acx_minute_singular; ?>');
573
+ }
574
+ else
575
+ {
576
+ jQuery('#acx_min_disp').html('<?php echo $acx_minute_plural; ?>');
577
+ }
578
+ if(minutes < 10 && minutes.toString().length == 1 )
579
+ {
580
+ minutes = "0"+minutes;
581
+ }
582
+ if(minutes > 60)
583
  {
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
584
  minutes = 60;
 
 
 
 
 
 
 
 
 
 
 
585
  }
586
+ var res_min = minutes.toString().charAt(j);
587
+ if(minutes.toString().length == 1)
588
+ {
589
+ var b=j+1;
590
+ document.getElementById("minutes_"+b).innerHTML = res_min;
591
+ }
592
+ else if(minutes.toString().length == 2)
593
+ {
594
+ document.getElementById("minutes_"+j).innerHTML = res_min;
595
+ }
596
+ }
597
+ for(var k=0;k< hours.toString().length;k++)
598
+ {
599
+ if(hours < 2)
600
+ {
601
+ jQuery('#acx_hour_disp').html('<?php echo $acx_hour_singular; ?>');
602
+ }
603
+ else
604
+ {
605
+ jQuery('#acx_hour_disp').html('<?php echo $acx_hour_plural; ?>');
606
+ }
607
+ if(hours < 10 && hours.toString().length == 1 )
608
+ {
609
+ hours = "0"+hours;
610
+ }
611
+ if(hours > 60)
612
  {
 
 
 
 
 
 
 
 
 
 
 
 
 
 
613
  hours = 60;
614
+ }
615
+ var res_hour = hours.toString().charAt(k);
616
+ if(hours.toString().length == 1)
617
+ {
618
  var c=k+1;
619
  document.getElementById("hours_"+c).innerHTML = res_hour;
620
+ }
621
+ else if(hours.toString().length == 2)
622
+ {
623
  document.getElementById("hours_"+k).innerHTML = res_hour;
 
624
  }
625
+ }
626
+ for(var m = 0; m < days.toString().length; m++)
627
+ {
628
+ if(days < 2)
629
  {
630
+ jQuery('#acx_day_disp').html('<?php echo $acx_day_singular; ?>');
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
631
  }
632
+ else
633
+ {
634
+ jQuery('#acx_day_disp').html('<?php echo $acx_day_plural; ?>');
635
+ }
636
+ var res_day = days.toString().charAt(m);
637
+ if(days.toString().length == 1)
638
+ {
639
+ var n=m+2;
640
+ document.getElementById("days_"+n).innerHTML = res_day;
641
+ }
642
+ else if(days.toString().length == 2)
643
+ {
644
+ var n=m+1;
645
+ document.getElementById("days_"+n).innerHTML = res_day;
646
+ }
647
+ else if(days.toString().length == 3)
648
+ {
649
+ document.getElementById("days_"+m).innerHTML = res_day;
650
+ }
651
+ }
652
+ setTimeout( function(){
653
+ updateCounter();
654
+ }, 1000 );
655
+ }
656
+ }
657
  <?php
658
  }
659
  }
661
  </script>
662
  <?php do_action('acx_csma_bottom_inside_body_tag',$acx_csma_template_id); ?>
663
  </body>
664
+ </html>
templates/2/index.php CHANGED
@@ -11,7 +11,6 @@ if(is_numeric($favicon_attach_id))
11
  $fav_icon_attachment_url = parse_url( wp_get_attachment_url($favicon_attach_id) );
12
  $acx_csma_favicon = $fav_icon_attachment_url [ 'scheme' ] . '://' .rawurlencode( basename( $fav_icon_attachment_url[ 'host' ])). $fav_icon_attachment_url[ 'path' ];
13
  }
14
-
15
  $acx_csma_appearence_array_2=acx_csma_get_db_array_value();
16
  $acx_csma_start_date_time=get_option('acx_csma_start_date_time');
17
  $acx_csma_date_time=get_option('acx_csma_date_time');
@@ -44,6 +43,22 @@ if($acx_csma_meta_keywords!="")
44
 
45
  <style>
46
  <?php echo $acx_csma_appearence_array_2[$acx_csma_template_id]['acx_csma_custom_css_temp2']; ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
47
  </style>
48
 
49
  <link href="<?php echo plugins_url('style.css', __FILE__); ?>" rel="stylesheet" type="text/css" />
@@ -72,29 +87,46 @@ else
72
  {
73
  $new_class="";
74
  }
 
75
  ?>
76
  <div class="wrapper <?php echo $new_class; ?>">
77
  <div class="canvas960">
78
- <div class="inline_block mg_top"> <div class="header">
79
- <?php if(array_key_exists('acx_csma_logo_choice',$acx_csma_appearence_array_2[$acx_csma_template_id])) {if($acx_csma_appearence_array_2[$acx_csma_template_id]['acx_csma_logo_choice']=="image" || $acx_csma_appearence_array_2[$acx_csma_template_id]['acx_csma_logo_choice']==""){
80
- $acx_csma_logo2_id = $acx_csma_appearence_array_2[$acx_csma_template_id]['acx_csma_logo2'];
81
- $logo2_url = $acx_csma_logo2_id;
82
- if(is_numeric($acx_csma_logo2_id))
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
83
  {
84
- $logo2_attachment_url = parse_url( wp_get_attachment_url($acx_csma_logo2_id) );
85
- $logo2_url = $logo2_attachment_url [ 'scheme' ] . '://' .rawurlencode( basename( $logo2_attachment_url[ 'host' ])). $logo2_attachment_url[ 'path' ];
 
 
 
 
86
  }
87
- ?>
88
- <div id="csma_master_logo">
89
- <img src="<?php echo $logo2_url; ?>" alt="Logo">
90
- </div> <!-- csma_master_logo -->
91
- <?php } else if($acx_csma_appearence_array_2[$acx_csma_template_id]['acx_csma_logo_choice']=="text")
92
- {
93
- $acx_csma_logo_text2 = $acx_csma_appearence_array_2[$acx_csma_template_id]['acx_csma_logo_text2'];
94
- $acx_csma_logo_text2 = acx_csma_text_after_save_hook_fn($acx_csma_logo_text2);
95
- ?>
96
- <div class="logo_text" style="color:<?php echo $acx_csma_appearence_array_2[$acx_csma_template_id]['acx_csma_logo_text_color2']; ?>"><?php echo $acx_csma_logo_text2; ?></div><!-- logo_text-->
97
- <?php }} ?></div><!-- header -->
98
  <div class="inline_block yellow" style="background: none repeat scroll 0 0 <?php echo $acx_csma_appearence_array_2[$acx_csma_template_id]['acx_csma_inside_bg_color2']; ?>;">
99
  <div class="inline_block form">
100
  <?php
@@ -135,10 +167,17 @@ else
135
  <?php }
136
  else if($acx_csma_show_subscription_name2 == 0){ ?>
137
  <input type="text" id="acx_csma_email" name="email" placeholder="<?php echo $acx_s_email_singular; ?>" >
138
- <input type="button" value="<?php echo acx_csma_option_text_after_save_hook_fn($acx_csma_appearence_array_2[$acx_csma_template_id]['acx_csma_subscribe_btn_text2']); ?>" id="acx_csma_submit" onclick="acx_csma_validate_email();" class="submit" style="color:<?php echo $acx_csma_appearence_array_2[$acx_csma_template_id]['acx_csma_subscribe_btn_color2']; ?>">
139
  <?php
140
  }
 
141
  ?>
 
 
 
 
 
 
142
  </form>
143
  <?php
144
  }
@@ -227,6 +266,10 @@ else
227
  </div><!-- timer_holder -->
228
 
229
  <div class="inline_block text_box">
 
 
 
 
230
  <?php
231
  $acx_csma_custom_html_top_temp2 = $acx_csma_appearence_array_2[$acx_csma_template_id]['acx_csma_custom_html_top_temp2'];
232
  if($acx_csma_custom_html_top_temp2 != "") { ?>
@@ -246,7 +289,16 @@ else
246
  <p style="color:<?php echo $acx_csma_desc_content_color2; ?>;"><?php echo $acx_csma_desc_subtitle2; ?></p>
247
  </div><!-- inline_block -->
248
  </div><!-- inline_block -->
249
- <div class="footer">
 
 
 
 
 
 
 
 
 
250
  <?php
251
  $acx_csma_fb_link2=$acx_csma_appearence_array_2[$acx_csma_template_id]['acx_csma_fb_link2'];
252
  $acx_csma_twitter_link2=$acx_csma_appearence_array_2[$acx_csma_template_id]['acx_csma_twitter_link2'];
@@ -347,8 +399,6 @@ function acx_csma_validate_email()
347
  jQuery("#acx_csma_email").show();
348
  jQuery("#acx_csma_submit").show();
349
  }, 3000);
350
-
351
-
352
  return false;
353
  }
354
  else
@@ -374,7 +424,6 @@ function acx_csma_validate_email()
374
  jQuery("#acx_csma_success").hide();
375
  jQuery("#acx_csma_email").show();
376
  jQuery("#acx_csma_submit").show();
377
- // acx_csma_form_status=1;
378
 
379
  }, 3000);
380
  }
@@ -390,7 +439,6 @@ function acx_csma_validate_email()
390
  jQuery("#acx_csma_error").hide();
391
  jQuery("#acx_csma_email").show();
392
  jQuery("#acx_csma_submit").show();
393
- //acx_csma_form_status=1;
394
 
395
  }, 3000);
396
 
@@ -547,7 +595,7 @@ function updateCounter()
547
  }
548
  if(seconds > 60)
549
  {
550
- seconds = 60;
551
  }
552
  var res_sec = seconds.toString().charAt(i);
553
  if(seconds.toString().length == 1)
@@ -576,7 +624,7 @@ function updateCounter()
576
  }
577
  if(minutes > 60)
578
  {
579
- minutes = 60;
580
  }
581
  var res_min = minutes.toString().charAt(j);
582
  if(minutes.toString().length == 1)
@@ -606,17 +654,17 @@ function updateCounter()
606
  }
607
  if(hours > 60)
608
  {
609
- hours = 60;
610
  }
611
  var res_hour = hours.toString().charAt(k);
612
  if(hours.toString().length == 1)
613
  {
614
- c=k+1;
615
- document.getElementById("hours_"+c).innerHTML = res_hour;
616
  }
617
  else if(hours.toString().length == 2)
618
  {
619
- document.getElementById("hours_"+k).innerHTML = res_hour;
620
  }
621
  }
622
  document.getElementById("days").innerHTML = days;
@@ -629,7 +677,7 @@ function updateCounter()
629
  jQuery('#acx_day_disp').html('<?php echo $acx_day_plural; ?>');
630
  }
631
  setTimeout(function(){
632
- updateCounter();
633
  }, 1000 );
634
  }
635
  }
@@ -640,4 +688,4 @@ function updateCounter()
640
  </script>
641
  <?php do_action('acx_csma_bottom_inside_body_tag',$acx_csma_template_id);?>
642
  </body>
643
- </html>
11
  $fav_icon_attachment_url = parse_url( wp_get_attachment_url($favicon_attach_id) );
12
  $acx_csma_favicon = $fav_icon_attachment_url [ 'scheme' ] . '://' .rawurlencode( basename( $fav_icon_attachment_url[ 'host' ])). $fav_icon_attachment_url[ 'path' ];
13
  }
 
14
  $acx_csma_appearence_array_2=acx_csma_get_db_array_value();
15
  $acx_csma_start_date_time=get_option('acx_csma_start_date_time');
16
  $acx_csma_date_time=get_option('acx_csma_date_time');
43
 
44
  <style>
45
  <?php echo $acx_csma_appearence_array_2[$acx_csma_template_id]['acx_csma_custom_css_temp2']; ?>
46
+ .inline_block_divider1,
47
+ .inline_block_divider2
48
+ {
49
+ background-color:<?php echo $acx_csma_appearence_array_2[$acx_csma_template_id]['acx_csma_divider_bg_color2']; ?>;
50
+ }
51
+ @media screen and (max-width: 980px)
52
+ {
53
+ .header
54
+ {
55
+ background: none repeat scroll 0 0 <?php echo $acx_csma_appearence_array_2[$acx_csma_template_id]['acx_csma_logo_bg_color2']; ?>;
56
+ }
57
+ .footer
58
+ {
59
+ background: none repeat scroll 0 0 <?php echo $acx_csma_appearence_array_2[$acx_csma_template_id]['acx_csma_social_bg_color2']; ?>;
60
+ }
61
+ }
62
  </style>
63
 
64
  <link href="<?php echo plugins_url('style.css', __FILE__); ?>" rel="stylesheet" type="text/css" />
87
  {
88
  $new_class="";
89
  }
90
+ $acx_hide_svg = "";
91
  ?>
92
  <div class="wrapper <?php echo $new_class; ?>">
93
  <div class="canvas960">
94
+ <div class="inline_block mg_top">
95
+ <div class="header">
96
+
97
+ <?php if(array_key_exists('acx_csma_logo_choice',$acx_csma_appearence_array_2[$acx_csma_template_id]))
98
+ {
99
+ if($acx_csma_appearence_array_2[$acx_csma_template_id]['acx_csma_logo_choice']=="image" || $acx_csma_appearence_array_2[$acx_csma_template_id]['acx_csma_logo_choice']==""){
100
+ $acx_csma_logo2_id = $acx_csma_appearence_array_2[$acx_csma_template_id]['acx_csma_logo2'];
101
+ $logo2_url = $acx_csma_logo2_id;
102
+ if(is_numeric($acx_csma_logo2_id))
103
+ {
104
+ $logo2_attachment_url = parse_url( wp_get_attachment_url($acx_csma_logo2_id) );
105
+ $logo2_url = $logo2_attachment_url [ 'scheme' ] . '://' .rawurlencode( basename( $logo2_attachment_url[ 'host' ])). $logo2_attachment_url[ 'path' ];
106
+ }
107
+
108
+ ?>
109
+ <div id="csma_master_logo">
110
+ <img src="<?php echo $logo2_url; ?>" alt="Logo">
111
+ </div> <!-- csma_master_logo -->
112
+ <?php }
113
+ else if($acx_csma_appearence_array_2[$acx_csma_template_id]['acx_csma_logo_choice']=="text")
114
  {
115
+ $acx_csma_logo_text2 = $acx_csma_appearence_array_2[$acx_csma_template_id]['acx_csma_logo_text2'];
116
+ $acx_csma_logo_text2 = acx_csma_text_after_save_hook_fn($acx_csma_logo_text2);
117
+ ?>
118
+ <div class="logo_text" style="color:<?php echo $acx_csma_appearence_array_2[$acx_csma_template_id]['acx_csma_logo_text_color2']; ?>"><?php echo $acx_csma_logo_text2; ?></div><!-- logo_text-->
119
+ <?php
120
+ $acx_hide_svg = 'style="display:none;"';
121
  }
122
+ }
123
+ $acx_csma_logo_bg_color2 = $acx_csma_appearence_array_2[$acx_csma_template_id]['acx_csma_logo_bg_color2'];
124
+ ?>
125
+ <div class="acx_header_bg_cvr" <?php echo $acx_hide_svg; ?>>
126
+ <svg fill="<?php echo $acx_csma_logo_bg_color2; ?>" version="1.1" id="acx_header_bg_cvr_svg" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" width="700px" height="400px" viewBox="0 0 587.95 400.62" enable-background="new 0 0 587.95 400.62" xml:space="preserve"><polygon points="399.873,0.5 587.45,0.5 587.45,400.12 1.205,400.12 "/></svg>
127
+
128
+ </div><!-- acx_header_bg_cvr -->
129
+ </div><!-- header -->
 
 
 
130
  <div class="inline_block yellow" style="background: none repeat scroll 0 0 <?php echo $acx_csma_appearence_array_2[$acx_csma_template_id]['acx_csma_inside_bg_color2']; ?>;">
131
  <div class="inline_block form">
132
  <?php
167
  <?php }
168
  else if($acx_csma_show_subscription_name2 == 0){ ?>
169
  <input type="text" id="acx_csma_email" name="email" placeholder="<?php echo $acx_s_email_singular; ?>" >
170
+ <input type="button" value="<?php echo acx_csma_option_text_after_save_hook_fn($acx_csma_appearence_array_2[$acx_csma_template_id]['acx_csma_subscribe_btn_text2']); ?>" id="acx_csma_submit" onclick="acx_csma_validate_email();" class="submit" style="color:<?php echo $acx_csma_appearence_array_2[$acx_csma_template_id]['acx_csma_subscribe_btn_color2']; ?>">
171
  <?php
172
  }
173
+ $acx_csma_subscribe_btn_bg_color2 = $acx_csma_appearence_array_2[$acx_csma_template_id]['acx_csma_subscribe_btn_bg_color2'];
174
  ?>
175
+ <div class="acx_form_input_svg">
176
+ <svg version="1.1" id="acx_input_svg_img" fill="<?php echo $acx_csma_subscribe_btn_bg_color2; ?>" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
177
+ width="138px" height="67px" viewBox="0 0 138 67" enable-background="new 0 0 138 67" xml:space="preserve">
178
+ <polygon points="138,0 138,67 0,67 66.75,0 "/>
179
+ </svg>
180
+ </div>
181
  </form>
182
  <?php
183
  }
266
  </div><!-- timer_holder -->
267
 
268
  <div class="inline_block text_box">
269
+ <div class="inline_block_divider_holder">
270
+ <div class="inline_block_divider1"></div>
271
+ <div class="inline_block_divider2"></div>
272
+ </div>
273
  <?php
274
  $acx_csma_custom_html_top_temp2 = $acx_csma_appearence_array_2[$acx_csma_template_id]['acx_csma_custom_html_top_temp2'];
275
  if($acx_csma_custom_html_top_temp2 != "") { ?>
289
  <p style="color:<?php echo $acx_csma_desc_content_color2; ?>;"><?php echo $acx_csma_desc_subtitle2; ?></p>
290
  </div><!-- inline_block -->
291
  </div><!-- inline_block -->
292
+ <div class="footer">
293
+ <?php
294
+ $acx_csma_social_bg_color2 = $acx_csma_appearence_array_2[$acx_csma_template_id]['acx_csma_social_bg_color2'];
295
+ ?>
296
+ <div class="acx_footer_svg_bg">
297
+ <svg version="1.1" id="footer_svg_bg_img" fill="<?php echo $acx_csma_social_bg_color2; ?>" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
298
+ width="271px" height="81px" viewBox="0 0 270.75 81.25" enable-background="new 0 0 270.75 81.25" xml:space="preserve">
299
+ <polygon points="0,0.25 0,81.25 189.5,81.25 270.75,0 "/>
300
+ </svg>
301
+ </div>
302
  <?php
303
  $acx_csma_fb_link2=$acx_csma_appearence_array_2[$acx_csma_template_id]['acx_csma_fb_link2'];
304
  $acx_csma_twitter_link2=$acx_csma_appearence_array_2[$acx_csma_template_id]['acx_csma_twitter_link2'];
399
  jQuery("#acx_csma_email").show();
400
  jQuery("#acx_csma_submit").show();
401
  }, 3000);
 
 
402
  return false;
403
  }
404
  else
424
  jQuery("#acx_csma_success").hide();
425
  jQuery("#acx_csma_email").show();
426
  jQuery("#acx_csma_submit").show();
 
427
 
428
  }, 3000);
429
  }
439
  jQuery("#acx_csma_error").hide();
440
  jQuery("#acx_csma_email").show();
441
  jQuery("#acx_csma_submit").show();
 
442
 
443
  }, 3000);
444
 
595
  }
596
  if(seconds > 60)
597
  {
598
+ seconds = 60;
599
  }
600
  var res_sec = seconds.toString().charAt(i);
601
  if(seconds.toString().length == 1)
624
  }
625
  if(minutes > 60)
626
  {
627
+ minutes = 60;
628
  }
629
  var res_min = minutes.toString().charAt(j);
630
  if(minutes.toString().length == 1)
654
  }
655
  if(hours > 60)
656
  {
657
+ hours = 60;
658
  }
659
  var res_hour = hours.toString().charAt(k);
660
  if(hours.toString().length == 1)
661
  {
662
+ c=k+1;
663
+ document.getElementById("hours_"+c).innerHTML = res_hour;
664
  }
665
  else if(hours.toString().length == 2)
666
  {
667
+ document.getElementById("hours_"+k).innerHTML = res_hour;
668
  }
669
  }
670
  document.getElementById("days").innerHTML = days;
677
  jQuery('#acx_day_disp').html('<?php echo $acx_day_plural; ?>');
678
  }
679
  setTimeout(function(){
680
+ updateCounter();
681
  }, 1000 );
682
  }
683
  }
688
  </script>
689
  <?php do_action('acx_csma_bottom_inside_body_tag',$acx_csma_template_id);?>
690
  </body>
691
+ </html>
templates/2/style.css CHANGED
@@ -24,6 +24,16 @@ body
24
  text-align: center;
25
 
26
  }
 
 
 
 
 
 
 
 
 
 
27
  p, img, h1, h2, h3, h4, ol, ul, li, a
28
  {
29
  margin: 0;
@@ -75,14 +85,26 @@ h4
75
  {
76
  display: inline-block;
77
  }
78
-
 
 
 
 
 
 
 
 
 
 
 
 
79
  .header {
80
- background: rgba(0, 0, 0, 0) url("images/corner_1.png") no-repeat scroll right top;
81
  box-sizing: border-box;
82
  float: right;
83
- min-height: 81px;
84
  margin-right: -14px;
85
  max-width: 885px;
 
 
86
  padding: 0 23px 0 26px;
87
  position: relative;
88
  text-align: right;
@@ -98,6 +120,8 @@ h4
98
  margin-top: 13px;
99
  width: 144px;
100
  margin-bottom: 10px;
 
 
101
  }
102
 
103
  #csma_master_logo > img {
@@ -182,18 +206,32 @@ input
182
  }
183
  form
184
  {
185
- margin: 32px 0 0;
186
  }
187
- .submit
188
- {
189
- background: url("images/submit.png") no-repeat scroll 0 0 rgba(0, 0, 0, 0);
190
- cursor: pointer;
191
- margin: 0 0 0 -133px;
192
- max-width: 138px;
193
- padding: 24px 24px 25px;
194
- text-align: right;
195
- text-transform: uppercase;
196
- transition: all 0.2s ease 0s;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
197
  }
198
  .submit:hover
199
  {
@@ -207,7 +245,6 @@ form
207
  }
208
  .text_box
209
  {
210
- background: url("images/divider.jpg") repeat-x scroll center top rgba(0, 0, 0, 0);
211
  margin: 30px 0 0;
212
  padding: 30px 0 0;
213
  }
@@ -215,13 +252,16 @@ form
215
  {
216
  text-align: center;
217
  }
218
- .footer
219
- {
220
- background: url("images/corner_2.png") no-repeat scroll left center rgba(0, 0, 0, 0);
221
- height: 81px;
222
- margin: -12px 0 0 -12px;
223
- padding: 0;
224
- position: relative;
 
 
 
225
  }
226
  .footer p, .text_box p
227
  {
@@ -232,9 +272,10 @@ form
232
  margin: 0 0 4px;
233
  text-transform: uppercase;
234
  }
235
- .footer ul
236
- {
237
- padding: 21px 0 0 25px;
 
238
  }
239
  .footer ul li
240
  {
@@ -308,12 +349,15 @@ media query
308
  {
309
  .header, .footer
310
  {
311
- background: none repeat scroll 0 0 #020202;
312
  margin: 0;
313
  max-width: none;
314
  padding: 0;
315
  text-align: center;
316
  }
 
 
 
 
317
  .timer_holder, .form
318
  {
319
  text-align: center;
@@ -354,4 +398,12 @@ media query
354
  border-radius: 4px;
355
  max-width:400px;
356
  margin:0 auto;
 
 
 
 
 
 
 
 
357
  }
24
  text-align: center;
25
 
26
  }
27
+ #acx_header_bg_cvr_svg {
28
+ position: absolute;
29
+ right: -57px;
30
+ top: 0;
31
+ }
32
+ .acx_header_bg_cvr {
33
+ position: absolute;
34
+ right: 0;
35
+ top: 0;
36
+ }
37
  p, img, h1, h2, h3, h4, ol, ul, li, a
38
  {
39
  margin: 0;
85
  {
86
  display: inline-block;
87
  }
88
+ .inline_block_divider1,
89
+ .inline_block_divider2
90
+ {
91
+ width:100%;
92
+ height:1px;
93
+ }
94
+ .inline_block_divider_holder {
95
+ margin-bottom: 29px;
96
+ }
97
+ .inline_block_divider2
98
+ {
99
+ opacity:0.4;
100
+ }
101
  .header {
 
102
  box-sizing: border-box;
103
  float: right;
 
104
  margin-right: -14px;
105
  max-width: 885px;
106
+ min-height: 81px;
107
+ overflow: hidden;
108
  padding: 0 23px 0 26px;
109
  position: relative;
110
  text-align: right;
120
  margin-top: 13px;
121
  width: 144px;
122
  margin-bottom: 10px;
123
+ z-index:40;
124
+ position:relative;
125
  }
126
 
127
  #csma_master_logo > img {
206
  }
207
  form
208
  {
209
+ margin: 32px auto 0;
210
  }
211
+ .submit {
212
+ background:none;
213
+ cursor: pointer;
214
+ margin: 0;
215
+ max-width: 138px;
216
+ padding: 24px 24px 25px;
217
+ position: absolute;
218
+ right: 0;
219
+ text-align: right;
220
+ text-transform: uppercase;
221
+ top: -4px;
222
+ transition: all 0.2s ease 0s;
223
+ width: auto;
224
+ z-index: 9;
225
+ }
226
+ .acx_form_input_svg {
227
+ position: absolute;
228
+ right: 0;
229
+ top: -5px;
230
+ }
231
+
232
+ .inline_block form {
233
+ max-width: 440px;
234
+ position: relative;
235
  }
236
  .submit:hover
237
  {
245
  }
246
  .text_box
247
  {
 
248
  margin: 30px 0 0;
249
  padding: 30px 0 0;
250
  }
252
  {
253
  text-align: center;
254
  }
255
+ .footer {
256
+ height: 81px;
257
+ margin: -12px 0 0 -12px;
258
+ padding: 0;
259
+ position: relative;
260
+ }
261
+ .acx_footer_svg_bg {
262
+ left: 0;
263
+ position: absolute;
264
+ top: 0;
265
  }
266
  .footer p, .text_box p
267
  {
272
  margin: 0 0 4px;
273
  text-transform: uppercase;
274
  }
275
+ .footer ul {
276
+ padding: 21px 0 0 25px;
277
+ position: relative;
278
+ z-index: 9;
279
  }
280
  .footer ul li
281
  {
349
  {
350
  .header, .footer
351
  {
 
352
  margin: 0;
353
  max-width: none;
354
  padding: 0;
355
  text-align: center;
356
  }
357
+ .acx_header_bg_cvr
358
+ {
359
+ display:none;
360
+ }
361
  .timer_holder, .form
362
  {
363
  text-align: center;
398
  border-radius: 4px;
399
  max-width:400px;
400
  margin:0 auto;
401
+ }
402
+
403
+ @media screen and (max-width:980px)
404
+ {
405
+ .acx_footer_svg_bg
406
+ {
407
+ display:none;
408
+ }
409
  }
templates/3/index.php CHANGED
@@ -431,6 +431,8 @@ if($acx_csma_show_subscription3 == 1)
431
  $acx_name_val_arr=acx_csma_disp_var_to_show("Subscription Name Error Message");
432
  $acx_name_val_singular=$acx_name_val_arr['singular'];
433
  $acx_email_val_arr=acx_csma_disp_var_to_show("Subscription Email Error Message");
 
 
434
  $acx_email_val_singular=$acx_email_val_arr['singular'];
435
  $acx_subs_next_arr=acx_csma_disp_var_to_show("next");
436
  $acx_next_singular=$acx_subs_next_arr['singular'];
@@ -488,7 +490,6 @@ function acx_csma_validate_email()
488
  jQuery("#acx_csma_success").hide();
489
  jQuery("#acx_csma_email").show();
490
  jQuery("#acx_csma_submit").show();
491
- // acx_csma_form_status=1;
492
 
493
  }, 3000);
494
  }
@@ -504,7 +505,6 @@ function acx_csma_validate_email()
504
  jQuery("#acx_csma_error").hide();
505
  jQuery("#acx_csma_email").show();
506
  jQuery("#acx_csma_submit").show();
507
- //acx_csma_form_status=1;
508
 
509
  }, 3000);
510
 
@@ -599,7 +599,7 @@ function acx_csma_validate_email()
599
  jQuery("#acx_csma_email").hide();
600
  jQuery("#acx_csma_submit").hide();
601
  jQuery("#acx_csma_error").show();
602
- jQuery("#acx_csma_error").html("Email Already Exists !!");
603
  setTimeout(function()
604
  {
605
  jQuery("#acx_csma_error").html('');
@@ -660,7 +660,7 @@ function updateCounter()
660
  }
661
  if(seconds > 60)
662
  {
663
- seconds = 60;
664
  }
665
  var res_sec = seconds.toString().charAt(i);
666
  if(seconds.toString().length == 1)
@@ -689,7 +689,7 @@ function updateCounter()
689
  }
690
  if(minutes > 60)
691
  {
692
- minutes = 60;
693
  }
694
  var res_min = minutes.toString().charAt(j);
695
  if(minutes.toString().length == 1)
@@ -719,17 +719,17 @@ function updateCounter()
719
  }
720
  if(hours > 60)
721
  {
722
- hours = 60;
723
  }
724
  var res_hour = hours.toString().charAt(k);
725
  if(hours.toString().length == 1)
726
  {
727
- c=k+1;
728
- document.getElementById("hours_"+c).innerHTML = res_hour;
729
  }
730
  else if(hours.toString().length == 2)
731
  {
732
- document.getElementById("hours_"+k).innerHTML = res_hour;
733
  }
734
  }
735
 
431
  $acx_name_val_arr=acx_csma_disp_var_to_show("Subscription Name Error Message");
432
  $acx_name_val_singular=$acx_name_val_arr['singular'];
433
  $acx_email_val_arr=acx_csma_disp_var_to_show("Subscription Email Error Message");
434
+ $acx_email_exist_arr=acx_csma_disp_var_to_show("Subscription Email Exists Message");
435
+ $acx_email_singular=$acx_email_exist_arr['singular'];
436
  $acx_email_val_singular=$acx_email_val_arr['singular'];
437
  $acx_subs_next_arr=acx_csma_disp_var_to_show("next");
438
  $acx_next_singular=$acx_subs_next_arr['singular'];
490
  jQuery("#acx_csma_success").hide();
491
  jQuery("#acx_csma_email").show();
492
  jQuery("#acx_csma_submit").show();
 
493
 
494
  }, 3000);
495
  }
505
  jQuery("#acx_csma_error").hide();
506
  jQuery("#acx_csma_email").show();
507
  jQuery("#acx_csma_submit").show();
 
508
 
509
  }, 3000);
510
 
599
  jQuery("#acx_csma_email").hide();
600
  jQuery("#acx_csma_submit").hide();
601
  jQuery("#acx_csma_error").show();
602
+ jQuery("#acx_csma_error").html("<?php echo $acx_email_singular ;?>");
603
  setTimeout(function()
604
  {
605
  jQuery("#acx_csma_error").html('');
660
  }
661
  if(seconds > 60)
662
  {
663
+ seconds = 60;
664
  }
665
  var res_sec = seconds.toString().charAt(i);
666
  if(seconds.toString().length == 1)
689
  }
690
  if(minutes > 60)
691
  {
692
+ minutes = 60;
693
  }
694
  var res_min = minutes.toString().charAt(j);
695
  if(minutes.toString().length == 1)
719
  }
720
  if(hours > 60)
721
  {
722
+ hours = 60;
723
  }
724
  var res_hour = hours.toString().charAt(k);
725
  if(hours.toString().length == 1)
726
  {
727
+ c=k+1;
728
+ document.getElementById("hours_"+c).innerHTML = res_hour;
729
  }
730
  else if(hours.toString().length == 2)
731
  {
732
+ document.getElementById("hours_"+k).innerHTML = res_hour;
733
  }
734
  }
735
 
templates/4/index.php CHANGED
@@ -368,7 +368,6 @@ function acx_csma_validate_email()
368
  jQuery("#acx_csma_success").hide();
369
  jQuery("#acx_csma_email").show();
370
  jQuery("#acx_csma_submit").show();
371
- // acx_csma_form_status=1;
372
 
373
  }, 3000);
374
  }
@@ -384,7 +383,6 @@ function acx_csma_validate_email()
384
  jQuery("#acx_csma_error").hide();
385
  jQuery("#acx_csma_email").show();
386
  jQuery("#acx_csma_submit").show();
387
- //acx_csma_form_status=1;
388
 
389
  }, 3000);
390
 
@@ -646,4 +644,4 @@ function updateCounter()
646
  </script>
647
  <?php do_action('acx_csma_bottom_inside_body_tag',$acx_csma_template_id);?>
648
  </body>
649
- </html>
368
  jQuery("#acx_csma_success").hide();
369
  jQuery("#acx_csma_email").show();
370
  jQuery("#acx_csma_submit").show();
 
371
 
372
  }, 3000);
373
  }
383
  jQuery("#acx_csma_error").hide();
384
  jQuery("#acx_csma_email").show();
385
  jQuery("#acx_csma_submit").show();
 
386
 
387
  }, 3000);
388
 
644
  </script>
645
  <?php do_action('acx_csma_bottom_inside_body_tag',$acx_csma_template_id);?>
646
  </body>
647
+ </html>
templates/5/index.php CHANGED
@@ -352,8 +352,6 @@ function acx_csma_validate_email()
352
  jQuery("#acx_csma_email").show();
353
  jQuery("#acx_csma_submit").show();
354
  }, 3000);
355
-
356
-
357
  return false;
358
  }
359
  else
@@ -379,7 +377,6 @@ function acx_csma_validate_email()
379
  jQuery("#acx_csma_success").hide();
380
  jQuery("#acx_csma_email").show();
381
  jQuery("#acx_csma_submit").show();
382
- // acx_csma_form_status=1;
383
 
384
  }, 3000);
385
  }
@@ -395,7 +392,6 @@ function acx_csma_validate_email()
395
  jQuery("#acx_csma_error").hide();
396
  jQuery("#acx_csma_email").show();
397
  jQuery("#acx_csma_submit").show();
398
- //acx_csma_form_status=1;
399
 
400
  }, 3000);
401
 
@@ -468,40 +464,39 @@ function acx_csma_validate_email()
468
  jQuery("#acx_csma_loading").remove();
469
  if(theResponse == "success")
470
  {
471
- document.getElementById('acx_csma_email').value="";
472
- document.getElementById('acx_csma_name_hidden').value="";
473
- jQuery("#acx_csma_email").hide();
474
- jQuery("#acx_csma_submit").hide();
 
 
 
 
 
 
 
 
 
475
 
476
- jQuery("#acx_csma_success").show();
477
- setTimeout(function()
478
- {
479
- jQuery("#acx_csma_success").hide();
480
- document.getElementById('acx_csma_name_hidden').type = 'text';
481
- document.getElementById('acx_csma_submit').value="<?php echo $acx_next_singular; ?>";
482
- jQuery("#acx_csma_submit").show();
483
- acx_csma_form_status=1;
484
-
485
- }, 3000);
486
  }
487
  else{
488
- document.getElementById('acx_csma_email').value="";
489
- document.getElementById('acx_csma_name_hidden').value="";
490
- jQuery("#acx_csma_email").hide();
491
- jQuery("#acx_csma_submit").hide();
492
- jQuery("#acx_csma_error").show();
493
- jQuery("#acx_csma_error").html("<?php echo $acx_email_singular; ?>");
494
- setTimeout(function()
495
- {
496
- jQuery("#acx_csma_error").html('');
497
- jQuery("#acx_csma_error").hide();
498
- document.getElementById('acx_csma_name_hidden').type = 'text';
499
- document.getElementById('acx_csma_submit').value="<?php echo $acx_next_singular; ?>";
500
- jQuery("#acx_csma_submit").show();
501
- acx_csma_form_status=1;
502
-
503
- }, 3000);
504
 
 
505
  }
506
  });
507
  }
@@ -623,4 +618,4 @@ function updateCounter()
623
  </script>
624
  <?php do_action('acx_csma_bottom_inside_body_tag',$acx_csma_template_id); ?>
625
  </body>
626
- </html>
352
  jQuery("#acx_csma_email").show();
353
  jQuery("#acx_csma_submit").show();
354
  }, 3000);
 
 
355
  return false;
356
  }
357
  else
377
  jQuery("#acx_csma_success").hide();
378
  jQuery("#acx_csma_email").show();
379
  jQuery("#acx_csma_submit").show();
 
380
 
381
  }, 3000);
382
  }
392
  jQuery("#acx_csma_error").hide();
393
  jQuery("#acx_csma_email").show();
394
  jQuery("#acx_csma_submit").show();
 
395
 
396
  }, 3000);
397
 
464
  jQuery("#acx_csma_loading").remove();
465
  if(theResponse == "success")
466
  {
467
+ document.getElementById('acx_csma_email').value="";
468
+ document.getElementById('acx_csma_name_hidden').value="";
469
+ jQuery("#acx_csma_email").hide();
470
+ jQuery("#acx_csma_submit").hide();
471
+
472
+ jQuery("#acx_csma_success").show();
473
+ setTimeout(function()
474
+ {
475
+ jQuery("#acx_csma_success").hide();
476
+ document.getElementById('acx_csma_name_hidden').type = 'text';
477
+ document.getElementById('acx_csma_submit').value="<?php echo $acx_next_singular; ?>";
478
+ jQuery("#acx_csma_submit").show();
479
+ acx_csma_form_status=1;
480
 
481
+ }, 3000);
 
 
 
 
 
 
 
 
 
482
  }
483
  else{
484
+ document.getElementById('acx_csma_email').value="";
485
+ document.getElementById('acx_csma_name_hidden').value="";
486
+ jQuery("#acx_csma_email").hide();
487
+ jQuery("#acx_csma_submit").hide();
488
+ jQuery("#acx_csma_error").show();
489
+ jQuery("#acx_csma_error").html("<?php echo $acx_email_singular; ?>");
490
+ setTimeout(function()
491
+ {
492
+ jQuery("#acx_csma_error").html('');
493
+ jQuery("#acx_csma_error").hide();
494
+ document.getElementById('acx_csma_name_hidden').type = 'text';
495
+ document.getElementById('acx_csma_submit').value="<?php echo $acx_next_singular; ?>";
496
+ jQuery("#acx_csma_submit").show();
497
+ acx_csma_form_status=1;
 
 
498
 
499
+ }, 3000);
500
  }
501
  });
502
  }
618
  </script>
619
  <?php do_action('acx_csma_bottom_inside_body_tag',$acx_csma_template_id); ?>
620
  </body>
621
+ </html>