84% cf7-file-download

Code Review | CF7 File Download - File Download for CF7

WordPress plugin CF7 File Download - File Download for CF7 scored84%from 54 tests.

About plugin

  • Plugin page: cf7-file-download
  • Plugin version: 2.0
  • PHP compatiblity: 5.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-5.4
  • WordPress version: 6.3.1
  • First release: Jul 25, 2020
  • Latest release: Nov 8, 2020
  • Number of updates: 21
  • Update frequency: every 6.7 days
  • Top authors: semirworku (100%)

Code review

54 tests

User reviews

4 reviews

Install metrics

4,000+ active /13,474 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
The plugin installed successfully, without throwing any errors or notices

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

Analyzing server-side resources used by CF7 File Download - File Download for CF7
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0143.55 ▼2.65
Dashboard /wp-admin3.32 ▼0.0348.23 ▼17.23
Posts /wp-admin/edit.php3.37 ▲0.0149.54 ▲1.87
Add New Post /wp-admin/post-new.php5.92 ▲0.0384.64 ▼23.61
Media Library /wp-admin/upload.php3.24 ▲0.0137.83 ▲3.56

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

Input-output and database impact of this plugin
This plugin installed successfully
Filesystem: 13 new files
Database: no new tables, 6 new options
New WordPress options
db_upgraded
widget_theysaidso_widget
theysaidso_admin_options
can_compress_scripts
widget_recent-posts
widget_recent-comments

Browser metrics Passed 4 tests

CF7 File Download - File Download for CF7: an overview of browser usage
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,808 ▲6214.27 ▼0.451.92 ▲0.2440.71 ▼3.23
Dashboard /wp-admin2,214 ▲375.63 ▼0.0489.92 ▼8.6240.84 ▼1.38
Posts /wp-admin/edit.php2,116 ▲162.03 ▲0.0935.40 ▲0.5332.27 ▼2.28
Add New Post /wp-admin/post-new.php1,540 ▲922.82 ▼0.32648.14 ▼20.1158.15 ▲8.75
Media Library /wp-admin/upload.php1,419 ▲254.23 ▼0.0296.09 ▼1.9443.22 ▼1.18

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
You still need to fix the following
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • widget_theysaidso_widget
    • widget_recent-posts
    • theysaidso_admin_options
    • can_compress_scripts
    • db_upgraded
    • widget_recent-comments

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
The smoke test was a success, however most plugin functionality was not tested

SRP 50% from 2 tests

🔹 Tests weight: 20 | A shallow check of the single-responsibility principle; PHP files should perform no action - including output of placeholder text - and trigger no errors when accessed directly
Almost there! Just fix the following items
  • 2× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/cf7-file-download/cf7-file-download.php:20
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/cf7-file-download/templates/form-template.php:4

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 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
5 plugin tags: contact form 7, file download, catalog download, attachment download, contact form

cf7-file-download/cf7-file-download.php Passed 13 tests

The main PHP script in "CF7 File Download - File Download for CF7" version 2.0 is automatically included on every request by WordPress
51 characters long description:
Adds file/catalog download option to Contact Form 7

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of programming languages used in this plugin; dangerous file extensions are not allowed
Success! There were no dangerous files found in this plugin331 lines of code in 7 files:
LanguageFilesBlank linesComment linesLines of code
PHP39965246
PO File2141552
JavaScript16227
CSS1006

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
This plugin has no cyclomatic complexity problems
Cyclomatic complexity
Average complexity per logical line of code0.22
Average class complexity6.00
▷ Minimum class complexity6.00
▷ Maximum class complexity6.00
Average method complexity1.56
▷ Minimum method complexity1.00
▷ Maximum method complexity4.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods9
▷ Static methods00.00%
▷ Public methods9100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants4
▷ Global constants4100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
1 PNG file occupies 0.02MB with 0.01MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
assets/images/placeholder.png15.96KB8.80KB▼ 44.86%