67% real-cookie-banner

Code Review | Real Cookie Banner: GDPR & ePrivacy Cookie Consent

WordPress plugin Real Cookie Banner: GDPR & ePrivacy Cookie Consent scored67%from 54 tests.

About plugin

  • Plugin page: real-cookie-banner
  • Plugin version: 4.1.2
  • PHP compatiblity: 7.4.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.8-6.4
  • WordPress version: 6.3.1
  • First release: Nov 17, 2020
  • Latest release: Nov 28, 2023
  • Number of updates: 152
  • Update frequency: every 7.7 days
  • Top authors: devowl (100%)

Code review

54 tests

User reviews

368 reviews

Install metrics

100,000+ active /6,898,176 total downloads

Benchmarks

Plugin footprint 64% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
Install script ran successfully

Server metrics [RAM: ▲8.69MB] [CPU: ▲58.91ms] 25% from 4 tests

A check of server-side resources used by Real Cookie Banner: GDPR & ePrivacy Cookie Consent
Please take the time to fix the following items
  • RAM: The total memory usage must be kept under 10MB (currently 12.12MB on /wp-admin/admin.php?page=real-cookie-banner-welcome)
  • CPU: Total CPU usage should be kept under 500.00ms (currently 549.44ms on /wp-admin/admin.php?page=real-cookie-banner-welcome)
  • Extra RAM: The extra memory usage must be under 5MB (currently 8.69MB on /wp-admin/admin.php?page=real-cookie-banner-welcome)
PageMemory (MB)CPU Time (ms)
Home /12.75 ▲9.2987.75 ▲46.21
Dashboard /wp-admin11.82 ▲8.52108.17 ▲60.37
Posts /wp-admin/edit.php11.92 ▲8.56119.66 ▲70.83
Add New Post /wp-admin/post-new.php15.02 ▲9.13165.66 ▲68.35
Media Library /wp-admin/upload.php11.77 ▲8.5496.46 ▲60.69
Real Cookie Banner (Free) /wp-admin/admin.php?page=real-cookie-banner-welcome12.12549.44

Server storage [IO: ▲11.33MB] [DB: ▲0.05MB] Passed 3 tests

A short overview of filesystem and database impact
This plugin was installed successfully
Filesystem: 946 new files
Database: 20 new tables, 233 new options
New tables
wp_rcb_tcf_purposes
wp_rcb_tcf_vendors
wp_rcb_scan
wp_rcb_tcf_special_features
wp_rcb_asset_seo_redirect
wp_rcb_scan_markup
wp_rcb_template_translation
wp_rcb_stats_custom_bypass
wp_rcb_tcf_features
wp_rcb_blocker_thumbnails
...
New WordPress options
rcb-group-desc-font-size
rcb-banner-body-design-btn-accept-essentials-border-width
rcb-banner-decision-show-groups
rpm-wpc-licenseDeferredLicenseActivation_real-cookie-banner-expire
rcb-banner-texts-accept-individual
rcb-banner-design-box-shadow-offset-x
rcb-banner-mobile-max-height
rcb-banner-layout-overlayBg
rcb-banner-layout-animation-out-duration
rcb-banner-design-border-width
...

Browser metrics Passed 4 tests

An overview of browser requirements for Real Cookie Banner: GDPR & ePrivacy Cookie Consent
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,076 ▲31415.49 ▲1.222.07 ▲0.3737.04 ▼6.55
Dashboard /wp-admin2,478 ▲3017.39 ▲1.84152.12 ▲51.3341.80 ▼4.88
Posts /wp-admin/edit.php2,353 ▲2533.82 ▲1.8189.80 ▲49.4552.83 ▲19.50
Add New Post /wp-admin/post-new.php1,599 ▲7223.18 ▲0.08719.56 ▲52.1228.41 ▼17.76
Media Library /wp-admin/upload.php1,721 ▲3245.74 ▲1.58145.81 ▲49.9546.22 ▲3.55
Real Cookie Banner (Free) /wp-admin/admin.php?page=real-cookie-banner-welcome1,8033.9376.1196.54

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
The following items require your attention
  • Zombie tables detected upon uninstall: 20 tables
    • wp_rcb_tcf_special_purposes
    • wp_rcb_tcf_features
    • wp_rcb_stats_buttons_clicked
    • wp_rcb_tcf_data_categories
    • wp_rcb_tcf_purposes
    • wp_real_queue
    • wp_rcb_scan
    • wp_rcb_template
    • wp_rcb_template_translation
    • wp_rcb_consent
    • ...
  • The uninstall procedure has failed, leaving 233 options in the database
    • rcb-banner-footer-design-font-inherit-family
    • rcb-banner-footer-design-font-color
    • rcb-group-link-hover-color
    • rcb-banner-decision-accept-essentials
    • rcb-banner-body-design-btn-accept-essentials-font-color
    • rcb-banner-body-design-btn-accept-individual-hover-bg
    • rcb-banner-layout-overlayBlur
    • rcb-banner-header-design-inherit-text-align
    • rcb-banner-layout-overlay
    • rcb-banner-design-font-weight
    • ...

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 | The single-responsibility principle: PHP files have to remain inert when accessed directly, throwing no errors and performing no actions
Almost there! Just fix the following items
  • 238× PHP files perform the action of outputting non-empty strings when accessed directly (only 10 are shown):
    • > /wp-content/plugins/real-cookie-banner/inc/comp/migration/DashboardTileMigrationMajor3.php
    • > /wp-content/plugins/real-cookie-banner/inc/view/shortcode/HistoryUuidsShortcode.php
    • > /wp-content/plugins/real-cookie-banner/inc/templates/StorageHelper.php
    • > /wp-content/plugins/real-cookie-banner/vendor/devowl-wp/real-utils/src/Assets.php
    • > /wp-content/plugins/real-cookie-banner/vendor/devowl-wp/utils/src/Assets.php
    • > /wp-content/plugins/real-cookie-banner/vendor/devowl-wp/freemium/src/Constants.php
    • > /wp-content/plugins/real-cookie-banner/vendor/devowl-wp/real-utils/src/RatingHandler.php
    • > /wp-content/plugins/real-cookie-banner/inc/settings/TCF.php
    • > /wp-content/plugins/real-cookie-banner/vendor/devowl-wp/multilingual/src/AbstractOutputBufferPlugin.php
    • > /wp-content/plugins/real-cookie-banner/inc/view/checklist/SaveSettings.php
  • 365× PHP files trigger server errors when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'DevOwl\\RealCookieBanner\\Vendor\\Embera\\Provider\\ProviderAdapter' not found in wp-content/plugins/real-cookie-banner/vendor/mpratt/embera/src/Embera/Provider/SmashNotes.php:23
    • > PHP Fatal error
      Uncaught Error: Class 'DevOwl\\RealCookieBanner\\Vendor\\DevOwl\\HeadlessContentBlocker\\AbstractPlugin' not found in wp-content/plugins/real-cookie-banner/vendor/devowl-wp/headless-content-blocker/src/plugins/selectorSyntaxFunction/KeepAttributes.php:20
    • > PHP Fatal error
      Uncaught Error: Class 'DevOwl\\RealCookieBanner\\Vendor\\DevOwl\\CacheInvalidate\\AbstractCache' not found in wp-content/plugins/real-cookie-banner/vendor/devowl-wp/cache-invalidate/src/caches/SGOptimizeImpl.php:13
    • > PHP Fatal error
      Uncaught Error: Class 'DevOwl\\RealCookieBanner\\Vendor\\Embera\\Provider\\ProviderAdapter' not found in wp-content/plugins/real-cookie-banner/vendor/mpratt/embera/src/Embera/Provider/Gong.php:23
    • > PHP Fatal error
      Uncaught Error: Class 'DevOwl\\RealCookieBanner\\Vendor\\Embera\\Provider\\ProviderAdapter' not found in wp-content/plugins/real-cookie-banner/vendor/mpratt/embera/src/Embera/Provider/KakaoTV.php:23
    • > PHP Fatal error
      Uncaught Error: Class 'DevOwl\\RealCookieBanner\\Vendor\\Embera\\Provider\\ProviderAdapter' not found in wp-content/plugins/real-cookie-banner/vendor/mpratt/embera/src/Embera/Provider/Tuxx.php:23
    • > PHP Fatal error
      Uncaught Error: Class 'DevOwl\\RealCookieBanner\\Vendor\\Embera\\Provider\\ProviderAdapter' not found in wp-content/plugins/real-cookie-banner/vendor/mpratt/embera/src/Embera/Provider/UpecPod.php:23
    • > PHP Fatal error
      Uncaught Error: Class 'DevOwl\\RealCookieBanner\\Vendor\\DevOwl\\CacheInvalidate\\AbstractCache' not found in wp-content/plugins/real-cookie-banner/vendor/devowl-wp/cache-invalidate/src/caches/LiteSpeedCacheImpl.php:14
    • > PHP Fatal error
      Uncaught Error: Class 'DevOwl\\RealCookieBanner\\Vendor\\Embera\\Provider\\ProviderAdapter' not found in wp-content/plugins/real-cookie-banner/vendor/mpratt/embera/src/Embera/Provider/Libsyn.php:22
    • > PHP Fatal error
      Uncaught Error: Class 'DevOwl\\RealCookieBanner\\Vendor\\Embera\\Provider\\ProviderAdapter' not found in wp-content/plugins/real-cookie-banner/vendor/mpratt/embera/src/Embera/Provider/Kmdr.php:23

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
No browser errors were detected

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is an important file in your plugin as it is parsed by WordPress.org to prepare the public listing of your plugin
Please fix the following attributes:
  • Tags: There are too many tags (13 tag instead of maximum 10)
You can take inspiration from this readme.txt

real-cookie-banner/index.php 85% from 13 tests

"Real Cookie Banner: GDPR & ePrivacy Cookie Consent" version 4.1.2's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
Please take the time to fix the following:
  • Description: The description should be shorter than 140 characters (currently 173 characters long)
  • Main file name: The principal plugin file should be the same as the plugin slug ("real-cookie-banner.php" instead of "index.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | An overview of files in this plugin; executable files are not allowed
Good job! No executable or dangerous file extensions detected69,516 lines of code in 831 files:
LanguageFilesBlank linesComment linesLines of code
PHP7021,49929,90643,555
JSON190014,864
Markdown155,108010,208
C111724665
XML24481
JavaScript65410769
m418032
CSS1101220
SVG140014
C/C++ Header14128

PHP code Passed 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
No cyclomatic complexity issues were detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.32
Average class complexity8.64
▷ Minimum class complexity1.00
▷ Maximum class complexity112.00
Average method complexity2.33
▷ Minimum method complexity1.00
▷ Maximum method complexity47.00
Code structure
Namespaces86
Interfaces17
Traits35
Classes619
▷ Abstract classes396.30%
▷ Concrete classes58093.70%
▷ Final classes30.52%
Methods3,660
▷ Static methods3288.96%
▷ Public methods3,27589.48%
▷ Protected methods2607.10%
▷ Private methods1253.42%
Functions283
▷ Named functions134.59%
▷ Anonymous functions27095.41%
Constants1,185
▷ Global constants574.81%
▷ Class constants1,12895.19%
▷ Public constants1,11298.58%

Plugin size Passed 2 tests

Image compression Passed 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
1 compressed PNG file occupies 0.00MB
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
public/images/dummy.png0.07KB0.09KB0.00%