88% bws-google-analytics

Code Review | Analytics by BestWebSoft - Google Analytics Dashboard and Statistic Plugin for WordPress

WordPress plugin Analytics by BestWebSoft - Google Analytics Dashboard and Statistic Plugin for WordPress scored 88% from 54 tests.

About plugin

  • Plugin page: bws-google-analytics
  • Plugin version: 1.7.8
  • PHP version: 7.4.16
  • WordPress compatibility: 4.5-5.8
  • WordPress version: 5.8.1
  • First release: Mar 20, 2014
  • Latest release: Oct 21, 2021
  • Number of updates: 36
  • Update frequency: every 77.0 days
  • Top authors: bestwebsoft (100%)

Code review

54 tests

User reviews

23 reviews

Install metrics

3,000+ active / 81,989 total downloads

Benchmarks

Plugin footprint Passed 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
Installer ran successfully

Server metrics [RAM: ▲0.04MB] [CPU: ▼140.92ms] Passed 4 tests

An overview of server-side resources used by Analytics by BestWebSoft - Google Analytics Dashboard and Statistic Plugin for WordPress
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /2.87 ▲0.0442.87 ▲14.74
Dashboard /wp-admin3.11 ▲0.0544.41 ▲0.88
Posts /wp-admin/edit.php3.22 ▲0.1150.45 ▲8.54
Add New Post /wp-admin/post-new.php5.46 ▲0.0391.19 ▼566.22
Media Library /wp-admin/upload.php3.05 ▲0.0530.95 ▼6.87

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

A short overview of filesystem and database impact
There were no storage issued detected upon installing this plugin
Filesystem: 180 new files
Database: no new tables, 2 new options
New WordPress options
bstwbsftwppdtplgns_options
gglnltcs_options

Browser metrics Passed 4 tests

A check of browser resources used by Analytics by BestWebSoft - Google Analytics Dashboard and Statistic Plugin for WordPress
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,724 ▲12816.13 ▲0.567.31 ▼0.4944.06 ▼4.56
Dashboard /wp-admin3,012 ▲785.97 ▲0.06139.06 ▼1.74108.40 ▲1.51
Posts /wp-admin/edit.php2,784 ▲452.73 ▲0.0565.37 ▼0.1689.68 ▲6.86
Add New Post /wp-admin/post-new.php1,532 ▼14018.49 ▼0.36350.85 ▼16.34103.75 ▼4.91
Media Library /wp-admin/upload.php1,855 ▲485.06 ▲0.07160.29 ▲8.39113.29 ▼9.59
BWS Panel /wp-admin/bws-google-analytics.php?page=gglnltcs-bws-panel260.900.129.51
Settings /wp-admin/bws-google-analytics.php260.900.0410.74

Uninstaller [IO: ▲0.00MB] [DB: ▲0.00MB] Passed 4 tests

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
Uninstaller ran successfully

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 everything seems fine, this is not an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | It is important to ensure that your PHP files perform no action when accessed directly, respecting the single-responsibility principle
The following issues need your attention
  • 5× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function register_activation_hook() in wp-content/plugins/bws-google-analytics/bws-google-analytics.php:632
    • > PHP Fatal error
      Uncaught Error: Call to undefined function __() in wp-content/plugins/bws-google-analytics/bws_menu/product_list.php:8
    • > PHP Fatal error
      Uncaught Error: Class 'Bws_Settings_Tabs' not found in wp-content/plugins/bws-google-analytics/includes/class-gglnltcs-settings.php:7
    • > PHP Fatal error
      Uncaught Error: Class 'Google_Service' not found in wp-content/plugins/bws-google-analytics/google-api/Service/AnalyticsReporting.php:29
    • > PHP Fatal error
      Uncaught Error: Class 'Google_Service' not found in wp-content/plugins/bws-google-analytics/google-api/Service/Analytics.php:29

User-side errors 0% from 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
Please fix the following user-side errors
    • > GET request to /wp-admin/bws-google-analytics.php?page=gglnltcs-bws-panel
    • > Network (severe)
    wp-admin/bws-google-analytics.php?page=gglnltcs-bws-panel - Failed to load resource: the server responded with a status of 404 (Not Found)
    • > GET request to /wp-admin/bws-google-analytics.php
    • > Network (severe)
    wp-admin/bws-google-analytics.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

The readme.txt file is an important file in your plugin as it is parsed by WordPress.org to prepare the public listing of your plugin
Attributes that need to be fixed:
  • Screenshots: These screenshots do not have images: #1 (Analytics Settings page.), #2 (Google Analytics Authentication.), #3 (Line Chart mode in the plugin Statistic page.), #4 (Table Chart mode in the plugin Statistic page.)
  • Tags: Too many tags (12 tag instead of maximum 10); only the first 5 tags are used in your directory listing
You can take inspiration from this readme.txt

bws-google-analytics/bws-google-analytics.php Passed 13 tests

"Analytics by BestWebSoft - Google Analytics Dashboard and Statistic Plugin for WordPress" version 1.7.8's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
69 characters long description:
Add Google Analytics code to WordPress website and track basic stats.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of file extensions present in this plugin and a short test that no dangerous files are bundled with this plugin
Success! There were no dangerous files found in this plugin34,208 lines of code in 88 files:
LanguageFilesBlank linesComment linesLines of code
PHP581,7414,43218,488
PO File114,1176,7917,902
CSS112133277,006
JavaScript753164741
SVG10071

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.26
Average class complexity5.21
▷ Minimum class complexity1.00
▷ Maximum class complexity224.00
Average method complexity1.48
▷ Minimum method complexity1.00
▷ Maximum method complexity76.00
Code structure
Namespaces0
Interfaces1
Traits0
Classes205
▷ Abstract classes62.93%
▷ Concrete classes19997.07%
▷ Final classes00.00%
Methods1,830
▷ Static methods130.71%
▷ Public methods1,76496.39%
▷ Protected methods201.09%
▷ Private methods462.51%
Functions70
▷ Named functions70100.00%
▷ Anonymous functions00.00%
Constants56
▷ Global constants23.57%
▷ Class constants5496.43%
▷ Public constants54100.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
73 PNG files occupy 2.40MB with 0.76MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
bws_menu/css/jquery-ui-styles/1.10.4/images/ui-icons_cd0a0a_256x240.png4.49KB4.20KB▼ 6.46%
bws_menu/css/jquery-ui-styles/1.11.4/images/ui-icons_222222_256x240.png6.76KB4.17KB▼ 38.24%
bws_menu/icons/plugins/bike-rental.png6.86KB2.68KB▼ 60.89%
bws_menu/css/jquery-ui-styles/1.10.4/images/ui-bg_glass_95_fef1ec_1x400.png0.38KB0.17KB▼ 53.39%
bws_menu/css/jquery-ui-styles/1.9.2/images/ui-bg_glass_95_fef1ec_1x400.png0.12KB0.14KB0.00%