PluginProbe
Imagify Image Optimization: Optimize Images | Compress & Convert to WebP/AVIF / trunk
Imagify Image Optimization: Optimize Images | Compress & Convert to WebP/AVIF vtrunk
2.3.4 2.3.3 2.3.2 2.3.1 2.3.0 2.2.9 2.2.8 trunk 1.10 1.3.3 1.3.4 1.3.5 1.3.5.1 1.3.5.2 1.3.6 1.3.6.1 1.4 1.4.1 1.4.2 1.4.3 1.4.4 1.4.5 1.4.6 1.4.7 1.5 All 103 releases
← All changes | classes/Tracking/McpTracking.php +6 -1 2.3.0 → trunk View file →
@@ -83,11 +83,15 @@
83 83 *
84 84 * @param string $ability_id Ability slug, e.g. `imagify/get-stats`.
85 85 * @param string $ability_name Human-readable ability label.
86 86 * @param float $start_time microtime(true) captured before execute() ran.
87 + * @param bool $is_preview True when the call was a credit-consumption preview
88 + * (`confirmation_required`/`insufficient_quota`/`invalid_api_key`)
89 + * rather than a real execution. Defaults to false so
90 + * non-quota-sensitive abilities keep their current behavior.
87 91 * @return void
88 92 */
89 - public function track_ability_executed( string $ability_id, string $ability_name, float $start_time ): void {
93 + public function track_ability_executed( string $ability_id, string $ability_name, float $start_time, bool $is_preview = false ): void {
90 94 if ( ! $this->can_track() ) {
91 95 return;
92 96 }
93 97
@@ -96,8 +100,9 @@
96 100 [
97 101 'ability_id' => $ability_id,
98 102 'ability_name' => $ability_name,
99 103 'execution_time_ms' => round( ( microtime( true ) - $start_time ) * 1000, 2 ),
104 + 'is_preview' => $is_preview,
100 105 ]
101 106 );
102 107
103 108 $this->mixpanel->track_direct( 'MCP Ability Executed', $event_data );