67% pdf-importer-for-ninjaforms-pro

Code Review | PDF Importer for Ninja Forms

WordPress plugin PDF Importer for Ninja 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: May 19, 2021
  • Latest release: Nov 20, 2023
  • Number of updates: 44
  • Update frequency: every 21.3 days
  • Top authors: EDGARROJAS (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /1,380 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
The plugin installed successfully, without throwing any errors or notices

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

An overview of server-side resources used by PDF Importer for Ninja Forms
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.90 ▲0.4341.17 ▲1.00
Dashboard /wp-admin3.73 ▲0.3856.26 ▼6.26
Posts /wp-admin/edit.php3.78 ▲0.4255.17 ▲5.42
Add New Post /wp-admin/post-new.php6.25 ▲0.3696.66 ▼1.60
Media Library /wp-admin/upload.php3.59 ▲0.3640.89 ▲8.81

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

How much does this plugin use your filesystem and database?
This plugin installed successfully
Filesystem: 519 new files
Database: 3 new tables, 7 new options
New tables
wp_rnpdfimporterninjafrms_records
wp_rnpdfimporterninjafrms_pdf_import
wp_rnpdfimporterninjafrms_form_config
New WordPress options
widget_recent-comments
widget_recent-posts
widget_theysaidso_widget
theysaidso_admin_options
can_compress_scripts
rednao_rnpdfimporterninjafrms_db_version
db_upgraded

Browser metrics Passed 4 tests

This is an overview of browser requirements for PDF Importer for Ninja Forms
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,806 ▲5914.21 ▼0.561.76 ▲0.1338.25 ▼5.45
Dashboard /wp-admin2,214 ▲365.65 ▼0.0690.78 ▼22.4941.42 ▼2.93
Posts /wp-admin/edit.php2,116 ▲162.07 ▼0.0140.57 ▲0.3634.41 ▼7.20
Add New Post /wp-admin/post-new.php1,543 ▲923.08 ▼2.12629.04 ▲20.0654.58 ▼18.53
Media Library /wp-admin/upload.php1,416 ▲164.22 ▲0.0397.94 ▲3.9840.58 ▼1.96

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
Please fix the following items
  • Zombie tables were found after uninstall: 3 tables
    • wp_rnpdfimporterninjafrms_pdf_import
    • wp_rnpdfimporterninjafrms_form_config
    • wp_rnpdfimporterninjafrms_records
  • This plugin did not uninstall successfully, leaving 7 options in the database
    • rednao_rnpdfimporterninjafrms_db_version
    • db_upgraded
    • widget_recent-comments
    • widget_theysaidso_widget
    • widget_recent-posts
    • theysaidso_admin_options
    • can_compress_scripts

Smoke tests 50% 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 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 fix the following items
  • 9× GET requests to PHP files return non-empty strings:
    • > /wp-content/plugins/pdf-importer-for-ninjaforms-pro/TEST.PHP
    • > /wp-content/plugins/pdf-importer-for-ninjaforms-pro/vendor/setasign/fpdf/tutorial/tuto5.php
    • > /wp-content/plugins/pdf-importer-for-ninjaforms-pro/vendor/setasign/fpdf/tutorial/tuto1.php
    • > /wp-content/plugins/pdf-importer-for-ninjaforms-pro/vendor/setasign/fpdf/tutorial/tuto3.php
    • > /wp-content/plugins/pdf-importer-for-ninjaforms-pro/vendor/setasign/fpdf/tutorial/tuto6.php
    • > /wp-content/plugins/pdf-importer-for-ninjaforms-pro/vendor/setasign/fpdf/tutorial/tuto7.php
    • > /wp-content/plugins/pdf-importer-for-ninjaforms-pro/vendor/setasign/fpdf/tutorial/makefont.php
    • > /wp-content/plugins/pdf-importer-for-ninjaforms-pro/vendor/setasign/fpdf/tutorial/tuto4.php
    • > /wp-content/plugins/pdf-importer-for-ninjaforms-pro/vendor/setasign/fpdf/tutorial/tuto2.php
  • 184× PHP files trigger server errors when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'setasign\\Fpdi\\PdfParser\\Type\\PdfType' not found in wp-content/plugins/pdf-importer-for-ninjaforms-pro/vendor/setasign/fpdi/src/PdfParser/Type/PdfIndirectObject.php:20
    • > PHP Fatal error
      Uncaught Error: Class 'rnpdfimporter\\JPDFGenerator\\JSONItem\\SubDictionary\\FieldJSONItem' not found in wp-content/plugins/pdf-importer-for-ninjaforms-pro/JPDFGenerator/JSONItem/SubDictionary/PDFFields/FieldWithParent.php:11
    • > PHP Fatal error
      Uncaught Error: Class 'rnpdfimporter\\core\\Integration\\Processors\\Settings\\Forms\\Fields\\FieldSettingsBase' not found in wp-content/plugins/pdf-importer-for-ninjaforms-pro/core/Integration/Processors/Settings/Forms/Fields/TextFieldSettings.php:14
    • > PHP Fatal error
      Uncaught Error: Class 'rnpdfimporter\\core\\Integration\\Processors\\Entry\\EntryItems\\EntryItemBase' not found in wp-content/plugins/pdf-importer-for-ninjaforms-pro/core/Integration/Processors/Entry/EntryItems/SimpleTextWithAmountEntryItem.php:15
    • > PHP Fatal error
      Uncaught Error: Class 'FontLib\\TrueType\\File' not found in wp-content/plugins/pdf-importer-for-ninjaforms-pro/vendor/phenx/php-font-lib/src/FontLib/OpenType/File.php:16
    • > PHP Fatal error
      Uncaught Error: Class 'setasign\\Fpdi\\PdfParser\\Type\\PdfType' not found in wp-content/plugins/pdf-importer-for-ninjaforms-pro/vendor/setasign/fpdi/src/PdfParser/Type/PdfNumeric.php:16
    • > PHP Fatal error
      Uncaught Error: Class 'rnpdfimporter\\core\\Integration\\Processors\\Entry\\EntryItems\\EntryItemBase' not found in wp-content/plugins/pdf-importer-for-ninjaforms-pro/core/Integration/Processors/Entry/EntryItems/DateTimeEntryItem.php:9
    • > PHP Fatal error
      Uncaught Error: Class 'setasign\\Fpdi\\PdfParser\\Type\\PdfType' not found in wp-content/plugins/pdf-importer-for-ninjaforms-pro/vendor/setasign/fpdi/src/PdfParser/Type/PdfNull.php:16
    • > PHP Fatal error
      Uncaught Error: Class 'setasign\\Fpdi\\PdfParser\\PdfParserException' not found in wp-content/plugins/pdf-importer-for-ninjaforms-pro/vendor/setasign/fpdi/src/PdfParser/Filter/FilterException.php:18
    • > PHP Fatal error
      Uncaught Error: Class 'FontLib\\Table\\DirectoryEntry' not found in wp-content/plugins/pdf-importer-for-ninjaforms-pro/vendor/phenx/php-font-lib/src/FontLib/TrueType/TableDirectoryEntry.php:18

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 90% from 29 tests

readme.txt Passed 16 tests

It's important to format your readme.txt file correctly as it is parsed for the public listing of your plugin
5 plugin tags: pdf, forms, pdf builder, wpforms, wpform

pdf-importer-for-ninjaforms-pro/PDFImporterForNinjaForms.php 77% from 13 tests

The principal PHP file in "PDF Importer for Ninja Forms" v. 1.3.43 is loaded by WordPress automatically on each request
It is important to fix the following:
  • Domain Path: The domain path points to an invalid folder, "/languages/" does not exist
  • Text Domain: You no longer need to specify the text domain since WordPress 4.6; it must be the same as the plugin slug
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("pdf-importer-for-ninjaforms-pro.php" instead of "PDFImporterForNinjaForms.php")

Code Analysis 95% from 3 tests

File types Passed 1 test

🔸 Test weight: 35 | There should be no dangerous file extensions present in any WordPress plugin
Success! There were no dangerous files found in this plugin50,353 lines of code in 427 files:
LanguageFilesBlank linesComment linesLines of code
PHP3377,7537,77638,979
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 fix the following
  • Class cyclomatic complexity has to be reduced to less than 1000 (currently 1,487)
  • Please reduce cyclomatic complexity of methods to less than 100 (currently 245)
Cyclomatic complexity
Average complexity per logical line of code0.37
Average class complexity20.03
▷ Minimum class complexity1.00
▷ Maximum class complexity1,487.00
Average method complexity4.25
▷ Minimum method complexity1.00
▷ Maximum method complexity245.00
Code structure
Namespaces77
Interfaces3
Traits2
Classes315
▷ Abstract classes216.67%
▷ Concrete classes29493.33%
▷ Final classes00.00%
Methods1,910
▷ Static methods23612.36%
▷ Public methods1,67287.54%
▷ Protected methods1457.59%
▷ Private methods934.87%
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.03MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
images/adIcons/wpform.png11.95KB3.97KB▼ 66.77%
images/fieldIcons/dropdown.png0.40KB0.25KB▼ 36.54%
images/adIcons/format_number.png2.10KB2.21KB0.00%
images/fieldIcons/text.png2.97KB0.27KB▼ 91.03%
vendor/setasign/fpdf/tutorial/logo.png2.32KB2.26KB▼ 2.57%