83% gg-bought-together

Code Review | GG Bought Together for WooCommerce

WordPress plugin GG Bought Together for WooCommerce scored83%from 54 tests.

About plugin

  • Plugin page: gg-bought-together
  • Plugin version: 1.0.2
  • PHP compatiblity: 7.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 3.6-5.4.1
  • WordPress version: 6.3.1
  • First release: Jun 26, 2020
  • Latest release: Oct 4, 2020
  • Number of updates: 8
  • Update frequency: every 12.6 days
  • Top authors: gutengeek (100%)

Code review

54 tests

User reviews

2 reviews

Install metrics

100+ active /1,442 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
This plugin's installer ran successfully

Server metrics [RAM: ▲0.52MB] [CPU: ▼0.76ms] Passed 4 tests

Analyzing server-side resources used by GG Bought Together for WooCommerce
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.84 ▲0.3825.58 ▼9.55
Dashboard /wp-admin3.88 ▲0.5456.16 ▼2.85
Posts /wp-admin/edit.php3.93 ▲0.5850.98 ▲3.62
Add New Post /wp-admin/post-new.php6.48 ▲0.6097.42 ▲5.76
Media Library /wp-admin/upload.php3.79 ▲0.5741.74 ▲11.08
Bought Together /wp-admin/admin.php?page=gg-woo-bt-settings3.9336.73

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

Analyzing filesystem and database footprints of this plugin
The plugin installed successfully
Filesystem: 164 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-comments
db_upgraded
can_compress_scripts
theysaidso_admin_options
widget_recent-posts
widget_theysaidso_widget

Browser metrics Passed 4 tests

GG Bought Together for WooCommerce: an overview of browser usage
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,467 ▼27913.49 ▼1.260.46 ▼1.3015.90 ▼24.12
Dashboard /wp-admin2,205 ▲205.22 ▼0.66100.46 ▲1.1738.02 ▼2.97
Posts /wp-admin/edit.php2,097 ▲82.38 ▲0.3639.97 ▲5.7132.45 ▼4.36
Add New Post /wp-admin/post-new.php6,240 ▲4,69821.71 ▲3.39887.63 ▲296.2044.74 ▼10.04
Media Library /wp-admin/upload.php1,384 ▼44.35 ▲0.1298.58 ▲3.5443.26 ▲1.14
Bought Together /wp-admin/admin.php?page=gg-woo-bt-settings1,0592.6938.3529.15

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
You still need to fix the following
  • Zombie WordPress options were found after uninstall: 6 options
    • widget_recent-posts
    • widget_theysaidso_widget
    • db_upgraded
    • theysaidso_admin_options
    • can_compress_scripts
    • widget_recent-comments

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)
Everything seems fine, however this is by no means an exhaustive test

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
The following issues need your attention
  • 21× PHP files trigger server errors when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'GG_Woo_BT\\Core\\Metabox' not found in wp-content/plugins/gg-bought-together/inc/Admin/Setting/General.php:13
    • > PHP Fatal error
      Uncaught Error: Class 'GG_Woo_BT\\Core\\Metabox' not found in wp-content/plugins/gg-bought-together/inc/Admin/Setting/Default_Products.php:13
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_attr() in wp-content/plugins/gg-bought-together/inc/Libraries/Form/Field/views/input-multi-checkbox.php:14
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wp_nonce_field() in wp-content/plugins/gg-bought-together/inc/Libraries/Form/View/tabs.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wp_parse_args() in wp-content/plugins/gg-bought-together/inc/Libraries/Form/Field/views/input-textarea.php:12
    • > PHP Fatal error
      Uncaught Error: Class 'GG_Woo_BT\\Core\\Controller' not found in wp-content/plugins/gg-bought-together/inc/Admin/Controller/Product.php:6
    • > PHP Fatal error
      Uncaught Error: Class 'GG_Woo_BT\\Core\\Controller' not found in wp-content/plugins/gg-bought-together/inc/Admin/Controller/Search.php:7
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html__() in wp-content/plugins/gg-bought-together/inc/Libraries/Form/Field/views/input-select.php:15
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wp_parse_args() in wp-content/plugins/gg-bought-together/inc/Libraries/Form/Field/views/input-switch.php:15
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wp_parse_args() in wp-content/plugins/gg-bought-together/inc/Libraries/Form/Field/views/input-title.php:13

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
No browser issues were found

Optimizations

Plugin configuration 86% from 29 tests

readme.txt 94% from 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
Attributes that require attention:
  • Screenshots: Add descriptions for screenshots #1, #10, #2, #3, #4, #5, #6, #7, #8, #9 in gg-bought-together/assets to your readme.txt
Please take inspiration from this readme.txt

gg-bought-together/gg-bought-together.php 77% from 13 tests

This is the main PHP file of "GG Bought Together for WooCommerce" version 1.0.2, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
The following require your attention:
  • Description: If Twitter did it, so should we! Keep the description under 140 characters (currently 155 characters long)
  • 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
  • Requires at least: Required version must be the same as the one declared in readme.txt ("5.2" instead of "3.6")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of file extensions present in this plugin and a short test that no dangerous files are bundled with this plugin
There were no executable files found in this plugin17,836 lines of code in 147 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript732,75588110,790
PHP631,3412,2535,395
CSS93821171,631
SVG10019
JSON1001

PHP code Passed 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
There are no cyclomatic complexity problems detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.46
Average class complexity16.59
▷ Minimum class complexity1.00
▷ Maximum class complexity98.00
Average method complexity3.38
▷ Minimum method complexity1.00
▷ Maximum method complexity39.00
Code structure
Namespaces12
Interfaces1
Traits1
Classes37
▷ Abstract classes25.41%
▷ Concrete classes3594.59%
▷ Final classes00.00%
Methods258
▷ Static methods2810.85%
▷ Public methods22587.21%
▷ Protected methods72.71%
▷ Private methods2610.08%
Functions27
▷ Named functions2696.30%
▷ Anonymous functions13.70%
Constants13
▷ Global constants753.85%
▷ Class constants646.15%
▷ Public constants6100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
No PNG files were detected