Version Description
- Regression fix: Don't load Imagify SweetAlert files on WP Rocket options screen to avoid conflitcs.
Download this release
Release Info
Developer | wp_media |
Plugin | Imagify Image Optimizer |
Version | 1.6.9.1 |
Comparing to | |
See all releases |
Code changes from version 1.6.9 to 1.6.9.1
- assets/images/big-blue-check.png +0 -0
- assets/images/check-1.svg +0 -0
- assets/images/check-mini-1.svg +0 -0
- assets/images/icon-arrow-choice.png +0 -0
- assets/images/icon-arrow-choice.svg +0 -0
- assets/images/icon-lock.png +0 -0
- assets/images/icon-lock.svg +0 -0
- assets/images/icon-pack.png +0 -0
- assets/images/icon-pack.svg +0 -0
- assets/images/mushrooms-aggressive.jpg +0 -0
- assets/images/mushrooms-normal.jpg +0 -0
- assets/images/mushrooms-original.jpg +0 -0
- assets/images/mushrooms-ultra.jpg +0 -0
- assets/images/pic-ericwaltr.jpg +0 -0
- assets/images/pic-srhdesign.jpg +0 -0
- imagify.php +2 -5
- inc/3rd-party/3rd-party.php +1 -0
- inc/3rd-party/amazon-s3-and-cloudfront/inc/classes/class-imagify-as3cf.php +0 -0
- inc/3rd-party/nextgen-gallery/inc/admin/ajax.php +0 -0
- inc/3rd-party/nextgen-gallery/inc/admin/bulk.php +0 -0
- inc/3rd-party/nextgen-gallery/inc/admin/db.php +0 -0
- inc/3rd-party/nextgen-gallery/inc/admin/enqueue.php +0 -0
- inc/3rd-party/nextgen-gallery/inc/admin/gallery.php +0 -0
- inc/3rd-party/nextgen-gallery/inc/admin/heartbeat.php +0 -0
- inc/3rd-party/nextgen-gallery/inc/admin/menu.php +0 -0
- inc/3rd-party/nextgen-gallery/inc/functions/admin-stats.php +0 -0
- inc/3rd-party/wp-rocket.php +21 -0
- inc/admin/heartbeat.php +0 -0
- inc/classes/class-imagify-rocket-infos.php +0 -433
- readme.txt +4 -1
- uninstall.php +0 -1
assets/images/big-blue-check.png
CHANGED
File without changes
|
assets/images/check-1.svg
CHANGED
File without changes
|
assets/images/check-mini-1.svg
CHANGED
File without changes
|
assets/images/icon-arrow-choice.png
CHANGED
File without changes
|
assets/images/icon-arrow-choice.svg
CHANGED
File without changes
|
assets/images/icon-lock.png
CHANGED
File without changes
|
assets/images/icon-lock.svg
CHANGED
File without changes
|
assets/images/icon-pack.png
CHANGED
File without changes
|
assets/images/icon-pack.svg
CHANGED
File without changes
|
assets/images/mushrooms-aggressive.jpg
CHANGED
File without changes
|
assets/images/mushrooms-normal.jpg
CHANGED
File without changes
|
assets/images/mushrooms-original.jpg
CHANGED
File without changes
|
assets/images/mushrooms-ultra.jpg
CHANGED
File without changes
|
assets/images/pic-ericwaltr.jpg
CHANGED
File without changes
|
assets/images/pic-srhdesign.jpg
CHANGED
File without changes
|
imagify.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
* Plugin Name: Imagify
|
4 |
* Plugin URI: https://wordpress.org/plugins/imagify/
|
5 |
* Description: Dramaticaly 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.
|
6 |
-
* Version: 1.6.9
|
7 |
* Author: WP Media
|
8 |
* Author URI: https://wp-media.me/
|
9 |
* Licence: GPLv2
|
@@ -17,7 +17,7 @@
|
|
17 |
defined( 'ABSPATH' ) || die( 'Cheatin\' uh?' );
|
18 |
|
19 |
// Imagify defines.
|
20 |
-
define( 'IMAGIFY_VERSION' , '1.6.9' );
|
21 |
define( 'IMAGIFY_SLUG' , 'imagify' );
|
22 |
define( 'IMAGIFY_SETTINGS_SLUG' , IMAGIFY_SLUG . '_settings' );
|
23 |
define( 'IMAGIFY_WEB_MAIN' , 'https://imagify.io' );
|
@@ -98,9 +98,6 @@ function _imagify_init() {
|
|
98 |
require( IMAGIFY_ADMIN_UI_PATH . 'options.php' );
|
99 |
require( IMAGIFY_ADMIN_UI_PATH . 'bulk.php' );
|
100 |
require( IMAGIFY_ADMIN_UI_PATH . 'notices.php' );
|
101 |
-
require( IMAGIFY_CLASSES_PATH . 'class-imagify-rocket-infos.php' );
|
102 |
-
|
103 |
-
add_action( 'init', array( imagify_rocket_infos(), 'init' ) );
|
104 |
}
|
105 |
|
106 |
/**
|
3 |
* Plugin Name: Imagify
|
4 |
* Plugin URI: https://wordpress.org/plugins/imagify/
|
5 |
* Description: Dramaticaly 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.
|
6 |
+
* Version: 1.6.9.1
|
7 |
* Author: WP Media
|
8 |
* Author URI: https://wp-media.me/
|
9 |
* Licence: GPLv2
|
17 |
defined( 'ABSPATH' ) || die( 'Cheatin\' uh?' );
|
18 |
|
19 |
// Imagify defines.
|
20 |
+
define( 'IMAGIFY_VERSION' , '1.6.9.1' );
|
21 |
define( 'IMAGIFY_SLUG' , 'imagify' );
|
22 |
define( 'IMAGIFY_SETTINGS_SLUG' , IMAGIFY_SLUG . '_settings' );
|
23 |
define( 'IMAGIFY_WEB_MAIN' , 'https://imagify.io' );
|
98 |
require( IMAGIFY_ADMIN_UI_PATH . 'options.php' );
|
99 |
require( IMAGIFY_ADMIN_UI_PATH . 'bulk.php' );
|
100 |
require( IMAGIFY_ADMIN_UI_PATH . 'notices.php' );
|
|
|
|
|
|
|
101 |
}
|
102 |
|
103 |
/**
|
inc/3rd-party/3rd-party.php
CHANGED
@@ -6,6 +6,7 @@ require( IMAGIFY_3RD_PARTY_PATH . 'enable-media-replace/enable-media-replace.php
|
|
6 |
require( IMAGIFY_3RD_PARTY_PATH . 'nextgen-gallery/nextgen-gallery.php' );
|
7 |
require( IMAGIFY_3RD_PARTY_PATH . 'screets-lc.php' );
|
8 |
require( IMAGIFY_3RD_PARTY_PATH . 'wp-retina-2x.php' );
|
|
|
9 |
|
10 |
// Hosting.
|
11 |
require( IMAGIFY_3RD_PARTY_PATH . 'hosting/wpengine.php' );
|
6 |
require( IMAGIFY_3RD_PARTY_PATH . 'nextgen-gallery/nextgen-gallery.php' );
|
7 |
require( IMAGIFY_3RD_PARTY_PATH . 'screets-lc.php' );
|
8 |
require( IMAGIFY_3RD_PARTY_PATH . 'wp-retina-2x.php' );
|
9 |
+
require( IMAGIFY_3RD_PARTY_PATH . 'wp-rocket.php' );
|
10 |
|
11 |
// Hosting.
|
12 |
require( IMAGIFY_3RD_PARTY_PATH . 'hosting/wpengine.php' );
|
inc/3rd-party/amazon-s3-and-cloudfront/inc/classes/class-imagify-as3cf.php
CHANGED
File without changes
|
inc/3rd-party/nextgen-gallery/inc/admin/ajax.php
CHANGED
File without changes
|
inc/3rd-party/nextgen-gallery/inc/admin/bulk.php
CHANGED
File without changes
|
inc/3rd-party/nextgen-gallery/inc/admin/db.php
CHANGED
File without changes
|
inc/3rd-party/nextgen-gallery/inc/admin/enqueue.php
CHANGED
File without changes
|
inc/3rd-party/nextgen-gallery/inc/admin/gallery.php
CHANGED
File without changes
|
inc/3rd-party/nextgen-gallery/inc/admin/heartbeat.php
CHANGED
File without changes
|
inc/3rd-party/nextgen-gallery/inc/admin/menu.php
CHANGED
File without changes
|
inc/3rd-party/nextgen-gallery/inc/functions/admin-stats.php
CHANGED
File without changes
|
inc/3rd-party/wp-rocket.php
ADDED
@@ -0,0 +1,21 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
defined( 'ABSPATH' ) || die( 'Cheatin\' uh?' );
|
3 |
+
|
4 |
+
// temp fix on 1.6.9.1
|
5 |
+
if ( defined( 'WP_ROCKET_VERSION' ) ) {
|
6 |
+
/**
|
7 |
+
* Don't load Imagify CSS & JS files on WP Rocket options screen to avoid conflict.
|
8 |
+
*
|
9 |
+
* @since 1.6.9.1
|
10 |
+
* @author Jonathan Buttigieg
|
11 |
+
*/
|
12 |
+
add_action( 'admin_print_styles', 'imagify_dequeue_sweetalert_wprocket', 11 );
|
13 |
+
function imagify_dequeue_sweetalert_wprocket() {
|
14 |
+
$current_screen = get_current_screen();
|
15 |
+
if ( isset( $current_screen ) && ( 'settings_page_wprocket' === $current_screen->base || 'settings_page_wprocket-network' === $current_screen->base ) ) {
|
16 |
+
wp_dequeue_style( 'imagify-css-sweetalert' );
|
17 |
+
wp_dequeue_script( 'imagify-js-admin' );
|
18 |
+
wp_dequeue_script( 'imagify-js-sweetalert' );
|
19 |
+
}
|
20 |
+
}
|
21 |
+
}
|
inc/admin/heartbeat.php
CHANGED
File without changes
|
inc/classes/class-imagify-rocket-infos.php
DELETED
@@ -1,433 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
defined( 'ABSPATH' ) || die( 'Cheatin\' uh?' );
|
3 |
-
|
4 |
-
/**
|
5 |
-
* Class that handles WP Rocket infos in the "Add Plugins" screen.
|
6 |
-
*
|
7 |
-
* @since 1.6.9
|
8 |
-
*/
|
9 |
-
class Imagify_Rocket_Infos {
|
10 |
-
|
11 |
-
/**
|
12 |
-
* Class version.
|
13 |
-
*
|
14 |
-
* @var string
|
15 |
-
*/
|
16 |
-
const VERSION = '1.0';
|
17 |
-
|
18 |
-
/**
|
19 |
-
* The URL to request.
|
20 |
-
*
|
21 |
-
* @var string
|
22 |
-
*/
|
23 |
-
const REQUEST_URL = 'https://wp-rocket.me/stat/1.0/wp-rocket/';
|
24 |
-
|
25 |
-
/**
|
26 |
-
* The name of the transient that stores the WP Rocket infos.
|
27 |
-
*
|
28 |
-
* @var string
|
29 |
-
*/
|
30 |
-
const TRANSIENT_NAME = 'imagify_rocket_plugin_info';
|
31 |
-
|
32 |
-
/**
|
33 |
-
* Time until transient expiration in seconds.
|
34 |
-
*
|
35 |
-
* @access protected
|
36 |
-
* @var int
|
37 |
-
*/
|
38 |
-
protected static $transient_expiration;
|
39 |
-
|
40 |
-
/**
|
41 |
-
* Time until transient expiration in seconds, in case of error.
|
42 |
-
*
|
43 |
-
* @access protected
|
44 |
-
* @var int
|
45 |
-
*/
|
46 |
-
protected static $error_expiration;
|
47 |
-
|
48 |
-
/**
|
49 |
-
* The headers to send along the request.
|
50 |
-
*
|
51 |
-
* @access protected
|
52 |
-
* @var array
|
53 |
-
*/
|
54 |
-
protected static $headers = array();
|
55 |
-
|
56 |
-
/**
|
57 |
-
* The plugin information.
|
58 |
-
*
|
59 |
-
* @access protected
|
60 |
-
* @var object
|
61 |
-
*/
|
62 |
-
protected static $plugin_information;
|
63 |
-
|
64 |
-
/**
|
65 |
-
* The single instance of the class.
|
66 |
-
*
|
67 |
-
* @access protected
|
68 |
-
* @var object
|
69 |
-
*/
|
70 |
-
protected static $_instance;
|
71 |
-
|
72 |
-
|
73 |
-
/** ----------------------------------------------------------------------------------------- */
|
74 |
-
/** INSTANCE, INIT ========================================================================== */
|
75 |
-
/** ----------------------------------------------------------------------------------------- */
|
76 |
-
|
77 |
-
/**
|
78 |
-
* Class constructor: set properties.
|
79 |
-
*
|
80 |
-
* @access protected
|
81 |
-
* @since 1.6.9
|
82 |
-
* @author Grégory Viguier
|
83 |
-
*/
|
84 |
-
protected function __construct() {
|
85 |
-
self::$transient_expiration = 2 * WEEK_IN_SECONDS;
|
86 |
-
self::$error_expiration = 5 * MINUTE_IN_SECONDS;
|
87 |
-
self::$headers['X-Locale'] = function_exists( 'get_user_locale' ) ? get_user_locale() : get_locale();
|
88 |
-
}
|
89 |
-
|
90 |
-
/**
|
91 |
-
* Get the main Instance.
|
92 |
-
*
|
93 |
-
* @access public
|
94 |
-
* @since 1.6.9
|
95 |
-
* @author Grégory Viguier
|
96 |
-
*
|
97 |
-
* @return object Main instance.
|
98 |
-
*/
|
99 |
-
public static function get_instance() {
|
100 |
-
if ( ! isset( self::$_instance ) ) {
|
101 |
-
self::$_instance = new self();
|
102 |
-
}
|
103 |
-
|
104 |
-
return self::$_instance;
|
105 |
-
}
|
106 |
-
|
107 |
-
/**
|
108 |
-
* Hooks init.
|
109 |
-
*
|
110 |
-
* @access public
|
111 |
-
* @since 1.6.9
|
112 |
-
* @author Grégory Viguier
|
113 |
-
*/
|
114 |
-
public function init() {
|
115 |
-
global $wp_version;
|
116 |
-
|
117 |
-
// Filter the plugin API results to inject WP Rocket.
|
118 |
-
add_filter( 'plugins_api_result', array( $this, 'add_api_result' ), IMAGIFY_INT_MAX, 3 );
|
119 |
-
|
120 |
-
// Change order for the featured tab.
|
121 |
-
if ( is_network_admin() ) {
|
122 |
-
add_filter( 'views_plugin-install-network', array( $this, 'change_featured_items_order' ), IMAGIFY_INT_MAX );
|
123 |
-
} else {
|
124 |
-
add_filter( 'views_plugin-install', array( $this, 'change_featured_items_order' ), IMAGIFY_INT_MAX );
|
125 |
-
}
|
126 |
-
|
127 |
-
// Filter the iframe src to return WP Rocket's site URL (More Details popup).
|
128 |
-
if ( version_compare( $wp_version, '4.9' ) >= 0 ) {
|
129 |
-
add_filter( 'self_admin_url', array( $this, 'filter_iframe_src' ), 100, 2 );
|
130 |
-
} else {
|
131 |
-
add_filter( 'network_admin_url', array( $this, 'filter_iframe_src' ), 100, 2 );
|
132 |
-
add_filter( 'user_admin_url', array( $this, 'filter_iframe_src' ), 100, 2 );
|
133 |
-
add_filter( 'admin_url', array( $this, 'filter_iframe_src' ), 100, 2 );
|
134 |
-
}
|
135 |
-
|
136 |
-
// Filter the iframe action links to display a "Buy Now" button.
|
137 |
-
add_filter( 'plugin_install_action_links', array( $this, 'add_action_link' ), 10, 2 );
|
138 |
-
}
|
139 |
-
|
140 |
-
|
141 |
-
/** ----------------------------------------------------------------------------------------- */
|
142 |
-
/** HOOKS =================================================================================== */
|
143 |
-
/** ----------------------------------------------------------------------------------------- */
|
144 |
-
|
145 |
-
/**
|
146 |
-
* Filter the plugin API results to inject WP Rocket.
|
147 |
-
*
|
148 |
-
* @access public
|
149 |
-
* @since 1.6.9
|
150 |
-
* @author Grégory Viguier
|
151 |
-
*
|
152 |
-
* @param object $result Response object or WP_Error object.
|
153 |
-
* @param string $action The type of information being requested from the Plugin Install API.
|
154 |
-
* @param object $args Plugin API arguments.
|
155 |
-
* @return array|object Updated array of results or WP_Error object.
|
156 |
-
*/
|
157 |
-
public function add_api_result( $result, $action, $args ) {
|
158 |
-
if ( is_wp_error( $result ) || empty( $args->browse ) ) {
|
159 |
-
return $result;
|
160 |
-
}
|
161 |
-
|
162 |
-
if ( 'featured' !== $args->browse && 'recommended' !== $args->browse && 'popular' !== $args->browse ) {
|
163 |
-
return $result;
|
164 |
-
}
|
165 |
-
|
166 |
-
if ( ! isset( $result->info['page'] ) || 1 < $result->info['page'] ) {
|
167 |
-
return $result;
|
168 |
-
}
|
169 |
-
|
170 |
-
if ( defined( 'WP_ROCKET_VERSION' ) || file_exists( WP_PLUGIN_DIR . '/wp-rocket/wp-rocket.php' ) ) {
|
171 |
-
return $result;
|
172 |
-
}
|
173 |
-
|
174 |
-
$plugin_info = $this->get_plugin_info();
|
175 |
-
|
176 |
-
if ( is_wp_error( $plugin_info ) ) {
|
177 |
-
return $result;
|
178 |
-
}
|
179 |
-
|
180 |
-
array_unshift( $result->plugins, $plugin_info );
|
181 |
-
|
182 |
-
if ( isset( $result->info['results'] ) ) {
|
183 |
-
++$result->info['results'];
|
184 |
-
}
|
185 |
-
|
186 |
-
return $result;
|
187 |
-
}
|
188 |
-
|
189 |
-
/**
|
190 |
-
* Put WP Rocket back at the first place in the Featured tab.
|
191 |
-
* In the Featured tab, WP uses `uasort()` to reorder the items. But the order is made on a non-existing property (group), so as a result, the items are ramdomized.
|
192 |
-
*
|
193 |
-
* @access public
|
194 |
-
* @since 1.6.9
|
195 |
-
* @author Grégory Viguier
|
196 |
-
*
|
197 |
-
* @param array $views An array of available list table views.
|
198 |
-
* @return array The same array.
|
199 |
-
*/
|
200 |
-
function change_featured_items_order( $views ) {
|
201 |
-
global $wp_list_table;
|
202 |
-
|
203 |
-
if ( 'group' !== $wp_list_table->orderby ) {
|
204 |
-
return $views;
|
205 |
-
}
|
206 |
-
|
207 |
-
foreach ( $wp_list_table->items as $i => $item ) {
|
208 |
-
$item = (object) $item;
|
209 |
-
|
210 |
-
if ( 'wp-rocket' === $item->slug ) {
|
211 |
-
unset( $wp_list_table->items[ $i ] );
|
212 |
-
array_unshift( $wp_list_table->items, $item );
|
213 |
-
break;
|
214 |
-
}
|
215 |
-
}
|
216 |
-
|
217 |
-
return $views;
|
218 |
-
}
|
219 |
-
|
220 |
-
/**
|
221 |
-
* Filter the iframe src to return WP Rocket's site URL (More Details popup).
|
222 |
-
*
|
223 |
-
* @access public
|
224 |
-
* @since 1.6.9
|
225 |
-
* @author Grégory Viguier
|
226 |
-
*
|
227 |
-
* @param string $url The complete URL including scheme and path.
|
228 |
-
* @param string $path Path relative to the URL. Blank string if no path is specified.
|
229 |
-
* @return string
|
230 |
-
*/
|
231 |
-
public function filter_iframe_src( $url, $path ) {
|
232 |
-
if ( ! preg_match( '@/wp-admin/(?:network/user/)?plugin-install.php\?@', $url ) ) {
|
233 |
-
return $url;
|
234 |
-
}
|
235 |
-
|
236 |
-
$parsed_url = wp_parse_url( $url );
|
237 |
-
|
238 |
-
if ( empty( $parsed_url['query'] ) ) {
|
239 |
-
return $url;
|
240 |
-
}
|
241 |
-
|
242 |
-
$parsed_url['query'] = htmlspecialchars_decode( $parsed_url['query'] );
|
243 |
-
wp_parse_str( $parsed_url['query'], $params );
|
244 |
-
|
245 |
-
if ( ! isset( $params['tab'], $params['plugin'] ) || 'plugin-information' !== $params['tab'] || 'wp-rocket' !== $params['plugin'] ) {
|
246 |
-
return $url;
|
247 |
-
}
|
248 |
-
|
249 |
-
$url = imagify_get_wp_rocket_url( false, array(
|
250 |
-
'utm_source' => 'wpaddplugins',
|
251 |
-
'utm_medium' => 'imagify',
|
252 |
-
'utm_campaign' => 'moredetails',
|
253 |
-
) );
|
254 |
-
|
255 |
-
return $url . '#TB_iframe=true&width=772&height=712';
|
256 |
-
}
|
257 |
-
|
258 |
-
/**
|
259 |
-
* Filter the iframe action links to display a "Buy Now" button.
|
260 |
-
*
|
261 |
-
* @access public
|
262 |
-
* @since 1.6.9
|
263 |
-
* @author Grégory Viguier
|
264 |
-
*
|
265 |
-
* @param array $links Links for plugin.
|
266 |
-
* @param array $plugin Plugin data.
|
267 |
-
* @return array
|
268 |
-
*/
|
269 |
-
public function add_action_link( $links, $plugin ) {
|
270 |
-
if ( empty( $plugin['slug'] ) || 'wp-rocket' !== $plugin['slug'] ) {
|
271 |
-
return $links;
|
272 |
-
}
|
273 |
-
|
274 |
-
// Remove the "Install Now" button.
|
275 |
-
if ( $links ) {
|
276 |
-
foreach ( $links as $i => $link ) {
|
277 |
-
if ( strpos( $link, 'install-now' ) !== false ) {
|
278 |
-
unset( $links[ $i ] );
|
279 |
-
break;
|
280 |
-
}
|
281 |
-
}
|
282 |
-
}
|
283 |
-
|
284 |
-
// Add the "Buy Now" button.
|
285 |
-
$link = '<a class="button" target="_blank" data-slug="wp-rocket" href="%s" aria-label="%s" data-name="WP Rocket">%s</a>';
|
286 |
-
$url = imagify_get_wp_rocket_url( false, array(
|
287 |
-
'utm_source' => 'wpaddplugins',
|
288 |
-
'utm_medium' => 'imagify',
|
289 |
-
'utm_campaign' => 'imagify',
|
290 |
-
) );
|
291 |
-
|
292 |
-
array_unshift( $links, sprintf(
|
293 |
-
$link,
|
294 |
-
esc_url( $url ),
|
295 |
-
/* translators: %s is a plugin name. */
|
296 |
-
esc_attr( sprintf( __( 'Buy %s now', 'imagify' ), 'WP Rocket' ) ),
|
297 |
-
__( 'Buy Now', 'imagify' )
|
298 |
-
) );
|
299 |
-
|
300 |
-
return $links;
|
301 |
-
}
|
302 |
-
|
303 |
-
|
304 |
-
/** ----------------------------------------------------------------------------------------- */
|
305 |
-
/** TOOLS TO GET THE PLUGIN INFOS =========================================================== */
|
306 |
-
/** ----------------------------------------------------------------------------------------- */
|
307 |
-
|
308 |
-
/**
|
309 |
-
* Get the plugin infos.
|
310 |
-
*
|
311 |
-
* @access public
|
312 |
-
* @since 1.6.9
|
313 |
-
* @author Grégory Viguier
|
314 |
-
*
|
315 |
-
* @return object The plugin informations object or WP_Error object.
|
316 |
-
*/
|
317 |
-
public function get_plugin_info() {
|
318 |
-
if ( ! isset( self::$plugin_information ) ) {
|
319 |
-
// Get the plugin info stored in a transient.
|
320 |
-
self::$plugin_information = $this->get_stored_data();
|
321 |
-
}
|
322 |
-
|
323 |
-
if ( self::$plugin_information ) {
|
324 |
-
// We have something.
|
325 |
-
return self::$plugin_information;
|
326 |
-
}
|
327 |
-
|
328 |
-
// Fetch new data.
|
329 |
-
self::$plugin_information = wp_remote_get( self::REQUEST_URL, array(
|
330 |
-
'headers' => self::$headers,
|
331 |
-
'timeout' => 15,
|
332 |
-
) );
|
333 |
-
|
334 |
-
if ( is_wp_error( self::$plugin_information ) ) {
|
335 |
-
// Requests are blocked.
|
336 |
-
return $this->store_data();
|
337 |
-
}
|
338 |
-
|
339 |
-
$response_code = wp_remote_retrieve_response_code( self::$plugin_information );
|
340 |
-
|
341 |
-
if ( 200 !== $response_code ) {
|
342 |
-
// Trouble on the WP Rocket site's side.
|
343 |
-
self::$plugin_information = new WP_Error( 'imagify_response_code', 'Information about the plugin could not be retrieved.' );
|
344 |
-
return $this->store_data();
|
345 |
-
}
|
346 |
-
|
347 |
-
self::$plugin_information = maybe_unserialize( wp_remote_retrieve_body( self::$plugin_information ) );
|
348 |
-
|
349 |
-
if ( ! is_object( self::$plugin_information ) ) {
|
350 |
-
// Trouble on the WP Rocket site's side.
|
351 |
-
self::$plugin_information = new WP_Error( 'imagify_format', 'Information about the plugin could not be retrieved.' );
|
352 |
-
return $this->store_data();
|
353 |
-
}
|
354 |
-
|
355 |
-
self::$plugin_information->short_description = 'The best WordPress caching plugin to speed up your site, optimize your SEO and increase your conversions. It’s never been easier to improve your loading time in a few clicks.';
|
356 |
-
|
357 |
-
return $this->store_data();
|
358 |
-
}
|
359 |
-
|
360 |
-
/**
|
361 |
-
* Get the data stored in the database.
|
362 |
-
*
|
363 |
-
* @access public
|
364 |
-
* @since 1.6.9
|
365 |
-
* @author Grégory Viguier
|
366 |
-
*
|
367 |
-
* @return object The plugin informations object or WP_Error object.
|
368 |
-
*/
|
369 |
-
protected function get_stored_data() {
|
370 |
-
self::$plugin_information = get_site_transient( self::TRANSIENT_NAME );
|
371 |
-
return $this->translate_informations();
|
372 |
-
}
|
373 |
-
|
374 |
-
/**
|
375 |
-
* Store the data into in the database.
|
376 |
-
*
|
377 |
-
* @access public
|
378 |
-
* @since 1.6.9
|
379 |
-
* @author Grégory Viguier
|
380 |
-
*
|
381 |
-
* @return object The plugin informations object or WP_Error object.
|
382 |
-
*/
|
383 |
-
protected function store_data() {
|
384 |
-
$expiration = self::$transient_expiration;
|
385 |
-
|
386 |
-
if ( is_wp_error( self::$plugin_information ) ) {
|
387 |
-
$expiration = self::$error_expiration;
|
388 |
-
}
|
389 |
-
|
390 |
-
set_site_transient( self::TRANSIENT_NAME, self::$plugin_information, $expiration );
|
391 |
-
|
392 |
-
return $this->translate_informations();
|
393 |
-
}
|
394 |
-
|
395 |
-
/**
|
396 |
-
* Translate some of the plugin informations.
|
397 |
-
*
|
398 |
-
* @access public
|
399 |
-
* @since 1.6.9
|
400 |
-
* @author Grégory Viguier
|
401 |
-
*
|
402 |
-
* @return object The plugin informations object or WP_Error object.
|
403 |
-
*/
|
404 |
-
protected function translate_informations() {
|
405 |
-
if ( ! self::$plugin_information || is_wp_error( self::$plugin_information ) ) {
|
406 |
-
return self::$plugin_information;
|
407 |
-
}
|
408 |
-
|
409 |
-
/* translators: %s is a WordPress version. */
|
410 |
-
self::$plugin_information->requires = preg_replace( '@([\d.]+) or higher@', sprintf( __( '%s or higher', 'imagify' ), '$1' ), self::$plugin_information->requires );
|
411 |
-
self::$plugin_information->requires = str_replace( 'Requires PHP:', __( 'Requires PHP:', 'imagify' ), self::$plugin_information->requires );
|
412 |
-
self::$plugin_information->homepage = imagify_get_wp_rocket_url( false, array(
|
413 |
-
'utm_source' => 'wpaddplugins',
|
414 |
-
'utm_medium' => 'imagify',
|
415 |
-
'utm_campaign' => 'imagify',
|
416 |
-
) );
|
417 |
-
self::$plugin_information->short_description = __( 'The best WordPress caching plugin to speed up your site, optimize your SEO and increase your conversions. It’s never been easier to improve your loading time in a few clicks.', 'imagify' );
|
418 |
-
|
419 |
-
return self::$plugin_information;
|
420 |
-
}
|
421 |
-
}
|
422 |
-
|
423 |
-
/**
|
424 |
-
* Returns the main instance of the Imagify_Rocket_Infos class.
|
425 |
-
*
|
426 |
-
* @since 1.6.9
|
427 |
-
* @author Grégory Viguier
|
428 |
-
*
|
429 |
-
* @return object The Imagify_Rocket_Infos instance.
|
430 |
-
*/
|
431 |
-
function imagify_rocket_infos() {
|
432 |
-
return Imagify_Rocket_Infos::get_instance();
|
433 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
readme.txt
CHANGED
@@ -3,7 +3,7 @@ Contributors: wp_media, GregLone
|
|
3 |
Tags: compress image, images, performance, optimization, photos, upload, resize, gif, png, jpg, reduce image size, retina
|
4 |
Requires at least: 3.7.0
|
5 |
Tested up to: 4.8.1
|
6 |
-
Stable tag: 1.6.9
|
7 |
|
8 |
Dramatically reduce image file sizes without losing quality, make your website load faster, boost your SEO and save money on your bandwidth.
|
9 |
|
@@ -136,6 +136,9 @@ When the plugin is disabled, your existing images remain optimized. Backups of t
|
|
136 |
3. Media Page
|
137 |
|
138 |
== Changelog ==
|
|
|
|
|
|
|
139 |
= 1.6.9 =
|
140 |
* Improvement: the bulk optimization now stops as soon as the quota is fully consumed, instead of trying to optimize more images and getting error messages one after the other.
|
141 |
* Improvement: updated (almost) all JavaScript libraries we use. SweetAlert won't conflict with new versions anymore. Few code improvements.
|
3 |
Tags: compress image, images, performance, optimization, photos, upload, resize, gif, png, jpg, reduce image size, retina
|
4 |
Requires at least: 3.7.0
|
5 |
Tested up to: 4.8.1
|
6 |
+
Stable tag: 1.6.9.1
|
7 |
|
8 |
Dramatically reduce image file sizes without losing quality, make your website load faster, boost your SEO and save money on your bandwidth.
|
9 |
|
136 |
3. Media Page
|
137 |
|
138 |
== Changelog ==
|
139 |
+
= 1.6.9.1 =
|
140 |
+
* Regression fix: Don't load Imagify SweetAlert files on WP Rocket options screen to avoid conflitcs.
|
141 |
+
|
142 |
= 1.6.9 =
|
143 |
* Improvement: the bulk optimization now stops as soon as the quota is fully consumed, instead of trying to optimize more images and getting error messages one after the other.
|
144 |
* Improvement: updated (almost) all JavaScript libraries we use. SweetAlert won't conflict with new versions anymore. Few code improvements.
|
uninstall.php
CHANGED
@@ -11,7 +11,6 @@ delete_site_transient( 'imagify_check_licence_1' );
|
|
11 |
delete_site_transient( 'imagify_bulk_optimization_level' );
|
12 |
delete_site_transient( 'imagify_large_library' );
|
13 |
delete_site_transient( 'imagify_max_image_size' );
|
14 |
-
delete_site_transient( 'imagify_rocket_plugin_info' );
|
15 |
|
16 |
// Clear scheduled hooks.
|
17 |
wp_clear_scheduled_hook( 'imagify_rating_event' );
|
11 |
delete_site_transient( 'imagify_bulk_optimization_level' );
|
12 |
delete_site_transient( 'imagify_large_library' );
|
13 |
delete_site_transient( 'imagify_max_image_size' );
|
|
|
14 |
|
15 |
// Clear scheduled hooks.
|
16 |
wp_clear_scheduled_hook( 'imagify_rating_event' );
|