Support » Plugin: Query Monitor » PHP Warning Non Numeric Value

  • Resolved kiwiot

    (@kiwiot)


    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)
Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘PHP Warning Non Numeric Value’ is closed to new replies.