78% complianz-terms-conditions

Code Review | Complianz - Terms and Conditions

WordPress plugin Complianz - Terms and Conditions scored78%from 54 tests.

About plugin

  • Plugin page: complianz-terms-c...
  • Plugin version: 1.2.7
  • PHP compatiblity: 7.2+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.7-6.3
  • WordPress version: 6.3.1
  • First release: Feb 12, 2021
  • Latest release: Oct 3, 2023
  • Number of updates: 67
  • Update frequency: every 14.4 days
  • Top authors: RogierLankhorst (97.01%)hesseldejong (4.48%)

Code review

54 tests

User reviews

100 reviews

Install metrics

60,000+ active /729,746 total downloads

Benchmarks

Plugin footprint 83% 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.90MB] [CPU: ▲3.37ms] Passed 4 tests

Server-side resources used by Complianz - Terms and Conditions
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /4.03 ▲0.5646.53 ▲0.51
Dashboard /wp-admin4.32 ▲1.0254.93 ▲5.57
Posts /wp-admin/edit.php4.37 ▲1.0262.33 ▲14.12
Add New Post /wp-admin/post-new.php6.91 ▲1.0392.89 ▼0.79
Media Library /wp-admin/upload.php4.25 ▲1.0243.84 ▲8.20
Terms & Conditions /wp-admin/tools.php?page=terms-conditions4.3449.38

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

A short overview of filesystem and database impact
This plugin was installed successfully
Filesystem: 745 new files
Database: no new tables, 10 new options
New WordPress options
widget_theysaidso_widget
cmplz_tc_activation_time
widget_recent-comments
theysaidso_admin_options
db_upgraded
cmplz-tc-current-version
cmplz_pdf_dir_token
can_compress_scripts
widget_recent-posts
cmplz_generate_pdf_languages

Browser metrics Passed 4 tests

Complianz - Terms and Conditions: an overview of browser usage
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,793 ▲3214.40 ▲0.051.61 ▼0.2142.13 ▼0.10
Dashboard /wp-admin2,196 ▲195.56 ▼0.1090.14 ▼1.1039.43 ▼1.02
Posts /wp-admin/edit.php2,104 ▲42.02 ▼0.0234.12 ▼2.1235.04 ▼3.42
Add New Post /wp-admin/post-new.php6,197 ▲4,67119.00 ▼4.03932.80 ▲250.5160.47 ▲17.04
Media Library /wp-admin/upload.php1,404 ▲74.19 ▼0.0294.04 ▼17.0944.32 ▲1.11
Terms & Conditions /wp-admin/tools.php?page=terms-conditions2,6322.4627.4849.71

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
Please fix the following items
  • Zombie WordPress options detected upon uninstall: 10 options
    • widget_theysaidso_widget
    • can_compress_scripts
    • widget_recent-posts
    • theysaidso_admin_options
    • cmplz-tc-current-version
    • db_upgraded
    • cmplz_generate_pdf_languages
    • cmplz_tc_activation_time
    • cmplz_pdf_dir_token
    • widget_recent-comments

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
Even though everything seems fine, this is not an exhaustive test

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 take a closer look at the following
  • 17× GET requests to PHP files return non-empty strings (only 10 are shown):
    • > /wp-content/plugins/complianz-terms-conditions/complianz-terms-conditions.php
    • > /wp-content/plugins/complianz-terms-conditions/class-wizard.php
    • > /wp-content/plugins/complianz-terms-conditions/rest-api/rest-api.php
    • > /wp-content/plugins/complianz-terms-conditions/templates/wizard/other-plugins.php
    • > /wp-content/plugins/complianz-terms-conditions/class-review.php
    • > /wp-content/plugins/complianz-terms-conditions/download.php
    • > /wp-content/plugins/complianz-terms-conditions/config/documents/terms-conditions.php
    • > /wp-content/plugins/complianz-terms-conditions/functions.php
    • > /wp-content/plugins/complianz-terms-conditions/templates/wizard/section.php
    • > /wp-content/plugins/complianz-terms-conditions/class-document.php
  • 236× PHP files trigger server errors when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Interface 'Mpdf\\Language\\LanguageToFontInterface' not found in wp-content/plugins/complianz-terms-conditions/assets/vendor/mpdf/mpdf/src/Language/LanguageToFont.php:5
    • > PHP Fatal error
      Uncaught Error: Class 'Mpdf\\Barcode\\AbstractBarcode' not found in wp-content/plugins/complianz-terms-conditions/assets/vendor/mpdf/mpdf/src/Barcode/Code128.php:11
    • > PHP Fatal error
      Uncaught Error: Class 'Mpdf\\Tag\\InlineTag' not found in wp-content/plugins/complianz-terms-conditions/assets/vendor/mpdf/mpdf/src/Tag/Q.php:5
    • > PHP Fatal error
      Uncaught Error: Interface 'DeepCopy\\Filter\\Filter' not found in wp-content/plugins/complianz-terms-conditions/assets/vendor/myclabs/deep-copy/src/DeepCopy/Filter/Doctrine/DoctrineCollectionFilter.php:11
    • > PHP Fatal error
      Uncaught Error: Class 'Mpdf\\Tag\\BlockTag' not found in wp-content/plugins/complianz-terms-conditions/assets/vendor/mpdf/mpdf/src/Tag/FieldSet.php:5
    • > PHP Fatal error
      Uncaught Error: Class 'Mpdf\\Tag\\InlineTag' not found in wp-content/plugins/complianz-terms-conditions/assets/vendor/mpdf/mpdf/src/Tag/Sup.php:5
    • > PHP Fatal error
      Uncaught Error: Class 'setasign\\Fpdi\\Tcpdf\\Fpdi' not found in wp-content/plugins/complianz-terms-conditions/assets/vendor/setasign/fpdi/src/TcpdfFpdi.php:20
    • > PHP Fatal error
      Uncaught Error: Class 'Mpdf\\Tag\\Tag' not found in wp-content/plugins/complianz-terms-conditions/assets/vendor/mpdf/mpdf/src/Tag/Br.php:5
    • > PHP Fatal error
      Uncaught Error: Class 'Mpdf\\Tag\\Tag' not found in wp-content/plugins/complianz-terms-conditions/assets/vendor/mpdf/mpdf/src/Tag/TextCircle.php:8
    • > PHP Fatal error
      Uncaught Error: Class 'Mpdf\\Tag\\BlockTag' not found in wp-content/plugins/complianz-terms-conditions/assets/vendor/mpdf/mpdf/src/Tag/Div.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 on the user side

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
6 plugin tags: terms and conditions, terms, conditions, webshop, legal...

complianz-terms-conditions/complianz-terms-conditions.php 92% from 13 tests

The entry point to "Complianz - Terms and Conditions" version 1.2.7 is a PHP file that has certain tags in its header comment area
The following require your attention:
  • Requires at least: Required version must be the same as the one declared in readme.txt ("5.0" instead of "5.7")

Code Analysis 95% from 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short review of files and their extensions; it is not recommended to include executable files
There were no executable files found in this plugin123,821 lines of code in 569 files:
LanguageFilesBlank linesComment linesLines of code
PHP43912,74513,83682,206
JSON123023,215
JavaScript652,5567729,901
CSS121211123,897
LESS184531562,923
Markdown1552201,483
SVG310102
XML411091
Bourne Shell1203

PHP code 0% from 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
It is recommended to fix the following
  • Please reduce cyclomatic complexity of classes 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 complexity56.63
▷ Minimum class complexity1.00
▷ Maximum class complexity7,024.00
Average method complexity12.38
▷ Minimum method complexity1.00
▷ Maximum method complexity460.00
Code structure
Namespaces49
Interfaces25
Traits6
Classes301
▷ Abstract classes92.99%
▷ Concrete classes29297.01%
▷ Final classes144.79%
Methods1,704
▷ Static methods1518.86%
▷ Public methods1,49987.97%
▷ Protected methods553.23%
▷ Private methods1508.80%
Functions68
▷ Named functions3450.00%
▷ Anonymous functions3450.00%
Constants440
▷ Global constants163.64%
▷ Class constants42496.36%
▷ Public constants424100.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
5 PNG files occupy 0.03MB with 0.02MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/images/s.png2.73KB0.09KB▼ 96.60%
assets/images/gutenberg-preview.png20.25KB12.11KB▼ 40.20%
assets/images/icon-256x256.png4.47KB1.85KB▼ 58.71%
assets/images/down.png2.64KB1.63KB▼ 38.33%
assets/images/icon-128x128.png2.38KB0.94KB▼ 60.40%