-
Notifications
You must be signed in to change notification settings - Fork 136
Feature/account security #2677
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: dev
Are you sure you want to change the base?
Feature/account security #2677
Conversation
includes/llms.spam.functions.php
Outdated
|
||
// Remove old items. | ||
$new_activity = []; | ||
$now = current_time( 'timestamp', true ); // UTC |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
current_time( 'timestamp' )
isn't recommended since WP 5.3 https://make.wordpress.org/core/2019/09/23/date-time-improvements-wp-5-3/
includes/llms.spam.functions.php
Outdated
$now = current_time( 'timestamp', true ); // UTC | ||
foreach( $activity as $item ) { | ||
// Determine whether this item is recent enough to include. | ||
if ( $item > $now-( LLMS_SPAM_ACTION_TIME_LIMIT ) ) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wrap in absint()
in case the constant is defined incorrectly
if ( count( $activity ) > LLMS_SPAM_ACTION_NUM_LIMIT ) { | ||
rsort( $activity ); | ||
$activity = array_slice( $activity, 0, LLMS_SPAM_ACTION_NUM_LIMIT ); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add absint()
around the constants
includes/llms.spam.functions.php
Outdated
|
||
$ip = preg_replace( '/[^0-9a-fA-F:., ]/', '', $ip ); | ||
$transient_key = 'llms_spam_activity_' . $ip; | ||
$activity = get_transient( $transient_key ); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure if it's an issue using transients when they can be deleted at any time? It does allow us to use the WP system of tracking the temporary data without making our own table etc.
…d key if preferred.
Description
We are going to add some spam/security features:
[x] IP Block at checkout if there are more than 10 failures within 15 minutes.
[ ] Built in support for captcha's like recaptcha and turnstile.
[ ] Built in integration with Akismet to check emails at checkout/registration.
How has this been tested?
Screenshots
Types of changes
Checklist: