90% cf7-google-analytics

Code Review | Contact Form 7 Google Analytics

WordPress plugin Contact Form 7 Google Analytics scored90%from 54 tests.

About plugin

  • Plugin page: cf7-google-analytics
  • Plugin version: 1.8.10
  • PHP version: 7.4.16
  • WordPress compatibility: 4.3-6.3.0
  • WordPress version: 6.3.1
  • First release: Apr 27, 2016
  • Latest release: Oct 19, 2023
  • Number of updates: 66
  • Update frequency: every 41.4 days
  • Top authors: macbookandrew (100%)

Code review

54 tests

User reviews

12 reviews

Install metrics

10,000+ active /110,562 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.06MB] [CPU: ▼8.23ms] Passed 4 tests

An overview of server-side resources used by Contact Form 7 Google Analytics
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.53 ▲0.0745.44 ▲5.23
Dashboard /wp-admin3.37 ▲0.0346.72 ▼16.73
Posts /wp-admin/edit.php3.49 ▲0.1346.02 ▼1.57
Add New Post /wp-admin/post-new.php5.97 ▲0.0983.61 ▼12.99
Media Library /wp-admin/upload.php3.30 ▲0.0736.50 ▼1.61
CF7 to GA /wp-admin/options-general.php?page=cf7_ga3.2631.47

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

Analyzing filesystem and database footprints of this plugin
No storage issues were detected
Filesystem: 8 new files
Database: no new tables, 6 new options
New WordPress options
db_upgraded
widget_theysaidso_widget
can_compress_scripts
widget_recent-posts
theysaidso_admin_options
widget_recent-comments

Browser metrics Passed 4 tests

A check of browser resources used by Contact Form 7 Google Analytics
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,880 ▲11914.24 ▼0.161.73 ▲0.2344.18 ▲6.41
Dashboard /wp-admin2,286 ▲1065.52 ▼0.0981.33 ▼8.5144.75 ▲1.70
Posts /wp-admin/edit.php2,192 ▲922.15 ▲0.1635.90 ▲1.1535.91 ▼0.96
Add New Post /wp-admin/post-new.php1,596 ▲7023.57 ▲0.54642.61 ▲0.0349.13 ▼3.95
Media Library /wp-admin/upload.php1,494 ▲974.22 ▲0.0797.52 ▼4.5952.75 ▲8.07
CF7 to GA /wp-admin/options-general.php?page=cf7_ga9452.1627.2036.32

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
You still need to fix the following
  • This plugin does not fully uninstall, leaving 6 options in the database
    • can_compress_scripts
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • db_upgraded
    • widget_recent-comments
    • widget_recent-posts

Smoke tests Passed 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 Passed 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
Everything seems fine, however this is by no means an exhaustive test

User-side errors Passed 1 test

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

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
Attributes that require attention:
  • Tags: You are using too many tags: 16 tag instead of maximum 10
The official readme.txt is a good inspiration

cf7-google-analytics/cf7-google-analytics.php Passed 13 tests

The main PHP script in "Contact Form 7 Google Analytics" version 1.8.10 is automatically included on every request by WordPress
65 characters long description:
Adds Google Analytics Event Tracking to all Contact Form 7 forms.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | An overview of files in this plugin; executable files are not allowed
Success! There were no dangerous files found in this plugin324 lines of code in 6 files:
LanguageFilesBlank linesComment linesLines of code
PHP255183258
JavaScript4233566

PHP code Passed 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
No cyclomatic complexity issues were detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.23
Average class complexity16.00
▷ Minimum class complexity16.00
▷ Maximum class complexity16.00
Average method complexity1.50
▷ Minimum method complexity1.00
▷ Maximum method complexity5.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods21
▷ Static methods00.00%
▷ Public methods2095.24%
▷ Protected methods00.00%
▷ Private methods14.76%
Functions2
▷ Named functions00.00%
▷ Anonymous functions2100.00%
Constants2
▷ Global constants2100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
No PNG files were detected