Changeset 3473025
- Timestamp:
- 03/02/2026 07:09:46 PM (4 weeks ago)
- Location:
- artificial-image-generator
- Files:
-
- 12 added
- 2 deleted
- 41 edited
- 1 copied
-
assets/blueprints/blueprint.json (modified) (1 diff)
-
tags/1.1.0 (copied) (copied from artificial-image-generator/trunk)
-
tags/1.1.0/artificial-image-generator.php (modified) (3 diffs)
-
tags/1.1.0/assets/css/admin-rtl.css (modified) (1 diff)
-
tags/1.1.0/assets/css/admin.asset.php (modified) (1 diff)
-
tags/1.1.0/assets/css/admin.css (modified) (1 diff)
-
tags/1.1.0/assets/js/admin.asset.php (modified) (1 diff)
-
tags/1.1.0/assets/js/admin.js (modified) (1 diff)
-
tags/1.1.0/composer.json (modified) (3 diffs)
-
tags/1.1.0/includes/Admin/Actions.php (modified) (2 diffs)
-
tags/1.1.0/includes/Admin/Admin.php (modified) (4 diffs)
-
tags/1.1.0/includes/Admin/ListTables (added)
-
tags/1.1.0/includes/Admin/ListTables/TemplatesTable.php (added)
-
tags/1.1.0/includes/Admin/Settings.php (modified) (8 diffs)
-
tags/1.1.0/includes/Admin/views/add-img-template.php (added)
-
tags/1.1.0/includes/Admin/views/admin-page.php (deleted)
-
tags/1.1.0/includes/Admin/views/edit-img-template.php (added)
-
tags/1.1.0/includes/Admin/views/img-templates.php (added)
-
tags/1.1.0/includes/GenerateImages.php (modified) (2 diffs)
-
tags/1.1.0/includes/Plugin.php (modified) (1 diff)
-
tags/1.1.0/includes/PostTypes.php (added)
-
tags/1.1.0/includes/functions.php (modified) (12 diffs)
-
tags/1.1.0/languages/artificial-image-generator.pot (modified) (7 diffs)
-
tags/1.1.0/readme.txt (modified) (2 diffs)
-
tags/1.1.0/vendor/autoload.php (modified) (1 diff)
-
tags/1.1.0/vendor/composer/autoload_classmap.php (modified) (1 diff)
-
tags/1.1.0/vendor/composer/autoload_real.php (modified) (2 diffs)
-
tags/1.1.0/vendor/composer/autoload_static.php (modified) (3 diffs)
-
tags/1.1.0/vendor/composer/installed.php (modified) (2 diffs)
-
trunk/artificial-image-generator.php (modified) (3 diffs)
-
trunk/assets/css/admin-rtl.css (modified) (1 diff)
-
trunk/assets/css/admin.asset.php (modified) (1 diff)
-
trunk/assets/css/admin.css (modified) (1 diff)
-
trunk/assets/js/admin.asset.php (modified) (1 diff)
-
trunk/assets/js/admin.js (modified) (1 diff)
-
trunk/composer.json (modified) (3 diffs)
-
trunk/includes/Admin/Actions.php (modified) (2 diffs)
-
trunk/includes/Admin/Admin.php (modified) (4 diffs)
-
trunk/includes/Admin/ListTables (added)
-
trunk/includes/Admin/ListTables/TemplatesTable.php (added)
-
trunk/includes/Admin/Settings.php (modified) (8 diffs)
-
trunk/includes/Admin/views/add-img-template.php (added)
-
trunk/includes/Admin/views/admin-page.php (deleted)
-
trunk/includes/Admin/views/edit-img-template.php (added)
-
trunk/includes/Admin/views/img-templates.php (added)
-
trunk/includes/GenerateImages.php (modified) (2 diffs)
-
trunk/includes/Plugin.php (modified) (1 diff)
-
trunk/includes/PostTypes.php (added)
-
trunk/includes/functions.php (modified) (12 diffs)
-
trunk/languages/artificial-image-generator.pot (modified) (7 diffs)
-
trunk/readme.txt (modified) (2 diffs)
-
trunk/vendor/autoload.php (modified) (1 diff)
-
trunk/vendor/composer/autoload_classmap.php (modified) (1 diff)
-
trunk/vendor/composer/autoload_real.php (modified) (2 diffs)
-
trunk/vendor/composer/autoload_static.php (modified) (3 diffs)
-
trunk/vendor/composer/installed.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
artificial-image-generator/assets/blueprints/blueprint.json
r3425585 r3473025 2 2 "landingPage": "/wp-admin/admin.php?page=artificial-image-generator", 3 3 "preferredVersions": { 4 "php": " 7.4",5 "wp": "5. 2"4 "php": "8.2", 5 "wp": "5.9" 6 6 }, 7 7 "phpExtensionBundles": [ -
artificial-image-generator/tags/1.1.0/artificial-image-generator.php
r3425585 r3473025 4 4 * Plugin URI: https://beautifulplugins.com/image-generator/ 5 5 * Description: Generate AI-powered images automatically across your WordPress site. Create stunning visuals for posts, pages, and more with ease. 6 * Version: 1. 0.06 * Version: 1.1.0 7 7 * Requires at least: 5.0 8 8 * Requires PHP: 7.4 9 * Tested up to: 6.9 9 10 * Author: BeautifulPlugins 10 11 * Author URI: https://beautifulplugins.com 11 * License: GPL v2 or later12 * License: GPL v2 or later 12 13 * License URI: https://www.gnu.org/licenses/gpl-2.0.html 13 14 * Text Domain: artificial-image-generator 14 15 * Domain Path: /languages 15 * Tested up to: 6.916 16 * 17 17 * @package ArtificialImageGenerator … … 30 30 use ArtificialImageGenerator\Plugin; 31 31 32 defined( 'ABSPATH' ) || exit; // Prevent direct access.32 defined( 'ABSPATH' ) || exit; // Exit if accessed directly. 33 33 34 /** 35 * Optimized autoload classes. 36 * 37 * @since 1.0.0 38 */ 34 // Autoload optimized classes. 39 35 require_once __DIR__ . '/vendor/autoload.php'; 40 36 … … 43 39 * 44 40 * @since 1.0.0 45 * @return Plugin 41 * @return Plugin The plugin instance. 46 42 */ 47 43 function artificial_image_generator() { 48 return Plugin::create( __FILE__, '1. 0.0' );44 return Plugin::create( __FILE__, '1.1.0' ); 49 45 } 50 46 -
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()}));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.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 7 7 "prefer-stable": true, 8 8 "minimum-stability": "dev", 9 "repositories": [],10 "require-dev": {},11 9 "require": { 12 10 "php": ">=7.4" … … 25 23 } 26 24 }, 27 "autoload-dev": {},28 25 "scripts": { 29 26 "post-install-cmd": [ … … 33 30 "composer dump-autoload" 34 31 ] 35 }, 36 "extra": {} 32 } 37 33 } -
artificial-image-generator/tags/1.1.0/includes/Admin/Actions.php
r3424875 r3473025 19 19 */ 20 20 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' ) ); 24 22 } 25 23 26 24 /** 27 * Save auto image generator settings.25 * Add product tabs data. 28 26 * 29 27 * @since 1.0.0 28 * @return void 30 29 */ 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' ); 33 32 $referer = wp_get_referer(); 34 33 35 34 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' ); 37 36 wp_safe_redirect( $referer ); 38 exit ();37 exit; 39 38 } 40 39 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. 41 73 $bg_colors = isset( $_POST['bg_colors'] ) ? sanitize_text_field( wp_unslash( $_POST['bg_colors'] ) ) : ''; 42 74 $width = isset( $_POST['width'] ) ? absint( $_POST['width'] ) : 1200; … … 44 76 $title_font_size = isset( $_POST['title_font_size'] ) ? absint( $_POST['title_font_size'] ) : 40; 45 77 $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'] ) ) : ''; 46 79 $overlay_position = isset( $_POST['overlay_position'] ) ? sanitize_text_field( wp_unslash( $_POST['overlay_position'] ) ) : 'center-center'; 47 80 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 ); 54 88 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 ); 59 94 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 ); 78 97 } 79 98 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' ) ); 103 104 } 104 105 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 ); 107 110 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; 138 113 } 139 114 } -
artificial-image-generator/tags/1.1.0/includes/Admin/Admin.php
r3424875 r3473025 2 2 3 3 namespace ArtificialImageGenerator\Admin; 4 5 use ArtificialImageGenerator\Admin\ListTables\TemplatesTable; 4 6 5 7 defined( 'ABSPATH' ) || exit; // Exit if accessed directly. … … 12 14 */ 13 15 class Admin { 16 14 17 /** 15 18 * Constructor. 16 19 */ 17 20 public function __construct() { 18 // Add menu page.19 21 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' ) ); 23 25 } 24 26 … … 34 36 __( 'Image Generator', 'artificial-image-generator' ), 35 37 'manage_options', 36 ' artificial-image-generator',37 array( $this, 'admin_page' ),38 'image-generator', 39 null, 38 40 'dashicons-format-image', 39 41 26 40 42 ); 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 } 51 192 } 52 193 … … 59 200 * @return void 60 201 */ 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 ) { 63 205 return; 64 206 } -
artificial-image-generator/tags/1.1.0/includes/Admin/Settings.php
r3425585 r3473025 32 32 public function add_settings_page() { 33 33 add_submenu_page( 34 ' artificial-image-generator',34 'image-generator', 35 35 __( 'Settings', 'artificial-image-generator' ), 36 36 __( 'Settings', 'artificial-image-generator' ), 37 37 'manage_options', 38 'a rtificial-image-generator-settings',38 'aimg-settings', 39 39 array( $this, 'settings_page' ) 40 40 ); … … 62 62 <form method="post" action="<?php echo esc_url( admin_url( 'options.php' ) ); ?>"> 63 63 <?php 64 settings_fields( 'a rtificial_image_generator' );65 do_settings_sections( 'a rtificial-image-generator' );64 settings_fields( 'aimg' ); 65 do_settings_sections( 'aimg-settings' ); 66 66 submit_button(); 67 67 ?> … … 78 78 */ 79 79 public function register_settings() { 80 register_setting( 'a rtificial_image_generator', 'aimg_settings', array( $this, 'sanitize_settings' ) );80 register_setting( 'aimg', 'aimg_settings', array( $this, 'sanitize_settings' ) ); 81 81 82 82 // Add settings section. … … 85 85 __( 'General Settings', 'artificial-image-generator' ), 86 86 array( $this, 'general_settings' ), 87 'a rtificial-image-generator'87 'aimg-settings' 88 88 ); 89 89 … … 93 93 __( 'Default Background Color', 'artificial-image-generator' ), 94 94 array( $this, 'default_bg_color' ), 95 'a rtificial-image-generator',95 'aimg-settings', 96 96 'aimg_general_settings' 97 97 ); … … 102 102 __( 'Default Text Color', 'artificial-image-generator' ), 103 103 array( $this, 'default_text_color' ), 104 'a rtificial-image-generator',104 'aimg-settings', 105 105 'aimg_general_settings' 106 106 ); … … 111 111 __( 'Enable Post Thumbnails', 'artificial-image-generator' ), 112 112 array( $this, 'is_post_thumbnail' ), 113 'a rtificial-image-generator',113 'aimg-settings', 114 114 'aimg_general_settings' 115 115 ); … … 120 120 __( 'Enable Page Thumbnails', 'artificial-image-generator' ), 121 121 array( $this, 'is_page_thumbnail' ), 122 'a rtificial-image-generator',122 'aimg-settings', 123 123 'aimg_general_settings' 124 124 ); -
artificial-image-generator/tags/1.1.0/includes/GenerateImages.php
r3424875 r3473025 73 73 } 74 74 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 ); 77 92 78 93 // Make sure colors are split into an array if they are a string. … … 83 98 // Get absolute paths of overlay images. 84 99 $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 } 89 108 } 90 }91 109 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 } 95 114 } 96 115 97 116 $image_path = aimg_generate_thumbnail( 98 117 array( 118 'post_id' => $template_id, 99 119 'title' => $title, 100 120 '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 ), 103 123 'overlays' => $overlays, 104 'post_id' => $post_id,105 124 ) 106 125 ); -
artificial-image-generator/tags/1.1.0/includes/Plugin.php
r3424875 r3473025 205 205 public function init() { 206 206 // Load common classes. 207 new PostTypes(); 207 208 new GenerateImages(); 208 209 -
artificial-image-generator/tags/1.1.0/includes/functions.php
r3424875 r3473025 2 2 3 3 defined( '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 */ 13 function 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 */ 35 function 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 } 4 52 5 53 /** … … 10 58 * 11 59 * @since 1.0.0 12 * @retu n mixed|null60 * @return mixed|null 13 61 */ 14 62 function aimg_get_settings( $option, $default_value = null ) { … … 21 69 * Generate a thumbnail image for preview on settings page. 22 70 * 23 * @param string $title The title text.71 * @param int $post_id Post ID for which the preview is being generated. 24 72 * @param string $colors Comma separated hex colors. 25 73 * @param int $width Image width. … … 29 77 * @return string|false Image URL or false on failure. 30 78 */ 31 function aimg_generate_preview( $title, $colors, $width, $height, $overlays = array() ) { 79 function 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 } 32 83 33 84 if ( is_string( $colors ) ) { … … 52 103 $filepath = aimg_generate_thumbnail( 53 104 array( 54 'title' => $title, 105 'post_id' => $post_id, 106 'title' => get_the_title( $post_id ), 55 107 'colors' => $colors, 56 108 'width' => $width, 57 109 'height' => $height, 58 110 'overlays' => $overlays_path, 59 'preview' => true,60 111 ) 61 112 ); … … 67 118 // Get URL from filepath. 68 119 $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'] ) ); 71 122 72 123 if ( strpos( $filepath, $basedir ) === 0 ) { … … 88 139 function aimg_generate_thumbnail( $args = array() ) { 89 140 $default_args = array( 141 'post_id' => 0, 90 142 'title' => '', 91 143 'colors' => array(), … … 93 145 'height' => 600, 94 146 'overlays' => array(), 95 'post_id' => 0,96 'preview' => false,97 147 ); 98 148 … … 100 150 101 151 // Extract arguments for easier access. 152 $post_id = isset( $args['post_id'] ) ? absint( $args['post_id'] ) : 0; 102 153 $title = isset( $args['title'] ) ? $args['title'] : ''; 103 154 $colors = isset( $args['colors'] ) && is_array( $args['colors'] ) ? $args['colors'] : array(); … … 105 156 $height = isset( $args['height'] ) ? absint( $args['height'] ) : 600; 106 157 $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 ); 110 164 $font_path = AIMG_ASSETS_PATH . 'fonts/Roboto-Bold.ttf'; 111 165 … … 141 195 } 142 196 143 $overlay_position = get_ option( 'aimg_overlay_position', 'center-center');197 $overlay_position = get_post_meta( $post_id, '_aimg_overlay_position', true ); 144 198 $overlay = imagecreatefrompng( $overlay_path ); 145 199 … … 283 337 284 338 // 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'; 291 341 292 342 // Save image to uploads directory. -
artificial-image-generator/tags/1.1.0/languages/artificial-image-generator.pot
r3425585 r3473025 1 # Copyright (C) 202 5BeautifulPlugins2 # This file is distributed under the GPL v2 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. 3 msgid "" 4 msgstr "" 5 "Project-Id-Version: Image Generator 1.1.0\n" 6 6 "Report-Msgid-Bugs-To: https://beautifulplugins.com/support/\n" 7 "POT-Creation-Date: 202 5-12-21 18:10:55+00:00\n"7 "POT-Creation-Date: 2026-03-02 19:03:46+00:00\n" 8 8 "MIME-Version: 1.0\n" 9 9 "Content-Type: text/plain; charset=utf-8\n" 10 10 "Content-Transfer-Encoding: 8bit\n" 11 "PO-Revision-Date: 202 5-MO-DA HO:MI+ZONE\n"11 "PO-Revision-Date: 2026-MO-DA HO:MI+ZONE\n" 12 12 "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" 13 13 "Language-Team: LANGUAGE <LL@li.org>\n" … … 25 25 "X-Generator: grunt-wp-i18n 1.0.3\n" 26 26 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 28 29 msgid "40" 29 30 msgstr "" 30 31 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 32 34 msgid "800" 33 35 msgstr "" 34 36 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 36 39 msgid "1200" 37 40 msgstr "" 38 41 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 43 msgid "You do not have permission to process this action" 44 msgstr "" 45 46 #: includes/Admin/Actions.php:45 47 msgid "The title field is required." 46 48 msgstr "" 47 49 48 50 #: 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." 51 msgid "Image template updated successfully." 52 msgstr "" 53 54 #: includes/Admin/Actions.php:103 55 msgid "Image template added successfully." 66 56 msgstr "" 67 57 68 58 #. Plugin Name of the plugin/theme 69 59 msgid "Image Generator" 60 msgstr "" 61 62 #: includes/Admin/Admin.php:46 includes/Admin/Admin.php:47 63 #: includes/Admin/views/img-templates.php:16 64 msgid "Image Templates" 65 msgstr "" 66 67 #: includes/Admin/Admin.php:94 68 msgid "Image templates per page" 69 msgstr "" 70 71 #: includes/Admin/Admin.php:157 72 msgid "You do not have permission to perform this action." 73 msgstr "" 74 75 #: includes/Admin/Admin.php:182 76 #. translators: %s: number of accounts. 77 msgid "%s item(s) deleted successfully." 78 msgstr "" 79 80 #: includes/Admin/ListTables/TemplatesTable.php:90 81 msgid "No templates found." 82 msgstr "" 83 84 #: includes/Admin/ListTables/TemplatesTable.php:103 85 msgid "Name" 86 msgstr "" 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 92 msgid "Preview Image" 93 msgstr "" 94 95 #: includes/Admin/ListTables/TemplatesTable.php:105 96 msgid "Date" 97 msgstr "" 98 99 #: includes/Admin/ListTables/TemplatesTable.php:163 100 #. translators: %d: key id. 101 msgid "ID: %d" 102 msgstr "" 103 104 #: includes/Admin/ListTables/TemplatesTable.php:164 105 msgid "Edit" 106 msgstr "" 107 108 #: includes/Admin/ListTables/TemplatesTable.php:165 109 #: includes/Admin/ListTables/TemplatesTable.php:178 110 msgid "Delete" 70 111 msgstr "" 71 112 … … 141 182 msgstr "" 142 183 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 185 msgid "Add New Image Template" 186 msgstr "" 187 188 #: includes/Admin/views/add-img-template.php:18 189 #: includes/Admin/views/edit-img-template.php:19 190 msgid "Configure the template options to generate images." 191 msgstr "" 192 193 #: includes/Admin/views/add-img-template.php:26 194 #: includes/Admin/views/edit-img-template.php:27 195 msgid "Title" 196 msgstr "" 197 198 #: includes/Admin/views/add-img-template.php:29 199 #: includes/Admin/views/edit-img-template.php:30 200 msgid "Awesome image template" 201 msgstr "" 202 203 #: includes/Admin/views/add-img-template.php:30 204 #: includes/Admin/views/edit-img-template.php:31 205 msgid "Enter the title for the image template." 206 msgstr "" 207 208 #: includes/Admin/views/add-img-template.php:35 209 #: includes/Admin/views/edit-img-template.php:36 148 210 msgid "Background Colors" 149 211 msgstr "" 150 212 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 152 215 msgid "e.g. #e74c3c, #2ecc71, #9b59b6" 153 216 msgstr "" 154 217 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 156 220 msgid "" 157 221 "Enter the background colors for the thumbnails. Use comma to separate " … … 159 223 msgstr "" 160 224 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 162 227 msgid "Width" 163 228 msgstr "" 164 229 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 166 232 msgid "Enter the width for the thumbnails in pixels." 167 233 msgstr "" 168 234 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 170 237 msgid "Height" 171 238 msgstr "" 172 239 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 174 242 msgid "Enter the height for the thumbnails in pixels." 175 243 msgstr "" 176 244 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 178 247 msgid "Title Font Size" 179 248 msgstr "" 180 249 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 182 252 msgid "Enter the font size for the title in pixels." 183 253 msgstr "" 184 254 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 186 257 msgid "Enable Overlay Images" 187 258 msgstr "" 188 259 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 190 262 msgid "Enable" 191 263 msgstr "" 192 264 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 194 267 msgid "Check this box to enable overlay images in the thumbnails." 195 268 msgstr "" 196 269 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 198 272 msgid "Overlay Images" 199 273 msgstr "" 200 274 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 214 277 msgid "Select Images" 215 278 msgstr "" 216 279 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 218 282 msgid "" 219 283 "Select one or more transparent PNG images to use as overlay images in the " … … 221 285 msgstr "" 222 286 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 224 289 msgid "Overlay Image Position" 225 290 msgstr "" 226 291 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 228 294 msgid "Top Left" 229 295 msgstr "" 230 296 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 232 299 msgid "Top Center" 233 300 msgstr "" 234 301 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 236 304 msgid "Top Right" 237 305 msgstr "" 238 306 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 240 309 msgid "Left Center" 241 310 msgstr "" 242 311 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 244 314 msgid "Center Center" 245 315 msgstr "" 246 316 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 248 319 msgid "Right Center" 249 320 msgstr "" 250 321 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 252 324 msgid "Bottom Left" 253 325 msgstr "" 254 326 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 256 329 msgid "Bottom Center" 257 330 msgstr "" 258 331 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 260 334 msgid "Bottom Right" 261 335 msgstr "" 262 336 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 264 339 msgid "" 265 340 "Select the position for the overlay images in the thumbnails. The overlay " … … 268 343 msgstr "" 269 344 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 347 msgid "Preview could not be generated. Save changes to generate a preview." 348 msgstr "" 349 350 #: includes/Admin/views/edit-img-template.php:16 includes/PostTypes.php:40 351 msgid "Edit Image Template" 352 msgstr "" 353 354 #: includes/Admin/views/edit-img-template.php:98 355 msgid "Overlay Image" 356 msgstr "" 357 358 #: includes/Admin/views/edit-img-template.php:99 359 msgid "X" 360 msgstr "" 361 362 #: includes/Admin/views/edit-img-template.php:104 363 msgid "No overlay images selected." 364 msgstr "" 365 366 #: includes/Admin/views/edit-img-template.php:146 367 msgid "" 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." 370 msgstr "" 371 372 #: includes/Admin/views/img-templates.php:18 373 msgid "Add New" 374 msgstr "" 375 376 #: includes/Admin/views/img-templates.php:25 377 msgid "Search" 378 msgstr "" 379 380 #: includes/PostTypes.php:38 381 msgid "Add New Images Template" 382 msgstr "" 383 384 #: includes/PostTypes.php:39 385 msgid "New Images Template" 386 msgstr "" 387 388 #: includes/PostTypes.php:41 389 msgid "View Image Template" 390 msgstr "" 391 392 #: includes/PostTypes.php:42 393 msgid "All Image Templates" 394 msgstr "" 395 396 #: includes/PostTypes.php:43 397 msgid "Search Image Templates" 398 msgstr "" 399 400 #: includes/PostTypes.php:44 401 msgid "Parent Image Templates:" 402 msgstr "" 403 404 #: includes/PostTypes.php:45 405 msgid "No image templates found." 406 msgstr "" 407 408 #: includes/PostTypes.php:46 409 msgid "No image templates found in Trash." 286 410 msgstr "" 287 411 … … 303 427 msgid "https://beautifulplugins.com" 304 428 msgstr "" 429 430 #: includes/PostTypes.php:33 431 msgctxt "post type general name" 432 msgid "Image Templates" 433 msgstr "" 434 435 #: includes/PostTypes.php:34 436 msgctxt "post type singular name" 437 msgid "Image Template" 438 msgstr "" 439 440 #: includes/PostTypes.php:35 441 msgctxt "admin menu" 442 msgid "Image Templates" 443 msgstr "" 444 445 #: includes/PostTypes.php:36 446 msgctxt "add new on admin bar" 447 msgid "Image Templates" 448 msgstr "" 449 450 #: includes/PostTypes.php:37 451 msgctxt "ticket" 452 msgid "Add New" 453 msgstr "" -
artificial-image-generator/tags/1.1.0/readme.txt
r3425585 r3473025 3 3 Tags: ai, ai image, featured images, ai image generator, image generator 4 4 Tested up to: 6.9 5 Stable tag: 1. 0.05 Stable tag: 1.1.0 6 6 License: GPLv2 or later 7 7 License URI: https://www.gnu.org/licenses/gpl-2.0.html … … 135 135 136 136 == 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. 137 141 138 142 = 1.0.0 ( 22nd December 2025 ) = 139 143 * Initial release 144 145 == Upgrade Notice == 146 = 1.1.0 = 147 Major update with new features and improvements. Please backup your site before updating. 140 148 141 149 == Support and Feedback == -
artificial-image-generator/tags/1.1.0/vendor/autoload.php
r3424875 r3473025 20 20 require_once __DIR__ . '/composer/autoload_real.php'; 21 21 22 return ComposerAutoloaderInit 2e664fd2fb00ee27f1f41078a1c13365::getLoader();22 return ComposerAutoloaderInit6e093c60687139b2de60a46a1974731c::getLoader(); -
artificial-image-generator/tags/1.1.0/vendor/composer/autoload_classmap.php
r3424875 r3473025 9 9 'ArtificialImageGenerator\\Admin\\Actions' => $baseDir . '/includes/Admin/Actions.php', 10 10 'ArtificialImageGenerator\\Admin\\Admin' => $baseDir . '/includes/Admin/Admin.php', 11 'ArtificialImageGenerator\\Admin\\ListTables\\TemplatesTable' => $baseDir . '/includes/Admin/ListTables/TemplatesTable.php', 11 12 'ArtificialImageGenerator\\Admin\\Settings' => $baseDir . '/includes/Admin/Settings.php', 12 13 'ArtificialImageGenerator\\GenerateImages' => $baseDir . '/includes/GenerateImages.php', 13 14 'ArtificialImageGenerator\\Plugin' => $baseDir . '/includes/Plugin.php', 15 'ArtificialImageGenerator\\PostTypes' => $baseDir . '/includes/PostTypes.php', 14 16 'Composer\\InstalledVersions' => $vendorDir . '/composer/InstalledVersions.php', 15 17 ); -
artificial-image-generator/tags/1.1.0/vendor/composer/autoload_real.php
r3424875 r3473025 3 3 // autoload_real.php @generated by Composer 4 4 5 class ComposerAutoloaderInit 2e664fd2fb00ee27f1f41078a1c133655 class ComposerAutoloaderInit6e093c60687139b2de60a46a1974731c 6 6 { 7 7 private static $loader; … … 25 25 require __DIR__ . '/platform_check.php'; 26 26 27 spl_autoload_register(array('ComposerAutoloaderInit 2e664fd2fb00ee27f1f41078a1c13365', 'loadClassLoader'), true, true);27 spl_autoload_register(array('ComposerAutoloaderInit6e093c60687139b2de60a46a1974731c', 'loadClassLoader'), true, true); 28 28 self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname(__DIR__)); 29 spl_autoload_unregister(array('ComposerAutoloaderInit 2e664fd2fb00ee27f1f41078a1c13365', 'loadClassLoader'));29 spl_autoload_unregister(array('ComposerAutoloaderInit6e093c60687139b2de60a46a1974731c', 'loadClassLoader')); 30 30 31 31 require __DIR__ . '/autoload_static.php'; 32 call_user_func(\Composer\Autoload\ComposerStaticInit 2e664fd2fb00ee27f1f41078a1c13365::getInitializer($loader));32 call_user_func(\Composer\Autoload\ComposerStaticInit6e093c60687139b2de60a46a1974731c::getInitializer($loader)); 33 33 34 34 $loader->register(true); -
artificial-image-generator/tags/1.1.0/vendor/composer/autoload_static.php
r3424875 r3473025 5 5 namespace Composer\Autoload; 6 6 7 class ComposerStaticInit 2e664fd2fb00ee27f1f41078a1c133657 class ComposerStaticInit6e093c60687139b2de60a46a1974731c 8 8 { 9 9 public static $prefixLengthsPsr4 = array ( … … 24 24 'ArtificialImageGenerator\\Admin\\Actions' => __DIR__ . '/../..' . '/includes/Admin/Actions.php', 25 25 'ArtificialImageGenerator\\Admin\\Admin' => __DIR__ . '/../..' . '/includes/Admin/Admin.php', 26 'ArtificialImageGenerator\\Admin\\ListTables\\TemplatesTable' => __DIR__ . '/../..' . '/includes/Admin/ListTables/TemplatesTable.php', 26 27 'ArtificialImageGenerator\\Admin\\Settings' => __DIR__ . '/../..' . '/includes/Admin/Settings.php', 27 28 'ArtificialImageGenerator\\GenerateImages' => __DIR__ . '/../..' . '/includes/GenerateImages.php', 28 29 'ArtificialImageGenerator\\Plugin' => __DIR__ . '/../..' . '/includes/Plugin.php', 30 'ArtificialImageGenerator\\PostTypes' => __DIR__ . '/../..' . '/includes/PostTypes.php', 29 31 'Composer\\InstalledVersions' => __DIR__ . '/..' . '/composer/InstalledVersions.php', 30 32 ); … … 33 35 { 34 36 return \Closure::bind(function () use ($loader) { 35 $loader->prefixLengthsPsr4 = ComposerStaticInit 2e664fd2fb00ee27f1f41078a1c13365::$prefixLengthsPsr4;36 $loader->prefixDirsPsr4 = ComposerStaticInit 2e664fd2fb00ee27f1f41078a1c13365::$prefixDirsPsr4;37 $loader->classMap = ComposerStaticInit 2e664fd2fb00ee27f1f41078a1c13365::$classMap;37 $loader->prefixLengthsPsr4 = ComposerStaticInit6e093c60687139b2de60a46a1974731c::$prefixLengthsPsr4; 38 $loader->prefixDirsPsr4 = ComposerStaticInit6e093c60687139b2de60a46a1974731c::$prefixDirsPsr4; 39 $loader->classMap = ComposerStaticInit6e093c60687139b2de60a46a1974731c::$classMap; 38 40 39 41 }, null, ClassLoader::class); -
artificial-image-generator/tags/1.1.0/vendor/composer/installed.php
r3425585 r3473025 2 2 'root' => array( 3 3 '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', 7 7 'type' => 'wordpress-plugin', 8 8 'install_path' => __DIR__ . '/../../', … … 12 12 'versions' => array( 13 13 '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', 17 17 'type' => 'wordpress-plugin', 18 18 'install_path' => __DIR__ . '/../../', -
artificial-image-generator/trunk/artificial-image-generator.php
r3425585 r3473025 4 4 * Plugin URI: https://beautifulplugins.com/image-generator/ 5 5 * Description: Generate AI-powered images automatically across your WordPress site. Create stunning visuals for posts, pages, and more with ease. 6 * Version: 1. 0.06 * Version: 1.1.0 7 7 * Requires at least: 5.0 8 8 * Requires PHP: 7.4 9 * Tested up to: 6.9 9 10 * Author: BeautifulPlugins 10 11 * Author URI: https://beautifulplugins.com 11 * License: GPL v2 or later12 * License: GPL v2 or later 12 13 * License URI: https://www.gnu.org/licenses/gpl-2.0.html 13 14 * Text Domain: artificial-image-generator 14 15 * Domain Path: /languages 15 * Tested up to: 6.916 16 * 17 17 * @package ArtificialImageGenerator … … 30 30 use ArtificialImageGenerator\Plugin; 31 31 32 defined( 'ABSPATH' ) || exit; // Prevent direct access.32 defined( 'ABSPATH' ) || exit; // Exit if accessed directly. 33 33 34 /** 35 * Optimized autoload classes. 36 * 37 * @since 1.0.0 38 */ 34 // Autoload optimized classes. 39 35 require_once __DIR__ . '/vendor/autoload.php'; 40 36 … … 43 39 * 44 40 * @since 1.0.0 45 * @return Plugin 41 * @return Plugin The plugin instance. 46 42 */ 47 43 function artificial_image_generator() { 48 return Plugin::create( __FILE__, '1. 0.0' );44 return Plugin::create( __FILE__, '1.1.0' ); 49 45 } 50 46 -
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()}));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.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 7 7 "prefer-stable": true, 8 8 "minimum-stability": "dev", 9 "repositories": [],10 "require-dev": {},11 9 "require": { 12 10 "php": ">=7.4" … … 25 23 } 26 24 }, 27 "autoload-dev": {},28 25 "scripts": { 29 26 "post-install-cmd": [ … … 33 30 "composer dump-autoload" 34 31 ] 35 }, 36 "extra": {} 32 } 37 33 } -
artificial-image-generator/trunk/includes/Admin/Actions.php
r3424875 r3473025 19 19 */ 20 20 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' ) ); 24 22 } 25 23 26 24 /** 27 * Save auto image generator settings.25 * Add product tabs data. 28 26 * 29 27 * @since 1.0.0 28 * @return void 30 29 */ 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' ); 33 32 $referer = wp_get_referer(); 34 33 35 34 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' ); 37 36 wp_safe_redirect( $referer ); 38 exit ();37 exit; 39 38 } 40 39 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. 41 73 $bg_colors = isset( $_POST['bg_colors'] ) ? sanitize_text_field( wp_unslash( $_POST['bg_colors'] ) ) : ''; 42 74 $width = isset( $_POST['width'] ) ? absint( $_POST['width'] ) : 1200; … … 44 76 $title_font_size = isset( $_POST['title_font_size'] ) ? absint( $_POST['title_font_size'] ) : 40; 45 77 $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'] ) ) : ''; 46 79 $overlay_position = isset( $_POST['overlay_position'] ) ? sanitize_text_field( wp_unslash( $_POST['overlay_position'] ) ) : 'center-center'; 47 80 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 ); 54 88 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 ); 59 94 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 ); 78 97 } 79 98 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' ) ); 103 104 } 104 105 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 ); 107 110 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; 138 113 } 139 114 } -
artificial-image-generator/trunk/includes/Admin/Admin.php
r3424875 r3473025 2 2 3 3 namespace ArtificialImageGenerator\Admin; 4 5 use ArtificialImageGenerator\Admin\ListTables\TemplatesTable; 4 6 5 7 defined( 'ABSPATH' ) || exit; // Exit if accessed directly. … … 12 14 */ 13 15 class Admin { 16 14 17 /** 15 18 * Constructor. 16 19 */ 17 20 public function __construct() { 18 // Add menu page.19 21 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' ) ); 23 25 } 24 26 … … 34 36 __( 'Image Generator', 'artificial-image-generator' ), 35 37 'manage_options', 36 ' artificial-image-generator',37 array( $this, 'admin_page' ),38 'image-generator', 39 null, 38 40 'dashicons-format-image', 39 41 26 40 42 ); 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 } 51 192 } 52 193 … … 59 200 * @return void 60 201 */ 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 ) { 63 205 return; 64 206 } -
artificial-image-generator/trunk/includes/Admin/Settings.php
r3425585 r3473025 32 32 public function add_settings_page() { 33 33 add_submenu_page( 34 ' artificial-image-generator',34 'image-generator', 35 35 __( 'Settings', 'artificial-image-generator' ), 36 36 __( 'Settings', 'artificial-image-generator' ), 37 37 'manage_options', 38 'a rtificial-image-generator-settings',38 'aimg-settings', 39 39 array( $this, 'settings_page' ) 40 40 ); … … 62 62 <form method="post" action="<?php echo esc_url( admin_url( 'options.php' ) ); ?>"> 63 63 <?php 64 settings_fields( 'a rtificial_image_generator' );65 do_settings_sections( 'a rtificial-image-generator' );64 settings_fields( 'aimg' ); 65 do_settings_sections( 'aimg-settings' ); 66 66 submit_button(); 67 67 ?> … … 78 78 */ 79 79 public function register_settings() { 80 register_setting( 'a rtificial_image_generator', 'aimg_settings', array( $this, 'sanitize_settings' ) );80 register_setting( 'aimg', 'aimg_settings', array( $this, 'sanitize_settings' ) ); 81 81 82 82 // Add settings section. … … 85 85 __( 'General Settings', 'artificial-image-generator' ), 86 86 array( $this, 'general_settings' ), 87 'a rtificial-image-generator'87 'aimg-settings' 88 88 ); 89 89 … … 93 93 __( 'Default Background Color', 'artificial-image-generator' ), 94 94 array( $this, 'default_bg_color' ), 95 'a rtificial-image-generator',95 'aimg-settings', 96 96 'aimg_general_settings' 97 97 ); … … 102 102 __( 'Default Text Color', 'artificial-image-generator' ), 103 103 array( $this, 'default_text_color' ), 104 'a rtificial-image-generator',104 'aimg-settings', 105 105 'aimg_general_settings' 106 106 ); … … 111 111 __( 'Enable Post Thumbnails', 'artificial-image-generator' ), 112 112 array( $this, 'is_post_thumbnail' ), 113 'a rtificial-image-generator',113 'aimg-settings', 114 114 'aimg_general_settings' 115 115 ); … … 120 120 __( 'Enable Page Thumbnails', 'artificial-image-generator' ), 121 121 array( $this, 'is_page_thumbnail' ), 122 'a rtificial-image-generator',122 'aimg-settings', 123 123 'aimg_general_settings' 124 124 ); -
artificial-image-generator/trunk/includes/GenerateImages.php
r3424875 r3473025 73 73 } 74 74 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 ); 77 92 78 93 // Make sure colors are split into an array if they are a string. … … 83 98 // Get absolute paths of overlay images. 84 99 $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 } 89 108 } 90 }91 109 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 } 95 114 } 96 115 97 116 $image_path = aimg_generate_thumbnail( 98 117 array( 118 'post_id' => $template_id, 99 119 'title' => $title, 100 120 '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 ), 103 123 'overlays' => $overlays, 104 'post_id' => $post_id,105 124 ) 106 125 ); -
artificial-image-generator/trunk/includes/Plugin.php
r3424875 r3473025 205 205 public function init() { 206 206 // Load common classes. 207 new PostTypes(); 207 208 new GenerateImages(); 208 209 -
artificial-image-generator/trunk/includes/functions.php
r3424875 r3473025 2 2 3 3 defined( '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 */ 13 function 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 */ 35 function 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 } 4 52 5 53 /** … … 10 58 * 11 59 * @since 1.0.0 12 * @retu n mixed|null60 * @return mixed|null 13 61 */ 14 62 function aimg_get_settings( $option, $default_value = null ) { … … 21 69 * Generate a thumbnail image for preview on settings page. 22 70 * 23 * @param string $title The title text.71 * @param int $post_id Post ID for which the preview is being generated. 24 72 * @param string $colors Comma separated hex colors. 25 73 * @param int $width Image width. … … 29 77 * @return string|false Image URL or false on failure. 30 78 */ 31 function aimg_generate_preview( $title, $colors, $width, $height, $overlays = array() ) { 79 function 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 } 32 83 33 84 if ( is_string( $colors ) ) { … … 52 103 $filepath = aimg_generate_thumbnail( 53 104 array( 54 'title' => $title, 105 'post_id' => $post_id, 106 'title' => get_the_title( $post_id ), 55 107 'colors' => $colors, 56 108 'width' => $width, 57 109 'height' => $height, 58 110 'overlays' => $overlays_path, 59 'preview' => true,60 111 ) 61 112 ); … … 67 118 // Get URL from filepath. 68 119 $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'] ) ); 71 122 72 123 if ( strpos( $filepath, $basedir ) === 0 ) { … … 88 139 function aimg_generate_thumbnail( $args = array() ) { 89 140 $default_args = array( 141 'post_id' => 0, 90 142 'title' => '', 91 143 'colors' => array(), … … 93 145 'height' => 600, 94 146 'overlays' => array(), 95 'post_id' => 0,96 'preview' => false,97 147 ); 98 148 … … 100 150 101 151 // Extract arguments for easier access. 152 $post_id = isset( $args['post_id'] ) ? absint( $args['post_id'] ) : 0; 102 153 $title = isset( $args['title'] ) ? $args['title'] : ''; 103 154 $colors = isset( $args['colors'] ) && is_array( $args['colors'] ) ? $args['colors'] : array(); … … 105 156 $height = isset( $args['height'] ) ? absint( $args['height'] ) : 600; 106 157 $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 ); 110 164 $font_path = AIMG_ASSETS_PATH . 'fonts/Roboto-Bold.ttf'; 111 165 … … 141 195 } 142 196 143 $overlay_position = get_ option( 'aimg_overlay_position', 'center-center');197 $overlay_position = get_post_meta( $post_id, '_aimg_overlay_position', true ); 144 198 $overlay = imagecreatefrompng( $overlay_path ); 145 199 … … 283 337 284 338 // 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'; 291 341 292 342 // Save image to uploads directory. -
artificial-image-generator/trunk/languages/artificial-image-generator.pot
r3425585 r3473025 1 # Copyright (C) 202 5BeautifulPlugins2 # This file is distributed under the GPL v2 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. 3 msgid "" 4 msgstr "" 5 "Project-Id-Version: Image Generator 1.1.0\n" 6 6 "Report-Msgid-Bugs-To: https://beautifulplugins.com/support/\n" 7 "POT-Creation-Date: 202 5-12-21 18:10:55+00:00\n"7 "POT-Creation-Date: 2026-03-02 19:03:46+00:00\n" 8 8 "MIME-Version: 1.0\n" 9 9 "Content-Type: text/plain; charset=utf-8\n" 10 10 "Content-Transfer-Encoding: 8bit\n" 11 "PO-Revision-Date: 202 5-MO-DA HO:MI+ZONE\n"11 "PO-Revision-Date: 2026-MO-DA HO:MI+ZONE\n" 12 12 "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" 13 13 "Language-Team: LANGUAGE <LL@li.org>\n" … … 25 25 "X-Generator: grunt-wp-i18n 1.0.3\n" 26 26 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 28 29 msgid "40" 29 30 msgstr "" 30 31 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 32 34 msgid "800" 33 35 msgstr "" 34 36 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 36 39 msgid "1200" 37 40 msgstr "" 38 41 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 43 msgid "You do not have permission to process this action" 44 msgstr "" 45 46 #: includes/Admin/Actions.php:45 47 msgid "The title field is required." 46 48 msgstr "" 47 49 48 50 #: 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." 51 msgid "Image template updated successfully." 52 msgstr "" 53 54 #: includes/Admin/Actions.php:103 55 msgid "Image template added successfully." 66 56 msgstr "" 67 57 68 58 #. Plugin Name of the plugin/theme 69 59 msgid "Image Generator" 60 msgstr "" 61 62 #: includes/Admin/Admin.php:46 includes/Admin/Admin.php:47 63 #: includes/Admin/views/img-templates.php:16 64 msgid "Image Templates" 65 msgstr "" 66 67 #: includes/Admin/Admin.php:94 68 msgid "Image templates per page" 69 msgstr "" 70 71 #: includes/Admin/Admin.php:157 72 msgid "You do not have permission to perform this action." 73 msgstr "" 74 75 #: includes/Admin/Admin.php:182 76 #. translators: %s: number of accounts. 77 msgid "%s item(s) deleted successfully." 78 msgstr "" 79 80 #: includes/Admin/ListTables/TemplatesTable.php:90 81 msgid "No templates found." 82 msgstr "" 83 84 #: includes/Admin/ListTables/TemplatesTable.php:103 85 msgid "Name" 86 msgstr "" 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 92 msgid "Preview Image" 93 msgstr "" 94 95 #: includes/Admin/ListTables/TemplatesTable.php:105 96 msgid "Date" 97 msgstr "" 98 99 #: includes/Admin/ListTables/TemplatesTable.php:163 100 #. translators: %d: key id. 101 msgid "ID: %d" 102 msgstr "" 103 104 #: includes/Admin/ListTables/TemplatesTable.php:164 105 msgid "Edit" 106 msgstr "" 107 108 #: includes/Admin/ListTables/TemplatesTable.php:165 109 #: includes/Admin/ListTables/TemplatesTable.php:178 110 msgid "Delete" 70 111 msgstr "" 71 112 … … 141 182 msgstr "" 142 183 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 185 msgid "Add New Image Template" 186 msgstr "" 187 188 #: includes/Admin/views/add-img-template.php:18 189 #: includes/Admin/views/edit-img-template.php:19 190 msgid "Configure the template options to generate images." 191 msgstr "" 192 193 #: includes/Admin/views/add-img-template.php:26 194 #: includes/Admin/views/edit-img-template.php:27 195 msgid "Title" 196 msgstr "" 197 198 #: includes/Admin/views/add-img-template.php:29 199 #: includes/Admin/views/edit-img-template.php:30 200 msgid "Awesome image template" 201 msgstr "" 202 203 #: includes/Admin/views/add-img-template.php:30 204 #: includes/Admin/views/edit-img-template.php:31 205 msgid "Enter the title for the image template." 206 msgstr "" 207 208 #: includes/Admin/views/add-img-template.php:35 209 #: includes/Admin/views/edit-img-template.php:36 148 210 msgid "Background Colors" 149 211 msgstr "" 150 212 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 152 215 msgid "e.g. #e74c3c, #2ecc71, #9b59b6" 153 216 msgstr "" 154 217 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 156 220 msgid "" 157 221 "Enter the background colors for the thumbnails. Use comma to separate " … … 159 223 msgstr "" 160 224 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 162 227 msgid "Width" 163 228 msgstr "" 164 229 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 166 232 msgid "Enter the width for the thumbnails in pixels." 167 233 msgstr "" 168 234 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 170 237 msgid "Height" 171 238 msgstr "" 172 239 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 174 242 msgid "Enter the height for the thumbnails in pixels." 175 243 msgstr "" 176 244 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 178 247 msgid "Title Font Size" 179 248 msgstr "" 180 249 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 182 252 msgid "Enter the font size for the title in pixels." 183 253 msgstr "" 184 254 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 186 257 msgid "Enable Overlay Images" 187 258 msgstr "" 188 259 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 190 262 msgid "Enable" 191 263 msgstr "" 192 264 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 194 267 msgid "Check this box to enable overlay images in the thumbnails." 195 268 msgstr "" 196 269 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 198 272 msgid "Overlay Images" 199 273 msgstr "" 200 274 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 214 277 msgid "Select Images" 215 278 msgstr "" 216 279 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 218 282 msgid "" 219 283 "Select one or more transparent PNG images to use as overlay images in the " … … 221 285 msgstr "" 222 286 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 224 289 msgid "Overlay Image Position" 225 290 msgstr "" 226 291 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 228 294 msgid "Top Left" 229 295 msgstr "" 230 296 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 232 299 msgid "Top Center" 233 300 msgstr "" 234 301 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 236 304 msgid "Top Right" 237 305 msgstr "" 238 306 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 240 309 msgid "Left Center" 241 310 msgstr "" 242 311 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 244 314 msgid "Center Center" 245 315 msgstr "" 246 316 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 248 319 msgid "Right Center" 249 320 msgstr "" 250 321 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 252 324 msgid "Bottom Left" 253 325 msgstr "" 254 326 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 256 329 msgid "Bottom Center" 257 330 msgstr "" 258 331 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 260 334 msgid "Bottom Right" 261 335 msgstr "" 262 336 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 264 339 msgid "" 265 340 "Select the position for the overlay images in the thumbnails. The overlay " … … 268 343 msgstr "" 269 344 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 347 msgid "Preview could not be generated. Save changes to generate a preview." 348 msgstr "" 349 350 #: includes/Admin/views/edit-img-template.php:16 includes/PostTypes.php:40 351 msgid "Edit Image Template" 352 msgstr "" 353 354 #: includes/Admin/views/edit-img-template.php:98 355 msgid "Overlay Image" 356 msgstr "" 357 358 #: includes/Admin/views/edit-img-template.php:99 359 msgid "X" 360 msgstr "" 361 362 #: includes/Admin/views/edit-img-template.php:104 363 msgid "No overlay images selected." 364 msgstr "" 365 366 #: includes/Admin/views/edit-img-template.php:146 367 msgid "" 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." 370 msgstr "" 371 372 #: includes/Admin/views/img-templates.php:18 373 msgid "Add New" 374 msgstr "" 375 376 #: includes/Admin/views/img-templates.php:25 377 msgid "Search" 378 msgstr "" 379 380 #: includes/PostTypes.php:38 381 msgid "Add New Images Template" 382 msgstr "" 383 384 #: includes/PostTypes.php:39 385 msgid "New Images Template" 386 msgstr "" 387 388 #: includes/PostTypes.php:41 389 msgid "View Image Template" 390 msgstr "" 391 392 #: includes/PostTypes.php:42 393 msgid "All Image Templates" 394 msgstr "" 395 396 #: includes/PostTypes.php:43 397 msgid "Search Image Templates" 398 msgstr "" 399 400 #: includes/PostTypes.php:44 401 msgid "Parent Image Templates:" 402 msgstr "" 403 404 #: includes/PostTypes.php:45 405 msgid "No image templates found." 406 msgstr "" 407 408 #: includes/PostTypes.php:46 409 msgid "No image templates found in Trash." 286 410 msgstr "" 287 411 … … 303 427 msgid "https://beautifulplugins.com" 304 428 msgstr "" 429 430 #: includes/PostTypes.php:33 431 msgctxt "post type general name" 432 msgid "Image Templates" 433 msgstr "" 434 435 #: includes/PostTypes.php:34 436 msgctxt "post type singular name" 437 msgid "Image Template" 438 msgstr "" 439 440 #: includes/PostTypes.php:35 441 msgctxt "admin menu" 442 msgid "Image Templates" 443 msgstr "" 444 445 #: includes/PostTypes.php:36 446 msgctxt "add new on admin bar" 447 msgid "Image Templates" 448 msgstr "" 449 450 #: includes/PostTypes.php:37 451 msgctxt "ticket" 452 msgid "Add New" 453 msgstr "" -
artificial-image-generator/trunk/readme.txt
r3425585 r3473025 3 3 Tags: ai, ai image, featured images, ai image generator, image generator 4 4 Tested up to: 6.9 5 Stable tag: 1. 0.05 Stable tag: 1.1.0 6 6 License: GPLv2 or later 7 7 License URI: https://www.gnu.org/licenses/gpl-2.0.html … … 135 135 136 136 == 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. 137 141 138 142 = 1.0.0 ( 22nd December 2025 ) = 139 143 * Initial release 144 145 == Upgrade Notice == 146 = 1.1.0 = 147 Major update with new features and improvements. Please backup your site before updating. 140 148 141 149 == Support and Feedback == -
artificial-image-generator/trunk/vendor/autoload.php
r3424875 r3473025 20 20 require_once __DIR__ . '/composer/autoload_real.php'; 21 21 22 return ComposerAutoloaderInit 2e664fd2fb00ee27f1f41078a1c13365::getLoader();22 return ComposerAutoloaderInit6e093c60687139b2de60a46a1974731c::getLoader(); -
artificial-image-generator/trunk/vendor/composer/autoload_classmap.php
r3424875 r3473025 9 9 'ArtificialImageGenerator\\Admin\\Actions' => $baseDir . '/includes/Admin/Actions.php', 10 10 'ArtificialImageGenerator\\Admin\\Admin' => $baseDir . '/includes/Admin/Admin.php', 11 'ArtificialImageGenerator\\Admin\\ListTables\\TemplatesTable' => $baseDir . '/includes/Admin/ListTables/TemplatesTable.php', 11 12 'ArtificialImageGenerator\\Admin\\Settings' => $baseDir . '/includes/Admin/Settings.php', 12 13 'ArtificialImageGenerator\\GenerateImages' => $baseDir . '/includes/GenerateImages.php', 13 14 'ArtificialImageGenerator\\Plugin' => $baseDir . '/includes/Plugin.php', 15 'ArtificialImageGenerator\\PostTypes' => $baseDir . '/includes/PostTypes.php', 14 16 'Composer\\InstalledVersions' => $vendorDir . '/composer/InstalledVersions.php', 15 17 ); -
artificial-image-generator/trunk/vendor/composer/autoload_real.php
r3424875 r3473025 3 3 // autoload_real.php @generated by Composer 4 4 5 class ComposerAutoloaderInit 2e664fd2fb00ee27f1f41078a1c133655 class ComposerAutoloaderInit6e093c60687139b2de60a46a1974731c 6 6 { 7 7 private static $loader; … … 25 25 require __DIR__ . '/platform_check.php'; 26 26 27 spl_autoload_register(array('ComposerAutoloaderInit 2e664fd2fb00ee27f1f41078a1c13365', 'loadClassLoader'), true, true);27 spl_autoload_register(array('ComposerAutoloaderInit6e093c60687139b2de60a46a1974731c', 'loadClassLoader'), true, true); 28 28 self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname(__DIR__)); 29 spl_autoload_unregister(array('ComposerAutoloaderInit 2e664fd2fb00ee27f1f41078a1c13365', 'loadClassLoader'));29 spl_autoload_unregister(array('ComposerAutoloaderInit6e093c60687139b2de60a46a1974731c', 'loadClassLoader')); 30 30 31 31 require __DIR__ . '/autoload_static.php'; 32 call_user_func(\Composer\Autoload\ComposerStaticInit 2e664fd2fb00ee27f1f41078a1c13365::getInitializer($loader));32 call_user_func(\Composer\Autoload\ComposerStaticInit6e093c60687139b2de60a46a1974731c::getInitializer($loader)); 33 33 34 34 $loader->register(true); -
artificial-image-generator/trunk/vendor/composer/autoload_static.php
r3424875 r3473025 5 5 namespace Composer\Autoload; 6 6 7 class ComposerStaticInit 2e664fd2fb00ee27f1f41078a1c133657 class ComposerStaticInit6e093c60687139b2de60a46a1974731c 8 8 { 9 9 public static $prefixLengthsPsr4 = array ( … … 24 24 'ArtificialImageGenerator\\Admin\\Actions' => __DIR__ . '/../..' . '/includes/Admin/Actions.php', 25 25 'ArtificialImageGenerator\\Admin\\Admin' => __DIR__ . '/../..' . '/includes/Admin/Admin.php', 26 'ArtificialImageGenerator\\Admin\\ListTables\\TemplatesTable' => __DIR__ . '/../..' . '/includes/Admin/ListTables/TemplatesTable.php', 26 27 'ArtificialImageGenerator\\Admin\\Settings' => __DIR__ . '/../..' . '/includes/Admin/Settings.php', 27 28 'ArtificialImageGenerator\\GenerateImages' => __DIR__ . '/../..' . '/includes/GenerateImages.php', 28 29 'ArtificialImageGenerator\\Plugin' => __DIR__ . '/../..' . '/includes/Plugin.php', 30 'ArtificialImageGenerator\\PostTypes' => __DIR__ . '/../..' . '/includes/PostTypes.php', 29 31 'Composer\\InstalledVersions' => __DIR__ . '/..' . '/composer/InstalledVersions.php', 30 32 ); … … 33 35 { 34 36 return \Closure::bind(function () use ($loader) { 35 $loader->prefixLengthsPsr4 = ComposerStaticInit 2e664fd2fb00ee27f1f41078a1c13365::$prefixLengthsPsr4;36 $loader->prefixDirsPsr4 = ComposerStaticInit 2e664fd2fb00ee27f1f41078a1c13365::$prefixDirsPsr4;37 $loader->classMap = ComposerStaticInit 2e664fd2fb00ee27f1f41078a1c13365::$classMap;37 $loader->prefixLengthsPsr4 = ComposerStaticInit6e093c60687139b2de60a46a1974731c::$prefixLengthsPsr4; 38 $loader->prefixDirsPsr4 = ComposerStaticInit6e093c60687139b2de60a46a1974731c::$prefixDirsPsr4; 39 $loader->classMap = ComposerStaticInit6e093c60687139b2de60a46a1974731c::$classMap; 38 40 39 41 }, null, ClassLoader::class); -
artificial-image-generator/trunk/vendor/composer/installed.php
r3425585 r3473025 2 2 'root' => array( 3 3 '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', 7 7 'type' => 'wordpress-plugin', 8 8 'install_path' => __DIR__ . '/../../', … … 12 12 'versions' => array( 13 13 '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', 17 17 'type' => 'wordpress-plugin', 18 18 'install_path' => __DIR__ . '/../../',
Note: See TracChangeset
for help on using the changeset viewer.