Skip to content

Instantly share code, notes, and snippets.

Avatar

Sean D. Conklin seanconklin

View GitHub Profile
View innodb-conversion.sql
SELECT CONCAT( 'ALTER TABLE ', TABLE_NAME, ' ENGINE=InnoDB;' )
FROM INFORMATION_SCHEMA.TABLES
WHERE ENGINE = 'MyISAM'
AND table_schema = 'database-name-here';
View report-post-types.sql
SELECT post_type, count( post_type )
FROM wp_posts
GROUP BY post_type
ORDER BY count( post_type ) DESC
LIMIT 50;
View report-post-meta.sql
SELECT meta_key, count( meta_key )
FROM wp_postmeta
GROUP BY `meta_key`
ORDER BY count( meta_key ) DESC
LIMIT 50;
View report-wp-options.sql
SELECT
'Autoload KB' as name, ROUND( SUM( LENGTH( option_value ) ) / 1024 ) as size, null as autoload
FROM wp_options
WHERE autoload = 'yes'
UNION
SELECT 'Autoload count', count( * ), null as autoload
FROM wp_options
WHERE autoload = 'yes'
UNION (
SELECT option_name, length( option_value ), autoload
@seanconklin
seanconklin / httpd.conf
Last active Oct 12, 2020
Apache WordPress WooCommerce SSL VirtualHost required and optional modules
View httpd.conf
# DEFAULT OFF
#LoadModule mpm_event_module lib/httpd/modules/mod_mpm_event.so
# REQUIRED
LoadModule mpm_prefork_module lib/httpd/modules/mod_mpm_prefork.so
# DEFAULT OFF
#LoadModule mpm_worker_module lib/httpd/modules/mod_mpm_worker.so
# DISABLED
View WooCommerce-product-variation-sample-import.csv
SKU Parent Type Name Regular price Attribute 1 name Attribute 1 value(s) Attribute 1 visible Attribute 1 global
TEST001 variable Product Size S,M,L,XL,2XL 0 1
TEST001-2XL TEST001 variation 9.99 Size 2XL 1 1
TEST001-XL TEST001 variation 9.99 Size XL 1 1
TEST001-L TEST001 variation 9.99 Size L 1 1
TEST001-M TEST001 variation 9.99 Size M 1 1
TEST001-S TEST001 variation 9.99 Size S 1 1
View report-user-meta.sql
SELECT meta_key, count( meta_key )
FROM wp_usermeta
GROUP BY meta_key
ORDER BY count( meta_key ) DESC
LIMIT 50;
View report-older-orders.sql
SELECT * FROM wp_posts
WHERE post_type = 'shop_order'
AND post_status IN( 'wc-cancelled', 'wc-completed', 'wc-failed', 'wc-pending' )
AND post_date < CURDATE() - INTERVAL 100 DAY
ORDER BY ID DESC;