77% bring-fraktguiden-for-woocommerce

Code Review | Bring Fraktguiden for WooCommerce

WordPress plugin Bring Fraktguiden for WooCommerce scored77%from 54 tests.

About plugin

  • Plugin page: bring-fraktguiden...
  • Plugin version: 1.10.4
  • PHP compatiblity: 8.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.6.0-6.4.0
  • WordPress version: 6.3.1
  • First release: Dec 16, 2015
  • Latest release: Nov 24, 2023
  • Number of updates: 160
  • Update frequency: every 18.2 days
  • Top authors: drivdigital (68.75%)Forsvunnet (28.13%)DrivTeam (4.38%)

Code review

54 tests

User reviews

16 reviews

Install metrics

700+ active /23,074 total downloads

Benchmarks

Plugin footprint 82% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.04MB] [CPU: ▼8.13ms] Passed 4 tests

Analyzing server-side resources used by Bring Fraktguiden for WooCommerce
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.51 ▲0.0540.39 ▼3.98
Dashboard /wp-admin3.36 ▲0.0150.69 ▼26.61
Posts /wp-admin/edit.php3.47 ▲0.1150.15 ▲0.75
Add New Post /wp-admin/post-new.php5.94 ▲0.0583.70 ▼2.63
Media Library /wp-admin/upload.php3.28 ▲0.0536.36 ▲0.70

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

Analyzing filesystem and database footprints of this plugin
Please try to fix the following items
  • Try to limit filesystem usage to 25MB (currently using 27.41MB)
Filesystem: 353 new files
Database: no new tables, 6 new options
New WordPress options
widget_theysaidso_widget
db_upgraded
widget_recent-posts
can_compress_scripts
theysaidso_admin_options
widget_recent-comments

Browser metrics Passed 4 tests

A check of browser resources used by Bring Fraktguiden for WooCommerce
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,790 ▲5414.06 ▼0.291.61 ▼0.3139.29 ▼11.70
Dashboard /wp-admin2,192 ▲155.59 ▼0.0795.40 ▲4.7541.35 ▲2.59
Posts /wp-admin/edit.php2,103 ▲32.01 ▲0.0141.44 ▲5.0237.59 ▲1.57
Add New Post /wp-admin/post-new.php1,526 ▼023.53 ▲0.02663.16 ▼37.8964.30 ▼1.73
Media Library /wp-admin/upload.php1,400 ▲34.20 ▲0.0199.22 ▼5.4742.91 ▼2.36

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
You still need to fix the following
  • This plugin does not fully uninstall, leaving 6 options in the database
    • db_upgraded
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • widget_recent-comments
    • can_compress_scripts
    • widget_recent-posts

Smoke tests 50% 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 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
Almost there! Just fix the following items
  • 2× PHP files output text when accessed directly:
    • > /wp-content/plugins/bring-fraktguiden-for-woocommerce/templates/woocommerce/alternative-dates.php
    • > /wp-content/plugins/bring-fraktguiden-for-woocommerce/includes/pdfmerger/tcpdf/tools/tcpdf_addfont.php
  • 32× PHP files trigger server-side errors or warnings when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html_e() in wp-content/plugins/bring-fraktguiden-for-woocommerce/pro/booking/templates/waybills-table-labels.php:105
    • > PHP Parse error
      syntax error, unexpected 'public' (T_PUBLIC), expecting variable (T_VARIABLE) in wp-content/plugins/bring-fraktguiden-for-woocommerce/pro/pickuppoint/SelectedPickUpPointComponent.php on line 7
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_attr() in wp-content/plugins/bring-fraktguiden-for-woocommerce/includes/admin/pro-notices.php:25
    • > PHP Warning
      Invalid argument supplied for foreach() in wp-content/plugins/bring-fraktguiden-for-woocommerce/pro/booking/templates/waybills-waybill.php on line 8
    • > PHP Fatal error
      Uncaught Error: Class 'Bring_Fraktguiden\\Vas\\VAS' not found in wp-content/plugins/bring-fraktguiden-for-woocommerce/classes/vas/class-vas-checkbox.php:13
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html() in wp-content/plugins/bring-fraktguiden-for-woocommerce/templates/system-info/shipping-zones.php:4
    • > PHP Fatal error
      Uncaught Error: Class 'BringFraktguidenPro\\Booking\\Labels\\Bring_Label_Collection' not found in wp-content/plugins/bring-fraktguiden-for-woocommerce/pro/booking/labels/class-bring-zpl-collection.php:13
    • > PHP Notice
      Undefined variable: new in wp-content/plugins/bring-fraktguiden-for-woocommerce/pro/booking/templates/waybills-messages.php on line 43
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html_e() in wp-content/plugins/bring-fraktguiden-for-woocommerce/pro/booking/templates/modal-templates.php:9
    • > PHP Notice
      Undefined variable: consignment in wp-content/plugins/bring-fraktguiden-for-woocommerce/pro/booking/templates/consignment-table-booking.php on line 14

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
Everything seems fine on the user side

Optimizations

Plugin configuration 93% 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:
  • Tags: Please reduce the number of tags, currently 12 tag instead of maximum 10
The official readme.txt might help

bring-fraktguiden-for-woocommerce/bring-fraktguiden-for-woocommerce.php 92% from 13 tests

"Bring Fraktguiden for WooCommerce" version 1.10.4's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
You should first fix the following items:
  • Requires at least: Required version must be the same as the one declared in readme.txt ("5.6" instead of "5.6.0")

Code Analysis 95% from 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short glimpse at programming languages used with this plugin and a check that no dangerous files are present
Everything looks great! No dangerous files found in this plugin79,216 lines of code in 219 files:
LanguageFilesBlank linesComment linesLines of code
PHP1813,55015,62258,219
JSON40016,589
JavaScript162534981,543
PO File14927041,082
Vuejs Component8460963
Sass31210714
Markdown28059
XML10444
CSS3003

PHP code 0% from 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
Please tend to the following items
  • Please reduce cyclomatic complexity of classes to less than 1000 (currently 4,420)
  • Cyclomatic complexity of methods has to be reduced to less than 100 (currently 503)
Cyclomatic complexity
Average complexity per logical line of code0.42
Average class complexity89.76
▷ Minimum class complexity1.00
▷ Maximum class complexity4,420.00
Average method complexity7.64
▷ Minimum method complexity1.00
▷ Maximum method complexity503.00
Code structure
Namespaces23
Interfaces0
Traits1
Classes87
▷ Abstract classes33.45%
▷ Concrete classes8496.55%
▷ Final classes00.00%
Methods1,180
▷ Static methods34329.07%
▷ Public methods85272.20%
▷ Protected methods29925.34%
▷ Private methods292.46%
Functions3
▷ Named functions133.33%
▷ Anonymous functions266.67%
Constants142
▷ Global constants12185.21%
▷ Class constants2114.79%
▷ Public constants21100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
There are no PNG files in this plugin