83% brenger-for-woocommerce

Code Review | Brenger for WooCommerce

WordPress plugin Brenger for WooCommerce scored83%from 54 tests.

About plugin

  • Plugin page: brenger-for-wooco...
  • Plugin version: 1.0.0
  • PHP compatiblity: 7.2+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.4-5.9.3
  • WordPress version: 6.3.1
  • First release: May 27, 2022
  • Latest release: May 27, 2022
  • Number of updates: 3
  • Update frequency: every 2.3 days
  • Top authors: brenger (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /705 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
Install script ran successfully

Server metrics [RAM: ▲0.19MB] [CPU: ▼4.92ms] Passed 4 tests

Analyzing server-side resources used by Brenger for WooCommerce
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.68 ▲0.2137.88 ▲0.66
Dashboard /wp-admin3.54 ▲0.2346.38 ▼1.49
Posts /wp-admin/edit.php3.59 ▲0.2351.48 ▲1.40
Add New Post /wp-admin/post-new.php6.06 ▲0.1786.05 ▼20.26
Media Library /wp-admin/upload.php3.40 ▲0.1737.76 ▲1.70

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

Input-output and database impact of this plugin
The plugin installed successfully
Filesystem: 253 new files
Database: no new tables, 6 new options
New WordPress options
widget_theysaidso_widget
theysaidso_admin_options
db_upgraded
widget_recent-comments
can_compress_scripts
widget_recent-posts

Browser metrics Passed 4 tests

A check of browser resources used by Brenger for WooCommerce
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,804 ▲5813.18 ▼1.611.81 ▲0.1340.79 ▼4.63
Dashboard /wp-admin2,207 ▲194.85 ▼0.08108.45 ▼10.6650.75 ▲10.67
Posts /wp-admin/edit.php2,095 ▲32.05 ▲0.0441.01 ▼1.0937.04 ▼0.04
Add New Post /wp-admin/post-new.php1,537 ▲1823.31 ▲0.28636.24 ▲12.7652.50 ▲1.88
Media Library /wp-admin/upload.php1,392 ▲44.25 ▲0.06101.92 ▼1.2143.44 ▼2.72

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
The following items require your attention
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • widget_recent-comments
    • can_compress_scripts
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • widget_recent-posts
    • db_upgraded

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)
Good news, no errors were detected

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
  • 77× PHP files trigger server errors when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Interface 'Psr\\Http\\Message\\StreamInterface' not found in wp-content/plugins/brenger-for-woocommerce/vendor/guzzlehttp/psr7/src/CachingStream.php:13
    • > PHP Fatal error
      Uncaught Error: Class 'WP_List_Table' not found in wp-content/plugins/brenger-for-woocommerce/src/Orders/OrderItemsWithOptions.php:15
    • > PHP Fatal error
      Uncaught Error: Interface 'BrengerClient\\Model\\ModelInterface' not found in wp-content/plugins/brenger-for-woocommerce/vendor/level-level/brenger-client/lib/Model/CreatedShipmentAllOf.php:46
    • > PHP Parse error
      syntax error, unexpected '|', expecting '{' in wp-content/plugins/brenger-for-woocommerce/vendor/symfony/polyfill-intl-idn/bootstrap80.php on line 121
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit\\Framework\\TestCase' not found in wp-content/plugins/brenger-for-woocommerce/vendor/level-level/brenger-client/test/Model/ItemSetPartTest.php:43
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit\\Framework\\TestCase' not found in wp-content/plugins/brenger-for-woocommerce/vendor/level-level/brenger-client/test/Model/CreatedShipmentAllOfTest.php:43
    • > PHP Fatal error
      Uncaught Error: Interface 'GuzzleHttp\\Exception\\GuzzleException' not found in wp-content/plugins/brenger-for-woocommerce/vendor/guzzlehttp/guzzle/src/Exception/TransferException.php:4
    • > PHP Fatal error
      Uncaught Error: Class 'GuzzleHttp\\Cookie\\CookieJar' not found in wp-content/plugins/brenger-for-woocommerce/vendor/guzzlehttp/guzzle/src/Cookie/SessionCookieJar.php:7
    • > PHP Fatal error
      Uncaught Error: Interface 'BrengerClient\\Model\\ModelInterface' not found in wp-content/plugins/brenger-for-woocommerce/vendor/level-level/brenger-client/lib/Model/Address.php:46
    • > PHP Fatal error
      Uncaught Error: Interface 'GuzzleHttp\\Exception\\GuzzleException' not found in wp-content/plugins/brenger-for-woocommerce/vendor/guzzlehttp/guzzle/src/Exception/InvalidArgumentException.php:5

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 97% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is an important file in your plugin as it is parsed by WordPress.org to prepare the public listing of your plugin
Attributes that require attention:
  • Screenshots: Add images for these screenshots: #1 (The plugin adds 2 custom actions to your Order detail page), #2 (Customize the order details), #3 (Shipment status is automatically tracked)
You can look at the official readme.txt

brenger-for-woocommerce/brenger-for-woocommerce.php Passed 13 tests

The principal PHP file in "Brenger for WooCommerce" v. 1.0.0 is loaded by WordPress automatically on each request
49 characters long description:
Adds Brenger as a shipping plugin to WooCommerce.

Code Analysis 97% 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
Good job! No executable or dangerous file extensions detected37,879 lines of code in 234 files:
LanguageFilesBlank linesComment linesLines of code
PHP1863,70111,20332,898
Markdown281,24603,708
JSON10001,096
YAML622599
Bourne Shell114836
XML10023
Dockerfile18010
make1409

PHP code 50% from 2 tests

An overview of cyclomatic complexity and code structure
The following items need your attention
  • Please reduce cyclomatic complexity of methods to less than 100 (currently 179)
Cyclomatic complexity
Average complexity per logical line of code0.42
Average class complexity13.99
▷ Minimum class complexity1.00
▷ Maximum class complexity179.00
Average method complexity2.43
▷ Minimum method complexity1.00
▷ Maximum method complexity179.00
Code structure
Namespaces27
Interfaces16
Traits2
Classes134
▷ Abstract classes00.00%
▷ Concrete classes134100.00%
▷ Final classes2317.16%
Methods1,367
▷ Static methods27820.34%
▷ Public methods1,19387.27%
▷ Protected methods60.44%
▷ Private methods16812.29%
Functions177
▷ Named functions7642.94%
▷ Anonymous functions10157.06%
Constants215
▷ Global constants7836.28%
▷ Class constants13763.72%
▷ Public constants137100.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
3 PNG files occupy 3.59MB with 2.70MB in potential savings
Potential savings
Compression of 3 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/screenshot-1.png1,468.72KB386.02KB▼ 73.72%
assets/screenshot-3.png1,309.45KB310.43KB▼ 76.29%
assets/screenshot-2.png894.92KB216.07KB▼ 75.86%