PluginProbe
MaxButtons – Create buttons / 7.11
MaxButtons – Create buttons v7.11
6.23 6.24 6.25 6.26 6.26.1 6.27 6.28 6.3 6.4 6.5 6.6 6.7 6.8 6.9 7.0 7.1 7.1.1 7.1.2 7.1.3 7.10 7.11 7.13 7.13.1 7.13.2 7.13.3 All 100 releases
maxbuttons / includes / maxbuttons-support.php

maxbuttons-support.php in MaxButtons – Create buttons 7.11, at includes/maxbuttons-support.php

210 lines 6.9 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 namespace MaxButtons;
3 defined('ABSPATH') or die('No direct access permitted');
4
5 $theme = wp_get_theme();
6 $browser = maxbuttons_get_browser();
7
8
9 function maxbuttons_system_label($label, $value, $spaces_between) {
10 $output = "<label>$label</label>";
11 return "<div class='info'>" . $output . trim($value) . "</div>" ;
12 }
13
14 // http://www.php.net/manual/en/function.get-browser.php#101125.
15 // Cleaned up a bit, but overall it's the same.
16 function maxbuttons_get_browser() {
17 $user_agent = $_SERVER['HTTP_USER_AGENT'];
18 $browser_name = 'Unknown';
19 $platform = 'Unknown';
20 $version= "";
21
22 // First get the platform
23 if (preg_match('/linux/i', $user_agent)) {
24 $platform = 'Linux';
25 }
26 elseif (preg_match('/macintosh|mac os x/i', $user_agent)) {
27 $platform = 'Mac';
28 }
29 elseif (preg_match('/windows|win32/i', $user_agent)) {
30 $platform = 'Windows';
31 }
32
33 // Next get the name of the user agent yes seperately and for good reason
34 if (preg_match('/MSIE/i', $user_agent) && !preg_match('/Opera/i', $user_agent)) {
35 $browser_name = 'Internet Explorer';
36 $browser_name_short = "MSIE";
37 }
38 elseif (preg_match('/Firefox/i', $user_agent)) {
39 $browser_name = 'Mozilla Firefox';
40 $browser_name_short = "Firefox";
41 }
42 elseif (preg_match('/Chrome/i', $user_agent)) {
43 $browser_name = 'Google Chrome';
44 $browser_name_short = "Chrome";
45 }
46 elseif (preg_match('/Safari/i', $user_agent)) {
47 $browser_name = 'Apple Safari';
48 $browser_name_short = "Safari";
49 }
50 elseif (preg_match('/Opera/i', $user_agent)) {
51 $browser_name = 'Opera';
52 $browser_name_short = "Opera";
53 }
54 elseif (preg_match('/Netscape/i', $user_agent)) {
55 $browser_name = 'Netscape';
56 $browser_name_short = "Netscape";
57 }
58
59 // Finally get the correct version number
60 $known = array('Version', $browser_name_short, 'other');
61 $pattern = '#(?<browser>' . join('|', $known) . ')[/ ]+(?<version>[0-9.|a-zA-Z.]*)#';
62 if (!preg_match_all($pattern, $user_agent, $matches)) {
63 // We have no matching number just continue
64 }
65
66 // See how many we have
67 $i = count($matches['browser']);
68 if ($i != 1) {
69 // We will have two since we are not using 'other' argument yet
70 // See if version is before or after the name
71 if (strripos($user_agent, "Version") < strripos($user_agent, $browser_name_short)){
72 $version= $matches['version'][0];
73 }
74 else {
75 $version= $matches['version'][1];
76 }
77 }
78 else {
79 $version= $matches['version'][0];
80 }
81
82 // Check if we have a number
83 if ($version == null || $version == "") { $version = "?"; }
84
85 return array(
86 'user_agent' => $user_agent,
87 'name' => $browser_name,
88 'version' => $version,
89 'platform' => $platform,
90 'pattern' => $pattern
91 );
92 }
93
94 function check_charset() {
95 global $maxbuttons_installed_version;
96 global $wpdb;
97 $check = "SHOW FULL COLUMNS FROM " . maxUtils::get_table_name();
98 $charset = $wpdb->query($check);
99 return $charset;
100 }
101 if(isset($_POST['alter_charset'])) {
102 $kludge = 'altering table to be utf-8';
103 global $maxbuttons_installed_version;
104 global $wpdb;
105 $table_name = maxUtils::get_table_name();
106 $kludge = $table_name;
107 // IMPORTANT: There MUST be two spaces between the PRIMARY KEY keywords
108 // and the column name, and the column name MUST be in parenthesis.
109 $sql = "ALTER TABLE " . $table_name . " CONVERT TO CHARACTER SET utf8";
110 require_once(ABSPATH . 'wp-admin/includes/upgrade.php');
111 $wpdb->query($wpdb->prepare($sql));
112 } else {
113 $kludge = 'Not yet enabled';
114 }
115
116 $charr = check_charset();
117
118
119 ?>
120 <?php
121 $support_link = apply_filters("mb-support-link", 'http://wordpress.org/support/plugin/maxbuttons');
122
123 $admin = MB()->getClass('admin');
124 $page_title = __("Support","maxbuttons");
125 $action = "<a href='$support_link' class='page-title-action add-new-h2' target='_blank'>" . __("Go to support","maxbuttons") . "</a>";
126 $admin->get_header(array("title" => $page_title, "title_action" => $action) );
127 ?>
128
129 <div class='support tiles'>
130 <div>
131 <a href='https://wordpress.org/plugins/maxbuttons/#faq' target="_blank">Frequently Asked Questions</a>
132 </div>
133
134 <div><?php printf(__('%sSupport Forums%s.', 'maxbuttons'), "<a href='$support_link' target='_blank'>" , '</a>') ?></div>
135
136 </div>
137
138 <h4><?php _e('You may be asked to provide the information below to help troubleshoot your issue.', 'maxbuttons') ?></h4>
139
140 <form>
141
142 <div class='system_info'>
143 ----- Begin System Info ----- <br />
144
145
146 <?php echo maxbuttons_system_label('WordPress Version:', get_bloginfo('version'), 4) ?>
147
148 <?php echo maxbuttons_system_label('PHP Version:', PHP_VERSION, 10) ?>
149
150 <?php
151 global $wpdb;
152 $mysql_version = $wpdb->db_version();
153
154
155 echo maxbuttons_system_label('MySQL Version:', $mysql_version, 8) ?>
156
157 <?php echo maxbuttons_system_label('Web Server:', $_SERVER['SERVER_SOFTWARE'], 11) ?>
158
159 <?php echo maxbuttons_system_label('WordPress URL:', get_bloginfo('wpurl'), 8) ?>
160
161 <?php echo maxbuttons_system_label('Home URL:', get_bloginfo('url'), 13) ?>
162
163 <?php echo maxbuttons_system_label('PHP cURL Support:', function_exists('curl_init') ? 'Yes' : 'No', 5) ?>
164
165 <?php echo maxbuttons_system_label('PHP GD Support:', function_exists('gd_info') ? 'Yes' : 'No', 7) ?>
166 <?php echo maxbuttons_system_label('PHP Memory Limit:', ini_get('memory_limit'), 5) ?>
167
168 <?php echo maxbuttons_system_label('PHP Post Max Size:', ini_get('post_max_size'), 4) ?>
169
170 <?php echo maxbuttons_system_label('PHP Upload Max Size:', ini_get('upload_max_filesize'), 2) ?>
171
172 <?php echo maxbuttons_system_label('WP_DEBUG:', defined('WP_DEBUG') ? WP_DEBUG ? 'Enabled' : 'Disabled' : 'Not set', 13) ?>
173 <?php echo maxbuttons_system_label('Multi-Site Active:', is_multisite() ? 'Yes' : 'No', 4) ?>
174
175 <?php echo maxbuttons_system_label('Operating System:', $browser['platform'], 5) ?>
176 <?php echo maxbuttons_system_label('Browser:', $browser['name'] . ' ' . $browser['version'], 14) ?>
177 <?php echo maxbuttons_system_label('User Agent:', $browser['user_agent'], 11) ?>
178
179 Active Theme:
180 <?php echo maxbuttons_system_label('-', $theme->get('Name') . ' ' . $theme->get('Version'), 1) ?>
181 <?php echo maxbuttons_system_label('', $theme->get('ThemeURI'), 2) ?>
182
183 Active Plugins:
184 <?php
185 $plugins = get_plugins();
186 $active_plugins = get_option('active_plugins', array());
187
188 foreach ($plugins as $plugin_path => $plugin) {
189 // Only show active plugins
190 if (in_array($plugin_path, $active_plugins)) {
191 echo maxbuttons_system_label('-', $plugin['Name'] . ' ' . $plugin['Version'], 1);
192
193 if (isset($plugin['PluginURI'])) {
194 echo maxbuttons_system_label('', $plugin['PluginURI'], 2);
195 }
196
197 echo "\n";
198 }
199 }
200 ?>
201 ----- End System Info -----
202 </div>
203 </form>
204 </div>
205 <div class="ad-wrap">
206 <?php do_action("mb-display-ads"); ?>
207 </div>
208
209 <?php $admin->get_footer(); ?>
210