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