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. :/
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. 🙂
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 2 years, 4 months ago by
hemligg.
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.