84% easy-eu-cookie-law

Code Review | Easy EU Cookie law

WordPress plugin Easy EU Cookie law scored84%from 54 tests.

About plugin

  • Plugin page: easy-eu-cookie-law
  • Plugin version: 1.3.3.1
  • PHP version: 7.4.16
  • WordPress compatibility: 3.8-3.8
  • WordPress version: 6.3.1
  • First release: Feb 25, 2014
  • Latest release: May 11, 2016
  • Number of updates: 34
  • Update frequency: every 23.7 days
  • Top authors: viher3 (100%)

Code review

54 tests

User reviews

3 reviews

Install metrics

200+ active /6,734 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
Install script ran successfully

Server metrics [RAM: ▲0.04MB] [CPU: ▼1.84ms] Passed 4 tests

An overview of server-side resources used by Easy EU Cookie law
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.51 ▲0.0544.51 ▲2.47
Dashboard /wp-admin3.34 ▲0.0449.46 ▼3.19
Posts /wp-admin/edit.php3.45 ▲0.1046.03 ▼3.54
Add New Post /wp-admin/post-new.php5.93 ▲0.0586.10 ▼3.08
Media Library /wp-admin/upload.php3.26 ▲0.0340.78 ▲4.98

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

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

Browser metrics Passed 4 tests

A check of browser resources used by Easy EU Cookie law
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,908 ▲14713.46 ▼0.819.16 ▲7.4449.43 ▲6.08
Dashboard /wp-admin2,219 ▲515.57 ▲0.0585.39 ▼10.1937.34 ▼6.28
Posts /wp-admin/edit.php2,121 ▲182.05 ▲0.0533.61 ▼2.7237.42 ▲1.95
Add New Post /wp-admin/post-new.php1,544 ▲1823.31 ▲0.33599.64 ▼114.8050.89 ▼6.69
Media Library /wp-admin/upload.php1,418 ▲184.21 ▼0.00102.27 ▼9.3341.95 ▼4.15

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
It is recommended to fix the following
  • This plugin does not fully uninstall, leaving 6 options in the database
    • can_compress_scripts
    • widget_recent-posts
    • widget_theysaidso_widget
    • widget_recent-comments
    • db_upgraded
    • theysaidso_admin_options

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
The smoke test was a success, however most plugin functionality was not tested

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
Please fix the following items
  • 2× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugins_url() in wp-content/plugins/easy-eu-cookie-law/admin_form.php:1
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/easy-eu-cookie-law/easy-eu-cookie-law.php:106

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
Everything seems fine on the user side

Optimizations

Plugin configuration 97% 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
Please fix the following attributes:
  • Donate link: Invalid url: ""
You can take inspiration from this readme.txt

easy-eu-cookie-law/easy-eu-cookie-law.php Passed 13 tests

The main PHP script in "Easy EU Cookie law" version 1.3.3.1 is automatically included on every request by WordPress
39 characters long description:
Plugin for the new European cookie law.

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
Success! There were no dangerous files found in this plugin679 lines of code in 13 files:
LanguageFilesBlank linesComment linesLines of code
PHP45229262
PO File39090248
CSS220100
JavaScript44369

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
This plugin has no cyclomatic complexity problems
Cyclomatic complexity
Average complexity per logical line of code0.35
Average class complexity4.00
▷ Minimum class complexity4.00
▷ Maximum class complexity4.00
Average method complexity1.60
▷ Minimum method complexity1.00
▷ Maximum method complexity3.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods5
▷ Static methods00.00%
▷ Public methods5100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions13
▷ Named functions13100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.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
No PNG files were detected