89% bought-product-tab-for-woocommerce

Code Review | Bought Product Tab for WooCommerce

WordPress plugin Bought Product Tab for WooCommerce scored89%from 54 tests.

About plugin

  • Plugin page: bought-product-ta...
  • Plugin version: 1.0.0
  • PHP version: 7.4.16
  • WordPress version: 6.3.1
  • First release: Jun 17, 2018
  • Latest release: Jun 17, 2018
  • Number of updates: 2
  • Update frequency: every 3.0 days
  • Top authors: shadowfied (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /554 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.02MB] [CPU: ▼3.71ms] Passed 4 tests

This is a short check of server-side resources used by Bought Product Tab for WooCommerce
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.48 ▲0.0243.38 ▼2.73
Dashboard /wp-admin3.32 ▲0.0247.77 ▼4.77
Posts /wp-admin/edit.php3.37 ▲0.0247.82 ▼5.14
Add New Post /wp-admin/post-new.php5.90 ▲0.0289.95 ▼2.19
Media Library /wp-admin/upload.php3.25 ▲0.0239.50 ▲1.78

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

A short overview of filesystem and database impact
No storage issues were detected
Filesystem: 2 new files
Database: no new tables, 6 new options
New WordPress options
can_compress_scripts
widget_recent-posts
widget_theysaidso_widget
widget_recent-comments
theysaidso_admin_options
db_upgraded

Browser metrics Passed 4 tests

Checking browser requirements for Bought Product Tab for WooCommerce
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,804 ▲4314.72 ▲0.561.78 ▼0.0949.38 ▲4.77
Dashboard /wp-admin2,207 ▲275.51 ▼0.1486.48 ▼1.9239.31 ▼1.97
Posts /wp-admin/edit.php2,116 ▲131.97 ▲0.0140.23 ▼5.5237.39 ▼3.74
Add New Post /wp-admin/post-new.php1,541 ▲1322.97 ▼0.28697.57 ▲3.6655.32 ▼4.90
Media Library /wp-admin/upload.php1,418 ▲214.22 ▼0.00115.21 ▲15.1649.25 ▲7.88

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
The following items require your attention
  • Zombie WordPress options detected upon uninstall: 6 options
    • widget_recent-comments
    • can_compress_scripts
    • db_upgraded
    • widget_recent-posts
    • theysaidso_admin_options
    • widget_theysaidso_widget

Smoke tests Passed 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Even though no errors were found, this is by no means an exhaustive test

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

User-side errors Passed 1 test

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

Optimizations

Plugin configuration 93% from 29 tests

readme.txt Passed 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
5 plugin tags: woocommerce, product tabs, product, tabs, restrict

bought-product-tab-for-woocommerce/bought-product-tab-woocommerce.php 85% from 13 tests

The main PHP file in "Bought Product Tab for WooCommerce" ver. 1.0.0 adds more information about the plugin and also serves as the entry point for this plugin
Please take the time to fix the following:
  • 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
  • Main file name: The principal plugin file should be the same as the plugin slug ("bought-product-tab-for-woocommerce.php" instead of "bought-product-tab-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
No dangerous file extensions were detected91 lines of code in 1 file:
LanguageFilesBlank linesComment linesLines of code
PHP1347591

PHP code Passed 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.31
Average class complexity10.00
▷ Minimum class complexity10.00
▷ Maximum class complexity10.00
Average method complexity2.33
▷ Minimum method complexity1.00
▷ Maximum method complexity6.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods7
▷ Static methods114.29%
▷ Public methods685.71%
▷ Protected methods00.00%
▷ Private methods114.29%
Functions3
▷ Named functions133.33%
▷ Anonymous functions266.67%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
There are no PNG files in this plugin