Pages for Cron use Only?

You could use php_sapi_name(). See this demo lifted from the developer docs <?php $sapi_type = php_sapi_name(); if (substr($sapi_type, 0, 3) == ‘cgi’) { echo “Your are probably a human”; } else { echo “You are probably not a human”; } ?> You could just apply this kind of conditional at the start of your script.

setting up a wp cron job

It depends what you mean by “I want the test.php file to be called not earlier then a specific time each day”. Setting up a cron job is very straightforward, you just need to simply do: <?php register_activation_hook( __FILE__, ‘prefix_activation’ ); /** * On activation, set a time, frequency and name of an action hook … Read more

Run WordPress Plugin in the Specified time

As you mentioned, WordPress by default only runs the wp_cron when the WordPress site is visited. This of course will cause problems if you are needing to schedule some event reliably, and you aren’t getting consistent traffic to your site. To resolve this, you can disable the default functionality of the wordpress cron by adding … Read more

Huge cron option_value into wp_options table

This could be caused by many different things, as well as a result of a broken cron setup, where actions are being scheduled, but never run. The best way forward is to try and understand what is actually being scheduled or rescheduled, what are the action names? If you can find the action names, you’ll … Read more

couldn’t connect to host – wp-cron.php?doing_wp_cron

You should open a support ticket with your host, as it’s probably related to their environment. From the error, it sounds to me like they might be blocking curl in their environment, probably for security reasons. They may be able to unblock it, or you may need to find an alternative.

Sending emails to separate accounts using a for loop

For whatever reason, this part: for ($z = 1; $z <= $Number_of_Categories; $z++) is the offender. even though $Number_of_Categories was defined above where it is used, the value wasn’t holding. I had to build a function instead, and do this: function get_Number_of_Categories(){ return “2”; } for ($z = 1; $z <= get_Number_of_Categories(); $z++) once I … Read more

Schedule Removal of Menu Page and Shortcode

First, unless zeeshan is actually a function inside a class, do not use array($this,’zeeshan’). (If it is in a class, nevermind.) Second, even if this event is firing – it may or may not be? – the way you have it is only going to affect the current pageload when triggered, so is rather pointless. … Read more