10% kiwiz-invoices-certification-pdf-file

Code Review | Kiwiz for WooCommerce

WordPress plugin Kiwiz for WooCommerce scored10%from 54 tests.

About plugin

  • Plugin page: kiwiz-invoices-ce...
  • Plugin version: 2.1.7
  • PHP compatiblity: 7.2+
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.0-6.3
  • WordPress version: 6.3.1
  • First release: Jul 19, 2023
  • Latest release: Aug 25, 2023
  • Number of updates: 7
  • Update frequency: every 10.1 days
  • Top authors: kiwizio (100%)

Code review

54 tests

User reviews

1 review

Install metrics

40+ active /272 total downloads

Benchmarks

Plugin footprint 40% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
It is recommended to fix the following installer errors
  • The plugin cannot be installed
    • > Warning in wp-admin/includes/plugin.php+294
    opendir(wp-content/plugins/woocommerce): failed to open dir: No such file or directory

Server metrics [RAM: ▲1.56MB] [CPU: ▼1.14ms] Passed 4 tests

A check of server-side resources used by Kiwiz for WooCommerce
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /5.05 ▲1.5844.42 ▲4.48
Dashboard /wp-admin4.87 ▲1.5655.02 ▲4.10
Posts /wp-admin/edit.php4.92 ▲1.5654.40 ▲2.18
Add New Post /wp-admin/post-new.php7.45 ▲1.5690.58 ▼15.31
Media Library /wp-admin/upload.php4.79 ▲1.5648.25 ▲14.94
KIWIZ Certification /wp-admin/admin.php?page=kiwiz-certification4.7642.63

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

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

Browser metrics Passed 4 tests

Kiwiz for WooCommerce: an overview of browser usage
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,916 ▲15513.75 ▼0.617.84 ▲6.3438.06 ▼1.73
Dashboard /wp-admin2,236 ▲595.11 ▼0.5686.64 ▲2.6439.99 ▼1.26
Posts /wp-admin/edit.php2,143 ▲432.37 ▲0.3637.51 ▼2.7634.44 ▼2.51
Add New Post /wp-admin/post-new.php1,567 ▲4122.91 ▼0.11676.57 ▼19.0640.17 ▼18.43
Media Library /wp-admin/upload.php1,444 ▲444.68 ▲0.48100.88 ▼5.4946.68 ▼0.09
KIWIZ Certification /wp-admin/admin.php?page=kiwiz-certification1,1562.2928.9125.24

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
Please fix the following items
  • This plugin cannot be uninstalled
    • > Warning in wp-content/plugins/kiwiz-invoices-certification-pdf-file/uninstall.php+55
    rmdir(wp-content/uploads/kiwiz-document/): No such file or directory
  • The uninstall procedure has failed, leaving 6 options in the database
    • db_upgraded
    • can_compress_scripts
    • widget_theysaidso_widget
    • widget_recent-posts
    • theysaidso_admin_options
    • widget_recent-comments

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Even though no errors were found, this is by no means an exhaustive test

SRP 0% 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
Please fix the following
  • 3× PHP files perform the task of outputting text when accessed with GET requests:
    • > /wp-content/plugins/kiwiz-invoices-certification-pdf-file/lib/fpdi/vendor/tecnickcom/tcpdf/tools/tcpdf_addfont.php
    • > /wp-content/plugins/kiwiz-invoices-certification-pdf-file/lib/dompdf/vendor/masterminds/html5/bin/entities.php
    • > /wp-content/plugins/kiwiz-invoices-certification-pdf-file/templates/refund/main.php
  • 218× PHP files trigger server errors when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Interface 'DeepCopy\\TypeFilter\\TypeFilter' not found in wp-content/plugins/kiwiz-invoices-certification-pdf-file/lib/fpdi/vendor/myclabs/deep-copy/src/DeepCopy/TypeFilter/Date/DateIntervalFilter.php:13
    • > PHP Fatal error
      Uncaught Error: Class 'setasign\\Fpdi\\PdfParser\\Filter\\FilterException' not found in wp-content/plugins/kiwiz-invoices-certification-pdf-file/lib/fpdi/src/PdfParser/Filter/Ascii85Exception.php:16
    • > PHP Warning
      require(vendor/autoload.php): failed to open stream: No such file or directory in wp-content/plugins/kiwiz-invoices-certification-pdf-file/lib/fpdi/vendor/setasign/tfpdf/ex.php on line 7
    • > PHP Fatal error
      Uncaught Error: Interface 'Sabberworm\\CSS\\Renderable' not found in wp-content/plugins/kiwiz-invoices-certification-pdf-file/lib/dompdf/vendor/sabberworm/php-css-parser/src/CSSList/CSSList.php:32
    • > PHP Fatal error
      require(): Failed opening required 'vendor/autoload.php' (include_path='.:/usr/share/php') in wp-content/plugins/kiwiz-invoices-certification-pdf-file/lib/fpdi/vendor/setasign/tfpdf/ex.php on line 7
    • > PHP Fatal error
      Uncaught Error: Class 'FontLib\\TrueType\\File' not found in wp-content/plugins/kiwiz-invoices-certification-pdf-file/lib/dompdf/vendor/phenx/php-font-lib/src/FontLib/EOT/File.php:16
    • > PHP Fatal error
      Uncaught Error: Interface 'Symfony\\Component\\Yaml\\Exception\\ExceptionInterface' not found in wp-content/plugins/kiwiz-invoices-certification-pdf-file/lib/fpdi/vendor/symfony/yaml/Exception/RuntimeException.php:19
    • > PHP Fatal error
      Uncaught Error: Class 'Dompdf\\FrameReflower\\AbstractFrameReflower' not found in wp-content/plugins/kiwiz-invoices-certification-pdf-file/lib/dompdf/vendor/dompdf/dompdf/src/FrameReflower/Inline.php:18
    • > PHP Fatal error
      Uncaught Error: Interface 'Sabberworm\\CSS\\Renderable' not found in wp-content/plugins/kiwiz-invoices-certification-pdf-file/lib/dompdf/vendor/sabberworm/php-css-parser/src/RuleSet/RuleSet.php:18
    • > PHP Fatal error
      Uncaught Error: Interface 'Sabberworm\\CSS\\Property\\AtRule' not found in wp-content/plugins/kiwiz-invoices-certification-pdf-file/lib/dompdf/vendor/sabberworm/php-css-parser/src/Property/CSSNamespace.php:11

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)
No browser issues were found

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
8 plugin tags: credimemo, refund, certification, certification facture, facture...

kiwiz-invoices-certification-pdf-file/woocommerce-gateway-certification-de-facture-et-gestion-de-pdf-kiwiz.php 85% from 13 tests

Analyzing the main PHP file in "Kiwiz for WooCommerce" version 2.1.7
You should first fix the following items:
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("kiwiz-invoices-certification-pdf-file.php" instead of "woocommerce-gateway-certification-de-facture-et-gestion-de-pdf-kiwiz.php")
  • Requires at least: Required version does not match the one declared in readme.txt ("4.6" instead of "3.0.0")

Code Analysis 0% from 3 tests

File types 0% from 1 test

🔸 Test weight: 35 | A short check of programming languages and file extensions; no executable files are allowed
Please make sure to remedy the following
  • Do not include executable or dangerous files in your plugin
    • .bat - Batch File in Windows
      • wp-content/plugins/kiwiz-invoices-certification-pdf-file/lib/fpdi/vendor/bin/phpcbf.bat
      • wp-content/plugins/kiwiz-invoices-certification-pdf-file/lib/fpdi/vendor/bin/phpcs.bat
      • wp-content/plugins/kiwiz-invoices-certification-pdf-file/lib/fpdi/vendor/bin/phpunit.bat
119,476 lines of code in 566 files:
LanguageFilesBlank linesComment linesLines of code
PHP44914,09539,502109,676
JSON31304,420
Markdown361,00602,753
CSS6159108908
HTML4280475
PO File1172280357
YAML11781262
Ant9330205
JavaScript32646187
XML10110179
reStructuredText2231831
DOS Batch30015
SVG1008

PHP code 0% from 2 tests

A short review of cyclomatic complexity and code structure
It is recommended to fix the following
  • Class cyclomatic complexity has to be reduced to less than 1000 (currently 4,415)
  • Method cyclomatic complexity has to be reduced to less than 100 (currently 500)
Cyclomatic complexity
Average complexity per logical line of code0.43
Average class complexity44.83
▷ Minimum class complexity1.00
▷ Maximum class complexity4,415.00
Average method complexity4.95
▷ Minimum method complexity1.00
▷ Maximum method complexity500.00
Code structure
Namespaces76
Interfaces21
Traits3
Classes349
▷ Abstract classes154.30%
▷ Concrete classes33495.70%
▷ Final classes61.80%
Methods4,252
▷ Static methods77218.16%
▷ Public methods3,23276.01%
▷ Protected methods82319.36%
▷ Private methods1974.63%
Functions85
▷ Named functions4047.06%
▷ Anonymous functions4552.94%
Constants413
▷ Global constants11928.81%
▷ Class constants29471.19%
▷ Public constants28797.62%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
2 PNG files occupy 0.01MB with 0.00MB in potential savings
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
(invalid) admin/assets/img/kiwiz-logo.png6.05KB0.00KB▼ 100.00%
lib/dompdf/vendor/dompdf/dompdf/lib/res/broken_image.png0.60KB0.47KB▼ 22.33%