89% similar-products

Code Review | Similar Products

WordPress plugin Similar Products scored89%from 54 tests.

About plugin

  • Plugin page: similar-products
  • Plugin version: 1.0.5
  • PHP version: 7.4.16
  • WordPress compatibility: 3.5-5.6
  • WordPress version: 6.3.1
  • First release: May 28, 2016
  • Latest release: Jun 29, 2021
  • Number of updates: 20
  • Update frequency: every 93.0 days
  • Top authors: cedcommerce (100%)

Code review

54 tests

User reviews

1 review

Install metrics

80+ active /3,011 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
This plugin's installer ran successfully

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

Analyzing server-side resources used by Similar Products
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.46 ▲0.0039.45 ▼4.22
Dashboard /wp-admin3.31 ▲0.0051.50 ▼2.84
Posts /wp-admin/edit.php3.36 ▲0.0050.76 ▼3.09
Add New Post /wp-admin/post-new.php5.89 ▲0.0084.57 ▼15.31
Media Library /wp-admin/upload.php3.23 ▲0.0035.67 ▼2.54

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

How much does this plugin use your filesystem and database?
This plugin installed successfully
Filesystem: 8 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-posts
can_compress_scripts
widget_recent-comments
db_upgraded
theysaidso_admin_options
widget_theysaidso_widget

Browser metrics Passed 4 tests

Similar Products: an overview of browser usage
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,789 ▲2814.50 ▼0.121.92 ▲0.1140.83 ▼8.78
Dashboard /wp-admin2,192 ▲155.54 ▼0.1482.87 ▼6.6040.31 ▼4.66
Posts /wp-admin/edit.php2,100 ▼02.02 ▲0.0039.43 ▼2.9734.87 ▲0.96
Add New Post /wp-admin/post-new.php1,545 ▼923.32 ▲5.26667.76 ▼33.5559.06 ▼12.05
Media Library /wp-admin/upload.php1,400 ▲34.26 ▲0.07105.66 ▼22.3946.92 ▼4.49

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
It is recommended to fix the following
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • can_compress_scripts
    • widget_recent-posts
    • widget_recent-comments
    • db_upgraded

Smoke tests Passed 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 Passed 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
No output text or server-side errors detected on direct access of PHP files

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
There were no browser issues found

Optimizations

Plugin configuration 93% from 29 tests

readme.txt Passed 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
8 plugin tags: similar products, variable product, product, similar, woocommerce...

similar-products/ced-similar-products-main.php 85% from 13 tests

The main PHP script in "Similar Products" version 1.0.5 is automatically included on every request by WordPress
You should first fix the following items:
  • Text Domain: Since WordPress version 4.6 the text domain is optional; if specified, it must be the same as the plugin slug
  • Main file name: The principal plugin file should be the same as the plugin slug ("similar-products.php" instead of "ced-similar-products-main.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
Success! There were no dangerous files found in this plugin607 lines of code in 5 files:
LanguageFilesBlank linesComment linesLines of code
PHP270133490
CSS12662
PO File1131947
JavaScript1008

PHP code Passed 2 tests

This plugin's cyclomatic complexity and code structure detailed below
This plugin has no cyclomatic complexity problems
Cyclomatic complexity
Average complexity per logical line of code0.24
Average class complexity34.00
▷ Minimum class complexity34.00
▷ Maximum class complexity34.00
Average method complexity3.54
▷ Minimum method complexity1.00
▷ Maximum method complexity13.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods13
▷ Static methods00.00%
▷ Public methods13100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions4
▷ Named functions4100.00%
▷ Anonymous functions00.00%
Constants2
▷ Global constants2100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
1 PNG file occupies 0.00MB with 0.00MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
assets/images/close.png2.31KB1.49KB▼ 35.34%