wp_upload_dir = wp_upload_dir(); $this->__media = $this->cls( 'Media' ); $this->__data = $this->cls( 'Data' ); $this->_table_img_optm = $this->__data->tb( 'img_optm' ); $this->_table_img_optming = $this->__data->tb( 'img_optming' ); $this->_summary = self::get_summary(); if ( empty( $this->_summary['next_post_id'] ) ) { $this->_summary['next_post_id'] = 0; } if ( $this->conf( Base::O_IMG_OPTM_WEBP ) ) { $this->_format = 'webp'; if ( $this->conf( Base::O_IMG_OPTM_WEBP ) === 2 ) { $this->_format = 'avif'; } } // Allow users to ignore custom sizes. $this->_sizes_skipped = apply_filters( 'litespeed_imgoptm_sizes_skipped', $this->conf( Base::O_IMG_OPTM_SIZES_SKIPPED ) ); } /** * Handle all request actions from main cls * * @since 2.0 * @access public */ public function handler() { $type = Router::verify_type(); switch ( $type ) { case self::TYPE_RESET_ROW: // phpcs:ignore WordPress.Security.NonceVerification.Recommended $id = ! empty( $_GET['id'] ) ? absint( wp_unslash( $_GET['id'] ) ) : false; $this->reset_row( $id ); break; case self::TYPE_CALC_BKUP: $this->_calc_bkup(); break; case self::TYPE_RM_BKUP: $this->rm_bkup(); break; case self::TYPE_NEW_REQ: $this->new_req(); break; case self::TYPE_RESCAN: $this->_rescan(); break; case self::TYPE_RESET_COUNTER: $this->_reset_counter(); break; case self::TYPE_DESTROY: $this->_destroy(); break; case self::TYPE_CLEAN: $this->clean(); break; case self::TYPE_PULL: self::start_async(); break; case self::TYPE_BATCH_SWITCH_ORI: case self::TYPE_BATCH_SWITCH_OPTM: $this->batch_switch( $type ); break; case substr( $type, 0, 4 ) === 'avif': case substr( $type, 0, 4 ) === 'webp': case substr( $type, 0, 4 ) === 'orig': $this->_switch_optm_file( $type ); break; default: break; } Admin::redirect(); } }