Improve WordPress security (.htaccess)
# Enable .htpasswd authentication
<If "%{HTTP_HOST} != 'dev'">
AuthType Basic
AuthName "Login to dashboard"
const { registerCheckoutFilters } = window.wc.blocksCheckout; | |
// Adjust the proceed to checkout button label. | |
registerCheckoutFilters( 'example-extension', { | |
proceedToCheckoutButtonLabel: ( value, extensions, { cart } ) => { | |
if ( ! cart.items ) { | |
return value; | |
} | |
const isSunglassesInCart = cart.items.some( |
const { registerCheckoutFilters } = window.wc.blocksCheckout; | |
// Adjust the proceed to checkout button link. | |
registerCheckoutFilters( 'example-extension', { | |
proceedToCheckoutButtonLink: ( value, extensions, { cart } ) => { | |
if ( ! cart.items ) { | |
return value; | |
} | |
const isSunglassesInCart = cart.items.some( |
const { registerCheckoutFilters } = window.wc.blocksCheckout; | |
// Adjust the place order button label. | |
registerCheckoutFilters( 'example-extension', { | |
placeOrderButtonLabel: () => '💰 Pay now 💰' | |
} ); |
const { registerCheckoutFilters } = window.wc.blocksCheckout; | |
// Adjust allowed cart and checkout inner block types. | |
registerCheckoutFilters( 'example-extension', { | |
additionalCartCheckoutInnerBlockTypes: ( value, extensions, { block } ) => { | |
// Remove the ability to add `core/separator` | |
value = value.filter( ( blockName ) => blockName !== 'core/separator' ); | |
// Add core/quote to any inner block area. | |
value.push( 'core/quote' ); |
diff --git a/assets/js/base/components/cart-checkout/address-form/address-form.tsx b/assets/js/base/components/cart-checkout/address-form/address-form.tsx | |
index cec368a6c..966ffeb06 100644 | |
--- a/assets/js/base/components/cart-checkout/address-form/address-form.tsx | |
+++ b/assets/js/base/components/cart-checkout/address-form/address-form.tsx | |
@@ -144,6 +144,29 @@ const AddressForm = ( { | |
id = id || instanceId; | |
+ const customValidationHandler = ( | |
+ inputObject: HTMLInputElement, |
<?php | |
switch ($_SERVER['HTTP_HOST']) { | |
case 'dev.mydomain.com': | |
define('DB_NAME', '' ); | |
define('DB_USER', '' ); | |
define('DB_PASSWORD', '' ); | |
define('DB_HOST', '127.0.0.1' ); | |
define('WP_CACHE', false); | |
define('WP_DEBUG', true); |
<?php | |
/** | |
* Add a 1% surcharge to your cart / checkout based on delivery country | |
* Taxes, shipping costs and order subtotal are all included in the surcharge amount | |
* | |
* Change $percentage to set the surcharge to a value to suit | |
* | |
* Add countries to array('US'); to include more countries to surcharge | |
* http://en.wikipedia.org/wiki/ISO_3166-1#Current_codes for available alpha-2 country codes | |
* |
let url = 'https://api.wordpress.org/plugins/info/1.2/?action=query_plugins&request[fields][banners]=true&request[search]=SMNTCS'; | |
let downloads = 0; | |
let installs = 0; | |
let plugins; | |
let plugin; | |
fetch( url ) | |
.then( response => { | |
return response.json() | |
} ) |
<?php | |
add_action('peepso_action_user_activate', 'hook', 10, 1); | |
/* | |
* Send an email to admin each time a new group is created | |
*/ | |
hook(PeepSoUser $PeepSoUser) { | |
$msg = "New user {$PeepSoUser->get_fullname()} ID {$PeepSoUser->get_id()}"; | |
error_log($msg); | |
} |