💸 Get more for your money each Wednesday with big savings on selected extensions. Shop this week's deals

WooCommerce Wishlists

WooCommerce Wishlists allows guests and customers to create and add products to an unlimited number of Wishlists.

Recaptcha to prevent creation of spam wishlists

My client allows wishlists to be created by anyone (non-registered users and prefers that. However we were getting tons of spam Wishlists. I hacked the Wishlists plugin to add Google Recaptcha on the form handler and that more or less eliminated the problem. I’d love to see this as an option on plugin (now I have to redo the hack every time the plugin updates 🙂

It would simply be an option to add Google Recaptcha and if it’s enabled then this code runs at the top of the create_list() method in the wishlists-request-handler class:

` $recaptcha_url = ‘https://www.google.com/recaptcha/api/siteverify’;
$recaptcha_secret_key = ‘xxxxxxxxxx_grab_this_from_settings_page_xxxxxxxxxx’;

$recaptcha_response = file_get_contents( $recaptcha_url . “?secret=” . $recaptcha_secret_key . “&response=” . $_POST[‘g-recaptcha-response’] . “&remoteip=” . $_SERVER[‘REMOTE_ADDR’] );

$data = json_decode( $recaptcha_response );

if( isset( $data->success ) && $data->success != true ) {

WC_Wishlist_Compatibility::wc_add_notice( __( ‘Make sure you let us know your are not a robot’, ‘wc_wishlist’ ), ‘error’ );
return false;

}
`

There is another part of this that has to happen, of course — the actual placement of the form on the create-list template:

`

`

Alternatively, an action hook at the top of the create_list method would be good enough to allow me to do this without having to hack the plugin. Actually a few more hooks throughout would be great.

Thanks for considering this!!

Author

Current Status

Open

Last updated: November 27, 2018

1 comment

Log in to comment on this feature request.

  1. Bdhi Gerop says:

    Yes its a nice idea and I would like to share some information about https://myuniversalremotecodes.com/how-to-program-a-vizio-universal-remote/ where you will get the complete information about how you can program a vizio universal remote.

Use of your personal data
We and our partners process your personal data (such as browsing data, IP Addresses, cookie information, and other unique identifiers) based on your consent and/or our legitimate interest to optimize our website, marketing activities, and your user experience.