83% handy-addons

Code Review | Handy Addons for WooCommerce

WordPress plugin Handy Addons for WooCommerce scored83%from 54 tests.

About plugin

  • Plugin page: handy-addons
  • Plugin version: 0.9
  • PHP compatiblity: 5.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.0-5.9
  • WordPress version: 6.3.1
  • First release: Feb 16, 2022
  • Latest release: Feb 16, 2022
  • Number of updates: 2
  • Update frequency: every 0.5 days
  • Top authors: codexpert (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /332 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.08MB] [CPU: ▼3.44ms] Passed 4 tests

Analyzing server-side resources used by Handy Addons for WooCommerce
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.48 ▲0.0244.51 ▲3.79
Dashboard /wp-admin3.44 ▲0.1446.46 ▲2.05
Posts /wp-admin/edit.php3.49 ▲0.1449.52 ▼1.22
Add New Post /wp-admin/post-new.php5.98 ▲0.0986.12 ▼17.44
Media Library /wp-admin/upload.php3.30 ▲0.0734.97 ▲2.84

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

How much does this plugin use your filesystem and database?
This plugin was installed successfully
Filesystem: 632 new files
Database: no new tables, 8 new options
New WordPress options
db_upgraded
can_compress_scripts
widget_recent-posts
handy-addons_install_time
widget_theysaidso_widget
widget_recent-comments
handy-addons_version
theysaidso_admin_options

Browser metrics Passed 4 tests

Handy Addons 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,889 ▲14313.30 ▼1.361.72 ▲0.0144.86 ▲1.21
Dashboard /wp-admin2,295 ▲1074.95 ▲0.01112.46 ▼0.1645.07 ▲2.93
Posts /wp-admin/edit.php2,129 ▲402.07 ▼0.0340.51 ▲0.8136.58 ▲3.47
Add New Post /wp-admin/post-new.php1,552 ▲3823.13 ▲5.64649.11 ▲0.4351.34 ▲0.32
Media Library /wp-admin/upload.php1,422 ▲314.30 ▲0.07119.57 ▲24.7242.63 ▲0.04

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
Please fix the following items
  • This plugin did not uninstall successfully, leaving 8 options in the database
    • can_compress_scripts
    • theysaidso_admin_options
    • handy-addons_install_time
    • widget_recent-posts
    • db_upgraded
    • handy-addons_version
    • widget_theysaidso_widget
    • widget_recent-comments

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 | 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
Almost there! Just fix the following items
  • 235× PHP files trigger server errors when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'Mpdf\\Tag\\Tag' not found in wp-content/plugins/handy-addons/vendor/mpdf/mpdf/src/Tag/Hr.php:7
    • > PHP Fatal error
      Uncaught Error: Class 'setasign\\Fpdi\\PdfParser\\Type\\PdfType' not found in wp-content/plugins/handy-addons/vendor/setasign/fpdi/src/PdfParser/Type/PdfString.php:18
    • > PHP Fatal error
      Uncaught Error: Class 'Codexpert\\Handy_Addons\\Helper' not found in wp-content/plugins/handy-addons/modules/order-filter/views/filter-inputs.php:23
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/handy-addons/modules/pdf-invoice/views/invoice-templates/template-2.php on line 5
    • > PHP Fatal error
      Uncaught Error: Class 'DeepCopy\\TypeFilter\\Spl\\SplDoublyLinkedListFilter' not found in wp-content/plugins/handy-addons/vendor/myclabs/deep-copy/src/DeepCopy/TypeFilter/Spl/SplDoublyLinkedList.php:8
    • > PHP Fatal error
      Uncaught Error: Class 'Mpdf\\Tag\\BlockTag' not found in wp-content/plugins/handy-addons/vendor/mpdf/mpdf/src/Tag/Header.php:5
    • > PHP Warning
      require_once(lib/byte_safe_strings.php): failed to open stream: No such file or directory in wp-content/plugins/handy-addons/vendor/paragonie/random_compat/psalm-autoload.php on line 3
    • > PHP Fatal error
      Uncaught Error: Class 'Mpdf\\Tag\\Tag' not found in wp-content/plugins/handy-addons/vendor/mpdf/mpdf/src/Tag/Bookmark.php:5
    • > PHP Fatal error
      Uncaught Error: Class 'Mpdf\\Tag\\Tag' not found in wp-content/plugins/handy-addons/vendor/mpdf/mpdf/src/Tag/WatermarkText.php:5
    • > PHP Fatal error
      Uncaught Error: Interface 'DeepCopy\\Filter\\Filter' not found in wp-content/plugins/handy-addons/vendor/myclabs/deep-copy/src/DeepCopy/Filter/KeepFilter.php:5

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)
Everything seems fine on the user side

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
7 plugin tags: pdf invoice, woocommerce extensions, order filter, checkout editor, product brands...

handy-addons/handy-addons.php 85% from 13 tests

The main PHP file in "Handy Addons for WooCommerce" ver. 0.9 adds more information about the plugin and also serves as the entry point for this plugin
You should first fix the following items:
  • Git Repository: Please do not include Git repositories in your plugin
  • Domain Path: The domain path is invalid: folder "/languages" does not exist

Code Analysis 95% from 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short glimpse at programming languages used with this plugin and a check that no dangerous files are present
Everything looks great! No dangerous files found in this plugin84,961 lines of code in 489 files:
LanguageFilesBlank linesComment linesLines of code
PHP42112,19612,29779,963
CSS20160632,631
Markdown1038501,182
JSON1630586
JavaScript125514404
YAML6364117
XML310075
Bourne Shell1203

PHP code 0% from 2 tests

This is a very shot review of cyclomatic complexity and code structure
It is recommended to fix the following
  • Cyclomatic complexity of classes has to be reduced to less than 1000 (currently 7,024)
  • Please reduce cyclomatic complexity of methods to less than 100 (currently 460)
Cyclomatic complexity
Average complexity per logical line of code0.51
Average class complexity56.77
▷ Minimum class complexity1.00
▷ Maximum class complexity7,024.00
Average method complexity12.42
▷ Minimum method complexity1.00
▷ Maximum method complexity460.00
Code structure
Namespaces49
Interfaces10
Traits6
Classes311
▷ Abstract classes113.54%
▷ Concrete classes30096.46%
▷ Final classes144.67%
Methods1,600
▷ Static methods1368.50%
▷ Public methods1,40888.00%
▷ Protected methods573.56%
▷ Private methods1358.44%
Functions47
▷ Named functions1940.43%
▷ Anonymous functions2859.57%
Constants432
▷ Global constants102.31%
▷ Class constants42297.69%
▷ Public constants422100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
6 PNG files occupy 0.17MB with 0.06MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
vendor/codexpert/plugin/src/assets/img/checked.png18.81KB9.90KB▼ 47.36%
vendor/codexpert/plugin/src/assets/img/survey.png7.31KB3.08KB▼ 57.88%
modules/pdf-invoice/assets/preview/template-1.png56.10KB58.01KB0.00%
modules/pdf-invoice/assets/preview/template-2-o.png33.94KB15.35KB▼ 54.76%
modules/pdf-invoice/assets/preview/template-3.png20.15KB16.51KB▼ 18.04%