84% risk-warning-bar

Code Review | Risk Warning Bar

WordPress plugin Risk Warning Bar scored84%from 54 tests.

About plugin

  • Plugin page: risk-warning-bar
  • Plugin version: 1.0
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-5.2
  • WordPress version: 6.3.1
  • First release: Jun 18, 2019
  • Latest release: Jun 20, 2019
  • Number of updates: 5
  • Update frequency: every 2.4 days
  • Top authors: ventureharbour (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /758 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
Install script ran successfully

Server metrics [RAM: ▼0.15MB] [CPU: ▼10.83ms] Passed 4 tests

Analyzing server-side resources used by Risk Warning Bar
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.49 ▲0.0341.86 ▼4.61
Dashboard /wp-admin3.34 ▲0.0452.70 ▲2.14
Posts /wp-admin/edit.php3.39 ▲0.0448.79 ▼4.07
Add New Post /wp-admin/post-new.php5.17 ▼0.7264.40 ▼36.79
Media Library /wp-admin/upload.php3.27 ▲0.0438.65 ▲3.13
Risk Warning Bar /wp-admin/options-general.php?page=risk_warning_bar_settings3.2533.66

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

Input-output and database impact of this plugin
This plugin was installed successfully
Filesystem: 24 new files
Database: no new tables, 8 new options
New WordPress options
theysaidso_admin_options
widget_recent-posts
risk_warning_bar_version
widget_theysaidso_widget
warning_bar_page_views
widget_recent-comments
db_upgraded
can_compress_scripts

Browser metrics Passed 4 tests

Checking browser requirements for Risk Warning Bar
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,825 ▲3913.15 ▼1.061.97 ▼0.1643.12 ▲2.82
Dashboard /wp-admin2,233 ▲324.87 ▼1.01110.90 ▲2.5141.34 ▼3.76
Posts /wp-admin/edit.php2,109 ▲92.06 ▲0.0635.91 ▼4.5436.21 ▲0.18
Add New Post /wp-admin/post-new.php6,245 ▲4,69526.06 ▲2.86913.28 ▲229.4458.86 ▼3.84
Media Library /wp-admin/upload.php1,415 ▲154.27 ▼0.0597.73 ▼2.1442.31 ▼3.01
Risk Warning Bar /wp-admin/options-general.php?page=risk_warning_bar_settings3,8164.81191.2495.51

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
Please fix the following items
  • The uninstall procedure has failed, leaving 8 options in the database
    • widget_recent-comments
    • widget_recent-posts
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • db_upgraded
    • warning_bar_page_views
    • can_compress_scripts
    • risk_warning_bar_version

Smoke tests 75% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Almost there, just fix the following server-side errors
    • > GET request to /wp-admin/options-general.php?page=risk_warning_bar_settings
    • > Notice in wp-content/plugins/risk-warning-bar/includes/lib/class-risk-warning-bar-admin-api.php+206
    Undefined index: description

SRP Passed 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
Looking good! No server-side errors or output on direct access of PHP files

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
There were no browser issues found

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

Perhaps the most important file in your plugin readme.txt gets parsed in order to generate the public listing of your plugin
7 plugin tags: compliance, warning, risk, forex, finance...

risk-warning-bar/risk-warning-bar.php 92% from 13 tests

This is the main PHP file of "Risk Warning Bar" version 1.0, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
It is important to fix the following:
  • Requires at least: Required version does not match the one declared in readme.txt ("5.0" instead of "4.0")

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
Success! There were no dangerous files found in this plugin1,052 lines of code in 18 files:
LanguageFilesBlank linesComment linesLines of code
PHP82384121,013
CSS32028
JavaScript74011

PHP code Passed 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.41
Average class complexity25.80
▷ Minimum class complexity5.00
▷ Maximum class complexity63.00
Average method complexity3.70
▷ Minimum method complexity1.00
▷ Maximum method complexity45.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes5
▷ Abstract classes00.00%
▷ Concrete classes5100.00%
▷ Final classes00.00%
Methods46
▷ Static methods24.35%
▷ Public methods4393.48%
▷ Protected methods00.00%
▷ Private methods36.52%
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
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
assets/img/switch.png3.37KB1.58KB▼ 53.11%