• Hi!
    I’m having a problem using Really Simple Captcha on WP Members. The plugin seems to use a tmp folder inside the plugin folder itself for storing the captacha images, ex: wp-content/plugins/really-simple-captcha/tmp this a restricted folder on my hosting provider (Pantheon), so the plugin is not working.

    Now, reading RSC documentation, there is no magic constant to change this, BUT, the temporary folder can be changed by the plugin that make use of the library, WP-Members in this case.

    So, has WP-Members a constant or a way to define the temporary folder for RSC?
    Thanks!

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author Chad Butler

    (@cbutlerjr)

    You can use the WPCF7_CAPTCHA_TMP_DIR in RS Captcha to define a different temp directory. (see: https://contactform7.com/captcha/)

    If you do, then use the WP-Members filter hook wpmem_rs_captcha_folder to change the location WP-Members is looking for the image.

    add_filter( 'wpmem_rs_captcha_folder', function( $tmp ) {
         return get_home_url( '/url/path/to/your/really-simple-captcha/tmp/' );
    });
    Thread Starter druellan

    (@druellan)

    Thanks Chad. I tested that, but that solution is for Contact Form 7. There is no mention of that constant on the RS Captcha code. RSC seems to use a public variable to handle the temp folder. Perhaps I’m reading it wrong, but I think that folder must be changed after the initialization. I solved the problem adding this line to the file class-wp-members-captcha.php around line 191.

    if ( defined('WPCF7_CAPTCHA_TMP_DIR') ) $rs_captcha->tmp_dir = WPCF7_CAPTCHA_TMP_DIR;

    Perhaps a more elegant way might be to have a new field on the RC Captcha options page, so you can define the folder via CMS?

    Thanks again.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘To change Really Simple Captcha temp folder’ is closed to new replies.