• Resolved MiKemp

    (@mikemp)


    Hi. Just recently the message “You need to login to view this content. Please Login. Not a Member? Join Us” started showing up on a page where it should not. It’s about 1/2 way down the page in the left column. I’d appreciate help figuring this out.

    The page I need help with: [log in to see the link]

Viewing 15 replies - 1 through 15 (of 24 total)
  • Plugin Support mbrsolution

    (@mbrsolution)

    Hi, check the URL above to see if you have added our login shortcode [swpm_login_form] or something similar.

    Kind regards.

    Thread Starter MiKemp

    (@mikemp)

    Thanks for the very quick response, but there are no Simple Membership shortcodes there.
    The content on that page is generated by a Toolset View. Their shortcode is the only element on that page. The Simple Memebership notice seems to be randomly inserted into the middle of their content.
    I do not see the message if I am logged in.
    If I disable SM, the message goes away.

    • This reply was modified 2 years, 4 months ago by MiKemp.
    Plugin Support mbrsolution

    (@mbrsolution)

    Hi,

    The Simple Memebership notice seems to be randomly inserted into the middle of their content.

    I can see the following HTML code inserted in the page in question. This code cannot be inserted unless added by our shortcode or another method. Maybe an addon for SMP.

    <div class="col-sm-6"><div class="swpm-post-not-logged-in-msg">You need to login to view this content. Please <a class="swpm-login-link" href="https://capecodwriterscenter.org/membership-login/">Login</a>. Not a Member? <a href="https://capecodwriterscenter.org/membership-join/">Join Us</a></div></div>

    I do not see the message if I am logged in.

    That is because you belong to the membership level that has access to the content in the page.

    Kind regards.

    Thread Starter MiKemp

    (@mikemp)

    Thanks. We have installed
    – SM After Login Redirections
    – SM Custom Messages
    – SM Google recaptcha
    – SM Social Page Widget & Shortcode
    – SM Simple Membership
    Deactivated each, one at a time, and checked after emptying cache, with hard reload.
    The only plugin that removes the code is SM Simple Membership.
    What else can we try?
    Thank you.

    Plugin Support mbrsolution

    (@mbrsolution)

    Hi, can you test one of WordPress default themes like Twenty Twenty. Let me know what happens.

    Regards.

    Thread Starter MiKemp

    (@mikemp)

    Will do but will have to wait until tomorrow.
    Thanks.

    Plugin Author wp.insider

    (@wpinsider-1)

    Also good to check if there are any page caching happening on the site. A cached page will show a stale page that is not dynamially reflecting what a member should see based on his/her membershpip level access.

    Thread Starter MiKemp

    (@mikemp)

    Thanks.
    Tested with WP 2022 – no change.
    No caching plugins, no host caching.
    And each time a change is made I use Developer Tools to “Empty cache and hard reload.”

    Thread Starter MiKemp

    (@mikemp)

    Is there something else I can do to diagnose this?

    Plugin Support mbrsolution

    (@mbrsolution)

    Hi, can you disable all the SMP addons at the same time. Make sure only SMP is active then check the page in question. Let me know what happens.

    Thank you.

    Thread Starter MiKemp

    (@mikemp)

    Good idea, but no change.
    Disabled all but SMP – see here.

    Plugin Support mbrsolution

    (@mbrsolution)

    Do you know if anyone has hard coded our code into your theme by any chance? What is happening in your site is very unusual to say the least. No one has ever reported this before unfortunately.

    Kind regards.

    Thread Starter MiKemp

    (@mikemp)

    There is a small amount of code in a custom function.php, but that would go away with the theme change, right?
    Other than that, no additional code.

    Plugin Support mbrsolution

    (@mbrsolution)

    Hi, can you share the code added to the functions.php file? Make sure you don’t reveal any personal or private information.

    Regards.

    Thread Starter MiKemp

    (@mikemp)

    The code is below. But:
    – The functions.php code definitely is gone with theme switch, AND
    – The error message remains with theme change (I did not see that last time, but this time tested with WP22 and with the theme that is the parent of active child theme)
    I have not tested for conflicts with other plugins yet.
    Code is this –

    <?php
    
    // Defines
    define( 'FL_CHILD_THEME_DIR', get_stylesheet_directory() );
    define( 'FL_CHILD_THEME_URL', get_stylesheet_directory_uri() );
    
    // Classes
    require_once 'classes/class-fl-child-theme.php';
    
    // Actions
    add_action( 'wp_enqueue_scripts', 'FLChildTheme::enqueue_scripts', 1000 );
    
    // Change excerpt length
    function custom_excerpt_length( $length ) {
      return 20;
    }
    add_filter( 'excerpt_length', 'custom_excerpt_length', 150 );
    
    // Disable Events menu up top
    // show events menu in admin bar only for admins
    if (!current_user_can('manage_options')) {
      define('TRIBE_DISABLE_TOOLBAR_ITEMS', true);
    }
    
    // Remove Toolset admin notices for all users except admin 
    function remove_toolset_notices(){
     
      if ( !current_user_can( 'administrator' ) ) { // test for administrator
        add_action( 'admin_notices', function() {
          remove_action( 'admin_notices', array( 'Toolset_Admin_Notices_Manager', 'show_notices' ) );
        }, -1 );
      }
    }
    add_action( 'init', 'remove_toolset_notices', 10 );
    
    @ini_set( 'upload_max_size' , '64M' );
    @ini_set( 'post_max_size', '64M');
    @ini_set( 'max_execution_time', '300' );
    
    // Add Dashboard widget
    add_action('wp_dashboard_setup', 'my_custom_dashboard_widgets');
     
    function my_custom_dashboard_widgets() {
    global $wp_meta_boxes;
    
    wp_add_dashboard_widget('custom_help_widget', 'Theme Support', 'custom_dashboard_help');
    }
    
    function custom_dashboard_help() {
    echo '<p><strong>Welcome to the "back end" of the website.</strong></p>
    <p>Use the menu on the left to create or edit your Bio, Books or Events.</p>
    <p>Click Dashboard to access the page you are on right now.</p>
    <p>Click xxxxxxx to create or edit your xxxxxxx bio page.</p>
    <p>Click xxxxxxx to add or edit your xxxxxxx.</p>
    <p>Click Events to create and publish an event.</p>
    <p>Members are encouraged to submit approval for RESOURCES and SPEAKERS BUREAU.</p>
    <p>Questions or concerns? Please contact xxxxxxx via email: <a href="mailto:xxxxxxxorg</a></p>
    <p>If you need to change your password, you can do that here: <a href="http://xxxxxxx/">Change password</a></p>';
    }
Viewing 15 replies - 1 through 15 (of 24 total)
  • The topic ‘“Need to login” shows when it shouldn’t’ is closed to new replies.