77% advanced-css-editor

Code Review | Advanced CSS Editor

WordPress plugin Advanced CSS Editor scored 77% from 54 tests.

About plugin

  • Plugin page: advanced-css-editor
  • Plugin version: 3.1
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0-5.2
  • WordPress version: 5.9.2
  • First release: Mar 2, 2016
  • Latest release: May 13, 2019
  • Number of updates: 12
  • Update frequency: every 97.3 days
  • Top authors: hardeepasrani (100%)

Code review

54 tests

User reviews

6 reviews

Install metrics

10,000+ active / 96,640 total downloads

Benchmarks

Plugin footprint 83% 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.02MB] [CPU: ▼289.86ms] Passed 4 tests

This is a short check of server-side resources used by Advanced CSS Editor
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.59 ▲0.0859.20 ▼2.22
Dashboard /wp-admin3.45 ▲0.0439.78 ▲6.50
Posts /wp-admin/edit.php3.68 ▲0.0440.78 ▲3.42
Add New Post /wp-admin/post-new.php6.92 ▼0.0594.57 ▼1,161.70
Media Library /wp-admin/upload.php3.33 ▲0.0425.39 ▲1.08
Customize /wp-admin/customize.php?return=%2Fwp-admin%2Fwp-api.php6.2455.95

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

Analyzing filesystem and database footprints of this plugin
There were no storage issued detected upon installing this plugin
Filesystem: 15 new files
Database: no new tables, 2 new options
New WordPress options
widget_recent-comments
widget_recent-posts

Browser metrics Passed 4 tests

A check of browser resources used by Advanced CSS Editor
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,815 ▲9315.87 ▲0.076.18 ▼1.522.95 ▲0.52
Dashboard /wp-admin2,893 ▲326.17 ▲0.00121.15 ▼19.29187.84 ▼55.25
Posts /wp-admin/edit.php2,693 ▲23.24 ▲0.0266.02 ▲1.32148.67 ▼8.22
Add New Post /wp-admin/post-new.php1,784 ▲12322.71 ▲6.49444.08 ▼18.69189.78 ▲37.40
Media Library /wp-admin/upload.php1,700 ▲65.52 ▼0.00167.62 ▼14.60245.16 ▲43.71
Customize /wp-admin/customize.php?return=%2Fwp-admin%2Fwp-api.php7,70319.65558.19207.11

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
You still need to fix the following
  • Zombie WordPress options detected upon uninstall: 2 options
    • widget_recent-posts
    • widget_recent-comments

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
These server-side errors were triggered
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/customize.php?return=%2Fwp-admin%2Fwp-api.php
    • > Notice in wp-includes/class-wp-customize-nav-menus.php+1152
    Trying to get property 'title' of non-object

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
Almost there! Just fix the following items
  • 3× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Customize_Control' not found in wp-content/plugins/advanced-css-editor/syntax-highlighter.php:3
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Customize_Control' not found in wp-content/plugins/advanced-css-editor/layout-picker.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/advanced-css-editor/css-editor.php:126

User-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 87% from 29 tests

readme.txt 88% from 16 tests

The readme.txt file uses markdown syntax to describe your plugin to the world
Attributes that need to be fixed:
  • Tags: Please delete some tags, you are using 12 tag instead of maximum 10
  • Screenshots: These screenshots do not have images: #1 (Screenshot 1. Add a global custom CSS), #2 (Screenshot 2. Add custom CSS for Desktop), #3 (Screenshot 3. Add custom CSS for Tablet), #4 (Screenshot 4. Add custom CSS for Phone)
The official readme.txt is a good inspiration

advanced-css-editor/css-editor.php 85% from 13 tests

"Advanced CSS Editor" version 3.1's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
You should first fix the following items:
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("advanced-css-editor.php" instead of "css-editor.php")
  • Description: If Twitter did it, so should we! Keep the description under 140 characters (currently 147 characters long)

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short review of files and their extensions; it is not recommended to include executable files
There were no executable files found in this plugin8,220 lines of code in 10 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript58721,0047,649
CSS24625319
PHP33120252

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.18
Average class complexity3.00
▷ Minimum class complexity2.00
▷ Maximum class complexity4.00
Average method complexity2.00
▷ Minimum method complexity1.00
▷ Maximum method complexity3.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes2
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes00.00%
Methods4
▷ Static methods00.00%
▷ Public methods375.00%
▷ Protected methods125.00%
▷ Private methods00.00%
Functions9
▷ Named functions9100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
4 PNG files occupy 0.15MB with 0.08MB in potential savings
Potential savings
Compression of 4 random PNG files using pngquant
FileSize - originalSize - compressedSavings
screenshot-1.png37.95KB17.90KB▼ 52.82%
screenshot-4.png36.24KB16.17KB▼ 55.38%
screenshot-3.png39.25KB17.22KB▼ 56.13%
screenshot-2.png36.14KB17.37KB▼ 51.94%