Open jimi008 opened 5 years ago
Duplicate of #118
This seems to be an issue and previously it's hooked on favorites-nonce-generated
Currently, it can be fixed by replacing it with previous code snippet until the fix provided by the author
Thank you for your fix.
Another bottleneck is here. https://github.com/kylephillips/favorites/blob/c067229fbb043c9b6e05b8b6612983eeeb3ec72a/app/Entities/User/UserFavorites.php#L48-L61
$this->removeInvalidFavorites($favorites)
Every id from FavoritesArray is checked for existence calling to get_post($id);
Current Behavior: With settings Anonymous user disabled FavoritesArray is still loading on each page load and hit admin-ajax.php without any user authentication.
{"status":"success","favorites":[{"groups":[{"group_id":1,"site_id":1,"group_name":"Default List","posts":[]}],"posts":[],"site_id":1}]}
Expected Behavior: FavoritesArray ( array of user's favorited posts) should be loaded when the user is logged in with settings for " Anonymous user" disabled.
To Reproduce this bug simply install the Favorites version 2.3.1 and check the browser console and XHR requests.
Similar Issue: https://github.com/kylephillips/favorites/issues/118