78% cookie-dough-compliance-and-consent-for-gdpr

Code Review | Cookie Dough Compliance and Consent for GDPR

WordPress plugin Cookie Dough Compliance and Consent for GDPR scored78%from 54 tests.

About plugin

  • Plugin page: cookie-dough-comp...
  • Plugin version: 2.2.2
  • PHP compatiblity: 7.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0.0-6.3.1
  • WordPress version: 6.3.1
  • First release: Oct 31, 2022
  • Latest release: Nov 29, 2023
  • Number of updates: 31
  • Update frequency: every 12.8 days
  • Top authors: ludwigyou (100%)

Code review

54 tests

User reviews

2 reviews

Install metrics

100+ active /1,634 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 gracefully, with no errors

Server metrics [RAM: ▲0.53MB] [CPU: ▼0.58ms] Passed 4 tests

A check of server-side resources used by Cookie Dough Compliance and Consent for GDPR
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /4.08 ▲0.6246.13 ▲9.68
Dashboard /wp-admin3.83 ▲0.4847.77 ▼11.23
Posts /wp-admin/edit.php3.94 ▲0.5847.56 ▲1.96
Add New Post /wp-admin/post-new.php6.41 ▲0.5297.58 ▲2.77
Media Library /wp-admin/upload.php3.75 ▲0.5236.37 ▲4.17

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

A short overview of filesystem and database impact
There were no storage issued detected upon installing this plugin
Filesystem: 88 new files
Database: no new tables, 7 new options
New WordPress options
widget_recent-comments
widget_theysaidso_widget
widget_recent-posts
cookie-dough-consent-settings
can_compress_scripts
theysaidso_admin_options
db_upgraded

Browser metrics Passed 4 tests

A check of browser resources used by Cookie Dough Compliance and Consent for GDPR
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,987 ▲24014.23 ▼0.452.64 ▲0.9661.56 ▲25.07
Dashboard /wp-admin2,212 ▲315.56 ▼0.1294.14 ▼18.3177.92 ▲31.41
Posts /wp-admin/edit.php2,120 ▲171.95 ▼0.0640.04 ▲1.8735.62 ▼1.39
Add New Post /wp-admin/post-new.php1,542 ▲1621.19 ▼1.87661.76 ▲14.4653.34 ▼3.02
Media Library /wp-admin/upload.php1,414 ▲174.19 ▼0.0294.67 ▼8.1163.51 ▲20.86

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
These items require your attention
  • This plugin did not uninstall successfully, leaving 7 options in the database
    • widget_recent-posts
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • can_compress_scripts
    • cookie-dough-consent-settings
    • widget_recent-comments
    • db_upgraded

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
Please fix the following items
  • 5× PHP files perform the action of outputting non-empty strings when accessed directly:
    • > /wp-content/plugins/cookie-dough-compliance-and-consent-for-gdpr/public/templates/components/cookie-step-optional-line.php
    • > /wp-content/plugins/cookie-dough-compliance-and-consent-for-gdpr/admin/templates/options/components/link-repeater-line.php
    • > /wp-content/plugins/cookie-dough-compliance-and-consent-for-gdpr/public/templates/components/cookie-step-mandatory-line.php
    • > /wp-content/plugins/cookie-dough-compliance-and-consent-for-gdpr/admin/templates/options/components/cookie-settings-line.php
    • > /wp-content/plugins/cookie-dough-compliance-and-consent-for-gdpr/admin/templates/popup/steps/step-01.php
  • 50× GET requests to PHP files trigger server-side errors or Error 500 responses (only 10 are shown):
    • > PHP Warning
      include(): Failed opening 'COOKIE_DOUGH_CONSENT_PLUGIN_PATHadmin/templates/options/components/input-search.php' for inclusion (include_path='.:/usr/share/php') in wp-content/plugins/cookie-dough-compliance-and-consent-for-gdpr/admin/templates/popup/steps/step-01.php on line 17
    • > PHP Notice
      Undefined variable: slider_max in wp-content/plugins/cookie-dough-compliance-and-consent-for-gdpr/admin/templates/options/components/slider.php on line 16
    • > PHP Fatal error
      Uncaught Error: Call to undefined function __() in wp-content/plugins/cookie-dough-compliance-and-consent-for-gdpr/admin/templates/options/option-advanced-settings.php:15
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html_e() in wp-content/plugins/cookie-dough-compliance-and-consent-for-gdpr/admin/templates/options/components/cookie-settings.php:22
    • > PHP Warning
      Use of undefined constant COOKIE_DOUGH_CONSENT_PLUGIN_PATH - assumed 'COOKIE_DOUGH_CONSENT_PLUGIN_PATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/cookie-dough-compliance-and-consent-for-gdpr/admin/templates/popup/steps/step-01.php on line 17
    • > PHP Notice
      Undefined variable: slider_step in wp-content/plugins/cookie-dough-compliance-and-consent-for-gdpr/admin/templates/options/components/slider.php on line 17
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_attr() in wp-content/plugins/cookie-dough-compliance-and-consent-for-gdpr/admin/templates/options/components/alignment.php:16
    • > PHP Fatal error
      Uncaught Error: Call to undefined function cdc_cookie_default_values() in wp-content/plugins/cookie-dough-compliance-and-consent-for-gdpr/admin/templates/preview/demo.php:13
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html_e() in wp-content/plugins/cookie-dough-compliance-and-consent-for-gdpr/admin/templates/options/components/color.php:17
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/cookie-dough-compliance-and-consent-for-gdpr/admin/templates/custom-settings-page.php:25

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
No browser errors were detected

Optimizations

Plugin configuration 93% from 29 tests

readme.txt Passed 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
7 plugin tags: consent, rgpd, modal, gdpr, cookies...

cookie-dough-compliance-and-consent-for-gdpr/cookie-dough-consent.php 85% from 13 tests

The entry point to "Cookie Dough Compliance and Consent for GDPR" version 2.2.2 is a PHP file that has certain tags in its header comment area
It is important to fix the following:
  • Main file name: Name the main plugin file the same as the plugin slug ("cookie-dough-compliance-and-consent-for-gdpr.php" instead of "cookie-dough-consent.php")
  • Text Domain: The text domain is optional since WordPress version 4.6; if you do specify it, 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 considered dangerous and should not be included with any WordPress plugin
Success! There were no dangerous files found in this plugin8,978 lines of code in 75 files:
LanguageFilesBlank linesComment linesLines of code
PHP497708944,369
CSS545463,265
PO File12933631,091
JavaScript672158210
SVG140043

PHP code Passed 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.39
Average class complexity18.25
▷ Minimum class complexity1.00
▷ Maximum class complexity57.00
Average method complexity4.07
▷ Minimum method complexity1.00
▷ Maximum method complexity48.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes8
▷ Abstract classes00.00%
▷ Concrete classes8100.00%
▷ Final classes00.00%
Methods45
▷ Static methods24.44%
▷ Public methods3884.44%
▷ Protected methods00.00%
▷ Private methods715.56%
Functions7
▷ Named functions7100.00%
▷ Anonymous functions00.00%
Constants5
▷ Global constants5100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
No PNG files were detected