78% uk-cookie-consent

Code Review | GDPR/CCPA Cookie Consent Banner

WordPress plugin GDPR/CCPA Cookie Consent Banner scored78%from 54 tests.

About plugin

  • Plugin page: uk-cookie-consent
  • Plugin version: 3.0.3
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.2-6.2
  • WordPress version: 6.3.1
  • First release: Jun 9, 2012
  • Latest release: Aug 8, 2023
  • Number of updates: 170
  • Update frequency: every 24.0 days
  • Top authors: Catapult_Themes (58.24%)Catapult (30%)brandondove (10%)davidtaroko (1.76%)nateconley (1.18%)

Code review

54 tests

User reviews

200 reviews

Install metrics

100,000+ active /2,389,302 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.16MB] [CPU: ▼7.72ms] Passed 4 tests

Server-side resources used by GDPR/CCPA Cookie Consent Banner
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.61 ▲0.1541.60 ▼0.76
Dashboard /wp-admin3.46 ▲0.1646.74 ▼23.30
Posts /wp-admin/edit.php3.58 ▲0.2249.34 ▲0.17
Add New Post /wp-admin/post-new.php6.04 ▲0.1692.83 ▼6.97
Media Library /wp-admin/upload.php3.39 ▲0.1641.00 ▲7.97

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

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

Browser metrics Passed 4 tests

Checking browser requirements for GDPR/CCPA Cookie Consent Banner
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,843 ▲9713.73 ▼0.644.54 ▲2.5943.03 ▼0.25
Dashboard /wp-admin2,224 ▲364.86 ▼0.05107.95 ▼0.7239.72 ▼2.60
Posts /wp-admin/edit.php2,107 ▲182.02 ▲0.0140.90 ▲0.6535.40 ▼3.16
Add New Post /wp-admin/post-new.php1,529 ▼417.56 ▼5.58682.83 ▲23.7356.85 ▲5.41
Media Library /wp-admin/upload.php1,406 ▲184.14 ▼0.0792.40 ▼16.7444.31 ▼0.93

Uninstaller [IO: ▲0.00MB] [DB: ▲0.00MB] 75% 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
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • db_upgraded
    • widget_recent-comments
    • can_compress_scripts
    • widget_recent-posts
    • widget_theysaidso_widget
    • theysaidso_admin_options

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
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
Almost there! Just fix the following items
  • 1× PHP files perform the task of outputting text when accessed with GET requests:
    • > /wp-content/plugins/uk-cookie-consent/uk-cookie-consent.php
  • 31× PHP files trigger errors when accessed directly with GET requests (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html_e() in wp-content/plugins/uk-cookie-consent/includes/views/policies.php:16
    • > PHP Fatal error
      Uncaught Error: Class 'termly\\Menu_Controller' not found in wp-content/plugins/uk-cookie-consent/includes/controllers/class-policies-controller.php:13
    • > PHP Fatal error
      Uncaught Error: Call to undefined function termly\\add_action() in wp-content/plugins/uk-cookie-consent/includes/controllers/class-termly-api-controller.php:10
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html_e() in wp-content/plugins/uk-cookie-consent/includes/views/sign-up.php:16
    • > PHP Fatal error
      Uncaught Error: Call to undefined function termly\\add_action() in wp-content/plugins/uk-cookie-consent/includes/controllers/class-frontend.php:10
    • > PHP Fatal error
      require(): Failed opening required 'TERMLY_VIEWScountries.php' (include_path='.:/usr/share/php') in wp-content/plugins/uk-cookie-consent/includes/views/edit-cookie.php on line 3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html_e() in wp-content/plugins/uk-cookie-consent/includes/views/banner-settings.php:15
    • > PHP Warning
      require_once(ABSPATHwp-admin/includes/class-wp-list-table.php): failed to open stream: No such file or directory in wp-content/plugins/uk-cookie-consent/includes/controllers/class-site-scan-results-list-table.php on line 8
    • > PHP Fatal error
      Uncaught Error: Class 'termly\\Menu_Controller' not found in wp-content/plugins/uk-cookie-consent/includes/controllers/class-app-controller.php:13
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html_e() in wp-content/plugins/uk-cookie-consent/includes/views/sign-up-notice.php:11

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 97% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file uses markdown syntax to describe your plugin to the world
Attributes that require attention:
  • Tags: Please reduce the number of tags, currently 12 tag instead of maximum 10
Please take inspiration from this readme.txt

uk-cookie-consent/uk-cookie-consent.php Passed 13 tests

The entry point to "GDPR/CCPA Cookie Consent Banner" version 3.0.3 is a PHP file that has certain tags in its header comment area
104 characters long description:
Our easy to use cookie consent plugin can assist in your GDPR and ePrivacy Directive compliance efforts.

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 plugin22,357 lines of code in 54 files:
LanguageFilesBlank linesComment linesLines of code
JSON20017,986
PHP328555572,823
Sass721412914
JavaScript715465606
SVG41126
CSS2022

PHP code Passed 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
Great job! No cyclomatic complexity issues were detected in this plugin
Cyclomatic complexity
Average complexity per logical line of code0.32
Average class complexity11.56
▷ Minimum class complexity1.00
▷ Maximum class complexity58.00
Average method complexity2.68
▷ Minimum method complexity1.00
▷ Maximum method complexity18.00
Code structure
Namespaces1
Interfaces0
Traits0
Classes18
▷ Abstract classes00.00%
▷ Concrete classes18100.00%
▷ Final classes00.00%
Methods107
▷ Static methods8983.18%
▷ Public methods9891.59%
▷ Protected methods76.54%
▷ Private methods21.87%
Functions5
▷ Named functions120.00%
▷ Anonymous functions480.00%
Constants13
▷ Global constants13100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
9 PNG files occupy 0.01MB with 0.01MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
dist/alert.b2f9f8a3.png2.00KB0.26KB▼ 87.13%
dist/check.dbfc8dab.png0.56KB0.43KB▼ 22.28%
dist/alert.1d2502f3.png2.00KB0.26KB▼ 87.13%
dist/check.95ebae12.png0.56KB0.43KB▼ 22.28%
dist/success.03da78df.png2.33KB0.47KB▼ 79.78%