-
Hi
I have recently have a fatal error in my website Admin panel:Uncaught Exception: DateTime::__construct(): Failed to parse time string (۱۳۹۹-۰۸-۰۹ ۰۰:۰۰:۰۰) at position 0 (�): Unexpected character in /home2/icananoi/public_html/wp-content/plugins/seo-by-rank-math/includes/class-helper.php:80 Stack trace: #0 /home2/icananoi/public_html/wp-content/plugins/seo-by-rank-math/includes/class-helper.php(80): DateTime->__construct(‘\xDB\xB1\xDB\xB3\xDB\xB9\xDB\xB9-\xDB\xB0\xDB\xB8-\xDB…’) #1 /home2/icananoi/public_html/wp-content/plugins/seo-by-rank-math/includes/modules/analytics/class-stats.php(94): RankMath\Helper::get_midnight(‘\xDB\xB1\xDB\xB3\xDB\xB9\xDB\xB9-\xDB\xB0\xDB\xB8-\xDB…’) #2 /home2/icananoi/public_html/wp-content/plugins/seo-by-rank-math/includes/modules/analytics/class-stats.php(76): RankMath\Analytics\Stats->set_date_range() #3 /home2/icananoi/public_html/wp-content/plugins/seo-by-rank-math/includes/modules/analytics/class-analytics.php(58): RankMath\Analytics\Stats::get() #4 /home2/icananoi/public_html/wp-content/plugins/seo-by-rank-math/i in /home2/icananoi/public_html/wp-content/plugins/seo-by-rank-math/includes/class-helper.php on line 80
And I check that code:
/**
* Get midnight time for the date variables.
*
* @param int $time Timestamp of date.
* @return int
*/
public static function get_midnight( $time ) {
if ( is_numeric( $time ) ) {
$time = date_i18n( ‘Y-m-d H:i:s’, $time );
}
$date = new \DateTime( $time );
$date->setTime( 0, 0, 0 );return $date->getTimestamp();
}I uninstalled rankmath and installed it again but nothing changed. I also tried previous versions of rankmath plugin but it wasn’t effective.
Please help me about this.
The ticket ‘Very Bad Fatal Error’ is closed to new replies.