68% cookie-law-info

Code Review | CookieYes | GDPR Cookie Consent & Compliance Notice (CCPA Ready)

WordPress plugin CookieYes | GDPR Cookie Consent & Compliance Notice (CCPA Ready) scored68%from 54 tests.

About plugin

  • Plugin page: cookie-law-info
  • Plugin version: 3.1.7
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.0.0-6.4
  • WordPress version: 6.3.1
  • First release: May 21, 2012
  • Latest release: Nov 16, 2023
  • Number of updates: 183
  • Update frequency: every 22.9 days
  • Top authors: webtoffee (45.9%)richardashby (31.69%)markwt (14.21%)cookieyesdev (9.84%)

Code review

54 tests

User reviews

2548 reviews

Install metrics

1,000,000+ active /25,565,744 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
Install script ran successfully

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

This is a short check of server-side resources used by CookieYes | GDPR Cookie Consent & Compliance Notice (CCPA Ready)
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /6.16 ▲2.7078.64 ▲39.09
Dashboard /wp-admin4.99 ▲1.6956.67 ▲9.09
Posts /wp-admin/edit.php5.04 ▲1.6961.37 ▲14.64
Add New Post /wp-admin/post-new.php7.68 ▲1.79101.42 ▲3.34
Media Library /wp-admin/upload.php4.85 ▲1.6251.49 ▲21.36

Server storage [IO: ▲4.25MB] [DB: ▲0.09MB] Passed 3 tests

How much does this plugin use your filesystem and database?
This plugin installed successfully
Filesystem: 274 new files
Database: 3 new tables, 14 new options
New tables
wp_cky_cookies
wp_cky_banners
wp_cky_cookie_categories
New WordPress options
can_compress_scripts
db_upgraded
widget_recent-posts
wt_cli_version
cky_banners_table_version
cky_cookie_table_version
cky_cookie_consent_lite_db_version
widget_theysaidso_widget
theysaidso_admin_options
cky_settings
...

Browser metrics Passed 4 tests

A check of browser resources used by CookieYes | GDPR Cookie Consent & Compliance Notice (CCPA Ready)
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,415 ▲65313.15 ▼1.2016.65 ▲14.8853.61 ▲7.61
Dashboard /wp-admin2,244 ▲645.52 ▼0.1391.02 ▼1.1440.47 ▼2.62
Posts /wp-admin/edit.php2,153 ▲562.01 ▲0.0639.58 ▲0.2333.25 ▼1.71
Add New Post /wp-admin/post-new.php1,539 ▲923.26 ▲0.14672.76 ▼20.0256.02 ▲1.79
Media Library /wp-admin/upload.php1,453 ▲564.17 ▼0.04100.07 ▼0.3445.68 ▲3.47

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
Please fix the following items
  • The uninstall procedure failed, leaving 3 tables in the database
    • wp_cky_cookies
    • wp_cky_banners
    • wp_cky_cookie_categories
  • Zombie WordPress options were found after uninstall: 14 options
    • widget_theysaidso_widget
    • widget_recent-comments
    • cky_cookie_table_version
    • widget_recent-posts
    • can_compress_scripts
    • theysaidso_admin_options
    • cky_banner_template
    • cky_settings
    • cky_banners_table_version
    • cky_cookie_category_table_version
    • ...

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 | The single-responsibility principle: PHP files have to remain inert when accessed directly, throwing no errors and performing no actions
The following issues need your attention
  • 5× PHP files perform the task of outputting text when accessed with GET requests:
    • > /wp-content/plugins/cookie-law-info/legacy/admin/modules/cli-policy-generator/data/data.block5.php
    • > /wp-content/plugins/cookie-law-info/legacy/admin/modules/cli-policy-generator/data/data.block4.php
    • > /wp-content/plugins/cookie-law-info/legacy/admin/modules/cli-policy-generator/data/data.block2.php
    • > /wp-content/plugins/cookie-law-info/legacy/admin/modules/cli-policy-generator/data/data.block1.php
    • > /wp-content/plugins/cookie-law-info/legacy/admin/modules/cli-policy-generator/data/data.block3.php
  • 6× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_url() in wp-content/plugins/cookie-law-info/legacy/loader.php:14
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_url() in wp-content/plugins/cookie-law-info/lite/loader.php:14
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/cookie-law-info/legacy/includes/class-cookie-law-info-activator.php:39
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_url() in wp-content/plugins/cookie-law-info/legacy/admin/views/goto-pro-v2.php:50
    • > PHP Warning
      Use of undefined constant CLI_PLUGIN_URL - assumed 'CLI_PLUGIN_URL' (this will throw an Error in a future version of PHP) in wp-content/plugins/cookie-law-info/legacy/admin/views/goto-pro-v2.php on line 1
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/cookie-law-info/legacy/public/views/cookie-law-info_popup_content.php:2

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

readme.txt 94% from 16 tests

The readme.txt file describes your plugin functionality and requirements and it is parsed to prepare the your plugin's listing
Please fix the following attributes:
  • Tags: You are using too many tags: 18 tag instead of maximum 10
The official readme.txt is a good inspiration

cookie-law-info/cookie-law-info.php Passed 13 tests

"CookieYes | GDPR Cookie Consent & Compliance Notice (CCPA Ready)" version 3.1.7's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
73 characters long description:
A simple way to show your website complies with the EU Cookie Law / GDPR.

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
Good job! No executable or dangerous file extensions detected60,987 lines of code in 243 files:
LanguageFilesBlank linesComment linesLines of code
JSON290034,277
PHP1262,2687,38917,582
JavaScript231972304,269
CSS14247732,832
SVG49341,990
XML10036
HTML1001

PHP code Passed 2 tests

This plugin's cyclomatic complexity and code structure detailed below
This plugin has no cyclomatic complexity problems
Cyclomatic complexity
Average complexity per logical line of code0.43
Average class complexity25.13
▷ Minimum class complexity1.00
▷ Maximum class complexity160.00
Average method complexity3.15
▷ Minimum method complexity1.00
▷ Maximum method complexity69.00
Code structure
Namespaces34
Interfaces0
Traits0
Classes89
▷ Abstract classes910.11%
▷ Concrete classes8089.89%
▷ Final classes00.00%
Methods1,011
▷ Static methods10310.19%
▷ Public methods91490.41%
▷ Protected methods565.54%
▷ Private methods414.06%
Functions52
▷ Named functions4688.46%
▷ Anonymous functions611.54%
Constants38
▷ Global constants2155.26%
▷ Class constants1744.74%
▷ Public constants17100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
13 PNG files occupy 0.09MB with 0.02MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
legacy/images/favicon.png1.32KB0.57KB▼ 57.10%
legacy/images/overlay.png0.13KB0.34KB0.00%
legacy/admin/images/documentation.png1.20KB0.77KB▼ 35.93%
legacy/images/collapse.png0.70KB0.60KB▼ 14.33%
legacy/images/expand.png0.66KB0.61KB▼ 8.68%