84% universal-analytics

Code Review | Universal Analytics

WordPress plugin Universal Analytics scored84%from 54 tests.

About plugin

  • Plugin page: universal-analytics
  • Plugin version: 1.3.2
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0-4.4.2
  • WordPress version: 6.3.1
  • First release: May 6, 2014
  • Latest release: Feb 8, 2016
  • Number of updates: 20
  • Update frequency: every 32.2 days
  • Top authors: cwhitmore (100%)

Code review

54 tests

User reviews

2 reviews

Install metrics

90+ active /4,282 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
Installer ran successfully

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

An overview of server-side resources used by Universal Analytics
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.50 ▲0.0438.75 ▼2.45
Dashboard /wp-admin3.35 ▲0.0544.32 ▼8.08
Posts /wp-admin/edit.php3.40 ▲0.0446.62 ▼1.38
Add New Post /wp-admin/post-new.php5.93 ▲0.0485.03 ▼16.38
Media Library /wp-admin/upload.php3.27 ▲0.0436.65 ▲5.88
Google Analytics /wp-admin/options-general.php?page=mdg_google_universal_analytics3.2532.79

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

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

Browser metrics Passed 4 tests

Universal Analytics: an overview of browser usage
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,812 ▲7714.80 ▲0.421.74 ▼0.3043.50 ▼4.57
Dashboard /wp-admin2,218 ▲304.87 ▼0.02101.78 ▼4.4039.97 ▼9.20
Posts /wp-admin/edit.php2,101 ▲122.01 ▲0.0039.90 ▲3.8837.41 ▲1.24
Add New Post /wp-admin/post-new.php1,596 ▲6522.82 ▼0.38649.65 ▲44.8645.60 ▼5.46
Media Library /wp-admin/upload.php1,403 ▲154.26 ▲0.0597.80 ▼8.3143.62 ▼0.68
Google Analytics /wp-admin/options-general.php?page=mdg_google_universal_analytics1,0172.3931.5160.59

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
You still need to fix the following
  • Zombie WordPress options were found after uninstall: 6 options
    • db_upgraded
    • widget_theysaidso_widget
    • widget_recent-comments
    • widget_recent-posts
    • can_compress_scripts
    • theysaidso_admin_options

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Good news, no errors were detected

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
Please take a closer look at the following
  • 3× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/universal-analytics/tracking-code.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/universal-analytics/universalanalytics.php:12
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wp_nonce_field() in wp-content/plugins/universal-analytics/options.php:6

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
Everything seems fine on the user side

Optimizations

Plugin configuration 93% 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
Please fix the following attributes:
  • Tags: Please reduce the number of tags, currently 11 tag instead of maximum 10
The official readme.txt is a good inspiration

universal-analytics/universalanalytics.php 92% from 13 tests

The principal PHP file in "Universal Analytics" v. 1.3.2 is loaded by WordPress automatically on each request
You should first fix the following items:
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("universal-analytics.php" instead of "universalanalytics.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short review of files and their extensions; it is not recommended to include executable files
There were no executable files found in this plugin6,703 lines of code in 14 files:
LanguageFilesBlank linesComment linesLines of code
CSS610456,120
PHP33322262
SVG100229
JavaScript3172778
Markdown17014

PHP code Passed 2 tests

An overview of cyclomatic complexity and code structure
Great job! No cyclomatic complexity issues were detected in this plugin
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%
Functions9
▷ Named functions9100.00%
▷ Anonymous functions00.00%
Constants4
▷ Global constants4100.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
2 PNG files occupy 0.01MB with 0.01MB in potential savings
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/icon-128x128.png4.85KB1.76KB▼ 63.67%
assets/icon-256x256.png10.14KB3.20KB▼ 68.43%