10% terms-popup-on-user-login

Code Review | Terms and Conditions Popup on User Login or at WooCommerce checkout

WordPress plugin Terms and Conditions Popup on User Login or at WooCommerce checkout scored10%from 54 tests.

About plugin

  • Plugin page: terms-popup-on-us...
  • Plugin version: 1.0.47
  • PHP compatiblity: 7.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 3.8-6.3.2
  • WordPress version: 6.3.1
  • First release: Jun 6, 2020
  • Latest release: Nov 22, 2023
  • Number of updates: 134
  • Update frequency: every 9.5 days
  • Top authors: lehelm (100%)

Code review

54 tests

User reviews

12 reviews

Install metrics

300+ active /8,749 total downloads

Benchmarks

Plugin footprint 58% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
Please fix the following installer errors
  • The plugin cannot be installed
    • > Notice in wp-content/plugins/terms-popup-on-user-login/includes/models/class-woo-options.php+62
    Trying to access array offset on value of type bool

Server metrics [RAM: ▲1.70MB] [CPU: ▲6.12ms] Passed 4 tests

An overview of server-side resources used by Terms and Conditions Popup on User Login or at WooCommerce checkout
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /5.16 ▲1.6954.44 ▲12.61
Dashboard /wp-admin5.03 ▲1.6859.29 ▼7.41
Posts /wp-admin/edit.php5.08 ▲1.7261.37 ▲14.28
Add New Post /wp-admin/post-new.php7.64 ▲1.75104.01 ▲7.90
Media Library /wp-admin/upload.php4.96 ▲1.7246.48 ▲11.37
Terms Popup On User Login /wp-admin/options-general.php?page=terms_popup_on_user_login_options4.8745.53

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

A short overview of filesystem and database impact
No storage issues were detected
Filesystem: 241 new files
Database: no new tables, 11 new options
New WordPress options
tpul_settings_term_modal_options
theysaidso_admin_options
tpul_settings_general_options
tpul_settings_term_modal_woo_options
tpul_email_options
widget_theysaidso_widget
can_compress_scripts
widget_recent-comments
tpul_settings_term_modal_display_options
db_upgraded
...

Browser metrics Passed 4 tests

Terms and Conditions Popup on User Login or at WooCommerce checkout: an overview of browser usage
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,798 ▲3614.27 ▼0.081.69 ▼0.1643.12 ▼0.55
Dashboard /wp-admin2,200 ▲235.61 ▼0.0595.99 ▼3.0543.71 ▼3.17
Posts /wp-admin/edit.php2,108 ▲82.01 ▲0.0046.02 ▲5.7436.99 ▲3.72
Add New Post /wp-admin/post-new.php1,533 ▲523.34 ▲0.09674.51 ▼3.7158.29 ▲6.12
Media Library /wp-admin/upload.php1,411 ▲114.23 ▲0.0795.88 ▲0.4242.95 ▲0.77
Terms Popup On User Login /wp-admin/options-general.php?page=terms_popup_on_user_login_options1,0322.2441.1230.40

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
The following items require your attention
  • The uninstall procedure has failed, leaving 11 options in the database
    • tpul_settings_term_modal_display_options
    • db_upgraded
    • tpul_settings_term_modal_options
    • tpul_email_options
    • widget_recent-comments
    • can_compress_scripts
    • widget_theysaidso_widget
    • widget_recent-posts
    • theysaidso_admin_options
    • tpul_settings_term_modal_woo_options
    • ...

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Everything seems fine, however this is by no means an exhaustive test

SRP 0% 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
The following issues need your attention
  • 3× GET requests to PHP files return non-empty strings:
    • > /wp-content/plugins/terms-popup-on-user-login/admin/partials/terms-popup-on-user-login-admin-display.php
    • > /wp-content/plugins/terms-popup-on-user-login/public/partials/terms-popup-on-user-login-public-display.php
    • > /wp-content/plugins/terms-popup-on-user-login/email-templates/default.php
  • 50× PHP files trigger server errors when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Interface 'GuzzleHttp\\Promise\\PromiseInterface' not found in wp-content/plugins/terms-popup-on-user-login/vendor/guzzlehttp/promises/src/Promise.php:10
    • > PHP Fatal error
      Uncaught Error: Class 'GuzzleHttp\\Cookie\\CookieJar' not found in wp-content/plugins/terms-popup-on-user-login/vendor/guzzlehttp/guzzle/src/Cookie/FileCookieJar.php:10
    • > PHP Fatal error
      Uncaught Error: Interface 'GuzzleHttp\\Exception\\GuzzleException' not found in wp-content/plugins/terms-popup-on-user-login/vendor/guzzlehttp/guzzle/src/Exception/TransferException.php:5
    • > PHP Fatal error
      Uncaught Error: Interface 'Psr\\Http\\Message\\StreamInterface' not found in wp-content/plugins/terms-popup-on-user-login/vendor/guzzlehttp/psr7/src/BufferStream.php:17
    • > PHP Fatal error
      Uncaught Error: Class 'GuzzleHttp\\Exception\\BadResponseException' not found in wp-content/plugins/terms-popup-on-user-login/vendor/guzzlehttp/guzzle/src/Exception/ServerException.php:8
    • > PHP Fatal error
      Uncaught Error: Class 'GuzzleHttp\\Promise\\RejectionException' not found in wp-content/plugins/terms-popup-on-user-login/vendor/guzzlehttp/promises/src/CancellationException.php:8
    • > PHP Fatal error
      Uncaught Error: Interface 'GuzzleHttp\\Promise\\PromisorInterface' not found in wp-content/plugins/terms-popup-on-user-login/vendor/guzzlehttp/guzzle/src/Pool.php:24
    • > PHP Fatal error
      Uncaught Error: Class 'GuzzleHttp\\Exception\\BadResponseException' not found in wp-content/plugins/terms-popup-on-user-login/vendor/guzzlehttp/guzzle/src/Exception/ClientException.php:8
    • > PHP Fatal error
      Uncaught Error: Interface 'GuzzleHttp\\Handler\\CurlFactoryInterface' not found in wp-content/plugins/terms-popup-on-user-login/vendor/guzzlehttp/guzzle/src/Handler/CurlFactory.php:20
    • > PHP Fatal error
      Uncaught Error: Interface 'Psr\\Http\\Message\\RequestFactoryInterface' not found in wp-content/plugins/terms-popup-on-user-login/vendor/guzzlehttp/psr7/src/HttpFactory.php:26

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
Everything seems fine on the user side

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% from 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
These attributes need to be fixed:
  • Donate link: Invalid URI ("")
Please take inspiration from this readme.txt

terms-popup-on-user-login/terms-popup-on-user-login.php Passed 13 tests

Analyzing the main PHP file in "Terms and Conditions Popup on User Login or at WooCommerce checkout" version 1.0.47
127 characters long description:
Creates a popup with a scrollable window that will show your own custom Terms and Conditions when users logs in to your website

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 detected22,725 lines of code in 217 files:
LanguageFilesBlank linesComment linesLines of code
PHP1733,9078,30815,874
Markdown181,38103,934
JavaScript112062771,295
JSON11001,121
CSS413763501

PHP code Passed 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
No cyclomatic complexity issues were detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.36
Average class complexity13.24
▷ Minimum class complexity1.00
▷ Maximum class complexity88.00
Average method complexity2.69
▷ Minimum method complexity1.00
▷ Maximum method complexity48.00
Code structure
Namespaces21
Interfaces27
Traits3
Classes123
▷ Abstract classes00.00%
▷ Concrete classes123100.00%
▷ Final classes3528.46%
Methods1,121
▷ Static methods18316.32%
▷ Public methods98487.78%
▷ Protected methods50.45%
▷ Private methods13211.78%
Functions130
▷ Named functions3728.46%
▷ Anonymous functions9371.54%
Constants64
▷ Global constants11.56%
▷ Class constants6398.44%
▷ Public constants5282.54%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
There are no PNG files in this plugin