Server IP & Memory Usage Display - Version 2.0.0

Version Description

  • Added additional information about memory_get_peak_usage() - support ticket by @diablodale
Download this release

Release Info

Developer apasionados
Plugin Icon 128x128 Server IP & Memory Usage Display
Version 2.0.0
Comparing to
See all releases

Code changes from version 2.0.2 to 2.0.0

lang/server-ip-memory-usage-es_ES.mo CHANGED
Binary file
lang/server-ip-memory-usage-es_ES.po CHANGED
@@ -1,15 +1,15 @@
1
  msgid ""
2
  msgstr ""
3
  "Project-Id-Version: ip-address-memory-usage\n"
4
- "POT-Creation-Date: 2016-12-27 11:04+0100\n"
5
- "PO-Revision-Date: 2016-12-27 11:04+0100\n"
6
  "Last-Translator: Ramon <marketing@apasionados.es>\n"
7
  "Language-Team: Apasionados <info@apasionados.es>\n"
8
  "Language: es_ES\n"
9
  "MIME-Version: 1.0\n"
10
  "Content-Type: text/plain; charset=UTF-8\n"
11
  "Content-Transfer-Encoding: 8bit\n"
12
- "X-Generator: Poedit 1.8.11\n"
13
  "X-Poedit-KeywordsList: __;_;gettext;gettext_noop;_e\n"
14
  "X-Poedit-Basepath: .\n"
15
  "X-Poedit-SearchPath-0: .\n"
@@ -28,35 +28,39 @@ msgstr ""
28
  "en el pie de la adminstración de WordPress para los usuarios que son "
29
  "adminstradores."
30
 
31
- #: ../server-ip-memory-usage.php:82
32
  msgid "N/A"
33
  msgstr "N/D"
34
 
35
- #: ../server-ip-memory-usage.php:92
36
  msgid "Memory"
37
  msgstr "Memoria"
38
 
39
- #: ../server-ip-memory-usage.php:92
40
  msgid "of"
41
  msgstr "de"
42
 
43
- #: ../server-ip-memory-usage.php:92
 
 
 
 
44
  msgid "WP LIMIT"
45
  msgstr "LÍMITE WP"
46
 
47
- #: ../server-ip-memory-usage.php:112
48
  msgid "Could not activate plugin: PHP version error"
49
  msgstr "No se ha podido activar el plugin: Error de versión PHP"
50
 
51
- #: ../server-ip-memory-usage.php:112
52
  msgid "You are using PHP version"
53
  msgstr "Estás usando la versión de PHP"
54
 
55
- #: ../server-ip-memory-usage.php:112
56
  msgid "This plugin has been tested with PHP versions 5.3 and greater."
57
  msgstr "Este plugin ha sido probado versiones de PHP 5.3 y superiores."
58
 
59
- #: ../server-ip-memory-usage.php:112
60
  msgid ""
61
  "WordPress itself <a href=\"https://wordpress.org/about/requirements/\" "
62
  "target=\"_blank\">recommends using PHP version 7 or greater</a>. Please "
@@ -66,3 +70,6 @@ msgstr ""
66
  "\"_blank\">recomienda el uso de PHP versión 7 o superior</a> . Por favor, "
67
  "actualiza tu versión de PHP o ponte en contacto con el administrador del "
68
  "servidor."
 
 
 
1
  msgid ""
2
  msgstr ""
3
  "Project-Id-Version: ip-address-memory-usage\n"
4
+ "POT-Creation-Date: 2017-03-27 21:06+0200\n"
5
+ "PO-Revision-Date: 2017-03-27 21:10+0200\n"
6
  "Last-Translator: Ramon <marketing@apasionados.es>\n"
7
  "Language-Team: Apasionados <info@apasionados.es>\n"
8
  "Language: es_ES\n"
9
  "MIME-Version: 1.0\n"
10
  "Content-Type: text/plain; charset=UTF-8\n"
11
  "Content-Transfer-Encoding: 8bit\n"
12
+ "X-Generator: Poedit 1.8.12\n"
13
  "X-Poedit-KeywordsList: __;_;gettext;gettext_noop;_e\n"
14
  "X-Poedit-Basepath: .\n"
15
  "X-Poedit-SearchPath-0: .\n"
28
  "en el pie de la adminstración de WordPress para los usuarios que son "
29
  "adminstradores."
30
 
31
+ #: ../server-ip-memory-usage.php:90
32
  msgid "N/A"
33
  msgstr "N/D"
34
 
35
+ #: ../server-ip-memory-usage.php:101
36
  msgid "Memory"
37
  msgstr "Memoria"
38
 
39
+ #: ../server-ip-memory-usage.php:101
40
  msgid "of"
41
  msgstr "de"
42
 
43
+ #: ../server-ip-memory-usage.php:101
44
+ msgid "Peak"
45
+ msgstr "Máximo"
46
+
47
+ #: ../server-ip-memory-usage.php:101
48
  msgid "WP LIMIT"
49
  msgstr "LÍMITE WP"
50
 
51
+ #: ../server-ip-memory-usage.php:121
52
  msgid "Could not activate plugin: PHP version error"
53
  msgstr "No se ha podido activar el plugin: Error de versión PHP"
54
 
55
+ #: ../server-ip-memory-usage.php:121
56
  msgid "You are using PHP version"
57
  msgstr "Estás usando la versión de PHP"
58
 
59
+ #: ../server-ip-memory-usage.php:121
60
  msgid "This plugin has been tested with PHP versions 5.3 and greater."
61
  msgstr "Este plugin ha sido probado versiones de PHP 5.3 y superiores."
62
 
63
+ #: ../server-ip-memory-usage.php:121
64
  msgid ""
65
  "WordPress itself <a href=\"https://wordpress.org/about/requirements/\" "
66
  "target=\"_blank\">recommends using PHP version 7 or greater</a>. Please "
70
  "\"_blank\">recomienda el uso de PHP versión 7 o superior</a> . Por favor, "
71
  "actualiza tu versión de PHP o ponte en contacto con el administrador del "
72
  "servidor."
73
+
74
+ #~ msgid "Memory Peak"
75
+ #~ msgstr "Máximo uso memoria"
lang/server-ip-memory-usage.pot CHANGED
@@ -3,20 +3,20 @@ msgid ""
3
  msgstr ""
4
  "Plural-Forms: nplurals=INTEGER; plural=EXPRESSION;\n"
5
  "Project-Id-Version: Server IP & Memory Usage Display\n"
6
- "POT-Creation-Date: 2016-12-27 11:05+0100\n"
7
  "PO-Revision-Date: 2016-12-27 11:05+0100\n"
8
  "Last-Translator: Ramon <marketing@apasionados.es>\n"
9
  "Language-Team: Ramon <marketing@apasionados.es>\n"
10
  "MIME-Version: 1.0\n"
11
  "Content-Type: text/plain; charset=UTF-8\n"
12
  "Content-Transfer-Encoding: 8bit\n"
13
- "X-Generator: Poedit 1.8.11\n"
14
  "X-Poedit-Basepath: ..\n"
15
  "X-Poedit-WPHeader: server-ip-memory-usage.php\n"
16
  "X-Poedit-SourceCharset: UTF-8\n"
17
  "X-Poedit-KeywordsList: __;_e;_n:1,2;_x:1,2c;_ex:1,2c;_nx:4c,1,2;esc_attr__;"
18
- "esc_attr_e;esc_attr_x:1,2c;esc_html__;esc_html_e;esc_html_x:1,2c;_n_noop:1,2;"
19
- "_nx_noop:3c,1,2;__ngettext_noop:1,2\n"
20
  "X-Poedit-SearchPath-0: .\n"
21
  "X-Poedit-SearchPathExcluded-0: *.js\n"
22
 
@@ -32,35 +32,39 @@ msgid ""
32
  "footer."
33
  msgstr ""
34
 
35
- #: server-ip-memory-usage.php:82
36
  msgid "N/A"
37
  msgstr ""
38
 
39
- #: server-ip-memory-usage.php:92
40
  msgid "Memory"
41
  msgstr ""
42
 
43
- #: server-ip-memory-usage.php:92
44
  msgid "of"
45
  msgstr ""
46
 
47
- #: server-ip-memory-usage.php:92
 
 
 
 
48
  msgid "WP LIMIT"
49
  msgstr ""
50
 
51
- #: server-ip-memory-usage.php:112
52
  msgid "Could not activate plugin: PHP version error"
53
  msgstr ""
54
 
55
- #: server-ip-memory-usage.php:112
56
  msgid "You are using PHP version"
57
  msgstr ""
58
 
59
- #: server-ip-memory-usage.php:112
60
  msgid "This plugin has been tested with PHP versions 5.3 and greater."
61
  msgstr ""
62
 
63
- #: server-ip-memory-usage.php:112
64
  msgid ""
65
  "WordPress itself <a href=\"https://wordpress.org/about/requirements/\" "
66
  "target=\"_blank\">recommends using PHP version 7 or greater</a>. Please "
3
  msgstr ""
4
  "Plural-Forms: nplurals=INTEGER; plural=EXPRESSION;\n"
5
  "Project-Id-Version: Server IP & Memory Usage Display\n"
6
+ "POT-Creation-Date: 2017-03-27 21:08+0200\n"
7
  "PO-Revision-Date: 2016-12-27 11:05+0100\n"
8
  "Last-Translator: Ramon <marketing@apasionados.es>\n"
9
  "Language-Team: Ramon <marketing@apasionados.es>\n"
10
  "MIME-Version: 1.0\n"
11
  "Content-Type: text/plain; charset=UTF-8\n"
12
  "Content-Transfer-Encoding: 8bit\n"
13
+ "X-Generator: Poedit 1.8.12\n"
14
  "X-Poedit-Basepath: ..\n"
15
  "X-Poedit-WPHeader: server-ip-memory-usage.php\n"
16
  "X-Poedit-SourceCharset: UTF-8\n"
17
  "X-Poedit-KeywordsList: __;_e;_n:1,2;_x:1,2c;_ex:1,2c;_nx:4c,1,2;esc_attr__;"
18
+ "esc_attr_e;esc_attr_x:1,2c;esc_html__;esc_html_e;esc_html_x:1,2c;"
19
+ "_n_noop:1,2;_nx_noop:3c,1,2;__ngettext_noop:1,2\n"
20
  "X-Poedit-SearchPath-0: .\n"
21
  "X-Poedit-SearchPathExcluded-0: *.js\n"
22
 
32
  "footer."
33
  msgstr ""
34
 
35
+ #: server-ip-memory-usage.php:90
36
  msgid "N/A"
37
  msgstr ""
38
 
39
+ #: server-ip-memory-usage.php:101
40
  msgid "Memory"
41
  msgstr ""
42
 
43
+ #: server-ip-memory-usage.php:101
44
  msgid "of"
45
  msgstr ""
46
 
47
+ #: server-ip-memory-usage.php:101
48
+ msgid "Peak"
49
+ msgstr ""
50
+
51
+ #: server-ip-memory-usage.php:101
52
  msgid "WP LIMIT"
53
  msgstr ""
54
 
55
+ #: server-ip-memory-usage.php:121
56
  msgid "Could not activate plugin: PHP version error"
57
  msgstr ""
58
 
59
+ #: server-ip-memory-usage.php:121
60
  msgid "You are using PHP version"
61
  msgstr ""
62
 
63
+ #: server-ip-memory-usage.php:121
64
  msgid "This plugin has been tested with PHP versions 5.3 and greater."
65
  msgstr ""
66
 
67
+ #: server-ip-memory-usage.php:121
68
  msgid ""
69
  "WordPress itself <a href=\"https://wordpress.org/about/requirements/\" "
70
  "target=\"_blank\">recommends using PHP version 7 or greater</a>. Please "
readme.txt CHANGED
@@ -5,7 +5,7 @@ Author URI: http://apasionados.es/
5
  Tags: memory, memory-limit, ip, ips, admin, adress, php, server, info
6
  Requires at least: 3.0.1
7
  Tested up to: 4.7
8
- Stable tag: 2.0.2
9
  License: GPLv2 or later
10
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
11
 
@@ -61,8 +61,6 @@ You can access the description of the plugin in Spanish at: [Server IP & Memory
61
 
62
  Please note that the plugin should not be used together with other plugins with similar funcionalities like: [WP-Memory-Usage](http://wordpress.org/plugins/wp-memory-usage/ "WP-Memory-Usage").
63
 
64
- Please use with *WordPress MultiSite* at your own risk, as it has not been tested.
65
-
66
  == Frequently Asked Questions ==
67
 
68
  = Why did you make this plugin? =
@@ -77,7 +75,6 @@ You can simply activate, deactivate or delete it in your plugin management secti
77
 
78
  = Are there any known incompatibilities? =
79
  The plugin should not be used together with other plugins with similar funcionalities like: [WP-Memory-Usage](http://wordpress.org/plugins/wp-memory-usage/ "WP-Memory-Usage").
80
- Please use with *WordPress MultiSite* at your own risk, as it has not been tested.
81
 
82
  = Are there any server requirements? =
83
  The PHP version should be at least 5.3. If PHP version is lower than 5.3 there is an error message shown and plugin is not activated.
@@ -87,12 +84,6 @@ Of course we do. That's why we created it. ;-)
87
 
88
  == Changelog ==
89
 
90
- = 2.0.2 =
91
- * Solved: PHP 7.1 Notice: A non well formed numeric value encountered for $result
92
-
93
- = 2.0.1 =
94
- * Changed memory information display to use memory_get_peak_usage().
95
-
96
  = 2.0.0 =
97
  * Added additional information about memory_get_peak_usage() - support ticket by @diablodale
98
 
@@ -126,8 +117,8 @@ Of course we do. That's why we created it. ;-)
126
 
127
  == Upgrade Notice ==
128
 
129
- = 2.0.2 =
130
- * Solved: PHP 7.1 Notice: A non well formed numeric value encountered for $result
131
 
132
  == Contact ==
133
 
5
  Tags: memory, memory-limit, ip, ips, admin, adress, php, server, info
6
  Requires at least: 3.0.1
7
  Tested up to: 4.7
8
+ Stable tag: 2.0.0
9
  License: GPLv2 or later
10
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
11
 
61
 
62
  Please note that the plugin should not be used together with other plugins with similar funcionalities like: [WP-Memory-Usage](http://wordpress.org/plugins/wp-memory-usage/ "WP-Memory-Usage").
63
 
 
 
64
  == Frequently Asked Questions ==
65
 
66
  = Why did you make this plugin? =
75
 
76
  = Are there any known incompatibilities? =
77
  The plugin should not be used together with other plugins with similar funcionalities like: [WP-Memory-Usage](http://wordpress.org/plugins/wp-memory-usage/ "WP-Memory-Usage").
 
78
 
79
  = Are there any server requirements? =
80
  The PHP version should be at least 5.3. If PHP version is lower than 5.3 there is an error message shown and plugin is not activated.
84
 
85
  == Changelog ==
86
 
 
 
 
 
 
 
87
  = 2.0.0 =
88
  * Added additional information about memory_get_peak_usage() - support ticket by @diablodale
89
 
117
 
118
  == Upgrade Notice ==
119
 
120
+ = 2.0.0 =
121
+ * Added additional information about memory_get_peak_usage()
122
 
123
  == Contact ==
124
 
server-ip-memory-usage.php CHANGED
@@ -3,7 +3,7 @@
3
  Plugin Name: Server IP & Memory Usage Display
4
  Plugin URI: http://apasionados.es/#utm_source=wpadmin&utm_medium=plugin&utm_campaign=server-ip-memory-usage-plugin
5
  Description: Show the memory limit, current memory usage and IP address in the admin footer.
6
- Version: 2.0.2
7
  Author: Apasionados, Apasionados del Marketing
8
  Author URI: http://apasionados.es
9
  Text Domain: server-ip-memory-usage
@@ -47,9 +47,9 @@ if ( is_admin() ) {
47
  }
48
 
49
  function check_memory_usage() {
50
-
51
- $this->memory['usage'] = function_exists('memory_get_usage') ? round(memory_get_usage() / 1024 / 1024, 2) : 0;
52
-
53
  if ( !empty($this->memory['usage']) && !empty($this->memory['limit']) ) {
54
  $this->memory['percent'] = round ($this->memory['usage'] / $this->memory['limit'] * 100, 0);
55
  $this->memory['color'] = 'font-weight:normal;';
@@ -58,11 +58,19 @@ if ( is_admin() ) {
58
  }
59
  }
60
 
 
 
 
 
 
 
 
 
 
 
61
  function format_wp_limit( $size ) {
62
  $value = substr( $size, -1 );
63
  $return = substr( $size, 0, -1 );
64
-
65
- $return = (int)$return; // Solved: PHP 7.1 Notice: A non well formed numeric value encountered
66
 
67
  switch ( strtoupper( $value ) ) {
68
  case 'P' :
@@ -86,12 +94,13 @@ if ( is_admin() ) {
86
 
87
  function add_footer($content) {
88
  $this->check_memory_usage();
 
89
  //$server_ip_address = $_SERVER[ 'SERVER_ADDR' ];
90
  $server_ip_address = (!empty($_SERVER[ 'SERVER_ADDR' ]) ? $_SERVER[ 'SERVER_ADDR' ] : "");
91
  if ($server_ip_address == "") { // Added for IP Address in IIS
92
  $server_ip_address = (!empty($_SERVER[ 'LOCAL_ADDR' ]) ? $_SERVER[ 'LOCAL_ADDR' ] : "");
93
  }
94
- $content .= ' | ' . __( 'Memory', 'server-ip-memory-usage' ) . ': ' . $this->memory['usage'] . ' ' . __( 'of', 'server-ip-memory-usage' ) . ' ' . $this->memory['limit'] . ' MB (<span style="' . $this->memory['color'] . '">' . $this->memory['percent'] . '%</span>) | ' . __( 'WP LIMIT', 'server-ip-memory-usage' ) . ': ' . $this->check_wp_limit() . ' | IP ' . $server_ip_address . ' (' . gethostname() . ') | PHP ' . PHP_VERSION . ' @' . (PHP_INT_SIZE * 8) . 'BitOS';
95
  return $content;
96
  }
97
 
3
  Plugin Name: Server IP & Memory Usage Display
4
  Plugin URI: http://apasionados.es/#utm_source=wpadmin&utm_medium=plugin&utm_campaign=server-ip-memory-usage-plugin
5
  Description: Show the memory limit, current memory usage and IP address in the admin footer.
6
+ Version: 2.0.0
7
  Author: Apasionados, Apasionados del Marketing
8
  Author URI: http://apasionados.es
9
  Text Domain: server-ip-memory-usage
47
  }
48
 
49
  function check_memory_usage() {
50
+ // $this->memory['usage'] = function_exists('memory_get_usage') ? round(memory_get_usage(TRUE) / 1024 / 1024, 2) : 0;
51
+ // Changed memory_get_usage to memory_get_peak_usage
52
+ $this->memory['usage'] = function_exists('memory_get_peak_usage') ? round(memory_get_peak_usage(TRUE) / 1024 / 1024, 2) : 0;
53
  if ( !empty($this->memory['usage']) && !empty($this->memory['limit']) ) {
54
  $this->memory['percent'] = round ($this->memory['usage'] / $this->memory['limit'] * 100, 0);
55
  $this->memory['color'] = 'font-weight:normal;';
58
  }
59
  }
60
 
61
+ function check_memory_peakusage() {
62
+ $this->memory['peakusage'] = function_exists('memory_get_peak_usage') ? round(memory_get_peak_usage(TRUE) / 1024 / 1024, 2) : 0;
63
+ if ( !empty($this->memory['peakusage']) && !empty($this->memory['limit']) ) {
64
+ $this->memory['peakpercent'] = round ($this->memory['peakusage'] / $this->memory['limit'] * 100, 0);
65
+ $this->memory['peakcolor'] = 'font-weight:normal;';
66
+ if ($this->memory['peakpercent'] > 75) $this->memory['peakcolor'] = 'font-weight:bold;color:#E66F00';
67
+ if ($this->memory['peakpercent'] > 90) $this->memory['peakcolor'] = 'font-weight:bold;color:red';
68
+ }
69
+ }
70
+
71
  function format_wp_limit( $size ) {
72
  $value = substr( $size, -1 );
73
  $return = substr( $size, 0, -1 );
 
 
74
 
75
  switch ( strtoupper( $value ) ) {
76
  case 'P' :
94
 
95
  function add_footer($content) {
96
  $this->check_memory_usage();
97
+ $this->check_memory_peakusage();
98
  //$server_ip_address = $_SERVER[ 'SERVER_ADDR' ];
99
  $server_ip_address = (!empty($_SERVER[ 'SERVER_ADDR' ]) ? $_SERVER[ 'SERVER_ADDR' ] : "");
100
  if ($server_ip_address == "") { // Added for IP Address in IIS
101
  $server_ip_address = (!empty($_SERVER[ 'LOCAL_ADDR' ]) ? $_SERVER[ 'LOCAL_ADDR' ] : "");
102
  }
103
+ $content .= ' | ' . __( 'Memory', 'server-ip-memory-usage' ) . ': ' . $this->memory['usage'] . ' ' . __( 'of', 'server-ip-memory-usage' ) . ' ' . $this->memory['limit'] . ' MB (<span style="' . $this->memory['color'] . '">' . $this->memory['percent'] . '%</span>) · ' . __( 'Peak', 'server-ip-memory-usage' ) . ': ' . $this->memory['peakusage'] . ' ' . __( 'of', 'server-ip-memory-usage' ) . ' ' . $this->memory['limit'] . ' MB (<span style="' . $this->memory['peakcolor'] . '">' . $this->memory['peakpercent'] . '%</span>) | ' . __( 'WP LIMIT', 'server-ip-memory-usage' ) . ': ' . $this->check_wp_limit() . ' | IP ' . $server_ip_address . ' (' . gethostname() . ') | PHP ' . PHP_VERSION . ' @' . (PHP_INT_SIZE * 8) . 'BitOS';
104
  return $content;
105
  }
106