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

Bug in Registration code? SWPM Version 3.5.6

Simple Membership Plugin › Forums › Simple Membership Plugin › Bug in Registration code? SWPM Version 3.5.6

  • This topic has 5 replies, 3 voices, and was last updated 8 years, 6 months ago by mbrsolution.
Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • August 24, 2017 at 8:46 pm #11820
    Neb
    Participant

    In the class: class.swpm-permission.php

    Their appears to be a bug…

    I kept getting the message ‘Invalid Membership level!’ when registering, even though my membership value (19) was definitely valid.

    The code in question looks like this:

    if ($level_id == 1 || $level_id == md5(1)) {
       wp_die('Invalid Membership level!');
    }

    The reason it fails is that it when passed in my membership level of 19 that’s MD5’d to ‘1f0e3dad99908345f7439f8ffabdffc4’, then the first check of

    $level_id == 1

    will be true, as this is not a strict === check, but a loose one that is just checking if the value is true (which a string would be, I believe).

    I updated the code to use stricter checking (===) and it works fine.

    Code:

    if ($level_id === 1 || $level_id === md5(1)) {
       wp_die('Invalid Membership level!');
    }

    Obviously I have had to modify a core file, so would rather you could check and fix this if it does indeed solve the issue, as any updates will revert this back.

    Thanks

    August 24, 2017 at 11:11 pm #11823
    mbrsolution
    Moderator

    Hi, thank you for posting your issue and solution. The plugin developers will further investigate your code.

    Kind regards

    August 25, 2017 at 10:33 am #11826
    admin
    Keymaster

    Thank you. We will apply a fix for this.

    August 25, 2017 at 11:13 am #11827
    Neb
    Participant

    Great!

    Thank you so much for the swift response and confirmation that it is the fix.

    The current Version is 3.5.6, will this make it to the next release?

    September 28, 2017 at 8:04 am #12025
    Neb
    Participant

    Hi,

    Was there any update on if this will make the next update and when that might be?

    October 15, 2017 at 5:09 am #12161
    mbrsolution
    Moderator

    Hi, version 3.5.7 fixes this issue. Please check and let us know.

    Thank you

  • Author
    Posts
Viewing 6 posts - 1 through 6 (of 6 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