bug in rank math v1.0.49

#92428
  • Hi
    For users who use solar date in WordPress, the following error occurs in this version of your plugin:

    Fatal error: Uncaught Exception: DateTime::__construct(): Failed to parse time string (۱۳۹۹-۰۷-۱۸ ۰۰:۰۰:۰۰) at position 0 (�): Unexpected character in /home/demow/public_html/wp-content/plugins/seo-by-rank-math/includes/class-helper.php:79 Stack trace: #0 /home/demow/public_html/wp-content/plugins/seo-by-rank-math/includes/class-helper.php(79): DateTime->__construct('\xDB\xB1\xDB\xB3\xDB\xB9\xDB\xB9-\xDB\xB0\xDB\xB7-\xDB...') #1 /home/demow/public_html/wp-content/plugins/seo-by-rank-math/includes/modules/analytics/class-stats.php(93): RankMath\Helper::get_midnight('\xDB\xB1\xDB\xB3\xDB\xB9\xDB\xB9-\xDB\xB0\xDB\xB7-\xDB...') #2 /home/demow/public_html/wp-content/plugins/seo-by-rank-math/includes/modules/analytics/class-stats.php(75): RankMath\Analytics\Stats->set_date_range() #3 /home/demow/public_html/wp-content/plugins/seo-by-rank-math/includes/modules/analytics/class-analytics.php(55): RankMath\Analytics\Stats::get() #4 /home/demow/public_html/wp-content/plugins/seo-by-rank-math/includes/module/class-man in /home/demow/public_html/wp-content/plugins/seo-by-rank-math/includes/class-helper.php on line 79

    Please make the following changes in the class-helper.php file on line 75-83 to fix this :

    	public static function get_midnight( $time ) {
    		if ( is_numeric( $time ) ) {
    		    date_default_timezone_set(get_option('timezone_string'));
    			$time = date( 'Y-m-d H:i:s', $time );
    		}
    		$date = new \DateTime( $time );
    		$date->setTime( 0, 0, 0 );
    
    		return $date->getTimestamp();
    	}

    your code :

    	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();
    	}

    thank you : https://wp-yar.ir

Viewing 3 replies - 1 through 3 (of 3 total)
  • Sajid Khan
    Rank Math business

    Hello,

    I have shared this thread with the devs so they can check it.

    Looking forward to help you.

    Hi
    In the new version, this bug still exists !!

    Hello,

    We are going to be releasing a fix for the issue in the future. You can check our changelog in future updates to know if this particular issue with Parsi date has been fixed.

    Hello,

    Since we did not hear back from you for 15 days, we are assuming that you found the solution. We are closing this support ticket.

    If you still need assistance or any other help, please feel free to open a new support ticket, and we will be more than happy to assist.

    Thank you.

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

The ticket ‘bug in rank math v1.0.49’ is closed to new replies.