Changeset 3284888
- Timestamp:
- 04/30/2025 12:59:36 PM (11 months ago)
- Location:
- emplibot/trunk
- Files:
-
- 3 edited
-
emplibot.php (modified) (1 diff)
-
includes/rest-api.php (modified) (3 diffs)
-
readme.txt (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
emplibot/trunk/emplibot.php
r3284088 r3284888 3 3 * Plugin Name: Emplibot 4 4 * Description: Automated keyword research, automated blogging, with internal and external links, engaging infographics, unique featured images, and more. 5 * Version: 1.0. 85 * Version: 1.0.9 6 6 * Requires at least: 6.4 7 7 * Requires PHP: 7.2 -
emplibot/trunk/includes/rest-api.php
r3284088 r3284888 288 288 // Generate metadata for the attachment and update the database 289 289 require_once( ABSPATH . 'wp-admin/includes/image.php' ); 290 291 // Set preference for GD over Imagick 292 add_filter('wp_image_editors', 'emplibot_prefer_gd_image_editor'); 290 293 $attachment_data = wp_generate_attachment_metadata( $attachment_id, $image_path ); 294 // Remove the filter after processing to avoid affecting other operations 295 remove_filter('wp_image_editors', 'emplibot_prefer_gd_image_editor'); 296 291 297 wp_update_attachment_metadata( $attachment_id, $attachment_data ); 292 298 … … 893 899 // Generate metadata for the attachment 894 900 require_once(ABSPATH . 'wp-admin/includes/image.php'); 901 902 // Set preference for GD over Imagick 903 add_filter('wp_image_editors', 'emplibot_prefer_gd_image_editor'); 895 904 $attachment_data = wp_generate_attachment_metadata($attachment_id, $image_dest_path); 905 // Remove the filter after processing to avoid affecting other operations 906 remove_filter('wp_image_editors', 'emplibot_prefer_gd_image_editor'); 907 896 908 wp_update_attachment_metadata($attachment_id, $attachment_data); 897 909 … … 938 950 939 951 /** 952 * Sets the preference for image editors to use GD first, then Imagick as fallback. 953 * 954 * @param array $editors Array of image editor class names. 955 * @return array Modified array of image editor class names. 956 */ 957 function emplibot_prefer_gd_image_editor($editors) { 958 // Define the preferred order: GD first, then Imagick 959 $preferred_editors = array( 960 'WP_Image_Editor_GD', 961 'WP_Image_Editor_Imagick' 962 ); 963 964 // Return our preferred order 965 return $preferred_editors; 966 } 967 968 /** 940 969 * Recursively removes a directory and its contents. 941 970 * -
emplibot/trunk/readme.txt
r3284088 r3284888 4 4 Requires at least: 6.4 5 5 Tested up to: 6.8 6 Stable tag: 1.0. 86 Stable tag: 1.0.9 7 7 Requires PHP: 7.1 8 8 License: GPLv3 or later … … 59 59 = 1.0.8 = 60 60 * Enhanced blogpost processing. 61 62 = 1.0.9 = 63 * Prefer GD Image processing.
Note: See TracChangeset
for help on using the changeset viewer.