84% south-african-covid-19-banner

Code Review | South African Covid-19 Banner

WordPress plugin South African Covid-19 Banner scored84%from 54 tests.

About plugin

  • Plugin page: south-african-cov...
  • Plugin version: 0.2.0
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.0-5.4
  • WordPress version: 6.3.1
  • First release: Mar 28, 2020
  • Latest release: Apr 13, 2020
  • Number of updates: 4
  • Update frequency: every 4.0 days
  • Top authors: Seags (100%)

Code review

54 tests

User reviews

3 reviews

Install metrics

200+ active /2,373 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.02MB] [CPU: ▼11.96ms] Passed 4 tests

This is a short check of server-side resources used by South African Covid-19 Banner
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.42 ▼0.0425.84 ▼20.67
Dashboard /wp-admin3.35 ▲0.0549.13 ▼3.16
Posts /wp-admin/edit.php3.40 ▲0.0549.15 ▼5.83
Add New Post /wp-admin/post-new.php5.93 ▲0.0584.18 ▼18.19
Media Library /wp-admin/upload.php3.27 ▲0.0536.35 ▲3.58

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

A short overview of filesystem and database impact
This plugin installed successfully
Filesystem: 17 new files
Database: no new tables, 7 new options
New WordPress options
widget_south-african-covid-19-banner-widget
db_upgraded
widget_recent-comments
widget_recent-posts
theysaidso_admin_options
widget_theysaidso_widget
can_compress_scripts

Browser metrics Passed 4 tests

An overview of browser requirements for South African Covid-19 Banner
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,811 ▲4013.66 ▼0.711.59 ▼0.3139.93 ▼2.39
Dashboard /wp-admin2,205 ▲175.98 ▲0.08112.52 ▲10.5467.20 ▲22.62
Posts /wp-admin/edit.php2,100 ▲82.01 ▼0.1633.50 ▼6.7730.01 ▼5.41
Add New Post /wp-admin/post-new.php1,677 ▲14821.43 ▼1.55751.16 ▲89.9248.82 ▼3.52
Media Library /wp-admin/upload.php1,402 ▲144.24 ▲0.04103.46 ▲1.1149.83 ▲4.66

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 were found after uninstall: 7 options
    • db_upgraded
    • widget_recent-posts
    • can_compress_scripts
    • theysaidso_admin_options
    • widget_south-african-covid-19-banner-widget
    • widget_recent-comments
    • widget_theysaidso_widget

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
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 fix the following
  • 7× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/south-african-covid-19-banner/src/widget.php:13
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html() in wp-content/plugins/south-african-covid-19-banner/src/html/admin/settings.php:12
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/south-african-covid-19-banner/src/html/admin/form.php:8
    • > PHP Fatal error
      Uncaught Error: Call to undefined function SeagynDavis\\SouthAfricaCovid19Banner\\plugin_dir_path() in wp-content/plugins/south-african-covid-19-banner/south-african-covid-19-banner.php:41
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_url() in wp-content/plugins/south-african-covid-19-banner/src/html/page-banner.php:14
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_url() in wp-content/plugins/south-african-covid-19-banner/src/html/banner.php:14
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/south-african-covid-19-banner/src/widget.php:13

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
Everything seems fine on the user side

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
Attributes that need to be fixed:
  • Plugin Name: Write the name of your plugin instead of "Plugin Name" on the first line ( === south-african-covid-19-banner === )
The official readme.txt is a good inspiration

south-african-covid-19-banner/south-african-covid-19-banner.php 92% from 13 tests

The main file in "South African Covid-19 Banner" v. 0.2.0 serves as a complement to information provided in readme.txt and as the entry point to the plugin
It is important to fix the following:
  • Requires PHP: The required version number must match the one declared in readme.txt ("7.2" instead of "5.6")

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
Everything looks great! No dangerous files found in this plugin372 lines of code in 13 files:
LanguageFilesBlank linesComment linesLines of code
PHP1162131230
CSS2260142

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
This plugin has no cyclomatic complexity problems
Cyclomatic complexity
Average complexity per logical line of code0.16
Average class complexity1.00
▷ Minimum class complexity1.00
▷ Maximum class complexity1.00
Average method complexity1.00
▷ Minimum method complexity1.00
▷ Maximum method complexity1.00
Code structure
Namespaces5
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods2
▷ Static methods00.00%
▷ Public methods2100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions11
▷ Named functions981.82%
▷ Anonymous functions218.18%
Constants3
▷ Global constants3100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
2 PNG files occupy 0.08MB with 0.03MB in potential savings
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
resources/images/sacovid19.png76.47KB22.69KB▼ 70.33%
resources/images/flag.png1.51KB1.21KB▼ 19.94%