This seems an excellent plugin. But I cannot work out a basic problem. The calendar is only visible if logged in. I have disabled every other plugin, and still the calendar is not publicly visible, unless logged in. (It works well when logged in.) The test page has the simplest shortcode, entered in a shortcode block: [stachethemes_ec]. The Calendar settings are Public for visibility, and logged in for front-end submission. Can you help?
Major thank you. I have entered the code you suggested as a Code Snippet, rather than editing the functions.php file. Sadly it has no effect. I see 7 errors and 1 warning in the Chrome Inspect Console for the calendar page, and even 6 errors on the Home page. There are zero errors when I disable the Calendar plugin. I can send you the Console information. Please advise.
@publicspace Priority doesn't really matter because there no other filters from this type. I usually say to put it at the bottom because it will be easier to find if something go wrong.
Then clear your litespeed cache. If the calendar has cache enabled clear it as well.
This is common problem when cache is enabled the nonce string is being cached as well and if the nonce is expired the events won't show up because the verification does not pass.
I entered the code you suggested as a Code Snippet (rather than editing the functions.php file) cleared all caches, but it had no effect.
I then created a duplicate staging site, and put the code directly into the theme functions.php file. It had no effect.
In the staging site, I have now deactivated all plugins except yours, and it works. So clearly there is a clash that prevents the calendar and produces the errors and warning in the Console. I will rebuild the staging site plugin by plugin to see where the clash is, and will get back to you. Thank you for your continued help.
After analysing this on a duplicate site, the calendar is now showing publicly (without the additional code).
In case it's useful to others: After deactivating all plugins except yours, the problem then reoccurred when reactivating SiteGround Optimizer. It is set to Combine and Defer javascript files to ensure performance. So, not wanting to lose the performance, I looked at the scripts identified as errors in the Console, and trialled which scripts needed to be excluded.
Deferral: for the Calendar to show, and without errors in the Console, this script needs to be excluded (in addition to 2 already excluded - jquery.min.js and jquery-migrate.min.js ) /wp-includes/js/dist/vendor/moment.min.js
Combining: for the Calendar to show, and without errors in the Console, these two scripts needs to be excluded: /plugins/stachethemes_event_calendar/assets/js/libs/jquery.mobile.min.js /wp-includes/js/dist/vendor/moment.min.js
Following this, I would like to ask 2 questions:
> How can I ensure that the Stachethemes scripts only load on the Calendar page, the Submission form, and the Single Events? At the moment, all the STEC scripts load on every other page on the site too. Have I missed an option somewhere? Or could you give me a code snippet?
> There is one remaining error, currently everywhere. (I can only remove it by turning off the Combining of scripts, or deactivating your plugin.) Do you know which file should be excluded from Combining javascript files, to prevent this error? As you can see above, I have already excluded the script explicitly referenced in the report:
Uncaught TypeError: Cannot read properties of undefined (reading 'concat') at jquery.mobile.min.js?siteground-async=1&ver=3.2.6:4:3006 at jquery.mobile.min.js?siteground-async=1&ver=3.2.6:4:3576
This seems an excellent plugin. But I cannot work out a basic problem. The calendar is only visible if logged in. I have disabled every other plugin, and still the calendar is not publicly visible, unless logged in. (It works well when logged in.) The test page has the simplest shortcode, entered in a shortcode block: [stachethemes_ec]. The Calendar settings are Public for visibility, and logged in for front-end submission. Can you help?
hello i have same problem
Hi,
Try following.
Open your theme or child-theme functions.php file and add this filter somewhere at the bottom:
Clear your cache if you're using cache plugin.
Let me know if the problem persists.
Stachethemes Developer
Hi Zhivko
Major thank you. I have entered the code you suggested as a Code Snippet, rather than editing the functions.php file. Sadly it has no effect. I see 7 errors and 1 warning in the Chrome Inspect Console for the calendar page, and even 6 errors on the Home page. There are zero errors when I disable the Calendar plugin. I can send you the Console information. Please advise.
for me after cache deleted the problem persist
when i unactivate litespeed cache
it's ok have you an idea ?
@publicspace Priority doesn't really matter because there no other filters from this type. I usually say to put it at the bottom because it will be easier to find if something go wrong.
Stachethemes Developer
@nicoxygen
Place the filter in your theme functions.php file.
Then clear your litespeed cache. If the calendar has cache enabled clear it as well.
This is common problem when cache is enabled the nonce string is being cached as well and if the nonce is expired the events won't show up because the verification does not pass.
Stachethemes Developer
when i place in functrions.php
with litespeed activate and full erase cache
don't work, i have found another module who explain modification with litespeed can you look
https://theeventscalendar.com/knowledgebase/k/litespeed-cache/
Hi
I entered the code you suggested as a Code Snippet (rather than editing the functions.php file) cleared all caches, but it had no effect.
I then created a duplicate staging site, and put the code directly into the theme functions.php file. It had no effect.
In the staging site, I have now deactivated all plugins except yours, and it works. So clearly there is a clash that prevents the calendar and produces the errors and warning in the Console. I will rebuild the staging site plugin by plugin to see where the clash is, and will get back to you. Thank you for your continued help.
Hi Zhivko
After analysing this on a duplicate site, the calendar is now showing publicly (without the additional code).
In case it's useful to others: After deactivating all plugins except yours, the problem then reoccurred when reactivating SiteGround Optimizer. It is set to Combine and Defer javascript files to ensure performance. So, not wanting to lose the performance, I looked at the scripts identified as errors in the Console, and trialled which scripts needed to be excluded.
Deferral: for the Calendar to show, and without errors in the Console, this script needs to be excluded (in addition to 2 already excluded - jquery.min.js and jquery-migrate.min.js )
/wp-includes/js/dist/vendor/moment.min.js
Combining: for the Calendar to show, and without errors in the Console, these two scripts needs to be excluded:
/plugins/stachethemes_event_calendar/assets/js/libs/jquery.mobile.min.js
/wp-includes/js/dist/vendor/moment.min.js
Following this, I would like to ask 2 questions:
> How can I ensure that the Stachethemes scripts only load on the Calendar page, the Submission form, and the Single Events? At the moment, all the STEC scripts load on every other page on the site too. Have I missed an option somewhere? Or could you give me a code snippet?
> There is one remaining error, currently everywhere. (I can only remove it by turning off the Combining of scripts, or deactivating your plugin.) Do you know which file should be excluded from Combining javascript files, to prevent this error? As you can see above, I have already excluded the script explicitly referenced in the report:
Uncaught TypeError: Cannot read properties of undefined (reading 'concat')
at jquery.mobile.min.js?siteground-async=1&ver=3.2.6:4:3006
at jquery.mobile.min.js?siteground-async=1&ver=3.2.6:4:3576
Thank you
litespeed use esi have you an idea ?
https://docs.litespeedtech.com/lscache/lscwp/api/#generate-esi-block-url
and list module nonce in litespeed github
https://github.com/litespeedtech/lscache_wp/blob/master/data/esi.nonces.txt
Scripts by default should load only on the pages where they are needed.
If they load on all pages make sure "Force load calendar scripts" is turned off in STEC -> General -> Misc tab.
Stachethemes Developer
Yes, that fixes it. Thank you.
can you give me liste of nonce of module please i want to integrate in esi litespeed
In file \shortcodes\stachethemes_ec.php:
I assume the "stecApiVerifyNonce" string is what you need.
Stachethemes Developer