bws_add_menu_render

The Google Captcha (reCAPTCHA) by BestWebSoft bws add menu render function.

Description

bws_add_menu_render(); 

Usage

  1. if ( !function_exists( 'bws_add_menu_render' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'google-captcha-recaptcha-by-bestwebsoft/bws_menu/bws_menu.php'; 
  3.  
  4.  
  5. // NOTICE! Understand what this does before running. 
  6. $result = bws_add_menu_render(); 
  7.  

Defined (1)

The function is defined in the following location(s).

/bws_menu/bws_menu.php  
  1. function bws_add_menu_render() { 
  2. global $wpdb, $wp_version, $bws_plugin_info, $bstwbsftwppdtplgns_options; 
  3. $error = $message = $bwsmn_form_email = ''; 
  4.  
  5. /** 
  6. * @deprecated 1.9.8 (15.12.2016) 
  7. */ 
  8. $is_main_page = in_array( $_GET['page'], array( 'bws_panel', 'bws_themes', 'bws_system_status' ) ); 
  9. $page = esc_attr( $_GET['page'] ); 
  10. $tab = isset( $_GET['tab'] ) ? esc_attr( $_GET['tab'] ) : ''; 
  11.  
  12. if ( $is_main_page ) 
  13. $current_page = 'admin.php?page=' . $page; 
  14. else 
  15. $current_page = isset( $_GET['tab'] ) ? 'admin.php?page=' . $page . '&tab=' . $tab : 'admin.php?page=' . $page; 
  16.  
  17. if ( 'bws_panel' == $page || ( ! $is_main_page && '' == $tab ) ) { 
  18.  
  19. if ( ! function_exists( 'is_plugin_active_for_network' ) ) 
  20. require_once( ABSPATH . 'wp-admin/includes/plugin.php' ); 
  21.  
  22. /** get $bws_plugins */ 
  23. require( dirname( __FILE__ ) . '/product_list.php' ); 
  24.  
  25. $all_plugins = get_plugins(); 
  26. $active_plugins = get_option( 'active_plugins' ); 
  27. $sitewide_active_plugins = ( function_exists( 'is_multisite' ) && is_multisite() ) ? get_site_option( 'active_sitewide_plugins' ) : array(); 
  28. $update_availible_all = get_site_transient( 'update_plugins' ); 
  29.  
  30. $plugin_category = isset( $_GET['category'] ) ? esc_html( $_GET['category'] ) : 'all'; 
  31.  
  32. if ( ( isset( $_GET['sub'] ) && 'installed' == $_GET['sub'] ) || ! isset( $_GET['sub'] ) ) { 
  33. $bws_plugins_update_availible = $bws_plugins_expired = array(); 
  34. foreach ( $bws_plugins as $key_plugin => $value_plugin ) { 
  35.  
  36. foreach ( $value_plugin['category'] as $category_key ) { 
  37. $bws_plugins_category[ $category_key ]['count'] = isset( $bws_plugins_category[ $category_key ]['count'] ) ? $bws_plugins_category[ $category_key ]['count'] + 1 : 1; 
  38.  
  39. $is_installed = array_key_exists( $key_plugin, $all_plugins ); 
  40. $is_pro_installed = false; 
  41. if ( isset( $value_plugin['pro_version'] ) ) { 
  42. $is_pro_installed = array_key_exists( $value_plugin['pro_version'], $all_plugins ); 
  43. /** check update_availible */ 
  44. if ( ! empty( $update_availible_all ) && ! empty( $update_availible_all->response ) ) { 
  45. if ( $is_pro_installed && array_key_exists( $value_plugin['pro_version'], $update_availible_all->response ) ) { 
  46. unset( $bws_plugins[ $key_plugin ] ); 
  47. $value_plugin['update_availible'] = $value_plugin['pro_version']; 
  48. $bws_plugins_update_availible[ $key_plugin ] = $value_plugin; 
  49. } else if ( $is_installed && array_key_exists( $key_plugin, $update_availible_all->response ) ) { 
  50. unset( $bws_plugins[ $key_plugin ] ); 
  51. $value_plugin['update_availible'] = $key_plugin; 
  52. $bws_plugins_update_availible[ $key_plugin ] = $value_plugin; 
  53. /** check expired */ 
  54. if ( $is_pro_installed && isset( $bstwbsftwppdtplgns_options['time_out'][ $value_plugin['pro_version'] ] ) && 
  55. strtotime( $bstwbsftwppdtplgns_options['time_out'][ $value_plugin['pro_version'] ] ) < strtotime( date( "m/d/Y" ) ) ) { 
  56. unset( $bws_plugins[ $key_plugin ] ); 
  57. $value_plugin['expired'] = $bstwbsftwppdtplgns_options['time_out'][ $value_plugin['pro_version'] ]; 
  58. $bws_plugins_expired[ $key_plugin ] = $value_plugin; 
  59. $bws_plugins = $bws_plugins_update_availible + $bws_plugins_expired + $bws_plugins; 
  60. } else { 
  61. foreach ( $bws_plugins as $key_plugin => $value_plugin ) { 
  62. foreach ( $value_plugin['category'] as $category_key ) { 
  63. $bws_plugins_category[ $category_key ]['count'] = isset( $bws_plugins_category[ $category_key ]['count'] ) ? $bws_plugins_category[ $category_key ]['count'] + 1 : 1; 
  64.  
  65. /*** membership ***/ 
  66. $bws_license_plugin = 'bws_get_list_for_membership'; 
  67. $bws_license_key = isset( $bstwbsftwppdtplgns_options[ $bws_license_plugin ] ) ? $bstwbsftwppdtplgns_options[ $bws_license_plugin ] : ''; 
  68. $update_membership_list = true; 
  69.  
  70. if ( isset( $_POST['bws_license_key'] ) ) 
  71. $bws_license_key = stripslashes( esc_html( trim( $_POST['bws_license_key'] ) ) ); 
  72.  
  73. if ( isset( $_SESSION['bws_membership_time_check'] ) && isset( $_SESSION['bws_membership_list'] ) && $_SESSION['bws_membership_time_check'] < strtotime( '+12 hours' ) ) { 
  74. $update_membership_list = false; 
  75. $plugins_array = $_SESSION['bws_membership_list']; 
  76.  
  77. if ( ( $update_membership_list && ! empty( $bws_license_key ) ) || ( isset( $_POST['bws_license_submit'] ) && check_admin_referer( plugin_basename(__FILE__), 'bws_license_nonce_name' ) ) ) { 
  78.  
  79. if ( '' != $bws_license_key ) { 
  80. if ( strlen( $bws_license_key ) != 18 ) { 
  81. $error = __( 'Wrong license key', 'bestwebsoft' ); 
  82. } else { 
  83.  
  84. if ( isset( $bstwbsftwppdtplgns_options['go_pro'][ $bws_license_plugin ]['count'] ) && $bstwbsftwppdtplgns_options['go_pro'][ $bws_license_plugin ]['time'] > ( time() - (24 * 60 * 60) ) ) { 
  85. $bstwbsftwppdtplgns_options['go_pro'][ $bws_license_plugin ]['count'] = $bstwbsftwppdtplgns_options['go_pro'][ $bws_license_plugin ]['count'] + 1; 
  86. } else { 
  87. $bstwbsftwppdtplgns_options['go_pro'][ $bws_license_plugin ]['count'] = 1; 
  88. $bstwbsftwppdtplgns_options['go_pro'][ $bws_license_plugin ]['time'] = time(); 
  89.  
  90. /** get Pro list */ 
  91. $to_send = array(); 
  92. $to_send["plugins"][ $bws_license_plugin ] = array(); 
  93. $to_send["plugins"][ $bws_license_plugin ]["bws_license_key"] = $bws_license_key; 
  94. $options = array( 
  95. 'timeout' => ( ( defined('DOING_CRON') && DOING_CRON ) ? 30 : 3 ),  
  96. 'body' => array( 'plugins' => serialize( $to_send ) ),  
  97. 'user-agent' => 'WordPress/' . $wp_version . '; ' . get_bloginfo( 'url' ) ); 
  98. $raw_response = wp_remote_post( 'http://bestwebsoft.com/wp-content/plugins/paid-products/plugins/update-check/1.0/', $options ); 
  99.  
  100. if ( is_wp_error( $raw_response ) || 200 != wp_remote_retrieve_response_code( $raw_response ) ) { 
  101. $error = __( "Something went wrong. Please try again later. If theerrorappears again, please contact us", 'bestwebsoft' ) . ' <a href="https://support.bestwebsoft.com">BestWebSoft</a>. ' . __( "We are sorry for inconvenience.", 'bestwebsoft' ); 
  102. } else { 
  103. $response = maybe_unserialize( wp_remote_retrieve_body( $raw_response ) ); 
  104. if ( is_array( $response ) && !empty( $response ) ) { 
  105. foreach ( $response as $key => $value ) { 
  106. if ( "wrong_license_key" == $value->package ) { 
  107. $error = __( "Wrong license key.", 'bestwebsoft' ); 
  108. } elseif ( "wrong_domain" == $value->package ) { 
  109. $error = __( 'This license key is bound to another site. Change it via personal Client Area.', 'bestwebsoft' ) . '<a target="_blank" href="https://bestwebsoft.com/client-area">' . __( 'Log in', 'bestwebsoft' ) . '</a>'; 
  110. } elseif ( "you_are_banned" == $value->package ) { 
  111. $error = __( "Unfortunately, you have exceeded the number of available tries per day.", 'bestwebsoft' ); 
  112. } elseif ( "time_out" == $value->package ) { 
  113. $error = sprintf( __( "Unfortunately, Your license has expired. To continue getting top-priority support and plugin updates, you should extend it in your %s", 'bestwebsoft' ), ' <a href="https://bestwebsoft.com/client-area">Client Area</a>' ); 
  114. } elseif ( "duplicate_domen_for_trial" == $value->package ) { 
  115. $error = __( "Unfortunately, the Pro licence was already installed to this domain. The Pro Trial license can be installed only once.", 'bestwebsoft' ); 
  116. } elseif ( is_array( $value->package ) && ! empty( $value->package ) ) { 
  117. $plugins_array = $_SESSION['bws_membership_list'] = $value->package; 
  118. $_SESSION['bws_membership_time_check'] = strtotime( 'now' ); 
  119.  
  120. if ( isset( $bstwbsftwppdtplgns_options[ $bws_license_plugin ] ) && $bws_license_key == $bstwbsftwppdtplgns_options[ $bws_license_plugin ] ) { 
  121. $message = __( 'The license key is valid.', 'bestwebsoft' ); 
  122. if ( isset( $value->time_out ) && $value->time_out != '' ) 
  123. $message .= ' ' . __( 'Your license will expire on', 'bestwebsoft' ) . ' ' . $value->time_out . '.'; 
  124. } else { 
  125. $message = __( 'Congratulations! Pro Membership license is activated successfully.', 'bestwebsoft' ); 
  126.  
  127. $bstwbsftwppdtplgns_options[ $bws_license_plugin ] = $bws_license_key; 
  128. } else { 
  129. $error = __( "Something went wrong. Try again later or upload the plugin manually. We are sorry for inconvenience.", 'bestwebsoft' ); 
  130.  
  131. if ( is_multisite() ) 
  132. update_site_option( 'bstwbsftwppdtplgns_options', $bstwbsftwppdtplgns_options ); 
  133. else 
  134. update_option( 'bstwbsftwppdtplgns_options', $bstwbsftwppdtplgns_options ); 
  135. } else { 
  136. $error = __( "Please enter your license key.", 'bestwebsoft' ); 
  137. } elseif ( 'bws_system_status' == $page || 'system-status' == $tab ) { 
  138.  
  139. $all_plugins = get_plugins(); 
  140. $active_plugins = get_option( 'active_plugins' ); 
  141. $mysql_info = $wpdb->get_results( "SHOW VARIABLES LIKE 'sql_mode'" ); 
  142. if ( is_array( $mysql_info ) ) 
  143. $sql_mode = $mysql_info[0]->Value; 
  144. if ( empty( $sql_mode ) ) 
  145. $sql_mode = __( 'Not set', 'bestwebsoft' ); 
  146.  
  147. $allow_url_fopen = ( ini_get( 'allow_url_fopen' ) ) ? __( 'On', 'bestwebsoft' ) : __( 'Off', 'bestwebsoft' ); 
  148. $upload_max_filesize = ( ini_get( 'upload_max_filesize' ) )? ini_get( 'upload_max_filesize' ) : __( 'N/A', 'bestwebsoft' ); 
  149. $post_max_size = ( ini_get( 'post_max_size' ) ) ? ini_get( 'post_max_size' ) : __( 'N/A', 'bestwebsoft' ); 
  150. $max_execution_time = ( ini_get( 'max_execution_time' ) ) ? ini_get( 'max_execution_time' ) : __( 'N/A', 'bestwebsoft' ); 
  151. $memory_limit = ( ini_get( 'memory_limit' ) ) ? ini_get( 'memory_limit' ) : __( 'N/A', 'bestwebsoft' ); 
  152. $wp_memory_limit = ( defined( 'WP_MEMORY_LIMIT' ) ) ? WP_MEMORY_LIMIT : __( 'N/A', 'bestwebsoft' );  
  153. $memory_usage = ( function_exists( 'memory_get_usage' ) ) ? round( memory_get_usage() / 1024 / 1024, 2 ) . __( ' Mb', 'bestwebsoft' ) : __( 'N/A', 'bestwebsoft' ); 
  154. $exif_read_data = ( is_callable( 'exif_read_data' ) ) ? __( 'Yes', 'bestwebsoft' ) . " ( V" . substr( phpversion( 'exif' ), 0, 4 ) . ")" : __( 'No', 'bestwebsoft' ); 
  155. $iptcparse = ( is_callable( 'iptcparse' ) ) ? __( 'Yes', 'bestwebsoft' ) : __( 'No', 'bestwebsoft' ); 
  156. $xml_parser_create = ( is_callable( 'xml_parser_create' ) ) ? __( 'Yes', 'bestwebsoft' ) : __( 'No', 'bestwebsoft' ); 
  157. $theme = ( function_exists( 'wp_get_theme' ) ) ? wp_get_theme() : get_theme( get_current_theme() ); 
  158.  
  159. if ( function_exists( 'is_multisite' ) ) { 
  160. $multisite = is_multisite() ? __( 'Yes', 'bestwebsoft' ) : __( 'No', 'bestwebsoft' ); 
  161. } else { 
  162. $multisite = __( 'N/A', 'bestwebsoft' ); 
  163.  
  164. $system_info = array( 
  165. 'wp_environment' => array( 
  166. 'name' => __( 'WordPress Environment', 'bestwebsoft' ),  
  167. 'data' => array( 
  168. __( 'Home URL', 'bestwebsoft' ) => home_url(),  
  169. __( 'Website URL', 'bestwebsoft' ) => get_option( 'siteurl' ),  
  170. __( 'WP Version', 'bestwebsoft' ) => $wp_version,  
  171. __( 'WP Multisite', 'bestwebsoft' ) => $multisite,  
  172. __( 'WP Memory Limit', 'bestwebsoft' ) => $wp_memory_limit,  
  173. __( 'Active Theme', 'bestwebsoft' ) => $theme['Name'] . ' ' . $theme['Version'] . ' (' . sprintf( __( 'by %s', 'bestwebsoft' ), $theme['Author'] ) . ')' 
  174. ),  
  175. ),  
  176. 'server_environment' => array( 
  177. 'name' => __( 'Server Environment', 'bestwebsoft' ),  
  178. 'data' => array( 
  179. __( 'Operating System', 'bestwebsoft' ) => PHP_OS,  
  180. __( 'Server', 'bestwebsoft' ) => $_SERVER["SERVER_SOFTWARE"],  
  181. __( 'PHP Version', 'bestwebsoft' ) => PHP_VERSION,  
  182. __( 'PHP Allow URL fopen', 'bestwebsoft' ) => $allow_url_fopen,  
  183. __( 'PHP Memory Limit', 'bestwebsoft' ) => $memory_limit,  
  184. __( 'Memory Usage', 'bestwebsoft' ) => $memory_usage,  
  185. __( 'PHP Max Upload Size', 'bestwebsoft' ) => $upload_max_filesize,  
  186. __( 'PHP Max Post Size', 'bestwebsoft' ) => $post_max_size,  
  187. __( 'PHP Max Script Execute Time', 'bestwebsoft' ) => $max_execution_time,  
  188. __( 'PHP Exif support', 'bestwebsoft' ) => $exif_read_data,  
  189. __( 'PHP IPTC support', 'bestwebsoft' ) => $iptcparse,  
  190. __( 'PHP XML support', 'bestwebsoft' ) => $xml_parser_create,  
  191. '$_SERVER[HTTP_HOST]' => $_SERVER['HTTP_HOST'],  
  192. '$_SERVER[SERVER_NAME]' => $_SERVER['SERVER_NAME'],  
  193. ),  
  194. ),  
  195. 'db' => array( 
  196. 'name' => __( 'Database', 'bestwebsoft' ),  
  197. 'data' => array( 
  198. __( 'WP DB version', 'bestwebsoft' ) => get_option( 'db_version' ),  
  199. __( 'MySQL version', 'bestwebsoft' ) => $wpdb->get_var( "SELECT VERSION() AS version" ),  
  200. __( 'SQL Mode', 'bestwebsoft' ) => $sql_mode,  
  201. ),  
  202. ),  
  203. 'active_plugins' => array( 
  204. 'name' => __( 'Active Plugins', 'bestwebsoft' ),  
  205. 'data' => array(),  
  206. 'count' => 0 
  207. ),  
  208. 'inactive_plugins' => array( 
  209. 'name' => __( 'Inactive Plugins', 'bestwebsoft' ),  
  210. 'data' => array(),  
  211. 'count' => 0 
  212. ); 
  213.  
  214. foreach ( $all_plugins as $path => $plugin ) { 
  215. $name = str_replace( 'by BestWebSoft', '', $plugin['Name'] ); 
  216. if ( is_plugin_active( $path ) ) { 
  217. $system_info['active_plugins']['data'][ $name ] = sprintf( __( 'by %s', 'bestwebsoft' ), $plugin['Author'] ) . ' - ' . $plugin['Version']; 
  218. $system_info['active_plugins']['count'] = $system_info['active_plugins']['count'] + 1; 
  219. } else { 
  220. $system_info['inactive_plugins']['data'][ $name ] = sprintf( __( 'by %s', 'bestwebsoft' ), $plugin['Author'] ) . ' - ' . $plugin['Version']; 
  221. $system_info['inactive_plugins']['count'] = $system_info['inactive_plugins']['count'] + 1; 
  222.  
  223. if ( ( isset( $_REQUEST['bwsmn_form_submit'] ) && check_admin_referer( plugin_basename(__FILE__), 'bwsmn_nonce_submit' ) ) || ( isset( $_REQUEST['bwsmn_form_submit_custom_email'] ) && check_admin_referer( plugin_basename(__FILE__), 'bwsmn_nonce_submit_custom_email' ) ) ) { 
  224. if ( isset( $_REQUEST['bwsmn_form_email'] ) ) { 
  225. $bwsmn_form_email = esc_html( trim( $_REQUEST['bwsmn_form_email'] ) ); 
  226. if ( $bwsmn_form_email == "" || ! is_email( $bwsmn_form_email ) ) { 
  227. $error = __( "Please enter a valid email address.", 'bestwebsoft' ); 
  228. } else { 
  229. $email = $bwsmn_form_email; 
  230. $bwsmn_form_email = ''; 
  231. $message = __( 'Email with system info is sent to', 'bestwebsoft' ) . ' ' . $email; 
  232. } else { 
  233. $email = 'plugin_system_status@bestwebsoft.com'; 
  234. $message = __( 'Thank you for contacting us.', 'bestwebsoft' ); 
  235.  
  236. if ( $error == '' ) { 
  237. $headers = 'MIME-Version: 1.0' . "\n"; 
  238. $headers .= 'Content-type: text/html; charset=utf-8' . "\n"; 
  239. $headers .= 'From: ' . get_option( 'admin_email' ); 
  240. $message_text = '<html><head><title>System Info From ' . home_url() . '</title></head><body>'; 
  241. foreach ( $system_info as $info ) {  
  242. if ( ! empty( $info['data'] ) ) {  
  243. $message_text .= '<h4>' . $info['name']; 
  244. if ( isset( $info['count'] ) ) 
  245. $message_text .= ' (' . $info['count'] . ')'; 
  246. $message_text .= '</h4><table>'; 
  247. foreach ( $info['data'] as $key => $value ) { 
  248. $message_text .= '<tr><td>'. $key .'</td><td>'. $value .'</td></tr>'; 
  249. $message_text .= '</table>'; 
  250. $message_text .= '</body></html>'; 
  251. $result = wp_mail( $email, 'System Info From ' . home_url(), $message_text, $headers ); 
  252. if ( $result != true ) 
  253. $error = __( "Sorry, email message could not be delivered.", 'bestwebsoft' ); 
  254. } ?> 
  255. <div class="bws-wrap"> 
  256. <div class="bws-header"> 
  257. <div class="bws-title"> 
  258. <a href="<?php echo ( $is_main_page ) ? self_admin_url( 'admin.php?page=bws_panel' ) : self_admin_url( 'admin.php?page=' . $page ); ?>"> 
  259. <span class="bws-logo bwsicons bwsicons-bws-logo"></span> 
  260. BestWebSoft 
  261. <span>panel</span> 
  262. </a> 
  263. </div> 
  264. <div class="bws-menu-item-icon">•••</div>  
  265. <div class="bws-nav-tab-wrapper"> 
  266. <?php if ( $is_main_page ) { ?> 
  267. <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> 
  268. <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> 
  269. <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> 
  270. <?php } else { ?> 
  271. <a class="bws-nav-tab<?php if ( ! isset( $_GET['tab'] ) ) echo ' bws-nav-tab-active'; ?>" href="<?php echo self_admin_url( 'admin.php?page=' . $page ); ?>"><?php _e( 'Plugins', 'bestwebsoft' ); ?></a> 
  272. <a class="bws-nav-tab<?php if ( 'themes' == $tab ) echo ' bws-nav-tab-active'; ?>" href="<?php echo self_admin_url( 'admin.php?page=' . $page . '&tab=themes' ); ?>"><?php _e( 'Themes', 'bestwebsoft' ); ?></a> 
  273. <a class="bws-nav-tab<?php if ( 'system-status' == $tab ) echo ' bws-nav-tab-active'; ?>" href="<?php echo self_admin_url( 'admin.php?page=' . $page . '&tab=system-status' ); ?>"><?php _e( 'System status', 'bestwebsoft' ); ?></a> 
  274. <?php } ?> 
  275. </div> 
  276. <div class="bws-help-links-wrapper"> 
  277. <a href="<?php echo esc_url( 'https://support.bestwebsoft.com' ); ?>" target="_blank"><?php _e( 'Support', 'bestwebsoft' ); ?></a> 
  278. <a href="<?php echo esc_url( 'https://bestwebsoft.com/client-area' ); ?>" target="_blank" title="<?php _e( 'Manage purchased licenses & subscriptions', 'bestwebsoft' ); ?>">Client Area</a> 
  279. </div> 
  280. <div class="clear"></div> 
  281. </div> 
  282. <?php if ( ( 'bws_panel' == $page || ( ! isset( $_GET['tab'] ) && ! $is_main_page ) ) && ! isset( $_POST['bws_plugin_action_submit'] ) ) { ?> 
  283. <div class="bws-membership-wrap"> 
  284. <div class="bws-membership-backround"></div> 
  285. <div class="bws-membership"> 
  286. <div class="bws-membership-title"><?php printf( __( 'Get Access to %s+ Premium Plugins', 'bestwebsoft' ), '30' ); ?></div> 
  287. <form class="bws-membership-form" method="post" action=""> 
  288. <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> 
  289. <?php if ( isset( $bstwbsftwppdtplgns_options['go_pro'][ $bws_license_plugin ]['count'] ) && 
  290. '5' < $bstwbsftwppdtplgns_options['go_pro'][ $bws_license_plugin ]['count'] && 
  291. $bstwbsftwppdtplgns_options['go_pro'][ $bws_license_plugin ]['time'] > ( time() - ( 24 * 60 * 60 ) ) ) { ?> 
  292. <div class="bws_form_input_wrap"> 
  293. <input disabled="disabled" type="text" name="bws_license_key" value="<?php echo $bws_license_key; ?>" /> 
  294. <div class="bws_error"><?php _e( "Unfortunately, you have exceeded the number of available tries per day.", 'bestwebsoft' ); ?></div> 
  295. </div> 
  296. <input disabled="disabled" type="submit" class="bws-button" value="<?php _e( 'Check license key', 'bestwebsoft' ); ?>" /> 
  297. <?php } else { ?> 
  298. <div class="bws_form_input_wrap"> 
  299. <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 $bws_license_key; ?>" /> 
  300. <div class="bws_error" <?php if ( "" == $error ) echo "style=\"display:none\""; ?>><?php echo $error; ?></div> 
  301. </div> 
  302. <input type="hidden" name="bws_license_plugin" value="<?php echo $bws_license_plugin; ?>" /> 
  303. <input type="hidden" name="bws_license_submit" value="submit" /> 
  304. <?php if ( empty( $plugins_array ) ) { ?> 
  305. <input type="submit" class="bws-button" value="<?php _e( 'Activate', 'bestwebsoft' ); ?>" /> 
  306. <?php } else { ?> 
  307. <input type="submit" class="bws-button" value="<?php _e( 'Check license key', 'bestwebsoft' ); ?>" /> 
  308. <?php } ?> 
  309. <?php wp_nonce_field( plugin_basename(__FILE__), 'bws_license_nonce_name' ); ?> 
  310. <?php } ?> 
  311. </form> 
  312. <div class="clear"></div> 
  313. </div> 
  314. </div> 
  315. <?php } ?> 
  316. <div class="bws-wrap-content wrap"> 
  317. <?php if ( 'bws_panel' == $page || ( ! isset( $_GET['tab'] ) && ! $is_main_page ) ) { ?> 
  318. <div class="updated notice is-dismissible inline" <?php if ( '' == $message || '' != $error ) echo "style=\"display:none\""; ?>><p><?php echo $message; ?></p></div> 
  319. <h1> 
  320. <?php _e( 'Plugins', 'bestwebsoft' ); ?> 
  321. <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> 
  322. </h1> 
  323. <?php if ( isset( $_GET[error] ) ) { 
  324. if ( isset( $_GET['charsout'] ) ) 
  325. $errmsg = sprintf(__( 'The plugin generated %d characters of <strong>unexpected output</strong> during activation. If you notice “headers already sent” messages, problems with syndication feeds or other issues, try deactivating or removing this plugin.' ), $_GET['charsout'] ); 
  326. else 
  327. $errmsg = __( 'Plugin could not be activated because it triggered a <strong>fatal error</strong>.' ); ?> 
  328. <div id="message" class="error is-dismissible"><p><?php echo $errmsg; ?></p></div> 
  329. <?php } elseif ( isset( $_GET['activate'] ) ) { ?> 
  330. <div id="message" class="updated notice is-dismissible"><p><?php _e( 'Plugin <strong>activated</strong>.' ) ?></p></div> 
  331. <?php } 
  332.  
  333. if ( isset( $_POST['bws_plugin_action_submit'] ) && isset( $_POST['bws_install_plugin'] ) && check_admin_referer( plugin_basename(__FILE__), 'bws_license_install_nonce_name' ) ) { 
  334.  
  335. $bws_license_plugin = esc_html( $_POST['bws_install_plugin'] ); 
  336.  
  337. echo '<h2>' . __( 'Installing Plugin', 'bestwebsoft' ) . ': ' . $plugins_array[ $bws_license_plugin ]['name'] . '</h2>'; 
  338.  
  339. $bstwbsftwppdtplgns_options[ $bws_license_plugin ] = $bws_license_key; 
  340.  
  341. $url = $plugins_array[ $bws_license_plugin ]['link'] . '&download_from=5'; 
  342.  
  343. echo '<p>' . __( "Downloading install package from", 'bestwebsoft' ) . ' ' . $url . '</p>'; 
  344.  
  345. $uploadDir = wp_upload_dir(); 
  346. $zip_name = explode( '/', $bws_license_plugin ); 
  347.  
  348. if ( !function_exists( 'curl_init' ) ) { 
  349. $received_content = file_get_contents( $url ); 
  350. } else { 
  351. $ch = curl_init(); 
  352. curl_setopt( $ch, CURLOPT_URL, $url ); 
  353. curl_setopt( $ch, CURLOPT_RETURNTRANSFER, true ); 
  354. curl_setopt( $ch, CURLOPT_FOLLOWLOCATION, true ); 
  355. $received_content = curl_exec( $ch ); 
  356. curl_close( $ch ); 
  357.  
  358. if ( ! $received_content ) { 
  359. $error = __( "Failed to download the zip archive. Please, upload the plugin manually", 'bestwebsoft' ); 
  360. } else { 
  361. if ( is_writable( $uploadDir["path"] ) ) { 
  362. $file_put_contents = $uploadDir["path"] . "/" . $zip_name[0] . ".zip"; 
  363.  
  364. if ( file_put_contents( $file_put_contents, $received_content ) ) { 
  365. @chmod( $file_put_contents, octdec( 755 ) ); 
  366.  
  367. echo '<p>' . __( 'Unpacking the package', 'bestwebsoft' ) . '...</p>'; 
  368.  
  369. if ( class_exists( 'ZipArchive' ) ) { 
  370. $zip = new ZipArchive(); 
  371. if ( $zip->open( $file_put_contents ) === TRUE ) { 
  372. echo '<p>' . __( 'Installing the plugin', 'bestwebsoft' ) . '...</p>'; 
  373. $zip->extractTo( WP_PLUGIN_DIR ); 
  374. $zip->close(); 
  375. } else { 
  376. $error = __( "Failed to open the zip archive. Please, upload the plugin manually", 'bestwebsoft' ); 
  377. } elseif ( class_exists( 'Phar' ) ) { 
  378. $phar = new PharData( $file_put_contents ); 
  379. echo '<p>' . __( 'Installing the plugin', 'bestwebsoft' ) . '...</p>'; 
  380. $phar->extractTo( WP_PLUGIN_DIR ); 
  381. } else { 
  382. $error = __( "Your server does not support either ZipArchive or Phar. Please, upload the plugin manually", 'bestwebsoft' ); 
  383. if ( empty( $error ) ) 
  384. echo '<p>' . sprintf( __( 'The plugin %s is successfully installed.', 'bestwebsoft' ), '<strong>' . $plugins_array[ $bws_license_plugin ]['name'] . '</strong>' ) . '</p>'; 
  385.  
  386. @unlink( $file_put_contents ); 
  387. } else { 
  388. $error = __( "Failed to download the zip archive. Please, upload the plugin manually", 'bestwebsoft' ); 
  389. } else { 
  390. $error = __( "UploadDir is not writable. Please, upload the plugin manually", 'bestwebsoft' ); 
  391.  
  392. if ( file_exists( WP_PLUGIN_DIR . '/' . $zip_name[0] ) ) { 
  393. echo '<p><a href="' . wp_nonce_url( $current_page . '&bws_activate_plugin=' . $bws_license_plugin, 'bws_activate_plugin' . $bws_license_plugin ) . '" target="_parent">' . __( 'Activate Plugin', 'bestwebsoft' ) . '</a> | <a href="' . self_admin_url( $current_page ) . '" target="_parent">' . __( 'Return to BestWebSoft Panel', 'bestwebsoft' ) . '</a></p>'; 
  394. } else { 
  395. if ( empty( $error ) ) 
  396. $error = __( "Failed to download the zip archive. Please, upload the plugin manually", 'bestwebsoft' ); 
  397.  
  398. echo '<p class="error">' . $error . '</p>'; 
  399. echo '<p><a href="' . self_admin_url( $current_page ) . '" target="_parent">' . __( 'Return to BestWebSoft Panel', 'bestwebsoft' ) . '</a></p>'; 
  400. } else { ?> 
  401. <ul class="subsubsub"> 
  402. <li><a <?php if ( ! isset( $_GET['sub'] ) ) echo 'class="current" '; ?>href="<?php echo $current_page; if ( 'all' != $plugin_category ) echo '&category=' . $plugin_category; ?>"><?php _e( 'All', 'bestwebsoft' ); ?></a></li> | 
  403. <li><a <?php if ( isset( $_GET['sub'] ) && 'installed' == $_GET['sub'] ) echo 'class="current" '; ?>href="<?php echo $current_page; ?>&sub=installed<?php if ( 'all' != $plugin_category ) echo '&category=' . $plugin_category; ?>"><?php _e( 'Installed', 'bestwebsoft' ); ?></a></li> | 
  404. <li><a <?php if ( isset( $_GET['sub'] ) && 'not_installed' == $_GET['sub'] ) echo 'class="current" '; ?>href="<?php echo $current_page; ?>&sub=not_installed<?php if ( 'all' != $plugin_category ) echo '&category=' . $plugin_category; ?>"><?php _e( 'Not Installed', 'bestwebsoft' ); ?></a></li> 
  405. </ul> 
  406. <div class="clear"></div> 
  407. <div class="bws-filter-top"> 
  408. <h2> 
  409. <span class="bws-toggle-indicator"></span> 
  410. <?php _e( 'Filter results', 'bestwebsoft' ); ?> 
  411. </h2> 
  412. <div class="bws-filter-top-inside"> 
  413. <div class="bws-filter-title"><?php _e( 'Category', 'bestwebsoft' ); ?></div> 
  414. <ul class="bws-category"> 
  415. <li> 
  416. <?php $sub_in_url = ( isset( $_GET['sub'] ) && in_array( $_GET['sub'], array( 'installed', 'not_installed' ) ) ) ? '&sub=' . $_GET['sub'] : ''; ?> 
  417. <a <?php if ( 'all' == $plugin_category ) echo ' class="bws-active"'; ?> href="<?php echo self_admin_url( $current_page . $sub_in_url ); ?>"><?php _e( 'All', 'bestwebsoft' ); ?> 
  418. <span>(<?php echo count( $bws_plugins ); ?>)</span> 
  419. </a> 
  420. </li> 
  421. <?php foreach ( $bws_plugins_category as $category_key => $category_value ) { ?> 
  422. <li> 
  423. <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']; ?> 
  424. <span>(<?php echo $category_value['count']; ?>)</span> 
  425. </a> 
  426. </li> 
  427. <?php } ?> 
  428. </ul> 
  429. </div> 
  430. </div> 
  431. <div class="bws-products"> 
  432. <?php $nothing_found = true; 
  433. foreach ( $bws_plugins as $key_plugin => $value_plugin ) { 
  434.  
  435. if ( 'all' != $plugin_category && isset( $bws_plugins_category[ $plugin_category ] ) && ! in_array( $plugin_category, $value_plugin['category'] ) ) 
  436. continue; 
  437.  
  438. $key_plugin_explode = explode( '/', $key_plugin ); 
  439.  
  440. $icon = isset( $value_plugin['icon'] ) ? $value_plugin['icon'] : '//ps.w.org/' . $key_plugin_explode[0] . '/assets/icon-128x128.png'; 
  441. $is_pro_isset = isset( $value_plugin['pro_version'] ); 
  442. $is_installed = array_key_exists( $key_plugin, $all_plugins ); 
  443. $is_active = in_array( $key_plugin, $active_plugins ) || isset( $sitewide_active_plugins[ $key_plugin ] ); 
  444.  
  445. $is_pro_installed = $is_pro_active = false; 
  446. if ( $is_pro_isset ) { 
  447. $is_pro_installed = array_key_exists( $value_plugin['pro_version'], $all_plugins ); 
  448. $is_pro_active = in_array( $value_plugin['pro_version'], $active_plugins ) || isset( $sitewide_active_plugins[ $value_plugin['pro_version'] ] ); 
  449.  
  450. if ( ( isset( $_GET['sub'] ) && 'installed' == $_GET['sub'] && ! $is_pro_installed && ! $is_installed ) || 
  451. ( isset( $_GET['sub'] ) && 'not_installed' == $_GET['sub'] && ( $is_pro_installed || $is_installed ) ) ) 
  452. continue; 
  453.  
  454. $link_attr = isset( $value_plugin['install_url'] ) ? 'href="' . $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"'; 
  455.  
  456. $nothing_found = false; ?> 
  457. <div class="bws_product_box<?php if ( $is_active || $is_pro_active ) echo ' bws_product_active'; ?>"> 
  458. <div class="bws_product_image"> 
  459. <a <?php echo $link_attr; ?>><img src="<?php echo $icon; ?>"/></a> 
  460. </div> 
  461. <div class="bws_product_content"> 
  462. <div class="bws_product_title"><a <?php echo $link_attr; ?>><?php echo $value_plugin['name']; ?></a></div> 
  463. <div class="bws-version"> 
  464. <?php 
  465. if ( $is_pro_installed ) { 
  466. echo '<span'; 
  467. if ( ! empty( $value_plugin['expired'] ) || ! empty( $value_plugin['update_availible'] ) ) 
  468. echo ' class="bws-update-available"'; 
  469. echo '>v ' . $all_plugins[ $value_plugin['pro_version'] ]['Version'] . '</span>'; 
  470. } elseif ( $is_installed ) { 
  471. echo '<span'; 
  472. if ( ! empty( $value_plugin['expired'] ) || ! empty( $value_plugin['update_availible'] ) ) 
  473. echo ' class="bws-update-available"'; 
  474. echo '>v ' . $all_plugins[ $key_plugin ]['Version'] . '</span>'; 
  475. } else { 
  476. echo '<span>' . __( 'Not installed', 'bestwebsoft' ) . '</span>'; 
  477.  
  478. if ( ! empty( $value_plugin['expired'] ) ) { 
  479. echo ' - <a class="bws-update-now" href="https://support.bestwebsoft.com/hc/en-us/articles/202356359" target="_blank">' . __( 'Renew to get updates', 'bestwebsoft' ) . '</a>'; 
  480. } elseif ( ! empty( $value_plugin['update_availible'] ) ) { 
  481. $r = $update_availible_all->response[ $value_plugin['update_availible'] ]; 
  482. echo ' - <a class="bws-update-now" href="' . 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>'; 
  483. } ?> 
  484. </div> 
  485. <div class="bws_product_description"> 
  486. <?php echo ( strlen( $value_plugin['description'] ) > 100 ) ? substr( $value_plugin['description'], 0, 100 ) . '...' : $value_plugin['description']; ?> 
  487. </div> 
  488. <div class="bws_product_links"> 
  489. <?php if ( $is_active || $is_pro_active ) { 
  490. if ( $is_pro_isset ) { 
  491. if ( ! $is_pro_installed ) { 
  492. if ( ! empty( $plugins_array ) && array_key_exists( $value_plugin['pro_version'], $plugins_array ) ) { ?> 
  493. <form method="post" action=""> 
  494. <input type="submit" class="button button-secondary" value="<?php _e( 'Install Now', 'bestwebsoft' ); ?>" /> 
  495. <input type="hidden" name="bws_plugin_action_submit" value="submit" /> 
  496. <input type="hidden" name="bws_install_plugin" value="<?php echo $value_plugin['pro_version']; ?>" /> 
  497. <?php wp_nonce_field( plugin_basename(__FILE__), 'bws_license_install_nonce_name' ); ?> 
  498. </form> 
  499. <?php } else { ?> 
  500. <a class="button button-secondary bws_upgrade_button" href="<?php echo $bws_plugins[ $key_plugin ]['purchase']; ?>" target="_blank"><?php _e( 'Upgrade to Pro', 'bestwebsoft' ); ?></a> 
  501. <?php } 
  502. } else { ?> 
  503. <a class="bws_donate" href="https://bestwebsoft.com/donate/" target="_blank"><?php _e( 'Donate', 'bestwebsoft' ); ?></a> <span>|</span> 
  504. <?php } 
  505.  
  506. if ( $is_pro_active ) { ?> 
  507. <a class="bws_settings" href="<?php echo $bws_plugins[ $key_plugin ]["pro_settings"]; ?>"><?php _e( 'Settings', 'bestwebsoft' ); ?></a> 
  508. <?php } else { ?> 
  509. <a class="bws_settings" href="<?php echo $bws_plugins[ $key_plugin ]["settings"]; ?>"><?php _e( 'Settings', 'bestwebsoft' ); ?></a> 
  510. <?php } 
  511. } else { 
  512. if ( $is_pro_installed ) { ?> 
  513. <a class="button button-secondary" href="<?php echo wp_nonce_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> 
  514. <?php } elseif ( ! empty( $plugins_array ) && isset( $value_plugin['pro_version'] ) && array_key_exists( $value_plugin['pro_version'], $plugins_array ) ) { ?> 
  515. <form method="post" action=""> 
  516. <input type="submit" class="button button-secondary" value="<?php _e( 'Install Now', 'bestwebsoft' ); ?>" /> 
  517. <input type="hidden" name="bws_plugin_action_submit" value="submit" /> 
  518. <input type="hidden" name="bws_install_plugin" value="<?php echo $value_plugin['pro_version']; ?>" /> 
  519. <?php wp_nonce_field( plugin_basename(__FILE__), 'bws_license_install_nonce_name' ); ?> 
  520. </form> 
  521. <?php } elseif ( $is_installed ) { ?> 
  522. <a class="button button-secondary" href="<?php echo wp_nonce_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> 
  523. <?php } else { 
  524. $install_url = isset( $value_plugin['install_url'] ) ? $value_plugin['install_url'] : esc_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' ) ); ?> 
  525. <a class="button button-secondary" href="<?php echo $install_url; ?>" title="<?php _e( 'Install this plugin', 'bestwebsoft' ); ?>" target="_blank"><?php _e( 'Install Now', 'bestwebsoft' ); ?></a> 
  526. <?php } 
  527. } ?> 
  528. </div> 
  529. </div> 
  530. <div class="clear"></div> 
  531. </div> 
  532. <?php } 
  533. if ( $nothing_found ) { ?> 
  534. <p class="description"><?php _e( 'Nothing found. Try another criteria.', 'bestwebsoft' ); ?></p> 
  535. <?php } ?> 
  536. </div> 
  537. <div id="bws-filter-wrapper"> 
  538. <div class="bws-filter"> 
  539. <div class="bws-filter-title"><?php _e( 'Category', 'bestwebsoft' ); ?></div> 
  540. <ul class="bws-category"> 
  541. <li> 
  542. <?php $sub_in_url = ( isset( $_GET['sub'] ) && in_array( $_GET['sub'], array( 'installed', 'not_installed' ) ) ) ? '&sub=' . $_GET['sub'] : ''; ?> 
  543. <a <?php if ( 'all' == $plugin_category ) echo ' class="bws-active"'; ?> href="<?php echo self_admin_url( $current_page . $sub_in_url ); ?>"><?php _e( 'All', 'bestwebsoft' ); ?> 
  544. <span>(<?php echo count( $bws_plugins ); ?>)</span> 
  545. </a> 
  546. </li> 
  547. <?php foreach ( $bws_plugins_category as $category_key => $category_value ) { ?> 
  548. <li> 
  549. <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']; ?> 
  550. <span>(<?php echo $category_value['count']; ?>)</span> 
  551. </a> 
  552. </li> 
  553. <?php } ?> 
  554. </ul> 
  555. </div> 
  556. </div><!-- #bws-filter-wrapper --> 
  557. <div class="clear"></div> 
  558. <?php } 
  559. } elseif ( 'bws_themes' == $page || 'themes' == $tab ) { 
  560. require( dirname( __FILE__ ) . '/product_list.php' ); ?> 
  561. <h1><?php _e( 'Themes', 'bestwebsoft' ); ?></h1> 
  562. <div id="availablethemes" class="bws-availablethemes"> 
  563. <?php if ( $wp_version < '3.9' ) { 
  564. foreach ( $themes as $theme ) { ?> 
  565. <div class="available-theme installable-theme"><?php 
  566. $installed_theme = wp_get_theme( $theme->slug ); ?> 
  567. <a class="screenshot" href="<?php echo esc_url( $theme->href ); ?>"> 
  568. <img src="<?php echo bws_menu_url( "icons/themes/" ) . $theme->slug . '.png'; ?>" width='150' /> 
  569. </a> 
  570. <h3><?php echo $theme->name; ?></h3> 
  571. <div class="theme-author"><?php printf( __( 'By %s', 'bestwebsoft' ), 'BestWebSoft' ); ?></div> 
  572. <div class="action-links"> 
  573. <ul> 
  574. <?php if ( $installed_theme->exists() ) { ?> 
  575. <li><span class="install-now" title="'<?php esc_attr__( 'This theme is already installed and is up to date' ); ?>"><?php echo _x( 'Installed', 'theme', 'bestwebsoft' ); ?></span></li> 
  576. <?php } ?> 
  577. <li><a class="theme-detail" href="<?php echo esc_url( $theme->href ); ?>" target="_blank"><?php _e( 'Learn More', 'bestwebsoft' ); ?></a></li> 
  578. </ul> 
  579. </div> 
  580. </div> 
  581. <?php } 
  582. } else { ?> 
  583. <div class="theme-browser content-filterable rendered"> 
  584. <div class="themes wp-clearfix"> 
  585. <?php foreach ( $themes as $key => $theme ) { 
  586. $installed_theme = wp_get_theme( $theme->slug ); ?> 
  587. <div class="theme" tabindex="0"> 
  588. <div class="theme-screenshot"> 
  589. <img src="<?php echo bws_menu_url( "icons/themes/" ) . $theme->slug . '.png'; ?>" alt="" /> 
  590. </div> 
  591. <div class="theme-author"><?php printf( __( 'By %s', 'bestwebsoft' ), 'BestWebSoft' ); ?></div> 
  592. <h3 class="theme-name"><?php echo $theme->name; ?></h3> 
  593. <div class="theme-actions"> 
  594. <a class="button button-secondary preview install-theme-preview" href="<?php echo $theme->href; ?>" target="_blank"><?php esc_html_e( 'Learn More', 'bestwebsoft' ); ?></a> 
  595. </div> 
  596. <?php if ( $installed_theme->exists() ) { 
  597. if ( $wp_version < '4.6' ) { ?> 
  598. <div class="theme-installed"><?php _e( 'Already Installed', 'bestwebsoft' ); ?></div> 
  599. <?php } else { ?> 
  600. <div class="notice notice-success notice-alt inline"><p><?php _e( 'Installed', 'bestwebsoft' ); ?></p></div> 
  601. <?php } 
  602. } ?> 
  603. </div> 
  604. <?php } ?> 
  605. <br class="clear" /> 
  606. </div> 
  607. </div> 
  608. <?php } ?> 
  609. <p><a class="bws_browse_link" href="http://bestweblayout.com/categories/themes/" target="_blank"><?php _e( 'Browse Free WordPress Themes', 'bestwebsoft' ); ?> <span class="dashicons dashicons-arrow-right-alt2"></span></a></p> 
  610. </div> 
  611. <?php } elseif ( 'bws_system_status' == $page || 'system-status' == $tab ) { ?> 
  612. <h1><?php _e( 'System status', 'bestwebsoft' ); ?></h1> 
  613. <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> 
  614. <div class="error" <?php if ( "" == $error ) echo "style=\"display:none\""; ?>><p><strong><?php echo $error; ?></strong></p></div> 
  615. <form method="post" action=""> 
  616. <p> 
  617. <input type="hidden" name="bwsmn_form_submit" value="submit" /> 
  618. <input type="submit" class="button-primary" value="<?php _e( 'Send to support', 'bestwebsoft' ) ?>" /> 
  619. <?php wp_nonce_field( plugin_basename(__FILE__), 'bwsmn_nonce_submit' ); ?> 
  620. </p> 
  621. </form> 
  622. <form method="post" action=""> 
  623. <p> 
  624. <input type="hidden" name="bwsmn_form_submit_custom_email" value="submit" /> 
  625. <input type="submit" class="button" value="<?php _e( 'Send to custom email »', 'bestwebsoft' ) ?>" /> 
  626. <input type="text" maxlength="250" value="<?php echo $bwsmn_form_email; ?>" name="bwsmn_form_email" /> 
  627. <?php wp_nonce_field( plugin_basename(__FILE__), 'bwsmn_nonce_submit_custom_email' ); ?> 
  628. </p> 
  629. </form> 
  630. <?php foreach ( $system_info as $info ) { ?> 
  631. <table class="widefat bws-system-info" cellspacing="0"> 
  632. <thead> 
  633. <tr> 
  634. <th colspan="2"> 
  635. <strong> 
  636. <?php echo $info['name']; 
  637. if ( isset( $info['count'] ) ) 
  638. echo ' (' . $info['count'] . ')'; ?>  
  639. </strong> 
  640. </th> 
  641. </tr> 
  642. </thead> 
  643. <tbody> 
  644. <?php foreach ( $info['data'] as $key => $value ) { ?> 
  645. <tr> 
  646. <td scope="row"><?php echo $key; ?></td> 
  647. <td scope="row"><?php echo $value; ?></td> 
  648. </tr> 
  649. <?php } ?> 
  650. </tbody> 
  651. </table> 
  652. <?php }  
  653. } ?> 
  654. </div> 
  655. </div> 
  656. <?php }