- This topic has 9 replies, 2 voices, and was last updated 2 years, 8 months ago by Mark van Dam.
-
AuthorPosts
-
February 24, 2022 at 6:49 am #2591Mark van DamParticipant
Hi there,
I’ve purchased the pro version of sign-up sheets just now. We are working with volunteers for an (art) exhibition center. The volunteers are registered in advanced (as they need some basic training before being scheduled) and have their own username and password for the website. The sign-up sheets however are placed on a public area of the website (to invite more visitors to become volunteer), so we would like to restrict access to the sign-up sheets only. Any suggestion on how to approach this? So basically everything on the page needs to be visible to visitors and only the sign-up sheets need to be visible for logged in users (volunteers) only. I’ve already created a separate user role for them.
And we would like to translate the plugin (strings, titles and form fields) to Dutch. Is this possible using WPML? Or do you have .po and .mo files for the plugin?
Thanks in advance and kind regards,
MarkFebruary 24, 2022 at 3:32 pm #2595Mark van DamParticipantHi,
Just wanted to let you know I’ve been trying to find a solution for my first question. I’ve added the following code (https://jpst.it/2LU5L) as a snippet to hide the sign-up sheets overview from the public. Unfortunately it does not hide the single sign-up sheets when clicked in the overview. Any suggestion how to hide the complete content, including the sign-up form, from public view?
Regarding translation of the plugin I came across “Text Overrides” under settings, but this only shows one field marked with: “WHAT”.
Kind regards,
MarkFebruary 24, 2022 at 9:19 pm #2601Fetch DesignsKeymasterHi Mark,
Sign-up Sheets has a POT file to support translations which is found in the plugin under languages/sign-up-sheets.pot. You can learn more about how to use it in the Translations documentation.
For your other question, the ability to restrict sign-ups to logged in users only is not currently a built-in feature of the plugin. However, there may be a few ways you can customize it and it sounds like you got part of it in place. To lock down the individual sheet pages, you can probably do something along the lines of the code below to check if we are on a sheet page and if so throw an error to prevent access…
function my_sheet_login_required() { if (get_post_type() === 'dlssus_sheet' && !is_user_logged_in()) { wp_die('You must be logged in to access this content'); } } add_action('wp', 'my_sheet_login_required');
February 25, 2022 at 12:10 am #2604Fetch DesignsKeymasterOne other thought I had is you could add the capability “read_private_dlssus_sheet” to role that you want to grant access using WP_Role::add_cap. Then set all your sheets to be published “privately”. This should also allow just those users with that access to see the sheets. Then you can check by using…
if (current_user_can('read_private_dlssus_sheet')) {...}
February 25, 2022 at 6:18 am #2605Mark van DamParticipantHi,
Thanks for the quick reply. I must have missed the documentation on the language but I found it and it works like a charm! Great work.
The suggestions for the restriction of content are actually quite useful. I’m using AAM (advanced access manager) plugin so I can probably set the user role to allow access to private sheets and set the sheets to private in stead of public.
Thanks for now and I’ll get back to you with the results.
Kind regards,
Markp.s. how do you include code with these posts? I tried it yesterday but my posts were rejected. That’s why I used an external link to show you the code I came up with.
February 25, 2022 at 7:07 am #2609Mark van DamParticipantThis reply has been marked as private.February 25, 2022 at 9:58 am #2610Mark van DamParticipantHi,
I just found that using reCAPTCHA is the cause behind the error. I was using reCAPTCHA v2 Checkbox and that caused the 500 critical error. When I disabled reCAPTCHA and use the normal anti-spam math question 7+1 it works fine. I would prefer to use reCAPTCHA though.. any suggestions on how to fix this? I’ve double checked the reCAPTCHA keys and also the registered domain with reCAPTCHA console; they are correct.
Kind regards,
MarkFebruary 25, 2022 at 7:15 pm #2612Fetch DesignsKeymasterFirst, don’t worry you didn’t miss the documentation, I just posted it. I am working on improving the documentation little by little so if you run into any other questions, please let me know.
As for posting code snippets on this forum, it is something on my to do list to update, but right now only admins have the ability to do so.
Regarding your reCAPTCHA issue you reported, I have just published a new version of the plugin (version 2.2.1) which includes a fix for reCAPTCHA that some users reported which only occurred in certain hosting environments. I just updated your site to use this latest version, enabled reCAPTCHA and ran a test and it appears to be working correctly now, but please confirm on your end.
Lastly, I did notice you were using LiteSpeed cache. I expect to add support for LiteSpeed Caching in the near future, but currently you will probably want to set LiteSpeed to not cache your Sign-up Sheet pages to prevent sheets showing old data (such as opens spots that are available that have recently been filled) since it won’t update in real time until the cache is refreshed.
If you notice any other issues, just let me know.
February 26, 2022 at 12:44 pm #2618Mark van DamParticipantHi,
Thanks for your quick reply, again! And great job on the documentation and updates on the plugin, love it!
The ReCAPTCHA is working indeed which is awesome and will probably save us from a lot of spam 🙂
Good call on the LiteSpeed caching. I’ve disabled caching on the main overview page as well as the single sheet page(s):/programmas/kamerbewaarders/
/sheet/And I’ve also disabled caching of the following query strings:
task_id
action
_susnonce
status
tasks
signupsAny other strings I should add to this list?
Translations are working like a charm and everything on the front-end has been translated, except for two strings. Maybe you can point me in the right direction.
1. When you click the “removal_link” in the confirmation e-mail; you get to a page where the first string is translated (Are you sure you want to remove your sign-up?), but I can’t translate the button which says “Yes, Remove Me”. This string does not seems to be in the .pot file.
2. The months used in the sheets date are in English (February, March etc). Any chance I can translate those as well? Site language is set to Dutch.
Thanks again and keep up the good work!
Kind regards,
MarkMarch 7, 2022 at 8:59 am #2737Mark van DamParticipantHi,
Any thoughts on my above request for translation of the strings. I’ve been diving into the code but I’ve come up empty to change the language on the months (Jan / Feb / March etc..). Also the “yes, remove me” string is not up for translation in the .po / .mo files.
Hope you have a suggestion. Thanks in advance!
Kind regards,
Mark -
AuthorPosts
- You must be logged in to reply to this topic.