72% age-gate

Code Review | Age Gate

WordPress plugin Age Gate scored72%from 54 tests.

About plugin

  • Plugin page: age-gate
  • Plugin version: 3.3.1
  • PHP compatiblity: 7.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 6.0.0-6.4.1
  • WordPress version: 6.3.1
  • First release: Apr 20, 2017
  • Latest release: Nov 20, 2023
  • Number of updates: 209
  • Update frequency: every 11.5 days
  • Top authors: philsbury (100%)

Code review

54 tests

User reviews

58 reviews

Install metrics

40,000+ active /949,061 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
Install script ran successfully

Server metrics [RAM: ▲2.45MB] [CPU: ▲20.17ms] Passed 4 tests

An overview of server-side resources used by Age Gate
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /6.40 ▲2.9367.21 ▲25.16
Dashboard /wp-admin5.60 ▲2.2963.02 ▲13.13
Posts /wp-admin/edit.php6.03 ▲2.6772.96 ▲25.67
Add New Post /wp-admin/post-new.php8.52 ▲2.63109.15 ▲29.17
Media Library /wp-admin/upload.php5.45 ▲2.2249.69 ▲16.73
Content /wp-admin/admin.php?page=age-gate-content5.6658.00
Troubleshooting /wp-admin/admin.php?page=age-gate-troubleshooting5.5953.33
Advanced /wp-admin/admin.php?page=age-gate-advanced5.6253.74
Restrictions /wp-admin/admin.php?page=age-gate5.6754.53
Appearance /wp-admin/admin.php?page=age-gate-appearance5.6651.02
Messages /wp-admin/admin.php?page=age-gate-message5.6454.04
Tools /wp-admin/admin.php?page=age-gate-tools5.6351.62
Access /wp-admin/admin.php?page=age-gate-access5.6255.71

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

Analyzing filesystem and database footprints of this plugin
No storage issues were detected
Filesystem: 936 new files
Database: no new tables, 13 new options
New WordPress options
age_gate_tools
age_gate_appearance
age_gate_content
age_gate_advanced
age_gate_version
theysaidso_admin_options
widget_recent-comments
widget_theysaidso_widget
age_gate_messages
db_upgraded
...

Browser metrics Passed 4 tests

Checking browser requirements for Age Gate
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,073 ▲32614.19 ▼0.1837.48 ▲35.7938.98 ▼5.21
Dashboard /wp-admin2,250 ▲725.64 ▼0.0798.32 ▼13.4242.44 ▼1.06
Posts /wp-admin/edit.php2,382 ▲2793.55 ▲1.60101.55 ▲58.2540.29 ▲3.45
Add New Post /wp-admin/post-new.php6,282 ▲4,75626.04 ▲2.55843.78 ▲243.1535.32 ▼19.99
Media Library /wp-admin/upload.php1,457 ▲544.19 ▼0.0381.33 ▼17.0942.40 ▼0.44
Content /wp-admin/admin.php?page=age-gate-content1,8044.1178.3634.60
Troubleshooting /wp-admin/admin.php?page=age-gate-troubleshooting1,3833.9269.0938.19
Advanced /wp-admin/admin.php?page=age-gate-advanced1,9253.7058.9237.80
Restrictions /wp-admin/admin.php?page=age-gate1,8113.8156.8329.56
Appearance /wp-admin/admin.php?page=age-gate-appearance2,1423.6557.1429.33
Messages /wp-admin/admin.php?page=age-gate-message1,9383.8870.2549.48
Tools /wp-admin/admin.php?page=age-gate-tools1,6693.8351.1833.58
Access /wp-admin/admin.php?page=age-gate-access1,8424.0047.2629.42

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
It is recommended to fix the following
  • The uninstall procedure has failed, leaving 6 options in the database
    • theysaidso_admin_options
    • widget_recent-comments
    • can_compress_scripts
    • db_upgraded
    • widget_theysaidso_widget
    • widget_recent-posts

Smoke tests 25% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Everything seems fine, however this is by no means an exhaustive test

SRP 0% 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 output non-empty strings when accessed directly via GET requests:
    • > /wp-content/plugins/age-gate/vendor/league/plates/example/templates/sidebar.php
    • > /wp-content/plugins/age-gate/src/Resources/views/public/partials/form/close.php
  • 378× PHP files trigger server-side errors or warnings when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html() in wp-content/plugins/age-gate/src/Resources/views/admin/term/edit-wrapper.php:2
    • > PHP Fatal error
      Uncaught Error: Interface 'Ramsey\\Uuid\\Fields\\FieldsInterface' not found in wp-content/plugins/age-gate/vendor/ramsey/uuid/src/Rfc4122/FieldsInterface.php:40
    • > PHP Fatal error
      Uncaught Error: Class 'Tests\\BaseTestCase' not found in wp-content/plugins/age-gate/vendor/asylum/validation/tests/Filters/SanitizeStringFilterTest.php:14
    • > PHP Fatal error
      Uncaught Error: Interface 'Ramsey\\Uuid\\Converter\\TimeConverterInterface' not found in wp-content/plugins/age-gate/vendor/ramsey/uuid/src/Converter/Time/GenericTimeConverter.php:35
    • > PHP Fatal error
      Uncaught Error: Interface 'League\\HTMLToMarkdown\\Converter\\ConverterInterface' not found in wp-content/plugins/age-gate/vendor/league/html-to-markdown/src/Converter/DefaultConverter.php:11
    • > PHP Warning
      include(../vendor/autoload.php): failed to open stream: No such file or directory in wp-content/plugins/age-gate/vendor/nicmart/string-template/benchmarks/engine.php on line 14
    • > PHP Notice
      Trying to get property 'remember' of non-object in wp-content/plugins/age-gate/src/Resources/views/public/partials/form/sections/remember.php on line 1
    • > PHP Fatal error
      Uncaught Error: Interface 'Ramsey\\Uuid\\Provider\odeProviderInterface' not found in wp-content/plugins/age-gate/vendor/ramsey/uuid/src/Provider/Node/RandomNodeProvider.php:36
    • > PHP Fatal error
      Uncaught Error: Call to undefined function collect() in wp-content/plugins/age-gate/src/Resources/views/admin/layouts/default.php:2
    • > PHP Fatal error
      Trait 'AgeGate\\Presentation\\ClassNames' not found in wp-content/plugins/age-gate/src/Presentation/Attribute.php on line 5

User-side errors 0% from 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
Please take a look at the following user-side issues
    • > GET request to /wp-admin/admin.php?page=age-gate-appearance
    • > Rendering (warning) in unknown
    /wp-admin/admin.php?page=age-gate-appearance 256 The specified value "" does not conform to the required format. The format is "#rrggbb" where rr, gg, bb are two-digit hexadecimal numbers.

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 88% from 16 tests

It's important to format your readme.txt file correctly as it is parsed for the public listing of your plugin
Please fix the following attributes:
  • Screenshots: These screenshots lack descriptions #7, #8 in age-gate/assets to your readme.txt
  • Tags: You are using too many tags: 22 tag instead of maximum 10
The official readme.txt is a good inspiration

age-gate/age-gate.php 92% from 13 tests

The main file in "Age Gate" v. 3.3.1 serves as a complement to information provided in readme.txt and as the entry point to the plugin
Please take the time to fix the following:
  • Domain Path: The domain path folder does not exist ("/language")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are considered dangerous and should not be included with any WordPress plugin
Everything looks great! No dangerous files found in this plugin44,919 lines of code in 885 files:
LanguageFilesBlank linesComment linesLines of code
PHP6768,69919,61335,956
JSON32002,802
Markdown531,02702,686
Sass58276851,517
JavaScript35402731,314
YAML13567337
HTML5112125
XML511398
CSS54831
SVG10029
Bourne Shell131112
TOML13012

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.37
Average class complexity5.91
▷ Minimum class complexity1.00
▷ Maximum class complexity186.00
Average method complexity2.15
▷ Minimum method complexity1.00
▷ Maximum method complexity26.00
Code structure
Namespaces122
Interfaces153
Traits21
Classes393
▷ Abstract classes215.34%
▷ Concrete classes37294.66%
▷ Final classes379.95%
Methods3,054
▷ Static methods2959.66%
▷ Public methods2,68888.02%
▷ Protected methods2177.11%
▷ Private methods1494.88%
Functions339
▷ Named functions15144.54%
▷ Anonymous functions18855.46%
Constants233
▷ Global constants135.58%
▷ Class constants22094.42%
▷ Public constants19387.73%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
8 PNG files occupy 0.08MB with 0.04MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
dist/img/banner-772x250.png24.24KB6.12KB▼ 74.77%
vendor/league/plates/doc/static/favicon/apple-touch-icon-precomposed.png5.40KB2.79KB▼ 48.42%
dist/img/thumbnail-128x128.png3.79KB1.97KB▼ 48.00%
src/Resources/assets/img/banner-772x250.png24.24KB6.12KB▼ 74.77%
vendor/league/plates/doc/static/images/logo.png2.25KB1.53KB▼ 32.22%