84% cookie-warning

Code Review | Cookie Warning

WordPress plugin Cookie Warning scored 84% from 54 tests.

About plugin

  • Plugin page: cookie-warning
  • Plugin version: 1.3
  • PHP version: 7.4.16
  • WordPress compatibility: 3.3.2-3.6
  • WordPress version: 6.3.1
  • First release: May 8, 2012
  • Latest release: Aug 9, 2013
  • Number of updates: 15
  • Update frequency: every 30.6 days
  • Top authors: Dourou (100%)

Code review

54 tests

User reviews

5 reviews

Install metrics

1,000+ active / 41,601 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.01MB] [CPU: ▼3.57ms] Passed 4 tests

This is a short check of server-side resources used by Cookie Warning
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0134.99 ▼5.85
Dashboard /wp-admin3.32 ▲0.0145.96 ▼4.55
Posts /wp-admin/edit.php3.37 ▲0.0146.07 ▼1.12
Add New Post /wp-admin/post-new.php5.90 ▲0.0195.78 ▲5.29
Media Library /wp-admin/upload.php3.24 ▲0.0132.86 ▼2.76
Cookie warning /wp-admin/options-general.php?page=cookie-warning-page3.2130.44

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

Input-output and database impact of this plugin
No storage issues were detected
Filesystem: 10 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-comments
theysaidso_admin_options
widget_theysaidso_widget
widget_recent-posts
can_compress_scripts
db_upgraded

Browser metrics Passed 4 tests

This is an overview of browser requirements for Cookie Warning
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,930 ▲19513.62 ▼0.597.72 ▲5.7044.47 ▼1.68
Dashboard /wp-admin2,210 ▲225.82 ▲0.91101.30 ▼6.3138.95 ▼6.66
Posts /wp-admin/edit.php2,093 ▲72.00 ▲0.0340.07 ▲3.4135.64 ▼1.48
Add New Post /wp-admin/post-new.php1,517 ▼1723.40 ▲0.34607.07 ▼58.9747.05 ▼6.79
Media Library /wp-admin/upload.php1,392 ▲44.38 ▲0.1797.72 ▼15.2543.53 ▼5.51
Cookie warning /wp-admin/options-general.php?page=cookie-warning-page8222.0124.3727.67

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
These items require your attention
  • Zombie WordPress options detected upon uninstall: 6 options
    • db_upgraded
    • widget_recent-comments
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • can_compress_scripts
    • widget_recent-posts

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Even though everything seems fine, this is not 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
Almost there! Just fix the following items
  • 2× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/cookie-warning/cookie-warning-options.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/cookie-warning/cookie-warning-options.php:3

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 97% from 29 tests

readme.txt 94% from 16 tests

Don't ignore readme.txt as it is the file that instructs WordPress.org on how to present your plugin to the world
Attributes that require attention:
  • Screenshots: These screenshots do not have images: #1 (Cookie warning message on first visit), #2 (Cookie warning options page)
The official readme.txt might help

cookie-warning/cookie-warning.php Passed 13 tests

The primary PHP file in "Cookie Warning" version 1.3 is used by WordPress to initiate all plugin functionality
82 characters long description:
Asks users for their consent for using cookies or redirects them out of your site.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is a short overview of programming languages used in this plugin, detecting executable files
No dangerous file extensions were detected273 lines of code in 5 files:
LanguageFilesBlank linesComment linesLines of code
PHP22530132
JavaScript1402092
CSS15043
XML1016

PHP code Passed 2 tests

An overview of cyclomatic complexity and code structure
No cyclomatic complexity issues were detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.06
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%
Functions12
▷ Named functions12100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
3 PNG files occupy 0.12MB with 0.07MB in potential savings
Potential savings
Compression of 3 random PNG files using pngquant
FileSize - originalSize - compressedSavings
screenshot-1.png53.88KB16.50KB▼ 69.37%
screenshot-2.png68.79KB21.83KB▼ 68.27%
cookie.png3.02KB2.05KB▼ 32.13%