Version Description
- 04.12.2017 =
- Bugfix : The compatibility issue with Google Captcha (reCAPTCHA) plugin has been fixed.
- Bugfix : The compatibility issue with Captcha plugin has been fixed.
- NEW : The Indonesian language file has been added.
Download this release
Release Info
Developer | bestwebsoft |
Plugin | Contact Form by BestWebSoft |
Version | 4.0.8 |
Comparing to | |
See all releases |
Code changes from version 4.0.7 to 4.0.8
- bws_menu/bws_functions.php +76 -64
- bws_menu/bws_include.php +2 -1
- bws_menu/bws_menu.php +90 -103
- bws_menu/class-bws-settings.php +52 -41
- bws_menu/css/modal.css +114 -0
- bws_menu/deactivation-form.php +429 -0
- bws_menu/deprecated.php +30 -26
- bws_menu/fonts/bwsicons.eot +0 -0
- bws_menu/fonts/bwsicons.svg +1 -4
- bws_menu/fonts/bwsicons.ttf +0 -0
- bws_menu/fonts/bwsicons.woff +0 -0
- bws_menu/languages/bestwebsoft-cs_CZ.mo +0 -0
- bws_menu/languages/bestwebsoft-cs_CZ.po +546 -297
- bws_menu/languages/bestwebsoft-es_ES.mo +0 -0
- bws_menu/languages/bestwebsoft-es_ES.po +1791 -0
- bws_menu/languages/bestwebsoft-fr_FR.mo +0 -0
- bws_menu/languages/bestwebsoft-fr_FR.po +412 -286
- bws_menu/languages/bestwebsoft-id_ID.mo +0 -0
- bws_menu/languages/bestwebsoft-id_ID.po +409 -283
- bws_menu/languages/bestwebsoft-nl_NL.mo +0 -0
- bws_menu/languages/bestwebsoft-nl_NL.po +409 -283
- bws_menu/languages/bestwebsoft-pl_PL.mo +0 -0
- bws_menu/languages/bestwebsoft-pl_PL.po +415 -289
- bws_menu/languages/bestwebsoft-ru_RU.mo +0 -0
- bws_menu/languages/bestwebsoft-ru_RU.po +462 -290
- bws_menu/languages/bestwebsoft-uk.mo +0 -0
- bws_menu/languages/bestwebsoft-uk.po +456 -291
- bws_menu/product_list.php +14 -25
- contact_form.php +367 -378
- languages/contact-form-plugin-af_ZA.mo +0 -0
- languages/contact-form-plugin-af_ZA.po +271 -247
- languages/contact-form-plugin-ca.mo +0 -0
- languages/contact-form-plugin-ca.po +253 -242
- languages/contact-form-plugin-cs_CZ.mo +0 -0
- languages/contact-form-plugin-cs_CZ.po +271 -246
- languages/contact-form-plugin-da_DK.mo +0 -0
- languages/contact-form-plugin-da_DK.po +274 -250
- languages/contact-form-plugin-de_DE.mo +0 -0
- languages/contact-form-plugin-de_DE.po +271 -247
- languages/contact-form-plugin-el.mo +0 -0
- languages/contact-form-plugin-el.po +275 -251
- languages/contact-form-plugin-es_ES.mo +0 -0
- languages/contact-form-plugin-es_ES.po +270 -246
- languages/contact-form-plugin-et.mo +0 -0
- languages/contact-form-plugin-et.po +270 -246
- languages/contact-form-plugin-fr_FR.mo +0 -0
- languages/contact-form-plugin-fr_FR.po +271 -247
- languages/contact-form-plugin-id_ID.mo +0 -0
- languages/contact-form-plugin-id_ID.po +1337 -0
bws_menu/bws_functions.php
CHANGED
@@ -4,6 +4,7 @@
|
|
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.
|
@@ -55,7 +56,7 @@ if ( ! function_exists ( 'bws_menu_url' ) ) {
|
|
55 |
* Function check if plugin is compatible with current WP version
|
56 |
* @return void
|
57 |
*/
|
58 |
-
if ( ! function_exists
|
59 |
function bws_wp_min_version_check( $plugin_basename, $plugin_info, $require_wp, $min_wp = false ) {
|
60 |
global $wp_version, $bws_versions_notice_array;
|
61 |
if ( false == $min_wp )
|
@@ -89,7 +90,7 @@ if ( ! function_exists( 'bws_plugin_reviews_block' ) ) {
|
|
89 |
<div class="bws-plugin-reviews">
|
90 |
<div class="bws-plugin-reviews-rate">
|
91 |
<?php _e( 'Like the plugin?', 'bestwebsoft' ); ?>
|
92 |
-
<a href="
|
93 |
<?php _e( 'Rate it', 'bestwebsoft' ); ?>
|
94 |
<span class="dashicons dashicons-star-filled"></span>
|
95 |
<span class="dashicons dashicons-star-filled"></span>
|
@@ -119,12 +120,12 @@ if ( ! function_exists ( 'bws_plugin_update_row' ) ) {
|
|
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
|
128 |
if ( $wp_version >= 4.6 )
|
129 |
echo '</p>';
|
130 |
echo '</div>
|
@@ -135,13 +136,13 @@ if ( ! function_exists ( 'bws_plugin_update_row' ) ) {
|
|
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 |
}
|
@@ -155,18 +156,18 @@ if ( ! function_exists ( 'bws_plugin_update_row' ) ) {
|
|
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 |
-
|
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 ' ' . __(
|
170 |
if ( $wp_version >= 4.6 )
|
171 |
echo '</p>';
|
172 |
echo '</div>
|
@@ -183,15 +184,15 @@ if ( ! function_exists( 'bws_admin_notices' ) ) {
|
|
183 |
/* versions notice */
|
184 |
if ( ! empty( $bws_versions_notice_array ) ) {
|
185 |
foreach ( $bws_versions_notice_array as $key => $value ) { ?>
|
186 |
-
<div class="update-nag"
|
187 |
-
|
188 |
-
|
189 |
-
|
190 |
-
|
191 |
-
|
192 |
-
|
193 |
-
|
194 |
-
|
195 |
<?php }
|
196 |
}
|
197 |
|
@@ -204,12 +205,13 @@ if ( ! function_exists( 'bws_admin_notices' ) ) {
|
|
204 |
<img title="" src="<?php echo esc_attr( $bws_plugin_banner_to_settings[0]['banner_url'] ); ?>" alt="" />
|
205 |
</div>
|
206 |
<div class="text">
|
207 |
-
<strong><?php printf( __( 'Thank you for installing %s plugin!', 'bestwebsoft' ), $bws_plugin_banner_to_settings[0]['plugin_info']['Name'] );
|
|
|
208 |
<?php _e( "Let's get started", 'bestwebsoft' ); ?>:
|
209 |
-
<a href="<?php echo $bws_plugin_banner_to_settings[0]['settings_url']; ?>"><?php _e( 'Settings', 'bestwebsoft' ); ?></a>
|
210 |
<?php if ( false != $bws_plugin_banner_to_settings[0]['post_type_url'] ) { ?>
|
211 |
<?php _e( 'or', 'bestwebsoft' ); ?>
|
212 |
-
<a href="<?php echo $bws_plugin_banner_to_settings[0]['post_type_url']; ?>"><?php _e( 'Add New', 'bestwebsoft' ); ?></a>
|
213 |
<?php } ?>
|
214 |
</div>
|
215 |
<form action="" method="post">
|
@@ -239,9 +241,9 @@ if ( ! function_exists( 'bws_admin_notices' ) ) {
|
|
239 |
<div class="bws-details hide-if-js">
|
240 |
<?php foreach ( $bws_plugin_banner_to_settings as $value ) { ?>
|
241 |
<div>
|
242 |
-
<strong><?php echo str_replace( ' by BestWebSoft', '', $value['plugin_info']['Name'] ); ?></strong> <a href="<?php echo $value['settings_url']; ?>"><?php _e( 'Settings', 'bestwebsoft' ); ?></a>
|
243 |
<?php if ( false != $value['post_type_url'] ) { ?>
|
244 |
-
 | <a target="_blank" href="<?php echo $value['post_type_url']; ?>"><?php _e( 'Add New', 'bestwebsoft' ); ?></a>
|
245 |
<?php } ?>
|
246 |
<input type="hidden" name="bws_hide_settings_notice_<?php echo $value['plugin_options_name']; ?>" value="hide" />
|
247 |
</div>
|
@@ -331,12 +333,12 @@ if ( ! function_exists( 'bws_plugin_banner' ) ) {
|
|
331 |
<div class="icon">
|
332 |
<img title="" src="<?php echo esc_attr( $banner_url_or_slug ); ?>" alt="" />
|
333 |
</div>
|
334 |
-
<div class="text"
|
335 |
-
_e( 'It’s time to upgrade your', 'bestwebsoft' ); ?> <strong><?php echo $plugin_info['Name']; ?> plugin</strong> <?php _e( 'to', 'bestwebsoft' ); ?> <strong>Pro</strong> <?php _e( 'version!', 'bestwebsoft' ); ?><br />
|
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
|
340 |
</div>
|
341 |
</div>
|
342 |
</div>
|
@@ -350,9 +352,14 @@ if ( ! function_exists( 'bws_plugin_banner' ) ) {
|
|
350 |
}
|
351 |
|
352 |
if ( ! function_exists ( 'bws_plugin_banner_timeout' ) ) {
|
353 |
-
function bws_plugin_banner_timeout( $plugin_key, $plugin_prefix, $plugin_name, $
|
354 |
global $bstwbsftwppdtplgns_options, $bstwbsftwppdtplgns_cookie_add;
|
355 |
if ( isset( $bstwbsftwppdtplgns_options['time_out'][ $plugin_key ] ) && ( strtotime( $bstwbsftwppdtplgns_options['time_out'][ $plugin_key ] ) < strtotime( date("m/d/Y") . '+1 month' ) ) && ( strtotime( $bstwbsftwppdtplgns_options['time_out'][ $plugin_key ] ) > strtotime( date("m/d/Y") ) ) ) {
|
|
|
|
|
|
|
|
|
|
|
356 |
if ( ! isset( $bstwbsftwppdtplgns_cookie_add ) ) {
|
357 |
echo '<script type="text/javascript" src="' . bws_menu_url( 'js/c_o_o_k_i_e.js' ) . '"></script>';
|
358 |
$bstwbsftwppdtplgns_cookie_add = true;
|
@@ -377,7 +384,7 @@ if ( ! function_exists ( 'bws_plugin_banner_timeout' ) ) {
|
|
377 |
<div class="<?php echo $plugin_prefix; ?>_message_timeout bws_banner_on_plugin_page bws_banner_timeout" style="display:none;">
|
378 |
<button class="<?php echo $plugin_prefix; ?>_close_icon close_icon notice-dismiss bws_hide_settings_notice" title="<?php _e( 'Close notice', 'bestwebsoft' ); ?>"></button>
|
379 |
<div class="icon">
|
380 |
-
<img title="" src="<?php echo $
|
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>
|
@@ -523,7 +530,7 @@ if ( ! function_exists ( 'bws_plugins_admin_init' ) ) {
|
|
523 |
function bws_plugins_admin_init() {
|
524 |
if ( isset( $_GET['bws_activate_plugin'] ) && check_admin_referer( 'bws_activate_plugin' . $_GET['bws_activate_plugin'] ) ) {
|
525 |
|
526 |
-
$plugin = isset( $_GET['bws_activate_plugin'] ) ? $_GET['bws_activate_plugin'] : '';
|
527 |
$result = activate_plugin( $plugin, '', is_network_admin() );
|
528 |
if ( is_wp_error( $result ) ) {
|
529 |
if ( 'unexpected_output' == $result->get_error_code() ) {
|
@@ -544,11 +551,24 @@ if ( ! function_exists ( 'bws_plugins_admin_init' ) ) {
|
|
544 |
unset( $recent[ $plugin ] );
|
545 |
update_site_option( 'recently_activated', $recent );
|
546 |
}
|
547 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
548 |
exit();
|
549 |
}
|
550 |
|
551 |
-
if ( isset( $_GET['page'] ) && $_GET['page'] == 'bws_panel' ) {
|
552 |
if ( ! session_id() )
|
553 |
@session_start();
|
554 |
}
|
@@ -559,7 +579,7 @@ if ( ! function_exists ( 'bws_plugins_admin_init' ) ) {
|
|
559 |
|
560 |
if ( ! function_exists ( 'bws_admin_enqueue_scripts' ) ) {
|
561 |
function bws_admin_enqueue_scripts() {
|
562 |
-
global $wp_scripts;
|
563 |
|
564 |
$jquery_version = isset( $wp_scripts->registered['jquery-ui-core']->ver ) ? $wp_scripts->registered['jquery-ui-core']->ver : '1.12.1';
|
565 |
|
@@ -574,6 +594,10 @@ if ( ! function_exists ( 'bws_admin_enqueue_scripts' ) ) {
|
|
574 |
add_thickbox();
|
575 |
wp_enqueue_script( 'plugin-install' );
|
576 |
}
|
|
|
|
|
|
|
|
|
577 |
}
|
578 |
}
|
579 |
|
@@ -652,14 +676,24 @@ if ( ! function_exists ( 'bws_plugins_admin_head' ) ) {
|
|
652 |
),
|
653 |
'set_timeout' => 2000
|
654 |
);
|
655 |
-
if ( $wp_version < '3.9' )
|
656 |
-
$tooltip_args['css_selector'] = '.mce_add_bws_shortcode';
|
657 |
bws_add_tooltip_in_admin( $tooltip_args );
|
658 |
}
|
659 |
}
|
660 |
}
|
661 |
}
|
662 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
663 |
if ( ! function_exists ( 'bws_plugins_include_codemirror' ) ) {
|
664 |
function bws_plugins_include_codemirror() {
|
665 |
wp_enqueue_style( 'codemirror.css', bws_menu_url( 'css/codemirror.css' ) );
|
@@ -833,7 +867,7 @@ if ( ! function_exists( 'bws_shortcode_media_button_popup' ) ) {
|
|
833 |
<h4><?php _e( 'Plugin', 'bestwebsoft' ); ?></h4>
|
834 |
<select name="bws_shortcode_select" id="bws_shortcode_select">
|
835 |
<?php foreach ( $bws_shortcode_list as $key => $value ) { ?>
|
836 |
-
<option value="<?php echo $key; ?>"><?php echo $value['name']; ?></option>
|
837 |
<?php } ?>
|
838 |
</select>
|
839 |
</div>
|
@@ -847,33 +881,9 @@ if ( ! function_exists( 'bws_shortcode_media_button_popup' ) ) {
|
|
847 |
<p><?php _e( 'The shortcode will be inserted', 'bestwebsoft' ); ?></p>
|
848 |
<div id="bws_shortcode_block"><div id="bws_shortcode_display"></div></div>
|
849 |
</div>
|
850 |
-
<?php if ( $wp_version < '3.9' ) { ?>
|
851 |
-
<p>
|
852 |
-
<button class="button-primary primary bws_shortcode_insert"><?php _e( 'Insert', 'bestwebsoft' ); ?></button>
|
853 |
-
</p>
|
854 |
-
<?php } ?>
|
855 |
</div>
|
856 |
</div>
|
857 |
<?php }
|
858 |
-
if ( $wp_version < '3.9' ) { ?>
|
859 |
-
<script type="text/javascript">
|
860 |
-
(function($){
|
861 |
-
$( '.bws_shortcode_insert' ).on( 'click',function() {
|
862 |
-
var shortcode = $( '#TB_ajaxContent #bws_shortcode_display' ).text();
|
863 |
-
if ( '' != shortcode ) {
|
864 |
-
/* insert shortcode to tinymce */
|
865 |
-
if ( !tinyMCE.activeEditor || tinyMCE.activeEditor.isHidden() ) {
|
866 |
-
$( 'textarea#content' ).val( shortcode );
|
867 |
-
} else {
|
868 |
-
tinyMCE.execCommand( 'mceInsertContent', false, shortcode );
|
869 |
-
}
|
870 |
-
}
|
871 |
-
/* close the thickbox after adding shortcode to editor */
|
872 |
-
self.parent.tb_remove();
|
873 |
-
});
|
874 |
-
})(jQuery);
|
875 |
-
</script>
|
876 |
-
<?php }
|
877 |
}
|
878 |
}
|
879 |
|
@@ -890,6 +900,8 @@ if ( ! function_exists( 'bws_shortcode_output' ) ) {
|
|
890 |
/**
|
891 |
* output tooltip
|
892 |
* @since 1.9.8
|
|
|
|
|
893 |
*/
|
894 |
if ( ! function_exists( 'bws_add_help_box' ) ) {
|
895 |
function bws_add_help_box( $content, $class = '' ) {
|
@@ -904,7 +916,7 @@ if ( ! function_exists( 'bws_help_tab' ) ) {
|
|
904 |
function bws_help_tab( $screen, $args ) {
|
905 |
$url = ( ! empty( $args['section'] ) ) ? 'https://support.bestwebsoft.com/hc/en-us/sections/' . $args['section'] : 'https://support.bestwebsoft.com/';
|
906 |
|
907 |
-
$content = '<p><a href="' . $url . '" target="_blank">' . __( 'Visit Help Center', 'bestwebsoft' ) . '</a></p>';
|
908 |
|
909 |
$screen->add_help_tab(
|
910 |
array(
|
@@ -1048,7 +1060,7 @@ if ( ! function_exists( 'bws_delete_plugin' ) ) {
|
|
1048 |
add_action( 'admin_init', 'bws_plugins_admin_init' );
|
1049 |
add_action( 'admin_enqueue_scripts', 'bws_admin_enqueue_scripts' );
|
1050 |
add_action( 'admin_head', 'bws_plugins_admin_head' );
|
1051 |
-
add_action( 'admin_footer','
|
1052 |
|
1053 |
add_action( 'admin_notices', 'bws_admin_notices', 30 );
|
1054 |
|
4 |
*/
|
5 |
|
6 |
require( dirname( __FILE__ ) . '/deprecated.php' );
|
7 |
+
require_once( dirname( __FILE__ ) . '/deactivation-form.php' );
|
8 |
|
9 |
/**
|
10 |
* Function to add 'bestwebsoft' slug for BWS_Menu MO file if BWS_Menu loaded from theme.
|
56 |
* Function check if plugin is compatible with current WP version
|
57 |
* @return void
|
58 |
*/
|
59 |
+
if ( ! function_exists( 'bws_wp_min_version_check' ) ) {
|
60 |
function bws_wp_min_version_check( $plugin_basename, $plugin_info, $require_wp, $min_wp = false ) {
|
61 |
global $wp_version, $bws_versions_notice_array;
|
62 |
if ( false == $min_wp )
|
90 |
<div class="bws-plugin-reviews">
|
91 |
<div class="bws-plugin-reviews-rate">
|
92 |
<?php _e( 'Like the plugin?', 'bestwebsoft' ); ?>
|
93 |
+
<a href="https://wordpress.org/support/view/plugin-reviews/<?php echo esc_attr( $plugin_slug ); ?>?filter=5" target="_blank" title="<?php printf( __( '%s reviews', 'bestwebsoft' ), sanitize_text_field( $plugin_name ) ); ?>">
|
94 |
<?php _e( 'Rate it', 'bestwebsoft' ); ?>
|
95 |
<span class="dashicons dashicons-star-filled"></span>
|
96 |
<span class="dashicons dashicons-star-filled"></span>
|
120 |
$class = ( $wp_version >= 4.6 ) ? 'active' : '';
|
121 |
$style = ( $wp_version < 4.6 ) ? ' style="background-color: #FFEBE8;border-color: #CC0000;"' : '';
|
122 |
$div_class = ( $wp_version >= 4.6 ) ? ' notice inline notice-warning notice-alt' : '';
|
123 |
+
echo '<tr class="bws-plugin-update-tr plugin-update-tr ' . $class . '" id="' . esc_attr( $explode_plugin_key[0] ) . '-update" data-slug="' . esc_attr( $explode_plugin_key[0] ) . '" data-plugin="' . esc_attr( $plugin_key ) . '">
|
124 |
+
<td colspan="' . esc_attr( $wp_list_table->get_column_count() ) . '" class="plugin-update colspanchange">
|
125 |
<div class="update-message' . $div_class . '"' . $style . '>';
|
126 |
if ( $wp_version >= 4.6 )
|
127 |
echo '<p>';
|
128 |
+
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 your 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>';
|
129 |
if ( $wp_version >= 4.6 )
|
130 |
echo '</p>';
|
131 |
echo '</div>
|
136 |
$class = ( $wp_version >= 4.6 ) ? 'active' : '';
|
137 |
$style = ( $wp_version < 4.6 ) ? ' style="color: #8C0000;"' : '';
|
138 |
$div_class = ( $wp_version >= 4.6 ) ? ' notice inline notice-warning notice-alt' : '';
|
139 |
+
echo '<tr class="bws-plugin-update-tr plugin-update-tr ' . $class . '" id="' . esc_attr( $explode_plugin_key[0] ) . '-update" data-slug="' . esc_attr( $explode_plugin_key[0] ) . '" data-plugin="' . esc_attr( $plugin_key ) . '">
|
140 |
+
<td colspan="' . esc_attr( $wp_list_table->get_column_count() ) . '" class="plugin-update colspanchange">
|
141 |
<div class="update-message' . $div_class . '"' . $style . '>';
|
142 |
if ( $wp_version >= 4.6 )
|
143 |
echo '<p>';
|
144 |
if ( isset( $bstwbsftwppdtplgns_options['trial'][ $plugin_key ] ) && $link_slug != false ) {
|
145 |
+
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/' . esc_attr( $link_slug ) . '/">https://bestwebsoft.com/products/wordpress/plugins/' . esc_attr( $link_slug ) . '/</a>';
|
146 |
} else {
|
147 |
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>';
|
148 |
}
|
156 |
$class = ( $wp_version >= 4.6 ) ? 'active' : '';
|
157 |
$style = ( $wp_version < 4.6 ) ? ' style="color: #8C0000;"' : '';
|
158 |
$div_class = ( $wp_version >= 4.6 ) ? ' notice inline notice-warning notice-alt' : '';
|
159 |
+
echo '<tr class="bws-plugin-update-tr plugin-update-tr ' . $class . '" id="' . esc_attr( $explode_plugin_key[0] ) . '-update" data-slug="' . esc_attr( $explode_plugin_key[0] ) . '" data-plugin="' . esc_attr( $plugin_key ) . '">
|
160 |
+
<td colspan="' . esc_attr( $wp_list_table->get_column_count() ) . '" class="plugin-update colspanchange">
|
161 |
<div class="update-message' . $div_class . '"' . $style . '>';
|
162 |
if ( $wp_version >= 4.6 )
|
163 |
echo '<p>';
|
164 |
if ( $free_plugin_name != false ) {
|
165 |
+
printf( __( 'Notice: You are using the Pro Trial license of %s plugin.', 'bestwebsoft' ), $free_plugin_name );
|
166 |
} else {
|
167 |
_e( 'Notice: You are using the Pro Trial license of plugin.', 'bestwebsoft' );
|
168 |
}
|
169 |
if ( isset( $bstwbsftwppdtplgns_options['time_out'][ $plugin_key ] ) )
|
170 |
+
echo ' ' . __( 'The Pro Trial license will expire on', 'bestwebsoft' ) . ' ' . $bstwbsftwppdtplgns_options['time_out'][ $plugin_key ] . '.';
|
171 |
if ( $wp_version >= 4.6 )
|
172 |
echo '</p>';
|
173 |
echo '</div>
|
184 |
/* versions notice */
|
185 |
if ( ! empty( $bws_versions_notice_array ) ) {
|
186 |
foreach ( $bws_versions_notice_array as $key => $value ) { ?>
|
187 |
+
<div class="update-nag">
|
188 |
+
<?php printf(
|
189 |
+
"<strong>%s</strong> %s <strong>WordPress %s</strong> %s",
|
190 |
+
$value['name'],
|
191 |
+
__( 'requires', 'bestwebsoft' ),
|
192 |
+
$value['version'],
|
193 |
+
__( 'or higher! We do not guarantee that our plugin will work correctly. Please upgrade to WordPress latest version.', 'bestwebsoft' )
|
194 |
+
); ?>
|
195 |
+
</div>
|
196 |
<?php }
|
197 |
}
|
198 |
|
205 |
<img title="" src="<?php echo esc_attr( $bws_plugin_banner_to_settings[0]['banner_url'] ); ?>" alt="" />
|
206 |
</div>
|
207 |
<div class="text">
|
208 |
+
<strong><?php printf( __( 'Thank you for installing %s plugin!', 'bestwebsoft' ), $bws_plugin_banner_to_settings[0]['plugin_info']['Name'] ); ?></strong>
|
209 |
+
<br />
|
210 |
<?php _e( "Let's get started", 'bestwebsoft' ); ?>:
|
211 |
+
<a href="<?php echo esc_url( self_admin_url( $bws_plugin_banner_to_settings[0]['settings_url'] ) ); ?>"><?php _e( 'Settings', 'bestwebsoft' ); ?></a>
|
212 |
<?php if ( false != $bws_plugin_banner_to_settings[0]['post_type_url'] ) { ?>
|
213 |
<?php _e( 'or', 'bestwebsoft' ); ?>
|
214 |
+
<a href="<?php echo esc_url( self_admin_url( $bws_plugin_banner_to_settings[0]['post_type_url'] ) ); ?>"><?php _e( 'Add New', 'bestwebsoft' ); ?></a>
|
215 |
<?php } ?>
|
216 |
</div>
|
217 |
<form action="" method="post">
|
241 |
<div class="bws-details hide-if-js">
|
242 |
<?php foreach ( $bws_plugin_banner_to_settings as $value ) { ?>
|
243 |
<div>
|
244 |
+
<strong><?php echo str_replace( ' by BestWebSoft', '', $value['plugin_info']['Name'] ); ?></strong> <a href="<?php echo esc_url( self_admin_url( $value['settings_url'] ) ); ?>"><?php _e( 'Settings', 'bestwebsoft' ); ?></a>
|
245 |
<?php if ( false != $value['post_type_url'] ) { ?>
|
246 |
+
 | <a target="_blank" href="<?php echo esc_url( self_admin_url( $value['post_type_url'] ) ); ?>"><?php _e( 'Add New', 'bestwebsoft' ); ?></a>
|
247 |
<?php } ?>
|
248 |
<input type="hidden" name="bws_hide_settings_notice_<?php echo $value['plugin_options_name']; ?>" value="hide" />
|
249 |
</div>
|
333 |
<div class="icon">
|
334 |
<img title="" src="<?php echo esc_attr( $banner_url_or_slug ); ?>" alt="" />
|
335 |
</div>
|
336 |
+
<div class="text">
|
337 |
+
<?php _e( 'It’s time to upgrade your', 'bestwebsoft' ); ?> <strong><?php echo $plugin_info['Name']; ?> plugin</strong> <?php _e( 'to', 'bestwebsoft' ); ?> <strong>Pro</strong> <?php _e( 'version!', 'bestwebsoft' ); ?><br />
|
338 |
<span><?php _e( 'Extend standard plugin functionality with new great options.', 'bestwebsoft' ); ?></span>
|
339 |
</div>
|
340 |
<div class="button_div">
|
341 |
+
<a class="button" target="_blank" href="<?php echo esc_url( 'https://bestwebsoft.com/products/wordpress/plugins/' . $link_slug . '/?k=' . $link_key . '&pn=' . $link_pn . '&v=' . $plugin_info["Version"] . '&wp_v=' . $wp_version ); ?>"><?php _e( 'Learn More', 'bestwebsoft' ); ?></a>
|
342 |
</div>
|
343 |
</div>
|
344 |
</div>
|
352 |
}
|
353 |
|
354 |
if ( ! function_exists ( 'bws_plugin_banner_timeout' ) ) {
|
355 |
+
function bws_plugin_banner_timeout( $plugin_key, $plugin_prefix, $plugin_name, $banner_url_or_slug = false ) {
|
356 |
global $bstwbsftwppdtplgns_options, $bstwbsftwppdtplgns_cookie_add;
|
357 |
if ( isset( $bstwbsftwppdtplgns_options['time_out'][ $plugin_key ] ) && ( strtotime( $bstwbsftwppdtplgns_options['time_out'][ $plugin_key ] ) < strtotime( date("m/d/Y") . '+1 month' ) ) && ( strtotime( $bstwbsftwppdtplgns_options['time_out'][ $plugin_key ] ) > strtotime( date("m/d/Y") ) ) ) {
|
358 |
+
|
359 |
+
if ( $banner_url_or_slug && false == strrpos( $banner_url_or_slug, '/' ) ) {
|
360 |
+
$banner_url_or_slug = '//ps.w.org/' . $banner_url_or_slug . '/assets/icon-128x128.png';
|
361 |
+
}
|
362 |
+
|
363 |
if ( ! isset( $bstwbsftwppdtplgns_cookie_add ) ) {
|
364 |
echo '<script type="text/javascript" src="' . bws_menu_url( 'js/c_o_o_k_i_e.js' ) . '"></script>';
|
365 |
$bstwbsftwppdtplgns_cookie_add = true;
|
384 |
<div class="<?php echo $plugin_prefix; ?>_message_timeout bws_banner_on_plugin_page bws_banner_timeout" style="display:none;">
|
385 |
<button class="<?php echo $plugin_prefix; ?>_close_icon close_icon notice-dismiss bws_hide_settings_notice" title="<?php _e( 'Close notice', 'bestwebsoft' ); ?>"></button>
|
386 |
<div class="icon">
|
387 |
+
<img title="" src="<?php echo esc_attr( $banner_url_or_slug ); ?>" alt="" />
|
388 |
</div>
|
389 |
<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>
|
390 |
</div>
|
530 |
function bws_plugins_admin_init() {
|
531 |
if ( isset( $_GET['bws_activate_plugin'] ) && check_admin_referer( 'bws_activate_plugin' . $_GET['bws_activate_plugin'] ) ) {
|
532 |
|
533 |
+
$plugin = isset( $_GET['bws_activate_plugin'] ) ? sanitize_text_field( $_GET['bws_activate_plugin'] ) : '';
|
534 |
$result = activate_plugin( $plugin, '', is_network_admin() );
|
535 |
if ( is_wp_error( $result ) ) {
|
536 |
if ( 'unexpected_output' == $result->get_error_code() ) {
|
551 |
unset( $recent[ $plugin ] );
|
552 |
update_site_option( 'recently_activated', $recent );
|
553 |
}
|
554 |
+
/**
|
555 |
+
* @deprecated 1.9.8 (15.12.2016)
|
556 |
+
*/
|
557 |
+
$is_main_page = in_array( $_GET['page'], array( 'bws_panel', 'bws_themes', 'bws_system_status' ) );
|
558 |
+
$page = esc_attr( $_GET['page'] );
|
559 |
+
$tab = isset( $_GET['tab'] ) ? esc_attr( $_GET['tab'] ) : '';
|
560 |
+
|
561 |
+
if ( $is_main_page )
|
562 |
+
$current_page = 'admin.php?page=' . $page;
|
563 |
+
else
|
564 |
+
$current_page = isset( $_GET['tab'] ) ? 'admin.php?page=' . $page . '&tab=' . $tab : 'admin.php?page=' . $page;
|
565 |
+
/*end deprecated */
|
566 |
+
|
567 |
+
wp_redirect( self_admin_url( $current_page . '&activate=true' ) );
|
568 |
exit();
|
569 |
}
|
570 |
|
571 |
+
if ( isset( $_GET['page'] ) && ( $_GET['page'] == 'bws_panel' || strpos( $_GET['page'], '-bws-panel' ) ) ) {
|
572 |
if ( ! session_id() )
|
573 |
@session_start();
|
574 |
}
|
579 |
|
580 |
if ( ! function_exists ( 'bws_admin_enqueue_scripts' ) ) {
|
581 |
function bws_admin_enqueue_scripts() {
|
582 |
+
global $wp_scripts, $hook_suffix;
|
583 |
|
584 |
$jquery_version = isset( $wp_scripts->registered['jquery-ui-core']->ver ) ? $wp_scripts->registered['jquery-ui-core']->ver : '1.12.1';
|
585 |
|
594 |
add_thickbox();
|
595 |
wp_enqueue_script( 'plugin-install' );
|
596 |
}
|
597 |
+
|
598 |
+
if ( 'plugins.php' == $hook_suffix && ! defined( 'DOING_AJAX' ) ) {
|
599 |
+
wp_enqueue_style( 'bws-modal-css', bws_menu_url( 'css/modal.css' ) );
|
600 |
+
}
|
601 |
}
|
602 |
}
|
603 |
|
676 |
),
|
677 |
'set_timeout' => 2000
|
678 |
);
|
|
|
|
|
679 |
bws_add_tooltip_in_admin( $tooltip_args );
|
680 |
}
|
681 |
}
|
682 |
}
|
683 |
}
|
684 |
|
685 |
+
if ( ! function_exists ( 'bws_plugins_admin_footer' ) ) {
|
686 |
+
function bws_plugins_admin_footer() {
|
687 |
+
global $hook_suffix;
|
688 |
+
|
689 |
+
bws_shortcode_media_button_popup();
|
690 |
+
|
691 |
+
if ( 'plugins.php' == $hook_suffix && ! defined( 'DOING_AJAX' ) ) {
|
692 |
+
bws_add_deactivation_feedback_dialog_box();
|
693 |
+
}
|
694 |
+
}
|
695 |
+
}
|
696 |
+
|
697 |
if ( ! function_exists ( 'bws_plugins_include_codemirror' ) ) {
|
698 |
function bws_plugins_include_codemirror() {
|
699 |
wp_enqueue_style( 'codemirror.css', bws_menu_url( 'css/codemirror.css' ) );
|
867 |
<h4><?php _e( 'Plugin', 'bestwebsoft' ); ?></h4>
|
868 |
<select name="bws_shortcode_select" id="bws_shortcode_select">
|
869 |
<?php foreach ( $bws_shortcode_list as $key => $value ) { ?>
|
870 |
+
<option value="<?php echo esc_attr( $key ); ?>"><?php echo $value['name']; ?></option>
|
871 |
<?php } ?>
|
872 |
</select>
|
873 |
</div>
|
881 |
<p><?php _e( 'The shortcode will be inserted', 'bestwebsoft' ); ?></p>
|
882 |
<div id="bws_shortcode_block"><div id="bws_shortcode_display"></div></div>
|
883 |
</div>
|
|
|
|
|
|
|
|
|
|
|
884 |
</div>
|
885 |
</div>
|
886 |
<?php }
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
887 |
}
|
888 |
}
|
889 |
|
900 |
/**
|
901 |
* output tooltip
|
902 |
* @since 1.9.8
|
903 |
+
* @param string $content - HTML content for the tooltip
|
904 |
+
* @param string $class - Can be standart "bws-hide-for-mobile" (tooltip will be hidden in 782px) and "bws-auto-width" (need for img) or some custom class.
|
905 |
*/
|
906 |
if ( ! function_exists( 'bws_add_help_box' ) ) {
|
907 |
function bws_add_help_box( $content, $class = '' ) {
|
916 |
function bws_help_tab( $screen, $args ) {
|
917 |
$url = ( ! empty( $args['section'] ) ) ? 'https://support.bestwebsoft.com/hc/en-us/sections/' . $args['section'] : 'https://support.bestwebsoft.com/';
|
918 |
|
919 |
+
$content = '<p><a href="' . esc_url( $url ) . '" target="_blank">' . __( 'Visit Help Center', 'bestwebsoft' ) . '</a></p>';
|
920 |
|
921 |
$screen->add_help_tab(
|
922 |
array(
|
1060 |
add_action( 'admin_init', 'bws_plugins_admin_init' );
|
1061 |
add_action( 'admin_enqueue_scripts', 'bws_admin_enqueue_scripts' );
|
1062 |
add_action( 'admin_head', 'bws_plugins_admin_head' );
|
1063 |
+
add_action( 'admin_footer','bws_plugins_admin_footer' );
|
1064 |
|
1065 |
add_action( 'admin_notices', 'bws_admin_notices', 30 );
|
1066 |
|
bws_menu/bws_include.php
CHANGED
@@ -5,7 +5,7 @@
|
|
5 |
|
6 |
if ( ! function_exists ( 'bws_include_init' ) ) {
|
7 |
function bws_include_init( $base, $bws_menu_source = 'plugins' ) {
|
8 |
-
global $bstwbsftwppdtplgns_options, $bstwbsftwppdtplgns_added_menu;
|
9 |
if ( ! function_exists( 'get_plugin_data' ) )
|
10 |
require_once( ABSPATH . 'wp-admin/includes/plugin.php' );
|
11 |
|
@@ -14,6 +14,7 @@ if ( ! function_exists ( 'bws_include_init' ) ) {
|
|
14 |
|
15 |
if ( $bws_menu_source == 'plugins' ) {
|
16 |
$bws_menu_dir = $wp_plugins_dir . '/' . dirname( $base ) . '/bws_menu/bws_menu.php';
|
|
|
17 |
} else {
|
18 |
$bws_menu_dir = $wp_content_dir . '/themes/' . $base . '/inc/bws_menu/bws_menu.php';
|
19 |
}
|
5 |
|
6 |
if ( ! function_exists ( 'bws_include_init' ) ) {
|
7 |
function bws_include_init( $base, $bws_menu_source = 'plugins' ) {
|
8 |
+
global $bstwbsftwppdtplgns_options, $bstwbsftwppdtplgns_added_menu, $bstwbsftwppdtplgns_active_plugins;
|
9 |
if ( ! function_exists( 'get_plugin_data' ) )
|
10 |
require_once( ABSPATH . 'wp-admin/includes/plugin.php' );
|
11 |
|
14 |
|
15 |
if ( $bws_menu_source == 'plugins' ) {
|
16 |
$bws_menu_dir = $wp_plugins_dir . '/' . dirname( $base ) . '/bws_menu/bws_menu.php';
|
17 |
+
$bstwbsftwppdtplgns_active_plugins[ $base ] = get_plugin_data( $wp_plugins_dir . '/' . $base );
|
18 |
} else {
|
19 |
$bws_menu_dir = $wp_content_dir . '/themes/' . $base . '/inc/bws_menu/bws_menu.php';
|
20 |
}
|
bws_menu/bws_menu.php
CHANGED
@@ -1,7 +1,7 @@
|
|
1 |
<?php
|
2 |
/*
|
3 |
* Function for displaying BestWebSoft menu
|
4 |
-
* Version: 2.
|
5 |
*/
|
6 |
|
7 |
if ( ! function_exists ( 'bws_admin_enqueue_scripts' ) )
|
@@ -10,7 +10,7 @@ if ( ! function_exists ( 'bws_admin_enqueue_scripts' ) )
|
|
10 |
if ( ! function_exists( 'bws_add_menu_render' ) ) {
|
11 |
function bws_add_menu_render() {
|
12 |
global $wpdb, $wp_version, $bws_plugin_info, $bstwbsftwppdtplgns_options;
|
13 |
-
$error = $message =
|
14 |
|
15 |
/**
|
16 |
* @deprecated 1.9.8 (15.12.2016)
|
@@ -37,7 +37,7 @@ if ( ! function_exists( 'bws_add_menu_render' ) ) {
|
|
37 |
$sitewide_active_plugins = ( function_exists( 'is_multisite' ) && is_multisite() ) ? get_site_option( 'active_sitewide_plugins' ) : array();
|
38 |
$update_availible_all = get_site_transient( 'update_plugins' );
|
39 |
|
40 |
-
$plugin_category = isset( $_GET['category'] ) ?
|
41 |
|
42 |
if ( ( isset( $_GET['sub'] ) && 'installed' == $_GET['sub'] ) || ! isset( $_GET['sub'] ) ) {
|
43 |
$bws_plugins_update_availible = $bws_plugins_expired = array();
|
@@ -87,7 +87,7 @@ if ( ! function_exists( 'bws_add_menu_render' ) ) {
|
|
87 |
$update_membership_list = true;
|
88 |
|
89 |
if ( isset( $_POST['bws_license_key'] ) )
|
90 |
-
$bws_license_key =
|
91 |
|
92 |
if ( isset( $_SESSION['bws_membership_time_check'] ) && isset( $_SESSION['bws_membership_list'] ) && $_SESSION['bws_membership_time_check'] < strtotime( '+12 hours' ) ) {
|
93 |
$update_membership_list = false;
|
@@ -143,7 +143,7 @@ if ( ! function_exists( 'bws_add_menu_render' ) ) {
|
|
143 |
if ( isset( $value->time_out ) && $value->time_out != '' )
|
144 |
$message .= ' ' . __( 'Your license will expire on', 'bestwebsoft' ) . ' ' . $value->time_out . '.';
|
145 |
} else {
|
146 |
-
$message = __( 'Congratulations! Pro Membership license is
|
147 |
}
|
148 |
|
149 |
$bstwbsftwppdtplgns_options[ $bws_license_plugin ] = $bws_license_key;
|
@@ -178,7 +178,7 @@ if ( ! function_exists( 'bws_add_menu_render' ) ) {
|
|
178 |
$post_max_size = ( ini_get( 'post_max_size' ) ) ? ini_get( 'post_max_size' ) : __( 'N/A', 'bestwebsoft' );
|
179 |
$max_execution_time = ( ini_get( 'max_execution_time' ) ) ? ini_get( 'max_execution_time' ) : __( 'N/A', 'bestwebsoft' );
|
180 |
$memory_limit = ( ini_get( 'memory_limit' ) ) ? ini_get( 'memory_limit' ) : __( 'N/A', 'bestwebsoft' );
|
181 |
-
$wp_memory_limit = ( defined( 'WP_MEMORY_LIMIT' ) ) ? WP_MEMORY_LIMIT : __( 'N/A', 'bestwebsoft' );
|
182 |
$memory_usage = ( function_exists( 'memory_get_usage' ) ) ? round( memory_get_usage() / 1024 / 1024, 2 ) . __( ' Mb', 'bestwebsoft' ) : __( 'N/A', 'bestwebsoft' );
|
183 |
$exif_read_data = ( is_callable( 'exif_read_data' ) ) ? __( 'Yes', 'bestwebsoft' ) . " ( V" . substr( phpversion( 'exif' ), 0,4 ) . ")" : __( 'No', 'bestwebsoft' );
|
184 |
$iptcparse = ( is_callable( 'iptcparse' ) ) ? __( 'Yes', 'bestwebsoft' ) : __( 'No', 'bestwebsoft' );
|
@@ -199,7 +199,7 @@ if ( ! function_exists( 'bws_add_menu_render' ) ) {
|
|
199 |
__( 'Website URL', 'bestwebsoft' ) => get_option( 'siteurl' ),
|
200 |
__( 'WP Version', 'bestwebsoft' ) => $wp_version,
|
201 |
__( 'WP Multisite', 'bestwebsoft' ) => $multisite,
|
202 |
-
__( 'WP Memory Limit', 'bestwebsoft' ) => $wp_memory_limit,
|
203 |
__( 'Active Theme', 'bestwebsoft' ) => $theme['Name'] . ' ' . $theme['Version'] . ' (' . sprintf( __( 'by %s', 'bestwebsoft' ), $theme['Author'] ) . ')'
|
204 |
),
|
205 |
),
|
@@ -217,7 +217,7 @@ if ( ! function_exists( 'bws_add_menu_render' ) ) {
|
|
217 |
__( 'PHP Max Script Execute Time', 'bestwebsoft' ) => $max_execution_time,
|
218 |
__( 'PHP Exif support', 'bestwebsoft' ) => $exif_read_data,
|
219 |
__( 'PHP IPTC support', 'bestwebsoft' ) => $iptcparse,
|
220 |
-
__( 'PHP XML support', 'bestwebsoft' ) => $xml_parser_create,
|
221 |
'$_SERVER[HTTP_HOST]' => $_SERVER['HTTP_HOST'],
|
222 |
'$_SERVER[SERVER_NAME]' => $_SERVER['SERVER_NAME'],
|
223 |
),
|
@@ -255,13 +255,11 @@ if ( ! function_exists( 'bws_add_menu_render' ) ) {
|
|
255 |
|
256 |
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' ) ) ) {
|
257 |
if ( isset( $_REQUEST['bwsmn_form_email'] ) ) {
|
258 |
-
$
|
259 |
-
if (
|
260 |
-
$error = __(
|
261 |
} else {
|
262 |
-
$
|
263 |
-
$bwsmn_form_email = '';
|
264 |
-
$message = __( 'Email with system info is sent to', 'bestwebsoft' ) . ' ' . $email;
|
265 |
}
|
266 |
} else {
|
267 |
$email = 'plugin_system_status@bestwebsoft.com';
|
@@ -273,14 +271,14 @@ if ( ! function_exists( 'bws_add_menu_render' ) ) {
|
|
273 |
$headers .= 'Content-type: text/html; charset=utf-8' . "\n";
|
274 |
$headers .= 'From: ' . get_option( 'admin_email' );
|
275 |
$message_text = '<html><head><title>System Info From ' . home_url() . '</title></head><body>';
|
276 |
-
foreach ( $system_info as $info ) {
|
277 |
-
if ( ! empty( $info['data'] ) ) {
|
278 |
$message_text .= '<h4>' . $info['name'];
|
279 |
if ( isset( $info['count'] ) )
|
280 |
$message_text .= ' (' . $info['count'] . ')';
|
281 |
$message_text .= '</h4><table>';
|
282 |
foreach ( $info['data'] as $key => $value ) {
|
283 |
-
$message_text .= '<tr><td>'. $key .'</td><td>'. $value .'</td></tr>';
|
284 |
}
|
285 |
$message_text .= '</table>';
|
286 |
}
|
@@ -295,27 +293,27 @@ if ( ! function_exists( 'bws_add_menu_render' ) ) {
|
|
295 |
<div class="bws-wrap">
|
296 |
<div class="bws-header">
|
297 |
<div class="bws-title">
|
298 |
-
<a href="<?php echo ( $is_main_page ) ? self_admin_url( 'admin.php?page=bws_panel' ) : self_admin_url( 'admin.php?page=' . $page ); ?>">
|
299 |
<span class="bws-logo bwsicons bwsicons-bws-logo"></span>
|
300 |
BestWebSoft
|
301 |
<span>panel</span>
|
302 |
</a>
|
303 |
</div>
|
304 |
-
<div class="bws-menu-item-icon">•••</div>
|
305 |
<div class="bws-nav-tab-wrapper">
|
306 |
<?php if ( $is_main_page ) { ?>
|
307 |
<a class="bws-nav-tab<?php if ( 'bws_panel' == $page ) echo ' bws-nav-tab-active'; ?>" href="<?php echo self_admin_url( 'admin.php?page=bws_panel' ); ?>"><?php _e( 'Plugins', 'bestwebsoft' ); ?></a>
|
308 |
<a class="bws-nav-tab<?php if ( 'bws_themes' == $page ) echo ' bws-nav-tab-active'; ?>" href="<?php echo self_admin_url( 'admin.php?page=bws_themes' ); ?>"><?php _e( 'Themes', 'bestwebsoft' ); ?></a>
|
309 |
<a class="bws-nav-tab<?php if ( 'bws_system_status' == $page ) echo ' bws-nav-tab-active'; ?>" href="<?php echo self_admin_url( 'admin.php?page=bws_system_status' ); ?>"><?php _e( 'System status', 'bestwebsoft' ); ?></a>
|
310 |
<?php } else { ?>
|
311 |
-
<a class="bws-nav-tab<?php if ( ! isset( $_GET['tab'] ) ) echo ' bws-nav-tab-active'; ?>" href="<?php echo self_admin_url( 'admin.php?page=' . $page ); ?>"><?php _e( 'Plugins', 'bestwebsoft' ); ?></a>
|
312 |
-
<a class="bws-nav-tab<?php if ( 'themes' == $tab ) echo ' bws-nav-tab-active'; ?>" href="<?php echo self_admin_url( 'admin.php?page=' . $page . '&tab=themes' ); ?>"><?php _e( 'Themes', 'bestwebsoft' ); ?></a>
|
313 |
-
<a class="bws-nav-tab<?php if ( 'system-status' == $tab ) echo ' bws-nav-tab-active'; ?>" href="<?php echo self_admin_url( 'admin.php?page=' . $page . '&tab=system-status' ); ?>"><?php _e( 'System status', 'bestwebsoft' ); ?></a>
|
314 |
<?php } ?>
|
315 |
</div>
|
316 |
<div class="bws-help-links-wrapper">
|
317 |
-
<a href="
|
318 |
-
<a href="
|
319 |
</div>
|
320 |
<div class="clear"></div>
|
321 |
</div>
|
@@ -330,16 +328,16 @@ if ( ! function_exists( 'bws_add_menu_render' ) ) {
|
|
330 |
'5' < $bstwbsftwppdtplgns_options['go_pro'][ $bws_license_plugin ]['count'] &&
|
331 |
$bstwbsftwppdtplgns_options['go_pro'][ $bws_license_plugin ]['time'] > ( time() - ( 24 * 60 * 60 ) ) ) { ?>
|
332 |
<div class="bws_form_input_wrap">
|
333 |
-
<input disabled="disabled" type="text" name="bws_license_key" value="<?php echo $bws_license_key; ?>" />
|
334 |
<div class="bws_error"><?php _e( "Unfortunately, you have exceeded the number of available tries per day.", 'bestwebsoft' ); ?></div>
|
335 |
</div>
|
336 |
<input disabled="disabled" type="submit" class="bws-button" value="<?php _e( 'Check license key', 'bestwebsoft' ); ?>" />
|
337 |
<?php } else { ?>
|
338 |
<div class="bws_form_input_wrap">
|
339 |
-
<input <?php if ( "" != $error ) echo
|
340 |
-
<div class="bws_error" <?php if ( "" == $error ) echo
|
341 |
</div>
|
342 |
-
<input type="hidden" name="bws_license_plugin" value="<?php echo $bws_license_plugin; ?>" />
|
343 |
<input type="hidden" name="bws_license_submit" value="submit" />
|
344 |
<?php if ( empty( $plugins_array ) ) { ?>
|
345 |
<input type="submit" class="bws-button" value="<?php _e( 'Activate', 'bestwebsoft' ); ?>" />
|
@@ -355,14 +353,14 @@ if ( ! function_exists( 'bws_add_menu_render' ) ) {
|
|
355 |
<?php } ?>
|
356 |
<div class="bws-wrap-content wrap">
|
357 |
<?php if ( 'bws_panel' == $page || ( ! isset( $_GET['tab'] ) && ! $is_main_page ) ) { ?>
|
358 |
-
<div class="updated notice is-dismissible inline" <?php if ( '' == $message || '' != $error ) echo
|
359 |
<h1>
|
360 |
<?php _e( 'Plugins', 'bestwebsoft' ); ?>
|
361 |
<a href="<?php echo self_admin_url( 'plugin-install.php?tab=upload' ); ?>" class="upload page-title-action add-new-h2"><?php _e( 'Upload Plugin', 'bestwebsoft' ); ?></a>
|
362 |
</h1>
|
363 |
<?php if ( isset( $_GET['error'] ) ) {
|
364 |
if ( isset( $_GET['charsout'] ) )
|
365 |
-
$errmsg = sprintf(__( 'The plugin generated %d characters of <strong>unexpected output</strong> during activation. If you notice “headers already sent” messages, problems with syndication feeds or other issues, try deactivating or removing this plugin.' ), $_GET['charsout'] );
|
366 |
else
|
367 |
$errmsg = __( 'Plugin could not be activated because it triggered a <strong>fatal error</strong>.' ); ?>
|
368 |
<div id="message" class="error is-dismissible"><p><?php echo $errmsg; ?></p></div>
|
@@ -372,7 +370,7 @@ if ( ! function_exists( 'bws_add_menu_render' ) ) {
|
|
372 |
|
373 |
if ( isset( $_POST['bws_plugin_action_submit'] ) && isset( $_POST['bws_install_plugin'] ) && check_admin_referer( plugin_basename(__FILE__), 'bws_license_install_nonce_name' ) ) {
|
374 |
|
375 |
-
$bws_license_plugin =
|
376 |
|
377 |
echo '<h2>' . __( 'Installing Plugin', 'bestwebsoft' ) . ': ' . $plugins_array[ $bws_license_plugin ]['name'] . '</h2>';
|
378 |
|
@@ -436,19 +434,28 @@ if ( ! function_exists( 'bws_add_menu_render' ) ) {
|
|
436 |
}
|
437 |
|
438 |
if ( file_exists( WP_PLUGIN_DIR . '/' . $zip_name[0] ) ) {
|
439 |
-
echo '<p><a href="' . wp_nonce_url( $current_page . '&
|
440 |
} else {
|
441 |
if ( empty( $error ) )
|
442 |
$error = __( "Failed to download the zip archive. Please, upload the plugin manually", 'bestwebsoft' );
|
443 |
|
444 |
echo '<p class="error">' . $error . '</p>';
|
445 |
-
echo '<p><a href="' . self_admin_url( $current_page ) . '" target="_parent">' . __( 'Return to BestWebSoft Panel', 'bestwebsoft' ) . '</a></p>';
|
446 |
}
|
447 |
-
} else {
|
|
|
|
|
|
|
448 |
<ul class="subsubsub">
|
449 |
-
<li
|
450 |
-
|
451 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
452 |
</ul>
|
453 |
<div class="clear"></div>
|
454 |
<div class="bws-filter-top">
|
@@ -460,14 +467,14 @@ if ( ! function_exists( 'bws_add_menu_render' ) ) {
|
|
460 |
<div class="bws-filter-title"><?php _e( 'Category', 'bestwebsoft' ); ?></div>
|
461 |
<ul class="bws-category">
|
462 |
<li>
|
463 |
-
<?php $sub_in_url = ( isset( $_GET['sub'] ) && in_array( $_GET['sub'], array( 'installed', 'not_installed' ) ) ) ? '&
|
464 |
-
<a <?php if ( 'all' == $plugin_category ) echo ' class="bws-active"'; ?> href="<?php echo self_admin_url( $current_page . $sub_in_url ); ?>"><?php _e( 'All', 'bestwebsoft' ); ?>
|
465 |
<span>(<?php echo count( $bws_plugins ); ?>)</span>
|
466 |
</a>
|
467 |
</li>
|
468 |
<?php foreach ( $bws_plugins_category as $category_key => $category_value ) { ?>
|
469 |
<li>
|
470 |
-
<a <?php if ( $category_key == $plugin_category ) echo ' class="bws-active"'; ?> href="<?php echo esc_url( self_admin_url( $current_page . $sub_in_url . '&
|
471 |
<span>(<?php echo $category_value['count']; ?>)</span>
|
472 |
</a>
|
473 |
</li>
|
@@ -499,7 +506,7 @@ if ( ! function_exists( 'bws_add_menu_render' ) ) {
|
|
499 |
( isset( $_GET['sub'] ) && 'not_installed' == $_GET['sub'] && ( $is_pro_installed || $is_installed ) ) )
|
500 |
continue;
|
501 |
|
502 |
-
$link_attr = isset( $value_plugin['install_url'] ) ? 'href="' . $value_plugin['install_url'] . '" target="_blank"' : 'href="' . esc_url( self_admin_url( 'plugin-install.php?tab=plugin-information&plugin=' . $key_plugin_explode[0] . '&from=import&TB_iframe=true&width=600&height=550' ) ) . '" class="thickbox open-plugin-details-modal"';
|
503 |
|
504 |
$nothing_found = false; ?>
|
505 |
<div class="bws_product_box<?php if ( $is_active || $is_pro_active ) echo ' bws_product_active'; ?>">
|
@@ -528,7 +535,7 @@ if ( ! function_exists( 'bws_add_menu_render' ) ) {
|
|
528 |
echo ' - <a class="bws-update-now" href="https://support.bestwebsoft.com/hc/en-us/articles/202356359" target="_blank">' . __( 'Renew to get updates', 'bestwebsoft' ) . '</a>';
|
529 |
} elseif ( ! empty( $value_plugin['update_availible'] ) ) {
|
530 |
$r = $update_availible_all->response[ $value_plugin['update_availible'] ];
|
531 |
-
echo ' - <a class="bws-update-now" href="' . wp_nonce_url( self_admin_url( 'update.php?action=upgrade-plugin&plugin='
|
532 |
} ?>
|
533 |
</div>
|
534 |
<div class="bws_product_description">
|
@@ -536,8 +543,8 @@ if ( ! function_exists( 'bws_add_menu_render' ) ) {
|
|
536 |
</div>
|
537 |
<div class="bws_product_links">
|
538 |
<?php if ( $is_active || $is_pro_active ) {
|
539 |
-
if ( $is_pro_isset ) {
|
540 |
-
if (
|
541 |
if ( ! empty( $plugins_array ) && array_key_exists( $value_plugin['pro_version'], $plugins_array ) ) { ?>
|
542 |
<form method="post" action="">
|
543 |
<input type="submit" class="button button-secondary" value="<?php _e( 'Install Now', 'bestwebsoft' ); ?>" />
|
@@ -546,7 +553,7 @@ if ( ! function_exists( 'bws_add_menu_render' ) ) {
|
|
546 |
<?php wp_nonce_field( plugin_basename(__FILE__), 'bws_license_install_nonce_name' ); ?>
|
547 |
</form>
|
548 |
<?php } else { ?>
|
549 |
-
<a class="button button-secondary bws_upgrade_button" href="<?php echo $bws_plugins[ $key_plugin ]['purchase']; ?>" target="_blank"><?php _e( 'Upgrade to Pro', 'bestwebsoft' ); ?></a>
|
550 |
<?php }
|
551 |
}
|
552 |
} else { ?>
|
@@ -554,13 +561,13 @@ if ( ! function_exists( 'bws_add_menu_render' ) ) {
|
|
554 |
<?php }
|
555 |
|
556 |
if ( $is_pro_active ) { ?>
|
557 |
-
<a class="bws_settings" href="<?php echo $bws_plugins[ $key_plugin ]["pro_settings"]; ?>"><?php _e( 'Settings', 'bestwebsoft' ); ?></a>
|
558 |
<?php } else { ?>
|
559 |
-
<a class="bws_settings" href="<?php echo $bws_plugins[ $key_plugin ]["settings"]; ?>"><?php _e( 'Settings', 'bestwebsoft' ); ?></a>
|
560 |
<?php }
|
561 |
} else {
|
562 |
if ( $is_pro_installed ) { ?>
|
563 |
-
<a class="button button-secondary" href="<?php echo wp_nonce_url( $current_page . '&
|
564 |
<?php } elseif ( ! empty( $plugins_array ) && isset( $value_plugin['pro_version'] ) && array_key_exists( $value_plugin['pro_version'], $plugins_array ) ) { ?>
|
565 |
<form method="post" action="">
|
566 |
<input type="submit" class="button button-secondary" value="<?php _e( 'Install Now', 'bestwebsoft' ); ?>" />
|
@@ -569,10 +576,10 @@ if ( ! function_exists( 'bws_add_menu_render' ) ) {
|
|
569 |
<?php wp_nonce_field( plugin_basename(__FILE__), 'bws_license_install_nonce_name' ); ?>
|
570 |
</form>
|
571 |
<?php } elseif ( $is_installed ) { ?>
|
572 |
-
<a class="button button-secondary" href="<?php echo wp_nonce_url( $current_page . '&
|
573 |
<?php } else {
|
574 |
-
$install_url = isset( $value_plugin['install_url'] ) ? $value_plugin['install_url'] :
|
575 |
-
<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>
|
576 |
<?php }
|
577 |
} ?>
|
578 |
</div>
|
@@ -589,14 +596,14 @@ if ( ! function_exists( 'bws_add_menu_render' ) ) {
|
|
589 |
<div class="bws-filter-title"><?php _e( 'Category', 'bestwebsoft' ); ?></div>
|
590 |
<ul class="bws-category">
|
591 |
<li>
|
592 |
-
<?php $sub_in_url = ( isset( $_GET['sub'] ) && in_array( $_GET['sub'], array( 'installed', 'not_installed' ) ) ) ? '&
|
593 |
-
<a <?php if ( 'all' == $plugin_category ) echo ' class="bws-active"'; ?> href="<?php echo self_admin_url( $current_page . $sub_in_url ); ?>"><?php _e( 'All', 'bestwebsoft' ); ?>
|
594 |
<span>(<?php echo count( $bws_plugins ); ?>)</span>
|
595 |
</a>
|
596 |
</li>
|
597 |
<?php foreach ( $bws_plugins_category as $category_key => $category_value ) { ?>
|
598 |
<li>
|
599 |
-
<a <?php if ( $category_key == $plugin_category ) echo ' class="bws-active"'; ?> href="<?php echo esc_url( self_admin_url( $current_page . $sub_in_url . '&
|
600 |
<span>(<?php echo $category_value['count']; ?>)</span>
|
601 |
</a>
|
602 |
</li>
|
@@ -610,58 +617,37 @@ if ( ! function_exists( 'bws_add_menu_render' ) ) {
|
|
610 |
require( dirname( __FILE__ ) . '/product_list.php' ); ?>
|
611 |
<h1><?php _e( 'Themes', 'bestwebsoft' ); ?></h1>
|
612 |
<div id="availablethemes" class="bws-availablethemes">
|
613 |
-
|
614 |
-
|
615 |
-
|
616 |
$installed_theme = wp_get_theme( $theme->slug ); ?>
|
617 |
-
<
|
618 |
-
<
|
619 |
-
|
620 |
-
<h3><?php echo $theme->name; ?></h3>
|
621 |
-
<div class="theme-author"><?php printf( __( 'By %s', 'bestwebsoft' ), 'BestWebSoft' ); ?></div>
|
622 |
-
<div class="action-links">
|
623 |
-
<ul>
|
624 |
-
<?php if ( $installed_theme->exists() ) { ?>
|
625 |
-
<li><span class="install-now" title="'<?php esc_attr__( 'This theme is already installed and is up to date' ); ?>"><?php echo _x( 'Installed', 'theme', 'bestwebsoft' ); ?></span></li>
|
626 |
-
<?php } ?>
|
627 |
-
<li><a class="theme-detail" href="<?php echo esc_url( $theme->href ); ?>" target="_blank"><?php _e( 'Learn More', 'bestwebsoft' ); ?></a></li>
|
628 |
-
</ul>
|
629 |
-
</div>
|
630 |
-
</div>
|
631 |
-
<?php }
|
632 |
-
} else { ?>
|
633 |
-
<div class="theme-browser content-filterable rendered">
|
634 |
-
<div class="themes wp-clearfix">
|
635 |
-
<?php foreach ( $themes as $key => $theme ) {
|
636 |
-
$installed_theme = wp_get_theme( $theme->slug ); ?>
|
637 |
-
<div class="theme" tabindex="0">
|
638 |
-
<div class="theme-screenshot">
|
639 |
-
<img src="<?php echo bws_menu_url( "icons/themes/" ) . $theme->slug . '.png'; ?>" alt="" />
|
640 |
-
</div>
|
641 |
-
<div class="theme-author"><?php printf( __( 'By %s', 'bestwebsoft' ), 'BestWebSoft' ); ?></div>
|
642 |
-
<h3 class="theme-name"><?php echo $theme->name; ?></h3>
|
643 |
-
<div class="theme-actions">
|
644 |
-
<a class="button button-secondary preview install-theme-preview" href="<?php echo $theme->href; ?>" target="_blank"><?php esc_html_e( 'Learn More', 'bestwebsoft' ); ?></a>
|
645 |
-
</div>
|
646 |
-
<?php if ( $installed_theme->exists() ) {
|
647 |
-
if ( $wp_version < '4.6' ) { ?>
|
648 |
-
<div class="theme-installed"><?php _e( 'Already Installed', 'bestwebsoft' ); ?></div>
|
649 |
-
<?php } else { ?>
|
650 |
-
<div class="notice notice-success notice-alt inline"><p><?php _e( 'Installed', 'bestwebsoft' ); ?></p></div>
|
651 |
-
<?php }
|
652 |
-
} ?>
|
653 |
</div>
|
654 |
-
|
655 |
-
|
656 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
657 |
</div>
|
658 |
-
|
659 |
-
<p><a class="bws_browse_link" href="
|
660 |
</div>
|
661 |
<?php } elseif ( 'bws_system_status' == $page || 'system-status' == $tab ) { ?>
|
662 |
<h1><?php _e( 'System status', 'bestwebsoft' ); ?></h1>
|
663 |
-
<div class="updated fade notice is-dismissible inline" <?php if ( ! ( isset( $_REQUEST['bwsmn_form_submit'] ) || isset( $_REQUEST['bwsmn_form_submit_custom_email'] ) ) || $error != "" ) echo
|
664 |
-
<div class="error" <?php if ( "" == $error ) echo
|
665 |
<form method="post" action="">
|
666 |
<p>
|
667 |
<input type="hidden" name="bwsmn_form_submit" value="submit" />
|
@@ -673,7 +659,7 @@ if ( ! function_exists( 'bws_add_menu_render' ) ) {
|
|
673 |
<p>
|
674 |
<input type="hidden" name="bwsmn_form_submit_custom_email" value="submit" />
|
675 |
<input type="submit" class="button" value="<?php _e( 'Send to custom email »', 'bestwebsoft' ) ?>" />
|
676 |
-
<input type="text" maxlength="250" value="
|
677 |
<?php wp_nonce_field( plugin_basename(__FILE__), 'bwsmn_nonce_submit_custom_email' ); ?>
|
678 |
</p>
|
679 |
</form>
|
@@ -685,7 +671,7 @@ if ( ! function_exists( 'bws_add_menu_render' ) ) {
|
|
685 |
<strong>
|
686 |
<?php echo $info['name'];
|
687 |
if ( isset( $info['count'] ) )
|
688 |
-
echo ' (' . $info['count'] . ')'; ?>
|
689 |
</strong>
|
690 |
</th>
|
691 |
</tr>
|
@@ -699,7 +685,7 @@ if ( ! function_exists( 'bws_add_menu_render' ) ) {
|
|
699 |
<?php } ?>
|
700 |
</tbody>
|
701 |
</table>
|
702 |
-
<?php }
|
703 |
} ?>
|
704 |
</div>
|
705 |
</div>
|
@@ -710,6 +696,7 @@ if ( ! function_exists( 'bws_get_banner_array' ) ) {
|
|
710 |
function bws_get_banner_array() {
|
711 |
global $bstwbsftwppdtplgns_banner_array;
|
712 |
$bstwbsftwppdtplgns_banner_array = array(
|
|
|
713 |
array( 'sclbttns_hide_banner_on_plugin_page', 'social-buttons-pack/social-buttons-pack.php', '1.1.0' ),
|
714 |
array( 'tmsht_hide_banner_on_plugin_page', 'timesheet/timesheet.php', '0.1.3' ),
|
715 |
array( 'pgntn_hide_banner_on_plugin_page', 'pagination/pagination.php', '1.0.6' ),
|
1 |
<?php
|
2 |
/*
|
3 |
* Function for displaying BestWebSoft menu
|
4 |
+
* Version: 2.1.5
|
5 |
*/
|
6 |
|
7 |
if ( ! function_exists ( 'bws_admin_enqueue_scripts' ) )
|
10 |
if ( ! function_exists( 'bws_add_menu_render' ) ) {
|
11 |
function bws_add_menu_render() {
|
12 |
global $wpdb, $wp_version, $bws_plugin_info, $bstwbsftwppdtplgns_options;
|
13 |
+
$error = $message = '';
|
14 |
|
15 |
/**
|
16 |
* @deprecated 1.9.8 (15.12.2016)
|
37 |
$sitewide_active_plugins = ( function_exists( 'is_multisite' ) && is_multisite() ) ? get_site_option( 'active_sitewide_plugins' ) : array();
|
38 |
$update_availible_all = get_site_transient( 'update_plugins' );
|
39 |
|
40 |
+
$plugin_category = isset( $_GET['category'] ) ? esc_attr( $_GET['category'] ) : 'all';
|
41 |
|
42 |
if ( ( isset( $_GET['sub'] ) && 'installed' == $_GET['sub'] ) || ! isset( $_GET['sub'] ) ) {
|
43 |
$bws_plugins_update_availible = $bws_plugins_expired = array();
|
87 |
$update_membership_list = true;
|
88 |
|
89 |
if ( isset( $_POST['bws_license_key'] ) )
|
90 |
+
$bws_license_key = sanitize_text_field( $_POST['bws_license_key'] );
|
91 |
|
92 |
if ( isset( $_SESSION['bws_membership_time_check'] ) && isset( $_SESSION['bws_membership_list'] ) && $_SESSION['bws_membership_time_check'] < strtotime( '+12 hours' ) ) {
|
93 |
$update_membership_list = false;
|
143 |
if ( isset( $value->time_out ) && $value->time_out != '' )
|
144 |
$message .= ' ' . __( 'Your license will expire on', 'bestwebsoft' ) . ' ' . $value->time_out . '.';
|
145 |
} else {
|
146 |
+
$message = __( 'Congratulations! Pro Membership license is activated successfully.', 'bestwebsoft' );
|
147 |
}
|
148 |
|
149 |
$bstwbsftwppdtplgns_options[ $bws_license_plugin ] = $bws_license_key;
|
178 |
$post_max_size = ( ini_get( 'post_max_size' ) ) ? ini_get( 'post_max_size' ) : __( 'N/A', 'bestwebsoft' );
|
179 |
$max_execution_time = ( ini_get( 'max_execution_time' ) ) ? ini_get( 'max_execution_time' ) : __( 'N/A', 'bestwebsoft' );
|
180 |
$memory_limit = ( ini_get( 'memory_limit' ) ) ? ini_get( 'memory_limit' ) : __( 'N/A', 'bestwebsoft' );
|
181 |
+
$wp_memory_limit = ( defined( 'WP_MEMORY_LIMIT' ) ) ? WP_MEMORY_LIMIT : __( 'N/A', 'bestwebsoft' );
|
182 |
$memory_usage = ( function_exists( 'memory_get_usage' ) ) ? round( memory_get_usage() / 1024 / 1024, 2 ) . __( ' Mb', 'bestwebsoft' ) : __( 'N/A', 'bestwebsoft' );
|
183 |
$exif_read_data = ( is_callable( 'exif_read_data' ) ) ? __( 'Yes', 'bestwebsoft' ) . " ( V" . substr( phpversion( 'exif' ), 0,4 ) . ")" : __( 'No', 'bestwebsoft' );
|
184 |
$iptcparse = ( is_callable( 'iptcparse' ) ) ? __( 'Yes', 'bestwebsoft' ) : __( 'No', 'bestwebsoft' );
|
199 |
__( 'Website URL', 'bestwebsoft' ) => get_option( 'siteurl' ),
|
200 |
__( 'WP Version', 'bestwebsoft' ) => $wp_version,
|
201 |
__( 'WP Multisite', 'bestwebsoft' ) => $multisite,
|
202 |
+
__( 'WP Memory Limit', 'bestwebsoft' ) => $wp_memory_limit,
|
203 |
__( 'Active Theme', 'bestwebsoft' ) => $theme['Name'] . ' ' . $theme['Version'] . ' (' . sprintf( __( 'by %s', 'bestwebsoft' ), $theme['Author'] ) . ')'
|
204 |
),
|
205 |
),
|
217 |
__( 'PHP Max Script Execute Time', 'bestwebsoft' ) => $max_execution_time,
|
218 |
__( 'PHP Exif support', 'bestwebsoft' ) => $exif_read_data,
|
219 |
__( 'PHP IPTC support', 'bestwebsoft' ) => $iptcparse,
|
220 |
+
__( 'PHP XML support', 'bestwebsoft' ) => $xml_parser_create,
|
221 |
'$_SERVER[HTTP_HOST]' => $_SERVER['HTTP_HOST'],
|
222 |
'$_SERVER[SERVER_NAME]' => $_SERVER['SERVER_NAME'],
|
223 |
),
|
255 |
|
256 |
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' ) ) ) {
|
257 |
if ( isset( $_REQUEST['bwsmn_form_email'] ) ) {
|
258 |
+
$email = sanitize_email( $_REQUEST['bwsmn_form_email'] );
|
259 |
+
if ( '' == $email ) {
|
260 |
+
$error = __( 'Please enter a valid email address.', 'bestwebsoft' );
|
261 |
} else {
|
262 |
+
$message = sprintf( __( 'Email with system info is sent to %s.', 'bestwebsoft' ), $email );
|
|
|
|
|
263 |
}
|
264 |
} else {
|
265 |
$email = 'plugin_system_status@bestwebsoft.com';
|
271 |
$headers .= 'Content-type: text/html; charset=utf-8' . "\n";
|
272 |
$headers .= 'From: ' . get_option( 'admin_email' );
|
273 |
$message_text = '<html><head><title>System Info From ' . home_url() . '</title></head><body>';
|
274 |
+
foreach ( $system_info as $info ) {
|
275 |
+
if ( ! empty( $info['data'] ) ) {
|
276 |
$message_text .= '<h4>' . $info['name'];
|
277 |
if ( isset( $info['count'] ) )
|
278 |
$message_text .= ' (' . $info['count'] . ')';
|
279 |
$message_text .= '</h4><table>';
|
280 |
foreach ( $info['data'] as $key => $value ) {
|
281 |
+
$message_text .= '<tr><td>' . $key . '</td><td>' . $value . '</td></tr>';
|
282 |
}
|
283 |
$message_text .= '</table>';
|
284 |
}
|
293 |
<div class="bws-wrap">
|
294 |
<div class="bws-header">
|
295 |
<div class="bws-title">
|
296 |
+
<a href="<?php echo ( $is_main_page ) ? self_admin_url( 'admin.php?page=bws_panel' ) : esc_url( self_admin_url( 'admin.php?page=' . $page ) ); ?>">
|
297 |
<span class="bws-logo bwsicons bwsicons-bws-logo"></span>
|
298 |
BestWebSoft
|
299 |
<span>panel</span>
|
300 |
</a>
|
301 |
</div>
|
302 |
+
<div class="bws-menu-item-icon">•••</div>
|
303 |
<div class="bws-nav-tab-wrapper">
|
304 |
<?php if ( $is_main_page ) { ?>
|
305 |
<a class="bws-nav-tab<?php if ( 'bws_panel' == $page ) echo ' bws-nav-tab-active'; ?>" href="<?php echo self_admin_url( 'admin.php?page=bws_panel' ); ?>"><?php _e( 'Plugins', 'bestwebsoft' ); ?></a>
|
306 |
<a class="bws-nav-tab<?php if ( 'bws_themes' == $page ) echo ' bws-nav-tab-active'; ?>" href="<?php echo self_admin_url( 'admin.php?page=bws_themes' ); ?>"><?php _e( 'Themes', 'bestwebsoft' ); ?></a>
|
307 |
<a class="bws-nav-tab<?php if ( 'bws_system_status' == $page ) echo ' bws-nav-tab-active'; ?>" href="<?php echo self_admin_url( 'admin.php?page=bws_system_status' ); ?>"><?php _e( 'System status', 'bestwebsoft' ); ?></a>
|
308 |
<?php } else { ?>
|
309 |
+
<a class="bws-nav-tab<?php if ( ! isset( $_GET['tab'] ) ) echo ' bws-nav-tab-active'; ?>" href="<?php echo esc_url( self_admin_url( 'admin.php?page=' . $page ) ); ?>"><?php _e( 'Plugins', 'bestwebsoft' ); ?></a>
|
310 |
+
<a class="bws-nav-tab<?php if ( 'themes' == $tab ) echo ' bws-nav-tab-active'; ?>" href="<?php echo esc_url( self_admin_url( 'admin.php?page=' . $page . '&tab=themes' ) ); ?>"><?php _e( 'Themes', 'bestwebsoft' ); ?></a>
|
311 |
+
<a class="bws-nav-tab<?php if ( 'system-status' == $tab ) echo ' bws-nav-tab-active'; ?>" href="<?php echo esc_url( self_admin_url( 'admin.php?page=' . $page . '&tab=system-status' ) ); ?>"><?php _e( 'System status', 'bestwebsoft' ); ?></a>
|
312 |
<?php } ?>
|
313 |
</div>
|
314 |
<div class="bws-help-links-wrapper">
|
315 |
+
<a href="https://support.bestwebsoft.com" target="_blank"><?php _e( 'Support', 'bestwebsoft' ); ?></a>
|
316 |
+
<a href="https://bestwebsoft.com/client-area" target="_blank" title="<?php _e( 'Manage purchased licenses & subscriptions', 'bestwebsoft' ); ?>">Client Area</a>
|
317 |
</div>
|
318 |
<div class="clear"></div>
|
319 |
</div>
|
328 |
'5' < $bstwbsftwppdtplgns_options['go_pro'][ $bws_license_plugin ]['count'] &&
|
329 |
$bstwbsftwppdtplgns_options['go_pro'][ $bws_license_plugin ]['time'] > ( time() - ( 24 * 60 * 60 ) ) ) { ?>
|
330 |
<div class="bws_form_input_wrap">
|
331 |
+
<input disabled="disabled" type="text" name="bws_license_key" value="<?php echo esc_attr( $bws_license_key); ?>" />
|
332 |
<div class="bws_error"><?php _e( "Unfortunately, you have exceeded the number of available tries per day.", 'bestwebsoft' ); ?></div>
|
333 |
</div>
|
334 |
<input disabled="disabled" type="submit" class="bws-button" value="<?php _e( 'Check license key', 'bestwebsoft' ); ?>" />
|
335 |
<?php } else { ?>
|
336 |
<div class="bws_form_input_wrap">
|
337 |
+
<input <?php if ( "" != $error ) echo 'class="bws_input_error"'; ?> type="text" placeholder="<?php _e( 'Enter your license key', 'bestwebsoft' ); ?>" maxlength="100" name="bws_license_key" value="<?php echo esc_attr( $bws_license_key ); ?>" />
|
338 |
+
<div class="bws_error" <?php if ( "" == $error ) echo 'style="display:none"'; ?>><?php echo $error; ?></div>
|
339 |
</div>
|
340 |
+
<input type="hidden" name="bws_license_plugin" value="<?php echo esc_attr( $bws_license_plugin ); ?>" />
|
341 |
<input type="hidden" name="bws_license_submit" value="submit" />
|
342 |
<?php if ( empty( $plugins_array ) ) { ?>
|
343 |
<input type="submit" class="bws-button" value="<?php _e( 'Activate', 'bestwebsoft' ); ?>" />
|
353 |
<?php } ?>
|
354 |
<div class="bws-wrap-content wrap">
|
355 |
<?php if ( 'bws_panel' == $page || ( ! isset( $_GET['tab'] ) && ! $is_main_page ) ) { ?>
|
356 |
+
<div class="updated notice is-dismissible inline" <?php if ( '' == $message || '' != $error ) echo 'style="display:none"'; ?>><p><?php echo $message; ?></p></div>
|
357 |
<h1>
|
358 |
<?php _e( 'Plugins', 'bestwebsoft' ); ?>
|
359 |
<a href="<?php echo self_admin_url( 'plugin-install.php?tab=upload' ); ?>" class="upload page-title-action add-new-h2"><?php _e( 'Upload Plugin', 'bestwebsoft' ); ?></a>
|
360 |
</h1>
|
361 |
<?php if ( isset( $_GET['error'] ) ) {
|
362 |
if ( isset( $_GET['charsout'] ) )
|
363 |
+
$errmsg = sprintf( __( 'The plugin generated %d characters of <strong>unexpected output</strong> during activation. If you notice “headers already sent” messages, problems with syndication feeds or other issues, try deactivating or removing this plugin.' ), $_GET['charsout'] );
|
364 |
else
|
365 |
$errmsg = __( 'Plugin could not be activated because it triggered a <strong>fatal error</strong>.' ); ?>
|
366 |
<div id="message" class="error is-dismissible"><p><?php echo $errmsg; ?></p></div>
|
370 |
|
371 |
if ( isset( $_POST['bws_plugin_action_submit'] ) && isset( $_POST['bws_install_plugin'] ) && check_admin_referer( plugin_basename(__FILE__), 'bws_license_install_nonce_name' ) ) {
|
372 |
|
373 |
+
$bws_license_plugin = sanitize_text_field( $_POST['bws_install_plugin'] );
|
374 |
|
375 |
echo '<h2>' . __( 'Installing Plugin', 'bestwebsoft' ) . ': ' . $plugins_array[ $bws_license_plugin ]['name'] . '</h2>';
|
376 |
|
434 |
}
|
435 |
|
436 |
if ( file_exists( WP_PLUGIN_DIR . '/' . $zip_name[0] ) ) {
|
437 |
+
echo '<p><a href="' . esc_url( wp_nonce_url( self_admin_url( $current_page . '&bws_activate_plugin=' . $bws_license_plugin ), 'bws_activate_plugin' . $bws_license_plugin ) ) . '" target="_parent">' . __( 'Activate Plugin', 'bestwebsoft' ) . '</a> | <a href="' . esc_url( self_admin_url( $current_page ) ) . '" target="_parent">' . __( 'Return to BestWebSoft Panel', 'bestwebsoft' ) . '</a></p>';
|
438 |
} else {
|
439 |
if ( empty( $error ) )
|
440 |
$error = __( "Failed to download the zip archive. Please, upload the plugin manually", 'bestwebsoft' );
|
441 |
|
442 |
echo '<p class="error">' . $error . '</p>';
|
443 |
+
echo '<p><a href="' . esc_url( self_admin_url( $current_page ) ) . '" target="_parent">' . __( 'Return to BestWebSoft Panel', 'bestwebsoft' ) . '</a></p>';
|
444 |
}
|
445 |
+
} else {
|
446 |
+
$category_href = $current_page;
|
447 |
+
if ( 'all' != $plugin_category )
|
448 |
+
$category_href .= '&category=' . $plugin_category; ?>
|
449 |
<ul class="subsubsub">
|
450 |
+
<li>
|
451 |
+
<a <?php if ( ! isset( $_GET['sub'] ) ) echo 'class="current" '; ?>href="<?php echo esc_url( self_admin_url( $category_href ) ); ?>"><?php _e( 'All', 'bestwebsoft' ); ?></a>
|
452 |
+
</li> |
|
453 |
+
<li>
|
454 |
+
<a <?php if ( isset( $_GET['sub'] ) && 'installed' == $_GET['sub'] ) echo 'class="current" '; ?>href="<?php echo esc_url( self_admin_url( $category_href . '&sub=installed' ) ); ?>"><?php _e( 'Installed', 'bestwebsoft' ); ?></a>
|
455 |
+
</li> |
|
456 |
+
<li>
|
457 |
+
<a <?php if ( isset( $_GET['sub'] ) && 'not_installed' == $_GET['sub'] ) echo 'class="current" '; ?>href="<?php echo esc_url( self_admin_url( $category_href . '&sub=not_installed' ) ); ?>"><?php _e( 'Not Installed', 'bestwebsoft' ); ?></a>
|
458 |
+
</li>
|
459 |
</ul>
|
460 |
<div class="clear"></div>
|
461 |
<div class="bws-filter-top">
|
467 |
<div class="bws-filter-title"><?php _e( 'Category', 'bestwebsoft' ); ?></div>
|
468 |
<ul class="bws-category">
|
469 |
<li>
|
470 |
+
<?php $sub_in_url = ( isset( $_GET['sub'] ) && in_array( $_GET['sub'], array( 'installed', 'not_installed' ) ) ) ? '&sub=' . $_GET['sub'] : ''; ?>
|
471 |
+
<a <?php if ( 'all' == $plugin_category ) echo ' class="bws-active"'; ?> href="<?php echo esc_url(self_admin_url( $current_page . $sub_in_url ) ); ?>"><?php _e( 'All', 'bestwebsoft' ); ?>
|
472 |
<span>(<?php echo count( $bws_plugins ); ?>)</span>
|
473 |
</a>
|
474 |
</li>
|
475 |
<?php foreach ( $bws_plugins_category as $category_key => $category_value ) { ?>
|
476 |
<li>
|
477 |
+
<a <?php if ( $category_key == $plugin_category ) echo ' class="bws-active"'; ?> href="<?php echo esc_url( self_admin_url( $current_page . $sub_in_url . '&category=' . $category_key ) ); ?>"><?php echo $category_value['name']; ?>
|
478 |
<span>(<?php echo $category_value['count']; ?>)</span>
|
479 |
</a>
|
480 |
</li>
|
506 |
( isset( $_GET['sub'] ) && 'not_installed' == $_GET['sub'] && ( $is_pro_installed || $is_installed ) ) )
|
507 |
continue;
|
508 |
|
509 |
+
$link_attr = isset( $value_plugin['install_url'] ) ? 'href="' . esc_url( $value_plugin['install_url'] ) . '" target="_blank"' : 'href="' . esc_url( self_admin_url( 'plugin-install.php?tab=plugin-information&plugin=' . $key_plugin_explode[0] . '&from=import&TB_iframe=true&width=600&height=550' ) ) . '" class="thickbox open-plugin-details-modal"';
|
510 |
|
511 |
$nothing_found = false; ?>
|
512 |
<div class="bws_product_box<?php if ( $is_active || $is_pro_active ) echo ' bws_product_active'; ?>">
|
535 |
echo ' - <a class="bws-update-now" href="https://support.bestwebsoft.com/hc/en-us/articles/202356359" target="_blank">' . __( 'Renew to get updates', 'bestwebsoft' ) . '</a>';
|
536 |
} elseif ( ! empty( $value_plugin['update_availible'] ) ) {
|
537 |
$r = $update_availible_all->response[ $value_plugin['update_availible'] ];
|
538 |
+
echo ' - <a class="bws-update-now" href="' . esc_url( wp_nonce_url( self_admin_url( 'update.php?action=upgrade-plugin&plugin=' . $value_plugin['update_availible'] ), 'upgrade-plugin_' . $value_plugin['update_availible'] ) ) . '" class="update-link" aria-label="' . sprintf( __( 'Update to v %s', 'bestwebsoft' ), $r->new_version ) . '">' . sprintf( __( 'Update to v %s', 'bestwebsoft' ), $r->new_version ) . '</a>';
|
539 |
} ?>
|
540 |
</div>
|
541 |
<div class="bws_product_description">
|
543 |
</div>
|
544 |
<div class="bws_product_links">
|
545 |
<?php if ( $is_active || $is_pro_active ) {
|
546 |
+
if ( $is_pro_isset ) {
|
547 |
+
if ( ! $is_pro_installed ) {
|
548 |
if ( ! empty( $plugins_array ) && array_key_exists( $value_plugin['pro_version'], $plugins_array ) ) { ?>
|
549 |
<form method="post" action="">
|
550 |
<input type="submit" class="button button-secondary" value="<?php _e( 'Install Now', 'bestwebsoft' ); ?>" />
|
553 |
<?php wp_nonce_field( plugin_basename(__FILE__), 'bws_license_install_nonce_name' ); ?>
|
554 |
</form>
|
555 |
<?php } else { ?>
|
556 |
+
<a class="button button-secondary bws_upgrade_button" href="<?php echo esc_url( $bws_plugins[ $key_plugin ]['purchase'] ); ?>" target="_blank"><?php _e( 'Upgrade to Pro', 'bestwebsoft' ); ?></a>
|
557 |
<?php }
|
558 |
}
|
559 |
} else { ?>
|
561 |
<?php }
|
562 |
|
563 |
if ( $is_pro_active ) { ?>
|
564 |
+
<a class="bws_settings" href="<?php echo esc_url( self_admin_url( $bws_plugins[ $key_plugin ]["pro_settings"] ) ); ?>"><?php _e( 'Settings', 'bestwebsoft' ); ?></a>
|
565 |
<?php } else { ?>
|
566 |
+
<a class="bws_settings" href="<?php echo esc_url( self_admin_url( $bws_plugins[ $key_plugin ]["settings"] ) ); ?>"><?php _e( 'Settings', 'bestwebsoft' ); ?></a>
|
567 |
<?php }
|
568 |
} else {
|
569 |
if ( $is_pro_installed ) { ?>
|
570 |
+
<a class="button button-secondary" href="<?php echo esc_url( wp_nonce_url( self_admin_url( $current_page . '&bws_activate_plugin=' . $value_plugin['pro_version'] ), 'bws_activate_plugin' . $value_plugin['pro_version'] ) ); ?>" title="<?php _e( 'Activate this plugin', 'bestwebsoft' ); ?>"><?php _e( 'Activate', 'bestwebsoft' ); ?></a>
|
571 |
<?php } elseif ( ! empty( $plugins_array ) && isset( $value_plugin['pro_version'] ) && array_key_exists( $value_plugin['pro_version'], $plugins_array ) ) { ?>
|
572 |
<form method="post" action="">
|
573 |
<input type="submit" class="button button-secondary" value="<?php _e( 'Install Now', 'bestwebsoft' ); ?>" />
|
576 |
<?php wp_nonce_field( plugin_basename(__FILE__), 'bws_license_install_nonce_name' ); ?>
|
577 |
</form>
|
578 |
<?php } elseif ( $is_installed ) { ?>
|
579 |
+
<a class="button button-secondary" href="<?php echo esc_url( wp_nonce_url( self_admin_url( $current_page . '&bws_activate_plugin=' . $key_plugin ), 'bws_activate_plugin' . $key_plugin ) ); ?>" title="<?php _e( 'Activate this plugin', 'bestwebsoft' ); ?>"><?php _e( 'Activate', 'bestwebsoft' ); ?></a>
|
580 |
<?php } else {
|
581 |
+
$install_url = isset( $value_plugin['install_url'] ) ? $value_plugin['install_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' ); ?>
|
582 |
+
<a class="button button-secondary" href="<?php echo esc_url( $install_url ); ?>" title="<?php _e( 'Install this plugin', 'bestwebsoft' ); ?>" target="_blank"><?php _e( 'Install Now', 'bestwebsoft' ); ?></a>
|
583 |
<?php }
|
584 |
} ?>
|
585 |
</div>
|
596 |
<div class="bws-filter-title"><?php _e( 'Category', 'bestwebsoft' ); ?></div>
|
597 |
<ul class="bws-category">
|
598 |
<li>
|
599 |
+
<?php $sub_in_url = ( isset( $_GET['sub'] ) && in_array( $_GET['sub'], array( 'installed', 'not_installed' ) ) ) ? '&sub=' . $_GET['sub'] : ''; ?>
|
600 |
+
<a <?php if ( 'all' == $plugin_category ) echo ' class="bws-active"'; ?> href="<?php echo esc_url( self_admin_url( $current_page . $sub_in_url ) ); ?>"><?php _e( 'All', 'bestwebsoft' ); ?>
|
601 |
<span>(<?php echo count( $bws_plugins ); ?>)</span>
|
602 |
</a>
|
603 |
</li>
|
604 |
<?php foreach ( $bws_plugins_category as $category_key => $category_value ) { ?>
|
605 |
<li>
|
606 |
+
<a <?php if ( $category_key == $plugin_category ) echo ' class="bws-active"'; ?> href="<?php echo esc_url( self_admin_url( $current_page . $sub_in_url . '&category=' . $category_key ) ); ?>"><?php echo $category_value['name']; ?>
|
607 |
<span>(<?php echo $category_value['count']; ?>)</span>
|
608 |
</a>
|
609 |
</li>
|
617 |
require( dirname( __FILE__ ) . '/product_list.php' ); ?>
|
618 |
<h1><?php _e( 'Themes', 'bestwebsoft' ); ?></h1>
|
619 |
<div id="availablethemes" class="bws-availablethemes">
|
620 |
+
<div class="theme-browser content-filterable rendered">
|
621 |
+
<div class="themes wp-clearfix">
|
622 |
+
<?php foreach ( $themes as $key => $theme ) {
|
623 |
$installed_theme = wp_get_theme( $theme->slug ); ?>
|
624 |
+
<div class="theme" tabindex="0">
|
625 |
+
<div class="theme-screenshot">
|
626 |
+
<img src="<?php echo bws_menu_url( "icons/themes/" ) . $theme->slug . '.png'; ?>" alt="" />
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
627 |
</div>
|
628 |
+
<div class="theme-author"><?php printf( __( 'By %s', 'bestwebsoft' ), 'BestWebSoft' ); ?></div>
|
629 |
+
<h3 class="theme-name"><?php echo $theme->name; ?></h3>
|
630 |
+
<div class="theme-actions">
|
631 |
+
<a class="button button-secondary preview install-theme-preview" href="<?php echo esc_url( $theme->href ); ?>" target="_blank"><?php _e( 'Learn More', 'bestwebsoft' ); ?></a>
|
632 |
+
</div>
|
633 |
+
<?php if ( $installed_theme->exists() ) {
|
634 |
+
if ( $wp_version < '4.6' ) { ?>
|
635 |
+
<div class="theme-installed"><?php _e( 'Already Installed', 'bestwebsoft' ); ?></div>
|
636 |
+
<?php } else { ?>
|
637 |
+
<div class="notice notice-success notice-alt inline"><p><?php _e( 'Installed', 'bestwebsoft' ); ?></p></div>
|
638 |
+
<?php }
|
639 |
+
} ?>
|
640 |
+
</div>
|
641 |
+
<?php } ?>
|
642 |
+
<br class="clear" />
|
643 |
</div>
|
644 |
+
</div>
|
645 |
+
<p><a class="bws_browse_link" href="https://bestwebsoft.com/products/wordpress/themes/" target="_blank"><?php _e( 'Browse More WordPress Themes', 'bestwebsoft' ); ?> <span class="dashicons dashicons-arrow-right-alt2"></span></a></p>
|
646 |
</div>
|
647 |
<?php } elseif ( 'bws_system_status' == $page || 'system-status' == $tab ) { ?>
|
648 |
<h1><?php _e( 'System status', 'bestwebsoft' ); ?></h1>
|
649 |
+
<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>
|
650 |
+
<div class="error" <?php if ( "" == $error ) echo 'style="display:none"'; ?>><p><strong><?php echo $error; ?></strong></p></div>
|
651 |
<form method="post" action="">
|
652 |
<p>
|
653 |
<input type="hidden" name="bwsmn_form_submit" value="submit" />
|
659 |
<p>
|
660 |
<input type="hidden" name="bwsmn_form_submit_custom_email" value="submit" />
|
661 |
<input type="submit" class="button" value="<?php _e( 'Send to custom email »', 'bestwebsoft' ) ?>" />
|
662 |
+
<input type="text" maxlength="250" value="" name="bwsmn_form_email" />
|
663 |
<?php wp_nonce_field( plugin_basename(__FILE__), 'bwsmn_nonce_submit_custom_email' ); ?>
|
664 |
</p>
|
665 |
</form>
|
671 |
<strong>
|
672 |
<?php echo $info['name'];
|
673 |
if ( isset( $info['count'] ) )
|
674 |
+
echo ' (' . $info['count'] . ')'; ?>
|
675 |
</strong>
|
676 |
</th>
|
677 |
</tr>
|
685 |
<?php } ?>
|
686 |
</tbody>
|
687 |
</table>
|
688 |
+
<?php }
|
689 |
} ?>
|
690 |
</div>
|
691 |
</div>
|
696 |
function bws_get_banner_array() {
|
697 |
global $bstwbsftwppdtplgns_banner_array;
|
698 |
$bstwbsftwppdtplgns_banner_array = array(
|
699 |
+
array( 'gglstpvrfctn_hide_banner_on_plugin_page', 'bws-google-2-step-verification/bws-google-2-step-verification.php', '1.0.0' ),
|
700 |
array( 'sclbttns_hide_banner_on_plugin_page', 'social-buttons-pack/social-buttons-pack.php', '1.1.0' ),
|
701 |
array( 'tmsht_hide_banner_on_plugin_page', 'timesheet/timesheet.php', '0.1.3' ),
|
702 |
array( 'pgntn_hide_banner_on_plugin_page', 'pagination/pagination.php', '1.0.6' ),
|
bws_menu/class-bws-settings.php
CHANGED
@@ -7,12 +7,13 @@
|
|
7 |
|
8 |
if ( ! class_exists( 'Bws_Settings_Tabs' ) ) {
|
9 |
class Bws_Settings_Tabs {
|
10 |
-
private $tabs;
|
11 |
-
private $plugin_basename;
|
12 |
-
private $prefix;
|
13 |
private $pro_plugin_is_activated = false;
|
14 |
private $custom_code_args = array();
|
15 |
-
|
|
|
|
|
|
|
16 |
|
17 |
public $options;
|
18 |
public $default_options;
|
@@ -128,7 +129,7 @@ if ( ! class_exists( 'Bws_Settings_Tabs' ) ) {
|
|
128 |
<div id="post-body" class="metabox-holder columns-2">
|
129 |
<div id="post-body-content" style="position: relative;">
|
130 |
<?php $this->display_tabs(); ?>
|
131 |
-
</div><!--
|
132 |
<div id="postbox-container-1" class="postbox-container">
|
133 |
<div class="meta-box-sortables ui-sortable">
|
134 |
<div id="submitdiv" class="postbox">
|
@@ -153,7 +154,7 @@ if ( ! class_exists( 'Bws_Settings_Tabs' ) ) {
|
|
153 |
$daysleft = floor( ( $finish - $today ) / ( 60*60*24 ) );
|
154 |
$license_status = sprintf( __( '%s day(-s) left', 'bestwebsoft' ), $daysleft );
|
155 |
}
|
156 |
-
$license_status .= '. <a target="_blank" href="' . $this->plugins_info['PluginURI'] . '">' . __( 'Upgrade to Pro', 'bestwebsoft' ) . '</a>';
|
157 |
} else {
|
158 |
$license_type = isset( $bstwbsftwppdtplgns_options['nonprofit'][ $this->plugin_basename ] ) ? 'Nonprofit Pro' : 'Pro';
|
159 |
if ( $finish < $today ) {
|
@@ -260,9 +261,11 @@ if ( ! class_exists( 'Bws_Settings_Tabs' ) ) {
|
|
260 |
foreach ( $this->tabs as $tab_slug => $data ) {
|
261 |
if ( ! empty( $data['is_pro'] ) && $this->hide_pro_tabs )
|
262 |
continue; ?>
|
263 |
-
<div class="bws_tab ui-tabs-panel ui-widget-content ui-corner-bottom" id="<?php echo $this->prefix . '_' . $tab_slug; ?>
|
264 |
-
<?php
|
265 |
-
|
|
|
|
|
266 |
} ?>
|
267 |
</div>
|
268 |
<?php }
|
@@ -397,7 +400,7 @@ if ( ! class_exists( 'Bws_Settings_Tabs' ) ) {
|
|
397 |
|
398 |
if ( file_exists( $real_file ) ) {
|
399 |
update_recently_edited( $real_file );
|
400 |
-
$this->custom_code_args["content_{$extension}"] =
|
401 |
if ( ( $this->is_multisite && isset( $bstwbsftwppdtplgns_options['custom_code'][ $this->custom_code_args['blog_id'] ][ $file ] ) ) ||
|
402 |
( ! $this->is_multisite && isset( $bstwbsftwppdtplgns_options['custom_code'][ $file ] ) ) ) {
|
403 |
$this->custom_code_args["is_{$extension}_active"] = true;
|
@@ -429,7 +432,7 @@ if ( ! class_exists( 'Bws_Settings_Tabs' ) ) {
|
|
429 |
'css' => array( 'description' => __( 'These styles will be added to the header on all pages of your site.', 'bestwebsoft' ),
|
430 |
'learn_more_link' => 'https://developer.mozilla.org/en-US/docs/Web/Guide/CSS/Getting_started'
|
431 |
),
|
432 |
-
'php' => array( 'description' => sprintf( __( 'This PHP code will be hooked to the %s action and will be printed on front end only.', 'bestwebsoft' ), '<a href="
|
433 |
'learn_more_link' => 'http://php.net/'
|
434 |
),
|
435 |
'js' => array( 'description' => __( 'These code will be added to the header on all pages of your site.', 'bestwebsoft' ),
|
@@ -453,14 +456,16 @@ if ( ! class_exists( 'Bws_Settings_Tabs' ) ) {
|
|
453 |
echo '(' . __( 'Browsing', 'bestwebsoft' ) . ')'; ?>
|
454 |
</big></p>
|
455 |
<p class="bws_info">
|
456 |
-
<
|
457 |
-
|
|
|
|
|
458 |
</p>
|
459 |
-
<textarea cols="70" rows="25" name="bws_newcontent_<?php echo $extension; ?>" id="bws_newcontent_<?php echo $extension; ?>"><?php if ( isset( $this->custom_code_args["content_{$extension}"] ) ) echo $this->custom_code_args["content_{$extension}"]; ?></textarea>
|
460 |
<p class="bws_info">
|
461 |
<?php echo $extension_data['description']; ?>
|
462 |
<br>
|
463 |
-
<a href="<?php echo $extension_data['learn_more_link']; ?>" target="_blank">
|
464 |
<?php printf( __( 'Learn more about %s', 'bestwebsoft' ), $name ); ?>
|
465 |
</a>
|
466 |
</p>
|
@@ -483,6 +488,8 @@ if ( ! class_exists( 'Bws_Settings_Tabs' ) ) {
|
|
483 |
if ( isset( $_POST["bws_newcontent_{$extension}"] ) &&
|
484 |
$this->custom_code_args["{$extension}_writeable"] ) {
|
485 |
$newcontent = trim( wp_unslash( $_POST["bws_newcontent_{$extension}"] ) );
|
|
|
|
|
486 |
|
487 |
if ( ! empty( $newcontent ) && isset( $_POST["bws_custom_{$extension}_active"] ) ) {
|
488 |
$this->custom_code_args["is_{$extension}_active"] = true;
|
@@ -544,16 +551,20 @@ if ( ! class_exists( 'Bws_Settings_Tabs' ) ) {
|
|
544 |
<tr>
|
545 |
<th scope="row"><?php _e( 'Pro Options', 'bestwebsoft' ); ?></th>
|
546 |
<td>
|
547 |
-
<
|
548 |
-
|
|
|
|
|
549 |
</td>
|
550 |
</tr>
|
551 |
<?php } ?>
|
552 |
<tr>
|
553 |
<th scope="row"><?php _e( 'Track Usage', 'bestwebsoft' ); ?></th>
|
554 |
<td>
|
555 |
-
<
|
556 |
-
|
|
|
|
|
557 |
</td>
|
558 |
</tr>
|
559 |
<tr>
|
@@ -692,7 +703,7 @@ if ( ! class_exists( 'Bws_Settings_Tabs' ) ) {
|
|
692 |
<?php $this->help_phrase(); ?>
|
693 |
<hr>
|
694 |
<?php if ( ! empty( $this->pro_page ) ) {
|
695 |
-
$bws_license_key = ( isset( $_POST['bws_license_key'] ) ) ? stripslashes(
|
696 |
|
697 |
if ( $this->pro_plugin_is_activated ) {
|
698 |
deactivate_plugins( $this->plugin_basename ); ?>
|
@@ -702,7 +713,7 @@ if ( ! class_exists( 'Bws_Settings_Tabs' ) ) {
|
|
702 |
function bws_set_timeout() {
|
703 |
i--;
|
704 |
if ( 0 == i ) {
|
705 |
-
window.location.href = '<?php echo $this->pro_page; ?>';
|
706 |
} else {
|
707 |
$( '#bws_timeout_counter' ).text( i );
|
708 |
window.setTimeout( bws_set_timeout, 1000 );
|
@@ -712,7 +723,7 @@ if ( ! class_exists( 'Bws_Settings_Tabs' ) ) {
|
|
712 |
})(jQuery);
|
713 |
</script>
|
714 |
<p><strong><?php _e( 'Congratulations! Pro license is activated successfully.', 'bestwebsoft' ); ?></strong></p>
|
715 |
-
<p><?php printf( __( 'You will be automatically redirected to the %s in %s seconds.', 'bestwebsoft' ), '<a href="' . $this->pro_page . '">' . __( 'Settings page', 'bestwebsoft' ) . '</a>', '<span id="bws_timeout_counter">7</span>' ); ?></p>
|
716 |
<?php } else {
|
717 |
$attr = '';
|
718 |
if ( isset( $bstwbsftwppdtplgns_options['go_pro'][ $this->bws_license_plugin ]['count'] ) &&
|
@@ -723,17 +734,17 @@ if ( ! class_exists( 'Bws_Settings_Tabs' ) ) {
|
|
723 |
<tr>
|
724 |
<th scope="row"><?php _e( 'License Key', 'bestwebsoft' ); ?></th>
|
725 |
<td>
|
726 |
-
<input <?php echo $attr; ?> type="text" name="bws_license_key" value="<?php echo $bws_license_key; ?>" />
|
727 |
-
<input <?php echo $attr; ?> type="hidden" name="bws_license_plugin" value="<?php echo $this->bws_license_plugin; ?>" />
|
728 |
<input <?php echo $attr; ?> type="submit" class="button button-secondary" name="bws_license_submit" value="<?php _e( 'Activate', 'bestwebsoft' ); ?>" />
|
729 |
<div class="bws_info">
|
730 |
-
<?php printf( __( 'Enter your license key to activate %s and get premium plugin features.', 'bestwebsoft' ), '<a href="' . $this->plugins_info['PluginURI'] . '?k=' . $this->link_key . '&pn=' . $this->link_pn . '&v=' . $this->plugins_info["Version"] . '&wp_v=' . $wp_version . '" target="_blank" title="' . $this->plugins_info["Name"] . ' Pro">' . $this->plugins_info["Name"] . ' Pro</a>' ); ?>
|
731 |
</div>
|
732 |
<?php if ( '' != $attr ) { ?>
|
733 |
<p><?php _e( "Unfortunately, you have exceeded the number of available tries per day. Please, upload the plugin manually.", 'bestwebsoft' ); ?></p>
|
734 |
<?php }
|
735 |
if ( $this->trial_days !== false )
|
736 |
-
echo '<p>' . __( 'or', 'bestwebsoft' ) . ' <a href="' . $this->plugins_info['PluginURI'] . 'trial/?k=' . $this->link_key . '&pn=' . $this->link_pn . '&v=' . $this->plugins_info["Version"] . '&wp_v=' . $wp_version . '" target="_blank">' . sprintf( __( 'Start Your Free %s-Day Trial Now', 'bestwebsoft' ), $this->trial_days ) . '</a></p>'; ?>
|
737 |
</td>
|
738 |
</tr>
|
739 |
</table>
|
@@ -745,7 +756,7 @@ if ( ! class_exists( 'Bws_Settings_Tabs' ) ) {
|
|
745 |
<tr>
|
746 |
<th scope="row"><?php _e( 'License Key', 'bestwebsoft' ); ?></th>
|
747 |
<td>
|
748 |
-
<input type="text" maxlength="100" name="bws_license_key" value="<?php echo $license_key; ?>" />
|
749 |
<input type="submit" class="button button-secondary" name="bws_license_submit" value="<?php _e( 'Check license key', 'bestwebsoft' ); ?>" />
|
750 |
<div class="bws_info">
|
751 |
<?php _e( 'If necessary, you can check if the license key is correct or reenter it in the field below.', 'bestwebsoft' ); ?>
|
@@ -774,7 +785,7 @@ if ( ! class_exists( 'Bws_Settings_Tabs' ) ) {
|
|
774 |
private function save_options_license_key() {
|
775 |
global $wp_version, $bstwbsftwppdtplgns_options;
|
776 |
|
777 |
-
$bws_license_key = ( isset( $_POST['bws_license_key'] ) ) ? stripslashes(
|
778 |
|
779 |
if ( '' != $bws_license_key ) {
|
780 |
if ( strlen( $bws_license_key ) != 18 ) {
|
@@ -831,7 +842,7 @@ if ( ! class_exists( 'Bws_Settings_Tabs' ) ) {
|
|
831 |
$message .= ' ' . __( 'Your license will expire on', 'bestwebsoft' ) . ' ' . $single_response->time_out . '.';
|
832 |
|
833 |
if ( isset( $single_response->trial ) && $this->is_trial )
|
834 |
-
$message .= ' ' . sprintf( __( 'In order to continue using the plugin it is necessary to buy a %s license.', 'bestwebsoft' ), '<a href="' . $this->plugins_info['PluginURI'] . '?k=' . $this->link_key . '&pn=' . $this->link_pn . '&v=' . $this->plugins_info["Version"] . '&wp_v=' . $wp_version . '" target="_blank" title="' . $this->plugins_info["Name"] . '">Pro</a>' );
|
835 |
}
|
836 |
|
837 |
if ( isset( $single_response->trial ) ) {
|
@@ -878,7 +889,7 @@ if ( ! class_exists( 'Bws_Settings_Tabs' ) ) {
|
|
878 |
/* Go Pro */
|
879 |
} else {
|
880 |
|
881 |
-
$bws_license_plugin = stripslashes(
|
882 |
if ( isset( $bstwbsftwppdtplgns_options['go_pro'][ $bws_license_plugin ]['count'] ) && $bstwbsftwppdtplgns_options['go_pro'][ $bws_license_plugin ]['time'] > ( time() - (24 * 60 * 60) ) ) {
|
883 |
$bstwbsftwppdtplgns_options['go_pro'][ $bws_license_plugin ]['count'] = $bstwbsftwppdtplgns_options['go_pro'][ $bws_license_plugin ]['count'] + 1;
|
884 |
} else {
|
@@ -919,7 +930,7 @@ if ( ! class_exists( 'Bws_Settings_Tabs' ) ) {
|
|
919 |
} elseif ( "you_are_banned" == $single_response->package ) {
|
920 |
$error = __( "Unfortunately, you have exceeded the number of available tries per day. Please, upload the plugin manually.", 'bestwebsoft' );
|
921 |
} elseif ( "time_out" == $single_response->package ) {
|
922 |
-
$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>' );
|
923 |
} elseif ( "duplicate_domen_for_trial" == $single_response->package ) {
|
924 |
$error = __( "Unfortunately, the Pro licence was already installed to this domain. The Pro Trial license can be installed only once.", 'bestwebsoft' );
|
925 |
}
|
@@ -945,7 +956,7 @@ if ( ! class_exists( 'Bws_Settings_Tabs' ) ) {
|
|
945 |
}
|
946 |
|
947 |
if ( ! $received_content ) {
|
948 |
-
$error = __( "Failed to download the zip archive. Please, upload the plugin manually", 'bestwebsoft' );
|
949 |
} else {
|
950 |
if ( is_writable( $this->upload_dir["path"] ) ) {
|
951 |
$file_put_contents = $this->upload_dir["path"] . "/" . $zip_name[0] . ".zip";
|
@@ -957,20 +968,20 @@ if ( ! class_exists( 'Bws_Settings_Tabs' ) ) {
|
|
957 |
$zip->extractTo( WP_PLUGIN_DIR );
|
958 |
$zip->close();
|
959 |
} else {
|
960 |
-
$error = __( "Failed to open the zip archive. Please, upload the plugin manually", 'bestwebsoft' );
|
961 |
}
|
962 |
} elseif ( class_exists( 'Phar' ) ) {
|
963 |
$phar = new PharData( $file_put_contents );
|
964 |
$phar->extractTo( WP_PLUGIN_DIR );
|
965 |
} else {
|
966 |
-
$error = __( "Your server does not support either ZipArchive or Phar. Please, upload the plugin manually", 'bestwebsoft' );
|
967 |
}
|
968 |
@unlink( $file_put_contents );
|
969 |
} else {
|
970 |
-
$error = __( "Failed to download the zip archive. Please, upload the plugin manually", 'bestwebsoft' );
|
971 |
}
|
972 |
} else {
|
973 |
-
$error = __( "UploadDir is not writable. Please, upload the plugin manually", 'bestwebsoft' );
|
974 |
}
|
975 |
}
|
976 |
|
@@ -989,7 +1000,7 @@ if ( ! class_exists( 'Bws_Settings_Tabs' ) ) {
|
|
989 |
}
|
990 |
$this->pro_plugin_is_activated = true;
|
991 |
} elseif ( empty( $error ) ) {
|
992 |
-
$error = __( "Failed to download the zip archive. Please, upload the plugin manually", 'bestwebsoft' );
|
993 |
}
|
994 |
}
|
995 |
} else {
|
@@ -1042,22 +1053,22 @@ if ( ! class_exists( 'Bws_Settings_Tabs' ) ) {
|
|
1042 |
public function help_phrase() {
|
1043 |
echo '<div class="bws_tab_description">' . __( 'Need Help?', 'bestwebsoft' ) . ' ';
|
1044 |
if ( '' != $this->doc_link )
|
1045 |
-
echo '<a href="' . $this->doc_link . '" target="_blank">' . __( 'Read the Instruction', 'bestwebsoft' );
|
1046 |
else
|
1047 |
echo '<a href="https://support.bestwebsoft.com/hc/en-us/" target="_blank">' . __( 'Visit Help Center', 'bestwebsoft' );
|
1048 |
if ( '' != $this->doc_video_link )
|
1049 |
-
echo '</a>' . ' ' . __( 'or', 'bestwebsoft' ) . ' ' . '<a href="' . $this->doc_video_link . '" target="_blank">' . __( 'Watch the Video', 'bestwebsoft' );
|
1050 |
echo '</a></div>';
|
1051 |
}
|
1052 |
|
1053 |
public function bws_pro_block_links() {
|
1054 |
global $wp_version; ?>
|
1055 |
<div class="bws_pro_version_tooltip">
|
1056 |
-
<a class="bws_button" href="<?php echo $this->plugins_info['PluginURI']; ?>?k=<?php echo $this->link_key; ?>&pn=<?php echo $this->link_pn; ?>&v=<?php echo $this->plugins_info["Version"]; ?>&wp_v=<?php echo $wp_version; ?>" target="_blank" title="<?php echo $this->plugins_info["Name"]; ?>"><?php _e( 'Upgrade to Pro', 'bestwebsoft' ); ?></a>
|
1057 |
<?php if ( $this->trial_days !== false ) { ?>
|
1058 |
<span class="bws_trial_info">
|
1059 |
<?php _e( 'or', 'bestwebsoft' ); ?>
|
1060 |
-
<a href="<?php echo $this->plugins_info['PluginURI']
|
1061 |
</span>
|
1062 |
<?php } ?>
|
1063 |
<div class="clear"></div>
|
7 |
|
8 |
if ( ! class_exists( 'Bws_Settings_Tabs' ) ) {
|
9 |
class Bws_Settings_Tabs {
|
10 |
+
private $tabs;
|
|
|
|
|
11 |
private $pro_plugin_is_activated = false;
|
12 |
private $custom_code_args = array();
|
13 |
+
|
14 |
+
public $plugin_basename;
|
15 |
+
public $prefix;
|
16 |
+
public $wp_slug;
|
17 |
|
18 |
public $options;
|
19 |
public $default_options;
|
129 |
<div id="post-body" class="metabox-holder columns-2">
|
130 |
<div id="post-body-content" style="position: relative;">
|
131 |
<?php $this->display_tabs(); ?>
|
132 |
+
</div><!-- #post-body-content -->
|
133 |
<div id="postbox-container-1" class="postbox-container">
|
134 |
<div class="meta-box-sortables ui-sortable">
|
135 |
<div id="submitdiv" class="postbox">
|
154 |
$daysleft = floor( ( $finish - $today ) / ( 60*60*24 ) );
|
155 |
$license_status = sprintf( __( '%s day(-s) left', 'bestwebsoft' ), $daysleft );
|
156 |
}
|
157 |
+
$license_status .= '. <a target="_blank" href="' . esc_url( $this->plugins_info['PluginURI'] ) . '">' . __( 'Upgrade to Pro', 'bestwebsoft' ) . '</a>';
|
158 |
} else {
|
159 |
$license_type = isset( $bstwbsftwppdtplgns_options['nonprofit'][ $this->plugin_basename ] ) ? 'Nonprofit Pro' : 'Pro';
|
160 |
if ( $finish < $today ) {
|
261 |
foreach ( $this->tabs as $tab_slug => $data ) {
|
262 |
if ( ! empty( $data['is_pro'] ) && $this->hide_pro_tabs )
|
263 |
continue; ?>
|
264 |
+
<div class="bws_tab ui-tabs-panel ui-widget-content ui-corner-bottom" id="<?php echo esc_attr( $this->prefix . '_' . $tab_slug . '_tab' ); ?>" aria-labelledby="ui-id-2" role="tabpanel" aria-hidden="false" style="display: block;">
|
265 |
+
<?php $tab_slug = str_replace( '-', '_', $tab_slug );
|
266 |
+
if ( method_exists( $this, 'tab_' . $tab_slug ) ) {
|
267 |
+
call_user_func( array( $this, 'tab_' . $tab_slug ) );
|
268 |
+
do_action_ref_array( __CLASS__ . '_after_tab_' . $tab_slug, array( &$this ) );
|
269 |
} ?>
|
270 |
</div>
|
271 |
<?php }
|
400 |
|
401 |
if ( file_exists( $real_file ) ) {
|
402 |
update_recently_edited( $real_file );
|
403 |
+
$this->custom_code_args["content_{$extension}"] = file_get_contents( $real_file );
|
404 |
if ( ( $this->is_multisite && isset( $bstwbsftwppdtplgns_options['custom_code'][ $this->custom_code_args['blog_id'] ][ $file ] ) ) ||
|
405 |
( ! $this->is_multisite && isset( $bstwbsftwppdtplgns_options['custom_code'][ $file ] ) ) ) {
|
406 |
$this->custom_code_args["is_{$extension}_active"] = true;
|
432 |
'css' => array( 'description' => __( 'These styles will be added to the header on all pages of your site.', 'bestwebsoft' ),
|
433 |
'learn_more_link' => 'https://developer.mozilla.org/en-US/docs/Web/Guide/CSS/Getting_started'
|
434 |
),
|
435 |
+
'php' => array( 'description' => sprintf( __( 'This PHP code will be hooked to the %s action and will be printed on front end only.', 'bestwebsoft' ), '<a href="https://codex.wordpress.org/Plugin_API/Action_Reference/init" target="_blank"><code>init</code></a>' ),
|
436 |
'learn_more_link' => 'http://php.net/'
|
437 |
),
|
438 |
'js' => array( 'description' => __( 'These code will be added to the header on all pages of your site.', 'bestwebsoft' ),
|
456 |
echo '(' . __( 'Browsing', 'bestwebsoft' ) . ')'; ?>
|
457 |
</big></p>
|
458 |
<p class="bws_info">
|
459 |
+
<label>
|
460 |
+
<input type="checkbox" name="bws_custom_<?php echo $extension; ?>_active" value="1" <?php if ( $this->custom_code_args["is_{$extension}_active"] ) echo "checked"; ?> />
|
461 |
+
<?php printf( __( 'Activate custom %s code.', 'bestwebsoft' ), $name ); ?>
|
462 |
+
</label>
|
463 |
</p>
|
464 |
+
<textarea cols="70" rows="25" name="bws_newcontent_<?php echo $extension; ?>" id="bws_newcontent_<?php echo $extension; ?>"><?php if ( isset( $this->custom_code_args["content_{$extension}"] ) ) echo esc_textarea( $this->custom_code_args["content_{$extension}"] ); ?></textarea>
|
465 |
<p class="bws_info">
|
466 |
<?php echo $extension_data['description']; ?>
|
467 |
<br>
|
468 |
+
<a href="<?php echo esc_url( $extension_data['learn_more_link'] ); ?>" target="_blank">
|
469 |
<?php printf( __( 'Learn more about %s', 'bestwebsoft' ), $name ); ?>
|
470 |
</a>
|
471 |
</p>
|
488 |
if ( isset( $_POST["bws_newcontent_{$extension}"] ) &&
|
489 |
$this->custom_code_args["{$extension}_writeable"] ) {
|
490 |
$newcontent = trim( wp_unslash( $_POST["bws_newcontent_{$extension}"] ) );
|
491 |
+
if ( 'css' == $extension )
|
492 |
+
$newcontent = wp_kses( $newcontent, 'strip' );
|
493 |
|
494 |
if ( ! empty( $newcontent ) && isset( $_POST["bws_custom_{$extension}_active"] ) ) {
|
495 |
$this->custom_code_args["is_{$extension}_active"] = true;
|
551 |
<tr>
|
552 |
<th scope="row"><?php _e( 'Pro Options', 'bestwebsoft' ); ?></th>
|
553 |
<td>
|
554 |
+
<label>
|
555 |
+
<input <?php echo $this->change_permission_attr; ?> name="bws_hide_premium_options_submit" type="checkbox" value="1" <?php if ( ! $this->hide_pro_tabs ) echo 'checked="checked "'; ?> />
|
556 |
+
<span class="bws_info"><?php _e( 'Enable to display plugin Pro options.', 'bestwebsoft' ); ?></span>
|
557 |
+
</label>
|
558 |
</td>
|
559 |
</tr>
|
560 |
<?php } ?>
|
561 |
<tr>
|
562 |
<th scope="row"><?php _e( 'Track Usage', 'bestwebsoft' ); ?></th>
|
563 |
<td>
|
564 |
+
<label>
|
565 |
+
<input <?php echo $this->change_permission_attr; ?> name="bws_track_usage" type="checkbox" value="1" <?php if ( ! empty( $bstwbsftwppdtplgns_options['track_usage']['products'][ $this->plugin_basename ] ) ) echo 'checked="checked "'; ?>/>
|
566 |
+
<span class="bws_info"><?php _e( 'Enable to allow tracking plugin usage anonymously in order to make it better.', 'bestwebsoft' ); ?></span>
|
567 |
+
</label>
|
568 |
</td>
|
569 |
</tr>
|
570 |
<tr>
|
703 |
<?php $this->help_phrase(); ?>
|
704 |
<hr>
|
705 |
<?php if ( ! empty( $this->pro_page ) ) {
|
706 |
+
$bws_license_key = ( isset( $_POST['bws_license_key'] ) ) ? stripslashes( sanitize_text_field( $_POST['bws_license_key'] ) ) : "";
|
707 |
|
708 |
if ( $this->pro_plugin_is_activated ) {
|
709 |
deactivate_plugins( $this->plugin_basename ); ?>
|
713 |
function bws_set_timeout() {
|
714 |
i--;
|
715 |
if ( 0 == i ) {
|
716 |
+
window.location.href = '<?php echo esc_url( self_admin_url( $this->pro_page ) ); ?>';
|
717 |
} else {
|
718 |
$( '#bws_timeout_counter' ).text( i );
|
719 |
window.setTimeout( bws_set_timeout, 1000 );
|
723 |
})(jQuery);
|
724 |
</script>
|
725 |
<p><strong><?php _e( 'Congratulations! Pro license is activated successfully.', 'bestwebsoft' ); ?></strong></p>
|
726 |
+
<p><?php printf( __( 'You will be automatically redirected to the %s in %s seconds.', 'bestwebsoft' ), '<a href="' . esc_url( self_admin_url( $this->pro_page ) ) . '">' . __( 'Settings page', 'bestwebsoft' ) . '</a>', '<span id="bws_timeout_counter">7</span>' ); ?></p>
|
727 |
<?php } else {
|
728 |
$attr = '';
|
729 |
if ( isset( $bstwbsftwppdtplgns_options['go_pro'][ $this->bws_license_plugin ]['count'] ) &&
|
734 |
<tr>
|
735 |
<th scope="row"><?php _e( 'License Key', 'bestwebsoft' ); ?></th>
|
736 |
<td>
|
737 |
+
<input <?php echo $attr; ?> type="text" name="bws_license_key" value="<?php echo esc_attr( $bws_license_key ); ?>" />
|
738 |
+
<input <?php echo $attr; ?> type="hidden" name="bws_license_plugin" value="<?php echo esc_attr( $this->bws_license_plugin ); ?>" />
|
739 |
<input <?php echo $attr; ?> type="submit" class="button button-secondary" name="bws_license_submit" value="<?php _e( 'Activate', 'bestwebsoft' ); ?>" />
|
740 |
<div class="bws_info">
|
741 |
+
<?php printf( __( 'Enter your license key to activate %s and get premium plugin features.', 'bestwebsoft' ), '<a href="' . esc_url( $this->plugins_info['PluginURI'] . '?k=' . $this->link_key . '&pn=' . $this->link_pn . '&v=' . $this->plugins_info["Version"] . '&wp_v=' . $wp_version ) . '" target="_blank" title="' . $this->plugins_info["Name"] . ' Pro">' . $this->plugins_info["Name"] . ' Pro</a>' ); ?>
|
742 |
</div>
|
743 |
<?php if ( '' != $attr ) { ?>
|
744 |
<p><?php _e( "Unfortunately, you have exceeded the number of available tries per day. Please, upload the plugin manually.", 'bestwebsoft' ); ?></p>
|
745 |
<?php }
|
746 |
if ( $this->trial_days !== false )
|
747 |
+
echo '<p>' . __( 'or', 'bestwebsoft' ) . ' <a href="' . esc_url( $this->plugins_info['PluginURI'] . 'trial/?k=' . $this->link_key . '&pn=' . $this->link_pn . '&v=' . $this->plugins_info["Version"] . '&wp_v=' . $wp_version ) . '" target="_blank">' . sprintf( __( 'Start Your Free %s-Day Trial Now', 'bestwebsoft' ), $this->trial_days ) . '</a></p>'; ?>
|
748 |
</td>
|
749 |
</tr>
|
750 |
</table>
|
756 |
<tr>
|
757 |
<th scope="row"><?php _e( 'License Key', 'bestwebsoft' ); ?></th>
|
758 |
<td>
|
759 |
+
<input type="text" maxlength="100" name="bws_license_key" value="<?php echo esc_attr( $license_key ); ?>" />
|
760 |
<input type="submit" class="button button-secondary" name="bws_license_submit" value="<?php _e( 'Check license key', 'bestwebsoft' ); ?>" />
|
761 |
<div class="bws_info">
|
762 |
<?php _e( 'If necessary, you can check if the license key is correct or reenter it in the field below.', 'bestwebsoft' ); ?>
|
785 |
private function save_options_license_key() {
|
786 |
global $wp_version, $bstwbsftwppdtplgns_options;
|
787 |
|
788 |
+
$bws_license_key = ( isset( $_POST['bws_license_key'] ) ) ? stripslashes( sanitize_text_field( $_POST['bws_license_key'] ) ) : '';
|
789 |
|
790 |
if ( '' != $bws_license_key ) {
|
791 |
if ( strlen( $bws_license_key ) != 18 ) {
|
842 |
$message .= ' ' . __( 'Your license will expire on', 'bestwebsoft' ) . ' ' . $single_response->time_out . '.';
|
843 |
|
844 |
if ( isset( $single_response->trial ) && $this->is_trial )
|
845 |
+
$message .= ' ' . sprintf( __( 'In order to continue using the plugin it is necessary to buy a %s license.', 'bestwebsoft' ), '<a href="' . esc_url( $this->plugins_info['PluginURI'] . '?k=' . $this->link_key . '&pn=' . $this->link_pn . '&v=' . $this->plugins_info["Version"] . '&wp_v=' . $wp_version ) . '" target="_blank" title="' . $this->plugins_info["Name"] . '">Pro</a>' );
|
846 |
}
|
847 |
|
848 |
if ( isset( $single_response->trial ) ) {
|
889 |
/* Go Pro */
|
890 |
} else {
|
891 |
|
892 |
+
$bws_license_plugin = stripslashes( sanitize_text_field( $_POST['bws_license_plugin'] ) );
|
893 |
if ( isset( $bstwbsftwppdtplgns_options['go_pro'][ $bws_license_plugin ]['count'] ) && $bstwbsftwppdtplgns_options['go_pro'][ $bws_license_plugin ]['time'] > ( time() - (24 * 60 * 60) ) ) {
|
894 |
$bstwbsftwppdtplgns_options['go_pro'][ $bws_license_plugin ]['count'] = $bstwbsftwppdtplgns_options['go_pro'][ $bws_license_plugin ]['count'] + 1;
|
895 |
} else {
|
930 |
} elseif ( "you_are_banned" == $single_response->package ) {
|
931 |
$error = __( "Unfortunately, you have exceeded the number of available tries per day. Please, upload the plugin manually.", 'bestwebsoft' );
|
932 |
} elseif ( "time_out" == $single_response->package ) {
|
933 |
+
$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>' );
|
934 |
} elseif ( "duplicate_domen_for_trial" == $single_response->package ) {
|
935 |
$error = __( "Unfortunately, the Pro licence was already installed to this domain. The Pro Trial license can be installed only once.", 'bestwebsoft' );
|
936 |
}
|
956 |
}
|
957 |
|
958 |
if ( ! $received_content ) {
|
959 |
+
$error = __( "Failed to download the zip archive. Please, upload the plugin manually.", 'bestwebsoft' );
|
960 |
} else {
|
961 |
if ( is_writable( $this->upload_dir["path"] ) ) {
|
962 |
$file_put_contents = $this->upload_dir["path"] . "/" . $zip_name[0] . ".zip";
|
968 |
$zip->extractTo( WP_PLUGIN_DIR );
|
969 |
$zip->close();
|
970 |
} else {
|
971 |
+
$error = __( "Failed to open the zip archive. Please, upload the plugin manually.", 'bestwebsoft' );
|
972 |
}
|
973 |
} elseif ( class_exists( 'Phar' ) ) {
|
974 |
$phar = new PharData( $file_put_contents );
|
975 |
$phar->extractTo( WP_PLUGIN_DIR );
|
976 |
} else {
|
977 |
+
$error = __( "Your server does not support either ZipArchive or Phar. Please, upload the plugin manually.", 'bestwebsoft' );
|
978 |
}
|
979 |
@unlink( $file_put_contents );
|
980 |
} else {
|
981 |
+
$error = __( "Failed to download the zip archive. Please, upload the plugin manually.", 'bestwebsoft' );
|
982 |
}
|
983 |
} else {
|
984 |
+
$error = __( "UploadDir is not writable. Please, upload the plugin manually.", 'bestwebsoft' );
|
985 |
}
|
986 |
}
|
987 |
|
1000 |
}
|
1001 |
$this->pro_plugin_is_activated = true;
|
1002 |
} elseif ( empty( $error ) ) {
|
1003 |
+
$error = __( "Failed to download the zip archive. Please, upload the plugin manually.", 'bestwebsoft' );
|
1004 |
}
|
1005 |
}
|
1006 |
} else {
|
1053 |
public function help_phrase() {
|
1054 |
echo '<div class="bws_tab_description">' . __( 'Need Help?', 'bestwebsoft' ) . ' ';
|
1055 |
if ( '' != $this->doc_link )
|
1056 |
+
echo '<a href="' . esc_url( $this->doc_link ) . '" target="_blank">' . __( 'Read the Instruction', 'bestwebsoft' );
|
1057 |
else
|
1058 |
echo '<a href="https://support.bestwebsoft.com/hc/en-us/" target="_blank">' . __( 'Visit Help Center', 'bestwebsoft' );
|
1059 |
if ( '' != $this->doc_video_link )
|
1060 |
+
echo '</a>' . ' ' . __( 'or', 'bestwebsoft' ) . ' ' . '<a href="' . esc_url( $this->doc_video_link ) . '" target="_blank">' . __( 'Watch the Video', 'bestwebsoft' );
|
1061 |
echo '</a></div>';
|
1062 |
}
|
1063 |
|
1064 |
public function bws_pro_block_links() {
|
1065 |
global $wp_version; ?>
|
1066 |
<div class="bws_pro_version_tooltip">
|
1067 |
+
<a class="bws_button" href="<?php echo esc_url( $this->plugins_info['PluginURI'] ); ?>?k=<?php echo $this->link_key; ?>&pn=<?php echo $this->link_pn; ?>&v=<?php echo $this->plugins_info["Version"]; ?>&wp_v=<?php echo $wp_version; ?>" target="_blank" title="<?php echo $this->plugins_info["Name"]; ?>"><?php _e( 'Upgrade to Pro', 'bestwebsoft' ); ?></a>
|
1068 |
<?php if ( $this->trial_days !== false ) { ?>
|
1069 |
<span class="bws_trial_info">
|
1070 |
<?php _e( 'or', 'bestwebsoft' ); ?>
|
1071 |
+
<a href="<?php echo esc_url( $this->plugins_info['PluginURI'] . '?k=' . $this->link_key . '&pn=' . $this->link_pn . '&v=' . $this->plugins_info["Version"] . '&wp_v=' . $wp_version ); ?>" target="_blank" title="<?php echo $this->plugins_info["Name"]; ?>"><?php _e( 'Start Your Free Trial', 'bestwebsoft' ); ?></a>
|
1072 |
</span>
|
1073 |
<?php } ?>
|
1074 |
<div class="clear"></div>
|
bws_menu/css/modal.css
ADDED
@@ -0,0 +1,114 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
.bws-modal {
|
2 |
+
position: fixed;
|
3 |
+
overflow: auto;
|
4 |
+
height: 100%;
|
5 |
+
width: 100%;
|
6 |
+
top: 0;
|
7 |
+
z-index: 100000;
|
8 |
+
display: none;
|
9 |
+
background: rgba(0, 0, 0, 0.6);
|
10 |
+
}
|
11 |
+
.bws-modal.active {
|
12 |
+
display: block;
|
13 |
+
}
|
14 |
+
.bws-modal.active:before {
|
15 |
+
display: block;
|
16 |
+
}
|
17 |
+
.bws-modal .bws-modal-dialog {
|
18 |
+
background: transparent;
|
19 |
+
position: absolute;
|
20 |
+
left: 50%;
|
21 |
+
margin-left: -298px;
|
22 |
+
padding-bottom: 30px;
|
23 |
+
top: -100%;
|
24 |
+
z-index: 100001;
|
25 |
+
width: 596px;
|
26 |
+
}
|
27 |
+
.bws-modal.active .bws-modal-dialog {
|
28 |
+
top: 10%;
|
29 |
+
}
|
30 |
+
.bws-modal .bws-modal-body,
|
31 |
+
.bws-modal .bws-modal-footer {
|
32 |
+
border: 0;
|
33 |
+
background: #fff;
|
34 |
+
padding: 25px 25px 15px;
|
35 |
+
}
|
36 |
+
.bws-modal .bws-modal-body {
|
37 |
+
border-bottom: 0;
|
38 |
+
}
|
39 |
+
.bws-modal .bws-modal-body p {
|
40 |
+
font-size: 1.3em;
|
41 |
+
}
|
42 |
+
.bws-modal .bws-modal-body h2 {
|
43 |
+
font-size: 1.6em;
|
44 |
+
font-weight: bold;
|
45 |
+
margin-top: 0;
|
46 |
+
}
|
47 |
+
.bws-modal .bws-modal-footer {
|
48 |
+
border-top: #eeeeee solid 1px;
|
49 |
+
text-align: right;
|
50 |
+
}
|
51 |
+
.bws-modal .bws-modal-footer .button {
|
52 |
+
margin: 0 7px;
|
53 |
+
}
|
54 |
+
.bws-modal .bws-modal-footer .button:first-child {
|
55 |
+
margin: 0;
|
56 |
+
}
|
57 |
+
.bws-modal .bws-modal-panel>.notice.inline {
|
58 |
+
margin: 0;
|
59 |
+
display: none;
|
60 |
+
}
|
61 |
+
.bws-modal .bws-modal-panel:not(.active) {
|
62 |
+
display: none;
|
63 |
+
}
|
64 |
+
body.has-bws-modal {
|
65 |
+
overflow: hidden;
|
66 |
+
}
|
67 |
+
.bws-modal.bws-modal-deactivation-feedback .bws-modal-reason-input,
|
68 |
+
.bws-modal.bws-modal-deactivation-feedback .bws-modal-internal-message {
|
69 |
+
margin: 3px 0 3px 22px;
|
70 |
+
}
|
71 |
+
.bws-modal.bws-modal-deactivation-feedback .bws-modal-reason-input input,
|
72 |
+
.bws-modal.bws-modal-deactivation-feedback .bws-modal-reason-input textarea,
|
73 |
+
.bws-modal.bws-modal-deactivation-feedback .bws-modal-internal-message input,
|
74 |
+
.bws-modal.bws-modal-deactivation-feedback .bws-modal-internal-message textarea {
|
75 |
+
width: 100%;
|
76 |
+
}
|
77 |
+
.bws-modal.bws-modal-deactivation-feedback li.bws-modal-reason.has-internal-message .bws-modal-internal-message {
|
78 |
+
border: 1px solid #ccc;
|
79 |
+
padding: 7px;
|
80 |
+
display: none;
|
81 |
+
}
|
82 |
+
.bws-modal.bws-modal-deactivation-feedback .bws-modal-anonymous-label {
|
83 |
+
padding-top: 15px;
|
84 |
+
}
|
85 |
+
.bws-modal.bws-modal-deactivation-feedback .bws-modal-panel {
|
86 |
+
margin-top: 0 !important;
|
87 |
+
}
|
88 |
+
|
89 |
+
@media (max-width: 650px) {
|
90 |
+
.bws-modal .bws-modal-dialog {
|
91 |
+
margin-left: -50%;
|
92 |
+
box-sizing: border-box;
|
93 |
+
padding-left: 10px;
|
94 |
+
padding-right: 10px;
|
95 |
+
width: 100%;
|
96 |
+
}
|
97 |
+
.bws-modal .bws-modal-dialog .bws-modal-panel>h3>strong {
|
98 |
+
font-size: 1.3em;
|
99 |
+
}
|
100 |
+
.bws-modal.bws-modal-deactivation-feedback li.bws-modal-reason li.bws-modal-reason {
|
101 |
+
margin-bottom: 10px;
|
102 |
+
}
|
103 |
+
.bws-modal.bws-modal-deactivation-feedback li.bws-modal-reason li.bws-modal-reason .bws-modal-reason-input,
|
104 |
+
.bws-modal.bws-modal-deactivation-feedback li.bws-modal-reason li.bws-modal-reason .bws-modal-internal-message {
|
105 |
+
margin-left: 29px;
|
106 |
+
}
|
107 |
+
.bws-modal.bws-modal-deactivation-feedback li.bws-modal-reason li.bws-modal-reason label {
|
108 |
+
display: table;
|
109 |
+
}
|
110 |
+
.bws-modal.bws-modal-deactivation-feedback li.bws-modal-reason li.bws-modal-reason label>span {
|
111 |
+
display: table-cell;
|
112 |
+
font-size: 1.3em;
|
113 |
+
}
|
114 |
+
}
|
bws_menu/deactivation-form.php
ADDED
@@ -0,0 +1,429 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Displays the content of the dialog box when the user clicks on the "Deactivate" link on the plugin settings page
|
4 |
+
* @package BestWebSoft
|
5 |
+
* @since 2.1.3
|
6 |
+
*/
|
7 |
+
if ( ! defined( 'ABSPATH' ) )
|
8 |
+
exit;
|
9 |
+
|
10 |
+
/**
|
11 |
+
* Displays a confirmation and feedback dialog box when the user clicks on the "Deactivate" link on the plugins
|
12 |
+
* page.
|
13 |
+
*
|
14 |
+
* @since 2.1.3
|
15 |
+
*/
|
16 |
+
if ( ! function_exists( 'bws_add_deactivation_feedback_dialog_box' ) ) {
|
17 |
+
function bws_add_deactivation_feedback_dialog_box() {
|
18 |
+
global $bstwbsftwppdtplgns_active_plugins;
|
19 |
+
if ( empty( $bstwbsftwppdtplgns_active_plugins ) )
|
20 |
+
return;
|
21 |
+
|
22 |
+
foreach ( $bstwbsftwppdtplgns_active_plugins as $basename => $plugin_data ) {
|
23 |
+
|
24 |
+
$slug = dirname( $basename );
|
25 |
+
$plugin_id = sanitize_title( $plugin_data['Name'] );
|
26 |
+
|
27 |
+
$contact_support_template = __( 'Need help? We are ready to answer your questions.', 'bestwebsoft' ) . ' <a href="https://support.bestwebsoft.com/hc/en-us/requests/new" target="_blank">' . __( 'Contact Support', 'bestwebsoft' ) . '</a>';
|
28 |
+
|
29 |
+
$reasons = array(
|
30 |
+
array(
|
31 |
+
'id' => 'NOT_WORKING',
|
32 |
+
'text' => __( 'The plugin is not working', 'bestwebsoft' ),
|
33 |
+
'input_type' => 'textarea',
|
34 |
+
'input_placeholder' => __( "Kindly share what didn't work so we can fix it in future updates...", 'bestwebsoft' )
|
35 |
+
),
|
36 |
+
array(
|
37 |
+
'id' => 'DIDNT_WORK_AS_EXPECTED',
|
38 |
+
'text' => __( "The plugin didn't work as expected", 'bestwebsoft' ),
|
39 |
+
'input_type' => 'textarea',
|
40 |
+
'input_placeholder' => __( 'What did you expect?', 'bestwebsoft' )
|
41 |
+
),
|
42 |
+
array(
|
43 |
+
'id' => 'SUDDENLY_STOPPED_WORKING',
|
44 |
+
'text' => __( 'The plugin suddenly stopped working', 'bestwebsoft' ),
|
45 |
+
'input_type' => '',
|
46 |
+
'input_placeholder' => '',
|
47 |
+
'internal_message' => $contact_support_template
|
48 |
+
),
|
49 |
+
array(
|
50 |
+
'id' => 'BROKE_MY_SITE',
|
51 |
+
'text' => __( 'The plugin broke my site', 'bestwebsoft' ),
|
52 |
+
'input_type' => '',
|
53 |
+
'input_placeholder' => '',
|
54 |
+
'internal_message' => $contact_support_template
|
55 |
+
),
|
56 |
+
array(
|
57 |
+
'id' => 'COULDNT_MAKE_IT_WORK',
|
58 |
+
'text' => __( "I couldn't understand how to get it work", 'bestwebsoft' ),
|
59 |
+
'input_type' => '',
|
60 |
+
'input_placeholder' => '',
|
61 |
+
'internal_message' => $contact_support_template
|
62 |
+
),
|
63 |
+
array(
|
64 |
+
'id' => 'FOUND_A_BETTER_PLUGIN',
|
65 |
+
'text' => __( 'I found a better plugin', 'bestwebsoft' ),
|
66 |
+
'input_type' => 'textfield',
|
67 |
+
'input_placeholder' => __( "What's the plugin name?", 'bestwebsoft' )
|
68 |
+
),
|
69 |
+
array(
|
70 |
+
'id' => 'GREAT_BUT_NEED_SPECIFIC_FEATURE',
|
71 |
+
'text' => __( "The plugin is great, but I need specific feature that you don't support", 'bestwebsoft' ),
|
72 |
+
'input_type' => 'textarea',
|
73 |
+
'input_placeholder' => __( 'What feature?', 'bestwebsoft' )
|
74 |
+
),
|
75 |
+
array(
|
76 |
+
'id' => 'NO_LONGER_NEEDED',
|
77 |
+
'text' => __( 'I no longer need the plugin', 'bestwebsoft' ),
|
78 |
+
'input_type' => '',
|
79 |
+
'input_placeholder' => ''
|
80 |
+
),
|
81 |
+
array(
|
82 |
+
'id' => 'TEMPORARY_DEACTIVATION',
|
83 |
+
'text' => __( "It's a temporary deactivation, I'm just debugging an issue", 'bestwebsoft' ),
|
84 |
+
'input_type' => '',
|
85 |
+
'input_placeholder' => ''
|
86 |
+
),
|
87 |
+
array(
|
88 |
+
'id' => 'OTHER',
|
89 |
+
'text' => __( 'Other', 'bestwebsoft' ),
|
90 |
+
'input_type' => 'textfield',
|
91 |
+
'input_placeholder' => ''
|
92 |
+
)
|
93 |
+
);
|
94 |
+
|
95 |
+
$reasons_list_items_html = '';
|
96 |
+
|
97 |
+
foreach ( $reasons as $reason ) {
|
98 |
+
$list_item_classes = 'bws-modal-reason' . ( ! empty( $reason['input_type'] ) ? ' has-input' : '' );
|
99 |
+
|
100 |
+
if ( ! empty( $reason['internal_message'] ) ) {
|
101 |
+
$list_item_classes .= ' has-internal-message';
|
102 |
+
$reason_internal_message = $reason['internal_message'];
|
103 |
+
} else {
|
104 |
+
$reason_internal_message = '';
|
105 |
+
}
|
106 |
+
|
107 |
+
$reasons_list_items_html .= '<li class="' . $list_item_classes . '" data-input-type="' . $reason['input_type'] . '" data-input-placeholder="' . $reason['input_placeholder'] . '">
|
108 |
+
<label>
|
109 |
+
<span>
|
110 |
+
<input type="radio" name="selected-reason" value="' . $reason['id'] . '"/>
|
111 |
+
</span>
|
112 |
+
<span>' . $reason['text'] . '</span>
|
113 |
+
</label>
|
114 |
+
<div class="bws-modal-internal-message">' . $reason_internal_message . '</div>
|
115 |
+
</li>';
|
116 |
+
} ?>
|
117 |
+
<script type="text/javascript">
|
118 |
+
(function($) {
|
119 |
+
var modalHtml =
|
120 |
+
'<div class="bws-modal bws-modal-deactivation-feedback">'
|
121 |
+
+ ' <div class="bws-modal-dialog">'
|
122 |
+
+ ' <div class="bws-modal-body">'
|
123 |
+
+ ' <h2><?php _e( 'Quick Feedback', 'bestwebsoft' ); ?></h2>'
|
124 |
+
+ ' <div class="bws-modal-panel active"><p><?php _e( 'If you have a moment, please let us know why you are deactivating', 'bestwebsoft' ); ?>:</p><ul>' + <?php echo json_encode( $reasons_list_items_html ); ?> + '</ul>'
|
125 |
+
+ ' <label class="bws-modal-anonymous-label">'
|
126 |
+
+ ' <input type="checkbox" checked="che |