89% cookie-notice

Code Review | Cookie Notice & Compliance for GDPR / CCPA

WordPress plugin Cookie Notice & Compliance for GDPR / CCPA scored89%from 54 tests.

About plugin

  • Plugin page: cookie-notice
  • Plugin version: 2.4.13
  • PHP compatiblity: 7.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.9.6-6.4.1
  • WordPress version: 6.3.1
  • First release: Jul 8, 2013
  • Latest release: Nov 28, 2023
  • Number of updates: 200
  • Update frequency: every 19.0 days
  • Top authors: dfactory (100%)

Code review

54 tests

User reviews

2963 reviews

Install metrics

1,000,000+ active /26,347,287 total downloads

Benchmarks

Plugin footprint 83% 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 gracefully, with no errors

Server metrics [RAM: ▲1.35MB] [CPU: ▲4.16ms] Passed 4 tests

An overview of server-side resources used by Cookie Notice & Compliance for GDPR / CCPA
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /4.81 ▲1.3448.09 ▲6.92
Dashboard /wp-admin4.67 ▲1.3258.44 ▼5.13
Posts /wp-admin/edit.php4.72 ▲1.3658.55 ▲10.85
Add New Post /wp-admin/post-new.php7.27 ▲1.3894.92 ▲3.99
Media Library /wp-admin/upload.php4.59 ▲1.3643.71 ▲11.92
Consent Logs /wp-admin/admin.php?page=cookie-notice&tab=consent-logs4.5141.87
Settings /wp-admin/admin.php?page=cookie-notice4.5845.46

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

Analyzing filesystem and database footprints of this plugin
This plugin was installed successfully
Filesystem: 75 new files
Database: no new tables, 6 new options
New WordPress options
can_compress_scripts
widget_recent-comments
theysaidso_admin_options
widget_recent-posts
db_upgraded
widget_theysaidso_widget

Browser metrics Passed 4 tests

A check of browser resources used by Cookie Notice & Compliance for GDPR / CCPA
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,928 ▲19214.33 ▲0.101.47 ▼0.1837.38 ▼7.62
Dashboard /wp-admin2,333 ▲1635.70 ▲0.0299.71 ▲0.1390.21 ▲47.75
Posts /wp-admin/edit.php2,175 ▲752.14 ▲0.1741.19 ▲6.4435.57 ▲2.33
Add New Post /wp-admin/post-new.php1,581 ▲5523.43 ▲0.23672.61 ▲48.2954.21 ▲6.13
Media Library /wp-admin/upload.php1,478 ▲814.32 ▲0.1599.39 ▲2.9444.86 ▲4.48
Consent Logs /wp-admin/admin.php?page=cookie-notice&tab=consent-logs1,0472.8053.2735.53
Settings /wp-admin/admin.php?page=cookie-notice2,1743.3679.2044.65

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
  • Zombie WordPress options detected upon uninstall: 6 options
    • widget_recent-posts
    • db_upgraded
    • theysaidso_admin_options
    • widget_recent-comments
    • can_compress_scripts
    • widget_theysaidso_widget

Smoke tests Passed 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
The smoke test was a success, however most plugin functionality was not tested

SRP Passed 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
No output text or server-side errors detected on direct access of PHP files

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 issues were found

Optimizations

Plugin configuration 96% 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
6 plugin tags: privacy, consent, ccpa, gdpr, compliance...

cookie-notice/cookie-notice.php 92% from 13 tests

The main PHP script in "Cookie Notice & Compliance for GDPR / CCPA" version 2.4.13 is automatically included on every request by WordPress
Please make the necessary changes and fix the following:
  • Description: Keep the plugin description shorter than 140 characters (currently 148 characters long)

Code Analysis 97% from 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is a short overview of programming languages used in this plugin, detecting executable files
Success! There were no dangerous files found in this plugin13,535 lines of code in 59 files:
LanguageFilesBlank linesComment linesLines of code
PHP221,3132,0896,814
CSS146631093,641
JavaScript167575922,590
Sass14426485
SVG5005
HTML1010

PHP code 50% from 2 tests

Analyzing cyclomatic complexity and code structure
It is recommended to fix the following
  • Please reduce cyclomatic complexity of methods to less than 100 (currently 151)
Cyclomatic complexity
Average complexity per logical line of code0.56
Average class complexity51.65
▷ Minimum class complexity1.00
▷ Maximum class complexity244.00
Average method complexity5.82
▷ Minimum method complexity1.00
▷ Maximum method complexity151.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes20
▷ Abstract classes00.00%
▷ Concrete classes20100.00%
▷ Final classes00.00%
Methods210
▷ Static methods31.43%
▷ Public methods20195.71%
▷ Protected methods10.48%
▷ Private methods83.81%
Functions5
▷ Named functions5100.00%
▷ Anonymous functions00.00%
Constants4
▷ Global constants4100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
14 PNG files occupy 0.91MB with 0.57MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
img/screen-compliance.png408.78KB134.11KB▼ 67.19%
img/layout-left.png2.33KB0.49KB▼ 79.00%
img/layout-bottom.png2.35KB0.47KB▼ 80.06%
img/screen-notice.png292.39KB90.98KB▼ 68.89%
img/consent-logs.png180.79KB142.13KB▼ 21.39%