• Resolved Mike Warren

    (@mike-warren-1)


    I have installed the email-subscribers plugin, but get an unexpected error when trying to register via the widget.

    I’ve uncommented the alert(xmlHttp.readyState) and alert(xmlHttp.responseText) lines from the JavaScript files and get a series of message boxes counting from 1 to 4, with blank ones in between. The message boxes just before and after the “4” say “unexpected-error”.

    I have previously used the Subscribe2 plugin without any problems

    I have tried disabling all other plugins, thinking it might be a compatibility problem, but still the error persists.

    I have also installed this plugin on a test site, using the same theme (Suffusion) and the same host (ixWeb), and that one works without problems.

    I really don’t know where to go from here with diagnosing the problem. It’s obviously not a fundamental problem with the plugin, but I need some way of gaining more diagnostic information.

    https://wordpress.org/plugins/email-subscribers/

Viewing 6 replies - 1 through 6 (of 6 total)
  • File : job/es-subscribe.php
    Code :
    if (strpos($_SERVER[‘HTTP_REFERER’], get_option(‘siteurl’)) !== false)
    {
    //Code in this block is required don’t remove.
    }
    else
    {
    echo “unexpected-error”;
    }

    Remove/Comment this IF condition from the file and try again.

    Thread Starter Mike Warren

    (@mike-warren-1)

    Thanks for your reply, Gopi. That indeed fixed the problem, but obviously I’d rather fix it without altering your code if that’s possible.

    Do you have any suggestions for what might be wrong to make that test fail?

    Hi Mike,

    I have little check in that place to confirm emails are submitted from the same URL (For extra security). Your WordPress has been configured different folder structure. Thus your wp variable (siteurl) is different from HTTP_REFERER.

    At present no other solution for this.

    Thread Starter Mike Warren

    (@mike-warren-1)

    I’m not familiar with JavaScript, but I assume strpos looks for the occurrence of the first string in the second.

    In my case, the directory WordPress is installed in is http://mysite.com/site so surely a test for the occurrence of http://mysite.com would return true?

    1. Your wp is configured on this http://mysite.com/site Thus your siteurl is http://mysite.com/site

    2. Your browsing the site on this URL http://mysite.com

    Condition failed, your siteurl (http://mysite.com/site) is not available on actual URL (http://mysite.com)

    Please follow my first solution and let me know if you have any other best solution. Thanks

    Thread Starter Mike Warren

    (@mike-warren-1)

    I’m sure I’m missing something, but won’t this work in both cases if you just reverse the strings?

    if (strpos(get_option(‘siteurl’), $_SERVER[‘HTTP_REFERER’]) !== false)

    Or will that cause other problems?

    ——————————————

    Okay, I just tried it and it doesn’t work, so I’m obviously not understanding how this stuff works.

    I’ll leave the test commented out and continue playing with the plugin.

    Thanks for your help, and thanks for the plugin.

Viewing 6 replies - 1 through 6 (of 6 total)

The topic ‘Unexpected Error’ is closed to new replies.