94% css-live

Code Review | Live css

WordPress plugin Live css scored 94% from 54 tests.

About plugin

  • Plugin page: css-live
  • Plugin version: 1.3
  • PHP version: 7.4.16
  • WordPress compatibility: 4.3-4.6
  • WordPress version: 5.8.1
  • First release: Sep 2, 2016
  • Latest release: Sep 16, 2016
  • Number of updates: 24
  • Update frequency: every 0.6 days
  • Top authors: wpion (100%)

Code review

54 tests

User reviews

4 reviews

Install metrics

100+ active / 2,663 total downloads

Benchmarks

Plugin footprint Passed 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▼0.59MB] [CPU: ▼155.10ms] Passed 4 tests

This is a short check of server-side resources used by Live css
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /2.90 ▲0.1836.15 ▲11.78
Dashboard /wp-admin3.12 ▲0.0644.86 ▲1.51
Posts /wp-admin/edit.php3.17 ▲0.0646.20 ▲0.92
Add New Post /wp-admin/post-new.php2.90 ▼2.5427.96 ▼621.32
Media Library /wp-admin/upload.php3.06 ▲0.0530.07 ▼1.52
Live CSS /wp-admin/tools.php?page=td_live_css_admin3.0325.69

Server storage [IO: ▲3.37MB] [DB: ▲0.00MB] Passed 3 tests

A short overview of filesystem and database impact
This plugin installed successfully
Filesystem: 46 new files
Database: no new tables, no new options

Browser metrics Passed 4 tests

A check of browser resources used by Live css
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /4,061 ▲46518.42 ▲2.8242.53 ▲32.8145.37 ▼4.55
Dashboard /wp-admin2,977 ▲436.06 ▲0.10136.48 ▼7.39111.10 ▼3.01
Posts /wp-admin/edit.php2,746 ▲72.71 ▲0.0168.14 ▼0.4991.04 ▼1.25
Add New Post /wp-admin/post-new.php1,505 ▲518.46 ▼0.30352.66 ▼22.77108.52 ▼9.05
Media Library /wp-admin/upload.php1,814 ▲45.02 ▼0.02146.38 ▲4.08125.81 ▲7.15
Live CSS /wp-admin/tools.php?page=td_live_css_admin1,0682.1056.6975.55

Uninstaller [IO: ▲0.00MB] [DB: ▲0.00MB] Passed 4 tests

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
This plugin's uninstaller ran successfully

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Even though everything seems fine, this is not an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | SRP (Single-Responsibility Principle) - PHP files must act as libraries and never output text or perform any action when accessed directly in a browser
Please fix the following
  • 2× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/css-live/includes/td_live_css_ajax.php:11
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugins_url() in wp-content/plugins/css-live/css-live.php:11

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
Everything seems fine on the user side

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% from 16 tests

Don't ignore readme.txt as it is the file that instructs WordPress.org on how to present your plugin to the world
Please fix the following attributes:
  • Screenshots: Please add images for these screenshots: #1 (Editing css and less on a page), #2 (Editing css and less on a category)
The official readme.txt is a good inspiration

css-live/css-live.php Passed 13 tests

The main PHP file in "Live css" ver. 1.3 adds more information about the plugin and also serves as the entry point for this plugin
34 characters long description:
Add CSS and LESS on the front end.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of file extensions present in this plugin and a short test that no dangerous files are bundled with this plugin
There were no executable files found in this plugin13,476 lines of code in 40 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript321,32019212,943
PHP514268320
LESS2364108
CSS100105

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.36
Average class complexity6.67
▷ Minimum class complexity1.00
▷ Maximum class complexity10.00
Average method complexity3.83
▷ Minimum method complexity1.00
▷ Maximum method complexity10.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes3
▷ Abstract classes00.00%
▷ Concrete classes3100.00%
▷ Final classes00.00%
Methods6
▷ Static methods6100.00%
▷ Public methods583.33%
▷ Protected methods00.00%
▷ Private methods116.67%
Functions11
▷ Named functions11100.00%
▷ Anonymous functions00.00%
Constants2
▷ Global constants2100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
2 PNG files occupy 0.55MB with 0.37MB in potential savings
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
screenshot-3.png427.38KB131.76KB▼ 69.17%
screenshot-2.png135.58KB47.89KB▼ 64.68%