83% css-optimizer-remove-unused-css

Code Review | CSS Optimizer - Remove Unused CSS

WordPress plugin CSS Optimizer - Remove Unused CSS scored83%from 54 tests.

About plugin

  • Plugin page: css-optimizer-rem...
  • Plugin version: 1.7
  • PHP compatiblity: 5.1+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.7-5.9
  • WordPress version: 6.3.1
  • First release: Nov 4, 2021
  • Latest release: Mar 16, 2022
  • Number of updates: 20
  • Update frequency: every 6.7 days
  • Top authors: wooncherk (100%)

Code review

54 tests

User reviews

6 reviews

Install metrics

200+ active /8,583 total downloads

Benchmarks

Plugin footprint 82% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.26MB] [CPU: ▼5.37ms] Passed 4 tests

A check of server-side resources used by CSS Optimizer - Remove Unused CSS
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.76 ▲0.2941.61 ▼0.50
Dashboard /wp-admin3.56 ▲0.2248.30 ▼17.00
Posts /wp-admin/edit.php3.67 ▲0.3253.23 ▲6.79
Add New Post /wp-admin/post-new.php6.14 ▲0.2685.04 ▼9.27
Media Library /wp-admin/upload.php3.48 ▲0.2639.97 ▲5.30
CSS Optimizer /wp-admin/options-general.php?page=cssoptimizer3.4635.29
CSS Optimizer /wp-admin/admin.php?page=cssoptimizer_support3.4533.72
CSS Optimizer /wp-admin/admin.php?page=cssoptimizer_jobqueue3.4532.44

Server storage [IO: ▲0.26MB] [DB: ▲0.00MB] 67% from 3 tests

How much does this plugin use your filesystem and database?
It is recommended to fix the following issues
  • You have illegally modified 2 files (0.00KB) outside of "wp-content/plugins/css-optimizer-remove-unused-css/" and "wp-content/uploads/"
    • (new file) wp-content/cache/cssoptimizer/css_job_queue.txt
    • (new file) wp-content/cache/cssoptimizer/css_optimizer_log.txt
Filesystem: 7 new files
Database: no new tables, 9 new options
New WordPress options
widget_recent-comments
db_upgraded
theysaidso_admin_options
cssoptimizer_options_exclude_css
cssoptimizer_options_safelist
cssoptimizer_first_time_guide
can_compress_scripts
widget_recent-posts
widget_theysaidso_widget

Browser metrics Passed 4 tests

Checking browser requirements for CSS Optimizer - Remove Unused CSS
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,805 ▲1914.28 ▼0.071.72 ▼0.1644.92 ▲1.82
Dashboard /wp-admin2,208 ▲315.57 ▼0.0984.80 ▼15.5939.45 ▼7.26
Posts /wp-admin/edit.php2,117 ▲172.14 ▲0.1538.73 ▲2.1336.77 ▼0.57
Add New Post /wp-admin/post-new.php1,541 ▲1523.59 ▲0.45604.85 ▼85.4154.14 ▼0.45
Media Library /wp-admin/upload.php1,413 ▲134.24 ▲0.0199.82 ▲3.1746.04 ▲2.58
CSS Optimizer /wp-admin/options-general.php?page=cssoptimizer1,1252.3340.6156.87
CSS Optimizer /wp-admin/admin.php?page=cssoptimizer_support8091.7425.7428.40
CSS Optimizer /wp-admin/admin.php?page=cssoptimizer_jobqueue8181.9026.0733.37

Uninstaller [IO: ▲0.00MB] [DB: ▲0.00MB] 75% from 4 tests

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
You still need to fix the following
  • Zombie WordPress options detected upon uninstall: 9 options
    • widget_theysaidso_widget
    • widget_recent-comments
    • can_compress_scripts
    • cssoptimizer_first_time_guide
    • cssoptimizer_options_safelist
    • cssoptimizer_options_exclude_css
    • theysaidso_admin_options
    • db_upgraded
    • widget_recent-posts

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Even though no errors were found, this is by no means an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | It is important to ensure that your PHP files perform no action when accessed directly, respecting the single-responsibility principle
Please fix the following
  • 1× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function site_url() in wp-content/plugins/css-optimizer-remove-unused-css/css_optimizer.php:16

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
Everything seems fine on the user side

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
Attributes that require attention:
  • Plugin Name: Write the name of your plugin instead of "Plugin Name" on the first line ( === css-optimizer-remove-unused-css === )
The official readme.txt is a good inspiration

css-optimizer-remove-unused-css/css_optimizer.php 85% from 13 tests

"CSS Optimizer - Remove Unused CSS" version 1.7's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
The following require your attention:
  • Text Domain: The text domain name should consist of only dashes and lowercase characters
  • Main file name: Name the main plugin file the same as the plugin slug ("css-optimizer-remove-unused-css.php" instead of "css_optimizer.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | An overview of files in this plugin; executable files are not allowed
Success! There were no dangerous files found in this plugin907 lines of code in 2 files:
LanguageFilesBlank linesComment linesLines of code
PHP1303650818
CSS117189

PHP code Passed 2 tests

This plugin's cyclomatic complexity and code structure detailed below
Great job! No cyclomatic complexity issues were detected in this plugin
Cyclomatic complexity
Average complexity per logical line of code0.47
Average class complexity0.00
▷ Minimum class complexity0.00
▷ Maximum class complexity0.00
Average method complexity0.00
▷ Minimum method complexity0.00
▷ Maximum method complexity0.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes0
▷ Abstract classes00.00%
▷ Concrete classes00.00%
▷ Final classes00.00%
Methods0
▷ Static methods00.00%
▷ Public methods00.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions38
▷ Named functions38100.00%
▷ Anonymous functions00.00%
Constants4
▷ Global constants4100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
1 PNG file occupies 0.00MB with 0.00MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
css/caret-down.png1.76KB0.31KB▼ 82.09%