Membership Plugin

WordPress Membership Plugin

  • Home
  • Documentation
  • Addons
  • Support
    • Quick Setup
    • Documentation
    • Premium Addon Support
    • Paid Support
    • Support Forum
    • Support Forum Search
    • Forum Login
    • Forum Registration
  • Contact

[Resolved] Member Admin exceeds available memory, gives 404

Simple Membership Plugin › Forums › Simple Membership Plugin › Member Admin exceeds available memory, gives 404

  • This topic has 4 replies, 2 voices, and was last updated 5 years, 11 months ago by admin.
Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • April 25, 2020 at 10:32 am #20165
    quick_dry
    Participant

    How do we recreate the link to the Member administration page?

    If I access /wp-admin/admin.php?page=simple_wp_membership I receive a 404 error.

    I can access any of the other admin pages in Simple WP Plugin, but all of a sudden this particular admin page just will not work (have tried multiple browsers, cleared caches, etc)

    I don’t need to recreate the other pages, registration still works – only management doesn’t. Is there something that can be twiddled in the database? I’m on version 3.9.6 but loathe to update it while the plugin isn’t fully working in case it breaks further.

    April 25, 2020 at 10:50 am #20166
    quick_dry
    Participant

    Further inpsection, is it possible this is caused by running out of memory? Though that raises the obvious “how does generating a page with only 50 member details on it, use over 2GB of memory?”

    Does SWPM load every member into memory when it generates the membership admin screen – and if so, where should I be looking to quickly patch this so that it doesn’t?

    April 25, 2020 at 2:18 pm #20167
    quick_dry
    Participant

    OK, I found the problem.

    The class.swpm_members.php needs to be more memory friendly – it is fine for small numbers, but not when you have many members and many categories.

    Problem: class.swpm_members.php prepare_items() exhausts available memory. It brings back every record in the join of swpm_members_tbl and swpm_membership_tbl. All the ‘list’ fields blow it out significantly bringing back about 49 fields per member when only 9 are used (member_id, user_name, first_name, last_name, email, alias, subscription_starts, account_state, last_accessed). I’m not a PHP guy but (if I’m not mistaken) it only does the first query returning everything in order to do an initial record count, after that it requeries the DB with record number limits. But by the time you do that, the memory has already blown out.

    Changing the class.swpm_members.php->prepare_items() to name the 9 columns instead of using “*” immediately fixes the problem at _this_ number of members. But I think the proper fix is to do the first query with something like COUNT(member_id) and then do the second query with pagination limits as is (I think this would also be better done with named columns to limit the data being shuffled around, but open to correction by someone who knows MySQL better than me)

    Doing it with COUNT then pages should make it handle massive member counts without needing massive memory.

    Is there a github repository to submit issue and pull requests to? (I submitted a pull request addressing the cron job for expired accounts to https://github.com/wp-insider/simple-membership but I don’t know if it has been looked at, or if that is the wrong place to submit to?)

    April 25, 2020 at 4:59 pm #20168
    quick_dry
    Participant

    tested the COUNT() approach and submitted the pull request to the wp-insider repo on github (https://github.com/wp-insider/simple-membership )

    If you can update the forum title to “Member Admin exceeds available memory, gives 404” that might make it clearer to other members who have this issue and need to patch their swpm_members class before a fix makes it to the plugin updates.

    April 27, 2020 at 1:31 am #20179
    admin
    Keymaster

    Thank you. I will merge this.

  • Author
    Posts
Viewing 5 posts - 1 through 5 (of 5 total)
  • You must be logged in to reply to this topic.
Log In

Please read this message before using our plugin.

Search

Featured Addons and Extensions

  • Membership Form Builder Addon
  • Member Directory Listing Addon
  • WooCommerce Payment Integration
  • Member Data Exporter Addon

Documentation

  • Documentation Index Page

Copyright © 2026 | Simple Membership Plugin | Privacy Policy