Plugin Directory

Changeset 3780659


Ignore:
Timestamp:
11/02/2026 08:07:32 PM (4 weeks ago)
Author:
mdburnette
Message:

Release 1.11.4: add analytics integrations, account access controls, and daily averages with accurate comparison periods

Location:
independence-hub-connector
Files:
12 added
6 edited
1 copied

Legend:

Unmodified
Added
Removed
  • independence-hub-connector/tags/1.11.4/independence-hub-connector.php

    r3726911 r3780659  
    22/**
    33 * Plugin Name: Independence Hub Connector
    4  * Description: Securely shares read-only Independent Analytics metrics with Independence Hub.
    5  * Version: 1.7.0
     4 * Description: Securely shares read-only WordPress analytics metrics with Independence Hub.
     5 * Version: 1.11.4
    66 * Requires at least: 6.5
    77 * Requires PHP: 8.0
    … …  
    1515defined( 'ABSPATH' ) || exit;
    1616
    17 define( 'INDEPENDENCE_HUB_CONNECTOR_VERSION', '1.7.0' );
     17define( 'INDEPENDENCE_HUB_CONNECTOR_VERSION', '1.11.4' );
    1818define( 'INDEPENDENCE_HUB_CONNECTOR_FILE', __FILE__ );
    1919define( 'INDEPENDENCE_HUB_CONNECTOR_TOKEN_OPTION', 'independence_hub_connector_token_hash' );
    … …  
    2828                $connections['legacy'] = array( 'hash' => $legacy, 'account_email' => '', 'created_at' => '' );
    2929        }
    30         return $connections;
     30        return independence_hub_connector_normalize_connections( $connections );
     31}
     32
     33/** Merge repeated approvals for the same Hub email, retaining the newest token. */
     34function independence_hub_connector_normalize_connections( $connections ) {
     35        $normalized = array();
     36        $account_keys = array();
     37        foreach ( $connections as $id => $connection ) {
     38                if ( ! is_array( $connection ) ) {
     39                        continue;
     40                }
     41                $email = strtolower( trim( (string) ( $connection['account_email'] ?? '' ) ) );
     42                $key   = $email ? 'email:' . $email : 'connection:' . (string) $id;
     43                $sources = isset( $connection['sources'] ) && is_array( $connection['sources'] ) ? $connection['sources'] : array( 'independent-analytics' );
     44                $sources = array_values( array_unique( array_filter( $sources, 'is_string' ) ) );
     45                if ( ! isset( $account_keys[ $key ] ) ) {
     46                        $normalized[ $id ] = array_merge( $connection, array( 'sources' => $sources ) );
     47                        $account_keys[ $key ] = $id;
     48                        continue;
     49                }
     50
     51                $existing_id = $account_keys[ $key ];
     52                $existing = $normalized[ $existing_id ];
     53                $merged_sources = array_values( array_unique( array_merge( $existing['sources'] ?? array(), $sources ) ) );
     54                $existing_date = (string) ( $existing['created_at'] ?? '' );
     55                $current_date  = (string) ( $connection['created_at'] ?? '' );
     56                if ( $current_date >= $existing_date ) {
     57                        unset( $normalized[ $existing_id ] );
     58                        $normalized[ $id ] = array_merge( $connection, array( 'sources' => $merged_sources ) );
     59                        $account_keys[ $key ] = $id;
     60                } else {
     61                        $normalized[ $existing_id ]['sources'] = $merged_sources;
     62                }
     63        }
     64        return $normalized;
    3165}
    3266
    … …  
    3569 */
    3670function independence_hub_connector_register_routes() {
     71        register_rest_route( 'independence-hub/v1', '/sources', array(
     72                'methods' => WP_REST_Server::READABLE,
     73                'callback' => 'independence_hub_connector_sources',
     74                'permission_callback' => 'independence_hub_connector_authorize_analytics_request',
     75        ) );
    3776        register_rest_route(
    3877                'independence-hub/v1',
    … …  
    5796                        'permission_callback' => 'independence_hub_connector_authorize_analytics_request',
    5897                        'args'                => array(
     98                                'source' => array( 'default' => 'independent-analytics', 'validate_callback' => static function ( $value ) { return in_array( $value, array( 'independent-analytics', 'wp-statistics', 'burst-statistics', 'koko-analytics' ), true ); } ),
    5999                                'days' => array(
    60100                                        'default'           => 28,
    … …  
    76116                        'permission_callback' => 'independence_hub_connector_authorize_analytics_request',
    77117                        'args'                => array(
     118                                'source' => array( 'default' => 'independent-analytics', 'validate_callback' => static function ( $value ) { return in_array( $value, array( 'independent-analytics', 'wp-statistics', 'burst-statistics', 'koko-analytics' ), true ); } ),
    78119                                'days' => array(
    79120                                        'default'           => 28,
    … …  
    114155                foreach ( independence_hub_connector_connections() as $connection ) {
    115156                        if ( is_array( $connection ) && isset( $connection['hash'] ) && is_string( $connection['hash'] ) && hash_equals( $connection['hash'], $hash ) ) {
     157                $source = method_exists( $request, 'get_param' ) ? $request->get_param( 'source' ) : null;
     158                if ( $source && ! in_array( $source, $connection['sources'] ?? array( 'independent-analytics' ), true ) ) {
     159                    return new WP_Error( 'source_not_approved', __( 'Access to this analytics plugin has not been approved for this Hub account.', 'independence-hub-connector' ), array( 'status' => 409 ) );
     160                }
    116161                                nocache_headers();
    117162                                return true;
    … …  
    134179                && in_array( $parts['host'] ?? '', array( 'app.independence-hub.com', 'iastats.mburnette.com' ), true )
    135180                && '/api/wordpress/callback' === ( $parts['path'] ?? '' )
     181                && empty( $parts['user'] )
     182                && empty( $parts['pass'] )
     183                && empty( $parts['port'] )
    136184                && empty( $parts['query'] )
    137185                && empty( $parts['fragment'] );
    … …  
    151199        }
    152200
    153         $identity = independence_hub_connector_intent_identity( $state );
    154         if ( is_wp_error( $identity ) ) {
    155                 return $identity;
    156         }
    157 
    158         set_transient(
    159                 'independence_hub_approval_' . hash( 'sha256', $state ),
    160                 array( 'state' => $state, 'redirect_uri' => $redirect_uri, 'account_email' => $identity['account_email'], 'account_id' => $identity['account_id'] ),
    161                 15 * MINUTE_IN_SECONDS
    162         );
    163201        return rest_ensure_response(
    164202                array(
    165203                        'authorization_url' => add_query_arg(
    166                                 array( 'page' => 'independence-hub-connector-approve', 'state' => $state ),
     204                                array( 'page' => 'independence-hub-connector-approve', 'state' => $state, 'redirect_uri' => $redirect_uri ),
    167205                                admin_url( 'admin.php' )
    168206                        ),
    … …  
    192230        // phpcs:ignore WordPress.Security.NonceVerification.Recommended -- The state is matched against a short-lived server-side transient; the approval POST is protected by a nonce below.
    193231        $state    = isset( $_GET['state'] ) ? sanitize_text_field( wp_unslash( $_GET['state'] ) ) : '';
    194         $approval = $state ? get_transient( 'independence_hub_approval_' . hash( 'sha256', $state ) ) : false;
    195         if ( ! current_user_can( 'manage_options' ) || ! is_array( $approval ) || $state !== ( $approval['state'] ?? '' ) ) {
    196                 wp_die( esc_html__( 'This Independence Hub connection request has expired. Return to Independence Hub and start again.', 'independence-hub-connector' ), esc_html__( 'Connection unavailable', 'independence-hub-connector' ), array( 'response' => 403 ) );
    197         }
     232    // Verify identity only after the administrator reaches WordPress. This
     233    // avoids a nested Hub -> WordPress -> Hub request during bootstrap.
     234    if ( ! current_user_can( 'manage_options' ) || ! preg_match( '/^[a-f0-9-]{32,128}$/', $state ) ) {
     235        wp_die( esc_html__( 'This Independence Hub connection request is invalid.', 'independence-hub-connector' ), '', array( 'response' => 403 ) );
     236    }
     237    $approval = get_transient( 'independence_hub_approval_' . hash( 'sha256', $state ) );
     238    if ( ! is_array( $approval ) ) {
     239        // phpcs:ignore WordPress.Security.NonceVerification.Recommended -- Read-only approval preparation; identity is verified server-to-server and approval POST has a nonce.
     240        $redirect_uri = isset( $_GET['redirect_uri'] ) ? esc_url_raw( wp_unslash( $_GET['redirect_uri'] ) ) : 'https://app.independence-hub.com/api/wordpress/callback';
     241        if ( ! independence_hub_connector_valid_redirect_uri( $redirect_uri ) ) {
     242            wp_die( esc_html__( 'The Hub callback is invalid.', 'independence-hub-connector' ), '', array( 'response' => 400 ) );
     243        }
     244        $identity = independence_hub_connector_intent_identity( $state );
     245        if ( is_wp_error( $identity ) ) {
     246            wp_die( esc_html( $identity->get_error_message() ), '', array( 'response' => 403 ) );
     247        }
     248        $approval = array( 'state' => $state, 'redirect_uri' => $redirect_uri, 'account_email' => $identity['account_email'], 'account_id' => $identity['account_id'] );
     249        set_transient( 'independence_hub_approval_' . hash( 'sha256', $state ), $approval, 15 * MINUTE_IN_SECONDS );
     250    }
     251    if ( $state !== ( $approval['state'] ?? '' ) ) {
     252        wp_die( esc_html__( 'This Independence Hub connection request has expired.', 'independence-hub-connector' ), '', array( 'response' => 403 ) );
     253    }
     254        $existing_sources = array();
     255        $account_email    = strtolower( trim( (string) ( $approval['account_email'] ?? '' ) ) );
     256        foreach ( independence_hub_connector_connections() as $connection ) {
     257                if ( $account_email && strtolower( trim( (string) ( $connection['account_email'] ?? '' ) ) ) === $account_email ) {
     258                        $existing_sources = $connection['sources'];
     259                        break;
     260                }
     261        }
     262
     263        $available_sources = independence_hub_connector_available_sources();
     264        $source_descriptions = array(
     265                'independent-analytics' => __( 'Page views, visitors, sessions, and detailed traffic reports.', 'independence-hub-connector' ),
     266                'wp-statistics' => __( 'Page views, daily visitors, and traffic breakdowns.', 'independence-hub-connector' ),
     267                'burst-statistics' => __( 'Page views, visitors, sessions, and engagement reports.', 'independence-hub-connector' ),
     268                'koko-analytics' => __( 'Page views, visitors, top pages, and referrers.', 'independence-hub-connector' ),
     269        );
    198270
    199271        ?>
    200         <div class="wrap">
     272        <div class="wrap ihc-approval">
    201273                <h1><?php esc_html_e( 'Connect Independence Hub', 'independence-hub-connector' ); ?></h1>
    202                 <p><strong><?php esc_html_e( 'Hub account:', 'independence-hub-connector' ); ?></strong> <?php echo esc_html( $approval['account_email'] ?? '' ); ?></p>
    203                 <p><?php esc_html_e( 'Approve access to this site’s aggregate analytics. The connector will create a random, site-specific token that can access only its read-only analytics endpoints. It cannot sign in to WordPress or access other WordPress APIs.', 'independence-hub-connector' ); ?></p>
    204                 <p><?php esc_html_e( 'The token is sent to Independence Hub over HTTPS and can be revoked at any time from Settings → Independence Hub Connector.', 'independence-hub-connector' ); ?></p>
    205                 <p><a href="https://app.independence-hub.com/privacy" target="_blank" rel="noopener noreferrer"><?php esc_html_e( 'Read the Independence Hub privacy policy', 'independence-hub-connector' ); ?></a></p>
    206                 <form method="post" action="<?php echo esc_url( admin_url( 'admin-post.php' ) ); ?>">
    207                         <input type="hidden" name="action" value="independence_hub_approve">
    208                         <input type="hidden" name="state" value="<?php echo esc_attr( $state ); ?>">
    209                         <?php wp_nonce_field( 'independence_hub_approve_' . $state ); ?>
    210                         <p><button type="submit" name="independence_hub_approve" value="1" class="button button-primary"><?php esc_html_e( 'Approve connection', 'independence-hub-connector' ); ?></button></p>
    211                 </form>
     274                <p class="ihc-approval-intro"><?php esc_html_e( 'Choose the analytics you want to see in your Hub.', 'independence-hub-connector' ); ?></p>
     275                <div class="ihc-approval-layout">
     276                        <div class="ihc-approval-main">
     277                                <section class="ihc-approval-account" aria-labelledby="ihc-requesting-account">
     278                                        <span id="ihc-requesting-account" class="ihc-eyebrow"><?php esc_html_e( 'Connecting to Hub account', 'independence-hub-connector' ); ?></span>
     279                                        <strong><?php echo esc_html( $approval['account_email'] ?? '' ); ?></strong>
     280                                        <p><?php echo esc_html( get_bloginfo( 'name' ) ); ?> <span aria-hidden="true">·</span> <?php echo esc_html( wp_parse_url( home_url( '/' ), PHP_URL_HOST ) ); ?></p>
     281                                </section>
     282                                <form class="ihc-approval-form" method="post" action="<?php echo esc_url( admin_url( 'admin-post.php' ) ); ?>">
     283                                        <input type="hidden" name="action" value="independence_hub_approve">
     284                                        <input type="hidden" name="state" value="<?php echo esc_attr( $state ); ?>">
     285                                        <?php wp_nonce_field( 'independence_hub_approve_' . $state ); ?>
     286                                        <fieldset aria-describedby="ihc-selection-help">
     287                                                <legend><?php esc_html_e( 'Analytics plugins', 'independence-hub-connector' ); ?></legend>
     288                                                <p id="ihc-selection-help" class="description"><?php esc_html_e( 'Select one or more active plugins. You can switch between their reports in the Hub; traffic for this site is never counted twice.', 'independence-hub-connector' ); ?></p>
     289                                                <?php if ( $available_sources ) : ?>
     290                                                <div class="ihc-source-choices">
     291                                                <?php foreach ( $available_sources as $source => $label ) : ?>
     292                                                        <label class="ihc-source-choice">
     293                                                                <input type="checkbox" name="sources[]" value="<?php echo esc_attr( $source ); ?>" <?php checked( in_array( $source, $existing_sources, true ) || empty( $existing_sources ) ); ?>>
     294                                                                <span class="ihc-source-copy"><strong><?php echo esc_html( $label ); ?></strong><span><?php echo esc_html( $source_descriptions[ $source ] ?? '' ); ?></span></span>
     295                                                                <?php if ( in_array( $source, $existing_sources, true ) ) : ?><span class="ihc-source-approved"><?php esc_html_e( 'Already approved', 'independence-hub-connector' ); ?></span><?php endif; ?>
     296                                                        </label>
     297                                                <?php endforeach; ?>
     298                                                </div>
     299                                                <p class="ihc-selection-note"><?php esc_html_e( 'Existing approvals are selected. Previously revoked plugins stay unselected until you choose them again. To remove an existing approval, use the connector’s settings.', 'independence-hub-connector' ); ?></p>
     300                                                <?php else : ?>
     301                                                <div class="notice notice-warning inline"><p><?php esc_html_e( 'No supported analytics plugins are active. Activate a supported plugin on this site, then start the connection again from the Hub.', 'independence-hub-connector' ); ?></p></div>
     302                                                <?php endif; ?>
     303                                                <p id="ihc-selection-error" class="ihc-selection-error" role="alert" hidden><?php esc_html_e( 'Select at least one analytics plugin, or cancel to return to the Hub.', 'independence-hub-connector' ); ?></p>
     304                                        </fieldset>
     305                                        <div class="ihc-approval-actions">
     306                                                <button type="submit" name="independence_hub_approve" value="1" class="button button-primary button-hero" <?php disabled( empty( $available_sources ) ); ?>><?php esc_html_e( 'Approve connection', 'independence-hub-connector' ); ?></button>
     307                                                <button type="submit" name="independence_hub_cancel" value="1" formnovalidate class="button button-secondary"><?php esc_html_e( 'Cancel, return to Hub', 'independence-hub-connector' ); ?></button>
     308                                        </div>
     309                                </form>
     310                        </div>
     311                        <aside class="ihc-approval-summary" aria-labelledby="ihc-access-summary">
     312                                <h2 id="ihc-access-summary"><?php esc_html_e( 'What you’re approving', 'independence-hub-connector' ); ?></h2>
     313                                <ul>
     314                                        <li><strong><?php esc_html_e( 'Read-only reports', 'independence-hub-connector' ); ?></strong><span><?php esc_html_e( 'Only aggregate analytics from the plugins you select.', 'independence-hub-connector' ); ?></span></li>
     315                                        <li><strong><?php esc_html_e( 'Your WordPress stays yours', 'independence-hub-connector' ); ?></strong><span><?php esc_html_e( 'No WordPress password is shared. The Hub cannot sign in or change your site.', 'independence-hub-connector' ); ?></span></li>
     316                                        <li><strong><?php esc_html_e( 'You stay in control', 'independence-hub-connector' ); ?></strong><span><?php esc_html_e( 'Revoke a plugin or this account’s access in Settings → Independence Hub Connector.', 'independence-hub-connector' ); ?></span></li>
     317                                </ul>
     318                                <p><?php esc_html_e( 'Approval creates a site-specific token, shared over HTTPS and encrypted in the Hub. WordPress stores only its hash.', 'independence-hub-connector' ); ?></p>
     319                                <a href="https://app.independence-hub.com/privacy" target="_blank" rel="noopener noreferrer"><?php esc_html_e( 'Read the privacy policy (opens in a new tab)', 'independence-hub-connector' ); ?></a>
     320                        </aside>
     321                </div>
    212322        </div>
    213323        <?php
    … …  
    226336        }
    227337        ?>
    228         <div class="wrap">
     338        <div class="wrap ihc-settings">
    229339                <h1><?php esc_html_e( 'Independence Hub Connector', 'independence-hub-connector' ); ?></h1>
    230                 <p><?php esc_html_e( 'Start a connection from Independence Hub. The connector stores token hashes, connected Hub account emails, account identifiers, and approval dates. It stores no analytics data.', 'independence-hub-connector' ); ?></p>
    231                 <h2><?php esc_html_e( 'Data shared after approval', 'independence-hub-connector' ); ?></h2>
    232                 <p><?php esc_html_e( 'The connector shares aggregate Independent Analytics metrics with Independence Hub. Its random connection token is valid only for the connector’s read-only analytics endpoints; it cannot authenticate to WordPress or perform site administration.', 'independence-hub-connector' ); ?></p>
    233                 <p><a href="https://app.independence-hub.com/privacy" target="_blank" rel="noopener noreferrer"><?php esc_html_e( 'Privacy policy', 'independence-hub-connector' ); ?></a> · <a href="https://app.independence-hub.com/terms" target="_blank" rel="noopener noreferrer"><?php esc_html_e( 'Terms of service', 'independence-hub-connector' ); ?></a></p>
    234                 <h2><?php esc_html_e( 'Connection access', 'independence-hub-connector' ); ?></h2>
    235                 <p><?php esc_html_e( 'Each approval creates a separate connection. Disconnecting one account stops its future analytics requests without affecting other accounts. Previously downloaded reports remain in that Hub account.', 'independence-hub-connector' ); ?></p>
     340                <div class="ihc-page-intro">
     341                        <p><?php esc_html_e( 'Manage which Hub accounts can read this site’s analytics.', 'independence-hub-connector' ); ?></p>
     342                        <a class="button button-primary" href="https://app.independence-hub.com/" target="_blank" rel="noopener noreferrer"><?php esc_html_e( 'Open Independence Hub', 'independence-hub-connector' ); ?><span class="screen-reader-text"> <?php esc_html_e( '(opens in a new tab)', 'independence-hub-connector' ); ?></span></a>
     343                </div>
     344                <hr class="wp-header-end">
     345                <div class="ihc-settings-layout">
     346                <section class="ihc-access" aria-labelledby="ihc-access-title">
     347                <h2 id="ihc-access-title"><?php esc_html_e( 'Connected accounts', 'independence-hub-connector' ); ?></h2>
     348                <p class="description"><?php esc_html_e( 'One connection per Hub account. Manage each analytics plugin below, or revoke the account’s entire connection.', 'independence-hub-connector' ); ?></p>
    236349                <?php $connections = independence_hub_connector_connections(); ?>
     350                <?php update_option( INDEPENDENCE_HUB_CONNECTOR_TOKENS_OPTION, $connections, false ); ?>
    237351                <?php if ( $connections ) : ?>
    238                 <table class="widefat striped">
    239                         <thead><tr><th scope="col"><?php esc_html_e( 'Hub account', 'independence-hub-connector' ); ?></th><th scope="col"><?php esc_html_e( 'Approved (UTC)', 'independence-hub-connector' ); ?></th><th scope="col"><?php esc_html_e( 'Access', 'independence-hub-connector' ); ?></th></tr></thead>
    240                         <tbody>
     352                <div class="ihc-connections" aria-label="<?php esc_attr_e( 'Connected Hub accounts', 'independence-hub-connector' ); ?>">
    241353                        <?php foreach ( $connections as $id => $connection ) : ?>
    242                                 <tr><td><?php echo esc_html( $connection['account_email'] ?: __( 'Existing connection — account email unavailable; reconnect from Hub to identify your account.', 'independence-hub-connector' ) ); ?></td>
    243                                 <td><?php echo esc_html( $connection['created_at'] ?: '—' ); ?></td>
    244                                 <td><form method="post" action="<?php echo esc_url( admin_url( 'admin-post.php' ) ); ?>">
     354                                <article class="ihc-connection-card">
     355                                        <header class="ihc-connection-identity">
     356                                                <span class="ihc-eyebrow"><?php esc_html_e( 'Hub account', 'independence-hub-connector' ); ?></span>
     357                                                <h3><?php echo esc_html( $connection['account_email'] ?: __( 'Existing connection', 'independence-hub-connector' ) ); ?></h3>
     358                                                <?php if ( empty( $connection['account_email'] ) ) : ?><p><?php esc_html_e( 'Reconnect from Hub to identify this account.', 'independence-hub-connector' ); ?></p><?php endif; ?>
     359                                                <?php if ( ! empty( $connection['created_at'] ) ) : ?><p class="ihc-approved"><?php
     360                        /* translators: %s: UTC approval date and time. */
     361                        echo esc_html( sprintf( __( 'Approved %s UTC', 'independence-hub-connector' ), $connection['created_at'] ) ); ?></p><?php endif; ?>
     362                                        </header>
     363                                        <section class="ihc-connection-permissions" aria-labelledby="ihc-permissions-<?php echo esc_attr( $id ); ?>">
     364                                                <h4 id="ihc-permissions-<?php echo esc_attr( $id ); ?>"><?php esc_html_e( 'Approved analytics plugins', 'independence-hub-connector' ); ?></h4>
     365                                                <ul class="ihc-plugin-list">
     366                                <?php foreach ( $connection['sources'] ?? array( 'independent-analytics' ) as $source ) : $source_label = array( 'independent-analytics' => 'Independent Analytics', 'wp-statistics' => 'WP Statistics', 'burst-statistics' => 'Burst Statistics', 'koko-analytics' => 'Koko Analytics' )[ $source ] ?? $source; ?>
     367                                                        <li><span class="ihc-plugin-name"><?php echo esc_html( $source_label ); ?></span><form method="post" action="<?php echo esc_url( admin_url( 'admin-post.php' ) ); ?>">
     368                                                <input type="hidden" name="action" value="independence_hub_revoke_source">
     369                                                <input type="hidden" name="connection_id" value="<?php echo esc_attr( $id ); ?>">
     370                                                <input type="hidden" name="source" value="<?php echo esc_attr( $source ); ?>">
     371                                                <?php wp_nonce_field( 'independence_hub_revoke_source_' . $id . '_' . $source ); ?>
     372                                                        <button type="submit" class="button ihc-revoke-source" aria-label="<?php
     373                        /* translators: %s: Analytics plugin name. */
     374                        echo esc_attr( sprintf( __( 'Revoke access to %s', 'independence-hub-connector' ), $source_label ) ); ?>"><?php esc_html_e( 'Revoke', 'independence-hub-connector' ); ?></button>
     375                                                        </form></li>
     376                                <?php endforeach; ?>
     377                                                </ul>
     378                                        </section>
     379                                        <footer class="ihc-connection-actions"><p><?php esc_html_e( 'Revoking a plugin affects only this Hub account. Previously downloaded reports remain in Hub.', 'independence-hub-connector' ); ?></p><form method="post" action="<?php echo esc_url( admin_url( 'admin-post.php' ) ); ?>">
    245380                                        <input type="hidden" name="action" value="independence_hub_revoke_token">
    246381                                        <input type="hidden" name="connection_id" value="<?php echo esc_attr( $id ); ?>">
    247382                                        <?php wp_nonce_field( 'independence_hub_revoke_token_' . $id ); ?>
    248                                         <?php submit_button( __( 'Disconnect', 'independence-hub-connector' ), 'secondary', 'disconnect_' . $id, false ); ?>
    249                                 </form></td></tr>
     383                                        <button type="submit" class="button ihc-revoke-all"><?php esc_html_e( 'Revoke all access', 'independence-hub-connector' ); ?></button>
     384                                        </form></footer>
     385                                </article>
    250386                        <?php endforeach; ?>
    251                         </tbody>
    252                 </table>
     387                </div>
    253388                <?php else : ?>
    254                 <p><?php esc_html_e( 'No Independence Hub accounts are connected.', 'independence-hub-connector' ); ?></p>
     389                <div class="postbox ihc-empty"><h3><?php esc_html_e( 'Connect your first Hub account', 'independence-hub-connector' ); ?></h3><p><?php esc_html_e( 'Open Independence Hub, choose Add site, and enter this site’s URL. You’ll return to WordPress to approve access.', 'independence-hub-connector' ); ?></p></div>
    255390                <?php endif; ?>
     391                </section>
     392                <aside class="ihc-sidebar" aria-label="<?php esc_attr_e( 'Connection information', 'independence-hub-connector' ); ?>">
     393                        <section class="postbox"><h2 class="hndle"><?php esc_html_e( 'Connect another account', 'independence-hub-connector' ); ?></h2><div class="inside"><ol><li><?php esc_html_e( 'Sign in to the Hub account you want to connect.', 'independence-hub-connector' ); ?></li><li><?php esc_html_e( 'Choose Add site and enter this site’s URL.', 'independence-hub-connector' ); ?></li><li><?php esc_html_e( 'Approve the analytics plugins to share in WordPress.', 'independence-hub-connector' ); ?></li></ol></div></section>
     394                        <section class="postbox"><h2 class="hndle"><?php esc_html_e( 'Privacy & access', 'independence-hub-connector' ); ?></h2><div class="inside">
     395                                <p><?php esc_html_e( 'Only aggregate reports from approved analytics plugins are shared with Independence Hub.', 'independence-hub-connector' ); ?></p>
     396                                <p><?php esc_html_e( 'The connection token provides read-only analytics access. It cannot sign in to WordPress or administer this site.', 'independence-hub-connector' ); ?></p>
     397                                <p><?php esc_html_e( 'This connector stores token hashes, Hub account emails and identifiers, approved plugins, and approval dates. It stores no analytics data.', 'independence-hub-connector' ); ?></p>
     398                                <p><a href="https://app.independence-hub.com/privacy" target="_blank" rel="noopener noreferrer"><?php esc_html_e( 'Privacy policy', 'independence-hub-connector' ); ?></a> &middot; <a href="https://app.independence-hub.com/terms" target="_blank" rel="noopener noreferrer"><?php esc_html_e( 'Terms of service', 'independence-hub-connector' ); ?></a></p>
     399                        </div></section>
     400                </aside>
     401                </div>
    256402        </div>
    257403        <?php
    258404}
     405
     406/** Load assets only on connector settings and approval screens. */
     407function independence_hub_connector_settings_styles( $hook_suffix ) {
     408        if ( ! in_array( $hook_suffix, array( 'settings_page_independence-hub-connector', 'admin_page_independence-hub-connector-approve' ), true ) ) {
     409                return;
     410        }
     411        wp_enqueue_style( 'independence-hub-connector-admin', plugins_url( 'assets/admin.css', INDEPENDENCE_HUB_CONNECTOR_FILE ), array(), INDEPENDENCE_HUB_CONNECTOR_VERSION );
     412        if ( 'admin_page_independence-hub-connector-approve' === $hook_suffix ) {
     413                wp_enqueue_script( 'independence-hub-connector-approval', plugins_url( 'assets/approval.js', INDEPENDENCE_HUB_CONNECTOR_FILE ), array(), INDEPENDENCE_HUB_CONNECTOR_VERSION, true );
     414        }
     415}
     416add_action( 'admin_enqueue_scripts', 'independence_hub_connector_settings_styles' );
    259417
    260418/** Revoke the active analytics token from an authenticated site administrator action. */
    … …  
    266424        check_admin_referer( 'independence_hub_revoke_token_' . $id );
    267425        $connections = independence_hub_connector_connections();
     426        if ( ! isset( $connections[ $id ] ) ) {
     427                wp_die( esc_html__( 'This Hub account connection was not found.', 'independence-hub-connector' ), '', array( 'response' => 404 ) );
     428        }
    268429        unset( $connections[ $id ] );
    269         unset( $connections['legacy'] );
    270430        if ( 'legacy' === $id ) {
    271431                delete_option( INDEPENDENCE_HUB_CONNECTOR_TOKEN_OPTION );
    … …  
    276436}
    277437add_action( 'admin_post_independence_hub_revoke_token', 'independence_hub_connector_revoke_token' );
     438
     439/** Remove one approved analytics plugin without disturbing the account's other grants. */
     440function independence_hub_connector_remove_source( &$connections, $id, $source ) {
     441        if ( ! isset( $connections[ $id ] ) || ! is_array( $connections[ $id ] ) ) {
     442                return false;
     443        }
     444        $sources = $connections[ $id ]['sources'] ?? array( 'independent-analytics' );
     445        if ( ! is_array( $sources ) || ! in_array( $source, $sources, true ) ) {
     446                return false;
     447        }
     448        $remaining = array_values( array_diff( $sources, array( $source ) ) );
     449        if ( empty( $remaining ) ) {
     450                unset( $connections[ $id ] );
     451                return true;
     452        }
     453        $connections[ $id ]['sources'] = $remaining;
     454        return true;
     455}
     456
     457/** Revoke one source using an authenticated site administrator action. */
     458function independence_hub_connector_revoke_source() {
     459        if ( ! current_user_can( 'manage_options' ) ) {
     460                wp_die( esc_html__( 'You are not allowed to revoke analytics access.', 'independence-hub-connector' ), '', array( 'response' => 403 ) );
     461        }
     462        $id = isset( $_POST['connection_id'] ) ? sanitize_text_field( wp_unslash( $_POST['connection_id'] ) ) : '';
     463        $source = isset( $_POST['source'] ) ? sanitize_key( wp_unslash( $_POST['source'] ) ) : '';
     464        check_admin_referer( 'independence_hub_revoke_source_' . $id . '_' . $source );
     465        $connections = independence_hub_connector_connections();
     466        if ( ! independence_hub_connector_remove_source( $connections, $id, $source ) ) {
     467                wp_die( esc_html__( 'This analytics plugin access was not found.', 'independence-hub-connector' ), '', array( 'response' => 404 ) );
     468        }
     469        if ( 'legacy' === $id && ! isset( $connections['legacy'] ) ) {
     470                delete_option( INDEPENDENCE_HUB_CONNECTOR_TOKEN_OPTION );
     471        }
     472        update_option( INDEPENDENCE_HUB_CONNECTOR_TOKENS_OPTION, $connections, false );
     473        wp_safe_redirect( add_query_arg( 'independence_hub_revoked', 'source', admin_url( 'options-general.php?page=independence-hub-connector' ) ) );
     474        exit;
     475}
     476add_action( 'admin_post_independence_hub_revoke_source', 'independence_hub_connector_revoke_source' );
    278477
    279478/**
    … …  
    290489add_filter( 'plugin_action_links_' . plugin_basename( INDEPENDENCE_HUB_CONNECTOR_FILE ), 'independence_hub_connector_plugin_action_links' );
    291490
    292 /** Store one independently revocable approval without changing existing tokens. */
    293 function independence_hub_connector_store_connection( $token, $identity ) {
     491/** Store one token per Hub account email, merging newly approved analytics sources. */
     492function independence_hub_connector_store_connection( $token, $identity, $sources = array( 'independent-analytics' ) ) {
    294493        $connections = independence_hub_connector_connections();
    295         unset( $connections['legacy'] );
    296         $connections[ wp_generate_uuid4() ] = array( 'hash' => hash( 'sha256', $token ), 'account_email' => $identity['account_email'], 'account_id' => $identity['account_id'], 'created_at' => gmdate( 'Y-m-d H:i:s' ) );
     494        $email = strtolower( trim( (string) $identity['account_email'] ) );
     495        $id = null;
     496        $approved_sources = array_values( array_unique( array_filter( $sources, 'is_string' ) ) );
     497        foreach ( $connections as $connection_id => $connection ) {
     498                if ( strtolower( trim( (string) ( $connection['account_email'] ?? '' ) ) ) === $email ) {
     499                        $id = $connection_id;
     500                        $approved_sources = array_values( array_unique( array_merge( $connection['sources'] ?? array( 'independent-analytics' ), $approved_sources ) ) );
     501                        break;
     502                }
     503        }
     504        if ( null === $id ) {
     505                $id = wp_generate_uuid4();
     506        }
     507        $connections[ $id ] = array( 'hash' => hash( 'sha256', $token ), 'account_email' => $identity['account_email'], 'account_id' => $identity['account_id'], 'sources' => $approved_sources, 'created_at' => gmdate( 'Y-m-d H:i:s' ) );
    297508        update_option( INDEPENDENCE_HUB_CONNECTOR_TOKENS_OPTION, $connections, false );
    298509}
    … …  
    308519        }
    309520        check_admin_referer( 'independence_hub_approve_' . $state );
     521        if ( ! independence_hub_connector_valid_redirect_uri( $approval['redirect_uri'] ?? '' ) ) {
     522                wp_die( esc_html__( 'The Hub callback is invalid.', 'independence-hub-connector' ), '', array( 'response' => 400 ) );
     523        }
     524        if ( isset( $_POST['independence_hub_cancel'] ) ) {
     525                delete_transient( 'independence_hub_approval_' . hash( 'sha256', $state ) );
     526                nocache_headers();
     527                $return_url = 'iastats.mburnette.com' === wp_parse_url( $approval['redirect_uri'], PHP_URL_HOST ) ? 'https://iastats.mburnette.com/' : 'https://app.independence-hub.com/';
     528                // phpcs:ignore WordPress.Security.SafeRedirect.wp_redirect_wp_redirect -- Only the two literal, allow-listed Hub home URLs above can be used.
     529                wp_redirect( $return_url, 303, 'Independence Hub Connector' );
     530                exit;
     531        }
     532
    310533        $identity = independence_hub_connector_intent_identity( $state );
    311534        if ( is_wp_error( $identity ) ) {
    312535                wp_die( esc_html( $identity->get_error_message() ), '', array( 'response' => 403 ) );
    313536        }
     537    $requested = isset( $_POST['sources'] ) && is_array( $_POST['sources'] ) ? array_map( 'sanitize_key', wp_unslash( $_POST['sources'] ) ) : array();
     538    $sources = array_values( array_intersect( array_keys( independence_hub_connector_available_sources() ), $requested ) );
     539    if ( empty( $sources ) ) {
     540        wp_die( esc_html__( 'Select at least one active analytics plugin. Return to the approval screen to try again.', 'independence-hub-connector' ), '', array( 'response' => 400 ) );
     541    }
    314542        $token = bin2hex( random_bytes( 32 ) );
    315         independence_hub_connector_store_connection( $token, $identity );
     543        independence_hub_connector_store_connection( $token, $identity, $sources );
    316544        delete_transient( 'independence_hub_approval_' . hash( 'sha256', $state ) );
    317545        nocache_headers();
    … …  
    392620 * @return WP_REST_Response|WP_Error
    393621 */
     622/** Mark pre-history buckets as unavailable, retaining genuine zeros after data begins. */
     623function independence_hub_connector_daily_coverage( $series, $has_earlier_data ) {
     624    $started = $has_earlier_data;
     625    foreach ( $series as &$point ) {
     626        foreach ( array( 'views', 'visitors', 'sessions' ) as $metric ) {
     627            if ( isset( $point[ $metric ] ) && $point[ $metric ] > 0 ) { $started = true; }
     628        }
     629        if ( ! $started ) {
     630            $point['views'] = null;
     631            $point['visitors'] = null;
     632            $point['sessions'] = null;
     633        }
     634    }
     635    unset( $point );
     636    return $series;
     637}
     638
     639/** Apply availability consistently to every authorized overview adapter. */
    394640function independence_hub_connector_overview( WP_REST_Request $request ) {
     641    $response = independence_hub_connector_overview_raw( $request );
     642    if ( is_wp_error( $response ) ) { return $response; }
     643    $data = $response->get_data();
     644    try {
     645        $has_earlier_data = false;
     646        foreach ( $data['previous'] as $value ) {
     647            if ( is_numeric( $value ) && $value > 0 ) { $has_earlier_data = true; }
     648        }
     649        if ( ! $has_earlier_data ) {
     650            // Check all retained history, so a quiet preceding period does not
     651            // incorrectly hide real zero-traffic days from an established plugin.
     652            $from = new DateTime( '1970-01-01', wp_timezone() );
     653            $to = ( new DateTime( $data['range']['from'] ) )->setTimezone( wp_timezone() )->modify( '-1 second' );
     654            $source = $request->get_param( 'source' );
     655            if ( 'wp-statistics' === $source ) {
     656                $history = independence_hub_connector_wp_statistics_counts( array( 'from' => '1970-01-01', 'to' => $to->format( 'Y-m-d' ) ) );
     657            } elseif ( 'burst-statistics' === $source ) {
     658                $history = independence_hub_connector_burst_counts( $from, $to );
     659            } elseif ( 'koko-analytics' === $source ) {
     660                $history = independence_hub_connector_koko_counts( new \KokoAnalytics\Stats(), $from, $to );
     661            } else {
     662                $history = independence_hub_connector_query( $from, $to );
     663            }
     664            if ( is_wp_error( $history ) ) { return $history; }
     665            foreach ( array( 'views', 'visitors', 'sessions' ) as $metric ) {
     666                if ( isset( $history[ $metric ] ) && $history[ $metric ] > 0 ) { $has_earlier_data = true; }
     667            }
     668        }
     669        if ( ! array_filter( $data['previous'], static function ( $value ) { return is_numeric( $value ) && $value > 0; } ) ) {
     670            $data['previous'] = array( 'views' => null, 'visitors' => null, 'sessions' => null );
     671        }
     672        $data['series'] = independence_hub_connector_daily_coverage( $data['series'], $has_earlier_data );
     673        if ( '1' === (string) $request->get_param( 'include_previous_series' ) ) {
     674            $prior_to = ( new DateTime( $data['range']['from'] ) )->setTimezone( wp_timezone() )->modify( '-1 second' );
     675            $prior_from = ( new DateTime( $data['range']['from'] ) )->setTimezone( wp_timezone() )->modify( '-' . (int) $request->get_param( 'days' ) . ' days' );
     676            $data['previousSeries'] = independence_hub_connector_prior_series( $request->get_param( 'source' ), $prior_from, $prior_to );
     677        }
     678        $data['dataCoverage'] = 'recorded-history';
     679        $response->set_data( $data );
     680        return $response;
     681    } catch ( Throwable $error ) {
     682        return new WP_Error( 'analytics_coverage_unavailable', __( 'The analytics plugin could not confirm its available history. Please try again.', 'independence-hub-connector' ), array( 'status' => 503 ) );
     683    }
     684}
     685
     686/** Daily prior-period counts use the same source definitions as current charts. */
     687function independence_hub_connector_prior_series( $source, DateTime $from, DateTime $to ) {
     688    global $wpdb;
     689    $date = array( 'from' => $from->format( 'Y-m-d' ), 'to' => $to->format( 'Y-m-d' ) );
     690    $series = array();
     691    if ( 'burst-statistics' === $source ) {
     692        $series = independence_hub_connector_burst_series( $from, $to );
     693    } elseif ( 'koko-analytics' === $source ) {
     694        foreach ( ( new \KokoAnalytics\Stats() )->get_stats( $from, $to, 'day' ) as $row ) {
     695            $series[] = array( 'date' => $row->date, 'views' => (int) $row->pageviews, 'visitors' => (int) $row->visitors, 'sessions' => null );
     696        }
     697    } elseif ( 'wp-statistics' === $source ) {
     698        $views = array(); $visitors = array();
     699        foreach ( ( new \WP_Statistics\Models\ViewsModel() )->countDailyViews( array( 'date' => $date, 'post_type' => array() ) ) as $row ) { $views[ $row->date ] = (int) $row->views; }
     700        foreach ( ( new \WP_Statistics\Models\VisitorsModel() )->countDailyVisitors( array( 'date' => $date ) ) as $row ) { $visitors[ $row->date ] = (int) $row->visitors; }
     701        $table = independence_hub_connector_wp_statistics_table( 'pages' );
     702        // phpcs:ignore WordPress.DB.PreparedSQL.InterpolatedNotPrepared -- Identifier validated above, values prepared.
     703        $dates = array_fill_keys( $wpdb->get_col( $wpdb->prepare( "SELECT DISTINCT date FROM `{$table}` WHERE date BETWEEN %s AND %s", $date['from'], $date['to'] ) ), true );
     704        for ( $cursor = clone $from; $cursor <= $to; $cursor->modify( '+1 day' ) ) {
     705            $day = $cursor->format( 'Y-m-d' );
     706            $series[] = array( 'date' => $day, 'views' => isset( $dates[ $day ] ) ? ( $views[ $day ] ?? 0 ) : null, 'visitors' => isset( $dates[ $day ] ) ? ( $visitors[ $day ] ?? 0 ) : null, 'sessions' => null );
     707        }
     708    } else {
     709        for ( $cursor = clone $from; $cursor <= $to; $cursor->modify( '+1 day' ) ) {
     710            $counts = independence_hub_connector_query( $cursor, ( clone $cursor )->setTime( 23, 59, 59 ) );
     711            if ( is_wp_error( $counts ) ) { throw new RuntimeException( 'Previous daily counts unavailable.' ); }
     712            $series[] = array_merge( array( 'date' => $cursor->format( 'Y-m-d' ) ), $counts );
     713        }
     714    }
     715    if ( $wpdb->last_error ) { throw new RuntimeException( 'Previous daily query failed.' ); }
     716    // Establish coverage before this period, independently of current history.
     717    $epoch = new DateTime( '1970-01-01', wp_timezone() );
     718    $before = ( clone $from )->modify( '-1 second' );
     719    if ( 'wp-statistics' === $source ) { return $series; }
     720    if ( 'burst-statistics' === $source ) { $history = independence_hub_connector_burst_counts( $epoch, $before ); }
     721    elseif ( 'koko-analytics' === $source ) { $history = independence_hub_connector_koko_counts( new \KokoAnalytics\Stats(), $epoch, $before ); }
     722    else { $history = independence_hub_connector_query( $epoch, $before ); }
     723    if ( is_wp_error( $history ) ) { throw new RuntimeException( 'Previous daily history unavailable.' ); }
     724    $earlier = false;
     725    foreach ( array( 'views', 'visitors', 'sessions' ) as $metric ) { if ( isset( $history[ $metric ] ) && $history[ $metric ] > 0 ) { $earlier = true; } }
     726    return independence_hub_connector_daily_coverage( $series, $earlier );
     727}
     728
     729function independence_hub_connector_overview_raw( WP_REST_Request $request ) {
     730    if ( 'koko-analytics' === $request->get_param( 'source' ) ) {
     731        return independence_hub_connector_koko_overview( $request );
     732    }
     733    if ( 'burst-statistics' === $request->get_param( 'source' ) ) {
     734        return independence_hub_connector_burst_overview( $request );
     735    }
     736    if ( 'wp-statistics' === $request->get_param( 'source' ) ) {
     737        return independence_hub_connector_wp_statistics_overview( $request );
     738    }
    395739        $days     = (int) $request->get_param( 'days' );
    396740        $timezone = wp_timezone();
    … …  
    457801 */
    458802function independence_hub_connector_details( WP_REST_Request $request ) {
     803    if ( 'koko-analytics' === $request->get_param( 'source' ) ) {
     804        return independence_hub_connector_koko_details( $request );
     805    }
     806    if ( 'burst-statistics' === $request->get_param( 'source' ) ) {
     807        return independence_hub_connector_burst_details( $request );
     808    }
     809    if ( 'wp-statistics' === $request->get_param( 'source' ) ) {
     810        return independence_hub_connector_wp_statistics_details( $request );
     811    }
    459812        if ( ! function_exists( 'iawp_analytics' ) || ! class_exists( '\\IAWP\\Date_Range\\Exact_Date_Range' ) ) {
    460813                return new WP_Error( 'independent_analytics_unavailable', __( 'Update Independent Analytics before loading this site report.', 'independence-hub-connector' ), array( 'status' => 503 ) );
    … …  
    532885        );
    533886}
     887
     888require_once __DIR__ . '/includes/analytics-sources.php';
     889
     890require_once __DIR__ . '/includes/burst-statistics.php';
     891
     892require_once __DIR__ . '/includes/koko-analytics.php';
  • independence-hub-connector/tags/1.11.4/languages/independence-hub-connector.pot

    r3717788 r3780659  
     1# Copyright (C) 2026 Marcus Burnette
     2# This file is distributed under the GPL-2.0-or-later.
    13msgid ""
    24msgstr ""
    3 "Project-Id-Version: Independence Hub Connector 1.5.0\n"
    4 "POT-Creation-Date: 2026-09-13 00:00+0000\n"
     5"Project-Id-Version: Independence Hub Connector 1.11.1\n"
     6"Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/independence-hub-connector\n"
     7"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
     8"Language-Team: LANGUAGE <LL@li.org>\n"
    59"MIME-Version: 1.0\n"
    610"Content-Type: text/plain; charset=UTF-8\n"
    711"Content-Transfer-Encoding: 8bit\n"
     12"POT-Creation-Date: 2026-11-02T19:50:03+00:00\n"
     13"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
     14"X-Generator: WP-CLI 2.12.0\n"
    815"X-Domain: independence-hub-connector\n"
    916
     17#. Plugin Name of the plugin
     18#: independence-hub-connector.php
     19#: independence-hub-connector.php:326
     20#: independence-hub-connector.php:339
     21#: independence-hub-connector.php:588
     22msgid "Independence Hub Connector"
     23msgstr ""
     24
     25#. Description of the plugin
     26#: independence-hub-connector.php
     27msgid "Securely shares read-only WordPress analytics metrics with Independence Hub."
     28msgstr ""
     29
     30#. Author of the plugin
     31#: independence-hub-connector.php
     32msgid "Marcus Burnette"
     33msgstr ""
     34
     35#: includes/analytics-sources.php:30
     36#: independence-hub-connector.php:166
     37msgid "A valid Independence Hub connection token is required."
     38msgstr ""
     39
     40#: includes/analytics-sources.php:35
     41msgid "WP Statistics must be active and up to date to read this source."
     42msgstr ""
     43
     44#: includes/analytics-sources.php:82
     45msgid "WP Statistics counts daily visitors; totals may differ from other analytics plugins."
     46msgstr ""
     47
     48#: includes/analytics-sources.php:85
     49msgid "WP Statistics could not return this date range. Check that its database is up to date."
     50msgstr ""
     51
     52#: includes/analytics-sources.php:144
     53msgid "WP Statistics measures single-page daily visits, rather than 30-minute sessions."
     54msgstr ""
     55
     56#: includes/analytics-sources.php:144
     57msgid "WP Statistics counts daily visitors."
     58msgstr ""
     59
     60#: includes/analytics-sources.php:147
     61msgid "WP Statistics could not return this report. Check that its database is up to date."
     62msgstr ""
     63
     64#: includes/burst-statistics.php:89
     65msgid "Burst Statistics could not return this report. Keep Burst 3.7.4 or newer active and finish any pending database updates."
     66msgstr ""
     67
     68#: includes/burst-statistics.php:115
     69msgid "Unknown page"
     70msgstr ""
     71
     72#: includes/burst-statistics.php:156
     73msgid "Direct / unknown"
     74msgstr ""
     75
     76#: includes/burst-statistics.php:158
     77msgid "Unknown"
     78msgstr ""
     79
     80#: includes/burst-statistics.php:159
     81msgid "Burst reports its own visitor identities and session-start totals. Daily sessions count sessions with page views that day. Duration uses recorded page time per session; bounce rate uses Burst’s bounce flag. New and returning sessions use the recorded first-visit flag."
     82msgstr ""
     83
     84#: includes/koko-analytics.php:8
     85msgid "Koko Analytics 2.5.3 or newer must be active to read this source."
     86msgstr ""
     87
     88#: includes/koko-analytics.php:12
     89msgid "Update Koko Analytics to read this report."
     90msgstr ""
     91
     92#: includes/koko-analytics.php:30
     93msgid "Koko Analytics totals sum its recorded visitor counts across the selected dates; tracking settings can affect these counts."
     94msgstr ""
     95
     96#: includes/koko-analytics.php:31
     97msgid "This integration reads Koko Analytics Free reports. Sessions, duration, bounce rate, new/returning sessions, countries, and devices are not tracked by this integration."
     98msgstr ""
     99
     100#: includes/koko-analytics.php:58
     101msgid "Koko Analytics could not return this date range. Check that its database is up to date."
     102msgstr ""
     103
     104#: includes/koko-analytics.php:92
     105msgid "Koko Analytics could not return this report. Check that its database is up to date."
     106msgstr ""
     107
     108#: independence-hub-connector.php:159
     109msgid "Access to this analytics plugin has not been approved for this Hub account."
     110msgstr ""
     111
     112#: independence-hub-connector.php:198
     113msgid "The connection request is invalid."
     114msgstr ""
     115
     116#: independence-hub-connector.php:221
     117msgid "The Hub account could not be verified. Return to Independence Hub and start again."
     118msgstr ""
     119
     120#: independence-hub-connector.php:235
     121msgid "This Independence Hub connection request is invalid."
     122msgstr ""
     123
     124#: independence-hub-connector.php:242
     125#: independence-hub-connector.php:522
     126msgid "The Hub callback is invalid."
     127msgstr ""
     128
     129#: independence-hub-connector.php:252
     130msgid "This Independence Hub connection request has expired."
     131msgstr ""
     132
     133#: independence-hub-connector.php:265
     134msgid "Page views, visitors, sessions, and detailed traffic reports."
     135msgstr ""
     136
     137#: independence-hub-connector.php:266
     138msgid "Page views, daily visitors, and traffic breakdowns."
     139msgstr ""
     140
     141#: independence-hub-connector.php:267
     142msgid "Page views, visitors, sessions, and engagement reports."
     143msgstr ""
     144
     145#: independence-hub-connector.php:268
     146msgid "Page views, visitors, top pages, and referrers."
     147msgstr ""
     148
     149#: independence-hub-connector.php:273
     150#: independence-hub-connector.php:327
     151msgid "Connect Independence Hub"
     152msgstr ""
     153
     154#: independence-hub-connector.php:274
     155msgid "Choose the analytics you want to see in your Hub."
     156msgstr ""
     157
     158#: independence-hub-connector.php:278
     159msgid "Connecting to Hub account"
     160msgstr ""
     161
     162#: independence-hub-connector.php:287
     163msgid "Analytics plugins"
     164msgstr ""
     165
     166#: independence-hub-connector.php:288
     167msgid "Select one or more active plugins. You can switch between their reports in the Hub; traffic for this site is never counted twice."
     168msgstr ""
     169
     170#: independence-hub-connector.php:295
     171msgid "Already approved"
     172msgstr ""
     173
     174#: independence-hub-connector.php:299
     175msgid "Existing approvals are selected. Previously revoked plugins stay unselected until you choose them again. To remove an existing approval, use the connector’s settings."
     176msgstr ""
     177
     178#: independence-hub-connector.php:301
     179msgid "No supported analytics plugins are active. Activate a supported plugin on this site, then start the connection again from the Hub."
     180msgstr ""
     181
     182#: independence-hub-connector.php:303
     183msgid "Select at least one analytics plugin, or cancel to return to the Hub."
     184msgstr ""
     185
     186#: independence-hub-connector.php:306
     187msgid "Approve connection"
     188msgstr ""
     189
     190#: independence-hub-connector.php:307
     191msgid "Cancel, return to Hub"
     192msgstr ""
     193
     194#: independence-hub-connector.php:312
     195msgid "What you’re approving"
     196msgstr ""
     197
     198#: independence-hub-connector.php:314
     199msgid "Read-only reports"
     200msgstr ""
     201
     202#: independence-hub-connector.php:314
     203msgid "Only aggregate analytics from the plugins you select."
     204msgstr ""
     205
     206#: independence-hub-connector.php:315
     207msgid "Your WordPress stays yours"
     208msgstr ""
     209
     210#: independence-hub-connector.php:315
     211msgid "No WordPress password is shared. The Hub cannot sign in or change your site."
     212msgstr ""
     213
     214#: independence-hub-connector.php:316
     215msgid "You stay in control"
     216msgstr ""
     217
     218#: independence-hub-connector.php:316
     219msgid "Revoke a plugin or this account’s access in Settings → Independence Hub Connector."
     220msgstr ""
     221
     222#: independence-hub-connector.php:318
     223msgid "Approval creates a site-specific token, shared over HTTPS and encrypted in the Hub. WordPress stores only its hash."
     224msgstr ""
     225
     226#: independence-hub-connector.php:319
     227msgid "Read the privacy policy (opens in a new tab)"
     228msgstr ""
     229
     230#: independence-hub-connector.php:341
     231msgid "Manage which Hub accounts can read this site’s analytics."
     232msgstr ""
     233
     234#: independence-hub-connector.php:342
     235msgid "Open Independence Hub"
     236msgstr ""
     237
     238#: independence-hub-connector.php:342
     239msgid "(opens in a new tab)"
     240msgstr ""
     241
     242#: independence-hub-connector.php:347
     243msgid "Connected accounts"
     244msgstr ""
     245
     246#: independence-hub-connector.php:348
     247msgid "One connection per Hub account. Manage each analytics plugin below, or revoke the account’s entire connection."
     248msgstr ""
     249
     250#: independence-hub-connector.php:352
     251msgid "Connected Hub accounts"
     252msgstr ""
     253
     254#: independence-hub-connector.php:356
     255msgid "Hub account"
     256msgstr ""
     257
     258#: independence-hub-connector.php:357
     259msgid "Existing connection"
     260msgstr ""
     261
     262#: independence-hub-connector.php:358
     263msgid "Reconnect from Hub to identify this account."
     264msgstr ""
     265
     266#. translators: %s: UTC approval date and time.
     267#: independence-hub-connector.php:361
     268#, php-format
     269msgid "Approved %s UTC"
     270msgstr ""
     271
     272#: independence-hub-connector.php:364
     273msgid "Approved analytics plugins"
     274msgstr ""
     275
     276#. translators: %s: Analytics plugin name.
     277#: independence-hub-connector.php:374
     278#, php-format
     279msgid "Revoke access to %s"
     280msgstr ""
     281
     282#. translators: %s: Analytics plugin name.
     283#: independence-hub-connector.php:374
     284msgid "Revoke"
     285msgstr ""
     286
     287#: independence-hub-connector.php:379
     288msgid "Revoking a plugin affects only this Hub account. Previously downloaded reports remain in Hub."
     289msgstr ""
     290
     291#: independence-hub-connector.php:383
     292msgid "Revoke all access"
     293msgstr ""
     294
     295#: independence-hub-connector.php:389
     296msgid "Connect your first Hub account"
     297msgstr ""
     298
     299#: independence-hub-connector.php:389
     300msgid "Open Independence Hub, choose Add site, and enter this site’s URL. You’ll return to WordPress to approve access."
     301msgstr ""
     302
     303#: independence-hub-connector.php:392
     304msgid "Connection information"
     305msgstr ""
     306
     307#: independence-hub-connector.php:393
     308msgid "Connect another account"
     309msgstr ""
     310
     311#: independence-hub-connector.php:393
     312msgid "Sign in to the Hub account you want to connect."
     313msgstr ""
     314
     315#: independence-hub-connector.php:393
     316msgid "Choose Add site and enter this site’s URL."
     317msgstr ""
     318
     319#: independence-hub-connector.php:393
     320msgid "Approve the analytics plugins to share in WordPress."
     321msgstr ""
     322
     323#: independence-hub-connector.php:394
     324msgid "Privacy & access"
     325msgstr ""
     326
     327#: independence-hub-connector.php:395
     328msgid "Only aggregate reports from approved analytics plugins are shared with Independence Hub."
     329msgstr ""
     330
     331#: independence-hub-connector.php:396
     332msgid "The connection token provides read-only analytics access. It cannot sign in to WordPress or administer this site."
     333msgstr ""
     334
     335#: independence-hub-connector.php:397
     336msgid "This connector stores token hashes, Hub account emails and identifiers, approved plugins, and approval dates. It stores no analytics data."
     337msgstr ""
     338
     339#: independence-hub-connector.php:398
     340msgid "Privacy policy"
     341msgstr ""
     342
     343#: independence-hub-connector.php:398
     344msgid "Terms of service"
     345msgstr ""
     346
     347#: independence-hub-connector.php:421
     348msgid "You are not allowed to revoke this connection."
     349msgstr ""
     350
     351#: independence-hub-connector.php:427
     352msgid "This Hub account connection was not found."
     353msgstr ""
     354
     355#: independence-hub-connector.php:460
     356msgid "You are not allowed to revoke analytics access."
     357msgstr ""
     358
     359#: independence-hub-connector.php:467
     360msgid "This analytics plugin access was not found."
     361msgstr ""
     362
     363#: independence-hub-connector.php:486
     364msgid "Settings"
     365msgstr ""
     366
     367#: independence-hub-connector.php:518
     368msgid "This Independence Hub connection request has expired. Return to Independence Hub and start again."
     369msgstr ""
     370
     371#: independence-hub-connector.php:518
     372msgid "Connection unavailable"
     373msgstr ""
     374
     375#: independence-hub-connector.php:540
     376msgid "Select at least one active analytics plugin. Return to the approval screen to try again."
     377msgstr ""
     378
     379#: independence-hub-connector.php:560
     380msgid "Completing Independence Hub connection"
     381msgstr ""
     382
     383#: independence-hub-connector.php:567
     384msgid "Completing your secure Independence Hub connection…"
     385msgstr ""
     386
     387#: independence-hub-connector.php:568
     388msgid "Continue to Independence Hub"
     389msgstr ""
     390
     391#: independence-hub-connector.php:585
     392msgid "When a site administrator approves a connection, Independence Hub Connector sends the site URL and a random site-specific token to Independence Hub over HTTPS. The token can access only the connector’s read-only aggregate analytics endpoints and cannot authenticate to WordPress or perform site administration. An administrator can revoke it from the connector settings screen."
     393msgstr ""
     394
     395#: independence-hub-connector.php:586
     396msgid "The connector verifies the requesting account with Independence Hub over HTTPS and stores its email address, account identifier, approval date, and token hash to let administrators manage each connection independently."
     397msgstr ""
     398
     399#: independence-hub-connector.php:587
     400msgid "Read the Independence Hub privacy policy."
     401msgstr ""
     402
     403#: independence-hub-connector.php:601
    10404msgid "Independent Analytics must be active before this site can be connected."
    11405msgstr ""
    12406
     407#: independence-hub-connector.php:612
    13408msgid "Independent Analytics could not return this date range."
    14409msgstr ""
     410
     411#: independence-hub-connector.php:706
     412msgid "Update Independent Analytics before loading this site report."
     413msgstr ""
     414
     415#: independence-hub-connector.php:746
     416msgid "Independent Analytics could not create this detailed report. Update the connector and Independent Analytics, then try again."
     417msgstr ""
     418
     419#: independence-hub-connector.php:768
     420msgid "Independent Analytics could not retrieve the detailed metrics."
     421msgstr ""
  • independence-hub-connector/tags/1.11.4/readme.txt

    r3726911 r3780659  
    11=== Independence Hub Connector ===
    22Contributors: mdburnette
    3 Tags: analytics, independent analytics, website traffic, reports, dashboard
     3Tags: analytics, independent analytics, wp statistics, reports, dashboard
    44Requires at least: 6.5
    55Tested up to: 7.1
    66Requires PHP: 8.0
    7 Stable tag: 1.7.0
     7Stable tag: 1.11.4
    88License: GPLv2 or later
    99License URI: https://www.gnu.org/licenses/gpl-2.0.html
    1010
    11 Connect separate WordPress sites running Independent Analytics to one private, read-only Hub dashboard.
     11Connect WordPress analytics from Independent Analytics, WP Statistics, Burst Statistics, or Koko Analytics in one private dashboard.
    1212
    1313== Description ==
    1414
    15 **Every site. One clear pulse.** If you manage several WordPress sites that each run [Independent Analytics](https://wordpress.org/plugins/independent-analytics/), install Independence Hub Connector on each site to bring their traffic into one calm dashboard. See which sites are growing, spot changes worth investigating, and prepare a portfolio report without opening each WordPress admin.
    16 
    17 Independence Hub Connector is the bridge between one WordPress site and the hosted Hub. A WordPress administrator approves each connection on their own site. The connector then gives the Hub read-only access to supported aggregate Independent Analytics reports through a revocable, site-specific token. No WordPress password or Application Password is shared.
     15**Your WordPress analytics. One clear view.** If you manage several WordPress sites that run [Independent Analytics](https://wordpress.org/plugins/independent-analytics/), [WP Statistics](https://wordpress.org/plugins/wp-statistics/), [Burst Statistics](https://wordpress.org/plugins/burst-statistics/), or [Koko Analytics](https://wordpress.org/plugins/koko-analytics/), install Independence Hub Connector on each site to bring their reports into one private dashboard. See which sites are growing, spot changes worth investigating, and prepare a portfolio report without opening each WordPress admin.
     16
     17Independence Hub Connector is the bridge between one WordPress site and the hosted Hub. A WordPress administrator approves each connection on their own site. The connector then gives the Hub read-only access to supported aggregate reports from the analytics plugins selected during approval through a revocable, site-specific token. No WordPress password or Application Password is shared.
    1818
    1919**In the Independence Hub dashboard**
    2020
    21 * Compare page views, visitors, sessions, and daily traffic across the WordPress sites you connect.
     21* Compare page views, visitors, daily traffic, and sessions where tracked across the WordPress sites you connect.
    2222* Open a site report to explore top pages, sources, locations, devices, and session metrics.
    2323* Group sites by client or portfolio, then include or exclude a group from views and reports.
    2424* Review portfolio Insights and choose the sites and sections for a printable report.
     25* Save traffic watchlist rules and rolling page-view, visitor, or session targets in the hosted Hub. Rules are checked when you open or refresh the Growth workspace. Optionally enable hourly background checks and email alerts to your verified Hub account email; email alerts are off by default.
     26* Record launches and campaigns in a private Hub impact journal, with seven-day before/after page-view comparisons when complete data is available within the last 90 days.
    2527
    2628The dashboard is a separate hosted service. [Create your Hub account](https://app.independence-hub.com/) to connect sites and view reports. Custom printable reports require the Hub's Unlimited plan.
    … …  
    2931
    3032* A guided connection approved by a WordPress administrator on the site itself.
    31 * A read-only connection to Independent Analytics data for the Independence Hub dashboard.
    32 * Overview reporting for page views, visitors, sessions, daily totals, and comparisons with the immediately preceding period.
    33 * Detailed reports with top pages, geographic traffic, device types, traffic sources, new and returning sessions, average session duration, and bounce rate.
     33* A read-only connection to approved Independent Analytics, WP Statistics, Burst Statistics, and Koko Analytics data for the Independence Hub dashboard.
     34* Overview reporting for page views, visitors, daily totals, sessions where tracked, and comparisons with the immediately preceding period.
     35* Detailed reports with top pages, geographic traffic, device types, traffic sources, and bounce rate. Independent Analytics and Burst Statistics also provide sessions, new and returning sessions, and average session duration; WP Statistics shows "Not tracked by this plugin" for those session metrics. Koko Analytics Free 2.5.3 provides page views, visitors, daily traffic, top pages, and referrers; sessions, duration, bounce rate, new/returning sessions, countries, and devices are labeled "Not tracked by this plugin". Koko Pro-specific reports are not included.
     36* Multiple approved analytics plugins per site, with a dashboard selector to view one plugin at a time. Each site counts once toward plan limits and portfolio totals.
     37* Source-specific comparisons, caches, reports, and saved Growth items; switching dashboard data does not change a saved rule’s analytics plugin.
    3438* Reporting ranges of 7, 28, 30, or 90 days.
    35 * Separate tokens for multiple Hub accounts connected to the same site, with account emails and individual Disconnect controls in Settings → Independence Hub Connector.
     39* One connection per Hub account email, with individual analytics-plugin revocation and a revoke-all control in Settings → Independence Hub Connector.
    3640
    3741**Before you connect**
    3842
    3943* This plugin is a connector, not an analytics dashboard. Create an account at https://app.independence-hub.com/ to view reports from the sites you connect.
    40 * Independent Analytics is a separate plugin and must already be installed and active on each site you connect. This connector does not install it or add tracking code.
     44* Independent Analytics, WP Statistics, Burst Statistics, and Koko Analytics are separate analytics plugins. At least one must already be installed and active on each site you connect. This connector does not install it or add tracking code.
    4145* It does not provide visitor-level records, change analytics settings, or let Independence Hub administer your WordPress site.
    4246* It does not share a WordPress password or Application Password. Its token can access only this connector’s read-only analytics endpoints; it cannot sign in to WordPress or access other WordPress APIs.
    … …  
    4448**Privacy and security**
    4549
    46 The connector reads analytics already collected by Independent Analytics. It sends the site URL and a random, site-specific token to Independence Hub over HTTPS only when an administrator approves a connection. The Hub uses the token to request the supported aggregate reports; it encrypts the token at rest. WordPress stores token hashes alongside connected Hub account emails, account identifiers, and approval dates. The connector verifies account identity with Hub over HTTPS before approval. Revoke access at any time from Settings → Independence Hub Connector. Review the [Independence Hub privacy policy](https://app.independence-hub.com/privacy) and [terms of service](https://app.independence-hub.com/terms) before connecting.
     50The connector reads analytics already collected by the selected analytics plugins. It sends the site URL and a random, site-specific token to Independence Hub over HTTPS only when an administrator approves a connection. The Hub uses the token to request the supported aggregate reports; it encrypts the token at rest. WordPress stores token hashes alongside connected Hub account emails, account identifiers, approved analytics plugins, and approval dates. The connector verifies account identity with Hub over HTTPS before approval. Revoke access at any time from Settings → Independence Hub Connector. Review the [Independence Hub privacy policy](https://app.independence-hub.com/privacy) and [terms of service](https://app.independence-hub.com/terms) before connecting.
    4751
    4852== Installation ==
    … …  
    51552. Enter one WordPress site URL. If needed, use the WordPress.org installer link to install and activate Independence Hub Connector on that site. You can also install it from Plugins → Add New.
    52563. Return to the Hub tab and choose “Step 2: Connect this site.”
    53 4. Sign in to WordPress if prompted and approve the connection. You’ll return to Independence Hub when it’s connected.
    54 5. Make sure Independent Analytics is installed and active to view reports.
     574. Sign in to WordPress if prompted, review the Hub account and plugins, and approve the connection. You’ll return to Independence Hub when it’s connected. Choose “Cancel, return to Hub” to leave without changing existing permissions.
     585. Make sure a selected analytics plugin is installed and active to view reports.
    5559
    5660If your host does not allow installing from the WordPress.org directory, download the plugin ZIP from the plugin page and install it through Plugins → Add New → Upload Plugin.
    … …  
    6468= What analytics data can Independence Hub access? =
    6569
    66 The connector provides aggregate page views, visitors, sessions, daily totals, and comparison totals, plus detailed report summaries for pages, geography, devices, sources, and session metrics. Reports are available for 7, 28, 30, or 90 days. The connector does not expose visitor-level records.
     70The connector provides aggregate page views, visitors, sessions, daily totals, and comparison totals, plus detailed report summaries for pages, geography, devices, sources, and session metrics. Reports are available for 7, 28, 30, or 90 days. Availability depends on the approved analytics plugin; Koko Free supplies page views, visitors, pages, and referrers. Unsupported reports show "Not tracked by this plugin". The connector does not expose visitor-level records.
    6771
    6872= Does the plugin collect or send personal data? =
    6973
    70 The connector does not add tracking or collect new visitor-level data. After an administrator approves a connection, it sends the site URL and a random, site-specific token to Independence Hub over HTTPS. The Hub then requests the supported analytics reports. WordPress stores the token hash, connected Hub account email, account identifier, and approval date; the Hub encrypts the token at rest. See the service’s privacy policy for details.
     74The connector does not add tracking or collect new visitor-level data. After an administrator approves a connection, it sends the site URL and a random, site-specific token to Independence Hub over HTTPS. The Hub then requests the supported analytics reports. WordPress stores the token hash, connected Hub account email, account identifier, approved analytics plugins, and approval date; the Hub encrypts the token at rest. See the service’s privacy policy for details.
    7175
    7276= Can Independence Hub administer my WordPress site? =
    … …  
    7680= How do I disconnect a site? =
    7781
    78 In WordPress, go to Settings → Independence Hub Connector and choose Disconnect beside the account you want to revoke. Other accounts keep their access. Existing downloaded reports are not deleted. You can also remove the site from your Independence Hub account. Uninstalling the connector removes its local token hashes and account connection records; it does not delete Independent Analytics data.
     82In WordPress, go to Settings → Independence Hub Connector. Choose Revoke beside an analytics plugin to remove only that plugin's access, or choose Revoke all access for the Hub account. Other accounts keep their access. Existing downloaded reports are not deleted. You can also remove the site from your Independence Hub account. Uninstalling the connector removes its local token hashes and account connection records; it does not delete analytics data.
    7983
    8084= What happens if I uninstall the connector? =
    8185
    82 Uninstalling removes the connector’s local token hashes and account connection records, preventing future requests with those tokens. It does not uninstall Independent Analytics or delete its analytics data.
     86Uninstalling removes the connector’s local token hashes and account connection records, preventing future requests with those tokens. It does not uninstall analytics plugins or delete their data.
    8387
    8488= Can multiple Hub accounts connect to the same site? =
    8589
    86 Yes. Start a connection from each Hub account and approve it in WordPress. Each approval creates its own token; the settings page lists the account email and approval date with a Disconnect button. Older connections remain active after updating, but cannot show an email until you reconnect because earlier versions did not store account identity. Each approval is listed separately, including repeat approvals for the same account.
     90Yes. Start a connection from each Hub account and approve it in WordPress. Each Hub account email has one connection on the site; approving again reuses that account entry, updates its token, and adds any newly approved analytics plugins without removing existing access. Older connections remain active after updating, but cannot show an email until you reconnect because earlier versions did not store account identity. The settings page lets you revoke an individual analytics plugin or revoke all access for one Hub account without affecting other accounts.
     91
     92= Can I use multiple analytics plugins on the same site? =
     93
     94Yes. Select one or more active supported plugins during WordPress approval with Connector 1.9.0 or newer. Use the Analytics plugin selector on the Hub site card to switch reports. Manage analytics plugins on an existing site to change your selection. Traffic from different plugins on the same site is never added together. WP Statistics counts visitors by day and measures single-page daily visits for its bounce rate; definitions and totals can differ from Independent Analytics. Sessions and session-based metrics are not tracked by WP Statistics. Burst Statistics Free 3.7.4 supports page views, visitors, sessions, engagement, and page/country/device/referrer reports. Burst duration uses recorded page time per session; its new/returning split uses session first-visit flags. Its period sessions follow session-start counting, while daily session points count sessions with page views that day. Koko Analytics support requires Connector 1.11.0 and Koko Analytics 2.5.3 or newer. Koko visitors use its own recorded counts and tracking settings; totals sum the stored counts across the chosen dates. Existing connections must approve Koko through Manage analytics plugins. Koko Free does not supply session, country, or device metrics to the Hub, even if Koko Pro is installed. Saved Growth rules, targets, and journal events keep their selected plugin.
    8795
    8896== Changelog ==
     97
     98= 1.11.4 (2026-11-02) =
     99
     100* Add daily comparison-period reports so Hub Average calculates percentage changes using matching daily averages.
     101
     102= 1.11.3 (2026-11-02) =
     103
     104* Fix WP Statistics daily availability when older historical totals exist without daily records in the requested range.
     105
     106= 1.11.2 (2026-11-02) =
     107
     108* Fix daily reports to return null before the first retained analytics activity while preserving zero-traffic days within recorded history.
     109
     110= 1.11.1 (2026-11-02) =
     111
     112* Add a clearer WordPress approval screen with account details, selectable plugin cards, and a concise access summary.
     113* Add a nonce-protected Cancel, return to Hub action that preserves existing analytics permissions.
     114* Fix empty plugin selection feedback before submitting the approval form.
     115
     116= 1.11.0 (2026-11-02) =
     117
     118* Add Koko Analytics Free support for page views, visitors, daily traffic, top pages, referrers, and preceding-period comparisons.
     119* Add source-scoped Koko approval and revocation while preserving existing sites and account connections.
     120* Fix translator context for approval dates and analytics-plugin revocation controls.
     121* Document unsupported Koko metrics and the Free 2.5.3 compatibility baseline.
     122
     123= 1.10.2 (2026-11-02) =
     124
     125* Refactor the settings page with native WordPress panels, concise setup guidance, and a dedicated privacy section.
     126
     127= 1.10.1 (2026-11-02) =
     128* Improve the connector settings layout with responsive account cards and clearer revocation actions.
     129
     130= 1.10.0 (2026-11-02) =
     131
     132* Add one connection per Hub account email and merge plugin approvals when that account reconnects.
     133* Add individual analytics-plugin revocation alongside a per-account revoke-all action.
     134
     135= 1.9.0 (2026-11-02) =
     136
     137* Add Burst Statistics Free aggregate reports with per-token approval, sessions, engagement, top pages, countries, devices, and referrers.
     138* Add daily Burst charts with site-timezone calendar boundaries across daylight-saving changes.
     139* Document Burst metric definitions and source selection across Hub reports, Insights, and Growth tools.
     140
     141= 1.8.0 (2026-11-02) =
     142
     143* Add WP Statistics aggregate reports alongside Independent Analytics with per-token plugin approval.
     144* Add multiple analytics plugins per site and a dashboard selector with separate caches, comparisons, reports, and Growth items.
     145* Add explicit "Not tracked by this plugin" labels for unsupported metrics and explain differences in visitor and bounce-rate definitions.
     146* Document supported analytics plugins, onboarding, privacy, and source selection.
     147* Refactor marketing copy around one dashboard for supported WordPress analytics plugins.
    89148
    90149= 1.7.0 (2026-10-03) =
    … …  
    159218== Affiliation ==
    160219
    161 Independence Hub Connector is an independent third-party project. It is not affiliated with, endorsed by, or sponsored by Independent Analytics or its developers. Independent Analytics is a separate plugin; its name is used only to identify the software this connector works with.
     220Independence Hub Connector is an independent third-party project. It is not affiliated with, endorsed by, or sponsored by Independent Analytics, WP Statistics, Burst Statistics, or their developers. These are separate plugins; their names identify compatible software.
  • independence-hub-connector/trunk/independence-hub-connector.php

    r3726911 r3780659  
    22/**
    33 * Plugin Name: Independence Hub Connector
    4  * Description: Securely shares read-only Independent Analytics metrics with Independence Hub.
    5  * Version: 1.7.0
     4 * Description: Securely shares read-only WordPress analytics metrics with Independence Hub.
     5 * Version: 1.11.4
    66 * Requires at least: 6.5
    77 * Requires PHP: 8.0
    … …  
    1515defined( 'ABSPATH' ) || exit;
    1616
    17 define( 'INDEPENDENCE_HUB_CONNECTOR_VERSION', '1.7.0' );
     17define( 'INDEPENDENCE_HUB_CONNECTOR_VERSION', '1.11.4' );
    1818define( 'INDEPENDENCE_HUB_CONNECTOR_FILE', __FILE__ );
    1919define( 'INDEPENDENCE_HUB_CONNECTOR_TOKEN_OPTION', 'independence_hub_connector_token_hash' );
    … …  
    2828                $connections['legacy'] = array( 'hash' => $legacy, 'account_email' => '', 'created_at' => '' );
    2929        }
    30         return $connections;
     30        return independence_hub_connector_normalize_connections( $connections );
     31}
     32
     33/** Merge repeated approvals for the same Hub email, retaining the newest token. */
     34function independence_hub_connector_normalize_connections( $connections ) {
     35        $normalized = array();
     36        $account_keys = array();
     37        foreach ( $connections as $id => $connection ) {
     38                if ( ! is_array( $connection ) ) {
     39                        continue;
     40                }
     41                $email = strtolower( trim( (string) ( $connection['account_email'] ?? '' ) ) );
     42                $key   = $email ? 'email:' . $email : 'connection:' . (string) $id;
     43                $sources = isset( $connection['sources'] ) && is_array( $connection['sources'] ) ? $connection['sources'] : array( 'independent-analytics' );
     44                $sources = array_values( array_unique( array_filter( $sources, 'is_string' ) ) );
     45                if ( ! isset( $account_keys[ $key ] ) ) {
     46                        $normalized[ $id ] = array_merge( $connection, array( 'sources' => $sources ) );
     47                        $account_keys[ $key ] = $id;
     48                        continue;
     49                }
     50
     51                $existing_id = $account_keys[ $key ];
     52                $existing = $normalized[ $existing_id ];
     53                $merged_sources = array_values( array_unique( array_merge( $existing['sources'] ?? array(), $sources ) ) );
     54                $existing_date = (string) ( $existing['created_at'] ?? '' );
     55                $current_date  = (string) ( $connection['created_at'] ?? '' );
     56                if ( $current_date >= $existing_date ) {
     57                        unset( $normalized[ $existing_id ] );
     58                        $normalized[ $id ] = array_merge( $connection, array( 'sources' => $merged_sources ) );
     59                        $account_keys[ $key ] = $id;
     60                } else {
     61                        $normalized[ $existing_id ]['sources'] = $merged_sources;
     62                }
     63        }
     64        return $normalized;
    3165}
    3266
    … …  
    3569 */
    3670function independence_hub_connector_register_routes() {
     71        register_rest_route( 'independence-hub/v1', '/sources', array(
     72                'methods' => WP_REST_Server::READABLE,
     73                'callback' => 'independence_hub_connector_sources',
     74                'permission_callback' => 'independence_hub_connector_authorize_analytics_request',
     75        ) );
    3776        register_rest_route(
    3877                'independence-hub/v1',
    … …  
    5796                        'permission_callback' => 'independence_hub_connector_authorize_analytics_request',
    5897                        'args'                => array(
     98                                'source' => array( 'default' => 'independent-analytics', 'validate_callback' => static function ( $value ) { return in_array( $value, array( 'independent-analytics', 'wp-statistics', 'burst-statistics', 'koko-analytics' ), true ); } ),
    5999                                'days' => array(
    60100                                        'default'           => 28,
    … …  
    76116                        'permission_callback' => 'independence_hub_connector_authorize_analytics_request',
    77117                        'args'                => array(
     118                                'source' => array( 'default' => 'independent-analytics', 'validate_callback' => static function ( $value ) { return in_array( $value, array( 'independent-analytics', 'wp-statistics', 'burst-statistics', 'koko-analytics' ), true ); } ),
    78119                                'days' => array(
    79120                                        'default'           => 28,
    … …  
    114155                foreach ( independence_hub_connector_connections() as $connection ) {
    115156                        if ( is_array( $connection ) && isset( $connection['hash'] ) && is_string( $connection['hash'] ) && hash_equals( $connection['hash'], $hash ) ) {
     157                $source = method_exists( $request, 'get_param' ) ? $request->get_param( 'source' ) : null;
     158                if ( $source && ! in_array( $source, $connection['sources'] ?? array( 'independent-analytics' ), true ) ) {
     159                    return new WP_Error( 'source_not_approved', __( 'Access to this analytics plugin has not been approved for this Hub account.', 'independence-hub-connector' ), array( 'status' => 409 ) );
     160                }
    116161                                nocache_headers();
    117162                                return true;
    … …  
    134179                && in_array( $parts['host'] ?? '', array( 'app.independence-hub.com', 'iastats.mburnette.com' ), true )
    135180                && '/api/wordpress/callback' === ( $parts['path'] ?? '' )
     181                && empty( $parts['user'] )
     182                && empty( $parts['pass'] )
     183                && empty( $parts['port'] )
    136184                && empty( $parts['query'] )
    137185                && empty( $parts['fragment'] );
    … …  
    151199        }
    152200
    153         $identity = independence_hub_connector_intent_identity( $state );
    154         if ( is_wp_error( $identity ) ) {
    155                 return $identity;
    156         }
    157 
    158         set_transient(
    159                 'independence_hub_approval_' . hash( 'sha256', $state ),
    160                 array( 'state' => $state, 'redirect_uri' => $redirect_uri, 'account_email' => $identity['account_email'], 'account_id' => $identity['account_id'] ),
    161                 15 * MINUTE_IN_SECONDS
    162         );
    163201        return rest_ensure_response(
    164202                array(
    165203                        'authorization_url' => add_query_arg(
    166                                 array( 'page' => 'independence-hub-connector-approve', 'state' => $state ),
     204                                array( 'page' => 'independence-hub-connector-approve', 'state' => $state, 'redirect_uri' => $redirect_uri ),
    167205                                admin_url( 'admin.php' )
    168206                        ),
    … …  
    192230        // phpcs:ignore WordPress.Security.NonceVerification.Recommended -- The state is matched against a short-lived server-side transient; the approval POST is protected by a nonce below.
    193231        $state    = isset( $_GET['state'] ) ? sanitize_text_field( wp_unslash( $_GET['state'] ) ) : '';
    194         $approval = $state ? get_transient( 'independence_hub_approval_' . hash( 'sha256', $state ) ) : false;
    195         if ( ! current_user_can( 'manage_options' ) || ! is_array( $approval ) || $state !== ( $approval['state'] ?? '' ) ) {
    196                 wp_die( esc_html__( 'This Independence Hub connection request has expired. Return to Independence Hub and start again.', 'independence-hub-connector' ), esc_html__( 'Connection unavailable', 'independence-hub-connector' ), array( 'response' => 403 ) );
    197         }
     232    // Verify identity only after the administrator reaches WordPress. This
     233    // avoids a nested Hub -> WordPress -> Hub request during bootstrap.
     234    if ( ! current_user_can( 'manage_options' ) || ! preg_match( '/^[a-f0-9-]{32,128}$/', $state ) ) {
     235        wp_die( esc_html__( 'This Independence Hub connection request is invalid.', 'independence-hub-connector' ), '', array( 'response' => 403 ) );
     236    }
     237    $approval = get_transient( 'independence_hub_approval_' . hash( 'sha256', $state ) );
     238    if ( ! is_array( $approval ) ) {
     239        // phpcs:ignore WordPress.Security.NonceVerification.Recommended -- Read-only approval preparation; identity is verified server-to-server and approval POST has a nonce.
     240        $redirect_uri = isset( $_GET['redirect_uri'] ) ? esc_url_raw( wp_unslash( $_GET['redirect_uri'] ) ) : 'https://app.independence-hub.com/api/wordpress/callback';
     241        if ( ! independence_hub_connector_valid_redirect_uri( $redirect_uri ) ) {
     242            wp_die( esc_html__( 'The Hub callback is invalid.', 'independence-hub-connector' ), '', array( 'response' => 400 ) );
     243        }
     244        $identity = independence_hub_connector_intent_identity( $state );
     245        if ( is_wp_error( $identity ) ) {
     246            wp_die( esc_html( $identity->get_error_message() ), '', array( 'response' => 403 ) );
     247        }
     248        $approval = array( 'state' => $state, 'redirect_uri' => $redirect_uri, 'account_email' => $identity['account_email'], 'account_id' => $identity['account_id'] );
     249        set_transient( 'independence_hub_approval_' . hash( 'sha256', $state ), $approval, 15 * MINUTE_IN_SECONDS );
     250    }
     251    if ( $state !== ( $approval['state'] ?? '' ) ) {
     252        wp_die( esc_html__( 'This Independence Hub connection request has expired.', 'independence-hub-connector' ), '', array( 'response' => 403 ) );
     253    }
     254        $existing_sources = array();
     255        $account_email    = strtolower( trim( (string) ( $approval['account_email'] ?? '' ) ) );
     256        foreach ( independence_hub_connector_connections() as $connection ) {
     257                if ( $account_email && strtolower( trim( (string) ( $connection['account_email'] ?? '' ) ) ) === $account_email ) {
     258                        $existing_sources = $connection['sources'];
     259                        break;
     260                }
     261        }
     262
     263        $available_sources = independence_hub_connector_available_sources();
     264        $source_descriptions = array(
     265                'independent-analytics' => __( 'Page views, visitors, sessions, and detailed traffic reports.', 'independence-hub-connector' ),
     266                'wp-statistics' => __( 'Page views, daily visitors, and traffic breakdowns.', 'independence-hub-connector' ),
     267                'burst-statistics' => __( 'Page views, visitors, sessions, and engagement reports.', 'independence-hub-connector' ),
     268                'koko-analytics' => __( 'Page views, visitors, top pages, and referrers.', 'independence-hub-connector' ),
     269        );
    198270
    199271        ?>
    200         <div class="wrap">
     272        <div class="wrap ihc-approval">
    201273                <h1><?php esc_html_e( 'Connect Independence Hub', 'independence-hub-connector' ); ?></h1>
    202                 <p><strong><?php esc_html_e( 'Hub account:', 'independence-hub-connector' ); ?></strong> <?php echo esc_html( $approval['account_email'] ?? '' ); ?></p>
    203                 <p><?php esc_html_e( 'Approve access to this site’s aggregate analytics. The connector will create a random, site-specific token that can access only its read-only analytics endpoints. It cannot sign in to WordPress or access other WordPress APIs.', 'independence-hub-connector' ); ?></p>
    204                 <p><?php esc_html_e( 'The token is sent to Independence Hub over HTTPS and can be revoked at any time from Settings → Independence Hub Connector.', 'independence-hub-connector' ); ?></p>
    205                 <p><a href="https://app.independence-hub.com/privacy" target="_blank" rel="noopener noreferrer"><?php esc_html_e( 'Read the Independence Hub privacy policy', 'independence-hub-connector' ); ?></a></p>
    206                 <form method="post" action="<?php echo esc_url( admin_url( 'admin-post.php' ) ); ?>">
    207                         <input type="hidden" name="action" value="independence_hub_approve">
    208                         <input type="hidden" name="state" value="<?php echo esc_attr( $state ); ?>">
    209                         <?php wp_nonce_field( 'independence_hub_approve_' . $state ); ?>
    210                         <p><button type="submit" name="independence_hub_approve" value="1" class="button button-primary"><?php esc_html_e( 'Approve connection', 'independence-hub-connector' ); ?></button></p>
    211                 </form>
     274                <p class="ihc-approval-intro"><?php esc_html_e( 'Choose the analytics you want to see in your Hub.', 'independence-hub-connector' ); ?></p>
     275                <div class="ihc-approval-layout">
     276                        <div class="ihc-approval-main">
     277                                <section class="ihc-approval-account" aria-labelledby="ihc-requesting-account">
     278                                        <span id="ihc-requesting-account" class="ihc-eyebrow"><?php esc_html_e( 'Connecting to Hub account', 'independence-hub-connector' ); ?></span>
     279                                        <strong><?php echo esc_html( $approval['account_email'] ?? '' ); ?></strong>
     280                                        <p><?php echo esc_html( get_bloginfo( 'name' ) ); ?> <span aria-hidden="true">·</span> <?php echo esc_html( wp_parse_url( home_url( '/' ), PHP_URL_HOST ) ); ?></p>
     281                                </section>
     282                                <form class="ihc-approval-form" method="post" action="<?php echo esc_url( admin_url( 'admin-post.php' ) ); ?>">
     283                                        <input type="hidden" name="action" value="independence_hub_approve">
     284                                        <input type="hidden" name="state" value="<?php echo esc_attr( $state ); ?>">
     285                                        <?php wp_nonce_field( 'independence_hub_approve_' . $state ); ?>
     286                                        <fieldset aria-describedby="ihc-selection-help">
     287                                                <legend><?php esc_html_e( 'Analytics plugins', 'independence-hub-connector' ); ?></legend>
     288                                                <p id="ihc-selection-help" class="description"><?php esc_html_e( 'Select one or more active plugins. You can switch between their reports in the Hub; traffic for this site is never counted twice.', 'independence-hub-connector' ); ?></p>
     289                                                <?php if ( $available_sources ) : ?>
     290                                                <div class="ihc-source-choices">
     291                                                <?php foreach ( $available_sources as $source => $label ) : ?>
     292                                                        <label class="ihc-source-choice">
     293                                                                <input type="checkbox" name="sources[]" value="<?php echo esc_attr( $source ); ?>" <?php checked( in_array( $source, $existing_sources, true ) || empty( $existing_sources ) ); ?>>
     294                                                                <span class="ihc-source-copy"><strong><?php echo esc_html( $label ); ?></strong><span><?php echo esc_html( $source_descriptions[ $source ] ?? '' ); ?></span></span>
     295                                                                <?php if ( in_array( $source, $existing_sources, true ) ) : ?><span class="ihc-source-approved"><?php esc_html_e( 'Already approved', 'independence-hub-connector' ); ?></span><?php endif; ?>
     296                                                        </label>
     297                                                <?php endforeach; ?>
     298                                                </div>
     299                                                <p class="ihc-selection-note"><?php esc_html_e( 'Existing approvals are selected. Previously revoked plugins stay unselected until you choose them again. To remove an existing approval, use the connector’s settings.', 'independence-hub-connector' ); ?></p>
     300                                                <?php else : ?>
     301                                                <div class="notice notice-warning inline"><p><?php esc_html_e( 'No supported analytics plugins are active. Activate a supported plugin on this site, then start the connection again from the Hub.', 'independence-hub-connector' ); ?></p></div>
     302                                                <?php endif; ?>
     303                                                <p id="ihc-selection-error" class="ihc-selection-error" role="alert" hidden><?php esc_html_e( 'Select at least one analytics plugin, or cancel to return to the Hub.', 'independence-hub-connector' ); ?></p>
     304                                        </fieldset>
     305                                        <div class="ihc-approval-actions">
     306                                                <button type="submit" name="independence_hub_approve" value="1" class="button button-primary button-hero" <?php disabled( empty( $available_sources ) ); ?>><?php esc_html_e( 'Approve connection', 'independence-hub-connector' ); ?></button>
     307                                                <button type="submit" name="independence_hub_cancel" value="1" formnovalidate class="button button-secondary"><?php esc_html_e( 'Cancel, return to Hub', 'independence-hub-connector' ); ?></button>
     308                                        </div>
     309                                </form>
     310                        </div>
     311                        <aside class="ihc-approval-summary" aria-labelledby="ihc-access-summary">
     312                                <h2 id="ihc-access-summary"><?php esc_html_e( 'What you’re approving', 'independence-hub-connector' ); ?></h2>
     313                                <ul>
     314                                        <li><strong><?php esc_html_e( 'Read-only reports', 'independence-hub-connector' ); ?></strong><span><?php esc_html_e( 'Only aggregate analytics from the plugins you select.', 'independence-hub-connector' ); ?></span></li>
     315                                        <li><strong><?php esc_html_e( 'Your WordPress stays yours', 'independence-hub-connector' ); ?></strong><span><?php esc_html_e( 'No WordPress password is shared. The Hub cannot sign in or change your site.', 'independence-hub-connector' ); ?></span></li>
     316                                        <li><strong><?php esc_html_e( 'You stay in control', 'independence-hub-connector' ); ?></strong><span><?php esc_html_e( 'Revoke a plugin or this account’s access in Settings → Independence Hub Connector.', 'independence-hub-connector' ); ?></span></li>
     317                                </ul>
     318                                <p><?php esc_html_e( 'Approval creates a site-specific token, shared over HTTPS and encrypted in the Hub. WordPress stores only its hash.', 'independence-hub-connector' ); ?></p>
     319                                <a href="https://app.independence-hub.com/privacy" target="_blank" rel="noopener noreferrer"><?php esc_html_e( 'Read the privacy policy (opens in a new tab)', 'independence-hub-connector' ); ?></a>
     320                        </aside>
     321                </div>
    212322        </div>
    213323        <?php
    … …  
    226336        }
    227337        ?>
    228         <div class="wrap">
     338        <div class="wrap ihc-settings">
    229339                <h1><?php esc_html_e( 'Independence Hub Connector', 'independence-hub-connector' ); ?></h1>
    230                 <p><?php esc_html_e( 'Start a connection from Independence Hub. The connector stores token hashes, connected Hub account emails, account identifiers, and approval dates. It stores no analytics data.', 'independence-hub-connector' ); ?></p>
    231                 <h2><?php esc_html_e( 'Data shared after approval', 'independence-hub-connector' ); ?></h2>
    232                 <p><?php esc_html_e( 'The connector shares aggregate Independent Analytics metrics with Independence Hub. Its random connection token is valid only for the connector’s read-only analytics endpoints; it cannot authenticate to WordPress or perform site administration.', 'independence-hub-connector' ); ?></p>
    233                 <p><a href="https://app.independence-hub.com/privacy" target="_blank" rel="noopener noreferrer"><?php esc_html_e( 'Privacy policy', 'independence-hub-connector' ); ?></a> · <a href="https://app.independence-hub.com/terms" target="_blank" rel="noopener noreferrer"><?php esc_html_e( 'Terms of service', 'independence-hub-connector' ); ?></a></p>
    234                 <h2><?php esc_html_e( 'Connection access', 'independence-hub-connector' ); ?></h2>
    235                 <p><?php esc_html_e( 'Each approval creates a separate connection. Disconnecting one account stops its future analytics requests without affecting other accounts. Previously downloaded reports remain in that Hub account.', 'independence-hub-connector' ); ?></p>
     340                <div class="ihc-page-intro">
     341                        <p><?php esc_html_e( 'Manage which Hub accounts can read this site’s analytics.', 'independence-hub-connector' ); ?></p>
     342                        <a class="button button-primary" href="https://app.independence-hub.com/" target="_blank" rel="noopener noreferrer"><?php esc_html_e( 'Open Independence Hub', 'independence-hub-connector' ); ?><span class="screen-reader-text"> <?php esc_html_e( '(opens in a new tab)', 'independence-hub-connector' ); ?></span></a>
     343                </div>
     344                <hr class="wp-header-end">
     345                <div class="ihc-settings-layout">
     346                <section class="ihc-access" aria-labelledby="ihc-access-title">
     347                <h2 id="ihc-access-title"><?php esc_html_e( 'Connected accounts', 'independence-hub-connector' ); ?></h2>
     348                <p class="description"><?php esc_html_e( 'One connection per Hub account. Manage each analytics plugin below, or revoke the account’s entire connection.', 'independence-hub-connector' ); ?></p>
    236349                <?php $connections = independence_hub_connector_connections(); ?>
     350                <?php update_option( INDEPENDENCE_HUB_CONNECTOR_TOKENS_OPTION, $connections, false ); ?>
    237351                <?php if ( $connections ) : ?>
    238                 <table class="widefat striped">
    239                         <thead><tr><th scope="col"><?php esc_html_e( 'Hub account', 'independence-hub-connector' ); ?></th><th scope="col"><?php esc_html_e( 'Approved (UTC)', 'independence-hub-connector' ); ?></th><th scope="col"><?php esc_html_e( 'Access', 'independence-hub-connector' ); ?></th></tr></thead>
    240                         <tbody>
     352                <div class="ihc-connections" aria-label="<?php esc_attr_e( 'Connected Hub accounts', 'independence-hub-connector' ); ?>">
    241353                        <?php foreach ( $connections as $id => $connection ) : ?>
    242                                 <tr><td><?php echo esc_html( $connection['account_email'] ?: __( 'Existing connection — account email unavailable; reconnect from Hub to identify your account.', 'independence-hub-connector' ) ); ?></td>
    243                                 <td><?php echo esc_html( $connection['created_at'] ?: '—' ); ?></td>
    244                                 <td><form method="post" action="<?php echo esc_url( admin_url( 'admin-post.php' ) ); ?>">
     354                                <article class="ihc-connection-card">
     355                                        <header class="ihc-connection-identity">
     356                                                <span class="ihc-eyebrow"><?php esc_html_e( 'Hub account', 'independence-hub-connector' ); ?></span>
     357                                                <h3><?php echo esc_html( $connection['account_email'] ?: __( 'Existing connection', 'independence-hub-connector' ) ); ?></h3>
     358                                                <?php if ( empty( $connection['account_email'] ) ) : ?><p><?php esc_html_e( 'Reconnect from Hub to identify this account.', 'independence-hub-connector' ); ?></p><?php endif; ?>
     359                                                <?php if ( ! empty( $connection['created_at'] ) ) : ?><p class="ihc-approved"><?php
     360                        /* translators: %s: UTC approval date and time. */
     361                        echo esc_html( sprintf( __( 'Approved %s UTC', 'independence-hub-connector' ), $connection['created_at'] ) ); ?></p><?php endif; ?>
     362                                        </header>
     363                                        <section class="ihc-connection-permissions" aria-labelledby="ihc-permissions-<?php echo esc_attr( $id ); ?>">
     364                                                <h4 id="ihc-permissions-<?php echo esc_attr( $id ); ?>"><?php esc_html_e( 'Approved analytics plugins', 'independence-hub-connector' ); ?></h4>
     365                                                <ul class="ihc-plugin-list">
     366                                <?php foreach ( $connection['sources'] ?? array( 'independent-analytics' ) as $source ) : $source_label = array( 'independent-analytics' => 'Independent Analytics', 'wp-statistics' => 'WP Statistics', 'burst-statistics' => 'Burst Statistics', 'koko-analytics' => 'Koko Analytics' )[ $source ] ?? $source; ?>
     367                                                        <li><span class="ihc-plugin-name"><?php echo esc_html( $source_label ); ?></span><form method="post" action="<?php echo esc_url( admin_url( 'admin-post.php' ) ); ?>">
     368                                                <input type="hidden" name="action" value="independence_hub_revoke_source">
     369                                                <input type="hidden" name="connection_id" value="<?php echo esc_attr( $id ); ?>">
     370                                                <input type="hidden" name="source" value="<?php echo esc_attr( $source ); ?>">
     371                                                <?php wp_nonce_field( 'independence_hub_revoke_source_' . $id . '_' . $source ); ?>
     372                                                        <button type="submit" class="button ihc-revoke-source" aria-label="<?php
     373                        /* translators: %s: Analytics plugin name. */
     374                        echo esc_attr( sprintf( __( 'Revoke access to %s', 'independence-hub-connector' ), $source_label ) ); ?>"><?php esc_html_e( 'Revoke', 'independence-hub-connector' ); ?></button>
     375                                                        </form></li>
     376                                <?php endforeach; ?>
     377                                                </ul>
     378                                        </section>
     379                                        <footer class="ihc-connection-actions"><p><?php esc_html_e( 'Revoking a plugin affects only this Hub account. Previously downloaded reports remain in Hub.', 'independence-hub-connector' ); ?></p><form method="post" action="<?php echo esc_url( admin_url( 'admin-post.php' ) ); ?>">
    245380                                        <input type="hidden" name="action" value="independence_hub_revoke_token">
    246381                                        <input type="hidden" name="connection_id" value="<?php echo esc_attr( $id ); ?>">
    247382                                        <?php wp_nonce_field( 'independence_hub_revoke_token_' . $id ); ?>
    248                                         <?php submit_button( __( 'Disconnect', 'independence-hub-connector' ), 'secondary', 'disconnect_' . $id, false ); ?>
    249                                 </form></td></tr>
     383                                        <button type="submit" class="button ihc-revoke-all"><?php esc_html_e( 'Revoke all access', 'independence-hub-connector' ); ?></button>
     384                                        </form></footer>
     385                                </article>
    250386                        <?php endforeach; ?>
    251                         </tbody>
    252                 </table>
     387                </div>
    253388                <?php else : ?>
    254                 <p><?php esc_html_e( 'No Independence Hub accounts are connected.', 'independence-hub-connector' ); ?></p>
     389                <div class="postbox ihc-empty"><h3><?php esc_html_e( 'Connect your first Hub account', 'independence-hub-connector' ); ?></h3><p><?php esc_html_e( 'Open Independence Hub, choose Add site, and enter this site’s URL. You’ll return to WordPress to approve access.', 'independence-hub-connector' ); ?></p></div>
    255390                <?php endif; ?>
     391                </section>
     392                <aside class="ihc-sidebar" aria-label="<?php esc_attr_e( 'Connection information', 'independence-hub-connector' ); ?>">
     393                        <section class="postbox"><h2 class="hndle"><?php esc_html_e( 'Connect another account', 'independence-hub-connector' ); ?></h2><div class="inside"><ol><li><?php esc_html_e( 'Sign in to the Hub account you want to connect.', 'independence-hub-connector' ); ?></li><li><?php esc_html_e( 'Choose Add site and enter this site’s URL.', 'independence-hub-connector' ); ?></li><li><?php esc_html_e( 'Approve the analytics plugins to share in WordPress.', 'independence-hub-connector' ); ?></li></ol></div></section>
     394                        <section class="postbox"><h2 class="hndle"><?php esc_html_e( 'Privacy & access', 'independence-hub-connector' ); ?></h2><div class="inside">
     395                                <p><?php esc_html_e( 'Only aggregate reports from approved analytics plugins are shared with Independence Hub.', 'independence-hub-connector' ); ?></p>
     396                                <p><?php esc_html_e( 'The connection token provides read-only analytics access. It cannot sign in to WordPress or administer this site.', 'independence-hub-connector' ); ?></p>
     397                                <p><?php esc_html_e( 'This connector stores token hashes, Hub account emails and identifiers, approved plugins, and approval dates. It stores no analytics data.', 'independence-hub-connector' ); ?></p>
     398                                <p><a href="https://app.independence-hub.com/privacy" target="_blank" rel="noopener noreferrer"><?php esc_html_e( 'Privacy policy', 'independence-hub-connector' ); ?></a> &middot; <a href="https://app.independence-hub.com/terms" target="_blank" rel="noopener noreferrer"><?php esc_html_e( 'Terms of service', 'independence-hub-connector' ); ?></a></p>
     399                        </div></section>
     400                </aside>
     401                </div>
    256402        </div>
    257403        <?php
    258404}
     405
     406/** Load assets only on connector settings and approval screens. */
     407function independence_hub_connector_settings_styles( $hook_suffix ) {
     408        if ( ! in_array( $hook_suffix, array( 'settings_page_independence-hub-connector', 'admin_page_independence-hub-connector-approve' ), true ) ) {
     409                return;
     410        }
     411        wp_enqueue_style( 'independence-hub-connector-admin', plugins_url( 'assets/admin.css', INDEPENDENCE_HUB_CONNECTOR_FILE ), array(), INDEPENDENCE_HUB_CONNECTOR_VERSION );
     412        if ( 'admin_page_independence-hub-connector-approve' === $hook_suffix ) {
     413                wp_enqueue_script( 'independence-hub-connector-approval', plugins_url( 'assets/approval.js', INDEPENDENCE_HUB_CONNECTOR_FILE ), array(), INDEPENDENCE_HUB_CONNECTOR_VERSION, true );
     414        }
     415}
     416add_action( 'admin_enqueue_scripts', 'independence_hub_connector_settings_styles' );
    259417
    260418/** Revoke the active analytics token from an authenticated site administrator action. */
    … …  
    266424        check_admin_referer( 'independence_hub_revoke_token_' . $id );
    267425        $connections = independence_hub_connector_connections();
     426        if ( ! isset( $connections[ $id ] ) ) {
     427                wp_die( esc_html__( 'This Hub account connection was not found.', 'independence-hub-connector' ), '', array( 'response' => 404 ) );
     428        }
    268429        unset( $connections[ $id ] );
    269         unset( $connections['legacy'] );
    270430        if ( 'legacy' === $id ) {
    271431                delete_option( INDEPENDENCE_HUB_CONNECTOR_TOKEN_OPTION );
    … …  
    276436}
    277437add_action( 'admin_post_independence_hub_revoke_token', 'independence_hub_connector_revoke_token' );
     438
     439/** Remove one approved analytics plugin without disturbing the account's other grants. */
     440function independence_hub_connector_remove_source( &$connections, $id, $source ) {
     441        if ( ! isset( $connections[ $id ] ) || ! is_array( $connections[ $id ] ) ) {
     442                return false;
     443        }
     444        $sources = $connections[ $id ]['sources'] ?? array( 'independent-analytics' );
     445        if ( ! is_array( $sources ) || ! in_array( $source, $sources, true ) ) {
     446                return false;
     447        }
     448        $remaining = array_values( array_diff( $sources, array( $source ) ) );
     449        if ( empty( $remaining ) ) {
     450                unset( $connections[ $id ] );
     451                return true;
     452        }
     453        $connections[ $id ]['sources'] = $remaining;
     454        return true;
     455}
     456
     457/** Revoke one source using an authenticated site administrator action. */
     458function independence_hub_connector_revoke_source() {
     459        if ( ! current_user_can( 'manage_options' ) ) {
     460                wp_die( esc_html__( 'You are not allowed to revoke analytics access.', 'independence-hub-connector' ), '', array( 'response' => 403 ) );
     461        }
     462        $id = isset( $_POST['connection_id'] ) ? sanitize_text_field( wp_unslash( $_POST['connection_id'] ) ) : '';
     463        $source = isset( $_POST['source'] ) ? sanitize_key( wp_unslash( $_POST['source'] ) ) : '';
     464        check_admin_referer( 'independence_hub_revoke_source_' . $id . '_' . $source );
     465        $connections = independence_hub_connector_connections();
     466        if ( ! independence_hub_connector_remove_source( $connections, $id, $source ) ) {
     467                wp_die( esc_html__( 'This analytics plugin access was not found.', 'independence-hub-connector' ), '', array( 'response' => 404 ) );
     468        }
     469        if ( 'legacy' === $id && ! isset( $connections['legacy'] ) ) {
     470                delete_option( INDEPENDENCE_HUB_CONNECTOR_TOKEN_OPTION );
     471        }
     472        update_option( INDEPENDENCE_HUB_CONNECTOR_TOKENS_OPTION, $connections, false );
     473        wp_safe_redirect( add_query_arg( 'independence_hub_revoked', 'source', admin_url( 'options-general.php?page=independence-hub-connector' ) ) );
     474        exit;
     475}
     476add_action( 'admin_post_independence_hub_revoke_source', 'independence_hub_connector_revoke_source' );
    278477
    279478/**
    … …  
    290489add_filter( 'plugin_action_links_' . plugin_basename( INDEPENDENCE_HUB_CONNECTOR_FILE ), 'independence_hub_connector_plugin_action_links' );
    291490
    292 /** Store one independently revocable approval without changing existing tokens. */
    293 function independence_hub_connector_store_connection( $token, $identity ) {
     491/** Store one token per Hub account email, merging newly approved analytics sources. */
     492function independence_hub_connector_store_connection( $token, $identity, $sources = array( 'independent-analytics' ) ) {
    294493        $connections = independence_hub_connector_connections();
    295         unset( $connections['legacy'] );
    296         $connections[ wp_generate_uuid4() ] = array( 'hash' => hash( 'sha256', $token ), 'account_email' => $identity['account_email'], 'account_id' => $identity['account_id'], 'created_at' => gmdate( 'Y-m-d H:i:s' ) );
     494        $email = strtolower( trim( (string) $identity['account_email'] ) );
     495        $id = null;
     496        $approved_sources = array_values( array_unique( array_filter( $sources, 'is_string' ) ) );
     497        foreach ( $connections as $connection_id => $connection ) {
     498                if ( strtolower( trim( (string) ( $connection['account_email'] ?? '' ) ) ) === $email ) {
     499                        $id = $connection_id;
     500                        $approved_sources = array_values( array_unique( array_merge( $connection['sources'] ?? array( 'independent-analytics' ), $approved_sources ) ) );
     501                        break;
     502                }
     503        }
     504        if ( null === $id ) {
     505                $id = wp_generate_uuid4();
     506        }
     507        $connections[ $id ] = array( 'hash' => hash( 'sha256', $token ), 'account_email' => $identity['account_email'], 'account_id' => $identity['account_id'], 'sources' => $approved_sources, 'created_at' => gmdate( 'Y-m-d H:i:s' ) );
    297508        update_option( INDEPENDENCE_HUB_CONNECTOR_TOKENS_OPTION, $connections, false );
    298509}
    … …  
    308519        }
    309520        check_admin_referer( 'independence_hub_approve_' . $state );
     521        if ( ! independence_hub_connector_valid_redirect_uri( $approval['redirect_uri'] ?? '' ) ) {
     522                wp_die( esc_html__( 'The Hub callback is invalid.', 'independence-hub-connector' ), '', array( 'response' => 400 ) );
     523        }
     524        if ( isset( $_POST['independence_hub_cancel'] ) ) {
     525                delete_transient( 'independence_hub_approval_' . hash( 'sha256', $state ) );
     526                nocache_headers();
     527                $return_url = 'iastats.mburnette.com' === wp_parse_url( $approval['redirect_uri'], PHP_URL_HOST ) ? 'https://iastats.mburnette.com/' : 'https://app.independence-hub.com/';
     528                // phpcs:ignore WordPress.Security.SafeRedirect.wp_redirect_wp_redirect -- Only the two literal, allow-listed Hub home URLs above can be used.
     529                wp_redirect( $return_url, 303, 'Independence Hub Connector' );
     530                exit;
     531        }
     532
    310533        $identity = independence_hub_connector_intent_identity( $state );
    311534        if ( is_wp_error( $identity ) ) {
    312535                wp_die( esc_html( $identity->get_error_message() ), '', array( 'response' => 403 ) );
    313536        }
     537    $requested = isset( $_POST['sources'] ) && is_array( $_POST['sources'] ) ? array_map( 'sanitize_key', wp_unslash( $_POST['sources'] ) ) : array();
     538    $sources = array_values( array_intersect( array_keys( independence_hub_connector_available_sources() ), $requested ) );
     539    if ( empty( $sources ) ) {
     540        wp_die( esc_html__( 'Select at least one active analytics plugin. Return to the approval screen to try again.', 'independence-hub-connector' ), '', array( 'response' => 400 ) );
     541    }
    314542        $token = bin2hex( random_bytes( 32 ) );
    315         independence_hub_connector_store_connection( $token, $identity );
     543        independence_hub_connector_store_connection( $token, $identity, $sources );
    316544        delete_transient( 'independence_hub_approval_' . hash( 'sha256', $state ) );
    317545        nocache_headers();
    … …  
    392620 * @return WP_REST_Response|WP_Error
    393621 */
     622/** Mark pre-history buckets as unavailable, retaining genuine zeros after data begins. */
     623function independence_hub_connector_daily_coverage( $series, $has_earlier_data ) {
     624    $started = $has_earlier_data;
     625    foreach ( $series as &$point ) {
     626        foreach ( array( 'views', 'visitors', 'sessions' ) as $metric ) {
     627            if ( isset( $point[ $metric ] ) && $point[ $metric ] > 0 ) { $started = true; }
     628        }
     629        if ( ! $started ) {
     630            $point['views'] = null;
     631            $point['visitors'] = null;
     632            $point['sessions'] = null;
     633        }
     634    }
     635    unset( $point );
     636    return $series;
     637}
     638
     639/** Apply availability consistently to every authorized overview adapter. */
    394640function independence_hub_connector_overview( WP_REST_Request $request ) {
     641    $response = independence_hub_connector_overview_raw( $request );
     642    if ( is_wp_error( $response ) ) { return $response; }
     643    $data = $response->get_data();
     644    try {
     645        $has_earlier_data = false;
     646        foreach ( $data['previous'] as $value ) {
     647            if ( is_numeric( $value ) && $value > 0 ) { $has_earlier_data = true; }
     648        }
     649        if ( ! $has_earlier_data ) {
     650            // Check all retained history, so a quiet preceding period does not
     651            // incorrectly hide real zero-traffic days from an established plugin.
     652            $from = new DateTime( '1970-01-01', wp_timezone() );
     653            $to = ( new DateTime( $data['range']['from'] ) )->setTimezone( wp_timezone() )->modify( '-1 second' );
     654            $source = $request->get_param( 'source' );
     655            if ( 'wp-statistics' === $source ) {
     656                $history = independence_hub_connector_wp_statistics_counts( array( 'from' => '1970-01-01', 'to' => $to->format( 'Y-m-d' ) ) );
     657            } elseif ( 'burst-statistics' === $source ) {
     658                $history = independence_hub_connector_burst_counts( $from, $to );
     659            } elseif ( 'koko-analytics' === $source ) {
     660                $history = independence_hub_connector_koko_counts( new \KokoAnalytics\Stats(), $from, $to );
     661            } else {
     662                $history = independence_hub_connector_query( $from, $to );
     663            }
     664            if ( is_wp_error( $history ) ) { return $history; }
     665            foreach ( array( 'views', 'visitors', 'sessions' ) as $metric ) {
     666                if ( isset( $history[ $metric ] ) && $history[ $metric ] > 0 ) { $has_earlier_data = true; }
     667            }
     668        }
     669        if ( ! array_filter( $data['previous'], static function ( $value ) { return is_numeric( $value ) && $value > 0; } ) ) {
     670            $data['previous'] = array( 'views' => null, 'visitors' => null, 'sessions' => null );
     671        }
     672        $data['series'] = independence_hub_connector_daily_coverage( $data['series'], $has_earlier_data );
     673        if ( '1' === (string) $request->get_param( 'include_previous_series' ) ) {
     674            $prior_to = ( new DateTime( $data['range']['from'] ) )->setTimezone( wp_timezone() )->modify( '-1 second' );
     675            $prior_from = ( new DateTime( $data['range']['from'] ) )->setTimezone( wp_timezone() )->modify( '-' . (int) $request->get_param( 'days' ) . ' days' );
     676            $data['previousSeries'] = independence_hub_connector_prior_series( $request->get_param( 'source' ), $prior_from, $prior_to );
     677        }
     678        $data['dataCoverage'] = 'recorded-history';
     679        $response->set_data( $data );
     680        return $response;
     681    } catch ( Throwable $error ) {
     682        return new WP_Error( 'analytics_coverage_unavailable', __( 'The analytics plugin could not confirm its available history. Please try again.', 'independence-hub-connector' ), array( 'status' => 503 ) );
     683    }
     684}
     685
     686/** Daily prior-period counts use the same source definitions as current charts. */
     687function independence_hub_connector_prior_series( $source, DateTime $from, DateTime $to ) {
     688    global $wpdb;
     689    $date = array( 'from' => $from->format( 'Y-m-d' ), 'to' => $to->format( 'Y-m-d' ) );
     690    $series = array();
     691    if ( 'burst-statistics' === $source ) {
     692        $series = independence_hub_connector_burst_series( $from, $to );
     693    } elseif ( 'koko-analytics' === $source ) {
     694        foreach ( ( new \KokoAnalytics\Stats() )->get_stats( $from, $to, 'day' ) as $row ) {
     695            $series[] = array( 'date' => $row->date, 'views' => (int) $row->pageviews, 'visitors' => (int) $row->visitors, 'sessions' => null );
     696        }
     697    } elseif ( 'wp-statistics' === $source ) {
     698        $views = array(); $visitors = array();
     699        foreach ( ( new \WP_Statistics\Models\ViewsModel() )->countDailyViews( array( 'date' => $date, 'post_type' => array() ) ) as $row ) { $views[ $row->date ] = (int) $row->views; }
     700        foreach ( ( new \WP_Statistics\Models\VisitorsModel() )->countDailyVisitors( array( 'date' => $date ) ) as $row ) { $visitors[ $row->date ] = (int) $row->visitors; }
     701        $table = independence_hub_connector_wp_statistics_table( 'pages' );
     702        // phpcs:ignore WordPress.DB.PreparedSQL.InterpolatedNotPrepared -- Identifier validated above, values prepared.
     703        $dates = array_fill_keys( $wpdb->get_col( $wpdb->prepare( "SELECT DISTINCT date FROM `{$table}` WHERE date BETWEEN %s AND %s", $date['from'], $date['to'] ) ), true );
     704        for ( $cursor = clone $from; $cursor <= $to; $cursor->modify( '+1 day' ) ) {
     705            $day = $cursor->format( 'Y-m-d' );
     706            $series[] = array( 'date' => $day, 'views' => isset( $dates[ $day ] ) ? ( $views[ $day ] ?? 0 ) : null, 'visitors' => isset( $dates[ $day ] ) ? ( $visitors[ $day ] ?? 0 ) : null, 'sessions' => null );
     707        }
     708    } else {
     709        for ( $cursor = clone $from; $cursor <= $to; $cursor->modify( '+1 day' ) ) {
     710            $counts = independence_hub_connector_query( $cursor, ( clone $cursor )->setTime( 23, 59, 59 ) );
     711            if ( is_wp_error( $counts ) ) { throw new RuntimeException( 'Previous daily counts unavailable.' ); }
     712            $series[] = array_merge( array( 'date' => $cursor->format( 'Y-m-d' ) ), $counts );
     713        }
     714    }
     715    if ( $wpdb->last_error ) { throw new RuntimeException( 'Previous daily query failed.' ); }
     716    // Establish coverage before this period, independently of current history.
     717    $epoch = new DateTime( '1970-01-01', wp_timezone() );
     718    $before = ( clone $from )->modify( '-1 second' );
     719    if ( 'wp-statistics' === $source ) { return $series; }
     720    if ( 'burst-statistics' === $source ) { $history = independence_hub_connector_burst_counts( $epoch, $before ); }
     721    elseif ( 'koko-analytics' === $source ) { $history = independence_hub_connector_koko_counts( new \KokoAnalytics\Stats(), $epoch, $before ); }
     722    else { $history = independence_hub_connector_query( $epoch, $before ); }
     723    if ( is_wp_error( $history ) ) { throw new RuntimeException( 'Previous daily history unavailable.' ); }
     724    $earlier = false;
     725    foreach ( array( 'views', 'visitors', 'sessions' ) as $metric ) { if ( isset( $history[ $metric ] ) && $history[ $metric ] > 0 ) { $earlier = true; } }
     726    return independence_hub_connector_daily_coverage( $series, $earlier );
     727}
     728
     729function independence_hub_connector_overview_raw( WP_REST_Request $request ) {
     730    if ( 'koko-analytics' === $request->get_param( 'source' ) ) {
     731        return independence_hub_connector_koko_overview( $request );
     732    }
     733    if ( 'burst-statistics' === $request->get_param( 'source' ) ) {
     734        return independence_hub_connector_burst_overview( $request );
     735    }
     736    if ( 'wp-statistics' === $request->get_param( 'source' ) ) {
     737        return independence_hub_connector_wp_statistics_overview( $request );
     738    }
    395739        $days     = (int) $request->get_param( 'days' );
    396740        $timezone = wp_timezone();
    … …  
    457801 */
    458802function independence_hub_connector_details( WP_REST_Request $request ) {
     803    if ( 'koko-analytics' === $request->get_param( 'source' ) ) {
     804        return independence_hub_connector_koko_details( $request );
     805    }
     806    if ( 'burst-statistics' === $request->get_param( 'source' ) ) {
     807        return independence_hub_connector_burst_details( $request );
     808    }
     809    if ( 'wp-statistics' === $request->get_param( 'source' ) ) {
     810        return independence_hub_connector_wp_statistics_details( $request );
     811    }
    459812        if ( ! function_exists( 'iawp_analytics' ) || ! class_exists( '\\IAWP\\Date_Range\\Exact_Date_Range' ) ) {
    460813                return new WP_Error( 'independent_analytics_unavailable', __( 'Update Independent Analytics before loading this site report.', 'independence-hub-connector' ), array( 'status' => 503 ) );
    … …  
    532885        );
    533886}
     887
     888require_once __DIR__ . '/includes/analytics-sources.php';
     889
     890require_once __DIR__ . '/includes/burst-statistics.php';
     891
     892require_once __DIR__ . '/includes/koko-analytics.php';
  • independence-hub-connector/trunk/languages/independence-hub-connector.pot

    r3717788 r3780659  
     1# Copyright (C) 2026 Marcus Burnette
     2# This file is distributed under the GPL-2.0-or-later.
    13msgid ""
    24msgstr ""
    3 "Project-Id-Version: Independence Hub Connector 1.5.0\n"
    4 "POT-Creation-Date: 2026-09-13 00:00+0000\n"
     5"Project-Id-Version: Independence Hub Connector 1.11.1\n"
     6"Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/independence-hub-connector\n"
     7"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
     8"Language-Team: LANGUAGE <LL@li.org>\n"
    59"MIME-Version: 1.0\n"
    610"Content-Type: text/plain; charset=UTF-8\n"
    711"Content-Transfer-Encoding: 8bit\n"
     12"POT-Creation-Date: 2026-11-02T19:50:03+00:00\n"
     13"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
     14"X-Generator: WP-CLI 2.12.0\n"
    815"X-Domain: independence-hub-connector\n"
    916
     17#. Plugin Name of the plugin
     18#: independence-hub-connector.php
     19#: independence-hub-connector.php:326
     20#: independence-hub-connector.php:339
     21#: independence-hub-connector.php:588
     22msgid "Independence Hub Connector"
     23msgstr ""
     24
     25#. Description of the plugin
     26#: independence-hub-connector.php
     27msgid "Securely shares read-only WordPress analytics metrics with Independence Hub."
     28msgstr ""
     29
     30#. Author of the plugin
     31#: independence-hub-connector.php
     32msgid "Marcus Burnette"
     33msgstr ""
     34
     35#: includes/analytics-sources.php:30
     36#: independence-hub-connector.php:166
     37msgid "A valid Independence Hub connection token is required."
     38msgstr ""
     39
     40#: includes/analytics-sources.php:35
     41msgid "WP Statistics must be active and up to date to read this source."
     42msgstr ""
     43
     44#: includes/analytics-sources.php:82
     45msgid "WP Statistics counts daily visitors; totals may differ from other analytics plugins."
     46msgstr ""
     47
     48#: includes/analytics-sources.php:85
     49msgid "WP Statistics could not return this date range. Check that its database is up to date."
     50msgstr ""
     51
     52#: includes/analytics-sources.php:144
     53msgid "WP Statistics measures single-page daily visits, rather than 30-minute sessions."
     54msgstr ""
     55
     56#: includes/analytics-sources.php:144
     57msgid "WP Statistics counts daily visitors."
     58msgstr ""
     59
     60#: includes/analytics-sources.php:147
     61msgid "WP Statistics could not return this report. Check that its database is up to date."
     62msgstr ""
     63
     64#: includes/burst-statistics.php:89
     65msgid "Burst Statistics could not return this report. Keep Burst 3.7.4 or newer active and finish any pending database updates."
     66msgstr ""
     67
     68#: includes/burst-statistics.php:115
     69msgid "Unknown page"
     70msgstr ""
     71
     72#: includes/burst-statistics.php:156
     73msgid "Direct / unknown"
     74msgstr ""
     75
     76#: includes/burst-statistics.php:158
     77msgid "Unknown"
     78msgstr ""
     79
     80#: includes/burst-statistics.php:159
     81msgid "Burst reports its own visitor identities and session-start totals. Daily sessions count sessions with page views that day. Duration uses recorded page time per session; bounce rate uses Burst’s bounce flag. New and returning sessions use the recorded first-visit flag."
     82msgstr ""
     83
     84#: includes/koko-analytics.php:8
     85msgid "Koko Analytics 2.5.3 or newer must be active to read this source."
     86msgstr ""
     87
     88#: includes/koko-analytics.php:12
     89msgid "Update Koko Analytics to read this report."
     90msgstr ""
     91
     92#: includes/koko-analytics.php:30
     93msgid "Koko Analytics totals sum its recorded visitor counts across the selected dates; tracking settings can affect these counts."
     94msgstr ""
     95
     96#: includes/koko-analytics.php:31
     97msgid "This integration reads Koko Analytics Free reports. Sessions, duration, bounce rate, new/returning sessions, countries, and devices are not tracked by this integration."
     98msgstr ""
     99
     100#: includes/koko-analytics.php:58
     101msgid "Koko Analytics could not return this date range. Check that its database is up to date."
     102msgstr ""
     103
     104#: includes/koko-analytics.php:92
     105msgid "Koko Analytics could not return this report. Check that its database is up to date."
     106msgstr ""
     107
     108#: independence-hub-connector.php:159
     109msgid "Access to this analytics plugin has not been approved for this Hub account."
     110msgstr ""
     111
     112#: independence-hub-connector.php:198
     113msgid "The connection request is invalid."
     114msgstr ""
     115
     116#: independence-hub-connector.php:221
     117msgid "The Hub account could not be verified. Return to Independence Hub and start again."
     118msgstr ""
     119
     120#: independence-hub-connector.php:235
     121msgid "This Independence Hub connection request is invalid."
     122msgstr ""
     123
     124#: independence-hub-connector.php:242
     125#: independence-hub-connector.php:522
     126msgid "The Hub callback is invalid."
     127msgstr ""
     128
     129#: independence-hub-connector.php:252
     130msgid "This Independence Hub connection request has expired."
     131msgstr ""
     132
     133#: independence-hub-connector.php:265
     134msgid "Page views, visitors, sessions, and detailed traffic reports."
     135msgstr ""
     136
     137#: independence-hub-connector.php:266
     138msgid "Page views, daily visitors, and traffic breakdowns."
     139msgstr ""
     140
     141#: independence-hub-connector.php:267
     142msgid "Page views, visitors, sessions, and engagement reports."
     143msgstr ""
     144
     145#: independence-hub-connector.php:268
     146msgid "Page views, visitors, top pages, and referrers."
     147msgstr ""
     148
     149#: independence-hub-connector.php:273
     150#: independence-hub-connector.php:327
     151msgid "Connect Independence Hub"
     152msgstr ""
     153
     154#: independence-hub-connector.php:274
     155msgid "Choose the analytics you want to see in your Hub."
     156msgstr ""
     157
     158#: independence-hub-connector.php:278
     159msgid "Connecting to Hub account"
     160msgstr ""
     161
     162#: independence-hub-connector.php:287
     163msgid "Analytics plugins"
     164msgstr ""
     165
     166#: independence-hub-connector.php:288
     167msgid "Select one or more active plugins. You can switch between their reports in the Hub; traffic for this site is never counted twice."
     168msgstr ""
     169
     170#: independence-hub-connector.php:295
     171msgid "Already approved"
     172msgstr ""
     173
     174#: independence-hub-connector.php:299
     175msgid "Existing approvals are selected. Previously revoked plugins stay unselected until you choose them again. To remove an existing approval, use the connector’s settings."
     176msgstr ""
     177
     178#: independence-hub-connector.php:301
     179msgid "No supported analytics plugins are active. Activate a supported plugin on this site, then start the connection again from the Hub."
     180msgstr ""
     181
     182#: independence-hub-connector.php:303
     183msgid "Select at least one analytics plugin, or cancel to return to the Hub."
     184msgstr ""
     185
     186#: independence-hub-connector.php:306
     187msgid "Approve connection"
     188msgstr ""
     189
     190#: independence-hub-connector.php:307
     191msgid "Cancel, return to Hub"
     192msgstr ""
     193
     194#: independence-hub-connector.php:312
     195msgid "What you’re approving"
     196msgstr ""
     197
     198#: independence-hub-connector.php:314
     199msgid "Read-only reports"
     200msgstr ""
     201
     202#: independence-hub-connector.php:314
     203msgid "Only aggregate analytics from the plugins you select."
     204msgstr ""
     205
     206#: independence-hub-connector.php:315
     207msgid "Your WordPress stays yours"
     208msgstr ""
     209
     210#: independence-hub-connector.php:315
     211msgid "No WordPress password is shared. The Hub cannot sign in or change your site."
     212msgstr ""
     213
     214#: independence-hub-connector.php:316
     215msgid "You stay in control"
     216msgstr ""
     217
     218#: independence-hub-connector.php:316
     219msgid "Revoke a plugin or this account’s access in Settings → Independence Hub Connector."
     220msgstr ""
     221
     222#: independence-hub-connector.php:318
     223msgid "Approval creates a site-specific token, shared over HTTPS and encrypted in the Hub. WordPress stores only its hash."
     224msgstr ""
     225
     226#: independence-hub-connector.php:319
     227msgid "Read the privacy policy (opens in a new tab)"
     228msgstr ""
     229
     230#: independence-hub-connector.php:341
     231msgid "Manage which Hub accounts can read this site’s analytics."
     232msgstr ""
     233
     234#: independence-hub-connector.php:342
     235msgid "Open Independence Hub"
     236msgstr ""
     237
     238#: independence-hub-connector.php:342
     239msgid "(opens in a new tab)"
     240msgstr ""
     241
     242#: independence-hub-connector.php:347
     243msgid "Connected accounts"
     244msgstr ""
     245
     246#: independence-hub-connector.php:348
     247msgid "One connection per Hub account. Manage each analytics plugin below, or revoke the account’s entire connection."
     248msgstr ""
     249
     250#: independence-hub-connector.php:352
     251msgid "Connected Hub accounts"
     252msgstr ""
     253
     254#: independence-hub-connector.php:356
     255msgid "Hub account"
     256msgstr ""
     257
     258#: independence-hub-connector.php:357
     259msgid "Existing connection"
     260msgstr ""
     261
     262#: independence-hub-connector.php:358
     263msgid "Reconnect from Hub to identify this account."
     264msgstr ""
     265
     266#. translators: %s: UTC approval date and time.
     267#: independence-hub-connector.php:361
     268#, php-format
     269msgid "Approved %s UTC"
     270msgstr ""
     271
     272#: independence-hub-connector.php:364
     273msgid "Approved analytics plugins"
     274msgstr ""
     275
     276#. translators: %s: Analytics plugin name.
     277#: independence-hub-connector.php:374
     278#, php-format
     279msgid "Revoke access to %s"
     280msgstr ""
     281
     282#. translators: %s: Analytics plugin name.
     283#: independence-hub-connector.php:374
     284msgid "Revoke"
     285msgstr ""
     286
     287#: independence-hub-connector.php:379
     288msgid "Revoking a plugin affects only this Hub account. Previously downloaded reports remain in Hub."
     289msgstr ""
     290
     291#: independence-hub-connector.php:383
     292msgid "Revoke all access"
     293msgstr ""
     294
     295#: independence-hub-connector.php:389
     296msgid "Connect your first Hub account"
     297msgstr ""
     298
     299#: independence-hub-connector.php:389
     300msgid "Open Independence Hub, choose Add site, and enter this site’s URL. You’ll return to WordPress to approve access."
     301msgstr ""
     302
     303#: independence-hub-connector.php:392
     304msgid "Connection information"
     305msgstr ""
     306
     307#: independence-hub-connector.php:393
     308msgid "Connect another account"
     309msgstr ""
     310
     311#: independence-hub-connector.php:393
     312msgid "Sign in to the Hub account you want to connect."
     313msgstr ""
     314
     315#: independence-hub-connector.php:393
     316msgid "Choose Add site and enter this site’s URL."
     317msgstr ""
     318
     319#: independence-hub-connector.php:393
     320msgid "Approve the analytics plugins to share in WordPress."
     321msgstr ""
     322
     323#: independence-hub-connector.php:394
     324msgid "Privacy & access"
     325msgstr ""
     326
     327#: independence-hub-connector.php:395
     328msgid "Only aggregate reports from approved analytics plugins are shared with Independence Hub."
     329msgstr ""
     330
     331#: independence-hub-connector.php:396
     332msgid "The connection token provides read-only analytics access. It cannot sign in to WordPress or administer this site."
     333msgstr ""
     334
     335#: independence-hub-connector.php:397
     336msgid "This connector stores token hashes, Hub account emails and identifiers, approved plugins, and approval dates. It stores no analytics data."
     337msgstr ""
     338
     339#: independence-hub-connector.php:398
     340msgid "Privacy policy"
     341msgstr ""
     342
     343#: independence-hub-connector.php:398
     344msgid "Terms of service"
     345msgstr ""
     346
     347#: independence-hub-connector.php:421
     348msgid "You are not allowed to revoke this connection."
     349msgstr ""
     350
     351#: independence-hub-connector.php:427
     352msgid "This Hub account connection was not found."
     353msgstr ""
     354
     355#: independence-hub-connector.php:460
     356msgid "You are not allowed to revoke analytics access."
     357msgstr ""
     358
     359#: independence-hub-connector.php:467
     360msgid "This analytics plugin access was not found."
     361msgstr ""
     362
     363#: independence-hub-connector.php:486
     364msgid "Settings"
     365msgstr ""
     366
     367#: independence-hub-connector.php:518
     368msgid "This Independence Hub connection request has expired. Return to Independence Hub and start again."
     369msgstr ""
     370
     371#: independence-hub-connector.php:518
     372msgid "Connection unavailable"
     373msgstr ""
     374
     375#: independence-hub-connector.php:540
     376msgid "Select at least one active analytics plugin. Return to the approval screen to try again."
     377msgstr ""
     378
     379#: independence-hub-connector.php:560
     380msgid "Completing Independence Hub connection"
     381msgstr ""
     382
     383#: independence-hub-connector.php:567
     384msgid "Completing your secure Independence Hub connection…"
     385msgstr ""
     386
     387#: independence-hub-connector.php:568
     388msgid "Continue to Independence Hub"
     389msgstr ""
     390
     391#: independence-hub-connector.php:585
     392msgid "When a site administrator approves a connection, Independence Hub Connector sends the site URL and a random site-specific token to Independence Hub over HTTPS. The token can access only the connector’s read-only aggregate analytics endpoints and cannot authenticate to WordPress or perform site administration. An administrator can revoke it from the connector settings screen."
     393msgstr ""
     394
     395#: independence-hub-connector.php:586
     396msgid "The connector verifies the requesting account with Independence Hub over HTTPS and stores its email address, account identifier, approval date, and token hash to let administrators manage each connection independently."
     397msgstr ""
     398
     399#: independence-hub-connector.php:587
     400msgid "Read the Independence Hub privacy policy."
     401msgstr ""
     402
     403#: independence-hub-connector.php:601
    10404msgid "Independent Analytics must be active before this site can be connected."
    11405msgstr ""
    12406
     407#: independence-hub-connector.php:612
    13408msgid "Independent Analytics could not return this date range."
    14409msgstr ""
     410
     411#: independence-hub-connector.php:706
     412msgid "Update Independent Analytics before loading this site report."
     413msgstr ""
     414
     415#: independence-hub-connector.php:746
     416msgid "Independent Analytics could not create this detailed report. Update the connector and Independent Analytics, then try again."
     417msgstr ""
     418
     419#: independence-hub-connector.php:768
     420msgid "Independent Analytics could not retrieve the detailed metrics."
     421msgstr ""
  • independence-hub-connector/trunk/readme.txt

    r3726911 r3780659  
    11=== Independence Hub Connector ===
    22Contributors: mdburnette
    3 Tags: analytics, independent analytics, website traffic, reports, dashboard
     3Tags: analytics, independent analytics, wp statistics, reports, dashboard
    44Requires at least: 6.5
    55Tested up to: 7.1
    66Requires PHP: 8.0
    7 Stable tag: 1.7.0
     7Stable tag: 1.11.4
    88License: GPLv2 or later
    99License URI: https://www.gnu.org/licenses/gpl-2.0.html
    1010
    11 Connect separate WordPress sites running Independent Analytics to one private, read-only Hub dashboard.
     11Connect WordPress analytics from Independent Analytics, WP Statistics, Burst Statistics, or Koko Analytics in one private dashboard.
    1212
    1313== Description ==
    1414
    15 **Every site. One clear pulse.** If you manage several WordPress sites that each run [Independent Analytics](https://wordpress.org/plugins/independent-analytics/), install Independence Hub Connector on each site to bring their traffic into one calm dashboard. See which sites are growing, spot changes worth investigating, and prepare a portfolio report without opening each WordPress admin.
    16 
    17 Independence Hub Connector is the bridge between one WordPress site and the hosted Hub. A WordPress administrator approves each connection on their own site. The connector then gives the Hub read-only access to supported aggregate Independent Analytics reports through a revocable, site-specific token. No WordPress password or Application Password is shared.
     15**Your WordPress analytics. One clear view.** If you manage several WordPress sites that run [Independent Analytics](https://wordpress.org/plugins/independent-analytics/), [WP Statistics](https://wordpress.org/plugins/wp-statistics/), [Burst Statistics](https://wordpress.org/plugins/burst-statistics/), or [Koko Analytics](https://wordpress.org/plugins/koko-analytics/), install Independence Hub Connector on each site to bring their reports into one private dashboard. See which sites are growing, spot changes worth investigating, and prepare a portfolio report without opening each WordPress admin.
     16
     17Independence Hub Connector is the bridge between one WordPress site and the hosted Hub. A WordPress administrator approves each connection on their own site. The connector then gives the Hub read-only access to supported aggregate reports from the analytics plugins selected during approval through a revocable, site-specific token. No WordPress password or Application Password is shared.
    1818
    1919**In the Independence Hub dashboard**
    2020
    21 * Compare page views, visitors, sessions, and daily traffic across the WordPress sites you connect.
     21* Compare page views, visitors, daily traffic, and sessions where tracked across the WordPress sites you connect.
    2222* Open a site report to explore top pages, sources, locations, devices, and session metrics.
    2323* Group sites by client or portfolio, then include or exclude a group from views and reports.
    2424* Review portfolio Insights and choose the sites and sections for a printable report.
     25* Save traffic watchlist rules and rolling page-view, visitor, or session targets in the hosted Hub. Rules are checked when you open or refresh the Growth workspace. Optionally enable hourly background checks and email alerts to your verified Hub account email; email alerts are off by default.
     26* Record launches and campaigns in a private Hub impact journal, with seven-day before/after page-view comparisons when complete data is available within the last 90 days.
    2527
    2628The dashboard is a separate hosted service. [Create your Hub account](https://app.independence-hub.com/) to connect sites and view reports. Custom printable reports require the Hub's Unlimited plan.
    … …  
    2931
    3032* A guided connection approved by a WordPress administrator on the site itself.
    31 * A read-only connection to Independent Analytics data for the Independence Hub dashboard.
    32 * Overview reporting for page views, visitors, sessions, daily totals, and comparisons with the immediately preceding period.
    33 * Detailed reports with top pages, geographic traffic, device types, traffic sources, new and returning sessions, average session duration, and bounce rate.
     33* A read-only connection to approved Independent Analytics, WP Statistics, Burst Statistics, and Koko Analytics data for the Independence Hub dashboard.
     34* Overview reporting for page views, visitors, daily totals, sessions where tracked, and comparisons with the immediately preceding period.
     35* Detailed reports with top pages, geographic traffic, device types, traffic sources, and bounce rate. Independent Analytics and Burst Statistics also provide sessions, new and returning sessions, and average session duration; WP Statistics shows "Not tracked by this plugin" for those session metrics. Koko Analytics Free 2.5.3 provides page views, visitors, daily traffic, top pages, and referrers; sessions, duration, bounce rate, new/returning sessions, countries, and devices are labeled "Not tracked by this plugin". Koko Pro-specific reports are not included.
     36* Multiple approved analytics plugins per site, with a dashboard selector to view one plugin at a time. Each site counts once toward plan limits and portfolio totals.
     37* Source-specific comparisons, caches, reports, and saved Growth items; switching dashboard data does not change a saved rule’s analytics plugin.
    3438* Reporting ranges of 7, 28, 30, or 90 days.
    35 * Separate tokens for multiple Hub accounts connected to the same site, with account emails and individual Disconnect controls in Settings → Independence Hub Connector.
     39* One connection per Hub account email, with individual analytics-plugin revocation and a revoke-all control in Settings → Independence Hub Connector.
    3640
    3741**Before you connect**
    3842
    3943* This plugin is a connector, not an analytics dashboard. Create an account at https://app.independence-hub.com/ to view reports from the sites you connect.
    40 * Independent Analytics is a separate plugin and must already be installed and active on each site you connect. This connector does not install it or add tracking code.
     44* Independent Analytics, WP Statistics, Burst Statistics, and Koko Analytics are separate analytics plugins. At least one must already be installed and active on each site you connect. This connector does not install it or add tracking code.
    4145* It does not provide visitor-level records, change analytics settings, or let Independence Hub administer your WordPress site.
    4246* It does not share a WordPress password or Application Password. Its token can access only this connector’s read-only analytics endpoints; it cannot sign in to WordPress or access other WordPress APIs.
    … …  
    4448**Privacy and security**
    4549
    46 The connector reads analytics already collected by Independent Analytics. It sends the site URL and a random, site-specific token to Independence Hub over HTTPS only when an administrator approves a connection. The Hub uses the token to request the supported aggregate reports; it encrypts the token at rest. WordPress stores token hashes alongside connected Hub account emails, account identifiers, and approval dates. The connector verifies account identity with Hub over HTTPS before approval. Revoke access at any time from Settings → Independence Hub Connector. Review the [Independence Hub privacy policy](https://app.independence-hub.com/privacy) and [terms of service](https://app.independence-hub.com/terms) before connecting.
     50The connector reads analytics already collected by the selected analytics plugins. It sends the site URL and a random, site-specific token to Independence Hub over HTTPS only when an administrator approves a connection. The Hub uses the token to request the supported aggregate reports; it encrypts the token at rest. WordPress stores token hashes alongside connected Hub account emails, account identifiers, approved analytics plugins, and approval dates. The connector verifies account identity with Hub over HTTPS before approval. Revoke access at any time from Settings → Independence Hub Connector. Review the [Independence Hub privacy policy](https://app.independence-hub.com/privacy) and [terms of service](https://app.independence-hub.com/terms) before connecting.
    4751
    4852== Installation ==
    … …  
    51552. Enter one WordPress site URL. If needed, use the WordPress.org installer link to install and activate Independence Hub Connector on that site. You can also install it from Plugins → Add New.
    52563. Return to the Hub tab and choose “Step 2: Connect this site.”
    53 4. Sign in to WordPress if prompted and approve the connection. You’ll return to Independence Hub when it’s connected.
    54 5. Make sure Independent Analytics is installed and active to view reports.
     574. Sign in to WordPress if prompted, review the Hub account and plugins, and approve the connection. You’ll return to Independence Hub when it’s connected. Choose “Cancel, return to Hub” to leave without changing existing permissions.
     585. Make sure a selected analytics plugin is installed and active to view reports.
    5559
    5660If your host does not allow installing from the WordPress.org directory, download the plugin ZIP from the plugin page and install it through Plugins → Add New → Upload Plugin.
    … …  
    6468= What analytics data can Independence Hub access? =
    6569
    66 The connector provides aggregate page views, visitors, sessions, daily totals, and comparison totals, plus detailed report summaries for pages, geography, devices, sources, and session metrics. Reports are available for 7, 28, 30, or 90 days. The connector does not expose visitor-level records.
     70The connector provides aggregate page views, visitors, sessions, daily totals, and comparison totals, plus detailed report summaries for pages, geography, devices, sources, and session metrics. Reports are available for 7, 28, 30, or 90 days. Availability depends on the approved analytics plugin; Koko Free supplies page views, visitors, pages, and referrers. Unsupported reports show "Not tracked by this plugin". The connector does not expose visitor-level records.
    6771
    6872= Does the plugin collect or send personal data? =
    6973
    70 The connector does not add tracking or collect new visitor-level data. After an administrator approves a connection, it sends the site URL and a random, site-specific token to Independence Hub over HTTPS. The Hub then requests the supported analytics reports. WordPress stores the token hash, connected Hub account email, account identifier, and approval date; the Hub encrypts the token at rest. See the service’s privacy policy for details.
     74The connector does not add tracking or collect new visitor-level data. After an administrator approves a connection, it sends the site URL and a random, site-specific token to Independence Hub over HTTPS. The Hub then requests the supported analytics reports. WordPress stores the token hash, connected Hub account email, account identifier, approved analytics plugins, and approval date; the Hub encrypts the token at rest. See the service’s privacy policy for details.
    7175
    7276= Can Independence Hub administer my WordPress site? =
    … …  
    7680= How do I disconnect a site? =
    7781
    78 In WordPress, go to Settings → Independence Hub Connector and choose Disconnect beside the account you want to revoke. Other accounts keep their access. Existing downloaded reports are not deleted. You can also remove the site from your Independence Hub account. Uninstalling the connector removes its local token hashes and account connection records; it does not delete Independent Analytics data.
     82In WordPress, go to Settings → Independence Hub Connector. Choose Revoke beside an analytics plugin to remove only that plugin's access, or choose Revoke all access for the Hub account. Other accounts keep their access. Existing downloaded reports are not deleted. You can also remove the site from your Independence Hub account. Uninstalling the connector removes its local token hashes and account connection records; it does not delete analytics data.
    7983
    8084= What happens if I uninstall the connector? =
    8185
    82 Uninstalling removes the connector’s local token hashes and account connection records, preventing future requests with those tokens. It does not uninstall Independent Analytics or delete its analytics data.
     86Uninstalling removes the connector’s local token hashes and account connection records, preventing future requests with those tokens. It does not uninstall analytics plugins or delete their data.
    8387
    8488= Can multiple Hub accounts connect to the same site? =
    8589
    86 Yes. Start a connection from each Hub account and approve it in WordPress. Each approval creates its own token; the settings page lists the account email and approval date with a Disconnect button. Older connections remain active after updating, but cannot show an email until you reconnect because earlier versions did not store account identity. Each approval is listed separately, including repeat approvals for the same account.
     90Yes. Start a connection from each Hub account and approve it in WordPress. Each Hub account email has one connection on the site; approving again reuses that account entry, updates its token, and adds any newly approved analytics plugins without removing existing access. Older connections remain active after updating, but cannot show an email until you reconnect because earlier versions did not store account identity. The settings page lets you revoke an individual analytics plugin or revoke all access for one Hub account without affecting other accounts.
     91
     92= Can I use multiple analytics plugins on the same site? =
     93
     94Yes. Select one or more active supported plugins during WordPress approval with Connector 1.9.0 or newer. Use the Analytics plugin selector on the Hub site card to switch reports. Manage analytics plugins on an existing site to change your selection. Traffic from different plugins on the same site is never added together. WP Statistics counts visitors by day and measures single-page daily visits for its bounce rate; definitions and totals can differ from Independent Analytics. Sessions and session-based metrics are not tracked by WP Statistics. Burst Statistics Free 3.7.4 supports page views, visitors, sessions, engagement, and page/country/device/referrer reports. Burst duration uses recorded page time per session; its new/returning split uses session first-visit flags. Its period sessions follow session-start counting, while daily session points count sessions with page views that day. Koko Analytics support requires Connector 1.11.0 and Koko Analytics 2.5.3 or newer. Koko visitors use its own recorded counts and tracking settings; totals sum the stored counts across the chosen dates. Existing connections must approve Koko through Manage analytics plugins. Koko Free does not supply session, country, or device metrics to the Hub, even if Koko Pro is installed. Saved Growth rules, targets, and journal events keep their selected plugin.
    8795
    8896== Changelog ==
     97
     98= 1.11.4 (2026-11-02) =
     99
     100* Add daily comparison-period reports so Hub Average calculates percentage changes using matching daily averages.
     101
     102= 1.11.3 (2026-11-02) =
     103
     104* Fix WP Statistics daily availability when older historical totals exist without daily records in the requested range.
     105
     106= 1.11.2 (2026-11-02) =
     107
     108* Fix daily reports to return null before the first retained analytics activity while preserving zero-traffic days within recorded history.
     109
     110= 1.11.1 (2026-11-02) =
     111
     112* Add a clearer WordPress approval screen with account details, selectable plugin cards, and a concise access summary.
     113* Add a nonce-protected Cancel, return to Hub action that preserves existing analytics permissions.
     114* Fix empty plugin selection feedback before submitting the approval form.
     115
     116= 1.11.0 (2026-11-02) =
     117
     118* Add Koko Analytics Free support for page views, visitors, daily traffic, top pages, referrers, and preceding-period comparisons.
     119* Add source-scoped Koko approval and revocation while preserving existing sites and account connections.
     120* Fix translator context for approval dates and analytics-plugin revocation controls.
     121* Document unsupported Koko metrics and the Free 2.5.3 compatibility baseline.
     122
     123= 1.10.2 (2026-11-02) =
     124
     125* Refactor the settings page with native WordPress panels, concise setup guidance, and a dedicated privacy section.
     126
     127= 1.10.1 (2026-11-02) =
     128* Improve the connector settings layout with responsive account cards and clearer revocation actions.
     129
     130= 1.10.0 (2026-11-02) =
     131
     132* Add one connection per Hub account email and merge plugin approvals when that account reconnects.
     133* Add individual analytics-plugin revocation alongside a per-account revoke-all action.
     134
     135= 1.9.0 (2026-11-02) =
     136
     137* Add Burst Statistics Free aggregate reports with per-token approval, sessions, engagement, top pages, countries, devices, and referrers.
     138* Add daily Burst charts with site-timezone calendar boundaries across daylight-saving changes.
     139* Document Burst metric definitions and source selection across Hub reports, Insights, and Growth tools.
     140
     141= 1.8.0 (2026-11-02) =
     142
     143* Add WP Statistics aggregate reports alongside Independent Analytics with per-token plugin approval.
     144* Add multiple analytics plugins per site and a dashboard selector with separate caches, comparisons, reports, and Growth items.
     145* Add explicit "Not tracked by this plugin" labels for unsupported metrics and explain differences in visitor and bounce-rate definitions.
     146* Document supported analytics plugins, onboarding, privacy, and source selection.
     147* Refactor marketing copy around one dashboard for supported WordPress analytics plugins.
    89148
    90149= 1.7.0 (2026-10-03) =
    … …  
    159218== Affiliation ==
    160219
    161 Independence Hub Connector is an independent third-party project. It is not affiliated with, endorsed by, or sponsored by Independent Analytics or its developers. Independent Analytics is a separate plugin; its name is used only to identify the software this connector works with.
     220Independence Hub Connector is an independent third-party project. It is not affiliated with, endorsed by, or sponsored by Independent Analytics, WP Statistics, Burst Statistics, or their developers. These are separate plugins; their names identify compatible software.
Note: See TracChangeset for help on using the changeset viewer.