• Resolved djeyewater

    (@djeyewater)


    I haven’t tested to make sure, but likely the cron job that you are using to update the data each week won’t work. The reason for this is that when you call wp_schedule_event, you are using ‘weekly’ as the second parameter. But ‘weekly’ is not a valid recurrence that ships with wordpress core.

    Likely you need to apply a filter to cron_schedules to add ‘weekly’ to the list of valid recurrences for it to work. See https://codex.www.ads-software.com/Function_Reference/wp_schedule_event for more info.

    BTW, you were interested in what people would you your plugin for. I’m planning on using it for my own plugins that require geo functionality. It seems much more sensible for my plugins to use the functionality provided by your plugin, rather than each of my plugins containing a complete duplicate of the same functionality.

    https://www.ads-software.com/plugins/geoip-detect/

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author Benjamin Pick

    (@benjaminpick)

    You seem to be right. I probably only checked the list of available schedules and weekly may have been provided by a different plugin. Will be fixed in the next release (see github).

    Oh and I’d love if WordPress could do dependency management, i.e. that you could declare in your plugin “in order for this to work, I need that plugin” …

    Benjamin

    Thread Starter djeyewater

    (@djeyewater)

    There’s been a few suggestions for wordpress plugin dependencies before, but unfortunately it is not going to be implemented. I agree it would be nice to have.

    I did think about implementing an auto-download, install and activate of your plugin when my plugin is activated, but thought it better that the user actively installs the plugin. Otherwise they might wonder where the Geo IP detection plugin had come from and disable it, not realising that it was installed by my plugin.

    The best solution would be to stop during the activation sequence (of my plugin) and output a message that your plugin will be installed as part of the process, and click OK to continue. That way the user has to acknowledge the installation of the dependency plugin. However, I don’t think this is possible as plugins aren’t allowed to output text during the activation process.

    Plugin Author Benjamin Pick

    (@benjaminpick)

    Fixed in 1.5. I also realised that the cron scheduling on plugin activation didn’t work, so this is now on showing the Plugin Page (under Tools).

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Update cron job probably won't work’ is closed to new replies.