62% gdpr-cookie-consent

Code Review | WP Cookie Consent ( for GDPR, CCPA & ePrivacy )

WordPress plugin WP Cookie Consent ( for GDPR, CCPA & ePrivacy ) scored62%from 54 tests.

About plugin

Code review

54 tests

User reviews

39 reviews

Install metrics

9,000+ active /173,873 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲1.57MB] [CPU: ▲14.14ms] Passed 4 tests

Server-side resources used by WP Cookie Consent ( for GDPR, CCPA & ePrivacy )
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /6.29 ▲2.8374.77 ▲35.49
Dashboard /wp-admin4.86 ▲1.5662.65 ▲12.82
Posts /wp-admin/edit.php4.98 ▲1.6262.22 ▲19.95
Add New Post /wp-admin/post-new.php7.45 ▲1.56102.85 ▲8.89
Media Library /wp-admin/upload.php4.77 ▲1.5449.92 ▲14.88
Import Policies /wp-admin/admin.php?page=gdpr-policies-import4.7647.84
Dashboard /wp-admin/admin.php?page=gdpr-cookie-consent4.9248.15
Wizard /wp-admin/admin.php?page=gdpr-cookie-consent-wizard5.5953.10
Policy Data /wp-admin/edit.php?post_type=gdprpolicies4.8448.80
Cookie Settings /wp-admin/admin.php?page=gdpr-cookie-consent-settings5.3951.78

Server storage [IO: ▲13.02MB] [DB: ▲0.01MB] Passed 3 tests

How much does this plugin use your filesystem and database?
The plugin installed successfully
Filesystem: 1,261 new files
Database: 2 new tables, 11 new options
New tables
wp_gdpr_cookie_post_cookies
wp_gdpr_cookie_scan_categories
New WordPress options
db_upgraded
theysaidso_admin_options
gdpr_version_number
widget_theysaidso_widget
can_compress_scripts
GDPRCookieConsent-9.0
widget_recent-comments
widget_recent-posts
gdpr_public_modules
analytics_activation_redirect_gdpr-cookie-consent
...

Browser metrics Passed 4 tests

WP Cookie Consent ( for GDPR, CCPA & ePrivacy ): an overview of browser usage
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,308 ▲54615.33 ▲0.6224.47 ▲22.5857.04 ▲8.81
Dashboard /wp-admin2,352 ▲1726.14 ▲0.50105.34 ▲16.8384.50 ▲44.84
Posts /wp-admin/edit.php2,298 ▲1983.34 ▲1.1953.44 ▲17.1365.69 ▲33.16
Add New Post /wp-admin/post-new.php6,387 ▲4,86127.53 ▲4.59900.70 ▲276.7038.23 ▼10.37
Media Library /wp-admin/upload.php1,429 ▲354.01 ▼0.2881.05 ▼13.9482.11 ▲39.35
Import Policies /wp-admin/admin.php?page=gdpr-policies-import1,0292.9641.6059.41
Dashboard /wp-admin/admin.php?page=gdpr-cookie-consent2,1737.85225.03129.92
Wizard /wp-admin/admin.php?page=gdpr-cookie-consent-wizard3,99912.40328.18147.36
Policy Data /wp-admin/edit.php?post_type=gdprpolicies1,2763.3350.6677.93
Cookie Settings /wp-admin/admin.php?page=gdpr-cookie-consent-settings8,70217.92498.52111.42

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
You still need to fix the following
  • Zombie tables detected upon uninstall: 2 tables
    • wp_gdpr_cookie_scan_categories
    • wp_gdpr_cookie_post_cookies
  • Zombie WordPress options detected upon uninstall: 11 options
    • analytics_activation_redirect_gdpr-cookie-consent
    • widget_recent-comments
    • theysaidso_admin_options
    • gdpr_version_number
    • can_compress_scripts
    • gdpr_public_modules
    • widget_recent-posts
    • GDPRCookieConsent-9.0
    • gdpr_admin_modules
    • db_upgraded
    • ...

Smoke tests 25% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Good news, no errors were detected

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
Please fix the following items
  • 2× GET requests to PHP files return non-empty strings:
    • > /wp-content/plugins/gdpr-cookie-consent/vendor/timber/timber/tests/bootstrap.php
    • > /wp-content/plugins/gdpr-cookie-consent/vendor/timber/timber/tests/assets/my-sidebar.php
  • 465× PHP files trigger server-side errors or warnings when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'Twig\ode\\IncludeNode' not found in wp-content/plugins/gdpr-cookie-consent/vendor/twig/twig/src/Node/EmbedNode.php:23
    • > PHP Fatal error
      Uncaught Error: Class 'Symfony\\Component\\CssSelector\\Tests\\Parser\\Handler\\AbstractHandlerTest' not found in wp-content/plugins/gdpr-cookie-consent/vendor/symfony/css-selector/Tests/Parser/Handler/CommentHandlerTest.php:19
    • > PHP Fatal error
      Uncaught Error: Class 'Twig\\Error\\Error' not found in wp-content/plugins/gdpr-cookie-consent/vendor/twig/twig/src/Error/SyntaxError.php:20
    • > PHP Fatal error
      Uncaught Error: Interface 'Twig\\Loader\\LoaderInterface' not found in wp-content/plugins/gdpr-cookie-consent/vendor/twig/twig/src/Loader/ChainLoader.php:21
    • > PHP Fatal error
      Uncaught Error: Interface 'DeepCopy\\Matcher\\Matcher' not found in wp-content/plugins/gdpr-cookie-consent/vendor/myclabs/deep-copy/src/DeepCopy/Matcher/PropertyTypeMatcher.php:16
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit\\Framework\\TestCase' not found in wp-content/plugins/gdpr-cookie-consent/vendor/symfony/css-selector/Tests/Parser/ReaderTest.php:17
    • > PHP Fatal error
      Uncaught Error: Interface 'Twig\odeVisitor\odeVisitorInterface' not found in wp-content/plugins/gdpr-cookie-consent/vendor/twig/twig/src/NodeVisitor/AbstractNodeVisitor.php:24
    • > PHP Fatal error
      Uncaught Error: Class 'Timber_UnitTestCase' not found in wp-content/plugins/gdpr-cookie-consent/vendor/timber/timber/tests/test-timber-gettext.php:3
    • > PHP Fatal error
      Uncaught Error: Class 'Symfony\\Component\\CssSelector\\Tests\\Parser\\Handler\\AbstractHandlerTest' not found in wp-content/plugins/gdpr-cookie-consent/vendor/symfony/css-selector/Tests/Parser/Handler/StringHandlerTest.php:19
    • > PHP Fatal error
      Uncaught Error: Class 'DeepCopy\\f008\\A' not found in wp-content/plugins/gdpr-cookie-consent/vendor/myclabs/deep-copy/fixtures/f008/B.php:5

User-side errors 0% from 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
Please fix the following browser errors
    • > GET request to /wp-admin/admin.php?page=gdpr-cookie-consent-wizard
    • > Console-api (severe) in unknown
    /wp-content/plugins/gdpr-cookie-consent/admin/js/vue/gdpr-cookie-consent-admin-main.js?ver=2.3.9 1:2177368 Error: ace.edit can't find div #aceEditorFreeat ace.define.t.edit (/wp-content/plugins/gdpr-cookie-consent/admin/js/vue/gdpr-cookie-consent-admin-main.js?ver=2.3.9:2:646345)at Gr.mounted (/wp-content/plugins/gdpr-cookie-consent/admin/js/vue/gdpr-cookie-consent-admin-main.js?ver=2.3.9:2:2421699)at Yt (/wp-content/plugins/gdpr-cookie-consent/admin/js/vue/gdpr-cookie-consent-admin-main.js?ver=2.3.9:2:2177047)at $t (/wp-content/plugins/gdpr-cookie-consent/admin/js/vue/gdpr-cookie-consent-admin-main.js?ver=2.3.9:2:2175935)at /wp-content/plugins/gdpr-cookie-consent/admin/js/vue/gdpr-cookie-consent-admin-main.js?ver=2.3.9:2:2232060at Gr.$mount (/wp-content/plugins/gdpr-cookie-consent/admin/js/vue/gdpr-cookie-consent-admin-main.js?ver=2.3.9:2:2232079)at Gr.$mount (/wp-content/plugins/gdpr-cookie-consent/admin/js/vue/gdpr-cookie-consent-admin-main.js?ver=2.3.9:2:2259339)at t._init (/wp-content/plugins/gdpr-cookie-consent/admin/js/vue/gdpr-cookie-consent-admin-main.js?ver=2.3.9:2:2194889)at new Gr (/wp-content/plugins/gdpr-cookie-consent/admin/js/vue/gdpr-cookie-consent-admin-main.js?ver=2.3.9:2:2192521)at /wp-content/plugins/gdpr-cookie-consent/admin/js/vue/gdpr-cookie-consent-admin-main.js?ver=2.3.9:2:2345186

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
These attributes need your attention:
  • Tags: You are using too many tags: 19 tag instead of maximum 10
You can take inspiration from this readme.txt

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

This is the main PHP file of "WP Cookie Consent ( for GDPR, CCPA & ePrivacy )" version 2.3.9, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
140 characters long description:
Cookie Consent will help you put up a subtle banner in the footer of your website to showcase compliance status regarding the EU Cookie law.

Code Analysis 97% from 3 tests

File types Passed 1 test

🔸 Test weight: 35 | An overview of files in this plugin; executable files are not allowed
Everything looks great! No dangerous files found in this plugin102,626 lines of code in 1,129 files:
LanguageFilesBlank linesComment linesLines of code
PHP8379,39417,87457,501
JavaScript212,4773,12218,803
PO File112,5983,9366,843
CSS114061185,660
JSON15304,221
Markdown461,73504,188
reStructuredText1142,4912,4742,959
Twig511301,389
HTML200356
XML122252351
Bourne Shell45819332
SVG50023

PHP code 50% from 2 tests

An overview of cyclomatic complexity and code structure
The following items need your attention
  • Cyclomatic complexity of methods should be reduced to less than 100 (currently 303)
Cyclomatic complexity
Average complexity per logical line of code0.27
Average class complexity6.17
▷ Minimum class complexity1.00
▷ Maximum class complexity496.00
Average method complexity2.30
▷ Minimum method complexity1.00
▷ Maximum method complexity303.00
Code structure
Namespaces82
Interfaces31
Traits33
Classes740
▷ Abstract classes212.84%
▷ Concrete classes71997.16%
▷ Final classes537.37%
Methods3,267
▷ Static methods43813.41%
▷ Public methods2,93489.81%
▷ Protected methods2186.67%
▷ Private methods1153.52%
Functions257
▷ Named functions11946.30%
▷ Anonymous functions13853.70%
Constants105
▷ Global constants2120.00%
▷ Class constants8480.00%
▷ Public constants84100.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
76 PNG files occupy 0.32MB with 0.14MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
admin/images/dashboard-icons/summary/next-scan.png0.69KB0.45KB▼ 34.42%
admin/js/vue/14ce045648bca89e5cf98a4507d2380d.png0.60KB0.33KB▼ 44.32%
admin/images/tick.png0.70KB0.43KB▼ 37.78%
admin/js/vue/c626db757429d64e1491d3a30cdbd2f9.png1.86KB1.13KB▼ 39.21%
admin/js/vue/2e395b177a3d703290d8b03d1d0ea62e.png16.43KB6.74KB▼ 58.96%