83% postnl-address-validation-for-woocommerce

Code Review | PostNL Address Validation for WooCommerce

WordPress plugin PostNL Address Validation for WooCommerce scored83%from 54 tests.

About plugin

  • Plugin page: postnl-address-va...
  • Plugin version: 1.0.8
  • PHP compatiblity: 7.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 6.0-6.0
  • WordPress version: 6.3.1
  • First release: Oct 4, 2022
  • Latest release: Aug 16, 2023
  • Number of updates: 30
  • Update frequency: every 10.5 days
  • Top authors: postnl (100%)

Code review

54 tests

User reviews

2 reviews

Install metrics

50+ active /733 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
Install script ran successfully

Server metrics [RAM: ▲0.04MB] [CPU: ▼5.03ms] Passed 4 tests

Analyzing server-side resources used by PostNL Address Validation for WooCommerce
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.50 ▲0.0437.85 ▼0.71
Dashboard /wp-admin3.34 ▲0.0447.88 ▲0.47
Posts /wp-admin/edit.php3.46 ▲0.1042.03 ▼2.35
Add New Post /wp-admin/post-new.php5.92 ▲0.0480.26 ▼17.53
Media Library /wp-admin/upload.php3.27 ▲0.0439.67 ▲5.79

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

A short overview of filesystem and database impact
No storage issues were detected
Filesystem: 35 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-comments
theysaidso_admin_options
can_compress_scripts
widget_theysaidso_widget
widget_recent-posts
db_upgraded

Browser metrics Passed 4 tests

Checking browser requirements for PostNL Address Validation for WooCommerce
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,792 ▲3114.35 ▼0.001.76 ▲0.1743.17 ▲3.43
Dashboard /wp-admin2,201 ▲205.62 ▼0.0498.00 ▼1.4444.84 ▲2.66
Posts /wp-admin/edit.php2,103 ▼02.02 ▲0.0836.23 ▲0.5935.25 ▼2.92
Add New Post /wp-admin/post-new.php1,538 ▲1017.97 ▼4.69617.47 ▼30.5373.54 ▲19.30
Media Library /wp-admin/upload.php1,403 ▲34.19 ▼0.0398.30 ▼10.1642.91 ▼3.38

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
You still need to fix the following
  • Zombie WordPress options detected upon uninstall: 6 options
    • theysaidso_admin_options
    • db_upgraded
    • widget_recent-posts
    • widget_theysaidso_widget
    • can_compress_scripts
    • widget_recent-comments

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 | SRP (Single-Responsibility Principle) - PHP files must act as libraries and never output text or perform any action when accessed directly in a browser
The following issues need your attention
  • 2× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      Uncaught Error: Class 'PostNL\\AddressValidation\\API\\AbstractAPI' not found in wp-content/plugins/postnl-address-validation-for-woocommerce/include/classes/PostNL/AddressValidation/API/PostNLAPI.php:14
    • > PHP Fatal error
      Uncaught Error: Class 'PostNL\\AddressValidation\\API\\AbstractAPI' not found in wp-content/plugins/postnl-address-validation-for-woocommerce/languages/include/classes/PostNL/AddressValidation/API/PostNLAPI.php:14

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
Everything seems fine on the user side

Optimizations

Plugin configuration 90% 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: postnl, address validation, woocommerce, delivery

postnl-address-validation-for-woocommerce/postnl-wc-address-validation.php 77% from 13 tests

The main PHP file in "PostNL Address Validation for WooCommerce" ver. 1.0.8 adds more information about the plugin and also serves as the entry point for this plugin
Please make the necessary changes and fix the following:
  • Text Domain: If you choose to specify the text domain, it must be the same as the plugin slug; optional since WordPress version 4.6
  • Description: The description should be shorter than 140 characters (currently 176 characters long)
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("postnl-address-validation-for-woocommerce.php" instead of "postnl-wc-address-validation.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are considered dangerous and should not be included with any WordPress plugin
Success! There were no dangerous files found in this plugin1,859 lines of code in 17 files:
LanguageFilesBlank linesComment linesLines of code
PHP103115531,305
JavaScript365193373
PO File14863136
JSON22044
CSS1001

PHP code Passed 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
This plugin has no cyclomatic complexity problems
Cyclomatic complexity
Average complexity per logical line of code0.29
Average class complexity13.36
▷ Minimum class complexity1.00
▷ Maximum class complexity46.00
Average method complexity2.34
▷ Minimum method complexity1.00
▷ Maximum method complexity11.00
Code structure
Namespaces3
Interfaces0
Traits0
Classes14
▷ Abstract classes214.29%
▷ Concrete classes1285.71%
▷ Final classes00.00%
Methods131
▷ Static methods96.87%
▷ Public methods12897.71%
▷ Protected methods21.53%
▷ Private methods10.76%
Functions1
▷ Named functions00.00%
▷ Anonymous functions1100.00%
Constants2
▷ Global constants2100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
4 PNG files occupy 0.15MB with 0.04MB in potential savings
Potential savings
Compression of 4 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/screenshot-1..png37.26KB28.33KB▼ 23.98%
assets/screenshot-4..png29.70KB18.03KB▼ 39.30%
assets/screenshot-3..png42.34KB31.90KB▼ 24.66%
assets/screenshot-2.png40.04KB29.99KB▼ 25.11%