// ============================================
// 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();
}
iQOO phones Sale: The e-commerce shopping site Amazon’s Great Republic Day Sale is starting on January 16th. This is the first major sale of the year. During this sale, significant discounts have been announced on iQOO smartphones, ranging from budget-friendly to flagship models.
iQOO has announced on its social media handles that the iQOO 15, which was launched in November 2025, will now be available during the sale for only ₹65,999. Similarly, the iQOO Neo 10 will be available for ₹33,999, while the iQOO Neo 10R will be available for ₹24,999. In addition, phones like the iQOO Z10, Z10R, Z10x, and Z10 Lite will also be available at budget-friendly prices.
Huge Savings on iQOO 15
The iQOO 15 was launched in November 2025 and comes with a sleek design, a 6.85-inch 144 Hz display, a Snapdragon 8 Elite Gen5 SoC, and a 7,000 mAh battery. During the sale, this phone will be available at a special sale price of ₹65,999, which is a significant discount from its original price of ₹72,999.
Huge Discount on iQOO Neo 10
The iQOO Neo 10, launched in May 2025, will be available during the sale for ₹33,999. It features an AMOLED display, a Snapdragon 8s Gen4 SoC processor, a 7,000 mAh battery, and a 50 MP primary camera.
iQOO Neo 10R: A Better Value Deal
The iQOO Neo 10R will also be offered at an attractive price tag of ₹24,999 during this sale. The iQOO Z10, Z10R, Z10x, and Z10 Lite are also available in the sale.
Discount on Other Phone
You can find many other great offers on iQOO smartphones in the budget segment. The iQOO Z10 will be available for ₹20,499 during Amazon’s Republic Day sale. The iQOO Z10R can be purchased for ₹18,499 in the sale. The iQOO Z10x is also included in the list and will be sold for ₹13,499. Furthermore, the iQOO Z10 Lite will be available for just ₹9,999 during the Amazon sale.