This isn't as simple of a question as you may think. Basically I have a C# program that is hitting the worpdress site and the wp_schedule doesn't seem to fire off. If I go to the site with my firefox browser then it seems to fire-off. Soooo what's the difference here? What exactly causes the cron to fire? Is it the HTTP GET? Or is there some script or function inside the page that is loaded by browsers?
The WP-Cron functions are not actually cron functions. Instead of a cron running and executing tasks precisely as scheduled, it waits until the frontend or admin is loaded, checks if any jobs are scheduled and then fires as needed. To execute the cron jobs, WP loads
wp-cron.php, which is located in the root folder. My understanding is that when you visit the site and a cron is scheduled, a request is made to
http://yourdomain.com/wp-cron.php, which initiates the scheduled cron job(s). I don't know exactly how this works (I've read about it before, but cannot find the resource again), but this request is made in such a way that not all servers can handle it, causing it not to work. I wonder if your problem is that this request isn't made with a GET request to your site.
As an alternative, I would recommend using a GET request to
http://yourdomain.com/wp-cron.php. In fact, in the excellent Professional WordPress Plugin Development, they recommend the following:
A common method is using wget to load wp-cron.php on a schedule. If your server is Linux- based, cron will already exist and can be scheduled using the crontab command. If your server is Windows-based, you can install wget and create a scheduled task to execute it. The wget command would work like this: wget http://www.example.com/wp-cron.php When wget requests wp-cron.php WordPress looks for all scheduled cron jobs and executes as needed. Setting up true cron on your server will guarantee your cron jobs will run perfectly on schedule without missing a beat.
Along with this, you need to disable the default way of handling cron:
Another discussion of this can be found here:
If you want to remove the need for C# polling then this shameless plug (in :) might solve your problem: