84% simple-universal-google-analytics

Code Review | Simple Universal Google Analytics

WordPress plugin Simple Universal Google Analytics scored84%from 54 tests.

About plugin

  • Plugin page: simple-universal-...
  • Plugin version: 1.0.5
  • PHP version: 7.4.16
  • WordPress compatibility: 4.2-6.2
  • WordPress version: 6.3.1
  • First release: Jun 15, 2015
  • Latest release: Mar 30, 2023
  • Number of updates: 28
  • Update frequency: every 101.7 days
  • Top authors: naa986 (100%)

Code review

54 tests

User reviews

9 reviews

Install metrics

7,000+ active /49,251 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.03MB] [CPU: ▼4.46ms] Passed 4 tests

Analyzing server-side resources used by Simple Universal Google Analytics
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.49 ▲0.0335.87 ▼2.03
Dashboard /wp-admin3.34 ▲0.0445.10 ▲0.98
Posts /wp-admin/edit.php3.39 ▲0.0442.48 ▼3.31
Add New Post /wp-admin/post-new.php5.92 ▲0.0384.18 ▼13.46
Media Library /wp-admin/upload.php3.26 ▲0.0435.35 ▲2.16
Google Analytics /wp-admin/options-general.php?page=simple-uga-settings3.2028.84

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

Filesystem and database footprint
No storage issues were detected
Filesystem: 4 new files
Database: no new tables, 6 new options
New WordPress options
widget_theysaidso_widget
db_upgraded
theysaidso_admin_options
widget_recent-comments
widget_recent-posts
can_compress_scripts

Browser metrics Passed 4 tests

This is an overview of browser requirements for Simple Universal Google Analytics
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,804 ▲5813.62 ▼0.691.78 ▲0.1042.81 ▼0.65
Dashboard /wp-admin2,210 ▲195.85 ▲0.95103.29 ▲2.8041.32 ▼1.42
Posts /wp-admin/edit.php2,093 ▲11.99 ▼0.0433.52 ▼2.9833.31 ▲0.55
Add New Post /wp-admin/post-new.php1,545 ▲918.57 ▼4.64631.38 ▼31.1760.64 ▼4.29
Media Library /wp-admin/upload.php1,389 ▲74.26 ▲0.0297.41 ▼38.5543.64 ▼9.90
Google Analytics /wp-admin/options-general.php?page=simple-uga-settings7872.0323.6727.37

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
The following items require your attention
  • The uninstall procedure has failed, leaving 6 options in the database
    • widget_theysaidso_widget
    • db_upgraded
    • theysaidso_admin_options
    • widget_recent-posts
    • can_compress_scripts
    • widget_recent-comments

Smoke tests 75% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Almost there, just fix the following server-side errors
    • > GET request to /wp-admin/options-general.php?page=simple-uga-settings
    • > Notice in wp-content/plugins/simple-universal-google-analytics/main.php+81
    Trying to access array offset on value of type bool

SRP Passed 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
The SRP test was a success

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
There were no browser issues found

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
Attributes that need to be fixed: You can take inspiration from this readme.txt

simple-universal-google-analytics/main.php 92% from 13 tests

The primary PHP file in "Simple Universal Google Analytics" version 1.0.5 is used by WordPress to initiate all plugin functionality
Please make the necessary changes and fix the following:
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("simple-universal-google-analytics.php" instead of "main.php")

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
Good job! No executable or dangerous file extensions detected131 lines of code in 1 file:
LanguageFilesBlank linesComment linesLines of code
PHP11911131

PHP code Passed 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.30
Average class complexity13.00
▷ Minimum class complexity13.00
▷ Maximum class complexity13.00
Average method complexity1.92
▷ Minimum method complexity1.00
▷ Maximum method complexity5.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods13
▷ Static methods00.00%
▷ Public methods13100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants1
▷ Global constants1100.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
PNG images were not found in this plugin