90% cookie-notice-consent

Code Review | Cookie Notice & Consent

WordPress plugin Cookie Notice & Consent scored90%from 54 tests.

About plugin

  • Plugin page: cookie-notice-con...
  • Plugin version: 1.6.1
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.0-6.3
  • WordPress version: 6.3.1
  • First release: Feb 9, 2021
  • Latest release: Aug 29, 2023
  • Number of updates: 26
  • Update frequency: every 35.8 days
  • Top authors: christophrado (100%)

Code review

54 tests

User reviews

5 reviews

Install metrics

700+ active /4,777 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.09MB] [CPU: ▼2.33ms] Passed 4 tests

Server-side resources used by Cookie Notice & Consent
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.54 ▲0.0841.17 ▼0.83
Dashboard /wp-admin3.40 ▲0.1048.71 ▼2.88
Posts /wp-admin/edit.php3.45 ▲0.1047.12 ▼1.00
Add New Post /wp-admin/post-new.php5.98 ▲0.1094.34 ▼4.38
Media Library /wp-admin/upload.php3.33 ▲0.1037.50 ▼1.04
Cookies /wp-admin/options-general.php?page=cookie-notice-consent3.2932.45
Cookie Consents /wp-admin/edit.php?post_type=cookie_consent3.3836.66

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

Analyzing filesystem and database footprints of this plugin
There were no storage issued detected upon installing this plugin
Filesystem: 28 new files
Database: no new tables, 12 new options
New WordPress options
cookie_notice_consent_category_marketing
cookie_notice_consent_category_functional
widget_recent-comments
cookie_notice_consent_consent_settings
theysaidso_admin_options
db_upgraded
can_compress_scripts
cookie_notice_consent_category_essential
widget_recent-posts
cookie_notice_consent_design_settings
...

Browser metrics Passed 4 tests

An overview of browser requirements for Cookie Notice & Consent
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,860 ▲11413.27 ▼1.116.29 ▲4.5947.23 ▲2.69
Dashboard /wp-admin2,214 ▲235.79 ▲0.91103.30 ▼2.6939.51 ▼7.96
Posts /wp-admin/edit.php2,097 ▲82.03 ▲0.0239.38 ▲1.0534.47 ▲0.48
Add New Post /wp-admin/post-new.php1,543 ▲2423.23 ▲2.18688.29 ▼24.4757.60 ▲5.92
Media Library /wp-admin/upload.php1,399 ▲114.20 ▲0.0097.36 ▼13.9741.71 ▼5.17
Cookies /wp-admin/options-general.php?page=cookie-notice-consent1,0012.0139.2027.70
Cookie Consents /wp-admin/edit.php?post_type=cookie_consent1,0771.9339.8929.72

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
You still need to fix the following
  • This plugin did not uninstall successfully, leaving 12 options in the database
    • widget_recent-comments
    • cookie_notice_consent_category_essential
    • cookie_notice_consent_design_settings
    • cookie_notice_consent_general_settings
    • can_compress_scripts
    • widget_theysaidso_widget
    • db_upgraded
    • theysaidso_admin_options
    • cookie_notice_consent_category_functional
    • widget_recent-posts
    • ...

Smoke tests Passed 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)
Good news, no errors were detected

SRP Passed 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
Congratulations! This plugin passed the SRP test

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

The readme.txt file uses markdown syntax to describe your plugin to the world
Attributes that need to be fixed: Please take inspiration from this readme.txt

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

The primary PHP file in "Cookie Notice & Consent" version 1.6.1 is used by WordPress to initiate all plugin functionality
105 characters long description:
Display a cookie notice, collect consent for different categories and output scripts if consent is given.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short glimpse at programming languages used with this plugin and a check that no dangerous files are present
Success! There were no dangerous files found in this plugin1,850 lines of code in 20 files:
LanguageFilesBlank linesComment linesLines of code
PHP102173521,353
CSS6160275
JavaScript3260199
XML10023

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
There are no cyclomatic complexity problems detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.32
Average class complexity16.50
▷ Minimum class complexity4.00
▷ Maximum class complexity38.00
Average method complexity2.04
▷ Minimum method complexity1.00
▷ Maximum method complexity18.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes8
▷ Abstract classes00.00%
▷ Concrete classes8100.00%
▷ Final classes00.00%
Methods116
▷ Static methods21.72%
▷ Public methods11195.69%
▷ Protected methods00.00%
▷ Private methods54.31%
Functions3
▷ Named functions266.67%
▷ Anonymous functions133.33%
Constants3
▷ Global constants3100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
There are no PNG files in this plugin