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 add_security_headers($headers) { | |
// Add X-XSS-Protection header | |
$headers['X-XSS-Protection'] = '1; mode=block'; | |
// Add X-Content-Type-Options header | |
$headers['X-Content-Type-Options'] = 'nosniff'; | |
// Add X-Frame-Options header | |
$headers['X-Frame-Options'] = 'SAMEORIGIN'; |
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
add_action( 'init', 'custom_wc_maybe_reduce_stock_levels', 10 ); | |
function custom_wc_maybe_reduce_stock_levels(){ | |
// remove_action( 'woocommerce_order_status_completed', 'wc_maybe_reduce_stock_levels' ); | |
remove_action( 'woocommerce_payment_complete', 'wc_maybe_reduce_stock_levels' ); | |
remove_action( 'woocommerce_order_status_processing', 'wc_maybe_reduce_stock_levels' ); | |
remove_action( 'woocommerce_order_status_on-hold', 'wc_maybe_reduce_stock_levels' ); | |
add_action( 'woocommerce_payment_complete', 'wc_maybe_increase_stock_levels' ); | |
add_action( 'woocommerce_order_status_processing', 'wc_maybe_increase_stock_levels' ); |
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
wp itsec site-scanner scan |
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 extend_auth_cookie_expiration( $expiration, $user_id, $remember ) { | |
// Set the desired cookie expiration time (48 hours in this example) | |
$cookie_expire = 2 * DAY_IN_SECONDS; | |
// Return the new expiration time | |
return $cookie_expire; | |
} | |
add_filter( 'auth_cookie_expiration', 'extend_auth_cookie_expiration', 10, 3 ); |
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
wp plugin update essential-addons-for-elementor-lite |
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
wp option get itsec-storage --format=json |
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 action_woocommerce_low_stock( $wc_get_product ) { | |
// Product set tag id(s), multiple IDs can be added, separated by a comma | |
$wc_get_product->set_tag_ids( array( 'YOUR TAG ID' ) ); | |
// OPTIONAL: Set category ids | |
//$wc_get_product->set_category_ids( array( 39, 2 ) ); | |
// Save | |
$wc_get_product->save(); | |
} |
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 reset_product_template( $post_type_args ) { | |
if ( array_key_exists( 'template', $post_type_args ) ) { | |
unset( $post_type_args['template'] ); | |
} | |
return $post_type_args; | |
} | |
add_filter( 'woocommerce_register_post_type_product', 'reset_product_template' ); |
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 pagespeed_module> | |
ModPagespeed on | |
ModPagespeedEnableFilters recompress_jpeg,recompress_png | |
ModPagespeedEnableFilters recompress_webp | |
ModPagespeedEnableFilters convert_gif_to_png,convert_jpeg_to_progressive | |
ModPagespeedEnableFilters convert_jpeg_to_webp,convert_png_to_jpeg | |
ModPagespeedEnableFilters jpeg_subsampling | |
ModPagespeedEnableFilters strip_image_color_profile,strip_image_meta_data | |
</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
wp user list --role=administrator --format=csv | |
wp user reset-password $(wp user list --fields=ID --role=administrator) | |
wp user reset-password $(wp user list --fields=ID --role=administrator) -skip-email | |
wp config shuffle-salts | |
wp plugin update --all | |
wp theme update --all |