84% category-limit-for-woocommerce

Code Review | Category Limit for WooCommerce

WordPress plugin Category Limit for WooCommerce scored84%from 54 tests.

About plugin

  • Plugin page: category-limit-fo...
  • Plugin version: 1.0
  • PHP compatiblity: 5.3+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.7-5.4
  • WordPress version: 6.3.1
  • First release: Apr 30, 2020
  • Latest release: Apr 30, 2020
  • Number of updates: 4
  • Update frequency: every 0.3 days
  • Top authors: web2webs (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /547 total downloads


Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.01MB] [CPU: ▼6.42ms] Passed 4 tests

A check of server-side resources used by Category Limit for WooCommerce
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0139.80 ▼2.80
Dashboard /wp-admin3.32 ▲0.0146.70 ▼2.12
Posts /wp-admin/edit.php3.37 ▲0.0149.91 ▼5.24
Add New Post /wp-admin/post-new.php5.90 ▲0.0184.70 ▼15.51
Media Library /wp-admin/upload.php3.24 ▲0.0142.62 ▲5.26

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

Input-output and database impact of this plugin
No storage issues were detected
Filesystem: 7 new files
Database: no new tables, 6 new options
New WordPress options

Browser metrics Passed 4 tests

Category Limit for WooCommerce: an overview of browser usage
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,815 ▲5413.63 ▼0.932.24 ▲0.2443.99 ▲1.45
Dashboard /wp-admin2,221 ▲154.86 ▼1.04108.12 ▲4.5242.81 ▲0.82
Posts /wp-admin/edit.php2,100 ▼02.04 ▲0.0341.00 ▲4.2336.55 ▲1.51
Add New Post /wp-admin/post-new.php1,531 ▼1423.41 ▲0.08699.25 ▲48.9669.50 ▲12.07
Media Library /wp-admin/upload.php1,400 ▼04.26 ▲0.04109.68 ▲8.5147.17 ▲3.57

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
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • db_upgraded
    • can_compress_scripts
    • widget_recent-comments
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • widget_recent-posts

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
The smoke test was a success, however most plugin functionality was not tested

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 take a closer look at the following
  • 1× PHP files output text when accessed directly:
    • > /wp-content/plugins/category-limit-for-woocommerce/inc/calss-settings.php

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
Everything seems fine on the user side


Plugin configuration 93% from 29 tests

readme.txt Passed 16 tests

The readme.txt file describes your plugin functionality and requirements and it is parsed to prepare the your plugin's listing
5 plugin tags: cart maximum, category, cart max, limit cart, woocommerce cart

category-limit-for-woocommerce/plugin.php 85% from 13 tests

The main PHP script in "Category Limit for WooCommerce" version 1.0 is automatically included on every request by WordPress
Please make the necessary changes and fix the following:
  • Main file name: The principal plugin file should be the same as the plugin slug ("category-limit-for-woocommerce.php" instead of "plugin.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 Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are not allowed as they can serve as attack vectors
Success! There were no dangerous files found in this plugin176 lines of code in 3 files:
LanguageFilesBlank linesComment linesLines of code
PO File1141444

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.38
Average class complexity9.00
▷ Minimum class complexity8.00
▷ Maximum class complexity10.00
Average method complexity2.78
▷ Minimum method complexity1.00
▷ Maximum method complexity10.00
Code structure
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes00.00%
▷ Static methods00.00%
▷ Public methods9100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
▷ Named functions1100.00%
▷ Anonymous functions00.00%
▷ 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
No PNG images were found in this plugin