83% covid-19-live-tracking

Code Review | Covid-19 Live Tracking

WordPress plugin Covid-19 Live Tracking scored83%from 54 tests.

About plugin

  • Plugin page: covid-19-live-tra...
  • Plugin version: 1.0.0
  • PHP version: 7.4.16
  • WordPress compatibility: 5.0-5.4
  • WordPress version: 6.3.1
  • First release: Apr 15, 2020
  • Latest release: Apr 15, 2020
  • Number of updates: 4
  • Update frequency: N/A
  • Top authors: jmsthemes (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /1,582 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
Installer ran successfully

Server metrics [RAM: ▲0.45MB] [CPU: ▼0.77ms] Passed 4 tests

Analyzing server-side resources used by Covid-19 Live Tracking
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.95 ▲0.4946.00 ▲2.79
Dashboard /wp-admin3.75 ▲0.4453.20 ▼1.47
Posts /wp-admin/edit.php3.86 ▲0.5050.76 ▼2.63
Add New Post /wp-admin/post-new.php6.33 ▲0.4489.37 ▼1.75
Media Library /wp-admin/upload.php3.67 ▲0.4440.83 ▲4.16

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

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

Browser metrics Passed 4 tests

Covid-19 Live Tracking: an overview of browser usage
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,935 ▲18913.96 ▼0.2510.22 ▲8.2142.34 ▼1.21
Dashboard /wp-admin2,222 ▲345.85 ▲0.95108.44 ▼8.2442.22 ▲0.00
Posts /wp-admin/edit.php2,108 ▲192.04 ▲0.0535.63 ▼2.1735.02 ▼0.68
Add New Post /wp-admin/post-new.php1,527 ▲818.01 ▼5.13591.47 ▼77.3265.04 ▲8.55
Media Library /wp-admin/upload.php1,407 ▲224.27 ▲0.0898.82 ▼15.1644.00 ▼2.15

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
The following items require your attention
  • The uninstall procedure has failed, leaving 8 options in the database
    • widget_recent-comments
    • widget_recent-posts
    • widget_widget_jms_covid_19
    • jms_covid_params
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • can_compress_scripts
    • db_upgraded

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 everything seems fine, this is not an exhaustive test

SRP 50% from 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
Please take a closer look at the following
  • 3× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function did_action() in wp-content/plugins/covid-19-live-tracking/admin/class-jmscovid-elementor.php:9
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/covid-19-live-tracking/front/class-jmscovid-widget.php:13
    • > PHP Fatal error
      Uncaught Error: Class 'Elementor\\Widget_Base' not found in wp-content/plugins/covid-19-live-tracking/admin/widgets/class-jmscovid-elementor-widget.php:17

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
Everything seems fine on the user side

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 94% from 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
Attributes that require attention: The official readme.txt might help

covid-19-live-tracking/jms-covid-19.php 85% from 13 tests

This is the main PHP file of "Covid-19 Live Tracking" version 1.0.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:
  • Text Domain: Since WordPress version 4.6 the text domain is optional; if specified, it must be the same as the plugin slug
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("covid-19-live-tracking.php" instead of "jms-covid-19.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short glimpse at programming languages used with this plugin and a check that no dangerous files are present
Good job! No executable or dangerous file extensions detected11,426 lines of code in 55 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript262,1777,2297,818
PHP71143091,686
CSS19364571,458
Sass3151464

PHP code Passed 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.22
Average class complexity20.17
▷ Minimum class complexity2.00
▷ Maximum class complexity71.00
Average method complexity3.88
▷ Minimum method complexity1.00
▷ Maximum method complexity47.00
Code structure
Namespaces1
Interfaces0
Traits0
Classes6
▷ Abstract classes00.00%
▷ Concrete classes6100.00%
▷ Final classes00.00%
Methods40
▷ Static methods717.50%
▷ Public methods3485.00%
▷ Protected methods37.50%
▷ Private methods37.50%
Functions3
▷ Named functions3100.00%
▷ Anonymous functions00.00%
Constants7
▷ Global constants7100.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
10 PNG files occupy 0.29MB with 0.11MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
css/DataTables-1.10.20/images/sort_asc.png0.16KB0.25KB0.00%
images/style-5.png113.34KB47.57KB▼ 58.03%
css/DataTables-1.10.20/images/sort_both.png0.20KB0.29KB0.00%
images/style-2.png59.83KB19.35KB▼ 67.66%
images/style-1.png23.36KB7.55KB▼ 67.68%