56% pdf-builder-for-ninja-forms

Code Review | PDF Builder for Ninja Forms

WordPress plugin PDF Builder for Ninja Forms scored56%from 54 tests.

About plugin

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

Code review

54 tests

User reviews

1 review

Install metrics

20+ active /5,219 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 gracefully, with no errors

Server metrics [RAM: ▲0.06MB] [CPU: ▼7.76ms] Passed 4 tests

A check of server-side resources used by PDF Builder for Ninja Forms
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.54 ▲0.0736.43 ▼5.77
Dashboard /wp-admin3.38 ▲0.0346.46 ▼15.01
Posts /wp-admin/edit.php3.49 ▲0.1348.96 ▼0.59
Add New Post /wp-admin/post-new.php5.96 ▲0.0791.91 ▼9.67
Media Library /wp-admin/upload.php3.30 ▲0.0734.82 ▲3.25
Entries /wp-admin/admin.php?page=rednaopdfninja_pdf_builder_entries3.2930.93
Ninja Forms PDF Builder /wp-admin/admin.php?page=rednaopdfninja_pdf_builder3.3034.34

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

Analyzing filesystem and database footprints of this plugin
It is recommended to fix the following issues
  • Total filesystem usage must be limited to 25MB (currently using 35.94MB)
Filesystem: 664 new files
Database: 5 new tables, 7 new options
New tables
wp_rednaopdfninja_custom_field
wp_rednaopdfninja_templates
wp_rednaopdfninja_records
wp_rednaopdfninja_form_config
wp_rednaopdfninja_links
New WordPress options
can_compress_scripts
db_upgraded
widget_theysaidso_widget
widget_recent-comments
widget_recent-posts
theysaidso_admin_options
rednao_rednaopdfninja_db_version

Browser metrics Passed 4 tests

An overview of browser requirements for PDF Builder for Ninja Forms
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,817 ▲4514.16 ▼0.151.66 ▼0.3242.34 ▲0.11
Dashboard /wp-admin2,225 ▲455.60 ▼0.0788.36 ▼7.7541.72 ▼1.76
Posts /wp-admin/edit.php2,127 ▲241.97 ▼0.0940.21 ▲0.1237.37 ▲2.54
Add New Post /wp-admin/post-new.php1,548 ▲2223.05 ▼0.07665.00 ▲62.6350.25 ▼7.59
Media Library /wp-admin/upload.php1,430 ▲304.17 ▼0.0396.23 ▼2.1342.59 ▼2.29
Entries /wp-admin/admin.php?page=rednaopdfninja_pdf_builder_entries7992.1923.1725.09
Ninja Forms PDF Builder /wp-admin/admin.php?page=rednaopdfninja_pdf_builder9073.0554.2527.09

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
It is recommended to fix the following
  • Zombie tables detected upon uninstall: 5 tables
    • wp_rednaopdfninja_templates
    • wp_rednaopdfninja_custom_field
    • wp_rednaopdfninja_form_config
    • wp_rednaopdfninja_links
    • wp_rednaopdfninja_records
  • Zombie WordPress options were found after uninstall: 7 options
    • widget_recent-posts
    • theysaidso_admin_options
    • widget_recent-comments
    • widget_theysaidso_widget
    • rednao_rednaopdfninja_db_version
    • db_upgraded
    • can_compress_scripts

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Good news, no errors were detected

SRP 0% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle: PHP files have to remain inert when accessed directly, throwing no errors and performing no actions
Almost there! Just fix the following items
  • 4× GET requests to PHP files return non-empty strings:
    • > /wp-content/plugins/pdf-builder-for-ninja-forms/vendor/sabberworm/php-css-parser/tests/quickdump.php
    • > /wp-content/plugins/pdf-builder-for-ninja-forms/Pages/AdditionalPlugins.php
    • > /wp-content/plugins/pdf-builder-for-ninja-forms/Pages/PDFBuilder.php
    • > /wp-content/plugins/pdf-builder-for-ninja-forms/vendor/phpqrcode/index.php
  • 280× PHP files trigger errors when accessed directly with GET requests (only 10 are shown):
    • > PHP Notice
      Undefined variable: fontDir in wp-content/plugins/pdf-builder-for-ninja-forms/vendor/dompdf/dompdf/lib/fonts/dompdf_font_family_cache.php on line 45
    • > PHP Notice
      Undefined variable: fontDir in wp-content/plugins/pdf-builder-for-ninja-forms/vendor/dompdf/dompdf/lib/fonts/dompdf_font_family_cache.php on line 58
    • > PHP Fatal error
      Uncaught Error: Class 'Dompdf\\Renderer\\Block' not found in wp-content/plugins/pdf-builder-for-ninja-forms/vendor/dompdf/dompdf/src/Renderer/TableCell.php:18
    • > PHP Fatal error
      Uncaught Error: Class 'rednaoformpdfbuilder\\Integration\\Processors\\Entry\\EntryItems\\EntryItemBase' not found in wp-content/plugins/pdf-builder-for-ninja-forms/Integration/Adapters/NinjaForms/Entry/EntryItems/NinjaFormsAddressEntryItem.php:15
    • > PHP Warning
      include(vendor/autoload.php): failed to open stream: No such file or directory in wp-content/plugins/pdf-builder-for-ninja-forms/vendor/printnode/printnode-php/examples/example-2-creating-a-child-account.php on line 2
    • > PHP Fatal error
      Uncaught Error: Class 'rednaoformpdfbuilder\\Integration\\Processors\\Loader\\ProcessorLoaderBase' not found in wp-content/plugins/pdf-builder-for-ninja-forms/Integration/Adapters/NinjaForms/Loader/NinjaFormsProcessorLoader.php:16
    • > PHP Fatal error
      Uncaught Error: Class 'Dompdf\\FrameReflower\\AbstractFrameReflower' not found in wp-content/plugins/pdf-builder-for-ninja-forms/vendor/dompdf/dompdf/src/FrameReflower/TableRowGroup.php:18
    • > PHP Notice
      Undefined variable: fontDir in wp-content/plugins/pdf-builder-for-ninja-forms/vendor/dompdf/dompdf/lib/fonts/dompdf_font_family_cache.php on line 40
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit_Framework_TestCase' not found in wp-content/plugins/pdf-builder-for-ninja-forms/vendor/printnode/printnode-php/tests/AccountsTests.php:4
    • > PHP Fatal error
      Uncaught Error: Class 'Dompdf\\FrameDecorator\\AbstractFrameDecorator' not found in wp-content/plugins/pdf-builder-for-ninja-forms/vendor/dompdf/dompdf/src/FrameDecorator/Table.php:21

User-side errors Passed 1 test

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

Optimizations

Plugin configuration 86% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file describes your plugin functionality and requirements and it is parsed to prepare the your plugin's listing
Attributes that require attention:
  • Screenshots: These screenshots do not have images: #1 (The first drag and drop pdf builder), #2 (You can easily customize the colors, sizes etc), #3 (Arrange multiple items without issues using the alignment tools)
The official readme.txt might help

pdf-builder-for-ninja-forms/rednaopdfninja.php 77% from 13 tests

The principal PHP file in "PDF Builder for Ninja Forms" v. 1.2.81 is loaded by WordPress automatically on each request
Please take the time to fix the following:
  • Main file name: The principal plugin file should be the same as the plugin slug ("pdf-builder-for-ninja-forms.php" instead of "rednaopdfninja.php")
  • Text Domain: The text domain name must use dashes instead of underscores, and it must be lowercase
  • 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 | This is a short overview of programming languages used in this plugin, detecting executable files
Please fix the following items
  • You should never include executable (binary) or otherwise dangerous files in your plugin
    • .bat - Batch File in Windows
      • wp-content/plugins/pdf-builder-for-ninja-forms/vendor/phpqrcode/tools/merge.bat
116,352 lines of code in 487 files:
LanguageFilesBlank linesComment linesLines of code
PHP36813,56621,13095,130
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

Analyzing cyclomatic complexity and code structure
It is recommended to fix the following
  • Cyclomatic complexity of classes should be reduced to less than 1000 (currently 1,487)
  • Please reduce cyclomatic complexity of methods to less than 100 (currently 652)
Cyclomatic complexity
Average complexity per logical line of code0.40
Average class complexity31.41
▷ Minimum class complexity1.00
▷ Maximum class complexity1,487.00
Average method complexity4.66
▷ Minimum method complexity1.00
▷ Maximum method complexity652.00
Code structure
Namespaces71
Interfaces7
Traits0
Classes355
▷ Abstract classes257.04%
▷ Concrete classes33092.96%
▷ Final classes00.00%
Methods3,092
▷ Static methods2738.83%
▷ Public methods2,58583.60%
▷ Protected methods32410.48%
▷ Private methods1835.92%
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

PNG files should be compressed to save space and minimize bandwidth usage
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/adIcons/stp.png10.54KB4.75KB▼ 54.92%
images/toolIcons/start.png0.62KB0.88KB0.00%
images/toolIcons/figures.png0.61KB0.74KB0.00%
images/temporalImage-107x107.png13.46KB6.59KB▼ 51.05%
images/toolIcons/image.png0.60KB0.70KB0.00%