78% easy-google-analytics-tracking-code

Code Review | Easy Google Analytics Tracking Code

WordPress plugin Easy Google Analytics Tracking Code scored78%from 54 tests.

About plugin

  • Plugin page: easy-google-analy...
  • Plugin version: 0.8
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0.1-5.3
  • WordPress version: 6.3.1
  • First release: Jul 10, 2019
  • Latest release: Nov 13, 2019
  • Number of updates: 6
  • Update frequency: every 21.2 days
  • Top authors: FerranBCN (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /592 total downloads

Benchmarks

Plugin footprint 83% from 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.01MB] [CPU: ▼4.72ms] Passed 4 tests

Analyzing server-side resources used by Easy Google Analytics Tracking Code
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0136.55 ▼5.20
Dashboard /wp-admin3.31 ▲0.0145.90 ▼2.90
Posts /wp-admin/edit.php3.36 ▲0.0145.26 ▼4.74
Add New Post /wp-admin/post-new.php5.89 ▲0.0184.99 ▼6.04
Media Library /wp-admin/upload.php3.23 ▲0.0134.80 ▼0.89
Google Analytics Code /wp-admin/options-general.php?page=add-analytics-code3.1829.11

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

Input-output and database impact of this plugin
This plugin installed successfully
Filesystem: 3 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-comments
widget_recent-posts
theysaidso_admin_options
db_upgraded
can_compress_scripts
widget_theysaidso_widget

Browser metrics Passed 4 tests

This is an overview of browser requirements for Easy Google Analytics Tracking Code
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,804 ▲6913.23 ▼0.951.84 ▲0.2540.77 ▼1.68
Dashboard /wp-admin2,213 ▲254.86 ▼0.04104.50 ▲4.4339.12 ▼3.00
Posts /wp-admin/edit.php2,093 ▲72.05 ▲0.0135.25 ▼5.4631.96 ▼4.75
Add New Post /wp-admin/post-new.php1,550 ▲1718.59 ▼4.47618.66 ▼66.4966.31 ▲10.53
Media Library /wp-admin/upload.php1,392 ▲74.23 ▲0.03101.13 ▼2.0043.85 ▼3.13
Google Analytics Code /wp-admin/options-general.php?page=add-analytics-code9312.0431.1431.11

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
It is recommended to fix the following
  • The uninstall procedure has failed, leaving 6 options in the database
    • widget_theysaidso_widget
    • widget_recent-comments
    • widget_recent-posts
    • can_compress_scripts
    • theysaidso_admin_options
    • db_upgraded

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
These errors were triggered by the plugin
    • > GET request to /wp-admin/options-general.php?page=add-analytics-code
    • > Notice in wp-content/plugins/easy-google-analytics-tracking-code/easy-google-analytics-tracking-code.php+139
    Undefined property: WP_AddAnalyticsCode::$plguin_options_menue_title

SRP 50% 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 trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/easy-google-analytics-tracking-code/easy-google-analytics-tracking-code.php:25

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
No browser errors were detected

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
These attributes need your attention:
  • Contributors: Plugin contributors field is missing
The official readme.txt might help

easy-google-analytics-tracking-code/easy-google-analytics-tracking-code.php Passed 13 tests

The main PHP script in "Easy Google Analytics Tracking Code" version 0.8 is automatically included on every request by WordPress
57 characters long description:
Add easily Google analytics tracking code to your website

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short check of programming languages and file extensions; no executable files are allowed
Good job! No executable or dangerous file extensions detected286 lines of code in 2 files:
LanguageFilesBlank linesComment linesLines of code
PHP1227205
CSS111481

PHP code Passed 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
This plugin has no cyclomatic complexity problems
Cyclomatic complexity
Average complexity per logical line of code0.58
Average class complexity32.00
▷ Minimum class complexity32.00
▷ Maximum class complexity32.00
Average method complexity5.43
▷ Minimum method complexity1.00
▷ Maximum method complexity13.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods7
▷ Static methods00.00%
▷ Public methods7100.00%
▷ Protected methods00.00%
▷ Private methods00.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

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
PNG images were not found in this plugin