94% instant-google-analytics

Code Review | Instant Google Analytics

WordPress plugin Instant Google Analytics scored 94% from 54 tests.

About plugin

  • Plugin page: instant-google-an...
  • Plugin version: 1.0.5
  • PHP compatiblity: 5.2+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.2-4.9
  • WordPress version: 5.8.1
  • First release: Nov 23, 2017
  • Latest release: May 24, 2018
  • Number of updates: 6
  • Update frequency: every 30.5 days
  • Top authors: 360Tactics (100%)

Code review

54 tests

User reviews

1 review

Install metrics

30+ active / 660 total downloads

Benchmarks

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

A check of server-side resources used by Instant Google Analytics
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /2.85 ▲0.1336.82 ▲17.31
Dashboard /wp-admin3.07 ▲0.0246.51 ▼0.74
Posts /wp-admin/edit.php3.12 ▲0.0246.03 ▲1.98
Add New Post /wp-admin/post-new.php5.44 ▲0.0195.88 ▼554.07
Media Library /wp-admin/upload.php3.02 ▲0.0142.72 ▲0.28
Inst. Google Analytics /wp-admin/options-general.php?page=tactics-analytics-settings2.9829.28

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

Input-output and database impact of this plugin
There were no storage issued detected upon installing this plugin
Filesystem: 5 new files
Database: no new tables, no new options

Browser metrics Passed 4 tests

Checking browser requirements for Instant Google Analytics
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,691 ▲9516.07 ▲0.5715.38 ▲6.9454.01 ▲3.48
Dashboard /wp-admin2,975 ▲415.91 ▼0.09144.80 ▼13.86115.73 ▼13.82
Posts /wp-admin/edit.php2,744 ▲52.69 ▲0.0166.40 ▲1.5096.22 ▲7.03
Add New Post /wp-admin/post-new.php1,584 ▼9916.98 ▼1.49417.02 ▲11.72164.00 ▲48.38
Media Library /wp-admin/upload.php1,812 ▲55.02 ▼0.04170.35 ▲16.09142.12 ▲18.84
Inst. Google Analytics /wp-admin/options-general.php?page=tactics-analytics-settings1,1012.1062.0575.73

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
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 | A smoke test targeting server-side errors
Even though everything seems fine, this is not an exhaustive test

SRP 50% from 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
Almost there! Just fix the following items
  • 2× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_url() in wp-content/plugins/instant-google-analytics/instant-google-analytics.php:15
    • > PHP Fatal error
      Uncaught Error: Call to undefined function is_admin() in wp-content/plugins/instant-google-analytics/lib/controllers/tactics-iga-controller-class.php:15

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
Everything seems fine on the user side

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
4 plugin tags: tracking, universal tracking code, analytics install, google analytics

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

This is the main PHP file of "Instant Google Analytics" version 1.0.5, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
75 characters long description:
Adds the Universal Google Analytics Tracking Code to Wordpress Theme Header

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of programming languages used in this plugin; dangerous file extensions are not allowed
No dangerous file extensions were detected82 lines of code in 3 files:
LanguageFilesBlank linesComment linesLines of code
PHP3193982

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
This plugin has no cyclomatic complexity issues
Cyclomatic complexity
Average complexity per logical line of code0.26
Average class complexity7.00
▷ Minimum class complexity7.00
▷ Maximum class complexity7.00
Average method complexity2.50
▷ Minimum method complexity1.00
▷ Maximum method complexity5.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods5
▷ Static methods00.00%
▷ Public methods5100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants2
▷ Global constants2100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
1 PNG file occupies 0.12MB with 0.08MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
assets/images/ga-tracking-code-location.png121.72KB39.52KB▼ 67.53%