To answer some of the more frequently asked questions regarding the Wordpress Plugin, we’ve created this article.
Change theme files
This content is more technical and is more suited for people with technical knowledge.
It is possible to overwrite theme files which are provided with the plugin. Each functionality provided with the OTYS WordPress plugin is using theme files which are provided within the plugin folder. It is possible to change (overwrite) these theme files by making a copy of the plugins theme files and placing the theme files within your own theme folder and changing the files.
How?
Navigate to the plugin view folder in your website, this folder should be located at [yourwebsite]/wp-content/plugins/otys-jobs-apply/app/views. Within this folder are all theme files located which are being used by the plugin.
To overwrite a theme file you can create a folder named 'otys-jobs-apply' in your own theme folder (this should look something like [yourwebsite]/wp-content/themes/[your-theme-name]/otys-jobs-apply) and copy a file from the plugin's view folder in there. The plugin will always prefer files in your theme folder above the view files in the plugin's folder.
Only overwrite theme files which you are actually changing, this will improve maintainability. Sometimes changes happen to theme files within the plugin, note that these changes will not affect your custom theme files.
OTYS will make sure to keep backwards compatibility in mind and not change variable names when not needed. However, this could happen in the future, but when this happens, we will make sure that this is noted in the update notes. When this happens, we will have a new Major version release. When a new Major version is released make sure to read the changelog provided with the update.
Example
When you for example want to change the theme file of the [otys-vacancies-list] shortcode (so the vacancies list HTML) create a new folder in [yourwebsite]/wp-content/themes/[your-theme-name]/otys-jobs-apply called 'vacancies'. Now copy the file [yourwebsite]/wp-content/plugins/otys-jobs-apply/app/views/vacancies/vacancies-list.php to this folder.
Now you will be able to edit this file however you like. All theme files will have access to a variable $args this variable will contain all information available to this theme file. When you var_dump($args) you will see that there's allot more information available then there's initially displayed.
How do I setup Google ReCAPTCHA?
In order to utilize the plugin, it is necessary to have an antispam check in the application/enroll forms. Currently, the only supported solution is Google's ReCAPTCHA. To configure it, follow the steps below:
Access the OTYS settings page in WordPress and navigate to the "Anti spam" tab.
On this tab, you will find two fields: "Secret" and "Public" key. These keys are required for ReCAPTCHA configuration.
To obtain these keys, go to the Google ReCAPTCHA Admin console by visiting: https://www.google.com/recaptcha/admin.
Sign in to your Google account if prompted and then click on the "plus" icon to register a new website.
Provide a name for your website in the designated field.
Choose the ReCAPTCHA v3 type from the available options.
Add the domains for which you want to enable ReCAPTCHA using the generated keys.
Click the "send" button to proceed.
Once the process is completed, you will be shown the secret and public keys.
Copy and paste these keys into the corresponding "Secret" and "Public" key fields on the OTYS settings page.
Save your changes and test your forms.
Making Changes in Translations and Texts
In order to manage the translation files for the OTYS WordPress plugin, you will need to install a WordPress plugin. In the following example, we will use "Loco Translate."
Please follow the steps outlined below:
Log in to your WordPress dashboard and navigate to the "Plugins" section.
Click on "Add New Plugin."
Search for "Loco Translate" using the provided search field.
Once you find the "Loco Translate" plugin, click on "Install Now."
After the installation is complete, open the plugin by accessing it through the navigation bar on the left-hand side.
On the plugin's homepage, you will find the OTYS Jobs & Apply plugin. Click on it.
Select the language in which you would like to make changes.
A list of all the available translations will appear. Choose the one you wish to modify.
You can now make changes to the text in the bottom text area according to your preferences.
Once you have made the desired changes, click on "Save" located in the top left corner.
Go to the webpage where this translation is displayed and verify if your changes have been applied.
Please note: It is important to check the responsiveness of the changes you made, ensuring they appear correctly on both desktop and mobile devices. Sometimes, alterations might not align well with the overall design of your website after modification.
How to let the API user mail via your sending profile?
The WordPress API has a user linked; this user is by default used for system emails. You can allow the WordPress API user to send mails via your email address. The WordPress API user will then send mails via your e-mails when for example a candidate applies on a vacancy, and you are the owner of the vacancy. The name of the API user differs per client, most of the time the name represents either the label name or has WordPress in its name.
This is available from version 2.0.10 from the OTYS plugin
If you want the plugin to be able to send emails from your e-mail address, it is required to allow the API user to send mails from your account.
The steps to follow:
Login in Go! with your own account
Open the mail module as the user whose rights may be shared
Click on the gear at the top right. (Settings)
Choose user settings when prompted.
Search for setting: GE89 and open that setting.
Select Permissions for: "My email account"
At "for user" select the user you want to give rights (the WordPress API user)
Click save
Now close the window and search for setting 'DB86'
Make sure this setting is enabled and click save.
How to set a referrer portal based on UTM tags
When a candidate applies the referrer gets automatically saved and can be found in the candidate detail view in OTYS. This behaviour is decadent on the referrer portal (i.e. indeed, google etc..) sending the referrer in the headers. It might be that you don't want to be dependent on this and you want to set the portal based on UTM tags, this is possible!
To specify which UTM tags belong to which portal follow the following steps:
Login in OTYS as a key user who has access to the CMS module (if you do not have access to the CMS module, please ask support to enable this for you)
Navigate to the CMS Module
Click the tab 'Traffic' and click 'Portals'
Click the portal you want to bind to the chosen UTM Tags
Click the checkbox 'Use custom UTM source'
Fill in the UTM tags.
Note that all UTM tags here need to match for the portal to be set via these UTM tags.
For example, when you fill in at google.com the following UTM tags:
UTM source | google.com |
UTM medium | |
UTM campaign name | google_search |
UTM campaign term | |
UTM campaign content |
When some one enters your website using these tags ie. https://www.yourdomain.com/?utm_source=google.com&utm_campaign=google_search
The portal google.com will be set as referral portal based on these UTM tags.
Don't forget to delete the plugin cache when you changed the portal UTM tags.
How to remove plugin cache?
Login as admin on your WordPress website
In the menu navigate to OTYS -> Cache
Click the button 'Delete all cache'
Click 'Ok'
This makes sure data is again retrieved from OTYS.
It may be that you are using a third party caching plugin. Make sure to also empty the cache of the third-party caching plugin. Note: This can be automated! See our guide how to easily implement automatic cache refresh for third party plugin.
Cache delete action
This guide expects you to know the basics of how actions work in WordPress and requires basic knowledge of PHP. For more information regarding actions in WordPress see the WordPress documentation at https://developer.wordpress.org/plugins/hooks/actions/
This action is available from version 1.3.19
About cache
The OTYS plugin uses WordPress transients to store responses of the OTYS API requests. These transients are stored in the WordPress database. By caching the responses it's not necessary for the plugin to do API requests every time which makes the plugin allot faster.
There are three scenarios’ of how cache can be removed:
By the cache expiring. All cache has an expiration date specified, when the cache expires it will not be used anymore and will be deleted by a WordPress CRON event (which gets registered by the plugin) within 24hours.
By a manual action. For example clicking the 'remove all cache' button in the plugin admin panel.
By a webhook. OTYS uses webhooks to refresh relevant cache based on events happening in OTYS Go!. (also see Webhook action)
The OTYS plugin does not use the 'delete_transient' function of WordPress when removing many cache records. This is due the many records that will get removed and could be triggering the the delete_transient function 1000+ times, since there could be allot of cache records created by the plugin depending on how large your website is. Therefore OTYS has written efficient database queries to remove cache. The downside of not using the delete_transient function of WordPress is that you can't use the delete_transient_{transient} action. Therefore we have created our own actions when removing cache.
Use case
It might be that you as a developer need to some action when cache gets refreshed. A good example might be that you are using your own caching methods on top of the WordPress transients (which the plugin uses). This means that it's not enough to only refresh the transient cache, but also your other caching method needs to get a heads up that it needs to refresh it's cache.
How to use the webhook?
On the left you see an example of the use case above. We register a webhook by calling add_action('otys_cache', 'example_callback', 10, 0). After the cache gets deletes the action is called.
The following parameters available in the callback function:
string $type | Describes what type of action got triggered i.e. 'refresh', 'delete_all', 'delete_expired', 'delete' |
array $transients | An array of all deleted transient names |