83% bpost-shipping

Code Review | bpost shipping

WordPress plugin bpost shipping scored83%from 54 tests.

About plugin

  • Plugin page: bpost-shipping
  • Plugin version: 3.0.3
  • PHP compatiblity: 7.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0-6.3
  • WordPress version: 6.3.1
  • First release: Nov 27, 2015
  • Latest release: Nov 8, 2023
  • Number of updates: 215
  • Update frequency: every 13.5 days
  • Top authors: antidot-dev (85.58%)slegrand.antidot (14.88%)

Code review

54 tests

User reviews

5 reviews

Install metrics

1,000+ active /37,256 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.00MB] [CPU: ▼8.05ms] Passed 4 tests

An overview of server-side resources used by bpost shipping
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0033.11 ▼7.78
Dashboard /wp-admin3.31 ▲0.0145.49 ▼8.32
Posts /wp-admin/edit.php3.37 ▲0.0047.46 ▼1.72
Add New Post /wp-admin/post-new.php5.90 ▲0.0081.70 ▼14.39
Media Library /wp-admin/upload.php3.24 ▲0.0035.01 ▼0.26

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

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

Browser metrics Passed 4 tests

Checking browser requirements for bpost shipping
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,795 ▲4814.30 ▼0.051.60 ▼0.0340.89 ▼3.84
Dashboard /wp-admin2,197 ▲235.49 ▼0.1984.04 ▼14.8838.03 ▼4.97
Posts /wp-admin/edit.php2,105 ▲52.02 ▲0.0240.25 ▲1.7937.11 ▲1.61
Add New Post /wp-admin/post-new.php1,531 ▼1422.96 ▼2.51624.60 ▼23.4450.37 ▼13.03
Media Library /wp-admin/upload.php1,408 ▲54.23 ▲0.05100.17 ▼8.4143.46 ▼2.21

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
The following items require your attention
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • can_compress_scripts
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • widget_recent-posts
    • db_upgraded
    • widget_recent-comments

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check 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 | It is important to ensure that your PHP files perform no action when accessed directly, respecting the single-responsibility principle
Please fix the following items
  • 318× PHP files trigger errors when accessed directly with GET requests (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit_Framework_TestCase' not found in wp-content/plugins/bpost-shipping/vendor/antidot-be/bpost-api-library/tests/Bpost/Order/Box/Openinghour/DayTest.php:7
    • > PHP Fatal error
      Uncaught Error: Class 'Monolog\\Handler\\Handler' not found in wp-content/plugins/bpost-shipping/vendor/monolog/monolog/src/Monolog/Handler/FilterHandler.php:31
    • > PHP Fatal error
      Uncaught Error: Class 'Bpost\\BpostApiClient\\Bpost\\Order\\Box\\Option\\Option' not found in wp-content/plugins/bpost-shipping/vendor/antidot-be/bpost-api-library/src/Bpost/Order/Box/Option/Messaging.php:16
    • > PHP Fatal error
      Uncaught Error: Class 'Monolog\\Handler\\AbstractProcessingHandler' not found in wp-content/plugins/bpost-shipping/vendor/monolog/monolog/src/Monolog/Handler/StreamHandler.php:26
    • > PHP Fatal error
      Uncaught Error: Class 'Bpost\\BpostApiClient\\Exception\\BpostLogicException' not found in wp-content/plugins/bpost-shipping/vendor/antidot-be/bpost-api-library/src/Exception/BpostLogicException/BpostInvalidPatternException.php:11
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit_Framework_TestCase' not found in wp-content/plugins/bpost-shipping/vendor/antidot-be/bpost-api-library/tests/Bpost/Order/Box/Option/SignatureTest.php:6
    • > PHP Fatal error
      Uncaught Error: Class 'Monolog\\Handler\\AbstractProcessingHandler' not found in wp-content/plugins/bpost-shipping/vendor/monolog/monolog/src/Monolog/Handler/RedisHandler.php:31
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit_Framework_TestCase' not found in wp-content/plugins/bpost-shipping/vendor/antidot-be/bpost-api-library/tests/Exception/ApiResponseException/BpostInvalidResponseExceptionTest.php:7
    • > PHP Fatal error
      Uncaught Error: Interface 'Psr\\Log\\LoggerInterface' not found in wp-content/plugins/bpost-shipping/vendor/monolog/monolog/src/Monolog/Logger.php:34
    • > PHP Fatal error
      Uncaught Error: Class 'Monolog\\Handler\\AbstractProcessingHandler' not found in wp-content/plugins/bpost-shipping/vendor/monolog/monolog/src/Monolog/Handler/PHPConsoleHandler.php:44

User-side errors Passed 1 test

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

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
These attributes need to be fixed:
  • Plugin Name: Please specify the plugin name on the first line ( === bpost-shipping === )
You can look at the official readme.txt

bpost-shipping/bpost-shipping.php 85% from 13 tests

The main PHP file in "bpost shipping" ver. 3.0.3 adds more information about the plugin and also serves as the entry point for this plugin
You should first fix the following items:
  • Description: The description should be shorter than 140 characters (currently 161 characters long)
  • Requires at least: The required version number must match the one declared in readme.txt ("4.9" instead of "3.0")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is a short overview of programming languages used in this plugin, detecting executable files
No dangerous file extensions were detected38,868 lines of code in 482 files:
LanguageFilesBlank linesComment linesLines of code
PHP4476,94114,01830,950
SVG1002,671
CSS40132,330
Markdown1550201,681
JavaScript514518719
JSON510406
YAML310059
XML28152

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.22
Average class complexity5.80
▷ Minimum class complexity1.00
▷ Maximum class complexity56.00
Average method complexity1.94
▷ Minimum method complexity1.00
▷ Maximum method complexity56.00
Code structure
Namespaces79
Interfaces13
Traits5
Classes462
▷ Abstract classes163.46%
▷ Concrete classes44696.54%
▷ Final classes30.67%
Methods2,489
▷ Static methods1586.35%
▷ Public methods2,02081.16%
▷ Protected methods2309.24%
▷ Private methods2399.60%
Functions89
▷ Named functions910.11%
▷ Anonymous functions8089.89%
Constants259
▷ Global constants83.09%
▷ Class constants25196.91%
▷ Public constants22489.24%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
3 PNG files occupy 0.05MB with 0.03MB in potential savings
Potential savings
Compression of 3 random PNG files using pngquant
FileSize - originalSize - compressedSavings
public/images/bpost_logo_4c_c.png47.31KB19.47KB▼ 58.84%
public/images/icon-print-label.png2.84KB0.15KB▼ 94.88%
public/images/bpost-logo.png2.34KB1.83KB▼ 21.72%