10% eucookielaw

Code Review | EUCookieLaw

WordPress plugin EUCookieLaw scored10%from 54 tests.

About plugin

  • Plugin page: eucookielaw
  • Plugin version: 2.7.2
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-4.4
  • WordPress version: 6.3.1
  • First release: Jun 2, 2015
  • Latest release: Dec 18, 2015
  • Number of updates: 48
  • Update frequency: every 4.2 days
  • Top authors: Diego La Monica (100%)

Code review

54 tests

User reviews

18 reviews

Install metrics

400+ active /11,341 total downloads

Benchmarks

Plugin footprint 58% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
You still need to fix the following installer errors
  • Install procedure validation failed for this plugin
    • > Deprecated in wp-content/plugins/eucookielaw/editor.php+2
    Methods with the same name as their class will not be constructors in a future version of PHP; EUCookieLawTinyMCE has a deprecated constructor

Server metrics [RAM: ▲0.03MB] [CPU: ▼7.07ms] Passed 4 tests

Server-side resources used by EUCookieLaw
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.54 ▲0.0739.89 ▼0.37
Dashboard /wp-admin3.34 ▼0.0147.76 ▼15.10
Posts /wp-admin/edit.php3.39 ▲0.0346.83 ▼7.35
Add New Post /wp-admin/post-new.php5.94 ▲0.0591.10 ▼5.44
Media Library /wp-admin/upload.php3.26 ▲0.0335.78 ▲0.09
About /wp-admin/admin.php?page=EUCookieLaw3.2331.96
Settings /wp-admin/admin.php?page=EUCookieLaw-settings3.2441.21
Tools /wp-admin/admin.php?page=EUCookieLaw-tools3.2332.88

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

How much does this plugin use your filesystem and database?
No storage issues were detected
Filesystem: 38 new files
Database: no new tables, 6 new options
New WordPress options
theysaidso_admin_options
widget_recent-posts
db_upgraded
can_compress_scripts
widget_theysaidso_widget
widget_recent-comments

Browser metrics Passed 4 tests

This is an overview of browser requirements for EUCookieLaw
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,873 ▲10213.26 ▼1.301.45 ▼0.4935.06 ▼4.36
Dashboard /wp-admin2,241 ▲594.87 ▼0.99110.74 ▼7.6539.81 ▼6.25
Posts /wp-admin/edit.php2,127 ▲412.03 ▼0.0140.80 ▲3.7334.78 ▲1.04
Add New Post /wp-admin/post-new.php1,552 ▲3318.74 ▼4.29612.27 ▼39.9247.35 ▼7.65
Media Library /wp-admin/upload.php1,423 ▲324.22 ▲0.0793.77 ▼4.0041.54 ▼0.41
About /wp-admin/admin.php?page=EUCookieLaw1,8607.79154.6189.02
Settings /wp-admin/admin.php?page=EUCookieLaw-settings2,7588.49222.8980.05
Tools /wp-admin/admin.php?page=EUCookieLaw-tools1,5958.49155.5148.98

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
Please fix the following items
  • Zombie WordPress options detected upon uninstall: 6 options
    • can_compress_scripts
    • db_upgraded
    • widget_recent-posts
    • theysaidso_admin_options
    • widget_recent-comments
    • widget_theysaidso_widget

Smoke tests 25% 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 0% 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
  • 1× GET requests to PHP files return non-empty strings:
    • > /wp-content/plugins/eucookielaw/templates/wp-config.fragment.php
  • 45× GET requests to PHP files trigger server-side errors or Error 500 responses (only 10 are shown):
    • > Cookie not detected
    • > ----
    • > handler 1 -> EUCookieLawHeader
      :buffering
    • > PHP Warning
      Use of undefined constant EUCOOKIELAW_DEBUG - assumed 'EUCOOKIELAW_DEBUG' (this will throw an Error in a future version of PHP) in wp-content/plugins/eucookielaw/eucookielaw-header.php on line 73
    • > Ignored url are
    • > PHP Warning
      Use of undefined constant EUCOOKIELAW_DEBUG - assumed 'EUCOOKIELAW_DEBUG' (this will throw an Error in a future version of PHP) in wp-content/plugins/eucookielaw/eucookielaw-header.php on line 73
    • > Current URL is
      /wp-content/plugins/eucookielaw/eucookielaw-header.php
    • > PHP Warning
      Use of undefined constant EUCOOKIELAW_DEBUG - assumed 'EUCOOKIELAW_DEBUG' (this will throw an Error in a future version of PHP) in wp-content/plugins/eucookielaw/eucookielaw-header.php on line 73
    • > ----
    • > PHP Warning
      Use of undefined constant EUCOOKIELAW_DEBUG - assumed 'EUCOOKIELAW_DEBUG' (this will throw an Error in a future version of PHP) in wp-content/plugins/eucookielaw/eucookielaw-header.php on line 73

User-side errors 0% from 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
Please fix the following browser errors
  • 3 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=EUCookieLaw-tools
    • > Security (warning) in unknown
    security - Error with Permissions-Policy header: Unrecognized feature: 'ambient-light-sensor'.
  • 3 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=EUCookieLaw-tools
    • > Security (warning) in unknown
    security - Error with Permissions-Policy header: Unrecognized feature: 'bluetooth'.
  • 3 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=EUCookieLaw-tools
    • > Deprecation (warning) in unknown
    https://static.xx.fbcdn.net/rsrc.php/v3/yx/r/RBH7b7zeA6F.js?_nc_x=Ij3Wp8lg5Kz 271 Listener added for a synchronous 'DOMSubtreeModified' DOM Mutation Event. This event type is deprecated (https://w3c.github.io/uievents/#legacy-event-types) and work is underway to remove it from this browser. Usage of this event listener will cause performance issues today, and represents a risk of future incompatibility. Consider using MutationObserver instead.
  • 3 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=EUCookieLaw-tools
    • > Console-api (severe) in unknown
    https://static.xx.fbcdn.net/rsrc.php/v3/yx/r/RBH7b7zeA6F.js?_nc_x=Ij3Wp8lg5Kz 60:573 "ErrorUtils caught an error:\n\nCannot listen to an undefined element. [Caught in: Tried to listen to element of type click]\n\nSubsequent non-fatal errors won't be logged; see https://fburl.com/debugjs."

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

Perhaps the most important file in your plugin readme.txt gets parsed in order to generate the public listing of your plugin
Please fix the following attributes:
  • Screenshots: Add an image for screenshot #1 (The configuration page)
You can take inspiration from this readme.txt

eucookielaw/eucookielaw.php 92% from 13 tests

The entry point to "EUCookieLaw" version 2.7.2 is a PHP file that has certain tags in its header comment area
Please take the time to fix the following:
  • Text Domain: Please use dashes and lowercase characters for text domains

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | An overview of files in this plugin; executable files are not allowed
No dangerous file extensions were detected4,709 lines of code in 24 files:
LanguageFilesBlank linesComment linesLines of code
PHP105873852,458
PO File4324397926
JavaScript618081918
CSS2653362
HTML14036
XML1009

PHP code Passed 2 tests

An overview of cyclomatic complexity and code structure
This plugin has no cyclomatic complexity issues
Cyclomatic complexity
Average complexity per logical line of code0.36
Average class complexity74.25
▷ Minimum class complexity4.00
▷ Maximum class complexity160.00
Average method complexity4.53
▷ Minimum method complexity1.00
▷ Maximum method complexity45.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes4
▷ Abstract classes00.00%
▷ Concrete classes4100.00%
▷ Final classes00.00%
Methods83
▷ Static methods00.00%
▷ Public methods5161.45%
▷ Protected methods00.00%
▷ Private methods3238.55%
Functions2
▷ Named functions2100.00%
▷ Anonymous functions00.00%
Constants100
▷ Global constants3838.00%
▷ Class constants6262.00%
▷ Public constants62100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
2 PNG files occupy 0.20MB with 0.07MB in potential savings
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
screenshot-1.png198.38KB80.09KB▼ 59.63%
cookie.png2.22KB1.94KB▼ 12.51%