sudo apt update
sudo apt install redis-server
sudo nano /etc/redis/redis.conf
supervised systemd
maxmemory 128M
maxmemory-policy allkeys-lfu
sudo systemctl restart redis.service
sudo systemctl status redis
redis-cli
andping
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 | |
// //remove emoji support | |
remove_action('wp_head', 'print_emoji_detection_script', 7); | |
remove_action('wp_print_styles', 'print_emoji_styles'); | |
// // Remove rss feed links | |
remove_action( 'wp_head', 'feed_links_extra', 3 ); | |
remove_action( 'wp_head', 'feed_links', 2 ); |
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 | |
add_post_meta( 5, 'fruit', 'orange', false ); | |
add_post_meta( 5, 'fruit', 'grape', false ); | |
add_post_meta( 5, 'fruit', 'apple', false ); | |
add_post_meta( 5, 'veggie', 'carrot', false ); | |
print_r(get_post_meta( 5, 'fruit', 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
// Get Posts | |
$posts = get_posts([ | |
'post_type' => 'press-release', | |
'posts_per_page' => 25, | |
'category' => 4, | |
]); | |
foreach($posts as $post){ | |
setup_postdata($post); |
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
function upload_svg_files( $allowed ) { | |
if ( !current_user_can( 'manage_options' ) ) | |
return $allowed; | |
$allowed['svg'] = 'image/svg+xml'; | |
return $allowed; | |
} | |
add_filter( 'upload_mimes', 'upload_svg_files'); |
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
// Removing plugin controls from admin | |
function remove_plugin_controls($actions, $plugin_file, $plugin_data, $context){ | |
if (array_key_exists('edit', $actions)) { | |
unset($actions['edit']); | |
} | |
if (array_key_exists('deactivate', $actions)) { |
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
function defer_parsing_of_js($url) | |
{ | |
if (is_admin()) return $url; //don't break WP Admin | |
if (false === strpos($url, '.js')) return $url; | |
if (strpos($url, 'jquery.js')) return $url; | |
return str_replace(' src', ' defer src', $url); | |
} | |
add_filter('script_loader_tag', 'defer_parsing_of_js', 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
php_value upload_max_filesize 64M | |
php_value post_max_size 64M | |
php_value max_execution_time 300 | |
php_value max_input_time 300 |
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
rsync -rlmvz --size-only --ipv4 --progress -e 'ssh -p 2222' <env>.<site_id>@appserver.<env>.<site_id>.drush.in:files/ . |
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
<?xml version="1.0"?> | |
<ruleset name="WordPress Theme Coding Standards"> | |
<!-- See https://github.com/squizlabs/PHP_CodeSniffer/wiki/Annotated-ruleset.xml --> | |
<!-- See https://github.com/WordPress-Coding-Standards/WordPress-Coding-Standards/blob/develop/WordPress-Core/ruleset.xml --> | |
<!-- Set a description for this ruleset. --> | |
<description>A custom set of code standard rules to check for WordPress themes.</description> | |
<!-- Include the WordPress ruleset, with exclusions. --> | |
<rule ref="WordPress"> |
NewerOlder