62% frequently-woo-bought

Code Review | Frequently bought items

WordPress plugin Frequently bought items scored62%from 54 tests.

About plugin

  • Plugin page: frequently-woo-bo...
  • Plugin version: 1.0.4
  • PHP compatiblity: 7.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.0-6.2
  • WordPress version: 6.3.1
  • First release: Oct 20, 2022
  • Latest release: Apr 24, 2023
  • Number of updates: 20
  • Update frequency: every 9.4 days
  • Top authors: dipakraval (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /363 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
Installer ran successfully

Server metrics [RAM: ▲0.00MB] [CPU: ▼0.47ms] Passed 4 tests

A check of server-side resources used by Frequently bought items
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.46 ▲0.0035.55 ▲0.08
Dashboard /wp-admin3.31 ▲0.0044.23 ▲0.96
Posts /wp-admin/edit.php3.36 ▲0.0045.17 ▲5.54
Add New Post /wp-admin/post-new.php5.89 ▲0.0090.82 ▼5.73
Media Library /wp-admin/upload.php3.23 ▲0.0033.43 ▲2.82
Settings /wp-admin/admin.php?page=buy-together3.0022.57
ShortCode /wp-admin/admin.php?page=buy-together-shortcode3.0021.88
My Custom Submenu Page /wp-admin/admin.php?page=my-secondary-slug3.0022.73
My Custom Page 1 /wp-admin/admin.php?page=my-top-level-slug3.0022.16

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

Filesystem and database footprint
There were no storage issued detected upon installing this plugin
Filesystem: 199 new files
Database: no new tables, 7 new options
New WordPress options
widget_recent-posts
widget_theysaidso_widget
can_compress_scripts
FBI_options
theysaidso_admin_options
db_upgraded
widget_recent-comments

Browser metrics Passed 4 tests

Frequently bought items: an overview of browser usage
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,825 ▲7913.61 ▼0.581.80 ▲0.2641.24 ▲1.39
Dashboard /wp-admin2,206 ▲185.86 ▲0.96113.49 ▼2.1340.51 ▼7.68
Posts /wp-admin/edit.php2,086 ▼32.04 ▲0.0039.31 ▲3.9934.32 ▼1.46
Add New Post /wp-admin/post-new.php1,513 ▼2917.48 ▼0.81604.19 ▼44.4846.85 ▼27.90
Media Library /wp-admin/upload.php1,388 ▼34.18 ▼0.0097.31 ▼4.2742.89 ▼0.17
Settings /wp-admin/admin.php?page=buy-together280.440.133.57
ShortCode /wp-admin/admin.php?page=buy-together-shortcode280.440.093.91
My Custom Submenu Page /wp-admin/admin.php?page=my-secondary-slug280.440.073.57
My Custom Page 1 /wp-admin/admin.php?page=my-top-level-slug280.440.083.77

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
  • Zombie WordPress options detected upon uninstall: 7 options
    • widget_recent-posts
    • widget_recent-comments
    • widget_theysaidso_widget
    • FBI_options
    • db_upgraded
    • can_compress_scripts
    • theysaidso_admin_options

Smoke tests 25% 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 no errors were found, this is by no means an exhaustive test

SRP 0% 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
Please fix the following items
  • 3× PHP files output text when accessed directly:
    • > /wp-content/plugins/frequently-woo-bought/buy-together.php
    • > /wp-content/plugins/frequently-woo-bought/template/FBIShortCodeSettings.php
    • > /wp-content/plugins/frequently-woo-bought/template/templates/FBILayoutOne.php
  • 88× PHP files trigger errors when accessed directly with GET requests (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'Phpml\\Helper\\Optimizer\\StochasticGD' not found in wp-content/plugins/frequently-woo-bought/vendor/php-ai/php-ml/src/Helper/Optimizer/GD.php:14
    • > PHP Fatal error
      Uncaught Error: Interface 'Phpml\euralNetwork\\ActivationFunction' not found in wp-content/plugins/frequently-woo-bought/vendor/php-ai/php-ml/src/NeuralNetwork/ActivationFunction/ThresholdedReLU.php:9
    • > PHP Fatal error
      Uncaught Error: Interface 'Phpml\\Transformer' not found in wp-content/plugins/frequently-woo-bought/vendor/php-ai/php-ml/src/Preprocessing/Preprocessor.php:9
    • > PHP Fatal error
      Uncaught Error: Interface 'Phpml\\Estimator' not found in wp-content/plugins/frequently-woo-bought/vendor/php-ai/php-ml/src/Pipeline.php:9
    • > PHP Fatal error
      Uncaught Error: Interface 'Phpml\\Preprocessing\\Preprocessor' not found in wp-content/plugins/frequently-woo-bought/vendor/php-ai/php-ml/src/Preprocessing/NumberConverter.php:7
    • > PHP Fatal error
      Uncaught Error: Interface 'Phpml\\Preprocessing\\Imputer\\Strategy' not found in wp-content/plugins/frequently-woo-bought/vendor/php-ai/php-ml/src/Preprocessing/Imputer/Strategy/MeanStrategy.php:10
    • > PHP Fatal error
      Uncaught Error: Interface 'Phpml\\Math\\Kernel' not found in wp-content/plugins/frequently-woo-bought/vendor/php-ai/php-ml/src/Math/Kernel/RBF.php:11
    • > PHP Fatal error
      Uncaught Error: Class 'Phpml\\CrossValidation\\Split' not found in wp-content/plugins/frequently-woo-bought/vendor/php-ai/php-ml/src/CrossValidation/RandomSplit.php:9
    • > PHP Fatal error
      Uncaught Error: Interface 'Phpml\\Estimator' not found in wp-content/plugins/frequently-woo-bought/vendor/php-ai/php-ml/src/Classification/Classifier.php:9
    • > PHP Fatal error
      Uncaught Error: Class 'Phpml\\Dataset\\ArrayDataset' not found in wp-content/plugins/frequently-woo-bought/vendor/php-ai/php-ml/src/Dataset/FilesDataset.php:9

User-side errors 0% from 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
There are user-side issues you should fix
    • > GET request to /wp-admin/admin.php?page=buy-together
    • > Network (severe)
    wp-admin/admin.php?page=buy-together - Failed to load resource: the server responded with a status of 403 (Forbidden)
    • > GET request to /wp-admin/admin.php?page=buy-together-shortcode
    • > Network (severe)
    wp-admin/admin.php?page=buy-together-shortcode - Failed to load resource: the server responded with a status of 403 (Forbidden)
    • > GET request to /wp-admin/admin.php?page=my-secondary-slug
    • > Network (severe)
    wp-admin/admin.php?page=my-secondary-slug - Failed to load resource: the server responded with a status of 403 (Forbidden)
    • > GET request to /wp-admin/admin.php?page=my-top-level-slug
    • > Network (severe)
    wp-admin/admin.php?page=my-top-level-slug - Failed to load resource: the server responded with a status of 403 (Forbidden)

Optimizations

Plugin configuration 86% from 29 tests

readme.txt 94% from 16 tests

It's important to format your readme.txt file correctly as it is parsed for the public listing of your plugin
These attributes need to be fixed: You can look at the official readme.txt

frequently-woo-bought/buy-together.php 77% from 13 tests

The main file in "Frequently bought items" v. 1.0.4 serves as a complement to information provided in readme.txt and as the entry point to the plugin
Please make the necessary changes and fix the following:
  • Domain Path: The domain path points to an invalid folder, "/languages" does not exist
  • Main file name: The principal plugin file should be the same as the plugin slug ("frequently-woo-bought.php" instead of "buy-together.php")
  • Text Domain: You no longer need to specify the text domain since WordPress 4.6; it must be the same as the plugin slug

Code Analysis 5% from 3 tests

File types 0% from 1 test

🔸 Test weight: 35 | A short review of files and their extensions; it is not recommended to include executable files
Please make sure to remedy the following
  • Do not distribute dangerous files with your plugin
    • .exe - Executable in Windows
      • wp-content/plugins/frequently-woo-bought/vendor/php-ai/php-ml/bin/libsvm/svm-predict.exe
      • wp-content/plugins/frequently-woo-bought/vendor/php-ai/php-ml/bin/libsvm/svm-scale.exe
      • wp-content/plugins/frequently-woo-bought/vendor/php-ai/php-ml/bin/libsvm/svm-train.exe
9,889 lines of code in 177 files:
LanguageFilesBlank linesComment linesLines of code
PHP1602,4433,0038,735
CSS49113759
JSON300138
Markdown2290125
JavaScript4101197
SVG30031
Bourne Shell1004

PHP code Passed 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.33
Average class complexity8.42
▷ Minimum class complexity1.00
▷ Maximum class complexity137.00
Average method complexity2.76
▷ Minimum method complexity1.00
▷ Maximum method complexity73.00
Code structure
Namespaces41
Interfaces17
Traits3
Classes128
▷ Abstract classes97.03%
▷ Concrete classes11992.97%
▷ Final classes1815.13%
Methods650
▷ Static methods8513.08%
▷ Public methods44167.85%
▷ Protected methods9915.23%
▷ Private methods11016.92%
Functions50
▷ Named functions816.00%
▷ Anonymous functions4284.00%
Constants46
▷ Global constants36.52%
▷ Class constants4393.48%
▷ Public constants3888.37%

Plugin size Passed 2 tests

Image compression Passed 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
1 PNG file occupies 0.10MB with 0.03MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
assets/images/dummy.png100.24KB73.05KB▼ 27.12%