84% wc-category-locker

Code Review | WooCommerce Category Locker

WordPress plugin WooCommerce Category Locker scored84%from 54 tests.

About plugin

  • Plugin page: wc-category-locker
  • Plugin version: 1.0.3
  • PHP version: 7.4.16
  • WordPress compatibility: 3.5-4.9.1
  • WordPress version: 6.3.1
  • First release: Apr 4, 2016
  • Latest release: Dec 6, 2017
  • Number of updates: 8
  • Update frequency: every 78.6 days
  • Top authors: benchmarkstudios (100%)

Code review

54 tests

User reviews

10 reviews

Install metrics

200+ active /4,727 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
Installer ran successfully

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

A check of server-side resources used by WooCommerce Category Locker
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0134.04 ▼7.81
Dashboard /wp-admin3.31 ▲0.0141.83 ▼1.90
Posts /wp-admin/edit.php3.36 ▲0.0148.57 ▲3.88
Add New Post /wp-admin/post-new.php5.89 ▲0.0181.32 ▼14.82
Media Library /wp-admin/upload.php3.24 ▲0.0136.97 ▲2.65

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

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

Browser metrics Passed 4 tests

An overview of browser requirements for WooCommerce Category Locker
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,825 ▲9013.20 ▼1.551.75 ▲0.0738.91 ▼9.23
Dashboard /wp-admin2,203 ▲175.91 ▲0.99113.90 ▲2.3842.71 ▲1.58
Posts /wp-admin/edit.php2,092 ▲241.99 ▼0.1640.38 ▲3.6234.43 ▼0.12
Add New Post /wp-admin/post-new.php1,535 ▲1623.23 ▲0.12603.94 ▼19.6650.30 ▼8.15
Media Library /wp-admin/upload.php1,388 ▲34.20 ▲0.07102.76 ▲3.1641.80 ▼3.14

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
  • The uninstall procedure has failed, leaving 6 options in the database
    • widget_theysaidso_widget
    • can_compress_scripts
    • db_upgraded
    • theysaidso_admin_options
    • 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)
Everything seems fine, however this is by no means an exhaustive test

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
  • 3× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/wc-category-locker/wc-category-locker.php:13
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/wc-category-locker/frontend.php:12
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/wc-category-locker/admin.php:12

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
No browser errors were detected

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

You should put a lot of thought into formatting readme.txt as it is used by WordPress.org to prepare the public listing of your plugin
6 plugin tags: woocommerce category, category lock, lock, woocommerce, taxonomy lock...

wc-category-locker/plugin.php 92% from 13 tests

The main file in "WooCommerce Category Locker" v. 1.0.3 serves as a complement to information provided in readme.txt and as the entry point to the plugin
Please make the necessary changes and fix the following:
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("wc-category-locker.php" instead of "plugin.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | An overview of files in this plugin; executable files are not allowed
No dangerous file extensions were detected421 lines of code in 8 files:
LanguageFilesBlank linesComment linesLines of code
PHP883270421

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
No cyclomatic complexity issues were detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.39
Average class complexity12.00
▷ Minimum class complexity7.00
▷ Maximum class complexity24.00
Average method complexity3.44
▷ Minimum method complexity1.00
▷ Maximum method complexity10.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes4
▷ Abstract classes00.00%
▷ Concrete classes4100.00%
▷ Final classes00.00%
Methods18
▷ Static methods316.67%
▷ Public methods1583.33%
▷ Protected methods316.67%
▷ Private methods00.00%
Functions4
▷ Named functions4100.00%
▷ Anonymous functions00.00%
Constants6
▷ Global constants6100.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
PNG images were not found in this plugin