How to make this plugin more efficient

Hi I have this plugin

http://pastebin.com/a7t1SPXj

Read More

which imports feeds from various websites. There are two problems I would like help in solving. The first is that I would like to place a limit on the date of the oldest feeds retrieved, limiting all results to the last 7 days. Secondly when I add more than 10 feeds it really starts to slow down the page and gets me PHP timeout errors. How can I make it more efficient, so it doesn’t require huge load times on every page load? Thanks.

Related posts

Leave a Reply

1 comment

  1. Instead of checking and updating the feeds every time you do the shortcode, instead register cron tasks for each feed timed to their update schedule. Also saving the feed items as posts, and storing the GUID in the posts meta, then only saving the feed items that are new, will simplify things. It will also let you use WP_Query on posts instead of dealing with feed transients too.