74% pdf-forms-for-contact-form-7

Code Review | PDF Forms Filler for CF7

WordPress plugin PDF Forms Filler for CF7 scored74%from 54 tests.

About plugin

  • Plugin page: pdf-forms-for-con...
  • Plugin version: 2.1.8
  • PHP compatiblity: 5.2+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.8-6.4
  • WordPress version: 6.3.1
  • First release: Mar 23, 2017
  • Latest release: Nov 8, 2023
  • Number of updates: 161
  • Update frequency: every 15.0 days
  • Top authors: maximumsoftware (100%)

Code review

54 tests

User reviews

12 reviews

Install metrics

4,000+ active /145,865 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
Installer ran successfully

Server metrics [RAM: ▲0.77MB] [CPU: ▼0.43ms] Passed 4 tests

A check of server-side resources used by PDF Forms Filler for CF7
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /4.22 ▲0.7542.18 ▲2.89
Dashboard /wp-admin4.08 ▲0.7850.14 ▲1.87
Posts /wp-admin/edit.php4.13 ▲0.7753.86 ▲4.37
Add New Post /wp-admin/post-new.php6.68 ▲0.7989.12 ▼10.87
Media Library /wp-admin/upload.php4.01 ▲0.7745.05 ▲11.47
Install Plugins /wp-admin/plugins.php?page=tgmpa-install-plugins4.1134.95

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

Input-output and database impact of this plugin
No storage issues were detected
Filesystem: 107 new files
Database: no new tables, 6 new options
New WordPress options
can_compress_scripts
widget_recent-comments
db_upgraded
widget_recent-posts
widget_theysaidso_widget
theysaidso_admin_options

Browser metrics Passed 4 tests

This is an overview of browser requirements for PDF Forms Filler for CF7
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,836 ▲8914.26 ▼0.251.63 ▼0.3539.72 ▼4.57
Dashboard /wp-admin2,244 ▲705.64 ▲0.0493.29 ▼8.5142.13 ▼0.99
Posts /wp-admin/edit.php2,158 ▲582.16 ▲0.2242.60 ▲2.0340.09 ▲3.96
Add New Post /wp-admin/post-new.php1,563 ▲3223.67 ▲0.83685.55 ▲68.8670.83 ▲7.16
Media Library /wp-admin/upload.php1,457 ▲604.27 ▲0.09101.89 ▲1.8847.38 ▲3.76
Install Plugins /wp-admin/plugins.php?page=tgmpa-install-plugins9892.2228.4731.66

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
You still need to fix the following
  • Uninstall procedure validation failed for this plugin
    • > Warning in wp-content/plugins/pdf-forms-for-contact-form-7/modules/downloads.php+164
    opendir(wp-content/uploads/wpcf7_pdf_forms_downloads): failed to open dir: No such file or directory
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • widget_recent-comments
    • can_compress_scripts
    • db_upgraded
    • widget_recent-posts

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Even though everything seems fine, this is not an exhaustive test

SRP 50% 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
The following issues need your attention
  • 8× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Warning
      Use of undefined constant ABSPATH - assumed 'ABSPATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/pdf-forms-for-contact-form-7/wpcf7-pdf-forms.php on line 7
    • > PHP Fatal error
      Uncaught Error: Class 'WPCF7_Service' not found in wp-content/plugins/pdf-forms-for-contact-form-7/modules/service.php:3
    • > PHP Fatal error
      Uncaught Error: Class 'WPCF7_Pdf_Forms_Service' not found in wp-content/plugins/pdf-forms-for-contact-form-7/modules/pdf-ninja.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function did_action() in wp-content/plugins/pdf-forms-for-contact-form-7/inc/class-tgm-plugin-activation.php:2109
    • > PHP Fatal error
      Uncaught Error: Call to undefined function untrailingslashit() in wp-content/plugins/pdf-forms-for-contact-form-7/pdf-forms-for-contact-form-7.php:17
    • > PHP Fatal error
      Uncaught Error: Call to undefined function did_action() in wp-content/plugins/pdf-forms-for-contact-form-7/inc/class-tgm-plugin-activation.php:2109
    • > PHP Warning
      require_once(ABSPATH/wp-admin/includes/plugin.php): failed to open stream: No such file or directory in wp-content/plugins/pdf-forms-for-contact-form-7/wpcf7-pdf-forms.php on line 7
    • > PHP Fatal error
      require_once(): Failed opening required 'ABSPATH/wp-admin/includes/plugin.php' (include_path='.:/usr/share/php') in wp-content/plugins/pdf-forms-for-contact-form-7/wpcf7-pdf-forms.php on line 7

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
No browser issues were found

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
7 plugin tags: download, contact form, email, filler, pdf...

pdf-forms-for-contact-form-7/pdf-forms-for-contact-form-7.php Passed 13 tests

This is the main PHP file of "PDF Forms Filler for CF7" version 2.1.8, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
139 characters long description:
Build Contact Form 7 forms from PDF forms. Get PDFs auto-filled and attached to email messages and/or website responses on form submission.

Code Analysis 97% from 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short glimpse at programming languages used with this plugin and a check that no dangerous files are present
No dangerous file extensions were detected11,222 lines of code in 94 files:
LanguageFilesBlank linesComment linesLines of code
PHP101,1152,1454,853
PO File101,4781,7923,911
JavaScript635341131,807
HTML7330365
CSS3540285
YAML1001

PHP code 50% from 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
The following items need your attention
  • Cyclomatic complexity of methods has to be reduced to less than 100 (currently 151)
Cyclomatic complexity
Average complexity per logical line of code0.57
Average class complexity79.54
▷ Minimum class complexity1.00
▷ Maximum class complexity483.00
Average method complexity4.93
▷ Minimum method complexity1.00
▷ Maximum method complexity151.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes13
▷ Abstract classes17.69%
▷ Concrete classes1292.31%
▷ Final classes00.00%
Methods260
▷ Static methods3714.23%
▷ Public methods19775.77%
▷ Protected methods238.85%
▷ Private methods4015.38%
Functions5
▷ Named functions5100.00%
▷ Anonymous functions00.00%
Constants7
▷ Global constants00.00%
▷ Class constants7100.00%
▷ Public constants7100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
PNG images were not found in this plugin