This file contains hidden or 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 | |
/** | |
* Close database connections | |
* | |
* It's very dangerous to let connections opened. In a website | |
* with high traffic volume, you can kill your database just | |
* because of unclosed DB connections. | |
* This little snippet prevent that drama ;) | |
* |
This file contains hidden or 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 WordPress version. | |
//<meta name="generator" content="WordPress __WP_VERSION__" /> | |
remove_action('wp_head', 'wp_generator'); | |
/** | |
* Remove WordPress generator info. | |
* | |
* @see https://github.com/crewstyle/clean-wordpress |
This file contains hidden or 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 admin bar since WP v3.1 | |
add_filter('show_admin_bar', '__return_false'); | |
remove_action('init', 'wp_admin_bar_init'); |
This file contains hidden or 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 | |
/** | |
* Disable emojicons introduced with WP 4.2 in frontend panel. | |
* | |
* @uses remove_action() | |
* @uses add_filter() | |
* @see https://github.com/crewstyle/clean-wordpress | |
*/ | |
add_action('init', '_cw_disable_wp_emojicons'); |
This file contains hidden or 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 | |
/** | |
* Define what to clean from the theme header frontend, via the "remove_action" hook. | |
* | |
* @see https://github.com/GetOlympus/Zeus-Core | |
*/ | |
$optims = [ | |
'adjacent_posts_rel', // Removes the next and previous post links from the header |
This file contains hidden or 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 | |
/** | |
* Sanitize filenames. | |
* | |
* This script has been made because of a bug on Safari which | |
* does not display medias if its name contains special character | |
* such as "é", "à" or a simple " ". | |
* This script transform all these specials to prevent this bug. | |
* |
This file contains hidden or 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 menu items from WordPress admin bar. | |
* | |
* @uses remove_menu() To remove specific menu. | |
* @see https://github.com/crewstyle/clean-wordpress | |
*/ | |
add_action('wp_before_admin_bar_render', '_cw_remove_bar_icons'); | |
function _cw_remove_bar_icons() |
This file contains hidden or 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 dashboard menus to editor role. | |
* | |
* @uses current_user_can() To know if current user has permissions. | |
* @uses remove_menu_page() To remove a menu page. | |
* @uses remove_submenu_page() To remove a submenu page. | |
* @see https://github.com/crewstyle/clean-wordpress | |
*/ |
This file contains hidden or 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 | |
/** | |
* Sets up WP version check for admin role only. | |
* | |
* @uses current_user_can() To know if current user has permissions. | |
* @uses add_action() To add a hook action. | |
* @uses add_filter() To add a hook filter. | |
* @see https://github.com/crewstyle/clean-wordpress | |
*/ |
This file contains hidden or 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
#!/bin/bash | |
#################################################################### | |
# WordPress updater script | |
# | |
# This script has been made to update WordPress sites quickly | |
# and works on remote server. | |
# | |
# It works with this simple command line: | |
# /path/to/wp-update.sh folder_name user:group |
OlderNewer