| @@ -7,8 +7,11 @@ | ||
| 7 | 7 | namespace Extendify; |
| 8 | 8 | |
| 9 | 9 | defined('ABSPATH') || die('No direct access.'); |
| 10 | 10 | |
| 11 | +use Extendify\Mcp\Availability; | |
| 12 | +use Extendify\Mcp\Connections; | |
| 13 | +use Extendify\Mcp\Log; | |
| 11 | 14 | use Extendify\Shared\Services\Sanitizer; |
| 12 | 15 | use Extendify\PartnerData; |
| 13 | 16 | |
| 14 | 17 | /** |
| @@ -19,9 +22,9 @@ | ||
| 19 | 22 | class Insights |
| 20 | 23 | { |
| 21 | 24 | /** |
| 22 | 25 | * Option name storing each site's A/B test assignments, keyed by the |
| 23 | - * screen/feature under test (e.g. 'AutoLaunch.ShowTitle'). | |
| 26 | + * screen/feature under test (e.g. 'AutoLaunch.HideEnhanceAI'). | |
| 24 | 27 | * |
| 25 | 28 | * @var string |
| 26 | 29 | */ |
| 27 | 30 | // phpcs:ignore PSR12.Properties.ConstantVisibility.NotFound |
| @@ -35,13 +38,10 @@ | ||
| 35 | 38 | */ |
| 36 | 39 | // phpcs:ignore PSR12.Properties.ConstantVisibility.NotFound |
| 37 | 40 | const AVAILABLE_TESTS = [ |
| 38 | 41 | 'AutoLaunch.HideEnhanceAI', |
| 39 | - 'AutoLaunch.ShowTitle', | |
| 40 | - 'AutoLaunch.SubmitOutside', | |
| 41 | 42 | 'AutoLaunch.SubmitCreateWebsite', |
| 42 | 43 | 'AutoLaunch.DescriptionPlaceholderLaw', |
| 43 | - 'AutoLaunch.HeaderParagraphOld', | |
| 44 | 44 | 'AutoLaunch.MigrateScreen', |
| 45 | 45 | ]; |
| 46 | 46 | |
| 47 | 47 | /** |
| @@ -79,9 +79,9 @@ | ||
| 79 | 79 | * tests. Each active test is rolled once; |
| 80 | 80 | * inactive tests are dropped. |
| 81 | 81 | * |
| 82 | 82 | * @param string[] $activeTests Active tests in `Name:Percentage` form |
| 83 | - * (e.g. 'AutoLaunch.ShowTitle:20'); a bare | |
| 83 | + * (e.g. 'AutoLaunch.HideEnhanceAI:20'); a bare | |
| 84 | 84 | * name defaults to a 50% rollout. |
| 85 | 85 | * @return void |
| 86 | 86 | */ |
| 87 | 87 | public static function setup(array $activeTests = []) |
| @@ -152,8 +152,13 @@ | ||
| 152 | 152 | 'lastUpdatedPost' => $this->getLastUpdatedPost('post'), |
| 153 | 153 | 'lastLoginAdmin' => $this->getLastAdminLogin(), |
| 154 | 154 | 'hasImprint' => $this->hasImprint(), |
| 155 | 155 | ]); |
| 156 | + | |
| 157 | + if (Availability::offered()) { | |
| 158 | + $insights['mcp'] = ['usage' => Log::usage(), 'connections' => Connections::count()]; | |
| 159 | + } | |
| 160 | + | |
| 156 | 161 | return $insights; |
| 157 | 162 | }); |
| 158 | 163 | } |
| 159 | 164 | |