Restrictions are not working

Hi,

After upgrading to latest PhP version none of the restrictions are working in my site: http://bit.ly/1LuFDRK

Support access is granted.

Can you provide an update to this plugin?

Thanks.

  • Alex Stine
    • System Administrator

    Hello chathura

    Hope you are having an awesome day!

    Just to make sure it actually is PHP 7 causing this, could you run a plugin/theme compatibility test?

    1. Deactivate all plugins but Membership2Pro.

    2. Test to see if you can access your protected content. If not, Activate your plugins one by one until you find the one causing this issue.

    3. If plugins do not fix the problem, try switching to the Twenty Sixteen theme to see if Membership2Pro works properly.

    Please let me know the results of the test.

    Cheers,

    Alex :smiley:

  • Luís
    • Support

    Hi chathura ,

    Hope you’re doing well today!

    From what I checked in your website, just the url’s protected using the “URL Protection” add-on are not working.

    I tried to replicate your setup in localhost, using the same PHP version (7.0.8 ), but I was unable. We need to dig into this to get more informations.

    The first thing should be check for a plugin conflict, however, as this is a live site, there is any option of creating a staging website with the same setup and PHP version?

    Can you enable the debug flags in your wp-config.php, to see if any related errors are being saved?

    define( 'WP_DEBUG', true );
    define( 'WP_DEBUG_LOG', true );

    It will be saved to a debug.log file inside the “wp-content” folder. Can you share it with us?

    https://codex.wordpress.org/Debugging_in_WordPress

    Note: Save the file as a .txt, because the .log extension is not allowed in the attachments.

    Cheers, Luís

  • Tyler Postle
    • CGO

    Hey Chathura,

    I’ve been testing this further on my own install and also the subsite you provided above. I’m not able to replicate the problem even with the same M2 settings and using Directory’s category urls.

    Your test subsite didn’t show any of the Directory Listing’s so I swapped to twentyfifteen and it shows them then. After that I temporarily deactivated only the site specific plugins you had(not any of the network ones) and it does look like some improvement was made, it was redirecting the protected category, but not to the correct page. I need to investigate further but when trying to access your site I now get a “connection has timed out” error.

    Are you having server issues? If you’re unable to resolve that yourself then you will want to contact your web host. Soon as the site is backup I’ll be able to continue troubleshooting on the test site you provided.

    Talk to you soon.

    Cheers,

    Tyler

  • Tyler Postle
    • CGO

    Looks like it was just a temporary issue. I’m able to access it again :slight_smile:

    I tested further and still saw the same issue with site specific plugins deactivated. We’re going to need to do full network wide conflict check. I know you don’t want that since it’s live site, so again if you create a staging site with the issue then that would be much better. I highly recommend always having a staging site that you can run tests.

    If you’re okay with us doing tests on your live site then please send in the FTP via:

    You can send that privately through our contact form: https://premium.wpmudev.org/contact/

    Select “I have a different question” for your topic – this and the subject line ensure that it gets assigned to me.

    Send in:

    Subject: “Attn: Tyler Postle

    -WordPress admin username

    -WordPress admin password

    -login url

    -FTP credentials (host/username/password)

    -link back to this thread for reference

    -any other relevant urls

    **If you keep support access active then no need to send in wp-admin

    This will also allow me to access the debug log as the link you posted keeps crashing my browser and I can’t search it properly. I’ll do my best to ensure I leave the site how I found it. We just need to find what the conflict is so we can reproduce locally.

    Talk to you soon.

    Cheers,

    Tyler

  • Tyler Postle
    • CGO

    Hey Chathura,

    This post here should help: https://premium.wpmudev.org/blog/move-multisite-new-domain/

    Essentially you want to move it to a new domain, but of course still keep your existing site. Then you want to ensure that the cloned site doesn’t use emails of the actual users on your live site, so I’d just delete all the users after you move it.

    Then you will want to hide it from search engines since you don’t want them seeing your staging site. Here are some options to do that: https://blogvault.net/how-to-block-google-from-indexing-your-wordpress-site/

    Checking with your host, as you mentioned, is a good first option as it’s possible they may be able to make a staging area for you :slight_smile:

    Look forward to hearing back!

    Cheers,

    Tyler

  • chathura
    • HummingBird

    I did a thorough plugin conflict test on my live site. As a prof I have attached screenshots as well.

    http://prnt.sc/cix28h

    * only active plugin is wpmu dev dashboard. Later on I deactivated that as well.

    http://prnt.sc/cix2ax

    Only active plugins are directory and membership 2 pro plugin

    URL RESTRICTIONS STILL DIDN’T WORKED!

    * When I network deactivate all plugins, there was a update notification for membership 2 pro. I found it it was coming from free version on wordpress.org

    http://prnt.sc/cix2e4

    http://prnt.sc/cix2hk

    As I have mentioned many times in this thread, this is problem with my server. So, can you please ask someone more knowledgeable (maybe second level support or something) to see what’s going on in my server? If none of the methods works, please provide me a custom solution for url restriction. I’m sure this can be achieved with very little lines of code.

    THIS IS VERY URGENT MATTER TO ME!!!

  • Tyler Postle
    • CGO

    Hey Chathura,

    Are you using Varnish on your server at all? Make sure you try turning it off if you are then see if you still have any issues. It can cause issues like this.

    * When I network deactivate all plugins, there was a update notification for membership 2 pro. I found it it was coming from free version on wordpress.org

    Yes, when our WPMU DEV Dashboard is deactivated you may get update alerts from the free versions on wordpress.org since they have the same folder name as the premium, but don’t update since it will actually be a downgrade in those cases :smiley:

    As I have mentioned many times in this thread, this is problem with my server. So, can you please ask someone more knowledgeable (maybe second level support or something) to see what’s going on in my server?

    I can ask one of our SLS staff to have a look, but keep in mind they aren’t system admins. They have more server knowledge than average of course, but not to the extent of what an actual system admin would have. If it really is a server issue then it may be your host who has to resolve it. We can definitely have a look though, can you send in your cPanel for the tuts site?You can send that privately through our contact form: https://premium.wpmudev.org/contact/

    Select “I have a different question” for your topic – this and the subject line ensure that it gets assigned to me.

    Send in:

    Subject: “Attn: Tyler Postle

    -WordPress admin username

    -WordPress admin password

    -login url

    -cPanel login url

    -cPanel username

    -cPanel password

    -link back to this thread for reference

    -any other relevant urls

    **If you keep support access active then no need to send in wp-admin

    Talk to you soon!

    Cheers,

    Tyler

  • Tyler Postle
    • CGO

    Hey Chathura, thanks for sending that in. It’s currently in the SLS queue. Keep in mind they deal with more advanced issues so replies can take a little longer. I know this is an urgent issue for you but other members can have urgent issues as well so we do need to still work in the order that they come in. I’ll ping the SLS staff now to see if there is any progress :slight_smile:

    Cheers,

    Tyler

  • Tyler Postle
    • CGO

    Hey Chathura,

    Thanks for your patience on this. Ash applied a temporary fix on your site. This was due to a bug involving subdomain multisites. it should be officially resolved in the next update so you don’t need to worry about re-applying the fix :slight_smile:

    The fix Ash applied is in this file:

    /wp-content/plugins/membership/app/rule/url/class-ms-rule-url-model.php

    He added this code around line 59:

    if( is_main_site() ){
    $url = MS_Helper_Utility::get_current_url();
    }
    else
    {
    $url = MS_Helper_Utility::get_current_url();
    $url = str_replace( 'http://tutsdirectory.com', site_url(), $url );
    }

    Replacing this:

    if( is_main_site() ){
    $url = MS_Helper_Utility::get_current_url();

    I’ve attached the patched file in-case you need to re-upload it for any reason.

    Cheers,

    Tyler

  • Alex Stine
    • System Administrator

    Hello chathura

    Hope you are well today and my apology for the delay.

    Since the last time you sent in credentials, has any of them changed? If so, could you please send them again?

    https://premium.wpmudev.org/contact/

    Select “I have a different question” In the subject line include the following text without the quotes that way it’s assigned to me.

    Subject: “Attn: Alex Stine

    In the message body, please include if changed:

    – WordPress admin URL, username, and password. Best to provide credentials for Staging site.

    – cPanel URL, username, or password. FTP works as well.

    Hoping to get this fixed for you soon. As soon as you send in the details, I’ll notify the SLS team.

    Thanks,

    Alex :smiley:

  • Alex Stine
    • System Administrator

    Hello chathura

    Hope you are well today and sorry for the delays.

    The next Membership2Pro update should be coming soon. When it does, you can fix the issue with the below code in functions.php of your theme.

    add_filter( 'ms_rule_url_model_exception_rule', function( $url ) {
       return str_replace( 'http://tutsdirectory.com', site_url(), $url );
    } );

    Until then, please follow these instructions to fix the problem via FTP.

    1. Open your site via FTP and navigate to

    /wp-content/plugins/membership/app/rule/url/class-ms-rule-url-model.php

    2. Download the attached file from the bottom of my reply here.

    3. Unzip the file.

    4. Upload class-ms-rule-url-model.php replacing the previous file.

    Hope this helps. If you need further assistance, please let me know.

    Cheers,

    Alex :smiley:

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.