Support » Plugin: WP RSS Aggregator » v4.15.1 generates an error when it cannot find RSS feed from the specified URL.

  • zu2

    (@zu2)


    The v4.15.1 generates “Call to undefined method WP_Error::get_permalink()” error in wprss_get_feed_items (includes/feed-importing.php).

    When wprss_fetch_feed can’t find RSS from specified URL, it returns WP_Error instance. But wprss_get_feed_items does not check the return value properly, an error occurs.

    My small fix are as follows:

    — includes/feed-importing.php.old 2019-08-16 02:08:10.353326009 +0900
    +++ includes/feed-importing.php 2019-08-21 02:13:28.097733216 +0900
    @@ -238,8 +238,10 @@
    /* Fetch the feed from the soure URL specified */
    $feed = wprss_fetch_feed( $feed_url, $source, $force_feed );

    – update_post_meta( $source, ‘wprss_site_url’, $feed->get_permalink() );
    – update_post_meta( $source, ‘wprss_feed_image’, $feed->get_image_url() );
    + if ( !is_wp_error( $feed ) ) {
    + update_post_meta( $source, ‘wprss_site_url’, $feed->get_permalink() );
    + update_post_meta( $source, ‘wprss_feed_image’, $feed->get_image_url() );
    + }

    // Remove previously added filters and actions
    remove_filter( ‘wp_feed_cache_transient_lifetime’ , ‘wprss_feed_cache_lifetime’ );

    • This topic was modified 2 months ago by  zu2.
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
  • You must be logged in to reply to this topic.