'✔', 'false' => '✖', 'debug' => '❖' ); // PHP GD image library debug info. $gd_extenstion_installed = adaptive_images_plugin_is_gd_extension_installed(); $message = '

' . ( $gd_extenstion_installed ? $icons['true'] : $icons['false'] ) . ' PHP GD library is ' . ( $gd_extenstion_installed ? '' : 'not ' ) . ' installed.' . '

'; // Image cache directory debug info. $cache_path = adaptive_images_plugin_get_cahe_directory_path(); $cache_path_exists = file_exists( $cache_path ); $message .= '

' . ( $cache_path_exists ? $icons['true'] : $icons['false'] ) . ' Image cache directory has ' . ( $cache_path_exists ? '' : 'not ' ) . 'been created.' . '

' . ( $cache_path_exists ? '

' . '' . $cache_path . ' => ' . adaptive_images_plugin_file_permissions( $cache_path ) . '' . '

' : '

' . ( ! $cache_path_exists && is_writable( dirname( $cache_path ) ) ? 'But this is probably because the cache has not been accessed yet.
' . 'After accessing your website from a mobile device the directory should be automatically created.' . '

' : 'It seems that the directory is not writeable. This is probably a filesystem permissions issue.
' . ' Consider adding manually the image cache directory: "/wp-content/cache/adaptive-images".' . '

' ) . '' . dirname( $cache_path ) . ' => ' . adaptive_images_plugin_file_permissions( dirname( $cache_path ) ) . '' . '

' ); // Check .htaccess file availability $htaccess = adaptive_images_plugin_get_htaccess_file_path(); $htaccess_ok = adaptive_images_actions_is_htaccess_ok(); $htaccess_writeable = adaptive_images_plugin_is_htaccess_writeable(); $message .= '

' . ( $htaccess_ok ? $icons['true'] : $icons['false'] ) . ' Installation .htaccess file is ' . ( $htaccess_ok ? 'setup OK.' : 'not properly setup.' ) . '

' . ( $htaccess_writeable ? '

' . '' . $htaccess . ' => ' . adaptive_images_plugin_file_permissions( $htaccess ) . '' . '

' : '

' . 'The .htaccess file is not writeable so it might have not been updated.' . '

' . '' . $htaccess . ' => ' . adaptive_images_plugin_file_permissions( $htaccess ) . '' . '

' ); // Image cache settings dump. $message .= '

' . $icons['debug'] . ' Adaptive images settings dump:

'; $message .= '
';
        ob_start();
        var_dump( $options );
        $message .= ob_get_clean();
        $message .= '
'; // Echo debug info or return it. if ( $echo ) { echo $message; } else { return $message; } } /** * Gets all kinds of system installation info. Kudos to WP-Migrate-DB and Send-System-Info plugins for the most of * this. * * @author Nevma (info@nevma.gr) * * @return void Nothing really! */ function adaptive_images_debug_diagnostic_info ( $echo = true ) { global $table_prefix; global $wpdb; // Collect diagnostic information. $debug = array(); $debug['Web Server'] = esc_html( $_SERVER['SERVER_SOFTWARE'] ); $debug['PHP'] = esc_html( phpversion() ); $debug['PHP Time Limit'] = esc_html( ini_get( 'max_execution_time' ) ); $debug['PHP Memory Limit'] = esc_html( ini_get( 'memory_limit' ) ); $debug['PHP Post Max Size'] = esc_html( ini_get( 'post_max_size' ) ); $debug['PHP Upload Max Size'] = esc_html( ini_get( 'upload_max_filesize' ) ); $debug['PHP Max Input Vars'] = esc_html( ini_get( 'max_input_vars' ) ); $debug['PHP Display Errors'] = esc_html( ini_get( 'display_errors' ) ); $debug['PHP Error Log'] = esc_html( ini_get( 'error_log' ) ); if ( $suhosin_limit = ini_get( 'suhosin.post.max_value_length' ) ) { $debug['Suhosin Post Max Value'] = esc_html( $suhosin_limit ); } if ( $suhosin_limit = ini_get( 'suhosin.request.max_value_length' ) ) { $debug['Suhosin Request Max Value'] = esc_html( $suhosin_limit ); } $debug['MySQL'] = esc_html( empty( $wpdb->use_mysqli ) ? mysql_get_server_info() : mysqli_get_server_info( $wpdb->dbh ) ); $debug['MySQL Ext/mysqli'] = empty( $wpdb->use_mysqli ) ? 'No' : 'Yes'; $debug['MySQL Table Prefix'] = esc_html( $table_prefix ); $debug['MySQL DB Charset'] = esc_html( DB_CHARSET ); $debug['WordPress'] = get_bloginfo( 'version' ); $debug['WP Multisite'] = ( is_multisite() ) ? 'Yes' : 'No'; $debug['WP Debug Mode'] = esc_html( ( defined( 'WP_DEBUG' ) && WP_DEBUG ) ? 'Yes' : 'No' ); $debug['WP Site url'] = esc_html( site_url() ); $debug['WP WP Home url'] = esc_html( home_url() ); $debug['WP Permalinks'] = esc_html( get_option( 'permalink_structure' ) ); $debug['WP content dir'] = esc_html( WP_CONTENT_DIR ); $debug['WP content url'] = esc_html( WP_CONTENT_URL ); $debug['WP plugin dir'] = esc_html( WP_PLUGIN_DIR ); $debug['WP plugin url'] = esc_html( WP_PLUGIN_URL ); $debug['WP Locale'] = esc_html( get_locale() ); $debug['WP Memory Limit'] = esc_html( WP_MEMORY_LIMIT ); $debug['WP Max Upload Size'] = esc_html( adaptive_images_plugin_file_size_human( wp_max_upload_size() ) ); // Active system plugins. $active_plugins = ( array ) get_option( 'active_plugins', array() ); $active_plugins_output = ''; foreach ( $active_plugins as $plugin ) { $plugin_data = get_plugin_data( WP_PLUGIN_DIR . '/' . $plugin ); $active_plugins_output .= $plugin_data['Name'] . ' v.' . $plugin_data['Version'] . ' by ' . $plugin_data['AuthorName'] . '
'; } $debug['WP Active plugins'] = $active_plugins_output; // Multisite (network) plugins. if ( is_multisite() ) { $network_active_plugins = wp_get_active_network_plugins(); foreach ( $network_active_plugins as $plugin ) { $plugin_data = get_plugin_data( WP_PLUGIN_DIR . '/' . $plugin ); $active_plugins_output .= $plugin_data['Name'] . ' v.' . $plugin_data['Version'] . ' by ' . $plugin_data['AuthorName'] . '
'; } $debug['WP Network active plugins'] = $active_plugins_output; } // Must-use plugins. $mu_plugins = wp_get_mu_plugins(); if ( $mu_plugins ) { foreach ( $network_active_plugins as $plugin ) { $plugin_data = get_plugin_data( WP_PLUGIN_DIR . '/' . $plugin ); $active_plugins_output .= $plugin_data['Name'] . ' v.' . $plugin_data['Version'] . ' by ' . $plugin_data['AuthorName'] . '
'; } $debug['WP MU plugins'] = $active_plugins_output; } // Create diagnostic output HTML table. $debug_output = ''; foreach ( $debug as $key => $value ) { $debug_output .= '' . '' . '' . ''; } $debug_output .= '
' . $key . '

' . $value . '

'; // Echo debug info or return it. if ( $echo ) { echo $debug_output; } else { return $debug_output; } } ?>