Craig B

Forum Replies Created

Viewing 12 posts - 1 through 12 (of 12 total)
Mar 4, 2026 at 1:45 pm
#212539
Participant
Craig B
OP

Hi,

I have in my previous post at Mar 3, 2026 at 9:07 pm 🙂

Mar 4, 2026 at 1:42 pm
#212537
Participant
Craig B
OP

Hi,

Yes I believe they’ll have the same issue as we had.

Mar 4, 2026 at 11:10 am
#212535
Participant
Craig B
OP

Will this be merged? Else the next update will wipe it.

Mar 4, 2026 at 9:19 am
#212533
Participant
Craig B
OP

Hi, yes it works. I believe anyone hosting on WordPress.com or who uses memcache will need this.

Mar 3, 2026 at 9:07 pm
#212528
Participant
Craig B
OP

I have a fix for anyone else with this issue! It seems to only happen if you have memache such as when hosting on WP.com. Here’s what I had to do:

Fix #1: Missing posts_per_page Parameter
File: download-manager.php
Add:

<?php
// Fix for missing posts_per_page parameter
add_filter('wpdm_packages_query_params', function($params) {
    if (!isset($params['posts_per_page'])) {
        $params['posts_per_page'] = 10;
    }
    return $params;
}, 999);

What it does: Ensures WP_Query always receives a posts_per_page parameter. When pagination/sorting is active, this parameter was missing for me, causing WP_Query to return incorrect results (I verified this with console logs).

Fix #2: WordPress.com Caching Bug with found_posts
File: __/Query.php inserted at line 415
Insert:

<?php
// Fix for WordPress.com caching issue: if found_posts is 0 but we have posts, recalculate
if ($this->result->found_posts == 0 && !empty($this->result->posts)) {
    // Run a separate count query to get accurate total
    $count_params = $this->params;
    unset($count_params['paged']);
    unset($count_params['posts_per_page']);
    $count_params['fields'] = 'ids';
    $count_params['posts_per_page'] = -1;
    $count_params['no_found_rows'] = true;
    $count_query = new \WP_Query($count_params);
    $this->count = $count_query->post_count;
} else {
    $this->count = $this->result->found_posts;
}

What it does: Detects when WordPress.com’s object cache incorrectly returns found_posts=0 despite WP_Query returning actual posts. Runs a separate count query to get the accurate total, preventing the “No downloads found!” message from displaying and ensuring pagination shows all pages correctly.

Mar 3, 2026 at 8:16 pm
#212527
Participant
Craig B
OP

Also this page is not showing any package for me https://free.wpdm.online/packages-block-check/

It just says “Packages Block Check”.

Mar 3, 2026 at 8:02 pm
#212526
Participant
Craig B
OP
This reply has been marked as private.
Mar 3, 2026 at 4:23 pm
#212518
Participant
Craig B
OP
This reply has been marked as private.
Mar 3, 2026 at 4:07 pm
#212514
Participant
Craig B
OP

I’ve actually already tried that. I went back to the built in theme and had the same results. Would it help if I gave you a ‘paid account’ on our live site so you can see it for yourself there?

Mar 3, 2026 at 2:43 pm
#212511
Participant
Craig B
OP
This reply has been marked as private.
Mar 3, 2026 at 8:02 am
#212486
Participant
Craig B
OP
This reply has been marked as private.
Mar 2, 2026 at 5:36 pm
#212456
Participant
Craig B
OP
This reply has been marked as private.
Viewing 12 posts - 1 through 12 (of 12 total)