78% sara-covid

Code Review | DR SARA COVID

WordPress plugin DR SARA COVID scored78%from 54 tests.

About plugin

  • Plugin page: sara-covid
  • Plugin version: 1.4
  • PHP compatiblity: 5.2.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 2.5-5.4
  • WordPress version: 6.3.1
  • First release: Apr 29, 2020
  • Latest release: May 4, 2020
  • Number of updates: 36
  • Update frequency: every 0.1 days
  • Top authors: ravikhadka (100%)

Code review

54 tests

User reviews

4 reviews

Install metrics

10+ active /2,665 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.09MB] [CPU: ▼8.54ms] Passed 4 tests

Server-side resources used by DR SARA COVID
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.56 ▲0.1039.52 ▼5.36
Dashboard /wp-admin3.40 ▲0.0644.13 ▼13.05
Posts /wp-admin/edit.php3.51 ▲0.1648.85 ▲0.07
Add New Post /wp-admin/post-new.php6.00 ▲0.1282.30 ▼15.83
Media Library /wp-admin/upload.php3.32 ▲0.1037.64 ▲3.50

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

Filesystem and database footprint
No storage issues were detected
Filesystem: 27 new files
Database: no new tables, 6 new options
New WordPress options
widget_theysaidso_widget
theysaidso_admin_options
widget_recent-posts
db_upgraded
widget_recent-comments
can_compress_scripts

Browser metrics Passed 4 tests

DR SARA COVID: an overview of browser usage
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,899 ▲15313.58 ▼1.165.29 ▲3.4545.10 ▲5.35
Dashboard /wp-admin2,222 ▲344.87 ▼1.02112.17 ▼1.0944.68 ▼0.19
Posts /wp-admin/edit.php2,105 ▲162.00 ▼0.0140.50 ▼1.6434.67 ▼3.25
Add New Post /wp-admin/post-new.php1,528 ▲923.44 ▲0.14640.13 ▼36.9064.48 ▲1.31
Media Library /wp-admin/upload.php1,401 ▲134.09 ▼0.1794.24 ▼12.6343.51 ▼6.70

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
You still need to fix the following
  • The uninstall procedure has failed, leaving 6 options in the database
    • widget_recent-posts
    • theysaidso_admin_options
    • widget_recent-comments
    • widget_theysaidso_widget
    • can_compress_scripts
    • db_upgraded

Smoke tests 50% 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)
Everything seems fine, however this is by no means an exhaustive test

SRP 0% 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
  • 3× GET requests to PHP files return non-empty strings:
    • > /wp-content/plugins/sara-covid/public/partials/dr-sara-covid-public-display.php
    • > /wp-content/plugins/sara-covid/admin/country-name.php
    • > /wp-content/plugins/sara-covid/admin/partials/dr-sara-covid-admin-display.php
  • 3× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/sara-covid/admin/class-dr-sara-covid-admin.php:106
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_shortcode() in wp-content/plugins/sara-covid/admin/dr-sara-covid.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/sara-covid/admin/back.php:2

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
No browser issues were found

Optimizations

Plugin configuration 90% from 29 tests

readme.txt Passed 16 tests

Perhaps the most important file in your plugin readme.txt gets parsed in order to generate the public listing of your plugin
10 plugin tags: coronavirus, nepal, usa, coronavirus update, covid live...

sara-covid/dr-sara-covid.php 77% from 13 tests

The entry point to "DR SARA COVID" version 1.4 is a PHP file that has certain tags in its header comment area
Please take the time to fix the following:
  • Text Domain: If you choose to specify the text domain, it must be the same as the plugin slug; optional since WordPress version 4.6
  • Main file name: Name the main plugin file the same as the plugin slug ("sara-covid.php" instead of "dr-sara-covid.php")
  • Description: The description should be shorter than 140 characters (currently 258 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
Everything looks great! No dangerous files found in this plugin963 lines of code in 20 files:
LanguageFilesBlank linesComment linesLines of code
PHP15197553832
PO File13434104
CSS20816
JavaScript285411

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.31
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%
Functions13
▷ Named functions13100.00%
▷ Anonymous functions00.00%
Constants1
▷ Global constants1100.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
PNG images were not found in this plugin