karoldomag
Forum Replies Created
-
Forum: Plugins
In reply to: [Page Restrict for WooCommerce] Page is restricted despite product boughtHi, yes, I am using a caching system provided by my host. Specifically:
Nginx FastCGI Cache – however, this is completely bypassed for logged-in users, so it shouldn’t be the issue here.
Redis Object Cache – this is where the problem seems to lie.
My hosting support performed a deep dive and confirmed that your plugin’s checks are being “frozen” in the Object Cache. When a user buys a product, the database is updated, but the query results stored in Redis still return the “old” restricted status for that user.
The issue is resolved only when I manually flush the Object Cache (Redis).
Could you check if the plugin uses get_user_meta or other functions that might be cached by Redis without being invalidated when a WooCommerce order is completed? Or perhaps you could suggest a hook I could use to trigger a cache refresh for the specific user after a successful purchase?
Forum: Plugins
In reply to: [Page Restrict for WooCommerce] Page is restricted despite product boughtyes, I already tested this before. When I cleared the cache everything with PageRestrict got back to normal. For the time being I disabled the cache completely.
Forum: Plugins
In reply to: [Page Restrict for WooCommerce] Page is restricted despite product boughtthanks for responding. Yeah based on what you are saying this is exactly the issue in the plugin. I’m getting cached data even those database was updated. I presume you don’t clear cache on POST requests thus the issue. Do you explicitly clear cache when update requests are made? If not that’s the culprit – I also saw other people mentioned the same problem. Please confirm. Thank you.
Forum: Plugins
In reply to: [Page Restrict for WooCommerce] Page is restricted despite product boughtI got some feedback from my hosting provider as well.
Problem Description: When a user purchases a product, their access permissions do not update immediately. Even after a successful transaction, the user is still being redirected to the “no access” page. Conversely, sometimes users who should be restricted can still see the content. The issue only resolves after a manual flush of the Redis cache.
Technical Details: My hosting provider investigated the issue and confirmed that Nginx FastCGI cache is bypassed for logged-in users, so the problem lies within the Object Cache (Redis). It seems the plugin does not trigger a cache invalidation for specific meta keys or option groups when:
- A purchase status changes in WooCommerce.
- Plugin settings are saved in the admin panel.
Question: Does the plugin support
wp_cache_deleteorwp_cache_flushfor its permission checks? If not, could you provide a hook or a snippet that I can use to manually clear the plugin’s cached data when a WooCommerce order is completed?Looking forward to your help.
Forum: Plugins
In reply to: [Page Restrict for WooCommerce] Page is restricted despite product boughtI figured out it was a problem with Redis Cache on my server. I’m wondering why it’s not updated when a settings is updated (I saw stale settings) or purchase is made. Might not be related to this plugin though. But worth checking what http request method is made on saving the changes – if it’s GET instead of POST then cache won’t be updated.
Forum: Plugins
In reply to: [Page Restrict for WooCommerce] Page is restricted despite product boughtPHP version: 8.1.31
Woocommerce: 10.4.3