77% collect-and-deliver-interface-for-woocommerce

Code Review | CDI - Collect and Deliver Interface for Woocommerce

WordPress plugin CDI - Collect and Deliver Interface for Woocommerce scored77%from 54 tests.

About plugin

  • Plugin page: collect-and-deliv...
  • Plugin version: 5.3.1
  • PHP compatiblity: 7.3+
  • PHP version: 7.4.16
  • WordPress compatibility: 6.2-6.4.1
  • WordPress version: 6.3.1
  • First release: Mar 9, 2021
  • Latest release: Nov 11, 2023
  • Number of updates: 216
  • Update frequency: every 4.5 days
  • Top authors: Harasse (100%)

Code review

54 tests

User reviews

3 reviews

Install metrics

400+ active /10,204 total downloads

Benchmarks

Plugin footprint 82% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
The plugin installed successfully, without throwing any errors or notices

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

Analyzing server-side resources used by CDI - Collect and Deliver Interface for Woocommerce
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.46 ▲0.0035.70 ▼5.75
Dashboard /wp-admin3.31 ▲0.0046.69 ▼1.14
Posts /wp-admin/edit.php3.36 ▲0.0046.34 ▲2.95
Add New Post /wp-admin/post-new.php5.89 ▲0.0081.98 ▼12.28
Media Library /wp-admin/upload.php3.23 ▲0.0033.98 ▼0.79

Server storage [IO: ▲28.26MB] [DB: ▲0.00MB] 67% from 3 tests

Input-output and database impact of this plugin
These are issues you should consider
  • The filesystem usage should be lower than 25MB (currently using 28.26MB)
Filesystem: 360 new files
Database: no new tables, 7 new options
New WordPress options
db_upgraded
theysaidso_admin_options
widget_theysaidso_widget
widget_recent-posts
can_compress_scripts
widget_recent-comments
cdi_o_noticesadmintodisplay

Browser metrics Passed 4 tests

Checking browser requirements for CDI - Collect and Deliver Interface for Woocommerce
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,790 ▲2814.67 ▲0.351.70 ▼0.0039.24 ▼4.07
Dashboard /wp-admin2,198 ▲215.67 ▲0.0087.55 ▼15.2038.86 ▼5.25
Posts /wp-admin/edit.php2,097 ▲151.94 ▼0.0340.76 ▲3.7236.77 ▼0.40
Add New Post /wp-admin/post-new.php1,526 ▼023.24 ▲0.01659.83 ▼15.4464.77 ▲8.08
Media Library /wp-admin/upload.php1,400 ▼34.16 ▼0.1394.58 ▼5.8441.65 ▼4.32

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
  • This plugin does not fully uninstall, leaving 7 options in the database
    • widget_theysaidso_widget
    • cdi_o_noticesadmintodisplay
    • db_upgraded
    • can_compress_scripts
    • widget_recent-comments
    • theysaidso_admin_options
    • 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
The smoke test was a success, however most plugin functionality was not tested

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
Please fix the following
  • 9× PHP files perform the action of outputting non-empty strings when accessed directly:
    • > /wp-content/plugins/collect-and-deliver-interface-for-woocommerce/includes/CDI-Bibext/FPDF/tutorial/tuto3.php
    • > /wp-content/plugins/collect-and-deliver-interface-for-woocommerce/includes/CDI-Bibext/FPDF/tutorial/tuto7.php
    • > /wp-content/plugins/collect-and-deliver-interface-for-woocommerce/includes/CDI-Bibext/FPDF/tutorial/tuto5.php
    • > /wp-content/plugins/collect-and-deliver-interface-for-woocommerce/includes/CDI-Bibext/FPDF/tutorial/tuto1.php
    • > /wp-content/plugins/collect-and-deliver-interface-for-woocommerce/uploads/CDI-collect-defaut.php
    • > /wp-content/plugins/collect-and-deliver-interface-for-woocommerce/includes/CDI-Bibext/FPDF/tutorial/makefont.php
    • > /wp-content/plugins/collect-and-deliver-interface-for-woocommerce/includes/CDI-Bibext/FPDF/tutorial/tuto6.php
    • > /wp-content/plugins/collect-and-deliver-interface-for-woocommerce/includes/CDI-Bibext/FPDF/tutorial/tuto2.php
    • > /wp-content/plugins/collect-and-deliver-interface-for-woocommerce/includes/CDI-Bibext/FPDF/tutorial/tuto4.php
  • 110× PHP files trigger server-side errors or warnings when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Interface 'BaconQrCode\\Renderer\\Image\\ImageBackEndInterface' not found in wp-content/plugins/collect-and-deliver-interface-for-woocommerce/includes/CDI-Bibext/qr-code-master/vendor/bacon/bacon-qr-code/src/Renderer/Image/SvgImageBackEnd.php:19
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit\\Framework\\TestCase' not found in wp-content/plugins/collect-and-deliver-interface-for-woocommerce/includes/CDI-Bibext/qr-code-master/vendor/dasprid/enum/test/EnumMapTest.php:12
    • > PHP Fatal error
      Uncaught Error: Call to undefined function __() in wp-content/plugins/collect-and-deliver-interface-for-woocommerce/includes/CDI-Docs/CDI-Doc-Setting-printlabel.php:13
    • > PHP Fatal error
      Uncaught Error: Interface 'DASPRiD\\Enum\\Exception\\ExceptionInterface' not found in wp-content/plugins/collect-and-deliver-interface-for-woocommerce/includes/CDI-Bibext/qr-code-master/vendor/dasprid/enum/src/Exception/IllegalArgumentException.php:8
    • > PHP Fatal error
      Uncaught Error: Call to undefined function __() in wp-content/plugins/collect-and-deliver-interface-for-woocommerce/cdi.php:23
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit\\Framework\\TestCase' not found in wp-content/plugins/collect-and-deliver-interface-for-woocommerce/includes/CDI-Bibext/qr-code-master/vendor/bacon/bacon-qr-code/test/Encoder/EncoderTest.php:17
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit\\Framework\\TestCase' not found in wp-content/plugins/collect-and-deliver-interface-for-woocommerce/includes/CDI-Bibext/qr-code-master/vendor/bacon/bacon-qr-code/test/Common/ReedSolomonCodecTest.php:10
    • > PHP Fatal error
      Uncaught Error: Interface 'Endroid\\QrCode\\Writer\\WriterInterface' not found in wp-content/plugins/collect-and-deliver-interface-for-woocommerce/includes/CDI-Bibext/qr-code-master/src/Writer/DebugWriter.php:13
    • > PHP Fatal error
      Uncaught Error: Call to undefined function __() in wp-content/plugins/collect-and-deliver-interface-for-woocommerce/includes/CDI-Docs/CDI-Doc-Setting-cn23.php:13
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit\\Framework\\TestCase' not found in wp-content/plugins/collect-and-deliver-interface-for-woocommerce/includes/CDI-Bibext/qr-code-master/vendor/bacon/bacon-qr-code/test/Common/FormatInformationTest.php:10

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
There were no browser issues found

Optimizations

Plugin configuration 87% from 29 tests

readme.txt 88% from 16 tests

It's important to format your readme.txt file correctly as it is parsed for the public listing of your plugin
Attributes that require attention:
  • Screenshots: Please add an image for screenshot #1 (CDI shipping instance.)
  • Tags: Too many tags (11 tag instead of maximum 10); only the first 5 tags are used in your directory listing
The official readme.txt is a good inspiration

collect-and-deliver-interface-for-woocommerce/cdi.php 85% from 13 tests

The main PHP file in "CDI - Collect and Deliver Interface for Woocommerce" ver. 5.3.1 adds more information about the plugin and also serves as the entry point for this plugin
The following require your attention:
  • 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
  • Main file name: Name the main plugin file the same as the plugin slug ("collect-and-deliver-interface-for-woocommerce.php" instead of "cdi.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | There should be no dangerous file extensions present in any WordPress plugin
There were no executable files found in this plugin46,091 lines of code in 344 files:
LanguageFilesBlank linesComment linesLines of code
PHP2534,8237,78437,021
HTML597203,298
PO File17761,1052,876
CSS560541,316
JavaScript123336918
Markdown41030330
JSON500227
YAML211058
XML22032
SVG10015

PHP code Passed 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
This plugin has no cyclomatic complexity issues
Cyclomatic complexity
Average complexity per logical line of code0.30
Average class complexity22.05
▷ Minimum class complexity1.00
▷ Maximum class complexity391.00
Average method complexity4.13
▷ Minimum method complexity1.00
▷ Maximum method complexity87.00
Code structure
Namespaces34
Interfaces26
Traits0
Classes197
▷ Abstract classes31.52%
▷ Concrete classes19498.48%
▷ Final classes10554.12%
Methods1,598
▷ Static methods53733.60%
▷ Public methods1,44190.18%
▷ Protected methods674.19%
▷ Private methods905.63%
Functions100
▷ Named functions7272.00%
▷ Anonymous functions2828.00%
Constants143
▷ Global constants2920.28%
▷ Class constants11479.72%
▷ Public constants3026.32%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
67 PNG files occupy 3.01MB with 1.29MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
images/logocollectmerchant.png37.76KB16.55KB▼ 56.18%
images/iconcheckad.png0.35KB0.29KB▼ 15.97%
images/Cube_Points_Retraits_carto_clients/Cube_cartographie_points_retraits_100px.png4.55KB2.91KB▼ 36.06%
images/resetmetabox.png9.69KB0.62KB▼ 93.59%
images/intruck.png0.84KB0.74KB▼ 12.43%