84% woo-for-logged-users

Code Review | WooCommerce for Logged-in Users

WordPress plugin WooCommerce for Logged-in Users scored84%from 54 tests.

About plugin

  • Plugin page: woo-for-logged-users
  • Plugin version: 1.3.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-6.3
  • WordPress version: 6.3.1
  • First release: Jun 16, 2017
  • Latest release: Aug 7, 2023
  • Number of updates: 22
  • Update frequency: every 102.0 days
  • Top authors: Rahmohn (100%)

Code review

54 tests

User reviews

8 reviews

Install metrics

2,000+ active /18,440 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
The plugin installed successfully, without throwing any errors or notices

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

A check of server-side resources used by WooCommerce for Logged-in Users
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0140.01 ▼2.81
Dashboard /wp-admin3.31 ▲0.0148.85 ▲3.37
Posts /wp-admin/edit.php3.36 ▲0.0143.17 ▼0.64
Add New Post /wp-admin/post-new.php5.90 ▲0.0184.03 ▼18.92
Media Library /wp-admin/upload.php3.24 ▲0.0134.29 ▼0.56
WooCommerce for logged-in users /wp-admin/admin.php?page=woocommerce_for_logged_users3.2031.94

Server storage [IO: ▲3.35MB] [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: 30 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-posts
can_compress_scripts
widget_theysaidso_widget
db_upgraded
widget_recent-comments
theysaidso_admin_options

Browser metrics Passed 4 tests

This is an overview of browser requirements for WooCommerce for Logged-in Users
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,800 ▲5413.27 ▼1.101.65 ▼0.0240.73 ▼5.64
Dashboard /wp-admin2,203 ▲185.79 ▲0.7697.86 ▼8.1037.93 ▼3.96
Posts /wp-admin/edit.php2,089 ▼02.02 ▲0.0334.04 ▼2.6635.22 ▲4.95
Add New Post /wp-admin/post-new.php1,514 ▼517.41 ▼5.83671.01 ▼11.0055.99 ▲1.16
Media Library /wp-admin/upload.php1,388 ▼04.27 ▲0.0393.49 ▼13.9040.98 ▼6.80
WooCommerce for logged-in users /wp-admin/admin.php?page=woocommerce_for_logged_users7462.0222.2820.06

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
Please fix the following items
  • This plugin does not fully uninstall, leaving 6 options in the database
    • widget_recent-comments
    • can_compress_scripts
    • theysaidso_admin_options
    • widget_recent-posts
    • widget_theysaidso_widget
    • db_upgraded

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Everything seems fine, however this is by no means an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | It is important to ensure that your PHP files perform no action when accessed directly, respecting the single-responsibility principle
Please fix the following
  • 1× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/woo-for-logged-users/admin.php:50

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

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 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
Attributes that require attention:
  • Plugin Name: Write the name of your plugin instead of "Plugin Name" on the first line ( === woo-for-logged-users === )
You can take inspiration from this readme.txt

woo-for-logged-users/woo-for-logged-users.php 92% from 13 tests

The main PHP file in "WooCommerce for Logged-in Users" ver. 1.3.0 adds more information about the plugin and also serves as the entry point for this plugin
You should first fix the following items:
  • Text Domain: If you choose to specify the text domain, it must be the same as the plugin slug; optional since WordPress version 4.6

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
Success! There were no dangerous files found in this plugin22,996 lines of code in 22 files:
LanguageFilesBlank linesComment linesLines of code
JSON40022,312
JavaScript136712490
PHP55798194

PHP code Passed 2 tests

An overview of cyclomatic complexity and code structure
There are no cyclomatic complexity problems detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.37
Average class complexity0.00
▷ Minimum class complexity0.00
▷ Maximum class complexity0.00
Average method complexity0.00
▷ Minimum method complexity0.00
▷ Maximum method complexity0.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes0
▷ Abstract classes00.00%
▷ Concrete classes00.00%
▷ Final classes00.00%
Methods0
▷ Static methods00.00%
▷ Public methods00.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions11
▷ Named functions1090.91%
▷ Anonymous functions19.09%
Constants0
▷ Global constants00.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