/bws_menu/bws_menu.php

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