seo-by-rank-math
seo-by-rank-math copied to clipboard
Fatal Error in class-user.php:46 : There are no checks in place for the Object Type.
Describe the bug In some instances, Rank Math is trying to get user meta data on an object that is not a user. Some plugins (like easy property listings) will allow filtering of a post type (property for example) via query strings. If this is used on the property post type archive, Rank Math attempts to get the user meta on this archive.
To Reproduce Steps to reproduce the behavior:
- Install Easy Property Listings
- add this search param: to your property archive:
?action=epl_search&post_type=property&property_status=current&author_name={user-nicename}
- See error
Expected behavior This function should only run on users(?). Sorry, I'm not 100% sure when it should run, but given the class naming, it should only operate on user meta, or the WP_User object.
Desktop (please complete the following information): Not applicable.
Smartphone (please complete the following information): Not applicable
Additional context Warning on PHP 7.4, and Fatal error on PHP 8 +
I created a pull request: https://github.com/rankmath/seo-by-rank-math/pull/255/commits/65a7ca0ad006322c9fd852c90fadf095bf413c06