77% surbma-yes-no-popup

Code Review | CPS | Age Verification

WordPress plugin CPS | Age Verification scored 77% from 54 tests.

About plugin

  • Plugin page: surbma-yes-no-popup
  • Plugin version: 7.4
  • PHP compatiblity: 7.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.2-5.9
  • WordPress version: 5.9.2
  • First release: Dec 31, 2016
  • Latest release: Mar 3, 2022
  • Number of updates: 40
  • Update frequency: every 47.2 days
  • Top authors: Surbma (100%)

Code review

54 tests

User reviews

6 reviews

Install metrics

1,000+ active / 18,062 total downloads

Benchmarks

Plugin footprint Passed 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
This plugin's installer ran successfully

Server metrics [RAM: ▲0.22MB] [CPU: ▼300.00ms] Passed 4 tests

A check of server-side resources used by CPS | Age Verification
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.64 ▲0.1256.45 ▲7.27
Dashboard /wp-admin3.69 ▲0.2934.89 ▲1.62
Posts /wp-admin/edit.php3.92 ▲0.2838.80 ▲2.04
Add New Post /wp-admin/post-new.php7.16 ▲0.1999.82 ▼1,197.99
Media Library /wp-admin/upload.php3.57 ▲0.2725.13 ▼5.65
Age Verification /wp-admin/admin.php?page=surbma-yes-no-popup-menu3.5526.35
All plugins /wp-admin/admin.php?page=cps-plugins-menu3.56380.47

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

Input-output and database impact of this plugin
There were no storage issued detected upon installing this plugin
Filesystem: 255 new files
Database: no new tables, no new options

Browser metrics Passed 4 tests

This is an overview of browser requirements for CPS | Age Verification
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /4,056 ▲33316.33 ▲0.5512.61 ▲6.822.19 ▼0.42
Dashboard /wp-admin3,063 ▲2096.22 ▲0.03117.97 ▼17.95177.03 ▲16.82
Posts /wp-admin/edit.php2,851 ▲1603.26 ▲0.0263.81 ▲2.15148.68 ▲8.71
Add New Post /wp-admin/post-new.php1,897 ▲14523.43 ▲2.13404.90 ▼37.72182.86 ▲23.31
Media Library /wp-admin/upload.php1,854 ▲1595.56 ▲0.10124.19 ▼7.88202.19 ▲15.75
Age Verification /wp-admin/admin.php?page=surbma-yes-no-popup-menu4,5546.02125.67189.04
All plugins /wp-admin/admin.php?page=cps-plugins-menu2,8093.5398.00180.20

Uninstaller [IO: ▲0.00MB] [DB: ▲0.00MB] Passed 4 tests

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
The plugin uninstalled completely, with no zombie files or tables

Smoke tests 0% 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
  • 4 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=surbma-yes-no-popup-menu
    • > Notice in wp-content/plugins/surbma-yes-no-popup/pages/settings.php+405
    Trying to access array offset on value of type bool

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
The following issues need your attention
  • 1× GET requests to PHP files return non-empty strings:
    • > /wp-content/plugins/surbma-yes-no-popup/surbma-yes-no-popup.php
  • 10× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Warning
      include_once(): Failed opening 'CPS_DIR/pages/plugins-page.php' for inclusion (include_path='.:/usr/share/php') in wp-content/plugins/surbma-yes-no-popup/cps/lib/admin.php on line 4
    • > PHP Warning
      Use of undefined constant CPS_DIR - assumed 'CPS_DIR' (this will throw an Error in a future version of PHP) in wp-content/plugins/surbma-yes-no-popup/cps/lib/admin.php on line 4
    • > PHP Warning
      include_once(): Failed opening 'SURBMA_YES_NO_POPUP_PLUGIN_DIR/pages/settings.php' for inclusion (include_path='.:/usr/share/php') in wp-content/plugins/surbma-yes-no-popup/lib/admin.php on line 3
    • > PHP Warning
      include_once(SURBMA_YES_NO_POPUP_PLUGIN_DIR/pages/settings.php): failed to open stream: No such file or directory in wp-content/plugins/surbma-yes-no-popup/lib/admin.php on line 3
    • > PHP Warning
      Use of undefined constant SURBMA_YES_NO_POPUP_PLUGIN_DIR - assumed 'SURBMA_YES_NO_POPUP_PLUGIN_DIR' (this will throw an Error in a future version of PHP) in wp-content/plugins/surbma-yes-no-popup/lib/admin.php on line 3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/surbma-yes-no-popup/pages/settings.php:10
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/surbma-yes-no-popup/lib/admin.php:17
    • > PHP Warning
      include_once(CPS_DIR/pages/plugins-page.php): failed to open stream: No such file or directory in wp-content/plugins/surbma-yes-no-popup/cps/lib/admin.php on line 4
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/surbma-yes-no-popup/cps/lib/admin.php:27
    • > PHP Fatal error
      Uncaught Error: Call to undefined function untrailingslashit() in wp-content/plugins/surbma-yes-no-popup/cps/start.php:6

User-side errors 0% from 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
These are user-side errors you should fix
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=cps-plugins-menu
    • > Network (severe)
    wp-content/plugins/surbma-yes-no-popup/cps/images/cps-logo.svg - Failed to load resource: the server responded with a status of 404 (Not Found)

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

The readme.txt file uses markdown syntax to describe your plugin to the world
8 plugin tags: age verify, yesno, age verification, popup, woocommerce...

surbma-yes-no-popup/surbma-yes-no-popup.php 92% from 13 tests

The entry point to "CPS | Age Verification" version 7.4 is a PHP file that has certain tags in its header comment area
The following require your attention:
  • Domain Path: The domain path folder does not exist ("/languages/")

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
There were no executable files found in this plugin34,252 lines of code in 200 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript234,69118011,549
CSS6493,0599,574
LESS1484,5654,9898,523
Markdown977702,017
PHP71171561,411
JSON42201,087
SVG20274
XML10017

PHP code Passed 2 tests

A brief analysis 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.53
Average class complexity11.00
▷ Minimum class complexity11.00
▷ Maximum class complexity11.00
Average method complexity2.80
▷ Minimum method complexity1.00
▷ Maximum method complexity5.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods6
▷ Static methods6100.00%
▷ Public methods6100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions21
▷ Named functions1990.48%
▷ Anonymous functions29.52%
Constants11
▷ Global constants11100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
1 compressed PNG file occupies 0.00MB
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
cps/assets/images/cps-logo.png0.88KB1.03KB0.00%