78% wp-terms-popup

Code Review | WP Terms Popup - Terms and Conditions and Privacy Policy WordPress Popups

WordPress plugin WP Terms Popup - Terms and Conditions and Privacy Policy WordPress Popups scored 78% from 54 tests.

About plugin

  • Plugin page: wp-terms-popup
  • Plugin version: 2.7.0
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.0-6.3
  • WordPress version: 6.3.1
  • First release: Jun 16, 2016
  • Latest release: Jul 24, 2023
  • Number of updates: 127
  • Update frequency: every 20.4 days
  • Top authors: linksoftware (62.2%)tentenbiz (38.58%)

Code review

54 tests

User reviews

15 reviews

Install metrics

4,000+ active / 82,251 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
This plugin's installer ran successfully

Server metrics [RAM: ▲0.10MB] [CPU: ▲2.23ms] Passed 4 tests

Analyzing server-side resources used by WP Terms Popup - Terms and Conditions and Privacy Policy WordPress Popups
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.53 ▲0.0745.06 ▲0.97
Dashboard /wp-admin3.42 ▲0.1149.19 ▲0.99
Posts /wp-admin/edit.php3.47 ▲0.1148.85 ▲1.58
Add New Post /wp-admin/post-new.php5.98 ▲0.09107.54 ▲11.45
Media Library /wp-admin/upload.php3.40 ▲0.1739.86 ▲5.36
Settings /wp-admin/edit.php?post_type=termpopup&page=wp-terms-popup-settings3.4140.67
Add New /wp-admin/post-new.php?post_type=termpopup3.5053.07
All Popups /wp-admin/edit.php?post_type=termpopup3.4441.99
Designer /wp-admin/edit.php?post_type=termpopup&page=wp-terms-popup-designer3.3636.43
Collector /wp-admin/edit.php?post_type=termpopup&page=wp-terms-popup-collector3.3635.07

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

How much does this plugin use your filesystem and database?
The plugin installed successfully
Filesystem: 42 new files
Database: no new tables, 7 new options
New WordPress options
wptp_version
widget_theysaidso_widget
widget_recent-posts
db_upgraded
theysaidso_admin_options
widget_recent-comments
can_compress_scripts

Browser metrics Passed 4 tests

A check of browser resources used by WP Terms Popup - Terms and Conditions and Privacy Policy WordPress Popups
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,871 ▲13613.60 ▼0.991.81 ▼0.3542.48 ▼5.37
Dashboard /wp-admin2,269 ▲784.89 ▼1.07120.23 ▲5.0641.22 ▼5.31
Posts /wp-admin/edit.php2,155 ▲692.12 ▲0.1137.43 ▲1.7632.42 ▼4.23
Add New Post /wp-admin/post-new.php6,524 ▲4,99120.26 ▼2.97974.88 ▲304.1555.29 ▲5.82
Media Library /wp-admin/upload.php1,457 ▲694.25 ▼0.0299.74 ▲0.0442.25 ▲0.34
Settings /wp-admin/edit.php?post_type=termpopup&page=wp-terms-popup-settings1,2651.7226.1642.59
Add New /wp-admin/post-new.php?post_type=termpopup2,4147.65188.5070.17
All Popups /wp-admin/edit.php?post_type=termpopup1,1382.0835.3427.68
Designer /wp-admin/edit.php?post_type=termpopup&page=wp-terms-popup-designer9171.6627.1633.98
Collector /wp-admin/edit.php?post_type=termpopup&page=wp-terms-popup-collector9181.7025.1731.73

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
It is recommended to fix the following
  • This plugin does not fully uninstall, leaving 7 options in the database
    • can_compress_scripts
    • widget_theysaidso_widget
    • widget_recent-comments
    • wptp_version
    • db_upgraded
    • widget_recent-posts
    • theysaidso_admin_options

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Everything seems fine, however this is by no means an exhaustive test

SRP 0% from 2 tests

🔹 Tests weight: 20 | SRP (Single-Responsibility Principle) - PHP files must act as libraries and never output text or perform any action when accessed directly in a browser
Please fix the following items
  • 3× GET requests to PHP files return non-empty strings:
    • > /wp-content/plugins/wp-terms-popup/admin/partials/wp-terms-popup-admin-display.php
    • > /wp-content/plugins/wp-terms-popup/public/partials/wp-terms-popup-public-age-verification.php
    • > /wp-content/plugins/wp-terms-popup/public/partials/wp-terms-popup-public-popup.php
  • 14× PHP files trigger server-side errors or warnings when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_attr() in wp-content/plugins/wp-terms-popup/public/partials/wp-terms-popup-public-css.php:14
    • > PHP Fatal error
      Uncaught Error: Call to undefined function do_action() in wp-content/plugins/wp-terms-popup/admin/partials/wp-terms-popup-admin-collector.php:17
    • > PHP Notice
      Undefined variable: columns in wp-content/plugins/wp-terms-popup/public/partials/wp-terms-popup-public-age-verification.php on line 14
    • > PHP Warning
      include_once(ABSPATHwp-admin/includes/plugin.php): failed to open stream: No such file or directory in wp-content/plugins/wp-terms-popup/admin/partials/wp-terms-popup-admin-settings.php on line 12
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wp_nonce_field() in wp-content/plugins/wp-terms-popup/admin/partials/wp-terms-popup-admin-post-type-meta-boxes.php:12
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/wp-terms-popup/admin/partials/wp-terms-popup-admin-footer.php:14
    • > PHP Warning
      Use of undefined constant ABSPATH - assumed 'ABSPATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/wp-terms-popup/admin/partials/wp-terms-popup-admin-settings.php on line 12
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/wp-terms-popup/public/partials/wp-terms-popup-public-popup-buttons.php:13
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/wp-terms-popup/admin/partials/wp-terms-popup-admin-post-meta-boxes.php:12
    • > PHP Warning
      Invalid argument supplied for foreach() in wp-content/plugins/wp-terms-popup/public/partials/wp-terms-popup-public-age-verification.php on line 14

User-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
No browser errors were detected

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

Perhaps the most important file in your plugin readme.txt gets parsed in order to generate the public listing of your plugin
5 plugin tags: terms and conditions, privacy policy, age verification, terms of service, popup

wp-terms-popup/index.php 92% from 13 tests

The main PHP file in "WP Terms Popup - Terms and Conditions and Privacy Policy WordPress Popups" ver. 2.7.0 adds more information about the plugin and also serves as the entry point for this plugin
Please make the necessary changes and fix the following:
  • Main file name: The principal plugin file should be the same as the plugin slug ("wp-terms-popup.php" instead of "index.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,727 lines of code in 27 files:
LanguageFilesBlank linesComment linesLines of code
PHP212887351,253
PO File191107325
JavaScript3203182
CSS26067

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.36
Average class complexity22.57
▷ Minimum class complexity1.00
▷ Maximum class complexity89.00
Average method complexity4.08
▷ Minimum method complexity1.00
▷ Maximum method complexity31.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes7
▷ Abstract classes00.00%
▷ Concrete classes7100.00%
▷ Final classes00.00%
Methods49
▷ Static methods24.08%
▷ Public methods3877.55%
▷ Protected methods00.00%
▷ Private methods1122.45%
Functions3
▷ Named functions3100.00%
▷ Anonymous functions00.00%
Constants1
▷ Global constants1100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
8 compressed PNG files occupy 0.08MB
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
admin/img/wptp-icon.png1.28KB0.59KB▼ 53.66%
admin/img/collector-2.png16.22KB15.40KB▼ 5.04%
admin/img/designer-2.png12.81KB12.41KB▼ 3.15%
admin/img/age-1.png11.25KB10.70KB▼ 4.88%
admin/img/collector-1.png16.94KB15.77KB▼ 6.93%