Skip to content

Instantly share code, notes, and snippets.

Avatar
🌏
No to war

Luke Cavanagh lukecav

🌏
No to war
View GitHub Profile
@lukecav
lukecav / .htaccess
Created Aug 17, 2022
MemberPress plugin rewrite rules
View .htaccess
# BEGIN MemberPress Rules
<IfModule mod_rewrite.c>
RewriteCond %{HTTP_COOKIE} mplk=([a-zA-Z0-9]+)
RewriteCond /var/www/somesite.com/wp-content/uploads/mepr/rules/%1 -f
RewriteRule ^(.*)$ - [L]
RewriteCond %{REQUEST_URI} !^/(wp-admin|wp-includes|wp-content/plugins|wp-content/themes)
RewriteCond %{REQUEST_URI} \.(zip|gz|tar|rar|doc|docx|xls|xlsx|xlsm|pdf|mp4|m4v|mp3|ts|key|m3u8|ZIP|GZ|TAR|RAR|DOC|DOCX|XLS|XLSX|XLSM|PDF|MP4|M4V|MP3|TS|KEY|M3U8)$
RewriteRule . /wp-content/plugins/memberpress/lock.php [L]
@lukecav
lukecav / Command
Last active Aug 17, 2022
Truncate the debug.log file on your WordPress site server
View Command
truncate -s 0 debug.log
@lukecav
lukecav / .htaccess
Created Aug 15, 2022
10Web Booster plugin added .htaccess rules
View .htaccess
# BEGIN Speed Optimizer by 10Web
# The directives (lines) between "BEGIN Speed Optimizer by 10Web" and "END Speed Optimizer by 10Web" are
# dynamically generated, and should only be modified via WordPress filters.
# Any changes to the directives between these markers will be overwritten.
<IfModule mod_rewrite.c>
RewriteEngine On
# Does browser explicitly support webp?
RewriteCond %{HTTP_USER_AGENT} Chrome [OR]
@lukecav
lukecav / functions.php
Created Aug 15, 2022
LiteSpeed Cache plugin bypass CDN in AJAX
View functions.php
defined( 'DOING_AJAX' ) && add_filter( 'litespeed_can_cdn', '__return_false' );
@lukecav
lukecav / Command
Created Aug 15, 2022
LiteSpeed Cache plugin purge from WP-CLI command
View Command
wp litespeed-purge all
@lukecav
lukecav / Command
Last active Aug 15, 2022
LiteSpeed Cache plugin reset all options
View Command
wp litespeed-option reset
@lukecav
lukecav / Links
Created Aug 11, 2022
XAMPP for local WordPress development
View Links
@lukecav
lukecav / Links
Last active Aug 11, 2022
MAMP local WordPress development
View Links
@lukecav
lukecav / Cron events
Created Aug 10, 2022
SiteGround Optimizer plugin cron events
View Cron events
siteground_optimizer_database_optimization_cron
siteground_optimizer_check_assets_dir
@lukecav
lukecav / functions.php
Created Aug 10, 2022
SiteGround Optimizer plugin change the number of URLs that are preheating
View functions.php
add_filter( 'sg_file_caching_preheat_url_limit', 'sgo_preheat_limit' );
function sgo_preheat_limit( $xml_urls ) {
// Define custom limit for XML URL preheat.
$xml_urls = 100;
return $xml_urls;
}