keycdn / optimus Goto Github PK
View Code? Open in Web Editor NEWWordPress Optimus Plugin
Home Page: https://wordpress.org/plugins/optimus/
WordPress Optimus Plugin
Home Page: https://wordpress.org/plugins/optimus/
Problem
Cause
wp post delete --force 1234
) then WordPress Core deletes its files from the uploads folder, but the webp files generated by Optimus remain in the filesystem.Goal
Proposed solution
Notes
wp optimus webp delete-orphans
similar to #7 that allows to clean up an existing filesystem (i.e., considering all the sites that have obsolete webp image files currently).Hello!
To optimize large installation the admin page can be really problematic for optimizing all the images.
Can you create a WPCLI command for optimizing one/all attachments ?
Like using the wp media regenerate
command, we can have a wp media optimize
or a wp optimus optimize
:)
Hello,
On some cases it can be usefull to call the optimus API for optimizing files from the filesystem.
For example here i'm using the "wpthumb" plugin for generating all the images sizes on the fly.
But this is not generating files for the webP only the png/jpg ones, but with only this lines of code :
<?php
add_action( 'wpthumb_saved_cache_image', function( WP_Thumb $wpthumb ) {
$file_path = $wpthumb->getCacheFilePath();
Optimus_Request::_do_image_action($file_path, array(
'file' => $wpthumb->getCacheFileURL(),
'webp' => true
));
} );
I'm able to generate a webP version on the fly for our ressource, and with the right .htaccess rules the file is switched from png/jpg to the webP version :).
Is it possible to offer an API for optimizing any image file from the filesystem like the _do_image_action method can, because right now this is on private so unusable and duplicating all this code is not possible for us.
Rahe
Where can I find the wpcli command for bulk optimization?
This sql, fetches ALL images.
On sites with 100.000 images, this will properbly die.
optimus/inc/optimus_management.class.php
Lines 101 to 112 in 3b830e4
We try to run some re-creating of .webp Images, but we suspect this one to be the root cause of why its not possible.
We do it via WP CLi, and the above sql, doesnt use LIMIT params, in order to listen on how many it should fetch.
Hello,
On this line https://github.com/keycdn/wp-optimus/blob/2658deeee9e6446e87a982ceedb313649dc6ff25/inc/optimus_hq.class.php#L191
the plugin is using wp_die on case of error from the API.
If the plugin is activated and an error occurs, the whole website is innacessible.
Nicolas,
Hello,
there is a list of Optimus commands for WP-CLI?
if there isen't a list of commands, can you tell me if there is the possibility of activating the license via WP-CLI?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.