83% password-protected-woo-store

Code Review | Password Protected Store for WooCommerce

WordPress plugin Password Protected Store for WooCommerce scored83%from 54 tests.

About plugin

  • Plugin page: password-protecte...
  • Plugin version: 1.7
  • PHP compatiblity: 5.2.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-6.4.1
  • WordPress version: 6.3.1
  • First release: Apr 1, 2022
  • Latest release: Nov 24, 2023
  • Number of updates: 15
  • Update frequency: every 40.3 days
  • Top authors: rajkakadiya (100%)

Code review

54 tests

User reviews

4 reviews

Install metrics

3,000+ active /10,320 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.07MB] [CPU: ▲1.24ms] Passed 4 tests

A check of server-side resources used by Password Protected Store for WooCommerce
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.50 ▲0.0441.89 ▲0.53
Dashboard /wp-admin3.46 ▲0.1651.87 ▲0.04
Posts /wp-admin/edit.php3.49 ▲0.1355.58 ▲10.75
Add New Post /wp-admin/post-new.php5.95 ▲0.0690.74 ▲1.68
Media Library /wp-admin/upload.php3.28 ▲0.0633.58 ▲2.71
Password Protected /wp-admin/admin.php?page=ppws-option-page3.2837.04

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

A short overview of filesystem and database impact
This plugin was installed successfully
Filesystem: 14 new files
Database: no new tables, 11 new options
New WordPress options
widget_theysaidso_widget
ppws_form_desgin_settings
ppws_product_categories_settings
can_compress_scripts
widget_recent-posts
widget_recent-comments
db_upgraded
ppws_form_content_option
theysaidso_admin_options
ppws_page_settings
...

Browser metrics Passed 4 tests

Checking browser requirements for Password Protected Store for WooCommerce
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,054 ▲29216.34 ▲1.941.75 ▲0.0739.90 ▼4.02
Dashboard /wp-admin2,462 ▲2857.24 ▲1.73141.96 ▲46.1541.91 ▼4.85
Posts /wp-admin/edit.php2,540 ▲4405.03 ▲3.0188.17 ▲49.1637.36 ▲0.46
Add New Post /wp-admin/post-new.php1,537 ▲1123.07 ▲0.16621.40 ▲21.8835.33 ▼17.62
Media Library /wp-admin/upload.php1,674 ▲2715.24 ▲1.07107.82 ▲11.0341.89 ▲0.48
Password Protected /wp-admin/admin.php?page=ppws-option-page1,4884.8075.5040.95

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
You still need to fix the following
  • This plugin does not fully uninstall, leaving 11 options in the database
    • ppws_product_categories_settings
    • can_compress_scripts
    • ppws_page_settings
    • ppws_form_content_option
    • theysaidso_admin_options
    • widget_recent-comments
    • widget_recent-posts
    • ppws_general_settings
    • db_upgraded
    • widget_theysaidso_widget
    • ...

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 | The single-responsibility principle: PHP files have to remain inert when accessed directly, throwing no errors and performing no actions
The following issues need your attention
  • 22× PHP files trigger server errors when accessed directly (only 10 are shown):
    • > PHP Warning
      Use of undefined constant WPPS_PLUGIN_DIR_PATH - assumed 'WPPS_PLUGIN_DIR_PATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/password-protected-woo-store/admin/options.php on line 6
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/password-protected-woo-store/admin/setting/product-categories-setting.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/password-protected-woo-store/admin/setting/general-setting.php:4
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/password-protected-woo-store/front/class-ppws-protected-form.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/password-protected-woo-store/admin/setting/form-desgin.php:3
    • > PHP Warning
      include(WPPS_PLUGIN_DIR_PATHadmin/setting/form-content.php): failed to open stream: No such file or directory in wp-content/plugins/password-protected-woo-store/admin/options.php on line 5
    • > PHP Warning
      include(WPPS_PLUGIN_DIR_PATHadmin/setting/form-desgin.php): failed to open stream: No such file or directory in wp-content/plugins/password-protected-woo-store/admin/options.php on line 6
    • > PHP Warning
      include(): Failed opening 'WPPS_PLUGIN_DIR_PATHadmin/setting/form-content.php' for inclusion (include_path='.:/usr/share/php') in wp-content/plugins/password-protected-woo-store/admin/options.php on line 5
    • > PHP Warning
      include(): Failed opening 'WPPS_PLUGIN_DIR_PATHadmin/setting/form-desgin.php' for inclusion (include_path='.:/usr/share/php') in wp-content/plugins/password-protected-woo-store/admin/options.php on line 6
    • > PHP Warning
      Use of undefined constant WPPS_PLUGIN_DIR_PATH - assumed 'WPPS_PLUGIN_DIR_PATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/password-protected-woo-store/admin/options.php on line 5

User-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
There were no browser issues found

Optimizations

Plugin configuration 90% from 29 tests

readme.txt Passed 16 tests

Perhaps the most important file in your plugin readme.txt gets parsed in order to generate the public listing of your plugin
4 plugin tags: woocommerce protected categories, woocommerce store protected, woo protect, product protected

password-protected-woo-store/password-protected-store-for-woocommerce.php 77% from 13 tests

This is the main PHP file of "Password Protected Store for WooCommerce" version 1.7, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
Please make the necessary changes and fix the following:
  • Text Domain: You no longer need to specify the text domain since WordPress 4.6; it must be the same as the plugin slug
  • Main file name: Name the main plugin file the same as the plugin slug ("password-protected-woo-store.php" instead of "password-protected-store-for-woocommerce.php")
  • Description: Keep the plugin description shorter than 140 characters (currently 233 characters long)

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is a short overview of programming languages used in this plugin, detecting executable files
There were no executable files found in this plugin2,894 lines of code in 13 files:
LanguageFilesBlank linesComment linesLines of code
PHP104141402,258
CSS2604403
JavaScript14116233

PHP code Passed 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.62
Average class complexity41.50
▷ Minimum class complexity12.00
▷ Maximum class complexity106.00
Average method complexity6.28
▷ Minimum method complexity1.00
▷ Maximum method complexity59.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes6
▷ Abstract classes00.00%
▷ Concrete classes6100.00%
▷ Final classes00.00%
Methods46
▷ Static methods00.00%
▷ Public methods46100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions23
▷ Named functions2295.65%
▷ Anonymous functions14.35%
Constants6
▷ Global constants6100.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
There were not PNG files found in your plugin