• zimbo000

    (@zimbo000)


    All other status messages are shown OK, e.g. “A confirmation message is on its way!”, “That email address is not subscribed.”

    When a new subscriber clicks on the email confirmation link the user is redirected to the subscribe page with the shortcode but the page displays as standard, e.g. with an empty input box and subscribe buttons. The “success” message is not shown.

    The new user is however correctly added to Subscribe2 and they receive ‘new post’ emails.

    After much digging around I have found that the problem is caused by a plugin conflict with Jetpack, and specifically the Publicize and Sharing modules. If either is active, the Subscribe2 “success” message is not displayed. Deactivate them and the “success” message for Subscribe2 is displayed when clicking to confirm.

    [I deactivated all plugins on the site and switched on one at a time – it’s only Jetpack that is conflicting with Subscribe2. Some other activated Jetpack modules do not affect Subscribe2 but the site doesn’t use every Jetpack module – two that definitely cause a problem are Publicize and Sharing, but others I don’t use might.]

    The subscribe page is here: Subscribe to the Herald The Jetpack modules are active so the problem can be seen live – try adding yourself as a new subscriber to see ‘no message’; and then subscribe again to see a valid message.

    The site theme is inFocus but I have tried Twenty Fourteen and the same problem exists, so it’s not a theme issue.

    In posts such as https://www.ads-software.com/support/topic/plugin-subscribe2-successful-subscription-message-doesnt-display?replies=13 and https://www.ads-software.com/support/topic/plugin-subscribe2-confirmation-link-sending-to-subscription-form?replies=7 you identified potential solutions to similar confirmation problems.

    Please could you have a look and suggest a solution or workaround for this problem?

    As Jetpack is one of the best known plugins, I could also raise the issue with Jetpack if you think (and can identify what) they are doing something wrong.

    PS. This is kind of related to this post https://www.ads-software.com/support/topic/not-able-to-redirect-to-home-page-1?replies=7 but having narrowed down the numerous discussion elements in that thread and identified the root problem, I thought it best to post a new distinct issue.

    https://www.ads-software.com/plugins/subscribe2/

Viewing 15 replies - 1 through 15 (of 26 total)
  • @zimbo000

    Thanks for the thorough report. I’ll see if I can code a way around this – I have previously had to implement some code to ensure Subscribe2 continues to work with Jetpack. Looks like I’ve got to do that again ??

    @zimbo000

    This code is untested but might be worth trying. In the class-s2-core.php file in the classes folder of subscribe2 add this function somewhere:

    function s2_hide_jetpack_social( $modules ) {
    	unset( $modules['publicize'] );
    	unset( $modules['sharedaddy'] );
    	return $modules;
    }

    Then find these lines:

    if ( isset( $_GET['s2'] ) ) {
    	// someone is confirming a request
    	if ( defined( 'DOING_S2_CONFIRM' ) && DOING_S2_CONFIRM ) { return; }
    	define( 'DOING_S2_CONFIRM', true );

    Add this line immedicately after the above:
    add_filter( 'jetpack_get_available_modules', array( &$this, 's2_hide_jetpack_social' ) );

    Does that help?

    Thread Starter zimbo000

    (@zimbo000)

    Yeah, sorry for the lengthy post but I tried to cover everything!

    Don’t know if it helps but modules Enhanced Distribution and WordPress.com Stats do not cause a problem.

    The Pubicize module is activated but not ‘connected’ to any social media because the site I referenced is a test/dev site where I’m testing Subscribe2 for use on a client’s live news site (they might go for the HTML version if you can fix this) and Pubicize is crucial on the live site for automatic social sharing of new posts.

    Hope you can fix it… ??

    Thread Starter zimbo000

    (@zimbo000)

    Sorry, I was replying and got distracted then missed your post.

    Code didn’t work, multiple errors on the subscribe page after clicking on the confirm email, use this link, I’ve toggled the address to “new” so it should work: https://dev.henleyherald.com/?s2=18cfaf9d36bc4ef6a0d6f35919d3fa51f19

    Just to confirm, the new code block is:

    if ( isset( $_GET['s2'] ) ) {
            // someone is confirming a request
            if ( defined('DOING_S2_CONFIRM') && DOING_S2_CONFIRM ) { return; }
    	define( 'DOING_S2_CONFIRM', true );
    	add_filter( 'jetpack_get_available_modules', array( &$this, 's2_hide_jetpack_social' ) );
    	add_filter('request', array(&$this, 'query_filter'));
    	add_filter('the_title', array(&$this, 'title_filter'));
    	add_filter('the_content', array(&$this, 'confirm'));
    			}

    and I added the function right at the end.

    @zimbo000

    I think you’ve put the new function outside the class. Move it up a little in the file.

    Thread Starter zimbo000

    (@zimbo000)

    Sorry, I did put it outside. I’ve moved it now and the errors have gone but it has not solved the problem, the “success” page is the standard subscribe page. Here’s another confirmation link:

    https://dev.henleyherald.com/?s2=18cfaf9d36bc4ef6a0d6f35919d3fa51f22

    @zimbo000

    Hmm, this is getting more and more puzzling. Try this, in the class-s2-frontend.php file you’ll find this line twice:
    $this->filtered = 1;

    Comment it out for now like this:
    //$this->filtered = 1;

    Does that make any difference?

    Thread Starter zimbo000

    (@zimbo000)

    There’s four instances, lines 165, 183, 302, 326 so I did them all… and it worked!

    Do I need to do all four lines or just a couple of them?

    Could I put the s2_hide_jetpack_social function in my child theme functions.php?

    @zimbo000

    Let me do some more checking now. Are your reining the SEO plugin from Yoast?

    Thread Starter zimbo000

    (@zimbo000)

    @mattyrob

    “reining”?

    Don’t use Yoast, inFocus has its own built-in SEO functions. You can set site-wide settings e.g. Page Title Format = %page_title% News from the %blog_title%, Henley on Thames, plus override the title and description on an individual page or post.

    Putting the s2_hide_jetpack_social function into my child theme functions.php does not work, it generates errors as per when I put the function in the wrong place.

    Thread Starter zimbo000

    (@zimbo000)

    I just found something else.

    If I register as a public subscriber all is OK. If I then go back to the subscribe page (https://dev.henleyherald.com/subscribe-to-the-herald/), enter that email address and click Unsubscribe, then I get an email with a “request to unsubscribe” message and link, but when I click on the link and get taken back to the subscribe page, this message is displayed:

    “No such email address is registered.”

    But the user is removed from the Subscribe2 > Public Subscribers section, so clicking the unsubscribe request link worked at the ‘server’ end but the user gets the wrong message. Not sure if this is related to the issue we’re looking at here, or if it’s another problem.

    Here’s a link for you to see for yourself (this is the “confirm unsubscribe link” from the email, the user is still registered):
    https://dev.henleyherald.com/?s2=08cfaf9d36bc4ef6a0d6f35919d3fa51f26

    @zimbo000

    I know what is happening but not exactly why as yet – although I suspect this is a plugin conflict somewhere.

    Basically, the $this->filtered variable is there with the aim of ensuring that Subscribe2 is only called once when a user joins or leaves. At the moment on your site, for some reason, the filter code is being called once before the page loads and then again at the time the page is actually created for your user.

    I think we need to look for another conflict beyond Jetpack.

    “reining” should have been ‘using’!

    Thread Starter zimbo000

    (@zimbo000)

    @mattyrob

    Just to be certain of my initial testing, I’ve just re-done this:

    1. Reverted to the standard Subscribe2 code i.e. removed additions above
    2. Turned off all plugins except Subscribe2 – add a new user, “success” confirmation is displayed
    3. Turned on all plugins except Jetpack – add a new user, confirmation is successful as #2
    4. Turn on Jetpack – add a new user, confirmation fails, ‘standard’ subscribe page displayed but user added as a subscriber

    @zimbo000

    I installed Jetpack on my localhost development site (feel quite dirty now and in need of a shower!).

    Anyway, I think this is to do with the Site Icon module, not Sharing or Publicise.

    Earlier where we created that new function for inside the class file try this:

    function s2_hide_jetpack_social( $modules ) {
    	unset( $modules['site-icon'] );
    	return $modules;
    }

    I tested and it works for me.

    Thread Starter zimbo000

    (@zimbo000)

    @mattyrob

    Strange, as I don’t use Site Icon, or at least it’s not activated.

    Do I need to keep all four of the this->filtered = 1; lines commented out in frontend?

    Anyway, it appears to work for the subscription confirmation but I’m still getting the wrong message displayed on Unsubscribe (“No such email address is registered.”), but the user’s deleted in admin, as explained in post #12 above.

    Here’s a new unsubscribe link for you to see for yourself:

    https://dev.henleyherald.com/?s2=08cfaf9d36bc4ef6a0d6f35919d3fa51f35

Viewing 15 replies - 1 through 15 (of 26 total)
  • The topic ‘'You have successfully subscribed!' message not displayed – plugin conflict’ is closed to new replies.