56% ninja-forms

Code Review | Ninja Forms Contact Form - The Drag and Drop Form Builder for WordPress

WordPress plugin Ninja Forms Contact Form - The Drag and Drop Form Builder for WordPress scored56%from 54 tests.

About plugin

  • Plugin page: ninja-forms
  • Plugin version: 3.7.0
  • PHP version: 7.4.16
  • WordPress compatibility: 6.1-6.4.0
  • WordPress version: 6.3.1
  • First release: Dec 21, 2011
  • Latest release: Nov 8, 2023
  • Number of updates: 675
  • Update frequency: every 6.4 days
  • Top authors: kstover (65.33%)krmoorhouse (21.04%)nahuelmahe (7.7%)kbjohnson90 (3.56%)jameslaws (2.52%)

Code review

54 tests

User reviews

1204 reviews

Install metrics

800,000+ active /41,562,151 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: ▲1.67MB] [CPU: ▲24.16ms] Passed 4 tests

An overview of server-side resources used by Ninja Forms Contact Form - The Drag and Drop Form Builder for WordPress
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /5.13 ▲1.6763.63 ▲23.62
Dashboard /wp-admin4.97 ▲1.6778.86 ▲32.50
Posts /wp-admin/edit.php5.02 ▲1.6769.20 ▲20.63
Add New Post /wp-admin/post-new.php7.71 ▲1.82114.49 ▲20.86
Media Library /wp-admin/upload.php4.92 ▲1.6965.10 ▲31.51
Dashboard /wp-admin/admin.php?page=ninja-forms5.3865.67
Import / Export /wp-admin/admin.php?page=nf-import-export4.9556.59
Settings /wp-admin/admin.php?page=nf-settings5.0061.22
Get Help /wp-admin/admin.php?page=nf-system-status4.8857.73
Processing /wp-admin/options.php?page=nf-processing4.8054.73
Submissions /wp-admin/admin.php?page=nf-submissions4.9264.91

Server storage [IO: ▲17.54MB] [DB: ▲0.12MB] Passed 3 tests

Analyzing filesystem and database footprints of this plugin
This plugin was installed successfully
Filesystem: 674 new files
Database: 11 new tables, 14 new options
New tables
wp_nf3_chunks
wp_nf3_action_meta
wp_nf3_object_meta
wp_nf3_objects
wp_nf3_upgrades
wp_nf3_form_meta
wp_nf3_field_meta
wp_nf3_fields
wp_nf3_relationships
wp_nf3_actions
...
New WordPress options
nf_admin_notice
ninja-forms-views-secret
widget_ninja_forms_widget
widget_recent-posts
ninja_forms_required_updates
widget_theysaidso_widget
ninja_forms_settings
db_upgraded
widget_recent-comments
ninja_forms_needs_updates
...

Browser metrics Passed 4 tests

A check of browser resources used by Ninja Forms Contact Form - The Drag and Drop Form Builder for WordPress
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,834 ▲4714.16 ▼0.241.73 ▼0.5843.63 ▼1.73
Dashboard /wp-admin2,239 ▲595.59 ▼0.0195.27 ▼3.7042.67 ▼2.64
Posts /wp-admin/edit.php2,147 ▲471.97 ▼0.0438.81 ▲2.2933.69 ▲0.01
Add New Post /wp-admin/post-new.php6,458 ▲4,93227.40 ▲4.43866.60 ▲194.8038.01 ▼12.60
Media Library /wp-admin/upload.php1,441 ▲414.19 ▲0.0596.33 ▼0.6942.10 ▼1.39
Dashboard /wp-admin/admin.php?page=ninja-forms1,4037.29260.1682.25
Add New /wp-admin/admin.php?page=ninja-forms#new-form1,6717.77122.8768.30
Import / Export /wp-admin/admin.php?page=nf-import-export1,1312.1137.5137.29
Settings /wp-admin/admin.php?page=nf-settings1,4922.4237.6246.99
Get Help /wp-admin/admin.php?page=nf-system-status1,2192.0323.6036.47
Processing /wp-admin/options.php?page=nf-processing8472.1537.9636.29
Submissions /wp-admin/admin.php?page=nf-submissions9409.74171.7831.04
Add-Ons /wp-admin/admin.php?page=ninja-forms#apps2,5317.20112.91102.59

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
These items require your attention
  • Zombie tables detected upon uninstall: 11 tables
    • wp_nf3_field_meta
    • wp_nf3_action_meta
    • wp_nf3_chunks
    • wp_nf3_forms
    • wp_nf3_objects
    • wp_nf3_upgrades
    • wp_nf3_fields
    • wp_nf3_object_meta
    • wp_nf3_form_meta
    • wp_nf3_relationships
    • ...
  • The uninstall procedure has failed, leaving 14 options in the database
    • ninja_forms_required_updates
    • nf_admin_notice
    • ninja_forms_oauth_client_secret
    • ninja_forms_version
    • widget_theysaidso_widget
    • db_upgraded
    • widget_recent-posts
    • widget_ninja_forms_widget
    • ninja-forms-views-secret
    • theysaidso_admin_options
    • ...

Smoke tests 0% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Please fix the following server-side errors
    • > GET request to /wp-admin/options.php?page=nf-processing
    • > Notice in wp-content/plugins/ninja-forms/lib/StepProcessing/menu.php+72
    Undefined index: title

SRP 0% from 2 tests

🔹 Tests weight: 20 | It is important to ensure that your PHP files perform no action when accessed directly, respecting the single-responsibility principle
Almost there! Just fix the following items
  • 2× PHP files output text when accessed directly:
    • > /wp-content/plugins/ninja-forms/includes/Templates/admin-metabox-append-a-form.html.php
    • > /wp-content/plugins/ninja-forms/includes/Templates/admin-metaboxes-calcs.html.php
  • 68× PHP files trigger server-side errors or warnings when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html_e() in wp-content/plugins/ninja-forms/includes/Templates/admin-menu-system-status.html.php:3
    • > PHP Notice
      Undefined variable: data in wp-content/plugins/ninja-forms/includes/Templates/admin-metaboxes-calcs.html.php on line 2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_attr() in wp-content/plugins/ninja-forms/includes/Templates/admin-notice.html.php:1
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html_e() in wp-content/plugins/ninja-forms/includes/Templates/admin-notice-form-import.html.php:3
    • > PHP Fatal error
      Uncaught Error: Class 'NinjaForms\\Includes\\Entities\\SimpleEntity' not found in wp-content/plugins/ninja-forms/includes/Entities/SubmissionExtraHandlerResponse.php:10
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html_e() in wp-content/plugins/ninja-forms/includes/Templates/ui-nf-drawer-buttons.html.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html() in wp-content/plugins/ninja-forms/includes/Templates/display-noscript-message.html.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html_e() in wp-content/plugins/ninja-forms/includes/Templates/ui-nf-menu-drawer.html.php:3
    • > PHP Notice
      Undefined variable: edit_url in wp-content/plugins/ninja-forms/includes/Templates/admin-menu-all-forms-column-title.html.php on line 2
    • > PHP Fatal error
      Uncaught Error: Interface 'NF_Exports_Interfaces_SubmissionCsvExportInterface' not found in wp-content/plugins/ninja-forms/includes/Exports/SubmissionCsvExport.php:13

User-side errors 0% from 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
Please take a look at the following user-side issues
    • > GET request to /wp-admin/options.php?page=nf-processing
    • > Network (severe)
    wp-content/plugins/ninja-forms/lib/Legacy/images/ui-bg_flat_75_ffffff_40x100.png - Failed to load resource: the server responded with a status of 404 (Not Found)

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 88% from 16 tests

Perhaps the most important file in your plugin readme.txt gets parsed in order to generate the public listing of your plugin
Attributes that need to be fixed:
  • Tags: Too many tags (50 tag instead of maximum 10); only the first 5 tags are used in your directory listing
  • Screenshots: Screenshot #3 (Emails and Actions) image required
The official readme.txt might help

ninja-forms/ninja-forms.php Passed 13 tests

The main PHP script in "Ninja Forms Contact Form - The Drag and Drop Form Builder for WordPress" version 3.7.0 is automatically included on every request by WordPress
76 characters long description:
Ninja Forms is a webform builder with unparalleled ease of use and features.

Code Analysis Passed 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 plugin126,694 lines of code in 546 files:
LanguageFilesBlank linesComment linesLines of code
PO File2835,96062,90184,718
PHP3538,58613,63031,286
JavaScript751,2282,1537,565
CSS272564,7671,675
HTML57731694
SVG100655
Markdown249083
JSON30018

PHP code Passed 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
This plugin has no cyclomatic complexity problems
Cyclomatic complexity
Average complexity per logical line of code0.35
Average class complexity15.23
▷ Minimum class complexity1.00
▷ Maximum class complexity151.00
Average method complexity3.15
▷ Minimum method complexity1.00
▷ Maximum method complexity68.00
Code structure
Namespaces14
Interfaces8
Traits0
Classes242
▷ Abstract classes2711.16%
▷ Concrete classes21588.84%
▷ Final classes5525.58%
Methods1,748
▷ Static methods1317.49%
▷ Public methods1,37978.89%
▷ Protected methods23613.50%
▷ Private methods1337.61%
Functions57
▷ Named functions2849.12%
▷ Anonymous functions2950.88%
Constants33
▷ Global constants39.09%
▷ Class constants3090.91%
▷ Public constants30100.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
57 PNG files occupy 0.76MB with 0.47MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/img/add-ons/zapier.png11.36KB4.45KB▼ 60.87%
assets/img/promotions/dashboard-user-management.png17.03KB4.97KB▼ 70.80%
assets/img/add-ons/cleverreach.png20.38KB8.02KB▼ 60.65%
assets/img/add-ons/vimeo-uploader.png20.58KB7.98KB▼ 61.22%
assets/img/add-ons/convertkit.png11.89KB5.15KB▼ 56.65%