78% cf7-goal-tracking-extension

Code Review | Contact Form 7 Goal Tracking Extension

WordPress plugin Contact Form 7 Goal Tracking Extension scored78%from 54 tests.

About plugin

  • Plugin page: cf7-goal-tracking...
  • Plugin version: 1.2.1
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-4.8
  • WordPress version: 6.3.1
  • First release: Sep 13, 2017
  • Latest release: Sep 27, 2017
  • Number of updates: 8
  • Update frequency: every 1.9 days
  • Top authors: shounakgupte (100%)

Code review

54 tests

User reviews

1 review

Install metrics

100+ active /1,323 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
Install script ran successfully

Server metrics [RAM: ▲0.04MB] [CPU: ▼3.50ms] Passed 4 tests

A check of server-side resources used by Contact Form 7 Goal Tracking Extension
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.51 ▲0.0437.45 ▼3.21
Dashboard /wp-admin3.35 ▲0.0444.70 ▼2.02
Posts /wp-admin/edit.php3.40 ▲0.0453.85 ▲4.05
Add New Post /wp-admin/post-new.php5.93 ▲0.0489.43 ▼7.98
Media Library /wp-admin/upload.php3.27 ▲0.0434.11 ▼0.80

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

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

Browser metrics Passed 4 tests

Contact Form 7 Goal Tracking Extension: an overview of browser usage
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,819 ▲7313.62 ▼0.741.66 ▲0.0640.33 ▼0.40
Dashboard /wp-admin2,222 ▲314.87 ▼0.04114.59 ▲15.9142.03 ▼1.56
Posts /wp-admin/edit.php2,101 ▲122.01 ▼0.0139.58 ▼0.1237.40 ▲3.20
Add New Post /wp-admin/post-new.php1,556 ▲1218.31 ▼0.04589.45 ▼34.7155.60 ▼1.03
Media Library /wp-admin/upload.php1,404 ▲194.21 ▲0.0398.56 ▼3.4142.31 ▼1.19

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
The following items require your attention
  • The uninstall procedure has failed, leaving 6 options in the database
    • widget_recent-posts
    • theysaidso_admin_options
    • widget_recent-comments
    • widget_theysaidso_widget
    • db_upgraded
    • can_compress_scripts

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Good news, no errors were detected

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
Please take a closer look at the following
  • 1× PHP files output text when accessed directly:
    • > /wp-content/plugins/cf7-goal-tracking-extension/admin/text.php
  • 8× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Warning
      Use of undefined constant CF7_SUBMIT_PLUGIN_URL - assumed 'CF7_SUBMIT_PLUGIN_URL' (this will throw an Error in a future version of PHP) in wp-content/plugins/cf7-goal-tracking-extension/admin/text.php on line 43
    • > PHP Warning
      Use of undefined constant CF7_SUBMIT_PLUGIN_URL - assumed 'CF7_SUBMIT_PLUGIN_URL' (this will throw an Error in a future version of PHP) in wp-content/plugins/cf7-goal-tracking-extension/admin/text.php on line 46
    • > PHP Warning
      Use of undefined constant CF7_SUBMIT_PLUGIN_URL - assumed 'CF7_SUBMIT_PLUGIN_URL' (this will throw an Error in a future version of PHP) in wp-content/plugins/cf7-goal-tracking-extension/admin/text.php on line 29
    • > PHP Warning
      Use of undefined constant CF7_SUBMIT_PLUGIN_URL - assumed 'CF7_SUBMIT_PLUGIN_URL' (this will throw an Error in a future version of PHP) in wp-content/plugins/cf7-goal-tracking-extension/admin/text.php on line 56
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_url() in wp-content/plugins/cf7-goal-tracking-extension/cf7-goal-tracking-extension.php:11
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/cf7-goal-tracking-extension/admin/admin-page.php:10
    • > PHP Warning
      Use of undefined constant CF7_SUBMIT_PLUGIN_URL - assumed 'CF7_SUBMIT_PLUGIN_URL' (this will throw an Error in a future version of PHP) in wp-content/plugins/cf7-goal-tracking-extension/admin/text.php on line 24
    • > PHP Warning
      Use of undefined constant CF7_SUBMIT_PLUGIN_URL - assumed 'CF7_SUBMIT_PLUGIN_URL' (this will throw an Error in a future version of PHP) in wp-content/plugins/cf7-goal-tracking-extension/admin/text.php on line 32

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
There were no browser issues found

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 81% from 16 tests

The readme.txt file uses markdown syntax to describe your plugin to the world
Attributes that need to be fixed:
  • Tags: There are too many tags (15 tag instead of maximum 10)
  • Donate link: Please fix this invalid url: ""
  • Screenshots: These screenshots have no corresponding images in /assets: #1 (Plugin settings enable redirect.), #2 (Plugin settings enable tracking.)
Please take inspiration from this readme.txt

cf7-goal-tracking-extension/cf7-goal-tracking-extension.php Passed 13 tests

The main PHP script in "Contact Form 7 Goal Tracking Extension" version 1.2.1 is automatically included on every request by WordPress
119 characters long description:
The Contact Form 7 Goal Tracking Extension enable users to add redirects or on-submit goals when the form is submitted.

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
Everything looks great! No dangerous files found in this plugin280 lines of code in 3 files:
LanguageFilesBlank linesComment linesLines of code
PHP33840280

PHP code Passed 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.38
Average class complexity0.00
▷ Minimum class complexity0.00
▷ Maximum class complexity0.00
Average method complexity0.00
▷ Minimum method complexity0.00
▷ Maximum method complexity0.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes0
▷ Abstract classes00.00%
▷ Concrete classes00.00%
▷ Final classes00.00%
Methods0
▷ Static methods00.00%
▷ Public methods00.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions8
▷ Named functions8100.00%
▷ Anonymous functions00.00%
Constants2
▷ Global constants2100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
2 PNG files occupy 0.05MB with 0.04MB in potential savings
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
screenshot-1.png18.21KB6.68KB▼ 63.30%
screenshot-2.png36.58KB11.84KB▼ 67.62%