Support » Plugin: WP Crontrol » Any tips on using with WP All Import?

  • Resolved FreshySites

    (@freshysites)


    I’m trying to set up the Cron Job feature of WP All Import. My host directed me to use WP All Import… but I’m not seeing an easy way to add the URLs for the Trigger Script and the Execution Script.

    I’d like to run a few imports on a nightly basis … each at a specific time of the night.

    https://wordpress.org/plugins/wp-crontrol/

Viewing 12 replies - 16 through 27 (of 27 total)
  • To follow-up wrt to @lljb3

    Tried that code too

    <?php
    define(‘SCHEDULED_EVENT_NAME’,’your_import_name_exec’);
    function your_name_wp_all_import_exec() {
    wp_remote_get( ‘INSERT WP ALL IMPORT TRIGGER OR EXEC URL HERE’, array(‘timeout’ => 600) )
    }
    add_action(your_import_name_exec,’your_name_wp_all_import_exec’);
    ?>

    as PHP Cron Job in WP Crontrol. But I am actually not sure where that code is supposed to go and how to change the names in the function (except for the WP All Import trigger and processing, that is clear).

    Tried it as a PHP Cron Job in WP Crontrol but did not work…

    Greets,
    Olaf

    @ogessel

    Did you make sure to check your wp-config.php file to see if WP Cron is disabled? If there’s no line, just write the line in there. define('DISABLE_WP_CRON', 'false');

    All we had to do was grab the URLs that WP All Import show for the:

    • Trigger Script URL
    • Execution Script URL

    Then we took those URLs and added a PHP Cron Event from within WP Crontrol, for each of the following:

    • Set this one to Once Daily: wp_remote_get(“your trigger script URL here”);
    • Set this one to Every 2 Minutes (this was a custom schedule I made within Cron Schedules) wp_remote_get(“your execution script URL here”);

    If using WP Engine, you need to have them enable true cron (WP Engine alternate cron is a true cron)… which is disabled by default. The normal WordPress “wp-cron” isn’t ideal, as far as I can tell.

    • This reply was modified 2 years, 5 months ago by FreshySites.

    @freshysites:

    thx but I’ve tried that (at least I think I did the same)

    Could you maybe show me a screenshot of one event in WP Crontrol Maybe?

    @lljb3 don’t you mean that is has to read

    define(‘DISABLE_WP_CRON’, true);

    ?

    It’s like that now because I have a separate cron trigger to trigger WP Cron every minutes

    Thx!

    https://gyazo.com/4e7e06863e8acbbe6235d1523d5f4677 and https://gyazo.com/7908a9ec06b048ed7aae1b4f5e89c6e8

    Note, that I do believe this is a slightly older version of WP Crontrol (before you could actually give your PHP Crons a name)

    @ogessel

    No, it needs to be false. It’s “Disable” WP Cron. You don’t want the disabling to be true.

    @lljb3

    Actually, if trying to use a “real” cron, that should be set to true. You do want to disable that. But that’s assuming your host allows you to use a real cron.

    https://www.pickaweb.co.uk/kb/how-to-disable-wp-cron-and-replace-it-with-a-real-cron-job/

    @freshysites

    True, but from the responses here, I didn’t know if he was using WP Cron or not, as for that case, WP Crontrol isn’t going to help @ogessel and he needs to talk to his hosting provider.

    @ogessel, what is your hosting provider anyway, and do they allow SSH access and all that?

    Because if they don’t allow you to set cron jobs on your server, then you’ll have to switch to using WP Cron.

    Yeah indeed I use the real cron instead so it should be set to true.

    But @freshysites: that’s exactly what I’ve tried to do, of course with my own settings.

    But that did not work for some reason.

    @lljb3

    my host is Kinsta

    but did you get it to work? And was that with the freshysites solution or with your code from 9 months, 1 week ago?

    Still don’t know where you would put that though…

    @ all: It actually is working now!

    I had to change my url in the expression of freshysites from

    https://www.yourwebsite.com

    which I used in the previous crons through cPanel into

    http://yourwebsite.com

    and now it is suddenly working just fine.

    Hope this will benefit somebody with the same problem.

    @lljb3 and especially @freshysites: thanks a lot for your help guys!

Viewing 12 replies - 16 through 27 (of 27 total)
  • The topic ‘Any tips on using with WP All Import?’ is closed to new replies.