83% super-simple-age-gate-beta

Code Review | Super Simple Age Gate

WordPress plugin Super Simple Age Gate scored83%from 54 tests.

About plugin

  • Plugin page: super-simple-age-...
  • Plugin version: 1.7.3
  • PHP version: 7.4.16
  • WordPress compatibility: 5.2-5.4
  • WordPress version: 6.3.1
  • First release: Nov 7, 2019
  • Latest release: Aug 16, 2020
  • Number of updates: 14
  • Update frequency: every 20.2 days
  • Top authors: betacore (100%)

Code review

54 tests

User reviews

1 review

Install metrics

30+ active /1,034 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
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.09MB] [CPU: ▲2.71ms] Passed 4 tests

Analyzing server-side resources used by Super Simple Age Gate
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.53 ▲0.0751.78 ▲4.06
Dashboard /wp-admin3.41 ▲0.1060.15 ▲9.54
Posts /wp-admin/edit.php3.53 ▲0.1760.07 ▲7.42
Add New Post /wp-admin/post-new.php5.97 ▲0.0894.74 ▼0.52
Media Library /wp-admin/upload.php3.31 ▲0.0838.57 ▼0.11
Age Gate /wp-admin/users.php?page=bcAGGT_gate_settings3.4844.67

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

Input-output and database impact of this plugin
The plugin installed successfully
Filesystem: 29 new files
Database: no new tables, 6 new options
New WordPress options
theysaidso_admin_options
widget_theysaidso_widget
widget_recent-comments
can_compress_scripts
widget_recent-posts
db_upgraded

Browser metrics Passed 4 tests

An overview of browser requirements for Super Simple Age Gate
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,974 ▲22814.45 ▼0.102.07 ▲0.1443.80 ▼1.29
Dashboard /wp-admin2,351 ▲1636.44 ▲1.57119.56 ▲14.7941.27 ▼3.73
Posts /wp-admin/edit.php2,257 ▲1863.33 ▲1.3354.26 ▲17.5935.45 ▼0.41
Add New Post /wp-admin/post-new.php1,522 ▼623.37 ▲5.01590.40 ▼62.6233.07 ▼23.18
Media Library /wp-admin/upload.php1,398 ▲104.08 ▼0.1280.38 ▼21.5345.54 ▼1.18
Age Gate /wp-admin/users.php?page=bcAGGT_gate_settings1,9043.0345.1074.67

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
Please fix the following items
  • Zombie WordPress options were found after uninstall: 6 options
    • can_compress_scripts
    • widget_theysaidso_widget
    • db_upgraded
    • widget_recent-posts
    • widget_recent-comments
    • theysaidso_admin_options

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
The smoke test was a success, however most plugin functionality was not tested

SRP 50% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle applies for WordPress plugins as well - please make sure your PHP files perform no actions when accessed directly
Please fix the following items
  • 6× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/super-simple-age-gate-beta/inc/functions-nav.php:21
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/super-simple-age-gate-beta/inc/functions-wp-admin.php:8
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/super-simple-age-gate-beta/inc/functions-gate.php:31
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/super-simple-age-gate-beta/template/wp-gate-page.php:4
    • > PHP Fatal error
      Uncaught Error: Call to undefined function settings_fields() in wp-content/plugins/super-simple-age-gate-beta/template/wp-admin-form.php:6
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/super-simple-age-gate-beta/inc/functions-nav.php:21

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 83% from 29 tests

readme.txt 88% 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 need to be fixed:
  • Requires php: The plugin version is formatted incorrectly
  • Screenshots: These screenshots require images: #1 (The age gate in action!), #2 (The back end of the age gate. It is tucked away under the users nav.), #3 (The plain page, classic dark template.), #4 (The classic light template.), #5 (There is ample oppurtunity to customise this screen so it fits your own needs.)
You can look at the official readme.txt

super-simple-age-gate-beta/simple-age-gate.php 77% from 13 tests

The main PHP script in "Super Simple Age Gate" version 1.7.3 is automatically included on every request by WordPress
Please make the necessary changes and fix the following:
  • Main file name: Name the main plugin file the same as the plugin slug ("super-simple-age-gate-beta.php" instead of "simple-age-gate.php")
  • Text Domain: Since WordPress version 4.6 the text domain is optional; if specified, it must be the same as the plugin slug
  • Domain Path: The domain path points to a folder that does not exist ("/lang")

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
Good job! No executable or dangerous file extensions detected1,252 lines of code in 11 files:
LanguageFilesBlank linesComment linesLines of code
PHP718380689
CSS4916563

PHP code Passed 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.23
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%
Functions19
▷ Named functions1894.74%
▷ Anonymous functions15.26%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
12 PNG files occupy 1.25MB with 0.66MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
img/super-simple-site-offline-beta.png11.49KB5.45KB▼ 52.54%
img/simple-analytics-tag-beta.png8.01KB3.60KB▼ 55.09%
img/super-simple-recaptcha-v3.png29.15KB11.08KB▼ 61.98%
img/rebranded-pro-the-agency-toolkit.png14.51KB6.63KB▼ 54.34%
img/betalogo-b.png7.85KB4.69KB▼ 40.27%