Edit File by line

Deprecated: str_replace(): Passing null to parameter #2 ($replace) of type array|string is deprecated in /home/sportsfever/public_html/filemanger/function.php on line 93
/home/sportsfe.../httpdocs/wp-conte.../plugins/portfoli.../bws_menu
File: bws_menu.php
<?php
[0] Fix | Delete
if ( ! defined( 'ABSPATH' ) ) {
[1] Fix | Delete
exit;
[2] Fix | Delete
}
[3] Fix | Delete
[4] Fix | Delete
/**
[5] Fix | Delete
* Function for displaying BestWebSoft menu
[6] Fix | Delete
* Version: 2.4.3
[7] Fix | Delete
*/
[8] Fix | Delete
if ( ! function_exists( 'bws_admin_enqueue_scripts' ) ) {
[9] Fix | Delete
require_once dirname( __FILE__ ) . '/bws_functions.php';
[10] Fix | Delete
}
[11] Fix | Delete
[12] Fix | Delete
if ( ! function_exists( 'bws_add_menu_render' ) ) {
[13] Fix | Delete
/**
[14] Fix | Delete
* Function for render BestWebSoft menu
[15] Fix | Delete
*/
[16] Fix | Delete
function bws_add_menu_render() {
[17] Fix | Delete
global $wpdb, $wp_version, $bstwbsftwppdtplgns_options;
[18] Fix | Delete
$error = '';
[19] Fix | Delete
$message = '';
[20] Fix | Delete
[21] Fix | Delete
/**
[22] Fix | Delete
* @deprecated 1.9.8 (15.12.2016)
[23] Fix | Delete
*/
[24] Fix | Delete
$is_main_page = isset( $_GET['page'] ) && in_array( $_GET['page'], array( 'bws_panel', 'bws_themes', 'bws_system_status' ) );
[25] Fix | Delete
$page = sanitize_text_field( wp_unslash( $_GET['page'] ) );
[26] Fix | Delete
$tab = isset( $_GET['tab'] ) ? sanitize_text_field( wp_unslash( $_GET['tab'] ) ) : '';
[27] Fix | Delete
[28] Fix | Delete
if ( $is_main_page ) {
[29] Fix | Delete
$current_page = 'admin.php?page=' . $page;
[30] Fix | Delete
} else {
[31] Fix | Delete
$current_page = isset( $_GET['tab'] ) ? 'admin.php?page=' . $page . '&tab=' . $tab : 'admin.php?page=' . $page;
[32] Fix | Delete
}
[33] Fix | Delete
[34] Fix | Delete
if ( 'bws_panel' === $page || ( ! $is_main_page && '' === $tab ) ) {
[35] Fix | Delete
[36] Fix | Delete
if ( ! function_exists( 'is_plugin_active_for_network' ) ) {
[37] Fix | Delete
require_once ABSPATH . 'wp-admin/includes/plugin.php';
[38] Fix | Delete
}
[39] Fix | Delete
[40] Fix | Delete
/* Get $bws_plugins */
[41] Fix | Delete
require dirname( __FILE__ ) . '/product_list.php';
[42] Fix | Delete
[43] Fix | Delete
$all_plugins = get_plugins();
[44] Fix | Delete
$active_plugins = get_option( 'active_plugins' );
[45] Fix | Delete
$sitewide_active_plugins = ( function_exists( 'is_multisite' ) && is_multisite() ) ? get_site_option( 'active_sitewide_plugins' ) : array();
[46] Fix | Delete
$update_availible_all = get_site_transient( 'update_plugins' );
[47] Fix | Delete
[48] Fix | Delete
$plugin_category = isset( $_GET['category'] ) ? sanitize_text_field( wp_unslash( $_GET['category'] ) ) : 'all';
[49] Fix | Delete
[50] Fix | Delete
if ( ( isset( $_GET['sub'] ) && 'installed' === sanitize_text_field( wp_unslash( $_GET['sub'] ) ) ) || ! isset( $_GET['sub'] ) ) {
[51] Fix | Delete
$bws_plugins_update_availible = array();
[52] Fix | Delete
$bws_plugins_expired = array();
[53] Fix | Delete
foreach ( $bws_plugins as $key_plugin => $value_plugin ) {
[54] Fix | Delete
[55] Fix | Delete
foreach ( $value_plugin['category'] as $category_key ) {
[56] Fix | Delete
$bws_plugins_category[ $category_key ]['count'] = isset( $bws_plugins_category[ $category_key ]['count'] ) ? $bws_plugins_category[ $category_key ]['count'] + 1 : 1;
[57] Fix | Delete
}
[58] Fix | Delete
[59] Fix | Delete
$is_installed = array_key_exists( $key_plugin, $all_plugins );
[60] Fix | Delete
$is_pro_installed = false;
[61] Fix | Delete
if ( isset( $value_plugin['pro_version'] ) ) {
[62] Fix | Delete
$is_pro_installed = array_key_exists( $value_plugin['pro_version'], $all_plugins );
[63] Fix | Delete
}
[64] Fix | Delete
/* Check update_availible */
[65] Fix | Delete
if ( ! empty( $update_availible_all ) && ! empty( $update_availible_all->response ) ) {
[66] Fix | Delete
if ( $is_pro_installed && array_key_exists( $value_plugin['pro_version'], $update_availible_all->response ) ) {
[67] Fix | Delete
unset( $bws_plugins[ $key_plugin ] );
[68] Fix | Delete
$value_plugin['update_availible'] = $value_plugin['pro_version'];
[69] Fix | Delete
$bws_plugins_update_availible[ $key_plugin ] = $value_plugin;
[70] Fix | Delete
} elseif ( $is_installed && array_key_exists( $key_plugin, $update_availible_all->response ) ) {
[71] Fix | Delete
unset( $bws_plugins[ $key_plugin ] );
[72] Fix | Delete
$value_plugin['update_availible'] = $key_plugin;
[73] Fix | Delete
$bws_plugins_update_availible[ $key_plugin ] = $value_plugin;
[74] Fix | Delete
}
[75] Fix | Delete
}
[76] Fix | Delete
/* Check expired */
[77] Fix | Delete
if ( $is_pro_installed && isset( $bstwbsftwppdtplgns_options['time_out'][ $value_plugin['pro_version'] ] ) &&
[78] Fix | Delete
strtotime( $bstwbsftwppdtplgns_options['time_out'][ $value_plugin['pro_version'] ] ) < strtotime( gmdate( 'm/d/Y' ) ) ) {
[79] Fix | Delete
unset( $bws_plugins[ $key_plugin ] );
[80] Fix | Delete
$value_plugin['expired'] = $bstwbsftwppdtplgns_options['time_out'][ $value_plugin['pro_version'] ];
[81] Fix | Delete
$bws_plugins_expired[ $key_plugin ] = $value_plugin;
[82] Fix | Delete
}
[83] Fix | Delete
}
[84] Fix | Delete
$bws_plugins = $bws_plugins_update_availible + $bws_plugins_expired + $bws_plugins;
[85] Fix | Delete
} else {
[86] Fix | Delete
foreach ( $bws_plugins as $key_plugin => $value_plugin ) {
[87] Fix | Delete
foreach ( $value_plugin['category'] as $category_key ) {
[88] Fix | Delete
$bws_plugins_category[ $category_key ]['count'] = isset( $bws_plugins_category[ $category_key ]['count'] ) ? $bws_plugins_category[ $category_key ]['count'] + 1 : 1;
[89] Fix | Delete
}
[90] Fix | Delete
}
[91] Fix | Delete
}
[92] Fix | Delete
[93] Fix | Delete
/*** Membership */
[94] Fix | Delete
$bws_license_plugin = 'bws_get_list_for_membership';
[95] Fix | Delete
$bws_license_key = isset( $bstwbsftwppdtplgns_options[ $bws_license_plugin ] ) ? $bstwbsftwppdtplgns_options[ $bws_license_plugin ] : '';
[96] Fix | Delete
$update_membership_list = true;
[97] Fix | Delete
[98] Fix | Delete
if ( isset( $_POST['bws_license_key'] ) ) {
[99] Fix | Delete
$bws_license_key = sanitize_text_field( wp_unslash( $_POST['bws_license_key'] ) );
[100] Fix | Delete
}
[101] Fix | Delete
[102] Fix | Delete
if ( isset( $_SESSION['bws_membership_time_check'] ) && isset( $_SESSION['bws_membership_list'] ) && $_SESSION['bws_membership_time_check'] < strtotime( '+12 hours' ) ) {
[103] Fix | Delete
$update_membership_list = false;
[104] Fix | Delete
$plugins_array = $_SESSION['bws_membership_list'];
[105] Fix | Delete
foreach ( $plugins_array as $plugins_key => $plugins_value ) {
[106] Fix | Delete
if ( is_array( $plugins_value ) ) {
[107] Fix | Delete
$plugins_array[ $plugins_key ] = array_map( 'sanitize_text_field', array_map( 'wp_unslash', $plugins_value ) );
[108] Fix | Delete
} elseif ( is_object( $plugins_value ) ) {
[109] Fix | Delete
foreach ( $plugins_value as $plugins_key2 => $plugins_value2 ) {
[110] Fix | Delete
$plugins_value->$plugins_key2 = sanitize_text_field( wp_unslash( $plugins_value2 ) );
[111] Fix | Delete
}
[112] Fix | Delete
$plugins_array[ $plugins_key ] = $plugins_value;
[113] Fix | Delete
} else {
[114] Fix | Delete
$plugins_array[ $plugins_key ] = sanitize_text_field( wp_unslash( $plugins_value ) );
[115] Fix | Delete
}
[116] Fix | Delete
}
[117] Fix | Delete
}
[118] Fix | Delete
[119] Fix | Delete
if ( ( $update_membership_list && ! empty( $bws_license_key ) ) || ( isset( $_POST['bws_license_submit'] ) && check_admin_referer( plugin_basename( __FILE__ ), 'bws_license_nonce_name' ) ) ) {
[120] Fix | Delete
[121] Fix | Delete
if ( '' !== $bws_license_key ) {
[122] Fix | Delete
if ( 18 !== strlen( $bws_license_key ) ) {
[123] Fix | Delete
$error = __( 'Wrong license key', 'bestwebsoft' );
[124] Fix | Delete
} else {
[125] Fix | Delete
[126] Fix | Delete
if ( isset( $bstwbsftwppdtplgns_options['go_pro'][ $bws_license_plugin ]['count'] ) && $bstwbsftwppdtplgns_options['go_pro'][ $bws_license_plugin ]['time'] > ( time() - ( 24 * 60 * 60 ) ) ) {
[127] Fix | Delete
$bstwbsftwppdtplgns_options['go_pro'][ $bws_license_plugin ]['count'] = $bstwbsftwppdtplgns_options['go_pro'][ $bws_license_plugin ]['count'] + 1;
[128] Fix | Delete
} else {
[129] Fix | Delete
$bstwbsftwppdtplgns_options['go_pro'][ $bws_license_plugin ]['count'] = 1;
[130] Fix | Delete
$bstwbsftwppdtplgns_options['go_pro'][ $bws_license_plugin ]['time'] = time();
[131] Fix | Delete
}
[132] Fix | Delete
[133] Fix | Delete
/* get Pro list */
[134] Fix | Delete
$to_send = array();
[135] Fix | Delete
$to_send['plugins'][ $bws_license_plugin ] = array();
[136] Fix | Delete
$to_send['plugins'][ $bws_license_plugin ]['bws_license_key'] = $bws_license_key;
[137] Fix | Delete
$options = array(
[138] Fix | Delete
'timeout' => ( ( defined( 'DOING_CRON' ) && DOING_CRON ) ? 30 : 3 ),
[139] Fix | Delete
'body' => array( 'plugins' => serialize( $to_send ) ),
[140] Fix | Delete
'user-agent' => 'WordPress/' . $wp_version . '; ' . get_bloginfo( 'url' ),
[141] Fix | Delete
);
[142] Fix | Delete
$raw_response = wp_remote_post( 'https://bestwebsoft.com/wp-content/plugins/paid-products/plugins/pro-license-check/1.0/', $options );
[143] Fix | Delete
[144] Fix | Delete
if ( is_wp_error( $raw_response ) || 200 !== wp_remote_retrieve_response_code( $raw_response ) ) {
[145] Fix | Delete
$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' );
[146] Fix | Delete
} else {
[147] Fix | Delete
$response = maybe_unserialize( wp_remote_retrieve_body( $raw_response ) );
[148] Fix | Delete
[149] Fix | Delete
if ( is_array( $response ) && ! empty( $response ) ) {
[150] Fix | Delete
foreach ( $response as $key => $value ) {
[151] Fix | Delete
if ( 'wrong_license_key' === $value->package ) {
[152] Fix | Delete
$error = __( 'Wrong license key.', 'bestwebsoft' );
[153] Fix | Delete
} elseif ( 'wrong_domain' === $value->package ) {
[154] Fix | Delete
$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>';
[155] Fix | Delete
} elseif ( 'you_are_banned' === $value->package ) {
[156] Fix | Delete
$error = __( 'Unfortunately, you have exceeded the number of available tries per day.', 'bestwebsoft' );
[157] Fix | Delete
} elseif ( 'time_out' === $value->package ) {
[158] Fix | Delete
$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>' );
[159] Fix | Delete
} elseif ( 'duplicate_domen_for_trial' === $value->package ) {
[160] Fix | Delete
$error = __( 'Unfortunately, the Pro licence was already installed to this domain. The Pro Trial license can be installed only once.', 'bestwebsoft' );
[161] Fix | Delete
} elseif ( is_array( $value->package ) && ! empty( $value->package ) ) {
[162] Fix | Delete
$plugins_array = $_SESSION['bws_membership_list'] = $value->package;
[163] Fix | Delete
$_SESSION['bws_membership_time_check'] = strtotime( 'now' );
[164] Fix | Delete
[165] Fix | Delete
if ( isset( $bstwbsftwppdtplgns_options[ $bws_license_plugin ] ) && $bws_license_key === $bstwbsftwppdtplgns_options[ $bws_license_plugin ] ) {
[166] Fix | Delete
$message = __( 'The license key is valid.', 'bestwebsoft' );
[167] Fix | Delete
if ( isset( $value->time_out ) && '' !== $value->time_out ) {
[168] Fix | Delete
$message .= ' ' . __( 'Your license will expire on', 'bestwebsoft' ) . ' ' . $value->time_out . '.';
[169] Fix | Delete
}
[170] Fix | Delete
} else {
[171] Fix | Delete
$message = __( 'Congratulations! Pro Membership license is activated successfully.', 'bestwebsoft' );
[172] Fix | Delete
}
[173] Fix | Delete
[174] Fix | Delete
$bstwbsftwppdtplgns_options[ $bws_license_plugin ] = $bws_license_key;
[175] Fix | Delete
}
[176] Fix | Delete
}
[177] Fix | Delete
} else {
[178] Fix | Delete
$error = __( 'Something went wrong. Try again later or upload the plugin manually. We are sorry for inconvenience.', 'bestwebsoft' );
[179] Fix | Delete
}
[180] Fix | Delete
}
[181] Fix | Delete
[182] Fix | Delete
if ( is_multisite() ) {
[183] Fix | Delete
update_site_option( 'bstwbsftwppdtplgns_options', $bstwbsftwppdtplgns_options );
[184] Fix | Delete
} else {
[185] Fix | Delete
update_option( 'bstwbsftwppdtplgns_options', $bstwbsftwppdtplgns_options );
[186] Fix | Delete
}
[187] Fix | Delete
}
[188] Fix | Delete
} else {
[189] Fix | Delete
$error = __( 'Please enter your license key.', 'bestwebsoft' );
[190] Fix | Delete
}
[191] Fix | Delete
}
[192] Fix | Delete
} elseif ( 'bws_system_status' === $page || 'system-status' === $tab ) {
[193] Fix | Delete
[194] Fix | Delete
$all_plugins = get_plugins();
[195] Fix | Delete
$active_plugins = get_option( 'active_plugins' );
[196] Fix | Delete
$mysql_info = $wpdb->get_results( "SHOW VARIABLES LIKE 'sql_mode'" );
[197] Fix | Delete
if ( is_array( $mysql_info ) ) {
[198] Fix | Delete
$sql_mode = $mysql_info[0]->Value;
[199] Fix | Delete
}
[200] Fix | Delete
if ( empty( $sql_mode ) ) {
[201] Fix | Delete
$sql_mode = __( 'Not set', 'bestwebsoft' );
[202] Fix | Delete
}
[203] Fix | Delete
[204] Fix | Delete
$allow_url_fopen = ( ini_get( 'allow_url_fopen' ) ) ? __( 'On', 'bestwebsoft' ) : __( 'Off', 'bestwebsoft' );
[205] Fix | Delete
$upload_max_filesize = ( ini_get( 'upload_max_filesize' ) ) ? ini_get( 'upload_max_filesize' ) : __( 'N/A', 'bestwebsoft' );
[206] Fix | Delete
$post_max_size = ( ini_get( 'post_max_size' ) ) ? ini_get( 'post_max_size' ) : __( 'N/A', 'bestwebsoft' );
[207] Fix | Delete
$max_execution_time = ( ini_get( 'max_execution_time' ) ) ? ini_get( 'max_execution_time' ) : __( 'N/A', 'bestwebsoft' );
[208] Fix | Delete
$memory_limit = ( ini_get( 'memory_limit' ) ) ? ini_get( 'memory_limit' ) : __( 'N/A', 'bestwebsoft' );
[209] Fix | Delete
$wp_memory_limit = ( defined( 'WP_MEMORY_LIMIT' ) ) ? WP_MEMORY_LIMIT : __( 'N/A', 'bestwebsoft' );
[210] Fix | Delete
$memory_usage = ( function_exists( 'memory_get_usage' ) ) ? round( memory_get_usage() / 1024 / 1024, 2 ) . ' ' . __( 'Mb', 'bestwebsoft' ) : __( 'N/A', 'bestwebsoft' );
[211] Fix | Delete
$exif_read_data = ( is_callable( 'exif_read_data' ) ) ? __( 'Yes', 'bestwebsoft' ) . ' ( V' . substr( phpversion( 'exif' ), 0, 4 ) . ')' : __( 'No', 'bestwebsoft' );
[212] Fix | Delete
$iptcparse = ( is_callable( 'iptcparse' ) ) ? __( 'Yes', 'bestwebsoft' ) : __( 'No', 'bestwebsoft' );
[213] Fix | Delete
$xml_parser_create = ( is_callable( 'xml_parser_create' ) ) ? __( 'Yes', 'bestwebsoft' ) : __( 'No', 'bestwebsoft' );
[214] Fix | Delete
$theme = wp_get_theme();
[215] Fix | Delete
[216] Fix | Delete
if ( function_exists( 'is_multisite' ) ) {
[217] Fix | Delete
$multisite = is_multisite() ? __( 'Yes', 'bestwebsoft' ) : __( 'No', 'bestwebsoft' );
[218] Fix | Delete
} else {
[219] Fix | Delete
$multisite = __( 'N/A', 'bestwebsoft' );
[220] Fix | Delete
}
[221] Fix | Delete
[222] Fix | Delete
$system_info = array(
[223] Fix | Delete
'wp_environment' => array(
[224] Fix | Delete
'name' => __( 'WordPress Environment', 'bestwebsoft' ),
[225] Fix | Delete
'data' => array(
[226] Fix | Delete
__( 'Home URL', 'bestwebsoft' ) => home_url(),
[227] Fix | Delete
__( 'Website URL', 'bestwebsoft' ) => get_option( 'siteurl' ),
[228] Fix | Delete
__( 'WP Version', 'bestwebsoft' ) => $wp_version,
[229] Fix | Delete
__( 'WP Multisite', 'bestwebsoft' ) => $multisite,
[230] Fix | Delete
__( 'WP Memory Limit', 'bestwebsoft' ) => $wp_memory_limit,
[231] Fix | Delete
__( 'Active Theme', 'bestwebsoft' ) => $theme['Name'] . ' ' . $theme['Version'] . ' (' . sprintf( __( 'by %s', 'bestwebsoft' ), $theme['Author'] ) . ')',
[232] Fix | Delete
),
[233] Fix | Delete
),
[234] Fix | Delete
'server_environment' => array(
[235] Fix | Delete
'name' => __( 'Server Environment', 'bestwebsoft' ),
[236] Fix | Delete
'data' => array(
[237] Fix | Delete
__( 'Operating System', 'bestwebsoft' ) => PHP_OS,
[238] Fix | Delete
__( 'Server', 'bestwebsoft' ) => isset( $_SERVER['SERVER_SOFTWARE'] ) ? sanitize_email( wp_unslash( $_SERVER['SERVER_SOFTWARE'] ) ) : '',
[239] Fix | Delete
__( 'PHP Version', 'bestwebsoft' ) => PHP_VERSION,
[240] Fix | Delete
__( 'PHP Allow URL fopen', 'bestwebsoft' ) => $allow_url_fopen,
[241] Fix | Delete
__( 'PHP Memory Limit', 'bestwebsoft' ) => $memory_limit,
[242] Fix | Delete
__( 'Memory Usage', 'bestwebsoft' ) => $memory_usage,
[243] Fix | Delete
__( 'PHP Max Upload Size', 'bestwebsoft' ) => $upload_max_filesize,
[244] Fix | Delete
__( 'PHP Max Post Size', 'bestwebsoft' ) => $post_max_size,
[245] Fix | Delete
__( 'PHP Max Script Execute Time', 'bestwebsoft' ) => $max_execution_time,
[246] Fix | Delete
__( 'PHP Exif support', 'bestwebsoft' ) => $exif_read_data,
[247] Fix | Delete
__( 'PHP IPTC support', 'bestwebsoft' ) => $iptcparse,
[248] Fix | Delete
__( 'PHP XML support', 'bestwebsoft' ) => $xml_parser_create,
[249] Fix | Delete
'$_SERVER[HTTP_HOST]' => isset( $_SERVER['HTTP_HOST'] ) ? sanitize_email( wp_unslash( $_SERVER['HTTP_HOST'] ) ) : '',
[250] Fix | Delete
'$_SERVER[SERVER_NAME]' => isset( $_SERVER['SERVER_NAME'] ) ? sanitize_email( wp_unslash( $_SERVER['SERVER_NAME'] ) ) : '',
[251] Fix | Delete
),
[252] Fix | Delete
),
[253] Fix | Delete
'db' => array(
[254] Fix | Delete
'name' => __( 'Database', 'bestwebsoft' ),
[255] Fix | Delete
'data' => array(
[256] Fix | Delete
__( 'WP DB version', 'bestwebsoft' ) => get_option( 'db_version' ),
[257] Fix | Delete
__( 'MySQL version', 'bestwebsoft' ) => $wpdb->get_var( 'SELECT VERSION() AS version' ),
[258] Fix | Delete
__( 'SQL Mode', 'bestwebsoft' ) => $sql_mode,
[259] Fix | Delete
),
[260] Fix | Delete
),
[261] Fix | Delete
'active_plugins' => array(
[262] Fix | Delete
'name' => __( 'Active Plugins', 'bestwebsoft' ),
[263] Fix | Delete
'data' => array(),
[264] Fix | Delete
'count' => 0,
[265] Fix | Delete
),
[266] Fix | Delete
'inactive_plugins' => array(
[267] Fix | Delete
'name' => __( 'Inactive Plugins', 'bestwebsoft' ),
[268] Fix | Delete
'data' => array(),
[269] Fix | Delete
'count' => 0,
[270] Fix | Delete
),
[271] Fix | Delete
);
[272] Fix | Delete
[273] Fix | Delete
foreach ( $all_plugins as $path => $plugin ) {
[274] Fix | Delete
$name = str_replace( 'by BestWebSoft', '', $plugin['Name'] );
[275] Fix | Delete
if ( is_plugin_active( $path ) ) {
[276] Fix | Delete
$system_info['active_plugins']['data'][ $name ] = sprintf( __( 'by %s', 'bestwebsoft' ), $plugin['Author'] ) . ' - ' . $plugin['Version'];
[277] Fix | Delete
$system_info['active_plugins']['count'] = $system_info['active_plugins']['count'] + 1;
[278] Fix | Delete
} else {
[279] Fix | Delete
$system_info['inactive_plugins']['data'][ $name ] = sprintf( __( 'by %s', 'bestwebsoft' ), $plugin['Author'] ) . ' - ' . $plugin['Version'];
[280] Fix | Delete
$system_info['inactive_plugins']['count'] = $system_info['inactive_plugins']['count'] + 1;
[281] Fix | Delete
}
[282] Fix | Delete
}
[283] Fix | Delete
[284] Fix | Delete
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' ) ) ) {
[285] Fix | Delete
if ( isset( $_REQUEST['bwsmn_form_email'] ) ) {
[286] Fix | Delete
$email = sanitize_email( wp_unslash( $_REQUEST['bwsmn_form_email'] ) );
[287] Fix | Delete
if ( '' === $email ) {
[288] Fix | Delete
$error = __( 'Please enter a valid email address.', 'bestwebsoft' );
[289] Fix | Delete
} else {
[290] Fix | Delete
$message = sprintf( __( 'Email with system info is sent to %s.', 'bestwebsoft' ), $email );
[291] Fix | Delete
}
[292] Fix | Delete
} else {
[293] Fix | Delete
$email = 'plugin_system_status@bestwebsoft.com';
[294] Fix | Delete
$message = __( 'Thank you for contacting us.', 'bestwebsoft' );
[295] Fix | Delete
}
[296] Fix | Delete
[297] Fix | Delete
if ( '' === $error ) {
[298] Fix | Delete
$headers = 'MIME-Version: 1.0' . "\n";
[299] Fix | Delete
$headers .= 'Content-type: text/html; charset=utf-8' . "\n";
[300] Fix | Delete
$headers .= 'From: ' . get_option( 'admin_email' );
[301] Fix | Delete
$message_text = '<html><head><title>System Info From ' . home_url() . '</title></head><body>';
[302] Fix | Delete
foreach ( $system_info as $info ) {
[303] Fix | Delete
if ( ! empty( $info['data'] ) ) {
[304] Fix | Delete
$message_text .= '<h4>' . $info['name'];
[305] Fix | Delete
if ( isset( $info['count'] ) ) {
[306] Fix | Delete
$message_text .= ' (' . $info['count'] . ')';
[307] Fix | Delete
}
[308] Fix | Delete
$message_text .= '</h4><table>';
[309] Fix | Delete
foreach ( $info['data'] as $key => $value ) {
[310] Fix | Delete
$message_text .= '<tr><td>' . $key . '</td><td>' . $value . '</td></tr>';
[311] Fix | Delete
}
[312] Fix | Delete
$message_text .= '</table>';
[313] Fix | Delete
}
[314] Fix | Delete
}
[315] Fix | Delete
$message_text .= '</body></html>';
[316] Fix | Delete
$result = wp_mail( $email, 'System Info From ' . esc_url( home_url() ), wp_kses( $message_text ), $headers );
[317] Fix | Delete
if ( true !== $result ) {
[318] Fix | Delete
$error = __( 'Sorry, email message could not be delivered.', 'bestwebsoft' );
[319] Fix | Delete
}
[320] Fix | Delete
}
[321] Fix | Delete
}
[322] Fix | Delete
} ?>
[323] Fix | Delete
<div class="bws-wrap">
[324] Fix | Delete
<div class="bws-header">
[325] Fix | Delete
<div class="bws-title">
[326] Fix | Delete
<a href="<?php echo esc_url( ( $is_main_page ) ? self_admin_url( 'admin.php?page=bws_panel' ) : self_admin_url( 'admin.php?page=' . $page ) ); ?>">
[327] Fix | Delete
<span class="bws-logo bwsicons bwsicons-bws-logo"></span>
[328] Fix | Delete
BestWebSoft
[329] Fix | Delete
<span>panel</span>
[330] Fix | Delete
</a>
[331] Fix | Delete
</div>
[332] Fix | Delete
<div class="bws-menu-item-icon">&#8226;&#8226;&#8226;</div>
[333] Fix | Delete
<div class="bws-nav-tab-wrapper">
[334] Fix | Delete
<?php if ( $is_main_page ) { ?>
[335] Fix | Delete
<a class="bws-nav-tab
[336] Fix | Delete
<?php
[337] Fix | Delete
if ( 'bws_panel' === $page ) {
[338] Fix | Delete
echo esc_attr( ' bws-nav-tab-active' );
[339] Fix | Delete
}
[340] Fix | Delete
?>
[341] Fix | Delete
" href="<?php echo esc_url( self_admin_url( 'admin.php?page=bws_panel' ) ); ?>">
[342] Fix | Delete
<?php
[343] Fix | Delete
esc_html_e( 'Plugins', 'bestwebsoft' );
[344] Fix | Delete
?>
[345] Fix | Delete
</a>
[346] Fix | Delete
<!-- pls -->
[347] Fix | Delete
<a class="bws-nav-tab
[348] Fix | Delete
<?php
[349] Fix | Delete
if ( 'bws_themes' === $page ) {
[350] Fix | Delete
echo esc_attr( ' bws-nav-tab-active' );
[351] Fix | Delete
}
[352] Fix | Delete
?>
[353] Fix | Delete
" href="<?php echo esc_url( self_admin_url( 'admin.php?page=bws_themes' ) ); ?>"><?php esc_html_e( 'Themes', 'bestwebsoft' ); ?></a>
[354] Fix | Delete
<a class="bws-nav-tab
[355] Fix | Delete
<?php
[356] Fix | Delete
if ( 'bws_system_status' === $page ) {
[357] Fix | Delete
echo esc_attr( ' bws-nav-tab-active' );
[358] Fix | Delete
}
[359] Fix | Delete
?>
[360] Fix | Delete
" href="<?php echo esc_url( self_admin_url( 'admin.php?page=bws_system_status' ) ); ?>">
[361] Fix | Delete
<?php
[362] Fix | Delete
esc_html_e( 'System status', 'bestwebsoft' );
[363] Fix | Delete
?>
[364] Fix | Delete
</a>
[365] Fix | Delete
<?php } else { ?>
[366] Fix | Delete
<a class="bws-nav-tab
[367] Fix | Delete
<?php
[368] Fix | Delete
if ( ! isset( $_GET['tab'] ) ) {
[369] Fix | Delete
echo esc_attr( ' bws-nav-tab-active' );
[370] Fix | Delete
}
[371] Fix | Delete
?>
[372] Fix | Delete
" href="<?php echo esc_url( self_admin_url( 'admin.php?page=' . $page ) ); ?>">
[373] Fix | Delete
<?php
[374] Fix | Delete
esc_html_e( 'Plugins', 'bestwebsoft' );
[375] Fix | Delete
?>
[376] Fix | Delete
</a>
[377] Fix | Delete
<a class="bws-nav-tab
[378] Fix | Delete
<?php
[379] Fix | Delete
if ( 'themes' === $tab ) {
[380] Fix | Delete
echo esc_attr( ' bws-nav-tab-active' );
[381] Fix | Delete
}
[382] Fix | Delete
?>
[383] Fix | Delete
" href="<?php echo esc_url( self_admin_url( 'admin.php?page=' . $page . '&tab=themes' ) ); ?>">
[384] Fix | Delete
<?php
[385] Fix | Delete
esc_html_e( 'Themes', 'bestwebsoft' );
[386] Fix | Delete
?>
[387] Fix | Delete
</a>
[388] Fix | Delete
<a class="bws-nav-tab
[389] Fix | Delete
<?php
[390] Fix | Delete
if ( 'system-status' === $tab ) {
[391] Fix | Delete
echo esc_attr( ' bws-nav-tab-active' );
[392] Fix | Delete
}
[393] Fix | Delete
?>
[394] Fix | Delete
" href="<?php echo esc_url( self_admin_url( 'admin.php?page=' . $page . '&tab=system-status' ) ); ?>">
[395] Fix | Delete
<?php
[396] Fix | Delete
esc_html_e( 'System status', 'bestwebsoft' );
[397] Fix | Delete
?>
[398] Fix | Delete
</a>
[399] Fix | Delete
<?php } ?>
[400] Fix | Delete
</div>
[401] Fix | Delete
<!-- pls -->
[402] Fix | Delete
<div class="bws-help-links-wrapper">
[403] Fix | Delete
<a href="https://support.bestwebsoft.com" target="_blank"><?php esc_html_e( 'Support', 'bestwebsoft' ); ?></a>
[404] Fix | Delete
<a href="https://bestwebsoft.com/client-area" target="_blank" title="<?php esc_html_e( 'Manage purchased licenses & subscriptions', 'bestwebsoft' ); ?>">Client Area</a>
[405] Fix | Delete
</div>
[406] Fix | Delete
<!-- end pls -->
[407] Fix | Delete
<div class="clear"></div>
[408] Fix | Delete
</div>
[409] Fix | Delete
<?php if ( ( 'bws_panel' === $page || ( ! isset( $_GET['tab'] ) && ! $is_main_page ) ) && ! isset( $_POST['bws_plugin_action_submit'] ) ) { ?>
[410] Fix | Delete
<div class="bws-membership-wrap">
[411] Fix | Delete
<div class="bws-membership-backround"></div>
[412] Fix | Delete
<div class="bws-membership">
[413] Fix | Delete
<div class="bws-membership-title"><?php printf( esc_html__( 'Get Access to %s+ Premium Plugins', 'bestwebsoft' ), '30' ); ?></div>
[414] Fix | Delete
<form class="bws-membership-form" method="post" action="">
[415] Fix | Delete
<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>
[416] Fix | Delete
<?php
[417] Fix | Delete
if ( isset( $bstwbsftwppdtplgns_options['go_pro'][ $bws_license_plugin ]['count'] ) &&
[418] Fix | Delete
'5' < $bstwbsftwppdtplgns_options['go_pro'][ $bws_license_plugin ]['count'] &&
[419] Fix | Delete
$bstwbsftwppdtplgns_options['go_pro'][ $bws_license_plugin ]['time'] > ( time() - ( 24 * 60 * 60 ) ) ) {
[420] Fix | Delete
?>
[421] Fix | Delete
<div class="bws_form_input_wrap">
[422] Fix | Delete
<input disabled="disabled" type="text" name="bws_license_key" value="<?php echo esc_attr( $bws_license_key ); ?>" />
[423] Fix | Delete
<div class="bws_error"><?php esc_html_e( 'Unfortunately, you have exceeded the number of available tries per day.', 'bestwebsoft' ); ?></div>
[424] Fix | Delete
</div>
[425] Fix | Delete
<input disabled="disabled" type="submit" class="bws-button" value="<?php esc_html_e( 'Check license key', 'bestwebsoft' ); ?>" />
[426] Fix | Delete
<?php } else { ?>
[427] Fix | Delete
<div class="bws_form_input_wrap">
[428] Fix | Delete
<input
[429] Fix | Delete
<?php
[430] Fix | Delete
if ( '' !== $error ) {
[431] Fix | Delete
echo 'class="bws_input_error"';
[432] Fix | Delete
}
[433] Fix | Delete
?>
[434] Fix | Delete
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 ); ?>" />
[435] Fix | Delete
<div class="bws_error"
[436] Fix | Delete
<?php
[437] Fix | Delete
if ( '' === $error ) {
[438] Fix | Delete
echo 'style="display:none"';
[439] Fix | Delete
}
[440] Fix | Delete
?>
[441] Fix | Delete
><?php echo esc_html( $error ); ?></div>
[442] Fix | Delete
</div>
[443] Fix | Delete
<input type="hidden" name="bws_license_plugin" value="<?php echo esc_attr( $bws_license_plugin ); ?>" />
[444] Fix | Delete
<input type="hidden" name="bws_license_submit" value="submit" />
[445] Fix | Delete
<?php if ( empty( $plugins_array ) ) { ?>
[446] Fix | Delete
<input type="submit" class="bws-button" value="<?php esc_html_e( 'Activate', 'bestwebsoft' ); ?>" />
[447] Fix | Delete
<?php } else { ?>
[448] Fix | Delete
<input type="submit" class="bws-button" value="<?php esc_html_e( 'Check license key', 'bestwebsoft' ); ?>" />
[449] Fix | Delete
<?php } ?>
[450] Fix | Delete
<?php wp_nonce_field( plugin_basename( __FILE__ ), 'bws_license_nonce_name' ); ?>
[451] Fix | Delete
<?php } ?>
[452] Fix | Delete
</form>
[453] Fix | Delete
<div class="clear"></div>
[454] Fix | Delete
</div>
[455] Fix | Delete
</div>
[456] Fix | Delete
<?php } ?>
[457] Fix | Delete
<!-- end pls -->
[458] Fix | Delete
<div class="bws-wrap-content wrap">
[459] Fix | Delete
<?php if ( 'bws_panel' === $page || ( ! isset( $_GET['tab'] ) && ! $is_main_page ) ) { ?>
[460] Fix | Delete
<div class="updated notice is-dismissible inline"
[461] Fix | Delete
<?php
[462] Fix | Delete
if ( '' === $message || '' !== $error ) {
[463] Fix | Delete
echo 'style="display:none"';
[464] Fix | Delete
}
[465] Fix | Delete
?>
[466] Fix | Delete
><p><?php echo esc_html( $message ); ?></p></div>
[467] Fix | Delete
<h1>
[468] Fix | Delete
<?php esc_html_e( 'Plugins', 'bestwebsoft' ); ?>
[469] Fix | Delete
<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>
[470] Fix | Delete
</h1>
[471] Fix | Delete
<?php
[472] Fix | Delete
if ( isset( $_GET['error'] ) ) {
[473] Fix | Delete
if ( isset( $_GET['charsout'] ) ) {
[474] Fix | Delete
$errmsg = sprintf( __( 'The plugin generated %d characters of <strong>unexpected output</strong> during activation. If you notice &#8220;headers already sent&#8221; messages, problems with syndication feeds or other issues, try deactivating or removing this plugin.' ), intval( $_GET['charsout'] ) );
[475] Fix | Delete
} else {
[476] Fix | Delete
$errmsg = __( 'Plugin could not be activated because it triggered a <strong>fatal error</strong>.' );
[477] Fix | Delete
}
[478] Fix | Delete
?>
[479] Fix | Delete
<div id="message" class="error is-dismissible"><p><?php echo wp_kses( $errmsg ); ?></p></div>
[480] Fix | Delete
<?php } elseif ( isset( $_GET['activate'] ) ) { ?>
[481] Fix | Delete
<div id="message" class="updated notice is-dismissible"><p><?php esc_html_e( 'Plugin <strong>activated</strong>.' ); ?></p></div>
[482] Fix | Delete
<?php
[483] Fix | Delete
}
[484] Fix | Delete
[485] Fix | Delete
if ( isset( $_POST['bws_plugin_action_submit'] ) && isset( $_POST['bws_install_plugin'] ) && check_admin_referer( plugin_basename( __FILE__ ), 'bws_license_install_nonce_name' ) ) {
[486] Fix | Delete
[487] Fix | Delete
$bws_license_plugin = sanitize_text_field( wp_unslash( $_POST['bws_install_plugin'] ) );
[488] Fix | Delete
[489] Fix | Delete
$bstwbsftwppdtplgns_options[ $bws_license_plugin ] = $bws_license_key;
[490] Fix | Delete
if ( is_multisite() ) {
[491] Fix | Delete
update_site_option( 'bstwbsftwppdtplgns_options', $bstwbsftwppdtplgns_options );
[492] Fix | Delete
} else {
[493] Fix | Delete
update_option( 'bstwbsftwppdtplgns_options', $bstwbsftwppdtplgns_options );
[494] Fix | Delete
}
[495] Fix | Delete
[496] Fix | Delete
$url = $plugins_array[ $bws_license_plugin ]['link'] . '&download_from=5';
[497] Fix | Delete
?>
[498] Fix | Delete
<h2><?php esc_html_e( 'Download Pro Plugin', 'bestwebsoft' ); ?></h2>
[499] Fix | Delete
12
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function