79% easy-marijuana-age-verify

Code Review | Marijuana Age Verify

WordPress plugin Marijuana Age Verify scored 79% from 54 tests.

About plugin

  • Plugin page: easy-marijuana-ag...
  • Plugin version: 1.5.2
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.6-6.2
  • WordPress version: 6.3.1
  • First release: Feb 26, 2019
  • Latest release: Jul 6, 2023
  • Number of updates: 84
  • Update frequency: every 19.2 days
  • Top authors: 5starplugins (100%)

Code review

54 tests

User reviews

2 reviews

Install metrics

1,000+ active / 16,355 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
Installer ran successfully

Server metrics [RAM: ▲5.40MB] [CPU: ▲26.08ms] 75% from 4 tests

This is a short check of server-side resources used by Marijuana Age Verify
It is recommended to improve the following
  • Extra RAM: The extra memory usage must be under 5MB (currently 5.40MB on /wp-admin/admin.php?page=freemius)
PageMemory (MB)CPU Time (ms)
Home /9.20 ▲5.7468.99 ▲32.27
Dashboard /wp-admin9.22 ▲5.9276.55 ▲29.11
Posts /wp-admin/edit.php9.22 ▲5.8780.46 ▲34.29
Add New Post /wp-admin/post-new.php9.97 ▲4.09108.41 ▲8.65
Media Library /wp-admin/upload.php9.22 ▲5.9968.38 ▲37.39
Freemius Debug [v.2.5.10] /wp-admin/admin.php?page=freemius9.2257.77

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

Filesystem and database footprint
This plugin was installed successfully
Filesystem: 198 new files
Database: no new tables, 10 new options
New WordPress options
widget_recent-comments
fs_active_plugins
fs_debug_mode
_emav_always_verify
can_compress_scripts
fs_accounts
db_upgraded
widget_theysaidso_widget
theysaidso_admin_options
widget_recent-posts

Browser metrics Passed 4 tests

Checking browser requirements for Marijuana Age Verify
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,948 ▲19113.76 ▼0.887.16 ▲4.9434.83 ▼13.82
Dashboard /wp-admin2,240 ▲525.84 ▲0.80103.25 ▼5.4445.76 ▲2.59
Posts /wp-admin/edit.php2,123 ▲342.02 ▲0.0139.62 ▼1.3938.71 ▲3.16
Add New Post /wp-admin/post-new.php1,536 ▲222.99 ▼0.12668.04 ▲37.3259.22 ▲6.34
Media Library /wp-admin/upload.php1,425 ▲404.21 ▲0.0499.33 ▼4.7645.66 ▲2.31
Freemius Debug [v.2.5.10] /wp-admin/admin.php?page=freemius1,0971.7224.3627.84

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
These items require your attention
  • The plugin did not uninstall gracefully
    • > Notice in wp-content/plugins/easy-marijuana-age-verify/includes/freemius/includes/class-freemius.php+8486
    Undefined property: stdClass::$plugins
  • Zombie WordPress options were found after uninstall: 10 options
    • theysaidso_admin_options
    • widget_recent-posts
    • can_compress_scripts
    • fs_accounts
    • widget_theysaidso_widget
    • fs_debug_mode
    • fs_active_plugins
    • db_upgraded
    • widget_recent-comments
    • _emav_always_verify

Smoke tests Passed 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Even though everything seems fine, this is not an exhaustive test

SRP Passed 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
Looking good! No server-side errors or output on direct access of PHP files

User-side errors Passed 1 test

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

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
6 plugin tags: age verify, dispensary, cannabis, popup, marijuana...

easy-marijuana-age-verify/easy-marijuana-age-verify.php Passed 13 tests

"Marijuana Age Verify" version 1.5.2's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
40 characters long description:
Age verification for marijuana websites.

Code Analysis 97% from 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short review of files and their extensions; it is not recommended to include executable files
Good job! No executable or dangerous file extensions detected35,578 lines of code in 146 files:
LanguageFilesBlank linesComment linesLines of code
PHP1238,12017,85834,089
PO File2214319461
CSS15780428
JavaScript55981386
Markdown1680214

PHP code 50% from 2 tests

This is a very shot review of cyclomatic complexity and code structure
Please tend to the following items
  • Class cyclomatic complexity should be reduced to less than 1000 (currently 3,073)
Cyclomatic complexity
Average complexity per logical line of code0.62
Average class complexity89.88
▷ Minimum class complexity1.00
▷ Maximum class complexity3,073.00
Average method complexity4.53
▷ Minimum method complexity1.00
▷ Maximum method complexity94.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes50
▷ Abstract classes24.00%
▷ Concrete classes4896.00%
▷ Final classes24.17%
Methods1,288
▷ Static methods20115.61%
▷ Public methods89669.57%
▷ Protected methods171.32%
▷ Private methods37529.11%
Functions147
▷ Named functions147100.00%
▷ Anonymous functions00.00%
Constants148
▷ Global constants10067.57%
▷ Class constants4832.43%
▷ Public constants48100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
4 PNG files occupy 0.04MB with 0.02MB in potential savings
Potential savings
Compression of 4 random PNG files using pngquant
FileSize - originalSize - compressedSavings
includes/freemius/assets/img/plugin-icon.png9.16KB5.26KB▼ 42.58%
includes/freemius/assets/img/theme-icon.png10.97KB5.78KB▼ 47.37%
includes/images/icon.png15.28KB7.15KB▼ 53.22%
includes/images/5StarPlugins_Logo80x80.png2.08KB1.07KB▼ 48.52%