84% cookie-consent-box

Code Review | GDPR Cookie Consent Notice Box

WordPress plugin GDPR Cookie Consent Notice Box scored84%from 54 tests.

About plugin

  • Plugin page: cookie-consent-box
  • Plugin version: 1.1.8
  • PHP version: 7.4.16
  • WordPress compatibility: 4.1.0-6.2.0
  • WordPress version: 6.3.1
  • First release: May 19, 2018
  • Latest release: May 29, 2023
  • Number of updates: 20
  • Update frequency: every 91.9 days
  • Top authors: adriandmitroca (100%)

Code review

54 tests

User reviews

7 reviews

Install metrics

1,000+ active /7,195 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
Installer ran successfully

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

This is a short check of server-side resources used by GDPR Cookie Consent Notice Box
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.51 ▲0.0527.97 ▼13.80
Dashboard /wp-admin3.47 ▲0.1651.09 ▲0.55
Posts /wp-admin/edit.php3.52 ▲0.1654.18 ▲6.54
Add New Post /wp-admin/post-new.php5.98 ▲0.0985.75 ▼13.69
Media Library /wp-admin/upload.php3.30 ▲0.0738.90 ▲3.88
Cookie Consent Box /wp-admin/options-general.php?page=cookie-consent-box3.3437.07

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

A short overview of filesystem and database impact
The plugin installed successfully
Filesystem: 23 new files
Database: no new tables, 6 new options
New WordPress options
db_upgraded
widget_theysaidso_widget
widget_recent-posts
theysaidso_admin_options
can_compress_scripts
widget_recent-comments

Browser metrics Passed 4 tests

Checking browser requirements for GDPR Cookie Consent Notice Box
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,023 ▲26615.01 ▲0.636.69 ▲4.2350.53 ▲7.41
Dashboard /wp-admin2,361 ▲1736.77 ▲1.90137.27 ▲20.5741.66 ▼2.34
Posts /wp-admin/edit.php2,279 ▲1873.60 ▲1.4773.41 ▲35.7141.91 ▲7.00
Add New Post /wp-admin/post-new.php1,535 ▲2123.44 ▲5.87659.03 ▼27.8336.83 ▼17.04
Media Library /wp-admin/upload.php1,415 ▲274.28 ▲0.1085.59 ▼17.1340.41 ▼1.11
Cookie Consent Box /wp-admin/options-general.php?page=cookie-consent-box1,4673.4760.0125.71

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
You still need to fix the following
  • Zombie WordPress options were found after uninstall: 6 options
    • theysaidso_admin_options
    • db_upgraded
    • widget_recent-posts
    • widget_recent-comments
    • widget_theysaidso_widget
    • can_compress_scripts

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Good news, no errors were detected

SRP 50% 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
  • 1× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/cookie-consent-box/admin/partials/cookie-consent-box-admin-display.php:14

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 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
These attributes need to be fixed: You can look at the official readme.txt

cookie-consent-box/cookie-consent-box.php 92% from 13 tests

The principal PHP file in "GDPR Cookie Consent Notice Box" v. 1.1.8 is loaded by WordPress automatically on each request
The following require your attention:
  • Description: Please don't use more than 140 characters for the plugin description (currently 141 characters long)

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short check of programming languages and file extensions; no executable files are allowed
There were no executable files found in this plugin676 lines of code in 17 files:
LanguageFilesBlank linesComment linesLines of code
PHP11137421491
CSS10096
JavaScript214143
JSON20029
XML15617

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.33
Average class complexity4.00
▷ Minimum class complexity1.00
▷ Maximum class complexity10.00
Average method complexity1.66
▷ Minimum method complexity1.00
▷ Maximum method complexity10.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes7
▷ Abstract classes00.00%
▷ Concrete classes7100.00%
▷ Final classes00.00%
Methods32
▷ Static methods26.25%
▷ Public methods2475.00%
▷ Protected methods00.00%
▷ Private methods825.00%
Functions3
▷ Named functions3100.00%
▷ Anonymous functions00.00%
Constants1
▷ Global constants1100.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
No PNG files were detected