BossBey File Manager
PHP:
8.2.30
OS:
Linux
User:
imagivibe
Root
/
.
/
wp-content
/
plugins
/
robin-image-optimizer
/
includes
/
classes
/
processing
π€ Upload
π New File
π New Folder
Close
Editing: class-rio-media-processing.php
<?php use WBCR\Factory_Processing_759\WP_Background_Process; // Exit if accessed directly if ( ! defined( 'ABSPATH' ) ) { exit; } /** * ΠΠ»Π°ΡΡ Π΄Π»Ρ ΡΠ°Π±ΠΎΡΡ ΠΎΠΏΡΠΈΠΌΠΈΠ·Π°ΡΠΈΠΈ Π² ΡΠΎΠ½Π΅ * * @version 1.0 */ class WRIO_Media_Processing extends WRIO_Processing { /** * @param array $attachment_ids * * @return int Count of pushed queue */ public function push_items( $attachment_ids = [] ) { if ( empty( $attachment_ids ) && $this->scope === 'media-library' ) { $media_library = WRIO_Media_Library::get_instance(); $attachment_ids = $media_library->getUnoptimizedImages(); } foreach ( $attachment_ids as $attachment_id ) { $this->push_to_queue( $attachment_id ); } return $this->count_queue(); } /** * ΠΠ΅ΡΠΎΠ΄ ΠΎΠΏΡΠΈΠΌΠΈΠ·ΠΈΡΡΠ΅Ρ ΠΈΠ·ΠΎΠ±ΡΠ°ΠΆΠ΅Π½ΠΈΡ ΠΏΡΠΈ Π²ΡΠΏΠΎΠ»Π½Π΅Π½ΠΈΠΈ Π·Π°Π΄Π°ΡΠΈ * * @param int $image * * @return bool */ protected function task( $image ) { if ( $image ) { WRIO_Plugin::app()->logger->info( sprintf( 'Start optimize attachment: %s', $image ) ); if ( $this->scope === 'media-library' ) { $media_library = WRIO_Media_Library::get_instance(); $result = $media_library->optimizeAttachment( $image ); } WRIO_Plugin::app()->logger->info( sprintf( 'End optimize attachment: %s', $image ) ); } return false; } }
Save
Cancel