61% disclaimer-popup

Code Review | Disclaimer Popup

WordPress plugin Disclaimer Popup scored61%from 54 tests.

About plugin

  • Plugin page: disclaimer-popup
  • Plugin version: 1.1.3
  • PHP compatiblity: 5.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.5-6.3
  • WordPress version: 6.3.1
  • First release: Mar 25, 2021
  • Latest release: Nov 20, 2023
  • Number of updates: 24
  • Update frequency: every 40.5 days
  • Top authors: marcodedo (100%)

Code review

54 tests

User reviews

5 reviews

Install metrics

1,000+ active /6,998 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
This plugin's installer ran successfully

Server metrics [RAM: ▼0.59MB] [CPU: ▼35.20ms] Passed 4 tests

Analyzing server-side resources used by Disclaimer Popup
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.35 ▼0.1119.80 ▼19.90
Dashboard /wp-admin3.43 ▲0.1323.31 ▼28.01
Posts /wp-admin/edit.php3.43 ▲0.0821.47 ▼23.02
Add New Post /wp-admin/post-new.php3.43 ▼2.4520.57 ▼69.88
Media Library /wp-admin/upload.php3.43 ▲0.2022.97 ▼9.43
Settings /wp-admin/edit.php?post_type=wp-disclaimer-popup&page=wpdp3.4421.49
Dashboard /wp-admin/plugins.php?page=meta-box3.5322.44
Add New Disclaimer /wp-admin/post-new.php?post_type=wp-disclaimer-popup3.4431.31
All Disclaimers /wp-admin/edit.php?post_type=wp-disclaimer-popup3.4425.63

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

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

Browser metrics Passed 4 tests

Disclaimer Popup: an overview of browser usage
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,968 ▲18113.41 ▼0.939.44 ▲7.4942.62 ▲0.26
Dashboard /wp-admin2,278 ▲1005.62 ▼0.0994.70 ▼17.9037.98 ▼6.34
Posts /wp-admin/edit.php2,184 ▲841.98 ▼0.0535.49 ▼6.8630.64 ▼3.71
Add New Post /wp-admin/post-new.php1,631 ▲10522.35 ▼0.90763.98 ▲97.2238.20 ▼17.43
Media Library /wp-admin/upload.php1,517 ▲1144.63 ▲0.43106.39 ▲7.8744.96 ▲1.76
Settings /wp-admin/edit.php?post_type=wp-disclaimer-popup&page=wpdp2,1803.85107.9538.04
Dashboard /wp-admin/plugins.php?page=meta-box1,8209.00288.4562.77
Add New Disclaimer /wp-admin/post-new.php?post_type=wp-disclaimer-popup6,18121.31814.8227.47
All Disclaimers /wp-admin/edit.php?post_type=wp-disclaimer-popup1,1441.9533.7529.61

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
These items require your attention
  • Uninstall procedure had uncaught errors
    • > Notice in wp-content/plugins/disclaimer-popup/mb-settings.php+220
    Trying to access array offset on value of type bool
  • The uninstall procedure has failed, leaving 6 options in the database
    • widget_recent-posts
    • widget_theysaidso_widget
    • db_upgraded
    • widget_recent-comments
    • theysaidso_admin_options
    • can_compress_scripts

Smoke tests 25% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Smoke test failed, please fix the following
  • 13 occurences, only the last one shown
    • > GET request to /wp-admin/edit.php?post_type=wp-disclaimer-popup
    • > POST request to /wp-admin/admin-ajax.php
    • > Notice in wp-content/plugins/disclaimer-popup/mb-settings.php+220
    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
Almost there! Just fix the following items
  • 7× PHP files perform the action of outputting non-empty strings when accessed directly:
    • > /wp-content/plugins/disclaimer-popup/public/partials/wp-disclaimer-popup-public-display.php
    • > /wp-content/plugins/disclaimer-popup/assets/meta-box/inc/templates/image-advanced.php
    • > /wp-content/plugins/disclaimer-popup/admin/partials/wp-disclaimer-popup-admin-display.php
    • > /wp-content/plugins/disclaimer-popup/assets/meta-box/inc/templates/audio.php
    • > /wp-content/plugins/disclaimer-popup/assets/meta-box/inc/templates/video.php
    • > /wp-content/plugins/disclaimer-popup/assets/meta-box/inc/templates/upload.php
    • > /wp-content/plugins/disclaimer-popup/assets/meta-box/inc/templates/media.php
  • 78× PHP files trigger errors when accessed directly with GET requests (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'RWMB_Select_Advanced_Field' not found in wp-content/plugins/disclaimer-popup/assets/meta-box/inc/fields/select-tree.php:5
    • > PHP Fatal error
      Uncaught Error: Class 'RWMB_Image_Advanced_Field' not found in wp-content/plugins/disclaimer-popup/assets/meta-box/inc/fields/image-upload.php:5
    • > PHP Fatal error
      Uncaught Error: Class 'RWMB_Input_Field' not found in wp-content/plugins/disclaimer-popup/assets/meta-box/inc/fields/fieldset-text.php:5
    • > PHP Fatal error
      Uncaught Error: Class 'RWMB_Field' not found in wp-content/plugins/disclaimer-popup/assets/meta-box/inc/fields/choice.php:5
    • > PHP Fatal error
      Uncaught Error: Class 'RWMB_Field' not found in wp-content/plugins/disclaimer-popup/assets/meta-box/inc/fields/textarea.php:5
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_plugin_data() in wp-content/plugins/disclaimer-popup/assets/meta-box/inc/about/sections/welcome.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html_e() in wp-content/plugins/disclaimer-popup/assets/meta-box/inc/about/sections/tabs.php:2
    • > PHP Fatal error
      Uncaught Error: Class 'RWMB_Select_Field' not found in wp-content/plugins/disclaimer-popup/assets/meta-box/inc/fields/select-advanced.php:5
    • > PHP Fatal error
      Uncaught Error: Class 'RWMB_Input_Field' not found in wp-content/plugins/disclaimer-popup/assets/meta-box/inc/fields/datetime.php:7
    • > PHP Fatal error
      Uncaught Error: Class 'RW_Meta_Box' not found in wp-content/plugins/disclaimer-popup/assets/mb-settings-page/src/Customizer/NormalSection.php:6

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 86% from 29 tests

readme.txt 94% from 16 tests

You should put a lot of thought into formatting readme.txt as it is used by WordPress.org to prepare the public listing of your plugin
Attributes that need to be fixed:
  • Donate link: Please fix this invalid URI: ""
Please take inspiration from this readme.txt

disclaimer-popup/wp-disclaimer-popup.php 77% from 13 tests

The main PHP script in "Disclaimer Popup" version 1.1.3 is automatically included on every request by WordPress
Please take the time to fix the following:
  • Description: Please keep the plugin description shorter than 140 characters (currently 243 characters long)
  • Main file name: Name the main plugin file the same as the plugin slug ("disclaimer-popup.php" instead of "wp-disclaimer-popup.php")
  • Text Domain: You no longer need to specify the text domain since WordPress 4.6; it must be the same as the plugin slug

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are not allowed as they can serve as attack vectors
Everything looks great! No dangerous files found in this plugin16,016 lines of code in 313 files:
LanguageFilesBlank linesComment linesLines of code
PHP1551,7444,1138,383
JavaScript1061,1167934,403
CSS472481413,020
Sass1159145
PO File2101755
JSON1005
SVG1005

PHP code Passed 2 tests

This plugin's cyclomatic complexity and code structure detailed below
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.32
Average class complexity8.41
▷ Minimum class complexity1.00
▷ Maximum class complexity67.00
Average method complexity2.40
▷ Minimum method complexity1.00
▷ Maximum method complexity18.00
Code structure
Namespaces7
Interfaces1
Traits0
Classes117
▷ Abstract classes65.13%
▷ Concrete classes11194.87%
▷ Final classes00.00%
Methods627
▷ Static methods32151.20%
▷ Public methods53485.17%
▷ Protected methods467.34%
▷ Private methods477.50%
Functions35
▷ Named functions2262.86%
▷ Anonymous functions1337.14%
Constants8
▷ Global constants8100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
17 PNG files occupy 0.50MB with 0.08MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/meta-box/img/jqueryui/ui-bg_glass_75_dadada_1x400.png0.11KB0.16KB0.00%
assets/meta-box/img/jqueryui/ui-icons_888888_256x240.png4.27KB4.11KB▼ 3.78%
screenshot-1.png55.04KB14.85KB▼ 73.02%
assets/meta-box/img/jqueryui/ui-bg_glass_75_e6e6e6_1x400.png0.11KB0.14KB0.00%
assets/meta-box/img/jqueryui/ui-icons_222222_256x240.png4.27KB4.11KB▼ 3.78%