wp/wp-content/plugins/portfolio/bws_menu/bws_menu.php
changeset 12 d8a8807227e4
parent 7 cf61fcea0001
child 16 a86126ab1dd4
equal deleted inserted replaced
11:bf1778c34b9a 12:d8a8807227e4
     1 <?php
     1 <?php
     2 /*
     2 /*
     3 * Function for displaying BestWebSoft menu
     3 * Function for displaying BestWebSoft menu
     4 * Version: 2.1.5
     4 * Version: 2.2.0
     5 */
     5 */
     6 
     6 
     7 if ( ! function_exists ( 'bws_admin_enqueue_scripts' ) )
     7 if ( ! function_exists ( 'bws_admin_enqueue_scripts' ) )
     8 	require_once( dirname( __FILE__ ) . '/bws_functions.php' );
     8 	require_once( dirname( __FILE__ ) . '/bws_functions.php' );
     9 
     9 
    11 	function bws_add_menu_render() {
    11 	function bws_add_menu_render() {
    12 		global $wpdb, $wp_version, $bws_plugin_info, $bstwbsftwppdtplgns_options;
    12 		global $wpdb, $wp_version, $bws_plugin_info, $bstwbsftwppdtplgns_options;
    13 		$error = $message = '';
    13 		$error = $message = '';
    14 
    14 
    15 		/**
    15 		/**
    16 		* @deprecated 1.9.8 (15.12.2016)
    16 		 * @deprecated 1.9.8 (15.12.2016)
    17 		*/
    17 		 */
    18 		$is_main_page = in_array( $_GET['page'], array( 'bws_panel', 'bws_themes', 'bws_system_status' ) );
    18 		$is_main_page = in_array( $_GET['page'], array( 'bws_panel', 'bws_themes', 'bws_system_status' ) );
    19 		$page = esc_attr( $_GET['page'] );
    19 		$page = esc_attr( $_GET['page'] );
    20 		$tab = isset( $_GET['tab'] ) ? esc_attr( $_GET['tab'] ) : '';
    20 		$tab = isset( $_GET['tab'] ) ? esc_attr( $_GET['tab'] ) : '';
    21 
    21 
    22 		if ( $is_main_page )
    22 		if ( $is_main_page )
    64 							$bws_plugins_update_availible[ $key_plugin ] = $value_plugin;
    64 							$bws_plugins_update_availible[ $key_plugin ] = $value_plugin;
    65 						}
    65 						}
    66 					}
    66 					}
    67 					/* check expired */
    67 					/* check expired */
    68 					if ( $is_pro_installed && isset( $bstwbsftwppdtplgns_options['time_out'][ $value_plugin['pro_version'] ] ) &&
    68 					if ( $is_pro_installed && isset( $bstwbsftwppdtplgns_options['time_out'][ $value_plugin['pro_version'] ] ) &&
    69 						strtotime( $bstwbsftwppdtplgns_options['time_out'][ $value_plugin['pro_version'] ] ) < strtotime( date( "m/d/Y" ) ) ) {
    69 					     strtotime( $bstwbsftwppdtplgns_options['time_out'][ $value_plugin['pro_version'] ] ) < strtotime( date( "m/d/Y" ) ) ) {
    70 						unset( $bws_plugins[ $key_plugin ] );
    70 						unset( $bws_plugins[ $key_plugin ] );
    71 						$value_plugin['expired'] = $bstwbsftwppdtplgns_options['time_out'][ $value_plugin['pro_version'] ];
    71 						$value_plugin['expired'] = $bstwbsftwppdtplgns_options['time_out'][ $value_plugin['pro_version'] ];
    72 						$bws_plugins_expired[ $key_plugin ] = $value_plugin;
    72 						$bws_plugins_expired[ $key_plugin ] = $value_plugin;
    73 					}
    73 					}
    74 				}
    74 				}
   155 						}
   155 						}
   156 
   156 
   157 						if ( is_multisite() )
   157 						if ( is_multisite() )
   158 							update_site_option( 'bstwbsftwppdtplgns_options', $bstwbsftwppdtplgns_options );
   158 							update_site_option( 'bstwbsftwppdtplgns_options', $bstwbsftwppdtplgns_options );
   159 						else
   159 						else
   160 						 	update_option( 'bstwbsftwppdtplgns_options', $bstwbsftwppdtplgns_options );
   160 							update_option( 'bstwbsftwppdtplgns_options', $bstwbsftwppdtplgns_options );
   161 					}
   161 					}
   162 				} else {
   162 				} else {
   163 					$error = __( "Please enter your license key.", 'bestwebsoft' );
   163 					$error = __( "Please enter your license key.", 'bestwebsoft' );
   164 				}
   164 				}
   165 			}
   165 			}
   166 		} elseif ( 'bws_system_status' == $page || 'system-status' == $tab ) {
   166 		} elseif ( 'bws_system_status' == $page || 'system-status' == $tab ) {
   167 
   167 
   168 			$all_plugins = get_plugins();
   168 			$all_plugins = get_plugins();
   169 			$active_plugins = get_option( 'active_plugins' );
   169 			$active_plugins = get_option( 'active_plugins' );
   170 		    $mysql_info = $wpdb->get_results( "SHOW VARIABLES LIKE 'sql_mode'" );
   170 			$mysql_info = $wpdb->get_results( "SHOW VARIABLES LIKE 'sql_mode'" );
   171 		    if ( is_array( $mysql_info ) )
   171 			if ( is_array( $mysql_info ) )
   172 		    	$sql_mode = $mysql_info[0]->Value;
   172 				$sql_mode = $mysql_info[0]->Value;
   173 		    if ( empty( $sql_mode ) )
   173 			if ( empty( $sql_mode ) )
   174 		    	$sql_mode = __( 'Not set', 'bestwebsoft' );
   174 				$sql_mode = __( 'Not set', 'bestwebsoft' );
   175 
   175 
   176 			$allow_url_fopen = ( ini_get( 'allow_url_fopen' ) ) ? __( 'On', 'bestwebsoft' ) : __( 'Off', 'bestwebsoft' );
   176 			$allow_url_fopen = ( ini_get( 'allow_url_fopen' ) ) ? __( 'On', 'bestwebsoft' ) : __( 'Off', 'bestwebsoft' );
   177 			$upload_max_filesize = ( ini_get( 'upload_max_filesize' ) )? ini_get( 'upload_max_filesize' ) : __( 'N/A', 'bestwebsoft' );
   177 			$upload_max_filesize = ( ini_get( 'upload_max_filesize' ) )? ini_get( 'upload_max_filesize' ) : __( 'N/A', 'bestwebsoft' );
   178 			$post_max_size = ( ini_get( 'post_max_size' ) ) ? ini_get( 'post_max_size' ) : __( 'N/A', 'bestwebsoft' );
   178 			$post_max_size = ( ini_get( 'post_max_size' ) ) ? ini_get( 'post_max_size' ) : __( 'N/A', 'bestwebsoft' );
   179 			$max_execution_time = ( ini_get( 'max_execution_time' ) ) ? ini_get( 'max_execution_time' ) : __( 'N/A', 'bestwebsoft' );
   179 			$max_execution_time = ( ini_get( 'max_execution_time' ) ) ? ini_get( 'max_execution_time' ) : __( 'N/A', 'bestwebsoft' );
   288 					if ( $result != true )
   288 					if ( $result != true )
   289 						$error = __( "Sorry, email message could not be delivered.", 'bestwebsoft' );
   289 						$error = __( "Sorry, email message could not be delivered.", 'bestwebsoft' );
   290 				}
   290 				}
   291 			}
   291 			}
   292 		} ?>
   292 		} ?>
   293 		<div class="bws-wrap">
   293         <div class="bws-wrap">
   294 			<div class="bws-header">
   294             <div class="bws-header">
   295 				<div class="bws-title">
   295                 <div class="bws-title">
   296 					<a href="<?php echo ( $is_main_page ) ? self_admin_url( 'admin.php?page=bws_panel' ) : esc_url( self_admin_url( 'admin.php?page=' . $page ) ); ?>">
   296                     <a href="<?php echo ( $is_main_page ) ? self_admin_url( 'admin.php?page=bws_panel' ) : esc_url( self_admin_url( 'admin.php?page=' . $page ) ); ?>">
   297 						<span class="bws-logo bwsicons bwsicons-bws-logo"></span>
   297                         <span class="bws-logo bwsicons bwsicons-bws-logo"></span>
   298 						BestWebSoft
   298                         BestWebSoft
   299 						<span>panel</span>
   299                         <span>panel</span>
   300 					</a>
   300                     </a>
   301 				</div>
   301                 </div>
   302 				<div class="bws-menu-item-icon">&#8226;&#8226;&#8226;</div>
   302                 <div class="bws-menu-item-icon">&#8226;&#8226;&#8226;</div>
   303 				<div class="bws-nav-tab-wrapper">
   303                 <div class="bws-nav-tab-wrapper">
   304 					<?php if ( $is_main_page ) { ?>
   304 					<?php if ( $is_main_page ) { ?>
   305 						<a class="bws-nav-tab<?php if ( 'bws_panel' == $page ) echo ' bws-nav-tab-active'; ?>" href="<?php echo self_admin_url( 'admin.php?page=bws_panel' ); ?>"><?php _e( 'Plugins', 'bestwebsoft' ); ?></a>
   305                         <a class="bws-nav-tab<?php if ( 'bws_panel' == $page ) echo ' bws-nav-tab-active'; ?>" href="<?php echo self_admin_url( 'admin.php?page=bws_panel' ); ?>"><?php _e( 'Plugins', 'bestwebsoft' ); ?></a>
   306 						<a class="bws-nav-tab<?php if ( 'bws_themes' == $page ) echo ' bws-nav-tab-active'; ?>" href="<?php echo self_admin_url( 'admin.php?page=bws_themes' ); ?>"><?php _e( 'Themes', 'bestwebsoft' ); ?></a>
   306                         <a class="bws-nav-tab<?php if ( 'bws_themes' == $page ) echo ' bws-nav-tab-active'; ?>" href="<?php echo self_admin_url( 'admin.php?page=bws_themes' ); ?>"><?php _e( 'Themes', 'bestwebsoft' ); ?></a>
   307 						<a class="bws-nav-tab<?php if ( 'bws_system_status' == $page ) echo ' bws-nav-tab-active'; ?>" href="<?php echo self_admin_url( 'admin.php?page=bws_system_status' ); ?>"><?php _e( 'System status', 'bestwebsoft' ); ?></a>
   307                         <a class="bws-nav-tab<?php if ( 'bws_system_status' == $page ) echo ' bws-nav-tab-active'; ?>" href="<?php echo self_admin_url( 'admin.php?page=bws_system_status' ); ?>"><?php _e( 'System status', 'bestwebsoft' ); ?></a>
   308 					<?php } else { ?>
   308 					<?php } else { ?>
   309 						<a class="bws-nav-tab<?php if ( ! isset( $_GET['tab'] ) ) echo ' bws-nav-tab-active'; ?>" href="<?php echo esc_url( self_admin_url( 'admin.php?page=' . $page ) ); ?>"><?php _e( 'Plugins', 'bestwebsoft' ); ?></a>
   309                         <a class="bws-nav-tab<?php if ( ! isset( $_GET['tab'] ) ) echo ' bws-nav-tab-active'; ?>" href="<?php echo esc_url( self_admin_url( 'admin.php?page=' . $page ) ); ?>"><?php _e( 'Plugins', 'bestwebsoft' ); ?></a>
   310 						<a class="bws-nav-tab<?php if ( 'themes' == $tab ) echo ' bws-nav-tab-active'; ?>" href="<?php echo esc_url( self_admin_url( 'admin.php?page=' . $page . '&tab=themes' ) ); ?>"><?php _e( 'Themes', 'bestwebsoft' ); ?></a>
   310                         <a class="bws-nav-tab<?php if ( 'themes' == $tab ) echo ' bws-nav-tab-active'; ?>" href="<?php echo esc_url( self_admin_url( 'admin.php?page=' . $page . '&tab=themes' ) ); ?>"><?php _e( 'Themes', 'bestwebsoft' ); ?></a>
   311 						<a class="bws-nav-tab<?php if ( 'system-status' == $tab ) echo ' bws-nav-tab-active'; ?>" href="<?php echo esc_url( self_admin_url( 'admin.php?page=' . $page . '&tab=system-status' ) ); ?>"><?php _e( 'System status', 'bestwebsoft' ); ?></a>
   311                         <a class="bws-nav-tab<?php if ( 'system-status' == $tab ) echo ' bws-nav-tab-active'; ?>" href="<?php echo esc_url( self_admin_url( 'admin.php?page=' . $page . '&tab=system-status' ) ); ?>"><?php _e( 'System status', 'bestwebsoft' ); ?></a>
   312 					<?php } ?>
   312 					<?php } ?>
   313 				</div>
   313                 </div>
   314 				<div class="bws-help-links-wrapper">
   314                 <div class="bws-help-links-wrapper">
   315 					<a href="https://support.bestwebsoft.com" target="_blank"><?php _e( 'Support', 'bestwebsoft' ); ?></a>
   315                     <a href="https://support.bestwebsoft.com" target="_blank"><?php _e( 'Support', 'bestwebsoft' ); ?></a>
   316 					<a href="https://bestwebsoft.com/client-area" target="_blank" title="<?php _e( 'Manage purchased licenses & subscriptions', 'bestwebsoft' ); ?>">Client Area</a>
   316                     <a href="https://bestwebsoft.com/client-area" target="_blank" title="<?php _e( 'Manage purchased licenses & subscriptions', 'bestwebsoft' ); ?>">Client Area</a>
   317 				</div>
   317                 </div>
   318 				<div class="clear"></div>
   318                 <div class="clear"></div>
   319 			</div>
   319             </div>
   320 			<?php if ( ( 'bws_panel' == $page || ( ! isset( $_GET['tab'] ) && ! $is_main_page ) ) && ! isset( $_POST['bws_plugin_action_submit'] ) ) { ?>
   320 			<?php if ( ( 'bws_panel' == $page || ( ! isset( $_GET['tab'] ) && ! $is_main_page ) ) && ! isset( $_POST['bws_plugin_action_submit'] ) ) { ?>
   321 				<div class="bws-membership-wrap">
   321                 <div class="bws-membership-wrap">
   322 					<div class="bws-membership-backround"></div>
   322                     <div class="bws-membership-backround"></div>
   323 					<div class="bws-membership">
   323                     <div class="bws-membership">
   324 						<div class="bws-membership-title"><?php printf( __( 'Get Access to %s+ Premium Plugins', 'bestwebsoft' ), '30' ); ?></div>
   324                         <div class="bws-membership-title"><?php printf( __( 'Get Access to %s+ Premium Plugins', 'bestwebsoft' ), '30' ); ?></div>
   325 						<form class="bws-membership-form" method="post" action="">
   325                         <form class="bws-membership-form" method="post" action="">
   326 							<span class="bws-membership-link"><a target="_blank" href="https://bestwebsoft.com/membership/"><?php _e( 'Subscribe to Pro Membership', 'bestwebsoft' ); ?></a> <?php _e( 'or', 'bestwebsoft' ); ?></span>
   326                             <span class="bws-membership-link"><a target="_blank" href="https://bestwebsoft.com/membership/"><?php _e( 'Subscribe to Pro Membership', 'bestwebsoft' ); ?></a> <?php _e( 'or', 'bestwebsoft' ); ?></span>
   327 							<?php if ( isset( $bstwbsftwppdtplgns_options['go_pro'][ $bws_license_plugin ]['count'] ) &&
   327 							<?php if ( isset( $bstwbsftwppdtplgns_options['go_pro'][ $bws_license_plugin ]['count'] ) &&
   328 								'5' < $bstwbsftwppdtplgns_options['go_pro'][ $bws_license_plugin ]['count'] &&
   328 							           '5' < $bstwbsftwppdtplgns_options['go_pro'][ $bws_license_plugin ]['count'] &&
   329 								$bstwbsftwppdtplgns_options['go_pro'][ $bws_license_plugin ]['time'] > ( time() - ( 24 * 60 * 60 ) ) ) { ?>
   329 							           $bstwbsftwppdtplgns_options['go_pro'][ $bws_license_plugin ]['time'] > ( time() - ( 24 * 60 * 60 ) ) ) { ?>
   330 								<div class="bws_form_input_wrap">
   330                                 <div class="bws_form_input_wrap">
   331 									<input disabled="disabled" type="text" name="bws_license_key" value="<?php echo esc_attr( $bws_license_key); ?>" />
   331                                     <input disabled="disabled" type="text" name="bws_license_key" value="<?php echo esc_attr( $bws_license_key); ?>" />
   332 									<div class="bws_error"><?php _e( "Unfortunately, you have exceeded the number of available tries per day.", 'bestwebsoft' ); ?></div>
   332                                     <div class="bws_error"><?php _e( "Unfortunately, you have exceeded the number of available tries per day.", 'bestwebsoft' ); ?></div>
   333 								</div>
   333                                 </div>
   334 								<input disabled="disabled" type="submit" class="bws-button" value="<?php _e( 'Check license key', 'bestwebsoft' ); ?>" />
   334                                 <input disabled="disabled" type="submit" class="bws-button" value="<?php _e( 'Check license key', 'bestwebsoft' ); ?>" />
   335 							<?php } else { ?>
   335 							<?php } else { ?>
   336 								<div class="bws_form_input_wrap">
   336                                 <div class="bws_form_input_wrap">
   337 									<input <?php if ( "" != $error ) echo 'class="bws_input_error"'; ?> type="text" placeholder="<?php _e( 'Enter your license key', 'bestwebsoft' ); ?>" maxlength="100" name="bws_license_key" value="<?php echo esc_attr( $bws_license_key ); ?>" />
   337                                     <input <?php if ( "" != $error ) echo 'class="bws_input_error"'; ?> type="text" placeholder="<?php _e( 'Enter your license key', 'bestwebsoft' ); ?>" maxlength="100" name="bws_license_key" value="<?php echo esc_attr( $bws_license_key ); ?>" />
   338 									<div class="bws_error" <?php if ( "" == $error ) echo 'style="display:none"'; ?>><?php echo $error; ?></div>
   338                                     <div class="bws_error" <?php if ( "" == $error ) echo 'style="display:none"'; ?>><?php echo $error; ?></div>
   339 								</div>
   339                                 </div>
   340 								<input type="hidden" name="bws_license_plugin" value="<?php echo esc_attr( $bws_license_plugin ); ?>" />
   340                                 <input type="hidden" name="bws_license_plugin" value="<?php echo esc_attr( $bws_license_plugin ); ?>" />
   341 								<input type="hidden" name="bws_license_submit" value="submit" />
   341                                 <input type="hidden" name="bws_license_submit" value="submit" />
   342 								<?php if ( empty( $plugins_array ) ) { ?>
   342 								<?php if ( empty( $plugins_array ) ) { ?>
   343 									<input type="submit" class="bws-button" value="<?php _e( 'Activate', 'bestwebsoft' ); ?>" />
   343                                     <input type="submit" class="bws-button" value="<?php _e( 'Activate', 'bestwebsoft' ); ?>" />
   344 								<?php } else { ?>
   344 								<?php } else { ?>
   345 									<input type="submit" class="bws-button" value="<?php _e( 'Check license key', 'bestwebsoft' ); ?>" />
   345                                     <input type="submit" class="bws-button" value="<?php _e( 'Check license key', 'bestwebsoft' ); ?>" />
   346 								<?php } ?>
   346 								<?php } ?>
   347 								<?php wp_nonce_field( plugin_basename(__FILE__), 'bws_license_nonce_name' ); ?>
   347 								<?php wp_nonce_field( plugin_basename(__FILE__), 'bws_license_nonce_name' ); ?>
   348 							<?php } ?>
   348 							<?php } ?>
   349 						</form>
   349                         </form>
   350 						<div class="clear"></div>
   350                         <div class="clear"></div>
   351 					</div>
   351                     </div>
   352 				</div>
   352                 </div>
   353 			<?php } ?>
   353 			<?php } ?>
   354 			<div class="bws-wrap-content wrap">
   354             <div class="bws-wrap-content wrap">
   355 				<?php if ( 'bws_panel' == $page || ( ! isset( $_GET['tab'] ) && ! $is_main_page ) ) { ?>
   355 				<?php if ( 'bws_panel' == $page || ( ! isset( $_GET['tab'] ) && ! $is_main_page ) ) { ?>
   356 					<div class="updated notice is-dismissible inline" <?php if ( '' == $message || '' != $error ) echo 'style="display:none"'; ?>><p><?php echo $message; ?></p></div>
   356                     <div class="updated notice is-dismissible inline" <?php if ( '' == $message || '' != $error ) echo 'style="display:none"'; ?>><p><?php echo $message; ?></p></div>
   357 					<h1>
   357                     <h1>
   358 						<?php _e( 'Plugins', 'bestwebsoft' ); ?>
   358 						<?php _e( 'Plugins', 'bestwebsoft' ); ?>
   359 						<a href="<?php echo self_admin_url( 'plugin-install.php?tab=upload' ); ?>" class="upload page-title-action add-new-h2"><?php _e( 'Upload Plugin', 'bestwebsoft' ); ?></a>
   359                         <a href="<?php echo self_admin_url( 'plugin-install.php?tab=upload' ); ?>" class="upload page-title-action add-new-h2"><?php _e( 'Upload Plugin', 'bestwebsoft' ); ?></a>
   360 					</h1>
   360                     </h1>
   361 					<?php if ( isset( $_GET['error'] ) ) {
   361 					<?php if ( isset( $_GET['error'] ) ) {
   362 						if ( isset( $_GET['charsout'] ) )
   362 						if ( isset( $_GET['charsout'] ) )
   363 							$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.' ), $_GET['charsout'] );
   363 							$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.' ), $_GET['charsout'] );
   364 						else
   364 						else
   365 							$errmsg = __( 'Plugin could not be activated because it triggered a <strong>fatal error</strong>.' ); ?>
   365 							$errmsg = __( 'Plugin could not be activated because it triggered a <strong>fatal error</strong>.' ); ?>
   366 						<div id="message" class="error is-dismissible"><p><?php echo $errmsg; ?></p></div>
   366                         <div id="message" class="error is-dismissible"><p><?php echo $errmsg; ?></p></div>
   367 					<?php } elseif ( isset( $_GET['activate'] ) ) { ?>
   367 					<?php } elseif ( isset( $_GET['activate'] ) ) { ?>
   368 						<div id="message" class="updated notice is-dismissible"><p><?php _e( 'Plugin <strong>activated</strong>.' ) ?></p></div>
   368                         <div id="message" class="updated notice is-dismissible"><p><?php _e( 'Plugin <strong>activated</strong>.' ) ?></p></div>
   369 					<?php }
   369 					<?php }
   370 
   370 
   371 					if ( isset( $_POST['bws_plugin_action_submit'] ) && isset( $_POST['bws_install_plugin'] ) && check_admin_referer( plugin_basename(__FILE__), 'bws_license_install_nonce_name' ) ) {
   371 					if ( isset( $_POST['bws_plugin_action_submit'] ) && isset( $_POST['bws_install_plugin'] ) && check_admin_referer( plugin_basename(__FILE__), 'bws_license_install_nonce_name' ) ) {
   372 
   372 
   373 						$bws_license_plugin = sanitize_text_field( $_POST['bws_install_plugin'] );
   373 						$bws_license_plugin = sanitize_text_field( $_POST['bws_install_plugin'] );
   440 								$error = __( "Failed to download the zip archive. Please, upload the plugin manually", 'bestwebsoft' );
   440 								$error = __( "Failed to download the zip archive. Please, upload the plugin manually", 'bestwebsoft' );
   441 
   441 
   442 							echo '<p class="error">' . $error . '</p>';
   442 							echo '<p class="error">' . $error . '</p>';
   443 							echo '<p><a href="' . esc_url( self_admin_url( $current_page ) ) . '" target="_parent">' . __( 'Return to BestWebSoft Panel', 'bestwebsoft' ) . '</a></p>';
   443 							echo '<p><a href="' . esc_url( self_admin_url( $current_page ) ) . '" target="_parent">' . __( 'Return to BestWebSoft Panel', 'bestwebsoft' ) . '</a></p>';
   444 						}
   444 						}
   445 					} else { 
   445 					} else {
   446 						$category_href = $current_page;
   446 						$category_href = $current_page;
   447 						if ( 'all' != $plugin_category )
   447 						if ( 'all' != $plugin_category )
   448 							$category_href .= '&category=' . $plugin_category; ?>
   448 							$category_href .= '&category=' . $plugin_category; ?>
   449 						<ul class="subsubsub">
   449                         <ul class="subsubsub">
   450 							<li>
   450                             <li>
   451 								<a <?php if ( ! isset( $_GET['sub'] ) ) echo 'class="current" '; ?>href="<?php echo esc_url( self_admin_url( $category_href ) ); ?>"><?php _e( 'All', 'bestwebsoft' ); ?></a>
   451                                 <a <?php if ( ! isset( $_GET['sub'] ) ) echo 'class="current" '; ?>href="<?php echo esc_url( self_admin_url( $category_href ) ); ?>"><?php _e( 'All', 'bestwebsoft' ); ?></a>
   452 							</li> |
   452                             </li> |
   453 							<li>
   453                             <li>
   454 								<a <?php if ( isset( $_GET['sub'] ) && 'installed' == $_GET['sub'] ) echo 'class="current" '; ?>href="<?php echo esc_url( self_admin_url( $category_href . '&sub=installed' ) ); ?>"><?php _e( 'Installed', 'bestwebsoft' ); ?></a>
   454                                 <a <?php if ( isset( $_GET['sub'] ) && 'installed' == $_GET['sub'] ) echo 'class="current" '; ?>href="<?php echo esc_url( self_admin_url( $category_href . '&sub=installed' ) ); ?>"><?php _e( 'Installed', 'bestwebsoft' ); ?></a>
   455 							</li> |
   455                             </li> |
   456 							<li>
   456                             <li>
   457 								<a <?php if ( isset( $_GET['sub'] ) && 'not_installed' == $_GET['sub'] ) echo 'class="current" '; ?>href="<?php echo esc_url( self_admin_url( $category_href . '&sub=not_installed' ) ); ?>"><?php _e( 'Not Installed', 'bestwebsoft' ); ?></a>
   457                                 <a <?php if ( isset( $_GET['sub'] ) && 'not_installed' == $_GET['sub'] ) echo 'class="current" '; ?>href="<?php echo esc_url( self_admin_url( $category_href . '&sub=not_installed' ) ); ?>"><?php _e( 'Not Installed', 'bestwebsoft' ); ?></a>
   458 							</li>
   458                             </li>
   459 						</ul>
   459                         </ul>
   460 						<div class="clear"></div>
   460                         <div class="clear"></div>
   461 						<div class="bws-filter-top">
   461                         <div class="bws-filter-top">
   462 							<h2>
   462                             <h2>
   463 								<span class="bws-toggle-indicator"></span>
   463                                 <span class="bws-toggle-indicator"></span>
   464 								<?php _e( 'Filter results', 'bestwebsoft' ); ?>
   464 								<?php _e( 'Filter results', 'bestwebsoft' ); ?>
   465 							</h2>
   465                             </h2>
   466 							<div class="bws-filter-top-inside">
   466                             <div class="bws-filter-top-inside">
   467 								<div class="bws-filter-title"><?php _e( 'Category', 'bestwebsoft' ); ?></div>
   467                                 <div class="bws-filter-title"><?php _e( 'Category', 'bestwebsoft' ); ?></div>
   468 								<ul class="bws-category">
   468                                 <ul class="bws-category">
   469 									<li>
   469                                     <li>
   470 										<?php $sub_in_url = ( isset( $_GET['sub'] ) && in_array( $_GET['sub'], array( 'installed', 'not_installed' ) ) ) ? '&sub=' . $_GET['sub'] : ''; ?>
   470 										<?php $sub_in_url = ( isset( $_GET['sub'] ) && in_array( $_GET['sub'], array( 'installed', 'not_installed' ) ) ) ? '&sub=' . $_GET['sub'] : ''; ?>
   471 										<a <?php if ( 'all' == $plugin_category ) echo ' class="bws-active"'; ?> href="<?php echo esc_url(self_admin_url( $current_page . $sub_in_url ) ); ?>"><?php _e( 'All', 'bestwebsoft' ); ?>
   471                                         <a <?php if ( 'all' == $plugin_category ) echo ' class="bws-active"'; ?> href="<?php echo esc_url(self_admin_url( $current_page . $sub_in_url ) ); ?>"><?php _e( 'All', 'bestwebsoft' ); ?>
   472 											<span>(<?php echo count( $bws_plugins ); ?>)</span>
   472                                             <span>(<?php echo count( $bws_plugins ); ?>)</span>
   473 										</a>
   473                                         </a>
   474 									</li>
   474                                     </li>
   475 									<?php foreach ( $bws_plugins_category as $category_key => $category_value ) { ?>
   475 									<?php foreach ( $bws_plugins_category as $category_key => $category_value ) { ?>
   476 										<li>
   476                                         <li>
   477 											<a <?php if ( $category_key == $plugin_category ) echo ' class="bws-active"'; ?> href="<?php echo esc_url( self_admin_url( $current_page . $sub_in_url . '&category=' . $category_key ) ); ?>"><?php echo $category_value['name']; ?>
   477                                             <a <?php if ( $category_key == $plugin_category ) echo ' class="bws-active"'; ?> href="<?php echo esc_url( self_admin_url( $current_page . $sub_in_url . '&category=' . $category_key ) ); ?>"><?php echo $category_value['name']; ?>
   478 												<span>(<?php echo $category_value['count']; ?>)</span>
   478                                                 <span>(<?php echo $category_value['count']; ?>)</span>
   479 											</a>
   479                                             </a>
   480 										</li>
   480                                         </li>
   481 									<?php } ?>
   481 									<?php } ?>
   482 								</ul>
   482                                 </ul>
   483 							</div>
   483                             </div>
   484 						</div>
   484                         </div>
   485 						<div class="bws-products">
   485                         <div class="bws-products">
   486 							<?php $nothing_found = true;
   486 							<?php $nothing_found = true;
   487 							foreach ( $bws_plugins as $key_plugin => $value_plugin ) {
   487 							foreach ( $bws_plugins as $key_plugin => $value_plugin ) {
   488 
   488 
   489 								if ( 'all' != $plugin_category && isset( $bws_plugins_category[ $plugin_category ] ) && ! in_array( $plugin_category, $value_plugin['category'] ) )
   489 								if ( 'all' != $plugin_category && isset( $bws_plugins_category[ $plugin_category ] ) && ! in_array( $plugin_category, $value_plugin['category'] ) )
   490 									continue;
   490 									continue;
   501 									$is_pro_installed = array_key_exists( $value_plugin['pro_version'], $all_plugins );
   501 									$is_pro_installed = array_key_exists( $value_plugin['pro_version'], $all_plugins );
   502 									$is_pro_active = in_array( $value_plugin['pro_version'], $active_plugins ) || isset( $sitewide_active_plugins[ $value_plugin['pro_version'] ] );
   502 									$is_pro_active = in_array( $value_plugin['pro_version'], $active_plugins ) || isset( $sitewide_active_plugins[ $value_plugin['pro_version'] ] );
   503 								}
   503 								}
   504 
   504 
   505 								if ( ( isset( $_GET['sub'] ) && 'installed' == $_GET['sub'] && ! $is_pro_installed && ! $is_installed ) ||
   505 								if ( ( isset( $_GET['sub'] ) && 'installed' == $_GET['sub'] && ! $is_pro_installed && ! $is_installed ) ||
   506 									( isset( $_GET['sub'] ) && 'not_installed' == $_GET['sub'] && ( $is_pro_installed || $is_installed ) ) )
   506 								     ( isset( $_GET['sub'] ) && 'not_installed' == $_GET['sub'] && ( $is_pro_installed || $is_installed ) ) )
   507 									continue;
   507 									continue;
   508 
   508 
   509 								$link_attr = isset( $value_plugin['install_url'] ) ? 'href="' . esc_url( $value_plugin['install_url'] ) . '" target="_blank"' : 'href="' . esc_url( self_admin_url( 'plugin-install.php?tab=plugin-information&plugin=' . $key_plugin_explode[0] . '&from=import&TB_iframe=true&width=600&height=550' ) ) . '" class="thickbox open-plugin-details-modal"';
   509 								$link_attr = isset( $value_plugin['install_url'] ) ? 'href="' . esc_url( $value_plugin['install_url'] ) . '" target="_blank"' : 'href="' . esc_url( self_admin_url( 'plugin-install.php?tab=plugin-information&plugin=' . $key_plugin_explode[0] . '&from=import&TB_iframe=true&width=600&height=550' ) ) . '" class="thickbox open-plugin-details-modal"';
   510 
   510 
   511 								$nothing_found = false; ?>
   511 								$nothing_found = false; ?>
   512 								<div class="bws_product_box<?php if ( $is_active || $is_pro_active ) echo ' bws_product_active'; ?>">
   512                                 <div class="bws_product_box<?php if ( $is_active || $is_pro_active ) echo ' bws_product_active'; ?>">
   513 									<div class="bws_product_image">
   513                                     <div class="bws_product_image">
   514 										<a <?php echo $link_attr; ?>><img src="<?php echo $icon; ?>"/></a>
   514                                         <a <?php echo $link_attr; ?>><img src="<?php echo $icon; ?>"/></a>
   515 									</div>
   515                                     </div>
   516 									<div class="bws_product_content">
   516                                     <div class="bws_product_content">
   517 										<div class="bws_product_title"><a <?php echo $link_attr; ?>><?php echo $value_plugin['name']; ?></a></div>
   517                                         <div class="bws_product_title"><a <?php echo $link_attr; ?>><?php echo $value_plugin['name']; ?></a></div>
   518 										<div class="bws-version">
   518                                         <div class="bws-version">
   519 											<?php
   519 											<?php
   520 											if ( $is_pro_installed ) {
   520 											if ( $is_pro_installed ) {
   521 												echo '<span';
   521 												echo '<span';
   522 												if ( ! empty( $value_plugin['expired'] ) || ! empty( $value_plugin['update_availible'] ) )
   522 												if ( ! empty( $value_plugin['expired'] ) || ! empty( $value_plugin['update_availible'] ) )
   523 													echo ' class="bws-update-available"';
   523 													echo ' class="bws-update-available"';
   535 												echo ' - <a class="bws-update-now" href="https://support.bestwebsoft.com/hc/en-us/articles/202356359" target="_blank">' . __( 'Renew to get updates', 'bestwebsoft' ) . '</a>';
   535 												echo ' - <a class="bws-update-now" href="https://support.bestwebsoft.com/hc/en-us/articles/202356359" target="_blank">' . __( 'Renew to get updates', 'bestwebsoft' ) . '</a>';
   536 											} elseif ( ! empty( $value_plugin['update_availible'] ) ) {
   536 											} elseif ( ! empty( $value_plugin['update_availible'] ) ) {
   537 												$r = $update_availible_all->response[ $value_plugin['update_availible'] ];
   537 												$r = $update_availible_all->response[ $value_plugin['update_availible'] ];
   538 												echo ' - <a class="bws-update-now" href="' . esc_url( wp_nonce_url( self_admin_url( 'update.php?action=upgrade-plugin&plugin=' . $value_plugin['update_availible'] ), 'upgrade-plugin_' . $value_plugin['update_availible'] ) ) . '" class="update-link" aria-label="' . sprintf( __( 'Update to v %s', 'bestwebsoft' ), $r->new_version ) . '">' . sprintf( __( 'Update to v %s', 'bestwebsoft' ), $r->new_version ) . '</a>';
   538 												echo ' - <a class="bws-update-now" href="' . esc_url( wp_nonce_url( self_admin_url( 'update.php?action=upgrade-plugin&plugin=' . $value_plugin['update_availible'] ), 'upgrade-plugin_' . $value_plugin['update_availible'] ) ) . '" class="update-link" aria-label="' . sprintf( __( 'Update to v %s', 'bestwebsoft' ), $r->new_version ) . '">' . sprintf( __( 'Update to v %s', 'bestwebsoft' ), $r->new_version ) . '</a>';
   539 											} ?>
   539 											} ?>
   540 										</div>
   540                                         </div>
   541 										<div class="bws_product_description">
   541                                         <div class="bws_product_description">
   542 											<?php echo ( strlen( $value_plugin['description'] ) > 100 ) ? mb_substr( $value_plugin['description'], 0, 100 ) . '...' : $value_plugin['description']; ?>
   542 											<?php echo ( strlen( $value_plugin['description'] ) > 100 ) ? mb_substr( $value_plugin['description'], 0, 100 ) . '...' : $value_plugin['description']; ?>
   543 										</div>
   543                                         </div>
   544 										<div class="bws_product_links">
   544                                         <div class="bws_product_links">
   545 											<?php if ( $is_active || $is_pro_active ) {
   545 											<?php if ( $is_active || $is_pro_active ) {
   546 												if ( $is_pro_isset ) {													
   546 												if ( $is_pro_isset ) {
   547 													if ( ! $is_pro_installed ) {
   547 													if ( ! $is_pro_installed ) {
   548 														if ( ! empty( $plugins_array ) && array_key_exists( $value_plugin['pro_version'], $plugins_array ) ) { ?>
   548 														if ( ! empty( $plugins_array ) && array_key_exists( $value_plugin['pro_version'], $plugins_array ) ) { ?>
   549 															<form method="post" action="">
   549                                                             <form method="post" action="">
   550 																<input type="submit" class="button button-secondary" value="<?php _e( 'Install Now', 'bestwebsoft' ); ?>" />
   550                                                                 <input type="submit" class="button button-secondary" value="<?php _e( 'Install Now', 'bestwebsoft' ); ?>" />
   551 																<input type="hidden" name="bws_plugin_action_submit" value="submit" />
   551                                                                 <input type="hidden" name="bws_plugin_action_submit" value="submit" />
   552 																<input type="hidden" name="bws_install_plugin" value="<?php echo $value_plugin['pro_version']; ?>" />
   552                                                                 <input type="hidden" name="bws_install_plugin" value="<?php echo $value_plugin['pro_version']; ?>" />
   553 																<?php wp_nonce_field( plugin_basename(__FILE__), 'bws_license_install_nonce_name' ); ?>
   553 																<?php wp_nonce_field( plugin_basename(__FILE__), 'bws_license_install_nonce_name' ); ?>
   554 															</form>
   554                                                             </form>
   555 														<?php } else { ?>
   555 														<?php } else { ?>
   556 															<a class="button button-secondary bws_upgrade_button" href="<?php echo esc_url( $bws_plugins[ $key_plugin ]['purchase'] ); ?>" target="_blank"><?php _e( 'Upgrade to Pro', 'bestwebsoft' ); ?></a>
   556                                                             <a class="button button-secondary bws_upgrade_button" href="<?php echo esc_url( $bws_plugins[ $key_plugin ]['purchase'] ); ?>" target="_blank"><?php _e( 'Upgrade to Pro', 'bestwebsoft' ); ?></a>
   557 														<?php }
   557 														<?php }
   558 													}
   558 													}
   559 												} else { ?>
   559 												} else { ?>
   560 													<a class="bws_donate" href="https://bestwebsoft.com/donate/" target="_blank"><?php _e( 'Donate', 'bestwebsoft' ); ?></a> <span>|</span>
   560                                                     <a class="bws_donate" href="https://bestwebsoft.com/donate/" target="_blank"><?php _e( 'Donate', 'bestwebsoft' ); ?></a> <span>|</span>
   561 												<?php }
   561 												<?php }
   562 
   562 
   563 												if ( $is_pro_active ) { ?>
   563 												if ( $is_pro_active ) { ?>
   564 													<a class="bws_settings" href="<?php echo esc_url( self_admin_url( $bws_plugins[ $key_plugin ]["pro_settings"] ) ); ?>"><?php _e( 'Settings', 'bestwebsoft' ); ?></a>
   564                                                     <a class="bws_settings" href="<?php echo esc_url( self_admin_url( $bws_plugins[ $key_plugin ]["pro_settings"] ) ); ?>"><?php _e( 'Settings', 'bestwebsoft' ); ?></a>
   565 												<?php } else { ?>
   565 												<?php } else { ?>
   566 													<a class="bws_settings" href="<?php echo esc_url( self_admin_url( $bws_plugins[ $key_plugin ]["settings"] ) ); ?>"><?php _e( 'Settings', 'bestwebsoft' ); ?></a>
   566                                                     <a class="bws_settings" href="<?php echo esc_url( self_admin_url( $bws_plugins[ $key_plugin ]["settings"] ) ); ?>"><?php _e( 'Settings', 'bestwebsoft' ); ?></a>
   567 												<?php }
   567 												<?php }
   568 											} else {
   568 											} else {
   569 												if ( $is_pro_installed ) { ?>
   569 												if ( $is_pro_installed ) { ?>
   570 													<a class="button button-secondary" href="<?php echo esc_url( wp_nonce_url( self_admin_url( $current_page . '&bws_activate_plugin=' . $value_plugin['pro_version'] ), 'bws_activate_plugin' . $value_plugin['pro_version'] ) ); ?>" title="<?php _e( 'Activate this plugin', 'bestwebsoft' ); ?>"><?php _e( 'Activate', 'bestwebsoft' ); ?></a>
   570                                                     <a class="button button-secondary" href="<?php echo esc_url( wp_nonce_url( self_admin_url( $current_page . '&bws_activate_plugin=' . $value_plugin['pro_version'] ), 'bws_activate_plugin' . $value_plugin['pro_version'] ) ); ?>" title="<?php _e( 'Activate this plugin', 'bestwebsoft' ); ?>"><?php _e( 'Activate', 'bestwebsoft' ); ?></a>
   571 												<?php } elseif ( ! empty( $plugins_array ) && isset( $value_plugin['pro_version'] ) && array_key_exists( $value_plugin['pro_version'], $plugins_array ) ) { ?>
   571 												<?php } elseif ( ! empty( $plugins_array ) && isset( $value_plugin['pro_version'] ) && array_key_exists( $value_plugin['pro_version'], $plugins_array ) ) { ?>
   572 													<form method="post" action="">
   572                                                     <form method="post" action="">
   573 														<input type="submit" class="button button-secondary" value="<?php _e( 'Install Now', 'bestwebsoft' ); ?>" />
   573                                                         <input type="submit" class="button button-secondary" value="<?php _e( 'Install Now', 'bestwebsoft' ); ?>" />
   574 														<input type="hidden" name="bws_plugin_action_submit" value="submit" />
   574                                                         <input type="hidden" name="bws_plugin_action_submit" value="submit" />
   575 														<input type="hidden" name="bws_install_plugin" value="<?php echo $value_plugin['pro_version']; ?>" />
   575                                                         <input type="hidden" name="bws_install_plugin" value="<?php echo $value_plugin['pro_version']; ?>" />
   576 														<?php wp_nonce_field( plugin_basename(__FILE__), 'bws_license_install_nonce_name' ); ?>
   576 														<?php wp_nonce_field( plugin_basename(__FILE__), 'bws_license_install_nonce_name' ); ?>
   577 													</form>
   577                                                     </form>
   578 												<?php } elseif ( $is_installed ) { ?>
   578 												<?php } elseif ( $is_installed ) { ?>
   579 													<a class="button button-secondary" href="<?php echo esc_url( wp_nonce_url( self_admin_url( $current_page . '&bws_activate_plugin=' . $key_plugin ), 'bws_activate_plugin' . $key_plugin ) ); ?>" title="<?php _e( 'Activate this plugin', 'bestwebsoft' ); ?>"><?php _e( 'Activate', 'bestwebsoft' ); ?></a>
   579                                                     <a class="button button-secondary" href="<?php echo esc_url( wp_nonce_url( self_admin_url( $current_page . '&bws_activate_plugin=' . $key_plugin ), 'bws_activate_plugin' . $key_plugin ) ); ?>" title="<?php _e( 'Activate this plugin', 'bestwebsoft' ); ?>"><?php _e( 'Activate', 'bestwebsoft' ); ?></a>
   580 												<?php } else {
   580 												<?php } else {
   581 													$install_url = isset( $value_plugin['install_url'] ) ? $value_plugin['install_url'] : self_admin_url( 'plugin-install.php?tab=search&type=term&s=' . str_replace( ' ', '+', str_replace( '-', '', $value_plugin['name'] ) ) . '+BestWebSoft&plugin-search-input=Search+Plugins' ); ?>
   581 													$install_url = isset( $value_plugin['install_url'] ) ? $value_plugin['install_url'] : self_admin_url( 'plugin-install.php?tab=search&type=term&s=' . str_replace( ' ', '+', str_replace( '-', '', $value_plugin['name'] ) ) . '+BestWebSoft&plugin-search-input=Search+Plugins' ); ?>
   582 													<a class="button button-secondary" href="<?php echo esc_url( $install_url ); ?>" title="<?php _e( 'Install this plugin', 'bestwebsoft' ); ?>" target="_blank"><?php _e( 'Install Now', 'bestwebsoft' ); ?></a>
   582                                                     <a class="button button-secondary" href="<?php echo esc_url( $install_url ); ?>" title="<?php _e( 'Install this plugin', 'bestwebsoft' ); ?>" target="_blank"><?php _e( 'Install Now', 'bestwebsoft' ); ?></a>
   583 												<?php }
   583 												<?php }
   584 											} ?>
   584 											} ?>
   585 										</div>
   585                                         </div>
   586 									</div>
   586                                     </div>
   587 									<div class="clear"></div>
   587                                     <div class="clear"></div>
   588 								</div>
   588                                 </div>
   589 							<?php }
   589 							<?php }
   590 							if ( $nothing_found ) { ?>
   590 							if ( $nothing_found ) { ?>
   591 								<p class="description"><?php _e( 'Nothing found. Try another criteria.', 'bestwebsoft' ); ?></p>
   591                                 <p class="description"><?php _e( 'Nothing found. Try another criteria.', 'bestwebsoft' ); ?></p>
   592 							<?php } ?>
   592 							<?php } ?>
   593 						</div>
   593                         </div>
   594 						<div id="bws-filter-wrapper">
   594                         <div id="bws-filter-wrapper">
   595 							<div class="bws-filter">
   595                             <div class="bws-filter">
   596 								<div class="bws-filter-title"><?php _e( 'Category', 'bestwebsoft' ); ?></div>
   596                                 <div class="bws-filter-title"><?php _e( 'Category', 'bestwebsoft' ); ?></div>
   597 								<ul class="bws-category">
   597                                 <ul class="bws-category">
   598 									<li>
   598                                     <li>
   599 										<?php $sub_in_url = ( isset( $_GET['sub'] ) && in_array( $_GET['sub'], array( 'installed', 'not_installed' ) ) ) ? '&sub=' . $_GET['sub'] : ''; ?>
   599 										<?php $sub_in_url = ( isset( $_GET['sub'] ) && in_array( $_GET['sub'], array( 'installed', 'not_installed' ) ) ) ? '&sub=' . $_GET['sub'] : ''; ?>
   600 										<a <?php if ( 'all' == $plugin_category ) echo ' class="bws-active"'; ?> href="<?php echo esc_url( self_admin_url( $current_page . $sub_in_url ) ); ?>"><?php _e( 'All', 'bestwebsoft' ); ?>
   600                                         <a <?php if ( 'all' == $plugin_category ) echo ' class="bws-active"'; ?> href="<?php echo esc_url( self_admin_url( $current_page . $sub_in_url ) ); ?>"><?php _e( 'All', 'bestwebsoft' ); ?>
   601 											<span>(<?php echo count( $bws_plugins ); ?>)</span>
   601                                             <span>(<?php echo count( $bws_plugins ); ?>)</span>
   602 										</a>
   602                                         </a>
   603 									</li>
   603                                     </li>
   604 									<?php foreach ( $bws_plugins_category as $category_key => $category_value ) { ?>
   604 									<?php foreach ( $bws_plugins_category as $category_key => $category_value ) { ?>
   605 										<li>
   605                                         <li>
   606 											<a <?php if ( $category_key == $plugin_category ) echo ' class="bws-active"'; ?> href="<?php echo esc_url( self_admin_url( $current_page . $sub_in_url . '&category=' . $category_key ) ); ?>"><?php echo $category_value['name']; ?>
   606                                             <a <?php if ( $category_key == $plugin_category ) echo ' class="bws-active"'; ?> href="<?php echo esc_url( self_admin_url( $current_page . $sub_in_url . '&category=' . $category_key ) ); ?>"><?php echo $category_value['name']; ?>
   607 												<span>(<?php echo $category_value['count']; ?>)</span>
   607                                                 <span>(<?php echo $category_value['count']; ?>)</span>
   608 											</a>
   608                                             </a>
   609 										</li>
   609                                         </li>
   610 									<?php } ?>
   610 									<?php } ?>
   611 								</ul>
   611                                 </ul>
   612 							</div>
   612                             </div>
   613 						</div><!-- #bws-filter-wrapper -->
   613                         </div><!-- #bws-filter-wrapper -->
   614 						<div class="clear"></div>
   614                         <div class="clear"></div>
   615 					<?php }
   615 					<?php }
   616 				} elseif ( 'bws_themes' == $page || 'themes' == $tab ) {
   616 				} elseif ( 'bws_themes' == $page || 'themes' == $tab ) {
   617 					require( dirname( __FILE__ ) . '/product_list.php' ); ?>
   617 					require( dirname( __FILE__ ) . '/product_list.php' ); ?>
   618 					<h1><?php _e( 'Themes', 'bestwebsoft' ); ?></h1>
   618                     <h1><?php _e( 'Themes', 'bestwebsoft' ); ?></h1>
   619 					<div id="availablethemes" class="bws-availablethemes">
   619                     <div id="availablethemes" class="bws-availablethemes">
   620 						<div class="theme-browser content-filterable rendered">
   620                         <div class="theme-browser content-filterable rendered">
   621 							<div class="themes wp-clearfix">
   621                             <div class="themes wp-clearfix">
   622 								<?php foreach ( $themes as $key => $theme ) {
   622 								<?php foreach ( $themes as $key => $theme ) {
   623 									$installed_theme = wp_get_theme( $theme->slug ); ?>
   623 									$installed_theme = wp_get_theme( $theme->slug ); ?>
   624 									<div class="theme" tabindex="0">
   624                                     <div class="theme" tabindex="0">
   625 										<div class="theme-screenshot">
   625                                         <div class="theme-screenshot">
   626 											<img src="<?php echo bws_menu_url( "icons/themes/" ) . $theme->slug . '.png'; ?>" alt="" />
   626                                             <img src="<?php echo bws_menu_url( "icons/themes/" ) . $theme->slug . '.png'; ?>" alt="" />
   627 										</div>
   627                                         </div>
   628 										<div class="theme-author"><?php printf( __( 'By %s', 'bestwebsoft' ), 'BestWebSoft' ); ?></div>
   628                                         <div class="theme-author"><?php printf( __( 'By %s', 'bestwebsoft' ), 'BestWebSoft' ); ?></div>
   629 										<h3 class="theme-name"><?php echo $theme->name; ?></h3>
   629                                         <h3 class="theme-name"><?php echo $theme->name; ?></h3>
   630 										<div class="theme-actions">
   630                                         <div class="theme-actions">
   631 											<a class="button button-secondary preview install-theme-preview" href="<?php echo esc_url( $theme->href ); ?>" target="_blank"><?php _e( 'Learn More', 'bestwebsoft' ); ?></a>
   631                                             <a class="button button-secondary preview install-theme-preview" href="<?php echo esc_url( $theme->href ); ?>" target="_blank"><?php _e( 'Learn More', 'bestwebsoft' ); ?></a>
   632 										</div>
   632                                         </div>
   633 										<?php if ( $installed_theme->exists() ) {
   633 										<?php if ( $installed_theme->exists() ) {
   634 											if ( $wp_version < '4.6' ) { ?>
   634 											if ( $wp_version < '4.6' ) { ?>
   635 												<div class="theme-installed"><?php _e( 'Already Installed', 'bestwebsoft' ); ?></div>
   635                                                 <div class="theme-installed"><?php _e( 'Already Installed', 'bestwebsoft' ); ?></div>
   636 											<?php } else { ?>
   636 											<?php } else { ?>
   637 												<div class="notice notice-success notice-alt inline"><p><?php _e( 'Installed', 'bestwebsoft' ); ?></p></div>
   637                                                 <div class="notice notice-success notice-alt inline"><p><?php _e( 'Installed', 'bestwebsoft' ); ?></p></div>
   638 											<?php }
   638 											<?php }
   639 										} ?>
   639 										} ?>
   640 									</div>
   640                                     </div>
   641 								<?php } ?>
   641 								<?php } ?>
   642 								<br class="clear" />
   642                                 <br class="clear" />
   643 							</div>
   643                             </div>
   644 						</div>
   644                         </div>
   645 						<p><a class="bws_browse_link" href="https://bestwebsoft.com/products/wordpress/themes/" target="_blank"><?php _e( 'Browse More WordPress Themes', 'bestwebsoft' ); ?> <span class="dashicons dashicons-arrow-right-alt2"></span></a></p>
   645                         <p><a class="bws_browse_link" href="https://bestwebsoft.com/products/wordpress/themes/" target="_blank"><?php _e( 'Browse More WordPress Themes', 'bestwebsoft' ); ?> <span class="dashicons dashicons-arrow-right-alt2"></span></a></p>
   646 					</div>
   646                     </div>
   647 				<?php } elseif ( 'bws_system_status' == $page || 'system-status' == $tab ) { ?>
   647 				<?php } elseif ( 'bws_system_status' == $page || 'system-status' == $tab ) { ?>
   648 					<h1><?php _e( 'System status', 'bestwebsoft' ); ?></h1>
   648                     <h1><?php _e( 'System status', 'bestwebsoft' ); ?></h1>
   649 					<div class="updated fade notice is-dismissible inline" <?php if ( ! ( isset( $_REQUEST['bwsmn_form_submit'] ) || isset( $_REQUEST['bwsmn_form_submit_custom_email'] ) ) || $error != "" ) echo 'style="display:none"'; ?>><p><strong><?php echo $message; ?></strong></p></div>
   649                     <div class="updated fade notice is-dismissible inline" <?php if ( ! ( isset( $_REQUEST['bwsmn_form_submit'] ) || isset( $_REQUEST['bwsmn_form_submit_custom_email'] ) ) || $error != "" ) echo 'style="display:none"'; ?>><p><strong><?php echo $message; ?></strong></p></div>
   650 					<div class="error" <?php if ( "" == $error ) echo 'style="display:none"'; ?>><p><strong><?php echo $error; ?></strong></p></div>
   650                     <div class="error" <?php if ( "" == $error ) echo 'style="display:none"'; ?>><p><strong><?php echo $error; ?></strong></p></div>
   651 					<form method="post" action="">
   651                     <form method="post" action="">
   652 						<p>
   652                         <p>
   653 							<input type="hidden" name="bwsmn_form_submit" value="submit" />
   653                             <input type="hidden" name="bwsmn_form_submit" value="submit" />
   654 							<input type="submit" class="button-primary" value="<?php _e( 'Send to support', 'bestwebsoft' ) ?>" />
   654                             <input type="submit" class="button-primary" value="<?php _e( 'Send to support', 'bestwebsoft' ) ?>" />
   655 							<?php wp_nonce_field( plugin_basename(__FILE__), 'bwsmn_nonce_submit' ); ?>
   655 							<?php wp_nonce_field( plugin_basename(__FILE__), 'bwsmn_nonce_submit' ); ?>
   656 						</p>
   656                         </p>
   657 					</form>
   657                     </form>
   658 					<form method="post" action="">
   658                     <form method="post" action="">
   659 						<p>
   659                         <p>
   660 							<input type="hidden" name="bwsmn_form_submit_custom_email" value="submit" />
   660                             <input type="hidden" name="bwsmn_form_submit_custom_email" value="submit" />
   661 							<input type="submit" class="button" value="<?php _e( 'Send to custom email &#187;', 'bestwebsoft' ) ?>" />
   661                             <input type="submit" class="button" value="<?php _e( 'Send to custom email &#187;', 'bestwebsoft' ) ?>" />
   662 							<input type="text" maxlength="250" value="" name="bwsmn_form_email" />
   662                             <input type="text" maxlength="250" value="" name="bwsmn_form_email" />
   663 							<?php wp_nonce_field( plugin_basename(__FILE__), 'bwsmn_nonce_submit_custom_email' ); ?>
   663 							<?php wp_nonce_field( plugin_basename(__FILE__), 'bwsmn_nonce_submit_custom_email' ); ?>
   664 						</p>
   664                         </p>
   665 					</form>
   665                     </form>
   666 					<?php foreach ( $system_info as $info ) { ?>
   666 					<?php foreach ( $system_info as $info ) { ?>
   667 						<table class="widefat bws-system-info" cellspacing="0">
   667                         <table class="widefat bws-system-info" cellspacing="0">
   668 							<thead>
   668                             <thead>
   669 								<tr>
   669                             <tr>
   670 									<th colspan="2">
   670                                 <th colspan="2">
   671 										<strong>
   671                                     <strong>
   672 											<?php echo $info['name'];
   672 										<?php echo $info['name'];
   673 											if ( isset( $info['count'] ) )
   673 										if ( isset( $info['count'] ) )
   674 												echo ' (' . $info['count'] . ')'; ?>
   674 											echo ' (' . $info['count'] . ')'; ?>
   675 										</strong>
   675                                     </strong>
   676 									</th>
   676                                 </th>
   677 								</tr>
   677                             </tr>
   678 							</thead>
   678                             </thead>
   679 							<tbody>
   679                             <tbody>
   680 								<?php foreach ( $info['data'] as $key => $value ) { ?>
   680 							<?php foreach ( $info['data'] as $key => $value ) { ?>
   681 									<tr>
   681                                 <tr>
   682 										<td scope="row"><?php echo $key; ?></td>
   682                                     <td scope="row"><?php echo $key; ?></td>
   683 										<td scope="row"><?php echo $value; ?></td>
   683                                     <td scope="row"><?php echo $value; ?></td>
   684 									</tr>
   684                                 </tr>
   685 								<?php } ?>
   685 							<?php } ?>
   686 							</tbody>
   686                             </tbody>
   687 						</table>
   687                         </table>
   688 					<?php }
   688 					<?php }
   689 				} ?>
   689 				} ?>
   690 			</div>
   690             </div>
   691 		</div>
   691         </div>
   692 	<?php }
   692 	<?php }
   693 }
   693 }
   694 
   694 
   695 if ( ! function_exists( 'bws_get_banner_array' ) ) {
   695 if ( ! function_exists( 'bws_get_banner_array' ) ) {
   696 	function bws_get_banner_array() {
   696 	function bws_get_banner_array() {
   727 			array( 'pdfprnt_hide_banner_on_plugin_page', 'pdf-print/pdf-print.php', '1.7.1' ),
   727 			array( 'pdfprnt_hide_banner_on_plugin_page', 'pdf-print/pdf-print.php', '1.7.1' ),
   728 			array( 'gglplsn_hide_banner_on_plugin_page', 'google-one/google-plus-one.php', '1.1.4' ),
   728 			array( 'gglplsn_hide_banner_on_plugin_page', 'google-one/google-plus-one.php', '1.1.4' ),
   729 			array( 'gglstmp_hide_banner_on_plugin_page', 'google-sitemap-plugin/google-sitemap-plugin.php', '2.8.4' ),
   729 			array( 'gglstmp_hide_banner_on_plugin_page', 'google-sitemap-plugin/google-sitemap-plugin.php', '2.8.4' ),
   730 			array( 'cntctfrmpr_for_ctfrmtdb_hide_banner_on_plugin_page', 'contact-form-pro/contact_form_pro.php', '1.14' ),
   730 			array( 'cntctfrmpr_for_ctfrmtdb_hide_banner_on_plugin_page', 'contact-form-pro/contact_form_pro.php', '1.14' ),
   731 			array( 'cntctfrm_hide_banner_on_plugin_page', 'contact-form-plugin/contact_form.php', '3.47' ),
   731 			array( 'cntctfrm_hide_banner_on_plugin_page', 'contact-form-plugin/contact_form.php', '3.47' ),
   732 			array( 'cptch_hide_banner_on_plugin_page', 'captcha/captcha.php', '3.8.4' ),
   732 			array( 'cptch_hide_banner_on_plugin_page', 'captcha-bws/captcha-bws.php', '3.8.4' ),
   733 			array( 'gllr_hide_banner_on_plugin_page', 'gallery-plugin/gallery-plugin.php', '3.9.1' ),
   733 			array( 'gllr_hide_banner_on_plugin_page', 'gallery-plugin/gallery-plugin.php', '3.9.1' ),
   734 			array( 'cntctfrm_for_ctfrmtdb_hide_banner_on_plugin_page', 'contact-form-plugin/contact_form.php', '3.62' )
   734 			array( 'cntctfrm_for_ctfrmtdb_hide_banner_on_plugin_page', 'contact-form-plugin/contact_form.php', '3.62' ),
       
   735             array( 'bwscrrntl_hide_banner_on_plugin_page', 'bws-car-rental/bws-car-rental.php', '0.0.1' ),
       
   736 			array( 'rtng_hide_banner_on_plugin_page', 'rating-bws/rating-bws.php', '1.0.0' ),
       
   737 			array( 'prflxtrflds_hide_banner_on_plugin_page', 'profile-extra-fields/profile-extra-fields.php', '1.1.3' ),
       
   738 			array( 'psttcsv_hide_banner_on_plugin_page', 'post-to-csv/post-to-csv.php', '1.3.4' ),
       
   739 			array( 'cstmdmnpg_hide_banner_on_plugin_page', 'custom-admin-page/custom-admin-page.php', '1.0.0' )
   735 		);
   740 		);
   736 	}
   741 	}
   737 }
   742 }