Version Description
May 7, 2021 =
Tested plugin for WordPress 5.7.1.
Added donate link.
Plugin now also displays MySQL version too when hovering over the PHP version text.
Download this release
Release Info
Developer | dgwyer |
Plugin | Display PHP Version |
Version | 1.6 |
Comparing to | |
See all releases |
Code changes from version 1.5 to 1.6
- display-php-version.php +23 -6
- dpv.js +8 -1
- readme.txt +18 -3
- screenshot-1.png +0 -0
display-php-version.php
CHANGED
@@ -2,7 +2,7 @@
|
|
2 |
/*
|
3 |
Plugin Name: Display PHP Version
|
4 |
Description: Displays the current PHP version in the "At a Glance" admin dashboard widget.
|
5 |
-
Version: 1.
|
6 |
Author: David Gwyer
|
7 |
Author URI: http://www.wpgoplugins.com
|
8 |
*/
|
@@ -27,18 +27,35 @@ Author URI: http://www.wpgoplugins.com
|
|
27 |
function dpv_enqueue_script( $hook ) {
|
28 |
|
29 |
// only run on dashboard page
|
30 |
-
if ( 'index.php'
|
31 |
return;
|
32 |
}
|
33 |
|
34 |
// enqueue script to show PHP version
|
35 |
wp_enqueue_script( 'dpv_script', plugin_dir_url( __FILE__ ) . 'dpv.js' );
|
36 |
|
|
|
|
|
|
|
|
|
|
|
37 |
// pass the PHP version to JavaScript
|
38 |
wp_localize_script( 'dpv_script', 'dpvObj', array(
|
39 |
-
'
|
|
|
40 |
) );
|
41 |
-
|
42 |
}
|
43 |
-
|
44 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2 |
/*
|
3 |
Plugin Name: Display PHP Version
|
4 |
Description: Displays the current PHP version in the "At a Glance" admin dashboard widget.
|
5 |
+
Version: 1.6
|
6 |
Author: David Gwyer
|
7 |
Author URI: http://www.wpgoplugins.com
|
8 |
*/
|
27 |
function dpv_enqueue_script( $hook ) {
|
28 |
|
29 |
// only run on dashboard page
|
30 |
+
if ( 'index.php' !== $hook ) {
|
31 |
return;
|
32 |
}
|
33 |
|
34 |
// enqueue script to show PHP version
|
35 |
wp_enqueue_script( 'dpv_script', plugin_dir_url( __FILE__ ) . 'dpv.js' );
|
36 |
|
37 |
+
// Remove '5.5.5-' prefix on Windows OS.
|
38 |
+
$fullver = mysqli_get_server_info( mysqli_connect( DB_HOST, DB_USER, DB_PASSWORD, DB_NAME ) );
|
39 |
+
$pattern = '/^5.5.5-/i';
|
40 |
+
$mysqlver = preg_replace($pattern, '', $fullver);
|
41 |
+
|
42 |
// pass the PHP version to JavaScript
|
43 |
wp_localize_script( 'dpv_script', 'dpvObj', array(
|
44 |
+
'phpversion' => phpversion(),
|
45 |
+
'mysqlversion' => $mysqlver
|
46 |
) );
|
|
|
47 |
}
|
48 |
+
add_action( 'admin_enqueue_scripts', 'dpv_enqueue_script' );
|
49 |
+
|
50 |
+
// Add donation link.
|
51 |
+
add_filter( 'plugin_action_links_display-php-version/display-php-version.php', function ( $links ) {
|
52 |
+
|
53 |
+
// Create the link.
|
54 |
+
$settings_link = "<a title='Please help support our open source work!' href='https://www.paypal.com/biz/fund?id=6EW7V4MWJP8ZE' target='_blank'>Donate</a>";
|
55 |
+
// Adds the link to the end of the array.
|
56 |
+
array_push(
|
57 |
+
$links,
|
58 |
+
$settings_link
|
59 |
+
);
|
60 |
+
return $links;
|
61 |
+
} );
|
dpv.js
CHANGED
@@ -1,3 +1,10 @@
|
|
1 |
jQuery(document).ready(function ($) {
|
2 |
-
$("#wp-version-message").after("<p>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3 |
});
|
1 |
jQuery(document).ready(function ($) {
|
2 |
+
$("#wp-version-message").after("<p class='dpv-wrapper'><span class='dpv-php'>Server running PHP version: <b style='color:green;'>" + dpvObj.phpversion + "</b>.</span><span style='display:none;' class='dpv-mysql'> MySQL version: <b style='color:green';>" + dpvObj.mysqlversion + "</b></span></p>");
|
3 |
+
|
4 |
+
$(".dpv-wrapper").hover( function() {
|
5 |
+
$( ".dpv-mysql" ).css( "display", "inline" );
|
6 |
+
}, function() {
|
7 |
+
$( ".dpv-mysql" ).css( "display", "none" );
|
8 |
+
}
|
9 |
+
);
|
10 |
});
|
readme.txt
CHANGED
@@ -2,8 +2,8 @@
|
|
2 |
Contributors: dgwyer, wpgoplugins
|
3 |
Tags: admin, server, support, version, dashboard, widget, display, PHP
|
4 |
Requires at least: 3.0
|
5 |
-
Tested up to: 5.1
|
6 |
-
Stable tag: 1.
|
7 |
|
8 |
Displays the currently installed PHP version in the "At a Glance" admin dashboard widget.
|
9 |
|
@@ -11,9 +11,17 @@ Displays the currently installed PHP version in the "At a Glance" admin dashboar
|
|
11 |
|
12 |
Very lightweight and simple plugin that displays the currently installed PHP version in the "At a Glance" admin dashboard widget.
|
13 |
|
|
|
|
|
|
|
|
|
|
|
|
|
14 |
Please <a href="https://wordpress.org/support/view/plugin-reviews/display-php-version"><strong>rate</strong></a> this Plugin if you find it useful. It only takes a moment but it's very much appreciated. :)
|
15 |
|
16 |
-
|
|
|
|
|
17 |
|
18 |
== Installation ==
|
19 |
|
@@ -28,9 +36,16 @@ Instructions for installing the Display PHP Version Plugin.
|
|
28 |
== Screenshots ==
|
29 |
|
30 |
1. Display the currently installed PHP version in the "At a Glance" admin dashboard widget.
|
|
|
31 |
|
32 |
== Changelog ==
|
33 |
|
|
|
|
|
|
|
|
|
|
|
|
|
34 |
= 1.5 - April 26, 2019 =
|
35 |
|
36 |
* Tested plugin for WordPress 5.1.
|
2 |
Contributors: dgwyer, wpgoplugins
|
3 |
Tags: admin, server, support, version, dashboard, widget, display, PHP
|
4 |
Requires at least: 3.0
|
5 |
+
Tested up to: 5.7.1
|
6 |
+
Stable tag: 1.6
|
7 |
|
8 |
Displays the currently installed PHP version in the "At a Glance" admin dashboard widget.
|
9 |
|
11 |
|
12 |
Very lightweight and simple plugin that displays the currently installed PHP version in the "At a Glance" admin dashboard widget.
|
13 |
|
14 |
+
In the latest plugin version you can also view the current MySQL version when hovering over the PHP version text. We chose to implement it this way as you may not need to know the MySQL version as often as the PHP version, and it just adds unnecessary visual noise.
|
15 |
+
|
16 |
+
Just hover over the PHP version label to display the installed MySQL version.
|
17 |
+
|
18 |
+
Also, on some Windows based servers the returned MySQL version can be displayed with a <code>5.5.5-</code> prefix which can be a little annoying, so this is removed for convenience.
|
19 |
+
|
20 |
Please <a href="https://wordpress.org/support/view/plugin-reviews/display-php-version"><strong>rate</strong></a> this Plugin if you find it useful. It only takes a moment but it's very much appreciated. :)
|
21 |
|
22 |
+
And here's how you can <a href='https://www.paypal.com/biz/fund?id=6EW7V4MWJP8ZE' target='_blank'>help support</a> our open source work. We couldn't do this without you!
|
23 |
+
|
24 |
+
For more plugins see our <a href="https://www.wpgoplugins.com" target="_blank">WordPress plugin site</a>.
|
25 |
|
26 |
== Installation ==
|
27 |
|
36 |
== Screenshots ==
|
37 |
|
38 |
1. Display the currently installed PHP version in the "At a Glance" admin dashboard widget.
|
39 |
+
2. Hover over the PHP version text to display the current MySQL version too!
|
40 |
|
41 |
== Changelog ==
|
42 |
|
43 |
+
= 1.6 - May 7, 2021 =
|
44 |
+
|
45 |
+
* Tested plugin for WordPress 5.7.1.
|
46 |
+
* Added donate link.
|
47 |
+
* Plugin now also displays MySQL version too when hovering over the PHP version text.
|
48 |
+
|
49 |
= 1.5 - April 26, 2019 =
|
50 |
|
51 |
* Tested plugin for WordPress 5.1.
|
screenshot-1.png
DELETED
Binary file
|