84% bw-coronavirus-banner

Code Review | BW Coronavirus Banner

WordPress plugin BW Coronavirus Banner scored84%from 54 tests.

About plugin

  • Plugin page: bw-coronavirus-ba...
  • Plugin version: 2.0.3
  • PHP compatiblity: 5.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.0-5.4
  • WordPress version: 6.3.1
  • First release: Apr 30, 2020
  • Latest release: May 1, 2020
  • Number of updates: 6
  • Update frequency: every 0.3 days
  • Top authors: cyberdevwp (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /451 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.05MB] [CPU: ▼6.24ms] Passed 4 tests

Server-side resources used by BW Coronavirus Banner
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.45 ▼0.0231.48 ▼3.89
Dashboard /wp-admin3.38 ▲0.0743.96 ▼3.99
Posts /wp-admin/edit.php3.49 ▲0.1346.57 ▼0.39
Add New Post /wp-admin/post-new.php5.98 ▲0.0991.71 ▼16.70
Media Library /wp-admin/upload.php3.30 ▲0.0740.98 ▲6.74

Server storage [IO: ▲0.58MB] [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: 23 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-posts
db_upgraded
can_compress_scripts
theysaidso_admin_options
widget_recent-comments
widget_theysaidso_widget

Browser metrics Passed 4 tests

An overview of browser requirements for BW Coronavirus Banner
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,942 ▲19613.91 ▼0.218.21 ▲6.5538.68 ▲0.12
Dashboard /wp-admin2,239 ▲625.77 ▲0.0988.34 ▲2.8989.60 ▲45.99
Posts /wp-admin/edit.php2,156 ▲592.29 ▲0.3340.34 ▲5.5635.83 ▲1.46
Add New Post /wp-admin/post-new.php1,725 ▲19922.77 ▼0.23655.37 ▼14.8633.66 ▼15.69
Media Library /wp-admin/upload.php1,450 ▲534.47 ▲0.26100.05 ▼1.6774.51 ▲28.23

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
It is recommended to fix the following
  • Zombie WordPress options were found after uninstall: 6 options
    • db_upgraded
    • can_compress_scripts
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • widget_recent-posts
    • widget_recent-comments

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Even though no errors were found, this is by no means an exhaustive test

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
  • 4× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function BW\\Covid19\\BannerDisplay\\add_filter() in wp-content/plugins/bw-coronavirus-banner/includes/banner.php:9
    • > PHP Fatal error
      Uncaught Error: Call to undefined function BW\\Covid19\\BannerDisplay\\add_filter() in wp-content/plugins/bw-coronavirus-banner/includes/banner.php:9
    • > PHP Fatal error
      Uncaught Error: Call to undefined function BW\\Covid19\\BannerDisplay\\add_filter() in wp-content/plugins/bw-coronavirus-banner/includes/banner.php:9
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/bw-coronavirus-banner/includes/user/banner.php:7

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 errors were detected

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% from 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
Attributes that require attention: Please take inspiration from this readme.txt

bw-coronavirus-banner/bw-coronavirus-banner.php Passed 13 tests

The principal PHP file in "BW Coronavirus Banner" v. 2.0.3 is loaded by WordPress automatically on each request
74 characters long description:
Options to add a banner of your choice to your WordPress site in Botswana.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of programming languages used in this plugin; dangerous file extensions are not allowed
There were no executable files found in this plugin667 lines of code in 17 files:
LanguageFilesBlank linesComment linesLines of code
PHP8162117333
CSS2420289
JavaScript65334
Markdown110011

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
No cyclomatic complexity issues were detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.30
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
Namespaces4
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%
Functions21
▷ Named functions2095.24%
▷ Anonymous functions14.76%
Constants3
▷ Global constants3100.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
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/images/bw_flag.png1.57KB0.91KB▼ 41.83%