WordPress – Optimisation

#public_html/.htaccess
<FilesMatch "\.(js|css|jpg|gif|png|pdf|swf|svg|svgz|ico|ttf|ttc|otf|eot|woff|woff2|webp)$">
 <IfModule mod_headers.c>
    ExpiresActive On
    ExpiresDefault  "access plus 1 year"
    Header set Cache-Control "public, immutable, max-age=31536000, s-maxage=31536000"
    Header set Access-Control-Allow-Origin "*"
 </IfModule>
</FilesMatch>

#public_html/wp-content/cache/autoptimize/.htaccess

## Comment out:
#<IfModule mod_expires.c>
#        ExpiresActive On
#        ExpiresByType text/css A30672000
#        ExpiresByType text/javascript A30672000
#        ExpiresByType application/javascript A30672000
#</IfModule>
#<IfModule mod_headers.c>
#    Header append Cache-Control "public, immutable"
#</IfModule>

## Add
<IfModule mod_expires.c>
    ExpiresActive On
    ExpiresByType text/css "access 1 year"
    ExpiresByType text/javascript "access 1 year"
    ExpiresByType application/javascript "access 1 year"
    Header set Cache-Control "public, immutable, max-age=31536000, s-maxage=31536000"
    Header set Access-Control-Allow-Origin "*"
</IfModule>

youtube-dl – Pluralsight

youtube-dl -u "username" \
-p "password" \
-i \
-c \
--no-check-certificate \
--console-title \
--max-sleep-interval 240 \
--min-sleep-interval 180 \
--add-header Referer:"https://app.pluralsight.com/library/" \
-o '%(playlist_title)s/%(chapter_number)s - %(chapter)s/%(playlist_index)s-%(title)s.%(ext)s' \
-f 'best[height<=720]/worst[height>720]' \
--rate-limit 600k \
"https://app.pluralsight.com/library/courses/firebase-functions-fundamentals"

wget – download a wordpress from ftp

wget -c -m --ftp-user='' --ftp-password='' ftp://162.241.248.17/  --exclude-directories=/wp-content/uploads/,/wp-admin/,/wp-includes/ --reject sql

.htaccess – Force https

<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
</IfModule>

WordPress – Package a plugin

# Run at the current directory
find . -type d -exec chmod 755 {} \; && find . -type f -exec chmod 644 {} \; && find . -name '.DS_Store' -type f -delete
# zip it
zip -x '*.git/*' -r updraftplus.2.16.20.24.zip updraftplus