• Resolved JohnDBB

    (@johndbb)


    Hello

    The “wprss_get_imported_items_query” function is not scalable. That function gets every single imported post, but there are more than 50.000 imported posts on our site, so it is consuming an extreme amount of memory every time the Feed Sources page is loaded and it crashes the site. Can you please add some sort of limit to that query or adjust the behavior so that it works better on sites with a large amount of imported posts?

Viewing 5 replies - 1 through 5 (of 5 total)
  • @johndbb thanks for bringing this up. I’ll be sharing this with the technical team for consideration on discussion on how this can be further improved.

    Thread Starter JohnDBB

    (@johndbb)

    Hello, this has not been solved and the plugin throws a fatal error when there are a lot of imported posts. The query in wprss_get_imported_items_query is just terrible if you have thousands of posts.

    Plugin Support Hendra Setiawan

    (@hendcorp)

    Hi @johndbb

    We understand your frustration, and you’re right. The code inside that function loads every single imported post from the database into memory, which is not ideal. This is one of the reasons why we are building Aggregator v5.0.

    However, making this change in version 4 is not trivial, and adding a limit as you suggested might not work for every user. We would need to rethink a lot of code to accommodate such a query change.

    Aggregator 5.0 will be released in the coming weeks, but as a temporary solution in v4, the best thing we can offer is a code filter that allows you to control your own limit.

    Here is the code snippet:

    add_filter('wprss_get_feed_items_for_source_args', function ($args, $src_id) {
    if ($src_id) {
    $args['posts_per_page'] = 200;
    }
    return $args;
    }, 10, 2);

    Please keep in mind that this is not a proper solution. This will make the number of imported items shown in the Feeds Sources table go up to 200 for every feed source. Of course, you can change the “200” in the filter to whatever you prefer.

    Thread Starter JohnDBB

    (@johndbb)

    Thank you very much for your answer and your support

    Plugin Support Hendra Setiawan

    (@hendcorp)

    You’re most welcome, @johndbb . Feel free to reach out if you need any further assistance.

Viewing 5 replies - 1 through 5 (of 5 total)
  • You must be logged in to reply to this topic.