Skip to content

Instantly share code, notes, and snippets.

View seanconklin's full-sized avatar

Sean D. Conklin seanconklin

View GitHub Profile
SELECT CONCAT( 'ALTER TABLE ', TABLE_NAME, ' ENGINE=InnoDB;' )
FROM INFORMATION_SCHEMA.TABLES
WHERE ENGINE = 'MyISAM'
AND table_schema = 'database-name-here';
SELECT post_type, count( post_type )
FROM wp_posts
GROUP BY post_type
ORDER BY count( post_type ) DESC
LIMIT 50;
SELECT meta_key, count( meta_key )
FROM wp_postmeta
GROUP BY `meta_key`
ORDER BY count( meta_key ) DESC
LIMIT 50;
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 October 12, 2020 04:39
Apache WordPress WooCommerce SSL VirtualHost required and optional modules
# 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
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
SELECT meta_key, count( meta_key )
FROM wp_usermeta
GROUP BY meta_key
ORDER BY count( meta_key ) DESC
LIMIT 50;
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;
<script type="text/javascript">
document.addEventListener('DOMContentLoaded', function() {
document.querySelectorAll('div.ccom_monitoring_task')
.forEach(function(taskDiv) {
taskDiv.innerHTML = '<img decoding="async" alt="spinner" src="/wp-includes/images/wpspin.gif">';
let task = taskDiv.getAttribute('data-task');