WordPress.org

Ready to get started?Download WordPress

Forums

SI CAPTCHA Anti-Spam
SI CAPTCHA and MU domains (10 posts)

  1. ronnyadsetts
    Member
    Posted 3 years ago #

    Hi,

    The SI CAPTCHA does not work when the "MU domain mapping" plugin is installed and the domain added in the "MU domain mapping" plugin is set to be the main domain.

    http://wordpress.org/extend/plugins/wordpress-mu-domain-mapping/

    We have our blogs at, eg, blogname.example.co.uk. We then map to them using the above plugin at blog.mainsitename.co.uk. Captcha works at blogname.example.co.uk but not at blog.mainsitename.co.uk.

    Is this a known problem and if so is there any way to solve this?

    Thanks.

    Ronny

    http://wordpress.org/extend/plugins/si-captcha-for-wordpress/

  2. Ron Rennick
    MultiSite Guru
    Posted 3 years ago #

    I haven't used SI Captcha & I haven't heard of anyone having that issue. If you can provide more details I might be able to point you in the right direction.

  3. Mike Challis
    Member
    Plugin Author

    Posted 3 years ago #

    A URL to a page with the problem would be helpful.

  4. ronnyadsetts
    Member
    Posted 3 years ago #

    I've set up two test blogs to illustrate the problem. The first is not set up in "MU Domain Mapping", the second is:

    http://test.aiblog.co.uk/
    http://testblog.amazinginternet.com/ (http://test2.aiblog.co.uk/ is the true blog address)

    Posting comments works on the first blog but not on the second. The error given on the failure is:

    "ERROR: Could not read CAPTCHA cookie. Make sure you have cookies enabled and not blocking in your web browser settings. Or another plugin is conflicting. See plugin FAQ."

    Thanks for any pointers that anyone can give on how to resolve this.

    Ronny

  5. ronnyadsetts
    Member
    Posted 3 years ago #

    The following changed fixed the problem for me. Not saying it's correct but it worked for my scenario:

    $ cvs diff -u si-captcha.php
    Index: si-captcha.php
    ===================================================================
    RCS file: /stor/cvsroot/aiblog.co.uk/htdocs/wp-content/plugins/si-captcha-for-wordpress/si-captcha.php,v
    retrieving revision 1.1.1.1
    diff -u -r1.1.1.1 si-captcha.php
    --- si-captcha.php      14 Mar 2011 11:48:14 -0000      1.1.1.1
    +++ si-captcha.php      15 Mar 2011 17:58:34 -0000
    @@ -1337,7 +1337,7 @@
    
       $url  = WP_PLUGIN_URL . $si_dir;
    
    -  if ($site_uri['host'] == $home_uri['host']) {
    +  if ($site_uri['host'] != $home_uri['host']) {
           $url = WP_PLUGIN_URL . $si_dir;
           if ($wpmu == 1)
                $url = get_option('siteurl') . '/' . MUPLUGINDIR . $si_dir;
    @@ -1351,7 +1351,6 @@
       if ( getenv('HTTPS') == 'on' ) {
           $url = preg_replace('|http://|', 'https://', $url);
       }
    -
       return $url;
     }
    
    @@ -1483,4 +1482,4 @@
          register_uninstall_hook(__FILE__, 'si_captcha_unset_options');
     }
    
    -?>
    \ No newline at end of file
    +?>
  6. ronnyadsetts
    Member
    Posted 3 years ago #

    Damn, correction to last. It appeared to fix my test scenario. Problem remains. Sigh. Looking at this again tomorrow after after some sleep.

    Ronny

  7. ronnyadsetts
    Member
    Posted 3 years ago #

    The problem seems to be that the CAPTCHA is being called on the wrong domain when at a domain-mapped blog.

    In the end I've changed the function get_captcha_url_si to return the following which I'll run for a few days to verify it works:

    $url = (is_ssl() ? 'https://' : 'http://') . $current_blog->domain . $current_blog->path . ($wpmu == 1 ? MUPLUGINDIR : PLUGINDIR) . $si_dir;
    
    return $url;

    You need to add $current_blog to the global call at the top of the function too.

    This works for me on both mapped and non-mapped blogs. Couldn't say how it will fare with blogs on a non-root path.

  8. Mike Challis
    Member
    Plugin Author

    Posted 3 years ago #

    I have a standard 1 domain blog.

    I think this code will work. But since I do not have all these variant blogs installed it is hard to test.

    if ( isset( $current_blog ) && !empty( $current_blog->domain ) && !empty( $current_blog->path ) )
        $url = (is_ssl() ? 'https://' : 'http://') . $current_blog->domain . $current_blog->path . ($wpmu == 1 ? MUPLUGINDIR : PLUGINDIR) . $si_dir;
  9. Mike Challis
    Member
    Plugin Author

    Posted 3 years ago #

    I added this code to the trunk download. Hopefully it s correct.

  10. ronnyadsetts
    Member
    Posted 3 years ago #

    Hi Mike.

    I can confirm that your fix works on my set up.

    Ronny

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic