77% delivery-date-system-for-woocommerce

Code Review | Delivery Date System for WooCommerce

WordPress plugin Delivery Date System for WooCommerce scored77%from 54 tests.

About plugin

  • Plugin page: delivery-date-sys...
  • Plugin version: 1.0.0
  • PHP compatiblity: 7.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.0-5.1
  • WordPress version: 6.3.1
  • First release: Mar 14, 2019
  • Latest release: Mar 15, 2019
  • Number of updates: 4
  • Update frequency: every 2.5 days
  • Top authors: hastedesign (100%)

Code review

54 tests

User reviews

1 review

Install metrics

50+ active /2,080 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.64MB] [CPU: ▲2.86ms] Passed 4 tests

An overview of server-side resources used by Delivery Date System for WooCommerce
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.89 ▲0.4248.31 ▲4.05
Dashboard /wp-admin4.03 ▲0.7251.16 ▲3.45
Posts /wp-admin/edit.php4.05 ▲0.6954.89 ▲10.97
Add New Post /wp-admin/post-new.php6.61 ▲0.7285.71 ▼7.03
Media Library /wp-admin/upload.php3.95 ▲0.7146.92 ▲11.38
Delivery Dates /wp-admin/admin.php?page=delivery_date4.2738.82

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

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

Browser metrics Passed 4 tests

Delivery Date System for WooCommerce: an overview of browser usage
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,811 ▲7613.41 ▼0.971.97 ▲0.0244.21 ▼0.94
Dashboard /wp-admin2,214 ▲236.01 ▲0.1298.45 ▼3.3539.17 ▼10.59
Posts /wp-admin/edit.php2,103 ▲142.07 ▲0.0541.82 ▲2.4934.71 ▲0.85
Add New Post /wp-admin/post-new.php1,521 ▲723.46 ▲6.01681.61 ▼7.4952.00 ▼15.30
Media Library /wp-admin/upload.php1,399 ▲114.29 ▲0.02109.21 ▲2.9143.88 ▼2.13
Delivery Dates /wp-admin/admin.php?page=delivery_date1,0982.4938.9028.60

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
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • theysaidso_admin_options
    • widget_recent-posts
    • db_upgraded
    • can_compress_scripts
    • widget_theysaidso_widget
    • widget_recent-comments

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)
Even though everything seems fine, this is not an exhaustive test

SRP 0% 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
  • 1× PHP files output text when accessed directly:
    • > /wp-content/plugins/delivery-date-system-for-woocommerce/vendor/cmb2/apigen/hook-docs.php
  • 97× PHP files trigger server errors when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'CMB2_Type_Base' not found in wp-content/plugins/delivery-date-system-for-woocommerce/vendor/cmb2/includes/types/CMB2_Type_Text.php:13
    • > PHP Warning
      file_get_contents(/Users/JT/Sites/wpengine/api/tree.html): failed to open stream: No such file or directory in wp-content/plugins/delivery-date-system-for-woocommerce/vendor/cmb2/apigen/hook-docs.php on line 221
    • > PHP Fatal error
      Uncaught Error: Class 'Composer\\Installer\\LibraryInstaller' not found in wp-content/plugins/delivery-date-system-for-woocommerce/vendor/composer/installers/src/Composer/Installers/Installer.php:8
    • > PHP Fatal error
      Uncaught Error: Class 'CMB2_Type_Select' not found in wp-content/plugins/delivery-date-system-for-woocommerce/vendor/cmb2/includes/types/CMB2_Type_Select_Timezone.php:13
    • > PHP Fatal error
      Uncaught Error: Class 'Composer\\Installers\\BaseInstaller' not found in wp-content/plugins/delivery-date-system-for-woocommerce/vendor/composer/installers/src/Composer/Installers/MagentoInstaller.php:4
    • > PHP Fatal error
      require_once(): Failed opening required '/includes/functions.php' (include_path='.:/usr/share/php') in wp-content/plugins/delivery-date-system-for-woocommerce/vendor/cmb2/tests/bootstrap.php on line 24
    • > PHP Fatal error
      Uncaught Error: Class 'Composer\\Installers\\BaseInstaller' not found in wp-content/plugins/delivery-date-system-for-woocommerce/vendor/composer/installers/src/Composer/Installers/TYPO3FlowInstaller.php:7
    • > PHP Fatal error
      Uncaught Error: Class 'Composer\\Installers\\BaseInstaller' not found in wp-content/plugins/delivery-date-system-for-woocommerce/vendor/composer/installers/src/Composer/Installers/OxidInstaller.php:4
    • > PHP Fatal error
      Uncaught Error: Class 'Composer\\Installers\\BaseInstaller' not found in wp-content/plugins/delivery-date-system-for-woocommerce/vendor/composer/installers/src/Composer/Installers/WolfCMSInstaller.php:4
    • > PHP Fatal error
      Uncaught Error: Class 'WP_UnitTestCase' not found in wp-content/plugins/delivery-date-system-for-woocommerce/vendor/cmb2/tests/cmb-tests-base.php:10

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
Everything seems fine on the user side

Optimizations

Plugin configuration 83% from 29 tests

readme.txt Passed 16 tests

The readme.txt file uses markdown syntax to describe your plugin to the world
4 plugin tags: delivery, woocommerce, orders, delivery date

delivery-date-system-for-woocommerce/delivery-date-system.php 62% from 13 tests

This is the main PHP file of "Delivery Date System for WooCommerce" 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
The following require your attention:
  • Domain Path: Prefix the domain path with a forward slash character ("/languages/")
  • Domain Path: Use only dashes and lowercase characters for the domain path ("languages/")
  • Text Domain: The text domain must be the same as the plugin slug, although optional since WordPress version 4.6
  • Requires at least: Required version must be the same as the one declared in readme.txt ("4.6" instead of "3.0.0")
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("delivery-date-system-for-woocommerce.php" instead of "delivery-date-system.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of file extensions present in this plugin and a short test that no dangerous files are bundled with this plugin
Success! There were no dangerous files found in this plugin63,675 lines of code in 313 files:
LanguageFilesBlank linesComment linesLines of code
PO File12214,48218,91932,538
PHP1253,3787,10012,939
CSS141,2711,1645,098
XML3204,521
JSON7003,852
JavaScript155217152,799
Sass16300251,379
Bourne Shell46745209
YAML2116190
Markdown3330116
diff216834

PHP code Passed 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.34
Average class complexity12.19
▷ Minimum class complexity1.00
▷ Maximum class complexity183.00
Average method complexity2.58
▷ Minimum method complexity1.00
▷ Maximum method complexity31.00
Code structure
Namespaces3
Interfaces0
Traits0
Classes129
▷ Abstract classes1310.08%
▷ Concrete classes11689.92%
▷ Final classes00.00%
Methods921
▷ Static methods12813.90%
▷ Public methods77684.26%
▷ Protected methods13714.88%
▷ Private methods80.87%
Functions58
▷ Named functions5493.10%
▷ Anonymous functions46.90%
Constants13
▷ Global constants646.15%
▷ Class constants753.85%
▷ Public constants7100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
27 compressed PNG files occupy 0.14MB
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
vendor/cmb2/images/ui-bg_glass_95_fef1ec_1x400.png0.12KB0.14KB0.00%
vendor/cmb2/images/ui-bg_glass_65_ffffff_1x400.png0.10KB0.10KB▼ 5.71%
vendor/cmb2/images/ui-icons_888888_256x240.png5.23KB4.11KB▼ 21.49%
vendor/cmb2/images/ui-bg_glass_75_dadada_1x400.png0.11KB0.16KB0.00%
vendor/cmb2/images/ui-icons_222222_256x240.png4.27KB4.11KB▼ 3.78%