This file contains 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
//* http://gasolicious.com/remove-tabs-keep-product-description-woocommerce/ | |
// Location: add to functions.php | |
// Output: removes woocommerce tabs | |
remove_action( 'woocommerce_after_single_product_summary', 'woocommerce_output_product_data_tabs', 10 ); |
This file contains 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
Enabling mod_expires | |
a2enmod expires | |
Configuring mod_expires | |
If you have multiple file types that should expire after the same time after they have been accessed (let's say in one week), | |
you can use a combination of the FilesMatch and the ExpiresDefault directives, e.g. as follows: | |
<IfModule mod_expires.c> |
This file contains 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 | |
require dirname(__FILE__).'/wp-blog-header.php'; | |
$wpdb->query("DELETE FROM wp_terms WHERE term_id IN (SELECT term_id FROM wp_term_taxonomy WHERE taxonomy LIKE 'pa_%')"); | |
$wpdb->query("DELETE FROM wp_term_taxonomy WHERE taxonomy LIKE 'pa_%'"); | |
$wpdb->query("DELETE FROM wp_term_relationships WHERE term_taxonomy_id not IN (SELECT term_taxonomy_id FROM wp_term_taxonomy)"); | |
$wpdb->query("DELETE FROM wp_term_relationships WHERE object_id IN (SELECT ID FROM wp_posts WHERE post_type IN ('product','product_variation'))"); | |
$wpdb->query("DELETE FROM wp_postmeta WHERE post_id IN (SELECT ID FROM wp_posts WHERE post_type IN ('product','product_variation'))"); | |
$wpdb->query("DELETE FROM wp_posts WHERE post_type IN ('product','product_variation')"); |
This file contains 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
Export | |
mysqldump -u user -pupasswd my-database | gzip -c > dbfile.sql.gz | |
Multiple parts: | |
mysqldump -u user -pupasswd my-database | gzip -c > one.gz; gzip -c one.gz > two.gz; gzip -c two.gz > three.gz | |
Import | |
zcat /path/to/file.sql.gz | mysql -u 'root' -p your_database |
This file contains 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
Apache2Buddy is a great tool that checks your server setup and performance and makes a report and suggestions based on the information it collects. It calculates the MaxRequestWorkers on remaining RAM, not total installed RAM. | |
curl -sL https://raw.githubusercontent.com/richardforth/apache2buddy/master/apache2buddy.pl | perl |
This file contains 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 tasksel install lamp-server | |
MySQL Secure Installation: | |
mysql_secure_installation | |
Firewall Configuration: | |
Enable firewall: | |
$ sudo ufw enable |
This file contains 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 git clone https://github.com/letsencrypt/letsencrypt /opt/letsencrypt | |
- cd /opt/letsencrypt | |
- Cert Only: sudo -H ./letsencrypt-auto certonly --standalone -d example.com -d www.example.com | |
- Auto config: sudo -H ./letsencrypt-auto -d example.com -d www.example.com | |
Check Certificate Domains | |
- sudo ls /etc/letsencrypt/live | |
- ./certbot-auto certificates | |
This file contains 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
ALTER USER 'root'@'localhost' IDENTIFIED with mysql_native_password; | |
ALTER USER 'root'@'localhost' IDENTIFIED BY 'password'; | |
FLUSH PRIVILEGES; |
This file contains 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
# First: | |
DELETE FROM wp_postmeta | |
WHERE post_id IN | |
( | |
SELECT id | |
FROM wp_posts | |
WHERE post_type = 'attachment' | |
) | |
; |