Change daily execution to hourly execution in PHP

I asked this question before, but asked it in a unclear way, so I am trying again.

I am trying to get this PHP to execute hourly instead of daily. It's a wordpress plugin that imports RSS feeds. It's GPL. I just have cheap hosting so I don't have access to command line/ cron on the server.

I have searched here and found this post: PHP Running an hourly script but it didn't help me understand. I don't know PHP, I have tried editing it, broken it, googled it, broken it again etc

If anyone could edit this so that it should work I'd be eternally grateful.

This is the original working code that executes daily: http://pastebin.ca/2313994

I'm looking at this bit where we define post days:

define('SCRD_DEFAULT_POST_DAYS', 'a:7:{s:6:"Monday";i:0;s:7:"Tuesday";i:0;s:9:"Wednesday";i:0;s:8:"Thursday";i:0;s:6:"Friday";i:1;s:8:"Saturday";i:0;s:6:"Sunday";i:0;}');

I'm thinking that if I knew the PHP for all 24 hours I could enter all 24 values and it would fool the script into running hourly?

What is the code to define all 24 hours?

s:6:"12:00";?:?;?:?:"13:00";?:?;?:?:"14:00";?:?;?:?: etc

Or would this approach not work?

I have googled: define('SCRD_DEFAULT_POST_DAYS', but only find this post and the original code.

I have already tried editing this part: define('SCRD_DEFAULT_HOUR', '17'); to read

define('SCRD_DEFAULT_HOUR', '17' '18' '19' '20' etc but it didn't work for me.

Solutions

Plugin author here.

You're looking in the wrong place . To hack this, you want to manipulate the function where the next digest is scheduled, particularly function scrd_do_digest which starts on line 65.

I haven't tested this, but I would start by replacing the code on line 67:

$next_digest = $right_now + 3600;   // schedule for one hour from now

Now this is a total hack, so if you do this the other places where the next digest time is displayed will be lying to you. Also, any time you update the settings, the next posting of the digest will be set according to the schedule you set in the UI. You might be able to use the "Post Now" button to get the ball rolling early.

Similar questions

Wait for JQuery execution until whole page is loaded breaks execution
I have a JQuery script to load a newsletter subscription popup window after the users scrolls down a certain amount of pixels using the jQuery .scroll/.scrollTop function. At the moment it's all encapsulated within The problem is the usual caching and images issue and the subscription box pops up all over the place. I was reading about delaying jQu...
How to change daily transaction limit of paytm gateway
Hi i am doing a hotel room booking reservation system in word press.i am using paytm as my payment gateway. Every thing works fine but if the transaction amount is greater than 10000 transaction cannot be processed and redirect back to the home page itself the url i got is
Run a php file daily at specific time
I'm trying to add a cron job to run file daily at 7pm. How can i add the file run command and specify to run it at 7pm ? I don't know if there is a better solution.
Post counter Daily,weekly,monthly,all time php & mysql
I got a website with several posts/articles which I can track by last 24h,last week,last month and all time views for each post. I save the timestamp on each view in the db. When someone opens the home page I loop these timestamps and save them accordingly to the last 24h/last week/last month/all time in the db. This works "good" (but problem). NOW...
Execute php script daily with wordpress
I found a script that check status of a url. Now i'm trying to integrate it with wordpress. This is the code: What i want is run this code only once daily. How can i make it not run when refresh or visit a page where i use shortcodes ? I need display status of about 50 sites and page takes more than 10 sec to load now. Sorry for this simple questio...
How to call a function daily in Wordpress & PHP without using cron?
I'm writing a plugin to show a Daily Quote on front-page of a WordPress site. Basically, I want to get one random daily quote. I have a custom post type daily_quotes. I'm having trouble with doing this query every day at 23:59 or 00:00. I'm looking for a solution to do this and some example would be nice. EDIT: I forgot to say that cron jobs aren't...

Also ask

We use cookies to deliver the best possible experience on our website. By continuing to use this site, accepting or closing this box, you consent to our use of cookies. To learn more, visit our privacy policy .