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
<form method="GET" class="wine-search"> | |
<label for="varieties">All varieties:</label> | |
<select name="varieties[]" id="varieties"> | |
<option value="" disabled selected>Select a variety</option> | |
<?php | |
$svarieties = get_terms([ | |
'taxonomy' => 'varieties', | |
'hide_empty' => 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
/** Disable Ajax Call from WooCommerce on front page and posts*/ | |
add_action( 'wp_enqueue_scripts', 'fixmysite_dequeue_woocommerce_cart_fragments' ); | |
function fixmysite_dequeue_woocommerce_cart_fragments() { | |
if( function_exists( 'is_woocommerce' ) ){ | |
if (is_front_page() || is_single() ) { | |
wp_dequeue_script('wc-cart-fragments'); | |
} |
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
/** Disable All WooCommerce Styles and Scripts Except Shop Pages*/ | |
add_action( 'wp_enqueue_scripts', 'fixmysite_disable_woocommerce_loading_css_js' ); | |
function fixmysite_disable_woocommerce_loading_css_js() { | |
if( function_exists( 'is_woocommerce' ) ){ | |
// Check if it's any of WooCommerce page | |
if(! is_woocommerce() && ! is_cart() && ! is_checkout() ) { | |
## Dequeue WooCommerce styles |
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
# Deny xmlrpc.php | |
<files xmlrpc.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
# Deny wp-config.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
# Deny wp-config.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
# Kill PHP Execution | |
<Files ~ "\.ph(?:p[345]?|t|tml)$"> | |
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
# Block the include-only files. | |
<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
/** MySQL database password */ | |
define('DB_PASSWORD', 'password_here'); | |
/** | |
* Authentication Unique Keys and Salts. | |
* You can generate these using the {@link https://api.wordpress.org/secret-key/1.1/salt/ WordPress.org secret-key service} | |
*/ | |
define('AUTH_KEY', 'put your unique phrase here'); | |
define('SECURE_AUTH_KEY', 'put your unique phrase here'); | |
define('LOGGED_IN_KEY', 'put your unique phrase here'); |
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 | |
# Fill our vars and run on cli | |
# $ php -f db-connect-test.php | |
$dbname = 'name'; | |
$dbuser = 'user'; | |
$dbpass = 'pass'; | |
$dbhost = 'host'; | |
$link = mysqli_connect($dbhost, $dbuser, $dbpass) or die("Unable to Connect to '$dbhost'"); | |
mysqli_select_db($link, $dbname) or die("Could not open the db '$dbname'"); | |
$test_query = "SHOW TABLES FROM $dbname"; |
NewerOlder