WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Google Analytics for WordPress - Fatal error message (5 posts)

  1. naturalgrace
    Member
    Posted 3 years ago #

    Hi,

    I've tried to install Google Analytics for Wordprss and got the error message below. I've no idea what it means or how to rectify it. I am not code literate so please sxplain it simply for me. I've looked around the website but can't find any solutions.

    Fatal error: Call to undefined method: wp_error->get_items() in /nfs/c05/h01/mnt/69347/domains/natural-grace.co.uk/html/wp-content/plugins/google-analytics-for-wordpress/yst_plugin_tools.php on line 196

    I think I am using WordPress version 2.8.5 but can't see where it says that. I'm seeing the option to upgrade to 3.0.1

    Thanks in advance for your help

    naturalgrace

  2. marchenko.alexandr
    Member
    Posted 3 years ago #

    to fix this problem replace code at line 196 from:

    $rss_items = $rss->get_items( 0, $rss->get_item_quantity(5) );

    to

    $rss_items = array();
    if (!is_wp_error( $rss ) ) {
    	$rss_items = $rss->get_items( 0, $rss->get_item_quantity(5) );
    }

    and all will be ok

  3. naturalgrace
    Member
    Posted 3 years ago #

    Hi marchenko.alexandr,

    The error message is not there now so I think things are ok now. Thank you for the coding. I will use it if I get the same error message in the future.

    Thank you
    naturalgrace

  4. marchenko.alexandr
    Member
    Posted 3 years ago #

    this error will reproduce every time when plugin site rss feed will not work, anyway this is really not "Fatal error" so we may do not make any changes - nothing will happend

  5. Laracy17
    Member
    Posted 3 years ago #

    Just wanted to thank you marchenko for your solution. You saved me hours of pulling my hair out :)

Topic Closed

This topic has been closed to new replies.

About this Topic