# Bug: Archived Data Analytics Dropdown Missing After v1.12.4

## What Was Reported

User reported: WooCommerce Analytics > Overview page stopped showing the "Archived Data Analytics" filter dropdown after upgrading free plugin from v1.12.3 → v1.12.4.

Old version (v1.12.3) on "Cooing Arithmetic" site: dropdown visible, working.
New version (v1.12.4) on "ArchiveMaster" local site: dropdown missing.

## Root Cause (Confirmed via Investigation)

**NOT a code regression in v1.12.4.** Two separate issues found:

### Issue 1 — Primary: `archm_analytics_sync_enabled = false/0`

The `ArchivedDataFilter` React component (`src/components/ArchivedDataFilter/ArchivedDataFilter.jsx`, line 450) explicitly returns `null` when `syncEnabled` is falsy:

```js
if (!isSyncEnabled) {
    return null;
}
```

The `syncEnabled` value comes from `wp_localize_script` in Pro plugin's `AnalyticsIntegration.php`:

```php
wp_localize_script('archm-analytics-sync', 'archmAnalytics', [
    'syncEnabled' => get_option('archm_analytics_sync_enabled', false),
]);
```

On the local dev test site (`archivemaster.local`), `archm_analytics_sync_enabled` was never set to `true` (fresh install default = `false`). On the old "Cooing Arithmetic" site, the option was previously enabled via plugin settings — hence dropdown showed.

**This is not a regression. It is a configuration difference between sites.**

### Issue 2 — Secondary: Pro Plugin License Gate

`AnalyticsIntegration` class (Pro plugin) only loads inside `load_admin_files()`, which is called only when `$this->license_status === true`. Without a valid Pro license, the analytics script is never enqueued at all — `archmAnalytics` object undefined — React component never mounts.

This applies to local dev sites without an active license.

## What v1.12.4 Actually Changed

Only two files had real code changes (all others were CRLF/LF line-ending normalization):

### 1. `archive-master.php`
- Lowered PHP requirement: 8.0 → 7.4
- Added file-level PHP version guard (returns early with admin notice if PHP < 7.4)
- Removed PHP 8.0 check from `init_plugin()` method
- Added `require_once __DIR__ . '/includes/polyfills.php'`

### 2. `includes/Admin/Assets.php`
- `private mixed $plugin_now` → `private $plugin_now` (PHP 7.4: `mixed` type requires PHP 8.0)
- `str_contains($page, 'master-archives')` → `false !== strpos($page, 'master-archives')` (PHP 7.4 compat)

**Neither change affects analytics at all.**

## Verification

Confirmed fix by directly setting `archm_analytics_sync_enabled = true` via PHP and reloading analytics page — dropdown appeared immediately with v1.12.4 code intact.

## Acceptance Criteria

- [x] Analytics dropdown appears when `archm_analytics_sync_enabled = true`
- [x] Analytics dropdown hidden when `archm_analytics_sync_enabled = false` (by design)
- [x] v1.12.4 code changes verified to not affect analytics flow
- [x] Pro plugin `AnalyticsIntegration` correctly enqueues `analytics-sync.js` from free plugin build dir
- [x] Analytics data displays correctly for each filter mode (manual QA — see test plan)
