74% gdpr-compliance-cookie-consent

Code Review | GDPR Compliance & Cookie Consent

WordPress plugin GDPR Compliance & Cookie Consent scored74%from 54 tests.

About plugin

  • Plugin page: gdpr-compliance-c...
  • Plugin version: 1.3
  • PHP version: 7.4.16
  • WordPress compatibility: 4.6-5.6
  • WordPress version: 6.3.1
  • First release: Jun 25, 2019
  • Latest release: Jul 28, 2023
  • Number of updates: 17
  • Update frequency: every 88.1 days
  • Top authors: stylemix (100%)

Code review

54 tests

User reviews

8 reviews

Install metrics

20,000+ active /356,046 total downloads

Benchmarks

Plugin footprint 65% 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.39MB] [CPU: ▼38.04ms] Passed 4 tests

An overview of server-side resources used by GDPR Compliance & Cookie Consent
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.74 ▲0.2737.09 ▼5.30
Dashboard /wp-admin3.59 ▲0.2428.44 ▼37.00
Posts /wp-admin/edit.php3.59 ▲0.2328.29 ▼24.31
Add New Post /wp-admin/post-new.php3.59 ▼2.3024.29 ▼82.58
Media Library /wp-admin/upload.php3.59 ▲0.3628.98 ▼8.28

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

How much does this plugin use your filesystem and database?
There were no storage issued detected upon installing this plugin
Filesystem: 113 new files
Database: no new tables, 7 new options
New WordPress options
db_upgraded
theysaidso_admin_options
widget_recent-posts
can_compress_scripts
widget_theysaidso_widget
widget_recent-comments
widget_stm_gdpr_widget

Browser metrics Passed 4 tests

GDPR Compliance & Cookie Consent: an overview of browser usage
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,933 ▲18713.54 ▼0.678.98 ▲7.1340.29 ▼2.42
Dashboard /wp-admin2,231 ▲515.71 ▲0.0387.78 ▼3.3040.00 ▲0.67
Posts /wp-admin/edit.php2,133 ▲332.10 ▲0.0938.40 ▲1.3732.27 ▼1.30
Add New Post /wp-admin/post-new.php1,554 ▲2823.47 ▲5.88648.61 ▼57.4265.16 ▲7.63
Media Library /wp-admin/upload.php1,430 ▲334.36 ▲0.15106.88 ▲5.3545.12 ▲0.29

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
You still need to fix the following
  • This plugin did not uninstall without warnings or errors
    • > User deprecated in wp-includes/functions.php+5453
    Function get_page_by_title is deprecated since version 6.2.0! Use WP_Query instead.
  • The uninstall procedure has failed, leaving 7 options in the database
    • widget_stm_gdpr_widget
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • db_upgraded
    • widget_recent-comments
    • widget_recent-posts
    • can_compress_scripts

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
Everything seems fine, however this is by no means an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | It is important to ensure that your PHP files perform no action when accessed directly, respecting the single-responsibility principle
Almost there! Just fix the following items
  • 41× PHP files trigger server errors when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'CMB2_Type_Base' not found in wp-content/plugins/gdpr-compliance-cookie-consent/includes/cmb2/includes/types/CMB2_Type_Text.php:13
    • > PHP Fatal error
      Uncaught Error: Class 'CMB2_Type_Text' not found in wp-content/plugins/gdpr-compliance-cookie-consent/includes/cmb2/includes/types/CMB2_Type_Picker_Base.php:13
    • > PHP Fatal error
      Uncaught Error: Class 'CMB2_Type_Radio' not found in wp-content/plugins/gdpr-compliance-cookie-consent/includes/cmb2/includes/types/CMB2_Type_Multicheck.php:13
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/gdpr-compliance-cookie-consent/includes/cmb2/includes/helper-functions.php:131
    • > PHP Fatal error
      Uncaught Error: Class 'CMB2_Type_Taxonomy_Base' not found in wp-content/plugins/gdpr-compliance-cookie-consent/includes/cmb2/includes/types/CMB2_Type_Taxonomy_Radio.php:13
    • > PHP Fatal error
      Uncaught Error: Class 'CMB2_Type_Text' not found in wp-content/plugins/gdpr-compliance-cookie-consent/includes/cmb2/includes/types/CMB2_Type_File_Base.php:13
    • > PHP Fatal error
      Uncaught Error: Class 'CMB2_Type_Text' not found in wp-content/plugins/gdpr-compliance-cookie-consent/includes/cmb2/includes/types/CMB2_Type_Colorpicker.php:13
    • > PHP Fatal error
      Uncaught Error: Class 'CMB2_Type_Base' not found in wp-content/plugins/gdpr-compliance-cookie-consent/includes/cmb2/includes/types/CMB2_Type_Textarea.php:13
    • > PHP Fatal error
      Uncaught Error: Class 'CMB2_Hookup_Base' not found in wp-content/plugins/gdpr-compliance-cookie-consent/includes/cmb2/includes/CMB2_hookup.php:14
    • > PHP Fatal error
      Uncaught Error: Class 'CMB2_Hookup_Base' not found in wp-content/plugins/gdpr-compliance-cookie-consent/includes/cmb2/includes/rest-api/CMB2_REST.php:19

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
There were no browser issues found

Optimizations

Plugin configuration 93% 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
These attributes need to be fixed:
  • Screenshots: Screenshot #4 (privacy policy) image required
The official readme.txt is a good inspiration

gdpr-compliance-cookie-consent/gdpr-compliance-cookie-consent.php 92% from 13 tests

The entry point to "GDPR Compliance & Cookie Consent" version 1.3 is a PHP file that has certain tags in its header comment area
The following require your attention:
  • Description: Please don't use more than 140 characters for the plugin description (currently 258 characters long)

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
Good job! No executable or dangerous file extensions detected13,939 lines of code in 91 files:
LanguageFilesBlank linesComment linesLines of code
PHP672,4555,8797,712
CSS151,1841,1484,768
JavaScript93465021,459

PHP code Passed 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.48
Average class complexity17.70
▷ Minimum class complexity1.00
▷ Maximum class complexity181.00
Average method complexity3.22
▷ Minimum method complexity1.00
▷ Maximum method complexity28.00
Code structure
Namespaces3
Interfaces0
Traits0
Classes79
▷ Abstract classes810.13%
▷ Concrete classes7189.87%
▷ Final classes00.00%
Methods597
▷ Static methods11519.26%
▷ Public methods50484.42%
▷ Protected methods8814.74%
▷ Private methods50.84%
Functions22
▷ Named functions2195.45%
▷ Anonymous functions14.55%
Constants21
▷ Global constants838.10%
▷ Class constants1361.90%
▷ Public constants13100.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
14 compressed PNG files occupy 0.02MB
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
includes/cmb2/images/ui-bg_glass_65_ffffff_1x400.png0.10KB0.10KB▼ 5.71%
includes/cmb2/images/ui-bg_highlight-soft_75_cccccc_1x100.png0.10KB0.17KB0.00%
includes/cmb2/images/ui-icons_222222_256x240.png4.27KB4.11KB▼ 3.78%
includes/cmb2/images/ico-delete.png0.70KB0.72KB0.00%
includes/cmb2/images/ui-bg_glass_95_fef1ec_1x400.png0.12KB0.14KB0.00%