Plugin Directory

Changeset 3493349


Ignore:
Timestamp:
03/28/2026 01:43:53 PM (8 days ago)
Author:
altpilot
Message:

Update to version 1.0.5 from GitHub

Location:
altpilot
Files:
2 added
10 edited
1 copied

Legend:

Unmodified
Added
Removed
  • altpilot/tags/1.0.5/altpilot.php

    r3412405 r3493349  
    88 * Plugin URI: https://altpilot.ai
    99 * Description: Alt Text AI Generator - Powerful and easy-to-use . Automatically generate image alt texts using AI and improve your SEO and accessibility.
    10  * Version: 1.0.4
     10 * Version: 1.0.5
    1111 * Requires at least: 6.3
    1212 * Requires PHP: 7.4
     
    1616 * Text Domain: altpilot
    1717 * Domain Path: /languages
    18  * Tested up to: 6.8
     18 * Tested up to: 6.9
    1919 */
    2020
    2121namespace AltPilot;
    2222
    23 use AltPilot\App\Classes\LogTable;
    2423use Exception;
    2524
     
    101100            );
    102101        }
    103 
    104         // Create a log table if it does not exist
    105         new Log();
    106102
    107103    }
  • altpilot/tags/1.0.5/app/classes/Filters.php

    r3363856 r3493349  
    227227        }
    228228
     229        $modifiedContent = str_replace('<?xml encoding="UTF-8">', '', $modifiedContent);
     230
    229231        // Remove the xml encoding tag from the output
    230         return str_replace('<?xml encoding="UTF-8">', '', $modifiedContent);
     232        return preg_replace('/<p>\s*(\[[^\]]+\])\s*<\/p>/', '$1', $modifiedContent);
    231233    }
    232234
  • altpilot/tags/1.0.5/app/classes/Image.php

    r3363856 r3493349  
    171171        }
    172172
     173        // Find id in references
     174        $reference = Reference::read(['img_url' => $url]);
     175        if ($reference && !empty($reference['attachment_id'])) {
     176            return (int)$reference['attachment_id'];
     177        }
     178
    173179        // Get all attachment IDs from the database
    174180        $attachments = Image::get_ids();
     
    183189            $attachment_metadata = wp_get_attachment_metadata( $attachment_id );
    184190
     191            // Get the main file URL for the attachment and check if it matches the provided URL
     192            if ( isset( $attachment_metadata['file'] ) && str_contains($url, $attachment_metadata['file'])) {
     193
     194                // Create a reference for future lookups
     195                Reference::create([
     196                    'attachment_id' => $attachment_id,
     197                    'img_url' => $url,
     198                ]);
     199
     200                return $attachment_id;
     201
     202            }
     203
    185204            // Get the attachment's URL for each size
    186205            $sizes = $attachment_metadata['sizes'] ?? [];
     
    189208                // Check if the URL matches the attachment's URL
    190209                if ( isset( $size['file'] ) && str_contains($url, $size['file'])) {
     210
     211                    // Create a reference for future lookups
     212                    Reference::create([
     213                        'attachment_id' => $attachment_id,
     214                        'img_url' => $url,
     215                    ]);
     216
    191217                    return $attachment_id;
    192218                }
  • altpilot/tags/1.0.5/changelog.txt

    r3412405 r3493349  
     1= 1.0.5 =
     2* Improved performance of the plugin by optimizing database queries.
     3
    14= 1.0.4 =
    25* Refactor readme text
  • altpilot/tags/1.0.5/readme.txt

    r3412405 r3493349  
    33Tags: alt, AI
    44Requires at least: 6.3
    5 Tested up to: 6.8
    6 Stable tag: 1.0.4
     5Tested up to: 6.9
     6Stable tag: 1.0.5
    77Requires PHP: 7.4
    88License: GPLv2 or later
     
    8181== Changelog ==
    8282
     83= 1.0.5 =
     84* Improved performance of the plugin by optimizing database queries.
     85
    8386= 1.0.4 =
    8487* Refactor readme text
     
    100103== Upgrade Notice =
    101104
     105= 1.0.5 =
     106* Improved performance of the plugin by optimizing database queries.
     107
    102108= 1.0.4 =
    103109* Refactor readme text
  • altpilot/trunk/altpilot.php

    r3412405 r3493349  
    88 * Plugin URI: https://altpilot.ai
    99 * Description: Alt Text AI Generator - Powerful and easy-to-use . Automatically generate image alt texts using AI and improve your SEO and accessibility.
    10  * Version: 1.0.4
     10 * Version: 1.0.5
    1111 * Requires at least: 6.3
    1212 * Requires PHP: 7.4
     
    1616 * Text Domain: altpilot
    1717 * Domain Path: /languages
    18  * Tested up to: 6.8
     18 * Tested up to: 6.9
    1919 */
    2020
    2121namespace AltPilot;
    2222
    23 use AltPilot\App\Classes\LogTable;
    2423use Exception;
    2524
     
    101100            );
    102101        }
    103 
    104         // Create a log table if it does not exist
    105         new Log();
    106102
    107103    }
  • altpilot/trunk/app/classes/Filters.php

    r3363856 r3493349  
    227227        }
    228228
     229        $modifiedContent = str_replace('<?xml encoding="UTF-8">', '', $modifiedContent);
     230
    229231        // Remove the xml encoding tag from the output
    230         return str_replace('<?xml encoding="UTF-8">', '', $modifiedContent);
     232        return preg_replace('/<p>\s*(\[[^\]]+\])\s*<\/p>/', '$1', $modifiedContent);
    231233    }
    232234
  • altpilot/trunk/app/classes/Image.php

    r3363856 r3493349  
    171171        }
    172172
     173        // Find id in references
     174        $reference = Reference::read(['img_url' => $url]);
     175        if ($reference && !empty($reference['attachment_id'])) {
     176            return (int)$reference['attachment_id'];
     177        }
     178
    173179        // Get all attachment IDs from the database
    174180        $attachments = Image::get_ids();
     
    183189            $attachment_metadata = wp_get_attachment_metadata( $attachment_id );
    184190
     191            // Get the main file URL for the attachment and check if it matches the provided URL
     192            if ( isset( $attachment_metadata['file'] ) && str_contains($url, $attachment_metadata['file'])) {
     193
     194                // Create a reference for future lookups
     195                Reference::create([
     196                    'attachment_id' => $attachment_id,
     197                    'img_url' => $url,
     198                ]);
     199
     200                return $attachment_id;
     201
     202            }
     203
    185204            // Get the attachment's URL for each size
    186205            $sizes = $attachment_metadata['sizes'] ?? [];
     
    189208                // Check if the URL matches the attachment's URL
    190209                if ( isset( $size['file'] ) && str_contains($url, $size['file'])) {
     210
     211                    // Create a reference for future lookups
     212                    Reference::create([
     213                        'attachment_id' => $attachment_id,
     214                        'img_url' => $url,
     215                    ]);
     216
    191217                    return $attachment_id;
    192218                }
  • altpilot/trunk/changelog.txt

    r3412405 r3493349  
     1= 1.0.5 =
     2* Improved performance of the plugin by optimizing database queries.
     3
    14= 1.0.4 =
    25* Refactor readme text
  • altpilot/trunk/readme.txt

    r3412405 r3493349  
    33Tags: alt, AI
    44Requires at least: 6.3
    5 Tested up to: 6.8
    6 Stable tag: 1.0.4
     5Tested up to: 6.9
     6Stable tag: 1.0.5
    77Requires PHP: 7.4
    88License: GPLv2 or later
     
    8181== Changelog ==
    8282
     83= 1.0.5 =
     84* Improved performance of the plugin by optimizing database queries.
     85
    8386= 1.0.4 =
    8487* Refactor readme text
     
    100103== Upgrade Notice =
    101104
     105= 1.0.5 =
     106* Improved performance of the plugin by optimizing database queries.
     107
    102108= 1.0.4 =
    103109* Refactor readme text
Note: See TracChangeset for help on using the changeset viewer.