83% saffire-frequently-bought-together-learndash

Code Review | Frequently Bought Together for LearnDash

WordPress plugin Frequently Bought Together for LearnDash scored83%from 54 tests.

About plugin

  • Plugin page: saffire-frequentl...
  • Plugin version: 1.0.6
  • PHP compatiblity: 7.2+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.3-6.3.1
  • WordPress version: 6.3.1
  • First release: Dec 30, 2022
  • Latest release: Oct 20, 2023
  • Number of updates: 14
  • Update frequency: every 21.5 days
  • Top authors: saffiretech (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /515 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
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.17MB] [CPU: ▼7.81ms] Passed 4 tests

An overview of server-side resources used by Frequently Bought Together for LearnDash
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.65 ▲0.1943.31 ▲5.37
Dashboard /wp-admin3.49 ▲0.1456.17 ▼7.63
Posts /wp-admin/edit.php3.60 ▲0.2451.31 ▲6.10
Add New Post /wp-admin/post-new.php6.07 ▲0.1886.63 ▼26.73
Media Library /wp-admin/upload.php3.41 ▲0.1836.78 ▼2.25

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

A short overview of filesystem and database impact
There were no storage issued detected upon installing this plugin
Filesystem: 16 new files
Database: no new tables, 6 new options
New WordPress options
widget_theysaidso_widget
theysaidso_admin_options
can_compress_scripts
widget_recent-comments
widget_recent-posts
db_upgraded

Browser metrics Passed 4 tests

An overview of browser requirements for Frequently Bought Together for LearnDash
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,020 ▲25914.95 ▲0.6711.36 ▲9.8842.90 ▲4.92
Dashboard /wp-admin2,239 ▲595.16 ▼0.50107.92 ▲9.7441.18 ▼6.62
Posts /wp-admin/edit.php2,142 ▲422.73 ▲0.7247.41 ▲10.5339.00 ▲3.46
Add New Post /wp-admin/post-new.php1,568 ▲3423.64 ▲5.34686.01 ▲26.4236.17 ▼32.27
Media Library /wp-admin/upload.php1,445 ▲454.60 ▲0.4294.28 ▼15.6644.94 ▼3.03

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
It is recommended to fix the following
  • Zombie WordPress options were found after uninstall: 6 options
    • theysaidso_admin_options
    • db_upgraded
    • can_compress_scripts
    • widget_theysaidso_widget
    • widget_recent-posts
    • 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)
Good news, no errors were detected

SRP 50% from 2 tests

🔹 Tests weight: 20 | A shallow check of the single-responsibility principle; PHP files should perform no action - including output of placeholder text - and trigger no errors when accessed directly
Please fix the following items
  • 4× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/saffire-frequently-bought-together-learndash/include/ldfbt-frequently-bought-widget.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/saffire-frequently-bought-together-learndash/include/ldfbt-setting-functions.php:131
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/saffire-frequently-bought-together-learndash/include/ldfbt-widget-metabox.php:88
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/saffire-frequently-bought-together-learndash/include/ldfbt-process-add-cart.php:105

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
No browser issues were found

Optimizations

Plugin configuration 90% from 29 tests

readme.txt Passed 16 tests

It's important to format your readme.txt file correctly as it is parsed for the public listing of your plugin
7 plugin tags: sell, bundles, cross-sells, upsells, learndash...

saffire-frequently-bought-together-learndash/saffire-frequently-bought-together-learndash.php 77% from 13 tests

The entry point to "Frequently Bought Together for LearnDash" version 1.0.6 is a PHP file that has certain tags in its header comment area
You should first fix the following items:
  • Text Domain: You no longer need to specify the text domain since WordPress 4.6; it must be the same as the plugin slug
  • Description: Please keep the plugin description shorter than 140 characters (currently 183 characters long)
  • Requires PHP: Required version must match the one declared in readme.txt ("7.2.0" instead of "7.2")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short glimpse at programming languages used with this plugin and a check that no dangerous files are present
There were no executable files found in this plugin1,170 lines of code in 14 files:
LanguageFilesBlank linesComment linesLines of code
PHP8137256811
CSS3304241
JavaScript31212118

PHP code Passed 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.65
Average class complexity14.50
▷ Minimum class complexity1.00
▷ Maximum class complexity28.00
Average method complexity5.50
▷ Minimum method complexity1.00
▷ Maximum method complexity12.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes2
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes00.00%
Methods6
▷ Static methods00.00%
▷ Public methods583.33%
▷ Protected methods116.67%
▷ Private methods00.00%
Functions33
▷ Named functions3090.91%
▷ Anonymous functions39.09%
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 were not PNG files found in your plugin