94% track-a-click-on-google-analytics

Code Review | Track a click on Google Analytics

WordPress plugin Track a click on Google Analytics scored 94% from 54 tests.

About plugin

  • Plugin page: track-a-click-on-...
  • Plugin version: 0.4
  • PHP version: 7.4.16
  • WordPress compatibility: 2.5.0-4.6
  • WordPress version: 5.8.1
  • First release: Sep 1, 2016
  • Latest release: Sep 1, 2016
  • Number of updates: 3
  • Update frequency: every 0.7 days
  • Top authors: gounder (100%)

Code review

54 tests

User reviews

1 review

Install metrics

40+ active / 1,108 total downloads

Benchmarks

Plugin footprint Passed 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
The plugin installed gracefully, with no errors

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

Server-side resources used by Track a click on Google Analytics
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /2.84 ▲0.0134.80 ▼1.05
Dashboard /wp-admin3.07 ▲0.0144.66 ▲0.73
Posts /wp-admin/edit.php3.12 ▲0.0143.76 ▲2.20
Add New Post /wp-admin/post-new.php5.43 ▼0.0086.95 ▼563.93
Media Library /wp-admin/upload.php3.01 ▲0.0031.20 ▼5.80

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

Input-output and database impact of this plugin
The plugin installed successfully
Filesystem: 2 new files
Database: no new tables, no new options

Browser metrics Passed 4 tests

An overview of browser requirements for Track a click on Google Analytics
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,679 ▲8315.88 ▲0.217.70 ▼0.5846.90 ▼0.16
Dashboard /wp-admin2,970 ▲366.07 ▲0.08135.33 ▼25.94118.18 ▲3.75
Posts /wp-admin/edit.php2,739 ▲32.69 ▼0.0164.09 ▼1.6387.79 ▼1.92
Add New Post /wp-admin/post-new.php1,672 ▲218.86 ▼0.30369.36 ▼29.8599.81 ▼8.91
Media Library /wp-admin/upload.php1,810 ▲35.03 ▼0.01145.02 ▼7.24113.95 ▼9.20

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
Uninstall script ran successfully

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

SRP 50% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle applies for WordPress plugins as well - please make sure your PHP files perform no actions when accessed directly
The following issues need your attention
  • 1× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_shortcode() in wp-content/plugins/track-a-click-on-google-analytics/track-a-click-ga.php:35

User-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
Everything seems fine on the user side

Optimizations

Plugin configuration 93% from 29 tests

readme.txt Passed 16 tests

The readme.txt file describes your plugin functionality and requirements and it is parsed to prepare the your plugin's listing
6 plugin tags: goal conversion, google analytics, link click, click tracking, link tracking...

track-a-click-on-google-analytics/track-a-click-ga.php 85% from 13 tests

Analyzing the main PHP file in "Track a click on Google Analytics" version 0.4
It is important to fix the following:
  • Text Domain: If you choose to specify the text domain, it must be the same as the plugin slug; optional since WordPress version 4.6
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("track-a-click-on-google-analytics.php" instead of "track-a-click-ga.php")

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
Success! There were no dangerous files found in this plugin19 lines of code in 1 file:
LanguageFilesBlank linesComment linesLines of code
PHP151119

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.40
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%
Functions1
▷ Named functions1100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.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
There were not PNG files found in your plugin