Subscribe by Email doesn't check if email already exsist

Hi,

The Subscribe by Email plugin doesn't check if the user has already been subscribed. I talked with Michael in the live chat, which could confirm this, and he told me that I should write you here at the forum.

You can check the issue on the provided website by the provided URL in the bottom of the website.

This is a bit urgent!

Sincerely,
Mika

  • Patrick
    • Support Monkey

    Hi there @Mika

    I hope you're well today!

    Yup, that is confirmed on my test site also.

    There is no indication that the email address entered has already been subscribed. The plugin actually displays the message that a confirmation email is on its way, but that email never arrives (presumably because the subscriber is already confirmed).

    I've notified the plugin developer of this issue so he can investigate and release a fix as soon as possible.

    Thanks for bringing this to our attention.

  • Ignacio
    • HummingBird

    Hi @Mika.

    Confirmation emails are not resent to prevent spammers/attackers to send too many emails (you'd just need to resend the form many times with the same email).

    But I guess you need a solution to override this behavior so before releasing a new version I'd like you to test it, would you?

    Attached to this post there's a new version of the plugin (just few minor changes). Just overwrite the current with the attached one.

    After that you'll need make use of a piece of code. The best way for this is to create a new php file (let's say sbe-hooks.php) and upload to wp-content/mu-plugins folder (if it does not exist, create it). MU Plugins are plugins that do not need activation, they are always activated.

    Here's the code:

    <?php
    
    add_filter( 'sbe_force_confirmation_email', 'sbe_hooks_force_confirmation_email_on_front', 10, 2 );
    function sbe_hooks_force_confirmation_email_on_front( $force, $subscriber ) {
    	if ( ! is_admin() )
    		$force = true;
    
    	if ( defined( 'DOING_AJAX' ) && DOING_AJAX && isset( $_REQUEST['action'] ) && $_REQUEST['action']  === 'sbe_widget_subscribe_user' )
    		$force = true;
    
    	return $force;
    }

    Regards.
    Ignacio.

  • Mika
    • The Bug Hunter

    Hey Ignacio.

    I just tested it and it doesn't work on my client website. I have created also added the php file to the MU plugins, but unfortunately it still doesn't work.

    I must mention one thing in connection with the plugin. Although it is a smart plugin, the uninstall.php file, does not help much with manual removal/update of the plugin, since 1) it removes all the info from the database and 2) the translation files are overwritten which means I have to start from scratch every time I update the plugin, unless I keep a copy of the translation files and upload it every time.

    Sincerely,
    Mika

    • Ignacio
      • HummingBird

      Hi @Mika.

      3 things :slight_smile:

      - Have you also updated Subscribe By Email with the attached one? As I read you it seems that you only uploaded the MU Plugin but I attached a new copy of SBE in my previous post.

      - uninstall.php should remove all data in database. Its code is only executed when you delete the plugin from dashboard. See the WP example here: http://codex.wordpress.org/Function_Reference/register_uninstall_hook . It drops a table. When you uninstall a plugin you want usually to clean the database.

      - Translation files: That's what happens with all plugins not only ours but also the free ones in the WP repository. But you may want to know a thing: Upload the languages files to wp-content/languages/plugins folder (if it does not exist, create it). You won't need to reupload the languages files again (just when we add new sentences). Shhh, don't tell anybody!

      Regards.
      Ignacio.

  • Mika
    • The Bug Hunter

    Hey Ignacio.

    1) Yes, I updated and installed everything as you advised. However, it still doesn't work. I have granted you access to the website so you are more than welcome to check it out :slight_smile:

    2. Yes you are right!

    3) Haha. Smart, I just learned something new today :slight_smile:

    Sincerely,
    Mika

  • Mika
    • The Bug Hunter

    Hey Ignacio.

    I just removed the file, however, it is still very generous with the confirmation emails. In other words, the green message about the confirmation email is still shown when I click subscribe.

    Sincerely,
    Mika

  • Mika
    • The Bug Hunter

    Ignacio,

    The plugin has been setup correctly and the STMP has also been setup successfully (the test email goes through), so I do believe there is an issue with the plugin.

    You have full access to the website. Could you please take a full look at what is happening so we can get it working as soon as possible :slight_smile:

    Thanks a lot!
    Sincerely,
    Mika

  • Ignacio
    • HummingBird

    Hi @Mika.

    This is weird. I have tried to send to myself the test email and is also not working (with three different emails). Could you please download the plugin again from here https://premium.wpmudev.org/project/subscribe-by-email/ ? We'll go back to the real version instead of the one that I attached and test again. If this does not work, then there must be a problem in your server becaus the plugin is working fine for the rest of the users.

    Pleas, bear in mind that is weekend and I'm not at 100%.

    Regards.
    Ignacio.

  • Mika
    • The Bug Hunter

    Hey Ignacio.

    Thanks for your reply.

    Alrighty, I have changed the SMTP plugin to another, and now emails are coming through. Strangely enough. However, the issue persist so the user still can add their email a second time and stil get the "A confirmation emails is on its way).

    By the way, I also downloaded and uploaded the original Subscribe by Email plugin as advised :slight_smile:

    Sincerely,
    Mika

  • Ash
    • WordPress Hacker

    Hello @Mika and @Ignacio

    Just adding what I got in testing, an user can enter same email multiple times, and yes he saw the confirmation email text too. But the email is added once. When the same email is entered 2nd times, it doesn't add the email 2nd time though.

    Cheers
    Ash

  • Mika
    • The Bug Hunter

    Hey Ash.

    Good to hear from you.

    Yes, I totally agree. I did the same observation, however, it does seem a bit odd that there currently isn't an error message if the user already is registered. :slight_smile:

    Sincerely,
    Mika

  • Ignacio
    • HummingBird

    Hi @Mika.

    What the MU plugin was supposed to do is not change the message in the widget/shortcode but if a user subscribe twice, the confirmation email is sent again. Just upload again the MU Plugin and the SBE version I attached above and test again.

    Changin the message is harder right now and it would need more time, I just came up with a quick solution. There will be changes in the widget/shortcode in following versions.

  • Mika
    • The Bug Hunter

    Hey Ignacio.

    Thanks for your reply.

    You write "but if a user subscribe twice, the confirmation email is sent again. " Did you mean "but if a user subscribe twice, the confirmation is not email is sent again. "?

    Sincerely,
    Mika

  • Ignacio
    • HummingBird

    I don't know if I get you but this is the process:

    If a user tries to subscribe and is already subscribed but not confirmed, he'll get another confirmation email.

    If a user tries to subscribe and is confirmed, he will not get anything.

    Both will get the same message in the widget.

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.