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