Plugin Directory

Changeset 3694415


Ignore:
Timestamp:
09/14/2026 04:06:06 AM (7 weeks ago)
Author:
cyberlord92
Message:

Improves first-run Analytics: tracking status, empty-state next steps, homepage Visibility Score CTA, and optional MCP cards until tool traffic appears.

Location:
miniorange-ai-visibility
Files:
218 added
7 edited

Legend:

Unmodified
Added
Removed
  • miniorange-ai-visibility/trunk/assets/css/admin.css

    r3670315 r3694415  
    60906090   ========================================================================== */
    60916091
     6092.moai-av-getting-started {
     6093        display: flex;
     6094        align-items: center;
     6095        justify-content: space-between;
     6096        gap: 24px;
     6097        margin-bottom: 18px;
     6098        border-color: var(--moai-indigo);
     6099        background: var(--moai-indigo-tint);
     6100}
     6101
     6102.moai-av-getting-started__content {
     6103        max-width: 720px;
     6104}
     6105
     6106.moai-av-getting-started__content h2 {
     6107        margin: 10px 0 6px;
     6108}
     6109
     6110.moai-av-getting-started__content p {
     6111        margin: 0;
     6112        color: var(--moai-muted);
     6113}
     6114
     6115.moai-av-getting-started__mcp {
     6116        margin-top: 8px !important;
     6117        font-size: 12px;
     6118}
     6119
     6120.moai-av-getting-started__status {
     6121        display: inline-flex;
     6122        align-items: center;
     6123        gap: 7px;
     6124        font-size: 12px;
     6125        font-weight: 700;
     6126}
     6127
     6128.moai-av-getting-started__status.is-active {
     6129        color: var(--moai-good);
     6130}
     6131
     6132.moai-av-getting-started__status.is-inactive {
     6133        color: var(--moai-bad);
     6134}
     6135
     6136.moai-av-getting-started__status-dot {
     6137        width: 8px;
     6138        height: 8px;
     6139        border-radius: 50%;
     6140        background: currentColor;
     6141}
     6142
     6143.moai-av-getting-started__actions {
     6144        display: flex;
     6145        gap: 10px;
     6146        flex-shrink: 0;
     6147        flex-wrap: wrap;
     6148}
     6149
    60926150.moai-av-dash-groups {
    60936151        display: grid;
    … …  
    60966154        margin-bottom: 20px;
    60976155        align-items: stretch;
     6156}
     6157
     6158.moai-av-dash-groups--two {
     6159        grid-template-columns: repeat(2, minmax(0, 1fr));
    60986160}
    60996161
    … …  
    66636725        }
    66646726
     6727        .moai-av-getting-started {
     6728                align-items: flex-start;
     6729                flex-direction: column;
     6730        }
     6731
    66656732        .moai-av-dash-metrics {
    66666733                grid-template-columns: repeat(2, minmax(0, 1fr));
  • miniorange-ai-visibility/trunk/assets/js/analytics.js

    r3670315 r3694415  
    11101110                                        // and real data just arrived (charts/tables were never rendered).
    11111111                                        if (
    1112                                                 res.data.stats
    1113                                                 && ( res.data.stats.total_visits > 0 || res.data.stats.total_blocked > 0 )
     1112                                                (
     1113                                                        ( res.data.stats && ( res.data.stats.total_visits > 0 || res.data.stats.total_blocked > 0 ) )
     1114                                                        || ( res.data.mcp_stats && res.data.mcp_stats.total_requests > 0 )
     1115                                                        || ( res.data.referral_stats && res.data.referral_stats.total_visits > 0 )
     1116                                                )
    11141117                                                && $( '#moai-av-dashboard-empty' ).length
    11151118                                        ) {
  • miniorange-ai-visibility/trunk/includes/common/controllers/class-analytics-controller.php

    r3670315 r3694415  
    1313use MOAI_Visibility\Includes\Common\Handlers\Analytics_Handler;
    1414use MOAI_Visibility\Includes\Common\Handlers\Ai_Inventory_Handler;
     15use MOAI_Visibility\Includes\Common\Services\Settings_Service;
    1516use MOAI_Visibility\Views\Src\Common\Pages\Analytics\Analytics_View;
    1617
    … …  
    9091                }
    9192
    92                 ( new Analytics_View( $this->handler->get_initial_data() ) )->render();
     93                $data                     = $this->handler->get_initial_data();
     94                $data['tracking_enabled'] = ( new Settings_Service() )->is_tracking_enabled();
     95                ( new Analytics_View( $data ) )->render();
    9396        }
    9497
  • miniorange-ai-visibility/trunk/includes/common/hooks/class-hooks.php

    r3602565 r3694415  
    1111
    1212use MOAI_Visibility\Includes\Common\Constants\Plugin_Constants;
     13use MOAI_Visibility\Includes\Common\Services\Settings_Service;
    1314
    1415if ( ! defined( 'ABSPATH' ) ) {
    … …  
    5758                $dashboard_link = sprintf(
    5859                        '<a href="%s">%s</a>',
    59                         esc_url( admin_url( 'admin.php?page=' . Plugin_Constants::MENU_SLUG_ANALYTICS ) ),
    60                         esc_html__( 'Analytics', 'miniorange-ai-visibility' )
     60                        esc_url( admin_url( 'admin.php?page=' . Plugin_Constants::MENU_SLUG_VISIBILITY ) ),
     61                        esc_html__( 'Get started', 'miniorange-ai-visibility' )
    6162                );
    6263
    … …  
    8485                }
    8586
     87                $tracking_enabled = ( new Settings_Service() )->is_tracking_enabled();
     88
    8689                delete_option( Plugin_Constants::OPTION_ACTIVATION_NOTICE );
    8790                ?>
    … …  
    97100                                ?>
    98101                                </strong>
    99                                 <?php esc_html_e( 'Open the dashboard to review your site\'s AI discovery signals.', 'miniorange-ai-visibility' ); ?>
     102                                <?php esc_html_e( 'See which AI bots visit your site, control their access, and make your content easier for AI assistants to find.', 'miniorange-ai-visibility' ); ?>
    100103                        </p>
    101104                        <p>
    102                                 <a href="<?php echo esc_url( admin_url( 'admin.php?page=' . Plugin_Constants::MENU_SLUG_ANALYTICS ) ); ?>" class="button button-primary">
     105                                <?php if ( $tracking_enabled ) : ?>
     106                                        <?php esc_html_e( 'Crawler tracking is already on—no API key or additional setup is required. Activity will appear after AI bots or visitors from AI assistants reach your site.', 'miniorange-ai-visibility' ); ?>
     107                                <?php else : ?>
     108                                        <?php esc_html_e( 'Crawler tracking is currently off. You can turn it on from the AI Crawlers page.', 'miniorange-ai-visibility' ); ?>
     109                                <?php endif; ?>
     110                        </p>
     111                        <p>
     112                                <a href="<?php echo esc_url( admin_url( 'admin.php?page=' . Plugin_Constants::MENU_SLUG_VISIBILITY ) ); ?>" class="button button-primary">
     113                                        <?php esc_html_e( 'Check Your Homepage', 'miniorange-ai-visibility' ); ?>
     114                                </a>
     115                                <a href="<?php echo esc_url( admin_url( 'admin.php?page=' . Plugin_Constants::MENU_SLUG_ANALYTICS ) ); ?>" class="button">
    103116                                        <?php esc_html_e( 'View Analytics', 'miniorange-ai-visibility' ); ?>
    104117                                </a>
  • miniorange-ai-visibility/trunk/miniorange-ai-visibility.php

    r3670315 r3694415  
    44 * Plugin URI:        https://plugins.miniorange.com/
    55 * Description:       Monitor AI crawlers and MCP traffic, inventory agents and tools, control access, and improve AI visibility with llms.txt and readiness checks.
    6  * Version:           1.8.0
     6 * Version:           1.8.1
    77 * Requires at least: 5.0
    88 * Requires PHP:      7.4
  • miniorange-ai-visibility/trunk/readme.txt

    r3670315 r3694415  
    55Tested up to: 7.0.1
    66Requires PHP: 7.4
    7 Stable tag: 1.8.0
     7Stable tag: 1.8.1
    88License: Expat
    99License URI: https://plugins.miniorange.com/mit-license
    … …  
    5353**Analytics**
    5454
    55 * Dual crawler + MCP summary cards on one dashboard.
     55* After activation, a getting-started panel explains that crawler tracking is already on and points you to a homepage Visibility Score check.
     56* Dual crawler + MCP summary cards on one dashboard (MCP cards appear after AI tool traffic is recorded).
    5657* Charts for crawler requests over time and traffic by category; MCP timeline and server charts.
    5758* Top AI crawlers, top MCP tools, and most-crawled pages.
    … …  
    379380== Changelog ==
    380381
     382= 1.8.1 =
     383* First-run Analytics guidance: status that crawler tracking is on, why metrics show 0, and a primary **Check Your Homepage** action.
     384* Activation notice now explains the plugin purpose and links to a homepage Visibility Score check (plus Analytics).
     385* Empty dashboard states include next steps (check a page, set up llms.txt) instead of only waiting for crawler traffic.
     386* MCP summary cards stay hidden until AI tool (MCP) traffic is recorded, with a short note that MCP is optional.
     387* Empty **Visits from AI** no longer links to a missing details section.
     388
    381389= 1.8.0 =
    382390* Added **Visits from AI** — detect human traffic referred by ChatGPT, Perplexity, Gemini, Claude, Copilot, and similar assistants via HTTP referrer and UTM parameters.
    … …  
    527535== Upgrade Notice ==
    528536
     537= 1.8.1 =
     538Improves first-run Analytics: tracking status, empty-state next steps, homepage Visibility Score CTA, and optional MCP cards until tool traffic appears.
     539
    529540= 1.8.0 =
    530541Adds Visits from AI (referral detection + Analytics) and IndexNow pings under Discoverability. Enable IndexNow from Discoverability → IndexNow after upgrading.
  • miniorange-ai-visibility/trunk/views/src/common/pages/analytics/class-analytics-view.php

    r3670315 r3694415  
    114114                ( new App_Header_View(
    115115                        __( 'Analytics', 'miniorange-ai-visibility' ),
    116                         __( 'Crawlers, MCP, and Visits from AI on your site', 'miniorange-ai-visibility' ),
     116                        __( 'See which AI bots visit your site, what they access, and which AI assistants send visitors.', 'miniorange-ai-visibility' ),
    117117                        $header_actions
    118118                ) )->render();
    119119
    120                 $stats    = $this->data['stats'] ?? array();
    121                 $has_data = ! empty( $stats['total_visits'] ) || ! empty( $stats['total_blocked'] ) || ! empty( $this->data['mcp_stats']['total_requests'] ) || ! empty( $this->data['referral_stats']['total_visits'] );
     120                $stats            = $this->data['stats'] ?? array();
     121                $tracking_enabled = ! array_key_exists( 'tracking_enabled', $this->data ) || ! empty( $this->data['tracking_enabled'] );
     122                $has_data         = ! empty( $stats['total_visits'] ) || ! empty( $stats['total_blocked'] ) || ! empty( $this->data['mcp_stats']['total_requests'] ) || ! empty( $this->data['referral_stats']['total_visits'] );
    122123                ?>
    123124                <div class="moai-av-view-container" id="moai-av-section-analytics">
    124125                        <div class="moai-av-section">
     126                                <?php if ( ! $has_data ) : ?>
     127                                        <?php $this->render_getting_started( $tracking_enabled ); ?>
     128                                <?php endif; ?>
     129
    125130                                <?php $this->render_range_filterbar(); ?>
    126131
    … …  
    140145                                                                <svg><use href="#moai-i-bot"/></svg>
    141146                                                        </div>
    142                                                         <h4><?php esc_html_e( 'Waiting for your first AI activity', 'miniorange-ai-visibility' ); ?></h4>
    143                                                         <p><?php esc_html_e( 'Once AI crawlers, MCP clients, or AI-referred visitors reach your site, activity will appear here automatically.', 'miniorange-ai-visibility' ); ?></p>
     147                                                        <h4><?php esc_html_e( 'No AI activity has been recorded yet', 'miniorange-ai-visibility' ); ?></h4>
     148                                                        <p><?php esc_html_e( 'This is normal for a new installation. These numbers will update automatically after AI bots or visitors from AI assistants reach your site.', 'miniorange-ai-visibility' ); ?></p>
     149                                                        <div class="moai-av-empty-state__actions">
     150                                                                <a class="moai-av-btn moai-av-btn-primary" href="<?php echo esc_url( admin_url( 'admin.php?page=' . Plugin_Constants::MENU_SLUG_VISIBILITY ) ); ?>">
     151                                                                        <?php esc_html_e( 'Check a Page Now', 'miniorange-ai-visibility' ); ?>
     152                                                                </a>
     153                                                                <a class="moai-av-btn moai-av-btn-ghost" href="<?php echo esc_url( admin_url( 'admin.php?page=' . Plugin_Constants::MENU_SLUG_DISCOVERABILITY ) ); ?>">
     154                                                                        <?php esc_html_e( 'Set Up llms.txt', 'miniorange-ai-visibility' ); ?>
     155                                                                </a>
     156                                                        </div>
    144157                                                </div>
    145158                                        <?php else : ?>
    … …  
    255268
    256269        /**
     270         * Render first-run guidance above an empty dashboard.
     271         *
     272         * @param bool $tracking_enabled Whether crawler tracking is enabled.
     273         * @return void
     274         */
     275        private function render_getting_started( bool $tracking_enabled ): void {
     276                $visibility_url = admin_url( 'admin.php?page=' . Plugin_Constants::MENU_SLUG_VISIBILITY );
     277                $settings_url   = admin_url( 'admin.php?page=' . Plugin_Constants::MENU_SLUG_SETTINGS );
     278                ?>
     279                <div class="moai-av-card moai-av-getting-started">
     280                        <div class="moai-av-getting-started__content">
     281                                <div class="moai-av-getting-started__status<?php echo esc_attr( $tracking_enabled ? ' is-active' : ' is-inactive' ); ?>">
     282                                        <span class="moai-av-getting-started__status-dot" aria-hidden="true"></span>
     283                                        <?php echo $tracking_enabled ? esc_html__( 'Crawler tracking is on', 'miniorange-ai-visibility' ) : esc_html__( 'Crawler tracking is off', 'miniorange-ai-visibility' ); ?>
     284                                </div>
     285                                <h2><?php esc_html_e( 'Start with an AI visibility check', 'miniorange-ai-visibility' ); ?></h2>
     286                                <p>
     287                                        <?php
     288                                        if ( $tracking_enabled ) {
     289                                                esc_html_e( 'No setup or API key is required for tracking. Your analytics are 0 because no AI activity has been recorded yet—not because the plugin failed.', 'miniorange-ai-visibility' );
     290                                        } else {
     291                                                esc_html_e( 'Tracking is currently paused, so new AI crawler visits will not appear in Analytics.', 'miniorange-ai-visibility' );
     292                                        }
     293                                        ?>
     294                                </p>
     295                                <p class="moai-av-getting-started__mcp">
     296                                        <?php esc_html_e( 'AI tool traffic (MCP) is optional and will remain empty unless an AI tool is connected to your site.', 'miniorange-ai-visibility' ); ?>
     297                                </p>
     298                        </div>
     299                        <div class="moai-av-getting-started__actions">
     300                                <a class="moai-av-btn moai-av-btn-primary" href="<?php echo esc_url( $visibility_url ); ?>">
     301                                        <?php esc_html_e( 'Check Your Homepage', 'miniorange-ai-visibility' ); ?>
     302                                </a>
     303                                <?php if ( ! $tracking_enabled ) : ?>
     304                                        <a class="moai-av-btn moai-av-btn-ghost" href="<?php echo esc_url( $settings_url ); ?>">
     305                                                <?php esc_html_e( 'Turn On Tracking', 'miniorange-ai-visibility' ); ?>
     306                                        </a>
     307                                <?php endif; ?>
     308                        </div>
     309                </div>
     310                <?php
     311        }
     312
     313        /**
    257314         * Shared date-range filter bar.
    258315         *
    … …  
    732789         */
    733790        private function render_dual_summary( array $stats, array $mcp_stats, array $referral_stats = array() ): void {
    734                 $comparison = (array) ( $this->data['comparison'] ?? array() );
     791                $comparison        = (array) ( $this->data['comparison'] ?? array() );
    735792                $urls              = (array) ( $this->data['urls'] ?? array() );
    736793                $tracker           = (string) ( $urls['mcp_tracker'] ?? admin_url( 'admin.php?page=' . Plugin_Constants::MENU_SLUG_MCP_TRACKER ) );
    … …  
    738795                $referral_anchor   = '#moai-av-section-referrals';
    739796                $top_page          = (string) ( $referral_stats['top_page'] ?? '' );
    740                 ?>
    741                 <div class="moai-av-dash-groups" id="moai-av-stats">
     797                $has_mcp_activity  = ! empty( $mcp_stats['total_requests'] );
     798                $has_ai_referrals  = ! empty( $referral_stats['total_visits'] );
     799                $summary_class     = $has_mcp_activity ? '' : ' moai-av-dash-groups--two';
     800                ?>
     801                <div class="moai-av-dash-groups<?php echo esc_attr( $summary_class ); ?>" id="moai-av-stats">
    742802                        <div class="moai-av-dash-group">
    743803                                <div class="moai-av-dash-group__head">
    … …  
    783843                                </div>
    784844                        </div>
     845                        <?php if ( $has_mcp_activity ) : ?>
    785846                        <div class="moai-av-dash-group">
    786847                                <div class="moai-av-dash-group__head">
    … …  
    826887                                </div>
    827888                        </div>
     889                        <?php endif; ?>
    828890                        <div class="moai-av-dash-group">
    829891                                <div class="moai-av-dash-group__head">
    … …  
    834896                                                <?php esc_html_e( 'Visits from AI', 'miniorange-ai-visibility' ); ?>
    835897                                        </div>
    836                                         <a class="moai-av-panel-link" href="<?php echo esc_url( $referral_anchor ); ?>"><?php esc_html_e( 'View details →', 'miniorange-ai-visibility' ); ?></a>
     898                                        <?php if ( $has_ai_referrals ) : ?>
     899                                                <a class="moai-av-panel-link" href="<?php echo esc_url( $referral_anchor ); ?>"><?php esc_html_e( 'View details →', 'miniorange-ai-visibility' ); ?></a>
     900                                        <?php else : ?>
     901                                                <span class="moai-av-dash-metric__hint"><?php esc_html_e( 'Waiting for visits', 'miniorange-ai-visibility' ); ?></span>
     902                                        <?php endif; ?>
    837903                                </div>
    838904                                <div class="moai-av-dash-metrics">
Note: See TracChangeset for help on using the changeset viewer.