84% simple-google-analytics

Code Review | Local Google Analytics for Wordpress - caches external requests

WordPress plugin Local Google Analytics for Wordpress - caches external requests scored84%from 54 tests.

About plugin

  • Plugin page: simple-google-ana...
  • Plugin version: 3.2.7
  • PHP compatiblity: 7.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.2-6.4
  • WordPress version: 6.3.1
  • First release: Mar 24, 2011
  • Latest release: Nov 23, 2023
  • Number of updates: 60
  • Update frequency: every 77.1 days
  • Top authors: JeromeMeyer62 (81.67%)alexkovalevv (16.67%)webcraftic (5%)

Code review

54 tests

User reviews

9 reviews

Install metrics

6,000+ active /248,494 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲1.75MB] [CPU: ▲10.08ms] Passed 4 tests

Analyzing server-side resources used by Local Google Analytics for Wordpress - caches external requests
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /4.60 ▲1.1445.81 ▲9.14
Dashboard /wp-admin5.27 ▲1.9760.84 ▲11.42
Posts /wp-admin/edit.php5.31 ▲1.9562.25 ▲10.44
Add New Post /wp-admin/post-new.php7.86 ▲1.97103.26 ▲9.31
Media Library /wp-admin/upload.php5.18 ▲1.9553.00 ▲17.15
Local Google Analytics /wp-admin/options-general.php?page=ga_cache-wbcr_gac6.10310.75

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

Filesystem and database footprint
This plugin was installed successfully
Filesystem: 240 new files
Database: no new tables, 9 new options
New WordPress options
wbcr_gac_plugin_version
widget_theysaidso_widget
widget_recent-posts
can_compress_scripts
db_upgraded
wbcr_gac_is_migrate_up_to_230
wbcr_gac_plugin_activated
widget_recent-comments
theysaidso_admin_options

Browser metrics Passed 4 tests

Checking browser requirements for Local Google Analytics for Wordpress - caches external requests
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,884 ▲9714.35 ▲0.081.72 ▼0.0442.97 ▲5.75
Dashboard /wp-admin2,289 ▲1145.72 ▼0.0295.17 ▼23.1440.02 ▼2.35
Posts /wp-admin/edit.php2,198 ▲982.18 ▲0.2342.31 ▲0.8336.83 ▼1.01
Add New Post /wp-admin/post-new.php1,561 ▲3523.29 ▼0.25603.00 ▲2.6534.58 ▼17.70
Media Library /wp-admin/upload.php1,440 ▲404.20 ▼0.0297.56 ▲0.8541.03 ▼1.19
Local Google Analytics /wp-admin/options-general.php?page=ga_cache-wbcr_gac1,4572.4847.5739.50

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
Please fix the following items
  • Zombie WordPress options were found after uninstall: 6 options
    • can_compress_scripts
    • widget_recent-posts
    • db_upgraded
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • widget_recent-comments

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
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 fix the following
  • 4× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Class 'Wbcr_FactoryForms469_FontControl' not found in wp-content/plugins/simple-google-analytics/libs/factory/forms/controls/google-font.php:18
    • > PHP Fatal error
      Uncaught Error: Class 'WBCR\\Factory_Templates_126\\Pages\\Step' not found in wp-content/plugins/simple-google-analytics/libs/factory/templates/pages/setup-parts/class-step-custom.php:11
    • > PHP Fatal error
      Uncaught Error: Class 'WBCR\\Factory_Templates_126\\Pages\\Step' not found in wp-content/plugins/simple-google-analytics/libs/factory/templates/pages/setup-parts/class-step-form.php:11
    • > PHP Fatal error
      Uncaught Error: Class 'Wbcr_Factory473_Update' not found in wp-content/plugins/simple-google-analytics/migrations/030002.php:7

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
No browser errors were detected

Optimizations

Plugin configuration 93% from 29 tests

readme.txt Passed 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
6 plugin tags: gtag, google analytics plugin, analytics, google analytics dashboard, google analytics widget...

simple-google-analytics/simple_google_analytics.php 85% from 13 tests

Analyzing the main PHP file in "Local Google Analytics for Wordpress - caches external requests" version 3.2.7
Please make the necessary changes and fix the following:
  • Main file name: The principal plugin file should be the same as the plugin slug ("simple-google-analytics.php" instead of "simple_google_analytics.php")
  • Description: Please keep the plugin description shorter than 140 characters (currently 423 characters long)

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
Success! There were no dangerous files found in this plugin19,935 lines of code in 180 files:
LanguageFilesBlank linesComment linesLines of code
PHP1223,5458,47911,830
CSS251662512,570
LESS6409911,973
JSON1001,810
PO File102663281,138
JavaScript15185199612
Markdown1102

PHP code Passed 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
There are no cyclomatic complexity problems detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.45
Average class complexity16.06
▷ Minimum class complexity1.00
▷ Maximum class complexity89.00
Average method complexity3.15
▷ Minimum method complexity1.00
▷ Maximum method complexity31.00
Code structure
Namespaces10
Interfaces2
Traits1
Classes103
▷ Abstract classes1716.50%
▷ Concrete classes8683.50%
▷ Final classes00.00%
Methods771
▷ Static methods283.63%
▷ Public methods54971.21%
▷ Protected methods14618.94%
▷ Private methods769.86%
Functions43
▷ Named functions1841.86%
▷ Anonymous functions2558.14%
Constants65
▷ Global constants5483.08%
▷ Class constants1116.92%
▷ Public constants11100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
6 PNG files occupy 0.03MB with 0.02MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
libs/factory/templates/pages/templates/impressive-lite/assets/img/webcraftic-plugin-icon.png1.97KB0.75KB▼ 61.79%
libs/factory/templates/pages/templates/impressive/assets/img/webcraftic-plugin-icon.png1.97KB0.75KB▼ 61.79%
libs/factory/templates/pages/templates/impressive/assets/img/5-stars22.png3.51KB0.70KB▼ 79.99%
libs/factory/templates/pages/templates/impressive/assets/img/paypal-donate.png12.44KB4.99KB▼ 59.88%
libs/factory/templates/pages/templates/impressive-lite/assets/img/paypal-donate.png12.44KB4.99KB▼ 59.88%