78% ga-universal

Code Review | GA Universal

WordPress plugin GA Universal scored78%from 54 tests.

About plugin

  • Plugin page: ga-universal
  • Plugin version: 1.0.1
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-3.5.1
  • WordPress version: 6.3.1
  • First release: Apr 4, 2013
  • Latest release: Apr 10, 2013
  • Number of updates: 8
  • Update frequency: every 2.4 days
  • Top authors: ethoseo (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /1,470 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

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

Server metrics [RAM: ▼0.09MB] [CPU: ▼9.65ms] Passed 4 tests

This is a short check of server-side resources used by GA Universal
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.49 ▲0.0333.70 ▼13.17
Dashboard /wp-admin3.33 ▲0.0344.46 ▲4.21
Posts /wp-admin/edit.php3.38 ▲0.0347.28 ▲1.61
Add New Post /wp-admin/post-new.php5.46 ▼0.4370.01 ▼26.13
Media Library /wp-admin/upload.php3.25 ▲0.0336.73 ▼0.89
GA Universal /wp-admin/options-general.php?page=ga-universal3.2431.03

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

Input-output and database impact of this plugin
This plugin installed successfully
Filesystem: 9 new files
Database: no new tables, 12 new options
New WordPress options
can_compress_scripts
ethoseo_gau_before
ethoseo_gau_activated
ethoseo_gau_infooter
widget_theysaidso_widget
widget_recent-posts
ethoseo_gau_hidefor
ethoseo_gau_properties
widget_recent-comments
db_upgraded
...

Browser metrics Passed 4 tests

Checking browser requirements for GA Universal
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,807 ▲6113.31 ▼1.074.15 ▲2.3939.58 ▼4.48
Dashboard /wp-admin2,213 ▲245.88 ▲1.01107.86 ▼12.0642.71 ▼4.37
Posts /wp-admin/edit.php2,093 ▲12.03 ▲0.0238.75 ▼1.5434.81 ▼1.23
Add New Post /wp-admin/post-new.php1,536 ▼623.31 ▲5.09668.79 ▲60.4256.64 ▼1.22
Media Library /wp-admin/upload.php1,392 ▲44.16 ▼0.0694.29 ▼15.0942.94 ▼0.25
GA Universal /wp-admin/options-general.php?page=ga-universal1,0792.0826.0246.53

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
  • Zombie WordPress options detected upon uninstall: 12 options
    • ethoseo_gau_infooter
    • can_compress_scripts
    • ethoseo_gau_before
    • widget_recent-comments
    • db_upgraded
    • ethoseo_gau_hidefor
    • ethoseo_gau_properties
    • ethoseo_gau_after
    • widget_recent-posts
    • theysaidso_admin_options
    • ...

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
These server-side errors were triggered
    • > GET request to /wp-admin/options-general.php?page=ga-universal
    • > Notice in wp-content/plugins/ga-universal/inc/screens/settings.php+19
    Undefined index: submit
    • > GET request to /wp-admin/options-general.php?page=ga-universal
    • > Notice in wp-content/plugins/ga-universal/inc/support/ethoseo.php+2
    Undefined index: hide
    • > GET request to /wp-admin/options-general.php?page=ga-universal
    • > Notice in wp-content/plugins/ga-universal/inc/screens/settings.php+49
    Undefined offset: 0
    • > GET request to /wp-admin/options-general.php?page=ga-universal
    • > Notice in wp-content/plugins/ga-universal/inc/screens/settings.php+57
    Undefined index: id
  • 6 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=ga-universal
    • > Notice in wp-content/plugins/ga-universal/inc/screens/settings.php+60
    Undefined index: roles
  • 6 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=ga-universal
    • > Notice in wp-content/plugins/ga-universal/inc/screens/settings.php+60
    Trying to access array offset on value of type null
    • > GET request to /wp-admin/options-general.php?page=ga-universal
    • > Notice in wp-content/plugins/ga-universal/inc/screens/settings.php+63
    Undefined index: custom

SRP 50% from 2 tests

🔹 Tests weight: 20 | A shallow check of the single-responsibility principle; PHP files should perform no action - including output of placeholder text - and trigger no errors when accessed directly
The following issues need your attention
  • 6× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Notice
      Undefined index: submit in wp-content/plugins/ga-universal/inc/screens/settings.php on line 19
    • > PHP Notice
      Trying to get property 'display_name' of non-object in wp-content/plugins/ga-universal/inc/screens/settings.php on line 8
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugins_url() in wp-content/plugins/ga-universal/inc/support/ethoseo.php:7
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/ga-universal/inc/screens/settings.php:32
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/ga-universal/index.php:22
    • > PHP Notice
      Undefined index: hide in wp-content/plugins/ga-universal/inc/support/ethoseo.php on line 2

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
No browser issues were found

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

It's important to format your readme.txt file correctly as it is parsed for the public listing of your plugin
5 plugin tags: analytics, analyticsjs, tracking, google analytics universal, google analytics

ga-universal/index.php 92% from 13 tests

"GA Universal" version 1.0.1's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
It is important to fix the following:
  • Main file name: Name the main plugin file the same as the plugin slug ("ga-universal.php" instead of "index.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | An overview of files in this plugin; executable files are not allowed
Everything looks great! No dangerous files found in this plugin303 lines of code in 6 files:
LanguageFilesBlank linesComment linesLines of code
PHP33018258
JavaScript20035
CSS14010

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
There are no cyclomatic complexity problems detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.33
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%
Functions7
▷ Named functions7100.00%
▷ Anonymous functions00.00%
Constants2
▷ Global constants2100.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
1 PNG file occupies 0.00MB with 0.00MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
images/pluginby.png3.13KB1.87KB▼ 40.27%