Title: PHP Warning Non Numeric Value
Last modified: June 1, 2021

---

# PHP Warning Non Numeric Value

 *  Resolved [kiwiot](https://wordpress.org/support/users/kiwiot/)
 * (@kiwiot)
 * [4 years, 12 months ago](https://wordpress.org/support/topic/php-warning-non-numeric-value-2/)
 * There seems to be a bug in Query monitor itself reporting itself as a php warning.
   I tracked it down out of curiosity
 *     ```
       		$this->data['time_limit'] = ini_get( 'max_execution_time' );
       		$this->data['time_start'] = $GLOBALS['timestart'];
   
       		if ( ! empty( $this->data['time_limit'] ) ) {
       			$this->data['time_usage'] = ( 100 / $this->data['time_limit'] ) * $this->data['time_taken'];
       		} else {
       			$this->data['time_usage'] = 0;
       		}
       ```
   
 * In my case $this->data[‘time_limit’] is returning a string (300s) therefore it
   cannot be used below
 * suggested fix
 * `$this->data['time_limit'] = (int) ini_get( 'max_execution_time' );`
 * line 44 of overview.php

Viewing 4 replies - 1 through 4 (of 4 total)

 *  Plugin Author [John Blackbourn](https://wordpress.org/support/users/johnbillion/)
 * (@johnbillion)
 * WordPress Core Developer
 * [4 years, 12 months ago](https://wordpress.org/support/topic/php-warning-non-numeric-value-2/#post-14511767)
 * Thanks for the report. “300s” is not a valid value for the `max_execution_time`
   directive as it should be an integer. You should report this to your web hosting
   provider or, if you manage the server yourself, change it to “300” as an integer.
 * Cheers!
 *  Plugin Author [John Blackbourn](https://wordpress.org/support/users/johnbillion/)
 * (@johnbillion)
 * WordPress Core Developer
 * [4 years, 12 months ago](https://wordpress.org/support/topic/php-warning-non-numeric-value-2/#post-14511772)
 * Documentation link for reference: [https://www.php.net/manual/en/info.configuration.php#ini.max-execution-time](https://www.php.net/manual/en/info.configuration.php#ini.max-execution-time)
 *  Thread Starter [kiwiot](https://wordpress.org/support/users/kiwiot/)
 * (@kiwiot)
 * [4 years, 12 months ago](https://wordpress.org/support/topic/php-warning-non-numeric-value-2/#post-14512141)
 * Hi John,
 * Yup totally agree and I actually dug deeper to find that one of my devs had set
   it incorrectly in the php.ini. That said ini_get is designed to return a string
   so shouldn’t the plugin code assume that it could be wrong ant type cast anyway?
 * [https://www.php.net/manual/en/function.ini-get.php](https://www.php.net/manual/en/function.ini-get.php)
 *  Plugin Author [John Blackbourn](https://wordpress.org/support/users/johnbillion/)
 * (@johnbillion)
 * WordPress Core Developer
 * [4 years, 12 months ago](https://wordpress.org/support/topic/php-warning-non-numeric-value-2/#post-14512735)
 * You’re right it does return a string, but for that particular directive it should
   return a numeric string. I might add a warning to QM if the value isn’t numeric,
   that way it’s easier to figure out what the problem is.
 * Cheers!

Viewing 4 replies - 1 through 4 (of 4 total)

The topic ‘PHP Warning Non Numeric Value’ is closed to new replies.

 * ![](https://ps.w.org/query-monitor/assets/icon.svg?rev=2994095)
 * [Query Monitor](https://wordpress.org/plugins/query-monitor/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/query-monitor/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/query-monitor/)
 * [Active Topics](https://wordpress.org/support/plugin/query-monitor/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/query-monitor/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/query-monitor/reviews/)

 * 4 replies
 * 2 participants
 * Last reply from: [John Blackbourn](https://wordpress.org/support/users/johnbillion/)
 * Last activity: [4 years, 12 months ago](https://wordpress.org/support/topic/php-warning-non-numeric-value-2/#post-14512735)
 * Status: resolved