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
# WHITELISTING IP ADDRESSES | |
<Files wp-login.php> | |
Order Deny,Allow | |
Deny from all | |
# Allow access via this IP address | |
Allow from xxx.xxx.xxx.xxx | |
</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
# PROTECTING THE .HTACCESS FILE | |
<Files ~ "^.*.([Hh][Tt][Aa])"> | |
Order Allow,Deny | |
Deny from all | |
Satisfy all | |
</Files> | |
# PROTECT .htaccess | |
<Files .htaccess> | |
order allow,deny |
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
# PROTECTING DIRECTORIES | |
Options -Indexes | |
#IndexIgnore *.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
<IfModule mod_rewrite.c> | |
RewriteEngine On | |
RewriteBase / | |
RewriteRule ^wp-admin/includes/ - [F,L] | |
RewriteRule !^wp-includes/ - [S=3] | |
RewriteRule ^wp-includes/[^/]+\.php$ - [F,L] | |
RewriteRule ^wp-includes/js/tinymce/langs/.+\.php - [F,L] | |
RewriteRule ^wp-includes/theme-compat/ - [F,L] | |
</IfModule> |
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
Order deny,allow | |
Deny from all | |
<Files ~ ".(xml|css|jpe?g|png|gif|js)$"> | |
Allow from all | |
</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
# PROTECT wpconfig.php | |
<files wp-config.php> | |
order allow,deny | |
deny from all | |
</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
OPTION 1 - Add a warning that you need a stronger password. | |
/* WC Vendors - Add a "Need a strong password" notice to the My Account Page */ | |
add_action( 'woocommerce_register_form', 'wcvendors_notify_password_myaccount' ); | |
function wcvendors_notify_password_myaccount() { | |
echo '<strong>Important</strong> -- This site respects your security. We require all new members to use a strong password. If you can not click the Register button, <strong>you need a stronger password</a>.<br><br>'; | |
} | |
/* WC Vendors - Add a "Need a strong password" notice to the Checkout Page */ | |
add_action( 'woocommerce_after_checkout_registration_form', 'wcvendors_notify_password_checkout' ); | |
function wcvendors_notify_password_checkout() { |
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 | |
/** | |
* This class removes the default excerpt metabox | |
* and adds a new box with the wysiwyg editor capability | |
* @author etessore | |
*/ | |
class TinyMceExcerptCustomization{ | |
const textdomain = ''; | |
const custom_exceprt_slug = '_custom-excerpt'; |
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
/* | |
* http://blog.templatetoaster.com/15-useful-code-snippets-for-your-wordpress-site/ | |
*/ | |
function wp_maintenance_mode(){ | |
if(!current_user_can('edit_themes') || !is_user_logged_in()){ | |
wp_die('Maintenance, please come back soon.', 'Maintenance – please come back soon.', array('response' => '503')); | |
} | |
} | |
add_action('get_header', 'wp_maintenance_mode'); |
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
/** | |
* Fix Gravity Form Tabindex Conflicts | |
* http://gravitywiz.com/fix-gravity-form-tabindex-conflicts/ | |
*/ | |
add_filter( 'gform_tabindex', 'gform_tabindexer', 10, 2 ); | |
function gform_tabindexer( $tab_index, $form = false ) { | |
$starting_index = 1000; // if you need a higher tabindex, update this number | |
if( $form ) | |
add_filter( 'gform_tabindex_' . $form['id'], 'gform_tabindexer' ); | |
return GFCommon::$tab_index >= $starting_index ? GFCommon::$tab_index : $starting_index; |