Warning on Helper::is_timestamp() when cache activated
-
After activating the cache settings: define(‘WPP_CACHE_VIEWS’, true);
we started seeing a PHP Warning with checking if a string is a timestamp or not.V 5.2.2
here is the stack trace:
E_WARNING: DateTime::__construct(): Failed to parse time string (@2020-08-11 18:26) at position 8 (-): Double timezone specification
in DateTime::__construct called at /wp-content/plugins/wordpress-popular-posts/src/Helper.php (164)in WordPressPopularPosts\Helper::is_timestamp called at /wp-content/plugins/wordpress-popular-posts/src/Rest/Controller.php (207)
in WordPressPopularPosts\Rest\Controller::update_views_count called at /wp-includes/rest-api/class-wp-rest-server.php (1015)
in WP_REST_Server::dispatch called at /wp-includes/rest-api/class-wp-rest-server.php (342)
in WP_REST_Server::serve_request called at /wp-includes/rest-api.php (312)
in rest_api_loaded called at /wp-includes/class-wp-hook.php (287)
in WP_Hook::apply_filters called at /wp-includes/class-wp-hook.php (311)
in WP_Hook::do_action called at /wp-includes/plugin.php (544)
in do_action_ref_array called at /wp-includes/class-wp.php (388)
in WP::parse_request called at /wp-includes/class-wp.php (739)
in WP::main called at /wp-includes/functions.php (1274)
in wp called at /wp-blog-header.php (16)
in require called at /index.php (17)it seems to be happening when calling the rest api:
URL /wp-json/wordpress-popular-posts/v1/popular-postsof course this date is not a timestamp so it correctly errors somewhat but not sure if this format for checking is correct?
Thoughts on eliminating the warning?
Thanks,
Bob
- The topic ‘Warning on Helper::is_timestamp() when cache activated’ is closed to new replies.