• When access Site Health in Admin dashboard, get Critical error.

    2021/09/20 09:39:48 [error] 1508848#0: *283968 FastCGI sent in stderr: "PHP message: PHP Fatal error: Uncaught TypeError: Unsupported operand types: string - int in /wp-admin/includes/class-wp-site-health.php:2502

    I’ve checked the class-wp-site-health.php, line 2502 in function: has_missed_cron(), I think $cron->time – time() has triggered the error.

    public function has_missed_cron() {
    		if ( is_wp_error( $this->crons ) ) {
    			return $this->crons;
    		}
    		
    		foreach ( $this->crons as $id => $cron ) {
    			if ( ( $cron->time - time() ) < $this->timeout_missed_cron ) {
    				$this->last_missed_cron = $cron->hook;
    				return true;
    			}
    		}
    		
    		return false;
    	}

    this also appears in the next function: has_late_cron().

    Hope this can be fixed in the next release.

Viewing 3 replies - 1 through 3 (of 3 total)
  • Moderator t-p

    (@t-p)

    Try manually resetting your plugins (no Dashboard access required). If that resolves the issue, reactivate each one individually until you find the cause.

    If that does not resolve the issue, access your server via SFTP or FTP, or a file manager in your hosting account’s control panel, navigate to /wp-content/themes/ and rename the directory of your currently active theme. This will force the default theme to activate and hopefully rule-out a theme-specific issue (theme functions can interfere like plugins).

    Thread Starter cnsjw

    (@cnsjw)

    I’ve tried those steps with no luck.

    Thread Starter cnsjw

    (@cnsjw)

    Is it possible this could be caused by some old failed cron job in database? Can I manually clear that?

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Probably a bug with PHP 8?’ is closed to new replies.