83% beehive-analytics

Code Review | Beehive Analytics - Google Analytics Dashboard

WordPress plugin Beehive Analytics - Google Analytics Dashboard scored 83% from 54 tests.

About plugin

  • Plugin page: beehive-analytics
  • Plugin version: 3.4.9
  • PHP compatiblity: 7.4.33+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.2-6.3
  • WordPress version: 6.3.1
  • First release: Nov 15, 2019
  • Latest release: Sep 11, 2023
  • Number of updates: 86
  • Update frequency: every 16.2 days
  • Top authors: joelcj91 (90.7%)jdailey (6.98%)rickjc89 (4.65%)

Code review

54 tests

User reviews

13 reviews

Install metrics

30,000+ active / 99,524 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
This plugin's installer ran successfully

Server metrics [RAM: ▲0.40MB] [CPU: ▼0.78ms] Passed 4 tests

Analyzing server-side resources used by Beehive Analytics - Google Analytics Dashboard
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.80 ▲0.3542.50 ▼1.94
Dashboard /wp-admin3.83 ▲0.5258.78 ▲6.29
Posts /wp-admin/edit.php3.73 ▲0.3855.86 ▼7.09
Add New Post /wp-admin/post-new.php6.39 ▲0.5093.58 ▲3.34
Media Library /wp-admin/upload.php3.60 ▲0.3840.96 ▲2.58
Google Analytics /wp-admin/admin.php?page=beehive-google-analytics3.5348.82
Accounts /wp-admin/admin.php?page=beehive-accounts3.6937.98
Google Tag Manager /wp-admin/admin.php?page=beehive-google-tag-manager3.6340.63
Tutorials /wp-admin/admin.php?page=beehive-tutorials3.5236.58
Settings /wp-admin/admin.php?page=beehive-settings3.7042.50
Dashboard /wp-admin/admin.php?page=beehive3.7046.88

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

A short overview of filesystem and database impact
This plugin installed successfully
Filesystem: 1,272 new files
Database: no new tables, 9 new options
New WordPress options
beehive_owner_user
beehive_version
widget_recent-comments
beehive_settings
can_compress_scripts
db_upgraded
widget_theysaidso_widget
theysaidso_admin_options
widget_recent-posts

Browser metrics Passed 4 tests

Beehive Analytics - Google Analytics Dashboard: an overview of browser usage
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,357 ▲56817.62 ▲2.832.60 ▲0.8247.59 ▲3.61
Dashboard /wp-admin2,770 ▲5678.56 ▲2.69244.02 ▲134.9592.26 ▲53.24
Posts /wp-admin/edit.php2,161 ▲692.05 ▲0.0446.75 ▲9.2640.32 ▲5.50
Add New Post /wp-admin/post-new.php1,567 ▲2523.45 ▲5.16763.09 ▲157.1362.85 ▲14.59
Media Library /wp-admin/upload.php1,464 ▲734.18 ▼0.0194.65 ▼33.5341.79 ▼31.77
Google Analytics /wp-admin/admin.php?page=beehive-google-analytics1,5926.14172.9273.72
Accounts /wp-admin/admin.php?page=beehive-accounts1,2914.3584.7859.90
Google Tag Manager /wp-admin/admin.php?page=beehive-google-tag-manager1,1203.7465.4346.26
Tutorials /wp-admin/admin.php?page=beehive-tutorials1,1653.9058.2053.45
Settings /wp-admin/admin.php?page=beehive-settings1,4744.38100.5264.11
Dashboard /wp-admin/admin.php?page=beehive1,9805.99120.7680.59

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
You still need to fix the following
  • Zombie WordPress options were found after uninstall: 6 options
    • theysaidso_admin_options
    • db_upgraded
    • widget_recent-comments
    • can_compress_scripts
    • widget_theysaidso_widget
    • widget_recent-posts

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 | A shallow check of the single-responsibility principle; PHP files should perform no action - including output of placeholder text - and trigger no errors when accessed directly
Please fix the following
  • 690× PHP files trigger errors when accessed directly with GET requests (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'Beehive\\Google\\Collection' not found in wp-content/plugins/beehive-analytics/dependencies/vendor/google/apiclient-services/src/Analytics/Upload.php:20
    • > PHP Fatal error
      Uncaught Error: Class 'Beehive\\Google\\Model' not found in wp-content/plugins/beehive-analytics/dependencies/vendor/google/apiclient-services/src/Analytics/HashClientIdRequest.php:20
    • > PHP Fatal error
      Uncaught Error: Class 'Beehive\\Google\\Collection' not found in wp-content/plugins/beehive-analytics/dependencies/vendor/google/apiclient-services/src/GoogleAnalyticsAdmin/GoogleAnalyticsAdminV1betaAccountSummary.php:20
    • > PHP Fatal error
      Uncaught Error: Class 'Beehive\\Google\\Collection' not found in wp-content/plugins/beehive-analytics/dependencies/vendor/google/apiclient-services/src/Analytics/AccountSummary.php:20
    • > PHP Fatal error
      Uncaught Error: Class 'Beehive\\Google\\Model' not found in wp-content/plugins/beehive-analytics/dependencies/vendor/google/apiclient-services/src/Analytics/EntityAdWordsLinkEntity.php:20
    • > PHP Fatal error
      Uncaught Error: Class 'Beehive\\Google\\Service\\Resource' not found in wp-content/plugins/beehive-analytics/dependencies/vendor/google/apiclient-services/src/Analytics/Resource/ManagementProfiles.php:30
    • > PHP Fatal error
      Uncaught Error: Class 'Beehive\\Google\\Collection' not found in wp-content/plugins/beehive-analytics/dependencies/vendor/google/apiclient-services/src/Analytics/Filters.php:20
    • > PHP Fatal error
      Uncaught Error: Class 'Beehive\\Google\\Collection' not found in wp-content/plugins/beehive-analytics/dependencies/vendor/google/apiclient-services/src/Analytics/GaData.php:20
    • > PHP Fatal error
      Uncaught Error: Class 'Beehive\\Google\\Model' not found in wp-content/plugins/beehive-analytics/dependencies/vendor/google/apiclient-services/src/AnalyticsData/Filter.php:20
    • > PHP Fatal error
      Uncaught Error: Class 'Beehive\\Google\\Model' not found in wp-content/plugins/beehive-analytics/dependencies/vendor/google/apiclient-services/src/PeopleService/Location.php:20

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
There were no browser issues found

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

The readme.txt file uses markdown syntax to describe your plugin to the world
8 plugin tags: statistics, google analytics wordpress plugin, add google analytics to wordpress, website analytics, google analytics report...

beehive-analytics/beehive-analytics.php 92% from 13 tests

"Beehive Analytics - Google Analytics Dashboard" version 3.4.9's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
You should first fix the following items:
  • Text Domain: The text domain follows the same naming rules as the plugin slug: lowercase characters and dashes

Code Analysis 97% from 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short review of files and their extensions; it is not recommended to include executable files
Good job! No executable or dangerous file extensions detected90,100 lines of code in 1,193 files:
LanguageFilesBlank linesComment linesLines of code
PHP9364,35165,75872,345
Vuejs Component1421,3983,21211,349
Sass54461893,200
JSON3001,431
JavaScript431788151,219
SVG100383
Markdown1390127
YAML12025
CSS110011
Dockerfile18010

PHP code 50% from 2 tests

Analyzing cyclomatic complexity and code structure
These items need your attention
  • Method cyclomatic complexity has to be reduced to less than 100 (currently 179)
Cyclomatic complexity
Average complexity per logical line of code0.31
Average class complexity10.08
▷ Minimum class complexity1.00
▷ Maximum class complexity634.00
Average method complexity2.20
▷ Minimum method complexity1.00
▷ Maximum method complexity179.00
Code structure
Namespaces85
Interfaces36
Traits8
Classes867
▷ Abstract classes182.08%
▷ Concrete classes84997.92%
▷ Final classes293.42%
Methods6,884
▷ Static methods3434.98%
▷ Public methods6,30491.57%
▷ Protected methods2203.20%
▷ Private methods3605.23%
Functions220
▷ Named functions9744.09%
▷ Anonymous functions12355.91%
Constants515
▷ Global constants8215.92%
▷ Class constants43384.08%
▷ Public constants433100.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
67 PNG files occupy 1.92MB with 0.91MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
app/assets/img/beehive-summary.png139.04KB28.56KB▼ 79.46%
core/external/free-notices/assets/images/giveaway/form/branda@2x.png6.85KB3.46KB▼ 49.49%
app/src/images/icons/flags.png47.75KB13.06KB▼ 72.64%
app/assets/img/onboarding/setup.png3.25KB2.39KB▼ 26.23%
app/src/images/icons/icon-google-connect@2x.png0.98KB0.89KB▼ 9.37%