sprzedawczyk
Forum Replies Created
-
Forum: Plugins
In reply to: [W3 Total Cache] Irregular serving of old cache after loggin inI see. One more question: wouldn’t it be possible to use page fragment cache to make
is_user_logged_in()inside functions.php work without problems? I know it can be done inside theme files but I would rather do it in functions.php file.- This reply was modified 5 years, 5 months ago by sprzedawczyk.
Hi. No. I’m not using nginx but I managed to fix and reproduce the issue.
It was not a problem with deleting cache or .htaccess files inside /cache/ folder. The thing causing the error was one of my debugging echo lines inside ‘widgets_init’ action filter. To be honest I would never though that it would be the case.
It’s fixed now, but if you want to check and try to reproduce this error, try this code in functions.php:
add_action( ‘widgets_init’, ‘xyz_new_widgets’ );
function xyz_new_widgets() {
echo “<script>console.log(“.json_encode(var_export(“test_message”, true)).”);</script>”;
//register_sidebar();
}Thanks for help.
Forum: Plugins
In reply to: [W3 Total Cache] Irregular serving of old cache after loggin inYou are right. Details on ‘is_user_logged_in()’ behavior can be found on my previous post. Unfortunately, after deleting my /cache/ folder my cache stopped working all together. I will create separate thread so it wont get mixed up.
Forum: Plugins
In reply to: [W3 Total Cache] Irregular serving of old cache after loggin inYes, I deleted all /cache/ folder but it’s getting populated again as you know.
After some debugging I think the problem lies with interaction of
is_user_logged_in()function and cache. Maybe “serving old cache” is not the best term for this problem.I will try to be as clear as possible:
– user logs in
– on pages served using ‘disc cache’, functionis_user_logged_in()returnsFALSE. After some time and some page refreshing,is_user_logged_in()returnsTRUElike the rest of the site and like it should. It’s probably caused by cache reload or something similar.
– at the same time, on pages with disabled cache like ‘cart’,is_user_logged_in()ALWAYS returnsTRUEafter login in so it’s working correctly.I’m using this filter to monitor
is_user_logged_in()behavior.add_filter( 'wp_nav_menu_objects', 'demit_filter_wp_nav_menu_objects', 10, 2 ); function demit_filter_wp_nav_menu_objects( $sorted_menu_items, $args ) { $is_user_logged_in = is_user_logged_in(); $is_user_logged_in_string = var_export($is_user_logged_in, true); echo "<script>console.log(".json_encode(var_export("is user logged in?: " .$is_user_logged_in_string, true)).");</script>"; return $sorted_menu_items; };It’s hard to reproduce this problem because of cache unpredictability so sometimes it’s working like it should.
I would give you example user login details so the debugging would be easier but I don’t think sharing this publicly would be a good idea.
- This reply was modified 5 years, 5 months ago by sprzedawczyk.
Forum: Plugins
In reply to: [W3 Total Cache] Irregular serving of old cache after loggin inThanks for reply. I’m not using any other caching plugin and did not setup any server-side caching. As I said “Don’t cache pages for logged in users” is enabled.
I did the purging and clearing of cache and the problem persists. Only disabling page caching stops the problem from happening.I will leave page caching and debug mode on for testing purposes.
URL: https://sklep.demit.plFrom what I’ve seen you can clearly see that user is logged after login in by checking cookies in browser, but he’s sometimes served old cache on some pages not blocked from caching.
My mistake, I forgot about the option in event notification panel.
Forum: Fixing WordPress
In reply to: wp-admin not working after changing URLI don’t know for sure, but I think that I made it to work by purging and removing my cache plugin.
Forum: Plugins
In reply to: [Apaczka.pl WooCommerce] Tylko jedna metoda płatnościJedyny pomysł na jaki wpadłem to ustawienie domyślnie metody z paczkomatem i chowanie przycisku “wybierz paczkomat” przy wybieraniu metody z kurierem. Później przy wysyłce produktu trzeba tylko ustawić metode wysyłki zgodną z wybraną przez klienta. Nie brzmi to ładnie, ale nic lepszego ne wymyśliłem. Ogólnie dramat.
Forum: Plugins
In reply to: [Apaczka.pl WooCommerce] Paczkomaty mapaW przypadku paczkomatów na dole są opcje czy chce się je wybrać za pomocą mapy czy listy.