Hello Gisele,
Here’s a few things:
1. Are there any JavaScript errors in your browser’s console? If an error occurs, not right after page load, but shortly after, this would explain the behavior you see. The knockout library doesn’t like JS errors.
2. A long shot, but are you minifying your HTML markup? This can cause issues, because the plugin is using some knockout directives that are embedded in HTML comments.
3. If you like, you could give me access, so I can login and debug this. I do not believe that admin access is required, a normal user account with the has_wallets capability should do. If you want me to do this, please contact me over email with credentials.
with regards
Hello Alex
1 + 2 don’t seem to apply -> I go for 3 🙂
cy soon
Kind regards
Thank you.
I have logged in to your site.
You have developed your own knockout.js views, and these have errors which prevent them from working as expected.
I will contact you over email about this, to discuss how the ko bindings can be improved.
with regards,
Alex
We exchanged some e-mails in the past few hours, we found that it’s a caching issue and found plugin Super-PWA to be the cause of our problem.
Super-PWA runs a service worker that caches xhr-requests locally.
The service worker is a JS-file Super-PWA drops on the website root on activate.
Its name is superpwa-sw.js.
This file, on line 12, includes a constant which defines URLs that Super-PWA must never cache.
I changed this line from it’s default
const neverCacheUrls = [/\/wp-admin/,/\/wp-login/,/preview=true/];
to
const neverCacheUrls = [/\/wp-admin/,/\/wp-login/,/preview=true/,/__wallets_action=/];
It adds all URLs containing pattern “__wallets_action=” to these URLs that Super-PWA will never cache.
Super-PWA proposes the use of a filter to achieve the same result:
apply_filters( 'superpwa_sw_never_cache_urls', '/\/wp-admin/,/\/wp-login/,/preview=true/,/__wallets_action=/' );
In my tests, this filter did not change the excluded URLs, but changing the JS-file was successful – immediately, on next normal page reload, the ko-scripts worked again like intended.
Alex, thanks again for your time-invest and for spotlighting the (cached) xhr-requests.
Normally I should be the one who summarised the findings here, but again thanks for taking the time to do so!
While you may have found a temporary workaround, I will continue to investigate this to find a more permanent solution.
with regards
After some digging, it turns out that the filter works, as long as you call superpwa_generate_sw(); once, right after providing the filter in functions.php. The call does not need to be called every time, only once and then the generated js code works.
Even the code that does caching is cached 🙂
I will be including a fix in the next release of wallets.
The latest version 4.4.8 includes a fix for @superpwa compatibility, based on the above discussion.