Jump to content

Wordpress Php help needed


codecreative

Recommended Posts

Hi

 

I have a script that is executed when wp-cron is executed, which is basically whenever my website loads.

 

I tried placing

 

//Disable internal Wp-Cron function  
define('DISABLE_WP_CRON', true);
 
At the top and it still runs my script. I also downloaded, installed and ran this plugin called cron view which lets me see what is in the wp crons scheduled tasks
 
The results were
 
Next due (GMT/UTC) Schedule Hook Arguments Oct 3, 2013 @ 1:54 (1380765280) Twice Daily wp_version_check   Oct 3, 2013 @ 3:40 (1380771621) Twice Daily wprc_schedule_update_plugins   Oct 3, 2013 @ 3:40 (1380771621) Twice Daily wprc_schedule_update_themes   Oct 3, 2013 @ 8:30 (1380789001) Every 12 hours check_plugin_updates-newroyalslider   Oct 3, 2013 @ 13:54 (1380808485) Once Daily wp_scheduled_delete   Oct 3, 2013 @ 14:01 (1380808908) Once Daily wp_scheduled_auto_draft_delete
 
Okay so the above to findings made me conclude that wp-cron is being used to call my script directly and doesn't in actual fact exist in the scheduld tasks. Okay so far so good.
 
My next step is, how do I stop the script being called from wp-cron? Can anyone help
 
The contents of my wp-cron file is can be seen at 
 
Anyone that could kindly give me a pointer on this would be really helpful to me and I would appreciate your help quite a lot, as well as helping me self educate.
 
Thanks in advance 
Link to comment
Share on other sites

there's no guarantee that the person who wrote this didn't just put in his own call to your script into one of the web site files.

 

since it appears that it is being included (just a guess) you can use debug_backtrace() in the file to get information about how it is being executed. you could simply append the debug_backtrace() output to a log file of your making, using file_put_contents() with the FILE_APPEND attribute.

Link to comment
Share on other sites

Hi could you if you don't mind give me a small snipet of code showing me this?

 

Its a very good point you raise, it could be called from any file. I know wp-cron is one of the files that does. But when I call wp-cron from scheduled tasks it executes well. So there could be another rogue file calling it.

 

This sounds like a great solution you've suggested I'm not too sure of the implementation

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.