84% cf7-post-fields

Code Review | Contact Form 7 - Post Fields

WordPress plugin Contact Form 7 - Post Fields scored84%from 54 tests.

About plugin

  • Plugin page: cf7-post-fields
  • Plugin version: 2.5.7
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-6.2.2
  • WordPress version: 6.3.1
  • First release: Nov 11, 2016
  • Latest release: Jun 13, 2023
  • Number of updates: 58
  • Update frequency: every 41.4 days
  • Top authors: markusfroehlich (100%)

Code review

54 tests

User reviews

31 reviews

Install metrics

4,000+ active /39,593 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
This plugin's installer ran successfully

Server metrics [RAM: ▼0.01MB] [CPU: ▼10.25ms] Passed 4 tests

This is a short check of server-side resources used by Contact Form 7 - Post Fields
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0035.60 ▼3.64
Dashboard /wp-admin3.31 ▼0.0446.43 ▼18.92
Posts /wp-admin/edit.php3.36 ▲0.0049.38 ▲3.76
Add New Post /wp-admin/post-new.php5.89 ▲0.0081.88 ▼22.19
Media Library /wp-admin/upload.php3.23 ▲0.0037.06 ▲4.32

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

Filesystem and database footprint
This plugin was installed successfully
Filesystem: 75 new files
Database: no new tables, 6 new options
New WordPress options
db_upgraded
widget_recent-comments
can_compress_scripts
widget_recent-posts
theysaidso_admin_options
widget_theysaidso_widget

Browser metrics Passed 4 tests

Contact Form 7 - Post Fields: an overview of browser usage
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,800 ▲5413.47 ▼0.924.60 ▲2.8438.20 ▼3.09
Dashboard /wp-admin2,209 ▲214.90 ▲0.0298.80 ▼3.8941.41 ▲1.21
Posts /wp-admin/edit.php2,086 ▼31.99 ▼0.0439.86 ▲0.6436.34 ▲1.97
Add New Post /wp-admin/post-new.php1,538 ▲1923.04 ▼0.38641.67 ▼34.1356.58 ▼2.61
Media Library /wp-admin/upload.php1,391 ▲64.19 ▼0.02105.86 ▲5.1948.39 ▲1.29

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
Please fix the following items
  • Zombie WordPress options detected upon uninstall: 6 options
    • widget_recent-posts
    • db_upgraded
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • can_compress_scripts
    • widget_recent-comments

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Even though everything seems fine, this is not an exhaustive test

SRP 50% 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
Please fix the following items
  • 8× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html() in wp-content/plugins/cf7-post-fields/modules/generators/checkbox.php:9
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html() in wp-content/plugins/cf7-post-fields/modules/generators/image-checkbox.php:8
    • > PHP Notice
      Undefined variable: description in wp-content/plugins/cf7-post-fields/modules/generators/checkbox.php on line 3
    • > PHP Notice
      Undefined variable: description in wp-content/plugins/cf7-post-fields/modules/generators/select.php on line 3
    • > PHP Notice
      Undefined variable: description in wp-content/plugins/cf7-post-fields/modules/generators/image-checkbox.php on line 3
    • > PHP Notice
      Undefined variable: description in wp-content/plugins/cf7-post-fields/modules/generators/image-select.php on line 3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html() in wp-content/plugins/cf7-post-fields/modules/generators/select.php:8
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html() in wp-content/plugins/cf7-post-fields/modules/generators/image-select.php:8

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
No browser errors were detected

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% from 16 tests

It's important to format your readme.txt file correctly as it is parsed for the public listing of your plugin
These attributes need to be fixed:
  • Plugin Name: Please specify the plugin name on the first line ( === cf7-post-fields === )
Please take inspiration from this readme.txt

cf7-post-fields/cf7-post-fields.php Passed 13 tests

The primary PHP file in "Contact Form 7 - Post Fields" version 2.5.7 is used by WordPress to initiate all plugin functionality
75 characters long description:
Provides a dynamic post select, radio and checkbox field to your CF7 forms.

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 plugin7,125 lines of code in 73 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript571,2043514,475
PHP125553212,067
CSS4820583

PHP code Passed 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
There are no cyclomatic complexity problems detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.38
Average class complexity45.29
▷ Minimum class complexity7.00
▷ Maximum class complexity86.00
Average method complexity5.92
▷ Minimum method complexity1.00
▷ Maximum method complexity43.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes7
▷ Abstract classes00.00%
▷ Concrete classes7100.00%
▷ Final classes00.00%
Methods63
▷ Static methods11.59%
▷ Public methods4469.84%
▷ Protected methods1117.46%
▷ Private methods812.70%
Functions1
▷ Named functions1100.00%
▷ Anonymous functions00.00%
Constants1
▷ Global constants1100.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
There were not PNG files found in your plugin