10% wsanalytics-google-analytics-and-dashboards

Code Review | WSAnalytics - Google Analytics And Dashboards

WordPress plugin WSAnalytics - Google Analytics And Dashboards scored10%from 54 tests.

About plugin

  • Plugin page: wsanalytics-googl...
  • Plugin version: 1.1.2
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-4.1
  • WordPress version: 6.3.1
  • First release: Feb 16, 2015
  • Latest release: Mar 1, 2015
  • Number of updates: 31
  • Update frequency: every 0.5 days
  • Top authors: shalintripathi (100%)

Code review

54 tests

User reviews

12 reviews

Install metrics

90+ active /7,931 total downloads

Benchmarks

Plugin footprint 40% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
Please fix the following installer errors
  • The plugin did not install without errors
    • > Deprecated in wp-content/plugins/wsanalytics-google-analytics-and-dashboards/lib/Google/Utils.php+67
    Array and string offset access syntax with curly braces is deprecated

Server metrics [RAM: ▼0.02MB] [CPU: ▼32.79ms] Passed 4 tests

A check of server-side resources used by WSAnalytics - Google Analytics And Dashboards
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /4.37 ▲0.9139.59 ▲2.53
Dashboard /wp-admin3.92 ▲0.6224.73 ▼22.77
Posts /wp-admin/edit.php3.93 ▲0.5723.66 ▼24.55
Add New Post /wp-admin/post-new.php3.92 ▼1.9623.75 ▼69.39
Media Library /wp-admin/upload.php3.92 ▲0.7026.39 ▼14.44
Settings /wp-admin/admin.php?page=WSAnalytics-settings3.9326.87
Dashboard /wp-admin/admin.php?page=WSAnalytics-dashboard3.9328.45

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

Filesystem and database footprint
There were no storage issued detected upon installing this plugin
Filesystem: 159 new files
Database: no new tables, 14 new options
New WordPress options
theysaidso_admin_options
can_compress_scripts
widget_recent-posts
post_analytics_disable_back
db_upgraded
display_demographic_code
WSAnalytics_posts_stats
post_analytics_settings_back
wsanalytics_code
post_analytics_access_back
...

Browser metrics Passed 4 tests

This is an overview of browser requirements for WSAnalytics - Google Analytics And Dashboards
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,951 ▲20513.84 ▼0.545.25 ▲3.4436.38 ▼6.52
Dashboard /wp-admin2,268 ▲805.23 ▼0.62114.16 ▼2.9181.34 ▲35.45
Posts /wp-admin/edit.php2,149 ▲602.41 ▲0.4238.13 ▲0.5532.37 ▼0.88
Add New Post /wp-admin/post-new.php1,583 ▲6420.85 ▼2.47661.57 ▼12.2339.42 ▼15.82
Media Library /wp-admin/upload.php1,439 ▲514.65 ▲0.48110.11 ▲6.9085.81 ▲42.26
Settings /wp-admin/admin.php?page=WSAnalytics-settings1,0312.3135.6843.93
Dashboard /wp-admin/admin.php?page=WSAnalytics-dashboard8402.1728.9726.66

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
The following items require your attention
  • This plugin did not uninstall without warnings or errors
    • > User notice in wp-includes/functions.php+5905
    Function add_menu_page was called incorrectly. The seventh parameter passed to add_menu_page() should be numeric representing menu position. Please see Debugging in WordPress for more information. (This message was added in version 6.0.0.)
  • Zombie WordPress options were found after uninstall: 12 options
    • post_analytics_access_back
    • widget_recent-comments
    • widget_theysaidso_widget
    • db_upgraded
    • can_compress_scripts
    • display_demographic_code
    • post_analytics_settings_back
    • widget_recent-posts
    • display_tracking_code
    • wsanalytics_code
    • ...

Smoke tests 25% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
These server-side errors were triggered
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=WSAnalytics-dashboard
    • > User notice in wp-includes/functions.php+5905
    Function add_menu_page was called incorrectly. The seventh parameter passed to add_menu_page() should be numeric representing menu position. Please see Debugging in WordPress for more information. (This message was added in version 6.0.0.)

SRP 0% from 2 tests

🔹 Tests weight: 20 | SRP (Single-Responsibility Principle) - PHP files must act as libraries and never output text or perform any action when accessed directly in a browser
Almost there! Just fix the following items
  • 2× PHP files output non-empty strings when accessed directly via GET requests:
    • > /wp-content/plugins/wsanalytics-google-analytics-and-dashboards/inc/front-menus.php
    • > /wp-content/plugins/wsanalytics-google-analytics-and-dashboards/views/admin/referrers-stats.php
  • 148× GET requests to PHP files trigger server-side errors or Error 500 responses (only 10 are shown):
    • > PHP Warning
      Use of undefined constant WSAnalytics_LIB_PATH - assumed 'WSAnalytics_LIB_PATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/wsanalytics-google-analytics-and-dashboards/lib/Google/IO/Stream.php on line 24
    • > PHP Fatal error
      require_once(): Failed opening required 'WSAnalytics_LIB_PATHGoogle/Auth/Exception.php' (include_path='.:/usr/share/php') in wp-content/plugins/wsanalytics-google-analytics-and-dashboards/lib/Google/Verifier/Pem.php on line 18
    • > PHP Warning
      Use of undefined constant WSAnalytics_LIB_PATH - assumed 'WSAnalytics_LIB_PATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/wsanalytics-google-analytics-and-dashboards/lib/Google/Cache/Null.php on line 18
    • > PHP Warning
      require_once(WSAnalytics_LIB_PATHGoogle/Exception.php): failed to open stream: No such file or directory in wp-content/plugins/wsanalytics-google-analytics-and-dashboards/lib/Google/Auth/Exception.php on line 18
    • > PHP Fatal error
      Uncaught Error: Class 'WSAnalytics_Google_Service' not found in wp-content/plugins/wsanalytics-google-analytics-and-dashboards/lib/Google/Service/Manager.php:32
    • > PHP Fatal error
      Uncaught Error: Class 'WSAnalytics_Google_Service' not found in wp-content/plugins/wsanalytics-google-analytics-and-dashboards/lib/Google/Service/SQLAdmin.php:32
    • > PHP Fatal error
      Uncaught Error: Class 'WSAnalytics_Google_Service' not found in wp-content/plugins/wsanalytics-google-analytics-and-dashboards/lib/Google/Service/Oauth2.php:32
    • > PHP Warning
      require_once(WSAnalytics_LIB_PATHGoogle/Cache/Abstract.php): failed to open stream: No such file or directory in wp-content/plugins/wsanalytics-google-analytics-and-dashboards/lib/Google/Cache/Memcache.php on line 18
    • > PHP Warning
      require_once(WSAnalytics_LIB_PATHGoogle/IO/Abstract.php): failed to open stream: No such file or directory in wp-content/plugins/wsanalytics-google-analytics-and-dashboards/lib/Google/IO/Curl.php on line 24
    • > PHP Fatal error
      require_once(): Failed opening required 'WSAnalytics_LIB_PATHGoogle/Cache/Abstract.php' (include_path='.:/usr/share/php') in wp-content/plugins/wsanalytics-google-analytics-and-dashboards/lib/Google/Cache/Apc.php on line 18

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
Everything seems fine on the user side

Optimizations

Plugin configuration 86% from 29 tests

readme.txt 94% from 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
These attributes need your attention:
  • Tags: Please reduce the number of tags, currently 14 tag instead of maximum 10
You can look at the official readme.txt

wsanalytics-google-analytics-and-dashboards/WSAnalytics.php 77% from 13 tests

The main file in "WSAnalytics - Google Analytics And Dashboards" v. 1.1.2 serves as a complement to information provided in readme.txt and as the entry point to the plugin
The following require your attention:
  • Text Domain: The text domain name must use dashes instead of underscores, and it must be lowercase
  • Main file name: The principal plugin file should be the same as the plugin slug ("wsanalytics-google-analytics-and-dashboards.php" instead of "WSAnalytics.php")
  • Description: Keep the plugin description shorter than 140 characters (currently 239 characters long)

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
Success! There were no dangerous files found in this plugin125,346 lines of code in 131 files:
LanguageFilesBlank linesComment linesLines of code
PHP11920,60325,314122,161
CSS541631,606
JavaScript71901331,579

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
This plugin has no cyclomatic complexity problems
Cyclomatic complexity
Average complexity per logical line of code0.02
Average class complexity1.25
▷ Minimum class complexity1.00
▷ Maximum class complexity73.00
Average method complexity1.03
▷ Minimum method complexity1.00
▷ Maximum method complexity35.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes2,309
▷ Abstract classes50.22%
▷ Concrete classes2,30499.78%
▷ Final classes00.00%
Methods17,940
▷ Static methods180.10%
▷ Public methods17,90199.78%
▷ Protected methods120.07%
▷ Private methods270.15%
Functions13
▷ Named functions13100.00%
▷ Anonymous functions00.00%
Constants196
▷ Global constants115.61%
▷ Class constants18594.39%
▷ Public constants185100.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
22 PNG files occupy 0.70MB with 0.25MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
css/images/ui-bg_glass_65_ffffff_1x400.png0.10KB0.10KB▼ 5.71%
images/arrow.png0.87KB0.43KB▼ 51.28%
assets/screenshot-2.png117.10KB35.39KB▼ 69.78%
css/images/ui-bg_flat_0_aaaaaa_40x100.png0.18KB0.08KB▼ 51.67%
css/images/ui-icons_888888_256x240.png4.27KB4.11KB▼ 3.78%