77% woo-postnl

Code Review | PostNL for WooCommerce

WordPress plugin PostNL for WooCommerce scored77%from 54 tests.

About plugin

  • Plugin page: woo-postnl
  • Plugin version: 5.3.1
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-6.3
  • WordPress version: 6.3.1
  • First release: Jan 23, 2018
  • Latest release: Nov 21, 2023
  • Number of updates: 107
  • Update frequency: every 20.3 days
  • Top authors: postnl (83.18%)abdalsalaam (12.15%)shadim (5.61%)fernandoroche90 (1.87%)

Code review

54 tests

User reviews

22 reviews

Install metrics

3,000+ active /74,676 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
Installer ran successfully

Server metrics [RAM: ▲0.03MB] [CPU: ▼12.73ms] Passed 4 tests

Analyzing server-side resources used by PostNL for WooCommerce
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.57 ▲0.1042.26 ▼0.11
Dashboard /wp-admin3.43 ▲0.1233.48 ▼15.81
Posts /wp-admin/edit.php3.50 ▲0.1334.52 ▼17.47
Add New Post /wp-admin/post-new.php5.66 ▼0.2471.92 ▼17.53
Media Library /wp-admin/upload.php3.43 ▲0.2032.53 ▲0.52

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

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

Browser metrics Passed 4 tests

PostNL for WooCommerce: an overview of browser usage
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /1,465 ▼1,29712.39 ▼2.361.87 ▲0.1342.68 ▼0.03
Dashboard /wp-admin857 ▼1,3211.36 ▼4.3614.77 ▼95.1621.48 ▼25.23
Posts /wp-admin/edit.php868 ▼1,2351.51 ▼0.466.68 ▼35.4519.20 ▼19.39
Add New Post /wp-admin/post-new.php594 ▼9321.71 ▼21.4819.06 ▼598.817.65 ▼44.37
Media Library /wp-admin/upload.php753 ▼6441.71 ▼2.4819.84 ▼78.8319.84 ▼21.68

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
You still need to fix the following
  • Zombie WordPress options were found after uninstall: 7 options
    • widget_theysaidso_widget
    • recovery_mode_email_last_sent
    • theysaidso_admin_options
    • can_compress_scripts
    • widget_recent-comments
    • db_upgraded
    • widget_recent-posts

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Even though no errors were found, this is by no means 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
The following issues need your attention
  • 8× GET requests to PHP files return non-empty strings:
    • > /wp-content/plugins/woo-postnl/vendor/setasign/fpdf/tutorial/tuto1.php
    • > /wp-content/plugins/woo-postnl/vendor/setasign/fpdf/tutorial/tuto6.php
    • > /wp-content/plugins/woo-postnl/vendor/setasign/fpdf/tutorial/tuto2.php
    • > /wp-content/plugins/woo-postnl/vendor/setasign/fpdf/tutorial/makefont.php
    • > /wp-content/plugins/woo-postnl/vendor/setasign/fpdf/tutorial/tuto3.php
    • > /wp-content/plugins/woo-postnl/vendor/setasign/fpdf/tutorial/tuto5.php
    • > /wp-content/plugins/woo-postnl/vendor/setasign/fpdf/tutorial/tuto4.php
    • > /wp-content/plugins/woo-postnl/vendor/setasign/fpdf/tutorial/tuto7.php
  • 33× GET requests to PHP files have triggered server-side errors or warnings (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'setasign\\Fpdi\\Tfpdf\\FpdfTpl' not found in wp-content/plugins/woo-postnl/vendor/setasign/fpdi/src/Tfpdf/Fpdi.php:24
    • > PHP Fatal error
      Uncaught Error: Class 'setasign\\Fpdi\\PdfParser\\Type\\PdfType' not found in wp-content/plugins/woo-postnl/vendor/setasign/fpdi/src/PdfParser/Type/PdfNumeric.php:16
    • > PHP Fatal error
      Uncaught Error: Interface 'setasign\\Fpdi\\PdfParser\\Filter\\FilterInterface' not found in wp-content/plugins/woo-postnl/vendor/setasign/fpdi/src/PdfParser/Filter/Flate.php:16
    • > PHP Fatal error
      Uncaught Error: Class 'setasign\\Fpdi\\FpdiException' not found in wp-content/plugins/woo-postnl/vendor/setasign/fpdi/src/PdfParser/PdfParserException.php:18
    • > PHP Fatal error
      Uncaught Error: Class 'setasign\\Fpdi\\Tcpdf\\Fpdi' not found in wp-content/plugins/woo-postnl/vendor/setasign/fpdi/src/TcpdfFpdi.php:20
    • > PHP Fatal error
      Uncaught Error: Class 'setasign\\Fpdi\\PdfParser\\Type\\PdfType' not found in wp-content/plugins/woo-postnl/vendor/setasign/fpdi/src/PdfParser/Type/PdfIndirectObject.php:20
    • > PHP Fatal error
      Uncaught Error: Class 'setasign\\Fpdi\\PdfParser\\Type\\PdfType' not found in wp-content/plugins/woo-postnl/vendor/setasign/fpdi/src/PdfParser/Type/PdfStream.php:27
    • > PHP Fatal error
      Uncaught Error: Class 'setasign\\Fpdi\\FpdfTpl' not found in wp-content/plugins/woo-postnl/vendor/setasign/fpdi/src/Fpdi.php:23
    • > PHP Fatal error
      Uncaught Error: Class 'setasign\\Fpdi\\PdfParser\\Type\\PdfType' not found in wp-content/plugins/woo-postnl/vendor/setasign/fpdi/src/PdfParser/Type/PdfHexString.php:18
    • > PHP Fatal error
      Uncaught Error: Class 'tFPDF' not found in wp-content/plugins/woo-postnl/vendor/setasign/fpdi/src/Tfpdf/FpdfTpl.php:20

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 86% from 29 tests

readme.txt 94% from 16 tests

Perhaps the most important file in your plugin readme.txt gets parsed in order to generate the public listing of your plugin
Please fix the following attributes:
  • Screenshots: Please add an image for screenshot #5 (PostNL information on the order details page)
The official readme.txt might help

woo-postnl/postnl-for-woocommerce.php 77% from 13 tests

The main file in "PostNL for WooCommerce" v. 5.3.1 serves as a complement to information provided in readme.txt and as the entry point to the plugin
The following require your attention:
  • Requires at least: The required version number must match the one declared in readme.txt ("4.6" instead of "4.0")
  • Description: The description should be shorter than 140 characters (currently 209 characters long)
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("woo-postnl.php" instead of "postnl-for-woocommerce.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short review of files and their extensions; it is not recommended to include executable files
Everything looks great! No dangerous files found in this plugin18,599 lines of code in 204 files:
LanguageFilesBlank linesComment linesLines of code
PHP1262,4976,07513,815
HTML597203,242
PO File1238249510
JavaScript58310302
JSON400269
CSS4470235
Markdown5760226

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
No cyclomatic complexity issues were detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.38
Average class complexity19.44
▷ Minimum class complexity1.00
▷ Maximum class complexity339.00
Average method complexity3.19
▷ Minimum method complexity1.00
▷ Maximum method complexity29.00
Code structure
Namespaces27
Interfaces2
Traits2
Classes89
▷ Abstract classes55.62%
▷ Concrete classes8494.38%
▷ Final classes00.00%
Methods762
▷ Static methods11515.09%
▷ Public methods65285.56%
▷ Protected methods10213.39%
▷ Private methods81.05%
Functions114
▷ Named functions2017.54%
▷ Anonymous functions9482.46%
Constants55
▷ Global constants1629.09%
▷ Class constants3970.91%
▷ Public constants39100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
4 PNG files occupy 0.04MB with 0.01MB in potential savings
Potential savings
Compression of 4 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/images/post-download-label.png2.51KB1.72KB▼ 31.36%
vendor/setasign/fpdf/tutorial/logo.png2.32KB2.26KB▼ 2.57%
assets/images/postnl-logo.png28.61KB13.86KB▼ 51.54%
assets/images/postnl-logo-40x40.png4.74KB2.01KB▼ 57.53%