93% gravity-forms-google-analytics-addon

Code Review | Gravity Forms: Google Analytics Addon

WordPress plugin Gravity Forms: Google Analytics Addon scored 93% from 54 tests.

About plugin

  • Plugin page: gravity-forms-goo...
  • Plugin version: 0.8
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-4.3.1
  • WordPress version: 5.9.2
  • First release: Apr 24, 2014
  • Latest release: Nov 4, 2015
  • Number of updates: 20
  • Update frequency: every 28.0 days
  • Top authors: MikevHoenselaar (100%)

Code review

54 tests

User reviews

4 reviews

Install metrics

100+ active / 2,960 total downloads

Benchmarks

Plugin footprint Passed 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
Install script ran successfully

Server metrics [RAM: ▲0.07MB] [CPU: ▼295.82ms] Passed 4 tests

An overview of server-side resources used by Gravity Forms: Google Analytics Addon
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.61 ▲0.1060.51 ▼3.94
Dashboard /wp-admin3.51 ▲0.1039.00 ▼5.07
Posts /wp-admin/edit.php3.74 ▲0.0942.18 ▼2.90
Add New Post /wp-admin/post-new.php6.98 ▲0.0098.68 ▼1,171.36
Media Library /wp-admin/upload.php3.39 ▲0.0929.34 ▲2.38

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

Analyzing filesystem and database footprints of this plugin
The plugin installed successfully
Filesystem: 6 new files
Database: no new tables, no new options

Browser metrics Passed 4 tests

Checking browser requirements for Gravity Forms: Google Analytics Addon
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,767 ▲2316.22 ▲0.166.58 ▼1.362.14 ▲0.00
Dashboard /wp-admin2,895 ▲346.15 ▼0.08117.37 ▼25.32157.61 ▼8.07
Posts /wp-admin/edit.php2,691 ▼03.23 ▼0.0173.72 ▲5.31156.65 ▲9.82
Add New Post /wp-admin/post-new.php1,711 ▲5021.08 ▲5.15471.08 ▲35.79159.68 ▲0.47
Media Library /wp-admin/upload.php1,695 ▼35.57 ▲0.03142.28 ▼7.08183.87 ▼6.37

Uninstaller [IO: ▲0.00MB] [DB: ▲0.00MB] Passed 4 tests

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
The plugin uninstalled completely, with no zombie files or tables

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
The smoke test was a success, however most plugin functionality was not tested

SRP 50% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle: PHP files have to remain inert when accessed directly, throwing no errors and performing no actions
Almost there! Just fix the following items
  • 1× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_url() in wp-content/plugins/gravity-forms-google-analytics-addon/gravityforms-ga.php:13

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 90% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file describes your plugin functionality and requirements and it is parsed to prepare the your plugin's listing
These attributes need your attention:
  • Plugin Name: You should set the name of your plugin on the first line ( === gravity-forms-google-analytics-addon === )
You can take inspiration from this readme.txt

gravity-forms-google-analytics-addon/gravityforms-ga.php 85% from 13 tests

"Gravity Forms: Google Analytics Addon" version 0.8'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: The principal plugin file should be the same as the plugin slug ("gravity-forms-google-analytics-addon.php" instead of "gravityforms-ga.php")
  • Description: Please don't use more than 140 characters for the plugin description (currently 335 characters long)

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | There should be no dangerous file extensions present in any WordPress plugin
Good job! No executable or dangerous file extensions detected547 lines of code in 5 files:
LanguageFilesBlank linesComment linesLines of code
PHP2116203479
CSS117366
XML2002

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.37
Average class complexity41.50
▷ Minimum class complexity38.00
▷ Maximum class complexity45.00
Average method complexity3.25
▷ Minimum method complexity1.00
▷ Maximum method complexity7.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes2
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes00.00%
Methods36
▷ Static methods00.00%
▷ Public methods36100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants5
▷ Global constants5100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
PNG images were not found in this plugin