Skip to content

Commit

Permalink
Merge branch 'develop' into fix/3rd-party-next-gen
Browse files Browse the repository at this point in the history
  • Loading branch information
remyperona committed Mar 9, 2024
2 parents 581e808 + 4783946 commit 5e3db8d
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 3 deletions.
4 changes: 2 additions & 2 deletions imagify.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* Plugin Name: Imagify
* Plugin URI: https://wordpress.org/plugins/imagify/
* Description: Dramatically reduce image file sizes without losing quality, make your website load faster, boost your SEO and save money on your bandwidth using Imagify, the new most advanced image optimization tool.
* Version: 2.2-alpha1
* Version: 2.2.0.1
* Requires at least: 5.3
* Requires PHP: 7.0
* Author: Imagify – Optimize Images & Convert WebP & Avif
Expand All @@ -19,7 +19,7 @@
defined( 'ABSPATH' ) || die( 'Cheatin’ uh?' );

// Imagify defines.
define( 'IMAGIFY_VERSION', '2.2-alpha1' );
define( 'IMAGIFY_VERSION', '2.2.0.1' );
define( 'IMAGIFY_SLUG', 'imagify' );
define( 'IMAGIFY_FILE', __FILE__ );
define( 'IMAGIFY_PATH', realpath( plugin_dir_path( IMAGIFY_FILE ) ) . '/' );
Expand Down
5 changes: 5 additions & 0 deletions inc/admin/upgrader.php
Original file line number Diff line number Diff line change
Expand Up @@ -307,6 +307,11 @@ function _imagify_new_upgrade( $network_version, $site_version ) {
if ( version_compare( $site_version, '2.0' ) < 0 ) {
Imagify_Options::get_instance()->set( 'optimization_level', 2 );
}

if ( version_compare( $site_version, '2.2' ) < 0 ) {
Imagify_Options::get_instance()->set( 'display_nextgen', Imagify_Options::get_instance()->get( 'display_webp', 0 ) );
Imagify_Options::get_instance()->set( 'display_nextgen_method', Imagify_Options::get_instance()->get( 'display_webp_method' ) );
}
}
add_action( 'imagify_upgrade', '_imagify_new_upgrade', 10, 2 );

Expand Down
5 changes: 5 additions & 0 deletions inc/classes/class-imagify-options.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,14 @@ class Imagify_Options extends Imagify_Abstract_Options {
'resize_larger_w' => 0,
'display_nextgen' => 0,
'display_nextgen_method' => 'picture',
'display_webp' => 0,
'display_webp_method' => 'picture',
'cdn_url' => '',
'disallowed-sizes' => [],
'admin_bar_menu' => 0,
'partner_links' => 0,
'convert_to_avif' => 0,
'convert_to_webp' => 0,
];

/**
Expand Down Expand Up @@ -131,6 +134,7 @@ public function sanitize_and_validate_value( $key, $value, $default ) {
case 'resize_larger':
case 'convert_to_webp':
case 'display_nextgen':
case 'display_webp':
case 'admin_bar_menu':
case 'partner_links':
case 'convert_to_avif':
Expand Down Expand Up @@ -160,6 +164,7 @@ public function sanitize_and_validate_value( $key, $value, $default ) {
return array_fill_keys( $value, 1 );

case 'display_nextgen_method':
case 'display_webp_method':
$values = [
'picture' => 1,
'rewrite' => 1,
Expand Down
8 changes: 7 additions & 1 deletion readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
Contributors: wp_rocket, imagify
Tags: optimize images, convert webp, webp converter, convert AVIF, webp to AVIF, AVIF plugin, AVIF converter, image optimization, compress images, image compressor, resize images, reduce image size, performance, image optimizer, core web vitals, best image optimization plugin
Tested up to: 6.4
Stable tag: 2.2
Stable tag: 2.2.0.1
License: GPLv2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html

Expand Down Expand Up @@ -261,6 +261,12 @@ You can report any security bugs found in the source code of the site-reviews pl
4. Other Media Page

== Changelog ==
= 2.2.0.1 =
- Bugfix: Preserve "Display images in webp format" configuration when updating.

= 2.2 =
- New Feature: Introduce AVIF generation feature

= 2.1.3.1 =
- Bugfix: missing styling on some banners when using minified versions of the CSS files (#765)

Expand Down

0 comments on commit 5e3db8d

Please sign in to comment.