# CWV Fix Plan - Sarkar Healings
## Current Issues (Typical WordPress + LiteSpeed)
Based on standard WordPress/LiteSpeed configurations, the likely CWV issues are:
### LCP (Largest Contentful Paint) - Target ≤2.5s
**Root Causes:**
1. No Critical CSS extracted - full CSS loads render-blocking
2. LCP images (hero banners) not preloaded or fetchpriority="high"
3. Web fonts (Google Fonts, custom fonts) causing FOIT/FOUT
4. Large hero images not optimized (WebP/AVIF, proper dimensions)
5. Server response time (TTFB) too high
### INP (Interaction to Next Paint) - Target ≤200ms
**Root Causes:**
1. Heavy JavaScript execution on main thread (jQuery, theme JS, plugins)
2. Long tasks from third-party scripts (chat widgets, analytics)
3. No code splitting / defer non-critical JS
### CLS (Cumulative Layout Shift) - Target ≤0.1
**Root Causes:**
1. Images without explicit width/height attributes
2. Ads/widgets injecting content after load
3. Font swap causing layout shift
4. Dynamic content (sliders, carousels) without reserved space
---
## Fix Implementation Plan
### 1. Critical CSS Extraction (Highest Impact for LCP)
**Method A: LiteSpeed Cache Plugin (Recommended)**
- Enable "Generate Critical CSS" in LiteSpeed Cache → Optimize → CSS
- Set "Critical CSS Rules" to "External File"
- Test with `?LSCWP_CTRL=before_optm` vs `?LSCWP_CTRL=after_optm`
**Method B: Autoptimize + Critical CSS (Fallback)**
- Install Autoptimize plugin
- Enable "Aggregate CSS" + "Generate Critical CSS"
- Use criticalcss.com API or local Penthouse
**Method C: Manual (functions.php)**
```php
// Inline critical CSS for above-fold content
function sarkar_inline_critical_css() {
if (is_singular() && in_array(get_post_field('post_name'), [
'online-ruqyah', 'surah-for-protection', 'surah-for-wealth-and-rizq',
'free-istikhara-online', '99-names-of-allah-directory',
'the-seekers-journey-2027-healing', 'coded-dua-taweez-guide'
])) {
// Critical CSS would be here - generated per template
}
}
add_action('wp_head', 'sarkar_inline_critical_css', 1);
```
### 2. Font Optimization (High Impact for LCP + CLS)
**Current Issue:** Likely loading Google Fonts or custom fonts without `font-display: swap`
**Fixes:**
```php
// Preload key fonts in functions.php
function sarkar_preload_fonts() {
$fonts = [
'https://fonts.gstatic.com/s/amiri/v30/J7aRnpd8CGxBHpUrtLMA.woff2',
'https://fonts.gstatic.com/s/noto-sans-arabic/v30/nwpxtLGrOAZMl5nA_qPqAV9Wlw.woff2',
];
foreach ($fonts as $font) {
echo ' ';
}
}
add_action('wp_head', 'sarkar_preload_fonts', 0);
```
**CSS Fix:**
```css
@font-face {
font-family: 'Amiri';
font-display: swap; /* Critical for CLS */
src: url('...') format('woff2');
}
```
### 3. LCP Image Optimization (High Impact)
**For Hero Images on Money Pages:**
```php
// Add fetchpriority and preload for LCP images
function sarkar_lcp_image_attrs($attr, $attachment, $size) {
$money_pages = ['online-ruqyah', 'surah-for-protection', 'surah-for-wealth-and-rizq',
'free-istikhara-online', '99-names-of-allah-directory',
'the-seekers-journey-2027-healing', 'coded-dua-taweez-guide'];
$slug = get_post_field('post_name', get_the_ID());
if (in_array($slug, $money_pages) && wp_get_attachment_image_src($attachment, 'full')) {
$attr['fetchpriority'] = 'high';
$attr['loading'] = 'eager'; // Override lazy-load for LCP
}
return $attr;
}
add_filter('wp_get_attachment_image_attributes', 'sarkar_lcp_image_attrs', 10, 3);
```
**Also ensure images have explicit dimensions:**
```html
```
### 4. JavaScript Optimization (INP Fix)
**Defer Non-Critical JS:**
```php
function sarkar_defer_scripts($tag, $handle) {
$defer_handles = [
'jquery-migrate', 'wp-embed', 'wc-cart-fragments',
'contact-form-7', 'woocommerce', 'wc-add-to-cart',
'photoswipe', 'flexslider', 'swiper'
];
if (in_array($handle, $defer_handles)) {
return str_replace(' src=', ' defer src=', $tag);
}
return $tag;
}
add_filter('script_loader_tag', 'sarkar_defer_scripts', 10, 2);
```
**Remove jQuery Migrate (if not needed):**
```php
add_filter('wp_default_scripts', function($scripts) {
if (!is_admin()) {
$scripts->remove('jquery');
$scripts->add('jquery', false, ['jquery-core'], '3.7.1');
}
});
```
### 5. CLS Fixes
**Reserve Space for Dynamic Content:**
```css
/* Reserve space for slide-in, announcement bar, WhatsApp float */
#sn-announce { min-height: 40px; }
#sn-slidein { min-height: 100px; }
.sh-wa-float { position: fixed; bottom: 20px; right: 20px; z-index: 9999; }
```
**Font Display Swap (already covered above)**
**Image Dimensions:** Ensure ALL ` ` tags have width/height attributes
---
## Money Pages Specific Fixes
### /online-ruqyah/
- Hero image: Preload + fetchpriority="high" + explicit dimensions
- Critical CSS: Inline above-fold styles
- Fonts: Preload Amiri + Noto Sans Arabic
### /surah-for-protection/ (and all 11 surah guides)
- Surah Arabic text: Preload Amiri font
- Key verses image: fetchpriority="high"
- Schema JSON-LD: Ensure in initial HTML (not JS-injected)
### /free-istikhara-online/
- Form interaction: Defer non-critical JS
- Hero/illustration: Optimize LCP
### /99-names-of-allah-directory/
- Long list: Virtualize or paginate (reduce DOM size)
- Arabic names: Preload fonts
### /the-seekers-journey-2027-healing/
- Video embed: Use facade pattern (lazy-load YouTube)
- Steps images: Proper dimensions
### /coded-dua-taweez-guide/
- Product images: WebP/AVIF + dimensions
- Schema Product markup in initial HTML
---
## Testing Checklist
### Pre-Deployment
- [ ] Run Lighthouse CI on staging
- [ ] Check Critical CSS coverage > 90%
- [ ] Verify all LCP images have fetchpriority="high"
- [ ] Confirm font-display: swap on all @font-face
- [ ] All images have width/height attributes
- [ ] No layout shifts on load (CLS < 0.1)
### Post-Deployment (Real User Monitoring)
- [ ] PageSpeed Insights: Mobile score ≥ 90
- [ ] CrUX Field Data (28-day): LCP ≤ 2.5s, INP ≤ 200ms, CLS ≤ 0.1
- [ ] Search Console → Core Web Vitals: All URLs "Good"
- [ ] Lighthouse Agentic Browsing category: Pass
---
## Implementation Order (Priority)
1. **Week 1:** Critical CSS + Font Preload + fetchpriority on LCP images
2. **Week 2:** Image dimensions + CLS fixes + JS defer
3. **Week 3:** Image optimization (WebP/AVIF) + LiteSpeed tuning
4. **Week 4:** Monitoring + iteration
---
## LiteSpeed Cache Specific Settings
```
Cache → Enable Cache: ON
Cache → Cache Mobile: ON
Cache → Cache Logged-in Users: OFF (or ON with vary)
Optimize → CSS Minify: ON
Optimize → CSS Combine: ON (test for conflicts)
Optimize → Generate Critical CSS: ON
Optimize → Critical CSS Rules: External File
Optimize → JS Minify: ON
Optimize → JS Combine: ON (test for conflicts)
Optimize → Load JS Deferred: ON
Optimize → HTML Minify: ON
Media → Image Optimization: ON
Media → WebP Replacement: ON
Media → Lazy Load Images: ON (but exclude LCP images)
Media → Add Missing Sizes: ON
CDN → QUIC.cloud CDN: ON (if configured)
```
---
## Files to Create/Modify
1. `wp-content/themes/sarkar-noor-divine/functions.php` - Add all PHP snippets
2. `wp-content/themes/sarkar-noor-divine/style.css` - Add font-display: swap, CLS reserves
3. `wp-content/themes/sarkar-noor-divine/critical.css` - Generated critical CSS (auto)
4. LiteSpeed Cache settings (admin UI)
human nature examples Archives - Sarkar Healings
🌙
Free Ruqyah Healing WhatsApp Group
—
daily ayat, protection reminders & live support
Join Free
✕
Skip to content بِسْمِ ٱللَّٰهِ ٱلرَّحْمَٰنِ ٱلرَّحِيمِ Human Nature & Spiritual Intelligence Understanding the Divine Design of Humanity Through Islamic Wisdom Human existence stands as a remarkable creation of the Almighty. Indeed, each individual possesses a unique identity and purpose within this world. Just as plants provide life-giving oxygen and absorb carbon dioxide, we recognize sunlight’s vital role … Read more
Try: "surah for rizq", "ruqyah for evil eye", "dua for anxiety", "Al-Wadud"