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
# Enable Compression | |
<IfModule mod_deflate.c> | |
AddOutputFilterByType DEFLATE application/javascript | |
AddOutputFilterByType DEFLATE application/rss+xml | |
AddOutputFilterByType DEFLATE application/vnd.ms-fontobject | |
AddOutputFilterByType DEFLATE application/x-font | |
AddOutputFilterByType DEFLATE application/x-font-opentype | |
AddOutputFilterByType DEFLATE application/x-font-otf | |
AddOutputFilterByType DEFLATE application/x-font-truetype | |
AddOutputFilterByType DEFLATE application/x-font-ttf |
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
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 |
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
SELECT | |
COUNT(*) as total | |
FROM | |
wp_posts as p | |
JOIN wp_postmeta as m ON p.ID = m.post_id | |
WHERE | |
p.`post_type` = 'page' | |
AND p.`post_status` = 'publish' | |
AND m.`meta_key` = '_wp_page_template' | |
AND m.`meta_value` = 'page-your-template-name.php' |
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 | |
/** | |
* Paralelize download test | |
*/ | |
add_filter( 'wp_get_attachment_url', 'iv_parallelize_hostnames', 10, 2 ); | |
function iv_parallelize_hostnames( $url, $id ) { | |
$hostname = iv_get_hostname( $url ); |
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
https://example.com/file1.gz | |
https://example.com/file2.gz | |
https://example.com/file3.gz |
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
-- Deletes old revisions | |
DELETE a, | |
b, | |
c | |
FROM | |
wp_posts a | |
LEFT JOIN wp_term_relationships b ON (a.ID = b.object_id) | |
LEFT JOIN wp_postmeta c ON (a.ID = c.post_id) | |
LEFT JOIN wp_term_taxonomy d ON (b.term_taxonomy_id = d.term_taxonomy_id) | |
WHERE |
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
SELECT | |
'autoloaded data' as name, | |
ROUND(SUM(LENGTH(option_value))) as value | |
FROM | |
wp_options | |
WHERE | |
autoload = 'yes' | |
UNION | |
SELECT | |
'autoloaded data count', |
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
UPDATE | |
wp_term_taxonomy | |
SET | |
count = ( | |
SELECT | |
COUNT(*) | |
FROM | |
wp_term_relationships rel | |
LEFT JOIN wp_posts po ON (po.ID = rel.object_id) | |
WHERE |
OlderNewer