10% cookie-disclaimer

Code Review | Best Cookies

WordPress plugin Best Cookies scored10%from 54 tests.

About plugin

  • Plugin page: cookie-disclaimer
  • Plugin version: 1.1.0
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-5.3.2
  • WordPress version: 6.3.1
  • First release: Mar 11, 2018
  • Latest release: Jan 22, 2020
  • Number of updates: 32
  • Update frequency: every 21.4 days
  • Top authors: alexey7013 (100%)Otto42 (6.25%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /2,723 total downloads

Benchmarks

Plugin footprint 58% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
You still need to fix the following installer errors
  • This plugin did not install gracefully
    • > Notice in wp-content/plugins/cookie-disclaimer/best_cookies.php+24
    Trying to access array offset on value of type bool

Server metrics [RAM: ▲0.02MB] [CPU: ▼3.13ms] Passed 4 tests

This is a short check of server-side resources used by Best Cookies
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.52 ▲0.0640.78 ▼1.30
Dashboard /wp-admin3.32 ▲0.0251.72 ▲6.12
Posts /wp-admin/edit.php3.37 ▲0.0143.26 ▼2.92
Add New Post /wp-admin/post-new.php5.92 ▲0.0389.97 ▼4.53
Media Library /wp-admin/upload.php3.24 ▲0.0133.46 ▼3.77
Best Cookies /wp-admin/options-general.php?page=best_cookies3.1831.05

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

Filesystem and database footprint
This plugin installed successfully
Filesystem: 11 new files
Database: no new tables, 8 new options
New WordPress options
db_upgraded
widget_recent-posts
can_compress_scripts
widget_recent-comments
widget_theysaidso_widget
best_cookies_version
best_cookie_settings
theysaidso_admin_options

Browser metrics Passed 4 tests

A check of browser resources used by Best Cookies
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,931 ▲19613.76 ▼0.466.63 ▲4.8749.18 ▼1.31
Dashboard /wp-admin2,230 ▲445.03 ▲0.08102.92 ▼1.4338.63 ▼3.38
Posts /wp-admin/edit.php2,121 ▲322.32 ▲0.3438.86 ▲2.6631.60 ▼0.97
Add New Post /wp-admin/post-new.php1,536 ▲323.49 ▲0.34606.46 ▼117.0833.98 ▼29.46
Media Library /wp-admin/upload.php1,418 ▲304.43 ▲0.2196.21 ▼10.3443.32 ▼2.01
Best Cookies /wp-admin/options-general.php?page=best_cookies1,3775.92124.7754.05

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
It is recommended to fix the following
  • Zombie WordPress options were found after uninstall: 7 options
    • widget_recent-comments
    • can_compress_scripts
    • db_upgraded
    • widget_recent-posts
    • theysaidso_admin_options
    • best_cookie_settings
    • widget_theysaidso_widget

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Almost there, just fix the following server-side errors
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=best_cookies
    • > Notice in wp-content/plugins/cookie-disclaimer/admin_form.php+4
    Undefined index: update_cookie

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
The following issues need your attention
  • 3× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/cookie-disclaimer/front_form.php:2
    • > PHP Notice
      Undefined index: update_cookie in wp-content/plugins/cookie-disclaimer/admin_form.php on line 4
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/cookie-disclaimer/admin_form.php:9

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
There were no browser issues found

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
No tags were detected

cookie-disclaimer/best_cookies.php 92% from 13 tests

"Best Cookies" version 1.1.0's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
The following require your attention:
  • Main file name: The principal plugin file should be the same as the plugin slug ("cookie-disclaimer.php" instead of "best_cookies.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of file extensions present in this plugin and a short test that no dangerous files are bundled with this plugin
Success! There were no dangerous files found in this plugin409 lines of code in 9 files:
LanguageFilesBlank linesComment linesLines of code
CSS236186
PHP41624178
JavaScript310845

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
This plugin has no cyclomatic complexity issues
Cyclomatic complexity
Average complexity per logical line of code0.41
Average class complexity0.00
▷ Minimum class complexity0.00
▷ Maximum class complexity0.00
Average method complexity0.00
▷ Minimum method complexity0.00
▷ Maximum method complexity0.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes0
▷ Abstract classes00.00%
▷ Concrete classes00.00%
▷ Final classes00.00%
Methods0
▷ Static methods00.00%
▷ Public methods00.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions10
▷ Named functions10100.00%
▷ Anonymous functions00.00%
Constants2
▷ Global constants150.00%
▷ Class constants150.00%
▷ Public constants1100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
1 compressed PNG file occupies 0.01MB
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
img/best-cookies-bg.png6.56KB7.29KB0.00%