83% cookie-information-consent-solution

Code Review | Cookie Information - GDPR & ePrivacy Cookie Consent Solution

WordPress plugin Cookie Information - GDPR & ePrivacy Cookie Consent Solution scored83%from 54 tests.

About plugin

  • Plugin page: cookie-informatio...
  • Plugin version: 1.1.4
  • PHP compatiblity: 5.2.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-5.9
  • WordPress version: 6.3.1
  • First release: Nov 9, 2018
  • Latest release: Jan 31, 2022
  • Number of updates: 56
  • Update frequency: every 21.1 days
  • Top authors: cookieinformation (100%)

Code review

54 tests

User reviews

3 reviews

Install metrics

2,000+ active /20,381 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
Installer ran successfully

Server metrics [RAM: ▲0.07MB] [CPU: ▼7.22ms] Passed 4 tests

An overview of server-side resources used by Cookie Information - GDPR & ePrivacy Cookie Consent Solution
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.54 ▲0.0838.19 ▼1.51
Dashboard /wp-admin3.38 ▲0.0746.32 ▼8.47
Posts /wp-admin/edit.php3.49 ▲0.1444.88 ▼1.95
Add New Post /wp-admin/post-new.php5.96 ▲0.0781.39 ▼16.62
Media Library /wp-admin/upload.php3.30 ▲0.0733.37 ▼1.84
Settings /wp-admin/admin.php?page=cookie-information-settings3.2731.77
Cookie Information /wp-admin/admin.php?page=cookie-information3.2732.31

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

A short overview of filesystem and database impact
This plugin installed successfully
Filesystem: 6 new files
Database: no new tables, 12 new options
New WordPress options
enable-tcf
can_compress_scripts
enable-video-sdk
enable-popup
theysaidso_admin_options
widget_theysaidso_widget
widget_recent-posts
disable-logged-in-users
db_upgraded
enable-gcm
...

Browser metrics Passed 4 tests

This is an overview of browser requirements for Cookie Information - GDPR & ePrivacy Cookie Consent Solution
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,857 ▲9613.49 ▼0.8611.86 ▲10.2039.24 ▼3.97
Dashboard /wp-admin2,225 ▲455.64 ▼0.0481.11 ▼20.1338.25 ▼4.22
Posts /wp-admin/edit.php2,127 ▲242.02 ▲0.0833.88 ▼3.6134.85 ▲0.61
Add New Post /wp-admin/post-new.php1,548 ▲1923.55 ▲0.51641.72 ▼22.3547.76 ▼11.62
Media Library /wp-admin/upload.php1,427 ▲274.17 ▼0.0794.93 ▼19.1643.23 ▼7.37
Settings /wp-admin/admin.php?page=cookie-information-settings1,0801.9823.3330.18
Cookie Information /wp-admin/admin.php?page=cookie-information8541.9922.6829.07

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
The following items require your attention
  • This plugin does not fully uninstall, leaving 12 options in the database
    • enable-popup
    • widget_recent-comments
    • enable-tcf
    • disable-logged-in-users
    • enable-video-sdk
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • can_compress_scripts
    • widget_recent-posts
    • video-sdk-category
    • ...

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Even though no errors were found, this is by no means an exhaustive test

SRP 50% 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
  • 1× PHP files output non-empty strings when accessed directly via GET requests:
    • > /wp-content/plugins/cookie-information-consent-solution/cookie-information.php

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 errors were detected

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 94% from 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
These attributes need to be fixed:
  • Screenshots: Add images for these screenshots: #1 ([https://cookieinformation.com/extensions/wordpress/screenshot1.JPG The plugin screen once it has been installed]), #2 ([https://cookieinformation.com/extensions/wordpress/screenshot2.JPG Example of a consent popup from Cookie Information]), #3 ([https://cookieinformation.com/extensions/wordpress/screenshot3.JPG Privacy Controls to updating the users consent])
The official readme.txt might help

cookie-information-consent-solution/cookie-information.php 85% from 13 tests

"Cookie Information - GDPR & ePrivacy Cookie Consent Solution" version 1.1.4's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
The following require your attention:
  • Description: Please don't use more than 140 characters for the plugin description (currently 174 characters long)
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("cookie-information-consent-solution.php" instead of "cookie-information.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short review of files and their extensions; it is not recommended to include executable files
Everything looks great! No dangerous files found in this plugin491 lines of code in 4 files:
LanguageFilesBlank linesComment linesLines of code
PHP16538315
CSS161149
JavaScript17118
HTML1109

PHP code Passed 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.22
Average class complexity19.00
▷ Minimum class complexity19.00
▷ Maximum class complexity19.00
Average method complexity2.00
▷ Minimum method complexity1.00
▷ Maximum method complexity5.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods18
▷ Static methods00.00%
▷ Public methods1794.44%
▷ Protected methods00.00%
▷ Private methods15.56%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.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
1 PNG file occupies 0.02MB with 0.01MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
image/ci-logo.png17.29KB9.71KB▼ 43.81%