78% italy-cookie-choices

Code Review | Italy Cookie Choices (for EU Cookie Law & Cookie Notice)

WordPress plugin Italy Cookie Choices (for EU Cookie Law & Cookie Notice) scored78%from 54 tests.

About plugin

  • Plugin page: italy-cookie-choices
  • Plugin version: 2.5.3
  • PHP compatiblity: 7.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.0-6.0
  • WordPress version: 6.3.1
  • First release: May 20, 2015
  • Latest release: Jul 24, 2023
  • Number of updates: 35
  • Update frequency: every 85.3 days
  • Top authors: overclokk (100%)

Code review

54 tests

User reviews

35 reviews

Install metrics

20,000+ active /251,875 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
This plugin's installer ran successfully

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

A check of server-side resources used by Italy Cookie Choices (for EU Cookie Law & Cookie Notice)
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.48 ▲0.0232.66 ▼12.24
Dashboard /wp-admin3.36 ▲0.0546.94 ▼4.21
Posts /wp-admin/edit.php3.40 ▲0.0547.45 ▼1.22
Add New Post /wp-admin/post-new.php5.94 ▲0.0595.46 ▼5.42
Media Library /wp-admin/upload.php3.28 ▲0.0638.24 ▼1.32
Italy Cookie Choices /wp-admin/options-general.php?page=italy-cookie-choices3.3236.14

Server storage [IO: ▲0.67MB] [DB: ▲0.07MB] Passed 3 tests

Filesystem and database footprint
This plugin installed successfully
Filesystem: 71 new files
Database: no new tables, 7 new options
New WordPress options
widget_recent-posts
db_upgraded
italy_cookie_choices
widget_theysaidso_widget
can_compress_scripts
theysaidso_admin_options
widget_recent-comments

Browser metrics Passed 4 tests

Italy Cookie Choices (for EU Cookie Law & Cookie Notice): an overview of browser usage
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,804 ▲6913.20 ▼1.101.87 ▲0.1643.34 ▲1.19
Dashboard /wp-admin2,210 ▲225.88 ▲0.07104.77 ▲1.2637.62 ▼7.29
Posts /wp-admin/edit.php2,096 ▲71.97 ▼0.0138.74 ▼3.7035.02 ▼0.89
Add New Post /wp-admin/post-new.php1,545 ▲318.13 ▼0.06603.02 ▼27.5554.54 ▲3.00
Media Library /wp-admin/upload.php1,392 ▲44.15 ▼0.0493.76 ▼1.3639.37 ▼2.93
Italy Cookie Choices /wp-admin/options-general.php?page=italy-cookie-choices2,6706.74157.7592.06

Uninstaller [IO: ▲0.00MB] [DB: ▲0.07MB] 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 were found after uninstall: 6 options
    • widget_recent-comments
    • db_upgraded
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • can_compress_scripts
    • widget_recent-posts

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Even though no errors were found, this is by no means an exhaustive test

SRP 0% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle applies for WordPress plugins as well - please make sure your PHP files perform no actions when accessed directly
Almost there! Just fix the following items
  • 4× PHP files perform the task of outputting text when accessed with GET requests:
    • > /wp-content/plugins/italy-cookie-choices/js/bigbutton/cookiechoices.php
    • > /wp-content/plugins/italy-cookie-choices/js/default/cookiechoices.php
    • > /wp-content/plugins/italy-cookie-choices/js/smallbutton/cookiechoices.php
    • > /wp-content/plugins/italy-cookie-choices/js/cookiechoices.php
  • 9× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Interface 'Overclokk\\Cookie\\Cookie_Interface' not found in wp-content/plugins/italy-cookie-choices/vendor/overclokk/cookie/src/Cookie.php:22
    • > PHP Fatal error
      Uncaught Error: Call to undefined function Italy_Cookie_Choices\\Admin\\is_admin() in wp-content/plugins/italy-cookie-choices/init-admin.php:14
    • > PHP Fatal error
      Uncaught Error: Using $this when not in object context in wp-content/plugins/italy-cookie-choices/admin/template/block-script.php:4
    • > PHP Fatal error
      require(): Failed opening required 'wp-content/plugins/italy-cookie-choices/vendor/overclokk/cookie/vendor/autoload.php' (include_path='.:/usr/share/php') in wp-content/plugins/italy-cookie-choices/vendor/overclokk/cookie/cookie.php on line 38
    • > PHP Fatal error
      Uncaught Error: Call to undefined function settings_fields() in wp-content/plugins/italy-cookie-choices/admin/template/admin.php:21
    • > PHP Fatal error
      Uncaught Error: Using $this when not in object context in wp-content/plugins/italy-cookie-choices/admin/template/allow-script.php:4
    • > PHP Warning
      require(wp-content/plugins/italy-cookie-choices/vendor/overclokk/cookie/vendor/autoload.php): failed to open stream: No such file or directory in wp-content/plugins/italy-cookie-choices/vendor/overclokk/cookie/cookie.php on line 38
    • > PHP Fatal error
      Uncaught Error: Call to undefined function register_activation_hook() in wp-content/plugins/italy-cookie-choices/bootstrap.php:31
    • > PHP Fatal error
      Uncaught Error: Call to undefined function Italy_Cookie_Choices\\Core\\is_admin() in wp-content/plugins/italy-cookie-choices/init.php:16

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 issues were found

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 88% from 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
Please fix the following attributes:
  • Tags: Please reduce the number of tags, currently 16 tag instead of maximum 10
  • Donate link: Invalid URI ("")
The official readme.txt might help

italy-cookie-choices/italy-cookie-choices.php Passed 13 tests

"Italy Cookie Choices (for EU Cookie Law & Cookie Notice)" version 2.5.3's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
119 characters long description:
Italy Cookie Choices allows you to easily comply with the european cookie law and block third part cookie in your page.

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
No dangerous file extensions were detected7,279 lines of code in 54 files:
LanguageFilesBlank linesComment linesLines of code
PHP409781,7624,980
JavaScript73694201,026
Markdown41570636
PO File2244316636
CSS1001

PHP code Passed 2 tests

An overview of cyclomatic complexity and code structure
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.50
Average class complexity33.83
▷ Minimum class complexity1.00
▷ Maximum class complexity140.00
Average method complexity4.13
▷ Minimum method complexity1.00
▷ Maximum method complexity44.00
Code structure
Namespaces5
Interfaces1
Traits0
Classes11
▷ Abstract classes00.00%
▷ Concrete classes11100.00%
▷ Final classes00.00%
Methods130
▷ Static methods2216.92%
▷ Public methods11890.77%
▷ Protected methods00.00%
▷ Private methods129.23%
Functions14
▷ Named functions1178.57%
▷ Anonymous functions321.43%
Constants7
▷ Global constants7100.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
No PNG images were found in this plugin