68% wr-age-verification

Code Review | Wr Age Verification

WordPress plugin Wr Age Verification scored68%from 54 tests.

About plugin

  • Plugin page: wr-age-verification
  • Plugin version: 2.0.0
  • PHP version: 7.4.16
  • WordPress compatibility: 5.0.0-5.7
  • WordPress version: 6.3.1
  • First release: Jun 30, 2021
  • Latest release: Jul 10, 2021
  • Number of updates: 6
  • Update frequency: every 2.0 days
  • Top authors: robindkumar (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /512 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
Install script ran successfully

Server metrics [RAM: ▲0.12MB] [CPU: ▲1.38ms] Passed 4 tests

A check of server-side resources used by Wr Age Verification
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.60 ▲0.1343.70 ▲5.96
Dashboard /wp-admin3.42 ▲0.1146.86 ▼0.28
Posts /wp-admin/edit.php3.53 ▲0.1748.17 ▲5.11
Add New Post /wp-admin/post-new.php6.02 ▲0.1392.15 ▼1.40
Media Library /wp-admin/upload.php3.34 ▲0.1136.18 ▲2.09
Add Country /wp-admin/admin.php?page=add-country3.6632.51
Add State /wp-admin/admin.php?page=add-state3.2830.05

Server storage [IO: ▲3.99MB] [DB: ▲0.02MB] Passed 3 tests

Filesystem and database footprint
This plugin was installed successfully
Filesystem: 47 new files
Database: 2 new tables, 6 new options
New tables
wp_age_v_country
wp_age_v_settings
New WordPress options
db_upgraded
theysaidso_admin_options
widget_recent-comments
can_compress_scripts
widget_theysaidso_widget
widget_recent-posts

Browser metrics Passed 4 tests

Wr Age Verification: an overview of browser usage
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,276 ▲50513.91 ▼0.676.28 ▲4.3847.00 ▲2.47
Dashboard /wp-admin2,236 ▲515.08 ▲0.19105.98 ▼0.6147.07 ▲3.53
Posts /wp-admin/edit.php2,119 ▲512.31 ▲0.3040.43 ▲4.7641.51 ▲7.16
Add New Post /wp-admin/post-new.php1,696 ▲17722.63 ▼0.53643.20 ▼14.9038.93 ▼13.50
Media Library /wp-admin/upload.php1,418 ▲274.37 ▲0.13100.15 ▲3.2046.62 ▲4.13
Add Country /wp-admin/admin.php?page=add-country1,1911.8828.0737.23
Add State /wp-admin/admin.php?page=add-state7881.8624.3824.57

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
It is recommended to fix the following
  • The uninstall procedure failed, leaving 2 tables in the database
    • wp_age_v_country
    • wp_age_v_settings
  • The uninstall procedure has failed, leaving 6 options in the database
    • widget_recent-posts
    • can_compress_scripts
    • theysaidso_admin_options
    • db_upgraded
    • widget_theysaidso_widget
    • widget_recent-comments

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
These errors were triggered by the plugin
    • > GET request to /wp-admin/admin.php?page=add-state
    • > Warning in wp-includes/class-wp-hook.php+310
    call_user_func_array() expects parameter 1 to be a valid callback, class 'Age_Verification_Admin' does not have a method 'display_plugin_state_page'

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
  • 13× GET requests to PHP files trigger server-side errors or Error 500 responses (only 10 are shown):
    • > PHP Warning
      require_once(ABSPATHwp-admin/includes/class-wp-list-table.php): failed to open stream: No such file or directory in wp-content/plugins/wr-age-verification/admin/partials/country-listing.php on line 4
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wp_upload_dir() in wp-content/plugins/wr-age-verification/public/partials/age-verification-public-display-one.php:18
    • > PHP Fatal error
      require_once(): Failed opening required 'ABSPATHwp-admin/includes/class-wp-list-table.php' (include_path='.:/usr/share/php') in wp-content/plugins/wr-age-verification/admin/partials/country-listing.php on line 4
    • > PHP Fatal error
      require_once(): Failed opening required 'ABSPATHwp-admin/includes/class-wp-list-table.php' (include_path='.:/usr/share/php') in wp-content/plugins/wr-age-verification/admin/partials/country-listing.php on line 4
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wp_upload_dir() in wp-content/plugins/wr-age-verification/public/partials/age-verification-public-display-two.php:18
    • > PHP Warning
      Use of undefined constant ABSPATH - assumed 'ABSPATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/wr-age-verification/admin/partials/country-listing.php on line 4
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wp_upload_dir() in wp-content/plugins/wr-age-verification/public/partials/age-verification-public-display-template.php:18
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wp_upload_dir() in wp-content/plugins/wr-age-verification/public/partials/age-verification-public-display.php:18
    • > PHP Warning
      require_once(ABSPATHwp-admin/includes/class-wp-list-table.php): failed to open stream: No such file or directory in wp-content/plugins/wr-age-verification/admin/partials/country-listing.php on line 4
    • > PHP Fatal error
      require_once(): Failed opening required 'ABSPATHwp-admin/includes/class-wp-list-table.php' (include_path='.:/usr/share/php') in wp-content/plugins/wr-age-verification/admin/partials/country-listing.php on line 4

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
There were no browser issues found

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
Attributes that need to be fixed:
  • Plugin Name: "Plugin Name" should be replaced with the name of your plugin on the first line ( === wr-age-verification === )
You can take inspiration from this readme.txt

wr-age-verification/age-verification.php 92% from 13 tests

The main file in "Wr Age Verification" v. 2.0.0 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:
  • Main file name: Name the main plugin file the same as the plugin slug ("wr-age-verification.php" instead of "age-verification.php")

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
No dangerous file extensions were detected1,786 lines of code in 26 files:
LanguageFilesBlank linesComment linesLines of code
PHP171536581,467
JavaScript6965176
CSS3920143

PHP code Passed 2 tests

An overview of cyclomatic complexity and code structure
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.31
Average class complexity6.38
▷ Minimum class complexity1.00
▷ Maximum class complexity16.00
Average method complexity2.02
▷ Minimum method complexity1.00
▷ Maximum method complexity8.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes8
▷ Abstract classes00.00%
▷ Concrete classes8100.00%
▷ Final classes00.00%
Methods42
▷ Static methods37.14%
▷ Public methods3788.10%
▷ Protected methods00.00%
▷ Private methods511.90%
Functions3
▷ Named functions3100.00%
▷ Anonymous functions00.00%
Constants2
▷ Global constants2100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
11 PNG files occupy 0.91MB with 0.54MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
Screenshot-2.png85.72KB27.89KB▼ 67.46%
Screenshot-6.png234.93KB84.04KB▼ 64.23%
Screenshot-3.png64.41KB21.63KB▼ 66.42%
admin/images/template1.png27.93KB12.13KB▼ 56.55%
public/images/dummy-logo1.png11.97KB7.16KB▼ 40.19%