• Thanx for todays update, unfortunately there is still one error that this plugin reports itsself:

    Trying to access array offset on value of type bool 1
    wp-content/plugins/query-monitor/collectors/environment.php:264

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author John Blackbourn

    (@johnbillion)

    WordPress Core Developer

    Thanks. What environment is this on please?

    Thread Starter Jacob N. Breetvelt

    (@opajaap)

    Its my test/development site (i write plugins) https://betatest.opajaap.nl/
    It runs WP 5.4.2, in config:

    define('WP_DEBUG', true);
    define('WP_DEBUG_LOG', true);
    define('WP_POST_REVISIONS', 3 );
    define('SCRIPT_DEBUG', true);
    

    It shows up on all pages (admin and frontend)

    PHP version is 7.4.8

    Thread Starter Jacob N. Breetvelt

    (@opajaap)

    The fix to get rid of this annoying message is extremely simple:

    In …/plugins/query-monitor/collectors/environment.php line 258
    change:

    	protected static function get_current_user() {
    
    		$php_u = null;
    
    		if ( function_exists( 'posix_getpwuid' ) ) {
    			$u = posix_getpwuid( posix_getuid() );
    			$g = posix_getgrgid( $u['gid'] );
    
    			if ( ! empty( $u ) && ! empty( $g ) ) {
    				$php_u = $u['name'] . ':' . $g['name'];
    			}
    		}
    

    into:

    	protected static function get_current_user() {
    
    		$php_u = null;
    
    		if ( function_exists( 'posix_getpwuid' ) ) {
    			$u = posix_getpwuid( posix_getuid() );
    			if ( is_array( $u ) ) {
    				$g = posix_getgrgid( $u['gid'] );
    			}
    
    			if ( ! empty( $u ) && ! empty( $g ) ) {
    				$php_u = $u['name'] . ':' . $g['name'];
    			}
    		}
    
    Plugin Author John Blackbourn

    (@johnbillion)

    WordPress Core Developer

    Cross your fingers Jacob! 😀 This should be fixed in 3.6.2.

    Thread Starter Jacob N. Breetvelt

    (@opajaap)

    Thanx!

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

The topic ‘One PHP Notice left after last update’ is closed to new replies.