BossBey File Manager
PHP:
8.2.30
OS:
Linux
User:
imagivibe
Root
/
home
/
imagivibe
/
public_html
/
wp-content
/
plugins
/
robin-image-optimizer
/
includes
/
classes
/
processing
π€ Upload
π New File
π New Folder
Close
Editing: class-rio-nextgen-processing.php
<?php use WBCR\Factory_Processing_759\WP_Background_Process; // Exit if accessed directly if ( ! defined( 'ABSPATH' ) ) { exit; } /** * ΠΠ»Π°ΡΡ Π΄Π»Ρ ΡΠ°Π±ΠΎΡΡ ΠΎΠΏΡΠΈΠΌΠΈΠ·Π°ΡΠΈΠΈ Π² ΡΠΎΠ½Π΅ * * @version 1.0 */ class WRIO_Nextgen_Processing extends WRIO_Processing { /** * @return int Count of pushed queue */ public function push_items() { $attachment_ids = []; if ( $this->scope === 'nextgen' ) { $nextgen_gallery = WRIO_Nextgen_Gallery::get_instance(); $attachment_ids = $nextgen_gallery->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 === 'nextgen' ) { $nextgen_gallery = WRIO_Nextgen_Gallery::get_instance(); $result = $nextgen_gallery->optimizeNextgenImage( $image ); } WRIO_Plugin::app()->logger->info( sprintf( 'End optimize attachment: %s', $image ) ); } return false; } }
Save
Cancel