67% complianz-gdpr

Code Review | Complianz - GDPR/CCPA Cookie Consent

WordPress plugin Complianz - GDPR/CCPA Cookie Consent scored67%from 54 tests.

About plugin

  • Plugin page: complianz-gdpr
  • Plugin version: 6.5.5
  • PHP compatiblity: 7.2+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.9-6.3
  • WordPress version: 6.3.1
  • First release: Jun 26, 2018
  • Latest release: Oct 11, 2023
  • Number of updates: 424
  • Update frequency: every 4.6 days
  • Top authors: RogierLankhorst (99.06%)hesseldejong (1.18%)

Code review

54 tests

User reviews

1166 reviews

Install metrics

700,000+ active /12,956,841 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
Installer ran successfully

Server metrics [RAM: ▲3.78MB] [CPU: ▲84.57ms] Passed 4 tests

Analyzing server-side resources used by Complianz - GDPR/CCPA Cookie Consent
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /6.41 ▲2.9599.50 ▲56.03
Dashboard /wp-admin7.47 ▲4.13203.42 ▲141.52
Posts /wp-admin/edit.php7.48 ▲4.12209.61 ▲156.81
Add New Post /wp-admin/post-new.php9.92 ▲4.04159.39 ▲52.80
Media Library /wp-admin/upload.php7.26 ▲4.03122.80 ▲87.94
Wizard /wp-admin/admin.php?page=cmplz-wizard7.40158.33
Integrations /wp-admin/admin.php?page=cmplz-script-center7.40104.43
Proof of consent /wp-admin/admin.php?page=cmplz-proof-of-consent7.31100.83
Dashboard /wp-admin/admin.php?page=complianz7.35139.45
Cookie banner /wp-admin/admin.php?page=cmplz-cookiebanner7.2698.37
Settings /wp-admin/admin.php?page=cmplz-settings7.54105.27

Server storage [IO: ▲21.30MB] [DB: ▲0.03MB] Passed 3 tests

Analyzing filesystem and database footprints of this plugin
No storage issues were detected
Filesystem: 1,412 new files
Database: 4 new tables, 17 new options
New tables
wp_cmplz_cookies
wp_cmplz_dnsmpd
wp_cmplz_cookiebanners
wp_cmplz_services
New WordPress options
cmplz_detected_stats
cmplz_last_cookie_scan
db_upgraded
cmplz_cbdb_version
widget_recent-comments
can_compress_scripts
cmplz_show_terms_conditions_notice
theysaidso_admin_options
widget_theysaidso_widget
widget_recent-posts
...

Browser metrics Passed 4 tests

Checking browser requirements for Complianz - GDPR/CCPA Cookie Consent
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,394 ▲63313.69 ▼1.0219.92 ▲18.1642.54 ▼0.76
Dashboard /wp-admin2,642 ▲4626.06 ▲0.40116.98 ▲25.3589.52 ▲47.21
Posts /wp-admin/edit.php2,541 ▲4382.50 ▲0.4655.54 ▲17.3632.66 ▼6.50
Add New Post /wp-admin/post-new.php1,584 ▲5819.25 ▼3.92765.55 ▲99.8064.23 ▲14.84
Media Library /wp-admin/upload.php1,472 ▲724.20 ▼0.00105.58 ▼5.4768.30 ▲20.51
Wizard /wp-admin/admin.php?page=cmplz-wizard1,6734.04102.6074.35
Integrations /wp-admin/admin.php?page=cmplz-script-center2,0883.9896.88101.23
Proof of consent /wp-admin/admin.php?page=cmplz-proof-of-consent1,2533.1953.7845.35
Dashboard /wp-admin/admin.php?page=complianz2,1003.4666.85118.61
Cookie banner /wp-admin/admin.php?page=cmplz-cookiebanner4,7868.40380.90163.42
Settings /wp-admin/admin.php?page=cmplz-settings3,1398.40160.93149.22

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
You still need to fix the following
  • Zombie tables were found after uninstall: 4 tables
    • wp_cmplz_dnsmpd
    • wp_cmplz_cookiebanners
    • wp_cmplz_cookies
    • wp_cmplz_services
  • Zombie WordPress options were found after uninstall: 17 options
    • cmplz_show_terms_conditions_notice
    • can_compress_scripts
    • cmplz_cbdb_version
    • widget_recent-posts
    • cmplz_detected_stats
    • cmplz_changed_cookies
    • widget_theysaidso_widget
    • cmplz_detected_thirdparty_services
    • cmplz_detected_social_media
    • cmplz_last_cookie_scan
    • ...

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

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

SRP 0% 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 take a closer look at the following
  • 168× PHP files output non-empty strings when accessed directly via GET requests (only 10 are shown):
    • > /wp-content/plugins/complianz-gdpr/class-wizard.php
    • > /wp-content/plugins/complianz-gdpr/integrations/plugins/hcaptcha.php
    • > /wp-content/plugins/complianz-gdpr/integrations/plugins/user-registration.php
    • > /wp-content/plugins/complianz-gdpr/templates/dashboard/tips-tricks-footer.php
    • > /wp-content/plugins/complianz-gdpr/integrations/services/advertising.php
    • > /wp-content/plugins/complianz-gdpr/templates/dashboard/other-plugins.php
    • > /wp-content/plugins/complianz-gdpr/integrations/plugins/google-site-kit.php
    • > /wp-content/plugins/complianz-gdpr/integrations/plugins/facebook-for-woocommerce.php
    • > /wp-content/plugins/complianz-gdpr/complianz-gpdr.php
    • > /wp-content/plugins/complianz-gdpr/integrations/services/dailymotion.php
  • 259× GET requests to PHP files trigger server-side errors or Error 500 responses (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'Mpdf\\Tag\\Tag' not found in wp-content/plugins/complianz-gdpr/assets/vendor/mpdf/mpdf/src/Tag/Option.php:7
    • > PHP Fatal error
      Uncaught Error: Class 'Mpdf\\MpdfException' not found in wp-content/plugins/complianz-gdpr/assets/vendor/mpdf/mpdf/src/Barcode/BarcodeException.php:5
    • > PHP Fatal error
      Uncaught Error: Class 'Mpdf\\Barcode\\AbstractBarcode' not found in wp-content/plugins/complianz-gdpr/assets/vendor/mpdf/mpdf/src/Barcode/Codabar.php:9
    • > PHP Fatal error
      Uncaught Error: Class 'setasign\\Fpdi\\PdfParser\\Type\\PdfType' not found in wp-content/plugins/complianz-gdpr/assets/vendor/setasign/fpdi/src/PdfParser/Type/PdfIndirectObjectReference.php:16
    • > PHP Fatal error
      Uncaught Error: Interface 'DeepCopy\\Matcher\\Matcher' not found in wp-content/plugins/complianz-gdpr/assets/vendor/myclabs/deep-copy/src/DeepCopy/Matcher/PropertyTypeMatcher.php:16
    • > PHP Fatal error
      Trait 'Mpdf\\Strict' not found in wp-content/plugins/complianz-gdpr/assets/vendor/mpdf/mpdf/src/Writer/FontWriter.php on line 10
    • > PHP Fatal error
      Uncaught Error: Class 'Mpdf\\Tag\\InlineTag' not found in wp-content/plugins/complianz-gdpr/assets/vendor/mpdf/mpdf/src/Tag/Tt.php:5
    • > PHP Fatal error
      Uncaught Error: Interface 'Psr\\Log\\LoggerAwareInterface' not found in wp-content/plugins/complianz-gdpr/assets/vendor/mpdf/mpdf/src/Mpdf.php:28
    • > PHP Fatal error
      Uncaught Error: Class 'Mpdf\\Tag\\Tag' not found in wp-content/plugins/complianz-gdpr/assets/vendor/mpdf/mpdf/src/Tag/Br.php:5
    • > PHP Fatal error
      Uncaught Error: Class 'Mpdf\\TTFontFile' not found in wp-content/plugins/complianz-gdpr/assets/vendor/mpdf/mpdf/src/TTFontFileAnalysis.php:5

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 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:
  • Tags: There are too many tags (12 tag instead of maximum 10)
The official readme.txt is a good inspiration

complianz-gdpr/complianz-gpdr.php 92% from 13 tests

Analyzing the main PHP file in "Complianz - GDPR/CCPA Cookie Consent" version 6.5.5
You should first fix the following items:
  • Main file name: The principal plugin file should be the same as the plugin slug ("complianz-gdpr.php" instead of "complianz-gpdr.php")

Code Analysis 95% from 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are considered dangerous and should not be included with any WordPress plugin
There were no executable files found in this plugin148,402 lines of code in 1,052 files:
LanguageFilesBlank linesComment linesLines of code
PHP64317,15919,184109,359
JavaScript1505,0214,73023,310
CSS1301292327,441
LESS848022515,852
Markdown1451801,467
JSON1210742
SVG1410137
XML411091
Bourne Shell1203

PHP code 0% from 2 tests

This plugin's cyclomatic complexity and code structure detailed below
It is recommended to fix the following
  • Class cyclomatic complexity should be reduced to less than 1000 (currently 7,024)
  • Please reduce cyclomatic complexity of methods to less than 100 (currently 460)
Cyclomatic complexity
Average complexity per logical line of code0.52
Average class complexity59.09
▷ Minimum class complexity1.00
▷ Maximum class complexity7,024.00
Average method complexity10.84
▷ Minimum method complexity1.00
▷ Maximum method complexity460.00
Code structure
Namespaces50
Interfaces25
Traits6
Classes325
▷ Abstract classes92.77%
▷ Concrete classes31697.23%
▷ Final classes154.75%
Methods2,174
▷ Static methods1607.36%
▷ Public methods1,89487.12%
▷ Protected methods803.68%
▷ Private methods2009.20%
Functions624
▷ Named functions56891.03%
▷ Anonymous functions568.97%
Constants467
▷ Global constants439.21%
▷ Class constants42490.79%
▷ Public constants424100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
17 PNG files occupy 0.11MB with 0.05MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/images/icon-128x128.png2.41KB1.13KB▼ 53.23%
assets/images/down.png2.64KB1.63KB▼ 38.33%
assets/images/gutenberg-preview.png20.25KB12.11KB▼ 40.20%
upgrade/img/really-simple-ssl.png11.96KB6.41KB▼ 46.40%
assets/vendor/myclabs/deep-copy/doc/graph.png6.29KB3.03KB▼ 51.86%