troubleshooting Question

Problem building WordPress Plugin that uses lastRSS

Avatar of Howard Bash
Howard BashFlag for United States of America asked on
18 Comments1 Solution1305 ViewsLast Modified:
I have been going through a tutorial and built a plugin for WordPress that uses lastRSS.  When I activate it.  It displays some of the code on the top left corner of the dashboard.

I will attach the code that uses lastRSS for review.  I'm not clear how to go about debugging it.

Plugin Name: RSS Processor
Plugin URI: http://localhost
Description: Plugin to fetch parse and show RSS feeds.
Author: Author
Version: 1.0
Author URI: http://localhost
Feature: So far none to be seen.


add_filter('the_content', 'rss_parse');

Sample format for rss tag:
{rss uri= count=5}

uri and how many feeds to show

param is content of post
returns none


include './lastRSS.php';

function rss_parse($content)
  $rss=new lastRSS();

  $matches = "";

  preg_match_all($pattern, $content, $matches);

  $rsses = 0;
  while ($rsses<count($matches[0]))



    if (empty($count)) $count=10;

    $rss_content = $rss->Get($uri);
    $items = $rss_content['items'];

    $i = 0;
    while ($i < $count)
        $p_content .= "<div id='rss_item'><strong><a href='{$items[$i]['link']}'>".$items[$i]['title']."</a></strong><br/>";
        $p_content .= "".$items[$i]['description']."</div><br/><br/>";


    $content = str_replace($matches[0][$rsses], $p_content, $content);
    $rsses +=1;

  return $content;


Open in new window


Our community of experts have been thoroughly vetted for their expertise and industry experience.

Join our community to see this answer!
Unlock 1 Answer and 18 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 18 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros