| 1 |
<?php |
| 2 |
/* |
| 3 |
Plugin Name: WordPress and Environment Version Number in Footer |
| 4 |
Plugin URI: https://wordpress.org/plugins/version-info |
| 5 |
Description: Show current WordPress, PHP, Web Server and MySQL versions in admin footer |
| 6 |
Author: alpipego |
| 7 |
Version: 1.0.2 |
| 8 |
Author URI: http://alpipego.com/ |
| 9 |
*/ |
| 10 |
|
| 11 |
// pseudo namespace |
| 12 |
class VersionInfo { |
| 13 |
|
| 14 |
public function __construct() { |
| 15 |
add_filter( 'update_footer', array($this, 'version_in_footer'), 11 ); |
| 16 |
} |
| 17 |
|
| 18 |
public function version_in_footer() { |
| 19 |
$update = core_update_footer(); |
| 20 |
$wp_version = strpos( $update, '<strong>' ) === 0 ? get_bloginfo( 'version' ) . ' (' . $update . ')' : get_bloginfo( 'version' ); |
| 21 |
|
| 22 |
$mysqli = new mysqli( DB_HOST, DB_USER, DB_PASSWORD ); |
| 23 |
$mysql_server = explode( '-', mysqli_get_server_info( $mysqli ) ); |
| 24 |
$mysqli->close(); |
| 25 |
|
| 26 |
return sprintf( 'You are running WordPress %s | PHP %s | %s | MySQL %s', $wp_version, phpversion(), $_SERVER['SERVER_SOFTWARE'], $mysql_server[0] ); |
| 27 |
} |
| 28 |
} |
| 29 |
|
| 30 |
new VersionInfo(); |
| 31 |
|