Plugin Directory

Changeset 3368533


Ignore:
Timestamp:
09/26/2025 02:12:55 PM (6 months ago)
Author:
PAGEmachine
Message:

[TASK] Updated uninstall. Updated Readme. Log when debug enabled. Version bump.

Location:
aigude-tools/trunk
Files:
1 added
1 deleted
3 edited

Legend:

Unmodified
Added
Removed
  • aigude-tools/trunk/README.txt

    r3367867 r3368533  
    22Contributors: pagemachine, maltamirano
    33Tags: ai, alt text, accessibility, images, seo
    4 Stable tag: 2.1.0
     4Stable tag: 2.1.1
    55Requires at least: 6.0
    66Tested up to: 6.8
     
    7676== Changelog ==
    7777
     78= 2.1.1 =
     79* Updated uninstall routine
     80* Debug: log only when debugging is enabled
     81
    7882= 2.1.0 =
    7983* Added server-side prompt and placeholders translation
     
    123127  - `_wp_attachment_image_alt` (final alt text)
    124128  - `_aigude_alt_suggestion` (last generated suggestion)
    125   - `_aigude_alt_translation_<lang>` (optional translations)
     129 
    126130
    127131== Location of Processing ==
     
    140144It deletes:
    141145- Options: `aigude_alt_servers`, `aigude_target_language`
    142 - Attachment meta starting with `_aigude_alt_` (e.g., `_aigude_alt_suggestion`, `_aigude_alt_translation_*`).
     146- Attachment meta starting with `_aigude_alt_` (e.g., `_aigude_alt_suggestion`).
    143147
    144148On multisite, the uninstaller runs for every site in the network.
  • aigude-tools/trunk/aigude-tools.php

    r3367867 r3368533  
    44 * Plugin URI:        https://wordpress.org/plugins/aigude-tools/
    55 * Description:       Generate and manage image alt text with AI — supports bulk actions, custom multilingual prompts, and full Media Library integration.
    6  * Version:           2.1.0
     6 * Version:           2.1.1
    77 * Requires at least: 6.0
    88 * Requires PHP:      7.4
     
    314314        // Build v2 prompt_spec JSON (DeepL codes; per-token lang and translatable)
    315315        $prompt_spec = self::build_prompt_spec($prompt, $prompt_lang, $tpl_src_lang, $id);
    316         // TEMP LOG – TO-REMOVE-BY-OWNER: inspect prompt_spec sent (single)
    317         if (defined('WP_DEBUG') && WP_DEBUG) {
     316        // LOG: inspect prompt_spec sent (single)
     317        if (self::debug_enabled()) {
    318318            error_log('[AiGude Tools] prompt_spec(single) id=' . $id . ': ' . wp_json_encode($prompt_spec));
    319319        }
     
    431431            // Build v2 prompt_spec JSON (DeepL codes; per-token lang and translatable)
    432432            $prompt_spec = self::build_prompt_spec($tpl_for_expansion, $prompt_lang, $tpl_src_lang, $id);
    433             // TEMP LOG – TO-REMOVE-BY-OWNER: inspect prompt_spec sent (bulk per id)
    434             if (defined('WP_DEBUG') && WP_DEBUG) {
     433            // LOG: inspect prompt_spec sent (bulk per id)
     434            if (self::debug_enabled()) {
    435435                error_log('[AiGude Tools] prompt_spec(bulk) id=' . $id . ': ' . wp_json_encode($prompt_spec));
    436436            }
     
    724724                'timeout' => 120,
    725725        ]);
     726    }
     727
     728    /** Determine whether debug logging is enabled for this plugin. */
     729    private static function debug_enabled(): bool {
     730        // Standard WordPress flags
     731        $wp_debug    = defined('WP_DEBUG') && WP_DEBUG;
     732        $script_debug = defined('SCRIPT_DEBUG') && SCRIPT_DEBUG;
     733
     734        // Environment variable (e.g., Docker compose WORDPRESS_DEBUG=1)
     735        $env = getenv('WORDPRESS_DEBUG');
     736        $env_debug = is_string($env) ? filter_var($env, FILTER_VALIDATE_BOOLEAN) : false;
     737
     738        return ($wp_debug || $script_debug || $env_debug) === true;
    726739    }
    727740
  • aigude-tools/trunk/uninstall.php

    r3361969 r3368533  
    1818    delete_option( 'aigude_target_language' );
    1919
    20     // Known meta keys created by this plugin
     20    // Known meta keys created by this plugin (v2: no per-language translation metas)
    2121    $meta_keys = array( '_aigude_alt_suggestion' );
    22     $langs = array( 'en', 'de', 'es', 'fr', 'it' );
    23     foreach ( $langs as $lang ) {
    24         $meta_keys[] = '_aigude_alt_translation_' . $lang;
    25     }
    2622
    2723    foreach ( $meta_keys as $mk ) {
Note: See TracChangeset for help on using the changeset viewer.