83% age-verification-for-woocommerce

Code Review | Age Verification System for WooCommerce

WordPress plugin Age Verification System for WooCommerce scored83%from 54 tests.

About plugin

  • Plugin page: age-verification-...
  • Plugin version: 1.4.2
  • PHP compatiblity: 7.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.7-6.1
  • WordPress version: 6.3.1
  • First release: Oct 4, 2019
  • Latest release: Oct 16, 2023
  • Number of updates: 13
  • Update frequency: every 113.5 days
  • Top authors: aweos (100%)

Code review

54 tests

User reviews

4 reviews

Install metrics

400+ active /4,655 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
Installer ran successfully

Server metrics [RAM: ▲0.00MB] [CPU: ▼5.12ms] Passed 4 tests

An overview of server-side resources used by Age Verification System for WooCommerce
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0037.86 ▼3.58
Dashboard /wp-admin3.31 ▲0.0044.31 ▼3.90
Posts /wp-admin/edit.php3.36 ▲0.0042.70 ▼3.20
Add New Post /wp-admin/post-new.php5.89 ▲0.0083.87 ▼9.78
Media Library /wp-admin/upload.php3.23 ▲0.0032.21 ▼2.63

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

How much does this plugin use your filesystem and database?
No storage issues were detected
Filesystem: 517 new files
Database: no new tables, 6 new options
New WordPress options
widget_theysaidso_widget
can_compress_scripts
widget_recent-posts
db_upgraded
theysaidso_admin_options
widget_recent-comments

Browser metrics Passed 4 tests

Age Verification System for WooCommerce: an overview of browser usage
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,789 ▲2814.35 ▼0.001.73 ▲0.1742.23 ▲0.44
Dashboard /wp-admin2,198 ▲215.62 ▼0.0382.01 ▼5.0536.95 ▼6.45
Posts /wp-admin/edit.php2,100 ▼02.02 ▲0.0032.71 ▼1.9734.86 ▼1.68
Add New Post /wp-admin/post-new.php1,526 ▼023.32 ▼0.22672.67 ▼2.3354.45 ▼2.96
Media Library /wp-admin/upload.php1,394 ▼64.19 ▲0.0895.02 ▼19.5340.40 ▼8.60

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
The following items require your attention
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • widget_theysaidso_widget
    • db_upgraded
    • widget_recent-comments
    • theysaidso_admin_options
    • can_compress_scripts
    • widget_recent-posts

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
Even though everything seems fine, this is not an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | SRP (Single-Responsibility Principle) - PHP files must act as libraries and never output text or perform any action when accessed directly in a browser
Almost there! Just fix the following items
  • 138× PHP files trigger server errors when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Interface 'Twig_LoaderInterface' not found in wp-content/plugins/age-verification-for-woocommerce/core/includes/lib/vendor/twig/twig/lib/Twig/Loader/Chain.php:17
    • > PHP Fatal error
      Uncaught Error: Class 'Twig_Node' not found in wp-content/plugins/age-verification-for-woocommerce/core/includes/lib/vendor/twig/twig/lib/Twig/Node/Body.php:17
    • > PHP Fatal error
      Uncaught Error: Class 'Twig_Node_Expression' not found in wp-content/plugins/age-verification-for-woocommerce/core/includes/lib/vendor/twig/twig/lib/Twig/Node/Expression/Conditional.php:12
    • > PHP Fatal error
      Uncaught Error: Class 'Twig_Node_Expression' not found in wp-content/plugins/age-verification-for-woocommerce/core/includes/lib/vendor/twig/twig/lib/Twig/Node/Expression/GetAttr.php:12
    • > PHP Fatal error
      Uncaught Error: Class 'Twig_Node_Expression_Call' not found in wp-content/plugins/age-verification-for-woocommerce/core/includes/lib/vendor/twig/twig/lib/Twig/Node/Expression/Test.php:11
    • > PHP Fatal error
      Uncaught Error: Class 'Twig_Sandbox_SecurityError' not found in wp-content/plugins/age-verification-for-woocommerce/core/includes/lib/vendor/twig/twig/lib/Twig/Sandbox/SecurityNotAllowedPropertyError.php:17
    • > PHP Fatal error
      Uncaught Error: Class 'Twig_Node_Expression_Binary' not found in wp-content/plugins/age-verification-for-woocommerce/core/includes/lib/vendor/twig/twig/lib/Twig/Node/Expression/Binary/Greater.php:11
    • > PHP Fatal error
      Uncaught Error: Class 'Twig_Extension' not found in wp-content/plugins/age-verification-for-woocommerce/core/includes/lib/vendor/twig/twig/lib/Twig/Extension/Debug.php:12
    • > PHP Fatal error
      Uncaught Error: Class 'Twig_Node_Expression_Unary' not found in wp-content/plugins/age-verification-for-woocommerce/core/includes/lib/vendor/twig/twig/lib/Twig/Node/Expression/Unary/Neg.php:12
    • > PHP Fatal error
      Uncaught Error: Class 'Twig_Node' not found in wp-content/plugins/age-verification-for-woocommerce/core/includes/lib/vendor/twig/twig/lib/Twig/Node/Block.php:18

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)
No browser issues were found

Optimizations

Plugin configuration 86% from 29 tests

readme.txt 94% from 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
Attributes that require attention: Please take inspiration from this readme.txt

age-verification-for-woocommerce/age-verification-system-for-woocommerce.php 77% from 13 tests

"Age Verification System for WooCommerce" version 1.4.2's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
It is important to fix the following:
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("age-verification-for-woocommerce.php" instead of "age-verification-system-for-woocommerce.php")
  • Text Domain: The text domain must be the same as the plugin slug, although optional since WordPress version 4.6
  • Description: Please don't use more than 140 characters for the plugin description (currently 454 characters long)

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of programming languages used in this plugin; dangerous file extensions are not allowed
No dangerous file extensions were detected19,750 lines of code in 485 files:
LanguageFilesBlank linesComment linesLines of code
PHP3703,0484,62914,767
reStructuredText891,9771,8072,627
PO File3234234871
CSS510733616
JavaScript66926346
JSON500322
Twig4252155
XML14029
Markdown28017

PHP code Passed 2 tests

This plugin's cyclomatic complexity and code structure detailed below
This plugin has no cyclomatic complexity problems
Cyclomatic complexity
Average complexity per logical line of code0.44
Average class complexity4.65
▷ Minimum class complexity1.00
▷ Maximum class complexity142.00
Average method complexity2.57
▷ Minimum method complexity1.00
▷ Maximum method complexity28.00
Code structure
Namespaces24
Interfaces27
Traits0
Classes331
▷ Abstract classes113.32%
▷ Concrete classes32096.68%
▷ Final classes4815.00%
Methods847
▷ Static methods596.97%
▷ Public methods72285.24%
▷ Protected methods586.85%
▷ Private methods677.91%
Functions100
▷ Named functions9191.00%
▷ Anonymous functions99.00%
Constants51
▷ Global constants35.88%
▷ Class constants4894.12%
▷ Public constants48100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
8 PNG files occupy 0.40MB with 0.26MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/img/simple-day.png51.87KB14.63KB▼ 71.79%
assets/img/lock.png8.29KB4.37KB▼ 47.29%
assets/img/birthday-dark.png81.89KB26.19KB▼ 68.02%
assets/img/simple-green.png51.41KB13.41KB▼ 73.92%
assets/img/back.png5.41KB1.90KB▼ 64.92%