78% covid-19-nepal

Code Review | Covid-19 Nepal

WordPress plugin Covid-19 Nepal scored78%from 54 tests.

About plugin

  • Plugin page: covid-19-nepal
  • Plugin version: 1.0.0
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-5.4
  • WordPress version: 6.3.1
  • First release: Apr 21, 2020
  • Latest release: Apr 21, 2020
  • Number of updates: 11
  • Update frequency: N/A
  • Top authors: shankhadev123 (100%)

Code review

54 tests

User reviews

1 review

Install metrics

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

Server metrics [RAM: ▲0.01MB] [CPU: ▼4.07ms] Passed 4 tests

An overview of server-side resources used by Covid-19 Nepal
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0136.93 ▲0.40
Dashboard /wp-admin3.31 ▲0.0141.66 ▼4.53
Posts /wp-admin/edit.php3.36 ▲0.0140.93 ▼8.88
Add New Post /wp-admin/post-new.php5.89 ▲0.0186.49 ▼3.27
Media Library /wp-admin/upload.php3.24 ▲0.0136.58 ▲2.22

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

A short overview of filesystem and database impact
The plugin installed successfully
Filesystem: 11 new files
Database: no new tables, 6 new options
New WordPress options
theysaidso_admin_options
can_compress_scripts
widget_theysaidso_widget
widget_recent-posts
db_upgraded
widget_recent-comments

Browser metrics Passed 4 tests

An overview of browser requirements for Covid-19 Nepal
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,891 ▲13013.57 ▼0.7812.19 ▲10.6847.84 ▲5.26
Dashboard /wp-admin2,209 ▲325.56 ▼0.0583.82 ▲1.3682.35 ▲37.88
Posts /wp-admin/edit.php2,114 ▲142.01 ▲0.0334.42 ▼1.9935.21 ▼2.71
Add New Post /wp-admin/post-new.php1,694 ▲16822.07 ▼1.08669.24 ▼16.6650.37 ▼10.88
Media Library /wp-admin/upload.php1,411 ▲84.21 ▲0.0799.33 ▼9.9474.40 ▲30.59

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
Please fix the following items
  • Zombie WordPress options detected upon uninstall: 6 options
    • widget_theysaidso_widget
    • can_compress_scripts
    • widget_recent-posts
    • db_upgraded
    • widget_recent-comments
    • theysaidso_admin_options

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Good news, no errors were detected

SRP 0% 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 items
  • 1× PHP files output text when accessed directly:
    • > /wp-content/plugins/covid-19-nepal/covid19.template.php
  • 2× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/covid-19-nepal/class.covid19.front.php:28
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/covid-19-nepal/class.covid19.admin.php:27

User-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
No browser errors were detected

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
Please fix the following attributes:
  • Screenshots: Screenshot #1 (Front Display) image missing
You can take inspiration from this readme.txt

covid-19-nepal/covid19-nepal.php 85% from 13 tests

This is the main PHP file of "Covid-19 Nepal" 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
Please make the necessary changes and fix the following:
  • Description: The description should be shorter than 140 characters (currently 148 characters long)
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("covid-19-nepal.php" instead of "covid19-nepal.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are not allowed as they can serve as attack vectors
No dangerous file extensions were detected153 lines of code in 7 files:
LanguageFilesBlank linesComment linesLines of code
PHP42653143
CSS2009
JavaScript1001

PHP code Passed 2 tests

An overview of cyclomatic complexity and code structure
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.30
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
Namespaces0
Interfaces0
Traits0
Classes2
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes00.00%
Methods7
▷ Static methods00.00%
▷ Public methods7100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions2
▷ Named functions00.00%
▷ Anonymous functions2100.00%
Constants4
▷ Global constants4100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
2 PNG files occupy 0.14MB with 0.04MB in potential savings
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
images/covid-19.png1.23KB1.24KB0.00%
images/banner.png146.27KB55.22KB▼ 62.25%