65% gdpr-consent-lite

Code Review | GDPR Consent Plugin

WordPress plugin GDPR Consent Plugin scored65%from 54 tests.

About plugin

  • Plugin page: gdpr-consent-lite
  • Plugin version: 3.0.10
  • PHP compatiblity: 5.6.2+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.5.1-5.5
  • WordPress version: 6.3.1
  • First release: Oct 16, 2020
  • Latest release: Nov 24, 2020
  • Number of updates: 26
  • Update frequency: every 1.8 days
  • Top authors: wpupgrader (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /532 total downloads

Benchmarks

Plugin footprint 82% 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 successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.19MB] [CPU: ▼0.48ms] Passed 4 tests

Server-side resources used by GDPR Consent Plugin
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.77 ▲0.3146.22 ▲6.73
Dashboard /wp-admin3.47 ▲0.1750.03 ▲1.31
Posts /wp-admin/edit.php3.58 ▲0.2344.92 ▼1.61
Add New Post /wp-admin/post-new.php6.08 ▲0.1982.01 ▼4.75
Media Library /wp-admin/upload.php3.39 ▲0.1735.65 ▲3.12
All Consents /wp-admin/edit.php?post_type=gdprc_consent3.4838.73
Add New Consent /wp-admin/post-new.php?post_type=gdprc_consent3.4541.84
Settings /wp-admin/options-general.php?page=gdpr-consent-settings3.1023.39

Server storage [IO: ▲2.16MB] [DB: ▲0.00MB] 67% from 3 tests

Input-output and database impact of this plugin
These are issues you should consider
  • There were 1 file (1.92KB) illegally modified outside of "wp-content/plugins/gdpr-consent-lite/" and "wp-content/uploads/"
    • (new file) wp-content/mu-plugins/gdprc-mu-plugin.php
Filesystem: 192 new files
Database: no new tables, 8 new options
New WordPress options
db_upgraded
theysaidso_admin_options
widget_recent-posts
gdprc_firsttime_setup
widget_theysaidso_widget
gdpr-consent-settings
widget_recent-comments
can_compress_scripts

Browser metrics Passed 4 tests

Checking browser requirements for GDPR Consent Plugin
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,115 ▲38013.87 ▼0.4416.63 ▲14.6951.70 ▲3.70
Dashboard /wp-admin2,278 ▲935.95 ▲0.13112.88 ▼15.9644.17 ▼2.76
Posts /wp-admin/edit.php2,163 ▲772.26 ▲0.2339.56 ▲4.4435.72 ▲1.02
Add New Post /wp-admin/post-new.php1,573 ▲5223.37 ▲0.32662.52 ▼22.6863.37 ▲12.61
Media Library /wp-admin/upload.php1,460 ▲694.35 ▲0.16102.83 ▲2.4844.87 ▲0.79
All Consents /wp-admin/edit.php?post_type=gdprc_consent1,6572.2434.0033.67
Add New Consent /wp-admin/post-new.php?post_type=gdprc_consent3,8848.59187.97133.62
Settings /wp-admin/options-general.php?page=gdpr-consent-settings280.440.083.39

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
It is recommended to fix the following
  • Zombie WordPress options were found after uninstall: 8 options
    • widget_recent-comments
    • theysaidso_admin_options
    • db_upgraded
    • gdpr-consent-settings
    • widget_recent-posts
    • gdprc_firsttime_setup
    • widget_theysaidso_widget
    • can_compress_scripts

Smoke tests 0% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
Smoke test failed, please fix the following
  • 3 occurences, only the last one shown
    • > GET request to /wp-admin/post-new.php?post_type=gdprc_consent
    • > Notice in wp-content/plugins/gdpr-consent-lite/Src/GdprConsentLite/Hooks/Actions/add_meta_boxes.php+74
    Undefined index: post

SRP 0% from 2 tests

🔹 Tests weight: 20 | A shallow check of the single-responsibility principle; PHP files should perform no action - including output of placeholder text - and trigger no errors when accessed directly
Please fix the following
  • 3× PHP files perform the action of outputting non-empty strings when accessed directly:
    • > /wp-content/plugins/gdpr-consent-lite/Library/Core/Core.php
    • > /wp-content/plugins/gdpr-consent-lite/mu/plugin-controller.php
    • > /wp-content/plugins/gdpr-consent-lite/GdprConsentPlugin.php
  • 136× PHP files trigger server-side errors or warnings when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'Composer\\Installers\\BaseInstaller' not found in wp-content/plugins/gdpr-consent-lite/vendor/composer/installers/src/Composer/Installers/SilverStripeInstaller.php:6
    • > PHP Fatal error
      Uncaught Error: Class 'Wpupgrader\\Libraries\\WordPress\\Plugins\\Core\\Settings' not found in wp-content/plugins/gdpr-consent-lite/Src/GdprConsentLite/Settings.php:4
    • > PHP Fatal error
      Uncaught Error: Class 'Wpupgrader\\Libraries\\WordPress\\Plugins\\Core\\Factory' not found in wp-content/plugins/gdpr-consent-lite/Library/Core/Factory/Blocks.php:6
    • > PHP Fatal error
      Uncaught Error: Class 'Composer\\Installers\\BaseInstaller' not found in wp-content/plugins/gdpr-consent-lite/vendor/composer/installers/src/Composer/Installers/TYPO3CmsInstaller.php:11
    • > PHP Fatal error
      Uncaught Error: Class 'Composer\\Installers\\BaseInstaller' not found in wp-content/plugins/gdpr-consent-lite/vendor/composer/installers/src/Composer/Installers/CakePHPInstaller.php:6
    • > PHP Fatal error
      Uncaught Error: Class 'Composer\\Installers\\BaseInstaller' not found in wp-content/plugins/gdpr-consent-lite/vendor/composer/installers/src/Composer/Installers/PxcmsInstaller.php:4
    • > PHP Fatal error
      Uncaught Error: Class 'Composer\\Installers\\BaseInstaller' not found in wp-content/plugins/gdpr-consent-lite/vendor/composer/installers/src/Composer/Installers/MODXEvoInstaller.php:7
    • > PHP Fatal error
      Uncaught Error: Class 'Composer\\Installers\\BaseInstaller' not found in wp-content/plugins/gdpr-consent-lite/vendor/composer/installers/src/Composer/Installers/ClanCatsFrameworkInstaller.php:4
    • > PHP Fatal error
      Uncaught Error: Class 'Wpupgrader\\Libraries\\WordPress\\Plugins\\Core\\Blocks\\Block' not found in wp-content/plugins/gdpr-consent-lite/Src/GdprConsentLite/Blocks/AbstractConsentsBlock.php:4
    • > PHP Fatal error
      Uncaught Error: Class 'Composer\\Installers\\BaseInstaller' not found in wp-content/plugins/gdpr-consent-lite/vendor/composer/installers/src/Composer/Installers/SiteDirectInstaller.php:5

User-side errors 0% from 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
These are user-side errors you should fix
    • > GET request to /wp-admin/options-general.php?page=gdpr-consent-settings
    • > Network (severe)
    wp-admin/options-general.php?page=gdpr-consent-settings - Failed to load resource: the server responded with a status of 403 (Forbidden)

Optimizations

Plugin configuration 83% from 29 tests

readme.txt 94% from 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
These attributes need to be fixed:
  • Tags: You are using too many tags: 13 tag instead of maximum 10
You can take inspiration from this readme.txt

gdpr-consent-lite/GdprConsentPlugin.php 69% from 13 tests

The main PHP file in "GDPR Consent Plugin" ver. 3.0.10 adds more information about the plugin and also serves as the entry point for this plugin
It is important to fix the following:
  • Main file name: The principal plugin file should be the same as the plugin slug ("gdpr-consent-lite.php" instead of "GdprConsentPlugin.php")
  • Text Domain: The text domain follows the same naming rules as the plugin slug: lowercase characters and dashes
  • Domain Path: The domain path folder was not found ("/languages")
  • Description: If Twitter did it, so should we! Keep the description under 140 characters (currently 172 characters long)

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are not allowed as they can serve as attack vectors
Everything looks great! No dangerous files found in this plugin9,310 lines of code in 179 files:
LanguageFilesBlank linesComment linesLines of code
PHP1691,0351,2106,345
SVG1002,666
JSON300260
XML10034
CSS3003
JavaScript2002

PHP code Passed 2 tests

An overview of cyclomatic complexity and code structure
This plugin has no cyclomatic complexity problems
Cyclomatic complexity
Average complexity per logical line of code0.33
Average class complexity3.61
▷ Minimum class complexity1.00
▷ Maximum class complexity39.00
Average method complexity2.37
▷ Minimum method complexity1.00
▷ Maximum method complexity18.00
Code structure
Namespaces19
Interfaces1
Traits2
Classes152
▷ Abstract classes117.24%
▷ Concrete classes14192.76%
▷ Final classes32.13%
Methods279
▷ Static methods4014.34%
▷ Public methods20372.76%
▷ Protected methods5620.07%
▷ Private methods207.17%
Functions42
▷ Named functions1535.71%
▷ Anonymous functions2764.29%
Constants7
▷ Global constants00.00%
▷ Class constants7100.00%
▷ Public constants7100.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
3 PNG files occupy 0.59MB with 0.40MB in potential savings
Potential savings
Compression of 3 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/lib/upgrade.png549.22KB88.24KB▼ 83.93%
assets/lib/gdpr.png24.20KB7.79KB▼ 67.80%
assets/lib/bg.png34.43KB17.41KB▼ 49.44%