Plugin Directory

Changeset 3473025


Ignore:
Timestamp:
03/02/2026 07:09:46 PM (4 weeks ago)
Author:
beautifulplugins
Message:

Release 1.1.0

Location:
artificial-image-generator
Files:
12 added
2 deleted
41 edited
1 copied

Legend:

Unmodified
Added
Removed
  • artificial-image-generator/assets/blueprints/blueprint.json

    r3425585 r3473025  
    22  "landingPage": "/wp-admin/admin.php?page=artificial-image-generator",
    33  "preferredVersions": {
    4     "php": "7.4",
    5     "wp": "5.2"
     4    "php": "8.2",
     5    "wp": "5.9"
    66  },
    77  "phpExtensionBundles": [
  • artificial-image-generator/tags/1.1.0/artificial-image-generator.php

    r3425585 r3473025  
    44 * Plugin URI:        https://beautifulplugins.com/image-generator/
    55 * Description:       Generate AI-powered images automatically across your WordPress site. Create stunning visuals for posts, pages, and more with ease.
    6  * Version:           1.0.0
     6 * Version:           1.1.0
    77 * Requires at least: 5.0
    88 * Requires PHP:      7.4
     9 * Tested up to:      6.9
    910 * Author:            BeautifulPlugins
    1011 * Author URI:        https://beautifulplugins.com
    11  * License:           GPLv2 or later
     12 * License:           GPL v2 or later
    1213 * License URI:       https://www.gnu.org/licenses/gpl-2.0.html
    1314 * Text Domain:       artificial-image-generator
    1415 * Domain Path:       /languages
    15  * Tested up to:      6.9
    1616 *
    1717 * @package ArtificialImageGenerator
     
    3030use ArtificialImageGenerator\Plugin;
    3131
    32 defined( 'ABSPATH' ) || exit; // Prevent direct access.
     32defined( 'ABSPATH' ) || exit; // Exit if accessed directly.
    3333
    34 /**
    35  * Optimized autoload classes.
    36  *
    37  * @since 1.0.0
    38  */
     34// Autoload optimized classes.
    3935require_once __DIR__ . '/vendor/autoload.php';
    4036
     
    4339 *
    4440 * @since 1.0.0
    45  * @return Plugin
     41 * @return Plugin The plugin instance.
    4642 */
    4743function artificial_image_generator() {
    48     return Plugin::create( __FILE__, '1.0.0' );
     44    return Plugin::create( __FILE__, '1.1.0' );
    4945}
    5046
  • artificial-image-generator/tags/1.1.0/assets/css/admin-rtl.css

    r3424875 r3473025  
    1 #aimg-form .preview-image{background:#fff;border:1px solid #ccc;height:auto;max-width:98%;padding:5px;width:600px}@media(max-width:768px){#aimg-form .form-table,#aimg-form .form-table tbody,#aimg-form .form-table td,#aimg-form .form-table th,#aimg-form .form-table thead,#aimg-form .form-table tr{display:block;width:100%}#aimg-form .form-table th{padding-top:1em;text-align:right}}.aimg-overlay-images h4{margin:0 0 10px}.aimg-overlay-images__items{display:flex;flex-wrap:wrap;gap:10px}.aimg-overlay-images__item{position:relative}.aimg-overlay-images__item img{height:60px;width:60px}.aimg-overlay-images .remove-overlay{background-color:#f00000;color:#fff;font-size:12px;line-height:inherit;min-height:inherit;padding:0 4px;position:absolute;left:2px;top:2px}
     1.aimg-wrap .columns{display:flex;gap:20px}.aimg-wrap .columns .column{width:100%}.aimg-wrap .columns .column-left{width:60%}.aimg-wrap .columns .column-right{width:40%}@media(max-width:768px){.aimg-wrap .columns{flex-direction:column}.aimg-wrap .columns .column-left,.aimg-wrap .columns .column-right{width:100%}}.aicw-card{background:#fff;border:1px solid #ddd;margin-bottom:1.25rem}.aicw-card__title{margin:0}.aicw-card__header{border-bottom:1px solid #ddd;padding:10px 20px}.aicw-card__body,.aicw-card__footer{padding:10px 20px}@media(max-width:768px){#aimg-form .form-table,#aimg-form .form-table tbody,#aimg-form .form-table td,#aimg-form .form-table th,#aimg-form .form-table thead,#aimg-form .form-table tr{display:block;width:100%}#aimg-form .form-table th{padding-top:1em;text-align:right}}.preview-image{background:#fff;border:1px solid #ccc;padding:5px}.preview-image img{height:auto;width:100%}.aimg-overlay-images h4{margin:0 0 10px}.aimg-overlay-images__items{display:flex;flex-wrap:wrap;gap:10px}.aimg-overlay-images__item{position:relative}.aimg-overlay-images__item img{height:60px;width:60px}.aimg-overlay-images .remove-overlay{background-color:#f00000;color:#fff;font-size:12px;line-height:inherit;min-height:inherit;padding:0 4px;position:absolute;left:2px;top:2px}
  • artificial-image-generator/tags/1.1.0/assets/css/admin.asset.php

    r3424875 r3473025  
    1 <?php return array('dependencies' => array(), 'version' => 'c720b17e0dff900a6e23');
     1<?php return array('dependencies' => array(), 'version' => '40369622bd6dde768f7b');
  • artificial-image-generator/tags/1.1.0/assets/css/admin.css

    r3424875 r3473025  
    1 #aimg-form .preview-image{background:#fff;border:1px solid #ccc;height:auto;max-width:98%;padding:5px;width:600px}@media(max-width:768px){#aimg-form .form-table,#aimg-form .form-table tbody,#aimg-form .form-table td,#aimg-form .form-table th,#aimg-form .form-table thead,#aimg-form .form-table tr{display:block;width:100%}#aimg-form .form-table th{padding-top:1em;text-align:left}}.aimg-overlay-images h4{margin:0 0 10px}.aimg-overlay-images__items{display:flex;flex-wrap:wrap;gap:10px}.aimg-overlay-images__item{position:relative}.aimg-overlay-images__item img{height:60px;width:60px}.aimg-overlay-images .remove-overlay{background-color:#f00000;color:#fff;font-size:12px;line-height:inherit;min-height:inherit;padding:0 4px;position:absolute;right:2px;top:2px}
     1.aimg-wrap .columns{display:flex;gap:20px}.aimg-wrap .columns .column{width:100%}.aimg-wrap .columns .column-left{width:60%}.aimg-wrap .columns .column-right{width:40%}@media(max-width:768px){.aimg-wrap .columns{flex-direction:column}.aimg-wrap .columns .column-left,.aimg-wrap .columns .column-right{width:100%}}.aicw-card{background:#fff;border:1px solid #ddd;margin-bottom:1.25rem}.aicw-card__title{margin:0}.aicw-card__header{border-bottom:1px solid #ddd;padding:10px 20px}.aicw-card__body,.aicw-card__footer{padding:10px 20px}@media(max-width:768px){#aimg-form .form-table,#aimg-form .form-table tbody,#aimg-form .form-table td,#aimg-form .form-table th,#aimg-form .form-table thead,#aimg-form .form-table tr{display:block;width:100%}#aimg-form .form-table th{padding-top:1em;text-align:left}}.preview-image{background:#fff;border:1px solid #ccc;padding:5px}.preview-image img{height:auto;width:100%}.aimg-overlay-images h4{margin:0 0 10px}.aimg-overlay-images__items{display:flex;flex-wrap:wrap;gap:10px}.aimg-overlay-images__item{position:relative}.aimg-overlay-images__item img{height:60px;width:60px}.aimg-overlay-images .remove-overlay{background-color:#f00000;color:#fff;font-size:12px;line-height:inherit;min-height:inherit;padding:0 4px;position:absolute;right:2px;top:2px}
  • artificial-image-generator/tags/1.1.0/assets/js/admin.asset.php

    r3424875 r3473025  
    1 <?php return array('dependencies' => array(), 'version' => 'ec9b2b8ffbf4c4fc5b18');
     1<?php return array('dependencies' => array(), 'version' => '594ce04d51cfaad24682');
  • artificial-image-generator/tags/1.1.0/assets/js/admin.js

    r3424875 r3473025  
    1 jQuery((function(e){"use strict";({init:function(){this.bindEvents()},bindEvents:function(){e("#upload_overlay_images").on("click",this.handleSelectOverlayImages),e(document).on("click",".remove-overlay",this.handleRemoveOverlayImage)},handleSelectOverlayImages:function(a){a.preventDefault();var t=[];e("#overlay-image-list .aimg-overlay-images__item").each((function(){t.push(parseInt(e(this).data("id")))}));var i=wp.media({title:"Select Overlay Images",button:{text:"Select Images"},multiple:!0,library:{type:"image/png"}});i.on("open",(function(){var e=i.state().get("selection");e.reset(),t.forEach((function(a){var t=wp.media.attachment(a);t.fetch(),e.add(t)}))})),i.on("select",(function(){var a=i.state().get("selection").toJSON(),n=[];e.each(a,(function(e,a){n.push({id:a.id,url:a.url,title:a.title})})),e.ajax({url:aimg_object.ajax_url,type:"POST",data:{action:"aimg_save_overlay_images",overlay_images:n,nonce:aimg_object.nonce},success:function(a){a.success?e.each(n,(function(a,i){if(-1===t.indexOf(i.id)){var n=e('<div class="aimg-overlay-images__item" data-id="'+i.id+'"></div>');n.append('<img src="'+i.url+'" alt="'+i.title+'" style="width:60px;height:60px;" />'),n.append('<input type="hidden" name="aimg_overlay_image_ids[]" value="'+i.id+'">'),n.append('<button type="button" class="remove-overlay button button-secondary">X</button>'),e("#overlay-image-list").append(n)}})):alert(a.data.message||"Failed to save images.")},error:function(){alert("An error occurred while uploading images.")}})})),i.open()},handleRemoveOverlayImage:function(a){a.preventDefault();var t=e(this).closest(".aimg-overlay-images__item"),i=t.data("id");e.ajax({url:aimg_object.ajax_url,type:"POST",data:{action:"aimg_remove_overlay_image",image_id:i,nonce:aimg_object.nonce},success:function(e){e.success?t.remove():alert(e.data.message||"Failed to remove image.")},error:function(){alert("An error occurred while removing the image.")}})}}).init()}));
     1jQuery((function(e){"use strict";({init:function(){this.bindEvents()},bindEvents:function(){e("#upload_overlay_images").on("click",this.handleSelectOverlayImages),e(document).on("click",".remove-overlay",this.handleRemoveOverlayImage)},handleSelectOverlayImages:function(a){a.preventDefault();var t=[];e("#overlay-image-list .aimg-overlay-images__item").each((function(){t.push(parseInt(e(this).data("id")))}));var i=wp.media({title:"Select Overlay Images",button:{text:"Select Images"},multiple:!0,library:{type:"image/png"}});i.on("open",(function(){var e=i.state().get("selection");e.reset(),t.forEach((function(a){var t=wp.media.attachment(a);t.fetch(),e.add(t)}))})),i.on("select",(function(){var a=i.state().get("selection").toJSON(),n=[];e.each(a,(function(e,a){n.push({id:a.id,url:a.url,title:a.title})})),e.each(n,(function(a,i){if(-1===t.indexOf(i.id)){var n=e('<div class="aimg-overlay-images__item" data-id="'+i.id+'"></div>');n.append('<img src="'+i.url+'" alt="'+i.title+'" style="width:60px;height:60px;" />'),n.append('<input type="hidden" name="aimg_overlay_image_ids[]" value="'+i.id+'">'),n.append('<button type="button" class="remove-overlay button button-secondary">X</button>'),e("#overlay-image-list").append(n)}}));var l=e("#overlay_images").val(),o=l?JSON.parse(l):[];e.each(n,(function(e,a){-1===o.indexOf(a.id)&&o.push(a.id)})),e("#overlay_images").val(JSON.stringify(o))})),i.open()},handleRemoveOverlayImage:function(a){a.preventDefault();var t=e(this).closest(".aimg-overlay-images__item"),i=t.data("id"),n=e("#overlay_images").val(),l=n?JSON.parse(n):[],o=l.indexOf(i);-1!==o&&l.splice(o,1),e("#overlay_images").val(JSON.stringify(l)),t.remove()}}).init()}));
  • artificial-image-generator/tags/1.1.0/composer.json

    r3425585 r3473025  
    77  "prefer-stable": true,
    88  "minimum-stability": "dev",
    9   "repositories": [],
    10   "require-dev": {},
    119  "require": {
    1210    "php": ">=7.4"
     
    2523    }
    2624  },
    27   "autoload-dev": {},
    2825  "scripts": {
    2926    "post-install-cmd": [
     
    3330      "composer dump-autoload"
    3431    ]
    35   },
    36   "extra": {}
     32  }
    3733}
  • artificial-image-generator/tags/1.1.0/includes/Admin/Actions.php

    r3424875 r3473025  
    1919     */
    2020    public function __construct() {
    21         add_action( 'admin_post_aimg_artificial_image_generator', array( $this, 'save_artificial_image_generator_settings' ) );
    22         add_action( 'wp_ajax_aimg_save_overlay_images', array( $this, 'save_overlay_images' ) );
    23         add_action( 'wp_ajax_aimg_remove_overlay_image', array( $this, 'remove_overlay_image' ) );
     21        add_action( 'admin_post_aimg_update_template', array( __CLASS__, 'update_template' ) );
    2422    }
    2523
    2624    /**
    27      * Save auto image generator settings.
     25     * Add product tabs data.
    2826     *
    2927     * @since 1.0.0
     28     * @return void
    3029     */
    31     public function save_artificial_image_generator_settings() {
    32         check_admin_referer( 'aimg_artificial_image_generator' );
     30    public static function update_template() {
     31        check_admin_referer( 'aimg_update_template' );
    3332        $referer = wp_get_referer();
    3433
    3534        if ( ! current_user_can( 'manage_options' ) ) {
    36             artificial_image_generator()->flash_notice( esc_html__( 'You do not have permission to perform this action.', 'artificial-image-generator' ), 'error' );
     35            artificial_image_generator()->flash_notice( __( 'You do not have permission to process this action', 'artificial-image-generator' ), 'error' );
    3736            wp_safe_redirect( $referer );
    38             exit();
     37            exit;
    3938        }
    4039
     40        $template_id = isset( $_POST['template_id'] ) ? absint( wp_unslash( $_POST['template_id'] ) ) : 0;
     41        $title       = isset( $_POST['title'] ) ? sanitize_text_field( wp_unslash( $_POST['title'] ) ) : '';
     42        $status      = isset( $_POST['status'] ) ? sanitize_text_field( wp_unslash( $_POST['status'] ) ) : 'publish';
     43
     44        if ( empty( $title ) ) {
     45            artificial_image_generator()->flash_notice( __( 'The title field is required.', 'artificial-image-generator' ), 'error' );
     46            wp_safe_redirect( $referer );
     47            exit;
     48        }
     49
     50        // Create or Update Product Tab.
     51        $post_args = array(
     52            'post_type'    => 'aimg_template',
     53            'post_title'   => wp_strip_all_tags( $title ),
     54            'post_name'    => sanitize_title( $title ),
     55            'post_content' => '',
     56            'post_status'  => $status,
     57        );
     58
     59        if ( $template_id ) {
     60            $post_args['ID'] = $template_id;
     61        }
     62
     63        // Create or update the post.
     64        $post = wp_insert_post( $post_args );
     65
     66        if ( is_wp_error( $post ) ) {
     67            artificial_image_generator()->flash_notice( $post->get_error_message(), 'error' );
     68            wp_safe_redirect( $referer );
     69            exit;
     70        }
     71
     72        // Save meta fields.
    4173        $bg_colors        = isset( $_POST['bg_colors'] ) ? sanitize_text_field( wp_unslash( $_POST['bg_colors'] ) ) : '';
    4274        $width            = isset( $_POST['width'] ) ? absint( $_POST['width'] ) : 1200;
     
    4476        $title_font_size  = isset( $_POST['title_font_size'] ) ? absint( $_POST['title_font_size'] ) : 40;
    4577        $is_overlay_image = isset( $_POST['is_overlay_image'] ) ? 'yes' : 'no';
     78        $overlay_images   = isset( $_POST['overlay_images'] ) ? sanitize_text_field( wp_unslash( $_POST['overlay_images'] ) ) : '';
    4679        $overlay_position = isset( $_POST['overlay_position'] ) ? sanitize_text_field( wp_unslash( $_POST['overlay_position'] ) ) : 'center-center';
    4780
    48         update_option( 'aimg_bg_colors', $bg_colors );
    49         update_option( 'aimg_width', $width );
    50         update_option( 'aimg_height', $height );
    51         update_option( 'aimg_title_font_size', $title_font_size );
    52         update_option( 'aimg_is_overlay_image', $is_overlay_image );
    53         update_option( 'aimg_overlay_position', $overlay_position );
     81        update_post_meta( $post, '_aimg_bg_colors', $bg_colors );
     82        update_post_meta( $post, '_aimg_width', $width );
     83        update_post_meta( $post, '_aimg_height', $height );
     84        update_post_meta( $post, '_aimg_title_font_size', $title_font_size );
     85        update_post_meta( $post, '_aimg_is_overlay_image', $is_overlay_image );
     86        update_post_meta( $post, '_aimg_overlay_images', $overlay_images );
     87        update_post_meta( $post, '_aimg_overlay_position', $overlay_position );
    5488
    55         // Generate the thumbnail image if the settings are saved.
    56         $colors            = empty( $bg_colors ) ? '#e74c3c,#2ecc71,#9b59b6' : $bg_colors;
    57         $overlay_images    = get_option( 'aimg_overlay_images', array() );
    58         $preview_image_url = aimg_generate_preview( 'Dynamic Post Title Will be Available Here', $colors, $width, $height, $overlay_images );
     89        // Generate the thumbnail image if the settings are saved successfully.
     90        if ( $post ) {
     91            $colors            = empty( $bg_colors ) ? '#e74c3c,#2ecc71,#9b59b6' : $bg_colors;
     92            $overlay_images    = 'yes' === $is_overlay_image ? json_decode( $overlay_images ) : array();
     93            $preview_image_url = aimg_generate_preview( $post, $colors, $width, $height, $overlay_images );
    5994
    60         // Save the preview image URL in the options.
    61         update_option( 'aimg_preview_image_url', $preview_image_url );
    62 
    63         artificial_image_generator()->flash_notice( esc_html__( 'Settings saved successfully.', 'artificial-image-generator' ), 'success' );
    64         wp_safe_redirect( $referer );
    65         exit();
    66     }
    67 
    68     /**
    69      * Save overlay images via AJAX.
    70      *
    71      * @since 1.0.0
    72      */
    73     public function save_overlay_images() {
    74         check_ajax_referer( 'aimg_nonce', 'nonce' );
    75 
    76         if ( ! current_user_can( 'manage_options' ) ) {
    77             wp_send_json_error( __( 'You do not have permission to perform this action.', 'artificial-image-generator' ) );
     95            // Update the preview image URL as post meta.
     96            update_post_meta( $post, '_aimg_preview_image_url', $preview_image_url );
    7897        }
    7998
    80         $images = isset( $_POST['overlay_images'] ) ? map_deep( wp_unslash( $_POST['overlay_images'] ), 'sanitize_text_field' ) : array();
    81 
    82         // Check if overlay images are set and is an array. Then check the images id and save them and send a success response with the ids.
    83         if ( is_array( $images ) && ! empty( $images ) ) {
    84             $image_ids = array_map(
    85                 function ( $image ) {
    86                     return absint( $image['id'] ?? 0 );
    87                 },
    88                 $images
    89             );
    90 
    91             // Get the existing overlay images from the database.
    92             $existing_image_ids = get_option( 'aimg_overlay_images', array() );
    93 
    94             // Merge existing and new image IDs, ensuring uniqueness.
    95             $image_ids = array_unique( array_merge( $existing_image_ids, $image_ids ) );
    96 
    97             // Update the option with the new image IDs.
    98             update_option( 'aimg_overlay_images', $image_ids );
    99 
    100             wp_send_json_success(
    101                 array( 'message' => __( 'Overlay images saved successfully.', 'artificial-image-generator' ) )
    102             );
     99        // Flash success message and redirect.
     100        if ( $template_id ) {
     101            artificial_image_generator()->flash_notice( __( 'Image template updated successfully.', 'artificial-image-generator' ) );
     102        } else {
     103            artificial_image_generator()->flash_notice( __( 'Image template added successfully.', 'artificial-image-generator' ) );
    103104        }
    104105
    105         wp_send_json_error( __( 'No overlay images provided.', 'artificial-image-generator' ) );
    106     }
     106        $referer = add_query_arg(
     107            array( 'edit' => absint( $post ) ),
     108            remove_query_arg( 'add', $referer )
     109        );
    107110
    108     /**
    109      * Remove an overlay image via AJAX.
    110      *
    111      * @since 1.0.0
    112      */
    113     public function remove_overlay_image() {
    114         check_ajax_referer( 'aimg_nonce', 'nonce' );
    115 
    116         if ( ! current_user_can( 'manage_options' ) ) {
    117             wp_send_json_error( __( 'You do not have permission to perform this action.', 'artificial-image-generator' ) );
    118         }
    119 
    120         $image_id = isset( $_POST['image_id'] ) ? absint( $_POST['image_id'] ) : null;
    121 
    122         if ( $image_id ) {
    123             $existing_images = get_option( 'aimg_overlay_images', array() );
    124 
    125             if ( in_array( $image_id, $existing_images, true ) ) {
    126                 $existing_images = array_diff( $existing_images, array( $image_id ) );
    127                 update_option( 'aimg_overlay_images', $existing_images );
    128 
    129                 wp_send_json_success(
    130                     array( 'message' => __( 'Overlay image removed successfully.', 'artificial-image-generator' ) )
    131                 );
    132             } else {
    133                 wp_send_json_error( __( 'Overlay image not found.', 'artificial-image-generator' ) );
    134             }
    135         }
    136 
    137         wp_send_json_error( __( 'Invalid overlay image ID.', 'artificial-image-generator' ) );
     111        wp_safe_redirect( $referer );
     112        exit;
    138113    }
    139114}
  • artificial-image-generator/tags/1.1.0/includes/Admin/Admin.php

    r3424875 r3473025  
    22
    33namespace ArtificialImageGenerator\Admin;
     4
     5use ArtificialImageGenerator\Admin\ListTables\TemplatesTable;
    46
    57defined( 'ABSPATH' ) || exit; // Exit if accessed directly.
     
    1214 */
    1315class Admin {
     16
    1417    /**
    1518     * Constructor.
    1619     */
    1720    public function __construct() {
    18         // Add menu page.
    1921        add_action( 'admin_menu', array( $this, 'add_menu' ) );
    20 
    21         // Add admin scripts.
    22         add_action( 'admin_enqueue_scripts', array( $this, 'admin_scripts' ) );
     22        add_filter( 'set-screen-option', array( $this, 'screen_option' ), 10, 3 );
     23        add_action( 'load-toplevel_page_image-generator', array( $this, 'handle_list_table_actions' ) );
     24        add_action( 'admin_enqueue_scripts', array( $this, 'enqueue_scripts' ) );
    2325    }
    2426
     
    3436            __( 'Image Generator', 'artificial-image-generator' ),
    3537            'manage_options',
    36             'artificial-image-generator',
    37             array( $this, 'admin_page' ),
     38            'image-generator',
     39            null,
    3840            'dashicons-format-image',
    3941            26
    4042        );
    41     }
    42 
    43     /**
    44      * Process email submission.
    45      *
    46      * @since 1.0.0
    47      * @return void
    48      */
    49     public function admin_page() {
    50         include __DIR__ . '/views/admin-page.php';
     43
     44        $load = add_submenu_page(
     45            'image-generator',
     46            __( 'Image Templates', 'artificial-image-generator' ),
     47            __( 'Image Templates', 'artificial-image-generator' ),
     48            'manage_options',
     49            'image-generator',
     50            array( $this, 'img_templates_page' ),
     51        );
     52
     53        // Load screen options.
     54        add_action( 'load-' . $load, array( __CLASS__, 'load_pages' ) );
     55    }
     56
     57    /**
     58     * Set screen option.
     59     *
     60     * @param mixed  $status Screen option value. Default false.
     61     * @param string $option Option name.
     62     * @param mixed  $value New option value.
     63     *
     64     * @since 1.0.0
     65     * @return mixed
     66     */
     67    public function screen_option( $status, $option, $value ) {
     68        $options = apply_filters(
     69            'aimg_set_screen_options',
     70            array(
     71                'aimg_img_templates_per_page',
     72            )
     73        );
     74        if ( in_array( $option, $options, true ) ) {
     75            return $value;
     76        }
     77
     78        return $status;
     79    }
     80
     81    /**
     82     * Load pages & set screen options.
     83     *
     84     * @since 1.0.0
     85     * @return void
     86     */
     87    public static function load_pages() {
     88        $screen = get_current_screen();
     89
     90        if ( 'toplevel_page_image-generator' === $screen->id ) {
     91            add_screen_option(
     92                'per_page',
     93                array(
     94                    'label'   => __( 'Image templates per page', 'artificial-image-generator' ),
     95                    'default' => 20,
     96                    'option'  => 'aimg_img_templates_per_page',
     97                )
     98            );
     99        }
     100    }
     101
     102    /**
     103     * Render image templates page.
     104     *
     105     * @since 1.0.0
     106     * @return void
     107     */
     108    public function img_templates_page() {
     109        $edit     = self::is_edit_screen();
     110        $template = ! empty( $edit ) ? aimg_get_template( $edit ) : '';
     111
     112        if ( ! empty( $edit ) && empty( $template ) ) {
     113            wp_safe_redirect( remove_query_arg( 'edit' ) );
     114            exit();
     115        }
     116
     117        if ( self::is_add_screen() ) {
     118            include __DIR__ . '/views/add-img-template.php';
     119        } elseif ( $edit ) {
     120            include __DIR__ . '/views/edit-img-template.php';
     121        } else {
     122            $list_table = new TemplatesTable();
     123            $list_table->prepare_items();
     124            include __DIR__ . '/views/img-templates.php';
     125        }
     126    }
     127
     128    /**
     129     * Check whether current page is add screen or not.
     130     *
     131     * @since 1.0.0
     132     * @return bool True if add screen, false otherwise.
     133     */
     134    public static function is_add_screen() {
     135        return filter_input( INPUT_GET, 'add' ) !== null;
     136    }
     137
     138    /**
     139     * Check whether current page is edit screen or not.
     140     *
     141     * @since 1.0.0
     142     * @return false|int The ID if edit screen, false otherwise.
     143     */
     144    public static function is_edit_screen() {
     145        return filter_input( INPUT_GET, 'edit', FILTER_VALIDATE_INT );
     146    }
     147
     148    /**
     149     * Handle list table actions.
     150     *
     151     * @since 1.0.0
     152     * @return void
     153     */
     154    public function handle_list_table_actions() {
     155
     156        if ( ! current_user_can( 'manage_options' ) ) {
     157            artificial_image_generator()->flash_notice( esc_html__( 'You do not have permission to perform this action.', 'artificial-image-generator' ), 'error' );
     158            $redirect_url = remove_query_arg( array( 'action', 'action2', 'ids', '_wpnonce', '_wp_http_referer' ) );
     159            wp_safe_redirect( $redirect_url );
     160            exit;
     161        }
     162
     163        $list_table = new TemplatesTable();
     164        $list_table->process_bulk_action();
     165
     166        if ( 'delete' === $list_table->current_action() ) {
     167            check_admin_referer( 'bulk-templates' );
     168
     169            $ids       = isset( $_GET['ids'] ) ? map_deep( wp_unslash( $_GET['ids'] ), 'intval' ) : array();
     170            $ids       = wp_parse_id_list( $ids );
     171            $performed = 0;
     172
     173            foreach ( $ids as $id ) {
     174                $template = aimg_get_template( $id );
     175                if ( $template && wp_delete_post( $template->ID, true ) ) {
     176                    ++$performed;
     177                }
     178            }
     179
     180            if ( ! empty( $performed ) ) {
     181                // translators: %s: number of accounts.
     182                artificial_image_generator()->flash_notice( sprintf( esc_html__( '%s item(s) deleted successfully.', 'artificial-image-generator' ), number_format_i18n( $performed ) ) );
     183            }
     184
     185            if ( ! headers_sent() ) {
     186                // Redirect to avoid resubmission.
     187                $redirect_url = remove_query_arg( array( 'action', 'action2', 'ids', '_wpnonce', '_wp_http_referer' ) );
     188                wp_safe_redirect( $redirect_url );
     189                exit;
     190            }
     191        }
    51192    }
    52193
     
    59200     * @return void
    60201     */
    61     public function admin_scripts( $hook ) {
    62         if ( 'toplevel_page_artificial-image-generator' !== $hook ) {
     202    public function enqueue_scripts( $hook ) {
     203
     204        if ( 'toplevel_page_image-generator' !== $hook ) {
    63205            return;
    64206        }
  • artificial-image-generator/tags/1.1.0/includes/Admin/Settings.php

    r3425585 r3473025  
    3232    public function add_settings_page() {
    3333        add_submenu_page(
    34             'artificial-image-generator',
     34            'image-generator',
    3535            __( 'Settings', 'artificial-image-generator' ),
    3636            __( 'Settings', 'artificial-image-generator' ),
    3737            'manage_options',
    38             'artificial-image-generator-settings',
     38            'aimg-settings',
    3939            array( $this, 'settings_page' )
    4040        );
     
    6262            <form method="post" action="<?php echo esc_url( admin_url( 'options.php' ) ); ?>">
    6363                <?php
    64                 settings_fields( 'artificial_image_generator' );
    65                 do_settings_sections( 'artificial-image-generator' );
     64                settings_fields( 'aimg' );
     65                do_settings_sections( 'aimg-settings' );
    6666                submit_button();
    6767                ?>
     
    7878     */
    7979    public function register_settings() {
    80         register_setting( 'artificial_image_generator', 'aimg_settings', array( $this, 'sanitize_settings' ) );
     80        register_setting( 'aimg', 'aimg_settings', array( $this, 'sanitize_settings' ) );
    8181
    8282        // Add settings section.
     
    8585            __( 'General Settings', 'artificial-image-generator' ),
    8686            array( $this, 'general_settings' ),
    87             'artificial-image-generator'
     87            'aimg-settings'
    8888        );
    8989
     
    9393            __( 'Default Background Color', 'artificial-image-generator' ),
    9494            array( $this, 'default_bg_color' ),
    95             'artificial-image-generator',
     95            'aimg-settings',
    9696            'aimg_general_settings'
    9797        );
     
    102102            __( 'Default Text Color', 'artificial-image-generator' ),
    103103            array( $this, 'default_text_color' ),
    104             'artificial-image-generator',
     104            'aimg-settings',
    105105            'aimg_general_settings'
    106106        );
     
    111111            __( 'Enable Post Thumbnails', 'artificial-image-generator' ),
    112112            array( $this, 'is_post_thumbnail' ),
    113             'artificial-image-generator',
     113            'aimg-settings',
    114114            'aimg_general_settings'
    115115        );
     
    120120            __( 'Enable Page Thumbnails', 'artificial-image-generator' ),
    121121            array( $this, 'is_page_thumbnail' ),
    122             'artificial-image-generator',
     122            'aimg-settings',
    123123            'aimg_general_settings'
    124124        );
  • artificial-image-generator/tags/1.1.0/includes/GenerateImages.php

    r3424875 r3473025  
    7373        }
    7474
    75         $colors         = get_option( 'aimg_bg_colors', '#e74c3c,#2ecc71,#9b59b6' );
    76         $overlay_images = get_option( 'aimg_overlay_images', array() );
     75        // Get a random image template ID.
     76        $templates = get_posts(
     77            array(
     78                'post_type'      => 'aimg_template',
     79                'posts_per_page' => 1,
     80                'post_status'    => 'publish',
     81                'fields'         => 'ids',
     82                'orderby'        => 'rand',
     83            )
     84        );
     85
     86        if ( empty( $templates ) || ! is_array( $templates ) ) {
     87            return;
     88        }
     89
     90        $template_id = reset( $templates );
     91        $colors      = get_post_meta( $template_id, '_aimg_bg_colors', true );
    7792
    7893        // Make sure colors are split into an array if they are a string.
     
    8398        // Get absolute paths of overlay images.
    8499        $overlays = array();
    85         foreach ( $overlay_images as $id ) {
    86             $path = get_attached_file( $id );
    87             if ( $path && file_exists( $path ) ) {
    88                 $overlays[] = $path;
     100        if ( 'yes' === get_post_meta( $template_id, '_aimg_is_overlay_image', true ) ) {
     101            $overlay_images = json_decode( get_post_meta( $template_id, '_aimg_overlay_images', true ) );
     102
     103            foreach ( $overlay_images as $id ) {
     104                $path = get_attached_file( $id );
     105                if ( $path && file_exists( $path ) ) {
     106                    $overlays[] = $path;
     107                }
    89108            }
    90         }
    91109
    92         // Keep only single overlay if multiple are provided.
    93         if ( count( $overlays ) > 1 ) {
    94             $overlays = array( $overlays[ array_rand( $overlays ) ] );
     110            // Keep only single overlay if multiple are provided.
     111            if ( count( $overlays ) > 1 ) {
     112                $overlays = array( $overlays[ array_rand( $overlays ) ] );
     113            }
    95114        }
    96115
    97116        $image_path = aimg_generate_thumbnail(
    98117            array(
     118                'post_id'  => $template_id,
    99119                'title'    => $title,
    100120                'colors'   => $colors,
    101                 'width'    => get_option( 'aimg_width', 1200 ),
    102                 'height'   => get_option( 'aimg_height', 800 ),
     121                'width'    => get_post_meta( $template_id, '_aimg_width', true ),
     122                'height'   => get_post_meta( $template_id, '_aimg_height', true ),
    103123                'overlays' => $overlays,
    104                 'post_id'  => $post_id,
    105124            )
    106125        );
  • artificial-image-generator/tags/1.1.0/includes/Plugin.php

    r3424875 r3473025  
    205205    public function init() {
    206206        // Load common classes.
     207        new PostTypes();
    207208        new GenerateImages();
    208209
  • artificial-image-generator/tags/1.1.0/includes/functions.php

    r3424875 r3473025  
    22
    33defined( 'ABSPATH' ) || exit; // Exit if accessed directly.
     4
     5/**
     6 * Get template post object.
     7 *
     8 * @param mixed $data The data.
     9 *
     10 * @since 1.0.0
     11 * @return WP_Post|false The template object, or false if not found.
     12 */
     13function aimg_get_template( $data ) {
     14
     15    if ( is_numeric( $data ) ) {
     16        $data = get_post( $data );
     17    }
     18
     19    if ( $data instanceof WP_Post && 'aimg_template' === $data->post_type ) {
     20        return $data;
     21    }
     22
     23    return false;
     24}
     25
     26/**
     27 * Get templates.
     28 *
     29 * @param array $args The args.
     30 * @param bool  $count Whether to return a count.
     31 *
     32 * @since 1.0.0
     33 * @return array|int The templates.
     34 */
     35function aimg_get_templates( $args = array(), $count = false ) {
     36    $defaults = array(
     37        'post_type'      => 'aimg_template',
     38        'posts_per_page' => - 1,
     39        'orderby'        => 'date',
     40        'order'          => 'ASC',
     41    );
     42
     43    $args  = wp_parse_args( $args, $defaults );
     44    $query = new WP_Query( $args );
     45
     46    if ( $count ) {
     47        return $query->found_posts;
     48    }
     49
     50    return array_map( 'aimg_get_template', $query->posts );
     51}
    452
    553/**
     
    1058 *
    1159 * @since 1.0.0
    12  * @retun mixed|null
     60 * @return mixed|null
    1361 */
    1462function aimg_get_settings( $option, $default_value = null ) {
     
    2169 * Generate a thumbnail image for preview on settings page.
    2270 *
    23  * @param string $title    The title text.
     71 * @param int    $post_id  Post ID for which the preview is being generated.
    2472 * @param string $colors   Comma separated hex colors.
    2573 * @param int    $width    Image width.
     
    2977 * @return string|false Image URL or false on failure.
    3078 */
    31 function aimg_generate_preview( $title, $colors, $width, $height, $overlays = array() ) {
     79function aimg_generate_preview( $post_id, $colors, $width, $height, $overlays = array() ) {
     80    if ( empty( $post_id ) || empty( $colors ) || empty( $width ) || empty( $height ) ) {
     81        return false;
     82    }
    3283
    3384    if ( is_string( $colors ) ) {
     
    52103    $filepath = aimg_generate_thumbnail(
    53104        array(
    54             'title'    => $title,
     105            'post_id'  => $post_id,
     106            'title'    => get_the_title( $post_id ),
    55107            'colors'   => $colors,
    56108            'width'    => $width,
    57109            'height'   => $height,
    58110            'overlays' => $overlays_path,
    59             'preview'  => true,
    60111        )
    61112    );
     
    67118    // Get URL from filepath.
    68119    $upload_dir = wp_upload_dir();
    69     $basedir    = trailingslashit( $upload_dir['basedir'] );
    70     $baseurl    = trailingslashit( $upload_dir['baseurl'] );
     120    $basedir    = wp_normalize_path( trailingslashit( $upload_dir['basedir'] ) );
     121    $baseurl    = wp_normalize_path( trailingslashit( $upload_dir['baseurl'] ) );
    71122
    72123    if ( strpos( $filepath, $basedir ) === 0 ) {
     
    88139function aimg_generate_thumbnail( $args = array() ) {
    89140    $default_args = array(
     141        'post_id'  => 0,
    90142        'title'    => '',
    91143        'colors'   => array(),
     
    93145        'height'   => 600,
    94146        'overlays' => array(),
    95         'post_id'  => 0,
    96         'preview'  => false,
    97147    );
    98148
     
    100150
    101151    // Extract arguments for easier access.
     152    $post_id  = isset( $args['post_id'] ) ? absint( $args['post_id'] ) : 0;
    102153    $title    = isset( $args['title'] ) ? $args['title'] : '';
    103154    $colors   = isset( $args['colors'] ) && is_array( $args['colors'] ) ? $args['colors'] : array();
     
    105156    $height   = isset( $args['height'] ) ? absint( $args['height'] ) : 600;
    106157    $overlays = isset( $args['overlays'] ) && is_array( $args['overlays'] ) ? $args['overlays'] : array();
    107     $preview  = isset( $args['preview'] ) ? (bool) $args['preview'] : false;
    108 
    109     $font_size = get_option( 'aimg_title_font_size', 40 );
     158
     159    if ( empty( $post_id ) || empty( $title ) || empty( $width ) || empty( $height ) ) {
     160        return false;
     161    }
     162
     163    $font_size = get_post_meta( $post_id, '_aimg_title_font_size', true );
    110164    $font_path = AIMG_ASSETS_PATH . 'fonts/Roboto-Bold.ttf';
    111165
     
    141195            }
    142196
    143             $overlay_position = get_option( 'aimg_overlay_position', 'center-center' );
     197            $overlay_position = get_post_meta( $post_id, '_aimg_overlay_position', true );
    144198            $overlay          = imagecreatefrompng( $overlay_path );
    145199
     
    283337
    284338    // Generate filename.
    285     if ( $preview ) {
    286         $filename = 'aimg-preview-thumbnail-image.png';
    287     } else {
    288         $suffix   = isset( $args['post_id'] ) ? absint( $args['post_id'] ) : wp_rand( 10000, 99999 );
    289         $filename = sanitize_title( $title ) . '-' . $suffix . '.png';
    290     }
     339    $suffix   = isset( $args['post_id'] ) ? absint( $args['post_id'] ) : wp_rand( 10000, 99999 );
     340    $filename = sanitize_title( $title ) . '-' . $suffix . '.png';
    291341
    292342    // Save image to uploads directory.
  • artificial-image-generator/tags/1.1.0/languages/artificial-image-generator.pot

    r3425585 r3473025  
    1 # Copyright (C) 2025 BeautifulPlugins
    2 # This file is distributed under the GPLv2 or later.
    3 msgid ""
    4 msgstr ""
    5 "Project-Id-Version: Image Generator 1.0.0\n"
     1# Copyright (C) 2026 BeautifulPlugins
     2# This file is distributed under the GPL v2 or later.
     3msgid ""
     4msgstr ""
     5"Project-Id-Version: Image Generator 1.1.0\n"
    66"Report-Msgid-Bugs-To: https://beautifulplugins.com/support/\n"
    7 "POT-Creation-Date: 2025-12-21 18:10:55+00:00\n"
     7"POT-Creation-Date: 2026-03-02 19:03:46+00:00\n"
    88"MIME-Version: 1.0\n"
    99"Content-Type: text/plain; charset=utf-8\n"
    1010"Content-Transfer-Encoding: 8bit\n"
    11 "PO-Revision-Date: 2025-MO-DA HO:MI+ZONE\n"
     11"PO-Revision-Date: 2026-MO-DA HO:MI+ZONE\n"
    1212"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
    1313"Language-Team: LANGUAGE <LL@li.org>\n"
     
    2525"X-Generator: grunt-wp-i18n 1.0.3\n"
    2626
    27 #: includes/Admin/views/admin-page.php:53
     27#: includes/Admin/views/add-img-template.php:65
     28#: includes/Admin/views/edit-img-template.php:66
    2829msgid "40"
    2930msgstr ""
    3031
    31 #: includes/Admin/views/admin-page.php:44
     32#: includes/Admin/views/add-img-template.php:56
     33#: includes/Admin/views/edit-img-template.php:57
    3234msgid "800"
    3335msgstr ""
    3436
    35 #: includes/Admin/views/admin-page.php:35
     37#: includes/Admin/views/add-img-template.php:47
     38#: includes/Admin/views/edit-img-template.php:48
    3639msgid "1200"
    3740msgstr ""
    3841
    39 #: includes/Admin/Actions.php:36 includes/Admin/Actions.php:77
    40 #: includes/Admin/Actions.php:117
    41 msgid "You do not have permission to perform this action."
    42 msgstr ""
    43 
    44 #: includes/Admin/Actions.php:63
    45 msgid "Settings saved successfully."
     42#: includes/Admin/Actions.php:35
     43msgid "You do not have permission to process this action"
     44msgstr ""
     45
     46#: includes/Admin/Actions.php:45
     47msgid "The title field is required."
    4648msgstr ""
    4749
    4850#: includes/Admin/Actions.php:101
    49 msgid "Overlay images saved successfully."
    50 msgstr ""
    51 
    52 #: includes/Admin/Actions.php:105
    53 msgid "No overlay images provided."
    54 msgstr ""
    55 
    56 #: includes/Admin/Actions.php:130
    57 msgid "Overlay image removed successfully."
    58 msgstr ""
    59 
    60 #: includes/Admin/Actions.php:133
    61 msgid "Overlay image not found."
    62 msgstr ""
    63 
    64 #: includes/Admin/Actions.php:137
    65 msgid "Invalid overlay image ID."
     51msgid "Image template updated successfully."
     52msgstr ""
     53
     54#: includes/Admin/Actions.php:103
     55msgid "Image template added successfully."
    6656msgstr ""
    6757
    6858#. Plugin Name of the plugin/theme
    6959msgid "Image Generator"
     60msgstr ""
     61
     62#: includes/Admin/Admin.php:46 includes/Admin/Admin.php:47
     63#: includes/Admin/views/img-templates.php:16
     64msgid "Image Templates"
     65msgstr ""
     66
     67#: includes/Admin/Admin.php:94
     68msgid "Image templates per page"
     69msgstr ""
     70
     71#: includes/Admin/Admin.php:157
     72msgid "You do not have permission to perform this action."
     73msgstr ""
     74
     75#: includes/Admin/Admin.php:182
     76#. translators: %s: number of accounts.
     77msgid "%s item(s) deleted successfully."
     78msgstr ""
     79
     80#: includes/Admin/ListTables/TemplatesTable.php:90
     81msgid "No templates found."
     82msgstr ""
     83
     84#: includes/Admin/ListTables/TemplatesTable.php:103
     85msgid "Name"
     86msgstr ""
     87
     88#: includes/Admin/ListTables/TemplatesTable.php:104
     89#: includes/Admin/views/add-img-template.php:120
     90#: includes/Admin/views/edit-img-template.php:140
     91#: includes/Admin/views/edit-img-template.php:144
     92msgid "Preview Image"
     93msgstr ""
     94
     95#: includes/Admin/ListTables/TemplatesTable.php:105
     96msgid "Date"
     97msgstr ""
     98
     99#: includes/Admin/ListTables/TemplatesTable.php:163
     100#. translators: %d: key id.
     101msgid "ID: %d"
     102msgstr ""
     103
     104#: includes/Admin/ListTables/TemplatesTable.php:164
     105msgid "Edit"
     106msgstr ""
     107
     108#: includes/Admin/ListTables/TemplatesTable.php:165
     109#: includes/Admin/ListTables/TemplatesTable.php:178
     110msgid "Delete"
    70111msgstr ""
    71112
     
    141182msgstr ""
    142183
    143 #: includes/Admin/views/admin-page.php:18
    144 msgid "Configure to generate thumbnails."
    145 msgstr ""
    146 
    147 #: includes/Admin/views/admin-page.php:23
     184#: includes/Admin/views/add-img-template.php:15
     185msgid "Add New Image Template"
     186msgstr ""
     187
     188#: includes/Admin/views/add-img-template.php:18
     189#: includes/Admin/views/edit-img-template.php:19
     190msgid "Configure the template options to generate images."
     191msgstr ""
     192
     193#: includes/Admin/views/add-img-template.php:26
     194#: includes/Admin/views/edit-img-template.php:27
     195msgid "Title"
     196msgstr ""
     197
     198#: includes/Admin/views/add-img-template.php:29
     199#: includes/Admin/views/edit-img-template.php:30
     200msgid "Awesome image template"
     201msgstr ""
     202
     203#: includes/Admin/views/add-img-template.php:30
     204#: includes/Admin/views/edit-img-template.php:31
     205msgid "Enter the title for the image template."
     206msgstr ""
     207
     208#: includes/Admin/views/add-img-template.php:35
     209#: includes/Admin/views/edit-img-template.php:36
    148210msgid "Background Colors"
    149211msgstr ""
    150212
    151 #: includes/Admin/views/admin-page.php:26
     213#: includes/Admin/views/add-img-template.php:38
     214#: includes/Admin/views/edit-img-template.php:39
    152215msgid "e.g. #e74c3c, #2ecc71, #9b59b6"
    153216msgstr ""
    154217
    155 #: includes/Admin/views/admin-page.php:27
     218#: includes/Admin/views/add-img-template.php:39
     219#: includes/Admin/views/edit-img-template.php:40
    156220msgid ""
    157221"Enter the background colors for the thumbnails. Use comma to separate "
     
    159223msgstr ""
    160224
    161 #: includes/Admin/views/admin-page.php:32
     225#: includes/Admin/views/add-img-template.php:44
     226#: includes/Admin/views/edit-img-template.php:45
    162227msgid "Width"
    163228msgstr ""
    164229
    165 #: includes/Admin/views/admin-page.php:36
     230#: includes/Admin/views/add-img-template.php:48
     231#: includes/Admin/views/edit-img-template.php:49
    166232msgid "Enter the width for the thumbnails in pixels."
    167233msgstr ""
    168234
    169 #: includes/Admin/views/admin-page.php:41
     235#: includes/Admin/views/add-img-template.php:53
     236#: includes/Admin/views/edit-img-template.php:54
    170237msgid "Height"
    171238msgstr ""
    172239
    173 #: includes/Admin/views/admin-page.php:45
     240#: includes/Admin/views/add-img-template.php:57
     241#: includes/Admin/views/edit-img-template.php:58
    174242msgid "Enter the height for the thumbnails in pixels."
    175243msgstr ""
    176244
    177 #: includes/Admin/views/admin-page.php:50
     245#: includes/Admin/views/add-img-template.php:62
     246#: includes/Admin/views/edit-img-template.php:63
    178247msgid "Title Font Size"
    179248msgstr ""
    180249
    181 #: includes/Admin/views/admin-page.php:54
     250#: includes/Admin/views/add-img-template.php:66
     251#: includes/Admin/views/edit-img-template.php:67
    182252msgid "Enter the font size for the title in pixels."
    183253msgstr ""
    184254
    185 #: includes/Admin/views/admin-page.php:59
     255#: includes/Admin/views/add-img-template.php:71
     256#: includes/Admin/views/edit-img-template.php:72
    186257msgid "Enable Overlay Images"
    187258msgstr ""
    188259
    189 #: includes/Admin/views/admin-page.php:64
     260#: includes/Admin/views/add-img-template.php:76
     261#: includes/Admin/views/edit-img-template.php:77
    190262msgid "Enable"
    191263msgstr ""
    192264
    193 #: includes/Admin/views/admin-page.php:66
     265#: includes/Admin/views/add-img-template.php:78
     266#: includes/Admin/views/edit-img-template.php:79
    194267msgid "Check this box to enable overlay images in the thumbnails."
    195268msgstr ""
    196269
    197 #: includes/Admin/views/admin-page.php:72
     270#: includes/Admin/views/add-img-template.php:84
     271#: includes/Admin/views/edit-img-template.php:85
    198272msgid "Overlay Images"
    199273msgstr ""
    200274
    201 #: includes/Admin/views/admin-page.php:84
    202 msgid "Overlay Image"
    203 msgstr ""
    204 
    205 #: includes/Admin/views/admin-page.php:85
    206 msgid "X"
    207 msgstr ""
    208 
    209 #: includes/Admin/views/admin-page.php:90
    210 msgid "No overlay images selected."
    211 msgstr ""
    212 
    213 #: includes/Admin/views/admin-page.php:94
     275#: includes/Admin/views/add-img-template.php:89
     276#: includes/Admin/views/edit-img-template.php:108
    214277msgid "Select Images"
    215278msgstr ""
    216279
    217 #: includes/Admin/views/admin-page.php:95
     280#: includes/Admin/views/add-img-template.php:91
     281#: includes/Admin/views/edit-img-template.php:110
    218282msgid ""
    219283"Select one or more transparent PNG images to use as overlay images in the "
     
    221285msgstr ""
    222286
    223 #: includes/Admin/views/admin-page.php:101
     287#: includes/Admin/views/add-img-template.php:97
     288#: includes/Admin/views/edit-img-template.php:116
    224289msgid "Overlay Image Position"
    225290msgstr ""
    226291
    227 #: includes/Admin/views/admin-page.php:106
     292#: includes/Admin/views/add-img-template.php:101
     293#: includes/Admin/views/edit-img-template.php:121
    228294msgid "Top Left"
    229295msgstr ""
    230296
    231 #: includes/Admin/views/admin-page.php:107
     297#: includes/Admin/views/add-img-template.php:102
     298#: includes/Admin/views/edit-img-template.php:122
    232299msgid "Top Center"
    233300msgstr ""
    234301
    235 #: includes/Admin/views/admin-page.php:108
     302#: includes/Admin/views/add-img-template.php:103
     303#: includes/Admin/views/edit-img-template.php:123
    236304msgid "Top Right"
    237305msgstr ""
    238306
    239 #: includes/Admin/views/admin-page.php:109
     307#: includes/Admin/views/add-img-template.php:104
     308#: includes/Admin/views/edit-img-template.php:124
    240309msgid "Left Center"
    241310msgstr ""
    242311
    243 #: includes/Admin/views/admin-page.php:110
     312#: includes/Admin/views/add-img-template.php:105
     313#: includes/Admin/views/edit-img-template.php:125
    244314msgid "Center Center"
    245315msgstr ""
    246316
    247 #: includes/Admin/views/admin-page.php:111
     317#: includes/Admin/views/add-img-template.php:106
     318#: includes/Admin/views/edit-img-template.php:126
    248319msgid "Right Center"
    249320msgstr ""
    250321
    251 #: includes/Admin/views/admin-page.php:112
     322#: includes/Admin/views/add-img-template.php:107
     323#: includes/Admin/views/edit-img-template.php:127
    252324msgid "Bottom Left"
    253325msgstr ""
    254326
    255 #: includes/Admin/views/admin-page.php:113
     327#: includes/Admin/views/add-img-template.php:108
     328#: includes/Admin/views/edit-img-template.php:128
    256329msgid "Bottom Center"
    257330msgstr ""
    258331
    259 #: includes/Admin/views/admin-page.php:114
     332#: includes/Admin/views/add-img-template.php:109
     333#: includes/Admin/views/edit-img-template.php:129
    260334msgid "Bottom Right"
    261335msgstr ""
    262336
    263 #: includes/Admin/views/admin-page.php:116
     337#: includes/Admin/views/add-img-template.php:111
     338#: includes/Admin/views/edit-img-template.php:131
    264339msgid ""
    265340"Select the position for the overlay images in the thumbnails. The overlay "
     
    268343msgstr ""
    269344
    270 #: includes/Admin/views/admin-page.php:120
    271 msgid "Preview"
    272 msgstr ""
    273 
    274 #: includes/Admin/views/admin-page.php:124
    275 msgid "Preview Image"
    276 msgstr ""
    277 
    278 #: includes/Admin/views/admin-page.php:125
    279 msgid ""
    280 "This is a preview of how the thumbnail will look like based on the current "
    281 "settings. Save the settings to generate a new preview."
    282 msgstr ""
    283 
    284 #: includes/Admin/views/admin-page.php:127
    285 msgid "Preview could not be generated. Save the settings to generate a preview."
     345#: includes/Admin/views/add-img-template.php:121
     346#: includes/Admin/views/edit-img-template.php:148
     347msgid "Preview could not be generated. Save changes to generate a preview."
     348msgstr ""
     349
     350#: includes/Admin/views/edit-img-template.php:16 includes/PostTypes.php:40
     351msgid "Edit Image Template"
     352msgstr ""
     353
     354#: includes/Admin/views/edit-img-template.php:98
     355msgid "Overlay Image"
     356msgstr ""
     357
     358#: includes/Admin/views/edit-img-template.php:99
     359msgid "X"
     360msgstr ""
     361
     362#: includes/Admin/views/edit-img-template.php:104
     363msgid "No overlay images selected."
     364msgstr ""
     365
     366#: includes/Admin/views/edit-img-template.php:146
     367msgid ""
     368"This is a preview of how the image will look like based on the current "
     369"settings. Save changes to generate a new preview."
     370msgstr ""
     371
     372#: includes/Admin/views/img-templates.php:18
     373msgid "Add New"
     374msgstr ""
     375
     376#: includes/Admin/views/img-templates.php:25
     377msgid "Search"
     378msgstr ""
     379
     380#: includes/PostTypes.php:38
     381msgid "Add New Images Template"
     382msgstr ""
     383
     384#: includes/PostTypes.php:39
     385msgid "New Images Template"
     386msgstr ""
     387
     388#: includes/PostTypes.php:41
     389msgid "View Image Template"
     390msgstr ""
     391
     392#: includes/PostTypes.php:42
     393msgid "All Image Templates"
     394msgstr ""
     395
     396#: includes/PostTypes.php:43
     397msgid "Search Image Templates"
     398msgstr ""
     399
     400#: includes/PostTypes.php:44
     401msgid "Parent Image Templates:"
     402msgstr ""
     403
     404#: includes/PostTypes.php:45
     405msgid "No image templates found."
     406msgstr ""
     407
     408#: includes/PostTypes.php:46
     409msgid "No image templates found in Trash."
    286410msgstr ""
    287411
     
    303427msgid "https://beautifulplugins.com"
    304428msgstr ""
     429
     430#: includes/PostTypes.php:33
     431msgctxt "post type general name"
     432msgid "Image Templates"
     433msgstr ""
     434
     435#: includes/PostTypes.php:34
     436msgctxt "post type singular name"
     437msgid "Image Template"
     438msgstr ""
     439
     440#: includes/PostTypes.php:35
     441msgctxt "admin menu"
     442msgid "Image Templates"
     443msgstr ""
     444
     445#: includes/PostTypes.php:36
     446msgctxt "add new on admin bar"
     447msgid "Image Templates"
     448msgstr ""
     449
     450#: includes/PostTypes.php:37
     451msgctxt "ticket"
     452msgid "Add New"
     453msgstr ""
  • artificial-image-generator/tags/1.1.0/readme.txt

    r3425585 r3473025  
    33Tags: ai, ai image, featured images, ai image generator, image generator
    44Tested up to: 6.9
    5 Stable tag: 1.0.0
     5Stable tag: 1.1.0
    66License: GPLv2 or later
    77License URI: https://www.gnu.org/licenses/gpl-2.0.html
     
    135135
    136136== Changelog ==
     137= 1.1.0 ( 3rd March 2026 ) =
     138* New: Added support for creating unlimited image templates with custom styles and layouts.
     139* Fix: Resolved compatibility issues with the latest version of WordPress.
     140* Enhance: Optimized image generation process for faster performance and reduced server load.
    137141
    138142= 1.0.0 ( 22nd December 2025 ) =
    139143* Initial release
     144
     145== Upgrade Notice ==
     146= 1.1.0 =
     147Major update with new features and improvements. Please backup your site before updating.
    140148
    141149== Support and Feedback ==
  • artificial-image-generator/tags/1.1.0/vendor/autoload.php

    r3424875 r3473025  
    2020require_once __DIR__ . '/composer/autoload_real.php';
    2121
    22 return ComposerAutoloaderInit2e664fd2fb00ee27f1f41078a1c13365::getLoader();
     22return ComposerAutoloaderInit6e093c60687139b2de60a46a1974731c::getLoader();
  • artificial-image-generator/tags/1.1.0/vendor/composer/autoload_classmap.php

    r3424875 r3473025  
    99    'ArtificialImageGenerator\\Admin\\Actions' => $baseDir . '/includes/Admin/Actions.php',
    1010    'ArtificialImageGenerator\\Admin\\Admin' => $baseDir . '/includes/Admin/Admin.php',
     11    'ArtificialImageGenerator\\Admin\\ListTables\\TemplatesTable' => $baseDir . '/includes/Admin/ListTables/TemplatesTable.php',
    1112    'ArtificialImageGenerator\\Admin\\Settings' => $baseDir . '/includes/Admin/Settings.php',
    1213    'ArtificialImageGenerator\\GenerateImages' => $baseDir . '/includes/GenerateImages.php',
    1314    'ArtificialImageGenerator\\Plugin' => $baseDir . '/includes/Plugin.php',
     15    'ArtificialImageGenerator\\PostTypes' => $baseDir . '/includes/PostTypes.php',
    1416    'Composer\\InstalledVersions' => $vendorDir . '/composer/InstalledVersions.php',
    1517);
  • artificial-image-generator/tags/1.1.0/vendor/composer/autoload_real.php

    r3424875 r3473025  
    33// autoload_real.php @generated by Composer
    44
    5 class ComposerAutoloaderInit2e664fd2fb00ee27f1f41078a1c13365
     5class ComposerAutoloaderInit6e093c60687139b2de60a46a1974731c
    66{
    77    private static $loader;
     
    2525        require __DIR__ . '/platform_check.php';
    2626
    27         spl_autoload_register(array('ComposerAutoloaderInit2e664fd2fb00ee27f1f41078a1c13365', 'loadClassLoader'), true, true);
     27        spl_autoload_register(array('ComposerAutoloaderInit6e093c60687139b2de60a46a1974731c', 'loadClassLoader'), true, true);
    2828        self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname(__DIR__));
    29         spl_autoload_unregister(array('ComposerAutoloaderInit2e664fd2fb00ee27f1f41078a1c13365', 'loadClassLoader'));
     29        spl_autoload_unregister(array('ComposerAutoloaderInit6e093c60687139b2de60a46a1974731c', 'loadClassLoader'));
    3030
    3131        require __DIR__ . '/autoload_static.php';
    32         call_user_func(\Composer\Autoload\ComposerStaticInit2e664fd2fb00ee27f1f41078a1c13365::getInitializer($loader));
     32        call_user_func(\Composer\Autoload\ComposerStaticInit6e093c60687139b2de60a46a1974731c::getInitializer($loader));
    3333
    3434        $loader->register(true);
  • artificial-image-generator/tags/1.1.0/vendor/composer/autoload_static.php

    r3424875 r3473025  
    55namespace Composer\Autoload;
    66
    7 class ComposerStaticInit2e664fd2fb00ee27f1f41078a1c13365
     7class ComposerStaticInit6e093c60687139b2de60a46a1974731c
    88{
    99    public static $prefixLengthsPsr4 = array (
     
    2424        'ArtificialImageGenerator\\Admin\\Actions' => __DIR__ . '/../..' . '/includes/Admin/Actions.php',
    2525        'ArtificialImageGenerator\\Admin\\Admin' => __DIR__ . '/../..' . '/includes/Admin/Admin.php',
     26        'ArtificialImageGenerator\\Admin\\ListTables\\TemplatesTable' => __DIR__ . '/../..' . '/includes/Admin/ListTables/TemplatesTable.php',
    2627        'ArtificialImageGenerator\\Admin\\Settings' => __DIR__ . '/../..' . '/includes/Admin/Settings.php',
    2728        'ArtificialImageGenerator\\GenerateImages' => __DIR__ . '/../..' . '/includes/GenerateImages.php',
    2829        'ArtificialImageGenerator\\Plugin' => __DIR__ . '/../..' . '/includes/Plugin.php',
     30        'ArtificialImageGenerator\\PostTypes' => __DIR__ . '/../..' . '/includes/PostTypes.php',
    2931        'Composer\\InstalledVersions' => __DIR__ . '/..' . '/composer/InstalledVersions.php',
    3032    );
     
    3335    {
    3436        return \Closure::bind(function () use ($loader) {
    35             $loader->prefixLengthsPsr4 = ComposerStaticInit2e664fd2fb00ee27f1f41078a1c13365::$prefixLengthsPsr4;
    36             $loader->prefixDirsPsr4 = ComposerStaticInit2e664fd2fb00ee27f1f41078a1c13365::$prefixDirsPsr4;
    37             $loader->classMap = ComposerStaticInit2e664fd2fb00ee27f1f41078a1c13365::$classMap;
     37            $loader->prefixLengthsPsr4 = ComposerStaticInit6e093c60687139b2de60a46a1974731c::$prefixLengthsPsr4;
     38            $loader->prefixDirsPsr4 = ComposerStaticInit6e093c60687139b2de60a46a1974731c::$prefixDirsPsr4;
     39            $loader->classMap = ComposerStaticInit6e093c60687139b2de60a46a1974731c::$classMap;
    3840
    3941        }, null, ClassLoader::class);
  • artificial-image-generator/tags/1.1.0/vendor/composer/installed.php

    r3425585 r3473025  
    22    'root' => array(
    33        'name' => 'beautifulplugins/artificial-image-generator',
    4         'pretty_version' => 'v1.0.0',
    5         'version' => '1.0.0.0',
    6         'reference' => 'fbefb482442bf5433a7a828d23cc49b35f528b66',
     4        'pretty_version' => 'v1.1.0',
     5        'version' => '1.1.0.0',
     6        'reference' => '9d2e7c0876df4d27498e57fe83fc1805b9314e0d',
    77        'type' => 'wordpress-plugin',
    88        'install_path' => __DIR__ . '/../../',
     
    1212    'versions' => array(
    1313        'beautifulplugins/artificial-image-generator' => array(
    14             'pretty_version' => 'v1.0.0',
    15             'version' => '1.0.0.0',
    16             'reference' => 'fbefb482442bf5433a7a828d23cc49b35f528b66',
     14            'pretty_version' => 'v1.1.0',
     15            'version' => '1.1.0.0',
     16            'reference' => '9d2e7c0876df4d27498e57fe83fc1805b9314e0d',
    1717            'type' => 'wordpress-plugin',
    1818            'install_path' => __DIR__ . '/../../',
  • artificial-image-generator/trunk/artificial-image-generator.php

    r3425585 r3473025  
    44 * Plugin URI:        https://beautifulplugins.com/image-generator/
    55 * Description:       Generate AI-powered images automatically across your WordPress site. Create stunning visuals for posts, pages, and more with ease.
    6  * Version:           1.0.0
     6 * Version:           1.1.0
    77 * Requires at least: 5.0
    88 * Requires PHP:      7.4
     9 * Tested up to:      6.9
    910 * Author:            BeautifulPlugins
    1011 * Author URI:        https://beautifulplugins.com
    11  * License:           GPLv2 or later
     12 * License:           GPL v2 or later
    1213 * License URI:       https://www.gnu.org/licenses/gpl-2.0.html
    1314 * Text Domain:       artificial-image-generator
    1415 * Domain Path:       /languages
    15  * Tested up to:      6.9
    1616 *
    1717 * @package ArtificialImageGenerator
     
    3030use ArtificialImageGenerator\Plugin;
    3131
    32 defined( 'ABSPATH' ) || exit; // Prevent direct access.
     32defined( 'ABSPATH' ) || exit; // Exit if accessed directly.
    3333
    34 /**
    35  * Optimized autoload classes.
    36  *
    37  * @since 1.0.0
    38  */
     34// Autoload optimized classes.
    3935require_once __DIR__ . '/vendor/autoload.php';
    4036
     
    4339 *
    4440 * @since 1.0.0
    45  * @return Plugin
     41 * @return Plugin The plugin instance.
    4642 */
    4743function artificial_image_generator() {
    48     return Plugin::create( __FILE__, '1.0.0' );
     44    return Plugin::create( __FILE__, '1.1.0' );
    4945}
    5046
  • artificial-image-generator/trunk/assets/css/admin-rtl.css

    r3424875 r3473025  
    1 #aimg-form .preview-image{background:#fff;border:1px solid #ccc;height:auto;max-width:98%;padding:5px;width:600px}@media(max-width:768px){#aimg-form .form-table,#aimg-form .form-table tbody,#aimg-form .form-table td,#aimg-form .form-table th,#aimg-form .form-table thead,#aimg-form .form-table tr{display:block;width:100%}#aimg-form .form-table th{padding-top:1em;text-align:right}}.aimg-overlay-images h4{margin:0 0 10px}.aimg-overlay-images__items{display:flex;flex-wrap:wrap;gap:10px}.aimg-overlay-images__item{position:relative}.aimg-overlay-images__item img{height:60px;width:60px}.aimg-overlay-images .remove-overlay{background-color:#f00000;color:#fff;font-size:12px;line-height:inherit;min-height:inherit;padding:0 4px;position:absolute;left:2px;top:2px}
     1.aimg-wrap .columns{display:flex;gap:20px}.aimg-wrap .columns .column{width:100%}.aimg-wrap .columns .column-left{width:60%}.aimg-wrap .columns .column-right{width:40%}@media(max-width:768px){.aimg-wrap .columns{flex-direction:column}.aimg-wrap .columns .column-left,.aimg-wrap .columns .column-right{width:100%}}.aicw-card{background:#fff;border:1px solid #ddd;margin-bottom:1.25rem}.aicw-card__title{margin:0}.aicw-card__header{border-bottom:1px solid #ddd;padding:10px 20px}.aicw-card__body,.aicw-card__footer{padding:10px 20px}@media(max-width:768px){#aimg-form .form-table,#aimg-form .form-table tbody,#aimg-form .form-table td,#aimg-form .form-table th,#aimg-form .form-table thead,#aimg-form .form-table tr{display:block;width:100%}#aimg-form .form-table th{padding-top:1em;text-align:right}}.preview-image{background:#fff;border:1px solid #ccc;padding:5px}.preview-image img{height:auto;width:100%}.aimg-overlay-images h4{margin:0 0 10px}.aimg-overlay-images__items{display:flex;flex-wrap:wrap;gap:10px}.aimg-overlay-images__item{position:relative}.aimg-overlay-images__item img{height:60px;width:60px}.aimg-overlay-images .remove-overlay{background-color:#f00000;color:#fff;font-size:12px;line-height:inherit;min-height:inherit;padding:0 4px;position:absolute;left:2px;top:2px}
  • artificial-image-generator/trunk/assets/css/admin.asset.php

    r3424875 r3473025  
    1 <?php return array('dependencies' => array(), 'version' => 'c720b17e0dff900a6e23');
     1<?php return array('dependencies' => array(), 'version' => '40369622bd6dde768f7b');
  • artificial-image-generator/trunk/assets/css/admin.css

    r3424875 r3473025  
    1 #aimg-form .preview-image{background:#fff;border:1px solid #ccc;height:auto;max-width:98%;padding:5px;width:600px}@media(max-width:768px){#aimg-form .form-table,#aimg-form .form-table tbody,#aimg-form .form-table td,#aimg-form .form-table th,#aimg-form .form-table thead,#aimg-form .form-table tr{display:block;width:100%}#aimg-form .form-table th{padding-top:1em;text-align:left}}.aimg-overlay-images h4{margin:0 0 10px}.aimg-overlay-images__items{display:flex;flex-wrap:wrap;gap:10px}.aimg-overlay-images__item{position:relative}.aimg-overlay-images__item img{height:60px;width:60px}.aimg-overlay-images .remove-overlay{background-color:#f00000;color:#fff;font-size:12px;line-height:inherit;min-height:inherit;padding:0 4px;position:absolute;right:2px;top:2px}
     1.aimg-wrap .columns{display:flex;gap:20px}.aimg-wrap .columns .column{width:100%}.aimg-wrap .columns .column-left{width:60%}.aimg-wrap .columns .column-right{width:40%}@media(max-width:768px){.aimg-wrap .columns{flex-direction:column}.aimg-wrap .columns .column-left,.aimg-wrap .columns .column-right{width:100%}}.aicw-card{background:#fff;border:1px solid #ddd;margin-bottom:1.25rem}.aicw-card__title{margin:0}.aicw-card__header{border-bottom:1px solid #ddd;padding:10px 20px}.aicw-card__body,.aicw-card__footer{padding:10px 20px}@media(max-width:768px){#aimg-form .form-table,#aimg-form .form-table tbody,#aimg-form .form-table td,#aimg-form .form-table th,#aimg-form .form-table thead,#aimg-form .form-table tr{display:block;width:100%}#aimg-form .form-table th{padding-top:1em;text-align:left}}.preview-image{background:#fff;border:1px solid #ccc;padding:5px}.preview-image img{height:auto;width:100%}.aimg-overlay-images h4{margin:0 0 10px}.aimg-overlay-images__items{display:flex;flex-wrap:wrap;gap:10px}.aimg-overlay-images__item{position:relative}.aimg-overlay-images__item img{height:60px;width:60px}.aimg-overlay-images .remove-overlay{background-color:#f00000;color:#fff;font-size:12px;line-height:inherit;min-height:inherit;padding:0 4px;position:absolute;right:2px;top:2px}
  • artificial-image-generator/trunk/assets/js/admin.asset.php

    r3424875 r3473025  
    1 <?php return array('dependencies' => array(), 'version' => 'ec9b2b8ffbf4c4fc5b18');
     1<?php return array('dependencies' => array(), 'version' => '594ce04d51cfaad24682');
  • artificial-image-generator/trunk/assets/js/admin.js

    r3424875 r3473025  
    1 jQuery((function(e){"use strict";({init:function(){this.bindEvents()},bindEvents:function(){e("#upload_overlay_images").on("click",this.handleSelectOverlayImages),e(document).on("click",".remove-overlay",this.handleRemoveOverlayImage)},handleSelectOverlayImages:function(a){a.preventDefault();var t=[];e("#overlay-image-list .aimg-overlay-images__item").each((function(){t.push(parseInt(e(this).data("id")))}));var i=wp.media({title:"Select Overlay Images",button:{text:"Select Images"},multiple:!0,library:{type:"image/png"}});i.on("open",(function(){var e=i.state().get("selection");e.reset(),t.forEach((function(a){var t=wp.media.attachment(a);t.fetch(),e.add(t)}))})),i.on("select",(function(){var a=i.state().get("selection").toJSON(),n=[];e.each(a,(function(e,a){n.push({id:a.id,url:a.url,title:a.title})})),e.ajax({url:aimg_object.ajax_url,type:"POST",data:{action:"aimg_save_overlay_images",overlay_images:n,nonce:aimg_object.nonce},success:function(a){a.success?e.each(n,(function(a,i){if(-1===t.indexOf(i.id)){var n=e('<div class="aimg-overlay-images__item" data-id="'+i.id+'"></div>');n.append('<img src="'+i.url+'" alt="'+i.title+'" style="width:60px;height:60px;" />'),n.append('<input type="hidden" name="aimg_overlay_image_ids[]" value="'+i.id+'">'),n.append('<button type="button" class="remove-overlay button button-secondary">X</button>'),e("#overlay-image-list").append(n)}})):alert(a.data.message||"Failed to save images.")},error:function(){alert("An error occurred while uploading images.")}})})),i.open()},handleRemoveOverlayImage:function(a){a.preventDefault();var t=e(this).closest(".aimg-overlay-images__item"),i=t.data("id");e.ajax({url:aimg_object.ajax_url,type:"POST",data:{action:"aimg_remove_overlay_image",image_id:i,nonce:aimg_object.nonce},success:function(e){e.success?t.remove():alert(e.data.message||"Failed to remove image.")},error:function(){alert("An error occurred while removing the image.")}})}}).init()}));
     1jQuery((function(e){"use strict";({init:function(){this.bindEvents()},bindEvents:function(){e("#upload_overlay_images").on("click",this.handleSelectOverlayImages),e(document).on("click",".remove-overlay",this.handleRemoveOverlayImage)},handleSelectOverlayImages:function(a){a.preventDefault();var t=[];e("#overlay-image-list .aimg-overlay-images__item").each((function(){t.push(parseInt(e(this).data("id")))}));var i=wp.media({title:"Select Overlay Images",button:{text:"Select Images"},multiple:!0,library:{type:"image/png"}});i.on("open",(function(){var e=i.state().get("selection");e.reset(),t.forEach((function(a){var t=wp.media.attachment(a);t.fetch(),e.add(t)}))})),i.on("select",(function(){var a=i.state().get("selection").toJSON(),n=[];e.each(a,(function(e,a){n.push({id:a.id,url:a.url,title:a.title})})),e.each(n,(function(a,i){if(-1===t.indexOf(i.id)){var n=e('<div class="aimg-overlay-images__item" data-id="'+i.id+'"></div>');n.append('<img src="'+i.url+'" alt="'+i.title+'" style="width:60px;height:60px;" />'),n.append('<input type="hidden" name="aimg_overlay_image_ids[]" value="'+i.id+'">'),n.append('<button type="button" class="remove-overlay button button-secondary">X</button>'),e("#overlay-image-list").append(n)}}));var l=e("#overlay_images").val(),o=l?JSON.parse(l):[];e.each(n,(function(e,a){-1===o.indexOf(a.id)&&o.push(a.id)})),e("#overlay_images").val(JSON.stringify(o))})),i.open()},handleRemoveOverlayImage:function(a){a.preventDefault();var t=e(this).closest(".aimg-overlay-images__item"),i=t.data("id"),n=e("#overlay_images").val(),l=n?JSON.parse(n):[],o=l.indexOf(i);-1!==o&&l.splice(o,1),e("#overlay_images").val(JSON.stringify(l)),t.remove()}}).init()}));
  • artificial-image-generator/trunk/composer.json

    r3425585 r3473025  
    77  "prefer-stable": true,
    88  "minimum-stability": "dev",
    9   "repositories": [],
    10   "require-dev": {},
    119  "require": {
    1210    "php": ">=7.4"
     
    2523    }
    2624  },
    27   "autoload-dev": {},
    2825  "scripts": {
    2926    "post-install-cmd": [
     
    3330      "composer dump-autoload"
    3431    ]
    35   },
    36   "extra": {}
     32  }
    3733}
  • artificial-image-generator/trunk/includes/Admin/Actions.php

    r3424875 r3473025  
    1919     */
    2020    public function __construct() {
    21         add_action( 'admin_post_aimg_artificial_image_generator', array( $this, 'save_artificial_image_generator_settings' ) );
    22         add_action( 'wp_ajax_aimg_save_overlay_images', array( $this, 'save_overlay_images' ) );
    23         add_action( 'wp_ajax_aimg_remove_overlay_image', array( $this, 'remove_overlay_image' ) );
     21        add_action( 'admin_post_aimg_update_template', array( __CLASS__, 'update_template' ) );
    2422    }
    2523
    2624    /**
    27      * Save auto image generator settings.
     25     * Add product tabs data.
    2826     *
    2927     * @since 1.0.0
     28     * @return void
    3029     */
    31     public function save_artificial_image_generator_settings() {
    32         check_admin_referer( 'aimg_artificial_image_generator' );
     30    public static function update_template() {
     31        check_admin_referer( 'aimg_update_template' );
    3332        $referer = wp_get_referer();
    3433
    3534        if ( ! current_user_can( 'manage_options' ) ) {
    36             artificial_image_generator()->flash_notice( esc_html__( 'You do not have permission to perform this action.', 'artificial-image-generator' ), 'error' );
     35            artificial_image_generator()->flash_notice( __( 'You do not have permission to process this action', 'artificial-image-generator' ), 'error' );
    3736            wp_safe_redirect( $referer );
    38             exit();
     37            exit;
    3938        }
    4039
     40        $template_id = isset( $_POST['template_id'] ) ? absint( wp_unslash( $_POST['template_id'] ) ) : 0;
     41        $title       = isset( $_POST['title'] ) ? sanitize_text_field( wp_unslash( $_POST['title'] ) ) : '';
     42        $status      = isset( $_POST['status'] ) ? sanitize_text_field( wp_unslash( $_POST['status'] ) ) : 'publish';
     43
     44        if ( empty( $title ) ) {
     45            artificial_image_generator()->flash_notice( __( 'The title field is required.', 'artificial-image-generator' ), 'error' );
     46            wp_safe_redirect( $referer );
     47            exit;
     48        }
     49
     50        // Create or Update Product Tab.
     51        $post_args = array(
     52            'post_type'    => 'aimg_template',
     53            'post_title'   => wp_strip_all_tags( $title ),
     54            'post_name'    => sanitize_title( $title ),
     55            'post_content' => '',
     56            'post_status'  => $status,
     57        );
     58
     59        if ( $template_id ) {
     60            $post_args['ID'] = $template_id;
     61        }
     62
     63        // Create or update the post.
     64        $post = wp_insert_post( $post_args );
     65
     66        if ( is_wp_error( $post ) ) {
     67            artificial_image_generator()->flash_notice( $post->get_error_message(), 'error' );
     68            wp_safe_redirect( $referer );
     69            exit;
     70        }
     71
     72        // Save meta fields.
    4173        $bg_colors        = isset( $_POST['bg_colors'] ) ? sanitize_text_field( wp_unslash( $_POST['bg_colors'] ) ) : '';
    4274        $width            = isset( $_POST['width'] ) ? absint( $_POST['width'] ) : 1200;
     
    4476        $title_font_size  = isset( $_POST['title_font_size'] ) ? absint( $_POST['title_font_size'] ) : 40;
    4577        $is_overlay_image = isset( $_POST['is_overlay_image'] ) ? 'yes' : 'no';
     78        $overlay_images   = isset( $_POST['overlay_images'] ) ? sanitize_text_field( wp_unslash( $_POST['overlay_images'] ) ) : '';
    4679        $overlay_position = isset( $_POST['overlay_position'] ) ? sanitize_text_field( wp_unslash( $_POST['overlay_position'] ) ) : 'center-center';
    4780
    48         update_option( 'aimg_bg_colors', $bg_colors );
    49         update_option( 'aimg_width', $width );
    50         update_option( 'aimg_height', $height );
    51         update_option( 'aimg_title_font_size', $title_font_size );
    52         update_option( 'aimg_is_overlay_image', $is_overlay_image );
    53         update_option( 'aimg_overlay_position', $overlay_position );
     81        update_post_meta( $post, '_aimg_bg_colors', $bg_colors );
     82        update_post_meta( $post, '_aimg_width', $width );
     83        update_post_meta( $post, '_aimg_height', $height );
     84        update_post_meta( $post, '_aimg_title_font_size', $title_font_size );
     85        update_post_meta( $post, '_aimg_is_overlay_image', $is_overlay_image );
     86        update_post_meta( $post, '_aimg_overlay_images', $overlay_images );
     87        update_post_meta( $post, '_aimg_overlay_position', $overlay_position );
    5488
    55         // Generate the thumbnail image if the settings are saved.
    56         $colors            = empty( $bg_colors ) ? '#e74c3c,#2ecc71,#9b59b6' : $bg_colors;
    57         $overlay_images    = get_option( 'aimg_overlay_images', array() );
    58         $preview_image_url = aimg_generate_preview( 'Dynamic Post Title Will be Available Here', $colors, $width, $height, $overlay_images );
     89        // Generate the thumbnail image if the settings are saved successfully.
     90        if ( $post ) {
     91            $colors            = empty( $bg_colors ) ? '#e74c3c,#2ecc71,#9b59b6' : $bg_colors;
     92            $overlay_images    = 'yes' === $is_overlay_image ? json_decode( $overlay_images ) : array();
     93            $preview_image_url = aimg_generate_preview( $post, $colors, $width, $height, $overlay_images );
    5994
    60         // Save the preview image URL in the options.
    61         update_option( 'aimg_preview_image_url', $preview_image_url );
    62 
    63         artificial_image_generator()->flash_notice( esc_html__( 'Settings saved successfully.', 'artificial-image-generator' ), 'success' );
    64         wp_safe_redirect( $referer );
    65         exit();
    66     }
    67 
    68     /**
    69      * Save overlay images via AJAX.
    70      *
    71      * @since 1.0.0
    72      */
    73     public function save_overlay_images() {
    74         check_ajax_referer( 'aimg_nonce', 'nonce' );
    75 
    76         if ( ! current_user_can( 'manage_options' ) ) {
    77             wp_send_json_error( __( 'You do not have permission to perform this action.', 'artificial-image-generator' ) );
     95            // Update the preview image URL as post meta.
     96            update_post_meta( $post, '_aimg_preview_image_url', $preview_image_url );
    7897        }
    7998
    80         $images = isset( $_POST['overlay_images'] ) ? map_deep( wp_unslash( $_POST['overlay_images'] ), 'sanitize_text_field' ) : array();
    81 
    82         // Check if overlay images are set and is an array. Then check the images id and save them and send a success response with the ids.
    83         if ( is_array( $images ) && ! empty( $images ) ) {
    84             $image_ids = array_map(
    85                 function ( $image ) {
    86                     return absint( $image['id'] ?? 0 );
    87                 },
    88                 $images
    89             );
    90 
    91             // Get the existing overlay images from the database.
    92             $existing_image_ids = get_option( 'aimg_overlay_images', array() );
    93 
    94             // Merge existing and new image IDs, ensuring uniqueness.
    95             $image_ids = array_unique( array_merge( $existing_image_ids, $image_ids ) );
    96 
    97             // Update the option with the new image IDs.
    98             update_option( 'aimg_overlay_images', $image_ids );
    99 
    100             wp_send_json_success(
    101                 array( 'message' => __( 'Overlay images saved successfully.', 'artificial-image-generator' ) )
    102             );
     99        // Flash success message and redirect.
     100        if ( $template_id ) {
     101            artificial_image_generator()->flash_notice( __( 'Image template updated successfully.', 'artificial-image-generator' ) );
     102        } else {
     103            artificial_image_generator()->flash_notice( __( 'Image template added successfully.', 'artificial-image-generator' ) );
    103104        }
    104105
    105         wp_send_json_error( __( 'No overlay images provided.', 'artificial-image-generator' ) );
    106     }
     106        $referer = add_query_arg(
     107            array( 'edit' => absint( $post ) ),
     108            remove_query_arg( 'add', $referer )
     109        );
    107110
    108     /**
    109      * Remove an overlay image via AJAX.
    110      *
    111      * @since 1.0.0
    112      */
    113     public function remove_overlay_image() {
    114         check_ajax_referer( 'aimg_nonce', 'nonce' );
    115 
    116         if ( ! current_user_can( 'manage_options' ) ) {
    117             wp_send_json_error( __( 'You do not have permission to perform this action.', 'artificial-image-generator' ) );
    118         }
    119 
    120         $image_id = isset( $_POST['image_id'] ) ? absint( $_POST['image_id'] ) : null;
    121 
    122         if ( $image_id ) {
    123             $existing_images = get_option( 'aimg_overlay_images', array() );
    124 
    125             if ( in_array( $image_id, $existing_images, true ) ) {
    126                 $existing_images = array_diff( $existing_images, array( $image_id ) );
    127                 update_option( 'aimg_overlay_images', $existing_images );
    128 
    129                 wp_send_json_success(
    130                     array( 'message' => __( 'Overlay image removed successfully.', 'artificial-image-generator' ) )
    131                 );
    132             } else {
    133                 wp_send_json_error( __( 'Overlay image not found.', 'artificial-image-generator' ) );
    134             }
    135         }
    136 
    137         wp_send_json_error( __( 'Invalid overlay image ID.', 'artificial-image-generator' ) );
     111        wp_safe_redirect( $referer );
     112        exit;
    138113    }
    139114}
  • artificial-image-generator/trunk/includes/Admin/Admin.php

    r3424875 r3473025  
    22
    33namespace ArtificialImageGenerator\Admin;
     4
     5use ArtificialImageGenerator\Admin\ListTables\TemplatesTable;
    46
    57defined( 'ABSPATH' ) || exit; // Exit if accessed directly.
     
    1214 */
    1315class Admin {
     16
    1417    /**
    1518     * Constructor.
    1619     */
    1720    public function __construct() {
    18         // Add menu page.
    1921        add_action( 'admin_menu', array( $this, 'add_menu' ) );
    20 
    21         // Add admin scripts.
    22         add_action( 'admin_enqueue_scripts', array( $this, 'admin_scripts' ) );
     22        add_filter( 'set-screen-option', array( $this, 'screen_option' ), 10, 3 );
     23        add_action( 'load-toplevel_page_image-generator', array( $this, 'handle_list_table_actions' ) );
     24        add_action( 'admin_enqueue_scripts', array( $this, 'enqueue_scripts' ) );
    2325    }
    2426
     
    3436            __( 'Image Generator', 'artificial-image-generator' ),
    3537            'manage_options',
    36             'artificial-image-generator',
    37             array( $this, 'admin_page' ),
     38            'image-generator',
     39            null,
    3840            'dashicons-format-image',
    3941            26
    4042        );
    41     }
    42 
    43     /**
    44      * Process email submission.
    45      *
    46      * @since 1.0.0
    47      * @return void
    48      */
    49     public function admin_page() {
    50         include __DIR__ . '/views/admin-page.php';
     43
     44        $load = add_submenu_page(
     45            'image-generator',
     46            __( 'Image Templates', 'artificial-image-generator' ),
     47            __( 'Image Templates', 'artificial-image-generator' ),
     48            'manage_options',
     49            'image-generator',
     50            array( $this, 'img_templates_page' ),
     51        );
     52
     53        // Load screen options.
     54        add_action( 'load-' . $load, array( __CLASS__, 'load_pages' ) );
     55    }
     56
     57    /**
     58     * Set screen option.
     59     *
     60     * @param mixed  $status Screen option value. Default false.
     61     * @param string $option Option name.
     62     * @param mixed  $value New option value.
     63     *
     64     * @since 1.0.0
     65     * @return mixed
     66     */
     67    public function screen_option( $status, $option, $value ) {
     68        $options = apply_filters(
     69            'aimg_set_screen_options',
     70            array(
     71                'aimg_img_templates_per_page',
     72            )
     73        );
     74        if ( in_array( $option, $options, true ) ) {
     75            return $value;
     76        }
     77
     78        return $status;
     79    }
     80
     81    /**
     82     * Load pages & set screen options.
     83     *
     84     * @since 1.0.0
     85     * @return void
     86     */
     87    public static function load_pages() {
     88        $screen = get_current_screen();
     89
     90        if ( 'toplevel_page_image-generator' === $screen->id ) {
     91            add_screen_option(
     92                'per_page',
     93                array(
     94                    'label'   => __( 'Image templates per page', 'artificial-image-generator' ),
     95                    'default' => 20,
     96                    'option'  => 'aimg_img_templates_per_page',
     97                )
     98            );
     99        }
     100    }
     101
     102    /**
     103     * Render image templates page.
     104     *
     105     * @since 1.0.0
     106     * @return void
     107     */
     108    public function img_templates_page() {
     109        $edit     = self::is_edit_screen();
     110        $template = ! empty( $edit ) ? aimg_get_template( $edit ) : '';
     111
     112        if ( ! empty( $edit ) && empty( $template ) ) {
     113            wp_safe_redirect( remove_query_arg( 'edit' ) );
     114            exit();
     115        }
     116
     117        if ( self::is_add_screen() ) {
     118            include __DIR__ . '/views/add-img-template.php';
     119        } elseif ( $edit ) {
     120            include __DIR__ . '/views/edit-img-template.php';
     121        } else {
     122            $list_table = new TemplatesTable();
     123            $list_table->prepare_items();
     124            include __DIR__ . '/views/img-templates.php';
     125        }
     126    }
     127
     128    /**
     129     * Check whether current page is add screen or not.
     130     *
     131     * @since 1.0.0
     132     * @return bool True if add screen, false otherwise.
     133     */
     134    public static function is_add_screen() {
     135        return filter_input( INPUT_GET, 'add' ) !== null;
     136    }
     137
     138    /**
     139     * Check whether current page is edit screen or not.
     140     *
     141     * @since 1.0.0
     142     * @return false|int The ID if edit screen, false otherwise.
     143     */
     144    public static function is_edit_screen() {
     145        return filter_input( INPUT_GET, 'edit', FILTER_VALIDATE_INT );
     146    }
     147
     148    /**
     149     * Handle list table actions.
     150     *
     151     * @since 1.0.0
     152     * @return void
     153     */
     154    public function handle_list_table_actions() {
     155
     156        if ( ! current_user_can( 'manage_options' ) ) {
     157            artificial_image_generator()->flash_notice( esc_html__( 'You do not have permission to perform this action.', 'artificial-image-generator' ), 'error' );
     158            $redirect_url = remove_query_arg( array( 'action', 'action2', 'ids', '_wpnonce', '_wp_http_referer' ) );
     159            wp_safe_redirect( $redirect_url );
     160            exit;
     161        }
     162
     163        $list_table = new TemplatesTable();
     164        $list_table->process_bulk_action();
     165
     166        if ( 'delete' === $list_table->current_action() ) {
     167            check_admin_referer( 'bulk-templates' );
     168
     169            $ids       = isset( $_GET['ids'] ) ? map_deep( wp_unslash( $_GET['ids'] ), 'intval' ) : array();
     170            $ids       = wp_parse_id_list( $ids );
     171            $performed = 0;
     172
     173            foreach ( $ids as $id ) {
     174                $template = aimg_get_template( $id );
     175                if ( $template && wp_delete_post( $template->ID, true ) ) {
     176                    ++$performed;
     177                }
     178            }
     179
     180            if ( ! empty( $performed ) ) {
     181                // translators: %s: number of accounts.
     182                artificial_image_generator()->flash_notice( sprintf( esc_html__( '%s item(s) deleted successfully.', 'artificial-image-generator' ), number_format_i18n( $performed ) ) );
     183            }
     184
     185            if ( ! headers_sent() ) {
     186                // Redirect to avoid resubmission.
     187                $redirect_url = remove_query_arg( array( 'action', 'action2', 'ids', '_wpnonce', '_wp_http_referer' ) );
     188                wp_safe_redirect( $redirect_url );
     189                exit;
     190            }
     191        }
    51192    }
    52193
     
    59200     * @return void
    60201     */
    61     public function admin_scripts( $hook ) {
    62         if ( 'toplevel_page_artificial-image-generator' !== $hook ) {
     202    public function enqueue_scripts( $hook ) {
     203
     204        if ( 'toplevel_page_image-generator' !== $hook ) {
    63205            return;
    64206        }
  • artificial-image-generator/trunk/includes/Admin/Settings.php

    r3425585 r3473025  
    3232    public function add_settings_page() {
    3333        add_submenu_page(
    34             'artificial-image-generator',
     34            'image-generator',
    3535            __( 'Settings', 'artificial-image-generator' ),
    3636            __( 'Settings', 'artificial-image-generator' ),
    3737            'manage_options',
    38             'artificial-image-generator-settings',
     38            'aimg-settings',
    3939            array( $this, 'settings_page' )
    4040        );
     
    6262            <form method="post" action="<?php echo esc_url( admin_url( 'options.php' ) ); ?>">
    6363                <?php
    64                 settings_fields( 'artificial_image_generator' );
    65                 do_settings_sections( 'artificial-image-generator' );
     64                settings_fields( 'aimg' );
     65                do_settings_sections( 'aimg-settings' );
    6666                submit_button();
    6767                ?>
     
    7878     */
    7979    public function register_settings() {
    80         register_setting( 'artificial_image_generator', 'aimg_settings', array( $this, 'sanitize_settings' ) );
     80        register_setting( 'aimg', 'aimg_settings', array( $this, 'sanitize_settings' ) );
    8181
    8282        // Add settings section.
     
    8585            __( 'General Settings', 'artificial-image-generator' ),
    8686            array( $this, 'general_settings' ),
    87             'artificial-image-generator'
     87            'aimg-settings'
    8888        );
    8989
     
    9393            __( 'Default Background Color', 'artificial-image-generator' ),
    9494            array( $this, 'default_bg_color' ),
    95             'artificial-image-generator',
     95            'aimg-settings',
    9696            'aimg_general_settings'
    9797        );
     
    102102            __( 'Default Text Color', 'artificial-image-generator' ),
    103103            array( $this, 'default_text_color' ),
    104             'artificial-image-generator',
     104            'aimg-settings',
    105105            'aimg_general_settings'
    106106        );
     
    111111            __( 'Enable Post Thumbnails', 'artificial-image-generator' ),
    112112            array( $this, 'is_post_thumbnail' ),
    113             'artificial-image-generator',
     113            'aimg-settings',
    114114            'aimg_general_settings'
    115115        );
     
    120120            __( 'Enable Page Thumbnails', 'artificial-image-generator' ),
    121121            array( $this, 'is_page_thumbnail' ),
    122             'artificial-image-generator',
     122            'aimg-settings',
    123123            'aimg_general_settings'
    124124        );
  • artificial-image-generator/trunk/includes/GenerateImages.php

    r3424875 r3473025  
    7373        }
    7474
    75         $colors         = get_option( 'aimg_bg_colors', '#e74c3c,#2ecc71,#9b59b6' );
    76         $overlay_images = get_option( 'aimg_overlay_images', array() );
     75        // Get a random image template ID.
     76        $templates = get_posts(
     77            array(
     78                'post_type'      => 'aimg_template',
     79                'posts_per_page' => 1,
     80                'post_status'    => 'publish',
     81                'fields'         => 'ids',
     82                'orderby'        => 'rand',
     83            )
     84        );
     85
     86        if ( empty( $templates ) || ! is_array( $templates ) ) {
     87            return;
     88        }
     89
     90        $template_id = reset( $templates );
     91        $colors      = get_post_meta( $template_id, '_aimg_bg_colors', true );
    7792
    7893        // Make sure colors are split into an array if they are a string.
     
    8398        // Get absolute paths of overlay images.
    8499        $overlays = array();
    85         foreach ( $overlay_images as $id ) {
    86             $path = get_attached_file( $id );
    87             if ( $path && file_exists( $path ) ) {
    88                 $overlays[] = $path;
     100        if ( 'yes' === get_post_meta( $template_id, '_aimg_is_overlay_image', true ) ) {
     101            $overlay_images = json_decode( get_post_meta( $template_id, '_aimg_overlay_images', true ) );
     102
     103            foreach ( $overlay_images as $id ) {
     104                $path = get_attached_file( $id );
     105                if ( $path && file_exists( $path ) ) {
     106                    $overlays[] = $path;
     107                }
    89108            }
    90         }
    91109
    92         // Keep only single overlay if multiple are provided.
    93         if ( count( $overlays ) > 1 ) {
    94             $overlays = array( $overlays[ array_rand( $overlays ) ] );
     110            // Keep only single overlay if multiple are provided.
     111            if ( count( $overlays ) > 1 ) {
     112                $overlays = array( $overlays[ array_rand( $overlays ) ] );
     113            }
    95114        }
    96115
    97116        $image_path = aimg_generate_thumbnail(
    98117            array(
     118                'post_id'  => $template_id,
    99119                'title'    => $title,
    100120                'colors'   => $colors,
    101                 'width'    => get_option( 'aimg_width', 1200 ),
    102                 'height'   => get_option( 'aimg_height', 800 ),
     121                'width'    => get_post_meta( $template_id, '_aimg_width', true ),
     122                'height'   => get_post_meta( $template_id, '_aimg_height', true ),
    103123                'overlays' => $overlays,
    104                 'post_id'  => $post_id,
    105124            )
    106125        );
  • artificial-image-generator/trunk/includes/Plugin.php

    r3424875 r3473025  
    205205    public function init() {
    206206        // Load common classes.
     207        new PostTypes();
    207208        new GenerateImages();
    208209
  • artificial-image-generator/trunk/includes/functions.php

    r3424875 r3473025  
    22
    33defined( 'ABSPATH' ) || exit; // Exit if accessed directly.
     4
     5/**
     6 * Get template post object.
     7 *
     8 * @param mixed $data The data.
     9 *
     10 * @since 1.0.0
     11 * @return WP_Post|false The template object, or false if not found.
     12 */
     13function aimg_get_template( $data ) {
     14
     15    if ( is_numeric( $data ) ) {
     16        $data = get_post( $data );
     17    }
     18
     19    if ( $data instanceof WP_Post && 'aimg_template' === $data->post_type ) {
     20        return $data;
     21    }
     22
     23    return false;
     24}
     25
     26/**
     27 * Get templates.
     28 *
     29 * @param array $args The args.
     30 * @param bool  $count Whether to return a count.
     31 *
     32 * @since 1.0.0
     33 * @return array|int The templates.
     34 */
     35function aimg_get_templates( $args = array(), $count = false ) {
     36    $defaults = array(
     37        'post_type'      => 'aimg_template',
     38        'posts_per_page' => - 1,
     39        'orderby'        => 'date',
     40        'order'          => 'ASC',
     41    );
     42
     43    $args  = wp_parse_args( $args, $defaults );
     44    $query = new WP_Query( $args );
     45
     46    if ( $count ) {
     47        return $query->found_posts;
     48    }
     49
     50    return array_map( 'aimg_get_template', $query->posts );
     51}
    452
    553/**
     
    1058 *
    1159 * @since 1.0.0
    12  * @retun mixed|null
     60 * @return mixed|null
    1361 */
    1462function aimg_get_settings( $option, $default_value = null ) {
     
    2169 * Generate a thumbnail image for preview on settings page.
    2270 *
    23  * @param string $title    The title text.
     71 * @param int    $post_id  Post ID for which the preview is being generated.
    2472 * @param string $colors   Comma separated hex colors.
    2573 * @param int    $width    Image width.
     
    2977 * @return string|false Image URL or false on failure.
    3078 */
    31 function aimg_generate_preview( $title, $colors, $width, $height, $overlays = array() ) {
     79function aimg_generate_preview( $post_id, $colors, $width, $height, $overlays = array() ) {
     80    if ( empty( $post_id ) || empty( $colors ) || empty( $width ) || empty( $height ) ) {
     81        return false;
     82    }
    3283
    3384    if ( is_string( $colors ) ) {
     
    52103    $filepath = aimg_generate_thumbnail(
    53104        array(
    54             'title'    => $title,
     105            'post_id'  => $post_id,
     106            'title'    => get_the_title( $post_id ),
    55107            'colors'   => $colors,
    56108            'width'    => $width,
    57109            'height'   => $height,
    58110            'overlays' => $overlays_path,
    59             'preview'  => true,
    60111        )
    61112    );
     
    67118    // Get URL from filepath.
    68119    $upload_dir = wp_upload_dir();
    69     $basedir    = trailingslashit( $upload_dir['basedir'] );
    70     $baseurl    = trailingslashit( $upload_dir['baseurl'] );
     120    $basedir    = wp_normalize_path( trailingslashit( $upload_dir['basedir'] ) );
     121    $baseurl    = wp_normalize_path( trailingslashit( $upload_dir['baseurl'] ) );
    71122
    72123    if ( strpos( $filepath, $basedir ) === 0 ) {
     
    88139function aimg_generate_thumbnail( $args = array() ) {
    89140    $default_args = array(
     141        'post_id'  => 0,
    90142        'title'    => '',
    91143        'colors'   => array(),
     
    93145        'height'   => 600,
    94146        'overlays' => array(),
    95         'post_id'  => 0,
    96         'preview'  => false,
    97147    );
    98148
     
    100150
    101151    // Extract arguments for easier access.
     152    $post_id  = isset( $args['post_id'] ) ? absint( $args['post_id'] ) : 0;
    102153    $title    = isset( $args['title'] ) ? $args['title'] : '';
    103154    $colors   = isset( $args['colors'] ) && is_array( $args['colors'] ) ? $args['colors'] : array();
     
    105156    $height   = isset( $args['height'] ) ? absint( $args['height'] ) : 600;
    106157    $overlays = isset( $args['overlays'] ) && is_array( $args['overlays'] ) ? $args['overlays'] : array();
    107     $preview  = isset( $args['preview'] ) ? (bool) $args['preview'] : false;
    108 
    109     $font_size = get_option( 'aimg_title_font_size', 40 );
     158
     159    if ( empty( $post_id ) || empty( $title ) || empty( $width ) || empty( $height ) ) {
     160        return false;
     161    }
     162
     163    $font_size = get_post_meta( $post_id, '_aimg_title_font_size', true );
    110164    $font_path = AIMG_ASSETS_PATH . 'fonts/Roboto-Bold.ttf';
    111165
     
    141195            }
    142196
    143             $overlay_position = get_option( 'aimg_overlay_position', 'center-center' );
     197            $overlay_position = get_post_meta( $post_id, '_aimg_overlay_position', true );
    144198            $overlay          = imagecreatefrompng( $overlay_path );
    145199
     
    283337
    284338    // Generate filename.
    285     if ( $preview ) {
    286         $filename = 'aimg-preview-thumbnail-image.png';
    287     } else {
    288         $suffix   = isset( $args['post_id'] ) ? absint( $args['post_id'] ) : wp_rand( 10000, 99999 );
    289         $filename = sanitize_title( $title ) . '-' . $suffix . '.png';
    290     }
     339    $suffix   = isset( $args['post_id'] ) ? absint( $args['post_id'] ) : wp_rand( 10000, 99999 );
     340    $filename = sanitize_title( $title ) . '-' . $suffix . '.png';
    291341
    292342    // Save image to uploads directory.
  • artificial-image-generator/trunk/languages/artificial-image-generator.pot

    r3425585 r3473025  
    1 # Copyright (C) 2025 BeautifulPlugins
    2 # This file is distributed under the GPLv2 or later.
    3 msgid ""
    4 msgstr ""
    5 "Project-Id-Version: Image Generator 1.0.0\n"
     1# Copyright (C) 2026 BeautifulPlugins
     2# This file is distributed under the GPL v2 or later.
     3msgid ""
     4msgstr ""
     5"Project-Id-Version: Image Generator 1.1.0\n"
    66"Report-Msgid-Bugs-To: https://beautifulplugins.com/support/\n"
    7 "POT-Creation-Date: 2025-12-21 18:10:55+00:00\n"
     7"POT-Creation-Date: 2026-03-02 19:03:46+00:00\n"
    88"MIME-Version: 1.0\n"
    99"Content-Type: text/plain; charset=utf-8\n"
    1010"Content-Transfer-Encoding: 8bit\n"
    11 "PO-Revision-Date: 2025-MO-DA HO:MI+ZONE\n"
     11"PO-Revision-Date: 2026-MO-DA HO:MI+ZONE\n"
    1212"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
    1313"Language-Team: LANGUAGE <LL@li.org>\n"
     
    2525"X-Generator: grunt-wp-i18n 1.0.3\n"
    2626
    27 #: includes/Admin/views/admin-page.php:53
     27#: includes/Admin/views/add-img-template.php:65
     28#: includes/Admin/views/edit-img-template.php:66
    2829msgid "40"
    2930msgstr ""
    3031
    31 #: includes/Admin/views/admin-page.php:44
     32#: includes/Admin/views/add-img-template.php:56
     33#: includes/Admin/views/edit-img-template.php:57
    3234msgid "800"
    3335msgstr ""
    3436
    35 #: includes/Admin/views/admin-page.php:35
     37#: includes/Admin/views/add-img-template.php:47
     38#: includes/Admin/views/edit-img-template.php:48
    3639msgid "1200"
    3740msgstr ""
    3841
    39 #: includes/Admin/Actions.php:36 includes/Admin/Actions.php:77
    40 #: includes/Admin/Actions.php:117
    41 msgid "You do not have permission to perform this action."
    42 msgstr ""
    43 
    44 #: includes/Admin/Actions.php:63
    45 msgid "Settings saved successfully."
     42#: includes/Admin/Actions.php:35
     43msgid "You do not have permission to process this action"
     44msgstr ""
     45
     46#: includes/Admin/Actions.php:45
     47msgid "The title field is required."
    4648msgstr ""
    4749
    4850#: includes/Admin/Actions.php:101
    49 msgid "Overlay images saved successfully."
    50 msgstr ""
    51 
    52 #: includes/Admin/Actions.php:105
    53 msgid "No overlay images provided."
    54 msgstr ""
    55 
    56 #: includes/Admin/Actions.php:130
    57 msgid "Overlay image removed successfully."
    58 msgstr ""
    59 
    60 #: includes/Admin/Actions.php:133
    61 msgid "Overlay image not found."
    62 msgstr ""
    63 
    64 #: includes/Admin/Actions.php:137
    65 msgid "Invalid overlay image ID."
     51msgid "Image template updated successfully."
     52msgstr ""
     53
     54#: includes/Admin/Actions.php:103
     55msgid "Image template added successfully."
    6656msgstr ""
    6757
    6858#. Plugin Name of the plugin/theme
    6959msgid "Image Generator"
     60msgstr ""
     61
     62#: includes/Admin/Admin.php:46 includes/Admin/Admin.php:47
     63#: includes/Admin/views/img-templates.php:16
     64msgid "Image Templates"
     65msgstr ""
     66
     67#: includes/Admin/Admin.php:94
     68msgid "Image templates per page"
     69msgstr ""
     70
     71#: includes/Admin/Admin.php:157
     72msgid "You do not have permission to perform this action."
     73msgstr ""
     74
     75#: includes/Admin/Admin.php:182
     76#. translators: %s: number of accounts.
     77msgid "%s item(s) deleted successfully."
     78msgstr ""
     79
     80#: includes/Admin/ListTables/TemplatesTable.php:90
     81msgid "No templates found."
     82msgstr ""
     83
     84#: includes/Admin/ListTables/TemplatesTable.php:103
     85msgid "Name"
     86msgstr ""
     87
     88#: includes/Admin/ListTables/TemplatesTable.php:104
     89#: includes/Admin/views/add-img-template.php:120
     90#: includes/Admin/views/edit-img-template.php:140
     91#: includes/Admin/views/edit-img-template.php:144
     92msgid "Preview Image"
     93msgstr ""
     94
     95#: includes/Admin/ListTables/TemplatesTable.php:105
     96msgid "Date"
     97msgstr ""
     98
     99#: includes/Admin/ListTables/TemplatesTable.php:163
     100#. translators: %d: key id.
     101msgid "ID: %d"
     102msgstr ""
     103
     104#: includes/Admin/ListTables/TemplatesTable.php:164
     105msgid "Edit"
     106msgstr ""
     107
     108#: includes/Admin/ListTables/TemplatesTable.php:165
     109#: includes/Admin/ListTables/TemplatesTable.php:178
     110msgid "Delete"
    70111msgstr ""
    71112
     
    141182msgstr ""
    142183
    143 #: includes/Admin/views/admin-page.php:18
    144 msgid "Configure to generate thumbnails."
    145 msgstr ""
    146 
    147 #: includes/Admin/views/admin-page.php:23
     184#: includes/Admin/views/add-img-template.php:15
     185msgid "Add New Image Template"
     186msgstr ""
     187
     188#: includes/Admin/views/add-img-template.php:18
     189#: includes/Admin/views/edit-img-template.php:19
     190msgid "Configure the template options to generate images."
     191msgstr ""
     192
     193#: includes/Admin/views/add-img-template.php:26
     194#: includes/Admin/views/edit-img-template.php:27
     195msgid "Title"
     196msgstr ""
     197
     198#: includes/Admin/views/add-img-template.php:29
     199#: includes/Admin/views/edit-img-template.php:30
     200msgid "Awesome image template"
     201msgstr ""
     202
     203#: includes/Admin/views/add-img-template.php:30
     204#: includes/Admin/views/edit-img-template.php:31
     205msgid "Enter the title for the image template."
     206msgstr ""
     207
     208#: includes/Admin/views/add-img-template.php:35
     209#: includes/Admin/views/edit-img-template.php:36
    148210msgid "Background Colors"
    149211msgstr ""
    150212
    151 #: includes/Admin/views/admin-page.php:26
     213#: includes/Admin/views/add-img-template.php:38
     214#: includes/Admin/views/edit-img-template.php:39
    152215msgid "e.g. #e74c3c, #2ecc71, #9b59b6"
    153216msgstr ""
    154217
    155 #: includes/Admin/views/admin-page.php:27
     218#: includes/Admin/views/add-img-template.php:39
     219#: includes/Admin/views/edit-img-template.php:40
    156220msgid ""
    157221"Enter the background colors for the thumbnails. Use comma to separate "
     
    159223msgstr ""
    160224
    161 #: includes/Admin/views/admin-page.php:32
     225#: includes/Admin/views/add-img-template.php:44
     226#: includes/Admin/views/edit-img-template.php:45
    162227msgid "Width"
    163228msgstr ""
    164229
    165 #: includes/Admin/views/admin-page.php:36
     230#: includes/Admin/views/add-img-template.php:48
     231#: includes/Admin/views/edit-img-template.php:49
    166232msgid "Enter the width for the thumbnails in pixels."
    167233msgstr ""
    168234
    169 #: includes/Admin/views/admin-page.php:41
     235#: includes/Admin/views/add-img-template.php:53
     236#: includes/Admin/views/edit-img-template.php:54
    170237msgid "Height"
    171238msgstr ""
    172239
    173 #: includes/Admin/views/admin-page.php:45
     240#: includes/Admin/views/add-img-template.php:57
     241#: includes/Admin/views/edit-img-template.php:58
    174242msgid "Enter the height for the thumbnails in pixels."
    175243msgstr ""
    176244
    177 #: includes/Admin/views/admin-page.php:50
     245#: includes/Admin/views/add-img-template.php:62
     246#: includes/Admin/views/edit-img-template.php:63
    178247msgid "Title Font Size"
    179248msgstr ""
    180249
    181 #: includes/Admin/views/admin-page.php:54
     250#: includes/Admin/views/add-img-template.php:66
     251#: includes/Admin/views/edit-img-template.php:67
    182252msgid "Enter the font size for the title in pixels."
    183253msgstr ""
    184254
    185 #: includes/Admin/views/admin-page.php:59
     255#: includes/Admin/views/add-img-template.php:71
     256#: includes/Admin/views/edit-img-template.php:72
    186257msgid "Enable Overlay Images"
    187258msgstr ""
    188259
    189 #: includes/Admin/views/admin-page.php:64
     260#: includes/Admin/views/add-img-template.php:76
     261#: includes/Admin/views/edit-img-template.php:77
    190262msgid "Enable"
    191263msgstr ""
    192264
    193 #: includes/Admin/views/admin-page.php:66
     265#: includes/Admin/views/add-img-template.php:78
     266#: includes/Admin/views/edit-img-template.php:79
    194267msgid "Check this box to enable overlay images in the thumbnails."
    195268msgstr ""
    196269
    197 #: includes/Admin/views/admin-page.php:72
     270#: includes/Admin/views/add-img-template.php:84
     271#: includes/Admin/views/edit-img-template.php:85
    198272msgid "Overlay Images"
    199273msgstr ""
    200274
    201 #: includes/Admin/views/admin-page.php:84
    202 msgid "Overlay Image"
    203 msgstr ""
    204 
    205 #: includes/Admin/views/admin-page.php:85
    206 msgid "X"
    207 msgstr ""
    208 
    209 #: includes/Admin/views/admin-page.php:90
    210 msgid "No overlay images selected."
    211 msgstr ""
    212 
    213 #: includes/Admin/views/admin-page.php:94
     275#: includes/Admin/views/add-img-template.php:89
     276#: includes/Admin/views/edit-img-template.php:108
    214277msgid "Select Images"
    215278msgstr ""
    216279
    217 #: includes/Admin/views/admin-page.php:95
     280#: includes/Admin/views/add-img-template.php:91
     281#: includes/Admin/views/edit-img-template.php:110
    218282msgid ""
    219283"Select one or more transparent PNG images to use as overlay images in the "
     
    221285msgstr ""
    222286
    223 #: includes/Admin/views/admin-page.php:101
     287#: includes/Admin/views/add-img-template.php:97
     288#: includes/Admin/views/edit-img-template.php:116
    224289msgid "Overlay Image Position"
    225290msgstr ""
    226291
    227 #: includes/Admin/views/admin-page.php:106
     292#: includes/Admin/views/add-img-template.php:101
     293#: includes/Admin/views/edit-img-template.php:121
    228294msgid "Top Left"
    229295msgstr ""
    230296
    231 #: includes/Admin/views/admin-page.php:107
     297#: includes/Admin/views/add-img-template.php:102
     298#: includes/Admin/views/edit-img-template.php:122
    232299msgid "Top Center"
    233300msgstr ""
    234301
    235 #: includes/Admin/views/admin-page.php:108
     302#: includes/Admin/views/add-img-template.php:103
     303#: includes/Admin/views/edit-img-template.php:123
    236304msgid "Top Right"
    237305msgstr ""
    238306
    239 #: includes/Admin/views/admin-page.php:109
     307#: includes/Admin/views/add-img-template.php:104
     308#: includes/Admin/views/edit-img-template.php:124
    240309msgid "Left Center"
    241310msgstr ""
    242311
    243 #: includes/Admin/views/admin-page.php:110
     312#: includes/Admin/views/add-img-template.php:105
     313#: includes/Admin/views/edit-img-template.php:125
    244314msgid "Center Center"
    245315msgstr ""
    246316
    247 #: includes/Admin/views/admin-page.php:111
     317#: includes/Admin/views/add-img-template.php:106
     318#: includes/Admin/views/edit-img-template.php:126
    248319msgid "Right Center"
    249320msgstr ""
    250321
    251 #: includes/Admin/views/admin-page.php:112
     322#: includes/Admin/views/add-img-template.php:107
     323#: includes/Admin/views/edit-img-template.php:127
    252324msgid "Bottom Left"
    253325msgstr ""
    254326
    255 #: includes/Admin/views/admin-page.php:113
     327#: includes/Admin/views/add-img-template.php:108
     328#: includes/Admin/views/edit-img-template.php:128
    256329msgid "Bottom Center"
    257330msgstr ""
    258331
    259 #: includes/Admin/views/admin-page.php:114
     332#: includes/Admin/views/add-img-template.php:109
     333#: includes/Admin/views/edit-img-template.php:129
    260334msgid "Bottom Right"
    261335msgstr ""
    262336
    263 #: includes/Admin/views/admin-page.php:116
     337#: includes/Admin/views/add-img-template.php:111
     338#: includes/Admin/views/edit-img-template.php:131
    264339msgid ""
    265340"Select the position for the overlay images in the thumbnails. The overlay "
     
    268343msgstr ""
    269344
    270 #: includes/Admin/views/admin-page.php:120
    271 msgid "Preview"
    272 msgstr ""
    273 
    274 #: includes/Admin/views/admin-page.php:124
    275 msgid "Preview Image"
    276 msgstr ""
    277 
    278 #: includes/Admin/views/admin-page.php:125
    279 msgid ""
    280 "This is a preview of how the thumbnail will look like based on the current "
    281 "settings. Save the settings to generate a new preview."
    282 msgstr ""
    283 
    284 #: includes/Admin/views/admin-page.php:127
    285 msgid "Preview could not be generated. Save the settings to generate a preview."
     345#: includes/Admin/views/add-img-template.php:121
     346#: includes/Admin/views/edit-img-template.php:148
     347msgid "Preview could not be generated. Save changes to generate a preview."
     348msgstr ""
     349
     350#: includes/Admin/views/edit-img-template.php:16 includes/PostTypes.php:40
     351msgid "Edit Image Template"
     352msgstr ""
     353
     354#: includes/Admin/views/edit-img-template.php:98
     355msgid "Overlay Image"
     356msgstr ""
     357
     358#: includes/Admin/views/edit-img-template.php:99
     359msgid "X"
     360msgstr ""
     361
     362#: includes/Admin/views/edit-img-template.php:104
     363msgid "No overlay images selected."
     364msgstr ""
     365
     366#: includes/Admin/views/edit-img-template.php:146
     367msgid ""
     368"This is a preview of how the image will look like based on the current "
     369"settings. Save changes to generate a new preview."
     370msgstr ""
     371
     372#: includes/Admin/views/img-templates.php:18
     373msgid "Add New"
     374msgstr ""
     375
     376#: includes/Admin/views/img-templates.php:25
     377msgid "Search"
     378msgstr ""
     379
     380#: includes/PostTypes.php:38
     381msgid "Add New Images Template"
     382msgstr ""
     383
     384#: includes/PostTypes.php:39
     385msgid "New Images Template"
     386msgstr ""
     387
     388#: includes/PostTypes.php:41
     389msgid "View Image Template"
     390msgstr ""
     391
     392#: includes/PostTypes.php:42
     393msgid "All Image Templates"
     394msgstr ""
     395
     396#: includes/PostTypes.php:43
     397msgid "Search Image Templates"
     398msgstr ""
     399
     400#: includes/PostTypes.php:44
     401msgid "Parent Image Templates:"
     402msgstr ""
     403
     404#: includes/PostTypes.php:45
     405msgid "No image templates found."
     406msgstr ""
     407
     408#: includes/PostTypes.php:46
     409msgid "No image templates found in Trash."
    286410msgstr ""
    287411
     
    303427msgid "https://beautifulplugins.com"
    304428msgstr ""
     429
     430#: includes/PostTypes.php:33
     431msgctxt "post type general name"
     432msgid "Image Templates"
     433msgstr ""
     434
     435#: includes/PostTypes.php:34
     436msgctxt "post type singular name"
     437msgid "Image Template"
     438msgstr ""
     439
     440#: includes/PostTypes.php:35
     441msgctxt "admin menu"
     442msgid "Image Templates"
     443msgstr ""
     444
     445#: includes/PostTypes.php:36
     446msgctxt "add new on admin bar"
     447msgid "Image Templates"
     448msgstr ""
     449
     450#: includes/PostTypes.php:37
     451msgctxt "ticket"
     452msgid "Add New"
     453msgstr ""
  • artificial-image-generator/trunk/readme.txt

    r3425585 r3473025  
    33Tags: ai, ai image, featured images, ai image generator, image generator
    44Tested up to: 6.9
    5 Stable tag: 1.0.0
     5Stable tag: 1.1.0
    66License: GPLv2 or later
    77License URI: https://www.gnu.org/licenses/gpl-2.0.html
     
    135135
    136136== Changelog ==
     137= 1.1.0 ( 3rd March 2026 ) =
     138* New: Added support for creating unlimited image templates with custom styles and layouts.
     139* Fix: Resolved compatibility issues with the latest version of WordPress.
     140* Enhance: Optimized image generation process for faster performance and reduced server load.
    137141
    138142= 1.0.0 ( 22nd December 2025 ) =
    139143* Initial release
     144
     145== Upgrade Notice ==
     146= 1.1.0 =
     147Major update with new features and improvements. Please backup your site before updating.
    140148
    141149== Support and Feedback ==
  • artificial-image-generator/trunk/vendor/autoload.php

    r3424875 r3473025  
    2020require_once __DIR__ . '/composer/autoload_real.php';
    2121
    22 return ComposerAutoloaderInit2e664fd2fb00ee27f1f41078a1c13365::getLoader();
     22return ComposerAutoloaderInit6e093c60687139b2de60a46a1974731c::getLoader();
  • artificial-image-generator/trunk/vendor/composer/autoload_classmap.php

    r3424875 r3473025  
    99    'ArtificialImageGenerator\\Admin\\Actions' => $baseDir . '/includes/Admin/Actions.php',
    1010    'ArtificialImageGenerator\\Admin\\Admin' => $baseDir . '/includes/Admin/Admin.php',
     11    'ArtificialImageGenerator\\Admin\\ListTables\\TemplatesTable' => $baseDir . '/includes/Admin/ListTables/TemplatesTable.php',
    1112    'ArtificialImageGenerator\\Admin\\Settings' => $baseDir . '/includes/Admin/Settings.php',
    1213    'ArtificialImageGenerator\\GenerateImages' => $baseDir . '/includes/GenerateImages.php',
    1314    'ArtificialImageGenerator\\Plugin' => $baseDir . '/includes/Plugin.php',
     15    'ArtificialImageGenerator\\PostTypes' => $baseDir . '/includes/PostTypes.php',
    1416    'Composer\\InstalledVersions' => $vendorDir . '/composer/InstalledVersions.php',
    1517);
  • artificial-image-generator/trunk/vendor/composer/autoload_real.php

    r3424875 r3473025  
    33// autoload_real.php @generated by Composer
    44
    5 class ComposerAutoloaderInit2e664fd2fb00ee27f1f41078a1c13365
     5class ComposerAutoloaderInit6e093c60687139b2de60a46a1974731c
    66{
    77    private static $loader;
     
    2525        require __DIR__ . '/platform_check.php';
    2626
    27         spl_autoload_register(array('ComposerAutoloaderInit2e664fd2fb00ee27f1f41078a1c13365', 'loadClassLoader'), true, true);
     27        spl_autoload_register(array('ComposerAutoloaderInit6e093c60687139b2de60a46a1974731c', 'loadClassLoader'), true, true);
    2828        self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname(__DIR__));
    29         spl_autoload_unregister(array('ComposerAutoloaderInit2e664fd2fb00ee27f1f41078a1c13365', 'loadClassLoader'));
     29        spl_autoload_unregister(array('ComposerAutoloaderInit6e093c60687139b2de60a46a1974731c', 'loadClassLoader'));
    3030
    3131        require __DIR__ . '/autoload_static.php';
    32         call_user_func(\Composer\Autoload\ComposerStaticInit2e664fd2fb00ee27f1f41078a1c13365::getInitializer($loader));
     32        call_user_func(\Composer\Autoload\ComposerStaticInit6e093c60687139b2de60a46a1974731c::getInitializer($loader));
    3333
    3434        $loader->register(true);
  • artificial-image-generator/trunk/vendor/composer/autoload_static.php

    r3424875 r3473025  
    55namespace Composer\Autoload;
    66
    7 class ComposerStaticInit2e664fd2fb00ee27f1f41078a1c13365
     7class ComposerStaticInit6e093c60687139b2de60a46a1974731c
    88{
    99    public static $prefixLengthsPsr4 = array (
     
    2424        'ArtificialImageGenerator\\Admin\\Actions' => __DIR__ . '/../..' . '/includes/Admin/Actions.php',
    2525        'ArtificialImageGenerator\\Admin\\Admin' => __DIR__ . '/../..' . '/includes/Admin/Admin.php',
     26        'ArtificialImageGenerator\\Admin\\ListTables\\TemplatesTable' => __DIR__ . '/../..' . '/includes/Admin/ListTables/TemplatesTable.php',
    2627        'ArtificialImageGenerator\\Admin\\Settings' => __DIR__ . '/../..' . '/includes/Admin/Settings.php',
    2728        'ArtificialImageGenerator\\GenerateImages' => __DIR__ . '/../..' . '/includes/GenerateImages.php',
    2829        'ArtificialImageGenerator\\Plugin' => __DIR__ . '/../..' . '/includes/Plugin.php',
     30        'ArtificialImageGenerator\\PostTypes' => __DIR__ . '/../..' . '/includes/PostTypes.php',
    2931        'Composer\\InstalledVersions' => __DIR__ . '/..' . '/composer/InstalledVersions.php',
    3032    );
     
    3335    {
    3436        return \Closure::bind(function () use ($loader) {
    35             $loader->prefixLengthsPsr4 = ComposerStaticInit2e664fd2fb00ee27f1f41078a1c13365::$prefixLengthsPsr4;
    36             $loader->prefixDirsPsr4 = ComposerStaticInit2e664fd2fb00ee27f1f41078a1c13365::$prefixDirsPsr4;
    37             $loader->classMap = ComposerStaticInit2e664fd2fb00ee27f1f41078a1c13365::$classMap;
     37            $loader->prefixLengthsPsr4 = ComposerStaticInit6e093c60687139b2de60a46a1974731c::$prefixLengthsPsr4;
     38            $loader->prefixDirsPsr4 = ComposerStaticInit6e093c60687139b2de60a46a1974731c::$prefixDirsPsr4;
     39            $loader->classMap = ComposerStaticInit6e093c60687139b2de60a46a1974731c::$classMap;
    3840
    3941        }, null, ClassLoader::class);
  • artificial-image-generator/trunk/vendor/composer/installed.php

    r3425585 r3473025  
    22    'root' => array(
    33        'name' => 'beautifulplugins/artificial-image-generator',
    4         'pretty_version' => 'v1.0.0',
    5         'version' => '1.0.0.0',
    6         'reference' => 'fbefb482442bf5433a7a828d23cc49b35f528b66',
     4        'pretty_version' => 'v1.1.0',
     5        'version' => '1.1.0.0',
     6        'reference' => '9d2e7c0876df4d27498e57fe83fc1805b9314e0d',
    77        'type' => 'wordpress-plugin',
    88        'install_path' => __DIR__ . '/../../',
     
    1212    'versions' => array(
    1313        'beautifulplugins/artificial-image-generator' => array(
    14             'pretty_version' => 'v1.0.0',
    15             'version' => '1.0.0.0',
    16             'reference' => 'fbefb482442bf5433a7a828d23cc49b35f528b66',
     14            'pretty_version' => 'v1.1.0',
     15            'version' => '1.1.0.0',
     16            'reference' => '9d2e7c0876df4d27498e57fe83fc1805b9314e0d',
    1717            'type' => 'wordpress-plugin',
    1818            'install_path' => __DIR__ . '/../../',
Note: See TracChangeset for help on using the changeset viewer.