84% sa-coronavirus-banner

Code Review | SA Coronavirus Banner

WordPress plugin SA Coronavirus Banner scored84%from 54 tests.

About plugin

  • Plugin page: sa-coronavirus-ba...
  • Plugin version: 2.1.1
  • PHP compatiblity: 5.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.0-5.9.1
  • WordPress version: 6.3.1
  • First release: Mar 31, 2020
  • Latest release: Mar 10, 2022
  • Number of updates: 26
  • Update frequency: every 27.3 days
  • Top authors: robinrsa (100%)

Code review

54 tests

User reviews

5 reviews

Install metrics

100+ active /3,559 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

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

Server metrics [RAM: ▲0.05MB] [CPU: ▼5.25ms] Passed 4 tests

A check of server-side resources used by SA Coronavirus Banner
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.44 ▼0.0228.12 ▼12.40
Dashboard /wp-admin3.37 ▲0.0751.84 ▼3.15
Posts /wp-admin/edit.php3.49 ▲0.1348.97 ▼2.43
Add New Post /wp-admin/post-new.php5.97 ▲0.0985.39 ▼3.03
Media Library /wp-admin/upload.php3.30 ▲0.0736.49 ▲1.54

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

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

Browser metrics Passed 4 tests

A check of browser resources used by SA Coronavirus Banner
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,917 ▲15614.07 ▼0.469.16 ▲7.5548.01 ▼0.82
Dashboard /wp-admin2,239 ▲594.96 ▼0.7188.86 ▼0.6981.79 ▲37.62
Posts /wp-admin/edit.php2,150 ▲472.33 ▲0.2539.40 ▼4.0836.41 ▼4.07
Add New Post /wp-admin/post-new.php1,562 ▲3623.67 ▲0.44776.84 ▲92.3537.09 ▼13.65
Media Library /wp-admin/upload.php1,441 ▲414.48 ▲0.31104.44 ▼4.5082.32 ▲34.18

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
These items require your attention
  • The uninstall procedure has failed, leaving 6 options in the database
    • can_compress_scripts
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • db_upgraded
    • widget_recent-comments
    • widget_recent-posts

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Everything seems fine, however this is by no means an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | It is important to ensure that your PHP files perform no action when accessed directly, respecting the single-responsibility principle
Almost there! Just fix the following items
  • 4× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function SA\\Covid19\\BannerDisplay\\add_filter() in wp-content/plugins/sa-coronavirus-banner/includes/banner.php:9
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/sa-coronavirus-banner/includes/user/banner.php:7
    • > PHP Fatal error
      Uncaught Error: Call to undefined function SA\\Covid19\\BannerDisplay\\add_filter() in wp-content/plugins/sa-coronavirus-banner/includes/banner.php:9
    • > PHP Fatal error
      Uncaught Error: Call to undefined function SA\\Covid19\\BannerDisplay\\add_filter() in wp-content/plugins/sa-coronavirus-banner/includes/banner.php:9

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
There were no browser issues found

Optimizations

Plugin configuration Passed 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
2 plugin tags: south-africa, covid-19

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

This is the main PHP file of "SA Coronavirus Banner" version 2.1.1, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
107 characters long description:
Options to add a banner of your choice to your WordPress site as stipulated by the South African Goverment.

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 plugin533 lines of code in 17 files:
LanguageFilesBlank linesComment linesLines of code
PHP8162116330
CSS2240155
JavaScript65334
Markdown111014

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.29
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

Often times overlooked, PNG files can occupy unnecessary space in 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/images/sa-flag.png1.51KB1.21KB▼ 19.94%