77% colissimo-shipping-methods-for-woocommerce

Code Review | Colissimo Officiel : Méthodes de livraison pour WooCommerce

WordPress plugin Colissimo Officiel : Méthodes de livraison pour WooCommerce scored77%from 54 tests.

About plugin

  • Plugin page: colissimo-shippin...
  • Plugin version: 1.9.1
  • PHP compatiblity: 7.4.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 3.6.5-6.1
  • WordPress version: 6.3.1
  • First release: Feb 21, 2020
  • Latest release: Oct 10, 2023
  • Number of updates: 58
  • Update frequency: every 25.2 days
  • Top authors: iscpcolissimo (100%)

Code review

54 tests

User reviews

20 reviews

Install metrics

10,000+ active /166,885 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
Installer ran successfully

Server metrics [RAM: ▲0.00MB] [CPU: ▼3.78ms] Passed 4 tests

Server-side resources used by Colissimo Officiel : Méthodes de livraison pour WooCommerce
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.46 ▲0.0038.20 ▼0.46
Dashboard /wp-admin3.31 ▲0.0047.07 ▼2.78
Posts /wp-admin/edit.php3.36 ▲0.0048.49 ▲1.20
Add New Post /wp-admin/post-new.php5.89 ▲0.0076.04 ▼12.12
Media Library /wp-admin/upload.php3.23 ▲0.0031.88 ▲0.25

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

A short overview of filesystem and database impact
This plugin installed successfully
Filesystem: 242 new files
Database: no new tables, 6 new options
New WordPress options
can_compress_scripts
widget_theysaidso_widget
widget_recent-posts
widget_recent-comments
db_upgraded
theysaidso_admin_options

Browser metrics Passed 4 tests

Colissimo Officiel : Méthodes de livraison pour WooCommerce: an overview of browser usage
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,789 ▲2814.35 ▼0.211.74 ▼0.0544.48 ▲7.64
Dashboard /wp-admin2,198 ▲215.56 ▼0.0582.89 ▼2.6735.79 ▼7.81
Posts /wp-admin/edit.php2,100 ▼02.03 ▲0.0533.70 ▼3.1035.85 ▲2.40
Add New Post /wp-admin/post-new.php1,526 ▼023.76 ▲0.06695.05 ▲24.5967.19 ▲12.23
Media Library /wp-admin/upload.php1,400 ▼04.23 ▲0.0596.44 ▲0.0240.86 ▼5.35

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
It is recommended to fix the following
  • This plugin does not fully uninstall, leaving 6 options in the database
    • widget_theysaidso_widget
    • db_upgraded
    • widget_recent-comments
    • widget_recent-posts
    • theysaidso_admin_options
    • can_compress_scripts

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Good news, no errors were detected

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
The following issues need your attention
  • 27× GET requests to PHP files return non-empty strings (only 10 are shown):
    • > /wp-content/plugins/colissimo-shipping-methods-for-woocommerce/admin/init.php
    • > /wp-content/plugins/colissimo-shipping-methods-for-woocommerce/includes/invoices/lpc_invoice_generate_action.php
    • > /wp-content/plugins/colissimo-shipping-methods-for-woocommerce/admin/labels/generate/lpc_label_inward_generate_action.php
    • > /wp-content/plugins/colissimo-shipping-methods-for-woocommerce/resources/hooksDescriptions.php
    • > /wp-content/plugins/colissimo-shipping-methods-for-woocommerce/admin/labels/deletion/lpc_label_inward_delete_action.php
    • > /wp-content/plugins/colissimo-shipping-methods-for-woocommerce/index.php
    • > /wp-content/plugins/colissimo-shipping-methods-for-woocommerce/public/init.php
    • > /wp-content/plugins/colissimo-shipping-methods-for-woocommerce/admin/labels/download/lpc_label_outward_download_action.php
    • > /wp-content/plugins/colissimo-shipping-methods-for-woocommerce/admin/bordereau/lpc_bordereau_download_action.php
    • > /wp-content/plugins/colissimo-shipping-methods-for-woocommerce/includes/tracking/lpc_update_statuses_action.php
  • 235× GET requests to PHP files have triggered server-side errors or warnings (only 10 are shown):
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/colissimo-shipping-methods-for-woocommerce/admin/partials/settings/select_field.php on line 6
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_url() in wp-content/plugins/colissimo-shipping-methods-for-woocommerce/admin/partials/orders/lpc_orders_header.php:2
    • > PHP Warning
      Use of undefined constant LPC_INCLUDES - assumed 'LPC_INCLUDES' (this will throw an Error in a future version of PHP) in wp-content/plugins/colissimo-shipping-methods-for-woocommerce/includes/label/lpc_label_generation_api.php on line 3
    • > PHP Warning
      Use of undefined constant DS - assumed 'DS' (this will throw an Error in a future version of PHP) in wp-content/plugins/colissimo-shipping-methods-for-woocommerce/includes/shipping/lpc_expert_ddp.php on line 3
    • > PHP Fatal error
      require_once(): Failed opening required 'LPC_INCLUDESpick_upDSlpc_pick_up_widget_api.php' (include_path='.:/usr/share/php') in wp-content/plugins/colissimo-shipping-methods-for-woocommerce/admin/pickup/lpc_admin_pickup_widget.php on line 3
    • > PHP Fatal error
      require_once(): Failed opening required 'wp-content/plugins/colissimo-shipping-methods-for-woocommerce/includes/shippingDSlpc_abstract_shipping.php' (include_path='.:/usr/share/php') in wp-content/plugins/colissimo-shipping-methods-for-woocommerce/includes/shipping/lpc_expert.php on line 3
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/colissimo-shipping-methods-for-woocommerce/public/partials/pickup/pick_up_info.php on line 1
    • > PHP Fatal error
      Uncaught Error: Call to undefined function admin_url() in wp-content/plugins/colissimo-shipping-methods-for-woocommerce/admin/partials/settings/onboarding.php:8
    • > PHP Warning
      require_once(LPC_INCLUDESpick_upDSlpc_pick_up_widget_api.php): failed to open stream: No such file or directory in wp-content/plugins/colissimo-shipping-methods-for-woocommerce/admin/pickup/lpc_admin_pickup_widget.php on line 3
    • > PHP Fatal error
      Uncaught Error: Class 'LpcComponent' not found in wp-content/plugins/colissimo-shipping-methods-for-woocommerce/includes/lpc_rest_api.php:3

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

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
3 plugin tags: shipping, colissimo, woocommerce

colissimo-shipping-methods-for-woocommerce/index.php 77% from 13 tests

The main PHP file in "Colissimo Officiel : Méthodes de livraison pour WooCommerce" ver. 1.9.1 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:
  • Requires at least: Required version does not match the one declared in readme.txt ("4.7" instead of "3.6.5")
  • Text Domain: The text domain name should consist of only dashes and lowercase characters
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("colissimo-shipping-methods-for-woocommerce.php" instead of "index.php")

Code Analysis 95% from 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
There were no executable files found in this plugin69,857 lines of code in 227 files:
LanguageFilesBlank linesComment linesLines of code
PHP1924,74713,03861,036
JSON6003,819
PO File21,30402,628
JavaScript10203321,266
CSS1421716938
Markdown3490170

PHP code 0% from 2 tests

An overview of cyclomatic complexity and code structure
Please tend to the following items
  • Please reduce cyclomatic complexity of classes to less than 1000 (currently 4,422)
  • Method cyclomatic complexity should be reduced to less than 100 (currently 500)
Cyclomatic complexity
Average complexity per logical line of code0.41
Average class complexity54.12
▷ Minimum class complexity1.00
▷ Maximum class complexity4,422.00
Average method complexity6.47
▷ Minimum method complexity1.00
▷ Maximum method complexity500.00
Code structure
Namespaces10
Interfaces2
Traits1
Classes144
▷ Abstract classes85.56%
▷ Concrete classes13694.44%
▷ Final classes00.00%
Methods1,438
▷ Static methods19713.70%
▷ Public methods1,09976.43%
▷ Protected methods31822.11%
▷ Private methods211.46%
Functions87
▷ Named functions11.15%
▷ Anonymous functions8698.85%
Constants295
▷ Global constants7525.42%
▷ Class constants22074.58%
▷ Public constants220100.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.02MB in potential savings
Potential savings
Compression of 4 random PNG files using pngquant
FileSize - originalSize - compressedSavings
includes/images/map_marker.png0.80KB0.83KB0.00%
includes/images/colissimo.png15.73KB7.21KB▼ 54.12%
includes/images/colissimo_icon.png4.09KB3.08KB▼ 24.61%
includes/images/colissimo_cropped.png21.75KB7.01KB▼ 67.77%