Skip to content

Commit

Permalink
Merge branch 'hotfix/1.1.2'
Browse files Browse the repository at this point in the history
  • Loading branch information
alpipego committed Feb 21, 2017
2 parents 300896c + e7669e9 commit ba852d2
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 11 deletions.
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.1.1
1.1.2
4 changes: 2 additions & 2 deletions readme.txt
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
=== Version Info ===
Contributors: alpipego
Tags: admin, version, php, mysql, server, support
Stable tag: 1.1.1
Stable tag: 1.1.2
License: MIT
Requires at least: 2.3.0
Tested up to: 4.7
Tested up to: 4.7.2

Show current WordPress, PHP, Web Server and MySQL versions in admin footer

Expand Down
16 changes: 8 additions & 8 deletions version-info.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,18 @@
* Description: Show current WordPress, PHP, Web Server and MySQL versions in admin footer
* Author: alpipego
* Author URI: http://alpipego.com/
* Version: 1.1.1
* Version: 1.1.2
* License: MIT
* GitHub Plugin URI: https://github.com/alpipego/wp-version-info
* Text Domain: version-info
*/
// pseudo namespace
class VersionInfo {

public function __construct() {
private $db;

public function __construct( \wpdb $wpdb ) {
$this->db = $wpdb;
add_action( 'plugins_loaded', array( $this, 'load_text_domain' ) );
add_filter( 'update_footer', array( $this, 'version_in_footer' ), 11 );
}
Expand All @@ -35,12 +38,9 @@ public function version_in_footer() {
$update = core_update_footer();
$wp_version = strpos( $update, '<strong>' ) === 0 ? get_bloginfo( 'version' ) . ' (' . $update . ')' : get_bloginfo( 'version' );

$mysqli = new mysqli( DB_HOST, DB_USER, DB_PASSWORD );
$mysql_server = explode( '-', mysqli_get_server_info( $mysqli ) );
$mysqli->close();

return sprintf( esc_attr__( 'You are running WordPress %s | PHP %s | %s | MySQL %s', 'version-info' ), $wp_version, phpversion(), $_SERVER['SERVER_SOFTWARE'], $mysql_server[0] );
return sprintf( esc_attr__( 'You are running WordPress %s | PHP %s | %s | MySQL %s', 'version-info' ), $wp_version, phpversion(), $_SERVER['SERVER_SOFTWARE'], $this->db->get_var('SELECT VERSION();') );
}
}

new VersionInfo();
global $wpdb;
new VersionInfo( $wpdb );

0 comments on commit ba852d2

Please sign in to comment.