94% discussions-tab-for-woocommerce-products

Code Review | Discussions Tab for WooCommerce Products

WordPress plugin Discussions Tab for WooCommerce Products scored 94% from 54 tests.

About plugin

  • Plugin page: discussions-tab-f...
  • Plugin version: 1.3.7
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.0-5.8
  • WordPress version: 5.8.1
  • First release: Jul 20, 2017
  • Latest release: Oct 5, 2021
  • Number of updates: 48
  • Update frequency: every 32.0 days
  • Top authors: algoritmika (75%)Karzin (27.08%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active / 1,634 total downloads

Benchmarks

Plugin footprint Passed 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.00MB] [CPU: ▼136.67ms] Passed 4 tests

A check of server-side resources used by Discussions Tab for WooCommerce Products
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /2.84 ▲0.1233.00 ▲11.52
Dashboard /wp-admin3.06 ▲0.0141.17 ▼2.93
Posts /wp-admin/edit.php3.11 ▲0.0043.78 ▲1.10
Add New Post /wp-admin/post-new.php5.42 ▼0.0189.04 ▼543.63
Media Library /wp-admin/upload.php3.00 ▲0.0031.84 ▼1.21

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

A short overview of filesystem and database impact
No storage issues were detected
Filesystem: 95 new files
Database: no new tables, no new options

Browser metrics Passed 4 tests

A check of browser resources used by Discussions Tab for WooCommerce Products
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,703 ▲10715.91 ▲0.209.51 ▲0.7148.79 ▲1.79
Dashboard /wp-admin2,967 ▲365.84 ▼0.11138.64 ▼5.12111.23 ▼8.06
Posts /wp-admin/edit.php2,739 ▼02.70 ▼0.0164.50 ▲0.8084.15 ▼2.18
Add New Post /wp-admin/post-new.php1,500 ▼11518.44 ▼2.96342.20 ▲74.49106.40 ▼1.40
Media Library /wp-admin/upload.php1,810 ▼05.03 ▲0.01146.39 ▼8.09119.63 ▲3.28

Uninstaller [IO: ▲0.00MB] [DB: ▲0.00MB] Passed 4 tests

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
The plugin uninstalled successfully, without leaving any zombie files or tables

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

SRP 50% from 2 tests

🔹 Tests weight: 20 | SRP (Single-Responsibility Principle) - PHP files must act as libraries and never output text or perform any action when accessed directly in a browser
Almost there! Just fix the following items
  • 1× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function sanitize_text_field() in wp-content/plugins/discussions-tab-for-woocommerce-products/templates/dtwp-comments.php:13

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 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
Attributes that require attention:
  • Tags: Please reduce the number of tags, currently 18 tag instead of maximum 10
You can take inspiration from this readme.txt

discussions-tab-for-woocommerce-products/discussions-tab-for-woocommerce-products.php 92% from 13 tests

The main file in "Discussions Tab for WooCommerce Products" v. 1.3.7 serves as a complement to information provided in readme.txt and as the entry point to the plugin
You should first fix the following items:
  • Requires at least: Required version must match the one declared in readme.txt ("4.4" instead of "3.0.0")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | There should be no dangerous file extensions present in any WordPress plugin
There were no executable files found in this plugin8,364 lines of code in 76 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript30992824,811
PHP305611,4322,822
CSS63242439
Sass6111189
JSON400103

PHP code Passed 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
This plugin has no cyclomatic complexity problems
Cyclomatic complexity
Average complexity per logical line of code0.43
Average class complexity12.67
▷ Minimum class complexity1.00
▷ Maximum class complexity64.00
Average method complexity2.61
▷ Minimum method complexity1.00
▷ Maximum method complexity18.00
Code structure
Namespaces6
Interfaces0
Traits0
Classes21
▷ Abstract classes00.00%
▷ Concrete classes21100.00%
▷ Final classes14.76%
Methods155
▷ Static methods1610.32%
▷ Public methods15096.77%
▷ Protected methods31.94%
▷ Private methods21.29%
Functions12
▷ Named functions975.00%
▷ Anonymous functions325.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
1 compressed PNG file occupies 0.01MB
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
assets/images/autofill-frontend.png5.47KB5.50KB0.00%