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
You are here: Home

quick_dry

  • Profile
  • Topics Started
  • Replies Created
  • Engagements
  • Favorites

Forum Replies Created

Viewing 10 posts - 1 through 10 (of 10 total)
  • Author
    Posts
  • May 15, 2020 at 8:13 am in reply to: 2020 – Reset Password not working #20253
    quick_dry
    Participant

    they mean that the users ARE able to reset their password via the “Edit Profile” page, but if they use the “forgot password” feature, where the site resets your password to a random password and sends you the password in an email – the emailed password does not work when they try to login.

    (I’m on a previous release so I couldn’t do a test of 3.9.7)

    April 25, 2020 at 4:59 pm in reply to: Member Admin exceeds available memory, gives 404 #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 25, 2020 at 2:18 pm in reply to: Member Admin exceeds available memory, gives 404 #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 10:50 am in reply to: Member Admin exceeds available memory, gives 404 #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?

    March 28, 2020 at 9:22 am in reply to: swpm_after_login hook not firing #19965
    quick_dry
    Participant

    that was how I narrowed it down to the “Simple Membership After Login Redirection” plugin having the effect.

    Activate – no swpm_after_login.

    Deactivate – swpm_after_login works _and_ lines of code immediately after the do_action call in the main swpm plugin.

    March 3, 2020 at 5:02 pm in reply to: Need to stop users getting emails #19867
    quick_dry
    Participant

    filter for wp_mail when it tries to send, then nuke the email details if it meets your criteria

    add_filter(‘wp_mail’,’disabling_swpm_emails’, 10,1);
    function disabling_swpm_emails( $args ){
      if ($args['subject']=='foo'){
          $args['to']=''; 
          $args['message']=''; 
      }
    return $args;
    }
    March 3, 2020 at 4:58 pm in reply to: Stop Confirmation Email or Change body at runtime #19866
    quick_dry
    Participant

    I know this is an old thread, but I had the same problem. Not sure if there is a better version yet, but I did it with a filter on wp_mail looking for any email with a certain phrase in the subject (that i could set via the SWPM admin screen) and removing the ‘to’ and ‘message’.

    add_filter(‘wp_mail’,’disabling_swpm_emails’, 10,1);
    function disabling_swpm_emails( $args ){
    try {
    if (strpos($args[‘subject’],’DO_NOT_SEND_THIS_EMAIL’)>-1){
    $args[‘to’]=”;
    $args[‘message’]=”;
    }
    } catch (Exception $e) {
    //do nothing
    }
    return $args;
    }

    March 3, 2020 at 4:52 pm in reply to: Edit [swpm_mini_login] Widget Text #19865
    quick_dry
    Participant

    you probably already solved it, but this might help someone else – rather than customising the plugin and losing changes on update. Put it in a little site specific plugin, and modify the shortcode’s output. e.g. I use the mod_swpm_login_form shortcode, instead of swpm_login_form

    //Replace the [swpm_login_form] shortcode output with something else
    function shortcode_mod_swpm_login_form(){

    $output=do_shortcode(‘[swpm_login_form]’); //Get the standard shortcode’s output
    //do stuff with the strings here, replace this, remove that, etc
    return $output;
    }
    add_shortcode(‘mod_swpm_login_form’, ‘shortcode_mod_swpm_login_form’);`

    March 3, 2020 at 4:46 pm in reply to: Replace "Profile" with "My Account" in mini login #19864
    quick_dry
    Participant

    @Mickael instead of messing with your theme, you could put it in a plugin specific to your site – just follow a “build a simple plugin” and put something like this in it – you can see how it checks and modifies the swpm_login_form shortcode’s output. Just call it with the ‘mod_swpm_login_form’ shortcode instead of swpm_login_form.

    //Replace the [swpm_login_form] shortcode output with something else
    //e.g. remove the username from the form output when logged in
    function shortcode_mod_swpm_login_form(){

    $output=do_shortcode(‘[swpm_login_form]’);
    if (strpos($output,’Logged in as’)>-1){ //if user is logged in
    $output=str_replace(‘>Logged in as</div>’,’>Logged in</div>’,$output);
    $output=preg_replace(‘/\<div class=\”swpm-logged-username-value swpm-logged-value\”\>(\S+)\<\/div\>/U’, ”, $output);
    }
    return $output;
    }
    add_shortcode(‘mod_swpm_login_form’, ‘shortcode_mod_swpm_login_form’);`

    March 24, 2019 at 8:06 pm in reply to: Social Login Not Working #17686
    quick_dry
    Participant

    is there any resolution to working with miniorange social login? (or any providers other than accesspress?) super socialiser doesn’t work either, they create the members – but SMP never recognises the users as logging in – though other plugins do.

  • Author
    Posts
Viewing 10 posts - 1 through 10 (of 10 total)
Next Page »

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