61% pdf-importer-for-wpform

Code Review | PDF Importer for WPForms

WordPress plugin PDF Importer for WPForms scored61%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: Nov 4, 2020
  • Latest release: Nov 20, 2023
  • Number of updates: 79
  • Update frequency: every 14.1 days
  • Top authors: EDGARROJAS (100%)

Code review

54 tests

User reviews

8 reviews

Install metrics

600+ active /16,006 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
Installer ran successfully

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

This is a short check of server-side resources used by PDF Importer for WPForms
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.95 ▲0.4944.56 ▲3.07
Dashboard /wp-admin3.79 ▲0.4450.63 ▼9.98
Posts /wp-admin/edit.php3.85 ▲0.4852.25 ▼0.57
Add New Post /wp-admin/post-new.php6.31 ▲0.4295.47 ▼5.18
Media Library /wp-admin/upload.php3.72 ▲0.4838.52 ▲4.81
Our WPForms Plugins /wp-admin/admin.php?page=rnpdfimporter_additional_plugins3.6333.72
PDF Importer for WPFORM /wp-admin/admin.php?page=rnpdfimporter3.6538.04

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

A short overview of filesystem and database impact
This plugin installed successfully
Filesystem: 528 new files
Database: 3 new tables, 7 new options
New tables
wp_rnpdfimporter_pdf_import
wp_rnpdfimporter_form_config
wp_rnpdfimporter_records
New WordPress options
theysaidso_admin_options
rednao_rnpdfimporter_db_version
widget_recent-comments
widget_recent-posts
db_upgraded
can_compress_scripts
widget_theysaidso_widget

Browser metrics Passed 4 tests

PDF Importer for WPForms: an overview of browser usage
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,817 ▲7014.60 ▲0.361.60 ▼0.0835.69 ▼7.26
Dashboard /wp-admin2,222 ▲455.62 ▼0.0494.02 ▲1.4938.09 ▼6.39
Posts /wp-admin/edit.php2,127 ▲242.00 ▼0.1538.57 ▼3.0035.40 ▲0.23
Add New Post /wp-admin/post-new.php1,548 ▲2223.31 ▲0.03629.87 ▲25.5251.87 ▲1.90
Media Library /wp-admin/upload.php1,427 ▲244.17 ▼0.0198.75 ▲3.0942.20 ▼1.88
Our WPForms Plugins /wp-admin/admin.php?page=rnpdfimporter_additional_plugins1,1051.9925.0427.33
PDF Importer for WPFORM /wp-admin/admin.php?page=rnpdfimporter8843.2258.8827.03

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
These items require your attention
  • Zombie tables detected upon uninstall: 3 tables
    • wp_rnpdfimporter_form_config
    • wp_rnpdfimporter_records
    • wp_rnpdfimporter_pdf_import
  • This plugin does not fully uninstall, leaving 7 options in the database
    • db_upgraded
    • widget_recent-posts
    • widget_recent-comments
    • widget_theysaidso_widget
    • can_compress_scripts
    • theysaidso_admin_options
    • rednao_rnpdfimporter_db_version

Smoke tests 25% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
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
  • 9× PHP files output non-empty strings when accessed directly via GET requests:
    • > /wp-content/plugins/pdf-importer-for-wpform/vendor/setasign/fpdf/tutorial/tuto5.php
    • > /wp-content/plugins/pdf-importer-for-wpform/vendor/setasign/fpdf/tutorial/tuto1.php
    • > /wp-content/plugins/pdf-importer-for-wpform/vendor/setasign/fpdf/tutorial/tuto2.php
    • > /wp-content/plugins/pdf-importer-for-wpform/vendor/setasign/fpdf/tutorial/tuto7.php
    • > /wp-content/plugins/pdf-importer-for-wpform/vendor/setasign/fpdf/tutorial/tuto3.php
    • > /wp-content/plugins/pdf-importer-for-wpform/vendor/setasign/fpdf/tutorial/makefont.php
    • > /wp-content/plugins/pdf-importer-for-wpform/TEST.PHP
    • > /wp-content/plugins/pdf-importer-for-wpform/vendor/setasign/fpdf/tutorial/tuto4.php
    • > /wp-content/plugins/pdf-importer-for-wpform/vendor/setasign/fpdf/tutorial/tuto6.php
  • 191× PHP files trigger errors when accessed directly with GET requests (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'rnpdfimporter\\PDFLib\\core\\objects\\PDFStream' not found in wp-content/plugins/pdf-importer-for-wpform/PDFLib/core/objects/PDFRawStream.php:9
    • > PHP Fatal error
      Uncaught Error: Class 'rnpdfimporter\\PDFLib\\core\\acroform\\flags' not found in wp-content/plugins/pdf-importer-for-wpform/PDFLib/core/acroform/AcroChoiceFlags.php:17
    • > PHP Fatal error
      Uncaught Error: Class 'rnpdfimporter\\core\\db\\core\\RepositoryBase' not found in wp-content/plugins/pdf-importer-for-wpform/core/db/TemplateRepository.php:11
    • > PHP Fatal error
      Uncaught Error: Class 'rnpdfimporter\\core\\Integration\\Processors\\Entry\\EntryProcessorBase' not found in wp-content/plugins/pdf-importer-for-wpform/core/Integration/Adapters/WPForm/Entry/WPFormEntryProcessor.php:37
    • > PHP Fatal error
      Uncaught Error: Class 'rnpdfimporter\\JPDFGenerator\\JSONItem\\SubDictionary\\FieldJSONItem' not found in wp-content/plugins/pdf-importer-for-wpform/JPDFGenerator/JSONItem/SubDictionary/PDFFields/TextPDFField.php:13
    • > PHP Fatal error
      Uncaught Error: Class 'setasign\\Fpdi\\PdfParser\\CrossReference\\AbstractReader' not found in wp-content/plugins/pdf-importer-for-wpform/vendor/setasign/fpdi/src/PdfParser/CrossReference/LineReader.php:22
    • > PHP Fatal error
      Uncaught Error: Class 'rnpdfimporter\\JPDFGenerator\\Appearance\\Layout\\LayoutBase' not found in wp-content/plugins/pdf-importer-for-wpform/JPDFGenerator/Appearance/Layout/SingleLineTextLayout.php:9
    • > PHP Fatal error
      Uncaught Error: Class 'rnpdfimporter\\core\\PageBase' not found in wp-content/plugins/pdf-importer-for-wpform/Pages/Settings.php:11
    • > PHP Fatal error
      Uncaught Error: Class 'rnpdfimporter\\JPDFGenerator\\JSONItem\\Streams\\StreamJSONItemBase' not found in wp-content/plugins/pdf-importer-for-wpform/JPDFGenerator/JSONItem/Streams/RawJSONItem.php:7
    • > PHP Fatal error
      Uncaught Error: Class 'rnpdfimporter\\JPDFGenerator\\JSONItem\\SubDictionary\\FieldJSONItem' not found in wp-content/plugins/pdf-importer-for-wpform/JPDFGenerator/JSONItem/SubDictionary/PDFFields/ImagePDFField.php:14

User-side errors 0% from 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
There are user-side issues you should fix
    • > GET request to /wp-admin/admin.php?page=rnpdfimporter_additional_plugins
    • > Network (severe)
    wp-content/plugins/pdf-importer-for-wpform/images/adicons/wpform.png - Failed to load resource: the server responded with a status of 404 (Not Found)
    • > GET request to /wp-admin/admin.php?page=rnpdfimporter_additional_plugins
    • > Network (severe)
    wp-content/plugins/pdf-importer-for-wpform/images/adicons/pagebuilder.png - Failed to load resource: the server responded with a status of 404 (Not Found)
    • > GET request to /wp-admin/admin.php?page=rnpdfimporter_additional_plugins
    • > Network (severe)
    wp-content/plugins/pdf-importer-for-wpform/images/adicons/stp128.png - Failed to load resource: the server responded with a status of 404 (Not Found)
    • > GET request to /wp-admin/admin.php?page=rnpdfimporter_additional_plugins
    • > Network (severe)
    wp-content/plugins/pdf-importer-for-wpform/images/adicons/pdfbuilder.jpg - Failed to load resource: the server responded with a status of 404 (Not Found)
    • > GET request to /wp-admin/admin.php?page=rnpdfimporter_additional_plugins
    • > Network (severe)
    wp-content/plugins/pdf-importer-for-wpform/images/adicons/repeater.png - Failed to load resource: the server responded with a status of 404 (Not Found)
    • > GET request to /wp-admin/admin.php?page=rnpdfimporter_additional_plugins
    • > Network (severe)
    wp-content/plugins/pdf-importer-for-wpform/images/adicons/format_number.png - Failed to load resource: the server responded with a status of 404 (Not Found)
    • > GET request to /wp-admin/admin.php?page=rnpdfimporter_additional_plugins
    • > Network (severe)
    wp-content/plugins/pdf-importer-for-wpform/images/adicons/calculation.png - Failed to load resource: the server responded with a status of 404 (Not Found)

Optimizations

Plugin configuration 90% from 29 tests

readme.txt Passed 16 tests

The readme.txt file describes your plugin functionality and requirements and it is parsed to prepare the your plugin's listing
5 plugin tags: wpforms, wpform, forms, pdf builder, pdf

pdf-importer-for-wpform/PDFImporterForWPForm.php 77% from 13 tests

The principal PHP file in "PDF Importer for WPForms" v. 1.3.43 is loaded by WordPress automatically on each request
The following require your attention:
  • 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: The principal plugin file should be the same as the plugin slug ("pdf-importer-for-wpform.php" instead of "PDFImporterForWPForm.php")

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 plugin51,011 lines of code in 434 files:
LanguageFilesBlank linesComment linesLines of code
PHP3447,8997,86239,637
CSS79551257,566
HTML597203,240
JSON600331
Markdown5540168
XML34132
JavaScript91221831
TypeScript1106

PHP code 0% from 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
Please tend to the following items
  • Cyclomatic complexity of classes 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.36
Average class complexity19.83
▷ Minimum class complexity1.00
▷ Maximum class complexity1,487.00
Average method complexity4.21
▷ Minimum method complexity1.00
▷ Maximum method complexity245.00
Code structure
Namespaces79
Interfaces3
Traits2
Classes322
▷ Abstract classes216.52%
▷ Concrete classes30193.48%
▷ Final classes00.00%
Methods1,952
▷ Static methods23612.09%
▷ Public methods1,71087.60%
▷ Protected methods1497.63%
▷ Private methods934.76%
Functions46
▷ Named functions1839.13%
▷ Anonymous functions2860.87%
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/adIcons/repeater.png1.57KB1.49KB▼ 5.53%
images/fieldIcons/text.png2.97KB0.27KB▼ 91.03%
images/fieldIcons/radio.png1.19KB1.29KB0.00%
images/fieldIcons/signature.png0.91KB0.74KB▼ 19.02%
images/adIcons/format_number.png2.10KB2.21KB0.00%