67% pdf-importer-for-gravity

Code Review | PDF Importer for Gravity Forms

WordPress plugin PDF Importer for Gravity Forms scored67%from 54 tests.

About plugin

  • Plugin page: pdf-importer-for-...
  • Plugin version: 1.3.43
  • PHP version: 7.4.16
  • WordPress compatibility: 3.3-6.4
  • WordPress version: 6.3.1
  • First release: Apr 24, 2021
  • Latest release: Nov 20, 2023
  • Number of updates: 46
  • Update frequency: every 23.9 days
  • Top authors: EDGARROJAS (100%)

Code review

54 tests

User reviews

1 review

Install metrics

20+ active /2,193 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
The plugin installed successfully, without throwing any errors or notices

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

This is a short check of server-side resources used by PDF Importer for Gravity Forms
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.96 ▲0.5043.39 ▲6.49
Dashboard /wp-admin3.80 ▲0.5048.96 ▼1.78
Posts /wp-admin/edit.php3.85 ▲0.4945.60 ▼1.76
Add New Post /wp-admin/post-new.php6.32 ▲0.4391.81 ▼1.52
Media Library /wp-admin/upload.php3.66 ▲0.4341.39 ▲10.68

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

How much does this plugin use your filesystem and database?
This plugin was installed successfully
Filesystem: 519 new files
Database: 3 new tables, 7 new options
New tables
wp_rnpdfimportergravity_pdf_import
wp_rnpdfimportergravity_form_config
wp_rnpdfimportergravity_records
New WordPress options
widget_recent-posts
widget_theysaidso_widget
db_upgraded
rednao_rnpdfimportergravity_db_version
widget_recent-comments
theysaidso_admin_options
can_compress_scripts

Browser metrics Passed 4 tests

An overview of browser requirements for PDF Importer for Gravity Forms
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,806 ▲4414.37 ▼0.011.70 ▲0.0244.61 ▲5.01
Dashboard /wp-admin2,214 ▲375.58 ▲0.0193.11 ▼6.9241.99 ▼0.45
Posts /wp-admin/edit.php2,116 ▲132.00 ▲0.0538.24 ▼1.7935.16 ▼5.45
Add New Post /wp-admin/post-new.php1,539 ▲1323.36 ▲0.16693.80 ▲55.0355.91 ▼2.26
Media Library /wp-admin/upload.php1,410 ▲74.19 ▲0.0296.92 ▼1.1743.20 ▼0.84

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
These items require your attention
  • This plugin does not fully uninstall, leaving 3 tables in the database
    • wp_rnpdfimportergravity_records
    • wp_rnpdfimportergravity_pdf_import
    • wp_rnpdfimportergravity_form_config
  • Zombie WordPress options detected upon uninstall: 7 options
    • widget_recent-posts
    • can_compress_scripts
    • theysaidso_admin_options
    • db_upgraded
    • rednao_rnpdfimportergravity_db_version
    • widget_recent-comments
    • widget_theysaidso_widget

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Everything seems fine, however this is by no means 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
The following issues need your attention
  • 9× PHP files perform the task of outputting text when accessed with GET requests:
    • > /wp-content/plugins/pdf-importer-for-gravity/vendor/setasign/fpdf/tutorial/tuto4.php
    • > /wp-content/plugins/pdf-importer-for-gravity/vendor/setasign/fpdf/tutorial/tuto1.php
    • > /wp-content/plugins/pdf-importer-for-gravity/vendor/setasign/fpdf/tutorial/tuto2.php
    • > /wp-content/plugins/pdf-importer-for-gravity/vendor/setasign/fpdf/tutorial/tuto5.php
    • > /wp-content/plugins/pdf-importer-for-gravity/vendor/setasign/fpdf/tutorial/tuto7.php
    • > /wp-content/plugins/pdf-importer-for-gravity/vendor/setasign/fpdf/tutorial/makefont.php
    • > /wp-content/plugins/pdf-importer-for-gravity/vendor/setasign/fpdf/tutorial/tuto3.php
    • > /wp-content/plugins/pdf-importer-for-gravity/TEST.PHP
    • > /wp-content/plugins/pdf-importer-for-gravity/vendor/setasign/fpdf/tutorial/tuto6.php
  • 184× PHP files trigger server-side errors or warnings when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'rnpdfimporter\\JPDFGenerator\\JSONItem\\Streams\\PDFFlatStream' not found in wp-content/plugins/pdf-importer-for-gravity/JPDFGenerator/JSONItem/Streams/ContentStreamJSONItem.php:9
    • > PHP Fatal error
      Uncaught Error: Class 'rnpdfimporter\\PDFLib\\core\\syntax\\CharCodes' not found in wp-content/plugins/pdf-importer-for-gravity/PDFLib/core/syntax/Numeric.php:22
    • > PHP Fatal error
      Uncaught Error: Interface 'setasign\\Fpdi\\PdfParser\\Filter\\FilterInterface' not found in wp-content/plugins/pdf-importer-for-gravity/vendor/setasign/fpdi/src/PdfParser/Filter/AsciiHex.php:16
    • > PHP Fatal error
      Uncaught Error: Class 'rnpdfimporter\\JPDFGenerator\\JSONItem\\SubDictionary\\FieldJSONItem' not found in wp-content/plugins/pdf-importer-for-gravity/JPDFGenerator/JSONItem/SubDictionary/PDFFields/ImagePDFField.php:14
    • > PHP Fatal error
      Uncaught Error: Class 'FontLib\\TrueType\\File' not found in wp-content/plugins/pdf-importer-for-gravity/vendor/phenx/php-font-lib/src/FontLib/WOFF/File.php:20
    • > PHP Fatal error
      Uncaught Error: Class 'FontLib\\TrueType\\File' not found in wp-content/plugins/pdf-importer-for-gravity/vendor/phenx/php-font-lib/src/FontLib/EOT/File.php:16
    • > PHP Fatal error
      Uncaught Error: Class 'rnpdfimporter\\JPDFGenerator\\Appearance\\AppearanceBase' not found in wp-content/plugins/pdf-importer-for-gravity/JPDFGenerator/Appearance/DefaultImageAppearance.php:20
    • > PHP Fatal error
      Uncaught Error: Class 'rnpdfimporter\\core\\Integration\\Processors\\Entry\\EntryItems\\EntryItemBase' not found in wp-content/plugins/pdf-importer-for-gravity/core/Integration/Processors/Entry/EntryItems/DateEntryItem.php:10
    • > PHP Fatal error
      Uncaught Error: Class 'rnpdfimporter\\PDFLib\\core\\acroform\\PDFAcroTerminal' not found in wp-content/plugins/pdf-importer-for-gravity/PDFLib/core/acroform/PDFAcroSignature.php:7
    • > PHP Fatal error
      Uncaught Error: Class 'setasign\\Fpdi\\PdfParser\\CrossReference\\AbstractReader' not found in wp-content/plugins/pdf-importer-for-gravity/vendor/setasign/fpdi/src/PdfParser/CrossReference/FixedReader.php:22

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
Everything seems fine on the user side

Optimizations

Plugin configuration 90% from 29 tests

readme.txt Passed 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
5 plugin tags: pdf builder, wpforms, pdf, forms, wpform

pdf-importer-for-gravity/PDFImporterForGravity.php 77% from 13 tests

Analyzing the main PHP file in "PDF Importer for Gravity Forms" version 1.3.43
You should first fix the following items:
  • Text Domain: If you choose to specify the text domain, it must be the same as the plugin slug; optional since WordPress version 4.6
  • Domain Path: The domain path is invalid: folder "/languages/" does not exist
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("pdf-importer-for-gravity.php" instead of "PDFImporterForGravity.php")

Code Analysis 95% from 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of file extensions present in this plugin and a short test that no dangerous files are bundled with this plugin
Success! There were no dangerous files found in this plugin50,539 lines of code in 427 files:
LanguageFilesBlank linesComment linesLines of code
PHP3377,7837,77639,165
CSS79551257,566
HTML597203,240
JSON600331
Markdown5540168
XML34132
JavaScript91221831
TypeScript1106

PHP code 0% from 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
Please tend to the following items
  • Cyclomatic complexity of classes has to be reduced to less than 1000 (currently 1,487)
  • Method cyclomatic complexity has to be reduced to less than 100 (currently 245)
Cyclomatic complexity
Average complexity per logical line of code0.37
Average class complexity20.14
▷ Minimum class complexity1.00
▷ Maximum class complexity1,487.00
Average method complexity4.27
▷ Minimum method complexity1.00
▷ Maximum method complexity245.00
Code structure
Namespaces77
Interfaces3
Traits2
Classes315
▷ Abstract classes216.67%
▷ Concrete classes29493.33%
▷ Final classes00.00%
Methods1,912
▷ Static methods23612.34%
▷ Public methods1,67487.55%
▷ Protected methods1457.58%
▷ Private methods934.86%
Functions45
▷ Named functions1737.78%
▷ Anonymous functions2862.22%
Constants336
▷ Global constants72.08%
▷ Class constants32997.92%
▷ Public constants329100.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
15 PNG files occupy 0.07MB with 0.02MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
images/fieldIcons/dropdown.png0.40KB0.25KB▼ 36.54%
vendor/setasign/fpdf/tutorial/logo.png2.32KB2.26KB▼ 2.57%
images/adIcons/stp.png10.54KB4.75KB▼ 54.92%
images/adIcons/wpform.png11.95KB3.97KB▼ 66.77%
images/fieldIcons/radio.png1.19KB1.29KB0.00%