57% pdf-builder-for-gravity

Code Review | PDF Builder for Gravity Forms

WordPress plugin PDF Builder for Gravity Forms scored57%from 54 tests.

About plugin

  • Plugin page: pdf-builder-for-g...
  • Plugin version: 1.2.81
  • PHP version: 7.4.16
  • WordPress compatibility: 3.3-6.4
  • WordPress version: 6.3.1
  • First release: Jun 8, 2019
  • Latest release: Nov 20, 2023
  • Number of updates: 76
  • Update frequency: every 21.4 days
  • Top authors: EDGARROJAS (100%)

Code review

54 tests

User reviews

2 reviews

Install metrics

60+ active /9,179 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
Installer ran successfully

Server metrics [RAM: ▲0.46MB] [CPU: ▼1.29ms] Passed 4 tests

An overview of server-side resources used by PDF Builder for Gravity Forms
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.97 ▲0.5137.31 ▼0.50
Dashboard /wp-admin3.81 ▲0.4751.63 ▼7.03
Posts /wp-admin/edit.php3.86 ▲0.5151.17 ▲7.09
Add New Post /wp-admin/post-new.php6.33 ▲0.4488.69 ▼4.72
Media Library /wp-admin/upload.php3.67 ▲0.4442.15 ▲9.52
Entries /wp-admin/admin.php?page=rednaopdfgravity_pdf_builder_entries3.6434.19
Gravity PDF Builder /wp-admin/admin.php?page=rednaopdfgravity_pdf_builder3.6439.92

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

How much does this plugin use your filesystem and database?
Just a few items left to fix
  • Try to limit filesystem usage to 25MB (currently using 35.84MB)
Filesystem: 649 new files
Database: 5 new tables, 7 new options
New tables
wp_rednaopdfgravity_records
wp_rednaopdfgravity_custom_field
wp_rednaopdfgravity_templates
wp_rednaopdfgravity_form_config
wp_rednaopdfgravity_links
New WordPress options
widget_recent-comments
rednao_rednaopdfgravity_db_version
db_upgraded
widget_recent-posts
theysaidso_admin_options
widget_theysaidso_widget
can_compress_scripts

Browser metrics Passed 4 tests

This is an overview of browser requirements for PDF Builder for Gravity Forms
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,817 ▲5514.72 ▲0.371.91 ▲0.1238.06 ▼8.47
Dashboard /wp-admin2,222 ▲425.63 ▼0.0496.52 ▼2.4342.85 ▼2.03
Posts /wp-admin/edit.php2,127 ▲241.96 ▼0.0139.64 ▼2.0136.65 ▼1.71
Add New Post /wp-admin/post-new.php1,548 ▲1223.47 ▲0.21594.48 ▼44.1654.44 ▼2.30
Media Library /wp-admin/upload.php1,424 ▲244.17 ▲0.0097.24 ▲1.9940.71 ▼1.23
Entries /wp-admin/admin.php?page=rednaopdfgravity_pdf_builder_entries8132.1723.5825.08
Gravity PDF Builder /wp-admin/admin.php?page=rednaopdfgravity_pdf_builder9073.1153.9224.99

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
These items require your attention
  • The plugin did not uninstall successfully, leaving 5 tables in the database
    • wp_rednaopdfgravity_records
    • wp_rednaopdfgravity_form_config
    • wp_rednaopdfgravity_links
    • wp_rednaopdfgravity_custom_field
    • wp_rednaopdfgravity_templates
  • Zombie WordPress options detected upon uninstall: 7 options
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • widget_recent-posts
    • db_upgraded
    • can_compress_scripts
    • widget_recent-comments
    • rednao_rednaopdfgravity_db_version

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
The smoke test was a success, however most plugin functionality was not tested

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
Almost there! Just fix the following items
  • 4× PHP files output text when accessed directly:
    • > /wp-content/plugins/pdf-builder-for-gravity/Pages/AdditionalPlugins.php
    • > /wp-content/plugins/pdf-builder-for-gravity/vendor/phpqrcode/index.php
    • > /wp-content/plugins/pdf-builder-for-gravity/Pages/PDFBuilder.php
    • > /wp-content/plugins/pdf-builder-for-gravity/vendor/sabberworm/php-css-parser/tests/quickdump.php
  • 296× GET requests to PHP files trigger server-side errors or Error 500 responses (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'Svg\\Tag\\AbstractTag' not found in wp-content/plugins/pdf-builder-for-gravity/vendor/phenx/php-svg-lib/src/Svg/Tag/StyleTag.php:13
    • > PHP Fatal error
      Uncaught Error: Class 'rednaoformpdfbuilder\\htmlgenerator\\sectionGenerators\\fields\\PDFFieldBase' not found in wp-content/plugins/pdf-builder-for-gravity/htmlgenerator/sectionGenerators/fields/PDFFormImageItem.php:16
    • > PHP Fatal error
      Uncaught Error: Class 'rednaoformpdfbuilder\\Integration\\Processors\\Settings\\Forms\\Fields\\FieldSettingsBase' not found in wp-content/plugins/pdf-builder-for-gravity/Integration/Adapters/Gravity/Settings/Forms/Fields/GravitySurveyRank.php:7
    • > PHP Fatal error
      Uncaught Error: Class 'FontLib\\TrueType\\Header' not found in wp-content/plugins/pdf-builder-for-gravity/vendor/phenx/php-font-lib/src/FontLib/WOFF/Header.php:16
    • > PHP Warning
      "continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"? in wp-content/plugins/pdf-builder-for-gravity/vendor/dompdf/dompdf/lib/Cpdf.php on line 489
    • > PHP Fatal error
      Uncaught Error: Class 'Dompdf\\FrameReflower\\AbstractFrameReflower' not found in wp-content/plugins/pdf-builder-for-gravity/vendor/dompdf/dompdf/src/FrameReflower/TableRow.php:20
    • > PHP Fatal error
      Uncaught Error: Class 'Svg\\Tag\\AbstractTag' not found in wp-content/plugins/pdf-builder-for-gravity/vendor/phenx/php-svg-lib/src/Svg/Tag/Stop.php:11
    • > PHP Fatal error
      Uncaught Error: Interface 'Sabberworm\\CSS\\Renderable' not found in wp-content/plugins/pdf-builder-for-gravity/vendor/sabberworm/php-css-parser/lib/Sabberworm/CSS/RuleSet/RuleSet.php:13
    • > PHP Fatal error
      Uncaught Error: Class 'FontLib\\Glyph\\Outline' not found in wp-content/plugins/pdf-builder-for-gravity/vendor/phenx/php-font-lib/src/FontLib/Glyph/OutlineSimple.php:17
    • > PHP Fatal error
      Uncaught Error: Class 'rednaoformpdfbuilder\\Integration\\Processors\\Entry\\EntryItems\\EntryItemBase' not found in wp-content/plugins/pdf-builder-for-gravity/Integration/Adapters/Gravity/Entry/EntryItems/GravityAddressEntryItem.php:16

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
No browser issues were found

Optimizations

Plugin configuration 90% from 29 tests

readme.txt Passed 16 tests

The readme.txt file is an important file in your plugin as it is parsed by WordPress.org to prepare the public listing of your plugin
5 plugin tags: pdf, wpforms, wpform, pdf builder, forms

pdf-builder-for-gravity/rednaopdfgravity.php 77% from 13 tests

"PDF Builder for Gravity Forms" version 1.2.81's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
Please take the time to fix the following:
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("pdf-builder-for-gravity.php" instead of "rednaopdfgravity.php")
  • Text Domain: The text domain name should consist of only dashes and lowercase characters
  • Domain Path: The domain path folder does not exist ("/languages/")

Code Analysis 0% from 3 tests

File types 0% from 1 test

🔸 Test weight: 35 | There should be no dangerous file extensions present in any WordPress plugin
Almost there! Just fix the following issues
  • You should never include executable (binary) or otherwise dangerous files in your plugin
    • .bat - Batch File in Windows
      • wp-content/plugins/pdf-builder-for-gravity/vendor/phpqrcode/tools/merge.bat
116,818 lines of code in 496 files:
LanguageFilesBlank linesComment linesLines of code
PHP37713,65221,14895,596
JavaScript191,9561,69112,338
CSS472511734,121
SVG14072,740
Markdown1031801,029
JSON1510641
XML6714218
YAML4192108
HTML10017
TypeScript1006
Bourne Shell1002
DOS Batch1002

PHP code 0% from 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
The following items need your attention
  • Cyclomatic complexity of classes should be reduced to less than 1000 (currently 1,487)
  • Cyclomatic complexity of methods should be reduced to less than 100 (currently 652)
Cyclomatic complexity
Average complexity per logical line of code0.41
Average class complexity30.94
▷ Minimum class complexity1.00
▷ Maximum class complexity1,487.00
Average method complexity4.67
▷ Minimum method complexity1.00
▷ Maximum method complexity652.00
Code structure
Namespaces72
Interfaces7
Traits0
Classes364
▷ Abstract classes256.87%
▷ Concrete classes33993.13%
▷ Final classes00.00%
Methods3,116
▷ Static methods2738.76%
▷ Public methods2,60683.63%
▷ Protected methods32710.49%
▷ Private methods1835.87%
Functions29
▷ Named functions620.69%
▷ Anonymous functions2379.31%
Constants431
▷ Global constants10524.36%
▷ Class constants32675.64%
▷ Public constants326100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
31 PNG files occupy 0.19MB with 0.04MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
images/toolIcons/qrcode.png0.54KB0.48KB▼ 11.73%
images/toolIcons/table.png0.70KB0.75KB0.00%
images/adIcons/stp.png10.54KB4.75KB▼ 54.92%
images/adIcons/calculation.png1.66KB1.23KB▼ 25.84%
images/adIcons/repeater.png1.57KB1.49KB▼ 5.53%