78% universal-analytics-injector

Code Review | Universal Analytics Injector

WordPress plugin Universal Analytics Injector scored 78% from 54 tests.

About plugin

  • Plugin page: universal-analyti...
  • Plugin version: 1.0.3
  • PHP version: 7.4.16
  • WordPress compatibility: 3.4-4.7.1
  • WordPress version: 5.8.1
  • First release: Sep 26, 2014
  • Latest release: Jan 22, 2017
  • Number of updates: 6
  • Update frequency: every 142.0 days
  • Top authors: hoyce (100%)

Code review

54 tests

User reviews

1 review

Install metrics

80+ active / 1,264 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
This plugin's installer ran successfully

Server metrics [RAM: ▼1.72MB] [CPU: ▼189.00ms] Passed 4 tests

A check of server-side resources used by Universal Analytics Injector
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /1.91 ▼0.936.16 ▼32.17
Dashboard /wp-admin1.93 ▼1.1310.43 ▼27.52
Posts /wp-admin/edit.php1.93 ▼1.185.91 ▼33.97
Add New Post /wp-admin/post-new.php1.93 ▼3.516.29 ▼660.04
Media Library /wp-admin/upload.php1.93 ▼1.086.36 ▼29.83

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

How much does this plugin use your filesystem and database?
No storage issues were detected
Filesystem: 7 new files
Database: no new tables, no new options

Browser metrics Passed 4 tests

Checking browser requirements for Universal Analytics Injector
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,816 ▲22016.28 ▲0.4112.19 ▲3.5655.94 ▼1.51
Dashboard /wp-admin2,976 ▲425.99 ▼0.22145.57 ▼12.80118.74 ▲4.56
Posts /wp-admin/edit.php2,748 ▲92.83 ▲0.1566.92 ▼3.5591.99 ▼5.20
Add New Post /wp-admin/post-new.php1,505 ▼17818.94 ▲0.24390.23 ▲13.89119.17 ▲5.46
Media Library /wp-admin/upload.php1,816 ▲95.04 ▲0.01154.84 ▼2.39125.25 ▼13.77
UA Injector /wp-admin/universal-analytics-injector.php260.900.2710.35

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
Please fix the following items
  • This plugin cannot be uninstalled
    • > User notice in wp-includes/functions.php+5663
    wp_enqueue_script was called incorrectly. Scripts and styles should not be registered or enqueued until the wp_enqueue_scripts, admin_enqueue_scripts, or login_enqueue_scripts hooks. This notice was triggered by the jquery handle. Please see Debugging in WordPress for more information. (This message was added in version 3.3.0.)

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Even though no errors were found, 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 wp_enqueue_script() in wp-content/plugins/universal-analytics-injector/universal-analytics-injector.php:17

User-side errors 0% from 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
Please take a look at the following user-side issues
    • > GET request to /wp-admin/universal-analytics-injector.php
    • > Network (severe)
    wp-admin/universal-analytics-injector.php - Failed to load resource: the server responded with a status of 404 (Not Found)

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 88% from 16 tests

You should put a lot of thought into formatting readme.txt as it is used by WordPress.org to prepare the public listing of your plugin
These attributes need your attention:
  • Donate link: Invalid URI found ("")
  • Screenshots: Please add an image for screenshot #1 (Settings for the Universal Analytics Injector)
You can take inspiration from this readme.txt

universal-analytics-injector/universal-analytics-injector.php Passed 13 tests

"Universal Analytics Injector" version 1.0.3's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
101 characters long description:
Universal Analytics Injector for WordPress will help you add Google Analytics to your WordPress blog.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is a short overview of programming languages used in this plugin, detecting executable files
Good job! No executable or dangerous file extensions detected554 lines of code in 3 files:
LanguageFilesBlank linesComment linesLines of code
PHP195112492
CSS114354
JavaScript1008

PHP code Passed 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.39
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%
Functions16
▷ Named functions16100.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
2 PNG files occupy 0.08MB with 0.02MB in potential savings
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/screenshot-1.png78.05KB30.03KB▼ 61.53%
images/external_link_icon.png0.14KB0.16KB0.00%