79% pressidium-cookie-consent

Code Review | Pressidium Cookie Consent

WordPress plugin Pressidium Cookie Consent scored79%from 54 tests.

About plugin

  • Plugin page: pressidium-cookie...
  • Plugin version: 1.3.0
  • PHP compatiblity: 7.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 6.0-6.4
  • WordPress version: 6.3.1
  • First release: Jun 19, 2023
  • Latest release: Nov 30, 2023
  • Number of updates: 17
  • Update frequency: every 10.0 days
  • Top authors: pressidium (100%)

Code review

54 tests

User reviews

1 review

Install metrics

60+ active /911 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
This plugin's installer ran successfully

Server metrics [RAM: ▲0.12MB] [CPU: ▼4.08ms] Passed 4 tests

Analyzing server-side resources used by Pressidium Cookie Consent
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.60 ▲0.1344.00 ▲0.43
Dashboard /wp-admin3.43 ▲0.0845.92 ▼12.87
Posts /wp-admin/edit.php3.54 ▲0.1950.86 ▲1.66
Add New Post /wp-admin/post-new.php6.03 ▲0.1492.68 ▼5.52
Media Library /wp-admin/upload.php3.35 ▲0.1236.75 ▲4.55

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

Input-output and database impact of this plugin
The plugin installed successfully
Filesystem: 126 new files
Database: 1 new table, 7 new options
New tables
wp_pressidium_cookie_consents
New WordPress options
widget_recent-posts
can_compress_scripts
theysaidso_admin_options
db_upgraded
pressidium_cookie_consent_table_versions
widget_recent-comments
widget_theysaidso_widget

Browser metrics Passed 4 tests

A check of browser resources used by Pressidium Cookie Consent
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,879 ▲11714.34 ▼0.012.69 ▲0.9644.57 ▼0.52
Dashboard /wp-admin2,253 ▲765.61 ▲0.0390.08 ▼3.1342.83 ▼1.89
Posts /wp-admin/edit.php2,154 ▲571.98 ▲0.0240.24 ▼1.8935.03 ▼0.97
Add New Post /wp-admin/post-new.php1,551 ▲2523.30 ▲0.12643.62 ▲51.8950.90 ▼9.66
Media Library /wp-admin/upload.php1,452 ▲524.22 ▼0.0495.80 ▼3.3941.21 ▼2.12

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
    • theysaidso_admin_options
    • db_upgraded
    • widget_recent-posts
    • widget_theysaidso_widget
    • widget_recent-comments

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
The smoke test was a success, however most plugin functionality was not tested

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
Please fix the following items
  • 30× PHP files output non-empty strings when accessed directly via GET requests (only 10 are shown):
    • > /wp-content/plugins/pressidium-cookie-consent/includes/Admin/Page.php
    • > /wp-content/plugins/pressidium-cookie-consent/includes/Feedback/Feedback.php
    • > /wp-content/plugins/pressidium-cookie-consent/pressidium-cookie-consent.php
    • > /wp-content/plugins/pressidium-cookie-consent/includes/Sanitizer.php
    • > /wp-content/plugins/pressidium-cookie-consent/includes/Feedback/Feedback_Exception.php
    • > /wp-content/plugins/pressidium-cookie-consent/includes/Database/Tables/Consents_Table.php
    • > /wp-content/plugins/pressidium-cookie-consent/includes/Migrator.php
    • > /wp-content/plugins/pressidium-cookie-consent/includes/Logs.php
    • > /wp-content/plugins/pressidium-cookie-consent/includes/Client/Cookie_Consent.php
    • > /wp-content/plugins/pressidium-cookie-consent/includes/Utils.php
  • 28× PHP files trigger server-side errors or warnings when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Interface 'Pressidium\\WP\\CookieConsent\\Dependencies\\League\\Container\\Argument\\ArgumentResolverInterface' not found in wp-content/plugins/pressidium-cookie-consent/includes/Dependencies/League/Container/Inflector/Inflector.php:9
    • > PHP Fatal error
      Uncaught Error: Class 'Pressidium\\WP\\CookieConsent\\Dependencies\\Psr\\Log\\AbstractLogger' not found in wp-content/plugins/pressidium-cookie-consent/includes/Dependencies/Psr/Log/NullLogger.php:13
    • > PHP Fatal error
      Uncaught Error: Interface 'Pressidium\\WP\\CookieConsent\\Dependencies\\League\\Container\\Inflector\\InflectorAggregateInterface' not found in wp-content/plugins/pressidium-cookie-consent/includes/Dependencies/League/Container/Inflector/InflectorAggregate.php:8
    • > PHP Fatal error
      Uncaught Error: Interface 'Pressidium\\WP\\CookieConsent\\Dependencies\\League\\Container\\Argument\\ClassNameInterface' not found in wp-content/plugins/pressidium-cookie-consent/includes/Dependencies/League/Container/Argument/ClassName.php:5
    • > PHP Fatal error
      Uncaught Error: Interface 'Pressidium\\WP\\CookieConsent\\Dependencies\\League\\Container\\ServiceProvider\\ServiceProviderAggregateInterface' not found in wp-content/plugins/pressidium-cookie-consent/includes/Dependencies/League/Container/ServiceProvider/ServiceProviderAggregate.php:9
    • > PHP Fatal error
      Uncaught Error: Interface 'Pressidium\\WP\\CookieConsent\\Dependencies\\League\\Container\\Argument\\ArgumentResolverInterface' not found in wp-content/plugins/pressidium-cookie-consent/includes/Dependencies/League/Container/ReflectionContainer.php:13
    • > PHP Fatal error
      Uncaught Error: Interface 'Pressidium\\WP\\CookieConsent\\Dependencies\\League\\Container\\Argument\\RawArgumentInterface' not found in wp-content/plugins/pressidium-cookie-consent/includes/Dependencies/League/Container/Argument/RawArgument.php:5
    • > PHP Fatal error
      Uncaught Error: Interface 'Pressidium\\WP\\CookieConsent\\Dependencies\\League\\Container\\ServiceProvider\\ServiceProviderInterface' not found in wp-content/plugins/pressidium-cookie-consent/includes/Dependencies/League/Container/ServiceProvider/AbstractServiceProvider.php:7
    • > PHP Fatal error
      Uncaught Error: Class 'Pressidium\\WP\\CookieConsent\\Feedback\\API' not found in wp-content/plugins/pressidium-cookie-consent/includes/Feedback/Feedback_API.php:24
    • > PHP Fatal error
      Uncaught Error: Interface 'Pressidium\\WP\\CookieConsent\\Dependencies\\League\\Container\\ContainerAwareInterface' not found in wp-content/plugins/pressidium-cookie-consent/includes/Dependencies/League/Container/Definition/DefinitionInterface.php:7

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
Everything seems fine on the user side

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
5 plugin tags: ccpa, gdpr, cookies, cookie, consent

pressidium-cookie-consent/pressidium-cookie-consent.php Passed 13 tests

"Pressidium Cookie Consent" version 1.3.0's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
134 characters long description:
Lightweight, user-friendly and customizable cookie consent banner to help you comply with the EU GDPR cookie law and CCPA regulations.

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 detected36,522 lines of code in 104 files:
LanguageFilesBlank linesComment linesLines of code
JSON40030,289
PHP931,3673,8185,019
CSS3195361,124
JavaScript40290

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.30
Average class complexity5.41
▷ Minimum class complexity1.00
▷ Maximum class complexity48.00
Average method complexity1.89
▷ Minimum method complexity1.00
▷ Maximum method complexity18.00
Code structure
Namespaces21
Interfaces21
Traits4
Classes55
▷ Abstract classes610.91%
▷ Concrete classes4989.09%
▷ Final classes36.12%
Methods443
▷ Static methods378.35%
▷ Public methods37183.75%
▷ Protected methods255.64%
▷ Private methods4710.61%
Functions25
▷ Named functions416.00%
▷ Anonymous functions2184.00%
Constants31
▷ Global constants516.13%
▷ Class constants2683.87%
▷ Public constants26100.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
1 PNG file occupies 0.06MB with 0.04MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
icon.png59.67KB23.14KB▼ 61.22%