/* --- PERFORMANCE HELPERS ADDED BY CHATGPT --- */ add_action( 'wp_enqueue_scripts', function() { // Defer non-critical theme scripts if they are enqueued. $defer_handles = array( 'bennet-common', 'bennet-scripts', 'gsap', 'clapat', 'three-min', 'threejs' ); foreach ( $defer_handles as $h ) { if ( wp_script_is( $h, 'enqueued' ) ) { wp_script_add_data( $h, 'defer', true ); } } }, 999 ); // Ensure images output by wp_get_attachment_image use native lazy loading add_filter( 'wp_get_attachment_image_attributes', function( $attr, $attachment, $size ) { if ( ! isset( $attr['loading'] ) ) { $attr['loading'] = 'lazy'; } return $attr; }, 10, 3 ); // Lightweight helper to register combined assets if present add_action( 'wp_enqueue_scripts', function() { $dist_css = get_template_directory() . '/assets/dist/app.min.css'; $dist_js = get_template_directory() . '/assets/dist/app.min.js'; if ( file_exists( $dist_css ) ) { // Dequeue some common stylesheet handles if they exist (safe attempt) $maybe = array('bennet-content','bennet-showcase','bennet-portfolio','bennet-blog','bennet-shortcodes','bennet-all'); foreach ( $maybe as $h ) { if ( wp_style_is( $h, 'enqueued' ) ) { wp_dequeue_style( $h ); } } wp_enqueue_style( 'bennet-combined', get_template_directory_uri() . '/assets/dist/app.min.css', array(), filemtime( $dist_css ) ); } if ( file_exists( $dist_js ) ) { $maybe_js = array('bennet-common','bennet-scripts'); foreach ( $maybe_js as $h ) { if ( wp_script_is( $h, 'enqueued' ) ) { wp_dequeue_script( $h ); } } wp_enqueue_script( 'bennet-combined', get_template_directory_uri() . '/assets/dist/app.min.js', array(), filemtime( $dist_js ), true ); wp_script_add_data( 'bennet-combined', 'defer', true ); } }, 1000 ); /* --- END PERFORMANCE HELPERS --- */ https://xhoisshaholli.com/wp-sitemap-posts-post-1.xmlhttps://xhoisshaholli.com/wp-sitemap-posts-page-1.xmlhttps://xhoisshaholli.com/wp-sitemap-posts-bennet_portfolio-1.xmlhttps://xhoisshaholli.com/wp-sitemap-taxonomies-category-1.xmlhttps://xhoisshaholli.com/wp-sitemap-taxonomies-portfolio_category-1.xmlhttps://xhoisshaholli.com/wp-sitemap-users-1.xml