• Been going through my site with a fine-tooth comb these past few hours to fix any minor bugs that could be slowing it down or adding lines to the error.log, and one thing about quote source stood out to me.

    On every single post that has no sources, i’m getting errors like this:

    Notice: Uninitialized string offset: 0 in /home/csicon/public_html/csicon.org/wp-content/plugins/quote-source/quote-source.php on line 110
    Notice: Uninitialized string offset: 0 in /home/csicon/public_html/csicon.org/wp-content/plugins/quote-source/quote-source.php on line 111
    Notice: Uninitialized string offset: 0 in /home/csicon/public_html/csicon.org/wp-content/plugins/quote-source/quote-source.php on line 110
    Notice: Uninitialized string offset: 0 in /home/csicon/public_html/csicon.org/wp-content/plugins/quote-source/quote-source.php on line 111
    Notice: Uninitialized string offset: 0 in /home/csicon/public_html/csicon.org/wp-content/plugins/quote-source/quote-source.php on line 110
    Notice: Uninitialized string offset: 0 in /home/csicon/public_html/csicon.org/wp-content/plugins/quote-source/quote-source.php on line 111

    If a post has one quote, I get this:

    Notice: Undefined index: quote2 in /home/csicon/public_html/csicon.org/wp-content/plugins/quote-source/quote-source.php on line 110
    Notice: Undefined index: quote2_title in /home/csicon/public_html/csicon.org/wp-content/plugins/quote-source/quote-source.php on line 111
    Notice: Undefined index: quote3 in /home/csicon/public_html/csicon.org/wp-content/plugins/quote-source/quote-source.php on line 110
    Notice: Undefined index: quote3_title in /home/csicon/public_html/csicon.org/wp-content/plugins/quote-source/quote-source.php on line 111

    If a post has two quotes, I get this:

    Notice: Undefined index: quote3 in /home/csicon/public_html/csicon.org/wp-content/plugins/quote-source/quote-source.php on line 110
    Notice: Undefined index: quote3_title in /home/csicon/public_html/csicon.org/wp-content/plugins/quote-source/quote-source.php on line 111

    This seems to suggest that the source goes through all three possible fields for every single post when outputting it, even when there is nothing defined for the quotes in there. Wouldn’t it make a lot more sense to put a simple if(!empty) call before you run the for-loop with the following two lines:

    $tmp_url = $meta['quote'. ($i+1)];
    $tmp_title = $meta['quote' . ($i+1) .'_title'];

    After all, those two lines are run three times per post, even when there are no quotes to be called.

    http://wordpress.org/extend/plugins/quote-source/

Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
  • The topic ‘[Plugin: Quote Source] Debug shows error’ is closed to new replies.