68% night-traffic-light

Code Review | Night Traffic Light

WordPress plugin Night Traffic Light scored 68% from 54 tests.

About plugin

  • Plugin page: night-traffic-light
  • Plugin version: 1.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.8.1-3.8
  • WordPress version: 6.3.1
  • First release: Mar 21, 2014
  • Latest release: Mar 21, 2014
  • Number of updates: 2
  • Update frequency: every 1.5 days
  • Top authors: TobiasBohn (100%)

Code review

54 tests

User reviews

1 review

Install metrics

20+ active / 1,193 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
The plugin installed gracefully, with no errors

Server metrics [RAM: ▼1.91MB] [CPU: ▼52.86ms] Passed 4 tests

A check of server-side resources used by Night Traffic Light
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /2.08 ▼1.395.10 ▼40.39
Dashboard /wp-admin2.10 ▼1.215.23 ▼43.92
Posts /wp-admin/edit.php2.10 ▼1.265.70 ▼42.01
Add New Post /wp-admin/post-new.php2.10 ▼3.795.86 ▼85.13
Media Library /wp-admin/upload.php2.10 ▼1.134.83 ▼26.59
Night Traffic Light /wp-admin/options-general.php?page=NightTrafficLightAdminPage2.105.53

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

Input-output and database impact of this plugin
No storage issues were detected
Filesystem: 17 new files
Database: no new tables, 7 new options
New WordPress options
can_compress_scripts
widget_recent-posts
theysaidso_admin_options
widget_theysaidso_widget
widget_nighttrafficlightwidgetmanuell
widget_recent-comments
db_upgraded

Browser metrics Passed 4 tests

An overview of browser requirements for Night Traffic Light
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,804 ▲6913.26 ▼1.141.83 ▼0.1143.94 ▼3.58
Dashboard /wp-admin2,210 ▲225.79 ▲0.94103.91 ▼4.5337.49 ▼10.89
Posts /wp-admin/edit.php2,093 ▲42.01 ▼0.0039.46 ▲4.7137.06 ▼2.26
Add New Post /wp-admin/post-new.php1,536 ▲2223.47 ▲5.82666.88 ▼28.1864.38 ▲9.51
Media Library /wp-admin/upload.php1,395 ▲74.19 ▲0.0298.26 ▼2.0142.00 ▼0.21
Night Traffic Light /wp-admin/options-general.php?page=NightTrafficLightAdminPage8642.0122.6932.93

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
Please fix the following items
  • Uninstall procedure had uncaught errors
    • > Deprecated in wp-includes/class-wp-hook.php+310
    Non-static method NightTrafficLightLoader::Translate() should not be called statically
  • This plugin did not uninstall successfully, leaving 7 options in the database
    • can_compress_scripts
    • widget_recent-comments
    • db_upgraded
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • widget_recent-posts
    • widget_nighttrafficlightwidgetmanuell

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Please fix the following server-side errors
    • > GET request to /wp-admin/options-general.php?page=NightTrafficLightAdminPage
    • > Deprecated in wp-includes/class-wp-hook.php+310
    Non-static method NightTrafficLightLoader::Translate() should not be called statically
    • > GET request to /wp-admin/options-general.php?page=NightTrafficLightAdminPage
    • > Deprecated in wp-includes/class-wp-hook.php+310
    Non-static method NightTrafficLightLoader::WidgetManuell() should not be called statically
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=NightTrafficLightAdminPage
    • > Deprecated in wp-content/plugins/night-traffic-light/night-traffic-light.php+42
    Non-static method NightTrafficLightLoader::GetBaseFILE() should not be called statically
    • > GET request to /wp-admin/options-general.php?page=NightTrafficLightAdminPage
    • > Deprecated in wp-includes/class-wp-hook.php+310
    Non-static method NightTrafficLightLoader::RegisterAdminPage() should not be called statically
    • > GET request to /wp-admin/options-general.php?page=NightTrafficLightAdminPage
    • > Deprecated in wp-includes/class-wp-hook.php+310
    Non-static method NightTrafficLightLoader::AdminPage() should not be called statically
    • > GET request to /wp-admin/options-general.php?page=NightTrafficLightAdminPage
    • > Notice in wp-content/plugins/night-traffic-light/site/admin_page.php+7
    Undefined index: tab

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
The following issues need your attention
  • 2× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/night-traffic-light/night-traffic-light.php:15
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/night-traffic-light/inc/widget_manuell.php:3

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

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
Please fix the following attributes:
  • Plugin Name: You should set the name of your plugin on the first line ( === night-traffic-light === )
Please take inspiration from this readme.txt

night-traffic-light/night-traffic-light.php Passed 13 tests

The main file in "Night Traffic Light" v. 1.0 serves as a complement to information provided in readme.txt and as the entry point to the plugin
36 characters long description:
Einfaches Ampelsystem für WordPress

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are considered dangerous and should not be included with any WordPress plugin
Success! There were no dangerous files found in this plugin395 lines of code in 6 files:
LanguageFilesBlank linesComment linesLines of code
PHP44545277
PO File23133118

PHP code Passed 2 tests

An overview of cyclomatic complexity and code structure
This plugin has no cyclomatic complexity issues
Cyclomatic complexity
Average complexity per logical line of code0.24
Average class complexity7.50
▷ Minimum class complexity2.00
▷ Maximum class complexity13.00
Average method complexity2.18
▷ Minimum method complexity1.00
▷ Maximum method complexity8.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes2
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes00.00%
Methods11
▷ Static methods00.00%
▷ Public methods11100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions2
▷ Named functions2100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
5 PNG files occupy 0.08MB with 0.03MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
img/support-center.png18.20KB8.07KB▼ 55.63%
img/tb-webtec-logo.png0.76KB1.05KB0.00%
img/red.png19.71KB9.11KB▼ 53.80%
img/yellow.png20.42KB9.25KB▼ 54.69%
img/green.png21.12KB9.22KB▼ 56.32%