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