Changeset 3128164
- Timestamp:
- 07/30/2024 01:11:43 PM (20 months ago)
- Location:
- block-specific-spam-woo-orders
- Files:
-
- 3 added
- 2 edited
-
tags/0.76 (added)
-
tags/0.76/readme.txt (added)
-
tags/0.76/woo-block-spam-orders.php (added)
-
trunk/readme.txt (modified) (3 diffs)
-
trunk/woo-block-spam-orders.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
block-specific-spam-woo-orders/trunk/readme.txt
r3090692 r3128164 1 === Block Specific Spam Woo Orders===1 === Plugin Name === 2 2 Contributors: wigster 3 Tags: woocommerce, woo,block,spam,orders3 Tags: woocommerce, woo, block, spam, orders 4 4 Requires at least: 5.1 5 Tested up to: 6. 5.25 Tested up to: 6.6.1 6 6 Requires PHP: 5.4 7 Stable tag: 0.7 57 Stable tag: 0.76 8 8 License: GPLv2 or later 9 9 License URI: http://www.gnu.org/licenses/gpl-2.0.html … … 14 14 15 15 This plugin prevents a specific set of WooCommerce fake/spam orders. 16 Simply install and activate the plugin ,there are no settings or tweaks to be made.16 Simply install and activate the plugin; there are no settings or tweaks to be made. 17 17 The plugin extends WooCommerce's built-in checkout validations to check for a specific set of known spam email accounts and names. If triggered, the spam bot simply cannot checkout and importantly does not get to the account creation stage. 18 The names/emails it checks for are only used by spam bots, so there is no need to worry about false positives. 19 20 If you've found this plugin useful, you can support my work by buying me a coffee at: 21 [Buy Me a Coffee](https://buymeacoffee.com/alexwigmore). 18 The names/emails it checks for would only be used by spam bots, so there is no need to worry about false positives. 22 19 23 20 == Frequently Asked Questions == … … 28 25 == Changelog == 29 26 27 = 0.76 = 28 * Tested compatibility with WP 6.6.1 and WC 9+ 29 * Added confirmation that this plugin is compliant with the new WooCommerce HPOS (High-Performance Order Storage) / Custom Order Tables (COT) systems. 30 30 31 = 0.75 = 31 * Tested Compatibility with WP 6.5.2 +WC32 * Tested compatibility with WP 6.5.2 and WC 32 33 33 34 = 0.7 = 34 * Update logic slightly to simplify checks. Names are now also array-based if people wantedto manually extend.35 * Added ability to translate/localize the Spam Validation message with typical language translators (WPML etc).36 * Confirm ing support with WP 6.4 and Latest WooCommerce35 * Updated logic slightly to simplify checks. Names are now also array-based if people want to manually extend. 36 * Added ability to translate/localize the Spam Validation message with typical language translators (WPML, etc.). 37 * Confirmed support with WP 6.4 and the latest WooCommerce 37 38 38 39 = 0.6 = 39 40 * Added a new function to handle checking against multiple blocked domains, now including ["@fakemail"] 40 * Confirm ing support with WP 6.1 and Latest WooCommerce41 * Confirmed support with WP 6.1 and the latest WooCommerce 41 42 42 43 = 0.55 = 43 * Tested support with WP 6.0 and latest WC - works fine.44 * Tested support with WP 6.0 and the latest WC - works fine. 44 45 45 46 = 0.54 = 46 * Updat ingsupported versions for WP and WooCommerce47 * Updated supported versions for WP and WooCommerce 47 48 48 49 = 0.53 = 49 * Add ingsupport for readme.txt changelogs.50 * Added support for readme.txt changelogs. 50 51 51 52 = 0.52 = 52 * Updat ingsupport for WooCommerce - no code changes, minor updates to comment wording.53 * Updated support for WooCommerce - no code changes, minor updates to comment wording. 53 54 54 55 = 0.51 = -
block-specific-spam-woo-orders/trunk/woo-block-spam-orders.php
r3081329 r3128164 6 6 * Description: A quick plugin to block on-going issues with spam WooCommerce orders November 2020 7 7 * Author: guwii 8 * Version: 0.7 58 * Version: 0.76 9 9 * Author URI: https://guwii.com 10 10 * License: GPL3+ 11 11 * Text Domain: guwii-woo-block-spam-orders 12 12 * WC requires at least: 4.3 13 * WC tested up to: 8.8.313 * WC tested up to: 9.1.4 14 14 */ 15 15 16 16 // Only use this plugin if WooCommerce is active 17 17 if (in_array('woocommerce/woocommerce.php', get_option('active_plugins'))) { 18 // Add our custom checks to the built in WooCommerce checkout validation: 18 19 // Add our custom checks to the built-in WooCommerce checkout validation: 19 20 add_action('woocommerce_after_checkout_validation', 'action_woocommerce_validate_spam_checkout', 10, 2); 20 21 … … 34 35 $is_a_spam_order = false; 35 36 36 // Compare user s email domain with our list of blocked email domains:37 // Compare user's email domain with our list of blocked email domains: 37 38 foreach ($blocked_email_domains as $blocked_email_domain) { 38 // If a blocked email domain exists in the user s billing email, return spam=true;39 // If a blocked email domain exists in the user's billing email, return spam=true; 39 40 if (strpos($billing_email, $blocked_email_domain) !== false) { 40 41 $is_a_spam_order = true; 42 break; // No need to check further if one match is found 41 43 } 42 44 } 43 foreach ($blocked_names as $blocked_name) { 44 // If a blocked Name exists in the users billing first name, return spam=true; 45 if (strpos($billing_first_name, $blocked_name) !== false) { 46 $is_a_spam_order = true; 45 46 // If not spam by email, check names 47 if (!$is_a_spam_order) { 48 foreach ($blocked_names as $blocked_name) { 49 // If a blocked Name exists in the user's billing first name, return spam=true; 50 if (strpos($billing_first_name, $blocked_name) !== false) { 51 $is_a_spam_order = true; 52 break; // No need to check further if one match is found 53 } 47 54 } 48 55 } 56 49 57 return $is_a_spam_order; 50 58 } 51 // Run the customers name & billing email through our func, report "Spam" if true: 59 60 // Run the customer's name & billing email through our func, report "Spam" if true: 52 61 function action_woocommerce_validate_spam_checkout($fields, $errors) 53 62 { 54 if ( (bssorders_is_a_spam_order($fields) == true)) {63 if (bssorders_is_a_spam_order($fields)) { 55 64 $errors->add('validation', __('Spam.', 'guwii-woo-block-spam-orders')); 56 65 } 57 66 } 67 68 // Optional: Indicate HPOS compatibility 69 add_action('before_woocommerce_init', function () { 70 if (class_exists('\Automattic\WooCommerce\Utilities\FeaturesUtil')) { 71 \Automattic\WooCommerce\Utilities\FeaturesUtil::declare_compatibility('custom_order_tables', __FILE__, true); 72 } 73 }); 58 74 }
Note: See TracChangeset
for help on using the changeset viewer.