Automattic / Automattic/jetpack

Optimisation: inline css <style> in modules/stats.php

Open
#7,077 1 comment 0 reactions 0 assignees View on GitHub
[Feature] Stats Data [Focus] Performance [Pri] Low Enhancement Good For Community
Dominant language
PHP
Stars
1.8k
Forks
898
Avg merge
1d 18h
Merged PRs (30d)
774

Description

#### Steps to reproduce the issue
Looking on home page code, I saw this #wpadminbar .quicklinks css not inline. Simple easy fast update. It's always showing up on my performances scans so I just want to let you guys know that it is not a big deal but would be a tiny improvement. It is located in the file jetpack/modules/stats.php.

#### What I expected
<style type='text/css'>#wpadminbar .quicklinks li#wp-admin-bar-stats{height:32px}#wpadminbar .quicklinks li#wp-admin-bar-stats a{height:32px;padding:0}#wpadminbar .quicklinks li#wp-admin-bar-stats a div{height:32px;width:95px;overflow:hidden;margin:0 10px}#wpadminbar .quicklinks li#wp-admin-bar-stats a:hover div{width:auto;margin:0 8px 0 10px}#wpadminbar .quicklinks li#wp-admin-bar-stats a img{height:24px;padding:4px 0;max-width:none;border:none}

#### What happened instead
CSS code is not inline, it is a minor change I am requesting, but it saves a little loading. Little easy fast change, small step to fast loading improvement. Thanks a lot !

Contributor guide

Open the contributing guide

Research direction

Open modules/stats.php and locate the Jetpack Stats CSS for the wpadminbar stats item. Verify how the style block is currently emitted, then make it inline as requested and confirm the generated home-page markup contains the CSS inline.

Written by the indexing model from the issue text.

Assessment

Tech stack
php, wordpress
Domain
backend, performance
Issue type
Refactor
Difficulty
1/5
Estimated time
Under an hour
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.