72% google-analytics-dashboard-for-wp

Code Review | ExactMetrics - Google Analytics Dashboard for WordPress (Website Stats Plugin)

WordPress plugin ExactMetrics - Google Analytics Dashboard for WordPress (Website Stats Plugin) scored72%from 54 tests.

About plugin

  • Plugin page: google-analytics-...
  • Plugin version: 7.22.0
  • PHP compatiblity: 7.2+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.6.0-6.4.1
  • WordPress version: 6.3.1
  • First release: Mar 12, 2013
  • Latest release: Nov 29, 2023
  • Number of updates: 739
  • Update frequency: every 5.3 days
  • Top authors: deconf (79.84%)chriscct7 (9.74%)manejaam (5.28%)gripgrip (3.38%)micheleam (2.3%)

Code review

54 tests

User reviews

1515 reviews

Install metrics

600,000+ active /42,919,511 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: ▲2.90MB] [CPU: ▲20.41ms] Passed 4 tests

An overview of server-side resources used by ExactMetrics - Google Analytics Dashboard for WordPress (Website Stats Plugin)
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /4.79 ▲1.3349.88 ▲8.53
Dashboard /wp-admin6.76 ▲3.4174.83 ▲13.13
Posts /wp-admin/edit.php6.78 ▲3.4280.39 ▲33.91
Add New Post /wp-admin/post-new.php9.40 ▲3.51116.84 ▲26.05
Media Library /wp-admin/upload.php6.67 ▲3.4469.52 ▲37.68
Settings /wp-admin/admin.php?page=exactmetrics_settings6.6470.61
Welcome to ExactMetrics /wp-admin/index.php?page=exactmetrics-getting-started6.6767.11
Reports /wp-admin/admin.php?page=exactmetrics_reports6.6564.86

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

How much does this plugin use your filesystem and database?
No storage issues were detected
Filesystem: 496 new files
Database: no new tables, 13 new options
New WordPress options
can_compress_scripts
widget_exactmetrics-popular-posts-widget
exactmetrics_db_version
exactmetrics_review
exactmetrics_settings
widget_recent-posts
widget_recent-comments
db_upgraded
theysaidso_admin_options
exactmetrics_current_version
...

Browser metrics Passed 4 tests

A check of browser resources used by ExactMetrics - Google Analytics Dashboard for WordPress (Website Stats Plugin)
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,130 ▲38319.07 ▲4.3526.48 ▲24.7930.43 ▼13.73
Dashboard /wp-admin2,415 ▲2408.65 ▲3.06163.94 ▲58.4055.14 ▲16.98
Posts /wp-admin/edit.php2,277 ▲1743.57 ▲1.6371.38 ▲31.5342.27 ▲6.18
Add New Post /wp-admin/post-new.php1,619 ▲9318.88 ▼4.09770.50 ▲161.2176.85 ▲21.84
Media Library /wp-admin/upload.php1,574 ▲1746.08 ▲1.83124.67 ▲29.1549.50 ▲8.62
Settings /wp-admin/admin.php?page=exactmetrics_settings1,5107.36192.55203.16
Welcome to ExactMetrics /wp-admin/index.php?page=exactmetrics-getting-started1,4506.66135.8880.15
User Journey /wp-admin/admin.php?page=exactmetrics_reports#/user-journey-report1,36011.93217.3281.86
Reports /wp-admin/admin.php?page=exactmetrics_reports1,44911.33317.7689.74
Setup Checklist15 /wp-admin/admin.php?page=exactmetrics_settings#/setup-checklist1,6507.09168.6696.25

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
These items require your attention
  • The uninstall procedure has failed, leaving 13 options in the database
    • exactmetrics_settings
    • db_upgraded
    • exactmetrics_db_version
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • widget_recent-comments
    • widget_exactmetrics-popular-posts-widget
    • exactmetrics_current_version
    • exactmetrics_usage_tracking_config
    • exactmetrics_review
    • ...

Smoke tests 25% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
Even though no errors were found, this is by no means an exhaustive test

SRP 0% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle applies for WordPress plugins as well - please make sure your PHP files perform no actions when accessed directly
Please fix the following
  • 7× GET requests to PHP files return non-empty strings:
    • > /wp-content/plugins/google-analytics-dashboard-for-wp/includes/gutenberg/headline-tool/phpinsight/lib/PHPInsight/data/data.prefix.php
    • > /wp-content/plugins/google-analytics-dashboard-for-wp/includes/gutenberg/headline-tool/phpinsight/lib/PHPInsight/data/data.ign.php
    • > /wp-content/plugins/google-analytics-dashboard-for-wp/includes/gutenberg/headline-tool/phpinsight/examples/demo.php
    • > /wp-content/plugins/google-analytics-dashboard-for-wp/includes/gutenberg/headline-tool/phpinsight/lib/PHPInsight/data/data.neu.php
    • > /wp-content/plugins/google-analytics-dashboard-for-wp/includes/gutenberg/headline-tool/phpinsight/lib/PHPInsight/data/data.pos.php
    • > /wp-content/plugins/google-analytics-dashboard-for-wp/includes/gutenberg/headline-tool/phpinsight/lib/PHPInsight/data/data.neg.php
    • > /wp-content/plugins/google-analytics-dashboard-for-wp/includes/emails/templates/body-default-plain.php
  • 66× GET requests to PHP files have triggered server-side errors or warnings (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/google-analytics-dashboard-for-wp/lite/includes/admin/helpers.php:11
    • > PHP Fatal error
      Uncaught Error: Class 'ExactMetrics_Notification_Event' not found in wp-content/plugins/google-analytics-dashboard-for-wp/includes/admin/notifications/notification-multiple-gtags.php:4
    • > PHP Fatal error
      Uncaught Error: Class 'ExactMetrics_Notification_Event' not found in wp-content/plugins/google-analytics-dashboard-for-wp/includes/admin/notifications/notification-upgrade-to-pro.php:9
    • > PHP Fatal error
      require_once(): Failed opening required 'ABSPATHwp-admin/includes/class-wp-upgrader.php' (include_path='.:/usr/share/php') in wp-content/plugins/google-analytics-dashboard-for-wp/includes/admin/licensing/plugin-upgrader.php on line 4
    • > PHP Fatal error
      Uncaught Error: Class 'ExactMetrics_Notification_Event' not found in wp-content/plugins/google-analytics-dashboard-for-wp/includes/admin/notifications/notification-audience.php:9
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_shortcode() in wp-content/plugins/google-analytics-dashboard-for-wp/includes/frontend/verified-badge/Controller.php:66
    • > PHP Fatal error
      Uncaught Error: Class 'ExactMetrics_Notification_Event' not found in wp-content/plugins/google-analytics-dashboard-for-wp/includes/admin/notifications/notification-install-optinmonster.php:9
    • > PHP Fatal error
      Uncaught Error: Class 'ExactMetrics_Notification_Event' not found in wp-content/plugins/google-analytics-dashboard-for-wp/includes/admin/notifications/notification-install-user-feedback.php:9
    • > PHP Fatal error
      Uncaught Error: Class 'ExactMetrics_Notification_Event' not found in wp-content/plugins/google-analytics-dashboard-for-wp/includes/admin/notifications/notification-upgrade-for-search-console.php:9
    • > PHP Fatal error
      Uncaught Error: Call to undefined function ExactMetrics() in wp-content/plugins/google-analytics-dashboard-for-wp/includes/admin/notifications/notification-events.php:3

User-side errors 0% from 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
Please fix the following user-side errors
    • > GET request to /wp-admin/admin.php?page=exactmetrics_settings#/setup-checklist
    • > Javascript (severe) in unknown
    /wp-content/plugins/google-analytics-dashboard-for-wp/lite/assets/vue/js/chunk-vendors.js?ver=7.22.0 0:5157 Uncaught TypeError: Cannot read properties of null (reading 'style')

Optimizations

Plugin configuration 93% from 29 tests

readme.txt Passed 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
6 plugin tags: google analytics widget, google analytics, google analytics plugin, gtag, analytics...

google-analytics-dashboard-for-wp/gadwp.php 85% from 13 tests

The main file in "ExactMetrics - Google Analytics Dashboard for WordPress (Website Stats Plugin)" v. 7.22.0 serves as a complement to information provided in readme.txt and as the entry point to the plugin
You should first fix the following items:
  • Description: Please keep the plugin description shorter than 140 characters (currently 148 characters long)
  • Main file name: The principal plugin file should be the same as the plugin slug ("google-analytics-dashboard-for-wp.php" instead of "gadwp.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short glimpse at programming languages used with this plugin and a check that no dangerous files are present
There were no executable files found in this plugin34,992 lines of code in 264 files:
LanguageFilesBlank linesComment linesLines of code
PHP1466,21021,16431,631
JavaScript252072931,551
CSS26222241,214
SVG64130551
JSON11026
Markdown28019

PHP code Passed 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.47
Average class complexity22.35
▷ Minimum class complexity1.00
▷ Maximum class complexity195.00
Average method complexity4.04
▷ Minimum method complexity1.00
▷ Maximum method complexity44.00
Code structure
Namespaces2
Interfaces0
Traits0
Classes97
▷ Abstract classes11.03%
▷ Concrete classes9698.97%
▷ Final classes3940.62%
Methods682
▷ Static methods253.67%
▷ Public methods60288.27%
▷ Protected methods334.84%
▷ Private methods476.89%
Functions193
▷ Named functions18897.41%
▷ Anonymous functions52.59%
Constants24
▷ Global constants2187.50%
▷ Class constants312.50%
▷ Public constants3100.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
157 PNG files occupy 6.25MB with 1.64MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
lite/assets/img/emails/summaries/icon-top-pages.png0.44KB0.33KB▼ 23.83%
lite/assets/vue/img/monsterinsights-report-ecommerce.png44.45KB47.11KB0.00%
lite/assets/vue/img/woocommerce.png5.57KB5.71KB0.00%
assets/images/up.png1.03KB0.21KB▼ 79.54%
lite/assets/img/emails/summaries/stats@2x.png0.39KB0.28KB▼ 28.04%