PluginProbe
PDF & Print by BestWebSoft – WordPress Posts and Pages PDF Generator Plugin / 1.7.1
PDF & Print by BestWebSoft – WordPress Posts and Pages PDF Generator Plugin v1.7.1
trunk 1.5 1.6 1.7 1.7.1 1.7.2 1.7.3 1.7.4 1.7.5 1.7.6 1.7.7 1.7.8 1.7.9 1.8.0 1.8.1 1.8.2 1.8.3 1.8.4 1.8.5 1.8.6 1.8.7 1.8.8 1.8.9 1.9.0 1.9.1 All 71 releases
← All changes | bws_menu/bws_menu.php +975 -603 1.9.0 → 1.7.1 View file →
@@ -1,187 +1,479 @@
1 1 <?php
2 2 /*
3 -* Function for displaying BestWebSoft menu
4 -* Version: 1.9.1
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, $wpmu, $wp_version, $bws_plugin_info;
8 + $error = '';
9 + $message = '';
10 + $bwsmn_form_email = '';
11 + $bws_donate_link = 'https://www.2checkout.com/checkout/purchase?sid=1430388&quantity=10&product_id=13';
14 12
15 - if ( 'bws_panel' == $_GET['page'] ) {
13 + // install the option defaults
14 + if ( 1 == $wpmu ) {
15 + if ( !get_site_option( 'bstwbsftwppdtplgns_options' ) )
16 + add_site_option( 'bstwbsftwppdtplgns_options', array(), '', 'yes' );
17 + $bstwbsftwppdtplgns_options = get_site_option( 'bstwbsftwppdtplgns_options' );
18 + } else {
19 + if ( !get_option( 'bstwbsftwppdtplgns_options' ) )
20 + add_option( 'bstwbsftwppdtplgns_options', array(), '', 'yes' );
21 + $bstwbsftwppdtplgns_options = get_option( 'bstwbsftwppdtplgns_options' );
22 + }
23 + if ( !isset( $bstwbsftwppdtplgns_options['bws_menu_version'] ) ) {
24 + $bstwbsftwppdtplgns_options['bws_menu_version'] = '1.1';
25 + update_option( 'bstwbsftwppdtplgns_options', $bstwbsftwppdtplgns_options, '', 'yes' );
26 + }
16 27
17 - if ( ! function_exists( 'is_plugin_active_for_network' ) )
18 - require_once( ABSPATH . 'wp-admin/includes/plugin.php' );
28 + if ( isset( $_REQUEST['bwsmn_form_submit_switch'] ) && check_admin_referer( plugin_basename(__FILE__), 'bwsmn_nonce_submit_switch' ) ) {
29 + if ( $bstwbsftwppdtplgns_options['bws_menu_version'] == '1.1' )
30 + $bstwbsftwppdtplgns_options['bws_menu_version'] = 'old';
31 + else
32 + $bstwbsftwppdtplgns_options['bws_menu_version'] = '1.1';
33 + $bstwbsftwppdtplgns_options['bws_menu_time'] = strtotime('now');
34 + update_option( 'bstwbsftwppdtplgns_options', $bstwbsftwppdtplgns_options, '', 'yes' );
35 + }
19 36
20 - /* get $bws_plugins */
21 - require_once( dirname( __FILE__ ) . '/product_list.php' );
37 + if ( ! function_exists( 'is_plugin_active_for_network' ) )
38 + require_once( ABSPATH . '/wp-admin/includes/plugin.php' );
22 39
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' );
40 + $bws_plugins = array(
41 + 'captcha/captcha.php' => array(
42 + 'name' => 'Captcha',
43 + 'description' => 'Plugin intended to prove that the visitor is a human being and not a spam robot.',
44 + 'link' => 'http://bestwebsoft.com/plugin/captcha-plugin/?k=d678516c0990e781edfb6a6c874f0b8a&pn=' . $bws_plugin_info["id"] . '&v=' . $bws_plugin_info["version"] . '&wp_v=' . $wp_version,
45 + 'download' => 'http://bestwebsoft.com/plugin/captcha-plugin/?k=d678516c0990e781edfb6a6c874f0b8a&pn=' . $bws_plugin_info["id"] . '&v=' . $bws_plugin_info["version"] . '&wp_v=' . $wp_version . '#download',
46 + 'wp_install' => '/wp-admin/plugin-install.php?tab=search&type=term&s=Captcha+bestwebsoft&plugin-search-input=Search+Plugins',
47 + 'settings' => 'admin.php?page=captcha.php',
48 + 'pro_version' => 'captcha-pro/captcha_pro.php'
49 + ),
50 + 'contact-form-plugin/contact_form.php' => array(
51 + 'name' => 'Contact form',
52 + 'description' => 'Add Contact Form to your WordPress website.',
53 + 'link' => 'http://bestwebsoft.com/plugin/contact-form/?k=012327ef413e5b527883e031d43b088b&pn=' . $bws_plugin_info["id"] . '&v=' . $bws_plugin_info["version"] . '&wp_v=' . $wp_version,
54 + 'download' => 'http://bestwebsoft.com/plugin/contact-form/?k=012327ef413e5b527883e031d43b088b&pn=' . $bws_plugin_info["id"] . '&v=' . $bws_plugin_info["version"] . '&wp_v=' . $wp_version . '#download',
55 + 'wp_install' => '/wp-admin/plugin-install.php?tab=search&type=term&s=Contact+Form+bestwebsoft&plugin-search-input=Search+Plugins',
56 + 'settings' => 'admin.php?page=contact_form.php',
57 + 'pro_version' => 'contact-form-pro/contact_form_pro.php'
58 + ),
59 + 'facebook-button-plugin/facebook-button-plugin.php' => array(
60 + 'name' => 'Facebook Like Button',
61 + 'description' => 'Allows you to add the Follow and Like buttons the easiest way.',
62 + 'link' => 'http://bestwebsoft.com/plugin/facebook-like-button-plugin/?k=05ec4f12327f55848335802581467d55&pn=' . $bws_plugin_info["id"] . '&v=' . $bws_plugin_info["version"] . '&wp_v=' . $wp_version,
63 + 'download' => 'http://bestwebsoft.com/plugin/facebook-like-button-plugin/?k=05ec4f12327f55848335802581467d55&pn=' . $bws_plugin_info["id"] . '&v=' . $bws_plugin_info["version"] . '&wp_v=' . $wp_version . '#download',
64 + 'wp_install' => '/wp-admin/plugin-install.php?tab=search&type=term&s=Facebook+Like+Button+Plugin+bestwebsoft&plugin-search-input=Search+Plugins',
65 + 'settings' => 'admin.php?page=facebook-button-plugin.php',
66 + 'pro_version' => 'facebook-button-pro/facebook-button-pro.php'
67 + ),
68 + 'twitter-plugin/twitter.php' => array(
69 + 'name' => 'Twitter',
70 + 'description' => 'Allows you to add the Twitter "Follow" and "Like" buttons the easiest way.',
71 + 'link' => 'http://bestwebsoft.com/plugin/twitter-plugin/?k=f8cb514e25bd7ec4974d64435c5eb333&pn=' . $bws_plugin_info["id"] . '&v=' . $bws_plugin_info["version"] . '&wp_v=' . $wp_version,
72 + 'download' => 'http://bestwebsoft.com/plugin/twitter-plugin/?k=f8cb514e25bd7ec4974d64435c5eb333&pn=' . $bws_plugin_info["id"] . '&v=' . $bws_plugin_info["version"] . '&wp_v=' . $wp_version . '#download',
73 + 'wp_install' => '/wp-admin/plugin-install.php?tab=search&type=term&s=Twitter+Plugin+bestwebsoft&plugin-search-input=Search+Plugins',
74 + 'settings' => 'admin.php?page=twitter.php',
75 + 'pro_version' => 'twitter-pro/twitter-pro.php'
76 + ),
77 + 'portfolio/portfolio.php' => array(
78 + 'name' => 'Portfolio',
79 + 'description' => 'Allows you to create a page with the information about your past projects.',
80 + 'link' => 'http://bestwebsoft.com/plugin/portfolio-plugin/?k=1249a890c5b7bba6bda3f528a94f768b&pn=' . $bws_plugin_info["id"] . '&v=' . $bws_plugin_info["version"] . '&wp_v=' . $wp_version,
81 + 'download' => 'http://bestwebsoft.com/plugin/portfolio-plugin/?k=1249a890c5b7bba6bda3f528a94f768b&pn=' . $bws_plugin_info["id"] . '&v=' . $bws_plugin_info["version"] . '&wp_v=' . $wp_version . '#download',
82 + 'wp_install' => '/wp-admin/plugin-install.php?tab=search&type=term&s=Portfolio+bestwebsoft&plugin-search-input=Search+Plugins',
83 + 'settings' => 'admin.php?page=portfolio.php'
84 + ),
85 + 'gallery-plugin/gallery-plugin.php' => array(
86 + 'name' => 'Gallery',
87 + 'description' => 'Allows you to implement a Gallery page into your website.',
88 + 'link' => 'http://bestwebsoft.com/plugin/gallery-plugin/?k=2da21c0a64eec7ebf16337fa134c5f78&pn=' . $bws_plugin_info["id"] . '&v=' . $bws_plugin_info["version"] . '&wp_v=' . $wp_version,
89 + 'download' => 'http://bestwebsoft.com/plugin/gallery-plugin/?k=2da21c0a64eec7ebf16337fa134c5f78&pn=' . $bws_plugin_info["id"] . '&v=' . $bws_plugin_info["version"] . '&wp_v=' . $wp_version . '#download',
90 + 'wp_install' => '/wp-admin/plugin-install.php?tab=search&type=term&s=Gallery+Plugin+bestwebsoft&plugin-search-input=Search+Plugins',
91 + 'settings' => 'admin.php?page=gallery-plugin.php',
92 + 'pro_version' => 'gallery-plugin-pro/gallery-plugin-pro.php'
93 + ),
94 + 'adsense-plugin/adsense-plugin.php'=> array(
95 + 'name' => 'Google AdSense',
96 + 'description' => 'Allows Google AdSense implementation to your website.',
97 + 'link' => 'http://bestwebsoft.com/plugin/google-adsense-plugin/?k=60e3979921e354feb0347e88e7d7b73d&pn=' . $bws_plugin_info["id"] . '&v=' . $bws_plugin_info["version"] . '&wp_v=' . $wp_version,
98 + 'download' => 'http://bestwebsoft.com/plugin/google-adsense-plugin/?k=60e3979921e354feb0347e88e7d7b73d&pn=' . $bws_plugin_info["id"] . '&v=' . $bws_plugin_info["version"] . '&wp_v=' . $wp_version . '#download',
99 + 'wp_install' => '/wp-admin/plugin-install.php?tab=search&type=term&s=Adsense+Plugin+bestwebsoft&plugin-search-input=Search+Plugins',
100 + 'settings' => 'admin.php?page=adsense-plugin.php'
101 + ),
102 + 'custom-search-plugin/custom-search-plugin.php'=> array(
103 + 'name' => 'Custom Search',
104 + 'description' => 'Allows to extend your website search functionality by adding a custom post type.',
105 + 'link' => 'http://bestwebsoft.com/plugin/custom-search-plugin/?k=933be8f3a8b8719d95d1079d15443e29&pn=' . $bws_plugin_info["id"] . '&v=' . $bws_plugin_info["version"] . '&wp_v=' . $wp_version,
106 + 'download' => 'http://bestwebsoft.com/plugin/custom-search-plugin/?k=933be8f3a8b8719d95d1079d15443e29&pn=' . $bws_plugin_info["id"] . '&v=' . $bws_plugin_info["version"] . '&wp_v=' . $wp_version . '#download',
107 + 'wp_install' => '/wp-admin/plugin-install.php?tab=search&type=term&s=Custom+Search+plugin+bestwebsoft&plugin-search-input=Search+Plugins',
108 + 'settings' => 'admin.php?page=custom_search.php'
109 + ),
110 + 'quotes-and-tips/quotes-and-tips.php'=> array(
111 + 'name' => 'Quotes and Tips',
112 + 'description' => 'Allows you to implement quotes & tips block into your web site.',
113 + 'link' => 'http://bestwebsoft.com/plugin/quotes-and-tips/?k=5738a4e85a798c4a5162240c6515098d&pn=' . $bws_plugin_info["id"] . '&v=' . $bws_plugin_info["version"] . '&wp_v=' . $wp_version,
114 + 'download' => 'http://bestwebsoft.com/plugin/quotes-and-tips/?k=5738a4e85a798c4a5162240c6515098d&pn=' . $bws_plugin_info["id"] . '&v=' . $bws_plugin_info["version"] . '&wp_v=' . $wp_version . '#download',
115 + 'wp_install' => '/wp-admin/plugin-install.php?tab=search&type=term&s=Quotes+and+Tips+bestwebsoft&plugin-search-input=Search+Plugins',
116 + 'settings' => 'admin.php?page=quotes-and-tips.php'
117 + ),
118 + 'google-sitemap-plugin/google-sitemap-plugin.php'=> array(
119 + 'name' => 'Google Sitemap',
120 + 'description' => 'Allows you to add sitemap file to Google Webmaster Tools.',
121 + 'link' => 'http://bestwebsoft.com/plugin/google-sitemap-plugin/?k=5202b2f5ce2cf85daee5e5f79a51d806&pn=' . $bws_plugin_info["id"] . '&v=' . $bws_plugin_info["version"] . '&wp_v=' . $wp_version,
122 + 'download' => 'http://bestwebsoft.com/plugin/google-sitemap-plugin/?k=5202b2f5ce2cf85daee5e5f79a51d806&pn=' . $bws_plugin_info["id"] . '&v=' . $bws_plugin_info["version"] . '&wp_v=' . $wp_version . '#download',
123 + 'wp_install' => '/wp-admin/plugin-install.php?tab=search&type=term&s=Google+sitemap+plugin+bestwebsoft&plugin-search-input=Search+Plugins',
124 + 'settings' => 'admin.php?page=google-sitemap-plugin.php',
125 + 'pro_version' => 'google-sitemap-pro/google-sitemap-pro.php'
126 + ),
127 + 'updater/updater.php'=> array(
128 + 'name' => 'Updater',
129 + 'description' => 'Allows you to update plugins and WP core.',
130 + 'link' => 'http://bestwebsoft.com/plugin/updater-plugin/?k=66f3ecd4c1912009d395c4bb30f779d1&pn=' . $bws_plugin_info["id"] . '&v=' . $bws_plugin_info["version"] . '&wp_v=' . $wp_version,
131 + 'download' => 'http://bestwebsoft.com/plugin/updater-plugin/?k=66f3ecd4c1912009d395c4bb30f779d1&pn=' . $bws_plugin_info["id"] . '&v=' . $bws_plugin_info["version"] . '&wp_v=' . $wp_version . '#download',
132 + 'wp_install' => '/wp-admin/plugin-install.php?tab=search&type=term&s=updater+bestwebsoft&plugin-search-input=Search+Plugins',
133 + 'settings' => 'admin.php?page=updater-options',
134 + 'pro_version' => 'updater-pro/updater_pro.php'
135 + ),
136 + 'custom-fields-search/custom-fields-search.php'=> array(
137 + 'name' => 'Custom Fields Search',
138 + 'description' => 'Allows you to add website search any existing custom fields.',
139 + 'link' => 'http://bestwebsoft.com/plugin/custom-fields-search/?k=f3f8285bb069250c42c6ffac95ed3284&pn=' . $bws_plugin_info["id"] . '&v=' . $bws_plugin_info["version"] . '&wp_v=' . $wp_version,
140 + 'download' => 'http://bestwebsoft.com/plugin/custom-fields-search/?k=f3f8285bb069250c42c6ffac95ed3284&pn=' . $bws_plugin_info["id"] . '&v=' . $bws_plugin_info["version"] . '&wp_v=' . $wp_version . '#download',
141 + 'wp_install' => '/wp-admin/plugin-install.php?tab=search&type=term&s=Custom+Fields+Search+bestwebsoft&plugin-search-input=Search+Plugins',
142 + 'settings' => 'admin.php?page=custom_fields_search.php'
143 + ),
144 + 'google-one/google-plus-one.php' => array(
145 + 'name' => 'Google +1',
146 + 'description' => 'Allows you to celebrate liked the article.',
147 + 'link' => 'http://bestwebsoft.com/plugin/google-plus-one/?k=ce7a88837f0a857b3a2bb142f470853c&pn=' . $bws_plugin_info["id"] . '&v=' . $bws_plugin_info["version"] . '&wp_v=' . $wp_version,
148 + 'download' => 'http://bestwebsoft.com/plugin/google-plus-one/?k=ce7a88837f0a857b3a2bb142f470853c&pn=' . $bws_plugin_info["id"] . '&v=' . $bws_plugin_info["version"] . '&wp_v=' . $wp_version . '#download',
149 + 'wp_install' => '/wp-admin/plugin-install.php?tab=search&type=term&s=Google+%2B1+bestwebsoft&plugin-search-input=Search+Plugins',
150 + 'settings' => 'admin.php?page=google-plus-one.php',
151 + 'pro_version' => 'google-one-pro/google-plus-one-pro.php'
152 + ),
153 + 'relevant/related-posts-plugin.php' => array(
154 + 'name' => 'Relevant - Related Posts',
155 + 'description' => 'Allows you to display related posts with similar words in category, tags, title or by adding special meta key for posts.',
156 + 'link' => 'http://bestwebsoft.com/plugin/related-posts-plugin/?k=73fb737037f7141e66415ec259f7e426&pn=' . $bws_plugin_info["id"] . '&v=' . $bws_plugin_info["version"] . '&wp_v=' . $wp_version,
157 + 'download' => 'http://bestwebsoft.com/plugin/related-posts-plugin/?k=73fb737037f7141e66415ec259f7e426&pn=' . $bws_plugin_info["id"] . '&v=' . $bws_plugin_info["version"] . '&wp_v=' . $wp_version . '#download',
158 + 'wp_install' => '/wp-admin/plugin-install.php?tab=search&s=Related+Posts+Plugin+Bestwebsoft&plugin-search-input=Search+Plugins',
159 + 'settings' => 'admin.php?page=related-posts-plugin.php'
160 + ),
161 + 'contact-form-to-db/contact_form_to_db.php' => array(
162 + 'name' => 'Contact Form To DB',
163 + 'description' => 'Allows you to manage the messages that have been sent from your site.',
164 + 'link' => 'http://bestwebsoft.com/plugin/contact-form-to-db/?k=ba3747d317c2692e4136ca096a8989d6&pn=' . $bws_plugin_info["id"] . '&v=' . $bws_plugin_info["version"] . '&wp_v=' . $wp_version,
165 + 'download' => 'http://bestwebsoft.com/plugin/contact-form-to-db/?k=ba3747d317c2692e4136ca096a8989d6&pn=' . $bws_plugin_info["id"] . '&v=' . $bws_plugin_info["version"] . '&wp_v=' . $wp_version . '#download',
166 + 'wp_install' => '/wp-admin/plugin-install.php?tab=search&s=Contact+Form+to+DB+bestwebsoft&plugin-search-input=Search+Plugins',
167 + 'settings' => 'admin.php?page=cntctfrmtdb_settings',
168 + 'pro_version' => 'contact-form-to-db-pro/contact_form_to_db_pro.php'
169 + ),
170 + 'pdf-print/pdf-print.php' => array(
171 + 'name' => 'PDF & Print',
172 + 'description' => 'Allows you to create PDF and Print page with adding appropriate buttons to the content.',
173 + 'link' => 'http://bestwebsoft.com/plugin/pdf-print/?k=bfefdfb522a4c0ff0141daa3f271840c&pn=' . $bws_plugin_info["id"] . '&v=' . $bws_plugin_info["version"] . '&wp_v=' . $wp_version,
174 + 'download' => 'http://bestwebsoft.com/plugin/pdf-print/?k=bfefdfb522a4c0ff0141daa3f271840c&pn=' . $bws_plugin_info["id"] . '&v=' . $bws_plugin_info["version"] . '&wp_v=' . $wp_version . '#download',
175 + 'wp_install' => '/wp-admin/plugin-install.php?tab=search&s=PDF+Print+Bestwebsoft&plugin-search-input=Search+Plugins',
176 + 'settings' => 'admin.php?page=pdf-print.php',
177 + 'pro_version' => 'pdf-print-pro/pdf-print-pro.php'
178 + ),
179 + 'donate-button/donate.php' => array(
180 + 'name' => 'Donate',
181 + 'description' => 'Makes it possible to place donation buttons of various payment systems on your web page.',
182 + 'link' => 'http://bestwebsoft.com/plugin/donate/?k=a8b2e2a56914fb1765dd20297c26401b&pn=' . $bws_plugin_info["id"] . '&v=' . $bws_plugin_info["version"] . '&wp_v=' . $wp_version,
183 + 'download' => 'http://bestwebsoft.com/plugin/donate/?k=a8b2e2a56914fb1765dd20297c26401b&pn=' . $bws_plugin_info["id"] . '&v=' . $bws_plugin_info["version"] . '&wp_v=' . $wp_version . '#download',
184 + 'wp_install' => '/wp-admin/plugin-install.php?tab=search&s=Donate+Bestwebsoft&plugin-search-input=Search+Plugins',
185 + 'settings' => 'admin.php?page=donate.php'
186 + ),
187 + 'post-to-csv/post-to-csv.php' => array(
188 + 'name' => 'Post To CSV',
189 + 'description' => 'The plugin allows to export posts of any types to a csv file.',
190 + 'link' => 'http://bestwebsoft.com/plugin/post-to-csv/?k=653aa55518ae17409293a7a894268b8f&pn=' . $bws_plugin_info["id"] . '&v=' . $bws_plugin_info["version"] . '&wp_v=' . $wp_version,
191 + 'download' => 'http://bestwebsoft.com/plugin/post-to-csv/?k=653aa55518ae17409293a7a894268b8f&pn=' . $bws_plugin_info["id"] . '&v=' . $bws_plugin_info["version"] . '&wp_v=' . $wp_version . '#download',
192 + 'wp_install' => '/wp-admin/plugin-install.php?tab=search&s=Post+To+CSV+Bestwebsoft&plugin-search-input=Search+Plugins',
193 + 'settings' => 'admin.php?page=post-to-csv.php'
194 + ),
195 + 'google-shortlink/google-shortlink.php' => array(
196 + 'name' => 'Google Shortlink',
197 + 'description' => 'Allows you to get short links from goo.gl servise without leaving your site.',
198 + 'link' => 'http://bestwebsoft.com/plugin/google-shortlink/?k=afcf3eaed021bbbbeea1090e16bc22db&pn=' . $bws_plugin_info["id"] . '&v=' . $bws_plugin_info["version"] . '&wp_v=' . $wp_version,
199 + 'download' => 'http://bestwebsoft.com/plugin/google-shortlink/?k=afcf3eaed021bbbbeea1090e16bc22db&pn=' . $bws_plugin_info["id"] . '&v=' . $bws_plugin_info["version"] . '&wp_v=' . $wp_version . '#download',
200 + 'wp_install' => '/wp-admin/plugin-install.php?tab=search&s=Google+Shortlink+Bestwebsoft&plugin-search-input=Search+Plugins',
201 + 'settings' => 'admin.php?page=gglshrtlnk_options'
202 + ),
203 + 'htaccess/htaccess.php' => array(
204 + 'name' => 'Htaccess',
205 + 'description' => 'Allows controlling access to your website using the directives Allow and Deny.',
206 + 'link' => 'http://bestwebsoft.com/plugin/htaccess/?k=2b865fcd56a935d22c5c4f1bba52ed46&pn=' . $bws_plugin_info["id"] . '&v=' . $bws_plugin_info["version"] . '&wp_v=' . $wp_version,
207 + 'download' => 'http://bestwebsoft.com/plugin/htaccess/?k=2b865fcd56a935d22c5c4f1bba52ed46&pn=' . $bws_plugin_info["id"] . '&v=' . $bws_plugin_info["version"] . '&wp_v=' . $wp_version . '#download',
208 + 'wp_install' => '/wp-admin/plugin-install.php?tab=search&s=Htaccess+Bestwebsoft&plugin-search-input=Search+Plugins',
209 + 'settings' => 'admin.php?page=htaccess.php'
210 + ),
211 + 'google-captcha/google-captcha.php' => array(
212 + 'name' => 'Google Captcha (reCAPTCHA)',
213 + 'description' => 'Plugin intended to prove that the visitor is a human being and not a spam robot.',
214 + 'link' => 'http://bestwebsoft.com/plugin/google-captcha/?k=7b59fbe542acf950b29f3e020d5ad735&pn=' . $bws_plugin_info["id"] . '&v=' . $bws_plugin_info["version"] . '&wp_v=' . $wp_version,
215 + 'download' => 'http://bestwebsoft.com/plugin/google-captcha/?k=7b59fbe542acf950b29f3e020d5ad735&pn=' . $bws_plugin_info["id"] . '&v=' . $bws_plugin_info["version"] . '&wp_v=' . $wp_version . '#download',
216 + 'wp_install' => '/wp-admin/plugin-install.php?tab=search&s=Google+Captcha+Bestwebsoft&plugin-search-input=Search+Plugins',
217 + 'settings' => 'admin.php?page=google-captcha.php'
218 + ),
219 + 'sender/sender.php' => array(
220 + 'name' => 'Sender',
221 + 'description' => 'You can send mails to all users or to certain categories of users.',
222 + 'link' => 'http://bestwebsoft.com/plugin/sender/?k=89c297d14ba85a8417a0f2fc05e089c7&pn=' . $bws_plugin_info["id"] . '&v=' . $bws_plugin_info["version"] . '&wp_v=' . $wp_version,
223 + 'download' => 'http://bestwebsoft.com/plugin/sender/?k=89c297d14ba85a8417a0f2fc05e089c7&pn=' . $bws_plugin_info["id"] . '&v=' . $bws_plugin_info["version"] . '&wp_v=' . $wp_version . '#download',
224 + 'wp_install' => '/wp-admin/plugin-install.php?tab=search&s=Sender+Bestwebsoft&plugin-search-input=Search+Plugins',
225 + 'settings' => 'admin.php?page=sndr_settings'
226 + )
227 + );
228 + $bws_plugins_pro = array(
229 + 'gallery-plugin-pro/gallery-plugin-pro.php' => array(
230 + 'name' => 'Gallery Pro',
231 + 'description' => 'Allows you to implement as many galleries as you want into your website.',
232 + 'link' => 'http://bestwebsoft.com/plugin/gallery-pro/?k=382e5ce7c96a6391f5ffa5e116b37fe0&pn=' . $bws_plugin_info["id"] . '&v=' . $bws_plugin_info["version"] . '&wp_v=' . $wp_version,
233 + 'purchase' => 'http://bestwebsoft.com/plugin/gallery-pro/?k=382e5ce7c96a6391f5ffa5e116b37fe0&pn=' . $bws_plugin_info["id"] . '&v=' . $bws_plugin_info["version"] . '&wp_v=' . $wp_version . '#purchase',
234 + 'settings' => 'admin.php?page=gallery-plugin-pro.php'
235 + ),
236 + 'contact-form-pro/contact_form_pro.php' => array(
237 + 'name' => 'Contact form Pro',
238 + 'description' => 'Allows you to implement a feedback form to a web-page or a post in no time.',
239 + 'link' => 'http://bestwebsoft.com/plugin/contact-form-pro/?k=773dc97bb3551975db0e32edca1a6d71&pn=' . $bws_plugin_info["id"] . '&v=' . $bws_plugin_info["version"] . '&wp_v=' . $wp_version,
240 + 'purchase' => 'http://bestwebsoft.com/plugin/contact-form-pro/?k=773dc97bb3551975db0e32edca1a6d71&pn=' . $bws_plugin_info["id"] . '&v=' . $bws_plugin_info["version"] . '&wp_v=' . $wp_version . '#purchase',
241 + 'settings' => 'admin.php?page=contact_form_pro.php'
242 + ),
243 + 'captcha-pro/captcha_pro.php' => array(
244 + 'name' => 'Captcha Pro',
245 + 'description' => 'Allows you to implement a super security captcha form into web forms.',
246 + 'link' => 'http://bestwebsoft.com/plugin/captcha-pro/?k=ff7d65e55e5e7f98f219be9ed711094e&pn=' . $bws_plugin_info["id"] . '&v=' . $bws_plugin_info["version"] . '&wp_v=' . $wp_version,
247 + 'purchase' => 'http://bestwebsoft.com/plugin/captcha-pro/?k=ff7d65e55e5e7f98f219be9ed711094e&pn=' . $bws_plugin_info["id"] . '&v=' . $bws_plugin_info["version"] . '&wp_v=' . $wp_version . '#purchase',
248 + 'settings' => 'admin.php?page=captcha_pro.php'
249 + ),
250 + 'updater-pro/updater_pro.php' => array(
251 + 'name' => 'Updater Pro',
252 + 'description' => 'Allows you to update plugins and WordPress core on your website.',
253 + 'link' => 'http://bestwebsoft.com/plugin/updater-pro/?k=cf633acbefbdff78545347fe08a3aecb&pn=' . $bws_plugin_info["id"] . '&v=' . $bws_plugin_info["version"] . '&wp_v=' . $wp_version,
254 + 'purchase' => 'http://bestwebsoft.com/plugin/updater-pro?k=cf633acbefbdff78545347fe08a3aecb&pn=' . $bws_plugin_info["id"] . '&v=' . $bws_plugin_info["version"] . '&wp_v=' . $wp_version . '#purchase',
255 + 'settings' => 'admin.php?page=updater-pro-options'
256 + ),
257 + 'contact-form-to-db-pro/contact_form_to_db_pro.php' => array(
258 + 'name' => 'Contact form to DB Pro',
259 + 'description' => 'The plugin provides a unique opportunity to manage messages sent from your site via the contact form.',
260 + 'link' => 'http://bestwebsoft.com/plugin/contact-form-to-db-pro/?k=6ce5f4a9006ec906e4db643669246c6a&pn=' . $bws_plugin_info["id"] . '&v=' . $bws_plugin_info["version"] . '&wp_v=' . $wp_version,
261 + 'purchase' => 'http://bestwebsoft.com/plugin/contact-form-to-db-pro/?k=6ce5f4a9006ec906e4db643669246c6a&pn=' . $bws_plugin_info["id"] . '&v=' . $bws_plugin_info["version"] . '&wp_v=' . $wp_version . '#purchase',
262 + 'settings' => 'admin.php?page=cntctfrmtdbpr_settings'
263 + ),
264 + 'google-sitemap-pro/google-sitemap-pro.php'=> array(
265 + 'name' => 'Google Sitemap Pro',
266 + 'description' => 'Allows you to add sitemap file to Google Webmaster Tools.',
267 + 'link' => 'http://bestwebsoft.com/plugin/google-sitemap-pro/?k=7ea384a5cc36cb4c22741caa20dcd56d&pn=' . $bws_plugin_info["id"] . '&v=' . $bws_plugin_info["version"] . '&wp_v=' . $wp_version,
268 + 'purchase' => 'http://bestwebsoft.com/plugin/google-sitemap-pro/?k=7ea384a5cc36cb4c22741caa20dcd56d&pn=' . $bws_plugin_info["id"] . '&v=' . $bws_plugin_info["version"] . '&wp_v=' . $wp_version . '#purchase',
269 + 'settings' => 'admin.php?page=google-sitemap-pro.php'
270 + ),
271 + 'twitter-pro/twitter-pro.php' => array(
272 + 'name' => 'Twitter Pro',
273 + 'description' => 'Allows you to add the Twitter "Follow" and "Like" buttons the easiest way.',
274 + 'link' => 'http://bestwebsoft.com/plugin/twitter-pro/?k=63ecbf0cc9cebf060b5a3c9362299700&pn=' . $bws_plugin_info["id"] . '&v=' . $bws_plugin_info["version"] . '&wp_v=' . $wp_version,
275 + 'purchase' => 'http://bestwebsoft.com/plugin/twitter-pro?k=63ecbf0cc9cebf060b5a3c9362299700&pn=' . $bws_plugin_info["id"] . '&v=' . $bws_plugin_info["version"] . '&wp_v=' . $wp_version . '#purchase',
276 + 'settings' => 'admin.php?page=twitter-pro.php'
277 + ),
278 + 'google-one-pro/google-plus-one-pro.php' => array(
279 + 'name' => 'Google +1 Pro',
280 + 'description' => 'Allows you to celebrate liked the article.',
281 + 'link' => 'http://bestwebsoft.com/plugin/google-plus-one-pro/?k=f4b0a62d155c9df9601a0531ad5bd832&pn=' . $bws_plugin_info["id"] . '&v=' . $bws_plugin_info["version"] . '&wp_v=' . $wp_version,
282 + 'purchase' => 'http://bestwebsoft.com/plugin/google-plus-one-pro?k=f4b0a62d155c9df9601a0531ad5bd832&pn=' . $bws_plugin_info["id"] . '&v=' . $bws_plugin_info["version"] . '&wp_v=' . $wp_version . '#purchase',
283 + 'settings' => 'admin.php?page=google-plus-one-pro.php'
284 + ),
285 + 'facebook-button-pro/facebook-button-pro.php' => array(
286 + 'name' => 'Facebook Like Button Pro',
287 + 'description' => 'Allows you to add the Follow and Like buttons the easiest way.',
288 + 'link' => 'http://bestwebsoft.com/plugin/facebook-like-button-pro/?k=8da168e60a831cfb3525417c333ad275&pn=' . $bws_plugin_info["id"] . '&v=' . $bws_plugin_info["version"] . '&wp_v=' . $wp_version,
289 + 'purchase' => 'http://bestwebsoft.com/plugin/facebook-like-button-pro?k=8da168e60a831cfb3525417c333ad275&pn=' . $bws_plugin_info["id"] . '&v=' . $bws_plugin_info["version"] . '&wp_v=' . $wp_version . '#purchase',
290 + 'settings' => 'admin.php?page=facebook-button-pro.php'
291 + ),
292 + 'pdf-print-pro/pdf-print-pro.php' => array(
293 + 'name' => 'PDF & Print Pro',
294 + 'description' => 'Allows you to create PDF and Print page with adding appropriate buttons to the content.',
295 + 'link' => 'http://bestwebsoft.com/plugin/pdf-print-pro/?k=fd43a0e659ddc170a9060027cbfdcc3a&pn=' . $bws_plugin_info["id"] . '&v=' . $bws_plugin_info["version"] . '&wp_v=' . $wp_version,
296 + 'purchase' => 'http://bestwebsoft.com/plugin/pdf-print-pro?k=fd43a0e659ddc170a9060027cbfdcc3a&pn=' . $bws_plugin_info["id"] . '&v=' . $bws_plugin_info["version"] . '&wp_v=' . $wp_version . '#purchase',
297 + 'settings' => 'admin.php?page=pdf-print-pro.php'
298 + )
299 + );
300 +
301 + $all_plugins = get_plugins();
302 + $active_plugins = get_option( 'active_plugins' );
27 303
28 - $plugin_category = isset( $_GET['category'] ) ? $_GET['category'] : 'all';
304 + if ( '1.1' == $bstwbsftwppdtplgns_options['bws_menu_version'] ) {
305 +
306 + $recommend_plugins = array_diff_key( $bws_plugins, $all_plugins );
29 307
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 ) {
308 + foreach ( $bws_plugins as $key_plugin => $value_plugin ) {
309 + if ( ! isset( $all_plugins[ $key_plugin ] ) && isset( $bws_plugins[ $key_plugin ]['pro_version'] ) && isset( $all_plugins[ $bws_plugins[ $key_plugin ]['pro_version'] ] ) ) {
310 + unset( $recommend_plugins[ $key_plugin ] );
311 + }
312 + }
33 313
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 - }
314 + foreach ( $all_plugins as $key_plugin => $value_plugin ) {
315 + if ( ! isset( $bws_plugins[ $key_plugin ] ) && ! isset( $bws_plugins_pro[ $key_plugin ] ) )
316 + unset( $all_plugins[ $key_plugin ] );
37 317
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 - }
318 + if ( isset( $bws_plugins[ $key_plugin ] ) && isset( $bws_plugins[ $key_plugin ]['pro_version'] ) && isset( $all_plugins[ $bws_plugins[ $key_plugin ]['pro_version'] ] ) ) {
319 + unset( $all_plugins[ $key_plugin ] );
60 320 }
61 - $bws_plugins = $bws_plugins_update_availible + $bws_plugins_expired + $bws_plugins;
62 - } 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 - }
68 321 }
322 + } else {
69 323
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;
324 + $array_activate = array();
325 + $array_install = array();
326 + $array_recomend = array();
327 + $count_activate = $count_install = $count_recomend = 0;
74 328
75 - if ( isset( $_POST['bws_license_key'] ) )
76 - $bws_license_key = stripslashes( esc_html( trim( $_POST['bws_license_key'] ) ) );
329 + foreach ( $bws_plugins as $key_plugin => $value_plugin ) {
330 + if ( in_array( $key_plugin, $active_plugins ) || is_plugin_active_for_network( $key_plugin ) ) {
331 + $array_activate[ $count_activate ]["title"] = $value_plugin['name'];
332 + $array_activate[ $count_activate ]["link"] = $value_plugin['link'];
333 + $array_activate[ $count_activate ]["href"] = $value_plugin['download'];
334 + $array_activate[ $count_activate ]["url"] = $value_plugin['settings'];
335 + $count_activate++;
336 + } else if ( array_key_exists( $key_plugin, $all_plugins ) ) {
337 + $array_install[ $count_install ]["title"] = $value_plugin['name'];
338 + $array_install[ $count_install ]["link"] = $value_plugin['link'];
339 + $array_install[ $count_install ]["href"] = $value_plugin['download'];
340 + $count_install++;
341 + } else {
342 + $array_recomend[ $count_recomend ]["title"] = $value_plugin['name'];
343 + $array_recomend[ $count_recomend ]["link"] = $value_plugin['link'];
344 + $array_recomend[ $count_recomend ]["href"] = $value_plugin['download'];
345 + $array_recomend[ $count_recomend ]["slug"] = $value_plugin['wp_install'];
346 + $count_recomend++;
347 + }
348 + }
77 349
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'];
350 + $array_activate_pro = array();
351 + $array_install_pro = array();
352 + $array_recomend_pro = array();
353 + $count_activate_pro = $count_install_pro = $count_recomend_pro = 0;
354 + foreach ( $bws_plugins_pro as $key_plugin => $value_plugin ) {
355 + if ( in_array( $key_plugin, $active_plugins ) || is_plugin_active_for_network( $key_plugin ) ) {
356 + $array_activate_pro[ $count_activate_pro ]["title"] = $value_plugin['name'];
357 + $array_activate_pro[ $count_activate_pro ]["link"] = $value_plugin['link'];
358 + $array_activate_pro[ $count_activate_pro ]["href"] = $value_plugin['purchase'];
359 + $array_activate_pro[ $count_activate_pro ]["url"] = $value_plugin['settings'];
360 + $count_activate_pro++;
361 + } else if ( array_key_exists( $key_plugin, $all_plugins ) ) {
362 + $array_install_pro[ $count_install_pro ]["title"] = $value_plugin['name'];
363 + $array_install_pro[ $count_install_pro ]["link"] = $value_plugin['link'];
364 + $array_install_pro[ $count_install_pro ]["href"] = $value_plugin['purchase'];
365 + $count_install_pro++;
366 + } else {
367 + $array_recomend_pro[ $count_recomend_pro ]["title"] = $value_plugin['name'];
368 + $array_recomend_pro[ $count_recomend_pro ]["link"] = $value_plugin['link'];
369 + $array_recomend_pro[ $count_recomend_pro ]["href"] = $value_plugin['purchase'];
370 + $count_recomend_pro++;
371 + }
81 372 }
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' );
373 + if ( $wp_version >= '3.4' ) {
374 + $wp_list_table = _get_list_table( 'WP_Themes_List_Table' );
375 + $wp_list_table->prepare_items();
376 + $current_theme = wp_get_theme();
377 + $array_activate_theme = array();
378 + $array_install_theme = array();
379 + $array_recomend_theme = array();
380 + $count_activate_theme = $count_install_theme = $count_recomend_theme = 0;
381 + $array_theme = array(
382 + array( 'central', 'Central', 'http://bestwebsoft.com/theme/central/?k=77c0199aabdb1f601a0504e312bee220&pn=' . $bws_plugin_info["id"] . '&v=' . $bws_plugin_info["version"] . '&wp_v=' . $wp_version, 'http://bestwebsoft.com/theme/central/?k=77c0199aabdb1f601a0504e312bee220&pn=' . $bws_plugin_info["id"] . '&v=' . $bws_plugin_info["version"] . '&wp_v=' . $wp_version . '#download', '/wp-admin/theme-install.php?tab=search&s=Central&search=Search' ),
383 + array( 'simple-classic', 'Simple Classic', 'http://bestwebsoft.com/theme/simple-classic/?k=b3990bfc85125747f48ece9f011f4cde&pn=' . $bws_plugin_info["id"] . '&v=' . $bws_plugin_info["version"] . '&wp_v=' . $wp_version, 'http://bestwebsoft.com/theme/simple-classic/?k=b3990bfc85125747f48ece9f011f4cde&pn=' . $bws_plugin_info["id"] . '&v=' . $bws_plugin_info["version"] . '&wp_v=' . $wp_version . '#download', '/wp-admin/theme-install.php?tab=search&type=term&s=Simple+Classic&search=Search' ),
384 + array( 'reddish', 'Reddish', 'http://bestwebsoft.com/theme/reddish/?k=1ea187e3fd401fd278e23a333abaf4f6&pn=' . $bws_plugin_info["id"] . '&v=' . $bws_plugin_info["version"] . '&wp_v=' . $wp_version, 'http://bestwebsoft.com/theme/reddish/?k=1ea187e3fd401fd278e23a333abaf4f6&pn=' . $bws_plugin_info["id"] . '&v=' . $bws_plugin_info["version"] . '&wp_v=' . $wp_version . '#download', '/wp-admin/theme-install.php?tab=search&type=term&s=reddish&search=Search' ),
385 + array( 'wordpost', 'Wordpost', 'http://bestwebsoft.com/theme/wordpost/?k=f0fc8c98135c9657751224562aca7a55&pn=' . $bws_plugin_info["id"] . '&v=' . $bws_plugin_info["version"] . '&wp_v=' . $wp_version, 'http://bestwebsoft.com/theme/wordpost/?k=f0fc8c98135c9657751224562aca7a55&pn=' . $bws_plugin_info["id"] . '&v=' . $bws_plugin_info["version"] . '&wp_v=' . $wp_version . '#download', '/wp-admin/theme-install.php?tab=search&type=term&s=Wordpost&search=Search' )
386 + );
387 + foreach ( $array_theme as $theme ) {
388 + if ( $current_theme->get( 'Name' ) == $theme[1] ) {
389 + $array_activate_theme[ $count_activate_theme ]["title"] = $theme[1];
390 + $array_activate_theme[ $count_activate_theme ]["link"] = $theme[2];
391 + $array_activate_theme[ $count_activate_theme ]["href"] = $theme[3];
392 + $count_activate_theme++;
393 + } elseif ( array_key_exists( $theme[0], $wp_list_table->items ) ) {
394 + $array_install_theme[ $count_install_theme ]["title"] = $theme[1];
395 + $array_install_theme[ $count_install_theme ]["link"] = $theme[2];
396 + $array_install_theme[ $count_install_theme ]["href"] = $theme[3];
397 + $count_install_theme++;
88 398 } 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 );
399 + $array_recomend_theme[ $count_recomend_theme ]["title"] = $theme[1];
400 + $array_recomend_theme[ $count_recomend_theme ]["link"] = $theme[2];
401 + $array_recomend_theme[ $count_recomend_theme ]["href"] = $theme[3];
402 + $array_recomend_theme[ $count_recomend_theme ]["slug"] = $theme[4];
403 + $count_recomend_theme++;
147 404 }
148 - } else {
149 - $error = __( "Please enter your license key.", 'bestwebsoft' );
150 405 }
151 - }
406 + }
152 407 }
153 408
154 - if ( 'bws_system_status' == $_GET['page'] ) {
409 + if ( ( isset( $_GET['action'] ) && 'system_status' == $_GET['action'] ) || 'old' == $bstwbsftwppdtplgns_options['bws_menu_version'] ) {
155 410 $all_plugins = get_plugins();
156 411 $active_plugins = get_option( 'active_plugins' );
412 + $sql_version = $wpdb->get_var( "SELECT VERSION() AS version" );
157 413 $mysql_info = $wpdb->get_results( "SHOW VARIABLES LIKE 'sql_mode'" );
158 - if ( is_array( $mysql_info ) )
414 + if ( is_array( $mysql_info) )
159 415 $sql_mode = $mysql_info[0]->Value;
160 416 if ( empty( $sql_mode ) )
161 417 $sql_mode = __( 'Not set', 'bestwebsoft' );
418 + if ( ini_get( 'safe_mode' ) )
419 + $safe_mode = __( 'On', 'bestwebsoft' );
420 + else
421 + $safe_mode = __( 'Off', 'bestwebsoft' );
422 + if ( ini_get( 'allow_url_fopen' ) )
423 + $allow_url_fopen = __( 'On', 'bestwebsoft' );
424 + else
425 + $allow_url_fopen = __( 'Off', 'bestwebsoft' );
426 + if ( ini_get( 'upload_max_filesize' ) )
427 + $upload_max_filesize = ini_get( 'upload_max_filesize' );
428 + else
429 + $upload_max_filesize = __( 'N/A', 'bestwebsoft' );
430 + if ( ini_get('post_max_size') )
431 + $post_max_size = ini_get('post_max_size');
432 + else
433 + $post_max_size = __( 'N/A', 'bestwebsoft' );
434 + if ( ini_get( 'max_execution_time' ) )
435 + $max_execution_time = ini_get( 'max_execution_time' );
436 + else
437 + $max_execution_time = __( 'N/A', 'bestwebsoft' );
438 + if ( ini_get( 'memory_limit' ) )
439 + $memory_limit = ini_get( 'memory_limit' );
440 + else
441 + $memory_limit = __( 'N/A', 'bestwebsoft' );
442 + if ( function_exists( 'memory_get_usage' ) )
443 + $memory_usage = round( memory_get_usage() / 1024 / 1024, 2 ) . __( ' Mb', 'bestwebsoft' );
444 + else
445 + $memory_usage = __( 'N/A', 'bestwebsoft' );
446 + if ( is_callable( 'exif_read_data' ) )
447 + $exif_read_data = __( 'Yes', 'bestwebsoft' ) . " ( V" . substr( phpversion( 'exif' ), 0,4 ) . ")" ;
448 + else
449 + $exif_read_data = __( 'No', 'bestwebsoft' );
450 + if ( is_callable( 'iptcparse' ) )
451 + $iptcparse = __( 'Yes', 'bestwebsoft' );
452 + else
453 + $iptcparse = __( 'No', 'bestwebsoft' );
454 + if ( is_callable( 'xml_parser_create' ) )
455 + $xml_parser_create = __( 'Yes', 'bestwebsoft' );
456 + else
457 + $xml_parser_create = __( 'No', 'bestwebsoft' );
162 458
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() );
459 + if ( function_exists( 'wp_get_theme' ) )
460 + $theme = wp_get_theme();
461 + else
462 + $theme = get_theme( get_current_theme() );
174 463
175 464 if ( function_exists( 'is_multisite' ) ) {
176 - if ( is_multisite() )
465 + if ( is_multisite() ) {
177 466 $multisite = __( 'Yes', 'bestwebsoft' );
178 - else
467 + } else {
179 468 $multisite = __( 'No', 'bestwebsoft' );
180 - } else {
469 + }
470 + } else
181 471 $multisite = __( 'N/A', 'bestwebsoft' );
182 - }
183 472
473 + $site_url = get_option( 'siteurl' );
474 + $home_url = get_option( 'home' );
475 + $db_version = get_option( 'db_version' );
184 476 $system_info = array(
185 477 'system_info' => '',
186 478 'active_plugins' => '',
187 479 'inactive_plugins' => ''
@@ -189,9 +481,9 @@
189 481 $system_info['system_info'] = array(
190 482 __( 'Operating System', 'bestwebsoft' ) => PHP_OS,
191 483 __( 'Server', 'bestwebsoft' ) => $_SERVER["SERVER_SOFTWARE"],
192 484 __( 'Memory usage', 'bestwebsoft' ) => $memory_usage,
193 - __( 'MYSQL Version', 'bestwebsoft' ) => $wpdb->get_var( "SELECT VERSION() AS version" ),
485 + __( 'MYSQL Version', 'bestwebsoft' ) => $sql_version,
194 486 __( 'SQL Mode', 'bestwebsoft' ) => $sql_mode,
195 487 __( 'PHP Version', 'bestwebsoft' ) => PHP_VERSION,
196 488 __( 'PHP Safe Mode', 'bestwebsoft' ) => $safe_mode,
197 489 __( 'PHP Allow URL fopen', 'bestwebsoft' ) => $allow_url_fopen,
@@ -201,456 +493,537 @@
201 493 __( 'PHP Max Script Execute Time', 'bestwebsoft' ) => $max_execution_time,
202 494 __( 'PHP Exif support', 'bestwebsoft' ) => $exif_read_data,
203 495 __( 'PHP IPTC support', 'bestwebsoft' ) => $iptcparse,
204 496 __( 'PHP XML support', 'bestwebsoft' ) => $xml_parser_create,
205 - __( 'Site URL', 'bestwebsoft' ) => get_option( 'siteurl' ),
206 - __( 'Home URL', 'bestwebsoft' ) => home_url(),
497 + __( 'Site URL', 'bestwebsoft' ) => $site_url,
498 + __( 'Home URL', 'bestwebsoft' ) => $home_url,
207 499 '$_SERVER[HTTP_HOST]' => $_SERVER['HTTP_HOST'],
208 500 '$_SERVER[SERVER_NAME]' => $_SERVER['SERVER_NAME'],
209 501 __( 'WordPress Version', 'bestwebsoft' ) => $wp_version,
210 - __( 'WordPress DB Version', 'bestwebsoft' ) => get_option( 'db_version' ),
502 + __( 'WordPress DB Version', 'bestwebsoft' ) => $db_version,
211 503 __( 'Multisite', 'bestwebsoft' ) => $multisite,
212 504 __( 'Active Theme', 'bestwebsoft' ) => $theme['Name'] . ' ' . $theme['Version']
213 505 );
214 506 foreach ( $all_plugins as $path => $plugin ) {
215 - if ( is_plugin_active( $path ) )
507 + if ( is_plugin_active( $path ) ) {
216 508 $system_info['active_plugins'][ $plugin['Name'] ] = $plugin['Version'];
217 - else
509 + } else {
218 510 $system_info['inactive_plugins'][ $plugin['Name'] ] = $plugin['Version'];
219 - }
220 -
511 + }
512 + }
513 + }
221 514
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 - }
515 + if ( ( isset( $_REQUEST['bwsmn_form_submit'] ) && check_admin_referer( plugin_basename(__FILE__), 'bwsmn_nonce_submit' ) ) ||
516 + ( isset( $_REQUEST['bwsmn_form_submit_custom_email'] ) && check_admin_referer( plugin_basename(__FILE__), 'bwsmn_nonce_submit_custom_email' ) ) ) {
517 + if ( isset( $_REQUEST['bwsmn_form_email'] ) ) {
518 + $bwsmn_form_email = trim( $_REQUEST['bwsmn_form_email'] );
519 + 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 ) ) {
520 + $error = __( "Please enter a valid email address.", 'bestwebsoft' );
232 521 } else {
233 - $email = '[email protected]';
234 - $message = __( 'Thank you for contacting us.', 'bestwebsoft' );
522 + $email = $bwsmn_form_email;
523 + $bwsmn_form_email = '';
524 + $message = __( 'Email with system info is sent to ', 'bestwebsoft' ) . $email;
235 525 }
526 + } else {
527 + $email = '[email protected]';
528 + $message = __( 'Thank you for contacting us.', 'bestwebsoft' );
529 + }
236 530
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' );
531 + if ( $error == '' ) {
532 + $headers = 'MIME-Version: 1.0' . "\n";
533 + $headers .= 'Content-type: text/html; charset=utf-8' . "\n";
534 + $headers .= 'From: ' . get_option( 'admin_email' );
535 + $message_text = '<html><head><title>System Info From ' . $home_url . '</title></head><body>
536 + <h4>Environment</h4>
537 + <table>';
538 + foreach ( $system_info['system_info'] as $key => $value ) {
539 + $message_text .= '<tr><td>'. $key .'</td><td>'. $value .'</td></tr>';
268 540 }
541 + $message_text .= '</table>
542 + <h4>Active Plugins</h4>
543 + <table>';
544 + foreach ( $system_info['active_plugins'] as $key => $value ) {
545 + $message_text .= '<tr><td scope="row">'. $key .'</td><td scope="row">'. $value .'</td></tr>';
546 + }
547 + $message_text .= '</table>
548 + <h4>Inactive Plugins</h4>
549 + <table>';
550 + foreach ( $system_info['inactive_plugins'] as $key => $value ) {
551 + $message_text .= '<tr><td scope="row">'. $key .'</td><td scope="row">'. $value .'</td></tr>';
552 + }
553 + $message_text .= '</table></body></html>';
554 + $result = wp_mail( $email, 'System Info From ' . $home_url, $message_text, $headers );
555 + if ( $result != true )
556 + $error = __( "Sorry, email message could not be delivered.", 'bestwebsoft' );
269 557 }
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>
558 + }
559 +
560 + ?>
561 + <div class="wrap">
562 + <div class="icon32 icon32-bws" id="icon-options-general"></div>
563 + <h2>
564 + <span class="bws_main title">BestWebSoft</span>
565 + <?php if ( 'old' == $bstwbsftwppdtplgns_options['bws_menu_version'] && isset( $bstwbsftwppdtplgns_options['bws_menu_time'] ) && strtotime("-14 day") < $bstwbsftwppdtplgns_options['bws_menu_time'] ) { ?>
566 + <form method="post" action="admin.php?page=bws_plugins">
567 + <input type="hidden" name="bwsmn_form_submit_switch" value="submit" />
568 + <input type="submit" class="bws_switch_link" value="<?php _e( 'Switch to new interface', 'bestwebsoft' ) ?>" />
569 + <?php wp_nonce_field( plugin_basename(__FILE__), 'bwsmn_nonce_submit_switch' ); ?>
570 + </form>
571 + </h2>
572 + <div class="clear"></div>
573 + <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>
574 + <div class="error" <?php if ( "" == $error ) echo "style=\"display:none\""; ?>><p><strong><?php echo $error; ?></strong></p></div>
575 + <h3 style="color: blue;"><?php _e( 'Pro plugins', 'bestwebsoft' ); ?></h3>
576 + <?php if ( 0 < $count_activate_pro ) { ?>
577 + <div style="padding-left:15px;">
578 + <h4><?php _e( 'Activated plugins', 'bestwebsoft' ); ?></h4>
579 + <?php foreach ( $array_activate_pro as $activate_plugin ) { ?>
580 + <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>
581 + <?php } ?>
279 582 </div>
280 - <div class="bws-menu-item-icon">&#8226;&#8226;&#8226;</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>
583 + <?php } ?>
584 + <?php if ( 0 < $count_install_pro ) { ?>
585 + <div style="padding-left:15px;">
586 + <h4><?php _e( 'Installed plugins', 'bestwebsoft' ); ?></h4>
587 + <?php foreach ( $array_install_pro as $install_plugin) { ?>
588 + <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>
589 + <?php } ?>
284 590 </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>
291 - </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 - <form method="post" action="">
297 - <?php if ( isset( $bstwbsftwppdtplgns_options['go_pro'][ $bws_license_plugin ]['count'] ) &&
298 - '5' < $bstwbsftwppdtplgns_options['go_pro'][ $bws_license_plugin ]['count'] &&
299 - $bstwbsftwppdtplgns_options['go_pro'][ $bws_license_plugin ]['time'] > ( time() - ( 24 * 60 * 60 ) ) ) { ?>
300 - <div>
301 - <input disabled="disabled" type="text" name="bws_license_key" value="<?php echo $bws_license_key; ?>" />
302 - <input disabled="disabled" type="submit" class="bws-button" value="<?php _e( 'Check license key', 'bestwebsoft' ); ?>" />
303 - </div>
304 - <div class="bws_error"><?php _e( "Unfortunately, you have exceeded the number of available tries per day.", 'bestwebsoft' ); ?></div>
305 - <?php } else { ?>
306 - <div>
307 - <input type="text" placeholder="<?php _e( 'Enter your license key', 'bestwebsoft' ); ?>" maxlength="100" name="bws_license_key" value="<?php echo $bws_license_key; ?>" />
308 - <input type="hidden" name="bws_license_plugin" value="<?php echo $bws_license_plugin; ?>" />
309 - <input type="hidden" name="bws_license_submit" value="submit" />
310 - <?php if ( empty( $plugins_array ) ) { ?>
311 - <input type="submit" class="bws-button" value="<?php _e( 'Activate Membership', 'bestwebsoft' ); ?>" />
312 - <?php } else { ?>
313 - <input type="submit" class="bws-button" value="<?php _e( 'Check license key', 'bestwebsoft' ); ?>" />
314 - <?php } ?>
315 - <?php wp_nonce_field( plugin_basename(__FILE__), 'bws_license_nonce_name' ); ?>
316 - </div>
317 - <div class="bws_error" <?php if ( "" == $error ) echo "style=\"display:none\""; ?>><?php echo $error; ?></div>
318 - <?php } ?>
319 - </form>
320 - <div class="bws-membership-link"><?php _e( 'Don’t have valid license key yet?', 'bestwebsoft' ); ?> <a target="_blank" href="http://bestwebsoft.com/membership/"><?php _e( 'Subscribe to Pro Membership Now', 'bestwebsoft' ); ?></a></div>
591 + <?php } ?>
592 + <?php if ( 0 < $count_recomend_pro ) { ?>
593 + <div style="padding-left:15px;">
594 + <h4><?php _e( 'Recommended plugins', 'bestwebsoft' ); ?></h4>
595 + <?php foreach ( $array_recomend_pro as $recomend_plugin ) { ?>
596 + <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>
597 + <?php } ?>
598 + </div>
599 + <?php } ?>
600 + <br />
601 + <h3 style="color: green"><?php _e( 'Free plugins', 'bestwebsoft' ); ?></h3>
602 + <?php if ( 0 < $count_activate ) { ?>
603 + <div style="padding-left:15px;">
604 + <h4><?php _e( 'Activated plugins', 'bestwebsoft' ); ?></h4>
605 + <?php foreach ( $array_activate as $activate_plugin ) { ?>
606 + <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>
607 + <?php } ?>
608 + </div>
609 + <?php } ?>
610 + <?php if ( 0 < $count_install ) { ?>
611 + <div style="padding-left:15px;">
612 + <h4><?php _e( 'Installed plugins', 'bestwebsoft' ); ?></h4>
613 + <?php foreach ( $array_install as $install_plugin ) { ?>
614 + <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>
615 + <?php } ?>
616 + </div>
617 + <?php } ?>
618 + <?php if ( 0 < $count_recomend ) { ?>
619 + <div style="padding-left:15px;">
620 + <h4><?php _e( 'Recommended plugins', 'bestwebsoft' ); ?></h4>
621 + <?php foreach ( $array_recomend as $recomend_plugin ) { ?>
622 + <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>
623 + <?php } ?>
624 + </div>
625 + <?php } ?>
626 + <br />
627 + <?php if ( $wp_version >= '3.4' ) { ?>
628 + <h3 style="color: green"><?php _e( 'Free themes', 'bestwebsoft' ); ?></h3>
629 + <?php if ( 0 < $count_activate_theme ) { ?>
630 + <div style="padding-left:15px;">
631 + <h4><?php _e( 'Activated theme', 'bestwebsoft' ); ?></h4>
632 + <div style="float:left; width:200px;"><?php echo $array_activate_theme[0]["title"]; ?></div> <p><a href="<?php echo $array_activate_theme[0]["link"]; ?>" target="_blank"><?php echo __( "Read more", 'bestwebsoft' ); ?></a> <a href="<?php echo wp_customize_url(); ?>" title="<?php echo esc_attr( sprintf( __( 'Customize &#8220;%s&#8221;' ), $current_theme->display('Name') ) ); ?>"><?php _e( 'Customize' ); ?></a></p>
321 633 </div>
322 - </div>
323 - <?php } ?>
324 - <div class="bws-wrap-content wrap">
325 - <?php if ( 'bws_panel' == $_GET['page'] ) { ?>
326 - <div class="updated notice is-dismissible inline" <?php if ( '' == $message || '' != $error ) echo "style=\"display:none\""; ?>><p><?php echo $message; ?></p></div>
327 - <h1>
328 - <?php _e( 'Plugins', 'bestwebsoft' ); ?>
329 - <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>
330 - </h1>
331 - <?php if ( isset( $_GET['error'] ) ) {
332 - if ( isset( $_GET['charsout'] ) )
333 - $errmsg = sprintf(__( 'The plugin generated %d characters of <strong>unexpected output</strong> during activation. If you notice &#8220;headers already sent&#8221; messages, problems with syndication feeds or other issues, try deactivating or removing this plugin.' ), $_GET['charsout'] );
334 - else
335 - $errmsg = __( 'Plugin could not be activated because it triggered a <strong>fatal error</strong>.' ); ?>
336 - <div id="message" class="error is-dismissible"><p><?php echo $errmsg; ?></p></div>
337 - <?php } elseif ( isset( $_GET['activate'] ) ) { ?>
338 - <div id="message" class="updated notice is-dismissible"><p><?php _e( 'Plugin <strong>activated</strong>.' ) ?></p></div>
339 - <?php }
634 + <?php } ?>
635 + <?php if ( 0 < $count_install_theme ) { ?>
636 + <div style="padding-left:15px;">
637 + <h4><?php _e( 'Installed themes', 'bestwebsoft' ); ?></h4>
638 + <?php foreach ( $array_install_theme as $install_theme ) { ?>
639 + <div style="float:left; width:200px;"><?php echo $install_theme["title"]; ?></div> <p><a href="<?php echo $install_theme["link"]; ?>" target="_blank"><?php echo __( "Read more", 'bestwebsoft' ); ?></a></p>
640 + <?php } ?>
641 + </div>
642 + <?php } ?>
643 + <?php if ( 0 < $count_recomend_theme ) { ?>
644 + <div style="padding-left:15px;">
645 + <h4><?php _e( 'Recommended themes', 'bestwebsoft' ); ?></h4>
646 + <?php foreach ( $array_recomend_theme as $recomend_theme ) { ?>
647 + <div style="float:left; width:200px;"><?php echo $recomend_theme["title"]; ?></div> <p><a href="<?php echo $recomend_theme["link"]; ?>" target="_blank"><?php echo __( "Read more", 'bestwebsoft' ); ?></a> <a href="<?php echo $recomend_theme["href"]; ?>" target="_blank"><?php echo __( "Download", 'bestwebsoft' ); ?></a> <a class="install-now" href="<?php echo get_bloginfo( "url" ) . $recomend_theme["slug"]; ?>" title="<?php esc_attr( sprintf( __( 'Install %s' ), $recomend_theme["title"] ) ) ?>" target="_blank"><?php echo __( 'Install now from wordpress.org', 'bestwebsoft' ) ?></a></p>
648 + <?php } ?>
649 + </div>
650 + <?php } ?>
651 + <br />
652 + <?php } ?>
653 + <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>
654 + <div id="poststuff" class="bws_system_info_meta_box">
655 + <div class="postbox">
656 + <div class="handlediv" title="Click to toggle">
657 + <br>
658 + </div>
659 + <h3 class="hndle">
660 + <span><?php _e( 'System status', 'bestwebsoft' ); ?></span>
661 + </h3>
662 + <div class="inside">
663 + <table class="bws_system_info">
664 + <thead><tr><th><?php _e( 'Environment', 'bestwebsoft' ); ?></th><td></td></tr></thead>
665 + <tbody>
666 + <?php foreach ( $system_info['system_info'] 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 + </tbody>
673 + </table>
674 + <table class="bws_system_info">
675 + <thead><tr><th><?php _e( 'Active Plugins', 'bestwebsoft' ); ?></th><th></th></tr></thead>
676 + <tbody>
677 + <?php foreach ( $system_info['active_plugins'] as $key => $value ) { ?>
678 + <tr>
679 + <td scope="row"><?php echo $key; ?></td>
680 + <td scope="row"><?php echo $value; ?></td>
681 + </tr>
682 + <?php } ?>
683 + </tbody>
684 + </table>
685 + <table class="bws_system_info">
686 + <thead><tr><th><?php _e( 'Inactive Plugins', 'bestwebsoft' ); ?></th><th></th></tr></thead>
687 + <tbody>
688 + <?php
689 + if ( ! empty( $system_info['inactive_plugins'] ) ) {
690 + foreach ( $system_info['inactive_plugins'] as $key => $value ) { ?>
691 + <tr>
692 + <td scope="row"><?php echo $key; ?></td>
693 + <td scope="row"><?php echo $value; ?></td>
694 + </tr>
695 + <?php }
696 + } ?>
697 + </tbody>
698 + </table>
699 + <div class="clear"></div>
700 + <form method="post" action="admin.php?page=bws_plugins">
701 + <p>
702 + <input type="hidden" name="bwsmn_form_submit" value="submit" />
703 + <input type="submit" class="button-primary" value="<?php _e( 'Send to support', 'bestwebsoft' ) ?>" />
704 + <?php wp_nonce_field( plugin_basename(__FILE__), 'bwsmn_nonce_submit' ); ?>
705 + </p>
706 + </form>
707 + <form method="post" action="admin.php?page=bws_plugins">
708 + <p>
709 + <input type="hidden" name="bwsmn_form_submit_custom_email" value="submit" />
710 + <input type="submit" class="button" value="<?php _e( 'Send to custom email &#187;', 'bestwebsoft' ) ?>" />
711 + <input type="text" value="<?php echo $bwsmn_form_email; ?>" name="bwsmn_form_email" />
712 + <?php wp_nonce_field( plugin_basename(__FILE__), 'bwsmn_nonce_submit_custom_email' ); ?>
713 + </p>
714 + </form>
715 + </div>
716 + </div>
717 + </div>
718 + <?php } else { ?>
719 + <form method="post" action="admin.php?page=bws_plugins">
720 + <input type="hidden" name="bwsmn_form_submit_switch" value="submit" />
721 + <input type="submit" class="bws_switch_link" value="<?php _e( 'Switch to old interface', 'bestwebsoft' ) ?>" />
722 + <?php wp_nonce_field( plugin_basename(__FILE__), 'bwsmn_nonce_submit_switch' ); ?>
723 + </form>
724 + </h2>
725 + <div class="clear"></div>
726 + <h2 class="nav-tab-wrapper">
727 + <a class="nav-tab<?php if ( !isset( $_GET['action'] ) ) echo ' nav-tab-active'; ?>" href="admin.php?page=bws_plugins"><?php _e( 'Plugins', 'bestwebsoft' ); ?></a>
728 + <?php if ( $wp_version >= '3.4' ) { ?>
729 + <a class="nav-tab<?php if ( isset( $_GET['action'] ) && 'themes' == $_GET['action'] ) echo ' nav-tab-active'; ?>" href="admin.php?page=bws_plugins&amp;action=themes"><?php _e( 'Themes', 'bestwebsoft' ); ?></a>
730 + <?php } ?>
731 + <a class="nav-tab<?php if ( isset( $_GET['action'] ) && 'system_status' == $_GET['action'] ) echo ' nav-tab-active'; ?>" href="admin.php?page=bws_plugins&amp;action=system_status"><?php _e( 'System status', 'bestwebsoft' ); ?></a>
732 + </h2>
733 + <?php if ( !isset( $_GET['action'] ) ) { ?>
734 + <ul class="subsubsub">
735 + <li><a <?php if ( !isset( $_GET['sub'] ) ) echo 'class="current" '; ?>href="admin.php?page=bws_plugins"><?php _e( 'All', 'bestwebsoft' ); ?></a></li> |
736 + <li><a <?php if ( isset( $_GET['sub'] ) && 'installed' == $_GET['sub'] ) echo 'class="current" '; ?>href="admin.php?page=bws_plugins&amp;sub=installed"><?php _e( 'Installed', 'bestwebsoft' ); ?></a></li> |
737 + <li><a <?php if ( isset( $_GET['sub'] ) && 'recommended' == $_GET['sub'] ) echo 'class="current" '; ?>href="admin.php?page=bws_plugins&amp;sub=recommended"><?php _e( 'Recommended', 'bestwebsoft' ); ?></a></li>
738 + </ul>
739 + <div class="clear"></div>
740 + <?php if ( ( isset( $_GET['sub'] ) && 'installed' == $_GET['sub'] ) || !isset( $_GET['sub'] ) ) { ?>
741 + <h4 class="bws_installed"><?php _e( 'Installed plugins', 'bestwebsoft' ); ?></h4>
742 + <?php foreach ( $all_plugins as $key_plugin => $value_plugin ) {
340 743
341 - if ( isset( $_POST['bws_plugin_action_submit'] ) && isset( $_POST['bws_install_plugin'] ) && check_admin_referer( plugin_basename(__FILE__), 'bws_license_install_nonce_name' ) ) {
744 + if ( isset( $bws_plugins_pro[ $key_plugin ] ) ) {
745 + $key_plugin_explode = explode( '-plugin-pro/', $key_plugin );
746 + if ( isset( $key_plugin_explode[1] ) )
747 + $icon = $key_plugin_explode[0];
748 + else {
749 + $key_plugin_explode = explode( '-pro/', $key_plugin );
750 + $icon = $key_plugin_explode[0];
751 + }
752 + } elseif ( isset( $bws_plugins[ $key_plugin ] ) ) {
753 + $key_plugin_explode = explode( '-plugin/', $key_plugin );
754 + if ( isset( $key_plugin_explode[1] ) )
755 + $icon = $key_plugin_explode[0];
756 + else {
757 + $key_plugin_explode = explode( '/', $key_plugin );
758 + $icon = $key_plugin_explode[0];
759 + }
760 + }
342 761
343 - $bws_license_plugin = esc_html( $_POST['bws_install_plugin'] );
344 -
345 - echo '<h2>' . __( 'Installing Plugin', 'bestwebsoft' ) . ': ' . $plugins_array[ $bws_license_plugin ]['name'] . '</h2>';
346 -
347 - $bstwbsftwppdtplgns_options[ $bws_license_plugin ] = $bws_license_key;
348 -
349 - $url = $plugins_array[ $bws_license_plugin ]['link'] . '&download_from=5';
350 -
351 - echo '<p>' . __( "Downloading install package from", 'bestwebsoft' ) . ' ' . $url . '</p>';
352 -
353 - $uploadDir = wp_upload_dir();
354 - $zip_name = explode( '/', $bws_license_plugin );
355 -
356 - if ( !function_exists( 'curl_init' ) ) {
357 - $received_content = file_get_contents( $url );
358 - } else {
359 - $ch = curl_init();
360 - curl_setopt( $ch, CURLOPT_URL, $url );
361 - curl_setopt( $ch, CURLOPT_RETURNTRANSFER, true );
362 - curl_setopt( $ch, CURLOPT_FOLLOWLOCATION, true );
363 - $received_content = curl_exec( $ch );
364 - curl_close( $ch );
365 - }
366 -
367 - if ( ! $received_content ) {
368 - $error = __( "Failed to download the zip archive. Please, upload the plugin manually", 'bestwebsoft' );
369 - } else {
370 - if ( is_writable( $uploadDir["path"] ) ) {
371 - $file_put_contents = $uploadDir["path"] . "/" . $zip_name[0] . ".zip";
372 -
373 - if ( file_put_contents( $file_put_contents, $received_content ) ) {
374 - @chmod( $file_put_contents, octdec( 755 ) );
375 -
376 - echo '<p>' . __( 'Unpacking the package', 'bestwebsoft' ) . '...</p>';
377 -
378 - if ( class_exists( 'ZipArchive' ) ) {
379 - $zip = new ZipArchive();
380 - if ( $zip->open( $file_put_contents ) === TRUE ) {
381 - echo '<p>' . __( 'Installing the plugin', 'bestwebsoft' ) . '...</p>';
382 - $zip->extractTo( WP_PLUGIN_DIR );
383 - $zip->close();
384 - } else {
385 - $error = __( "Failed to open the zip archive. Please, upload the plugin manually", 'bestwebsoft' );
386 - }
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 - }
394 - if ( empty( $error ) )
395 - echo '<p>' . __( 'Successfully installed the plugin', 'bestwebsoft' ) . ' <strong>' . $plugins_array[ $bws_license_plugin ]['name'] . '</strong></p>';
396 -
397 - @unlink( $file_put_contents );
398 - } else {
399 - $error = __( "Failed to download the zip archive. Please, upload the plugin manually", 'bestwebsoft' );
400 - }
762 + if ( in_array( $key_plugin, $active_plugins ) || is_plugin_active_for_network( $key_plugin ) ) { ?>
763 + <?php if ( isset( $bws_plugins_pro[ $key_plugin ] ) ) { ?>
764 + <div class="bws_product_box bws_exist_overlay">
765 + <div class="bws_product">
766 + <div class="bws_product_title"><?php echo $value_plugin["Name"]; ?></div>
767 + <div class="bws_product_content">
768 + <div class="bws_product_icon">
769 + <div class="bws_product_icon_pro"></div>
770 + <img src="<?php echo plugins_url( "icons/" , __FILE__ ) . $icon . '.png'; ?>"/>
771 + </div>
772 + <div class="bws_product_description"><?php echo $value_plugin["Description"]; ?></div>
773 + </div>
774 + <div class="clear"></div>
775 + </div>
776 + <div class="bws_product_links">
777 + <a href="<?php echo $bws_plugins_pro[ $key_plugin ]["link"]; ?>" target="_blank"><?php _e( "Learn more", 'bestwebsoft' ); ?></a>
778 + <span> | </span>
779 + <a href="<?php echo $bws_plugins_pro[ $key_plugin ]["settings"]; ?>" target="_blank"><?php _e( "Settings", 'bestwebsoft' ); ?></a>
780 + </div>
781 + </div>
782 + <?php } elseif ( isset( $bws_plugins[ $key_plugin ] ) ) { ?>
783 + <div class="bws_product_box bws_product_free">
784 + <div class="bws_product">
785 + <div class="bws_product_title"><?php echo $value_plugin["Name"]; ?></div>
786 + <div class="bws_product_content">
787 + <div class="bws_product_icon">
788 + <img src="<?php echo plugins_url( "icons/" , __FILE__ ) . $icon . '.png'; ?>"/>
789 + </div>
790 + <div class="bws_product_description"><?php echo $bws_plugins[ $key_plugin ]["description"]; ?></div>
791 + </div>
792 + <?php if ( isset( $bws_plugins[ $key_plugin ]['pro_version'] ) && isset( $bws_plugins_pro[ $bws_plugins[ $key_plugin ]['pro_version'] ] ) ) { ?>
793 + <a class="bws_product_button" href="<?php echo $bws_plugins_pro[ $bws_plugins[ $key_plugin ]['pro_version'] ]["purchase"]; ?>" target="_blank">
794 + <?php _e( 'Go', 'bestwebsoft' );?> <strong>PRO</strong>
795 + </a>
796 + <?php } else { ?>
797 + <a class="bws_product_button bws_donate_button" href="<?php echo $bws_donate_link; ?>" target="_blank">
798 + <strong><?php _e( 'DONATE', 'bestwebsoft' );?></strong>
799 + </a>
800 + <?php } ?>
801 + <div class="clear"></div>
802 + </div>
803 + <div class="bws_product_links">
804 + <a href="<?php echo $bws_plugins[ $key_plugin ]["link"]; ?>" target="_blank"><?php _e( "Learn more", 'bestwebsoft' ); ?></a>
805 + <span> | </span>
806 + <a href="<?php echo $bws_plugins[ $key_plugin ]["settings"]; ?>" target="_blank"><?php _e( "Settings", 'bestwebsoft' ); ?></a>
807 + </div>
808 + </div>
809 + <?php }
401 810 } else {
402 - $error = __( "UploadDir is not writable. Please, upload the plugin manually", 'bestwebsoft' );
811 + if ( isset( $bws_plugins_pro[ $key_plugin ] ) ) { ?>
812 + <div class="bws_product_box bws_product_deactivated">
813 + <div class="bws_product">
814 + <div class="bws_product_title"><?php echo $value_plugin["Name"]; ?></div>
815 + <div class="bws_product_content">
816 + <div class="bws_product_icon">
817 + <div class="bws_product_icon_pro"></div>
818 + <img src="<?php echo plugins_url( "icons/" , __FILE__ ) . $icon . '.png'; ?>"/>
819 + </div>
820 + <div class="bws_product_description"><?php echo $bws_plugins_pro[ $key_plugin ]["description"]; ?></div>
821 + </div>
822 + <div class="clear"></div>
823 + </div>
824 + <div class="bws_product_links">
825 + <a href="<?php echo $bws_plugins_pro[ $key_plugin ]["link"]; ?>" target="_blank"><?php _e( "Learn more", 'bestwebsoft' ); ?></a>
826 + <span> | </span>
827 + <a class="bws_activate" href="plugins.php" title="<?php _e( "Activate this plugin", 'bestwebsoft' ); ?>" target="_blank"><?php _e( "Activate", 'bestwebsoft' ); ?></a>
828 + </div>
829 + </div>
830 + <?php } elseif ( isset( $bws_plugins[ $key_plugin ] ) ) { ?>
831 + <div class="bws_product_box bws_product_deactivated bws_product_free">
832 + <div class="bws_product">
833 + <div class="bws_product_title"><?php echo $value_plugin["Name"]; ?></div>
834 + <div class="bws_product_content">
835 + <div class="bws_product_icon">
836 + <img src="<?php echo plugins_url( "icons/" , __FILE__ ) . $icon . '.png'; ?>"/>
837 + </div>
838 + <div class="bws_product_description"><?php echo $bws_plugins[ $key_plugin ]["description"]; ?></div>
839 + </div>
840 + <?php if ( isset( $bws_plugins[ $key_plugin ]['pro_version'] ) && isset( $bws_plugins_pro[ $bws_plugins[ $key_plugin ]['pro_version'] ] ) ) { ?>
841 + <a class="bws_product_button" href="<?php echo $bws_plugins_pro[ $bws_plugins[ $key_plugin ]['pro_version'] ]["purchase"]; ?>" target="_blank">
842 + <?php _e( 'Go', 'bestwebsoft' );?> <strong>PRO</strong>
843 + </a>
844 + <?php } else { ?>
845 + <a class="bws_product_button bws_donate_button" href="<?php echo $bws_donate_link; ?>" target="_blank">
846 + <strong><?php _e( 'DONATE', 'bestwebsoft' );?></strong>
847 + </a>
848 + <?php } ?>
849 + <div class="clear"></div>
850 + </div>
851 + <div class="bws_product_links">
852 + <a href="<?php echo $bws_plugins[ $key_plugin ]["link"]; ?>" target="_blank"><?php _e( "Learn more", 'bestwebsoft' ); ?></a>
853 + <span> | </span>
854 + <a class="bws_activate" href="plugins.php" title="<?php _e( "Activate this plugin", 'bestwebsoft' ); ?>" target="_blank"><?php _e( "Activate", 'bestwebsoft' ); ?></a>
855 + </div>
856 + </div>
857 + <?php }
403 858 }
404 859 }
860 + } ?>
861 + <div class="clear"></div>
862 + <?php if ( ( isset( $_GET['sub'] ) && 'recommended' == $_GET['sub'] ) || !isset( $_GET['sub'] ) ) { ?>
863 + <h4 class="bws_recommended"><?php _e( 'Recommended plugins', 'bestwebsoft' ); ?></h4>
864 + <?php foreach ( $recommend_plugins as $key_plugin => $value_plugin ) {
405 865
406 - if ( file_exists( WP_PLUGIN_DIR . '/' . $zip_name[0] ) ) {
407 - echo '<p><a href="' . wp_nonce_url( 'admin.php?page=bws_panel&amp;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>';
408 - } else {
409 - if ( empty( $error ) )
410 - $error = __( "Failed to download the zip archive. Please, upload the plugin manually", 'bestwebsoft' );
411 -
412 - echo '<p class="error">' . $error . '</p>';
413 - echo '<p><a href="' . self_admin_url( 'admin.php?page=bws_panel' ) . '" target="_parent">' . __( 'Return to BestWebSoft Panel', 'bestwebsoft' ) . '</a></p>';
414 - }
415 - } else { ?>
416 - <ul class="subsubsub">
417 - <li><a <?php if ( !isset( $_GET['sub'] ) ) echo 'class="current" '; ?>href="admin.php?page=bws_panel<?php if ( 'all' != $plugin_category ) echo '&amp;category=' . $plugin_category; ?>"><?php _e( 'All', 'bestwebsoft' ); ?></a></li> |
418 - <li><a <?php if ( isset( $_GET['sub'] ) && 'installed' == $_GET['sub'] ) echo 'class="current" '; ?>href="admin.php?page=bws_panel&amp;sub=installed<?php if ( 'all' != $plugin_category ) echo '&amp;category=' . $plugin_category; ?>"><?php _e( 'Installed', 'bestwebsoft' ); ?></a></li> |
419 - <li><a <?php if ( isset( $_GET['sub'] ) && 'not_installed' == $_GET['sub'] ) echo 'class="current" '; ?>href="admin.php?page=bws_panel&amp;sub=not_installed<?php if ( 'all' != $plugin_category ) echo '&amp;category=' . $plugin_category; ?>"><?php _e( 'Not Installed', 'bestwebsoft' ); ?></a></li>
420 - </ul>
421 - <div class="clear"></div>
422 - <div class="bws-filter-top">
423 - <h2>
424 - <span class="bws-toggle-indicator"></span>
425 - <?php _e( 'Filter results', 'bestwebsoft' ); ?>
426 - </h2>
427 - <div class="bws-filter-top-inside">
428 - <div class="bws-filter-title"><?php _e( 'Category', 'bestwebsoft' ); ?></div>
429 - <ul class="bws-category">
430 - <li>
431 - <?php $sub_in_url = ( isset( $_GET['sub'] ) && in_array( $_GET['sub'], array( 'installed', 'not_installed' ) ) ) ? '&amp;sub=' . $_GET['sub'] : ''; ?>
432 - <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' ); ?>
433 - <span>(<?php echo count( $bws_plugins ); ?>)</span>
434 - </a>
435 - </li>
436 - <?php foreach ( $bws_plugins_category as $category_key => $category_value ) { ?>
437 - <li>
438 - <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 . '&amp;category=' . $category_key ) ); ?>"><?php echo $category_value['name']; ?>
439 - <span>(<?php echo $category_value['count']; ?>)</span>
440 - </a>
441 - </li>
866 + if ( isset( $bws_plugins_pro[ $key_plugin ] ) ) {
867 + $key_plugin_explode = explode( '-plugin-pro/', $key_plugin );
868 + if ( isset( $key_plugin_explode[1] ) )
869 + $icon = $key_plugin_explode[0];
870 + else {
871 + $key_plugin_explode = explode( '-pro/', $key_plugin );
872 + $icon = $key_plugin_explode[0];
873 + }
874 + } elseif ( isset( $bws_plugins[ $key_plugin ] ) ) {
875 + $key_plugin_explode = explode( '-plugin/', $key_plugin );
876 + if ( isset( $key_plugin_explode[1] ) )
877 + $icon = $key_plugin_explode[0];
878 + else {
879 + $key_plugin_explode = explode( '/', $key_plugin );
880 + $icon = $key_plugin_explode[0];
881 + }
882 + }
883 + ?>
884 + <div class="bws_product_box">
885 + <div class="bws_product">
886 + <div class="bws_product_title"><?php echo $value_plugin["name"]; ?></div>
887 + <div class="bws_product_content">
888 + <div class="bws_product_icon">
889 + <?php if ( isset( $bws_plugins[ $key_plugin ]['pro_version'] ) && isset( $bws_plugins_pro[ $bws_plugins[ $key_plugin ]['pro_version'] ] ) ) { ?>
890 + <div class="bws_product_icon_pro"></div>
891 + <?php } ?>
892 + <img src="<?php echo plugins_url( "icons/" , __FILE__ ) . $icon . '.png'; ?>"/>
893 + </div>
894 + <div class="bws_product_description"><?php echo $bws_plugins[ $key_plugin ]["description"]; ?></div>
895 + </div>
896 + <?php if ( isset( $bws_plugins[ $key_plugin ]['pro_version'] ) && isset( $bws_plugins_pro[ $bws_plugins[ $key_plugin ]['pro_version'] ] ) ) { ?>
897 + <a class="bws_product_button" href="<?php echo $bws_plugins_pro[ $bws_plugins[ $key_plugin ]['pro_version'] ]["link"]; ?>" target="_blank">
898 + <?php echo _e( 'Go', 'bestwebsoft' );?> <strong>PRO</strong>
899 + </a>
900 + <?php } else { ?>
901 + <a class="bws_product_button bws_donate_button" href="<?php echo $bws_donate_link; ?>" target="_blank">
902 + <strong><?php echo _e( 'DONATE', 'bestwebsoft' );?></strong>
903 + </a>
442 904 <?php } ?>
443 - </ul>
905 + </div>
906 + <div class="clear"></div>
907 + <div class="bws_product_links">
908 + <a href="<?php echo $bws_plugins[ $key_plugin ]["link"]; ?>" target="_blank"><?php echo __( "Learn more", 'bestwebsoft' ); ?></a>
909 + <span> | </span>
910 + <a href="<?php echo $bws_plugins[ $key_plugin ]["wp_install"]; ?>" target="_blank"><?php echo __( "Install now", 'bestwebsoft' ); ?></a>
911 + </div>
444 912 </div>
445 - </div>
446 - <div class="bws-products">
447 - <?php $nothing_found = true;
448 - foreach ( $bws_plugins as $key_plugin => $value_plugin ) {
913 + <?php }
914 + } ?>
915 + <?php } elseif ( 'themes' == $_GET['action'] ) { ?>
916 + <div id="availablethemes">
917 + <?php
918 + global $tabs, $tab, $paged, $type, $theme_field_defaults;
919 + include( ABSPATH . 'wp-admin/includes/theme-install.php' );
920 + include( ABSPATH . 'wp-admin/includes/class-wp-themes-list-table.php' );
921 + include( ABSPATH . 'wp-admin/includes/class-wp-theme-install-list-table.php' );
449 922
450 - if ( 'all' != $plugin_category && isset( $bws_plugins_category[ $plugin_category ] ) && ! in_array( $plugin_category, $value_plugin['category'] ) )
451 - continue;
923 + $theme_class = new WP_Theme_Install_List_Table();
924 + $paged = $theme_class->get_pagenum();
925 + $per_page = 36;
926 + $args = array( 'page' => $paged, 'per_page' => $per_page, 'fields' => $theme_field_defaults );
927 + $args['author'] = 'bestwebsoft';
928 + $args = apply_filters( 'install_themes_table_api_args_search', $args );
929 + $api = themes_api( 'query_themes', $args );
452 930
453 - $key_plugin_explode = explode( '/', $key_plugin );
931 + if ( is_wp_error( $api ) )
932 + wp_die( $api->get_error_message() . '</p> <p><a href="#" onclick="document.location.reload(); return false;">' . __( 'Try again' ) . '</a>' );
454 933
455 - $icon = isset( $value_plugin['icon'] ) ? $value_plugin['icon'] : '//ps.w.org/' . $key_plugin_explode[0] . '/assets/icon-128x128.png';
456 - $is_pro_isset = isset( $value_plugin['pro_version'] );
457 - $is_installed = array_key_exists( $key_plugin, $all_plugins );
458 - $is_active = in_array( $key_plugin, $active_plugins ) || isset( $sitewide_active_plugins[ $key_plugin ] );
934 + $theme_class->items = $api->themes;
935 + $theme_class->set_pagination_args( array(
936 + 'total_items' => $api->info['results'],
937 + 'per_page' => $per_page,
938 + 'infinite_scroll' => true,
939 + ) );
940 + $themes = $theme_class->items;
941 + foreach ( $themes as $theme ) {
942 + ?><div class="available-theme installable-theme"><?php
943 + global $themes_allowedtags;
944 + if ( empty( $theme ) )
945 + return;
459 946
460 - $is_pro_installed = $is_pro_active = false;
461 - if ( $is_pro_isset ) {
462 - $is_pro_installed = array_key_exists( $value_plugin['pro_version'], $all_plugins );
463 - $is_pro_active = in_array( $value_plugin['pro_version'], $active_plugins ) || isset( $sitewide_active_plugins[ $value_plugin['pro_version'] ] );
464 - }
947 + $name = wp_kses( $theme->name, $themes_allowedtags );
948 + $author = wp_kses( $theme->author, $themes_allowedtags );
949 + $preview_title = sprintf( __('Preview &#8220;%s&#8221;'), $name );
950 + $preview_url = add_query_arg( array(
951 + 'tab' => 'theme-information',
952 + 'theme' => $theme->slug,
953 + ), self_admin_url( 'theme-install.php' ) );
465 954
466 - if ( ( isset( $_GET['sub'] ) && 'installed' == $_GET['sub'] && ! $is_pro_installed && ! $is_installed ) ||
467 - ( isset( $_GET['sub'] ) && 'not_installed' == $_GET['sub'] && ( $is_pro_installed || $is_installed ) ) )
468 - continue;
955 + $actions = array();
469 956
470 - $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"';
957 + $install_url = add_query_arg( array(
958 + 'action' => 'install-theme',
959 + 'theme' => $theme->slug,
960 + ), self_admin_url( 'update.php' ) );
471 961
472 - $nothing_found = false; ?>
473 - <div class="bws_product_box<?php if ( $is_active || $is_pro_active ) echo ' bws_product_active'; ?>">
474 - <div class="bws_product_image">
475 - <a <?php echo $link_attr; ?>><img src="<?php echo $icon; ?>"/></a>
476 - </div>
477 - <div class="bws_product_content">
478 - <div class="bws_product_title"><a <?php echo $link_attr; ?>><?php echo $value_plugin['name']; ?></a></div>
479 - <div class="bws-version">
480 - <?php
481 - if ( $is_pro_installed ) {
482 - echo '<span';
483 - if ( ! empty( $value_plugin['expired'] ) || ! empty( $value_plugin['update_availible'] ) )
484 - echo ' class="bws-update-available"';
485 - echo '>v ' . $all_plugins[ $value_plugin['pro_version'] ]['Version'] . '</span>';
486 - } elseif ( $is_installed ) {
487 - echo '<span';
488 - if ( ! empty( $value_plugin['expired'] ) || ! empty( $value_plugin['update_availible'] ) )
489 - echo ' class="bws-update-available"';
490 - echo '>v ' . $all_plugins[ $key_plugin ]['Version'] . '</span>';
491 - } else {
492 - echo '<span>' . __( 'Not installed', 'bestwebsoft' ) . '</span>';
493 - }
962 + $update_url = add_query_arg( array(
963 + 'action' => 'upgrade-theme',
964 + 'theme' => $theme->slug,
965 + ), self_admin_url( 'update.php' ) );
494 966
495 - if ( ! empty( $value_plugin['expired'] ) ) {
496 - echo ' - <a class="bws-update-now" href="http://support.bestwebsoft.com/hc/en-us/articles/202356359" target="_blank">' . __( 'Renew to get updates', 'bestwebsoft' ) . '</a>';
497 - } elseif ( ! empty( $value_plugin['update_availible'] ) ) {
498 - $r = $update_availible_all->response[ $value_plugin['update_availible'] ];
499 - 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>';
500 - } ?>
501 - </div>
502 - <div class="bws_product_description">
503 - <?php echo ( strlen( $value_plugin['description'] ) > 100 ) ? substr( $value_plugin['description'], 0, 100 ) . '...' : $value_plugin['description']; ?>
504 - </div>
505 - <div class="bws_product_links">
506 - <?php if ( $is_active || $is_pro_active ) {
507 - if ( $is_pro_isset ) {
508 - if ( ! $is_pro_installed ) {
509 - if ( ! empty( $plugins_array ) && array_key_exists( $value_plugin['pro_version'], $plugins_array ) ) { ?>
510 - <form method="post" action="">
511 - <input type="submit" class="button button-secondary" value="<?php _e( 'Install Now', 'bestwebsoft' ); ?>" />
512 - <input type="hidden" name="bws_plugin_action_submit" value="submit" />
513 - <input type="hidden" name="bws_install_plugin" value="<?php echo $value_plugin['pro_version']; ?>" />
514 - <?php wp_nonce_field( plugin_basename(__FILE__), 'bws_license_install_nonce_name' ); ?>
515 - </form>
516 - <?php } else { ?>
517 - <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>
518 - <?php }
519 - }
520 - } else { ?>
521 - <a class="bws_donate" href="http://bestwebsoft.com/donate/" target="_blank"><?php _e( 'Donate', 'bestwebsoft' ); ?></a> <span>|</span>
522 - <?php }
523 -
524 - if ( $is_pro_active ) { ?>
525 - <a class="bws_settings" href="<?php echo $bws_plugins[ $key_plugin ]["pro_settings"]; ?>"><?php _e( 'Settings', 'bestwebsoft' ); ?></a>
526 - <?php } else { ?>
527 - <a class="bws_settings" href="<?php echo $bws_plugins[ $key_plugin ]["settings"]; ?>"><?php _e( 'Settings', 'bestwebsoft' ); ?></a>
528 - <?php }
529 - } else {
530 - if ( $is_pro_installed ) { ?>
531 - <a class="button button-secondary" href="<?php echo wp_nonce_url( 'admin.php?page=bws_panel&amp;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>
532 - <?php } elseif ( ! empty( $plugins_array ) && isset( $value_plugin['pro_version'] ) && array_key_exists( $value_plugin['pro_version'], $plugins_array ) ) { ?>
533 - <form method="post" action="">
534 - <input type="submit" class="button button-secondary" value="<?php _e( 'Install Now', 'bestwebsoft' ); ?>" />
535 - <input type="hidden" name="bws_plugin_action_submit" value="submit" />
536 - <input type="hidden" name="bws_install_plugin" value="<?php echo $value_plugin['pro_version']; ?>" />
537 - <?php wp_nonce_field( plugin_basename(__FILE__), 'bws_license_install_nonce_name' ); ?>
538 - </form>
539 - <?php } elseif ( $is_installed ) { ?>
540 - <a class="button button-secondary" href="<?php echo wp_nonce_url( 'admin.php?page=bws_panel&amp;bws_activate_plugin=' . $key_plugin, 'bws_activate_plugin' . $key_plugin ); ?>" title="<?php _e( 'Activate this plugin', 'bestwebsoft' ); ?>"><?php _e( 'Activate', 'bestwebsoft' ); ?></a>
541 - <?php } else {
542 - $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' ) ); ?>
543 - <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>
544 - <?php }
545 - } ?>
546 - </div>
547 - </div>
548 - <div class="clear"></div>
549 - </div>
550 - <?php }
551 - if ( $nothing_found ) { ?>
552 - <p class="description"><?php _e( 'Nothing found. Try another criteria.', 'bestwebsoft' ); ?></p>
553 - <?php } ?>
554 - </div>
555 - <div id="bws-filter-wrapper">
556 - <div class="bws-filter">
557 - <div class="bws-filter-title"><?php _e( 'Category', 'bestwebsoft' ); ?></div>
558 - <ul class="bws-category">
559 - <li>
560 - <?php $sub_in_url = ( isset( $_GET['sub'] ) && in_array( $_GET['sub'], array( 'installed', 'not_installed' ) ) ) ? '&amp;sub=' . $_GET['sub'] : ''; ?>
561 - <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' ); ?>
562 - <span>(<?php echo count( $bws_plugins ); ?>)</span>
563 - </a>
564 - </li>
565 - <?php foreach ( $bws_plugins_category as $category_key => $category_value ) { ?>
566 - <li>
567 - <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 . '&amp;category=' . $category_key ) ); ?>"><?php echo $category_value['name']; ?>
568 - <span>(<?php echo $category_value['count']; ?>)</span>
569 - </a>
570 - </li>
571 - <?php } ?>
572 - </ul>
573 - </div>
574 - </div><!-- #bws-filter-wrapper -->
575 - <div class="clear"></div>
576 - <?php }
577 - } elseif ( 'bws_themes' == $_GET['page'] ) {
578 - require_once( dirname( __FILE__ ) . '/product_list.php' ); ?>
579 - <h1><?php _e( 'Themes', 'bestwebsoft' ); ?></h1>
580 - <div id="availablethemes" class="bws-availablethemes">
581 - <?php if ( $wp_version < '3.9' ) {
582 - foreach ( $themes as $theme ) { ?>
583 - <div class="available-theme installable-theme"><?php
584 - $installed_theme = wp_get_theme( $theme->slug ); ?>
585 - <a class="screenshot" href="<?php echo esc_url( $theme->href ); ?>">
586 - <img src="<?php echo plugins_url( "icons/themes/" , __FILE__ ) . $theme->slug . '.png'; ?>" width='150' />
587 - </a>
588 - <h3><?php echo $theme->name; ?></h3>
589 - <div class="theme-author"><?php printf( __( 'By %s', 'bestwebsoft' ), 'BestWebSoft' ); ?></div>
590 - <div class="action-links">
591 - <ul>
592 - <?php if ( $installed_theme->exists() ) { ?>
593 - <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>
594 - <?php } ?>
595 - <li><a class="theme-detail" href="<?php echo esc_url( $theme->href ); ?>" target="_blank"><?php _e( 'Learn More', 'bestwebsoft' ); ?></a></li>
596 - </ul>
597 - </div>
967 + $status = 'install';
968 + $installed_theme = wp_get_theme( $theme->slug );
969 + if ( $installed_theme->exists() ) {
970 + if ( version_compare( $installed_theme->get('Version'), $theme->version, '=' ) )
971 + $status = 'latest_installed';
972 + elseif ( version_compare( $installed_theme->get('Version'), $theme->version, '>' ) )
973 + $status = 'newer_installed';
974 + else
975 + $status = 'update_available';
976 + }
977 + switch ( $status ) {
978 + default:
979 + case 'install':
980 + $actions[] = '<a class="install-now" href="' . esc_url( wp_nonce_url( $install_url, 'install-theme_' . $theme->slug ) ) . '" title="' . esc_attr( sprintf( __( 'Install %s' ), $name ) ) . '">' . __( 'Install Now' ) . '</a>';
981 + break;
982 + case 'update_available':
983 + $actions[] = '<a class="install-now" href="' . esc_url( wp_nonce_url( $update_url, 'upgrade-theme_' . $theme->slug ) ) . '" title="' . esc_attr( sprintf( __( 'Update to version %s' ), $theme->version ) ) . '">' . __( 'Update' ) . '</a>';
984 + break;
985 + case 'newer_installed':
986 + case 'latest_installed':
987 + $actions[] = '<span class="install-now" title="' . esc_attr__( 'This theme is already installed and is up to date' ) . '">' . _x( 'Installed', 'theme' ) . '</span>';
988 + break;
989 + }
990 + $actions[] = '<a class="install-theme-preview" href="' . esc_url( $preview_url ) . '" title="' . esc_attr( sprintf( __( 'Preview %s' ), $name ) ) . '">' . __( 'Preview' ) . '</a>';
991 + $actions = apply_filters( 'theme_install_actions', $actions, $theme );
992 + ?>
993 + <a class="screenshot install-theme-preview" href="<?php echo esc_url( $preview_url ); ?>" title="<?php echo esc_attr( $preview_title ); ?>">
994 + <img src='<?php echo esc_url( $theme->screenshot_url ); ?>' width='150' />
995 + </a>
996 + <h3><?php echo $name; ?></h3>
997 + <div class="theme-author"><?php printf( __( 'By %s' ), $author ); ?></div>
998 + <div class="action-links">
999 + <ul>
1000 + <?php foreach ( $actions as $action ): ?>
1001 + <li><?php echo $action; ?></li>
1002 + <?php endforeach; ?>
1003 + <li class="hide-if-no-js"><a href="#" class="theme-detail"><?php _e('Details') ?></a></li>
1004 + </ul>
598 1005 </div>
599 - <?php }
600 - } else { ?>
601 - <div class="theme-browser">
602 - <div class="themes">
603 - <?php foreach ( $themes as $key => $theme ) {
604 - $installed_theme = wp_get_theme( $theme->slug ); ?>
605 - <div class="theme" tabindex="0">
606 - <div class="theme-screenshot">
607 - <img src="<?php echo plugins_url( "icons/themes/" , __FILE__ ) . $theme->slug . '.png'; ?>" alt="" />
608 - </div>
609 - <div class="theme-author"><?php printf( __( 'By %s', 'bestwebsoft' ), 'BestWebSoft' ); ?></div>
610 - <h3 class="theme-name"><?php echo $theme->name; ?></h3>
611 - <div class="theme-actions">
612 - <a class="button button-secondary preview install-theme-preview" href="<?php echo $theme->href; ?>" target="_blank"><?php esc_html_e( 'Learn More', 'bestwebsoft' ); ?></a>
613 - </div>
614 - <?php if ( $installed_theme->exists() ) { ?>
615 - <div class="theme-installed"><?php _e( 'Already Installed', 'bestwebsoft' ); ?></div>
616 - <?php } ?>
617 - </div>
618 - <?php } ?>
619 - <br class="clear" />
620 - </div>
621 - </div>
622 - <?php } ?>
623 - <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>
1006 + <?php $theme_class->install_theme_info( $theme );
1007 + ?></div>
1008 + <?php }
1009 + // end foreach $theme_names
1010 + $theme_class->theme_installer();
1011 + ?>
624 1012 </div>
625 - <?php } elseif ( 'bws_system_status' == $_GET['page'] ) { ?>
626 - <h1><?php _e( 'System status', 'bestwebsoft' ); ?></h1>
627 - <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>
1013 + <?php } elseif ( 'system_status' == $_GET['action'] ) { ?>
1014 + <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>
628 1015 <div class="error" <?php if ( "" == $error ) echo "style=\"display:none\""; ?>><p><strong><?php echo $error; ?></strong></p></div>
629 - <form method="post" action="">
630 - <p>
631 - <input type="hidden" name="bwsmn_form_submit" value="submit" />
632 - <input type="submit" class="button-primary" value="<?php _e( 'Send to support', 'bestwebsoft' ) ?>" />
633 - <?php wp_nonce_field( plugin_basename(__FILE__), 'bwsmn_nonce_submit' ); ?>
634 - </p>
635 - </form>
636 - <form method="post" action="">
637 - <p>
638 - <input type="hidden" name="bwsmn_form_submit_custom_email" value="submit" />
639 - <input type="submit" class="button" value="<?php _e( 'Send to custom email &#187;', 'bestwebsoft' ) ?>" />
640 - <input type="text" maxlength="250" value="<?php echo $bwsmn_form_email; ?>" name="bwsmn_form_email" />
641 - <?php wp_nonce_field( plugin_basename(__FILE__), 'bwsmn_nonce_submit_custom_email' ); ?>
642 - </p>
643 - </form>
1016 + <h3><?php _e( 'System status', 'bestwebsoft' ); ?></h3>
644 1017 <div class="inside">
645 1018 <table class="bws_system_info">
646 1019 <thead><tr><th><?php _e( 'Environment', 'bestwebsoft' ); ?></th><td></td></tr></thead>
647 1020 <tbody>
648 - <?php foreach ( $system_info['system_info'] as $key => $value ) { ?>
1021 + <?php foreach ( $system_info['system_info'] as $key => $value ) { ?>
649 1022 <tr>
650 1023 <td scope="row"><?php echo $key; ?></td>
651 1024 <td scope="row"><?php echo $value; ?></td>
652 - </tr>
1025 + </tr>
653 1026 <?php } ?>
654 1027 </tbody>
655 1028 </table>
656 1029 <table class="bws_system_info">
@@ -655,74 +1028,73 @@
655 1028 </table>
656 1029 <table class="bws_system_info">
657 1030 <thead><tr><th><?php _e( 'Active Plugins', 'bestwebsoft' ); ?></th><th></th></tr></thead>
658 1031 <tbody>
659 - <?php if ( ! empty( $system_info['active_plugins'] ) ) {
660 - foreach ( $system_info['active_plugins'] as $key => $value ) { ?>
661 - <tr>
662 - <td scope="row"><?php echo $key; ?></td>
663 - <td scope="row"><?php echo $value; ?></td>
664 - </tr>
665 - <?php }
666 - } ?>
1032 + <?php foreach ( $system_info['active_plugins'] as $key => $value ) { ?>
1033 + <tr>
1034 + <td scope="row"><?php echo $key; ?></td>
1035 + <td scope="row"><?php echo $value; ?></td>
1036 + </tr>
1037 + <?php } ?>
667 1038 </tbody>
668 1039 </table>
669 1040 <table class="bws_system_info">
670 1041 <thead><tr><th><?php _e( 'Inactive Plugins', 'bestwebsoft' ); ?></th><th></th></tr></thead>
671 1042 <tbody>
672 - <?php if ( ! empty( $system_info['inactive_plugins'] ) ) {
673 - foreach ( $system_info['inactive_plugins'] as $key => $value ) { ?>
1043 + <?php
1044 + if ( ! empty( $system_info['inactive_plugins'] ) ) {
1045 + foreach ( $system_info['inactive_plugins'] as $key => $value ) { ?>
674 1046 <tr>
675 1047 <td scope="row"><?php echo $key; ?></td>
676 1048 <td scope="row"><?php echo $value; ?></td>
677 - </tr>
678 - <?php }
1049 + </tr>
1050 + <?php }
679 1051 } ?>
680 1052 </tbody>
681 1053 </table>
682 1054 <div class="clear"></div>
1055 + <form method="post" action="admin.php?page=bws_plugins&amp;action=system_status">
1056 + <p>
1057 + <input type="hidden" name="bwsmn_form_submit" value="submit" />
1058 + <input type="submit" class="button-primary" value="<?php _e( 'Send to support', 'bestwebsoft' ) ?>" />
1059 + <?php wp_nonce_field( plugin_basename(__FILE__), 'bwsmn_nonce_submit' ); ?>
1060 + </p>
1061 + </form>
1062 + <form method="post" action="admin.php?page=bws_plugins&amp;action=system_status">
1063 + <p>
1064 + <input type="hidden" name="bwsmn_form_submit_custom_email" value="submit" />
1065 + <input type="submit" class="button" value="<?php _e( 'Send to custom email &#187;', 'bestwebsoft' ) ?>" />
1066 + <input type="text" value="<?php echo $bwsmn_form_email; ?>" name="bwsmn_form_email" />
1067 + <?php wp_nonce_field( plugin_basename(__FILE__), 'bwsmn_nonce_submit_custom_email' ); ?>
1068 + </p>
1069 + </form>
683 1070 </div>
684 - <?php } ?>
685 - </div>
1071 + <?php }
1072 + } ?>
686 1073 </div>
687 1074 <?php }
1075 +}
1076 +
1077 +if ( ! function_exists ( 'bws_plugin_init' ) ) {
1078 + function bws_plugin_init() {
1079 + // Internationalization, first(!)
1080 + load_plugin_textdomain( 'bestwebsoft', false, dirname( plugin_basename( __FILE__ ) ) . '/languages/' );
1081 + }
688 1082 }
689 1083
690 -if ( ! function_exists( 'bws_get_banner_array' ) ) {
691 - function bws_get_banner_array() {
692 - global $bstwbsftwppdtplgns_banner_array;
693 - $bstwbsftwppdtplgns_banner_array = array(
694 - array( 'crrntl_hide_banner_on_plugin_page', 'car-rental/car-rental.php', '1.0.0' ),
695 - array( 'lnkdn_hide_banner_on_plugin_page', 'bws-linkedin/bws-linkedin.php', '1.0.1' ),
696 - array( 'pntrst_hide_banner_on_plugin_page', 'bws-pinterest/bws-pinterest.php', '1.0.1' ),
697 - array( 'zndskhc_hide_banner_on_plugin_page', 'zendesk-help-center/zendesk-help-center.php', '1.0.0' ),
698 - array( 'gglcptch_hide_banner_on_plugin_page', 'google-captcha/google-captcha.php', '1.18' ),
699 - array( 'mltlngg_hide_banner_on_plugin_page', 'multilanguage/multilanguage.php', '1.1.1' ),
700 - array( 'adsns_hide_banner_on_plugin_page', 'adsense-plugin/adsense-plugin.php', '1.36' ),
701 - array( 'vstrsnln_hide_banner_on_plugin_page', 'visitors-online/visitors-online.php', '0.2' ),
702 - array( 'cstmsrch_hide_banner_on_plugin_page', 'custom-search-plugin/custom-search-plugin.php', '1.28' ),
703 - array( 'prtfl_hide_banner_on_plugin_page', 'portfolio/portfolio.php', '2.33' ),
704 - array( 'rlt_hide_banner_on_plugin_page', 'realty/realty.php', '1.0.0' ),
705 - array( 'prmbr_hide_banner_on_plugin_page', 'promobar/promobar.php', '1.0.0' ),
706 - array( 'gglnltcs_hide_banner_on_plugin_page', 'bws-google-analytics/bws-google-analytics.php', '1.6.2' ),
707 - array( 'htccss_hide_banner_on_plugin_page', 'htaccess/htaccess.php', '1.6.3' ),
708 - array( 'sbscrbr_hide_banner_on_plugin_page', 'subscriber/subscriber.php', '1.1.8' ),
709 - array( 'lmtttmpts_hide_banner_on_plugin_page', 'limit-attempts/limit-attempts.php', '1.0.2' ),
710 - array( 'sndr_hide_banner_on_plugin_page', 'sender/sender.php', '0.5' ),
711 - array( 'srrl_hide_banner_on_plugin_page', 'user-role/user-role.php', '1.4' ),
712 - array( 'pdtr_hide_banner_on_plugin_page', 'updater/updater.php', '1.12' ),
713 - array( 'cntctfrmtdb_hide_banner_on_plugin_page', 'contact-form-to-db/contact_form_to_db.php', '1.2' ),
714 - array( 'cntctfrmmlt_hide_banner_on_plugin_page', 'contact-form-multi/contact-form-multi.php', '1.0.7' ),
715 - array( 'gglmps_hide_banner_on_plugin_page', 'bws-google-maps/bws-google-maps.php', '1.2' ),
716 - array( 'fcbkbttn_hide_banner_on_plugin_page', 'facebook-button-plugin/facebook-button-plugin.php', '2.29' ),
717 - array( 'twttr_hide_banner_on_plugin_page', 'twitter-plugin/twitter.php', '2.34' ),
718 - array( 'pdfprnt_hide_banner_on_plugin_page', 'pdf-print/pdf-print.php', '1.7.1' ),
719 - array( 'gglplsn_hide_banner_on_plugin_page', 'google-one/google-plus-one.php', '1.1.4' ),
720 - array( 'gglstmp_hide_banner_on_plugin_page', 'google-sitemap-plugin/google-sitemap-plugin.php', '2.8.4' ),
721 - array( 'cntctfrmpr_for_ctfrmtdb_hide_banner_on_plugin_page', 'contact-form-pro/contact_form_pro.php', '1.14' ),
722 - array( 'cntctfrm_hide_banner_on_plugin_page', 'contact-form-plugin/contact_form.php', '3.47' ),
723 - array( 'cptch_hide_banner_on_plugin_page', 'captcha/captcha.php', '3.8.4' ),
724 - array( 'gllr_hide_banner_on_plugin_page', 'gallery-plugin/gallery-plugin.php', '3.9.1' ),
725 - array( 'cntctfrm_for_ctfrmtdb_hide_banner_on_plugin_page', 'contact-form-plugin/contact_form.php', '3.62' )
726 - );
1084 +if ( ! function_exists ( 'bws_admin_head' ) ) {
1085 + function bws_admin_head() {
1086 + global $wp_version;
1087 + if ( isset( $_GET['page'] ) && $_GET['page'] == "bws_plugins" ) {
1088 + wp_enqueue_style( 'bws_menu_style', plugins_url( 'css/style.css', __FILE__ ) );
1089 + wp_enqueue_script( 'bws_menu_script', plugins_url( 'js/bws_menu.js' , __FILE__ ) );
1090 + if ( $wp_version >= '3.8' )
1091 + wp_enqueue_script( 'theme-install' );
1092 + elseif ( $wp_version >= '3.4' )
1093 + wp_enqueue_script( 'theme' );
1094 + }
727 1095 }
728 -}
1096 +}
1097 +
1098 +add_action( 'init', 'bws_plugin_init' );
1099 +add_action( 'admin_enqueue_scripts', 'bws_admin_head' );
1100 +?>