84% void-woo-cart-restrictor

Code Review | Void Woo Cart Restrictor

WordPress plugin Void Woo Cart Restrictor scored 84% from 54 tests.

About plugin

  • Plugin page: void-woo-cart-res...
  • Plugin version: 1.0.0
  • PHP version: 7.4.16
  • WordPress compatibility: 4.4-5.5.3
  • WordPress version: 6.3.1
  • First release: Apr 17, 2019
  • Latest release: Nov 24, 2020
  • Number of updates: 8
  • Update frequency: every 73.4 days
  • Top authors: voidcoders (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active / 639 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
Install script ran successfully

Server metrics [RAM: ▲0.03MB] [CPU: ▲2.05ms] Passed 4 tests

A check of server-side resources used by Void Woo Cart Restrictor
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.49 ▲0.0340.69 ▲5.02
Dashboard /wp-admin3.33 ▲0.0345.48 ▲1.19
Posts /wp-admin/edit.php3.38 ▲0.0347.27 ▲0.08
Add New Post /wp-admin/post-new.php5.93 ▲0.0592.74 ▲9.66
Media Library /wp-admin/upload.php3.25 ▲0.0337.06 ▲1.89
Void Woo Cart Restrictor /wp-admin/options-general.php?page=void-woo-cart-restrictor3.2531.55

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

Input-output and database impact of this plugin
This plugin installed successfully
Filesystem: 22 new files
Database: no new tables, 6 new options
New WordPress options
db_upgraded
widget_theysaidso_widget
can_compress_scripts
theysaidso_admin_options
widget_recent-posts
widget_recent-comments

Browser metrics Passed 4 tests

Void Woo Cart Restrictor: an overview of browser usage
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,916 ▲12713.99 ▲0.655.57 ▲3.9441.13 ▲0.97
Dashboard /wp-admin2,214 ▲144.87 ▼0.90108.07 ▲5.6940.02 ▼1.93
Posts /wp-admin/edit.php2,097 ▲112.02 ▼0.0240.01 ▲4.6934.71 ▲3.28
Add New Post /wp-admin/post-new.php1,530 ▼418.14 ▼4.89673.37 ▼35.2450.89 ▼1.57
Media Library /wp-admin/upload.php1,399 ▲114.21 ▼0.03101.92 ▼5.2543.20 ▼4.80
Void Woo Cart Restrictor /wp-admin/options-general.php?page=void-woo-cart-restrictor8172.0224.8024.69

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
The following items require your attention
  • Zombie WordPress options detected upon uninstall: 6 options
    • widget_recent-comments
    • widget_recent-posts
    • widget_theysaidso_widget
    • can_compress_scripts
    • theysaidso_admin_options
    • db_upgraded

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
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 fix the following
  • 2× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html__() in wp-content/plugins/void-woo-cart-restrictor/public/partials/void-woo-cart-restrictor-public-display.php:18
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Roles' not found in wp-content/plugins/void-woo-cart-restrictor/admin/partials/void-woo-cart-restrictor-admin-display.php:19

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

Don't ignore readme.txt as it is the file that instructs WordPress.org on how to present your plugin to the world
7 plugin tags: category, product, visbility, restrict, user role...

void-woo-cart-restrictor/void-woo-cart-restrictor.php 92% from 13 tests

"Void Woo Cart Restrictor" version 1.0.0's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
The following require your attention:
  • Description: Keep the plugin description shorter than 140 characters (currently 208 characters long)

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short review of files and their extensions; it is not recommended to include executable files
There were no executable files found in this plugin363 lines of code in 17 files:
LanguageFilesBlank linesComment linesLines of code
PHP13144609323
JavaScript29230
CSS21810

PHP code Passed 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.19
Average class complexity4.00
▷ Minimum class complexity1.00
▷ Maximum class complexity12.00
Average method complexity1.64
▷ Minimum method complexity1.00
▷ Maximum method complexity8.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes7
▷ Abstract classes00.00%
▷ Concrete classes7100.00%
▷ Final classes00.00%
Methods33
▷ Static methods26.06%
▷ Public methods2781.82%
▷ Protected methods13.03%
▷ Private methods515.15%
Functions3
▷ Named functions3100.00%
▷ Anonymous functions00.00%
Constants1
▷ Global constants1100.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
No PNG images were found in this plugin