wp/wp-content/plugins/portfolio/bws_menu/bws_menu.php
changeset 21 48c4eec2b7e6
parent 19 3d72ae0968f4
equal deleted inserted replaced
20:7b1b88e27a20 21:48c4eec2b7e6
     1 <?php
     1 <?php
       
     2 if ( ! defined( 'ABSPATH' ) ) {
       
     3 	exit;
       
     4 }
       
     5 
     2 /**
     6 /**
     3  * Function for displaying BestWebSoft menu
     7  * Function for displaying BestWebSoft menu
     4  * Version: 2.4.2
     8  * Version: 2.4.3
     5  */
     9  */
     6 
       
     7 if ( ! function_exists( 'bws_admin_enqueue_scripts' ) ) {
    10 if ( ! function_exists( 'bws_admin_enqueue_scripts' ) ) {
     8 	require_once dirname( __FILE__ ) . '/bws_functions.php';
    11 	require_once dirname( __FILE__ ) . '/bws_functions.php';
     9 }
    12 }
    10 
    13 
    11 if ( ! function_exists( 'bws_add_menu_render' ) ) {
    14 if ( ! function_exists( 'bws_add_menu_render' ) ) {
       
    15 	/**
       
    16 	 * Function for render BestWebSoft menu
       
    17 	 */
    12 	function bws_add_menu_render() {
    18 	function bws_add_menu_render() {
    13 		global $wpdb, $wp_version, $bstwbsftwppdtplgns_options;
    19 		global $wpdb, $wp_version, $bstwbsftwppdtplgns_options;
    14 		$error = $message = '';
    20 		$error   = '';
       
    21 		$message = '';
    15 
    22 
    16 		/**
    23 		/**
    17 		 * @deprecated 1.9.8 (15.12.2016)
    24 		 * @deprecated 1.9.8 (15.12.2016)
    18 		 */
    25 		 */
    19 		$is_main_page = isset( $_GET['page'] ) && in_array( $_GET['page'], array( 'bws_panel', 'bws_themes', 'bws_system_status' ) );
    26 		$is_main_page = isset( $_GET['page'] ) && in_array( $_GET['page'], array( 'bws_panel', 'bws_themes', 'bws_system_status' ) );
    41 			$update_availible_all    = get_site_transient( 'update_plugins' );
    48 			$update_availible_all    = get_site_transient( 'update_plugins' );
    42 
    49 
    43 			$plugin_category = isset( $_GET['category'] ) ? sanitize_text_field( wp_unslash( $_GET['category'] ) ) : 'all';
    50 			$plugin_category = isset( $_GET['category'] ) ? sanitize_text_field( wp_unslash( $_GET['category'] ) ) : 'all';
    44 
    51 
    45 			if ( ( isset( $_GET['sub'] ) && 'installed' === sanitize_text_field( wp_unslash( $_GET['sub'] ) ) ) || ! isset( $_GET['sub'] ) ) {
    52 			if ( ( isset( $_GET['sub'] ) && 'installed' === sanitize_text_field( wp_unslash( $_GET['sub'] ) ) ) || ! isset( $_GET['sub'] ) ) {
    46 				$bws_plugins_update_availible = $bws_plugins_expired = array();
    53 				$bws_plugins_update_availible = array();
       
    54 				$bws_plugins_expired          = array();
    47 				foreach ( $bws_plugins as $key_plugin => $value_plugin ) {
    55 				foreach ( $bws_plugins as $key_plugin => $value_plugin ) {
    48 
    56 
    49 					foreach ( $value_plugin['category'] as $category_key ) {
    57 					foreach ( $value_plugin['category'] as $category_key ) {
    50 						$bws_plugins_category[ $category_key ]['count'] = isset( $bws_plugins_category[ $category_key ]['count'] ) ? $bws_plugins_category[ $category_key ]['count'] + 1 : 1;
    58 						$bws_plugins_category[ $category_key ]['count'] = isset( $bws_plugins_category[ $category_key ]['count'] ) ? $bws_plugins_category[ $category_key ]['count'] + 1 : 1;
    51 					}
    59 					}
    94 			}
   102 			}
    95 
   103 
    96 			if ( isset( $_SESSION['bws_membership_time_check'] ) && isset( $_SESSION['bws_membership_list'] ) && $_SESSION['bws_membership_time_check'] < strtotime( '+12 hours' ) ) {
   104 			if ( isset( $_SESSION['bws_membership_time_check'] ) && isset( $_SESSION['bws_membership_list'] ) && $_SESSION['bws_membership_time_check'] < strtotime( '+12 hours' ) ) {
    97 				$update_membership_list = false;
   105 				$update_membership_list = false;
    98 				$plugins_array          = $_SESSION['bws_membership_list'];
   106 				$plugins_array          = $_SESSION['bws_membership_list'];
       
   107 				foreach ( $plugins_array as $plugins_key => $plugins_value ) {
       
   108 					if ( is_array( $plugins_value ) ) {
       
   109 						$plugins_array[ $plugins_key ] = array_map( 'sanitize_text_field', array_map( 'wp_unslash', $plugins_value ) );
       
   110 					} elseif ( is_object( $plugins_value ) ) {
       
   111 						foreach ( $plugins_value as $plugins_key2 => $plugins_value2 ) {
       
   112 							$plugins_value->$plugins_key2 = sanitize_text_field( wp_unslash( $plugins_value2 ) );
       
   113 						}
       
   114 						$plugins_array[ $plugins_key ] = $plugins_value;
       
   115 					} else {
       
   116 						$plugins_array[ $plugins_key ] = sanitize_text_field( wp_unslash( $plugins_value ) );
       
   117 					}
       
   118 				}
    99 			}
   119 			}
   100 
   120 
   101 			if ( ( $update_membership_list && ! empty( $bws_license_key ) ) || ( isset( $_POST['bws_license_submit'] ) && check_admin_referer( plugin_basename( __FILE__ ), 'bws_license_nonce_name' ) ) ) {
   121 			if ( ( $update_membership_list && ! empty( $bws_license_key ) ) || ( isset( $_POST['bws_license_submit'] ) && check_admin_referer( plugin_basename( __FILE__ ), 'bws_license_nonce_name' ) ) ) {
   102 
   122 
   103 				if ( '' !== $bws_license_key ) {
   123 				if ( '' !== $bws_license_key ) {
   200 			} else {
   220 			} else {
   201 				$multisite = __( 'N/A', 'bestwebsoft' );
   221 				$multisite = __( 'N/A', 'bestwebsoft' );
   202 			}
   222 			}
   203 
   223 
   204 			$system_info = array(
   224 			$system_info = array(
   205 				'wp_environment' => array(
   225 				'wp_environment'     => array(
   206 					'name' => __( 'WordPress Environment', 'bestwebsoft' ),
   226 					'name' => __( 'WordPress Environment', 'bestwebsoft' ),
   207 					'data' => array(
   227 					'data' => array(
   208 						__( 'Home URL', 'bestwebsoft' )         => home_url(),
   228 						__( 'Home URL', 'bestwebsoft' )    => home_url(),
   209 						__( 'Website URL', 'bestwebsoft' )      => get_option( 'siteurl' ),
   229 						__( 'Website URL', 'bestwebsoft' ) => get_option( 'siteurl' ),
   210 						__( 'WP Version', 'bestwebsoft' )       => $wp_version,
   230 						__( 'WP Version', 'bestwebsoft' )  => $wp_version,
   211 						__( 'WP Multisite', 'bestwebsoft' )     => $multisite,
   231 						__( 'WP Multisite', 'bestwebsoft' ) => $multisite,
   212 						__( 'WP Memory Limit', 'bestwebsoft' )  => $wp_memory_limit,
   232 						__( 'WP Memory Limit', 'bestwebsoft' ) => $wp_memory_limit,
   213 						__( 'Active Theme', 'bestwebsoft' )     => $theme['Name'] . ' ' . $theme['Version'] . ' (' . sprintf( __( 'by %s', 'bestwebsoft' ), $theme['Author'] ) . ')',
   233 						__( 'Active Theme', 'bestwebsoft' ) => $theme['Name'] . ' ' . $theme['Version'] . ' (' . sprintf( __( 'by %s', 'bestwebsoft' ), $theme['Author'] ) . ')',
   214 					),
   234 					),
   215 				),
   235 				),
   216 				'server_environment' => array(
   236 				'server_environment' => array(
   217 					'name' => __( 'Server Environment', 'bestwebsoft' ),
   237 					'name' => __( 'Server Environment', 'bestwebsoft' ),
   218 					'data' => array(
   238 					'data' => array(
   219 						__( 'Operating System', 'bestwebsoft' )      => PHP_OS,
   239 						__( 'Operating System', 'bestwebsoft' ) => PHP_OS,
   220 						__( 'Server', 'bestwebsoft' )                => isset( $_SERVER['SERVER_SOFTWARE'] ) ? sanitize_email( wp_unslash( $_SERVER['SERVER_SOFTWARE'] ) ) : '',
   240 						__( 'Server', 'bestwebsoft' )      => isset( $_SERVER['SERVER_SOFTWARE'] ) ? sanitize_email( wp_unslash( $_SERVER['SERVER_SOFTWARE'] ) ) : '',
   221 						__( 'PHP Version', 'bestwebsoft' )           => PHP_VERSION,
   241 						__( 'PHP Version', 'bestwebsoft' ) => PHP_VERSION,
   222 						__( 'PHP Allow URL fopen', 'bestwebsoft' )   => $allow_url_fopen,
   242 						__( 'PHP Allow URL fopen', 'bestwebsoft' ) => $allow_url_fopen,
   223 						__( 'PHP Memory Limit', 'bestwebsoft' )      => $memory_limit,
   243 						__( 'PHP Memory Limit', 'bestwebsoft' ) => $memory_limit,
   224 						__( 'Memory Usage', 'bestwebsoft' )          => $memory_usage,
   244 						__( 'Memory Usage', 'bestwebsoft' ) => $memory_usage,
   225 						__( 'PHP Max Upload Size', 'bestwebsoft' )   => $upload_max_filesize,
   245 						__( 'PHP Max Upload Size', 'bestwebsoft' ) => $upload_max_filesize,
   226 						__( 'PHP Max Post Size', 'bestwebsoft' )     => $post_max_size,
   246 						__( 'PHP Max Post Size', 'bestwebsoft' ) => $post_max_size,
   227 						__( 'PHP Max Script Execute Time', 'bestwebsoft' ) => $max_execution_time,
   247 						__( 'PHP Max Script Execute Time', 'bestwebsoft' ) => $max_execution_time,
   228 						__( 'PHP Exif support', 'bestwebsoft' )      => $exif_read_data,
   248 						__( 'PHP Exif support', 'bestwebsoft' ) => $exif_read_data,
   229 						__( 'PHP IPTC support', 'bestwebsoft' )      => $iptcparse,
   249 						__( 'PHP IPTC support', 'bestwebsoft' ) => $iptcparse,
   230 						__( 'PHP XML support', 'bestwebsoft' )       => $xml_parser_create,
   250 						__( 'PHP XML support', 'bestwebsoft' ) => $xml_parser_create,
   231 						'$_SERVER[HTTP_HOST]'                        => isset( $_SERVER['HTTP_HOST'] ) ? sanitize_email( wp_unslash( $_SERVER['HTTP_HOST'] ) ) : '',
   251 						'$_SERVER[HTTP_HOST]'              => isset( $_SERVER['HTTP_HOST'] ) ? sanitize_email( wp_unslash( $_SERVER['HTTP_HOST'] ) ) : '',
   232 						'$_SERVER[SERVER_NAME]'                      => isset( $_SERVER['SERVER_NAME'] ) ? sanitize_email( wp_unslash( $_SERVER['SERVER_NAME'] ) ) : '',
   252 						'$_SERVER[SERVER_NAME]'            => isset( $_SERVER['SERVER_NAME'] ) ? sanitize_email( wp_unslash( $_SERVER['SERVER_NAME'] ) ) : '',
   233 					),
   253 					),
   234 				),
   254 				),
   235 				'db' => array(
   255 				'db'                 => array(
   236 					'name' => __( 'Database', 'bestwebsoft' ),
   256 					'name' => __( 'Database', 'bestwebsoft' ),
   237 					'data' => array(
   257 					'data' => array(
   238 						__( 'WP DB version', 'bestwebsoft' ) => get_option( 'db_version' ),
   258 						__( 'WP DB version', 'bestwebsoft' ) => get_option( 'db_version' ),
   239 						__( 'MySQL version', 'bestwebsoft' ) => $wpdb->get_var( 'SELECT VERSION() AS version' ),
   259 						__( 'MySQL version', 'bestwebsoft' ) => $wpdb->get_var( 'SELECT VERSION() AS version' ),
   240 						__( 'SQL Mode', 'bestwebsoft' )      => $sql_mode,
   260 						__( 'SQL Mode', 'bestwebsoft' ) => $sql_mode,
   241 					),
   261 					),
   242 				),
   262 				),
   243 				'active_plugins' => array(
   263 				'active_plugins'     => array(
   244 					'name'  => __( 'Active Plugins', 'bestwebsoft' ),
   264 					'name'  => __( 'Active Plugins', 'bestwebsoft' ),
   245 					'data'  => array(),
   265 					'data'  => array(),
   246 					'count' => 0,
   266 					'count' => 0,
   247 				),
   267 				),
   248 				'inactive_plugins' => array(
   268 				'inactive_plugins'   => array(
   249 					'name'  => __( 'Inactive Plugins', 'bestwebsoft' ),
   269 					'name'  => __( 'Inactive Plugins', 'bestwebsoft' ),
   250 					'data'  => array(),
   270 					'data'  => array(),
   251 					'count' => 0,
   271 					'count' => 0,
   252 				),
   272 				),
   253 			);
   273 			);
   303 			}
   323 			}
   304 		} ?>
   324 		} ?>
   305 		<div class="bws-wrap">
   325 		<div class="bws-wrap">
   306 			<div class="bws-header">
   326 			<div class="bws-header">
   307 				<div class="bws-title">
   327 				<div class="bws-title">
   308 					<a href="<?php echo ( $is_main_page ) ? esc_url( self_admin_url( 'admin.php?page=bws_panel' ) ) : esc_url( self_admin_url( 'admin.php?page=' . $page ) ); ?>">
   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 ) ); ?>">
   309 						<span class="bws-logo bwsicons bwsicons-bws-logo"></span>
   329 						<span class="bws-logo bwsicons bwsicons-bws-logo"></span>
   310 						BestWebSoft
   330 						BestWebSoft
   311 						<span>panel</span>
   331 						<span>panel</span>
   312 					</a>
   332 					</a>
   313 				</div>
   333 				</div>
   314 				<div class="bws-menu-item-icon">&#8226;&#8226;&#8226;</div>
   334 				<div class="bws-menu-item-icon">&#8226;&#8226;&#8226;</div>
   315 				<div class="bws-nav-tab-wrapper">
   335 				<div class="bws-nav-tab-wrapper">
   316 					<?php if ( $is_main_page ) { ?>
   336 					<?php if ( $is_main_page ) { ?>
   317 						<a class="bws-nav-tab <?php
   337 						<a class="bws-nav-tab 
       
   338 						<?php
   318 						if ( 'bws_panel' === $page ) {
   339 						if ( 'bws_panel' === $page ) {
   319 							echo esc_attr( ' bws-nav-tab-active' );
   340 							echo esc_attr( ' bws-nav-tab-active' );
   320 						}
   341 						}
   321 						?>" href="<?php echo esc_url( self_admin_url( 'admin.php?page=bws_panel' ) ); ?>"><?php esc_html_e( 'Plugins', 'bestwebsoft' );
       
   322 						?>
   342 						?>
       
   343 						" href="<?php echo esc_url( self_admin_url( 'admin.php?page=bws_panel' ) ); ?>">
       
   344 							<?php
       
   345 							esc_html_e( 'Plugins', 'bestwebsoft' );
       
   346 							?>
   323 						</a>
   347 						</a>
   324 						<!-- pls -->
   348 						<!-- pls -->
   325 						<a class="bws-nav-tab <?php
   349 						<a class="bws-nav-tab 
       
   350 						<?php
   326 						if ( 'bws_themes' === $page ) {
   351 						if ( 'bws_themes' === $page ) {
   327 							echo esc_attr( ' bws-nav-tab-active' );
   352 							echo esc_attr( ' bws-nav-tab-active' );
   328 						}
   353 						}
   329 						?>" href="<?php echo esc_url( self_admin_url( 'admin.php?page=bws_themes' ) ); ?>"><?php esc_html_e( 'Themes', 'bestwebsoft' ); ?></a>
   354 						?>
   330 						<a class="bws-nav-tab <?php
   355 						" href="<?php echo esc_url( self_admin_url( 'admin.php?page=bws_themes' ) ); ?>"><?php esc_html_e( 'Themes', 'bestwebsoft' ); ?></a>
       
   356 						<a class="bws-nav-tab 
       
   357 						<?php
   331 						if ( 'bws_system_status' === $page ) {
   358 						if ( 'bws_system_status' === $page ) {
   332 							echo esc_attr( ' bws-nav-tab-active' );
   359 							echo esc_attr( ' bws-nav-tab-active' );
   333 						} 
   360 						}
   334 						?>" href="<?php echo esc_url( self_admin_url( 'admin.php?page=bws_system_status' ) ); ?>"><?php esc_html_e( 'System status', 'bestwebsoft' );
       
   335 						?>
   361 						?>
       
   362 						" href="<?php echo esc_url( self_admin_url( 'admin.php?page=bws_system_status' ) ); ?>">
       
   363 							<?php
       
   364 							esc_html_e( 'System status', 'bestwebsoft' );
       
   365 							?>
   336 						</a>
   366 						</a>
   337 					<?php } else { ?>
   367 					<?php } else { ?>
   338 						<a class="bws-nav-tab <?php
   368 						<a class="bws-nav-tab 
       
   369 						<?php
   339 						if ( ! isset( $_GET['tab'] ) ) {
   370 						if ( ! isset( $_GET['tab'] ) ) {
   340 							echo esc_attr( ' bws-nav-tab-active' );
   371 							echo esc_attr( ' bws-nav-tab-active' );
   341 						} 
   372 						}
   342 						?>" href="<?php echo esc_url( self_admin_url( 'admin.php?page=' . $page ) ); ?>"><?php esc_html_e( 'Plugins', 'bestwebsoft' ); 
       
   343 						?>
   373 						?>
       
   374 						" href="<?php echo esc_url( self_admin_url( 'admin.php?page=' . $page ) ); ?>">
       
   375 							<?php
       
   376 							esc_html_e( 'Plugins', 'bestwebsoft' );
       
   377 							?>
   344 						</a>
   378 						</a>
   345 						<!-- pls -->
   379 						<a class="bws-nav-tab 
   346 						<a class="bws-nav-tab <?php
   380 						<?php
   347 						if ( 'themes' === $tab ) {
   381 						if ( 'themes' === $tab ) {
   348 							echo esc_attr( ' bws-nav-tab-active' );
   382 							echo esc_attr( ' bws-nav-tab-active' );
   349 						}
   383 						}
   350 						?>" href="<?php echo esc_url( self_admin_url( 'admin.php?page=' . $page . '&tab=themes' ) ); ?>"><?php esc_html_e( 'Themes', 'bestwebsoft' );
       
   351 						?>
   384 						?>
       
   385 						" href="<?php echo esc_url( self_admin_url( 'admin.php?page=' . $page . '&tab=themes' ) ); ?>">
       
   386 							<?php
       
   387 							esc_html_e( 'Themes', 'bestwebsoft' );
       
   388 							?>
   352 						</a>
   389 						</a>
   353 						 <!-- end pls -->
   390 						<a class="bws-nav-tab 
   354 						<a class="bws-nav-tab <?php
   391 						<?php
   355 						if ( 'system-status' === $tab ) {
   392 						if ( 'system-status' === $tab ) {
   356 							echo esc_attr( ' bws-nav-tab-active' );
   393 							echo esc_attr( ' bws-nav-tab-active' );
   357 						}
   394 						}
   358 						?>" href="<?php echo esc_url( self_admin_url( 'admin.php?page=' . $page . '&tab=system-status' ) ); ?>"><?php esc_html_e( 'System status', 'bestwebsoft' );
       
   359 						?>
   395 						?>
       
   396 						" href="<?php echo esc_url( self_admin_url( 'admin.php?page=' . $page . '&tab=system-status' ) ); ?>">
       
   397 							<?php
       
   398 							esc_html_e( 'System status', 'bestwebsoft' );
       
   399 							?>
   360 						</a>
   400 						</a>
   361 					<?php } ?>
   401 					<?php } ?>
   362 				</div>
   402 				</div>
   363 				<!-- pls -->
   403 				<!-- pls -->
   364 				<div class="bws-help-links-wrapper">
   404 				<div class="bws-help-links-wrapper">
   388 							<?php } else { ?>
   428 							<?php } else { ?>
   389 								<div class="bws_form_input_wrap">
   429 								<div class="bws_form_input_wrap">
   390 									<input 
   430 									<input 
   391 									<?php
   431 									<?php
   392 									if ( '' !== $error ) {
   432 									if ( '' !== $error ) {
   393 										echo 'class="bws_input_error"';}
   433 										echo 'class="bws_input_error"';
       
   434 									}
   394 									?>
   435 									?>
   395 										type="text" placeholder="<?php esc_html_e( 'Enter your license key', 'bestwebsoft' ); ?>" maxlength="100" name="bws_license_key" value="<?php echo esc_attr( $bws_license_key ); ?>" />
   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 ); ?>" />
   396 									<div class="bws_error" 
   437 									<div class="bws_error" 
   397 									<?php
   438 									<?php
   398 									if ( '' === $error ) {
   439 									if ( '' === $error ) {
   399 										echo 'style="display:none"';}
   440 										echo 'style="display:none"';
       
   441 									}
   400 									?>
   442 									?>
   401 									><?php echo esc_html( $error ); ?></div>
   443 									><?php echo esc_html( $error ); ?></div>
   402 								</div>
   444 								</div>
   403 								<input type="hidden" name="bws_license_plugin" value="<?php echo esc_attr( $bws_license_plugin ); ?>" />
   445 								<input type="hidden" name="bws_license_plugin" value="<?php echo esc_attr( $bws_license_plugin ); ?>" />
   404 								<input type="hidden" name="bws_license_submit" value="submit" />
   446 								<input type="hidden" name="bws_license_submit" value="submit" />
   418 			<div class="bws-wrap-content wrap">
   460 			<div class="bws-wrap-content wrap">
   419 				<?php if ( 'bws_panel' === $page || ( ! isset( $_GET['tab'] ) && ! $is_main_page ) ) { ?>
   461 				<?php if ( 'bws_panel' === $page || ( ! isset( $_GET['tab'] ) && ! $is_main_page ) ) { ?>
   420 					<div class="updated notice is-dismissible inline" 
   462 					<div class="updated notice is-dismissible inline" 
   421 					<?php
   463 					<?php
   422 					if ( '' === $message || '' !== $error ) {
   464 					if ( '' === $message || '' !== $error ) {
   423 						echo 'style="display:none"';}
   465 						echo 'style="display:none"';
       
   466 					}
   424 					?>
   467 					?>
   425 					><p><?php echo esc_html( $message ); ?></p></div>
   468 					><p><?php echo esc_html( $message ); ?></p></div>
   426 					<h1>
   469 					<h1>
   427 						<?php esc_html_e( 'Plugins', 'bestwebsoft' ); ?>
   470 						<?php esc_html_e( 'Plugins', 'bestwebsoft' ); ?>
   428 						<a href="<?php echo esc_url( self_admin_url( 'plugin-install.php?tab=upload' ) ); ?>" class="upload page-title-action add-new-h2"><?php esc_html_e( 'Upload Plugin', 'bestwebsoft' ); ?></a>
   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>
   499 						<ul class="subsubsub">
   542 						<ul class="subsubsub">
   500 							<li>
   543 							<li>
   501 								<a 
   544 								<a 
   502 								<?php
   545 								<?php
   503 								if ( ! isset( $_GET['sub'] ) ) {
   546 								if ( ! isset( $_GET['sub'] ) ) {
   504 									echo 'class="current" ';}
   547 									echo 'class="current" ';
       
   548 								}
   505 								?>
   549 								?>
   506 								href="<?php echo esc_url( self_admin_url( $category_href ) ); ?>"><?php esc_html_e( 'All', 'bestwebsoft' ); ?></a>
   550 								href="<?php echo esc_url( self_admin_url( $category_href ) ); ?>"><?php esc_html_e( 'All', 'bestwebsoft' ); ?></a>
   507 							</li> |
   551 							</li> |
   508 							<li>
   552 							<li>
   509 								<a 
   553 								<a 
   510 								<?php
   554 								<?php
   511 								if ( isset( $_GET['sub'] ) && 'installed' === sanitize_text_field( wp_unslash( $_GET['sub'] ) ) ) {
   555 								if ( isset( $_GET['sub'] ) && 'installed' === sanitize_text_field( wp_unslash( $_GET['sub'] ) ) ) {
   512 									echo 'class="current" ';}
   556 									echo 'class="current" ';
       
   557 								}
   513 								?>
   558 								?>
   514 								href="<?php echo esc_url( self_admin_url( $category_href . '&sub=installed' ) ); ?>"><?php esc_html_e( 'Installed', 'bestwebsoft' ); ?></a>
   559 								href="<?php echo esc_url( self_admin_url( $category_href . '&sub=installed' ) ); ?>"><?php esc_html_e( 'Installed', 'bestwebsoft' ); ?></a>
   515 							</li> |
   560 							</li> |
   516 							<li>
   561 							<li>
   517 								<a 
   562 								<a 
   518 								<?php
   563 								<?php
   519 								if ( isset( $_GET['sub'] ) && 'not_installed' === sanitize_text_field( wp_unslash( $_GET['sub'] ) ) ) {
   564 								if ( isset( $_GET['sub'] ) && 'not_installed' === sanitize_text_field( wp_unslash( $_GET['sub'] ) ) ) {
   520 									echo 'class="current" ';}
   565 									echo 'class="current" ';
       
   566 								}
   521 								?>
   567 								?>
   522 								href="<?php echo esc_url( self_admin_url( $category_href . '&sub=not_installed' ) ); ?>"><?php esc_html_e( 'Not Installed', 'bestwebsoft' ); ?></a>
   568 								href="<?php echo esc_url( self_admin_url( $category_href . '&sub=not_installed' ) ); ?>"><?php esc_html_e( 'Not Installed', 'bestwebsoft' ); ?></a>
   523 							</li>
   569 							</li>
   524 						</ul>
   570 						</ul>
   525 						<div class="clear"></div>
   571 						<div class="clear"></div>
   534 									<li>
   580 									<li>
   535 										<?php $sub_in_url = ( isset( $_GET['sub'] ) && in_array( sanitize_text_field( wp_unslash( $_GET['sub'] ) ), array( 'installed', 'not_installed' ) ) ) ? '&sub=' . sanitize_text_field( wp_unslash( $_GET['sub'] ) ) : ''; ?>
   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'] ) ) : ''; ?>
   536 										<a 
   582 										<a 
   537 										<?php
   583 										<?php
   538 										if ( 'all' === $plugin_category ) {
   584 										if ( 'all' === $plugin_category ) {
   539 											echo ' class="bws-active"';}
   585 											echo ' class="bws-active"';
       
   586 										}
   540 										?>
   587 										?>
   541 											href="<?php echo esc_url( self_admin_url( $current_page . $sub_in_url ) ); ?>"><?php esc_html_e( 'All', 'bestwebsoft' ); ?>
   588 											href="<?php echo esc_url( self_admin_url( $current_page . $sub_in_url ) ); ?>"><?php esc_html_e( 'All', 'bestwebsoft' ); ?>
   542 												<span>(<?php echo count( $bws_plugins ); ?>)</span>
   589 												<span>(<?php echo count( $bws_plugins ); ?>)</span>
   543 										</a>
   590 										</a>
   544 									</li>
   591 									</li>
   545 									<?php foreach ( $bws_plugins_category as $category_key => $category_value ) { ?>
   592 									<?php foreach ( $bws_plugins_category as $category_key => $category_value ) { ?>
   546 										<li>
   593 										<li>
   547 											<a 
   594 											<a 
   548 											<?php
   595 											<?php
   549 											if ( $category_key === $plugin_category ) {
   596 											if ( $category_key === $plugin_category ) {
   550 												echo ' class="bws-active"';}
   597 												echo ' class="bws-active"';
       
   598 											}
   551 											?>
   599 											?>
   552 												href="<?php echo esc_url( self_admin_url( $current_page . $sub_in_url . '&category=' . $category_key ) ); ?>"><?php echo esc_html( $category_value['name'] ); ?>
   600 												href="<?php echo esc_url( self_admin_url( $current_page . $sub_in_url . '&category=' . $category_key ) ); ?>"><?php echo esc_html( $category_value['name'] ); ?>
   553 													<span>(<?php echo intval( $category_value['count'] ); ?>)</span>
   601 													<span>(<?php echo absint( $category_value['count'] ); ?>)</span>
   554 											</a>
   602 											</a>
   555 										</li>
   603 										</li>
   556 									<?php } ?>
   604 									<?php } ?>
   557 								</ul>
   605 								</ul>
   558 							</div>
   606 							</div>
   565 								if ( 'all' !== $plugin_category && isset( $bws_plugins_category[ $plugin_category ] ) && ! in_array( $plugin_category, $value_plugin['category'] ) ) {
   613 								if ( 'all' !== $plugin_category && isset( $bws_plugins_category[ $plugin_category ] ) && ! in_array( $plugin_category, $value_plugin['category'] ) ) {
   566 									continue;
   614 									continue;
   567 								}
   615 								}
   568 
   616 
   569 								$key_plugin_explode = explode( '/', $key_plugin );
   617 								$key_plugin_explode = explode( '/', $key_plugin );
   570 
   618 								if ( in_array( $key_plugin_explode[0], array( 'car-rental', 'contact-form-multi', 'custom-admin-page', 'adsense-plugin', 'zendesk-help-center', 'bws-adsense' ) ) ) {
   571 								$icon         = isset( $value_plugin['icon'] ) ? $value_plugin['icon'] : '//ps.w.org/' . $key_plugin_explode[0] . '/assets/icon-256x256.png';
   619 									$icon = isset( $value_plugin['icon'] ) ? $value_plugin['icon'] : '//ps.w.org/' . $key_plugin_explode[0] . '/assets/icon-256x256.png';
       
   620 								} else {
       
   621 									$icon = isset( $value_plugin['icon'] ) ? $value_plugin['icon'] : '//ps.w.org/' . $key_plugin_explode[0] . '/assets/icon-256x256.gif';
       
   622 								}
       
   623 
   572 								$is_pro_isset = isset( $value_plugin['pro_version'] );
   624 								$is_pro_isset = isset( $value_plugin['pro_version'] );
   573 								$is_installed = array_key_exists( $key_plugin, $all_plugins );
   625 								$is_installed = array_key_exists( $key_plugin, $all_plugins );
   574 								$is_active    = in_array( $key_plugin, $active_plugins ) || isset( $sitewide_active_plugins[ $key_plugin ] );
   626 								$is_active    = in_array( $key_plugin, $active_plugins ) || isset( $sitewide_active_plugins[ $key_plugin ] );
   575 
   627 
   576 								$is_pro_installed = $is_pro_active = false;
   628 								$is_pro_installed = $is_pro_active = false;
   582 								if ( ( isset( $_GET['sub'] ) && 'installed' === sanitize_text_field( wp_unslash( $_GET['sub'] ) ) && ! $is_pro_installed && ! $is_installed ) ||
   634 								if ( ( isset( $_GET['sub'] ) && 'installed' === sanitize_text_field( wp_unslash( $_GET['sub'] ) ) && ! $is_pro_installed && ! $is_installed ) ||
   583 									( isset( $_GET['sub'] ) && 'not_installed' === sanitize_text_field( wp_unslash( $_GET['sub'] ) ) && ( $is_pro_installed || $is_installed ) ) ) {
   635 									( isset( $_GET['sub'] ) && 'not_installed' === sanitize_text_field( wp_unslash( $_GET['sub'] ) ) && ( $is_pro_installed || $is_installed ) ) ) {
   584 									continue;
   636 									continue;
   585 								}
   637 								}
   586 
   638 
   587 								$link_attr = isset( $value_plugin['install_url'] ) ? 'href="' . esc_url( $value_plugin['install_url'] ) . '" target="_blank"' : 'href="' . esc_url( self_admin_url( 'plugin-install.php?tab=plugin-information&plugin=' . $key_plugin_explode[0] . '&from=import&TB_iframe=true&width=600&height=550' ) ) . '" class="thickbox open-plugin-details-modal"';
   639 								if ( is_multisite() ) {
       
   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"';
       
   641 								} else {
       
   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"';
       
   643 								}
   588 
   644 
   589 								$nothing_found = false;
   645 								$nothing_found = false;
   590 								?>
   646 								?>
   591 									<div class="bws_product_box
   647 									<div class="bws_product_box
   592 									<?php
   648 									<?php
   593 									if ( $is_active || $is_pro_active ) {
   649 									if ( $is_active || $is_pro_active ) {
   594 										echo esc_attr( ' bws_product_active' );}
   650 										echo esc_attr( ' bws_product_active' );
       
   651 									}
   595 									?>
   652 									?>
   596 									">
   653 									">
   597 										<div class="bws_product_image">
   654 										<div class="bws_product_image">
   598 											<a <?php echo wp_kses_data( $link_attr ); ?>><img src="<?php echo esc_url( $icon ); ?>"/></a>
   655 											<a <?php echo wp_kses_data( $link_attr ); ?>><img src="<?php echo esc_url( $icon ); ?>"/></a>
   599 										</div>
   656 										</div>
   619 
   676 
   620 												if ( ! empty( $value_plugin['expired'] ) ) {
   677 												if ( ! empty( $value_plugin['expired'] ) ) {
   621 													echo ' - <a class="bws-update-now" href="https://support.bestwebsoft.com/hc/en-us/articles/202356359" target="_blank">' . esc_html__( 'Renew to get updates', 'bestwebsoft' ) . '</a>';
   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>';
   622 												} elseif ( ! empty( $value_plugin['update_availible'] ) ) {
   679 												} elseif ( ! empty( $value_plugin['update_availible'] ) ) {
   623 													$r = $update_availible_all->response[ $value_plugin['update_availible'] ];
   680 													$r = $update_availible_all->response[ $value_plugin['update_availible'] ];
   624 													echo ' - <a class="bws-update-now" href="' . esc_url( wp_nonce_url( self_admin_url( 'update.php?action=upgrade-plugin&plugin=' . $value_plugin['update_availible'] ), 'upgrade-plugin_' . $value_plugin['update_availible'] ) ) . '" class="update-link" aria-label="' . sprintf( esc_html__( 'Update to v %s', 'bestwebsoft' ), $r->new_version ) . '">' . sprintf( esc_html__( 'Update to v %s', 'bestwebsoft' ), esc_html( $r->new_version ) ) . '</a>';
   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>';
   625 												}
   682 												}
   626 												?>
   683 												?>
   627 											</div>
   684 											</div>
   628 											<div class="bws_product_description">
   685 											<div class="bws_product_description">
   629 												<?php echo ( strlen( $value_plugin['description'] ) > 100 ) ? esc_html( mb_substr( $value_plugin['description'], 0, 100 ) ) . '...' : esc_html( $value_plugin['description'] ); ?>
   686 												<?php echo esc_html( strlen( $value_plugin['description'] ) > 100 ? mb_substr( $value_plugin['description'], 0, 100 ) . '...' : $value_plugin['description'] ); ?>
   630 											</div>
   687 											</div>
   631 											<div class="bws_product_links">
   688 											<div class="bws_product_links">
   632 												<?php
   689 												<?php
   633 												if ( $is_active || $is_pro_active ) {
   690 												if ( $is_active || $is_pro_active ) {
   634 													if ( $is_pro_isset ) {
   691 													if ( $is_pro_isset ) {
   699 									<li>
   756 									<li>
   700 										<?php $sub_in_url = ( isset( $_GET['sub'] ) && in_array( sanitize_text_field( wp_unslash( $_GET['sub'] ) ), array( 'installed', 'not_installed' ) ) ) ? '&sub=' . sanitize_text_field( wp_unslash( $_GET['sub'] ) ) : ''; ?>
   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'] ) ) : ''; ?>
   701 										<a 
   758 										<a 
   702 										<?php
   759 										<?php
   703 										if ( 'all' === $plugin_category ) {
   760 										if ( 'all' === $plugin_category ) {
   704 											echo ' class="bws-active"';}
   761 											echo ' class="bws-active"';
       
   762 										}
   705 										?>
   763 										?>
   706 											href="<?php echo esc_url( self_admin_url( $current_page . $sub_in_url ) ); ?>"><?php esc_html_e( 'All', 'bestwebsoft' ); ?>
   764 											href="<?php echo esc_url( self_admin_url( $current_page . $sub_in_url ) ); ?>"><?php esc_html_e( 'All', 'bestwebsoft' ); ?>
   707 											<span>(<?php echo count( $bws_plugins ); ?>)</span>
   765 											<span>(<?php echo count( $bws_plugins ); ?>)</span>
   708 										</a>
   766 										</a>
   709 									</li>
   767 									</li>
   710 									<?php foreach ( $bws_plugins_category as $category_key => $category_value ) { ?>
   768 									<?php foreach ( $bws_plugins_category as $category_key => $category_value ) { ?>
   711 										<li>
   769 										<li>
   712 											<a 
   770 											<a 
   713 											<?php
   771 											<?php
   714 											if ( $category_key === $plugin_category ) {
   772 											if ( $category_key === $plugin_category ) {
   715 												echo ' class="bws-active"';}
   773 												echo ' class="bws-active"';
       
   774 											}
   716 											?>
   775 											?>
   717 												href="<?php echo esc_url( self_admin_url( $current_page . $sub_in_url . '&category=' . $category_key ) ); ?>"><?php echo esc_html( $category_value['name'] ); ?>
   776 												href="<?php echo esc_url( self_admin_url( $current_page . $sub_in_url . '&category=' . $category_key ) ); ?>"><?php echo esc_html( $category_value['name'] ); ?>
   718 												<span>(<?php echo intval( $category_value['count'] ); ?>)</span>
   777 												<span>(<?php echo absint( $category_value['count'] ); ?>)</span>
   719 											</a>
   778 											</a>
   720 										</li>
   779 										</li>
   721 									<?php } ?>
   780 									<?php } ?>
   722 								</ul>
   781 								</ul>
   723 							</div>
   782 							</div>
   766 				<?php } elseif ( 'bws_system_status' === $page || 'system-status' === $tab ) { ?>
   825 				<?php } elseif ( 'bws_system_status' === $page || 'system-status' === $tab ) { ?>
   767 					<h1><?php esc_html_e( 'System status', 'bestwebsoft' ); ?></h1>
   826 					<h1><?php esc_html_e( 'System status', 'bestwebsoft' ); ?></h1>
   768 					<div class="updated fade notice is-dismissible inline" 
   827 					<div class="updated fade notice is-dismissible inline" 
   769 					<?php
   828 					<?php
   770 					if ( ! ( isset( $_REQUEST['bwsmn_form_submit'] ) || isset( $_REQUEST['bwsmn_form_submit_custom_email'] ) ) || '' !== $error ) {
   829 					if ( ! ( isset( $_REQUEST['bwsmn_form_submit'] ) || isset( $_REQUEST['bwsmn_form_submit_custom_email'] ) ) || '' !== $error ) {
   771 						echo 'style="display:none"';}
   830 						echo 'style="display:none"';
       
   831 					}
   772 					?>
   832 					?>
   773 					><p><strong><?php echo esc_html( $message ); ?></strong></p></div>
   833 					><p><strong><?php echo esc_html( $message ); ?></strong></p></div>
   774 					<div class="error" 
   834 					<div class="error" 
   775 					<?php
   835 					<?php
   776 					if ( '' === $error ) {
   836 					if ( '' === $error ) {
   777 						echo 'style="display:none"';}
   837 						echo 'style="display:none"';
       
   838 					}
   778 					?>
   839 					?>
   779 					><p><strong><?php echo esc_html( $error ); ?></strong></p></div>
   840 					><p><strong><?php echo esc_html( $error ); ?></strong></p></div>
   780 					<form method="post" action="">
   841 					<form method="post" action="">
   781 						<p>
   842 						<p>
   782 							<input type="hidden" name="bwsmn_form_submit" value="submit" />
   843 							<input type="hidden" name="bwsmn_form_submit" value="submit" />
   826 		<?php
   887 		<?php
   827 	}
   888 	}
   828 }
   889 }
   829 
   890 
   830 if ( ! function_exists( 'bws_get_banner_array' ) ) {
   891 if ( ! function_exists( 'bws_get_banner_array' ) ) {
       
   892 	/**
       
   893 	 * Get banner array
       
   894 	 */
   831 	function bws_get_banner_array() {
   895 	function bws_get_banner_array() {
   832 		global $bstwbsftwppdtplgns_banner_array;
   896 		global $bstwbsftwppdtplgns_banner_array;
   833 		$bstwbsftwppdtplgns_banner_array = array(
   897 		$bstwbsftwppdtplgns_banner_array = array(
   834 			array( 'gglstpvrfctn_hide_banner_on_plugin_page', 'bws-google-2-step-verification/bws-google-2-step-verification.php', '1.0.0' ),
   898 			array( 'gglstpvrfctn_hide_banner_on_plugin_page', 'bws-google-2-step-verification/bws-google-2-step-verification.php', '1.0.0' ),
   835 			array( 'sclbttns_hide_banner_on_plugin_page', 'social-buttons-pack/social-buttons-pack.php', '1.1.0' ),
   899 			array( 'sclbttns_hide_banner_on_plugin_page', 'social-buttons-pack/social-buttons-pack.php', '1.1.0' ),
   839 			array( 'lnkdn_hide_banner_on_plugin_page', 'bws-linkedin/bws-linkedin.php', '1.0.1' ),
   903 			array( 'lnkdn_hide_banner_on_plugin_page', 'bws-linkedin/bws-linkedin.php', '1.0.1' ),
   840 			array( 'pntrst_hide_banner_on_plugin_page', 'bws-pinterest/bws-pinterest.php', '1.0.1' ),
   904 			array( 'pntrst_hide_banner_on_plugin_page', 'bws-pinterest/bws-pinterest.php', '1.0.1' ),
   841 			array( 'zndskhc_hide_banner_on_plugin_page', 'zendesk-help-center/zendesk-help-center.php', '1.0.0' ),
   905 			array( 'zndskhc_hide_banner_on_plugin_page', 'zendesk-help-center/zendesk-help-center.php', '1.0.0' ),
   842 			array( 'gglcptch_hide_banner_on_plugin_page', 'google-captcha/google-captcha.php', '1.18' ),
   906 			array( 'gglcptch_hide_banner_on_plugin_page', 'google-captcha/google-captcha.php', '1.18' ),
   843 			array( 'mltlngg_hide_banner_on_plugin_page', 'multilanguage/multilanguage.php', '1.1.1' ),
   907 			array( 'mltlngg_hide_banner_on_plugin_page', 'multilanguage/multilanguage.php', '1.1.1' ),
   844 			array( 'adsns_hide_banner_on_plugin_page', 'adsense-plugin/adsense-plugin.php', '1.36' ),
   908 			array( 'adsns_hide_banner_on_plugin_page', 'bws-adsense/bws-adsense.php', '1.36' ),
   845 			array( 'vstrsnln_hide_banner_on_plugin_page', 'visitors-online/visitors-online.php', '0.2' ),
   909 			array( 'vstrsnln_hide_banner_on_plugin_page', 'visitors-online/visitors-online.php', '0.2' ),
   846 			array( 'cstmsrch_hide_banner_on_plugin_page', 'custom-search-plugin/custom-search-plugin.php', '1.28' ),
   910 			array( 'cstmsrch_hide_banner_on_plugin_page', 'custom-search-plugin/custom-search-plugin.php', '1.28' ),
   847 			array( 'prtfl_hide_banner_on_plugin_page', 'portfolio/portfolio.php', '2.33' ),
   911 			array( 'prtfl_hide_banner_on_plugin_page', 'portfolio/portfolio.php', '2.33' ),
   848 			array( 'rlt_hide_banner_on_plugin_page', 'realty/realty.php', '1.0.0' ),
   912 			array( 'rlt_hide_banner_on_plugin_page', 'realty/realty.php', '1.0.0' ),
   849 			array( 'prmbr_hide_banner_on_plugin_page', 'promobar/promobar.php', '1.0.0' ),
   913 			array( 'prmbr_hide_banner_on_plugin_page', 'promobar/promobar.php', '1.0.0' ),