Version Description
- 03.03.2017 =
- Bugfix : The bug with selecting language via BWS Shortcode button was fixed.
- Bugfix : The bug with enabling/disabling Captcha on the plugin additional settings page was fixed.
- Update : BWS Panel section was updated.
Download this release
Release Info
Developer | bestwebsoft |
Plugin | Contact Form by BestWebSoft |
Version | 4.0.5 |
Comparing to | |
See all releases |
Code changes from version 4.0.4 to 4.0.5
- bws_menu/bws_functions.php +197 -752
- bws_menu/bws_menu.php +141 -130
- bws_menu/class-bws-settings.php +1077 -0
- bws_menu/css/codemirror.css +1 -0
- bws_menu/css/general_style.css +425 -140
- bws_menu/css/style.css +15 -25
- bws_menu/deprecated.php +717 -0
- bws_menu/fonts/bwsicons.eot +0 -0
- bws_menu/fonts/bwsicons.svg +71 -0
- bws_menu/fonts/bwsicons.ttf +0 -0
- bws_menu/fonts/bwsicons.woff +0 -0
- bws_menu/images/bestwebsoft-logo-white.svg +0 -29
- bws_menu/images/logo-white-min.png +0 -0
- bws_menu/images/pattern.png +0 -0
- bws_menu/images/pattern_bg.png +0 -0
- bws_menu/images/shortcode-icon.png +0 -0
- bws_menu/js/codemirror.js +0 -0
- bws_menu/js/general_script.js +118 -3
- bws_menu/js/shortcode-button.js +2 -2
- bws_menu/languages/bestwebsoft-cs_CZ.mo +0 -0
- bws_menu/languages/bestwebsoft-cs_CZ.po +1330 -0
- bws_menu/languages/bestwebsoft-fr_FR.mo +0 -0
- bws_menu/languages/bestwebsoft-fr_FR.po +910 -648
- bws_menu/languages/bestwebsoft-pl_PL.mo +0 -0
- bws_menu/languages/bestwebsoft-pl_PL.po +865 -613
- bws_menu/languages/bestwebsoft-ru_RU.mo +0 -0
- bws_menu/languages/bestwebsoft-ru_RU.po +778 -547
- bws_menu/languages/bestwebsoft-uk.mo +0 -0
- bws_menu/languages/bestwebsoft-uk.po +778 -547
- bws_menu/product_list.php +98 -91
- contact_form.php +280 -210
- css/form_style.css +7 -1
- css/style.css +45 -31
- images/tooltip_attachment_tips.png +0 -0
- includes/deprecated.php +3 -3
- js/script.js +2 -0
- languages/contact-form-plugin-af_ZA.mo +0 -0
- languages/contact-form-plugin-af_ZA.po +227 -223
- languages/contact-form-plugin-ca.mo +0 -0
- languages/contact-form-plugin-ca.po +227 -227
- languages/contact-form-plugin-cs_CZ.mo +0 -0
- languages/contact-form-plugin-cs_CZ.po +232 -228
- languages/contact-form-plugin-da_DK.mo +0 -0
- languages/contact-form-plugin-da_DK.po +233 -226
- languages/contact-form-plugin-de_DE.mo +0 -0
- languages/contact-form-plugin-de_DE.po +228 -227
- languages/contact-form-plugin-el.mo +0 -0
- languages/contact-form-plugin-el.po +234 -227
- languages/contact-form-plugin-es_ES.mo +0 -0
- languages/contact-form-plugin-es_ES.po +232 -227
- languages/contact-form-plugin-et.mo +0 -0
- languages/contact-form-plugin-et.po +233 -229
- languages/contact-form-plugin-fr_FR.mo +0 -0
- languages/contact-form-plugin-fr_FR.po +232 -230
- languages/contact-form-plugin-ja.mo +0 -0
- languages/contact-form-plugin-ja.po +233 -226
- languages/contact-form-plugin-nb_NO.mo +0 -0
- languages/contact-form-plugin-nb_NO.po +112 -114
bws_menu/bws_functions.php
CHANGED
@@ -3,6 +3,8 @@
|
|
3 |
* General functions for BestWebSoft plugins
|
4 |
*/
|
5 |
|
|
|
|
|
6 |
/**
|
7 |
* Function to add 'bestwebsoft' slug for BWS_Menu MO file if BWS_Menu loaded from theme.
|
8 |
*
|
@@ -29,50 +31,23 @@ if ( isset( $bws_menu_source ) && 'themes' == $bws_menu_source ) {
|
|
29 |
}
|
30 |
|
31 |
/**
|
32 |
-
* Function
|
33 |
-
*
|
34 |
-
|
35 |
-
|
36 |
-
|
37 |
-
|
38 |
-
|
39 |
-
|
40 |
-
|
41 |
-
/**
|
42 |
-
* Function add BWS Plugins page
|
43 |
-
* @return void
|
44 |
-
*/
|
45 |
-
if ( ! function_exists ( 'bws_general_menu' ) ) {
|
46 |
-
function bws_general_menu() {
|
47 |
-
global $menu, $bws_general_menu_exist;
|
48 |
-
|
49 |
-
if ( ! $bws_general_menu_exist ) {
|
50 |
-
/* we check also menu exist in global array as in old plugins $bws_general_menu_exist variable not exist */
|
51 |
-
foreach ( $menu as $value_menu ) {
|
52 |
-
if ( 'bws_panel' == $value_menu[2] ) {
|
53 |
-
$bws_general_menu_exist = true;
|
54 |
-
return;
|
55 |
-
}
|
56 |
-
}
|
57 |
-
|
58 |
-
add_menu_page( 'BWS Panel', 'BWS Panel', 'manage_options', 'bws_panel', 'bws_add_menu_render', bws_menu_url( 'images/logo-white-min.png' ), '1001' );
|
59 |
-
|
60 |
-
add_submenu_page( 'bws_panel', __( 'Plugins', 'bestwebsoft' ), __( 'Plugins', 'bestwebsoft' ), 'manage_options', 'bws_panel', 'bws_add_menu_render' );
|
61 |
-
add_submenu_page( 'bws_panel', __( 'Themes', 'bestwebsoft' ), __( 'Themes', 'bestwebsoft' ), 'manage_options', 'bws_themes', 'bws_add_menu_render' );
|
62 |
-
add_submenu_page( 'bws_panel', __( 'System Status', 'bestwebsoft' ), __( 'System Status', 'bestwebsoft' ), 'manage_options', 'bws_system_status', 'bws_add_menu_render' );
|
63 |
-
|
64 |
-
$bws_general_menu_exist = true;
|
65 |
}
|
66 |
-
}
|
67 |
-
|
|
|
|
|
|
|
68 |
|
69 |
-
|
70 |
-
|
71 |
-
* @deprecated 1.7.4
|
72 |
-
*/
|
73 |
-
if ( ! function_exists ( 'bws_wp_version_check' ) ) {
|
74 |
-
function bws_wp_version_check( $plugin_basename, $plugin_info, $require_wp ) {
|
75 |
-
bws_wp_min_version_check( $plugin_basename, $plugin_info, '3.8' , $require_wp );
|
76 |
}
|
77 |
}
|
78 |
|
@@ -109,9 +84,101 @@ if ( ! function_exists ( 'bws_wp_min_version_check' ) ) {
|
|
109 |
}
|
110 |
}
|
111 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
112 |
if ( ! function_exists( 'bws_admin_notices' ) ) {
|
113 |
function bws_admin_notices() {
|
114 |
-
global $bws_versions_notice_array, $bws_plugin_banner_to_settings;
|
115 |
|
116 |
/* versions notice */
|
117 |
if ( ! empty( $bws_versions_notice_array ) ) {
|
@@ -185,6 +252,34 @@ if ( ! function_exists( 'bws_admin_notices' ) ) {
|
|
185 |
</div>
|
186 |
<?php }
|
187 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
188 |
}
|
189 |
}
|
190 |
|
@@ -241,7 +336,7 @@ if ( ! function_exists( 'bws_plugin_banner' ) ) {
|
|
241 |
<span><?php _e( 'Extend standard plugin functionality with new great options.', 'bestwebsoft' ); ?></span>
|
242 |
</div>
|
243 |
<div class="button_div">
|
244 |
-
<a class="button" target="_blank" href="
|
245 |
</div>
|
246 |
</div>
|
247 |
</div>
|
@@ -254,510 +349,6 @@ if ( ! function_exists( 'bws_plugin_banner' ) ) {
|
|
254 |
}
|
255 |
}
|
256 |
|
257 |
-
if ( ! function_exists( 'bws_plugin_reviews_block' ) ) {
|
258 |
-
function bws_plugin_reviews_block( $plugin_name, $plugin_slug ) { ?>
|
259 |
-
<div class="bws-plugin-reviews">
|
260 |
-
<div class="bws-plugin-reviews-rate">
|
261 |
-
<?php _e( 'If you enjoy our plugin, please give it 5 stars on WordPress', 'bestwebsoft' ); ?>:
|
262 |
-
<a href="http://wordpress.org/support/view/plugin-reviews/<?php echo $plugin_slug; ?>?filter=5" target="_blank" title="<?php echo $plugin_name; ?> reviews"><?php _e( 'Rate the plugin', 'bestwebsoft' ); ?></a>
|
263 |
-
</div>
|
264 |
-
<div class="bws-plugin-reviews-support">
|
265 |
-
<?php _e( 'If there is something wrong about it, please contact us', 'bestwebsoft' ); ?>:
|
266 |
-
<a href="http://support.bestwebsoft.com">http://support.bestwebsoft.com</a>
|
267 |
-
</div>
|
268 |
-
<div class="bws-plugin-reviews-donate">
|
269 |
-
<?php _e( 'Donations play an important role in supporting great projects', 'bestwebsoft' ); ?>:
|
270 |
-
<a href="http://bestwebsoft.com/donate/">Donate</a>
|
271 |
-
</div>
|
272 |
-
</div>
|
273 |
-
<?php }
|
274 |
-
}
|
275 |
-
|
276 |
-
if ( ! function_exists( 'bws_go_pro_tab_check' ) ) {
|
277 |
-
function bws_go_pro_tab_check( $plugin_basename, $plugin_options_name = false, $is_network_option = false ) {
|
278 |
-
global $wp_version, $bstwbsftwppdtplgns_options;
|
279 |
-
$result = array();
|
280 |
-
|
281 |
-
$bws_license_key = ( isset( $_POST['bws_license_key'] ) ) ? stripslashes( esc_html( trim( $_POST['bws_license_key'] ) ) ) : "";
|
282 |
-
|
283 |
-
if ( ! empty( $plugin_options_name ) && isset( $_POST['bws_hide_premium_options_submit'] ) && check_admin_referer( $plugin_basename, 'bws_license_nonce_name' ) ) {
|
284 |
-
|
285 |
-
$plugin_options = ( $is_network_option ) ? get_site_option( $plugin_options_name ) : get_option( $plugin_options_name );
|
286 |
-
|
287 |
-
if ( !empty( $plugin_options['hide_premium_options'] ) ) {
|
288 |
-
|
289 |
-
$key = array_search( get_current_user_id(), $plugin_options['hide_premium_options'] );
|
290 |
-
if ( false !== $key ) {
|
291 |
-
unset( $plugin_options['hide_premium_options'][ $key ] );
|
292 |
-
}
|
293 |
-
|
294 |
-
if ( $is_network_option )
|
295 |
-
update_site_option( $plugin_options_name, $plugin_options );
|
296 |
-
else
|
297 |
-
update_option( $plugin_options_name, $plugin_options );
|
298 |
-
|
299 |
-
$result['message'] = __( 'Check premium options on the plugin settings page!', 'bestwebsoft' );
|
300 |
-
}
|
301 |
-
}
|
302 |
-
|
303 |
-
if ( isset( $_POST['bws_license_submit'] ) && check_admin_referer( $plugin_basename, 'bws_license_nonce_name' ) ) {
|
304 |
-
if ( '' != $bws_license_key ) {
|
305 |
-
if ( strlen( $bws_license_key ) != 18 ) {
|
306 |
-
$result['error'] = __( "Wrong license key", 'bestwebsoft' );
|
307 |
-
} else {
|
308 |
-
$bws_license_plugin = stripslashes( esc_html( $_POST['bws_license_plugin'] ) );
|
309 |
-
if ( isset( $bstwbsftwppdtplgns_options['go_pro'][ $bws_license_plugin ]['count'] ) && $bstwbsftwppdtplgns_options['go_pro'][ $bws_license_plugin ]['time'] > ( time() - (24 * 60 * 60) ) ) {
|
310 |
-
$bstwbsftwppdtplgns_options['go_pro'][ $bws_license_plugin ]['count'] = $bstwbsftwppdtplgns_options['go_pro'][ $bws_license_plugin ]['count'] + 1;
|
311 |
-
} else {
|
312 |
-
$bstwbsftwppdtplgns_options['go_pro'][ $bws_license_plugin ]['count'] = 1;
|
313 |
-
$bstwbsftwppdtplgns_options['go_pro'][ $bws_license_plugin ]['time'] = time();
|
314 |
-
}
|
315 |
-
|
316 |
-
/* download Pro */
|
317 |
-
if ( ! function_exists( 'get_plugins' ) )
|
318 |
-
require_once( ABSPATH . 'wp-admin/includes/plugin.php' );
|
319 |
-
|
320 |
-
$all_plugins = get_plugins();
|
321 |
-
|
322 |
-
if ( ! array_key_exists( $bws_license_plugin, $all_plugins ) ) {
|
323 |
-
$current = get_site_transient( 'update_plugins' );
|
324 |
-
if ( is_array( $all_plugins ) && !empty( $all_plugins ) && isset( $current ) && is_array( $current->response ) ) {
|
325 |
-
$to_send = array();
|
326 |
-
$to_send["plugins"][ $bws_license_plugin ] = array();
|
327 |
-
$to_send["plugins"][ $bws_license_plugin ]["bws_license_key"] = $bws_license_key;
|
328 |
-
$to_send["plugins"][ $bws_license_plugin ]["bws_illegal_client"] = true;
|
329 |
-
$options = array(
|
330 |
-
'timeout' => ( ( defined( 'DOING_CRON' ) && DOING_CRON ) ? 30 : 3 ),
|
331 |
-
'body' => array( 'plugins' => serialize( $to_send ) ),
|
332 |
-
'user-agent' => 'WordPress/' . $wp_version . '; ' . get_bloginfo( 'url' ) );
|
333 |
-
$raw_response = wp_remote_post( 'http://bestwebsoft.com/wp-content/plugins/paid-products/plugins/update-check/1.0/', $options );
|
334 |
-
|
335 |
-
if ( is_wp_error( $raw_response ) || 200 != wp_remote_retrieve_response_code( $raw_response ) ) {
|
336 |
-
$result['error'] = __( "Something went wrong. Please try again later. If the error appears again, please contact us", 'bestwebsoft' ) . ' <a href="http://support.bestwebsoft.com">BestWebSoft</a>. ' . __( "We are sorry for inconvenience.", 'bestwebsoft' );
|
337 |
-
} else {
|
338 |
-
$response = maybe_unserialize( wp_remote_retrieve_body( $raw_response ) );
|
339 |
-
if ( is_array( $response ) && !empty( $response ) ) {
|
340 |
-
foreach ( $response as $key => $value ) {
|
341 |
-
if ( "wrong_license_key" == $value->package ) {
|
342 |
-
$result['error'] = __( "Wrong license key", 'bestwebsoft' );
|
343 |
-
} elseif ( "wrong_domain" == $value->package ) {
|
344 |
-
$result['error'] = __( "This license key is bind to another site", 'bestwebsoft' );
|
345 |
-
} elseif ( "you_are_banned" == $value->package ) {
|
346 |
-
$result['error'] = __( "Unfortunately, you have exceeded the number of available tries per day. Please, upload the plugin manually.", 'bestwebsoft' );
|
347 |
-
} elseif ( "time_out" == $value->package ) {
|
348 |
-
$result['error'] = __( "Unfortunately, Your license has expired. To continue getting top-priority support and plugin updates you should extend it in your", 'bestwebsoft' ) . ' <a href="http://bestwebsoft.com/wp-admin/admin.php?page=client-area">Client area</a>';
|
349 |
-
} elseif ( "duplicate_domen_for_trial" == $value->package ) {
|
350 |
-
$result['error'] = __( "Unfortunately, the Pro licence was already installed to this domain. The Pro Trial license can be installed only once.", 'bestwebsoft' );
|
351 |
-
}
|
352 |
-
}
|
353 |
-
if ( empty( $result['error'] ) ) {
|
354 |
-
$bstwbsftwppdtplgns_options[ $bws_license_plugin ] = $bws_license_key;
|
355 |
-
|
356 |
-
$url = 'http://bestwebsoft.com/wp-content/plugins/paid-products/plugins/downloads/?bws_first_download=' . $bws_license_plugin . '&bws_license_key=' . $bws_license_key . '&download_from=5';
|
357 |
-
$uploadDir = wp_upload_dir();
|
358 |
-
$zip_name = explode( '/', $bws_license_plugin );
|
359 |
-
|
360 |
-
if ( !function_exists( 'curl_init' ) ) {
|
361 |
-
$received_content = file_get_contents( $url );
|
362 |
-
} else {
|
363 |
-
$ch = curl_init();
|
364 |
-
curl_setopt( $ch, CURLOPT_URL, $url );
|
365 |
-
curl_setopt( $ch, CURLOPT_RETURNTRANSFER, true );
|
366 |
-
$received_content = curl_exec( $ch );
|
367 |
-
curl_close( $ch );
|
368 |
-
}
|
369 |
-
|
370 |
-
if ( ! $received_content ) {
|
371 |
-
$result['error'] = __( "Failed to download the zip archive. Please, upload the plugin manually", 'bestwebsoft' );
|
372 |
-
} else {
|
373 |
-
if ( is_writable( $uploadDir["path"] ) ) {
|
374 |
-
$file_put_contents = $uploadDir["path"] . "/" . $zip_name[0] . ".zip";
|
375 |
-
if ( file_put_contents( $file_put_contents, $received_content ) ) {
|
376 |
-
@chmod( $file_put_contents, octdec( 755 ) );
|
377 |
-
if ( class_exists( 'ZipArchive' ) ) {
|
378 |
-
$zip = new ZipArchive();
|
379 |
-
if ( $zip->open( $file_put_contents ) === TRUE ) {
|
380 |
-
$zip->extractTo( WP_PLUGIN_DIR );
|
381 |
-
$zip->close();
|
382 |
-
} else {
|
383 |
-
$result['error'] = __( "Failed to open the zip archive. Please, upload the plugin manually", 'bestwebsoft' );
|
384 |
-
}
|
385 |
-
} elseif ( class_exists( 'Phar' ) ) {
|
386 |
-
$phar = new PharData( $file_put_contents );
|
387 |
-
$phar->extractTo( WP_PLUGIN_DIR );
|
388 |
-
} else {
|
389 |
-
$result['error'] = __( "Your server does not support either ZipArchive or Phar. Please, upload the plugin manually", 'bestwebsoft' );
|
390 |
-
}
|
391 |
-
@unlink( $file_put_contents );
|
392 |
-
} else {
|
393 |
-
$result['error'] = __( "Failed to download the zip archive. Please, upload the plugin manually", 'bestwebsoft' );
|
394 |
-
}
|
395 |
-
} else {
|
396 |
-
$result['error'] = __( "UploadDir is not writable. Please, upload the plugin manually", 'bestwebsoft' );
|
397 |
-
}
|
398 |
-
}
|
399 |
-
|
400 |
-
/* activate Pro */
|
401 |
-
if ( file_exists( WP_PLUGIN_DIR . '/' . $zip_name[0] ) ) {
|
402 |
-
if ( is_multisite() && is_plugin_active_for_network( $plugin_basename ) ) {
|
403 |
-
/* if multisite and free plugin is network activated */
|
404 |
-
$active_plugins = get_site_option( 'active_sitewide_plugins' );
|
405 |
-
$active_plugins[ $bws_license_plugin ] = time();
|
406 |
-
update_site_option( 'active_sitewide_plugins', $active_plugins );
|
407 |
-
} else {
|
408 |
-
/* activate on a single blog */
|
409 |
-
$active_plugins = get_option( 'active_plugins' );
|
410 |
-
array_push( $active_plugins, $bws_license_plugin );
|
411 |
-
update_option( 'active_plugins', $active_plugins );
|
412 |
-
}
|
413 |
-
$result['pro_plugin_is_activated'] = true;
|
414 |
-
} elseif ( empty( $result['error'] ) ) {
|
415 |
-
$result['error'] = __( "Failed to download the zip archive. Please, upload the plugin manually", 'bestwebsoft' );
|
416 |
-
}
|
417 |
-
}
|
418 |
-
} else {
|
419 |
-
$result['error'] = __( "Something went wrong. Try again later or upload the plugin manually. We are sorry for inconvenience.", 'bestwebsoft' );
|
420 |
-
}
|
421 |
-
}
|
422 |
-
}
|
423 |
-
} else {
|
424 |
-
$bstwbsftwppdtplgns_options[ $bws_license_plugin ] = $bws_license_key;
|
425 |
-
/* activate Pro */
|
426 |
-
if ( ! is_plugin_active( $bws_license_plugin ) ) {
|
427 |
-
if ( is_multisite() && is_plugin_active_for_network( $plugin_basename ) ) {
|
428 |
-
/* if multisite and free plugin is network activated */
|
429 |
-
$network_wide = true;
|
430 |
-
} else {
|
431 |
-
/* activate on a single blog */
|
432 |
-
$network_wide = false;
|
433 |
-
}
|
434 |
-
activate_plugin( $bws_license_plugin, NULL, $network_wide );
|
435 |
-
$result['pro_plugin_is_activated'] = true;
|
436 |
-
}
|
437 |
-
}
|
438 |
-
if ( is_multisite() )
|
439 |
-
update_site_option( 'bstwbsftwppdtplgns_options', $bstwbsftwppdtplgns_options );
|
440 |
-
else
|
441 |
-
update_option( 'bstwbsftwppdtplgns_options', $bstwbsftwppdtplgns_options );
|
442 |
-
|
443 |
-
if ( ! empty( $result['pro_plugin_is_activated'] ) )
|
444 |
-
delete_transient( 'bws_plugins_update' );
|
445 |
-
}
|
446 |
-
} else {
|
447 |
-
$result['error'] = __( "Please, enter Your license key", 'bestwebsoft' );
|
448 |
-
}
|
449 |
-
}
|
450 |
-
return $result;
|
451 |
-
}
|
452 |
-
}
|
453 |
-
|
454 |
-
/**
|
455 |
-
* Function display GO PRO tab - for old plugin version
|
456 |
-
* @deprecated 1.7.6
|
457 |
-
*/
|
458 |
-
if ( ! function_exists( 'bws_go_pro_tab' ) ) {
|
459 |
-
function bws_go_pro_tab( $plugin_info, $plugin_basename, $page, $pro_page, $bws_license_plugin, $link_slug, $link_key, $link_pn, $pro_plugin_is_activated = false, $trial_days_number = false ) {
|
460 |
-
bws_go_pro_tab_show( false, $plugin_info, $plugin_basename, $page, $pro_page, $bws_license_plugin, $link_slug, $link_key, $link_pn, $pro_plugin_is_activated, $trial_days_number );
|
461 |
-
}
|
462 |
-
}
|
463 |
-
|
464 |
-
/**
|
465 |
-
* Function display GO PRO tab
|
466 |
-
*/
|
467 |
-
if ( ! function_exists( 'bws_go_pro_tab_show' ) ) {
|
468 |
-
function bws_go_pro_tab_show( $bws_hide_premium_options_check, $plugin_info, $plugin_basename, $page, $pro_page, $bws_license_plugin, $link_slug, $link_key, $link_pn, $pro_plugin_is_activated = false, $trial_days_number = false ) {
|
469 |
-
global $wp_version, $bstwbsftwppdtplgns_options;
|
470 |
-
$bws_license_key = ( isset( $_POST['bws_license_key'] ) ) ? stripslashes( esc_html( trim( $_POST['bws_license_key'] ) ) ) : "";
|
471 |
-
if ( $pro_plugin_is_activated ) { ?>
|
472 |
-
<script type="text/javascript">
|
473 |
-
window.setTimeout( function() {
|
474 |
-
window.location.href = 'admin.php?page=<?php echo $pro_page; ?>';
|
475 |
-
}, 5000 );
|
476 |
-
</script>
|
477 |
-
<p><?php _e( "Congratulations! Pro version of the plugin is successfully installed and activated.", 'bestwebsoft' ); ?></p>
|
478 |
-
<p>
|
479 |
-
<?php _e( "Please, go to", 'bestwebsoft' ); ?> <a href="admin.php?page=<?php echo $pro_page; ?>"><?php _e( 'the setting page', 'bestwebsoft' ); ?></a>
|
480 |
-
(<?php _e( "You will be redirected automatically in 5 seconds.", 'bestwebsoft' ); ?>)
|
481 |
-
</p>
|
482 |
-
<?php } else {
|
483 |
-
if ( $bws_hide_premium_options_check ) { ?>
|
484 |
-
<form method="post" action="">
|
485 |
-
<p>
|
486 |
-
<input type="hidden" name="bws_hide_premium_options_submit" value="submit" />
|
487 |
-
<input type="submit" class="button" value="<?php _e( 'Show Pro features', 'bestwebsoft' ); ?>" />
|
488 |
-
<?php wp_nonce_field( $plugin_basename, 'bws_license_nonce_name' ); ?>
|
489 |
-
</p>
|
490 |
-
</form>
|
491 |
-
<?php } ?>
|
492 |
-
<form method="post" action="">
|
493 |
-
<p>
|
494 |
-
<?php _e( 'Enter your license key to install and activate', 'bestwebsoft' ); ?>
|
495 |
-
<a href="http://bestwebsoft.com/products/wordpress/plugins/<?php echo $link_slug; ?>/?k=<?php echo $link_key; ?>&pn=<?php echo $link_pn; ?>&v=<?php echo $plugin_info["Version"]; ?>&wp_v=<?php echo $wp_version; ?>" target="_blank" title="<?php echo $plugin_info["Name"]; ?> Pro">Pro</a>
|
496 |
-
<?php _e( 'version of the plugin.', 'bestwebsoft' ); ?><br />
|
497 |
-
<span class="bws_info">
|
498 |
-
<?php _e( 'License key can be found in the', 'bestwebsoft' ); ?>
|
499 |
-
<a href="http://bestwebsoft.com/wp-login.php">Client Area</a>
|
500 |
-
<?php _e( '(your username is the email address specified during the purchase).', 'bestwebsoft' ); ?>
|
501 |
-
</span>
|
502 |
-
</p>
|
503 |
-
<?php if ( $trial_days_number !== false )
|
504 |
-
$trial_days_number = __( 'or', 'bestwebsoft' ) . ' <a href="http://bestwebsoft.com/products/wordpress/plugins/' . $link_slug . '/trial/" target="_blank">' . sprintf( __( 'Start Your Free %s-Day Trial Now', 'bestwebsoft' ), $trial_days_number ) . '</a>';
|
505 |
-
if ( isset( $bstwbsftwppdtplgns_options['go_pro'][ $bws_license_plugin ]['count'] ) &&
|
506 |
-
'5' < $bstwbsftwppdtplgns_options['go_pro'][ $bws_license_plugin ]['count'] &&
|
507 |
-
$bstwbsftwppdtplgns_options['go_pro'][ $bws_license_plugin ]['time'] > ( time() - ( 24 * 60 * 60 ) ) ) { ?>
|
508 |
-
<p>
|
509 |
-
<input disabled="disabled" type="text" name="bws_license_key" value="<?php echo $bws_license_key; ?>" />
|
510 |
-
<input disabled="disabled" type="submit" class="button-primary" value="<?php _e( 'Activate', 'bestwebsoft' ); ?>" />
|
511 |
-
<?php if ( $trial_days_number !== false ) echo $trial_days_number; ?>
|
512 |
-
</p>
|
513 |
-
<p><?php _e( "Unfortunately, you have exceeded the number of available tries per day. Please, upload the plugin manually.", 'bestwebsoft' ); ?></p>
|
514 |
-
<?php } else { ?>
|
515 |
-
<p>
|
516 |
-
<input type="text" maxlength="100" name="bws_license_key" value="<?php echo $bws_license_key; ?>" />
|
517 |
-
<input type="hidden" name="bws_license_plugin" value="<?php echo $bws_license_plugin; ?>" />
|
518 |
-
<input type="hidden" name="bws_license_submit" value="submit" />
|
519 |
-
<input type="submit" class="button-primary" value="<?php _e( 'Activate', 'bestwebsoft' ); ?>" />
|
520 |
-
<?php if ( $trial_days_number !== false ) echo $trial_days_number;
|
521 |
-
wp_nonce_field( $plugin_basename, 'bws_license_nonce_name' ); ?>
|
522 |
-
</p>
|
523 |
-
<?php } ?>
|
524 |
-
</form>
|
525 |
-
<?php }
|
526 |
-
}
|
527 |
-
}
|
528 |
-
|
529 |
-
if ( ! function_exists( 'bws_go_pro_from_trial_tab' ) ) {
|
530 |
-
function bws_go_pro_from_trial_tab( $plugin_info, $plugin_basename, $page, $link_slug, $link_key, $link_pn, $trial_license_is_set = true ) {
|
531 |
-
global $wp_version, $bstwbsftwppdtplgns_options;
|
532 |
-
$bws_license_key = ( isset( $_POST['bws_license_key'] ) ) ? stripslashes( esc_html( trim( $_POST['bws_license_key'] ) ) ) : "";
|
533 |
-
if ( $trial_license_is_set ) { ?>
|
534 |
-
<form method="post" action="">
|
535 |
-
<p>
|
536 |
-
<?php echo sprintf( __( 'In order to continue using the plugin it is necessary to buy a %s license.', 'bestwebsoft' ), '<a href="http://bestwebsoft.com/products/wordpress/plugins/' . $link_slug . '/?k=' . $link_key . '&pn=' . $link_pn . '&v=' . $plugin_info["Version"] . '&wp_v=' . $wp_version .'" target="_blank" title="' . $plugin_info["Name"] . '">Pro</a>' ) . ' ';
|
537 |
-
_e( 'After that you can activate it by entering your license key.', 'bestwebsoft' ); ?><br />
|
538 |
-
<span class="bws_info">
|
539 |
-
<?php _e( 'License key can be found in the', 'bestwebsoft' ); ?>
|
540 |
-
<a href="http://bestwebsoft.com/wp-login.php">Client Area</a>
|
541 |
-
<?php _e( '(your username is the email address specified during the purchase).', 'bestwebsoft' ); ?>
|
542 |
-
</span>
|
543 |
-
</p>
|
544 |
-
<?php if ( isset( $bstwbsftwppdtplgns_options['go_pro'][ $plugin_basename ]['count'] ) &&
|
545 |
-
'5' < $bstwbsftwppdtplgns_options['go_pro'][ $plugin_basename ]['count'] &&
|
546 |
-
$bstwbsftwppdtplgns_options['go_pro'][ $plugin_basename ]['time'] > ( time() - ( 24 * 60 * 60 ) ) ) { ?>
|
547 |
-
<p>
|
548 |
-
<input disabled="disabled" type="text" name="bws_license_key" value="" />
|
549 |
-
<input disabled="disabled" type="submit" class="button-primary" value="<?php _e( 'Activate', 'bestwebsoft' ); ?>" />
|
550 |
-
</p>
|
551 |
-
<p><?php _e( "Unfortunately, you have exceeded the number of available tries per day.", 'bestwebsoft' ); ?></p>
|
552 |
-
<?php } else { ?>
|
553 |
-
<p>
|
554 |
-
<input type="text" maxlength="100" name="bws_license_key" value="" />
|
555 |
-
<input type="hidden" name="bws_license_plugin" value="<?php echo $plugin_basename; ?>" />
|
556 |
-
<input type="hidden" name="bws_license_submit" value="submit" />
|
557 |
-
<input type="submit" class="button-primary" value="<?php _e( 'Activate', 'bestwebsoft' ); ?>" />
|
558 |
-
<?php wp_nonce_field( $plugin_basename, 'bws_license_nonce_name' ); ?>
|
559 |
-
</p>
|
560 |
-
<?php } ?>
|
561 |
-
</form>
|
562 |
-
<?php } else { ?>
|
563 |
-
<script type="text/javascript">
|
564 |
-
window.setTimeout( function() {
|
565 |
-
window.location.href = 'admin.php?page=<?php echo $page; ?>';
|
566 |
-
}, 5000 );
|
567 |
-
</script>
|
568 |
-
<p><?php _e( "Congratulations! The Pro license of the plugin is successfully activated.", 'bestwebsoft' ); ?></p>
|
569 |
-
<p>
|
570 |
-
<?php _e( "Please, go to", 'bestwebsoft' ); ?> <a href="admin.php?page=<?php echo $page; ?>"><?php _e( 'the setting page', 'bestwebsoft' ); ?></a>
|
571 |
-
(<?php _e( "You will be redirected automatically in 5 seconds.", 'bestwebsoft' ); ?>)
|
572 |
-
</p>
|
573 |
-
<?php }
|
574 |
-
}
|
575 |
-
}
|
576 |
-
|
577 |
-
if ( ! function_exists( 'bws_check_pro_license' ) ) {
|
578 |
-
function bws_check_pro_license( $plugin_basename, $trial_plugin = false ) {
|
579 |
-
global $wp_version, $bstwbsftwppdtplgns_options;
|
580 |
-
$result = array();
|
581 |
-
|
582 |
-
if ( isset( $_POST['bws_license_submit'] ) && check_admin_referer( $plugin_basename, 'bws_license_nonce_name' ) ) {
|
583 |
-
$license_key = isset( $_POST['bws_license_key'] ) ? stripslashes( esc_html( trim( $_POST['bws_license_key'] ) ) ) : '';
|
584 |
-
|
585 |
-
if ( '' != $license_key ) {
|
586 |
-
|
587 |
-
delete_transient( 'bws_plugins_update' );
|
588 |
-
|
589 |
-
if ( ! function_exists( 'get_plugins' ) )
|
590 |
-
require_once( ABSPATH . 'wp-admin/includes/plugin.php' );
|
591 |
-
$plugins_all = get_plugins();
|
592 |
-
$current = get_site_transient( 'update_plugins' );
|
593 |
-
|
594 |
-
if ( is_array( $plugins_all ) && !empty( $plugins_all ) && isset( $current ) && is_array( $current->response ) ) {
|
595 |
-
$to_send = array();
|
596 |
-
$to_send["plugins"][ $plugin_basename ] = $plugins_all[ $plugin_basename ];
|
597 |
-
$to_send["plugins"][ $plugin_basename ]["bws_license_key"] = $license_key;
|
598 |
-
$to_send["plugins"][ $plugin_basename ]["bws_illegal_client"] = true;
|
599 |
-
$options = array(
|
600 |
-
'timeout' => ( ( defined('DOING_CRON') && DOING_CRON ) ? 30 : 3),
|
601 |
-
'body' => array( 'plugins' => serialize( $to_send ) ),
|
602 |
-
'user-agent' => 'WordPress/' . $wp_version . '; ' . get_bloginfo( 'url' )
|
603 |
-
);
|
604 |
-
$raw_response = wp_remote_post( 'http://bestwebsoft.com/wp-content/plugins/paid-products/plugins/update-check/1.0/', $options );
|
605 |
-
if ( is_wp_error( $raw_response ) || 200 != wp_remote_retrieve_response_code( $raw_response ) ) {
|
606 |
-
$result['error'] = __( 'Something went wrong. Please try again later. If the error appears again, please contact us', 'bestwebsoft' ) . ' <a href=http://support.bestwebsoft.com>BestWebSoft</a>. ' . __( 'We are sorry for inconvenience.', 'bestwebsoft' );
|
607 |
-
} else {
|
608 |
-
$response = maybe_unserialize( wp_remote_retrieve_body( $raw_response ) );
|
609 |
-
if ( is_array( $response ) && !empty( $response ) ) {
|
610 |
-
foreach ( $response as $key => $value ) {
|
611 |
-
if ( "wrong_license_key" == $value->package ) {
|
612 |
-
$result['error'] = __( 'Wrong license key.', 'bestwebsoft' );
|
613 |
-
} else if ( "wrong_domain" == $value->package ) {
|
614 |
-
$result['error'] = __( 'This license key is bind to another site.', 'bestwebsoft' );
|
615 |
-
} else if ( "time_out" == $value->package ) {
|
616 |
-
$result['message'] = __( 'This license key is valid, but Your license has expired. If you want to update our plugin in future, you should extend the license.', 'bestwebsoft' );
|
617 |
-
} elseif ( "you_are_banned" == $value->package ) {
|
618 |
-
$result['error'] = __( "Unfortunately, you have exceeded the number of available tries.", 'bestwebsoft' );
|
619 |
-
} elseif ( "duplicate_domen_for_trial" == $value->package ) {
|
620 |
-
$result['error'] = __( "Unfortunately, the Pro Trial licence was already installed to this domain. The Pro Trial license can be installed only once.", 'bestwebsoft' );
|
621 |
-
}
|
622 |
-
if ( empty( $result['message'] ) && empty( $result['error'] ) ) {
|
623 |
-
if ( isset( $value->trial ) )
|
624 |
-
$result['message'] = __( 'The Pro Trial license key is valid.', 'bestwebsoft' );
|
625 |
-
else
|
626 |
-
$result['message'] = __( 'The license key is valid.', 'bestwebsoft' );
|
627 |
-
|
628 |
-
if ( ! empty( $value->time_out ) )
|
629 |
-
$result['message'] .= ' ' . __( 'Your license will expire on', 'bestwebsoft' ) . ' ' . $value->time_out . '.';
|
630 |
-
|
631 |
-
if ( isset( $value->trial ) && $trial_plugin != false )
|
632 |
-
$result['message'] .= ' ' . sprintf( __( 'In order to continue using the plugin it is necessary to buy a %s license.', 'bestwebsoft' ), '<a href="http://bestwebsoft.com/products/wordpress/plugins/' . $trial_plugin['link_slug'] . '/?k=' . $trial_plugin['link_key'] . '&pn=' . $trial_plugin['link_pn'] . '&v=' . $trial_plugin['plugin_info']['Version'] . '&wp_v=' . $wp_version . '" target="_blank" title="' . $trial_plugin['plugin_info']['Name'] . '">Pro</a>' );
|
633 |
-
|
634 |
-
if ( isset( $value->trial ) ) {
|
635 |
-
$bstwbsftwppdtplgns_options['trial'][ $plugin_basename ] = 1;
|
636 |
-
} else {
|
637 |
-
unset( $bstwbsftwppdtplgns_options['trial'][ $plugin_basename ] );
|
638 |
-
}
|
639 |
-
}
|
640 |
-
if ( empty( $result['error'] ) ) {
|
641 |
-
if ( $bstwbsftwppdtplgns_options[ $plugin_basename ] != $license_key ) {
|
642 |
-
$bstwbsftwppdtplgns_options[ $plugin_basename ] = $license_key;
|
643 |
-
|
644 |
-
$file = @fopen( dirname( dirname( __FILE__ ) ) . "/license_key.txt" , "w+" );
|
645 |
-
if ( $file ) {
|
646 |
-
@fwrite( $file, $license_key );
|
647 |
-
@fclose( $file );
|
648 |
-
}
|
649 |
-
$update_option = true;
|
650 |
-
}
|
651 |
-
|
652 |
-
if ( ! isset( $bstwbsftwppdtplgns_options['time_out'][ $plugin_basename ] ) || $bstwbsftwppdtplgns_options['time_out'][ $plugin_basename ] != $value->time_out ) {
|
653 |
-
$bstwbsftwppdtplgns_options['time_out'][ $plugin_basename ] = $value->time_out;
|
654 |
-
$update_option = true;
|
655 |
-
}
|
656 |
-
|
657 |
-
if ( isset( $update_option ) ) {
|
658 |
-
if ( is_multisite() )
|
659 |
-
update_site_option( 'bstwbsftwppdtplgns_options', $bstwbsftwppdtplgns_options );
|
660 |
-
else
|
661 |
-
update_option( 'bstwbsftwppdtplgns_options', $bstwbsftwppdtplgns_options );
|
662 |
-
}
|
663 |
-
}
|
664 |
-
}
|
665 |
-
} else {
|
666 |
-
$result['error'] = __( 'Something went wrong. Please try again later. If the error appears again, please contact us', 'bestwebsoft' ) . ' <a href=http://support.bestwebsoft.com>BestWebSoft</a>. ' . __( 'We are sorry for inconvenience.', 'bestwebsoft' );
|
667 |
-
}
|
668 |
-
}
|
669 |
-
}
|
670 |
-
} else {
|
671 |
-
$result['error'] = __( 'Please, enter your license key', 'bestwebsoft' );
|
672 |
-
}
|
673 |
-
}
|
674 |
-
return $result;
|
675 |
-
}
|
676 |
-
}
|
677 |
-
|
678 |
-
if ( ! function_exists ( 'bws_check_pro_license_form' ) ) {
|
679 |
-
function bws_check_pro_license_form( $plugin_basename ) {
|
680 |
-
global $bstwbsftwppdtplgns_options;
|
681 |
-
$license_key = ( isset( $bstwbsftwppdtplgns_options[ $plugin_basename ] ) ) ? $bstwbsftwppdtplgns_options[ $plugin_basename ] : ''; ?>
|
682 |
-
<div class="clear"></div>
|
683 |
-
<form method="post" action="">
|
684 |
-
<p><?php echo _e( 'If needed you can check if the license key is correct or reenter it in the field below. You can find your license key on your personal page - Client area - on our website', 'bestwebsoft' ) . ' <a href="http://bestwebsoft.com/wp-login.php">http://bestwebsoft.com/wp-login.php</a> ' . __( '(your username is the email address specified during the purchase). If necessary, please submit "Lost your password?" request.', 'bestwebsoft' ); ?></p>
|
685 |
-
<p>
|
686 |
-
<input type="text" maxlength="100" name="bws_license_key" value="<?php echo $license_key; ?>" />
|
687 |
-
<input type="hidden" name="bws_license_submit" value="submit" />
|
688 |
-
<input type="submit" class="button" value="<?php _e( 'Check license key', 'bestwebsoft' ) ?>" />
|
689 |
-
<?php wp_nonce_field( $plugin_basename, 'bws_license_nonce_name' ); ?>
|
690 |
-
</p>
|
691 |
-
</form>
|
692 |
-
<?php }
|
693 |
-
}
|
694 |
-
|
695 |
-
if ( ! function_exists ( 'bws_plugin_update_row' ) ) {
|
696 |
-
function bws_plugin_update_row( $plugin_key, $link_slug = false, $free_plugin_name = false ) {
|
697 |
-
global $bstwbsftwppdtplgns_options, $wp_version;
|
698 |
-
$wp_list_table = _get_list_table( 'WP_Plugins_List_Table' );
|
699 |
-
if ( isset( $bstwbsftwppdtplgns_options['wrong_license_key'][ $plugin_key ] ) ) {
|
700 |
-
$explode_plugin_key = explode( '/', $plugin_key );
|
701 |
-
$class = ( $wp_version >= 4.6 ) ? 'active' : '';
|
702 |
-
$style = ( $wp_version < 4.6 ) ? ' style="background-color: #FFEBE8;border-color: #CC0000;"' : '';
|
703 |
-
$div_class = ( $wp_version >= 4.6 ) ? ' notice inline notice-warning notice-alt' : '';
|
704 |
-
echo '<tr class="bws-plugin-update-tr plugin-update-tr ' . $class . '" id="' . $explode_plugin_key[0] . '-update" data-slug="' . $explode_plugin_key[0] . '" data-plugin="' . $plugin_key . '">
|
705 |
-
<td colspan="' . $wp_list_table->get_column_count() . '" class="plugin-update colspanchange">
|
706 |
-
<div class="update-message' . $div_class . '"' . $style . '>';
|
707 |
-
if ( $wp_version >= 4.6 )
|
708 |
-
echo '<p>';
|
709 |
-
echo '<strong>' . __( 'WARNING: Illegal use notification', 'bestwebsoft' ) . '.</strong> ' . __( 'You can use one license of the Pro plugin for one domain only. Please check and edit your license or domain if necessary using you personal Client Area. We strongly recommend you to solve the problem within 24 hours, otherwise the Pro plugin will be deactivated.', 'bestwebsoft' ) . ' <a target="_blank" href="http://support.bestwebsoft.com/hc/en-us/articles/204240089">' . __( 'Learn More', 'bestwebsoft' ) . '</a>';
|
710 |
-
if ( $wp_version >= 4.6 )
|
711 |
-
echo '</p>';
|
712 |
-
echo '</div>
|
713 |
-
</td>
|
714 |
-
</tr>';
|
715 |
-
} elseif ( isset( $bstwbsftwppdtplgns_options['time_out'][ $plugin_key ] ) && strtotime( $bstwbsftwppdtplgns_options['time_out'][ $plugin_key ] ) < strtotime( date("m/d/Y") ) ) {
|
716 |
-
$explode_plugin_key = explode( '/', $plugin_key );
|
717 |
-
$class = ( $wp_version >= 4.6 ) ? 'active' : '';
|
718 |
-
$style = ( $wp_version < 4.6 ) ? ' style="color: #8C0000;"' : '';
|
719 |
-
$div_class = ( $wp_version >= 4.6 ) ? ' notice inline notice-warning notice-alt' : '';
|
720 |
-
echo '<tr class="bws-plugin-update-tr plugin-update-tr ' . $class . '" id="' . $explode_plugin_key[0] . '-update" data-slug="' . $explode_plugin_key[0] . '" data-plugin="' . $plugin_key . '">
|
721 |
-
<td colspan="' . $wp_list_table->get_column_count() . '" class="plugin-update colspanchange">
|
722 |
-
<div class="update-message' . $div_class . '"' . $style . '>';
|
723 |
-
if ( $wp_version >= 4.6 )
|
724 |
-
echo '<p>';
|
725 |
-
if ( isset( $bstwbsftwppdtplgns_options['trial'][ $plugin_key ] ) && $link_slug != false ) {
|
726 |
-
echo __( 'Notice: Your Pro Trial license has expired. To continue using the plugin you should buy a Pro license', 'bestwebsoft' ) . ' - <a href="http://bestwebsoft.com/products/wordpress/plugins/' . $link_slug .'/">http://bestwebsoft.com/products/wordpress/plugins/' . $link_slug . '/</a>';
|
727 |
-
} else {
|
728 |
-
echo __( 'Your license has expired. To continue getting top-priority support and plugin updates you should extend it.', 'bestwebsoft' ) . ' <a target="_new" href="http://support.bestwebsoft.com/entries/53487136">' . __( "Learn more", 'bestwebsoft' ) . '</a>';
|
729 |
-
}
|
730 |
-
if ( $wp_version >= 4.6 )
|
731 |
-
echo '</p>';
|
732 |
-
echo '</div>
|
733 |
-
</td>
|
734 |
-
</tr>';
|
735 |
-
} elseif ( isset( $bstwbsftwppdtplgns_options['trial'][ $plugin_key ] ) ) {
|
736 |
-
$explode_plugin_key = explode( '/', $plugin_key );
|
737 |
-
$class = ( $wp_version >= 4.6 ) ? 'active' : '';
|
738 |
-
$style = ( $wp_version < 4.6 ) ? ' style="color: #8C0000;"' : '';
|
739 |
-
$div_class = ( $wp_version >= 4.6 ) ? ' notice inline notice-warning notice-alt' : '';
|
740 |
-
echo '<tr class="bws-plugin-update-tr plugin-update-tr ' . $class . '" id="' . $explode_plugin_key[0] . '-update" data-slug="' . $explode_plugin_key[0] . '" data-plugin="' . $plugin_key . '">
|
741 |
-
<td colspan="' . $wp_list_table->get_column_count() . '" class="plugin-update colspanchange">
|
742 |
-
<div class="update-message' . $div_class . '"' . $style . '>';
|
743 |
-
if ( $wp_version >= 4.6 )
|
744 |
-
echo '<p>';
|
745 |
-
if ( $free_plugin_name != false ) {
|
746 |
-
echo sprintf( __( 'Notice: You are using the Pro Trial license of %s plugin.', 'bestwebsoft' ), $free_plugin_name );
|
747 |
-
} else {
|
748 |
-
_e( 'Notice: You are using the Pro Trial license of plugin.', 'bestwebsoft' );
|
749 |
-
}
|
750 |
-
if ( isset( $bstwbsftwppdtplgns_options['time_out'][ $plugin_key ] ) )
|
751 |
-
echo ' ' . __( "The Pro Trial license will expire on", 'bestwebsoft' ) . ' ' . $bstwbsftwppdtplgns_options['time_out'][ $plugin_key ] . '.';
|
752 |
-
if ( $wp_version >= 4.6 )
|
753 |
-
echo '</p>';
|
754 |
-
echo '</div>
|
755 |
-
</td>
|
756 |
-
</tr>';
|
757 |
-
}
|
758 |
-
}
|
759 |
-
}
|
760 |
-
|
761 |
if ( ! function_exists ( 'bws_plugin_banner_timeout' ) ) {
|
762 |
function bws_plugin_banner_timeout( $plugin_key, $plugin_prefix, $plugin_name, $banner_url = false ) {
|
763 |
global $bstwbsftwppdtplgns_options, $bstwbsftwppdtplgns_cookie_add;
|
@@ -788,7 +379,7 @@ if ( ! function_exists ( 'bws_plugin_banner_timeout' ) ) {
|
|
788 |
<div class="icon">
|
789 |
<img title="" src="<?php echo $banner_url; ?>" alt="" />
|
790 |
</div>
|
791 |
-
<div class="text"><?php
|
792 |
</div>
|
793 |
</div>
|
794 |
<?php }
|
@@ -885,7 +476,7 @@ if ( ! function_exists( 'bws_plugin_suggest_feature_banner' ) ) {
|
|
885 |
<div class="text">
|
886 |
<strong><?php _e( 'Thank you for choosing', 'bestwebsoft' ); ?> <?php echo $plugin_info['Name']; ?> plugin!</strong><br />
|
887 |
<?php _e( "If you have a feature, suggestion or idea you'd like to see in the plugin, we'd love to hear about it!", 'bestwebsoft' ); ?>
|
888 |
-
<a target="_blank" href="
|
889 |
</div>
|
890 |
<form action="" method="post">
|
891 |
<button class="notice-dismiss bws_hide_settings_notice" title="<?php _e( 'Close notice', 'bestwebsoft' ); ?>"></button>
|
@@ -916,7 +507,7 @@ if ( ! function_exists( 'bws_hide_premium_options' ) ) {
|
|
916 |
$options['hide_premium_options'][] = get_current_user_id();
|
917 |
|
918 |
return array(
|
919 |
-
'message' => __( 'You can always look at premium options by
|
920 |
'options' => $options );
|
921 |
}
|
922 |
}
|
@@ -932,7 +523,6 @@ if ( ! function_exists( 'bws_hide_premium_options_check' ) ) {
|
|
932 |
|
933 |
if ( ! function_exists ( 'bws_plugins_admin_init' ) ) {
|
934 |
function bws_plugins_admin_init() {
|
935 |
-
|
936 |
if ( isset( $_GET['bws_activate_plugin'] ) && check_admin_referer( 'bws_activate_plugin' . $_GET['bws_activate_plugin'] ) ) {
|
937 |
|
938 |
$plugin = isset( $_GET['bws_activate_plugin'] ) ? $_GET['bws_activate_plugin'] : '';
|
@@ -971,11 +561,15 @@ if ( ! function_exists ( 'bws_plugins_admin_init' ) ) {
|
|
971 |
|
972 |
if ( ! function_exists ( 'bws_admin_enqueue_scripts' ) ) {
|
973 |
function bws_admin_enqueue_scripts() {
|
974 |
-
global $
|
|
|
|
|
|
|
|
|
975 |
wp_enqueue_style( 'bws-admin-css', bws_menu_url( 'css/general_style.css' ) );
|
976 |
-
wp_enqueue_script( 'bws-admin-scripts', bws_menu_url( 'js/general_script.js' ), array( 'jquery' ) );
|
977 |
|
978 |
-
if ( isset( $_GET['page'] ) && in_array( $_GET['page'], array( 'bws_panel', 'bws_themes', 'bws_system_status' ) ) ) {
|
979 |
wp_enqueue_style( 'bws_menu_style', bws_menu_url( 'css/style.css' ) );
|
980 |
wp_enqueue_script( 'bws_menu_script', bws_menu_url( 'js/bws_menu.js' ) );
|
981 |
wp_enqueue_script( 'theme-install' );
|
@@ -985,6 +579,18 @@ if ( ! function_exists ( 'bws_admin_enqueue_scripts' ) ) {
|
|
985 |
}
|
986 |
}
|
987 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
988 |
if ( ! function_exists ( 'bws_plugins_admin_head' ) ) {
|
989 |
function bws_plugins_admin_head() {
|
990 |
global $bws_shortcode_list, $wp_version, $post_type;
|
@@ -1024,7 +630,6 @@ if ( ! function_exists ( 'bws_plugins_admin_head' ) ) {
|
|
1024 |
var bws_shortcode_button = {
|
1025 |
'label': '<?php esc_attr_e( "Add BWS Shortcode", "bestwebsoft" ); ?>',
|
1026 |
'title': '<?php esc_attr_e( "Add BWS Plugins Shortcode", "bestwebsoft" ); ?>',
|
1027 |
-
'icon_url': '<?php echo bws_menu_url( "images/shortcode-icon.png" ); ?>',
|
1028 |
'function_name': [
|
1029 |
<?php foreach ( $bws_shortcode_list as $key => $value ) {
|
1030 |
if ( isset( $value['js_function'] ) )
|
@@ -1181,23 +786,10 @@ if ( ! class_exists( 'BWS_admin_tooltip' ) ) {
|
|
1181 |
}
|
1182 |
}
|
1183 |
|
1184 |
-
if ( ! function_exists ( 'bws_form_restore_default_settings' ) ) {
|
1185 |
-
function bws_form_restore_default_settings( $plugin_basename, $change_permission_attr = '' ) { ?>
|
1186 |
-
<form method="post" action="">
|
1187 |
-
<p><?php _e( 'Restore all plugin settings to defaults', 'bestwebsoft' ); ?></p>
|
1188 |
-
<p>
|
1189 |
-
<input <?php echo $change_permission_attr; ?> type="submit" class="button" value="<?php _e( 'Restore settings', 'bestwebsoft' ); ?>" />
|
1190 |
-
</p>
|
1191 |
-
<input type="hidden" name="bws_restore_default" value="submit" />
|
1192 |
-
<?php wp_nonce_field( $plugin_basename, 'bws_settings_nonce_name' ); ?>
|
1193 |
-
</form>
|
1194 |
-
<?php }
|
1195 |
-
}
|
1196 |
-
|
1197 |
if ( ! function_exists ( 'bws_form_restore_default_confirm' ) ) {
|
1198 |
function bws_form_restore_default_confirm( $plugin_basename ) { ?>
|
1199 |
<div>
|
1200 |
-
<p><?php _e( 'Are you sure you want to restore
|
1201 |
<form method="post" action="">
|
1202 |
<p>
|
1203 |
<button class="button button-primary" name="bws_restore_confirm"><?php _e( 'Yes, restore all settings', 'bestwebsoft' ) ?></button>
|
@@ -1294,10 +886,32 @@ if ( ! function_exists( 'bws_shortcode_media_button_popup' ) ) {
|
|
1294 |
}
|
1295 |
}
|
1296 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1297 |
/* add help tab */
|
1298 |
if ( ! function_exists( 'bws_help_tab' ) ) {
|
1299 |
function bws_help_tab( $screen, $args ) {
|
1300 |
-
$url = ( ! empty( $args['section'] ) ) ? '
|
1301 |
|
1302 |
$content = '<p><a href="' . $url . '" target="_blank">' . __( 'Visit Help Center', 'bestwebsoft' ) . '</a></p>';
|
1303 |
|
@@ -1313,174 +927,13 @@ if ( ! function_exists( 'bws_help_tab' ) ) {
|
|
1313 |
'<p><strong>' . __( 'For more information:', 'bestwebsoft' ) . '</strong></p>' .
|
1314 |
'<p><a href="https://drive.google.com/folderview?id=0B5l8lO-CaKt9VGh0a09vUjNFNjA&usp=sharing#list" target="_blank">' . __( 'Documentation', 'bestwebsoft' ) . '</a></p>' .
|
1315 |
'<p><a href="http://www.youtube.com/user/bestwebsoft/playlists?flow=grid&sort=da&view=1" target="_blank">' . __( 'Video Instructions', 'bestwebsoft' ) . '</a></p>' .
|
1316 |
-
'<p><a href="
|
1317 |
);
|
1318 |
}
|
1319 |
}
|
1320 |
|
1321 |
-
|
1322 |
-
|
1323 |
-
*/
|
1324 |
-
if ( ! function_exists( 'bws_custom_code_tab' ) ) {
|
1325 |
-
function bws_custom_code_tab() {
|
1326 |
-
if ( ! current_user_can( 'edit_plugins' ) )
|
1327 |
-
wp_die( __( 'You do not have sufficient permissions to edit plugins for this site.', 'bestwebsoft' ) );
|
1328 |
-
|
1329 |
-
global $bstwbsftwppdtplgns_options;
|
1330 |
-
|
1331 |
-
$message = $content = '';
|
1332 |
-
$is_css_active = $is_php_active = false;
|
1333 |
-
|
1334 |
-
$upload_dir = wp_upload_dir();
|
1335 |
-
$folder = $upload_dir['basedir'] . '/bws-custom-code';
|
1336 |
-
if ( ! $upload_dir["error"] ) {
|
1337 |
-
if ( ! is_dir( $folder ) )
|
1338 |
-
wp_mkdir_p( $folder, 0755 );
|
1339 |
-
|
1340 |
-
$index_file = $upload_dir['basedir'] . '/bws-custom-code/index.php';
|
1341 |
-
if ( ! file_exists( $index_file ) ) {
|
1342 |
-
if ( $f = fopen( $index_file, 'w+' ) )
|
1343 |
-
fclose( $f );
|
1344 |
-
}
|
1345 |
-
}
|
1346 |
-
|
1347 |
-
$css_file = 'bws-custom-code.css';
|
1348 |
-
$real_css_file = $folder . '/' . $css_file;
|
1349 |
-
|
1350 |
-
$php_file = 'bws-custom-code.php';
|
1351 |
-
$real_php_file = $folder . '/' . $php_file;
|
1352 |
-
|
1353 |
-
$is_multisite = is_multisite();
|
1354 |
-
if ( $is_multisite )
|
1355 |
-
$blog_id = get_current_blog_id();
|
1356 |
-
|
1357 |
-
if ( isset( $_REQUEST['bws_update_custom_code'] ) && check_admin_referer( 'bws_update_' . $css_file ) ) {
|
1358 |
-
|
1359 |
-
/* CSS */
|
1360 |
-
$newcontent_css = wp_unslash( $_POST['bws_newcontent_css'] );
|
1361 |
-
if ( ! empty( $newcontent_css ) && isset( $_REQUEST['bws_custom_css_active'] ) ) {
|
1362 |
-
if ( $is_multisite )
|
1363 |
-
$bstwbsftwppdtplgns_options['custom_code'][ $blog_id ][ $css_file ] = $upload_dir['baseurl'] . '/bws-custom-code/' . $css_file;
|
1364 |
-
else
|
1365 |
-
$bstwbsftwppdtplgns_options['custom_code'][ $css_file ] = $upload_dir['baseurl'] . '/bws-custom-code/' . $css_file;
|
1366 |
-
} else {
|
1367 |
-
if ( $is_multisite ) {
|
1368 |
-
if ( isset( $bstwbsftwppdtplgns_options['custom_code'][ $blog_id ][ $css_file ] ) )
|
1369 |
-
unset( $bstwbsftwppdtplgns_options['custom_code'][ $blog_id ][ $css_file ] );
|
1370 |
-
} else {
|
1371 |
-
if ( isset( $bstwbsftwppdtplgns_options['custom_code'][ $css_file ] ) )
|
1372 |
-
unset( $bstwbsftwppdtplgns_options['custom_code'][ $css_file ] );
|
1373 |
-
}
|
1374 |
-
}
|
1375 |
-
if ( $f = fopen( $real_css_file, 'w+' ) ) {
|
1376 |
-
fwrite( $f, $newcontent_css );
|
1377 |
-
fclose( $f );
|
1378 |
-
$message .= sprintf( __( 'File %s edited successfully.', 'bestwebsoft' ), '<i>' . $css_file . '</i>' ) . ' ';
|
1379 |
-
} else {
|
1380 |
-
$error .= __( 'Not enough permissions to create or update the file', 'bestwebsoft' ) . ' ' . $real_css_file . '. ';
|
1381 |
-
}
|
1382 |
-
|
1383 |
-
/* PHP */
|
1384 |
-
$newcontent_php = wp_unslash( trim( $_POST['bws_newcontent_php'] ) );
|
1385 |
-
if ( file_exists( $index_file ) ) {
|
1386 |
-
if ( ! empty( $newcontent_php ) && isset( $_REQUEST['bws_custom_php_active'] ) ) {
|
1387 |
-
if ( $is_multisite )
|
1388 |
-
$bstwbsftwppdtplgns_options['custom_code'][ $blog_id ][ $php_file ] = $real_php_file;
|
1389 |
-
else
|
1390 |
-
$bstwbsftwppdtplgns_options['custom_code'][ $php_file ] = $real_php_file;
|
1391 |
-
} else {
|
1392 |
-
if ( $is_multisite ) {
|
1393 |
-
if ( isset( $bstwbsftwppdtplgns_options['custom_code'][ $blog_id ][ $php_file ] ) )
|
1394 |
-
unset( $bstwbsftwppdtplgns_options['custom_code'][ $blog_id ][ $php_file ] );
|
1395 |
-
} else {
|
1396 |
-
if ( isset( $bstwbsftwppdtplgns_options['custom_code'][ $php_file ] ) )
|
1397 |
-
unset( $bstwbsftwppdtplgns_options['custom_code'][ $php_file ] );
|
1398 |
-
}
|
1399 |
-
}
|
1400 |
-
|
1401 |
-
if ( $f = fopen( $real_php_file, 'w+' ) ) {
|
1402 |
-
$newcontent_php = $newcontent_php;
|
1403 |
-
fwrite( $f, $newcontent_php );
|
1404 |
-
fclose( $f );
|
1405 |
-
$message .= sprintf( __( 'File %s edited successfully.', 'bestwebsoft' ), '<i>' . $php_file . '</i>' );
|
1406 |
-
} else {
|
1407 |
-
$error .= __( 'Not enough permissions to create or update the file', 'bestwebsoft' ) . ' ' . $real_php_file . '. ';
|
1408 |
-
}
|
1409 |
-
} else {
|
1410 |
-
$error .= __( 'Not enough permissions to create the file', 'bestwebsoft' ) . ' ' . $index_file . '. ';
|
1411 |
-
}
|
1412 |
-
|
1413 |
-
if ( ! empty( $error ) )
|
1414 |
-
$error .= ' <a href="https://codex.wordpress.org/Changing_File_Permissions" target="_blank">' . __( 'Learn more', 'bestwebsoft' ) . '</a>';
|
1415 |
-
|
1416 |
-
if ( $is_multisite )
|
1417 |
-
update_site_option( 'bstwbsftwppdtplgns_options', $bstwbsftwppdtplgns_options );
|
1418 |
-
else
|
1419 |
-
update_option( 'bstwbsftwppdtplgns_options', $bstwbsftwppdtplgns_options );
|
1420 |
-
}
|
1421 |
-
|
1422 |
-
if ( file_exists( $real_css_file ) ) {
|
1423 |
-
update_recently_edited( $real_css_file );
|
1424 |
-
$content_css = esc_textarea( file_get_contents( $real_css_file ) );
|
1425 |
-
if ( ( $is_multisite && isset( $bstwbsftwppdtplgns_options['custom_code'][ $blog_id ][ $css_file ] ) ) ||
|
1426 |
-
( ! $is_multisite && isset( $bstwbsftwppdtplgns_options['custom_code'][ $css_file ] ) ) ) {
|
1427 |
-
$is_css_active = true;
|
1428 |
-
}
|
1429 |
-
}
|
1430 |
-
if ( file_exists( $real_php_file ) ) {
|
1431 |
-
update_recently_edited( $real_php_file );
|
1432 |
-
$content_php = esc_textarea( file_get_contents( $real_php_file ) );
|
1433 |
-
if ( ( $is_multisite && isset( $bstwbsftwppdtplgns_options['custom_code'][ $blog_id ][ $php_file ] ) ) ||
|
1434 |
-
( ! $is_multisite && isset( $bstwbsftwppdtplgns_options['custom_code'][ $php_file ] ) ) ) {
|
1435 |
-
$is_php_active = true;
|
1436 |
-
}
|
1437 |
-
} else {
|
1438 |
-
$content_php = "<?php" . "\n" . "if ( ! defined( 'ABSPATH' ) ) exit;" . "\n" . "if ( ! defined( 'BWS_GLOBAL' ) ) exit;" . "\n\n" . "/* Start your code here */" . "\n";
|
1439 |
-
}
|
1440 |
-
|
1441 |
-
if ( ! empty( $message ) ) { ?>
|
1442 |
-
<div id="message" class="below-h2 updated notice is-dismissible"><p><?php echo $message; ?></p></div>
|
1443 |
-
<?php } ?>
|
1444 |
-
<form action="" method="post">
|
1445 |
-
<?php foreach ( array( 'css', 'php' ) as $extension ) { ?>
|
1446 |
-
<p>
|
1447 |
-
<?php if ( 'css' == $extension )
|
1448 |
-
_e( 'These styles will be added to the header on all pages of your site.', 'bestwebsoft' );
|
1449 |
-
else
|
1450 |
-
printf( __( 'This PHP code will be hooked to the %s action and will be printed on front end only.', 'bestwebsoft' ), '<a href="http://codex.wordpress.org/Plugin_API/Action_Reference/init" target="_blank"><code>init</code></a>' ); ?>
|
1451 |
-
</p>
|
1452 |
-
<p><big>
|
1453 |
-
<?php if ( ! file_exists( ${"real_{$extension}_file"} ) || ( is_writeable( ${"real_{$extension}_file"} ) ) ) {
|
1454 |
-
echo __( 'Editing', 'bestwebsoft' ) . ' <strong>' . ${"{$extension}_file"} . '</strong>';
|
1455 |
-
} else {
|
1456 |
-
echo __( 'Browsing', 'bestwebsoft' ) . ' <strong>' . ${"{$extension}_file"} . '</strong>';
|
1457 |
-
} ?>
|
1458 |
-
</big></p>
|
1459 |
-
<p><label><input type="checkbox" name="bws_custom_<?php echo $extension; ?>_active" value="1" <?php if ( ${"is_{$extension}_active"} ) echo "checked"; ?> /> <?php _e( 'Activate', 'bestwebsoft' ); ?></label></p>
|
1460 |
-
<textarea cols="70" rows="25" name="bws_newcontent_<?php echo $extension; ?>" id="bws_newcontent_<?php echo $extension; ?>"><?php if ( isset( ${"content_{$extension}"} ) ) echo ${"content_{$extension}"}; ?></textarea>
|
1461 |
-
<p class="description">
|
1462 |
-
<a href="<?php echo ( 'css' == $extension ) ? 'https://developer.mozilla.org/en-US/docs/Web/Guide/CSS/Getting_started' : 'http://php.net/' ?>" target="_blank">
|
1463 |
-
<?php printf( __( 'Learn more about %s', 'bestwebsoft' ), strtoupper( $extension ) ); ?>
|
1464 |
-
</a>
|
1465 |
-
</p>
|
1466 |
-
<?php }
|
1467 |
-
if ( ( ! file_exists( $real_css_file ) || is_writeable( $real_css_file ) ) && ( ! file_exists( $real_php_file ) || is_writeable( $real_php_file ) ) ) { ?>
|
1468 |
-
<p class="submit">
|
1469 |
-
<input type="hidden" name="bws_update_custom_code" value="submit" />
|
1470 |
-
<?php submit_button( __( 'Save Changes', 'bestwebsoft' ), 'primary', 'submit', false );
|
1471 |
-
wp_nonce_field( 'bws_update_' . $css_file ); ?>
|
1472 |
-
</p>
|
1473 |
-
<?php } else { ?>
|
1474 |
-
<p><em><?php printf( __( 'You need to make this files writable before you can save your changes. See %s the Codex %s for more information.', 'bestwebsoft' ),
|
1475 |
-
'<a href="https://codex.wordpress.org/Changing_File_Permissions" target="_blank">',
|
1476 |
-
'</a>' ); ?></em></p>
|
1477 |
-
<?php } ?>
|
1478 |
-
</form>
|
1479 |
-
<?php }
|
1480 |
-
}
|
1481 |
-
|
1482 |
-
if ( ! function_exists( 'bws_enqueue_custom_code_css' ) ) {
|
1483 |
-
function bws_enqueue_custom_code_css() {
|
1484 |
global $bstwbsftwppdtplgns_options;
|
1485 |
|
1486 |
if ( ! isset( $bstwbsftwppdtplgns_options ) )
|
@@ -1495,6 +948,11 @@ if ( ! function_exists( 'bws_enqueue_custom_code_css' ) ) {
|
|
1495 |
wp_enqueue_style( 'bws-custom-style', $bstwbsftwppdtplgns_options['custom_code']['bws-custom-code.css'] );
|
1496 |
elseif ( $is_multisite && ! empty( $bstwbsftwppdtplgns_options['custom_code'][ $blog_id ]['bws-custom-code.css'] ) )
|
1497 |
wp_enqueue_style( 'bws-custom-style', $bstwbsftwppdtplgns_options['custom_code'][ $blog_id ]['bws-custom-code.css'] );
|
|
|
|
|
|
|
|
|
|
|
1498 |
}
|
1499 |
}
|
1500 |
}
|
@@ -1516,7 +974,6 @@ if ( ! function_exists( 'bws_enqueue_custom_code_php' ) ) {
|
|
1516 |
$blog_id = get_current_blog_id();
|
1517 |
|
1518 |
if ( ! $is_multisite && ! empty( $bstwbsftwppdtplgns_options['custom_code']['bws-custom-code.php'] ) ) {
|
1519 |
-
|
1520 |
if ( file_exists( $bstwbsftwppdtplgns_options['custom_code']['bws-custom-code.php'] ) ) {
|
1521 |
if ( ! defined( 'BWS_GLOBAL' ) )
|
1522 |
define( 'BWS_GLOBAL', true );
|
@@ -1558,6 +1015,9 @@ if ( ! function_exists( 'bws_delete_plugin' ) ) {
|
|
1558 |
|
1559 |
/* remove bws_menu versions */
|
1560 |
unset( $bstwbsftwppdtplgns_options['bws_menu']['version'][ $basename ] );
|
|
|
|
|
|
|
1561 |
/* if empty ['bws_menu']['version'] - there is no other bws plugins - delete all */
|
1562 |
if ( empty( $bstwbsftwppdtplgns_options['bws_menu']['version'] ) ) {
|
1563 |
/* remove options */
|
@@ -1594,21 +1054,6 @@ if ( ! function_exists( 'bws_delete_plugin' ) ) {
|
|
1594 |
}
|
1595 |
}
|
1596 |
|
1597 |
-
/**
|
1598 |
-
* Function to getting url to current BWS_Menu.
|
1599 |
-
*
|
1600 |
-
* @since 1.9.7
|
1601 |
-
*/
|
1602 |
-
if ( ! function_exists ( 'bws_menu_url' ) ) {
|
1603 |
-
function bws_menu_url( $path = '' ) {
|
1604 |
-
$bws_menu_current_dir = str_replace( '\\', '/', dirname( __FILE__ ) );
|
1605 |
-
$bws_menu_abspath = str_replace( '\\', '/', ABSPATH );
|
1606 |
-
$bws_menu_current_url = site_url( str_replace( $bws_menu_abspath, '', $bws_menu_current_dir ) );
|
1607 |
-
|
1608 |
-
return sprintf( '%s/%s', $bws_menu_current_url, $path );
|
1609 |
-
}
|
1610 |
-
}
|
1611 |
-
|
1612 |
add_action( 'admin_init', 'bws_plugins_admin_init' );
|
1613 |
add_action( 'admin_enqueue_scripts', 'bws_admin_enqueue_scripts' );
|
1614 |
add_action( 'admin_head', 'bws_plugins_admin_head' );
|
@@ -1616,6 +1061,6 @@ add_action( 'admin_footer','bws_shortcode_media_button_popup' );
|
|
1616 |
|
1617 |
add_action( 'admin_notices', 'bws_admin_notices', 30 );
|
1618 |
|
1619 |
-
add_action( 'wp_enqueue_scripts', '
|
1620 |
|
1621 |
bws_enqueue_custom_code_php();
|
3 |
* General functions for BestWebSoft plugins
|
4 |
*/
|
5 |
|
6 |
+
require( dirname( __FILE__ ) . '/deprecated.php' );
|
7 |
+
|
8 |
/**
|
9 |
* Function to add 'bestwebsoft' slug for BWS_Menu MO file if BWS_Menu loaded from theme.
|
10 |
*
|
31 |
}
|
32 |
|
33 |
/**
|
34 |
+
* Function to getting url to current BWS_Menu.
|
35 |
+
*
|
36 |
+
* @since 1.9.7
|
37 |
+
*/
|
38 |
+
if ( ! function_exists ( 'bws_menu_url' ) ) {
|
39 |
+
if ( ! isset( $bws_menu_source ) || 'plugins' == $bws_menu_source ) {
|
40 |
+
function bws_menu_url( $path = '' ) {
|
41 |
+
return plugins_url( $path, __FILE__ );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
42 |
}
|
43 |
+
} else {
|
44 |
+
function bws_menu_url( $path = '' ) {
|
45 |
+
$bws_menu_current_dir = str_replace( '\\', '/', dirname( __FILE__ ) );
|
46 |
+
$bws_menu_abspath = str_replace( '\\', '/', ABSPATH );
|
47 |
+
$bws_menu_current_url = site_url( str_replace( $bws_menu_abspath, '', $bws_menu_current_dir ) );
|
48 |
|
49 |
+
return sprintf( '%s/%s', $bws_menu_current_url, $path );
|
50 |
+
}
|
|
|
|
|
|
|
|
|
|
|
51 |
}
|
52 |
}
|
53 |
|
84 |
}
|
85 |
}
|
86 |
|
87 |
+
if ( ! function_exists( 'bws_plugin_reviews_block' ) ) {
|
88 |
+
function bws_plugin_reviews_block( $plugin_name, $plugin_slug ) { ?>
|
89 |
+
<div class="bws-plugin-reviews">
|
90 |
+
<div class="bws-plugin-reviews-rate">
|
91 |
+
<?php _e( 'Like the plugin?', 'bestwebsoft' ); ?>
|
92 |
+
<a href="http://wordpress.org/support/view/plugin-reviews/<?php echo $plugin_slug; ?>?filter=5" target="_blank" title="<?php echo $plugin_name; ?> reviews">
|
93 |
+
<?php _e( 'Rate it', 'bestwebsoft' ); ?>
|
94 |
+
<span class="dashicons dashicons-star-filled"></span>
|
95 |
+
<span class="dashicons dashicons-star-filled"></span>
|
96 |
+
<span class="dashicons dashicons-star-filled"></span>
|
97 |
+
<span class="dashicons dashicons-star-filled"></span>
|
98 |
+
<span class="dashicons dashicons-star-filled"></span>
|
99 |
+
</a>
|
100 |
+
</div>
|
101 |
+
<div class="bws-plugin-reviews-support">
|
102 |
+
<?php _e( 'Need help?', 'bestwebsoft' ); ?>
|
103 |
+
<a href="https://support.bestwebsoft.com"><?php _e( 'Visit Help Center', 'bestwebsoft' ); ?></a>
|
104 |
+
</div>
|
105 |
+
<div class="bws-plugin-reviews-donate">
|
106 |
+
<?php _e( 'Want to support the plugin?', 'bestwebsoft' ); ?>
|
107 |
+
<a href="https://bestwebsoft.com/donate/"><?php _e( 'Donate', 'bestwebsoft' ); ?></a>
|
108 |
+
</div>
|
109 |
+
</div>
|
110 |
+
<?php }
|
111 |
+
}
|
112 |
+
|
113 |
+
if ( ! function_exists ( 'bws_plugin_update_row' ) ) {
|
114 |
+
function bws_plugin_update_row( $plugin_key, $link_slug = false, $free_plugin_name = false ) {
|
115 |
+
global $bstwbsftwppdtplgns_options, $wp_version;
|
116 |
+
$wp_list_table = _get_list_table( 'WP_Plugins_List_Table' );
|
117 |
+
if ( isset( $bstwbsftwppdtplgns_options['wrong_license_key'][ $plugin_key ] ) ) {
|
118 |
+
$explode_plugin_key = explode( '/', $plugin_key );
|
119 |
+
$class = ( $wp_version >= 4.6 ) ? 'active' : '';
|
120 |
+
$style = ( $wp_version < 4.6 ) ? ' style="background-color: #FFEBE8;border-color: #CC0000;"' : '';
|
121 |
+
$div_class = ( $wp_version >= 4.6 ) ? ' notice inline notice-warning notice-alt' : '';
|
122 |
+
echo '<tr class="bws-plugin-update-tr plugin-update-tr ' . $class . '" id="' . $explode_plugin_key[0] . '-update" data-slug="' . $explode_plugin_key[0] . '" data-plugin="' . $plugin_key . '">
|
123 |
+
<td colspan="' . $wp_list_table->get_column_count() . '" class="plugin-update colspanchange">
|
124 |
+
<div class="update-message' . $div_class . '"' . $style . '>';
|
125 |
+
if ( $wp_version >= 4.6 )
|
126 |
+
echo '<p>';
|
127 |
+
echo '<strong>' . __( 'WARNING: Illegal use notification', 'bestwebsoft' ) . '.</strong> ' . __( 'You can use one license of the Pro plugin for one domain only. Please check and edit your license or domain if necessary using you personal Client Area. We strongly recommend you to solve the problem within 24 hours, otherwise the Pro plugin will be deactivated.', 'bestwebsoft' ) . ' <a target="_blank" href="https://support.bestwebsoft.com/hc/en-us/articles/204240089">' . __( 'Learn More', 'bestwebsoft' ) . '</a>';
|
128 |
+
if ( $wp_version >= 4.6 )
|
129 |
+
echo '</p>';
|
130 |
+
echo '</div>
|
131 |
+
</td>
|
132 |
+
</tr>';
|
133 |
+
} elseif ( isset( $bstwbsftwppdtplgns_options['time_out'][ $plugin_key ] ) && strtotime( $bstwbsftwppdtplgns_options['time_out'][ $plugin_key ] ) < strtotime( date("m/d/Y") ) ) {
|
134 |
+
$explode_plugin_key = explode( '/', $plugin_key );
|
135 |
+
$class = ( $wp_version >= 4.6 ) ? 'active' : '';
|
136 |
+
$style = ( $wp_version < 4.6 ) ? ' style="color: #8C0000;"' : '';
|
137 |
+
$div_class = ( $wp_version >= 4.6 ) ? ' notice inline notice-warning notice-alt' : '';
|
138 |
+
echo '<tr class="bws-plugin-update-tr plugin-update-tr ' . $class . '" id="' . $explode_plugin_key[0] . '-update" data-slug="' . $explode_plugin_key[0] . '" data-plugin="' . $plugin_key . '">
|
139 |
+
<td colspan="' . $wp_list_table->get_column_count() . '" class="plugin-update colspanchange">
|
140 |
+
<div class="update-message' . $div_class . '"' . $style . '>';
|
141 |
+
if ( $wp_version >= 4.6 )
|
142 |
+
echo '<p>';
|
143 |
+
if ( isset( $bstwbsftwppdtplgns_options['trial'][ $plugin_key ] ) && $link_slug != false ) {
|
144 |
+
echo __( 'Notice: Your Pro Trial license has expired. To continue using the plugin, you should buy a Pro license', 'bestwebsoft' ) . ' - <a href="https://bestwebsoft.com/products/wordpress/plugins/' . $link_slug .'/">https://bestwebsoft.com/products/wordpress/plugins/' . $link_slug . '/</a>';
|
145 |
+
} else {
|
146 |
+
echo __( 'Your license has expired. To continue getting top-priority support and plugin updates, you should extend it.', 'bestwebsoft' ) . ' <a target="_new" href="https://support.bestwebsoft.com/entries/53487136">' . __( "Learn more", 'bestwebsoft' ) . '</a>';
|
147 |
+
}
|
148 |
+
if ( $wp_version >= 4.6 )
|
149 |
+
echo '</p>';
|
150 |
+
echo '</div>
|
151 |
+
</td>
|
152 |
+
</tr>';
|
153 |
+
} elseif ( isset( $bstwbsftwppdtplgns_options['trial'][ $plugin_key ] ) ) {
|
154 |
+
$explode_plugin_key = explode( '/', $plugin_key );
|
155 |
+
$class = ( $wp_version >= 4.6 ) ? 'active' : '';
|
156 |
+
$style = ( $wp_version < 4.6 ) ? ' style="color: #8C0000;"' : '';
|
157 |
+
$div_class = ( $wp_version >= 4.6 ) ? ' notice inline notice-warning notice-alt' : '';
|
158 |
+
echo '<tr class="bws-plugin-update-tr plugin-update-tr ' . $class . '" id="' . $explode_plugin_key[0] . '-update" data-slug="' . $explode_plugin_key[0] . '" data-plugin="' . $plugin_key . '">
|
159 |
+
<td colspan="' . $wp_list_table->get_column_count() . '" class="plugin-update colspanchange">
|
160 |
+
<div class="update-message' . $div_class . '"' . $style . '>';
|
161 |
+
if ( $wp_version >= 4.6 )
|
162 |
+
echo '<p>';
|
163 |
+
if ( $free_plugin_name != false ) {
|
164 |
+
echo sprintf( __( 'Notice: You are using the Pro Trial license of %s plugin.', 'bestwebsoft' ), $free_plugin_name );
|
165 |
+
} else {
|
166 |
+
_e( 'Notice: You are using the Pro Trial license of plugin.', 'bestwebsoft' );
|
167 |
+
}
|
168 |
+
if ( isset( $bstwbsftwppdtplgns_options['time_out'][ $plugin_key ] ) )
|
169 |
+
echo ' ' . __( "The Pro Trial license will expire on", 'bestwebsoft' ) . ' ' . $bstwbsftwppdtplgns_options['time_out'][ $plugin_key ] . '.';
|
170 |
+
if ( $wp_version >= 4.6 )
|
171 |
+
echo '</p>';
|
172 |
+
echo '</div>
|
173 |
+
</td>
|
174 |
+
</tr>';
|
175 |
+
}
|
176 |
+
}
|
177 |
+
}
|
178 |
+
|
179 |
if ( ! function_exists( 'bws_admin_notices' ) ) {
|
180 |
function bws_admin_notices() {
|
181 |
+
global $bws_versions_notice_array, $bws_plugin_banner_to_settings, $bstwbsftwppdtplgns_options;
|
182 |
|
183 |
/* versions notice */
|
184 |
if ( ! empty( $bws_versions_notice_array ) ) {
|
252 |
</div>
|
253 |
<?php }
|
254 |
}
|
255 |
+
|
256 |
+
/**
|
257 |
+
* show notices about deprecated_function
|
258 |
+
* @since 1.9.8
|
259 |
+
*/
|
260 |
+
if ( ! empty( $bstwbsftwppdtplgns_options['deprecated_function'] ) ) { ?>
|
261 |
+
<div class="update-nag">
|
262 |
+
<strong><?php _e( 'Deprecated function(-s) is used on the site here:', 'bestwebsoft' ); ?></strong>
|
263 |
+
<?php $i = 1;
|
264 |
+
foreach ( $bstwbsftwppdtplgns_options['deprecated_function'] as $function_name => $attr ) {
|
265 |
+
if ( 1 != $i )
|
266 |
+
echo ' ,';
|
267 |
+
if ( ! empty( $attr['product-name'] ) ) {
|
268 |
+
echo $attr['product-name'];
|
269 |
+
} elseif ( ! empty( $attr['file'] ) ) {
|
270 |
+
echo $attr['file'];
|
271 |
+
}
|
272 |
+
unset( $bstwbsftwppdtplgns_options['deprecated_function'][ $function_name ] );
|
273 |
+
$i++;
|
274 |
+
} ?>.
|
275 |
+
<br/>
|
276 |
+
<?php _e( 'This function(-s) will be removed over time. Please update the product(-s).', 'bestwebsoft' ); ?>
|
277 |
+
</div>
|
278 |
+
<?php if ( is_multisite() )
|
279 |
+
update_site_option( 'bstwbsftwppdtplgns_options', $bstwbsftwppdtplgns_options );
|
280 |
+
else
|
281 |
+
update_option( 'bstwbsftwppdtplgns_options', $bstwbsftwppdtplgns_options );
|
282 |
+
}
|
283 |
}
|
284 |
}
|
285 |
|
336 |
<span><?php _e( 'Extend standard plugin functionality with new great options.', 'bestwebsoft' ); ?></span>
|
337 |
</div>
|
338 |
<div class="button_div">
|
339 |
+
<a class="button" target="_blank" href="https://bestwebsoft.com/products/wordpress/plugins/<?php echo $link_slug; ?>/?k=<?php echo $link_key; ?>&pn=<?php echo $link_pn; ?>&v=<?php echo $plugin_info["Version"]; ?>&wp_v=<?php echo $wp_version; ?>"><?php _e( 'Learn More', 'bestwebsoft' ); ?></a>
|
340 |
</div>
|
341 |
</div>
|
342 |
</div>
|
349 |
}
|
350 |
}
|
351 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
352 |
if ( ! function_exists ( 'bws_plugin_banner_timeout' ) ) {
|
353 |
function bws_plugin_banner_timeout( $plugin_key, $plugin_prefix, $plugin_name, $banner_url = false ) {
|
354 |
global $bstwbsftwppdtplgns_options, $bstwbsftwppdtplgns_cookie_add;
|
379 |
<div class="icon">
|
380 |
<img title="" src="<?php echo $banner_url; ?>" alt="" />
|
381 |
</div>
|
382 |
+
<div class="text"><?php printf( __( "Your license key for %s expires on %s and you won't be granted TOP-PRIORITY SUPPORT or UPDATES.", 'bestwebsoft' ), '<strong>' . $plugin_name . '</strong>', $bstwbsftwppdtplgns_options['time_out'][ $plugin_key ] ); ?> <a target="_new" href="https://support.bestwebsoft.com/entries/53487136"><?php _e( "Learn more", 'bestwebsoft' ); ?></a></div>
|
383 |
</div>
|
384 |
</div>
|
385 |
<?php }
|
476 |
<div class="text">
|
477 |
<strong><?php _e( 'Thank you for choosing', 'bestwebsoft' ); ?> <?php echo $plugin_info['Name']; ?> plugin!</strong><br />
|
478 |
<?php _e( "If you have a feature, suggestion or idea you'd like to see in the plugin, we'd love to hear about it!", 'bestwebsoft' ); ?>
|
479 |
+
<a target="_blank" href="https://support.bestwebsoft.com/hc/en-us/requests/new"><?php _e( 'Suggest a Feature', 'bestwebsoft' ); ?></a>
|
480 |
</div>
|
481 |
<form action="" method="post">
|
482 |
<button class="notice-dismiss bws_hide_settings_notice" title="<?php _e( 'Close notice', 'bestwebsoft' ); ?>"></button>
|
507 |
$options['hide_premium_options'][] = get_current_user_id();
|
508 |
|
509 |
return array(
|
510 |
+
'message' => __( 'You can always look at premium options by checking the "Pro Options" in the "Misc" tab.', 'bestwebsoft' ),
|
511 |
'options' => $options );
|
512 |
}
|
513 |
}
|
523 |
|
524 |
if ( ! function_exists ( 'bws_plugins_admin_init' ) ) {
|
525 |
function bws_plugins_admin_init() {
|
|
|
526 |
if ( isset( $_GET['bws_activate_plugin'] ) && check_admin_referer( 'bws_activate_plugin' . $_GET['bws_activate_plugin'] ) ) {
|
527 |
|
528 |
$plugin = isset( $_GET['bws_activate_plugin'] ) ? $_GET['bws_activate_plugin'] : '';
|
561 |
|
562 |
if ( ! function_exists ( 'bws_admin_enqueue_scripts' ) ) {
|
563 |
function bws_admin_enqueue_scripts() {
|
564 |
+
global $wp_scripts;
|
565 |
+
|
566 |
+
$jquery_version = isset( $wp_scripts->registered['jquery-ui-core']->ver ) ? $wp_scripts->registered['jquery-ui-core']->ver : '1.12.1';
|
567 |
+
|
568 |
+
wp_enqueue_style( 'jquery-ui-style', '//code.jquery.com/ui/' . $jquery_version . '/themes/smoothness/jquery-ui.min.css', array(), $jquery_version );
|
569 |
wp_enqueue_style( 'bws-admin-css', bws_menu_url( 'css/general_style.css' ) );
|
570 |
+
wp_enqueue_script( 'bws-admin-scripts', bws_menu_url( 'js/general_script.js' ), array( 'jquery', 'jquery-ui-tooltip' ) );
|
571 |
|
572 |
+
if ( isset( $_GET['page'] ) && ( in_array( $_GET['page'], array( 'bws_panel', 'bws_themes', 'bws_system_status' ) ) || strpos( $_GET['page'], '-bws-panel' ) ) ) {
|
573 |
wp_enqueue_style( 'bws_menu_style', bws_menu_url( 'css/style.css' ) );
|
574 |
wp_enqueue_script( 'bws_menu_script', bws_menu_url( 'js/bws_menu.js' ) );
|
575 |
wp_enqueue_script( 'theme-install' );
|
579 |
}
|
580 |
}
|
581 |
|
582 |
+
/**
|
583 |
+
* add styles and scripts for Bws_Settings_Tabs
|
584 |
+
*
|
585 |
+
* @since 1.9.8
|
586 |
+
*/
|
587 |
+
if ( ! function_exists( 'bws_enqueue_settings_scripts' ) ) {
|
588 |
+
function bws_enqueue_settings_scripts() {
|
589 |
+
wp_enqueue_script( 'jquery-ui-resizable' );
|
590 |
+
wp_enqueue_script( 'jquery-ui-tabs' );
|
591 |
+
}
|
592 |
+
}
|
593 |
+
|
594 |
if ( ! function_exists ( 'bws_plugins_admin_head' ) ) {
|
595 |
function bws_plugins_admin_head() {
|
596 |
global $bws_shortcode_list, $wp_version, $post_type;
|
630 |
var bws_shortcode_button = {
|
631 |
'label': '<?php esc_attr_e( "Add BWS Shortcode", "bestwebsoft" ); ?>',
|
632 |
'title': '<?php esc_attr_e( "Add BWS Plugins Shortcode", "bestwebsoft" ); ?>',
|
|
|
633 |
'function_name': [
|
634 |
<?php foreach ( $bws_shortcode_list as $key => $value ) {
|
635 |
if ( isset( $value['js_function'] ) )
|
786 |
}
|
787 |
}
|
788 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
789 |
if ( ! function_exists ( 'bws_form_restore_default_confirm' ) ) {
|
790 |
function bws_form_restore_default_confirm( $plugin_basename ) { ?>
|
791 |
<div>
|
792 |
+
<p><?php _e( 'Are you sure you want to restore default settings?', 'bestwebsoft' ) ?></p>
|
793 |
<form method="post" action="">
|
794 |
<p>
|
795 |
<button class="button button-primary" name="bws_restore_confirm"><?php _e( 'Yes, restore all settings', 'bestwebsoft' ) ?></button>
|
886 |
}
|
887 |
}
|
888 |
|
889 |
+
/**
|
890 |
+
* output shortcode in a special block
|
891 |
+
* @since 1.9.8
|
892 |
+
*/
|
893 |
+
if ( ! function_exists( 'bws_shortcode_output' ) ) {
|
894 |
+
function bws_shortcode_output( $shortcode ) { ?>
|
895 |
+
<span class="bws_shortcode_output"><input type="text" onfocus="this.select();" readonly="readonly" value="<?php echo $shortcode; ?>" class="large-text bws_no_bind_notice"></span>
|
896 |
+
<?php }
|
897 |
+
}
|
898 |
+
|
899 |
+
/**
|
900 |
+
* output tooltip
|
901 |
+
* @since 1.9.8
|
902 |
+
*/
|
903 |
+
if ( ! function_exists( 'bws_add_help_box' ) ) {
|
904 |
+
function bws_add_help_box( $content, $class = '' ) {
|
905 |
+
return '<span class="bws_help_box dashicons dashicons-editor-help ' . $class . ' hide-if-no-js">
|
906 |
+
<span class="bws_hidden_help_text">' . $content . '</span>
|
907 |
+
</span>';
|
908 |
+
}
|
909 |
+
}
|
910 |
+
|
911 |
/* add help tab */
|
912 |
if ( ! function_exists( 'bws_help_tab' ) ) {
|
913 |
function bws_help_tab( $screen, $args ) {
|
914 |
+
$url = ( ! empty( $args['section'] ) ) ? 'https://support.bestwebsoft.com/hc/en-us/sections/' . $args['section'] : 'https://support.bestwebsoft.com/';
|
915 |
|
916 |
$content = '<p><a href="' . $url . '" target="_blank">' . __( 'Visit Help Center', 'bestwebsoft' ) . '</a></p>';
|
917 |
|
927 |
'<p><strong>' . __( 'For more information:', 'bestwebsoft' ) . '</strong></p>' .
|
928 |
'<p><a href="https://drive.google.com/folderview?id=0B5l8lO-CaKt9VGh0a09vUjNFNjA&usp=sharing#list" target="_blank">' . __( 'Documentation', 'bestwebsoft' ) . '</a></p>' .
|
929 |
'<p><a href="http://www.youtube.com/user/bestwebsoft/playlists?flow=grid&sort=da&view=1" target="_blank">' . __( 'Video Instructions', 'bestwebsoft' ) . '</a></p>' .
|
930 |
+
'<p><a href="https://support.bestwebsoft.com/hc/en-us/requests/new" target="_blank">' . __( 'Submit a Request', 'bestwebsoft' ) . '</a></p>'
|
931 |
);
|
932 |
}
|
933 |
}
|
934 |
|
935 |
+
if ( ! function_exists( 'bws_enqueue_custom_code_css_js' ) ) {
|
936 |
+
function bws_enqueue_custom_code_css_js() {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
937 |
global $bstwbsftwppdtplgns_options;
|
938 |
|
939 |
if ( ! isset( $bstwbsftwppdtplgns_options ) )
|
948 |
wp_enqueue_style( 'bws-custom-style', $bstwbsftwppdtplgns_options['custom_code']['bws-custom-code.css'] );
|
949 |
elseif ( $is_multisite && ! empty( $bstwbsftwppdtplgns_options['custom_code'][ $blog_id ]['bws-custom-code.css'] ) )
|
950 |
wp_enqueue_style( 'bws-custom-style', $bstwbsftwppdtplgns_options['custom_code'][ $blog_id ]['bws-custom-code.css'] );
|
951 |
+
|
952 |
+
if ( ! $is_multisite && ! empty( $bstwbsftwppdtplgns_options['custom_code']['bws-custom-code.js'] ) )
|
953 |
+
wp_enqueue_script( 'bws-custom-style', $bstwbsftwppdtplgns_options['custom_code']['bws-custom-code.js'] );
|
954 |
+
elseif ( $is_multisite && ! empty( $bstwbsftwppdtplgns_options['custom_code'][ $blog_id ]['bws-custom-code.js'] ) )
|
955 |
+
wp_enqueue_script( 'bws-custom-style', $bstwbsftwppdtplgns_options['custom_code'][ $blog_id ]['bws-custom-code.js'] );
|
956 |
}
|
957 |
}
|
958 |
}
|
974 |
$blog_id = get_current_blog_id();
|
975 |
|
976 |
if ( ! $is_multisite && ! empty( $bstwbsftwppdtplgns_options['custom_code']['bws-custom-code.php'] ) ) {
|
|
|
977 |
if ( file_exists( $bstwbsftwppdtplgns_options['custom_code']['bws-custom-code.php'] ) ) {
|
978 |
if ( ! defined( 'BWS_GLOBAL' ) )
|
979 |
define( 'BWS_GLOBAL', true );
|
1015 |
|
1016 |
/* remove bws_menu versions */
|
1017 |
unset( $bstwbsftwppdtplgns_options['bws_menu']['version'][ $basename ] );
|
1018 |
+
/* remove track usage data */
|
1019 |
+
if ( isset( $bstwbsftwppdtplgns_options['bws_menu']['track_usage']['products'][ $basename ] ) )
|
1020 |
+
unset( $bstwbsftwppdtplgns_options['bws_menu']['track_usage']['products'][ $basename ] );
|
1021 |
/* if empty ['bws_menu']['version'] - there is no other bws plugins - delete all */
|
1022 |
if ( empty( $bstwbsftwppdtplgns_options['bws_menu']['version'] ) ) {
|
1023 |
/* remove options */
|
1054 |
}
|
1055 |
}
|
1056 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1057 |
add_action( 'admin_init', 'bws_plugins_admin_init' );
|
1058 |
add_action( 'admin_enqueue_scripts', 'bws_admin_enqueue_scripts' );
|
1059 |
add_action( 'admin_head', 'bws_plugins_admin_head' );
|
1061 |
|
1062 |
add_action( 'admin_notices', 'bws_admin_notices', 30 );
|
1063 |
|
1064 |
+
add_action( 'wp_enqueue_scripts', 'bws_enqueue_custom_code_css_js', 20 );
|
1065 |
|
1066 |
bws_enqueue_custom_code_php();
|
bws_menu/bws_menu.php
CHANGED
@@ -1,7 +1,7 @@
|
|
1 |
<?php
|
2 |
/*
|
3 |
* Function for displaying BestWebSoft menu
|
4 |
-
* Version:
|
5 |
*/
|
6 |
|
7 |
if ( ! function_exists ( 'bws_admin_enqueue_scripts' ) )
|
@@ -12,7 +12,19 @@ if ( ! function_exists( 'bws_add_menu_render' ) ) {
|
|
12 |
global $wpdb, $wp_version, $bws_plugin_info, $bstwbsftwppdtplgns_options;
|
13 |
$error = $message = $bwsmn_form_email = '';
|
14 |
|
15 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
16 |
|
17 |
if ( ! function_exists( 'is_plugin_active_for_network' ) )
|
18 |
require_once( ABSPATH . 'wp-admin/includes/plugin.php' );
|
@@ -105,31 +117,31 @@ if ( ! function_exists( 'bws_add_menu_render' ) ) {
|
|
105 |
$raw_response = wp_remote_post( 'http://bestwebsoft.com/wp-content/plugins/paid-products/plugins/update-check/1.0/', $options );
|
106 |
|
107 |
if ( is_wp_error( $raw_response ) || 200 != wp_remote_retrieve_response_code( $raw_response ) ) {
|
108 |
-
$error = __( "Something went wrong. Please try again later. If the error appears again, please contact us", 'bestwebsoft' ) . ' <a href="
|
109 |
} else {
|
110 |
$response = maybe_unserialize( wp_remote_retrieve_body( $raw_response ) );
|
111 |
if ( is_array( $response ) && !empty( $response ) ) {
|
112 |
foreach ( $response as $key => $value ) {
|
113 |
if ( "wrong_license_key" == $value->package ) {
|
114 |
-
$error = __( "Wrong license key", 'bestwebsoft' );
|
115 |
} elseif ( "wrong_domain" == $value->package ) {
|
116 |
-
$error = __( 'This license key is
|
117 |
} elseif ( "you_are_banned" == $value->package ) {
|
118 |
$error = __( "Unfortunately, you have exceeded the number of available tries per day.", 'bestwebsoft' );
|
119 |
} elseif ( "time_out" == $value->package ) {
|
120 |
-
$error = __( "Unfortunately, Your license has expired. To continue getting top-priority support and plugin updates you should extend it in your", 'bestwebsoft' )
|
121 |
} elseif ( "duplicate_domen_for_trial" == $value->package ) {
|
122 |
$error = __( "Unfortunately, the Pro licence was already installed to this domain. The Pro Trial license can be installed only once.", 'bestwebsoft' );
|
123 |
} elseif ( is_array( $value->package ) && ! empty( $value->package ) ) {
|
124 |
$plugins_array = $_SESSION['bws_membership_list'] = $value->package;
|
125 |
$_SESSION['bws_membership_time_check'] = strtotime( 'now' );
|
126 |
|
127 |
-
if ( $bws_license_key == $bstwbsftwppdtplgns_options[ $bws_license_plugin ] ) {
|
128 |
$message = __( 'The license key is valid.', 'bestwebsoft' );
|
129 |
if ( isset( $value->time_out ) && $value->time_out != '' )
|
130 |
$message .= ' ' . __( 'Your license will expire on', 'bestwebsoft' ) . ' ' . $value->time_out . '.';
|
131 |
} else {
|
132 |
-
$message = __( 'Congratulations! Pro Membership license is successfully
|
133 |
}
|
134 |
|
135 |
$bstwbsftwppdtplgns_options[ $bws_license_plugin ] = $bws_license_key;
|
@@ -149,9 +161,8 @@ if ( ! function_exists( 'bws_add_menu_render' ) ) {
|
|
149 |
$error = __( "Please enter your license key.", 'bestwebsoft' );
|
150 |
}
|
151 |
}
|
152 |
-
}
|
153 |
|
154 |
-
if ( 'bws_system_status' == $_GET['page'] ) {
|
155 |
$all_plugins = get_plugins();
|
156 |
$active_plugins = get_option( 'active_plugins' );
|
157 |
$mysql_info = $wpdb->get_results( "SHOW VARIABLES LIKE 'sql_mode'" );
|
@@ -160,12 +171,12 @@ if ( ! function_exists( 'bws_add_menu_render' ) ) {
|
|
160 |
if ( empty( $sql_mode ) )
|
161 |
$sql_mode = __( 'Not set', 'bestwebsoft' );
|
162 |
|
163 |
-
$safe_mode = ( ini_get( 'safe_mode' ) ) ? __( 'On', 'bestwebsoft' ) : __( 'Off', 'bestwebsoft' );
|
164 |
$allow_url_fopen = ( ini_get( 'allow_url_fopen' ) ) ? __( 'On', 'bestwebsoft' ) : __( 'Off', 'bestwebsoft' );
|
165 |
$upload_max_filesize = ( ini_get( 'upload_max_filesize' ) )? ini_get( 'upload_max_filesize' ) : __( 'N/A', 'bestwebsoft' );
|
166 |
$post_max_size = ( ini_get( 'post_max_size' ) ) ? ini_get( 'post_max_size' ) : __( 'N/A', 'bestwebsoft' );
|
167 |
$max_execution_time = ( ini_get( 'max_execution_time' ) ) ? ini_get( 'max_execution_time' ) : __( 'N/A', 'bestwebsoft' );
|
168 |
$memory_limit = ( ini_get( 'memory_limit' ) ) ? ini_get( 'memory_limit' ) : __( 'N/A', 'bestwebsoft' );
|
|
|
169 |
$memory_usage = ( function_exists( 'memory_get_usage' ) ) ? round( memory_get_usage() / 1024 / 1024, 2 ) . __( ' Mb', 'bestwebsoft' ) : __( 'N/A', 'bestwebsoft' );
|
170 |
$exif_read_data = ( is_callable( 'exif_read_data' ) ) ? __( 'Yes', 'bestwebsoft' ) . " ( V" . substr( phpversion( 'exif' ), 0,4 ) . ")" : __( 'No', 'bestwebsoft' );
|
171 |
$iptcparse = ( is_callable( 'iptcparse' ) ) ? __( 'Yes', 'bestwebsoft' ) : __( 'No', 'bestwebsoft' );
|
@@ -173,53 +184,74 @@ if ( ! function_exists( 'bws_add_menu_render' ) ) {
|
|
173 |
$theme = ( function_exists( 'wp_get_theme' ) ) ? wp_get_theme() : get_theme( get_current_theme() );
|
174 |
|
175 |
if ( function_exists( 'is_multisite' ) ) {
|
176 |
-
|
177 |
-
$multisite = __( 'Yes', 'bestwebsoft' );
|
178 |
-
else
|
179 |
-
$multisite = __( 'No', 'bestwebsoft' );
|
180 |
} else {
|
181 |
$multisite = __( 'N/A', 'bestwebsoft' );
|
182 |
}
|
183 |
|
184 |
$system_info = array(
|
185 |
-
'
|
186 |
-
|
187 |
-
|
188 |
-
|
189 |
-
|
190 |
-
|
191 |
-
|
192 |
-
|
193 |
-
|
194 |
-
|
195 |
-
|
196 |
-
|
197 |
-
|
198 |
-
|
199 |
-
|
200 |
-
|
201 |
-
|
202 |
-
|
203 |
-
|
204 |
-
|
205 |
-
|
206 |
-
|
207 |
-
|
208 |
-
|
209 |
-
|
210 |
-
|
211 |
-
|
212 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
213 |
);
|
|
|
214 |
foreach ( $all_plugins as $path => $plugin ) {
|
215 |
-
|
216 |
-
|
217 |
-
|
218 |
-
$system_info['
|
|
|
|
|
|
|
|
|
219 |
}
|
220 |
|
221 |
-
|
222 |
-
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' ) ) ) {
|
223 |
if ( isset( $_REQUEST['bwsmn_form_email'] ) ) {
|
224 |
$bwsmn_form_email = esc_html( trim( $_REQUEST['bwsmn_form_email'] ) );
|
225 |
if ( $bwsmn_form_email == "" || ! is_email( $bwsmn_form_email ) ) {
|
@@ -227,7 +259,7 @@ if ( ! function_exists( 'bws_add_menu_render' ) ) {
|
|
227 |
} else {
|
228 |
$email = $bwsmn_form_email;
|
229 |
$bwsmn_form_email = '';
|
230 |
-
$message = __( 'Email with system info is sent to
|
231 |
}
|
232 |
} else {
|
233 |
$email = 'plugin_system_status@bestwebsoft.com';
|
@@ -238,28 +270,18 @@ if ( ! function_exists( 'bws_add_menu_render' ) ) {
|
|
238 |
$headers = 'MIME-Version: 1.0' . "\n";
|
239 |
$headers .= 'Content-type: text/html; charset=utf-8' . "\n";
|
240 |
$headers .= 'From: ' . get_option( 'admin_email' );
|
241 |
-
$message_text = '<html><head><title>System Info From ' . home_url() . '</title></head><body>
|
242 |
-
|
243 |
-
|
244 |
-
|
245 |
-
|
246 |
-
|
247 |
-
|
248 |
-
|
249 |
-
|
250 |
-
|
251 |
-
|
252 |
-
$message_text .= '<tr><td scope="row">'. $key .'</td><td scope="row">'. $value .'</td></tr>';
|
253 |
-
}
|
254 |
-
$message_text .= '</table>';
|
255 |
-
}
|
256 |
-
if ( ! empty( $system_info['inactive_plugins'] ) ) {
|
257 |
-
$message_text .= '<h4>Inactive Plugins</h4>
|
258 |
-
<table>';
|
259 |
-
foreach ( $system_info['inactive_plugins'] as $key => $value ) {
|
260 |
-
$message_text .= '<tr><td scope="row">'. $key .'</td><td scope="row">'. $value .'</td></tr>';
|
261 |
}
|
262 |
-
$message_text .= '</table>';
|
263 |
}
|
264 |
$message_text .= '</body></html>';
|
265 |
$result = wp_mail( $email, 'System Info From ' . home_url(), $message_text, $headers );
|
@@ -271,31 +293,37 @@ if ( ! function_exists( 'bws_add_menu_render' ) ) {
|
|
271 |
<div class="bws-wrap">
|
272 |
<div class="bws-header">
|
273 |
<div class="bws-title">
|
274 |
-
<a href="<?php echo self_admin_url( 'admin.php?page=bws_panel' ); ?>">
|
275 |
-
<
|
276 |
BestWebSoft
|
277 |
<span>panel</span>
|
278 |
</a>
|
279 |
</div>
|
280 |
-
<div class="bws-menu-item-icon">•••</div>
|
281 |
<div class="bws-nav-tab-wrapper">
|
282 |
-
|
283 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
284 |
</div>
|
285 |
<div class="bws-help-links-wrapper">
|
286 |
-
<a
|
287 |
-
<a href="<?php echo esc_url( '
|
288 |
-
<a href="<?php echo esc_url( 'http://bestwebsoft.com/wp-admin/admin.php?page=client-area' ); ?>" target="_blank" title="<?php _e( 'Manage purchased licenses & subscriptions', 'bestwebsoft' ); ?>"><?php _e( 'Client Area', 'bestwebsoft' ); ?></a>
|
289 |
</div>
|
290 |
<div class="clear"></div>
|
291 |
</div>
|
292 |
-
<?php if ( 'bws_panel' == $_GET['
|
293 |
<div class="bws-membership-wrap">
|
294 |
<div class="bws-membership-backround"></div>
|
295 |
<div class="bws-membership">
|
296 |
<div class="bws-membership-title"><?php printf( __( 'Get Access to %s+ Premium Plugins', 'bestwebsoft' ), '30' ); ?></div>
|
297 |
<form class="bws-membership-form" method="post" action="">
|
298 |
-
<span class="bws-membership-link"><a target="_blank" href="
|
299 |
<?php if ( isset( $bstwbsftwppdtplgns_options['go_pro'][ $bws_license_plugin ]['count'] ) &&
|
300 |
'5' < $bstwbsftwppdtplgns_options['go_pro'][ $bws_license_plugin ]['count'] &&
|
301 |
$bstwbsftwppdtplgns_options['go_pro'][ $bws_license_plugin ]['time'] > ( time() - ( 24 * 60 * 60 ) ) ) { ?>
|
@@ -324,7 +352,7 @@ if ( ! function_exists( 'bws_add_menu_render' ) ) {
|
|
324 |
</div>
|
325 |
<?php } ?>
|
326 |
<div class="bws-wrap-content wrap">
|
327 |
-
<?php if ( 'bws_panel' == $_GET['
|
328 |
<div class="updated notice is-dismissible inline" <?php if ( '' == $message || '' != $error ) echo "style=\"display:none\""; ?>><p><?php echo $message; ?></p></div>
|
329 |
<h1>
|
330 |
<?php _e( 'Plugins', 'bestwebsoft' ); ?>
|
@@ -394,7 +422,7 @@ if ( ! function_exists( 'bws_add_menu_render' ) ) {
|
|
394 |
$error = __( "Your server does not support either ZipArchive or Phar. Please, upload the plugin manually", 'bestwebsoft' );
|
395 |
}
|
396 |
if ( empty( $error ) )
|
397 |
-
echo '<p>' . __( '
|
398 |
|
399 |
@unlink( $file_put_contents );
|
400 |
} else {
|
@@ -406,19 +434,19 @@ if ( ! function_exists( 'bws_add_menu_render' ) ) {
|
|
406 |
}
|
407 |
|
408 |
if ( file_exists( WP_PLUGIN_DIR . '/' . $zip_name[0] ) ) {
|
409 |
-
echo '<p><a href="' . wp_nonce_url( '
|
410 |
} else {
|
411 |
if ( empty( $error ) )
|
412 |
$error = __( "Failed to download the zip archive. Please, upload the plugin manually", 'bestwebsoft' );
|
413 |
|
414 |
echo '<p class="error">' . $error . '</p>';
|
415 |
-
echo '<p><a href="' . self_admin_url(
|
416 |
}
|
417 |
} else { ?>
|
418 |
<ul class="subsubsub">
|
419 |
-
<li><a <?php if ( !isset( $_GET['sub'] ) ) echo 'class="current" '; ?>href="
|
420 |
-
<li><a <?php if ( isset( $_GET['sub'] ) && 'installed' == $_GET['sub'] ) echo 'class="current" '; ?>href="
|
421 |
-
<li><a <?php if ( isset( $_GET['sub'] ) && 'not_installed' == $_GET['sub'] ) echo 'class="current" '; ?>href="
|
422 |
</ul>
|
423 |
<div class="clear"></div>
|
424 |
<div class="bws-filter-top">
|
@@ -431,13 +459,13 @@ if ( ! function_exists( 'bws_add_menu_render' ) ) {
|
|
431 |
<ul class="bws-category">
|
432 |
<li>
|
433 |
<?php $sub_in_url = ( isset( $_GET['sub'] ) && in_array( $_GET['sub'], array( 'installed', 'not_installed' ) ) ) ? '&sub=' . $_GET['sub'] : ''; ?>
|
434 |
-
<a <?php if ( 'all' == $plugin_category ) echo ' class="bws-active"'; ?> href="<?php echo self_admin_url(
|
435 |
<span>(<?php echo count( $bws_plugins ); ?>)</span>
|
436 |
</a>
|
437 |
</li>
|
438 |
<?php foreach ( $bws_plugins_category as $category_key => $category_value ) { ?>
|
439 |
<li>
|
440 |
-
<a <?php if ( $category_key == $plugin_category ) echo ' class="bws-active"'; ?> href="<?php echo esc_url( self_admin_url(
|
441 |
<span>(<?php echo $category_value['count']; ?>)</span>
|
442 |
</a>
|
443 |
</li>
|
@@ -495,7 +523,7 @@ if ( ! function_exists( 'bws_add_menu_render' ) ) {
|
|
495 |
}
|
496 |
|
497 |
if ( ! empty( $value_plugin['expired'] ) ) {
|
498 |
-
echo ' - <a class="bws-update-now" href="
|
499 |
} elseif ( ! empty( $value_plugin['update_availible'] ) ) {
|
500 |
$r = $update_availible_all->response[ $value_plugin['update_availible'] ];
|
501 |
echo ' - <a class="bws-update-now" href="' . 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( __( 'Update to v %s', 'bestwebsoft' ), $r->new_version ) . '">' . sprintf( __( 'Update to v %s', 'bestwebsoft' ), $r->new_version ) . '</a>';
|
@@ -520,7 +548,7 @@ if ( ! function_exists( 'bws_add_menu_render' ) ) {
|
|
520 |
<?php }
|
521 |
}
|
522 |
} else { ?>
|
523 |
-
<a class="bws_donate" href="
|
524 |
<?php }
|
525 |
|
526 |
if ( $is_pro_active ) { ?>
|
@@ -530,7 +558,7 @@ if ( ! function_exists( 'bws_add_menu_render' ) ) {
|
|
530 |
<?php }
|
531 |
} else {
|
532 |
if ( $is_pro_installed ) { ?>
|
533 |
-
<a class="button button-secondary" href="<?php echo wp_nonce_url( '
|
534 |
<?php } elseif ( ! empty( $plugins_array ) && isset( $value_plugin['pro_version'] ) && array_key_exists( $value_plugin['pro_version'], $plugins_array ) ) { ?>
|
535 |
<form method="post" action="">
|
536 |
<input type="submit" class="button button-secondary" value="<?php _e( 'Install Now', 'bestwebsoft' ); ?>" />
|
@@ -539,7 +567,7 @@ if ( ! function_exists( 'bws_add_menu_render' ) ) {
|
|
539 |
<?php wp_nonce_field( plugin_basename(__FILE__), 'bws_license_install_nonce_name' ); ?>
|
540 |
</form>
|
541 |
<?php } elseif ( $is_installed ) { ?>
|
542 |
-
<a class="button button-secondary" href="<?php echo wp_nonce_url( '
|
543 |
<?php } else {
|
544 |
$install_url = isset( $value_plugin['install_url'] ) ? $value_plugin['install_url'] : esc_url( self_admin_url( 'plugin-install.php?tab=search&type=term&s=' . str_replace( ' ', '+', str_replace( '-', '', $value_plugin['name'] ) ) . '+BestWebSoft&plugin-search-input=Search+Plugins' ) ); ?>
|
545 |
<a class="button button-secondary" href="<?php echo $install_url; ?>" title="<?php _e( 'Install this plugin', 'bestwebsoft' ); ?>" target="_blank"><?php _e( 'Install Now', 'bestwebsoft' ); ?></a>
|
@@ -560,13 +588,13 @@ if ( ! function_exists( 'bws_add_menu_render' ) ) {
|
|
560 |
<ul class="bws-category">
|
561 |
<li>
|
562 |
<?php $sub_in_url = ( isset( $_GET['sub'] ) && in_array( $_GET['sub'], array( 'installed', 'not_installed' ) ) ) ? '&sub=' . $_GET['sub'] : ''; ?>
|
563 |
-
<a <?php if ( 'all' == $plugin_category ) echo ' class="bws-active"'; ?> href="<?php echo self_admin_url(
|
564 |
<span>(<?php echo count( $bws_plugins ); ?>)</span>
|
565 |
</a>
|
566 |
</li>
|
567 |
<?php foreach ( $bws_plugins_category as $category_key => $category_value ) { ?>
|
568 |
<li>
|
569 |
-
<a <?php if ( $category_key == $plugin_category ) echo ' class="bws-active"'; ?> href="<?php echo esc_url( self_admin_url(
|
570 |
<span>(<?php echo $category_value['count']; ?>)</span>
|
571 |
</a>
|
572 |
</li>
|
@@ -576,7 +604,7 @@ if ( ! function_exists( 'bws_add_menu_render' ) ) {
|
|
576 |
</div><!-- #bws-filter-wrapper -->
|
577 |
<div class="clear"></div>
|
578 |
<?php }
|
579 |
-
} elseif ( 'bws_themes' == $
|
580 |
require( dirname( __FILE__ ) . '/product_list.php' ); ?>
|
581 |
<h1><?php _e( 'Themes', 'bestwebsoft' ); ?></h1>
|
582 |
<div id="availablethemes" class="bws-availablethemes">
|
@@ -628,7 +656,7 @@ if ( ! function_exists( 'bws_add_menu_render' ) ) {
|
|
628 |
<?php } ?>
|
629 |
<p><a class="bws_browse_link" href="http://bestweblayout.com/categories/themes/" target="_blank"><?php _e( 'Browse Free WordPress Themes', 'bestwebsoft' ); ?> <span class="dashicons dashicons-arrow-right-alt2"></span></a></p>
|
630 |
</div>
|
631 |
-
<?php } elseif ( 'bws_system_status' == $
|
632 |
<h1><?php _e( 'System status', 'bestwebsoft' ); ?></h1>
|
633 |
<div class="updated fade notice is-dismissible inline" <?php if ( ! ( isset( $_REQUEST['bwsmn_form_submit'] ) || isset( $_REQUEST['bwsmn_form_submit_custom_email'] ) ) || $error != "" ) echo "style=\"display:none\""; ?>><p><strong><?php echo $message; ?></strong></p></div>
|
634 |
<div class="error" <?php if ( "" == $error ) echo "style=\"display:none\""; ?>><p><strong><?php echo $error; ?></strong></p></div>
|
@@ -647,47 +675,30 @@ if ( ! function_exists( 'bws_add_menu_render' ) ) {
|
|
647 |
<?php wp_nonce_field( plugin_basename(__FILE__), 'bwsmn_nonce_submit_custom_email' ); ?>
|
648 |
</p>
|
649 |
</form>
|
650 |
-
|
651 |
-
<table class="
|
652 |
-
<thead
|
653 |
-
<tbody>
|
654 |
-
<?php foreach ( $system_info['system_info'] as $key => $value ) { ?>
|
655 |
<tr>
|
656 |
-
<
|
657 |
-
|
|
|
|
|
|
|
|
|
|
|
658 |
</tr>
|
659 |
-
|
660 |
-
</tbody>
|
661 |
-
</table>
|
662 |
-
<table class="bws_system_info">
|
663 |
-
<thead><tr><th><?php _e( 'Active Plugins', 'bestwebsoft' ); ?></th><th></th></tr></thead>
|
664 |
-
<tbody>
|
665 |
-
<?php if ( ! empty( $system_info['active_plugins'] ) ) {
|
666 |
-
foreach ( $system_info['active_plugins'] as $key => $value ) { ?>
|
667 |
-
<tr>
|
668 |
-
<td scope="row"><?php echo $key; ?></td>
|
669 |
-
<td scope="row"><?php echo $value; ?></td>
|
670 |
-
</tr>
|
671 |
-
<?php }
|
672 |
-
} ?>
|
673 |
-
</tbody>
|
674 |
-
</table>
|
675 |
-
<table class="bws_system_info">
|
676 |
-
<thead><tr><th><?php _e( 'Inactive Plugins', 'bestwebsoft' ); ?></th><th></th></tr></thead>
|
677 |
<tbody>
|
678 |
-
|
679 |
-
foreach ( $system_info['inactive_plugins'] as $key => $value ) { ?>
|
680 |
<tr>
|
681 |
<td scope="row"><?php echo $key; ?></td>
|
682 |
<td scope="row"><?php echo $value; ?></td>
|
683 |
</tr>
|
684 |
-
<?php }
|
685 |
-
} ?>
|
686 |
</tbody>
|
687 |
</table>
|
688 |
-
|
689 |
-
|
690 |
-
<?php } ?>
|
691 |
</div>
|
692 |
</div>
|
693 |
<?php }
|
1 |
<?php
|
2 |
/*
|
3 |
* Function for displaying BestWebSoft menu
|
4 |
+
* Version: 2.0.3
|
5 |
*/
|
6 |
|
7 |
if ( ! function_exists ( 'bws_admin_enqueue_scripts' ) )
|
12 |
global $wpdb, $wp_version, $bws_plugin_info, $bstwbsftwppdtplgns_options;
|
13 |
$error = $message = $bwsmn_form_email = '';
|
14 |
|
15 |
+
/**
|
16 |
+
* @deprecated 1.9.8 (15.12.2016)
|
17 |
+
*/
|
18 |
+
$is_main_page = in_array( $_GET['page'], array( 'bws_panel', 'bws_themes', 'bws_system_status' ) );
|
19 |
+
$page = esc_attr( $_GET['page'] );
|
20 |
+
$tab = isset( $_GET['tab'] ) ? esc_attr( $_GET['tab'] ) : '';
|
21 |
+
|
22 |
+
if ( $is_main_page )
|
23 |
+
$current_page = 'admin.php?page=' . $page;
|
24 |
+
else
|
25 |
+
$current_page = isset( $_GET['tab'] ) ? 'admin.php?page=' . $page . '&tab=' . $tab : 'admin.php?page=' . $page;
|
26 |
+
|
27 |
+
if ( 'bws_panel' == $page || ( ! $is_main_page && '' == $tab ) ) {
|
28 |
|
29 |
if ( ! function_exists( 'is_plugin_active_for_network' ) )
|
30 |
require_once( ABSPATH . 'wp-admin/includes/plugin.php' );
|
117 |
$raw_response = wp_remote_post( 'http://bestwebsoft.com/wp-content/plugins/paid-products/plugins/update-check/1.0/', $options );
|
118 |
|
119 |
if ( is_wp_error( $raw_response ) || 200 != wp_remote_retrieve_response_code( $raw_response ) ) {
|
120 |
+
$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' );
|
121 |
} else {
|
122 |
$response = maybe_unserialize( wp_remote_retrieve_body( $raw_response ) );
|
123 |
if ( is_array( $response ) && !empty( $response ) ) {
|
124 |
foreach ( $response as $key => $value ) {
|
125 |
if ( "wrong_license_key" == $value->package ) {
|
126 |
+
$error = __( "Wrong license key.", 'bestwebsoft' );
|
127 |
} elseif ( "wrong_domain" == $value->package ) {
|
128 |
+
$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>';
|
129 |
} elseif ( "you_are_banned" == $value->package ) {
|
130 |
$error = __( "Unfortunately, you have exceeded the number of available tries per day.", 'bestwebsoft' );
|
131 |
} elseif ( "time_out" == $value->package ) {
|
132 |
+
$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>' );
|
133 |
} elseif ( "duplicate_domen_for_trial" == $value->package ) {
|
134 |
$error = __( "Unfortunately, the Pro licence was already installed to this domain. The Pro Trial license can be installed only once.", 'bestwebsoft' );
|
135 |
} elseif ( is_array( $value->package ) && ! empty( $value->package ) ) {
|
136 |
$plugins_array = $_SESSION['bws_membership_list'] = $value->package;
|
137 |
$_SESSION['bws_membership_time_check'] = strtotime( 'now' );
|
138 |
|
139 |
+
if ( isset( $bstwbsftwppdtplgns_options[ $bws_license_plugin ] ) && $bws_license_key == $bstwbsftwppdtplgns_options[ $bws_license_plugin ] ) {
|
140 |
$message = __( 'The license key is valid.', 'bestwebsoft' );
|
141 |
if ( isset( $value->time_out ) && $value->time_out != '' )
|
142 |
$message .= ' ' . __( 'Your license will expire on', 'bestwebsoft' ) . ' ' . $value->time_out . '.';
|
143 |
} else {
|
144 |
+
$message = __( 'Congratulations! Pro Membership license is activated successfully.', 'bestwebsoft' );
|
145 |
}
|
146 |
|
147 |
$bstwbsftwppdtplgns_options[ $bws_license_plugin ] = $bws_license_key;
|
161 |
$error = __( "Please enter your license key.", 'bestwebsoft' );
|
162 |
|