Popis
Zrýchlite svoje webové stránky pomocou nášho jednoduchého optimalizátora obrázkov tým, že budete používať obrázky WebP a AVIF. Nahradením súborov v štandardných formátoch JPEG, PNG a GIF formátmi WebP a AVIF môžete ušetriť viac ako polovicu hmotnosti stránky bez straty kvality.
Po inštalácii pluginu nemusíte robiť nič ďalšie. Vaše aktuálne obrázky budú prevedené do nového formátu. Po dokončení optimalizácie obrázkov naším optimalizátorom obrázkov používatelia automaticky dostanú nové, oveľa ľahšie obrázky, ako boli pôvodné.
V súčasnosti viac ako 90 % používateľov používa prehliadače, ktoré podporujú formát WebP. Čas načítania webovej stránky do veľkej miery závisí od jej hmotnosti a úrovne optimalizácie obrázkov. Pomocou nášho WebP konvertora ho teraz môžete zrýchliť za pár sekúnd bez väčšej námahy!
To bude prínosom pre vašich používateľov, ktorí nebudú musieť sťahovať toľko dát, ale aj pre server, ktorý bude menej zaťažený. Nezabúdajte, že lepšie optimalizovaná webová stránka ovplyvňuje aj vaše umiestnenie v Google. Optimalizácia obrázkov je veľmi dôležitá.
Podpora formátu AVIF
Teraz vo verzii PRO môžete použiť formát AVIF ako výstupný formát pre svoje obrázky. Formát AVIF je nové rozšírenie – je nástupcom formátu WebP. AVIF umožňuje dosiahnuť ešte vyššiu úroveň kompresie obrázku, a kvalita konvertovaných obrázkov po optimalizácii je lepšia ako vo WebP.
Ako to funguje?
- Ak ste práve nainštalovali plugin, môžete obrázky optimalizovať jedným kliknutím. Veľkosť obrázku bude po vygenerovaní webp menšia!
- Nové obrázky, ktoré budú pridané do knižnice médií, budú konvertované automaticky.
- Náš optimalizátor obrázkov nijako neupravuje vaše pôvodné obrázky. To znamená bezpečnosť pre vás a vaše súbory.
- Keď prehliadač načíta obrázok, náš plugin skontroluje, či podporuje formát WebP. Ak áno, načíta sa obrázok vo formáte WebP.
- Plugin v predvolenom režime nevykonáva presmerovania, takže adresa URL je vždy rovnaká. Zmení sa len typ MIME obrázka na
image/webp
. - Žiadne presmerovania neznamenajú problémy s vyrovnávacou pamäťou, rýchlejšiu a bezproblémovú prevádzku vašich webových stránok. Ak sa chcete dozvedieť viac o tom, ako to funguje, pozrite si FAQ k pluginu nižšie.
- Nezáleží na tom, či sa obrázok zobrazuje ako
img
HTML tag alebo použijetebackground-image
. Funguje to vždy! - V prípade, že je prepisovanie pomocou pravidiel zo súboru .htaccess zablokované, je k dispozícii režim, ktorý načíta obrázky prostredníctvom súboru PHP. Vtedy sa zmenia adresy URL obrázkov, ale logika činnosti je rovnaká ako v prípade predvoleného režimu.
- Konečným výsledkom po optimalizácii obrázkov je, že vaši používatelia stiahnu menej ako polovicu dát a samotná webová stránka sa načíta rýchlejšie!
- O nič neprídete – ak by ste museli odstrániť plugin, odstráni všetko po sebe. Nezanecháva žiadne stopy, takže ho môžete bez problémov skontrolovať.
Konvertovať do WebP – je to budúcnosť optimalizácie obrázkov!
Optimalizujte obrázky a pozdvihnite svoje webové stránky na novú úroveň! Nainštalujte si tento plugin a vychutnajte si webové stránky, ktoré sa vďaka optimalizácii obrázkov načítajú rýchlejšie. Určite to oceníte vy aj vaši používatelia.
Podpora ďalších adresárov
Obrázky WebP môžete konvertovať a optimalizovať nielen z /uploads
adresára, ale aj z /plugins
a /themes
adresárov. To umožňuje úplnú integráciu s formátom WebP!
Podpora pri vývoji pluginu
Na vývoji tohto pluginu sme strávili hodiny práce. Technická podpora si tiež vyžaduje veľa času, ale robíme to preto, lebo vám chceme ponúknuť ten najlepší plugin. Tešíme sa z každej novej inštalácie pluginu.
Ak by ste to chceli oceniť, môžete vyskúšať PRO verziu. Okrem toho získate prístup k ďalším funkciám, ktoré vám umožnia dosiahnuť ešte lepšie výsledky optimalizácie obrázkov.
Prečítajte si tiež nižšie uvedené často kladené otázky. Ďakujeme, že ste s nami!
Obrázky
Inštalácia
- Upload the plugin files to the
/wp-content/plugins/webp-converter-for-media
directory, or install the plugin through the WordPress plugins screen directly. - Activate the plugin through the
Plugins
screen in WordPress Admin Panel. - Use the
Settings -> Settings -> Converter for Media
screen to configure the plugin. - Click on the
Start Bulk Optimization
button and wait. - Check if everything works fine using this tutorial.
That’s all! Your website is already loading faster!
Časté otázky
-
How can I report security bugs?
-
You can report security bugs through the Patchstack Vulnerability Disclosure Program. The Patchstack team help validate, triage and handle any security vulnerabilities.
-
How to get technical support? (before you ask for help)
-
Before you add a new thread, read all other questions in this FAQ and other threads in the support forum first. Perhaps someone had a similar problem and it has been resolved.
When adding a thread, follow these steps and reply to each of them:
1. Do you have any errors on the plugin settings page? Please read this thread if you have any errors.
2. URL of your website.
3. Screenshot of the Help Center tab on the plugin settings screen – please take a screenshot of the ENTIRE page.
4. Please do the test, which is described in the FAQ in the question „How to check if the plugin works?“. Please send a screenshot of Devtools with the test results.
Please remember to include the answers to all questions by adding a thread. It is much easier and accelerates the solution of your problem.
-
Configuration for Nginx
-
If you are using a Nginx server that does not support .htaccess rules, additional Nginx server configuration is required for the plugin to work properly.
Pre viac informácií si prečítajte tento návod.
-
Konfigurácia pre proxy server Nginx
-
Ak používate server Nginx, ktorý podporuje pravidlá .htaccess, ale na stránke s nastaveniami pluginu sa stále zobrazuje chyba konfigurácie servera, na správne fungovanie pluginu je potrebná dodatočná konfigurácia servera Nginx.
Pre viac informácií si prečítajte tento návod.
-
Error on plugin settings screen?
-
If you have an error on the plugin settings screen, first of all, please read it carefully. They are displayed when there is a problem with the configuration of your server or website.
The messages are designed to reduce the number of support requests that are repeated. It saves your and our time. Please read this thread for more information.
-
Error while converting?
-
You can get several types of errors when converting. First of all, carefully read their content. For the most part, you can solve this problem yourself. Try to do this or contact the server administrator.
If you get an error:
File "%s" does not exist. Please check file path.
means that the file_exists() function in PHP returnedfalse
using the file path given in the error message. Check this path and make sure it is correct.If you get an error:
File "%s" is unreadable. Please check file permissions.
means that the is_readable() function in PHP returnedfalse
using the file path given in the error message. Check the permissions for the file and the directory in which the file is located.If you get an error:
"%s" is not a valid image file.
means that the file is damaged in some way. Download the file to disk, save it again using any graphics program and add it again to the page. If the error applies to individual images then you can ignore it – just the original images will load, not WebP.If you get an error:
Image "%s" converted to .webp is larger than original and converted .webp file has been deleted.
means the original image weighed less than WebP. This happens when images have been compressed before. Disable the „Automatic removal of files in output formats larger than original“ option in plugin settings to force always using WebP. -
What are requirements of plugin?
-
Practically every hosting meets these requirements. You must use PHP at least 7.0 and have the
GD
orImagick
extension installed. The extension must supportWebP format
. If you have an error saying that the GD or Imagick library is not installed, but you have it installed then they are probably incorrectly configured and do not have WebP support.They are required native PHP extensions, used among others by WordPress to generate thumbnails. Your server must also have the modules
mod_mime
,mod_rewrite
andmod_expires
enabled.An example of the correct server configuration can be found here. The link to your current configuration can be found in the Help Center tab on plugin settings screen.
Note the items marked in red. If the values marked in red do not appear in your case, it means that your server does not meet the technical requirements. Pay attention to the WebP Support value for the GD library and WEBP in the list of supported extensions for the Imagick library.
In a situation where your server does not meet the technical requirements, please contact your server Administrator. We are not able to help you. Please do not contact us about this matter, because this is a server configuration problem, not a plugin.
Also, REST API must be enabled and work without additional restrictions. If you have a problem with it, please contact the Developer who created your website. He should easily find the issue with the REST API not working.
-
How to check if the plugin works?
-
Viac informácií o fungovaní pluginu nájdete v našej príručke.
-
How to change the path to uploads?
-
This is possible using the following types of filters to change default paths. It is a solution for advanced users. If you are not, please skip this question.
Path to the root installation directory of WordPress (
ABSPATH
by default):add_filter( 'webpc_site_root', function( $path ) { return ABSPATH; } );
Cesty k adresárom (relatívne ku koreňovému adresáru):
add_filter( 'webpc_dir_name', function( $path, $directory ) { switch ( $directory ) { case 'uploads': return 'wp-content/uploads'; case 'webp': return 'wp-content/uploads-webpc'; case 'plugins': return 'wp-content/plugins'; case 'themes': return 'wp-content/themes'; } return $path; }, 10, 2 );
Note that the
/uploads-webpc
directory must be at the same nesting level as the/uploads
,/plugins
and/themes
directories.Prefix in URL of
/wp-content/
directory or equivalent (used in .htaccess):add_filter( 'webpc_htaccess_rewrite_path', function( $prefix ) { return '/'; } );
For the following sample custom WordPress structure:
... ├── web ... ├── app │ ├── mu-plugins │ ├── plugins │ ├── themes │ └── uploads ├── wp-config.php ...
Use the following filters:
add_filter( 'webpc_site_root', function( $path ) { return 'C:/WAMP/www/project/web'; // your valid path to root } ); add_filter( 'webpc_htaccess_rewrite_path', function( $prefix ) { return '/'; } ); add_filter( 'webpc_dir_name', function( $path, $directory ) { switch ( $directory ) { case 'uploads': return 'app/uploads'; case 'webp': return 'app/uploads-webpc'; case 'plugins': return 'app/plugins'; case 'themes': return 'app/themes'; } return $path; }, 10, 2 );
After setting the filters go to
Settings -> Converter for Media
in the admin panel and click theSave Changes
button..htaccess
files with appropriate rules should be created in the directories/uploads
and/uploads-webpc
. -
How to exclude paths from converting?
-
To exclude selected directories, provide them in the
Excluded directories
field in the Advanced Settings tab in the plugin settings.In this field, you can enter a directory name or path. Here are examples:
–2023
–2024/01
–2023,2024/01
To exclude selected files, use the following filter (in this case with the suffix „-skipped“ in a filename, e.g. image-skipped.png):
add_filter( 'webpc_supported_source_file', function( bool $status, string $file_name, string $server_path ): bool { $excluded_suffix = '-skipped'; if ( strpos( $file_name, $excluded_suffix . '.' ) !== false ) { return false; } return $status; }, 10, 3 );
Argument
$server_path
is the absolute server path to a directory or file. Inside the filters, you can apply more complicated rules as needed.Changes to excluded directories and files take effect before images are converted – they do not affect already converted images. These images must be manually removed from the directory:
/wp-content/uploads-webpc/
. -
Support for custom directories
-
Plugin štandardne podporuje nasledujúce adresáre:
–/gallery
–/plugins
–/themes
–/uploads
Ak chcete pridať podporu pre vlastný adresár, pridajte nasledujúci kód do súboru functions.php v adresári témy (namiesto
custom-directory
použite správny názov adresára):add_filter( 'webpc_source_directories', function ( $directories ) { $directories[] = 'custom-directory'; return $directories; } );
Nezabudnite, že tento adresár musí byť umiestnený v adresári
/wp-content
. -
How to run manually conversion?
-
By default, all images are converted when you click on the
Start Bulk Optimization
button. In addition, conversion is automatic when you add new files to your Media Library.Remember that our plugin takes into account images generated by WordPress. There are many plugins that generate, for example, images of a different size or in a different version.
If you would like to integrate with your plugin, which generates images by yourself, you can do it. Our plugin provides the possibility of this type of integration. This works for all images in the
/wp-content
directory.It is a solution for advanced users. If you would like to integrate with another plugin, it’s best to contact the author of that plugin and give him information about the actions available in our plugin. This will help you find a solution faster.
You can manually run converting selected files, you can use the action to which you will pass an array with a list of paths (they must be absolute server paths):
do_action( 'webpc_convert_paths', $paths, true );
An alternative method is to manually start converting the selected attachment by passing the post ID from the Media Library. Remember to run this action after registering all image sizes (i.e. after running the
add_image_size
function):do_action( 'webpc_convert_attachment', $post_id, true );
To delete manually converted files, use the following action, providing as an argument an array of absolute server paths to the files (this will delete manually converted files):
do_action( 'webpc_delete_paths', $paths );
-
Support for WP-CLI
-
The plugin supports WP-CLI, which enables faster image conversion from the server level. More information on how to get started with WP-CLI can be found in the Handbook. The supported commands are described below.
Checking how many maximum images for conversion are on website:
wp converter-for-media calculate
Converting all images:
wp converter-for-media regenerate
Converting all images (with „Force convert all images again“ option):
wp converter-for-media regenerate --force
-
Does plugin support CDN?
-
The website files (WordPress files) and the images from the Media Library must be on the same server. If they are, everything should work fine.
If only your images are on another CDN server, unfortunately correct operation is impossible, because such images are managed by another server.
Aktuálny zoznam podporovaných serverov CDN:
– (pred použitím si pozrite návod)
Recenzie
Prispievatelia a vývojári
“Converter for Media – Optimalizácia obrázkov | Konvertovanie WebP & AVIF” je softvér s otvoreným zdrojovým kódom. Do tohto pluginu prispeli nasledujúci ľudia.
Prispievatelia„Converter for Media – Optimalizácia obrázkov | Konvertovanie WebP & AVIF“ bol preložený do 20 jazykov. Ďakujeme prekladateľom za ich príspevky.
Preložiť „Converter for Media – Optimalizácia obrázkov | Konvertovanie WebP & AVIF“ do vašho jazyka.
Máte záujem o vývoj?
Prehľadávajte zdrojový kód, preskúmajte SVN repozitár, alebo sa prihláste na odber vývojárskeho logu cez RSS.
Zoznam zmien
6.1.2 (2024-10-26)
[Fixed]
Removing converted files after uninstalling plugin[Added]
Support for WordPress 6.7
6.1.1 (2024-10-02)
[Changed]
Bulk Optimization of Images section
6.1.0 (2024-09-13)
[Removed]
Filterwebpc_supported_source_directory
[Fixed]
Handling of excluded directories when uploading new images[Fixed]
Handling of excluded filenames when uploading new images[Fixed]
Adding support for custom directories using webpc_source_directories filter[Fixed]
Verification of rewrites_not_working server configuration error when HTTP referer is required
6.0.0 (2024-08-28)
[Fixed]
Generating statistics on plugin settings page when WebP format is unchecked[Fixed]
Restoring original images in Media Library[Changed]
Optimization statistics in Media Library[Added]
Warnings with explanations in plugin settings field: Image loading mode
5.13.1 (2024-08-04)
[Changed]
Optimization statistics in Media Library
5.13.0 (2024-06-27)
[Fixed]
Filterwebpc_option_quality_levels
to change conversion quality levels[Added]
Support for WordPress 6.6
See changelog.txt for previous versions.