84% covid-hospitals-bd

Code Review | Covid Hospitals BD

WordPress plugin Covid Hospitals BD scored 84% from 54 tests.

About plugin

  • Plugin page: covid-hospitals-bd
  • Plugin version: 1.0.2
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.2-5.8
  • WordPress version: 5.8.1
  • First release: Aug 4, 2021
  • Latest release: Aug 13, 2021
  • Number of updates: 32
  • Update frequency: every 0.3 days
  • Top authors: ratulhasan (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active / 125 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 gracefully, with no errors

Server metrics [RAM: ▲0.07MB] [CPU: ▼143.76ms] Passed 4 tests

A check of server-side resources used by Covid Hospitals BD
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /2.94 ▲0.1030.90 ▼5.12
Dashboard /wp-admin3.12 ▲0.0644.82 ▼3.45
Posts /wp-admin/edit.php3.23 ▲0.1246.67 ▲5.43
Add New Post /wp-admin/post-new.php5.48 ▲0.0594.93 ▼562.59
Media Library /wp-admin/upload.php3.06 ▲0.0532.34 ▼3.86

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

How much does this plugin use your filesystem and database?
The plugin installed successfully
Filesystem: 47 new files
Database: no new tables, 2 new options
New WordPress options
covid_hospitals_bd_installed
covid_hospitals_bd_version

Browser metrics Passed 4 tests

This is an overview of browser requirements for Covid Hospitals BD
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,818 ▲22216.46 ▲0.7417.76 ▲9.3160.47 ▲8.33
Dashboard /wp-admin2,967 ▲335.88 ▼0.13142.57 ▼2.11120.19 ▲3.47
Posts /wp-admin/edit.php2,739 ▼02.71 ▲0.0161.97 ▲2.0191.90 ▲3.86
Add New Post /wp-admin/post-new.php1,683 ▼20618.77 ▼0.29371.60 ▲8.15107.25 ▼5.93
Media Library /wp-admin/upload.php1,807 ▲35.02 ▼0.03149.65 ▲0.58116.00 ▼9.62

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
It is recommended to fix the following
  • This plugin does not fully uninstall, leaving 2 options in the database
    • covid_hospitals_bd_version
    • covid_hospitals_bd_installed

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 | It is important to ensure that your PHP files perform no action when accessed directly, respecting the single-responsibility principle
The following issues need your attention
  • 8× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Warning
      Use of undefined constant C19H_INC_DIR - assumed 'C19H_INC_DIR' (this will throw an Error in a future version of PHP) in wp-content/plugins/covid-hospitals-bd/includes/templates/c19h_single.php on line 16
    • > PHP Warning
      Use of undefined constant C19H_INC_DIR - assumed 'C19H_INC_DIR' (this will throw an Error in a future version of PHP) in wp-content/plugins/covid-hospitals-bd/includes/templates/c19h_details.php on line 16
    • > PHP Warning
      require_once(C19H_INC_DIR/templates/c19h_search_form.php): failed to open stream: No such file or directory in wp-content/plugins/covid-hospitals-bd/includes/templates/c19h_details.php on line 16
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_url_raw() in wp-content/plugins/covid-hospitals-bd/includes/templates/c19h_search_form.php:15
    • > PHP Warning
      require_once(C19H_INC_DIR/templates/c19h_search_form.php): failed to open stream: No such file or directory in wp-content/plugins/covid-hospitals-bd/includes/templates/c19h_single.php on line 16
    • > PHP Fatal error
      require_once(): Failed opening required 'C19H_INC_DIR/templates/c19h_search_form.php' (include_path='.:/usr/share/php') in wp-content/plugins/covid-hospitals-bd/includes/templates/c19h_details.php on line 16
    • > PHP Fatal error
      require_once(): Failed opening required 'C19H_INC_DIR/templates/c19h_search_form.php' (include_path='.:/usr/share/php') in wp-content/plugins/covid-hospitals-bd/includes/templates/c19h_single.php on line 16
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_url_raw() in wp-content/plugins/covid-hospitals-bd/includes/templates/c19h_home.php:16

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 93% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
These attributes need to be fixed:
  • Screenshots: These screenshots have no corresponding images in /assets: #1 (Home), #2 (Available Beds), #3 (Hospital details), #4 (Oxygen information)
The official readme.txt is a good inspiration

covid-hospitals-bd/covid-hospitals-bd.php 92% from 13 tests

This is the main PHP file of "Covid Hospitals BD" version 1.0.2, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
The following require your attention:
  • Domain Path: The domain path folder does not exist ("/languages")

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
Good job! No executable or dangerous file extensions detected21,980 lines of code in 34 files:
LanguageFilesBlank linesComment linesLines of code
CSS71,4684513,039
JavaScript52,0431,7157,832
PHP192493981,083
JSON20025
SVG1001

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
This plugin has no cyclomatic complexity issues
Cyclomatic complexity
Average complexity per logical line of code0.39
Average class complexity11.11
▷ Minimum class complexity1.00
▷ Maximum class complexity44.00
Average method complexity2.90
▷ Minimum method complexity1.00
▷ Maximum method complexity19.00
Code structure
Namespaces4
Interfaces0
Traits0
Classes9
▷ Abstract classes00.00%
▷ Concrete classes9100.00%
▷ Final classes111.11%
Methods49
▷ Static methods1632.65%
▷ Public methods4795.92%
▷ Protected methods00.00%
▷ Private methods24.08%
Functions3
▷ Named functions266.67%
▷ Anonymous functions133.33%
Constants10
▷ Global constants990.00%
▷ Class constants110.00%
▷ Public constants1100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
There were not PNG files found in your plugin