PluginProbe
BetterDocs – AI Documentation, Knowledge Base, MCP Server, Docs, Wikis, FAQ & Chatbot / 4.9.4
BetterDocs – AI Documentation, Knowledge Base, MCP Server, Docs, Wikis, FAQ & Chatbot v4.9.4
4.9.4 4.9.3 4.9.2 4.9.1 4.9.0 4.8.2 4.8.1 4.8.0 4.7.0 4.6.2 4.6.1 4.6.0 4.5.6 4.5.5 4.5.4 4.5.3 4.5.2 4.5.1 4.5.0 4.4.1 4.4.0 3.3.4 3.4.0 3.4.1 3.4.2 All 202 releases
← All changes | includes/Utils/AIUsage.php +12 -2 4.9.1 → 4.9.4 View file →
@@ -148,13 +148,17 @@
148 148 * - generate-doc / generate-outline / expand-outline (and any future prompt-driven
149 149 * action) → prompt
150 150 *
151 151 * @param array<string,int> $actions
152 - * @return array{prompt:int,source:int,git:int}
152 + * @return array{prompt:int,source:int,git:int,attachment:int,recording:int}
153 153 */
154 154 protected static function write_with_ai_modes( $actions ) {
155 - $modes = [ 'prompt' => 0, 'source' => 0, 'git' => 0 ];
155 + $modes = [ 'prompt' => 0, 'source' => 0, 'git' => 0, 'attachment' => 0, 'recording' => 0 ];
156 156
157 + // Anything unrecognised lands in `prompt`, which is why `attachment` and
158 + // `recording` need explicit arms: without them every file-based
159 + // generation was reported as a plain prompt, making the attachment tab
160 + // look unused in the insights snapshot.
157 161 foreach ( (array) $actions as $action => $count ) {
158 162 $count = (int) $count;
159 163 if ( 'from-source' === $action ) {
160 164 $modes['source'] += $count;
@@ -159,8 +163,14 @@
159 163 if ( 'from-source' === $action ) {
160 164 $modes['source'] += $count;
161 165 } elseif ( 'from-git' === $action ) {
162 166 $modes['git'] += $count;
167 + } elseif ( 'from-attachment' === $action ) {
168 + $modes['attachment'] += $count;
169 + } elseif ( 'from-recording' === $action || 'transcribe-attachment' === $action ) {
170 + // `from-recording` is the generation. `transcribe-attachment` is
171 + // only kept so counts recorded before that split still land here.
172 + $modes['recording'] += $count;
163 173 } else {
164 174 $modes['prompt'] += $count;
165 175 }
166 176 }