• hemligg

    (@hemligg)


    We have been using this plugin for a few years and have about 50K invitations stored. But we would like to clear all accepted invitations. When we click on the link “/invite-anyone/sent-invites/?clear=accepted” then only a couple of invitations are deleted each time. I can’t find any error message. Why is that? And how can I deleted all accepted invitations? Is there any work around? Can I run a database query to delete them manually? Run a code snippet to make it go through all 50K invitations and delete the accepted ones?

    • This topic was modified 10 months ago by hemligg.
Viewing 4 replies - 1 through 4 (of 4 total)
  • Thread Starter hemligg

    (@hemligg)

    After further investigation it seems it only iterates the first 10 invitations in the list. So as we only display 10 per page it only iterates the first 10. :/

    Thread Starter hemligg

    (@hemligg)

    I have found where it is wrong. In the file by-email-db.php line 716 you have this code:

    array(
    'inviter_id' => $inviter_id,
    'posts_per_page' => -1,
    );

    I guess that should be replace by this following code to work as intended:

    $args = array(
    'inviter_id' => $inviter_id,
    'posts_per_page' => -1,
    );

    That will however give me a fatal error due to trying to allocate too much memory as I have more than 50000 invitations. But it works okay if I replace the code with this instead:

    $args = array(
    'inviter_id' => $inviter_id,
    'posts_per_page' => 10000,
    'paged' => 1,
    );

    That way I can clean up most invitations at least. I just have to do it over and over again for a while. ??

    Thread Starter hemligg

    (@hemligg)

    Better yet is to add the argument to order by ‘accepted’ to concentrate on the ones we want to delete.

    $args = array(
    'inviter_id' => $inviter_id,
    'posts_per_page' => 1000,
    'paged' => 1,
    'orderby' => 'accepted',
    );

    • This reply was modified 10 months ago by hemligg.
    Plugin Author Boone Gorges

    (@boonebgorges)

    Thank you for the report and for spotting the bug! The $args issue should be fixed in the next version of Invite Anyone: https://github.com/boonebgorges/invite-anyone/issues/178

    Note that I set the limit lower than you did, at 500. This is based on my experience with users leveraging plugins like this on shared hosting, etc. The new filter will allow you to increase if necessary. In any case, you should be able to simply click the ‘clear’ link multiple times in order to clear all records.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Can’t clear all accepted’ is closed to new replies.