Skip to content

axew3.com

Php MySQL Javascript

  • Home
  • Forum
  • Free plugins
  • Supported plugins and Contact
    • WP_w3 VTP plugin: Video Killed the WordPress Star!
    • WPD – w3all WordPress Dropbox plugin
    • Contact Alessio Nanni

Tag: memberpress google recaptcha

Add google recaptcha to memberpress login page

I’ve come across to a problem for a site i’m following: they use memberpress login page, that unfortunately present a lack about brute force attacks: there is no way to add a google recaptcha so easily …
Since i had to resolve in short this issue, and since i use a simple google recaptcha plugin here at axew3.com to prevent robot’s fake registrations, i edited the code just a little two lines making it work also into memberpress. The explained trick could be easily done using any other recaptcha plugin, but this 156 lines plugin, can also be easily hacked for our scope and will do the simple dirty job as smooth, working fine example.

Download this plugin and install and configure it (or as you like, may download the plugin, apply modifications as below indicated, then upload into your plugin directory and install):
Simple Google reCAPTCHA

open the file

/wp-content/plugins/simple-google-recaptcha/simple-google-recaptcha.php

on it search for this line:

1
function sgr_check() {

just after add the follow:

1
2
3
if( isset($_REQUEST['mepr_process_login_form']) && isset($_REQUEST['mepr_is_login_page']) ){
sgr_verify($_REQUEST);
}

then search for:

1
add_action("init", "sgr_check");

change into:

1
add_action("init", "sgr_check", 9);

save and replace.

Now open:
/wp-content/plugins/memberpress/app/views/login/form.php
and immediately after this:

1
2
3
4
  <div>
        <label><input name="rememberme" type="checkbox" id="rememberme" value="forever"<?php checked(isset($_REQUEST['rememberme'])); ?> /> <?php _ex('Remember Me', 'ui', 'memberpress'); ?></label>
      </div>
      <div class="mp-spacer">&nbsp;</div>

add the follow (note that the code could be added wherever you want, but before the closing </form> tag):

1
<div class="sgr-recaptcha"></div>

Save and replace. If there is some payment/subscription process using same page to access (for example) a payment renew, then may something else need to be added to prevent action to fire when not needed.

Cheers to all lovely and cool people!

Author axew3Posted on November 13, 2018January 4, 2019Categories WordPressTags how to, memberpress, memberpress google recaptcha, memberpress login recaptcha8 Comments on Add google recaptcha to memberpress login page

From Forums – Links mode

  • Many says Signal, many says Telegram: it's better to say Element
    by axew3 at 09:58 2021-01-19
  • Crayon Syntax Highlighter for Classic editor OR Gutenberg
    by axew3 at 12:05 2021-01-17
  • How to jump to #unread anchor - phpBB iframe js code
    by axew3 at 12:02 2021-01-17

From Forums – Post text

  • Many says Signal, many says Telegram: it's better to say Element
    It is your conversation. Own it! A part of the Matrix ecosystem. Matrix is an open network for secure, decentralised communication, connecting 20M+ users over 45K+ deployments. Governed by The Matrix.org Foundation, ...
    by axew3 at 09:58 2021-01-19
  • Crayon Syntax Highlighter for Classic editor OR Gutenberg
    Patched files: crayon-syntax-highlighter/crayon_formatter.class.php crayon-syntax-highlighter/crayon_parser.class.php crayon-syntax-highlighter/crayon_langs.class.php crayon-syntax-highlighter/util/crayon_util.class.php crayon-syntax-highlighter/langs/default/default.txt (so now default fully works without errors, maybe for some config still some fix is required?) crayon-syntax-highlighter/langs/yaml/yaml.txt others questions i have not well understand the meaning maybe, anyway: It is ...
    by axew3 at 12:05 2021-01-17

wp w3all Login

Register

Username

Password

Remember me



I forgot my password

WP login/out

  • Register
  • Log in
  • Entries feed
  • Comments feed
  • WordPress.org

Recent Blog Posts

  • WP W3ALL 2.4.0> phpBB to WordPress
  • phpBB WordPress template integration (iframe v5)
  • [w3allcustomiframe] shortcode how to
  • phpBB WordPress template integration (iframe v4)
  • Shortcode: phpBB PM into WordPress

Categories

  • General In-Out
  • Joomla!
  • Php tips and hints
  • phpBB
  • Server related
  • w3all plugins
  • WordPress
  • WordPress Ajax Chat integration
  • Wordpress phpBB integration
  • Home
  • Forum
  • Free plugins
  • Supported plugins and Contact
    • WP_w3 VTP plugin: Video Killed the WordPress Star!
    • WPD – w3all WordPress Dropbox plugin
    • Contact Alessio Nanni
axew3.com Proudly powered by WordPress