72% corona-virus-data

Code Review | Corona Virus Data

WordPress plugin Corona Virus Data scored72%from 54 tests.

About plugin

  • Plugin page: corona-virus-data
  • Plugin version: 1.4.2
  • PHP version: 7.4.16
  • WordPress version: 6.3.1
  • First release: Feb 21, 2020
  • Latest release: Apr 13, 2022
  • Number of updates: 42
  • Update frequency: every 18.6 days
  • Top authors: freeduke (100%)

Code review

54 tests

User reviews

12 reviews

Install metrics

2,000+ active /60,443 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
Installer ran successfully

Server metrics [RAM: ▲0.31MB] [CPU: ▼11.93ms] Passed 4 tests

Server-side resources used by Corona Virus Data
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.77 ▲0.3025.87 ▼17.06
Dashboard /wp-admin3.63 ▲0.2844.95 ▼18.66
Posts /wp-admin/edit.php3.74 ▲0.3847.09 ▲5.26
Add New Post /wp-admin/post-new.php6.23 ▲0.3488.85 ▼14.03
Media Library /wp-admin/upload.php3.55 ▲0.3235.09 ▲2.04
Corona Virus Data /wp-admin/options-general.php?page=corona-virus-data3.5233.37

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

Analyzing filesystem and database footprints of this plugin
This plugin was installed successfully
Filesystem: 287 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-posts
widget_theysaidso_widget
db_upgraded
can_compress_scripts
widget_recent-comments
theysaidso_admin_options

Browser metrics Passed 4 tests

A check of browser resources used by Corona Virus Data
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,836 ▲9013.31 ▼1.074.65 ▲2.9539.45 ▼3.54
Dashboard /wp-admin2,215 ▲274.95 ▼0.99110.77 ▼5.1438.31 ▼7.97
Posts /wp-admin/edit.php2,098 ▲62.02 ▲0.0239.90 ▼1.4637.32 ▼0.44
Add New Post /wp-admin/post-new.php1,530 ▲1118.25 ▼4.90594.96 ▼31.0057.89 ▲8.43
Media Library /wp-admin/upload.php1,397 ▲64.24 ▲0.0596.22 ▼5.5740.15 ▼3.30
Corona Virus Data /wp-admin/options-general.php?page=corona-virus-data2,7232.1528.8234.33

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
  • Zombie WordPress options were found after uninstall: 6 options
    • widget_theysaidso_widget
    • widget_recent-posts
    • db_upgraded
    • can_compress_scripts
    • theysaidso_admin_options
    • widget_recent-comments

Smoke tests 25% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Everything seems fine, however this is by no means an exhaustive test

SRP 0% 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
Please fix the following
  • 2× GET requests to PHP files return non-empty strings:
    • > /wp-content/plugins/corona-virus-data/admin/partials/corona-virus-data-admin-display.php
    • > /wp-content/plugins/corona-virus-data/public/partials/corona-virus-data-public-display.php
  • 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/corona-virus-data/includes/class-corona-virus-data.php:219
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/corona-virus-data/admin/class-corona-virus-data-admin.php:92

User-side errors 0% from 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
Please fix the following browser errors
    • > GET request to /wp-admin/options-general.php?page=corona-virus-data
    • > Javascript (severe) in unknown
    /wp-admin/options-general.php?page=corona-virus-data - Access to XMLHttpRequest at 'https://corona.lmao.ninja/v3/covid-19/all' from origin '' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource.
    • > GET request to /wp-admin/options-general.php?page=corona-virus-data
    • > Network (severe)
    https://corona.lmao.ninja/v3/covid-19/all - Failed to load resource: net::ERR_FAILED

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

Perhaps the most important file in your plugin readme.txt gets parsed in order to generate the public listing of your plugin
Attributes that need to be fixed:
  • Screenshots: No descriptions were found for these screenshots #2, #3, #4, #5 in corona-virus-data/assets to your readme.txt
The official readme.txt might help

corona-virus-data/corona-virus-data.php 92% from 13 tests

The entry point to "Corona Virus Data" version 1.4.2 is a PHP file that has certain tags in its header comment area
Please take the time to fix the following:
  • Description: If Twitter did it, so should we! Keep the description under 140 characters (currently 171 characters long)

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 plugin600 lines of code in 24 files:
LanguageFilesBlank linesComment linesLines of code
SVG211379
JavaScript7719205
PHP1201113
CSS3003

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.01
Average class complexity1.43
▷ Minimum class complexity1.00
▷ Maximum class complexity3.00
Average method complexity1.13
▷ Minimum method complexity1.00
▷ Maximum method complexity3.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes7
▷ Abstract classes00.00%
▷ Concrete classes7100.00%
▷ Final classes00.00%
Methods23
▷ Static methods28.70%
▷ Public methods1878.26%
▷ Protected methods00.00%
▷ Private methods521.74%
Functions23
▷ Named functions23100.00%
▷ Anonymous functions00.00%
Constants2
▷ Global constants2100.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
257 compressed PNG files occupy 0.81MB
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
public/img/flags/de.png0.13KB0.13KB0.00%
public/img/flags/me.png7.52KB4.41KB▼ 41.34%
public/img/flags/gi.png3.98KB2.65KB▼ 33.46%
public/img/flags/ee.png0.20KB0.21KB0.00%
public/img/flags/us.png2.32KB2.45KB0.00%