73% trunkrs-for-woocommerce

Code Review | Trunkrs for WooCommerce

WordPress plugin Trunkrs for WooCommerce scored73%from 54 tests.

About plugin

  • Plugin page: trunkrs-for-wooco...
  • Plugin version: 1.3.0
  • PHP compatiblity: 7.1+
  • PHP version: 7.4.16
  • WordPress compatibility: 3.6 & WooCommerce 3.0+-6.4
  • WordPress version: 6.3.1
  • First release: Sep 1, 2021
  • Latest release: Nov 30, 2023
  • Number of updates: 56
  • Update frequency: every 14.6 days
  • Top authors: fean (100%)

Code review

54 tests

User reviews

1 review

Install metrics

20+ active /1,280 total downloads

Benchmarks

Plugin footprint 65% 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.04MB] [CPU: ▼8.80ms] Passed 4 tests

Server-side resources used by Trunkrs for WooCommerce
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.50 ▲0.0425.04 ▼16.96
Dashboard /wp-admin3.36 ▲0.0148.42 ▼16.74
Posts /wp-admin/edit.php3.47 ▲0.1145.57 ▼0.74
Add New Post /wp-admin/post-new.php5.94 ▲0.0592.10 ▼0.75
Media Library /wp-admin/upload.php3.28 ▲0.0535.73 ▲3.39

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

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

Browser metrics Passed 4 tests

An overview of browser requirements for Trunkrs for WooCommerce
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,487 ▼26014.63 ▲0.420.57 ▼1.0820.37 ▼23.63
Dashboard /wp-admin2,231 ▲535.65 ▼0.0795.76 ▼14.1879.53 ▲37.40
Posts /wp-admin/edit.php2,137 ▲371.96 ▼0.0639.97 ▲2.9634.24 ▼0.73
Add New Post /wp-admin/post-new.php1,712 ▲17521.76 ▼1.32672.83 ▼11.7252.00 ▲0.61
Media Library /wp-admin/upload.php1,436 ▲364.14 ▼0.0296.07 ▼1.4365.24 ▲23.21

Uninstaller [IO: ▲0.00MB] [DB: ▲0.00MB] 50% 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
  • Zombie tables were found after uninstall: 1 table
    • wp_trunkrs_rule_audit_log_v3
  • The uninstall procedure has failed, leaving 6 options in the database
    • widget_theysaidso_widget
    • widget_recent-comments
    • can_compress_scripts
    • theysaidso_admin_options
    • widget_recent-posts
    • db_upgraded

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
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
  • 24× PHP files trigger server-side errors or warnings when accessed directly (only 10 are shown):
    • > PHP Warning
      include_once(ABSPATHWPINC/class-http.php): failed to open stream: No such file or directory in wp-content/plugins/trunkrs-for-woocommerce/includes/api.php on line 5
    • > PHP Warning
      include_once(): Failed opening 'ABSPATHWPINC/class-http.php' for inclusion (include_path='.:/usr/share/php') in wp-content/plugins/trunkrs-for-woocommerce/includes/api.php on line 5
    • > PHP Warning
      Use of undefined constant WPINC - assumed 'WPINC' (this will throw an Error in a future version of PHP) in wp-content/plugins/trunkrs-for-woocommerce/includes/api.php on line 5
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/trunkrs-for-woocommerce/includes/wc-internal/notices.php:7
    • > PHP Warning
      Use of undefined constant ABSPATH - assumed 'ABSPATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/trunkrs-for-woocommerce/includes/api.php on line 5
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_basename() in wp-content/plugins/trunkrs-for-woocommerce/trunkrs-woocommerce.php:64
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/trunkrs-for-woocommerce/includes/wc-internal/shipping-method.php:164
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/trunkrs-for-woocommerce/includes/wc-internal/track-trace.php:8
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/trunkrs-for-woocommerce/includes/wc-internal/subscriptions.php:8
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/trunkrs-for-woocommerce/includes/admin/admin-endpoints.php:24

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
No browser issues were 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:
  • Requires at least: Invalid plugin version format
  • Screenshots: Please add images for these screenshots: #1 (Manage your shipment details in the order page.), #2 (Easy to set-up and understand carrier service management.)
Please take inspiration from this readme.txt

trunkrs-for-woocommerce/trunkrs-woocommerce.php 85% from 13 tests

The primary PHP file in "Trunkrs for WooCommerce" version 1.3.0 is used by WordPress to initiate all plugin functionality
The following require your attention:
  • Requires at least: Required version number formatted incorrectly (ex. "7.0" instead of "3.6 & WooCommerce 3.0+")
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("trunkrs-for-woocommerce.php" instead of "trunkrs-woocommerce.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are considered dangerous and should not be included with any WordPress plugin
Good job! No executable or dangerous file extensions detected2,149 lines of code in 37 files:
LanguageFilesBlank linesComment linesLines of code
PHP294263341,868
PO File2604186
SVG30072
CSS20022
JavaScript1001

PHP code Passed 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.29
Average class complexity7.58
▷ Minimum class complexity1.00
▷ Maximum class complexity44.00
Average method complexity2.07
▷ Minimum method complexity1.00
▷ Maximum method complexity12.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes24
▷ Abstract classes14.17%
▷ Concrete classes2395.83%
▷ Final classes00.00%
Methods140
▷ Static methods4935.00%
▷ Public methods11985.00%
▷ Protected methods00.00%
▷ Private methods2115.00%
Functions12
▷ Named functions433.33%
▷ Anonymous functions866.67%
Constants51
▷ Global constants35.88%
▷ Class constants4894.12%
▷ Public constants4083.33%

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
1 PNG file occupies 0.00MB with 0.00MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
build/icons/trunkrs.png3.93KB2.40KB▼ 38.99%