83% gravity-forms-pdf-extended

Code Review | Gravity PDF

WordPress plugin Gravity PDF scored83%from 54 tests.

About plugin

  • Plugin page: gravity-forms-pdf...
  • Plugin version: 6.7.2
  • PHP compatiblity: 7.3+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.3-6.4
  • WordPress version: 6.3.1
  • First release: Sep 10, 2012
  • Latest release: Nov 17, 2023
  • Number of updates: 798
  • Update frequency: every 5.1 days
  • Top authors: Blue Liquid Designs (100%)

Code review

54 tests

User reviews

308 reviews

Install metrics

50,000+ active /1,425,327 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.05MB] [CPU: ▼0.03ms] Passed 4 tests

Analyzing server-side resources used by Gravity PDF
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.52 ▲0.0544.42 ▲3.20
Dashboard /wp-admin3.36 ▲0.0548.23 ▲1.52
Posts /wp-admin/edit.php3.47 ▲0.1145.83 ▼6.28
Add New Post /wp-admin/post-new.php5.94 ▲0.0585.27 ▲1.44
Media Library /wp-admin/upload.php3.28 ▲0.0538.88 ▲5.01

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

Analyzing filesystem and database footprints of this plugin
There were no storage issued detected upon installing this plugin
Filesystem: 1,358 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-posts
widget_theysaidso_widget
db_upgraded
can_compress_scripts
widget_recent-comments
theysaidso_admin_options

Browser metrics Passed 4 tests

Checking browser requirements for Gravity PDF
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,813 ▲5114.31 ▼0.421.62 ▼0.2336.41 ▼10.48
Dashboard /wp-admin2,221 ▲465.64 ▼0.0293.81 ▼12.0143.32 ▼3.47
Posts /wp-admin/edit.php2,124 ▲212.09 ▲0.0741.94 ▼0.4137.94 ▼0.59
Add New Post /wp-admin/post-new.php1,547 ▲2123.34 ▲0.51590.48 ▲5.6852.05 ▲1.02
Media Library /wp-admin/upload.php1,426 ▲294.21 ▲0.0197.89 ▲0.4642.69 ▼1.46

Uninstaller [IO: ▲0.00MB] [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 were found after uninstall: 6 options
    • can_compress_scripts
    • theysaidso_admin_options
    • widget_recent-comments
    • widget_recent-posts
    • widget_theysaidso_widget
    • db_upgraded

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Good news, no errors were detected

SRP 50% 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 items
  • 387× PHP files trigger server errors when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'GFPDF_Vendor\\Mpdf\\Tag\\BlockTag' not found in wp-content/plugins/gravity-forms-pdf-extended/vendor_prefixed/mpdf/mpdf/src/Tag/Header.php:5
    • > PHP Fatal error
      Uncaught Error: Class 'GFPDF_Vendor\\Mpdf\\Tag\\BlockTag' not found in wp-content/plugins/gravity-forms-pdf-extended/vendor_prefixed/mpdf/mpdf/src/Tag/Details.php:5
    • > PHP Fatal error
      Uncaught Error: Interface 'GFPDF_Vendor\\Monolog\\Formatter\\FormatterInterface' not found in wp-content/plugins/gravity-forms-pdf-extended/vendor_prefixed/monolog/src/Monolog/Formatter/MongoDBFormatter.php:22
    • > PHP Fatal error
      Uncaught Error: Class 'GFPDF_Vendor\\setasign\\Fpdi\\PdfParser\\PdfParserException' not found in wp-content/plugins/gravity-forms-pdf-extended/vendor_prefixed/setasign/fpdi/src/PdfParser/Type/PdfTypeException.php:16
    • > PHP Fatal error
      Uncaught Error: Interface 'Psr\\Http\\Message\\UriInterface' not found in wp-content/plugins/gravity-forms-pdf-extended/vendor_prefixed/league/uri/src/Http.php:21
    • > PHP Fatal error
      Uncaught Error: Class 'GFPDF_Vendor\\setasign\\Fpdi\\PdfParser\\Type\\PdfType' not found in wp-content/plugins/gravity-forms-pdf-extended/vendor_prefixed/setasign/fpdi/src/PdfParser/Type/PdfStream.php:25
    • > PHP Fatal error
      Uncaught Error: Class 'GFPDF_Vendor\\setasign\\Fpdi\\PdfParser\\PdfParserException' not found in wp-content/plugins/gravity-forms-pdf-extended/vendor_prefixed/setasign/fpdi/src/PdfParser/Filter/FilterException.php:16
    • > PHP Fatal error
      Uncaught Error: Class 'Psr\\Log\\AbstractLogger' not found in wp-content/plugins/gravity-forms-pdf-extended/vendor/psr/log/Psr/Log/Test/TestLogger.php:57
    • > PHP Fatal error
      Uncaught Error: Class 'GFPDF_Vendor\\Monolog\\Handler\\MailHandler' not found in wp-content/plugins/gravity-forms-pdf-extended/vendor_prefixed/monolog/src/Monolog/Handler/NativeMailerHandler.php:22
    • > PHP Fatal error
      Uncaught Error: Class 'GFPDF_Vendor\\Monolog\\Formatter\ormalizerFormatter' not found in wp-content/plugins/gravity-forms-pdf-extended/vendor_prefixed/monolog/src/Monolog/Formatter/GelfMessageFormatter.php:25

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
There were no browser issues found

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file uses markdown syntax to describe your plugin to the world
These attributes need to be fixed: Please take inspiration from this readme.txt

gravity-forms-pdf-extended/pdf.php 92% from 13 tests

This is the main PHP file of "Gravity PDF" version 6.7.2, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
It is important to fix the following:
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("gravity-forms-pdf-extended.php" instead of "pdf.php")

Code Analysis 95% from 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short glimpse at programming languages used with this plugin and a check that no dangerous files are present
Everything looks great! No dangerous files found in this plugin113,096 lines of code in 930 files:
LanguageFilesBlank linesComment linesLines of code
PHP8587,51249,446108,010
JSON5002,592
Sass4329901,667
CSS36518406
Markdown6990321
JavaScript12041377
XML10019
Bourne Shell1203
SVG1001

PHP code 0% from 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
It is recommended to fix the following
  • Cyclomatic complexity of classes has to be reduced to less than 1000 (currently 7,027)
  • Method cyclomatic complexity should be reduced to less than 100 (currently 460)
Cyclomatic complexity
Average complexity per logical line of code0.49
Average class complexity31.84
▷ Minimum class complexity1.00
▷ Maximum class complexity7,027.00
Average method complexity6.54
▷ Minimum method complexity1.00
▷ Maximum method complexity460.00
Code structure
Namespaces98
Interfaces66
Traits18
Classes669
▷ Abstract classes314.63%
▷ Concrete classes63895.37%
▷ Final classes517.99%
Methods4,491
▷ Static methods46310.31%
▷ Public methods3,70482.48%
▷ Protected methods4239.42%
▷ Private methods3648.11%
Functions115
▷ Named functions97.83%
▷ Anonymous functions10692.17%
Constants758
▷ Global constants151.98%
▷ Class constants74398.02%
▷ Public constants63785.73%

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 compressed PNG files occupy 0.19MB
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
src/templates/images/zadani.png42.81KB42.51KB▼ 0.72%
src/templates/images/focus-gravity.png49.37KB48.93KB▼ 0.88%
src/templates/images/blank-slate.png36.38KB35.54KB▼ 2.29%
src/assets/images/cap-paws-sitting.png24.94KB8.95KB▼ 64.13%
src/templates/images/rubix.png44.43KB43.85KB▼ 1.31%