82% wc-myparcel-belgium

Code Review | WC MyParcel Belgium

WordPress plugin WC MyParcel Belgium scored82%from 54 tests.

About plugin

Code review

54 tests

User reviews

1 review

Install metrics

800+ active /14,669 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
This plugin's installer ran successfully

Server metrics [RAM: ▲0.28MB] [CPU: ▼5.71ms] Passed 4 tests

This is a short check of server-side resources used by WC MyParcel Belgium
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.75 ▲0.2947.97 ▲1.23
Dashboard /wp-admin3.58 ▲0.2848.97 ▼8.29
Posts /wp-admin/edit.php3.70 ▲0.3450.28 ▲0.48
Add New Post /wp-admin/post-new.php6.17 ▲0.2898.79 ▼15.86
Media Library /wp-admin/upload.php3.51 ▲0.2841.33 ▲0.85

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

Filesystem and database footprint
The plugin installed successfully
Filesystem: 233 new files
Database: no new tables, 7 new options
New WordPress options
widget_theysaidso_widget
db_upgraded
theysaidso_admin_options
widget_recent-comments
can_compress_scripts
widget_recent-posts
woocommerce_myparcelbe_version

Browser metrics Passed 4 tests

WC MyParcel Belgium: an overview of browser usage
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,795 ▲3414.35 ▲0.001.56 ▼0.4540.35 ▼0.73
Dashboard /wp-admin2,201 ▲275.52 ▼0.0686.42 ▼17.3939.17 ▼6.92
Posts /wp-admin/edit.php2,106 ▲32.04 ▲0.0439.25 ▲3.7136.07 ▲0.95
Add New Post /wp-admin/post-new.php1,544 ▲1623.03 ▼0.14671.84 ▼23.4254.16 ▼3.48
Media Library /wp-admin/upload.php1,409 ▲94.19 ▲0.04101.17 ▼7.0646.99 ▼0.83

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
It is recommended to fix the following
  • Zombie WordPress options detected upon uninstall: 7 options
    • theysaidso_admin_options
    • db_upgraded
    • widget_theysaidso_widget
    • widget_recent-posts
    • can_compress_scripts
    • widget_recent-comments
    • woocommerce_myparcelbe_version

Smoke tests 75% 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 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
  • 63× GET requests to PHP files have triggered server-side errors or warnings (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'MyParcelNL\\Sdk\\src\\Services\\Web\\Webhook\\AbstractWebhookWebService' not found in wp-content/plugins/wc-myparcel-belgium/vendor/myparcelnl/sdk/src/Services/Web/Webhook/ShopUpdatedWebhookWebService.php:7
    • > PHP Fatal error
      Uncaught Error: Class 'MyParcelNL\\Sdk\\src\\Services\\Web\\AbstractWebService' not found in wp-content/plugins/wc-myparcel-belgium/vendor/myparcelnl/sdk/src/Services/Web/CarrierConfigurationWebService.php:11
    • > PHP Fatal error
      Uncaught Error: Class 'MyParcelNL\\Sdk\\src\\Services\\Web\\AbstractWebService' not found in wp-content/plugins/wc-myparcel-belgium/vendor/myparcelnl/sdk/src/Services/Web/CarrierOptionsWebService.php:11
    • > PHP Fatal error
      Trait 'MyParcelNL\\Sdk\\src\\Concerns\\HasApiKey' not found in wp-content/plugins/wc-myparcel-belgium/vendor/myparcelnl/sdk/src/Model/MyParcelRequest.php on line 18
    • > PHP Fatal error
      Uncaught Error: Class 'MyParcelNL\\Sdk\\src\\Model\\BaseModel' not found in wp-content/plugins/wc-myparcel-belgium/vendor/myparcelnl/sdk/src/Model/Account/CarrierOptions.php:11
    • > PHP Fatal error
      Uncaught Error: Class 'MyParcelNL\\Sdk\\src\\Adapter\\DeliveryOptions\\AbstractPickupLocationAdapter' not found in wp-content/plugins/wc-myparcel-belgium/vendor/myparcelnl/sdk/src/Adapter/DeliveryOptions/PickupLocationV3Adapter.php:5
    • > PHP Fatal error
      Uncaught Error: Class 'MyParcelNL\\Sdk\\src\\Adapter\\DeliveryOptions\\AbstractPickupLocationAdapter' not found in wp-content/plugins/wc-myparcel-belgium/includes/adapter/pickup-location-from-order-adapter.php:8
    • > PHP Fatal error
      Uncaught Error: Class 'MyParcelNL\\Sdk\\src\\Rule\\Rule' not found in wp-content/plugins/wc-myparcel-belgium/vendor/myparcelnl/sdk/src/Rule/Consignment/LocalCountryOnlyRule.php:9
    • > PHP Fatal error
      Uncaught Error: Class 'MyParcelNL\\Sdk\\src\\Services\\Web\\Webhook\\AbstractWebhookWebService' not found in wp-content/plugins/wc-myparcel-belgium/vendor/myparcelnl/sdk/src/Services/Web/Webhook/ShopCarrierAccessibilityUpdatedWebhookWebService.php:7
    • > PHP Fatal error
      Uncaught Error: Class 'MyParcelNL\\Sdk\\src\\Model\\BaseModel' not found in wp-content/plugins/wc-myparcel-belgium/vendor/myparcelnl/sdk/src/Model/Account/Shop.php:9

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
No browser errors were detected

Optimizations

Plugin configuration 79% from 29 tests

readme.txt 81% from 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
These attributes need to be fixed:
  • Screenshots: Add images for these screenshots: #1 (Export or print MyParcel BE label per order), #2 (Bulk export or print MyParcel BE labels), #3 (Change the shipment options for an order), #4 (MyParcel BE actions on the order overview page), #5 (MyParcel BE information on the order details page)
  • Plugin Name: Write the name of your plugin instead of "Plugin Name" on the first line ( === wc-myparcel-belgium === )
  • Requires at least: Invalid version format
You can take inspiration from this readme.txt

wc-myparcel-belgium/woocommerce-myparcel.php 77% from 13 tests

Analyzing the main PHP file in "WC MyParcel Belgium" version 4.5.5-beta...
It is important to fix the following:
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("wc-myparcel-belgium.php" instead of "woocommerce-myparcel.php")
  • Text Domain: The text domain must be the same as the plugin slug, although optional since WordPress version 4.6
  • Version: The version number should only use digits and periods (ex. "1.0.3" instead of "4.5.5-beta...")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short check of programming languages and file extensions; no executable files are allowed
Good job! No executable or dangerous file extensions detected25,843 lines of code in 206 files:
LanguageFilesBlank linesComment linesLines of code
PHP1734,0669,56017,146
PO File93,01807,912
CSS85953491
Markdown2960145
JSON410138
JavaScript60107
SVG4004

PHP code Passed 2 tests

An overview of cyclomatic complexity and code structure
This plugin has no cyclomatic complexity problems
Cyclomatic complexity
Average complexity per logical line of code0.37
Average class complexity12.30
▷ Minimum class complexity1.00
▷ Maximum class complexity164.00
Average method complexity2.25
▷ Minimum method complexity1.00
▷ Maximum method complexity20.00
Code structure
Namespaces30
Interfaces2
Traits8
Classes148
▷ Abstract classes117.43%
▷ Concrete classes13792.57%
▷ Final classes00.00%
Methods1,415
▷ Static methods25718.16%
▷ Public methods1,15981.91%
▷ Protected methods483.39%
▷ Private methods20814.70%
Functions59
▷ Named functions35.08%
▷ Anonymous functions5694.92%
Constants322
▷ Global constants30.93%
▷ Class constants31999.07%
▷ Public constants28388.71%

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
5 PNG files occupy 0.68MB with 0.42MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
screenshot-2.png25.64KB8.88KB▼ 65.38%
screenshot-5.png242.91KB75.78KB▼ 68.80%
screenshot-3.png174.63KB60.92KB▼ 65.11%
screenshot-1.png6.26KB3.41KB▼ 45.55%
screenshot-4.png244.06KB80.81KB▼ 66.89%