Problems with WP plugin error message

by 4 replies
5
Hi,

I recently installed a WP plug in called widlink but it showed on my log 2 error message as follows:




The 2 "foreach" line are as in red as follows:



$q = @file($remoteURL);$a=array();$b=array();
$l = @file($myLinksUrl);

//removing $ignore from $q
$new_q=array();

{
$_p=explode("|", $_u);
$_name = trim($_p[0]);
if( ($_name) && ($_name != $ignore) )
$new_q[]=$_u;
}
$q=$new_q; unset($new_q);
$n=count($q);

//removing $ignore from $l
$new_l=array();

{
$_p=explode("|", $_u);
$_name = trim($_p[0]);
if( ($_name) && ($_name != $ignore) )
$new_l[]=$_u;
}
$l=$new_l; unset($new_l);
$mylinks_count=count($l);

srand(time());
$addmylink = (empty($l)) ? "" : $l[array_rand($l)];

if(empty($l)) {

if(empty($q)) {

echo "";
echo $after_widget;
return;

}


}

I am not a programmer, please advise .

Cheers
Jason Ser
#programming #error #message #plugin #problems
  • Are you sure that the Plugin is designed and compliant with your version of WordPress? A lot of plugins for earlier versions broke after version 2.7 was introduced.

    I can't find any reference to this plugin on the WordPress site, what does it actually do? At the risk of asking the obvious, have you contacted the developer about the problem?

    Bill
  • It looks like the plugin is expecting to read in pipe delimited list from these;

    $q = @file($remoteURL);
    $l = @file($myLinksUrl);

    At a guess, the foreach is failing because they are blank or empty; Where is it mean to source the $remoteURL and $myLinksUrl from?

    If the plugin 'includes' or 'requires' any other files, they may be set there.

    You should also check the plugin docs or contact the author for support, after all, they'd know best how to fix it.
  • Thanks Guy, I Think That's what I will do
  • I've had this error with other plugins in the past.

    You'll need to:
    1. Disable (not uninstall) all plugins
    2. Activate each plugin, one by one, until you activate the plugin that produces the error.
    3. Delete the plugin that produces the error
    4. Download the plugin from the author's site, and install it again.

    When I've encountered this issue it's because the plugin's PHP file isn't a complete file i.e. it cuts off before the end - I'm not sure whether this happens due to a failed download of the plugin or failed FTP / upload of the plugin to your site. The error itself is a little erronous, as the code line it points to is typically fine.
  • Banned
    [DELETED]

Next Topics on Trending Feed