68% cookie-law-info

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

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

About plugin

  • Plugin page: cookie-law-info
  • Plugin version: 2.1.1
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.4.0-5.9
  • WordPress version: 5.9.2
  • First release: May 21, 2012
  • Latest release: Feb 17, 2022
  • Number of updates: 161
  • Update frequency: every 22.1 days
  • Top authors: webtoffee (49.07%)richardashby (36.02%)markwt (16.15%)

Code review

54 tests

User reviews

1796 reviews

Install metrics

1,000,000+ active / 14,812,651 total downloads

Benchmarks

Plugin footprint 65% 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: ▲1.44MB] [CPU: ▼280.91ms] Passed 4 tests

Server-side resources used by CookieYes | GDPR Cookie Consent & Compliance Notice (CCPA Ready)
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /5.17 ▲1.6691.93 ▲40.34
Dashboard /wp-admin4.83 ▲1.4246.67 ▲13.73
Posts /wp-admin/edit.php5.12 ▲1.4850.86 ▲12.85
Add New Post /wp-admin/post-new.php8.36 ▲1.39113.27 ▼1,159.11
Media Library /wp-admin/upload.php4.78 ▲1.4834.94 ▲8.90
Cookie List /wp-admin/edit.php?post_type=cookielawinfo5.0850.82
Settings /wp-admin/edit.php?post_type=cookielawinfo&page=cookie-law-info5.0239.21
Cookie Scanner /wp-admin/edit.php?post_type=cookielawinfo&page=cookie-law-info-cookie-scaner4.7540.29
Policy generator /wp-admin/edit.php?post_type=cookielawinfo&page=cookie-law-info-policy-generator4.8137.64
Privacy Overview /wp-admin/edit.php?post_type=cookielawinfo&page=cookie-law-info-poverview4.8139.26
Cookie Category /wp-admin/edit-tags.php?taxonomy=cookielawinfo-category&post_type=cookielawinfo4.8149.20
Script Blocker /wp-admin/edit.php?post_type=cookielawinfo&page=cli-script-settings4.8854.81

Server storage [IO: ▲1.08MB] [DB: ▲0.02MB] Passed 3 tests

A short overview of filesystem and database impact
There were no storage issued detected upon installing this plugin
Filesystem: 106 new files
Database: 5 new tables, 8 new options
New tables
wp_cli_cookie_scan_cookies
wp_cli_cookie_scan_url
wp_cli_cookie_scan
wp_cli_cookie_scan_categories
wp_cli_scripts
New WordPress options
cookielawinfo_js_blocking
CookieLawInfo-0.9
wt_cli_cookie_db_version
cookielawinfo_privacy_overview_content_settings
wt_cli_db_version
wt_cli_start_date
wt_cli_version
cli_script_blocker_status

Browser metrics Passed 4 tests

CookieYes | GDPR Cookie Consent & Compliance Notice (CCPA Ready): an overview of browser usage
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /4,467 ▲71416.26 ▲0.6136.82 ▲30.6549.12 ▲46.58
Dashboard /wp-admin2,951 ▲906.18 ▲0.03120.35 ▼14.53175.61 ▲11.53
Posts /wp-admin/edit.php2,716 ▲223.14 ▼0.1067.69 ▲3.91143.17 ▲6.06
Add New Post /wp-admin/post-new.php1,626 ▼6418.23 ▼2.24423.98 ▼44.17175.79 ▲11.79
Media Library /wp-admin/upload.php1,753 ▲555.50 ▼0.02128.35 ▼15.84203.67 ▲15.71
Cookie List /wp-admin/edit.php?post_type=cookielawinfo2,9583.5482.77135.88
Settings /wp-admin/edit.php?post_type=cookielawinfo&page=cookie-law-info9,3794.68168.03236.84
Cookie Scanner /wp-admin/edit.php?post_type=cookielawinfo&page=cookie-law-info-cookie-scaner1,1443.2161.2595.77
Policy generator /wp-admin/edit.php?post_type=cookielawinfo&page=cookie-law-info-policy-generator2,2678.99166.81213.05
Privacy Overview /wp-admin/edit.php?post_type=cookielawinfo&page=cookie-law-info-poverview2,0189.29157.46197.63
Cookie Category /wp-admin/edit-tags.php?taxonomy=cookielawinfo-category&post_type=cookielawinfo2,1442.6466.80148.90
Script Blocker /wp-admin/edit.php?post_type=cookielawinfo&page=cli-script-settings1,5333.2074.04160.23

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
It is recommended to fix the following
  • Zombie tables detected upon uninstall: 5 tables
    • wp_cli_cookie_scan_url
    • wp_cli_cookie_scan_categories
    • wp_cli_cookie_scan_cookies
    • wp_cli_scripts
    • wp_cli_cookie_scan
  • The uninstall procedure has failed, leaving 7 options in the database
    • wt_cli_version
    • wt_cli_db_version
    • cookielawinfo_privacy_overview_content_settings
    • cookielawinfo_js_blocking
    • CookieLawInfo-0.9
    • cli_script_blocker_status
    • wt_cli_cookie_db_version

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)
Even though everything seems fine, this is not an exhaustive test

SRP 0% from 2 tests

🔹 Tests weight: 20 | It is important to ensure that your PHP files perform no action when accessed directly, respecting the single-responsibility principle
The following issues need your attention
  • 5× PHP files perform the action of outputting non-empty strings when accessed directly:
    • > /wp-content/plugins/cookie-law-info/admin/modules/cli-policy-generator/data/data.block2.php
    • > /wp-content/plugins/cookie-law-info/admin/modules/cli-policy-generator/data/data.block4.php
    • > /wp-content/plugins/cookie-law-info/admin/modules/cli-policy-generator/data/data.block3.php
    • > /wp-content/plugins/cookie-law-info/admin/modules/cli-policy-generator/data/data.block1.php
    • > /wp-content/plugins/cookie-law-info/admin/modules/cli-policy-generator/data/data.block5.php
  • 4× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_url() in wp-content/plugins/cookie-law-info/admin/views/goto-pro-v2.php:50
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/cookie-law-info/includes/class-cookie-law-info-activator.php:39
    • > 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/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/public/views/cookie-law-info_popup_content.php:2

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% from 16 tests

Perhaps the most important file in your plugin readme.txt gets parsed in order to generate the public listing of your plugin
Attributes that require attention:
  • Tags: You are using too many tags: 15 tag instead of maximum 10
The official readme.txt might help

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

The primary PHP file in "CookieYes | GDPR Cookie Consent & Compliance Notice (CCPA Ready)" version 2.1.1 is used by WordPress to initiate all plugin functionality
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 | There should be no dangerous file extensions present in any WordPress plugin
Good job! No executable or dangerous file extensions detected16,715 lines of code in 84 files:
LanguageFilesBlank linesComment linesLines of code
PHP551,0602,1329,325
JavaScript9127823,137
CSS6247732,824
SVG13021,393
XML10036

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.40
Average class complexity50.43
▷ Minimum class complexity1.00
▷ Maximum class complexity158.00
Average method complexity3.90
▷ Minimum method complexity1.00
▷ Maximum method complexity69.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes23
▷ Abstract classes00.00%
▷ Concrete classes23100.00%
▷ Final classes00.00%
Methods393
▷ Static methods5413.74%
▷ Public methods35590.33%
▷ Protected methods102.54%
▷ Private methods287.12%
Functions11
▷ Named functions1090.91%
▷ Anonymous functions19.09%
Constants30
▷ Global constants1446.67%
▷ Class constants1653.33%
▷ Public constants16100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
12 PNG files occupy 0.08MB with 0.03MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
admin/modules/cookie-scaner/assets/images/screenshot-1.png60.56KB23.87KB▼ 60.59%
images/icon-256x256.png11.23KB5.01KB▼ 55.42%
images/overlay.png0.13KB0.34KB0.00%
admin/images/support.png4.64KB2.84KB▼ 38.75%
images/collapse.png0.70KB0.60KB▼ 14.33%