wordpress-sdk
wordpress-sdk copied to clipboard
Unhooked daily cron remains after installation
🐞 bug report
Behavior:
-
After installing a plugin that implements Freemius, a cron event remains scheduled to run daily but with no action hooked to it, this can be seen easily by installing WP-Cron plugin, in one of my plugins for example I have an empty cron even titled
fs_data_sync_wpmq
remaining. This same thing happens in another Freemius deployed plugin I have - Subscribe2 HTML. -
What is the expected behavior?
This hook should either be scheduled to fire once if that is all that is needed, or it needs a regular function hooked to it if something needs to happen daily.
Versions: (*)
-
Freemius SDK Version:
2.4.1 -
WordPress Version:
5.6 -
PHP Version:
7.4.13
Plugin / Theme: (*)
-
Name:
WordPress Mail Queue -
Slug:
wpmq -
Freemius ID:
5525
Additional Information:
-
Browser Type: (*)
Safari MacOS -
Browser Version: (*)
14.0.2 -
OS: (*)
MacOS 11.1 -
Stack Traces:
N/A
Note: (*)
indicates required information. Without this information, your issue may be auto-closed.
You can find your Freemius SDK version at
/freemius/start.php
You can find your Freemius product ID in the Freemius dashboard:
SETTINGS -> INTEGRATION
.
Do not modify the titles or questions. Simply add your responses to the ends of the questions. Add more lines if needed.
@mattyrob we are not able to reproduce this issue. Is it possible that the plugin was deactivated/deleted via FTP?
@vovafeldman Thanks for the response. The plugin(s) is/are still installed and active but there remains a cron hook defined with no action attached to it.
@mattyrob why do you think there's no action attached to it? The SDK does come with a daily WP cron to sync license data from the API.
@vovafeldman If you install the WP-Crontrol plugin it shows the hook and in the 'Action' column where the hooked function should be listed it displays 'None' as per the attached screenshot.
The column names are Hook, Arguments, Time, Action, Recurrence.

@mattyrob I don't know how this plugin works so hard for me to say.
Please try the following:
- Install Query Monitor
- Navigate to /wp-admin/admin.php?page=freemius and turn to debug on (remember to revert after this check)
- Refresh the page
- Open Query Monitor and check the Freemius section, it should show you the last time the crons were executed
@vovafeldman
Thanks for keeping with me on this.
My understanding, as per the WordPress developer handbook is that to use the cron system you create a hook and then add a callback to that hook.
I can see the hook in both Query Monitor
and WP-Crontrol
and I can also see that the hook is being executed on schedule.
The issue I am trying to raise is the the hook appear to have no callback attached to it, so even though there is cron hook registered and executing, it isn't actually doing anything.