WordPress.org

Ready to get started?Download WordPress

Forums

Bei Fen - WordPress Backup Plugin
Bei Fen Error after installation (8 posts)

  1. mimikbos
    Member
    Posted 3 years ago #

    This error popped up in the right hand side of the Dashboard:

    Fatal error: Call to undefined method WP_Error::get_item_quantity() in /home/jewishorganizing/jewishorganizing.org/wp-content/plugins/bei-fen/pages/bf-info.php on line 7

    I installed version 1.4.2 using both the automatic install and the Zip file install then clicked on Back-up on the left hand menu and saw the error listed above.

    Please let me know what the fix is.

  2. misterchris
    Member
    Posted 3 years ago #

    yes exactly the same problem an hour ago. Any access at all to the plug in produces that exact same fatal error. Be grateful for a quick answer to this one. Thanks

  3. Bryn
    Member
    Posted 3 years ago #

    Looks like this is happening because Ben's feed is down.

    FIX:
    In /wp-content/plugins/bei-fen/pages/bf-info.php, comment out lines 5-8, e.g.

    include_once(ABSPATH . WPINC . '/feed.php');
    $rss = fetch_feed('http://www.beifen.info/feed/');
    $maxitems = $rss->get_item_quantity(5);
    $rss_items = $rss->get_items(0, $maxitems);

    Becomes

    // include_once(ABSPATH . WPINC . '/feed.php');
    // $rss = fetch_feed('http://www.beifen.info/feed/');
    // $maxitems = $rss->get_item_quantity(5);
    // $rss_items = $rss->get_items(0, $maxitems);
  4. misterchris
    Member
    Posted 3 years ago #

    Thank you Bryn. What is the difference in your fix between the "old" and the "becomes" script. They look exactly the same. Or am I being silly here? Rgds chris

  5. Peter Butler
    Member
    Posted 3 years ago #

    The "becomes" section has // at the beginning of every line, which makes your server ignore the code.

    Side note: This is a useful lesson for plugin developers - if you're going to include a feed like this, make sure it fails gracefully!

  6. misterchris
    Member
    Posted 3 years ago #

    Hi Peter
    Im a dummy for missing that. I feel proper stupid now. Anyways that worked fine thank you. Can I ask you a couple of other questions:

    1) what exactly is this backup tool backing up from the following list?
    wrdp database?
    themes?
    plug in?
    uploads?
    anything else?

    2) will it continue to work do you think bearing in mind Ben seems to have gone AWOL on us?

    Rgds
    Chris

  7. biissolutions
    Member
    Posted 3 years ago #

    Thanks...it worked perfectly!

  8. dasBIOS
    Member
    Posted 3 years ago #

    In the case the RSS will be up and runing sometime in the future, replace lines 5-8 in /wp-content/plugins/bei-fen/pages/bf-info.php

    include_once(ABSPATH . WPINC . '/feed.php');
    $rss = fetch_feed('http://www.beifen.info/feed/');
    $maxitems = $rss->get_item_quantity(5);
    $rss_items = $rss->get_items(0, $maxitems);

    WITH:

    include_once(ABSPATH . WPINC . '/feed.php');
    			$rss = fetch_feed('http://www.beifen.info/feed/');
    
    			if (!is_wp_error( $rss )){ // Checks that the object is created correctly
    				$maxitems = $rss->get_item_quantity(5);
    				$rss_items = $rss->get_items(0, $maxitems);
    			} else {
    				$maxitems = 0;
    				$rss_items = array();
    			}

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags