My Wordpress website is slowed down by a plugin i wrote myself. This plugin loads events from a RSS feed on a different site.
I have disabled the plugin and it made a difference of 20 in Google Page Speed.
How can i lazy load a RSS feed in Ajax or Javascript?
The code i have:
$rss = simplexml_load_file(get_option('capu_url'));
foreach ($rss->channel->item as $item) {
echo '<h4><a href="'. $item->link .'">' . $item->title . "</a></h4>";
//echo "<p>" . $item->description . "</p>";
$dom = new DOMDocument;
$dom->strictErrorChecking = FALSE ;
libxml_use_internal_errors(true);
$dom->loadHTML($item->description);
$xpath = new DOMXPath($dom);
$nodes = $xpath->query('//ul[@class="ee-event-datetimes-ul"]'); // get <ul>'s with class 'up'
foreach($nodes as $node) { // loops through each <ul>
foreach($node->getElementsByTagName('li') as $li) { // loops through the <li>'s
echo $li->nodeValue . "<br/>
"; // echo's the <li> elements