77% contact-form-pdf-extension

Code Review | contact form 7 pdf extension

WordPress plugin contact form 7 pdf extension scored77%from 54 tests.

About plugin

  • Plugin page: contact-form-pdf-...
  • Plugin version: 1.2
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-4.9.5
  • WordPress version: 6.3.1
  • First release: Dec 14, 2015
  • Latest release: Jul 15, 2023
  • Number of updates: 22
  • Update frequency: every 126.0 days
  • Top authors: AnjitVishwakarma (100%)

Code review

54 tests

User reviews

5 reviews

Install metrics

70+ active /4,957 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
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.02MB] [CPU: ▼2.29ms] Passed 4 tests

This is a short check of server-side resources used by contact form 7 pdf extension
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.49 ▲0.0235.09 ▼3.39
Dashboard /wp-admin3.33 ▲0.0244.28 ▼4.57
Posts /wp-admin/edit.php3.38 ▲0.0244.87 ▼0.14
Add New Post /wp-admin/post-new.php5.91 ▲0.0295.90 ▼1.06
Media Library /wp-admin/upload.php3.25 ▲0.0234.16 ▲0.63

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

Analyzing filesystem and database footprints of this plugin
This plugin installed successfully
Filesystem: 82 new files
Database: no new tables, 6 new options
New WordPress options
theysaidso_admin_options
db_upgraded
widget_recent-posts
widget_theysaidso_widget
can_compress_scripts
widget_recent-comments

Browser metrics Passed 4 tests

A check of browser resources used by contact form 7 pdf extension
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,817 ▲8213.41 ▼0.974.32 ▲2.4842.12 ▼2.07
Dashboard /wp-admin2,226 ▲384.90 ▼0.14105.84 ▼4.4076.78 ▲30.46
Posts /wp-admin/edit.php2,112 ▲232.03 ▲0.0338.32 ▼7.0134.27 ▲1.47
Add New Post /wp-admin/post-new.php1,538 ▲2423.24 ▲5.43708.62 ▲63.5252.52 ▼4.66
Media Library /wp-admin/upload.php1,402 ▲144.23 ▲0.0097.77 ▼7.0072.67 ▲28.99

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
The following items require your attention
  • Zombie WordPress options were found after uninstall: 6 options
    • db_upgraded
    • widget_recent-posts
    • can_compress_scripts
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • widget_recent-comments

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
The smoke test was a success, however most plugin functionality was not tested

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
The following issues need your attention
  • 2× PHP files perform the task of outputting text when accessed with GET requests:
    • > /wp-content/plugins/contact-form-pdf-extension/trunk/pdflib/gif.php
    • > /wp-content/plugins/contact-form-pdf-extension/pdflib/gif.php
  • 2× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/contact-form-pdf-extension/trunk/contact-form-7-pdf-extension.php:16
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/contact-form-pdf-extension/contact-form-7-pdf-extension.php:16

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 90% 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
3 plugin tags: contact form 7 pdf, contact form 7 pdf extension, contact form 7 mail pdf

contact-form-pdf-extension/contact-form-7-pdf-extension.php 77% from 13 tests

The main file in "contact form 7 pdf extension" v. 1.2 serves as a complement to information provided in readme.txt and as the entry point to the plugin
It is important to fix the following:
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("contact-form-pdf-extension.php" instead of "contact-form-7-pdf-extension.php")
  • Text Domain: You no longer need to specify the text domain since WordPress 4.6; it must be the same as the plugin slug
  • Description: Please keep the plugin description shorter than 140 characters (currently 201 characters long)

Code Analysis 97% from 3 tests

File types Passed 1 test

🔸 Test weight: 35 | An overview of files in this plugin; executable files are not allowed
There were no executable files found in this plugin6,297 lines of code in 19 files:
LanguageFilesBlank linesComment linesLines of code
PHP195858686,297

PHP code 50% from 2 tests

This is a very shot review of cyclomatic complexity and code structure
Please tend to the following items
  • Method cyclomatic complexity has to be reduced to less than 100 (currently 270)
Cyclomatic complexity
Average complexity per logical line of code0.41
Average class complexity598.50
▷ Minimum class complexity448.00
▷ Maximum class complexity749.00
Average method complexity11.67
▷ Minimum method complexity1.00
▷ Maximum method complexity270.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes4
▷ Abstract classes00.00%
▷ Concrete classes4100.00%
▷ Final classes00.00%
Methods224
▷ Static methods00.00%
▷ Public methods224100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions46
▷ Named functions46100.00%
▷ Anonymous functions00.00%
Constants10
▷ Global constants10100.00%
▷ Class constants00.00%
▷ Public constants00.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
2 PNG files occupy 0.01MB with 0.00MB in potential savings
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
trunk/ico.png2.72KB1.54KB▼ 43.26%
ico.png2.72KB1.54KB▼ 43.26%