47% independent-analytics

Code Review | Independent Analytics - Google Analytics Alternative for WordPress

WordPress plugin Independent Analytics - Google Analytics Alternative for WordPress scored47%from 54 tests.

About plugin

  • Plugin page: independent-analy...
  • Plugin version: 2.0.1
  • PHP compatiblity: 7.3.33+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.9-6.3.1
  • WordPress version: 6.3.1
  • First release: May 31, 2022
  • Latest release: Nov 16, 2023
  • Number of updates: 72
  • Update frequency: every 7.5 days
  • Top authors: BenSibley (100%)(no author) (2.78%)

Code review

54 tests

User reviews

47 reviews

Install metrics

10,000+ active /155,969 total downloads

Benchmarks

Plugin footprint 47% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
This plugin's installer ran successfully

Server metrics [RAM: ▲6.39MB] [CPU: ▲58.55ms] 75% from 4 tests

An overview of server-side resources used by Independent Analytics - Google Analytics Alternative for WordPress
It is recommended to improve the following
  • Extra RAM: Try to keep extra memory usage under 5MB (currently 6.39MB on /wp-admin/admin.php?page=freemius)
PageMemory (MB)CPU Time (ms)
Home /10.53 ▲7.0692.88 ▲53.32
Dashboard /wp-admin11.78 ▲8.47125.60 ▲75.38
Posts /wp-admin/edit.php8.91 ▲5.55105.22 ▲62.76
Add New Post /wp-admin/post-new.php13.13 ▲7.25163.57 ▲67.07
Media Library /wp-admin/upload.php8.91 ▲5.6884.23 ▲51.05
Freemius Debug [v.2.5.11] /wp-admin/admin.php?page=freemius8.9181.24

Server storage [IO: ▲16.48MB] [DB: ▲0.04MB] Passed 3 tests

Filesystem and database footprint
This plugin was installed successfully
Filesystem: 2,745 new files
Database: 13 new tables, 14 new options
New tables
wp_independent_analytics_referrer_groups
wp_independent_analytics_sessions
wp_independent_analytics_visitors_1_16_archive
wp_independent_analytics_views
wp_independent_analytics_campaigns
wp_independent_analytics_cities
wp_independent_analytics_wc_orders
wp_independent_analytics_resources
wp_independent_analytics_referrers
wp_independent_analytics_campaign_urls
...
New WordPress options
fs_active_plugins
theysaidso_admin_options
widget_theysaidso_widget
fs_debug_mode
iawp_need_clear_cache
iawp_geo_database_download_last_attempted_at
iawp_db_version
can_compress_scripts
widget_recent-posts
widget_recent-comments
...

Browser metrics Passed 4 tests

A check of browser resources used by Independent Analytics - Google Analytics Alternative for WordPress
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,086 ▲29917.04 ▲2.912.06 ▲0.1521.55 ▼24.38
Dashboard /wp-admin2,419 ▲2397.32 ▲1.67128.06 ▲34.8265.44 ▲20.39
Posts /wp-admin/edit.php2,142 ▲421.99 ▲0.0340.92 ▲1.6147.20 ▲10.44
Add New Post /wp-admin/post-new.php1,591 ▲6521.97 ▼1.21819.37 ▲56.5247.31 ▼8.87
Media Library /wp-admin/upload.php1,441 ▲474.23 ▲0.04109.00 ▲3.6244.16 ▼4.55
Freemius Debug [v.2.5.11] /wp-admin/admin.php?page=freemius1,0931.6638.2332.74

Uninstaller [IO: ▲93.64MB] [DB: ▲0.04MB] 25% from 4 tests

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
It is recommended to fix the following
  • Uninstall procedure had uncaught errors
    • > Notice in wp-content/plugins/independent-analytics/freemius/includes/class-freemius.php+8515
    Undefined property: stdClass::$plugins
  • The uninstall procedure failed, leaving 13 tables in the database
    • wp_independent_analytics_views
    • wp_independent_analytics_reports
    • wp_independent_analytics_cities
    • wp_independent_analytics_devices
    • wp_independent_analytics_wc_orders
    • wp_independent_analytics_campaigns
    • wp_independent_analytics_countries
    • wp_independent_analytics_referrers
    • wp_independent_analytics_sessions
    • wp_independent_analytics_resources
    • ...
  • The uninstall procedure has failed, leaving 14 options in the database
    • db_upgraded
    • iawp_is_database_downloading
    • widget_recent-posts
    • iawp_db_version
    • widget_recent-comments
    • iawp_is_migrating
    • iawp_geo_database_download_last_attempted_at
    • widget_theysaidso_widget
    • fs_accounts
    • fs_active_plugins
    • ...

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
The smoke test was a success, however most plugin functionality was not tested

SRP 0% 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
Almost there! Just fix the following items
  • 17× PHP files output text when accessed directly (only 10 are shown):
    • > /wp-content/plugins/independent-analytics/views/learn/learn.blade.php
    • > /wp-content/plugins/independent-analytics/views/icons/devices.blade.php
    • > /wp-content/plugins/independent-analytics/views/partials/report-header.blade.php
    • > /wp-content/plugins/independent-analytics/views/icons/reviews.blade.php
    • > /wp-content/plugins/independent-analytics/views/icons/campaign-builder.blade.php
    • > /wp-content/plugins/independent-analytics/views/icons/real-time.blade.php
    • > /wp-content/plugins/independent-analytics/views/icons/knowledgebase.blade.php
    • > /wp-content/plugins/independent-analytics/views/icons/referrers.blade.php
    • > /wp-content/plugins/independent-analytics/views/partials/toolbar.blade.php
    • > /wp-content/plugins/independent-analytics/views/settings/export-reports.blade.php
  • 648× PHP files trigger server-side errors or warnings when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Interface 'IAWP_SCOPED\\Carbon\\Exceptions\\InvalidArgumentException' not found in wp-content/plugins/independent-analytics/vendor/nesbot/carbon/src/Carbon/Exceptions/NotACarbonClassException.php:16
    • > PHP Fatal error
      Uncaught Error: Interface 'IAWP_SCOPED\\League\\Uri\\Contracts\\UriException' not found in wp-content/plugins/independent-analytics/vendor/league/uri-interfaces/src/Exceptions/SyntaxError.php:15
    • > PHP Fatal error
      Uncaught Error: Class 'IAWP_SCOPED\\IAWP\\Migrations\\Migration' not found in wp-content/plugins/independent-analytics/IAWP/Migrations/Migration_18.php:6
    • > PHP Fatal error
      Uncaught Error: Class 'IAWP_SCOPED\\Carbon\\Doctrine\\DateTimeType' not found in wp-content/plugins/independent-analytics/vendor/nesbot/carbon/src/Carbon/Doctrine/CarbonType.php:14
    • > PHP Fatal error
      Uncaught Error: Class 'IAWP_SCOPED\\Carbon\\AbstractTranslator' not found in wp-content/plugins/independent-analytics/vendor/nesbot/carbon/lazy/Carbon/TranslatorWeakType.php:14
    • > PHP Fatal error
      Uncaught Error: Class 'IAWP_SCOPED\\Symfony\\Component\\Translation\\Loader\\IcuResFileLoader' not found in wp-content/plugins/independent-analytics/vendor/symfony/translation/Loader/IcuDatFileLoader.php:22
    • > PHP Fatal error
      Uncaught Error: Class 'IAWP_SCOPED\\Illuminate\\Database\\Events\\MigrationsEvent' not found in wp-content/plugins/independent-analytics/vendor/illuminate/database/Events/MigrationsEnded.php:5
    • > PHP Fatal error
      Uncaught Error: Class 'IAWP_SCOPED\\Symfony\\Component\\Console\\Output\\Output' not found in wp-content/plugins/independent-analytics/vendor/symfony/console/Output/StreamOutput.php:28
    • > PHP Fatal error
      Uncaught Error: Interface 'IAWP_SCOPED\\Carbon\\Exceptions\\BadMethodCallException' not found in wp-content/plugins/independent-analytics/vendor/nesbot/carbon/src/Carbon/Exceptions/BadFluentSetterException.php:15
    • > PHP Fatal error
      Uncaught Error: Class 'IAWP_SCOPED\\IAWP\\Migrations\\Migration' not found in wp-content/plugins/independent-analytics/IAWP/Migrations/Migration_8.php:6

User-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
No browser issues were found

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% 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 require attention:
  • Tags: There are too many tags (12 tag instead of maximum 10)
Please take inspiration from this readme.txt

independent-analytics/iawp.php 92% from 13 tests

The main PHP script in "Independent Analytics - Google Analytics Alternative for WordPress" version 2.0.1 is automatically included on every request by WordPress
You should first fix the following items:
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("independent-analytics.php" instead of "iawp.php")

Code Analysis 0% from 3 tests

File types 0% from 1 test

🔸 Test weight: 35 | This is a short overview of programming languages used in this plugin, detecting executable files
Please fix the following items
  • Do not distribute dangerous files with your plugin
    • .bat - Batch File in Windows
      • wp-content/plugins/independent-analytics/vendor/nesbot/carbon/bin/carbon.bat
177,366 lines of code in 2,436 files:
LanguageFilesBlank linesComment linesLines of code
PHP2,03612,20191,207118,205
YAML213,5752,87142,483
SVG2821764,629
PO File61,7522,0323,596
XSD392482,803
JSON2002,558
Blade4920211,863
C111825668
JavaScript934119210
XML42513155
reStructuredText1747874
Bourne Again Shell1101460
m418032
CSS180018
C/C++ Header14128
DOS Batch1004

PHP code 0% from 2 tests

A short review of cyclomatic complexity and code structure
Please fix the following
  • Cyclomatic complexity of classes should be reduced to less than 1000 (currently 3,087)
  • Method cyclomatic complexity should be reduced to less than 100 (currently 140)
Cyclomatic complexity
Average complexity per logical line of code0.45
Average class complexity14.49
▷ Minimum class complexity1.00
▷ Maximum class complexity3,087.00
Average method complexity2.62
▷ Minimum method complexity1.00
▷ Maximum method complexity140.00
Code structure
Namespaces170
Interfaces201
Traits72
Classes825
▷ Abstract classes607.27%
▷ Concrete classes76592.73%
▷ Final classes8511.11%
Methods10,267
▷ Static methods1,29112.57%
▷ Public methods7,49472.99%
▷ Protected methods1,79917.52%
▷ Private methods9749.49%
Functions1,267
▷ Named functions38930.70%
▷ Anonymous functions87869.30%
Constants641
▷ Global constants11918.56%
▷ Class constants52281.44%
▷ Public constants42080.46%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
5 PNG files occupy 0.06MB with 0.03MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
img/logo-white.png13.95KB7.82KB▼ 43.94%
img/logo.png25.73KB8.93KB▼ 65.29%
freemius/assets/img/theme-icon.png10.97KB5.78KB▼ 47.37%
img/favicon.png4.80KB2.28KB▼ 52.54%
freemius/assets/img/plugin-icon.png9.16KB5.26KB▼ 42.58%