84% tarteaucitronjs

Code Review | tarteaucitron.js - Cookies legislation & GDPR

WordPress plugin tarteaucitron.js - Cookies legislation & GDPR scored84%from 54 tests.

About plugin

  • Plugin page: tarteaucitronjs
  • Plugin version: 1.6.5
  • PHP version: 7.4.16
  • WordPress compatibility: 2.8-6.1
  • WordPress version: 6.3.1
  • First release: Jan 31, 2015
  • Latest release: May 11, 2023
  • Number of updates: 72
  • Update frequency: every 42.0 days
  • Top authors: AmauriC (100%)

Code review

54 tests

User reviews

13 reviews

Install metrics

10,000+ active /97,206 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.09MB] [CPU: ▼2.11ms] Passed 4 tests

Analyzing server-side resources used by tarteaucitron.js - Cookies legislation & GDPR
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.56 ▲0.0947.18 ▲1.37
Dashboard /wp-admin3.39 ▲0.0951.46 ▼3.78
Posts /wp-admin/edit.php3.50 ▲0.1548.79 ▲2.10
Add New Post /wp-admin/post-new.php5.99 ▲0.1196.33 ▼8.13
Media Library /wp-admin/upload.php3.31 ▲0.0942.23 ▲5.55
tarteaucitron.js /wp-admin/options-general.php?page=tarteaucitronjs3.2834.29

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

How much does this plugin use your filesystem and database?
This plugin installed successfully
Filesystem: 12 new files
Database: no new tables, 6 new options
New WordPress options
widget_theysaidso_widget
widget_recent-posts
theysaidso_admin_options
widget_recent-comments
can_compress_scripts
db_upgraded

Browser metrics Passed 4 tests

This is an overview of browser requirements for tarteaucitron.js - Cookies legislation & GDPR
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,862 ▲11613.25 ▼0.952.25 ▲0.5137.80 ▼8.07
Dashboard /wp-admin2,227 ▲394.85 ▼0.0598.57 ▼5.4537.66 ▼6.10
Posts /wp-admin/edit.php2,128 ▲572.01 ▼0.0240.38 ▲4.2834.49 ▼1.24
Add New Post /wp-admin/post-new.php1,529 ▲1023.36 ▼0.04654.56 ▼26.6660.41 ▲10.85
Media Library /wp-admin/upload.php1,412 ▲274.22 ▼0.0999.56 ▲0.0847.87 ▲0.77
tarteaucitron.js /wp-admin/options-general.php?page=tarteaucitronjs8352.0325.5729.51

Uninstaller [IO: ▲0.00MB] [DB: ▲0.00MB] 75% from 4 tests

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
These items require your attention
  • The uninstall procedure has failed, leaving 6 options in the database
    • widget_theysaidso_widget
    • widget_recent-comments
    • theysaidso_admin_options
    • db_upgraded
    • can_compress_scripts
    • widget_recent-posts

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Even though no errors were found, this is by no means 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
Please fix the following items
  • 4× PHP files output non-empty strings when accessed directly via GET requests:
    • > /wp-content/plugins/tarteaucitronjs/Sidebars.php
    • > /wp-content/plugins/tarteaucitronjs/Widgets.php
    • > /wp-content/plugins/tarteaucitronjs/Admin.php
    • > /wp-content/plugins/tarteaucitronjs/tarteaucitron.php

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)
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 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
4 plugin tags: rgpd, gdpr, tarteaucitron, cookie

tarteaucitronjs/tarteaucitron.php 92% from 13 tests

The main PHP script in "tarteaucitron.js - Cookies legislation & GDPR" version 1.6.5 is automatically included on every request by WordPress
Please make the necessary changes and fix the following:
  • Main file name: The principal plugin file should be the same as the plugin slug ("tarteaucitronjs.php" instead of "tarteaucitron.php")

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 detected642 lines of code in 9 files:
LanguageFilesBlank linesComment linesLines of code
PHP411027417
CSS387108
PO File1354677
JavaScript15040

PHP code Passed 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
This plugin has no cyclomatic complexity problems
Cyclomatic complexity
Average complexity per logical line of code0.51
Average class complexity8.00
▷ Minimum class complexity8.00
▷ Maximum class complexity8.00
Average method complexity2.75
▷ Minimum method complexity1.00
▷ Maximum method complexity5.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods4
▷ Static methods00.00%
▷ Public methods4100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions15
▷ Named functions1493.33%
▷ Anonymous functions16.67%
Constants2
▷ Global constants2100.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
There were not PNG files found in your plugin