78% generate-pdf-using-contact-form-7

Code Review | Generate PDF using Contact Form 7

WordPress plugin Generate PDF using Contact Form 7 scored78%from 54 tests.

About plugin

  • Plugin page: generate-pdf-usin...
  • Plugin version: 4.0.3
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-6.3
  • WordPress version: 6.3.1
  • First release: Apr 30, 2020
  • Latest release: Aug 11, 2023
  • Number of updates: 104
  • Update frequency: every 11.5 days
  • Top authors: zealopensource (100%)

Code review

54 tests

User reviews

30 reviews

Install metrics

3,000+ active /62,980 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

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

Server metrics [RAM: ▲0.00MB] [CPU: ▼5.40ms] Passed 4 tests

A check of server-side resources used by Generate PDF using Contact Form 7
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.46 ▲0.0034.08 ▼7.82
Dashboard /wp-admin3.31 ▲0.0043.49 ▼1.78
Posts /wp-admin/edit.php3.36 ▲0.0042.64 ▼1.07
Add New Post /wp-admin/post-new.php5.89 ▲0.0081.61 ▼10.92
Media Library /wp-admin/upload.php3.23 ▲0.0032.00 ▼0.72
PDF with CF7 /wp-admin/admin.php?page=wp-cf7-send-pdf3.0024.03

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

How much does this plugin use your filesystem and database?
No storage issues were detected
Filesystem: 618 new files
Database: no new tables, 6 new options
New WordPress options
widget_theysaidso_widget
widget_recent-comments
widget_recent-posts
theysaidso_admin_options
db_upgraded
can_compress_scripts

Browser metrics Passed 4 tests

A check of browser resources used by Generate PDF using Contact Form 7
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,789 ▲314.10 ▼0.531.70 ▼0.2237.66 ▼0.99
Dashboard /wp-admin2,195 ▲215.56 ▼0.1381.18 ▼5.7537.88 ▼0.88
Posts /wp-admin/edit.php2,100 ▲31.99 ▼0.0135.81 ▲0.2630.21 ▼5.26
Add New Post /wp-admin/post-new.php1,534 ▲618.38 ▼4.52596.99 ▼63.3362.99 ▲1.02
Media Library /wp-admin/upload.php1,400 ▼04.16 ▲0.0198.13 ▼12.0142.27 ▼4.93
PDF with CF7 /wp-admin/admin.php?page=wp-cf7-send-pdf280.420.063.68

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
Please fix the following items
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • widget_recent-posts
    • widget_theysaidso_widget
    • widget_recent-comments
    • can_compress_scripts
    • theysaidso_admin_options
    • db_upgraded

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Everything seems fine, however this is by no means an exhaustive test

SRP 50% 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 take a closer look at the following
  • 211× PHP files trigger server-side errors or warnings when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'Mpdf\\Tag\\BlockTag' not found in wp-content/plugins/generate-pdf-using-contact-form-7/inc/lib/mpdf/vendor/mpdf/mpdf/src/Tag/H4.php:5
    • > PHP Fatal error
      Uncaught Error: Class 'setasign\\Fpdi\\PdfParser\\Type\\PdfType' not found in wp-content/plugins/generate-pdf-using-contact-form-7/inc/lib/mpdf/vendor/setasign/fpdi/src/PdfParser/Type/PdfString.php:18
    • > PHP Fatal error
      Uncaught Error: Class 'Mpdf\\Tag\\Tag' not found in wp-content/plugins/generate-pdf-using-contact-form-7/inc/lib/mpdf/vendor/mpdf/mpdf/src/Tag/A.php:5
    • > PHP Fatal error
      Uncaught Error: Class 'Mpdf\\Barcode\\AbstractBarcode' not found in wp-content/plugins/generate-pdf-using-contact-form-7/inc/lib/mpdf/vendor/mpdf/mpdf/src/Barcode/Code93.php:9
    • > PHP Fatal error
      Uncaught Error: Interface 'DeepCopy\\Filter\\Filter' not found in wp-content/plugins/generate-pdf-using-contact-form-7/inc/lib/mpdf/vendor/myclabs/deep-copy/src/DeepCopy/Filter/KeepFilter.php:5
    • > PHP Fatal error
      Uncaught Error: Class 'Mpdf\\Tag\\InlineTag' not found in wp-content/plugins/generate-pdf-using-contact-form-7/inc/lib/mpdf/vendor/mpdf/mpdf/src/Tag/Del.php:5
    • > PHP Fatal error
      Uncaught Error: Class 'Mpdf\\Tag\\BlockTag' not found in wp-content/plugins/generate-pdf-using-contact-form-7/inc/lib/mpdf/vendor/mpdf/mpdf/src/Tag/Footer.php:5
    • > PHP Fatal error
      Uncaught Error: Class 'Mpdf\\Tag\\InlineTag' not found in wp-content/plugins/generate-pdf-using-contact-form-7/inc/lib/mpdf/vendor/mpdf/mpdf/src/Tag/Cite.php:5
    • > PHP Fatal error
      Uncaught Error: Interface 'Psr\\Log\\LoggerAwareInterface' not found in wp-content/plugins/generate-pdf-using-contact-form-7/inc/lib/mpdf/vendor/mpdf/mpdf/src/Mpdf.php:28
    • > PHP Fatal error
      Uncaught Error: Class 'Mpdf\\Tag\\BlockTag' not found in wp-content/plugins/generate-pdf-using-contact-form-7/inc/lib/mpdf/vendor/mpdf/mpdf/src/Tag/Div.php:5

User-side errors 0% from 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
There are user-side issues you should fix
    • > GET request to /wp-admin/admin.php?page=wp-cf7-send-pdf
    • > Network (severe)
    wp-admin/admin.php?page=wp-cf7-send-pdf - Failed to load resource: the server responded with a status of 403 (Forbidden)

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

You should put a lot of thought into formatting readme.txt as it is used by WordPress.org to prepare the public listing of your plugin
7 plugin tags: form, contact form, contact, pdf, contact corm 7...

generate-pdf-using-contact-form-7/generate-pdf-using-contact-form-7.php 92% from 13 tests

The primary PHP file in "Generate PDF using Contact Form 7" version 4.0.3 is used by WordPress to initiate all plugin functionality
You should first fix the following items:
  • Description: If Twitter did it, so should we! Keep the description under 140 characters (currently 173 characters long)

Code Analysis 95% from 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of file extensions present in this plugin and a short test that no dangerous files are bundled with this plugin
Success! There were no dangerous files found in this plugin89,903 lines of code in 451 files:
LanguageFilesBlank linesComment linesLines of code
PHP39211,22511,80176,055
JavaScript91,1291,0969,865
CSS11176992,054
Markdown938501,180
JSON2030554
YAML6364117
XML310075
Bourne Shell1203

PHP code 0% from 2 tests

Analyzing cyclomatic complexity and code structure
These items need your attention
  • Class cyclomatic complexity should be reduced to less than 1000 (currently 7,024)
  • Please reduce cyclomatic complexity of methods to less than 100 (currently 460)
Cyclomatic complexity
Average complexity per logical line of code0.52
Average class complexity59.54
▷ Minimum class complexity1.00
▷ Maximum class complexity7,024.00
Average method complexity14.05
▷ Minimum method complexity1.00
▷ Maximum method complexity460.00
Code structure
Namespaces44
Interfaces10
Traits6
Classes286
▷ Abstract classes93.15%
▷ Concrete classes27796.85%
▷ Final classes134.69%
Methods1,363
▷ Static methods13910.20%
▷ Public methods1,17986.50%
▷ Protected methods554.04%
▷ Private methods1299.46%
Functions39
▷ Named functions923.08%
▷ Anonymous functions3076.92%
Constants433
▷ Global constants112.54%
▷ Class constants42297.46%
▷ Public constants422100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
3 PNG files occupy 0.02MB with 0.01MB in potential savings
Potential savings
Compression of 3 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/css/images/ui-icons_444444_256x240.png6.84KB4.18KB▼ 38.90%
assets/images/pdf-logo.png7.99KB4.14KB▼ 48.19%
assets/images/arrow-right-top.png5.97KB2.68KB▼ 55.17%