• The plugin settings page give these instructions to set up the cron job in the server:

    php /home/user/public_html/wp-content/plugins/wp-cron-control/wp-cron-control.php https://misite.com secretskey
    
    or
    
    wget -q "https://misite.com/wp-cron.php?doing_wp_cron&secretskey"

    Are the second option correct or should it be this?:

    wget -q "https://misite.com/wp-content/plugins/wp-cron-control/wp-cron-control.php?doing_wp_cron&secretskey"

    https://www.ads-software.com/plugins/wp-cron-control/

Viewing 7 replies - 1 through 7 (of 7 total)
  • The second option is correct. Your alternative is not.

    Thread Starter Juan

    (@cybnet)

    Can you elaborate the answer and explain why? I’m confused why each option executes a different PHP script. I wouuld like to understand it.

    The short answer is that these are just different entry points to the same script.

    The first option – running a script using php-cli, this is the faster method – is not always available depending on the server setup.

    The second option is basically a work-around – using a web-client to load WP and do cron.

    Thread Starter Juan

    (@cybnet)

    Sorry, I’m still confused.

    One option use php-cli and the other a web-get command, I knew taht. But they don’t execute the same sript. One execute the script wp-cron.php from the core of WordPress, the other executes the wp-cron-control.php script packaged with the plugin.

    Most PHP scripts are not coded to be executed via php-cli.
    wp-cron.php is one of those – not suitable for execution from php-cli.

    So the wp-cron-control.php script effectively works as a wrapper to get the command line parameters and pass them to wp-cron.php.

    Thread Starter Juan

    (@cybnet)

    Aha!!! That’s why I had so much troubles trying to run wp-cron.php through php-cli (and the reason I found wp-cron control trying to find a solution).

    Thank you very much.

    You may want to read up on the difference: https://php.net/manual/en/features.commandline.php

    Some of the most notable differences:
    * no access to query vars, $_GET or $_POST, but access to command line parameters instead via $argc and $argv
    * no max execution time
    * current directory does not change

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Are the instructions correct?’ is closed to new replies.