78% t2a-age-verify

Code Review | Age Verify UK

WordPress plugin Age Verify UK scored78%from 54 tests.

About plugin

  • Plugin page: t2a-age-verify
  • Plugin version: 1.3.3
  • PHP compatiblity: 7.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.2-6.1
  • WordPress version: 6.3.1
  • First release: Oct 7, 2020
  • Latest release: Apr 4, 2023
  • Number of updates: 25
  • Update frequency: every 36.9 days
  • Top authors: simunix (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /786 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
This plugin's installer ran successfully

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

Server-side resources used by Age Verify UK
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.46 ▲0.0040.10 ▼8.09
Dashboard /wp-admin3.31 ▲0.0052.35 ▼0.78
Posts /wp-admin/edit.php3.36 ▲0.0049.20 ▼5.71
Add New Post /wp-admin/post-new.php5.89 ▲0.0086.32 ▼11.02
Media Library /wp-admin/upload.php3.23 ▲0.0039.84 ▲0.79

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

How much does this plugin use your filesystem and database?
The plugin installed successfully
Filesystem: 32 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-comments
theysaidso_admin_options
widget_recent-posts
widget_theysaidso_widget
can_compress_scripts
db_upgraded

Browser metrics Passed 4 tests

Checking browser requirements for Age Verify UK
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,814 ▲5314.75 ▲0.391.81 ▲0.1545.63 ▲5.64
Dashboard /wp-admin2,195 ▲275.55 ▼0.0384.39 ▼10.3143.86 ▼2.18
Posts /wp-admin/edit.php2,100 ▼01.98 ▲0.0138.57 ▲0.2737.68 ▲1.19
Add New Post /wp-admin/post-new.php1,526 ▼523.53 ▲0.69660.79 ▼4.5770.76 ▲21.93
Media Library /wp-admin/upload.php1,397 ▼64.23 ▼0.1694.90 ▼17.9543.86 ▼1.71

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
Please fix the following items
  • This plugin does not fully uninstall, leaving 6 options in the database
    • theysaidso_admin_options
    • db_upgraded
    • widget_recent-posts
    • widget_theysaidso_widget
    • widget_recent-comments
    • can_compress_scripts

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Good news, no errors were detected

SRP 0% 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
Please fix the following
  • 1× PHP files output non-empty strings when accessed directly via GET requests:
    • > /wp-content/plugins/t2a-age-verify/admin/templates/demo.php
  • 5× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/t2a-age-verify/includes/includes.php:2
    • > PHP Fatal error
      Uncaught Error: Using $this when not in object context in wp-content/plugins/t2a-age-verify/admin/templates/advanced.php:4
    • > PHP Fatal error
      Uncaught Error: Using $this when not in object context in wp-content/plugins/t2a-age-verify/admin/templates/nokey.php:49
    • > PHP Fatal error
      Uncaught Error: Using $this when not in object context in wp-content/plugins/t2a-age-verify/admin/templates/admin.php:3
    • > PHP Fatal error
      Uncaught Error: Using $this when not in object context in wp-content/plugins/t2a-age-verify/admin/templates/users.php:9

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is an important file in your plugin as it is parsed by WordPress.org to prepare the public listing of your plugin
Please fix the following attributes:
  • Plugin Name: Please specify the plugin name on the first line ( === t2a-age-verify === )
You can take inspiration from this readme.txt

t2a-age-verify/t2a-age-verify.php Passed 13 tests

This is the main PHP file of "Age Verify UK" version 1.3.3, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
136 characters long description:
Verify the age of your UK customers at point of registration, point of sale and in bulk. Age restrict your products or your entire shop.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short check of programming languages and file extensions; no executable files are allowed
Everything looks great! No dangerous files found in this plugin1,625 lines of code in 24 files:
LanguageFilesBlank linesComment linesLines of code
PHP162454621,217
JavaScript42522311
CSS3131151
SVG10146

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.37
Average class complexity12.29
▷ Minimum class complexity1.00
▷ Maximum class complexity40.00
Average method complexity2.65
▷ Minimum method complexity1.00
▷ Maximum method complexity20.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes7
▷ Abstract classes00.00%
▷ Concrete classes7100.00%
▷ Final classes00.00%
Methods48
▷ Static methods24.17%
▷ Public methods3777.08%
▷ Protected methods48.33%
▷ Private methods714.58%
Functions6
▷ Named functions6100.00%
▷ Anonymous functions00.00%
Constants2
▷ Global constants2100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
2 PNG files occupy 0.00MB with 0.00MB in potential savings
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
admin/img/avuk.png0.41KB0.33KB▼ 20.53%
admin/img/t2a.png0.35KB0.28KB▼ 21.49%