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
// Disable Plugin Automatic Updates | |
add_filter( 'auto_update_plugin', '__return_false' ); | |
// Disable Themes Automatic Updates | |
add_filter( 'auto_update_theme', '__return_false' ); | |
// Disable plugins auto-update UI elements. | |
add_filter( 'plugins_auto_update_enabled', '__return_false' ); |
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
### WordPress | |
## Logs | |
*.log | |
## Uploads | |
wp-content/cache/* | |
wp-content/et-cache/* | |
wp-content/upgrade/ | |
wp-content/uploads/* |
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
##-- Images Double Quote | |
UPDATE `wp_posts` SET post_content = ( Replace (post_content, 'src="http://', 'src="//') ) | |
WHERE Instr(post_content, 'jpeg') > 0 | |
OR Instr(post_content, 'jpg') > 0 | |
OR Instr(post_content, 'gif') > 0 | |
OR Instr(post_content, 'png') > 0; | |
##-- Images Single Quote | |
UPDATE `wp_posts` SET post_content = ( Replace (post_content, "src='http://", "src='//") ) | |
WHERE Instr(post_content, 'jpeg') > 0 |
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
##-- Delete All Transients | |
DELETE FROM `wp_options` WHERE `option_name` LIKE '%_transient_%'; | |
##-- Remove any WooCommerce wc_sessions from your database. | |
DELETE FROM wp_options | |
WHERE option_name LIKE '_wc_session_%' OR option_name LIKE '_wc_session_expires_%'; | |
##-- Remove any transients set by WooCommerce from your database. | |
DELETE FROM wp_options | |
WHERE option_name LIKE '_transient_wc_%' OR option_name LIKE '_transient_timeout_wc_%'; |
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
##-- Show current operations being performed | |
SHOW FULL PROCESSLIST; | |
##-- Check InnoDB status for locks | |
SHOW ENGINE InnoDB STATUS; | |
##-- Check MySQL open tables | |
SHOW OPEN TABLES WHERE In_use > 0; | |
##-- Check pending InnoDB transactions |
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
#Force non-www | |
RewriteCond %{HTTP_HOST} ^www.domain.com [NC] | |
RewriteRule (.*) https://domain.com%{REQUEST_URI} [L,R=301,NC] | |
#Redirect to HTTPS | |
RewriteEngine On | |
RewriteCond %{HTTPS} off | |
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301] | |
# add a trailing slash to /wp-admin |
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
##-- Show Orders Current Postmeta | |
SELECT DISTINCT pm.meta_key FROM wp_postmeta AS pm LEFT JOIN wp_posts AS p ON p.ID = pm.post_id WHERE p.post_type = 'shop_order'; | |
##-- Show Last 20 Orders | |
SELECT SQL_CALC_FOUND_ROWS hush_posts.ID | |
FROM hush_posts | |
WHERE 1=1 | |
AND hush_posts.post_type = 'shop_order' | |
AND ((hush_posts.post_status = 'wc-pending' | |
OR hush_posts.post_status = 'wc-processing' |
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
##-- Show WP autoload options length on wp_options table | |
SELECT option_name, LENGTH(option_value), autoload FROM wp_options ORDER BY autoload DESC, option_name ASC; | |
##-- Display LENGTH of option_value in wp_options table | |
SELECT option_name, LENGTH(option_value), autoload FROM wp_options ORDER BY option_value DESC, option_name ASC; | |
##-- Autoloaded data size, how many entries are in the table, and the first 10 entries by size | |
SELECT 'autoloaded data in KiB' as name, ROUND(SUM(LENGTH(option_value))/ 1024) as value FROM wp_options WHERE autoload='yes' | |
UNION SELECT 'autoloaded data count', count(*) FROM wp_options WHERE autoload='yes' | |
UNION (SELECT option_name, length(option_value) FROM wp_options WHERE autoload='yes' ORDER BY length(option_value) DESC LIMIT 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
$logger = wc_get_logger(); | |
$logger->debug( $VARIABLE_TO_OUTPUT, array( 'source' => 'LOGNAME' ) ); |
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
User-agent: * | |
Disallow: /wp-admin/ | |
Disallow: /*add-to-cart=* | |
Disallow: /cart/ | |
Disallow: /checkout/ | |
Disallow: /my-account/ | |
Allow: /wp-admin/admin-ajax.php |
NewerOlder