84% easy-googleanalytics

Code Review | Easy Google Analytics

WordPress plugin Easy Google Analytics scored84%from 54 tests.

About plugin

  • Plugin page: easy-googleanalytics
  • Plugin version: 1.0.2
  • PHP version: 7.4.16
  • WordPress compatibility: 4.5.0-5.7.0
  • WordPress version: 6.3.1
  • First release: Oct 9, 2018
  • Latest release: Apr 10, 2021
  • Number of updates: 5
  • Update frequency: every 183.0 days
  • Top authors: hayk (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /726 total downloads

Benchmarks

Plugin footprint 83% from 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.35MB] [CPU: ▼12.64ms] Passed 4 tests

A check of server-side resources used by Easy Google Analytics
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /2.03 ▼1.443.76 ▼35.14
Dashboard /wp-admin3.31 ▲0.0144.40 ▼8.47
Posts /wp-admin/edit.php3.37 ▲0.0148.45 ▲1.02
Add New Post /wp-admin/post-new.php5.90 ▲0.0180.75 ▼7.97
Media Library /wp-admin/upload.php3.24 ▲0.0136.08 ▲2.88
Easy Google Analytics /wp-admin/options-general.php?page=easy-googleanalytics3.2331.49

Server storage [IO: ▲0.04MB] [DB: ▲0.07MB] Passed 3 tests

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

Browser metrics Passed 4 tests

Easy Google Analytics: an overview of browser usage
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,793 ▲3214.24 ▼0.391.53 ▼0.1541.37 ▼2.80
Dashboard /wp-admin2,199 ▲195.55 ▼0.1189.11 ▼0.6736.62 ▼0.98
Posts /wp-admin/edit.php2,101 ▲12.01 ▲0.0639.85 ▲0.0534.33 ▼3.85
Add New Post /wp-admin/post-new.php1,531 ▲322.99 ▼0.27658.77 ▼18.7952.85 ▼6.53
Media Library /wp-admin/upload.php1,407 ▲44.18 ▼0.0293.66 ▼13.3740.70 ▼6.50
Easy Google Analytics /wp-admin/options-general.php?page=easy-googleanalytics8382.0322.4826.46

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
These items require your attention
  • This plugin does not fully uninstall, leaving 8 options in the database
    • can_compress_scripts
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • db_upgraded
    • widget_recent-posts
    • ega_tracking_id
    • widget_recent-comments
    • ega_version

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
The smoke test was a success, however most plugin functionality was not tested

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
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 wp_nonce_field() in wp-content/plugins/easy-googleanalytics/options.php:5
    • > PHP Fatal error
      Uncaught Error: Call to undefined function register_activation_hook() in wp-content/plugins/easy-googleanalytics/googleanalytics.php:95

User-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
Everything seems fine on the user side

Optimizations

Plugin configuration 93% from 29 tests

readme.txt Passed 16 tests

Perhaps the most important file in your plugin readme.txt gets parsed in order to generate the public listing of your plugin
4 plugin tags: googleanalytics, analytics, google, javascript

easy-googleanalytics/googleanalytics.php 85% from 13 tests

The main PHP script in "Easy Google Analytics" version 1.0.2 is automatically included on every request by WordPress
You should first fix the following items:
  • Domain Path: The domain path folder does not exist ("/languages")
  • Main file name: The principal plugin file should be the same as the plugin slug ("easy-googleanalytics.php" instead of "googleanalytics.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are not allowed as they can serve as attack vectors
Good job! No executable or dangerous file extensions detected105 lines of code in 2 files:
LanguageFilesBlank linesComment linesLines of code
PHP23430105

PHP code Passed 2 tests

This plugin's cyclomatic complexity and code structure detailed below
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.35
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%
Functions8
▷ Named functions8100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.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
There are no PNG files in this plugin