84% woo-simply-add-related-products-to-blog-posts

Code Review | WooCommerce Simple Add Related Products to Blog Posts

WordPress plugin WooCommerce Simple Add Related Products to Blog Posts scored84%from 54 tests.

About plugin

  • Plugin page: woo-simply-add-re...
  • Plugin version: 3.2
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-5.2.3
  • WordPress version: 6.3.1
  • First release: Aug 10, 2015
  • Latest release: Oct 10, 2019
  • Number of updates: 24
  • Update frequency: every 63.4 days
  • Top authors: mshirk (100%)

Code review

54 tests

User reviews

5 reviews

Install metrics

100+ active /7,415 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
Install script ran successfully

Server metrics [RAM: ▲0.06MB] [CPU: ▼0.98ms] Passed 4 tests

Analyzing server-side resources used by WooCommerce Simple Add Related Products to Blog Posts
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.57 ▲0.0643.66 ▼1.86
Dashboard /wp-admin3.41 ▲0.0651.12 ▼3.20
Posts /wp-admin/edit.php3.52 ▲0.1352.31 ▲2.56
Add New Post /wp-admin/post-new.php5.99 ▲0.07109.90 ▲11.20
Media Library /wp-admin/upload.php3.33 ▲0.0638.63 ▼1.42
Related Products on Posts /wp-admin/options-general.php?page=select-parent-category3.3140.45

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

A short overview of filesystem and database impact
This plugin was installed successfully
Filesystem: 9 new files
Database: 1 new table, 6 new options
New tables
wp_wooRelatedProducts
New WordPress options
widget_theysaidso_widget
db_upgraded
theysaidso_admin_options
can_compress_scripts
widget_recent-posts
widget_recent-comments

Browser metrics Passed 4 tests

Checking browser requirements for WooCommerce Simple Add Related Products to Blog Posts
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,871 ▲11014.23 ▼0.421.94 ▲0.2140.71 ▼2.48
Dashboard /wp-admin2,229 ▲495.55 ▼0.1084.07 ▼8.3743.75 ▼5.11
Posts /wp-admin/edit.php2,134 ▲342.10 ▲0.1034.01 ▼3.4744.20 ▲4.07
Add New Post /wp-admin/post-new.php1,603 ▲7724.10 ▲0.92605.78 ▼86.1272.14 ▲16.15
Media Library /wp-admin/upload.php1,434 ▲344.22 ▲0.0198.12 ▼9.7344.55 ▼5.13
Related Products on Posts /wp-admin/options-general.php?page=select-parent-category8801.9924.8139.78

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

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

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 | The single-responsibility principle applies for WordPress plugins as well - please make sure your PHP files perform no actions when accessed directly
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 add_action() in wp-content/plugins/woo-simply-add-related-products-to-blog-posts/woo-related-products-on-posts.php:15

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
There were no browser issues found

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

Don't ignore readme.txt as it is the file that instructs WordPress.org on how to present your plugin to the world
3 plugin tags: woocommerce, related products, blog posts

woo-simply-add-related-products-to-blog-posts/woo-related-products-on-posts.php 92% from 13 tests

The main file in "WooCommerce Simple Add Related Products to Blog Posts" v. 3.2 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:
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("woo-simply-add-related-products-to-blog-posts.php" instead of "woo-related-products-on-posts.php")

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
No dangerous file extensions were detected534 lines of code in 3 files:
LanguageFilesBlank linesComment linesLines of code
PHP19652413
CSS2103121

PHP code Passed 2 tests

An overview of cyclomatic complexity and code structure
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.19
Average class complexity0.00
▷ Minimum class complexity0.00
▷ Maximum class complexity0.00
Average method complexity0.00
▷ Minimum method complexity0.00
▷ Maximum method complexity0.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes0
▷ Abstract classes00.00%
▷ Concrete classes00.00%
▷ Final classes00.00%
Methods0
▷ Static methods00.00%
▷ Public methods00.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions15
▷ Named functions15100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
5 PNG files occupy 0.43MB with 0.29MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/screenshot-5.png139.77KB56.42KB▼ 59.63%
assets/screenshot-1.png60.21KB19.54KB▼ 67.55%
assets/screenshot-2.png63.82KB18.09KB▼ 71.65%
assets/screenshot-4.png107.36KB32.72KB▼ 69.52%
assets/screenshot-3.png67.08KB18.58KB▼ 72.29%