PluginProbe ʕ •ᴥ•ʔ
Gallery : FooGallery / 3.3.0
Gallery : FooGallery v3.3.0
3.3.0 3.1.31 3.1.32 3.1.34 3.1.36 3.2.0 3.2.6 trunk 1.10.3 2.0.24 2.1.34 2.2.44 2.3.3 2.4.32 3.0.6 3.1.11 3.1.12 3.1.13 3.1.20 3.1.25 3.1.26 3.1.26.1 3.1.26.2
foogallery / includes / admin / view-system-info.php
foogallery / includes / admin Last commit date
class-admin-notice-custom-css.php 1 week ago class-admin-notices.php 1 week ago class-admin.php 1 week ago class-attachment-fields.php 1 week ago class-columns.php 1 week ago class-demo-content.php 1 week ago class-extensions.php 1 week ago class-gallery-attachment-modal.php 1 week ago class-gallery-datasources.php 1 week ago class-gallery-editor.php 1 week ago class-gallery-metabox-fields.php 1 week ago class-gallery-metabox-items.php 1 week ago class-gallery-metabox-settings-helper.php 1 week ago class-gallery-metabox-settings.php 1 week ago class-gallery-metabox-template.php 1 week ago class-gallery-metaboxes.php 1 week ago class-menu.php 1 week ago class-pro-promotion.php 1 week ago class-settings.php 1 week ago class-silent-installer-skin.php 1 week ago class-trial-mode.php 1 week ago demo-content-galleries.php 1 week ago demo-content-images.php 1 week ago index.php 1 week ago pro-features.php 1 week ago view-features.php 1 week ago view-help-demos.php 1 week ago view-help-getting-started.php 1 week ago view-help-pro.php 1 week ago view-help.php 1 week ago view-system-info.php 1 week ago
view-system-info.php
135 lines
1 <?php
2
3 if ( ! defined( 'ABSPATH' ) ) {
4 exit;
5 }
6
7 global $wp_version;
8 /**
9 * Get which version of GD is installed, if any.
10 *
11 * Returns the version (1 or 2) of the GD extension.
12 */
13 function foogallery_gdversion() {
14 if ( ! extension_loaded( 'gd' ) ) {
15 return '0';
16 }
17
18 // Use the gd_info() function if possible.
19 if ( function_exists( 'gd_info' ) ) {
20 $ver_info = gd_info();
21 preg_match( '/\d/', $ver_info['GD Version'], $match );
22
23 return $match[0];
24 }
25 // If phpinfo() is disabled use a specified / fail-safe choice...
26 if ( preg_match( '/phpinfo/', ini_get( 'disable_functions' ) ) ) {
27 return '?';
28 }
29 // ...otherwise use phpinfo().
30 ob_start();
31 phpinfo( 8 );
32 $info = ob_get_contents();
33 ob_end_clean();
34 $info = stristr( $info, 'gd version' );
35 preg_match( '/\d/', $info, $match );
36
37 return $match[0];
38 }
39
40 if ( current_user_can( 'activate_plugins' ) ) {
41 $instance = FooGallery_Plugin::get_instance();
42 $info = $instance->get_plugin_info();
43 /* translators: %s: Value inserted at runtime. */
44 $title = apply_filters( 'foogallery_admin_systeminfo_title', sprintf( __( '%s System Information', 'foogallery' ), foogallery_plugin_name() ) );
45 /* translators: %s: Value inserted at runtime. */
46 $support_text = apply_filters( 'foogallery_admin_systeminfo_supporttext', sprintf( __( 'Below is some information about your server configuration. You can use this info to help debug issues you may have with %s.' ), foogallery_plugin_name() ) );
47 $api = new FooGallery_Extensions_API();
48
49 //get all gallery templates
50 $template_slugs = array();
51 foreach ( foogallery_gallery_templates() as $template ) {
52 $template_slugs[] = $template['slug'];
53 }
54
55 //get all activated plugins
56 $plugins = array();
57 foreach ( get_option('active_plugins') as $plugin_slug => $plugin ) {
58 $plugins[] = $plugin;
59 }
60
61 $current_theme = wp_get_theme();
62
63 $foogallery = FooGallery_Plugin::get_instance();
64 $settings = $foogallery->options()->get_all();
65
66 // Redact sensitive settings
67 foreach ( $settings as $k => $v ) {
68 if ( preg_match( '/api_key|token|secret/i', $k ) ) {
69 $settings[$k] = 'REDACTED';
70 }
71 }
72
73 $stream_wrappers = stream_get_wrappers();
74
75 $debug_info = array(
76 __( 'FooGallery version', 'foogallery' ) => $info['version'],
77 __( 'WordPress version', 'foogallery' ) => $wp_version,
78 __( 'Activated Theme', 'foogallery' ) => $current_theme['Name'],
79 __( 'WordPress URL', 'foogallery' ) => get_site_url(),
80 __( 'PHP version', 'foogallery' ) => phpversion(),
81 __( 'Thumb Engine', 'foogallery' ) => foogallery_get_setting( 'thumb_engine' )
82 );
83
84 $extra_debug_info = array(
85 __( 'PHP Open SSL', 'foogallery' ) => extension_loaded( 'openssl' ) ? __( 'Loaded', 'foogallery' ) : __( 'Not found!', 'foogallery' ),
86 __( 'PHP HTTP Wrapper', 'foogallery' ) => in_array( 'http', $stream_wrappers ) ? __( 'Found', 'foogallery' ) : __( 'Not found!', 'foogallery' ),
87 __( 'PHP HTTPS Wrapper', 'foogallery' ) => in_array( 'https', $stream_wrappers ) ? __( 'Found', 'foogallery' ) : __( 'Not found!', 'foogallery' ),
88 __( 'PHP Config[allow_url_fopen]', 'foogallery' ) => ini_get( 'allow_url_fopen' ),
89 __( 'PHP Config[allow_url_include]', 'foogallery' ) => ini_get( 'allow_url_include' ),
90
91 __( 'Features Active', 'foogallery' ) => array_keys( $api->get_active_extensions() ),
92 __( 'Gallery Templates', 'foogallery' ) => $template_slugs,
93 __( 'Lightboxes', 'foogallery' ) => apply_filters( 'foogallery_gallery_template_field_lightboxes', array() ),
94 __( 'Settings', 'foogallery' ) => $settings,
95 __( 'Active Plugins', 'foogallery' ) => $plugins
96 );
97
98 if ( foogallery_thumb_active_engine()->uses_image_editors() ) {
99 $image_editor = _wp_image_editor_choose( array( 'methods' => array( 'get_image' ) ) );
100 $test_image_url = foogallery_test_thumb_url();
101 $test_image_url_scheme = wp_parse_url( $test_image_url, PHP_URL_SCHEME );
102 $home_url_scheme = wp_parse_url( home_url(), PHP_URL_SCHEME );
103
104 $debug_info[ __( 'PHP GD', 'foogallery' ) ] = extension_loaded( 'gd' ) && function_exists( 'gd_info' ) ? __( 'Loaded', 'foogallery' ) . ' (V' . foogallery_gdversion() . ')' : __( 'Not found!', 'foogallery' );
105 $debug_info[ __( 'PHP Imagick', 'foogallery' ) ] = extension_loaded( 'imagick' ) ? __( 'Loaded', 'foogallery' ) : __( 'Not found!', 'foogallery' );
106 $debug_info[ __( 'WP Image Editor', 'foogallery' ) ] = $image_editor;
107 $debug_info[ __( 'Thumbnail Generation Test', 'foogallery') ] = $test_image_url;
108 $debug_info[ __( 'HTTPS Thumb Mismatch', 'foogallery' )] = $test_image_url_scheme === $home_url_scheme ? __( 'None', 'foogallery' ) : __( 'There is a protocol mismatch between your site URL and the thumbnail URL!', 'foogallery' );
109 $debug_info[ __( 'Available Image Editors', 'foogallery' ) ] = apply_filters( 'wp_image_editors', array( 'WP_Image_Editor_Imagick', 'WP_Image_Editor_GD' ) );
110 }
111
112 $debug_info = array_merge( $debug_info, $extra_debug_info );
113
114 $debug_info = apply_filters( 'foogallery_admin_debug_info', $debug_info );
115 ?>
116 <style>
117 .foogallery-debug {
118 width: 100%;
119 font-family: "courier new";
120 height: 500px;
121 }
122 </style>
123 <div class="wrap about-wrap">
124 <h1><?php echo esc_html( $title ); ?></h1>
125 <p><?php echo esc_html( $support_text ); ?></p>
126 <textarea class="foogallery-debug">
127 <?php foreach ( $debug_info as $key => $value ) {
128 echo esc_html( $key ) . ' : ';
129 print_r( $value );
130 echo "\n";
131 } ?>
132 </textarea>
133 </div>
134 <?php }
135