PluginProbe
PDF & Print by BestWebSoft – WordPress Posts and Pages PDF Generator Plugin / trunk
PDF & Print by BestWebSoft – WordPress Posts and Pages PDF Generator Plugin vtrunk
trunk 1.5 1.6 1.7 1.7.1 1.7.2 1.7.3 1.7.4 1.7.5 1.7.6 1.7.7 1.7.8 1.7.9 1.8.0 1.8.1 1.8.2 1.8.3 1.8.4 1.8.5 1.8.6 1.8.7 1.8.8 1.8.9 1.9.0 1.9.1 All 71 releases
pdf-print / bws_menu / bws_menu.php

bws_menu.php in PDF & Print by BestWebSoft – WordPress Posts and Pages PDF Generator Plugin trunk, at bws_menu/bws_menu.php

941 lines 47.9 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 if ( ! defined( 'ABSPATH' ) ) {
3 exit;
4 }
5
6 /**
7 * Function for displaying BestWebSoft menu
8 * Version: 2.4.4
9 */
10 if ( ! function_exists( 'bws_admin_enqueue_scripts' ) ) {
11 require_once dirname( __FILE__ ) . '/bws_functions.php';
12 }
13
14 if ( ! function_exists( 'bws_add_menu_render' ) ) {
15 /**
16 * Function for render BestWebSoft menu
17 */
18 function bws_add_menu_render() {
19 global $wpdb, $wp_version, $bstwbsftwppdtplgns_options;
20 $error = '';
21 $message = '';
22
23 /**
24 * @deprecated 1.9.8 (15.12.2016)
25 */
26 $is_main_page = isset( $_GET['page'] ) && in_array( $_GET['page'], array( 'bws_panel', 'bws_themes', 'bws_system_status' ) );
27 $page = sanitize_text_field( wp_unslash( $_GET['page'] ) );
28 $tab = isset( $_GET['tab'] ) ? sanitize_text_field( wp_unslash( $_GET['tab'] ) ) : '';
29
30 if ( $is_main_page ) {
31 $current_page = 'admin.php?page=' . $page;
32 } else {
33 $current_page = isset( $_GET['tab'] ) ? 'admin.php?page=' . $page . '&tab=' . $tab : 'admin.php?page=' . $page;
34 }
35
36 if ( 'bws_panel' === $page || ( ! $is_main_page && '' === $tab ) ) {
37
38 if ( ! function_exists( 'is_plugin_active_for_network' ) ) {
39 require_once ABSPATH . 'wp-admin/includes/plugin.php';
40 }
41
42 /* Get $bws_plugins */
43 require dirname( __FILE__ ) . '/product_list.php';
44
45 $all_plugins = get_plugins();
46 $active_plugins = get_option( 'active_plugins' );
47 $sitewide_active_plugins = ( function_exists( 'is_multisite' ) && is_multisite() ) ? get_site_option( 'active_sitewide_plugins' ) : array();
48 $update_availible_all = get_site_transient( 'update_plugins' );
49
50 $plugin_category = isset( $_GET['category'] ) ? sanitize_text_field( wp_unslash( $_GET['category'] ) ) : 'all';
51
52 if ( ( isset( $_GET['sub'] ) && 'installed' === sanitize_text_field( wp_unslash( $_GET['sub'] ) ) ) || ! isset( $_GET['sub'] ) ) {
53 $bws_plugins_update_availible = array();
54 $bws_plugins_expired = array();
55 foreach ( $bws_plugins as $key_plugin => $value_plugin ) {
56
57 foreach ( $value_plugin['category'] as $category_key ) {
58 $bws_plugins_category[ $category_key ]['count'] = isset( $bws_plugins_category[ $category_key ]['count'] ) ? $bws_plugins_category[ $category_key ]['count'] + 1 : 1;
59 }
60
61 $is_installed = array_key_exists( $key_plugin, $all_plugins );
62 $is_pro_installed = false;
63 if ( isset( $value_plugin['pro_version'] ) ) {
64 $is_pro_installed = array_key_exists( $value_plugin['pro_version'], $all_plugins );
65 }
66 /* Check update_availible */
67 if ( ! empty( $update_availible_all ) && ! empty( $update_availible_all->response ) ) {
68 if ( $is_pro_installed && array_key_exists( $value_plugin['pro_version'], $update_availible_all->response ) ) {
69 unset( $bws_plugins[ $key_plugin ] );
70 $value_plugin['update_availible'] = $value_plugin['pro_version'];
71 $bws_plugins_update_availible[ $key_plugin ] = $value_plugin;
72 } elseif ( $is_installed && array_key_exists( $key_plugin, $update_availible_all->response ) ) {
73 unset( $bws_plugins[ $key_plugin ] );
74 $value_plugin['update_availible'] = $key_plugin;
75 $bws_plugins_update_availible[ $key_plugin ] = $value_plugin;
76 }
77 }
78 /* Check expired */
79 if ( $is_pro_installed && isset( $bstwbsftwppdtplgns_options['time_out'][ $value_plugin['pro_version'] ] ) &&
80 strtotime( $bstwbsftwppdtplgns_options['time_out'][ $value_plugin['pro_version'] ] ) < strtotime( gmdate( 'm/d/Y' ) ) ) {
81 unset( $bws_plugins[ $key_plugin ] );
82 $value_plugin['expired'] = $bstwbsftwppdtplgns_options['time_out'][ $value_plugin['pro_version'] ];
83 $bws_plugins_expired[ $key_plugin ] = $value_plugin;
84 }
85 }
86 $bws_plugins = $bws_plugins_update_availible + $bws_plugins_expired + $bws_plugins;
87 } else {
88 foreach ( $bws_plugins as $key_plugin => $value_plugin ) {
89 foreach ( $value_plugin['category'] as $category_key ) {
90 $bws_plugins_category[ $category_key ]['count'] = isset( $bws_plugins_category[ $category_key ]['count'] ) ? $bws_plugins_category[ $category_key ]['count'] + 1 : 1;
91 }
92 }
93 }
94
95 /*** Membership */
96 $bws_license_plugin = 'bws_get_list_for_membership';
97 $bws_license_key = isset( $bstwbsftwppdtplgns_options[ $bws_license_plugin ] ) ? $bstwbsftwppdtplgns_options[ $bws_license_plugin ] : '';
98 $update_membership_list = true;
99
100 if ( isset( $_POST['bws_license_key'] ) ) {
101 $bws_license_key = sanitize_text_field( wp_unslash( $_POST['bws_license_key'] ) );
102 }
103
104 if ( isset( $_SESSION['bws_membership_time_check'] ) && isset( $_SESSION['bws_membership_list'] ) && $_SESSION['bws_membership_time_check'] < strtotime( '+12 hours' ) ) {
105 $update_membership_list = false;
106 $plugins_array = $_SESSION['bws_membership_list'];
107 foreach ( $plugins_array as $plugins_key => $plugins_value ) {
108 if ( is_array( $plugins_value ) ) {
109 $plugins_array[ $plugins_key ] = array_map( 'sanitize_text_field', array_map( 'wp_unslash', $plugins_value ) );
110 } elseif ( is_object( $plugins_value ) ) {
111 foreach ( $plugins_value as $plugins_key2 => $plugins_value2 ) {
112 $plugins_value->$plugins_key2 = sanitize_text_field( wp_unslash( $plugins_value2 ) );
113 }
114 $plugins_array[ $plugins_key ] = $plugins_value;
115 } else {
116 $plugins_array[ $plugins_key ] = sanitize_text_field( wp_unslash( $plugins_value ) );
117 }
118 }
119 }
120
121 if ( ( $update_membership_list && ! empty( $bws_license_key ) ) || ( isset( $_POST['bws_license_submit'] ) && check_admin_referer( plugin_basename( __FILE__ ), 'bws_license_nonce_name' ) ) ) {
122
123 if ( '' !== $bws_license_key ) {
124 if ( 18 !== strlen( $bws_license_key ) ) {
125 $error = __( 'Wrong license key', 'bestwebsoft' );
126 } else {
127
128 if ( isset( $bstwbsftwppdtplgns_options['go_pro'][ $bws_license_plugin ]['count'] ) && $bstwbsftwppdtplgns_options['go_pro'][ $bws_license_plugin ]['time'] > ( time() - ( 24 * 60 * 60 ) ) ) {
129 $bstwbsftwppdtplgns_options['go_pro'][ $bws_license_plugin ]['count'] = $bstwbsftwppdtplgns_options['go_pro'][ $bws_license_plugin ]['count'] + 1;
130 } else {
131 $bstwbsftwppdtplgns_options['go_pro'][ $bws_license_plugin ]['count'] = 1;
132 $bstwbsftwppdtplgns_options['go_pro'][ $bws_license_plugin ]['time'] = time();
133 }
134
135 /* get Pro list */
136 $to_send = array();
137 $to_send['plugins'][ $bws_license_plugin ] = array();
138 $to_send['plugins'][ $bws_license_plugin ]['bws_license_key'] = $bws_license_key;
139 $options = array(
140 'timeout' => ( ( defined( 'DOING_CRON' ) && DOING_CRON ) ? 30 : 3 ),
141 'body' => array( 'plugins' => serialize( $to_send ) ),
142 'user-agent' => 'WordPress/' . $wp_version . '; ' . get_bloginfo( 'url' ),
143 );
144 $raw_response = wp_remote_post( 'https://bestwebsoft.com/wp-content/plugins/paid-products/plugins/pro-license-check/1.0/', $options );
145
146 if ( is_wp_error( $raw_response ) || 200 !== wp_remote_retrieve_response_code( $raw_response ) ) {
147 $error = __( 'Something went wrong. Please try again later. If the error appears again, please contact us', 'bestwebsoft' ) . ' <a href="https://support.bestwebsoft.com">BestWebSoft</a>. ' . __( 'We are sorry for inconvenience.', 'bestwebsoft' );
148 } else {
149 $response = maybe_unserialize( wp_remote_retrieve_body( $raw_response ) );
150
151 if ( is_array( $response ) && ! empty( $response ) ) {
152 foreach ( $response as $key => $value ) {
153 if ( 'wrong_license_key' === $value->package ) {
154 $error = __( 'Wrong license key.', 'bestwebsoft' );
155 } elseif ( 'wrong_domain' === $value->package ) {
156 $error = __( 'This license key is bound to another site. Change it via personal Client Area.', 'bestwebsoft' ) . '<a target="_blank" href="https://bestwebsoft.com/client-area">' . __( 'Log in', 'bestwebsoft' ) . '</a>';
157 } elseif ( 'you_are_banned' === $value->package ) {
158 $error = __( 'Unfortunately, you have exceeded the number of available tries per day.', 'bestwebsoft' );
159 } elseif ( 'time_out' === $value->package ) {
160 $error = sprintf( __( 'Unfortunately, Your license has expired. To continue getting top-priority support and plugin updates, you should extend it in your %s', 'bestwebsoft' ), ' <a href="https://bestwebsoft.com/client-area">Client Area</a>' );
161 } elseif ( 'duplicate_domen_for_trial' === $value->package ) {
162 $error = __( 'Unfortunately, the Pro licence was already installed to this domain. The Pro Trial license can be installed only once.', 'bestwebsoft' );
163 } elseif ( is_array( $value->package ) && ! empty( $value->package ) ) {
164 $plugins_array = $_SESSION['bws_membership_list'] = $value->package;
165 $_SESSION['bws_membership_time_check'] = strtotime( 'now' );
166
167 if ( isset( $bstwbsftwppdtplgns_options[ $bws_license_plugin ] ) && $bws_license_key === $bstwbsftwppdtplgns_options[ $bws_license_plugin ] ) {
168 $message = __( 'The license key is valid.', 'bestwebsoft' );
169 if ( isset( $value->time_out ) && '' !== $value->time_out ) {
170 $message .= ' ' . __( 'Your license will expire on', 'bestwebsoft' ) . ' ' . $value->time_out . '.';
171 }
172 } else {
173 $message = __( 'Congratulations! Pro Membership license is activated successfully.', 'bestwebsoft' );
174 }
175
176 $bstwbsftwppdtplgns_options[ $bws_license_plugin ] = $bws_license_key;
177 }
178 }
179 } else {
180 $error = __( 'Something went wrong. Try again later or upload the plugin manually. We are sorry for inconvenience.', 'bestwebsoft' );
181 }
182 }
183
184 if ( is_multisite() ) {
185 update_site_option( 'bstwbsftwppdtplgns_options', $bstwbsftwppdtplgns_options );
186 } else {
187 update_option( 'bstwbsftwppdtplgns_options', $bstwbsftwppdtplgns_options );
188 }
189 }
190 } else {
191 $error = __( 'Please enter your license key.', 'bestwebsoft' );
192 }
193 }
194 } elseif ( 'bws_system_status' === $page || 'system-status' === $tab ) {
195
196 $all_plugins = get_plugins();
197 $active_plugins = get_option( 'active_plugins' );
198 $mysql_info = $wpdb->get_results( "SHOW VARIABLES LIKE 'sql_mode'" );
199 if ( is_array( $mysql_info ) ) {
200 $sql_mode = $mysql_info[0]->Value;
201 }
202 if ( empty( $sql_mode ) ) {
203 $sql_mode = __( 'Not set', 'bestwebsoft' );
204 }
205
206 $allow_url_fopen = ( ini_get( 'allow_url_fopen' ) ) ? __( 'On', 'bestwebsoft' ) : __( 'Off', 'bestwebsoft' );
207 $upload_max_filesize = ( ini_get( 'upload_max_filesize' ) ) ? ini_get( 'upload_max_filesize' ) : __( 'N/A', 'bestwebsoft' );
208 $post_max_size = ( ini_get( 'post_max_size' ) ) ? ini_get( 'post_max_size' ) : __( 'N/A', 'bestwebsoft' );
209 $max_execution_time = ( ini_get( 'max_execution_time' ) ) ? ini_get( 'max_execution_time' ) : __( 'N/A', 'bestwebsoft' );
210 $memory_limit = ( ini_get( 'memory_limit' ) ) ? ini_get( 'memory_limit' ) : __( 'N/A', 'bestwebsoft' );
211 $wp_memory_limit = ( defined( 'WP_MEMORY_LIMIT' ) ) ? WP_MEMORY_LIMIT : __( 'N/A', 'bestwebsoft' );
212 $memory_usage = ( function_exists( 'memory_get_usage' ) ) ? round( memory_get_usage() / 1024 / 1024, 2 ) . ' ' . __( 'Mb', 'bestwebsoft' ) : __( 'N/A', 'bestwebsoft' );
213 $exif_read_data = ( is_callable( 'exif_read_data' ) ) ? __( 'Yes', 'bestwebsoft' ) . ' ( V' . substr( phpversion( 'exif' ), 0, 4 ) . ')' : __( 'No', 'bestwebsoft' );
214 $iptcparse = ( is_callable( 'iptcparse' ) ) ? __( 'Yes', 'bestwebsoft' ) : __( 'No', 'bestwebsoft' );
215 $xml_parser_create = ( is_callable( 'xml_parser_create' ) ) ? __( 'Yes', 'bestwebsoft' ) : __( 'No', 'bestwebsoft' );
216 $theme = wp_get_theme();
217
218 if ( function_exists( 'is_multisite' ) ) {
219 $multisite = is_multisite() ? __( 'Yes', 'bestwebsoft' ) : __( 'No', 'bestwebsoft' );
220 } else {
221 $multisite = __( 'N/A', 'bestwebsoft' );
222 }
223
224 $system_info = array(
225 'wp_environment' => array(
226 'name' => __( 'WordPress Environment', 'bestwebsoft' ),
227 'data' => array(
228 __( 'Home URL', 'bestwebsoft' ) => home_url(),
229 __( 'Website URL', 'bestwebsoft' ) => get_option( 'siteurl' ),
230 __( 'WP Version', 'bestwebsoft' ) => $wp_version,
231 __( 'WP Multisite', 'bestwebsoft' ) => $multisite,
232 __( 'WP Memory Limit', 'bestwebsoft' ) => $wp_memory_limit,
233 __( 'Active Theme', 'bestwebsoft' ) => $theme['Name'] . ' ' . $theme['Version'] . ' (' . sprintf( __( 'by %s', 'bestwebsoft' ), $theme['Author'] ) . ')',
234 ),
235 ),
236 'server_environment' => array(
237 'name' => __( 'Server Environment', 'bestwebsoft' ),
238 'data' => array(
239 __( 'Operating System', 'bestwebsoft' ) => PHP_OS,
240 __( 'Server', 'bestwebsoft' ) => isset( $_SERVER['SERVER_SOFTWARE'] ) ? sanitize_email( wp_unslash( $_SERVER['SERVER_SOFTWARE'] ) ) : '',
241 __( 'PHP Version', 'bestwebsoft' ) => PHP_VERSION,
242 __( 'PHP Allow URL fopen', 'bestwebsoft' ) => $allow_url_fopen,
243 __( 'PHP Memory Limit', 'bestwebsoft' ) => $memory_limit,
244 __( 'Memory Usage', 'bestwebsoft' ) => $memory_usage,
245 __( 'PHP Max Upload Size', 'bestwebsoft' ) => $upload_max_filesize,
246 __( 'PHP Max Post Size', 'bestwebsoft' ) => $post_max_size,
247 __( 'PHP Max Script Execute Time', 'bestwebsoft' ) => $max_execution_time,
248 __( 'PHP Exif support', 'bestwebsoft' ) => $exif_read_data,
249 __( 'PHP IPTC support', 'bestwebsoft' ) => $iptcparse,
250 __( 'PHP XML support', 'bestwebsoft' ) => $xml_parser_create,
251 '$_SERVER[HTTP_HOST]' => isset( $_SERVER['HTTP_HOST'] ) ? sanitize_email( wp_unslash( $_SERVER['HTTP_HOST'] ) ) : '',
252 '$_SERVER[SERVER_NAME]' => isset( $_SERVER['SERVER_NAME'] ) ? sanitize_email( wp_unslash( $_SERVER['SERVER_NAME'] ) ) : '',
253 ),
254 ),
255 'db' => array(
256 'name' => __( 'Database', 'bestwebsoft' ),
257 'data' => array(
258 __( 'WP DB version', 'bestwebsoft' ) => get_option( 'db_version' ),
259 __( 'MySQL version', 'bestwebsoft' ) => $wpdb->get_var( 'SELECT VERSION() AS version' ),
260 __( 'SQL Mode', 'bestwebsoft' ) => $sql_mode,
261 ),
262 ),
263 'active_plugins' => array(
264 'name' => __( 'Active Plugins', 'bestwebsoft' ),
265 'data' => array(),
266 'count' => 0,
267 ),
268 'inactive_plugins' => array(
269 'name' => __( 'Inactive Plugins', 'bestwebsoft' ),
270 'data' => array(),
271 'count' => 0,
272 ),
273 );
274
275 foreach ( $all_plugins as $path => $plugin ) {
276 $name = str_replace( 'by BestWebSoft', '', $plugin['Name'] );
277 if ( is_plugin_active( $path ) ) {
278 $system_info['active_plugins']['data'][ $name ] = sprintf( __( 'by %s', 'bestwebsoft' ), $plugin['Author'] ) . ' - ' . $plugin['Version'];
279 $system_info['active_plugins']['count'] = $system_info['active_plugins']['count'] + 1;
280 } else {
281 $system_info['inactive_plugins']['data'][ $name ] = sprintf( __( 'by %s', 'bestwebsoft' ), $plugin['Author'] ) . ' - ' . $plugin['Version'];
282 $system_info['inactive_plugins']['count'] = $system_info['inactive_plugins']['count'] + 1;
283 }
284 }
285
286 if ( ( isset( $_REQUEST['bwsmn_form_submit'] ) && check_admin_referer( plugin_basename( __FILE__ ), 'bwsmn_nonce_submit' ) ) || ( isset( $_REQUEST['bwsmn_form_submit_custom_email'] ) && check_admin_referer( plugin_basename( __FILE__ ), 'bwsmn_nonce_submit_custom_email' ) ) ) {
287 if ( isset( $_REQUEST['bwsmn_form_email'] ) ) {
288 $email = sanitize_email( wp_unslash( $_REQUEST['bwsmn_form_email'] ) );
289 if ( '' === $email ) {
290 $error = __( 'Please enter a valid email address.', 'bestwebsoft' );
291 } else {
292 $message = sprintf( __( 'Email with system info is sent to %s.', 'bestwebsoft' ), $email );
293 }
294 } else {
295 $email = 'plugin_system_status@bestwebsoft.com';
296 $message = __( 'Thank you for contacting us.', 'bestwebsoft' );
297 }
298
299 if ( '' === $error ) {
300 $headers = 'MIME-Version: 1.0' . "\n";
301 $headers .= 'Content-type: text/html; charset=utf-8' . "\n";
302 $headers .= 'From: ' . get_option( 'admin_email' );
303 $message_text = '<html><head><title>System Info From ' . home_url() . '</title></head><body>';
304 foreach ( $system_info as $info ) {
305 if ( ! empty( $info['data'] ) ) {
306 $message_text .= '<h4>' . $info['name'];
307 if ( isset( $info['count'] ) ) {
308 $message_text .= ' (' . $info['count'] . ')';
309 }
310 $message_text .= '</h4><table>';
311 foreach ( $info['data'] as $key => $value ) {
312 $message_text .= '<tr><td>' . $key . '</td><td>' . $value . '</td></tr>';
313 }
314 $message_text .= '</table>';
315 }
316 }
317 $message_text .= '</body></html>';
318 $result = wp_mail( $email, 'System Info From ' . esc_url( home_url() ), wp_kses( $message_text ), $headers );
319 if ( true !== $result ) {
320 $error = __( 'Sorry, email message could not be delivered.', 'bestwebsoft' );
321 }
322 }
323 }
324 } ?>
325 <div class="bws-wrap">
326 <div class="bws-header">
327 <div class="bws-title">
328 <a href="<?php echo esc_url( ( $is_main_page ) ? self_admin_url( 'admin.php?page=bws_panel' ) : self_admin_url( 'admin.php?page=' . $page ) ); ?>">
329 <span class="bws-logo bwsicons bwsicons-bws-logo"></span>
330 BestWebSoft
331 <span>panel</span>
332 </a>
333 </div>
334 <div class="bws-menu-item-icon">&#8226;&#8226;&#8226;</div>
335 <div class="bws-nav-tab-wrapper">
336 <?php if ( $is_main_page ) { ?>
337 <a class="bws-nav-tab
338 <?php
339 if ( 'bws_panel' === $page ) {
340 echo esc_attr( ' bws-nav-tab-active' );
341 }
342 ?>
343 " href="<?php echo esc_url( self_admin_url( 'admin.php?page=bws_panel' ) ); ?>">
344 <?php
345 esc_html_e( 'Plugins', 'bestwebsoft' );
346 ?>
347 </a>
348 <!-- pls -->
349 <a class="bws-nav-tab
350 <?php
351 if ( 'bws_themes' === $page ) {
352 echo esc_attr( ' bws-nav-tab-active' );
353 }
354 ?>
355 " href="<?php echo esc_url( self_admin_url( 'admin.php?page=bws_themes' ) ); ?>"><?php esc_html_e( 'Themes', 'bestwebsoft' ); ?></a>
356 <a class="bws-nav-tab
357 <?php
358 if ( 'bws_system_status' === $page ) {
359 echo esc_attr( ' bws-nav-tab-active' );
360 }
361 ?>
362 " href="<?php echo esc_url( self_admin_url( 'admin.php?page=bws_system_status' ) ); ?>">
363 <?php
364 esc_html_e( 'System status', 'bestwebsoft' );
365 ?>
366 </a>
367 <?php } else { ?>
368 <a class="bws-nav-tab
369 <?php
370 if ( ! isset( $_GET['tab'] ) ) {
371 echo esc_attr( ' bws-nav-tab-active' );
372 }
373 ?>
374 " href="<?php echo esc_url( self_admin_url( 'admin.php?page=' . $page ) ); ?>">
375 <?php
376 esc_html_e( 'Plugins', 'bestwebsoft' );
377 ?>
378 </a>
379 <a class="bws-nav-tab
380 <?php
381 if ( 'themes' === $tab ) {
382 echo esc_attr( ' bws-nav-tab-active' );
383 }
384 ?>
385 " href="<?php echo esc_url( self_admin_url( 'admin.php?page=' . $page . '&tab=themes' ) ); ?>">
386 <?php
387 esc_html_e( 'Themes', 'bestwebsoft' );
388 ?>
389 </a>
390 <a class="bws-nav-tab
391 <?php
392 if ( 'system-status' === $tab ) {
393 echo esc_attr( ' bws-nav-tab-active' );
394 }
395 ?>
396 " href="<?php echo esc_url( self_admin_url( 'admin.php?page=' . $page . '&tab=system-status' ) ); ?>">
397 <?php
398 esc_html_e( 'System status', 'bestwebsoft' );
399 ?>
400 </a>
401 <?php } ?>
402 </div>
403 <!-- pls -->
404 <div class="bws-help-links-wrapper">
405 <a href="https://support.bestwebsoft.com" target="_blank"><?php esc_html_e( 'Support', 'bestwebsoft' ); ?></a>
406 <a href="https://bestwebsoft.com/client-area" target="_blank" title="<?php esc_html_e( 'Manage purchased licenses & subscriptions', 'bestwebsoft' ); ?>">Client Area</a>
407 </div>
408 <!-- end pls -->
409 <div class="clear"></div>
410 </div>
411 <?php if ( ( 'bws_panel' === $page || ( ! isset( $_GET['tab'] ) && ! $is_main_page ) ) && ! isset( $_POST['bws_plugin_action_submit'] ) ) { ?>
412 <div class="bws-membership-wrap">
413 <div class="bws-membership-backround"></div>
414 <div class="bws-membership">
415 <div class="bws-membership-title"><?php printf( esc_html__( 'Get Access to %s+ Premium Plugins', 'bestwebsoft' ), '30' ); ?></div>
416 <form class="bws-membership-form" method="post" action="">
417 <span class="bws-membership-link"><a target="_blank" href="https://bestwebsoft.com/membership/"><?php esc_html_e( 'Subscribe to Pro Membership', 'bestwebsoft' ); ?></a> <?php esc_html_e( 'or', 'bestwebsoft' ); ?></span>
418 <?php
419 if ( isset( $bstwbsftwppdtplgns_options['go_pro'][ $bws_license_plugin ]['count'] ) &&
420 '5' < $bstwbsftwppdtplgns_options['go_pro'][ $bws_license_plugin ]['count'] &&
421 $bstwbsftwppdtplgns_options['go_pro'][ $bws_license_plugin ]['time'] > ( time() - ( 24 * 60 * 60 ) ) ) {
422 ?>
423 <div class="bws_form_input_wrap">
424 <input disabled="disabled" type="text" name="bws_license_key" value="<?php echo esc_attr( $bws_license_key ); ?>" />
425 <div class="bws_error"><?php esc_html_e( 'Unfortunately, you have exceeded the number of available tries per day.', 'bestwebsoft' ); ?></div>
426 </div>
427 <input disabled="disabled" type="submit" class="bws-button" value="<?php esc_html_e( 'Check license key', 'bestwebsoft' ); ?>" />
428 <?php } else { ?>
429 <div class="bws_form_input_wrap">
430 <input
431 <?php
432 if ( '' !== $error ) {
433 echo 'class="bws_input_error"';
434 }
435 ?>
436 type="text" placeholder="<?php esc_html_e( 'Enter your license key', 'bestwebsoft' ); ?>" maxlength="100" name="bws_license_key" value="<?php echo esc_attr( $bws_license_key ); ?>" />
437 <div class="bws_error"
438 <?php
439 if ( '' === $error ) {
440 echo 'style="display:none"';
441 }
442 ?>
443 ><?php echo esc_html( $error ); ?></div>
444 </div>
445 <input type="hidden" name="bws_license_plugin" value="<?php echo esc_attr( $bws_license_plugin ); ?>" />
446 <input type="hidden" name="bws_license_submit" value="submit" />
447 <?php if ( empty( $plugins_array ) ) { ?>
448 <input type="submit" class="bws-button" value="<?php esc_html_e( 'Activate', 'bestwebsoft' ); ?>" />
449 <?php } else { ?>
450 <input type="submit" class="bws-button" value="<?php esc_html_e( 'Check license key', 'bestwebsoft' ); ?>" />
451 <?php } ?>
452 <?php wp_nonce_field( plugin_basename( __FILE__ ), 'bws_license_nonce_name' ); ?>
453 <?php } ?>
454 </form>
455 <div class="clear"></div>
456 </div>
457 </div>
458 <?php } ?>
459 <!-- end pls -->
460 <div class="bws-wrap-content wrap">
461 <?php if ( 'bws_panel' === $page || ( ! isset( $_GET['tab'] ) && ! $is_main_page ) ) { ?>
462 <div class="updated notice is-dismissible inline"
463 <?php
464 if ( '' === $message || '' !== $error ) {
465 echo 'style="display:none"';
466 }
467 ?>
468 ><p><?php echo esc_html( $message ); ?></p></div>
469 <h1>
470 <?php esc_html_e( 'Plugins', 'bestwebsoft' ); ?>
471 <a href="<?php echo esc_url( self_admin_url( 'plugin-install.php?tab=upload' ) ); ?>" class="upload page-title-action add-new-h2"><?php esc_html_e( 'Upload Plugin', 'bestwebsoft' ); ?></a>
472 </h1>
473 <?php
474 if ( isset( $_GET['error'] ) ) {
475 if ( isset( $_GET['charsout'] ) ) {
476 $errmsg = sprintf( __( 'The plugin generated %d characters of <strong>unexpected output</strong> during activation. If you notice &#8220;headers already sent&#8221; messages, problems with syndication feeds or other issues, try deactivating or removing this plugin.' ), intval( $_GET['charsout'] ) );
477 } else {
478 $errmsg = __( 'Plugin could not be activated because it triggered a <strong>fatal error</strong>.' );
479 }
480 ?>
481 <div id="message" class="error is-dismissible"><p><?php echo wp_kses( $errmsg ); ?></p></div>
482 <?php } elseif ( isset( $_GET['activate'] ) ) { ?>
483 <div id="message" class="updated notice is-dismissible"><p><?php esc_html_e( 'Plugin <strong>activated</strong>.' ); ?></p></div>
484 <?php
485 }
486
487 if ( isset( $_POST['bws_plugin_action_submit'] ) && isset( $_POST['bws_install_plugin'] ) && check_admin_referer( plugin_basename( __FILE__ ), 'bws_license_install_nonce_name' ) ) {
488
489 $bws_license_plugin = sanitize_text_field( wp_unslash( $_POST['bws_install_plugin'] ) );
490
491 $bstwbsftwppdtplgns_options[ $bws_license_plugin ] = $bws_license_key;
492 if ( is_multisite() ) {
493 update_site_option( 'bstwbsftwppdtplgns_options', $bstwbsftwppdtplgns_options );
494 } else {
495 update_option( 'bstwbsftwppdtplgns_options', $bstwbsftwppdtplgns_options );
496 }
497
498 $url = $plugins_array[ $bws_license_plugin ]['link'] . '&download_from=5';
499 ?>
500 <h2><?php esc_html_e( 'Download Pro Plugin', 'bestwebsoft' ); ?></h2>
501 <p>
502 <strong><?php esc_html_e( 'Your Pro plugin is ready', 'bestwebsoft' ); ?></strong>
503 <br>
504 <?php esc_html_e( 'Your plugin has been zipped, and now is ready to download.', 'bestwebsoft' ); ?>
505 </p>
506 <p>
507 <a class="button button-secondary" target="_parent" href="<?php echo esc_url( $url ); ?>"><?php esc_html_e( 'Download Now', 'bestwebsoft' ); ?></a>
508 </p>
509 <br>
510 <p>
511 <strong><?php esc_html_e( 'Need help installing the plugin?', 'bestwebsoft' ); ?></strong>
512 <br>
513 <a target="_blank" href="https://bestwebsoft.com/documentation/how-to-install-a-wordpress-product/how-to-install-a-wordpress-plugin/"><?php esc_html_e( 'How to install WordPress plugin from your admin Dashboard (ZIP archive)', 'bestwebsoft' ); ?></a>
514 </p>
515 <p>
516 <strong><?php esc_html_e( 'Get Started', 'bestwebsoft' ); ?></strong>
517 <br>
518 <a target="_blank" href="https://bestwebsoft.com/documentation/"><?php esc_html_e( 'Documentation', 'bestwebsoft' ); ?></a>
519 <br>
520 <a target="_blank" href="https://www.youtube.com/user/bestwebsoft"><?php esc_html_e( 'Video Instructions', 'bestwebsoft' ); ?></a>
521 <br>
522 <a target="_blank" href="https://support.bestwebsoft.com"><?php esc_html_e( 'Knowledge Base', 'bestwebsoft' ); ?></a>
523 </p>
524 <p>
525 <strong><?php esc_html_e( 'Licenses & Domains', 'bestwebsoft' ); ?></strong>
526 <br>
527 <?php
528 printf(
529 'Manage your license(-s) and change domain names using the %s at BestWebSoft.',
530 '<a target="_blank" href="https://bestwebsoft.com/client-area">' . esc_html__( 'Client Area', 'bestwebsoft' ) . '</a>'
531 );
532 ?>
533 </p>
534 <p><a href="<?php echo esc_url( self_admin_url( $current_page ) ); ?>" target="_parent"><?php esc_html_e( 'Return to BestWebSoft Panel', 'bestwebsoft' ); ?></a></p>
535 <?php
536 } else {
537 $category_href = $current_page;
538 if ( 'all' !== $plugin_category ) {
539 $category_href .= '&category=' . $plugin_category;
540 }
541 ?>
542 <ul class="subsubsub">
543 <li>
544 <a
545 <?php
546 if ( ! isset( $_GET['sub'] ) ) {
547 echo 'class="current" ';
548 }
549 ?>
550 href="<?php echo esc_url( self_admin_url( $category_href ) ); ?>"><?php esc_html_e( 'All', 'bestwebsoft' ); ?></a>
551 </li> |
552 <li>
553 <a
554 <?php
555 if ( isset( $_GET['sub'] ) && 'installed' === sanitize_text_field( wp_unslash( $_GET['sub'] ) ) ) {
556 echo 'class="current" ';
557 }
558 ?>
559 href="<?php echo esc_url( self_admin_url( $category_href . '&sub=installed' ) ); ?>"><?php esc_html_e( 'Installed', 'bestwebsoft' ); ?></a>
560 </li> |
561 <li>
562 <a
563 <?php
564 if ( isset( $_GET['sub'] ) && 'not_installed' === sanitize_text_field( wp_unslash( $_GET['sub'] ) ) ) {
565 echo 'class="current" ';
566 }
567 ?>
568 href="<?php echo esc_url( self_admin_url( $category_href . '&sub=not_installed' ) ); ?>"><?php esc_html_e( 'Not Installed', 'bestwebsoft' ); ?></a>
569 </li>
570 </ul>
571 <div class="clear"></div>
572 <div class="bws-filter-top">
573 <h2>
574 <span class="bws-toggle-indicator"></span>
575 <?php esc_html_e( 'Filter results', 'bestwebsoft' ); ?>
576 </h2>
577 <div class="bws-filter-top-inside">
578 <div class="bws-filter-title"><?php esc_html_e( 'Category', 'bestwebsoft' ); ?></div>
579 <ul class="bws-category">
580 <li>
581 <?php $sub_in_url = ( isset( $_GET['sub'] ) && in_array( sanitize_text_field( wp_unslash( $_GET['sub'] ) ), array( 'installed', 'not_installed' ) ) ) ? '&sub=' . sanitize_text_field( wp_unslash( $_GET['sub'] ) ) : ''; ?>
582 <a
583 <?php
584 if ( 'all' === $plugin_category ) {
585 echo ' class="bws-active"';
586 }
587 ?>
588 href="<?php echo esc_url( self_admin_url( $current_page . $sub_in_url ) ); ?>"><?php esc_html_e( 'All', 'bestwebsoft' ); ?>
589 <span>(<?php echo count( $bws_plugins ); ?>)</span>
590 </a>
591 </li>
592 <?php foreach ( $bws_plugins_category as $category_key => $category_value ) { ?>
593 <li>
594 <a
595 <?php
596 if ( $category_key === $plugin_category ) {
597 echo ' class="bws-active"';
598 }
599 ?>
600 href="<?php echo esc_url( self_admin_url( $current_page . $sub_in_url . '&category=' . $category_key ) ); ?>"><?php echo esc_html( $category_value['name'] ); ?>
601 <span>(<?php echo absint( $category_value['count'] ); ?>)</span>
602 </a>
603 </li>
604 <?php } ?>
605 </ul>
606 </div>
607 </div>
608 <div class="bws-products">
609 <?php
610 $nothing_found = true;
611 foreach ( $bws_plugins as $key_plugin => $value_plugin ) {
612
613 if ( 'all' !== $plugin_category && isset( $bws_plugins_category[ $plugin_category ] ) && ! in_array( $plugin_category, $value_plugin['category'] ) ) {
614 continue;
615 }
616
617 $key_plugin_explode = explode( '/', $key_plugin );
618 if ( in_array( $key_plugin_explode[0], array( 'car-rental', 'contact-form-multi', 'custom-admin-page', 'adsense-plugin', 'zendesk-help-center', 'bws-adsense' ) ) ) {
619 $icon = isset( $value_plugin['icon'] ) ? $value_plugin['icon'] : '//ps.w.org/' . $key_plugin_explode[0] . '/assets/icon-256x256.png';
620 } else {
621 $icon = isset( $value_plugin['icon'] ) ? $value_plugin['icon'] : '//ps.w.org/' . $key_plugin_explode[0] . '/assets/icon-256x256.gif';
622 }
623
624 $is_pro_isset = isset( $value_plugin['pro_version'] );
625 $is_installed = array_key_exists( $key_plugin, $all_plugins );
626 $is_active = in_array( $key_plugin, $active_plugins ) || isset( $sitewide_active_plugins[ $key_plugin ] );
627
628 $is_pro_installed = $is_pro_active = false;
629 if ( $is_pro_isset ) {
630 $is_pro_installed = array_key_exists( $value_plugin['pro_version'], $all_plugins );
631 $is_pro_active = in_array( $value_plugin['pro_version'], $active_plugins ) || isset( $sitewide_active_plugins[ $value_plugin['pro_version'] ] );
632 }
633
634 if ( ( isset( $_GET['sub'] ) && 'installed' === sanitize_text_field( wp_unslash( $_GET['sub'] ) ) && ! $is_pro_installed && ! $is_installed ) ||
635 ( isset( $_GET['sub'] ) && 'not_installed' === sanitize_text_field( wp_unslash( $_GET['sub'] ) ) && ( $is_pro_installed || $is_installed ) ) ) {
636 continue;
637 }
638
639 if ( is_multisite() ) {
640 $link_attr = isset( $value_plugin['install_url'] ) ? 'href="' . esc_url( $value_plugin['install_url'] ) . '" target="_blank"' : 'href="' . esc_url( network_admin_url( 'plugin-install.php?tab=plugin-information&plugin=' . $key_plugin_explode[0] . '&from=import&TB_iframe=true&width=600&height=550' ) ) . '" class="thickbox open-plugin-details-modal"';
641 } else {
642 $link_attr = isset( $value_plugin['install_url'] ) ? 'href="' . esc_url( $value_plugin['install_url'] ) . '" target="_blank"' : 'href="' . esc_url( self_admin_url( 'plugin-install.php?tab=plugin-information&plugin=' . $key_plugin_explode[0] . '&from=import&TB_iframe=true&width=600&height=550' ) ) . '" class="thickbox open-plugin-details-modal"';
643 }
644
645 $nothing_found = false;
646 ?>
647 <div class="bws_product_box
648 <?php
649 if ( $is_active || $is_pro_active ) {
650 echo esc_attr( ' bws_product_active' );
651 }
652 ?>
653 ">
654 <div class="bws_product_image">
655 <a <?php echo wp_kses_data( $link_attr ); ?>><img src="<?php echo esc_url( $icon ); ?>"/></a>
656 </div>
657 <div class="bws_product_content">
658 <div class="bws_product_title"><a <?php echo wp_kses_data( $link_attr ); ?>><?php echo esc_html( $value_plugin['name'] ); ?></a></div>
659 <div class="bws-version">
660 <?php
661 if ( $is_pro_installed ) {
662 echo '<span';
663 if ( ! empty( $value_plugin['expired'] ) || ! empty( $value_plugin['update_availible'] ) ) {
664 echo ' class="bws-update-available"';
665 }
666 echo '>v ' . esc_attr( $all_plugins[ $value_plugin['pro_version'] ]['Version'] ) . '</span>';
667 } elseif ( $is_installed ) {
668 echo '<span';
669 if ( ! empty( $value_plugin['expired'] ) || ! empty( $value_plugin['update_availible'] ) ) {
670 echo ' class="bws-update-available"';
671 }
672 echo '>v ' . esc_attr( $all_plugins[ $key_plugin ]['Version'] ) . '</span>';
673 } else {
674 echo '<span>' . esc_html__( 'Not installed', 'bestwebsoft' ) . '</span>';
675 }
676
677 if ( ! empty( $value_plugin['expired'] ) ) {
678 echo ' - <a class="bws-update-now" href="https://support.bestwebsoft.com/hc/en-us/articles/202356359" target="_blank">' . esc_html__( 'Renew to get updates', 'bestwebsoft' ) . '</a>';
679 } elseif ( ! empty( $value_plugin['update_availible'] ) ) {
680 $r = $update_availible_all->response[ $value_plugin['update_availible'] ];
681 echo ' - <a class="bws-update-now" href="' . esc_url( wp_nonce_url( self_admin_url( 'update.php?action=upgrade-plugin&plugin=' . $value_plugin['update_availible'] ), 'upgrade-plugin_' . $value_plugin['update_availible'] ) ) . '" class="update-link" aria-label="' . sprintf( esc_html__( 'Update to v %s', 'bestwebsoft' ), esc_attr( $r->new_version ) ) . '">' . sprintf( esc_html__( 'Update to v %s', 'bestwebsoft' ), esc_html( $r->new_version ) ) . '</a>';
682 }
683 ?>
684 </div>
685 <div class="bws_product_description">
686 <?php echo esc_html( strlen( $value_plugin['description'] ) > 100 ? mb_substr( $value_plugin['description'], 0, 100 ) . '...' : $value_plugin['description'] ); ?>
687 </div>
688 <div class="bws_product_links">
689 <?php
690 if ( $is_active || $is_pro_active ) {
691 if ( $is_pro_isset ) {
692 if ( ! $is_pro_installed ) {
693 if ( ! empty( $plugins_array ) && array_key_exists( $value_plugin['pro_version'], $plugins_array ) ) {
694 ?>
695 <form method="post" action="">
696 <input type="submit" class="button button-secondary" value="<?php esc_html_e( 'Get Pro', 'bestwebsoft' ); ?>" />
697 <input type="hidden" name="bws_plugin_action_submit" value="submit" />
698 <input type="hidden" name="bws_install_plugin" value="<?php echo esc_attr( $value_plugin['pro_version'] ); ?>" />
699 <?php wp_nonce_field( plugin_basename( __FILE__ ), 'bws_license_install_nonce_name' ); ?>
700 </form>
701 <?php } else { ?>
702 <a class="button button-secondary bws_upgrade_button" href="<?php echo esc_url( $bws_plugins[ $key_plugin ]['purchase'] ); ?>" target="_blank"><?php esc_html_e( 'Upgrade to Pro', 'bestwebsoft' ); ?></a>
703 <?php
704 }
705 }
706 } else {
707 ?>
708 <a class="bws_donate" href="https://bestwebsoft.com/donate/" target="_blank"><?php esc_html_e( 'Donate', 'bestwebsoft' ); ?></a> <span>|</span>
709 <?php
710 }
711
712 if ( $is_pro_active ) {
713 ?>
714 <a class="bws_settings" href="<?php echo esc_url( self_admin_url( $bws_plugins[ $key_plugin ]['pro_settings'] ) ); ?>"><?php esc_html_e( 'Settings', 'bestwebsoft' ); ?></a>
715 <?php } else { ?>
716 <a class="bws_settings" href="<?php echo esc_url( self_admin_url( $bws_plugins[ $key_plugin ]['settings'] ) ); ?>"><?php esc_html_e( 'Settings', 'bestwebsoft' ); ?></a>
717 <?php
718 }
719 } else {
720 if ( $is_pro_installed ) {
721 ?>
722 <a class="button button-secondary" href="<?php echo esc_url( wp_nonce_url( self_admin_url( $current_page . '&bws_activate_plugin=' . $value_plugin['pro_version'] ), 'bws_activate_plugin' . $value_plugin['pro_version'] ) ); ?>" title="<?php esc_html_e( 'Activate this plugin', 'bestwebsoft' ); ?>"><?php esc_html_e( 'Activate', 'bestwebsoft' ); ?></a>
723 <?php } elseif ( ! empty( $plugins_array ) && isset( $value_plugin['pro_version'] ) && array_key_exists( $value_plugin['pro_version'], $plugins_array ) ) { ?>
724 <form method="post" action="">
725 <input type="submit" class="button button-secondary" value="<?php esc_html_e( 'Get Pro', 'bestwebsoft' ); ?>" />
726 <input type="hidden" name="bws_plugin_action_submit" value="submit" />
727 <input type="hidden" name="bws_install_plugin" value="<?php echo esc_url( $value_plugin['pro_version'] ); ?>" />
728 <?php wp_nonce_field( plugin_basename( __FILE__ ), 'bws_license_install_nonce_name' ); ?>
729 </form>
730 <?php } elseif ( $is_installed ) { ?>
731 <a class="button button-secondary" href="<?php echo esc_url( wp_nonce_url( self_admin_url( $current_page . '&bws_activate_plugin=' . $key_plugin ), 'bws_activate_plugin' . $key_plugin ) ); ?>" title="<?php esc_html_e( 'Activate this plugin', 'bestwebsoft' ); ?>"><?php esc_html_e( 'Activate', 'bestwebsoft' ); ?></a>
732 <?php
733 } else {
734 $install_url = isset( $value_plugin['install_url'] ) ? $value_plugin['install_url'] : network_admin_url( 'plugin-install.php?tab=search&type=term&s=' . str_replace( array( ' ', '-' ), '+', str_replace( '&', '', $value_plugin['name'] ) ) . '+BestWebSoft&plugin-search-input=Search+Plugins' );
735 ?>
736 <a class="button button-secondary" href="<?php echo esc_url( $install_url ); ?>" title="<?php esc_html_e( 'Install this plugin', 'bestwebsoft' ); ?>" target="_blank"><?php esc_html_e( 'Install Now', 'bestwebsoft' ); ?></a>
737 <?php
738 }
739 }
740 ?>
741 </div>
742 </div>
743 <div class="clear"></div>
744 </div>
745 <?php
746 }
747 if ( $nothing_found ) {
748 ?>
749 <p class="description"><?php esc_html_e( 'Nothing found. Try another criteria.', 'bestwebsoft' ); ?></p>
750 <?php } ?>
751 </div>
752 <div id="bws-filter-wrapper">
753 <div class="bws-filter">
754 <div class="bws-filter-title"><?php esc_html_e( 'Category', 'bestwebsoft' ); ?></div>
755 <ul class="bws-category">
756 <li>
757 <?php $sub_in_url = ( isset( $_GET['sub'] ) && in_array( sanitize_text_field( wp_unslash( $_GET['sub'] ) ), array( 'installed', 'not_installed' ) ) ) ? '&sub=' . sanitize_text_field( wp_unslash( $_GET['sub'] ) ) : ''; ?>
758 <a
759 <?php
760 if ( 'all' === $plugin_category ) {
761 echo ' class="bws-active"';
762 }
763 ?>
764 href="<?php echo esc_url( self_admin_url( $current_page . $sub_in_url ) ); ?>"><?php esc_html_e( 'All', 'bestwebsoft' ); ?>
765 <span>(<?php echo count( $bws_plugins ); ?>)</span>
766 </a>
767 </li>
768 <?php foreach ( $bws_plugins_category as $category_key => $category_value ) { ?>
769 <li>
770 <a
771 <?php
772 if ( $category_key === $plugin_category ) {
773 echo ' class="bws-active"';
774 }
775 ?>
776 href="<?php echo esc_url( self_admin_url( $current_page . $sub_in_url . '&category=' . $category_key ) ); ?>"><?php echo esc_html( $category_value['name'] ); ?>
777 <span>(<?php echo absint( $category_value['count'] ); ?>)</span>
778 </a>
779 </li>
780 <?php } ?>
781 </ul>
782 </div>
783 </div><!-- #bws-filter-wrapper -->
784 <div class="clear"></div>
785 <?php
786 }
787 } elseif ( 'bws_themes' === $page || 'themes' === $tab ) {
788 require dirname( __FILE__ ) . '/product_list.php';
789 ?>
790 <h1><?php esc_html_e( 'Themes', 'bestwebsoft' ); ?></h1>
791 <div id="availablethemes" class="bws-availablethemes">
792 <div class="theme-browser content-filterable rendered">
793 <div class="themes wp-clearfix">
794 <?php
795 foreach ( $themes as $key => $theme ) {
796 $installed_theme = wp_get_theme( $theme->slug );
797 ?>
798 <div class="theme" tabindex="0">
799 <div class="theme-screenshot">
800 <img src="<?php echo esc_url( bws_menu_url( 'icons/themes/' ) . $theme->slug . '.png' ); ?>" alt="" />
801 </div>
802 <div class="theme-author"><?php printf( esc_html__( 'By %s', 'bestwebsoft' ), 'BestWebSoft' ); ?></div>
803 <h3 class="theme-name"><?php echo esc_html( $theme->name ); ?></h3>
804 <div class="theme-actions">
805 <a class="button button-secondary preview install-theme-preview" href="<?php echo esc_url( $theme->href ); ?>" target="_blank"><?php esc_html_e( 'Learn More', 'bestwebsoft' ); ?></a>
806 </div>
807 <?php
808 if ( $installed_theme->exists() ) {
809 if ( $wp_version < '4.6' ) {
810 ?>
811 <div class="theme-installed"><?php esc_html_e( 'Already Installed', 'bestwebsoft' ); ?></div>
812 <?php } else { ?>
813 <div class="notice notice-success notice-alt inline"><p><?php esc_html_e( 'Installed', 'bestwebsoft' ); ?></p></div>
814 <?php
815 }
816 }
817 ?>
818 </div>
819 <?php } ?>
820 <br class="clear" />
821 </div>
822 </div>
823 <p><a class="bws_browse_link" href="https://bestwebsoft.com/products/wordpress/themes/" target="_blank"><?php esc_html_e( 'Browse More WordPress Themes', 'bestwebsoft' ); ?> <span class="dashicons dashicons-arrow-right-alt2"></span></a></p>
824 </div>
825 <?php } elseif ( 'bws_system_status' === $page || 'system-status' === $tab ) { ?>
826 <h1><?php esc_html_e( 'System status', 'bestwebsoft' ); ?></h1>
827 <div class="updated fade notice is-dismissible inline"
828 <?php
829 if ( ! ( isset( $_REQUEST['bwsmn_form_submit'] ) || isset( $_REQUEST['bwsmn_form_submit_custom_email'] ) ) || '' !== $error ) {
830 echo 'style="display:none"';
831 }
832 ?>
833 ><p><strong><?php echo esc_html( $message ); ?></strong></p></div>
834 <div class="error"
835 <?php
836 if ( '' === $error ) {
837 echo 'style="display:none"';
838 }
839 ?>
840 ><p><strong><?php echo esc_html( $error ); ?></strong></p></div>
841 <form method="post" action="">
842 <p>
843 <input type="hidden" name="bwsmn_form_submit" value="submit" />
844 <input type="submit" class="button-primary" value="<?php esc_html_e( 'Send to support', 'bestwebsoft' ); ?>" />
845 <?php wp_nonce_field( plugin_basename( __FILE__ ), 'bwsmn_nonce_submit' ); ?>
846 </p>
847 </form>
848 <form method="post" action="">
849 <p>
850 <input type="hidden" name="bwsmn_form_submit_custom_email" value="submit" />
851 <input type="submit" class="button" value="<?php esc_html_e( 'Send to custom email &#187;', 'bestwebsoft' ); ?>" />
852 <input type="text" maxlength="250" value="" name="bwsmn_form_email" />
853 <?php wp_nonce_field( plugin_basename( __FILE__ ), 'bwsmn_nonce_submit_custom_email' ); ?>
854 </p>
855 </form>
856 <?php foreach ( $system_info as $info ) { ?>
857 <table class="widefat bws-system-info" cellspacing="0">
858 <thead>
859 <tr>
860 <th colspan="2">
861 <strong>
862 <?php
863 echo esc_html( $info['name'] );
864 if ( isset( $info['count'] ) ) {
865 echo ' (' . intval( $info['count'] ) . ')';
866 }
867 ?>
868 </strong>
869 </th>
870 </tr>
871 </thead>
872 <tbody>
873 <?php foreach ( $info['data'] as $key => $value ) { ?>
874 <tr>
875 <td scope="row"><?php echo esc_attr( $key ); ?></td>
876 <td scope="row"><?php echo esc_html( $value ); ?></td>
877 </tr>
878 <?php } ?>
879 </tbody>
880 </table>
881 <?php
882 }
883 }
884 ?>
885 </div>
886 </div>
887 <?php
888 }
889 }
890
891 if ( ! function_exists( 'bws_get_banner_array' ) ) {
892 /**
893 * Get banner array
894 */
895 function bws_get_banner_array() {
896 global $bstwbsftwppdtplgns_banner_array;
897 $bstwbsftwppdtplgns_banner_array = array(
898 array( 'gglstpvrfctn_hide_banner_on_plugin_page', 'bws-google-2-step-verification/bws-google-2-step-verification.php', '1.0.0' ),
899 array( 'sclbttns_hide_banner_on_plugin_page', 'social-buttons-pack/social-buttons-pack.php', '1.1.0' ),
900 array( 'tmsht_hide_banner_on_plugin_page', 'timesheet/timesheet.php', '0.1.3' ),
901 array( 'pgntn_hide_banner_on_plugin_page', 'pagination/pagination.php', '1.0.6' ),
902 array( 'crrntl_hide_banner_on_plugin_page', 'car-rental/car-rental.php', '1.0.0' ),
903 array( 'lnkdn_hide_banner_on_plugin_page', 'bws-linkedin/bws-linkedin.php', '1.0.1' ),
904 array( 'pntrst_hide_banner_on_plugin_page', 'bws-pinterest/bws-pinterest.php', '1.0.1' ),
905 array( 'zndskhc_hide_banner_on_plugin_page', 'zendesk-help-center/zendesk-help-center.php', '1.0.0' ),
906 array( 'gglcptch_hide_banner_on_plugin_page', 'google-captcha/google-captcha.php', '1.18' ),
907 array( 'mltlngg_hide_banner_on_plugin_page', 'multilanguage/multilanguage.php', '1.1.1' ),
908 array( 'adsns_hide_banner_on_plugin_page', 'bws-adsense/bws-adsense.php', '1.36' ),
909 array( 'vstrsnln_hide_banner_on_plugin_page', 'visitors-online/visitors-online.php', '0.2' ),
910 array( 'cstmsrch_hide_banner_on_plugin_page', 'custom-search-plugin/custom-search-plugin.php', '1.28' ),
911 array( 'prtfl_hide_banner_on_plugin_page', 'portfolio/portfolio.php', '2.33' ),
912 array( 'rlt_hide_banner_on_plugin_page', 'realty/realty.php', '1.0.0' ),
913 array( 'prmbr_hide_banner_on_plugin_page', 'promobar/promobar.php', '1.0.0' ),
914 array( 'gglnltcs_hide_banner_on_plugin_page', 'bws-google-analytics/bws-google-analytics.php', '1.6.2' ),
915 array( 'htccss_hide_banner_on_plugin_page', 'htaccess/htaccess.php', '1.6.3' ),
916 array( 'sbscrbr_hide_banner_on_plugin_page', 'subscriber/subscriber.php', '1.1.8' ),
917 array( 'lmtttmpts_hide_banner_on_plugin_page', 'limit-attempts/limit-attempts.php', '1.0.2' ),
918 array( 'sndr_hide_banner_on_plugin_page', 'sender/sender.php', '0.5' ),
919 array( 'srrl_hide_banner_on_plugin_page', 'user-role/user-role.php', '1.4' ),
920 array( 'pdtr_hide_banner_on_plugin_page', 'updater/updater.php', '1.12' ),
921 array( 'cntctfrmtdb_hide_banner_on_plugin_page', 'contact-form-to-db/contact_form_to_db.php', '1.2' ),
922 array( 'cntctfrmmlt_hide_banner_on_plugin_page', 'contact-form-multi/contact-form-multi.php', '1.0.7' ),
923 array( 'gglmps_hide_banner_on_plugin_page', 'bws-google-maps/bws-google-maps.php', '1.2' ),
924 array( 'fcbkbttn_hide_banner_on_plugin_page', 'facebook-button-plugin/facebook-button-plugin.php', '2.29' ),
925 array( 'twttr_hide_banner_on_plugin_page', 'twitter-plugin/twitter.php', '2.34' ),
926 array( 'pdfprnt_hide_banner_on_plugin_page', 'pdf-print/pdf-print.php', '1.7.1' ),
927 array( 'gglstmp_hide_banner_on_plugin_page', 'google-sitemap-plugin/google-sitemap-plugin.php', '2.8.4' ),
928 array( 'cntctfrmpr_for_ctfrmtdb_hide_banner_on_plugin_page', 'contact-form-pro/contact_form_pro.php', '1.14' ),
929 array( 'cntctfrm_hide_banner_on_plugin_page', 'contact-form-plugin/contact_form.php', '3.47' ),
930 array( 'cptch_hide_banner_on_plugin_page', 'captcha-bws/captcha-bws.php', '3.8.4' ),
931 array( 'gllr_hide_banner_on_plugin_page', 'gallery-plugin/gallery-plugin.php', '3.9.1' ),
932 array( 'cntctfrm_for_ctfrmtdb_hide_banner_on_plugin_page', 'contact-form-plugin/contact_form.php', '3.62' ),
933 array( 'bwscrrntl_hide_banner_on_plugin_page', 'bws-car-rental/bws-car-rental.php', '0.0.1' ),
934 array( 'rtng_hide_banner_on_plugin_page', 'rating-bws/rating-bws.php', '1.0.0' ),
935 array( 'prflxtrflds_hide_banner_on_plugin_page', 'profile-extra-fields/profile-extra-fields.php', '1.1.3' ),
936 array( 'psttcsv_hide_banner_on_plugin_page', 'post-to-csv/post-to-csv.php', '1.3.4' ),
937 array( 'cstmdmnpg_hide_banner_on_plugin_page', 'custom-admin-page/custom-admin-page.php', '1.0.0' ),
938 );
939 }
940 }
941