wrong redirect .htaccess

# Slash al final RewriteBase / RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_URI} !# RewriteCond %{REQUEST_URI} !(.*)/$ RewriteRule ^(.*)$ https://yourdomain.com/$1/ [L,R=301] # END Slash al finalContinue reading

snip_FetchPriority version 0

add_filter( ‘wp_get_attachment_image_attributes’, function( $attr, $attachment ) { // Check if the image has the class “highfetchprio” if ( isset( $attr[‘class’] ) && strpos( $attr[‘class’], ‘highfetchprio’ ) !== false ) { $attr[‘loading’] = ‘eager’; $attr[‘fetchpriority’] = ‘high’; $attr[‘decoding’] = ‘async’; }…Continue reading

snip_FetchPriority version 2

add_filter( ‘wp_get_attachment_image_attributes’, function( $attr, $attachment ) { // Check if the image has the class “highfetchprio” if ( isset( $attr[‘class’] ) && strpos( $attr[‘class’], ‘highfetchprio’ ) !== false ) { $attr[‘loading’] = ‘eager’; $attr[‘fetchpriority’] = ‘high’; $attr[‘decoding’] = ‘async’; }…Continue reading

Helper Functions (dep)

/** * WPCode Snippet: get_page_by_title Compatibility Helper * * This snippet provides a backward-compatible replacement for the deprecated * get_page_by_title() function that was removed in WordPress 6.2.0 * * To use this snippet: * 1. Go to WPCode > +…Continue reading

snip_FetchPriority

add_action(‘template_redirect’, function () { // On initialise un tableau global $GLOBALS[‘highfetchprio_preload’] = []; ob_start(function ($html) { // 1. On modifie les balises ciblées $html = preg_replace_callback( ‘#]+class=”[^”]*highfetchprio[^”]*”[^>]*)>#i’, function ($matches) { $img = $matches[0]; // Supprimer lazyload et attributs inutiles $img…Continue reading

3 Month

add_action( ‘init’, ‘export_all_completed_orders_test’ ); function export_all_completed_orders_test() { if ( isset( $_GET[‘export_customers’] ) && $_GET[‘export_customers’] === ‘1’ ) { if ( ! current_user_can( ‘manage_options’ ) ) { wp_die( ‘Access denied’ ); } header( ‘Content-Type: text/csv; charset=utf-8’ ); header( ‘Content-Disposition: attachment; filename=all_completed_orders.csv’…Continue reading