public
Last active

WordPress Engine shortcode

  • Download Gist
gistfile1.php
PHP
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47
<?php
 
class Marko_Shortcodes {
function __construct() {
add_shortcode( 'engine_info', array( $this, 'engine_info' ) );
}
 
function engine_info( $atts ) {
global $wp_version, $batcache, $wp_object_cache;
 
$html = '<table style="width: 280px;">';
$html .= '<tr><td>WordPress versie</td><td>' . $wp_version . '</td></tr>';
 
if( is_multisite() )
$html .= '<tr><td>WordPress type</td><td>Network installation</td></tr>';
else
$html .= '<tr><td>WordPress type</td><td>Single installation</td></tr>';
 
$html .= '<tr><td>Image manipulator</td><td>' . _wp_image_editor_choose() . '</td></tr>';
 
if ( isset( $batcache ) && is_object( $batcache ) && method_exists( $wp_object_cache, 'incr' ) )
$html .= '<tr><td>Advanced cache</td><td>Batcache</td></tr>';
 
if( class_exists( 'APC_Object_Cache' ) )
$html .= '<tr><td>Object cache</td><td>APC Object Cache</td></tr>';
 
$html .= '<tr><td style="height:10px"></td></tr>';
 
$html .= '<tr><td>OS type</td><td>' . php_uname('s') . '</td></tr>';
$html .= '<tr><td>Linux distro</td><td>Debian</td></tr>';
$html .= '<tr><td>Webserver</td><td>' . $_SERVER["SERVER_SOFTWARE"] . '</td></tr>';
$html .= '<tr><td>PHP type</td><td>' . php_sapi_name() . '</td></tr>';
$html .= '<tr><td>PHP version</td><td>' . phpversion() . '</td></tr>';
$html .= '<tr><td>APC cache</td><td>' . phpversion( 'apc' ) . '</td></tr>';
$html .= '<tr><td>GD version</td><td>' . gd_info()['GD Version'] . '</td></tr>';
 
if( phpversion( 'imagick' ) )
$html .= '<tr><td>Imagick version</td><td>' . phpversion( 'imagick' ) . '</td></tr>';
 
if( phpversion( 'gmagick' ) )
$html .= '<tr><td>Gmagick version</td><td>' . phpversion( 'gmagick' ) . '</td></tr>';
 
$html .= '</table>';
 
return $html;
}
}

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.