84% doorhub

Code Review | Doorhub

WordPress plugin Doorhub scored84%from 54 tests.

About plugin

  • Plugin page: doorhub
  • Plugin version: 2.0.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-5.4.1
  • WordPress version: 6.3.1
  • First release: May 27, 2020
  • Latest release: Nov 25, 2021
  • Number of updates: 25
  • Update frequency: every 21.9 days
  • Top authors: doorhub2020 (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /700 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.02MB] [CPU: ▼6.29ms] Passed 4 tests

An overview of server-side resources used by Doorhub
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.49 ▲0.0345.69 ▼2.91
Dashboard /wp-admin3.33 ▼0.0150.71 ▼19.55
Posts /wp-admin/edit.php3.38 ▲0.0351.82 ▲2.40
Add New Post /wp-admin/post-new.php5.91 ▲0.0396.14 ▼5.10
Media Library /wp-admin/upload.php3.26 ▲0.0338.95 ▲2.91

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

Analyzing filesystem and database footprints of this plugin
No storage issues were detected
Filesystem: 36 new files
Database: no new tables, 6 new options
New WordPress options
widget_theysaidso_widget
can_compress_scripts
widget_recent-comments
theysaidso_admin_options
widget_recent-posts
db_upgraded

Browser metrics Passed 4 tests

A check of browser resources used by Doorhub
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,789 ▲2814.68 ▲0.331.74 ▼0.0743.76 ▲1.51
Dashboard /wp-admin2,192 ▲185.52 ▼0.1385.86 ▼15.3735.03 ▼8.67
Posts /wp-admin/edit.php2,100 ▼31.98 ▼0.0335.80 ▲0.0137.25 ▲1.91
Add New Post /wp-admin/post-new.php1,529 ▲323.11 ▼0.61664.06 ▼33.4260.12 ▲4.23
Media Library /wp-admin/upload.php1,400 ▼04.22 ▲0.0695.78 ▼11.9540.51 ▼7.98

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
You still need to fix the following
  • The uninstall procedure has failed, leaving 6 options in the database
    • can_compress_scripts
    • widget_recent-comments
    • widget_theysaidso_widget
    • db_upgraded
    • widget_recent-posts
    • theysaidso_admin_options

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
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: PHP files have to remain inert when accessed directly, throwing no errors and performing no actions
Please fix the following items
  • 7× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Class 'WC_Shipping_Method' not found in wp-content/plugins/doorhub/public/class-wc-doorhub-shipping-sameday.php:3
    • > PHP Fatal error
      Uncaught Error: Class 'WC_Shipping_Method' not found in wp-content/plugins/doorhub/public/class-wc-doorhub-shipping.php:5
    • > PHP Fatal error
      Uncaught Error: Call to undefined function __() in wp-content/plugins/doorhub/public/partials/wc-doorhub-public-display.php:9
    • > PHP Fatal error
      Uncaught Error: Call to a member function get_meta() on null in wp-content/plugins/doorhub/admin/partials/order-doorhub-metabox.php:5
    • > PHP Fatal error
      Uncaught Error: Class 'WC_Shipping_Method' not found in wp-content/plugins/doorhub/public/class-wc-doorhub-shipping-quick-commerce.php:4
    • > PHP Fatal error
      Uncaught Error: Class 'WC_Shipping_Method' not found in wp-content/plugins/doorhub/public/class-wc-doorhub-shipping-on-demand.php:4
    • > PHP Notice
      Undefined variable: order in wp-content/plugins/doorhub/admin/partials/order-doorhub-metabox.php on line 5

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 Passed 16 tests

The readme.txt file uses markdown syntax to describe your plugin to the world
3 plugin tags: shipping, woocommerce, ecommerce

doorhub/wc-doorhub.php 85% from 13 tests

The main PHP script in "Doorhub" version 2.0.0 is automatically included on every request by WordPress
You should first fix the following items:
  • Text Domain: You no longer need to specify the text domain since WordPress 4.6; it must be the same as the plugin slug
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("doorhub.php" instead of "wc-doorhub.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short check of programming languages and file extensions; no executable files are allowed
Everything looks great! No dangerous files found in this plugin1,356 lines of code in 24 files:
LanguageFilesBlank linesComment linesLines of code
PHP183899611,239
JavaScript3201473
Markdown113030
CSS22014

PHP code Passed 2 tests

This is a very shot review 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.37
Average class complexity9.38
▷ Minimum class complexity1.00
▷ Maximum class complexity68.00
Average method complexity2.63
▷ Minimum method complexity1.00
▷ Maximum method complexity36.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes13
▷ Abstract classes00.00%
▷ Concrete classes13100.00%
▷ Final classes00.00%
Methods67
▷ Static methods45.97%
▷ Public methods5886.57%
▷ Protected methods00.00%
▷ Private methods913.43%
Functions3
▷ Named functions3100.00%
▷ Anonymous functions00.00%
Constants1
▷ Global constants1100.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
4 PNG files occupy 0.42MB with 0.24MB in potential savings
Potential savings
Compression of 4 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/screenshot-3.png56.78KB25.54KB▼ 55.02%
assets/screenshot-4.png56.78KB25.54KB▼ 55.02%
assets/screenshot-1.png176.24KB72.16KB▼ 59.06%
assets/screenshot-2.png138.72KB59.64KB▼ 57.01%