78% cf7-live-preview

Code Review | Live Preview for Contact Form 7

WordPress plugin Live Preview for Contact Form 7 scored 78% from 54 tests.

About plugin

  • Plugin page: cf7-live-preview
  • Plugin version: 1.2.0
  • PHP version: 7.4.16
  • WordPress compatibility: 4.4-5.3
  • WordPress version: 5.8.1
  • First release: Feb 20, 2018
  • Latest release: Feb 29, 2020
  • Number of updates: 15
  • Update frequency: every 49.3 days
  • Top authors: GusRuss89 (100%)

Code review

54 tests

User reviews

10 reviews

Install metrics

10,000+ active / 58,619 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
The plugin installed gracefully, with no errors

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

Server-side resources used by Live Preview for Contact Form 7
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /2.84 ▲0.0141.96 ▲7.89
Dashboard /wp-admin3.06 ▲0.0146.06 ▼7.67
Posts /wp-admin/edit.php3.12 ▲0.0142.86 ▲2.28
Add New Post /wp-admin/post-new.php5.42 ▼0.0185.93 ▼570.29
Media Library /wp-admin/upload.php3.01 ▲0.0030.34 ▼3.19

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

Input-output and database impact of this plugin
There were no storage issued detected upon installing this plugin
Filesystem: 6 new files
Database: no new tables, 5 new options
New WordPress options
cf7lp_entirepage
cf7lp_autoreload
cf7lp_background
cf7lp_width
cf7lp_preview_post_id

Browser metrics Passed 4 tests

Checking browser requirements for Live Preview for Contact Form 7
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,689 ▲9315.83 ▲0.199.75 ▼0.7944.47 ▼6.45
Dashboard /wp-admin2,970 ▲365.97 ▲0.07146.74 ▼13.25111.95 ▼3.79
Posts /wp-admin/edit.php2,739 ▼02.72 ▲0.0165.28 ▲2.2686.85 ▲1.02
Add New Post /wp-admin/post-new.php1,676 ▼1,95818.90 ▲3.92407.46 ▼72.38107.47 ▼3.46
Media Library /wp-admin/upload.php1,810 ▲35.03 ▼0.01154.66 ▲1.86115.77 ▲1.71

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
You still need to fix the following
  • Zombie WordPress options were found after uninstall: 5 options
    • cf7lp_preview_post_id
    • cf7lp_autoreload
    • cf7lp_background
    • cf7lp_entirepage
    • cf7lp_width

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

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

SRP 0% 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
Almost there! Just fix the following items
  • 1× PHP files perform the action of outputting non-empty strings when accessed directly:
    • > /wp-content/plugins/cf7-live-preview/contact-form-7-live-preview.php
  • 1× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function language_attributes() in wp-content/plugins/cf7-live-preview/preview-template.php:3

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
No browser issues were found

Optimizations

Plugin configuration 93% from 29 tests

readme.txt Passed 16 tests

The readme.txt file is an important file in your plugin as it is parsed by WordPress.org to prepare the public listing of your plugin
5 plugin tags: contact form 7, contact form 7 preview, contact form 7 theme, contact form 7 style, contactform7

cf7-live-preview/contact-form-7-live-preview.php 85% from 13 tests

"Live Preview for Contact Form 7" version 1.2.0's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
Please make the necessary changes and fix the following:
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("cf7-live-preview.php" instead of "contact-form-7-live-preview.php")
  • Domain Path: The domain path is invalid: folder "/languages" does not exist

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are not allowed as they can serve as attack vectors
No dangerous file extensions were detected515 lines of code in 5 files:
LanguageFilesBlank linesComment linesLines of code
PHP293100241
JavaScript24750212
CSS10162

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.28
Average class complexity27.00
▷ Minimum class complexity27.00
▷ Maximum class complexity27.00
Average method complexity2.73
▷ Minimum method complexity1.00
▷ Maximum method complexity11.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods15
▷ Static methods213.33%
▷ Public methods1280.00%
▷ Protected methods00.00%
▷ Private methods320.00%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.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