84% traffic-lights

Code Review | Traffic Lights

WordPress plugin Traffic Lights scored84%from 54 tests.

About plugin

  • Plugin page: traffic-lights
  • Plugin version: 1.02
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0-5.6.2
  • WordPress version: 6.3.1
  • First release: Nov 24, 2013
  • Latest release: Feb 5, 2021
  • Number of updates: 15
  • Update frequency: every 175.3 days
  • Top authors: theode (100%)

Code review

54 tests

User reviews

2 reviews

Install metrics

100+ active /2,563 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
Install script ran successfully

Server metrics [RAM: ▲0.03MB] [CPU: ▼6.07ms] Passed 4 tests

An overview of server-side resources used by Traffic Lights
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.49 ▲0.0342.54 ▼4.73
Dashboard /wp-admin3.33 ▲0.0350.16 ▼4.02
Posts /wp-admin/edit.php3.38 ▲0.0346.73 ▼5.16
Add New Post /wp-admin/post-new.php5.91 ▲0.0386.77 ▼10.35
Media Library /wp-admin/upload.php3.26 ▲0.0338.27 ▲3.40

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

Analyzing filesystem and database footprints of this plugin
This plugin installed successfully
Filesystem: 10 new files
Database: no new tables, 7 new options
New WordPress options
widget_recent-comments
theysaidso_admin_options
widget_recent-posts
widget_theysaidso_widget
widget_traffic_light_widget
db_upgraded
can_compress_scripts

Browser metrics Passed 4 tests

Traffic Lights: an overview of browser usage
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,832 ▲7114.69 ▼0.031.90 ▲0.2543.80 ▲1.09
Dashboard /wp-admin2,238 ▲645.58 ▲0.0284.04 ▼45.7484.35 ▲30.01
Posts /wp-admin/edit.php2,100 ▼01.97 ▼0.0636.20 ▼7.6432.94 ▼5.05
Add New Post /wp-admin/post-new.php1,537 ▲1118.26 ▼4.76621.50 ▲9.3669.44 ▲12.66
Media Library /wp-admin/upload.php1,397 ▼34.25 ▼0.0997.95 ▼0.6043.83 ▲1.24

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
It is recommended to fix the following
  • Zombie WordPress options detected upon uninstall: 7 options
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • widget_recent-comments
    • widget_recent-posts
    • can_compress_scripts
    • widget_traffic_light_widget
    • db_upgraded

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Good news, no errors were detected

SRP 50% from 2 tests

🔹 Tests weight: 20 | A shallow check of the single-responsibility principle; PHP files should perform no action - including output of placeholder text - and trigger no errors when accessed directly
Please take a closer look at the following
  • 2× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/traffic-lights/traffic-lights-widget.php:2
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/traffic-lights/traffic-lights-widget.php:2

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)
No browser issues were found

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

You should put a lot of thought into formatting readme.txt as it is used by WordPress.org to prepare the public listing of your plugin
3 plugin tags: status, traffic, lights

traffic-lights/traffic-lights.php Passed 13 tests

The main PHP file in "Traffic Lights" ver. 1.02 adds more information about the plugin and also serves as the entry point for this plugin
53 characters long description:
A simple Traffic Light to show some state for visitor

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
Everything looks great! No dangerous files found in this plugin195 lines of code in 3 files:
LanguageFilesBlank linesComment linesLines of code
PHP33748195

PHP code Passed 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
This plugin has no cyclomatic complexity problems
Cyclomatic complexity
Average complexity per logical line of code0.34
Average class complexity5.00
▷ Minimum class complexity5.00
▷ Maximum class complexity5.00
Average method complexity2.00
▷ Minimum method complexity1.00
▷ Maximum method complexity3.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods4
▷ Static methods00.00%
▷ Public methods4100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions6
▷ Named functions6100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
6 PNG files occupy 0.03MB with 0.01MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
bilder/green-off.png4.54KB2.80KB▼ 38.26%
bilder/red-off.png5.35KB3.00KB▼ 43.83%
bilder/red.png5.54KB2.98KB▼ 46.29%
bilder/yellow-off.png4.45KB2.62KB▼ 41.10%
bilder/green.png4.79KB2.65KB▼ 44.55%