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

automatic send email at custom time

Creating a Scheduled Event First we’ll create a function that will schedule our event. Mine is called “mycronjob” and it will run once every day. All this code can go into your plugin’s main file, outside the main function: // create a scheduled event (if it does not exist already) function cronstarter_activation() { if( !wp_next_scheduled( … Read more

Using cron for multiple queries

It sounds like what you really might want is a transient. WP Transients are a way to cache the results of a query, and set an expiration date on that cache. So you could cache the results of your example from above for 24 hours. If anyone requests that data while the cache is still … 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

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)