84% cookiefox

Code Review | CookieFox - Cookie Notice

WordPress plugin CookieFox - Cookie Notice scored84%from 54 tests.

About plugin

  • Plugin page: cookiefox
  • Plugin version: 2.0.8
  • PHP compatiblity: 7.3+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.0-6.3.1
  • WordPress version: 6.3.1
  • First release: Jan 13, 2021
  • Latest release: Sep 23, 2023
  • Number of updates: 60
  • Update frequency: every 16.4 days
  • Top authors: fabianpimminger (100%)

Code review

54 tests

User reviews

5 reviews

Install metrics

300+ active /3,259 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: ▲1.08MB] [CPU: ▼3.87ms] Passed 4 tests

Server-side resources used by CookieFox - Cookie Notice
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /4.22 ▲0.7548.62 ▲0.22
Dashboard /wp-admin4.53 ▲1.1863.33 ▼3.76
Posts /wp-admin/edit.php4.55 ▲1.1956.78 ▲3.72
Add New Post /wp-admin/post-new.php7.11 ▲1.2294.56 ▼15.67
Media Library /wp-admin/upload.php4.45 ▲1.2149.31 ▲11.04
Cookie Notice /wp-admin/options-general.php?page=cookiefox4.9149.19

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

Filesystem and database footprint
No storage issues were detected
Filesystem: 399 new files
Database: no new tables, 7 new options
New WordPress options
widget_theysaidso_widget
db_upgraded
cookiefox
can_compress_scripts
theysaidso_admin_options
widget_recent-comments
widget_recent-posts

Browser metrics Passed 4 tests

This is an overview of browser requirements for CookieFox - Cookie Notice
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,896 ▲13514.38 ▲0.199.72 ▲7.9847.73 ▲2.95
Dashboard /wp-admin2,221 ▲445.64 ▲0.0593.22 ▼4.8240.93 ▼1.22
Posts /wp-admin/edit.php2,126 ▲262.09 ▲0.0738.31 ▲2.4935.18 ▼2.71
Add New Post /wp-admin/post-new.php1,549 ▲1421.01 ▲2.76707.37 ▲40.5275.65 ▼3.36
Media Library /wp-admin/upload.php1,429 ▲324.26 ▲0.1098.78 ▼1.9345.10 ▲0.79
Cookie Notice /wp-admin/options-general.php?page=cookiefox2,4364.72119.5550.46

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
You still need to fix the following
  • This plugin does not fully uninstall, leaving 7 options in the database
    • can_compress_scripts
    • db_upgraded
    • cookiefox
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • widget_recent-posts
    • widget_recent-comments

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Everything seems fine, however this is by no means an exhaustive test

SRP 50% from 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
Almost there! Just fix the following items
  • 39× GET requests to PHP files have triggered server-side errors or warnings (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'CMB2_Type_Base' not found in wp-content/plugins/cookiefox/vendor/cmb2/cmb2/includes/types/CMB2_Type_Title.php:13
    • > PHP Fatal error
      Uncaught Error: Class 'CMB2_Type_Picker_Base' not found in wp-content/plugins/cookiefox/vendor/cmb2/cmb2/includes/types/CMB2_Type_Text_Datetime_Timestamp.php:13
    • > PHP Fatal error
      Uncaught Error: Class 'CMB2_Type_Radio' not found in wp-content/plugins/cookiefox/vendor/cmb2/cmb2/includes/types/CMB2_Type_Multicheck.php:13
    • > PHP Fatal error
      Uncaught Error: Class 'CMB2_Hookup_Base' not found in wp-content/plugins/cookiefox/vendor/cmb2/cmb2/includes/CMB2_Hookup.php:14
    • > PHP Fatal error
      Uncaught Error: Class 'CMB2_Type_Taxonomy_Radio' not found in wp-content/plugins/cookiefox/vendor/cmb2/cmb2/includes/types/CMB2_Type_Taxonomy_Radio_Hierarchical.php:13
    • > PHP Fatal error
      Uncaught Error: Class 'CMB2_Type_Multi_Base' not found in wp-content/plugins/cookiefox/vendor/cmb2/cmb2/includes/types/CMB2_Type_Select.php:13
    • > PHP Fatal error
      Uncaught Error: Class 'CMB2_Type_Text' not found in wp-content/plugins/cookiefox/vendor/cmb2/cmb2/includes/types/CMB2_Type_Oembed.php:13
    • > PHP Fatal error
      Uncaught Error: Class 'CMB2_Type_Multi_Base' not found in wp-content/plugins/cookiefox/vendor/cmb2/cmb2/includes/types/CMB2_Type_Radio.php:13
    • > PHP Fatal error
      Uncaught Error: Class 'CMB2_Base' not found in wp-content/plugins/cookiefox/vendor/cmb2/cmb2/includes/CMB2.php:21
    • > PHP Fatal error
      Uncaught Error: Class 'CMB2_Type_Taxonomy_Base' not found in wp-content/plugins/cookiefox/vendor/cmb2/cmb2/includes/types/CMB2_Type_Taxonomy_Multicheck.php:13

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
Everything seems fine on the user side

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
7 plugin tags: cookie, privacy, cookie notice, cookie consent, cookie banner...

cookiefox/cookiefox.php Passed 13 tests

This is the main PHP file of "CookieFox - Cookie Notice" version 2.0.8, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
70 characters long description:
A performant and accessible cookie and consent solution for WordPress.

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
Everything looks great! No dangerous files found in this plugin57,077 lines of code in 250 files:
LanguageFilesBlank linesComment linesLines of code
PO File12114,48718,69732,793
PHP822,7116,6629,428
JSON3006,670
CSS132501,1904,555
JavaScript103615911,434
Sass17306291,411
Markdown32490768
XML10018

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
This plugin has no cyclomatic complexity issues
Cyclomatic complexity
Average complexity per logical line of code0.46
Average class complexity17.76
▷ Minimum class complexity1.00
▷ Maximum class complexity188.00
Average method complexity3.20
▷ Minimum method complexity1.00
▷ Maximum method complexity31.00
Code structure
Namespaces4
Interfaces0
Traits0
Classes86
▷ Abstract classes910.47%
▷ Concrete classes7789.53%
▷ Final classes00.00%
Methods659
▷ Static methods11317.15%
▷ Public methods55484.07%
▷ Protected methods8913.51%
▷ Private methods162.43%
Functions37
▷ Named functions3697.30%
▷ Anonymous functions12.70%
Constants13
▷ Global constants753.85%
▷ Class constants646.15%
▷ Public constants6100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
14 compressed PNG files occupy 0.02MB
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
vendor/cmb2/cmb2/images/ui-icons_222222_256x240.png4.27KB4.11KB▼ 3.78%
vendor/cmb2/cmb2/images/ui-icons_cd0a0a_256x240.png4.27KB4.11KB▼ 3.78%
vendor/cmb2/cmb2/images/ui-bg_glass_65_ffffff_1x400.png0.10KB0.10KB▼ 5.71%
vendor/cmb2/cmb2/images/ui-bg_glass_75_e6e6e6_1x400.png0.11KB0.14KB0.00%
vendor/cmb2/cmb2/images/ui-icons_454545_256x240.png4.27KB4.11KB▼ 3.78%