Motorola Edge 60 Fusion Review: Stunning Design Meets Intelligent Features
Motorola Edge 60 Fusion: Motorola has made a giant leap in the mid-range smartphone market with the launch of the Edge 60 Fusion. With an......
Full Story// ============================================
// IMAGE SEO CLASS (FIXED)
// ============================================
if (!class_exists('TimesBull_Image_SEO')) {
class TimesBull_Image_SEO {
private static $instance = null;
private $image_count = 0;
private $featured_image_id = null;
public static function get_instance() {
if (null === self::$instance) {
self::$instance = new self();
}
return self::$instance;
}
private function __construct() {
add_filter('wp_get_attachment_image_attributes', [$this, 'add_image_attributes'], 10, 3);
add_filter('the_content', [$this, 'auto_add_image_alt']);
add_action('add_attachment', [$this, 'auto_image_seo']);
add_action('wp', [$this, 'set_featured_image_id']);
}
public function set_featured_image_id() {
if (is_singular()) {
$this->featured_image_id = get_post_thumbnail_id();
}
}
public function add_image_attributes($attr, $attachment, $size) {
$this->image_count++;
// CRITICAL FIX: Check if this is the featured image
$is_featured = ($attachment->ID === $this->featured_image_id);
if ($is_featured) {
// Featured image - ALWAYS eager, ALWAYS high priority
$attr['loading'] = 'eager';
$attr['fetchpriority'] = 'high';
$attr['decoding'] = 'async';
} elseif ($this->image_count === 1 && !is_admin()) {
// First non-featured image (e.g., logo)
$attr['loading'] = 'eager';
$attr['fetchpriority'] = 'high';
$attr['decoding'] = 'async';
} else {
// All other images - lazy load for performance
$attr['loading'] = 'lazy';
$attr['decoding'] = 'async';
// Remove fetchpriority from lazy images (prevents conflict)
if (isset($attr['fetchpriority'])) {
unset($attr['fetchpriority']);
}
}
// Ensure alt text is never empty
if (empty($attr['alt'])) {
$alt_text = get_post_meta($attachment->ID, '_wp_attachment_image_alt', true);
$attr['alt'] = $alt_text ?: get_the_title($attachment->ID);
}
return $attr;
}
public function auto_add_image_alt($content) {
if (empty($content) || !is_singular() || is_admin()) {
return $content;
}
$post_title = esc_attr(get_the_title());
return preg_replace_callback('/]+)>/i', function($matches) use ($post_title) {
$img_tag = $matches[0];
$attributes = $matches[1];
if (!preg_match('/alt=([\'"])(.*?)\1/i', $attributes, $alt_matches) || empty(trim($alt_matches[2]))) {
if (stripos($attributes, 'alt=') !== false) {
return preg_replace('/alt=([\'"])(.*?)\1/i', 'alt="' . $post_title . '"', $img_tag);
} else {
return str_replace('
$attachment_id,
'post_title' => $clean_title,
'post_excerpt' => $clean_title,
]);
update_post_meta($attachment_id, '_wp_attachment_image_alt', $clean_title);
}
}
TimesBull_Image_SEO::get_instance();
}
Stay updated with the latest #Motorola Edge 60 Fusion news, trending stories, and in-depth analysis. Timesbull brings you real-time updates and comprehensive coverage from trusted sources.
Get the most relevant and timely motorola edge 60 fusion news, expert opinions, and exclusive insights. Follow us for daily updates and never miss an important story.
Motorola Edge 60 Fusion: Motorola has made a giant leap in the mid-range smartphone market with the launch of the Edge 60 Fusion. With an......
Full StoryMotorola Edge 60 Fusion : What if a phone was actually very cool in looks, very fast in performance, took amazing photos, and had the......
Full StoryMotorola Edge 60 Fusion Beats Galaxy A26: Want to purchase a new smartphone in the price bracket of Rs.25,000? Two high-performing devices Motorola Edge 60......
Full StoryMotorola Edge 60 Fusion comes with a 6.7-inch display offering a resolution of 1220 x 2712 pixels. The screen supports a 120Hz refresh rate, making......
Full StoryMotorola Edge 60 Fusion: Motorola smartphones are well liked in India, and now Motorola has launched another great smartphone! The name of this new phone......
Full StoryMotorola Edge 60 Fusion : Motorola has launched a new and powerful smartphone of its Edge series in the Indian market, named Motorola Edge 60......
Full StoryMotorola Edge 60 Fusion: Motorola has released its new smartphone, Motorola Edge 60 Fusion, in India, and it is the nation’s first phone to be......
Full StoryMotorola Edge 60 Fusion Full Review: Motorola smartphone is making a strong comeback in the market, and Motorola Edge 60 Fusion is one of its......
Full StoryMotorola Edge 60 Fusion: Motorola is gearing up to launch the Edge 60 Fusion, a smartphone designed for performance, efficiency, and impressive camera capabilities. With......
Full StoryMotorola Edge 60 Fusion: Motorola is launching its new smartphone, the Motorola Edge 60 Fusion. It has an immersive screen, excellent performance, and a high......
Full StoryMotorola is set to launch another feature-packed smartphone, the Motorola Edge 60 Fusion, offering a premium experience at a competitive price. With a sleek design,......
Full Storyनई दिल्ली: मोटोरोला भारतीय स्मार्टफोन बाजार में एक के बाद एक नए फोन लॉन्च कर रही है। ताज़ा रिपोर्ट्स के मुताबिक, कंपनी जल्द ही अपनी......
Full Story