Display PHP Version - Version 1.2

Version Description

Download this release

Release Info

Developer dgwyer
Plugin Icon 128x128 Display PHP Version
Version 1.2
Comparing to
See all releases

Code changes from version 1.0 to 1.2

Files changed (4) hide show
  1. display-php-version.php +17 -11
  2. dpv.js +3 -0
  3. readme.txt +17 -8
  4. screenshot-1.png +0 -0
display-php-version.php CHANGED
@@ -1,8 +1,8 @@
1
  <?php
2
  /*
3
  Plugin Name: Display PHP Version
4
- Description: Displays the current PHP version in the "Right Now" admin dashboard widget.
5
- Version: 1.0
6
  Author: David Gwyer
7
  Author URI: http://www.presscoders.com
8
  */
@@ -24,13 +24,19 @@ Author URI: http://www.presscoders.com
24
  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
25
  */
26
 
27
- function pc_add_php_version() {
28
- ?>
29
- <script language="javascript">
30
- jQuery(document).ready(function($) {
31
- $("#wp-version-message .b").after("<span>, with PHP <b><?php echo phpversion(); ?></b></span>");
32
- });
33
- </script>
34
- <?php
 
 
 
 
 
 
35
  }
36
- add_action('rightnow_end', 'pc_add_php_version');
1
  <?php
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.2
6
  Author: David Gwyer
7
  Author URI: http://www.presscoders.com
8
  */
24
  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
25
  */
26
 
27
+ function dpv_enqueue_script($hook) {
28
+
29
+ // only run on dashboard page
30
+ if( 'index.php' != $hook )
31
+ return;
32
+
33
+ // enqueue script to show PHP version
34
+ wp_enqueue_script( 'dpv_script', plugin_dir_url( __FILE__ ) . 'dpv.js' );
35
+
36
+ // pass the PHP version to JavaScript
37
+ wp_localize_script( 'dpv_script', 'dpvObj', array(
38
+ 'phpVersion' => phpversion()
39
+ ) );
40
+
41
  }
42
+ add_action( 'admin_enqueue_scripts', 'dpv_enqueue_script' );
dpv.js ADDED
@@ -0,0 +1,3 @@
 
 
 
1
+ jQuery(document).ready(function($) {
2
+ $("#wp-version-message").after("<p>Running PHP version: <b>" + dpvObj.phpVersion + "</b></p>");
3
+ });
readme.txt CHANGED
@@ -2,14 +2,14 @@
2
  Contributors: dgwyer
3
  Tags: admin, dashboard, widget, display, PHP, version
4
  Requires at least: 2.7
5
- Tested up to: 3.2.1
6
- Stable tag: 1.0
7
 
8
- Displays the current PHP version in the "Right Now" admin dashboard widget.
9
 
10
  == Description ==
11
 
12
- Displays the current PHP version in the "Right Now" admin dashboard widget.
13
 
14
  Please rate the Plugin if you find it useful, thanks.
15
 
@@ -19,10 +19,11 @@ See our <a href="http://www.presscoders.com" target="_blank">WordPress developme
19
 
20
  Instructions for installing the Display PHP Version Plugin.
21
 
22
- 1. Download and extract the Plugin zip file.
23
- 2. Upload the folder containing the Plugin files to your WordPress Plugins folder (usually ../wp-content/plugins/ folder).
24
- 3. Activate the Plugin via the 'Plugins' menu in WordPress.
25
- 4. Go to your WordPress dashboard page and look next to your WordPress version to see what PHP version is running.
 
26
 
27
  == Screenshots ==
28
 
@@ -30,6 +31,14 @@ Instructions for installing the Display PHP Version Plugin.
30
 
31
  == Changelog ==
32
 
 
 
 
 
 
 
 
 
33
  *1.0 update*
34
 
35
  * Initial uploaded version!
2
  Contributors: dgwyer
3
  Tags: admin, dashboard, widget, display, PHP, version
4
  Requires at least: 2.7
5
+ Tested up to: 3.9.1
6
+ Stable tag: 1.2
7
 
8
+ Displays the current PHP version in the "At a Glance" admin dashboard widget.
9
 
10
  == Description ==
11
 
12
+ Displays the current PHP version in the "At a Glane" admin dashboard widget.
13
 
14
  Please rate the Plugin if you find it useful, thanks.
15
 
19
 
20
  Instructions for installing the Display PHP Version Plugin.
21
 
22
+ 1. In your WordPress admin go to Plugins -> Add New.
23
+ 2. Enter Display PHP Version in the text box and click Search Plugins.
24
+ 3. In the list of Plugins click Install Now next to the Display PHP Version Plugin.
25
+ 4. Once installed click to activate.
26
+ 5. Go to your WordPress dashboard page and look next to your WordPress version to see what PHP version is running.
27
 
28
  == Screenshots ==
29
 
31
 
32
  == Changelog ==
33
 
34
+ *1.2 update*
35
+
36
+ * Added more reliable way to output PHP version number.
37
+
38
+ *1.1 update*
39
+
40
+ * Updated for WordPress 3.9.1.
41
+
42
  *1.0 update*
43
 
44
  * Initial uploaded version!
screenshot-1.png CHANGED
Binary file