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!

axew3Author 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

  • Allow some multisite illegal username characters
    by pennymachines
    July 4, 2022 3:19 pm
  • axew3Upgrade Time!
    by axew3
    July 1, 2022 9:53 am
  • floxshifuLogin problem
    by floxshifu
    June 19, 2022 4:25 pm

From forums – With text

  • Allow some multisite illegal username characters
    Thanks for the detailed response. Let know where is the point you would see changed (explain the wrong behavior you have ...
    by pennymachines
    July 4, 2022 3:19 pm
  • axew3Upgrade Time!
    Hello dear! Happy that it is, at moment no bugs (but some code line still need to be adjusted and ...
    by axew3
    July 1, 2022 9:53 am

wp w3all Login

Register

  Username

  Password

Remember me



I forgot my password

phpBB online users and stats

Most users ever online was: 640
Registered users: 304
Topics: 782
Posts: 4397
There are 10 guests and 2 users online
Ahrefs [Bot]
Semrush [Bot]

WP login/out

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

Recent Blog Posts

  • The (awesome) iframe template integration using shortcode
  • phpBB WordPress Integration Common Tasks extension
  • phpBB WordPress template integration (iframe v5)
  • [w3allcustomiframe] shortcode how to
  • phpBB WordPress template integration (iframe v4)

Categories

  • General In-Out
  • Joomla!
  • Php tips and hints
  • phpBB
  • Server related
  • w3all plugins
  • WordPress
  • WordPress Ajax Chat integration
  • Wordpress phpBB integration

Tags

  • add
  • ajax
  • alessio
  • alessio nanni
  • another
  • axew3
  • bbcode
  • buddypress
  • comments
  • connection
  • database
  • db
  • default
  • different
  • domain
  • email
  • excerpts
  • external
  • fields
  • how to
  • iframe
  • integration
  • login
  • memberpress google recaptcha
  • nanni
  • notification
  • parser
  • phpbb
  • phpbb32
  • phpbb wordpress template integration
  • pm
  • post
  • posts
  • private message
  • profile
  • profile updates
  • reset
  • shortcode
  • synchronize
  • template
  • template integration
  • transfer
  • users
  • widgets
  • wordpress
  • 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
© 2007 - 2022 - axew3.com Proudly powered by WordPress