This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Send 429 status for rate limit violations. | |
limit_req_status 429; | |
# Apply to product pages only. | |
location ~ ^/(product|product-category|product-tag)(/|$) { | |
limit_req zone=perip burst=20 nodelay; | |
# Use the same backend hand-off as the default location / | |
proxy_pass $backend_protocol://$backend_host:$backend_port; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Shared per-IP rate limit zone (global). | |
limit_req_zone $binary_remote_addr zone=perip:10m rate=5r/s; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
for i in {1..40}; do | |
curl -s -o /dev/null -w "%{http_code}\n" \ | |
https://www.yourapp.com/product/sample-product-slug/ & | |
done | |
wait |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ sudo nginx-sp -t | |
$ sudo service nginx-sp restart |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
wp user generate --format=ids --count=10 | xargs -d ' ' -I % bash -c 'wp user update % --user_registered="2020-04-02 14:35:02" && wp user meta add % verification_token randomstring1234' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
wp user generate --format=ids --count=10 | xargs -d ' ' -I % wp user meta add % verification_token randomstring1234 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
wp user generate --count=10 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Add text with a link after the LearnDash login modal heading. | |
*/ | |
function kanuka_add_text_after_login_modal_heading() { | |
?> | |
<div class="my-custom-text"> | |
<p>This is some additional text. <a href="https://example.com">Click here</a> for more information.</p> | |
</div> | |
<?php |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Write a log entry. | |
* | |
* Helper function to write a log entry with a given title, category, and any | |
* log data. Relies on the Maintenance Functionality mu-plugin being present. | |
* | |
* Usage: | |
* | |
* kanuka_log( 'Data Import', 'import', array( |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Generate a phone link with an aria-label for accessibility. | |
* | |
* @link https://link.from.pw/3HElEp9 | |
* | |
* @param string $phone The phone number to format. | |
* @param string $class Optional. The CSS class name to add to the link. | |
* | |
* @return string The formatted telephone link. |
NewerOlder