84% corona-stats-live

Code Review | Corona Stats Live - Corona Virus COVID-19 Live Stats for WordPress Lite

WordPress plugin Corona Stats Live - Corona Virus COVID-19 Live Stats for WordPress Lite scored84%from 54 tests.

About plugin

  • Plugin page: corona-stats-live
  • Plugin version: 1.2.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.0-5.4
  • WordPress version: 6.3.1
  • First release: May 15, 2020
  • Latest release: Jun 4, 2020
  • Number of updates: 7
  • Update frequency: every 3.0 days
  • Top authors: hafeezpk (100%)

Code review

54 tests

User reviews

3 reviews

Install metrics

30+ active /1,805 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
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.08MB] [CPU: ▼5.39ms] Passed 4 tests

An overview of server-side resources used by Corona Stats Live - Corona Virus COVID-19 Live Stats for WordPress Lite
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.56 ▲0.1038.71 ▼1.69
Dashboard /wp-admin3.39 ▲0.0547.71 ▼12.19
Posts /wp-admin/edit.php3.50 ▲0.1549.00 ▲3.73
Add New Post /wp-admin/post-new.php5.97 ▲0.0885.69 ▼11.40
Media Library /wp-admin/upload.php3.31 ▲0.0838.57 ▲4.56

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

Filesystem and database footprint
No storage issues were detected
Filesystem: 212 new files
Database: no new tables, 9 new options
New WordPress options
CSL-type
db_upgraded
widget_recent-comments
CSL_activation_time
theysaidso_admin_options
widget_recent-posts
widget_theysaidso_widget
can_compress_scripts
CSL-alreadyRated

Browser metrics Passed 4 tests

A check of browser resources used by Corona Stats Live - Corona Virus COVID-19 Live Stats for WordPress Lite
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,868 ▲12214.49 ▲0.1321.91 ▲20.2444.99 ▼1.72
Dashboard /wp-admin2,206 ▲215.91 ▲0.10106.81 ▼1.9938.82 ▼0.67
Posts /wp-admin/edit.php2,092 ▲32.00 ▼0.0138.67 ▲2.4935.05 ▼0.28
Add New Post /wp-admin/post-new.php1,544 ▲1118.30 ▼4.70636.45 ▼22.9256.14 ▲4.98
Media Library /wp-admin/upload.php1,391 ▲34.18 ▼0.1095.26 ▼1.2943.15 ▼1.81

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
Please fix the following items
  • Zombie WordPress options detected upon uninstall: 9 options
    • CSL-alreadyRated
    • widget_theysaidso_widget
    • widget_recent-comments
    • CSL_activation_time
    • theysaidso_admin_options
    • widget_recent-posts
    • CSL-type
    • db_upgraded
    • can_compress_scripts

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
The smoke test was a success, however most plugin functionality was not tested

SRP 50% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle applies for WordPress plugins as well - please make sure your PHP files perform no actions when accessed directly
Please fix the following items
  • 2× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugins_url() in wp-content/plugins/corona-stats-live/classes/csl-utils.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugins_url() in wp-content/plugins/corona-stats-live/classes/csl-utils.php:3

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
No browser errors were detected

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

The readme.txt file is an important file in your plugin as it is parsed by WordPress.org to prepare the public listing of your plugin
5 plugin tags: corona virus, corona virus live, covid19, corona virus live trackers, covid-19 live stats

corona-stats-live/csl-corona-stats.php 92% from 13 tests

The primary PHP file in "Corona Stats Live - Corona Virus COVID-19 Live Stats for WordPress Lite" version 1.2.0 is used by WordPress to initiate all plugin functionality
It is important to fix the following:
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("corona-stats-live.php" instead of "csl-corona-stats.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 detected22,615 lines of code in 14 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript65,1409,62121,588
CSS42138625
PHP46020402

PHP code Passed 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.09
Average class complexity5.33
▷ Minimum class complexity2.00
▷ Maximum class complexity9.00
Average method complexity1.59
▷ Minimum method complexity1.00
▷ Maximum method complexity5.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes3
▷ Abstract classes00.00%
▷ Concrete classes3100.00%
▷ Final classes00.00%
Methods22
▷ Static methods14.55%
▷ Public methods2090.91%
▷ Protected methods00.00%
▷ Private methods29.09%
Functions3
▷ Named functions3100.00%
▷ Anonymous functions00.00%
Constants5
▷ Global constants5100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
196 PNG files occupy 1.30MB with 0.68MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
images/flags/Tanzania.png6.20KB2.98KB▼ 51.85%
images/flags/Congo.png6.36KB3.01KB▼ 52.64%
images/flags/Croatia.png4.03KB1.80KB▼ 55.30%
images/flags/IsleofMan.png3.11KB1.60KB▼ 48.73%
images/flags/Bahamas.png2.65KB1.20KB▼ 54.52%