PluginProbe ʕ •ᴥ•ʔ
Advanced Ads – Ad Manager & AdSense / 2.0.24
Advanced Ads – Ad Manager & AdSense v2.0.24
2.0.24 2.0.23 2.0.22 2.0.21 1.38.0 1.39.0 1.39.1 1.39.2 1.39.3 1.39.4 1.4.0 1.4.1 1.4.2 1.4.3 1.4.4 1.4.5 1.4.6 1.4.7 1.4.8 1.4.9 1.40.0 1.40.1 1.40.2 1.41.0 1.42.0 1.42.1 1.42.2 1.43.0 1.44.0 1.44.1 1.45.0 1.45.1 1.46.0 1.47.0 1.47.1 1.47.2 1.47.3 1.47.4 1.47.5 1.48.0 1.48.1 1.49.0 1.5.0 1.5.0.1 1.5.1 1.5.2 1.5.2.1 1.5.4 1.5.4.1 1.5.5 1.50.0 1.51.0 1.51.1 1.51.2 1.51.3 1.52.0 1.52.1 1.52.2 1.52.3 1.52.4 1.53.0 1.53.1 1.53.2 1.54.0 1.54.1 1.55.0 1.56.0 1.56.1 1.56.2 1.56.3 1.56.4 1.6 1.6.1 1.6.10 1.6.10.1 1.6.10.2 1.6.11 1.6.11.1 1.6.12 1.6.13 1.6.14 1.6.15 1.6.16 1.6.17 1.6.17.1 1.6.17.2 1.6.2 1.6.2.1 1.6.3 1.6.4 1.6.4.1 1.6.5 1.6.6 1.6.6.1 1.6.7 1.6.7.1 1.6.8 1.6.8.1 1.6.8.2 1.6.8.3 1.6.9 1.6.9.1 1.6.9.2 1.6.9.3 1.6.9.4 1.7 1.7.0.1 1.7.0.2 1.7.0.3 1.7.1 1.7.1.1 1.7.1.2 1.7.1.3 1.7.1.4 1.7.1.5 1.7.10 trunk 1.7.11 1.0.1 1.7.12 1.0.2 1.7.13 1.0.3 1.7.14 1.1.0 1.7.15 1.1.1 1.7.16 1.1.2 1.7.17 1.1.3 1.7.18 1.10 1.7.19 1.10.1 1.7.2 1.10.10 1.7.2.1 1.10.11 1.7.20 1.10.12 1.7.21 1.10.2 1.7.22 1.10.3 1.7.23 1.10.4 1.7.24 1.10.5 1.7.25 1.10.6 1.7.3 1.10.7 1.7.4 1.10.8 1.7.4.1 1.10.9 1.7.4.2 1.11 1.7.4.3 1.11.1 1.7.4.4 1.11.2 1.7.4.5 1.12 1.7.5 1.13 1.7.5.1 1.13.1 1.7.6 1.13.2 1.7.7 1.13.3 1.7.8 1.13.4 1.7.9 1.13.5 1.7.9.1 1.13.6 1.7.9.2 1.13.7 1.7.9.3 1.13.8 1.8 1.14 1.8.1 1.14.1 1.8.10 1.14.10 1.8.11 1.14.11 1.8.12 1.14.2 1.8.13 1.14.3 1.8.14 1.14.4 1.8.15 1.14.5 1.8.16 1.14.6 1.8.17 1.14.7 1.8.18 1.14.8 1.8.19 1.14.9 1.8.2 1.15 1.8.20 1.16 1.8.21 1.16.1 1.8.22 1.17 1.8.23 1.17.1 1.8.24 1.17.10 1.8.25 1.17.10-rc.1 1.8.26 1.17.11 1.8.27 1.17.12 1.8.28 1.17.12-rc.1 1.8.29 1.17.2 1.8.3 1.17.3 1.8.30 1.17.4 1.8.4 1.17.5 1.8.5 1.17.6 1.8.6 1.17.7 1.8.7 1.17.8 1.8.8 1.17.9 1.8.9 1.17.9-beta.1 1.9 1.18.0 2.0.0 1.19.0 2.0.1 1.19.1 2.0.10 1.2 2.0.11 1.2.1 2.0.12 1.2.2 2.0.13 1.2.3 2.0.14 1.2.4 2.0.15 1.2.5 2.0.16 1.2.6 2.0.17 1.2.7 2.0.18 1.20.0 2.0.19 1.20.0-rc.1 2.0.2 1.20.0-rc.2 2.0.20 1.20.1 2.0.3 1.20.2 2.0.4 1.20.3 2.0.5 1.21.0 2.0.6 1.21.1 2.0.7 1.22.0 2.0.8 1.22.1 2.0.9 1.22.2 1.23.0 1.23.1 1.23.2 1.24.0 1.24.1 1.24.2 1.25.0 1.25.1 1.26.0 1.27.0 1.28.0 1.29.0 1.29.1 1.3 1.3.1 1.3.10 1.3.11 1.3.12 1.3.13 1.3.14 1.3.15 1.3.16 1.3.17 1.3.18 1.3.2 1.3.3 1.3.4 1.3.5 1.3.6 1.3.7 1.3.8 1.3.9 1.30.0 1.30.1 1.30.2 1.30.2-rc.1 1.30.3 1.30.4 1.30.4-rc.1 1.30.5 1.31.0 1.31.1 1.32.0 1.32.0-rc.1 1.33.0 1.33.1 1.33.2 1.34.0 1.35.0 1.35.1 1.36.0 1.36.1 1.36.2 1.36.3 1.37.0 1.37.1 1.37.2
advanced-ads / includes / admin / class-system-info.php
advanced-ads / includes / admin Last commit date
ads 1 week ago groups 1 week ago metaboxes 1 year ago pages 3 months ago placements 1 week ago class-action-links.php 1 week ago class-addon-box.php 1 year ago class-addon-updater.php 3 months ago class-admin-menu.php 1 week ago class-admin-notices.php 1 year ago class-ajax.php 3 months ago class-assets.php 1 week ago class-authors.php 1 year ago class-edd-updater.php 4 weeks ago class-list-filters.php 1 week ago class-marketing.php 1 year ago class-metabox-ad-settings.php 1 year ago class-metabox-ad.php 1 year ago class-misc.php 1 week ago class-page-quick-edit.php 1 year ago class-plugin-installer.php 1 year ago class-post-list.php 1 year ago class-post-types.php 1 week ago class-screen-options.php 3 months ago class-settings.php 1 year ago class-shortcode-creator.php 1 year ago class-system-info.php 1 year ago class-tinymce.php 2 years ago class-translation-promo.php 1 year ago class-upgrades.php 1 year ago class-version-control.php 3 months ago class-welcome.php 1 year ago class-wordpress-dashboard.php 1 year ago index.php 2 years ago
class-system-info.php
292 lines
1 <?php
2 /**
3 * Admin System Info.
4 *
5 * @package AdvancedAds
6 * @author Advanced Ads <info@wpadvancedads.com>
7 * @since 1.50.0
8 */
9
10 namespace AdvancedAds\Admin;
11
12 use AdvancedAds\Framework\Utilities\Params;
13
14 defined( 'ABSPATH' ) || exit;
15
16 /**
17 * Admin System Info.
18 */
19 class System_Info {
20
21 /**
22 * Get system information.
23 *
24 * @return string
25 */
26 public function get_info() {
27 $data = '### Begin System Info ###' . "\n\n";
28
29 $data .= $this->advanced_ads_info();
30 $data .= $this->site_info();
31 $data .= $this->wp_info();
32 $data .= $this->uploads_info();
33 $data .= $this->plugins_info();
34 $data .= $this->server_info();
35
36 $data .= "\n" . '### End System Info ###';
37
38 return $data;
39 }
40
41 /**
42 * Get Advanced Ads info.
43 *
44 * @return string
45 */
46 private function advanced_ads_info() {
47 $data = '-- Advanced Ads Info' . "\n\n";
48 $data .= $this->get_it_spaced( 'Pro', defined( 'AAP_VERSION' ) ? 'Activated' : 'Not Activated', 22 );
49
50 return $data;
51 }
52
53 /**
54 * Get Site info.
55 *
56 * @return string
57 */
58 private function site_info() {
59 $data = "\n" . '-- Site Info' . "\n\n";
60 $data .= $this->get_it_spaced( 'Site URL', site_url(), 17 );
61 $data .= $this->get_it_spaced( 'Home URL', home_url(), 17 );
62 $data .= $this->get_it_spaced( 'Multisite', is_multisite() ? 'Yes' : 'No', 16 );
63
64 return $data;
65 }
66
67 /**
68 * Get WordPress Configuration info.
69 *
70 * @return string
71 */
72 private function wp_info() {
73 global $wpdb;
74
75 $theme_data = wp_get_theme();
76 $theme = $theme_data->name . ' ' . $theme_data->version;
77
78 $data = "\n" . '-- WordPress Configuration' . "\n\n";
79 $data .= $this->get_it_spaced( 'Version', get_bloginfo( 'version' ), 18 );
80 $data .= $this->get_it_spaced( 'Language', get_locale(), 17 );
81 $data .= $this->get_it_spaced( 'User Language', get_user_locale(), 12 );
82 $data .= $this->get_it_spaced( 'Permalink Structure', get_option( 'permalink_structure' ) ?? 'Default', 6 );
83 $data .= $this->get_it_spaced( 'Active Theme', $theme, 13 );
84 $data .= $this->get_it_spaced( 'Show On Front', get_option( 'show_on_front' ), 12 );
85 $data .= $this->get_it_spaced( 'ABSPATH', ABSPATH, 18 );
86 $data .= $this->get_it_spaced( 'Table Prefix', 'Length: ' . strlen( $wpdb->prefix ) . ' Status: ' . ( strlen( $wpdb->prefix ) > 16 ? 'ERROR: Too long' : 'Acceptable' ), 13 ); //phpcs:ignore
87 $data .= $this->get_it_spaced( 'WP_DEBUG', defined( 'WP_DEBUG' ) ? WP_DEBUG ? 'Enabled' : 'Disabled' : 'Not set', 17 );
88 $data .= $this->get_it_spaced( 'Memory Limit', WP_MEMORY_LIMIT, 13 );
89 $data .= $this->get_it_spaced( 'Registered Post Stati', implode( ', ', get_post_stati() ), 4 );
90 $data .= $this->get_it_spaced( 'Revisions', WP_POST_REVISIONS ? WP_POST_REVISIONS > 1 ? 'Limited to ' . WP_POST_REVISIONS : 'Enabled' : 'Disabled', 16 );
91
92 return $data;
93 }
94
95 /**
96 * Get Uploads/Constants info.
97 *
98 * @return string
99 */
100 private function uploads_info() {
101 $uploads_dir = wp_upload_dir();
102
103 $data = "\n" . '-- WordPress Uploads/Constants' . "\n\n";
104 $data .= $this->get_it_spaced( 'WP_CONTENT_DIR', defined( 'WP_CONTENT_DIR' ) ? WP_CONTENT_DIR ? WP_CONTENT_DIR : 'Disabled' : 'Not set', 11 );
105 $data .= $this->get_it_spaced( 'WP_CONTENT_URL', defined( 'WP_CONTENT_URL' ) ? WP_CONTENT_URL ? WP_CONTENT_URL : 'Disabled' : 'Not set', 11 );
106 $data .= $this->get_it_spaced( 'UPLOADS', defined( 'UPLOADS' ) ? UPLOADS ? UPLOADS : 'Disabled' : 'Not set', 18 );
107 $data .= $this->get_it_spaced( 'wp_uploads_dir() path', $uploads_dir['path'], 4 );
108 $data .= $this->get_it_spaced( 'wp_uploads_dir() url', $uploads_dir['url'], 5 );
109 $data .= $this->get_it_spaced( 'wp_uploads_dir() basedir', $uploads_dir['basedir'], 1 );
110 $data .= $this->get_it_spaced( 'wp_uploads_dir() baseurl', $uploads_dir['baseurl'], 1 );
111
112 return $data;
113 }
114
115 /**
116 * Get Plugins info.
117 *
118 * @return string
119 */
120 private function plugins_info() {
121 $data = $this->mu_plugins();
122 $data .= $this->installed_plugins();
123 $data .= $this->multisite_plugins();
124
125 return $data;
126 }
127
128 /**
129 * Get MU Plugins info.
130 *
131 * @return string
132 */
133 private function mu_plugins() {
134 $data = '';
135
136 // Must-use plugins.
137 // NOTE: MU plugins can't show updates!
138 $muplugins = get_mu_plugins();
139
140 if ( ! empty( $muplugins ) && count( $muplugins ) > 0 ) {
141 $data = "\n" . '-- Must-Use Plugins' . "\n\n";
142
143 foreach ( $muplugins as $plugin => $plugin_data ) {
144 $data .= $plugin_data['Name'] . ': ' . $plugin_data['Version'] . "\n";
145 }
146 }
147
148 return $data;
149 }
150
151 /**
152 * Get Installed Plugins info.
153 *
154 * @return string
155 */
156 private function installed_plugins() {
157 $updates = get_plugin_updates();
158
159 // WordPress active plugins.
160 $data = "\n" . '-- WordPress Active Plugins' . "\n\n";
161
162 $plugins = get_plugins();
163 $active_plugins = get_option( 'active_plugins', [] );
164
165 foreach ( $plugins as $plugin_path => $plugin ) {
166 if ( ! in_array( $plugin_path, $active_plugins, true ) ) {
167 continue;
168 }
169
170 $update = ( array_key_exists( $plugin_path, $updates ) ) ? ' (needs update - ' . $updates[ $plugin_path ]->update->new_version . ')' : '';
171 $data .= $plugin['Name'] . ': ' . $plugin['Version'] . $update . "\n";
172 }
173
174 // WordPress inactive plugins.
175 $data .= "\n" . '-- WordPress Inactive Plugins' . "\n\n";
176
177 foreach ( $plugins as $plugin_path => $plugin ) {
178 if ( in_array( $plugin_path, $active_plugins, true ) ) {
179 continue;
180 }
181
182 $update = ( array_key_exists( $plugin_path, $updates ) ) ? ' (needs update - ' . $updates[ $plugin_path ]->update->new_version . ')' : '';
183 $data .= $plugin['Name'] . ': ' . $plugin['Version'] . $update . "\n";
184 }
185
186 return $data;
187 }
188
189 /**
190 * Get Multisite Plugins info.
191 *
192 * @return string
193 */
194 private function multisite_plugins() {
195 $data = '';
196
197 if ( ! is_multisite() ) {
198 return $data;
199 }
200
201 $updates = get_plugin_updates();
202
203 // WordPress Multisite active plugins.
204 $data = "\n" . '-- Network Active Plugins' . "\n\n";
205
206 $plugins = wp_get_active_network_plugins();
207 $active_plugins = get_site_option( 'active_sitewide_plugins', [] );
208
209 foreach ( $plugins as $plugin_path ) {
210 $plugin_base = plugin_basename( $plugin_path );
211
212 if ( ! array_key_exists( $plugin_base, $active_plugins ) ) {
213 continue;
214 }
215
216 $update = ( array_key_exists( $plugin_path, $updates ) ) ? ' (needs update - ' . $updates[ $plugin_path ]->update->new_version . ')' : '';
217 $plugin = get_plugin_data( $plugin_path );
218 $data .= $plugin['Name'] . ': ' . $plugin['Version'] . $update . "\n";
219 }
220
221 return $data;
222 }
223
224 /**
225 * Get Server info.
226 *
227 * @return string
228 */
229 private function server_info() {
230 global $wpdb;
231
232 // Server configuration (really just versions).
233 $software = Params::server( 'SERVER_SOFTWARE', '' );
234 $software = sanitize_text_field( wp_unslash( $software ) );
235
236 $data = "\n" . '-- Webserver Configuration' . "\n\n";
237 $data .= $this->get_it_spaced( 'PHP Version:', PHP_VERSION, 14 );
238 $data .= $this->get_it_spaced( 'MySQL Version', $wpdb->db_version(), 13 );
239 $data .= $this->get_it_spaced( 'Webserver Info', $software, 12 );
240
241 // PHP configs... now we're getting to the important stuff.
242 $data .= "\n" . '-- PHP Configuration' . "\n\n";
243 $data .= $this->get_it_spaced( 'Memory Limit', ini_get( 'memory_limit' ), 13 );
244 $data .= $this->get_it_spaced( 'Upload Max Size', ini_get( 'upload_max_filesize' ), 10 );
245 $data .= $this->get_it_spaced( 'Post Max Size', ini_get( 'post_max_size' ), 12 );
246 $data .= $this->get_it_spaced( 'Upload Max Filesize', ini_get( 'upload_max_filesize' ), 6 );
247 $data .= $this->get_it_spaced( 'Time Limit', ini_get( 'max_execution_time' ), 15 );
248 $data .= $this->get_it_spaced( 'Max Input Vars', ini_get( 'max_input_vars' ), 11 );
249 $data .= $this->get_it_spaced( 'Display Errors', ( ini_get( 'display_errors' ) ? 'On (' . ini_get( 'display_errors' ) . ')' : 'N/A' ), 11 );
250
251 // PHP extensions and such.
252 $data .= "\n" . '-- PHP Extensions' . "\n\n";
253 $data .= $this->get_it_spaced( 'cURL', function_exists( 'curl_init' ) ? 'Supported' : 'Not Supported', 21 );
254 $data .= $this->get_it_spaced( 'fsockopen', function_exists( 'fsockopen' ) ? 'Supported' : 'Not Supported', 16 );
255 $data .= $this->get_it_spaced( 'SOAP Client', class_exists( 'SoapClient', false ) ? 'Installed' : 'Not Installed', 14 );
256 $data .= $this->get_it_spaced( 'Suhosin', extension_loaded( 'suhosin' ) ? 'Installed' : 'Not Installed', 18 );
257
258 // Session stuff.
259 $data .= "\n" . '-- Session Configuration' . "\n\n";
260 $data .= $this->get_it_spaced( 'Session', isset( $_SESSION ) ? 'Enabled' : 'Disabled', 18 );
261
262 // The rest of this is only relevant if session is enabled.
263 if ( isset( $_SESSION ) ) {
264 $data .= $this->get_it_spaced( 'Session Name', esc_html( ini_get( 'session.name' ) ), 13 );
265 $data .= $this->get_it_spaced( 'Cookie Path', esc_html( ini_get( 'session.cookie_path' ) ), 14 );
266 $data .= $this->get_it_spaced( 'Save Path', esc_html( ini_get( 'session.save_path' ) ), 16 );
267 $data .= $this->get_it_spaced( 'Use Cookies', ( ini_get( 'session.use_cookies' ) ? 'On' : 'Off' ), 14 );
268 $data .= $this->get_it_spaced( 'Use Only Cookies', ( ini_get( 'session.use_only_cookies' ) ? 'On' : 'Off' ), 9 );
269 }
270
271 return $data;
272 }
273
274 /**
275 * Consistent spacing in labels
276 *
277 * @param string $label Label of data.
278 * @param string $value Value of data.
279 * @param int $space Space count.
280 *
281 * @return string
282 */
283 private function get_it_spaced( $label, $value, $space = 9 ): string {
284 return sprintf(
285 '%1$s:%2$s%3$s' . "\n",
286 $label,
287 str_repeat( ' ', $space ),
288 $value
289 );
290 }
291 }
292