Skip to content

Instantly share code, notes, and snippets.

@szepeviktor
Last active May 25, 2026 16:01
Show Gist options
  • Select an option

  • Save szepeviktor/76d0999f2283a34ea102b260cefb11b6 to your computer and use it in GitHub Desktop.

Select an option

Save szepeviktor/76d0999f2283a34ea102b260cefb11b6 to your computer and use it in GitHub Desktop.
Make a slow WordPress site fast!

WordPress Performance

Debugging theory: https://github.com/szepeviktor/debug-wordpress

@szepeviktor

Copy link
Copy Markdown
Author

Canonical redirect

# BEGIN Canonical redirect
RewriteEngine On
RewriteCond %{HTTPS} !=on [OR]
RewriteCond %{HTTP_HOST} !=example.com
RewriteRule ^ https://example.com%{REQUEST_URI} [L,R=301]
# END Canonical redirect

@szepeviktor

szepeviktor commented May 21, 2026

Copy link
Copy Markdown
Author
# Bot attacks
zgrep -vE '"GET /(wp-includes|wp-content|wp-admin/js)/\S+\.\S+ HTTP/' ~/access-logs/example.com-ssl_log|cut -d' ' -f4|cut -d: -f1-3|sort|uniq -c|sort -n
zgrep -vE '"GET /(wp-includes|wp-content|wp-admin/js)/\S+\.\S+ HTTP/' ~/logs/example.com-ssl_log-May-2026.gz|cut -d' ' -f4|cut -d: -f1-3|sort|uniq -c|sort -n

# WooCommerce logs and fatal errors
zgrep '" 500 ' ~/access-logs/example.com-ssl_log
ls -l public_html/wp-content/uploads/wc-logs/*$(date +%F)*

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment