90% related-categories-for-woocommerce

Code Review | Related Categories for WooCommerce

WordPress plugin Related Categories for WooCommerce scored90%from 54 tests.

About plugin

  • Plugin page: related-categorie...
  • Plugin version: 1.9.6
  • PHP version: 7.4.16
  • WordPress compatibility: 4.7-6.3
  • WordPress version: 6.3.1
  • First release: Dec 18, 2020
  • Latest release: Sep 26, 2023
  • Number of updates: 21
  • Update frequency: every 48.2 days
  • Top authors: algoritmika (80.95%)wpcodefactory (23.81%)

Code review

54 tests

User reviews

3 reviews

Install metrics

100+ active /1,907 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.02MB] [CPU: ▼3.83ms] Passed 4 tests

Server-side resources used by Related Categories for WooCommerce
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.48 ▲0.0243.66 ▲0.02
Dashboard /wp-admin3.32 ▲0.0250.39 ▼5.57
Posts /wp-admin/edit.php3.37 ▲0.0252.59 ▼2.88
Add New Post /wp-admin/post-new.php5.90 ▲0.0297.78 ▼6.88
Media Library /wp-admin/upload.php3.24 ▲0.0242.23 ▲6.39

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

How much does this plugin use your filesystem and database?
There were no storage issued detected upon installing this plugin
Filesystem: 13 new files
Database: no new tables, 6 new options
New WordPress options
can_compress_scripts
db_upgraded
widget_recent-comments
theysaidso_admin_options
widget_theysaidso_widget
widget_recent-posts

Browser metrics Passed 4 tests

Related Categories for WooCommerce: an overview of browser usage
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,789 ▲314.19 ▼0.451.68 ▼0.5439.97 ▼2.17
Dashboard /wp-admin2,192 ▲155.52 ▼0.0686.65 ▼10.4939.42 ▼3.52
Posts /wp-admin/edit.php2,100 ▲32.02 ▲0.0139.04 ▲0.4535.49 ▼0.39
Add New Post /wp-admin/post-new.php1,528 ▼023.36 ▲0.16636.75 ▼32.4757.23 ▲5.60
Media Library /wp-admin/upload.php1,394 ▼64.19 ▲0.1296.76 ▼11.3743.31 ▼4.06

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
You still need to fix the following
  • Zombie WordPress options detected upon uninstall: 6 options
    • can_compress_scripts
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • widget_recent-posts
    • db_upgraded
    • widget_recent-comments

Smoke tests Passed 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Good news, no errors were detected

SRP Passed 2 tests

🔹 Tests weight: 20 | The single-responsibility principle: PHP files have to remain inert when accessed directly, throwing no errors and performing no actions
The SRP test was a success

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 97% 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
Please fix the following attributes:
  • Screenshots: Screenshot #1 (Related Categories for WooCommerce - Frontend.) image required
Please take inspiration from this readme.txt

related-categories-for-woocommerce/related-categories-for-woocommerce.php Passed 13 tests

Analyzing the main PHP file in "Related Categories for WooCommerce" version 1.9.6
84 characters long description:
Add "Related categories" section to single product and/or shop pages in WooCommerce.

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
There were no executable files found in this plugin1,699 lines of code in 10 files:
LanguageFilesBlank linesComment linesLines of code
PHP101497321,699

PHP code Passed 2 tests

A short review 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.61
Average class complexity17.18
▷ Minimum class complexity1.00
▷ Maximum class complexity75.00
Average method complexity3.47
▷ Minimum method complexity1.00
▷ Maximum method complexity16.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes11
▷ Abstract classes00.00%
▷ Concrete classes11100.00%
▷ Final classes19.09%
Methods72
▷ Static methods11.39%
▷ Public methods72100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions2
▷ Named functions2100.00%
▷ Anonymous functions00.00%
Constants2
▷ Global constants2100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
No PNG images were found in this plugin