Version Description
- Fix: When metadata is broken, displays a message.
- Fix: A few icons weren't displayed nicely.
- Fix: When metadata is broken, displays a message.
- Update: From Lazysizes 3.0 to 4.0.1.
- Add: Option for forcing SSL Verify.
Download this release
Release Info
Developer | TigrouMeow |
Plugin | WP Retina 2x |
Version | 5.2.0 |
Comparing to | |
See all releases |
Code changes from version 5.1.4 to 5.2.0
- common/admin.php +107 -8
- core.php +4 -4
- dashboard.php +25 -14
- js/lazysizes.min.js +2 -2
- readme.txt +9 -2
- wp-retina-2x.php +13 -5
- wr2x_admin.css +3 -3
- wr2x_admin.php +1 -1
common/admin.php
CHANGED
@@ -5,7 +5,7 @@ if ( !class_exists( 'MeowApps_Admin' ) ) {
|
|
5 |
class MeowApps_Admin {
|
6 |
|
7 |
public static $loaded = false;
|
8 |
-
public static $admin_version = "1.
|
9 |
|
10 |
public $prefix; // prefix used for actions, filters (mfrh)
|
11 |
public $mainfile; // plugin main file (media-file-renamer.php)
|
@@ -19,6 +19,7 @@ if ( !class_exists( 'MeowApps_Admin' ) ) {
|
|
19 |
add_action( 'admin_menu', array( $this, 'admin_menu_start' ) );
|
20 |
add_action( 'admin_enqueue_scripts', array( $this, 'admin_enqueue_scripts' ) );
|
21 |
add_action( 'plugins_loaded', array( $this, 'plugins_loaded' ) );
|
|
|
22 |
}
|
23 |
MeowApps_Admin::$loaded = true;
|
24 |
}
|
@@ -28,14 +29,100 @@ if ( !class_exists( 'MeowApps_Admin' ) ) {
|
|
28 |
$this->mainfile = $mainfile;
|
29 |
$this->domain = $domain;
|
30 |
|
31 |
-
|
32 |
-
|
33 |
if ( is_admin() ) {
|
34 |
$license = get_option( $this->prefix . '_license', "" );
|
35 |
if ( ( !empty( $license ) ) && !file_exists( plugin_dir_path( $this->mainfile ) . 'common/meowapps/admin.php' ) ) {
|
36 |
add_action( 'admin_notices', array( $this, 'admin_notices_licensed_free' ) );
|
37 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
38 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
39 |
}
|
40 |
|
41 |
function admin_notices_licensed_free() {
|
@@ -45,7 +132,7 @@ if ( !class_exists( 'MeowApps_Admin' ) ) {
|
|
45 |
return;
|
46 |
}
|
47 |
echo '<div class="error">';
|
48 |
-
echo '<p>It looks like you are using the free version of the plugin (<b>' . $this->mainfile
|
49 |
echo '<p>
|
50 |
<form method="post" action="">
|
51 |
<input type="hidden" name="' . $this->prefix . '_reset_sub" value="true">
|
@@ -61,7 +148,7 @@ if ( !class_exists( 'MeowApps_Admin' ) ) {
|
|
61 |
}
|
62 |
|
63 |
function display_title( $title = "Meow Apps",
|
64 |
-
$author = "By <a style='text-decoration: none;' href='
|
65 |
if ( !empty( $this->prefix ) )
|
66 |
$title = apply_filters( $this->prefix . '_plugin_title', $title );
|
67 |
if ( $this->display_ads() ) {
|
@@ -104,9 +191,13 @@ if ( !class_exists( 'MeowApps_Admin' ) ) {
|
|
104 |
add_settings_field( 'meowapps_hide_meowapps', "Main Menu",
|
105 |
array( $this, 'meowapps_hide_dashboard_callback' ),
|
106 |
'meowapps_common_settings-menu', 'meowapps_common_settings' );
|
|
|
|
|
|
|
107 |
add_settings_field( 'meowapps_hide_ads', "Ads",
|
108 |
array( $this, 'meowapps_hide_ads_callback' ),
|
109 |
'meowapps_common_settings-menu', 'meowapps_common_settings' );
|
|
|
110 |
register_setting( 'meowapps_common_settings', 'meowapps_hide_meowapps' );
|
111 |
register_setting( 'meowapps_common_settings', 'meowapps_hide_ads' );
|
112 |
}
|
@@ -115,7 +206,7 @@ if ( !class_exists( 'MeowApps_Admin' ) ) {
|
|
115 |
$value = get_option( 'meowapps_hide_ads', null );
|
116 |
$html = '<input type="checkbox" id="meowapps_hide_ads" name="meowapps_hide_ads" value="1" ' .
|
117 |
checked( 1, get_option( 'meowapps_hide_ads' ), false ) . '/>';
|
118 |
-
$html .= __( '<label>Hide</label><br /><small>Doesn\'t display the ads.</small>', '
|
119 |
echo $html;
|
120 |
}
|
121 |
|
@@ -123,7 +214,15 @@ if ( !class_exists( 'MeowApps_Admin' ) ) {
|
|
123 |
$value = get_option( 'meowapps_hide_meowapps', null );
|
124 |
$html = '<input type="checkbox" id="meowapps_hide_meowapps" name="meowapps_hide_meowapps" value="1" ' .
|
125 |
checked( 1, get_option( 'meowapps_hide_meowapps' ), false ) . '/>';
|
126 |
-
$html .= __( '<label>Hide <b>Meow Apps</b> Menu</label><br /><small>Hide Meow Apps menu and all its components, for a
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
127 |
echo $html;
|
128 |
}
|
129 |
|
@@ -134,7 +233,7 @@ if ( !class_exists( 'MeowApps_Admin' ) ) {
|
|
134 |
$html .= '<div class="inside">';
|
135 |
echo $html;
|
136 |
$html = apply_filters( $this->prefix . '_meowapps_license_input', ( 'More information about the Pro version here:
|
137 |
-
<a target="_blank" href="' . $url . '">' . $url . '</a>.' ), $url );
|
138 |
$html .= '</div>';
|
139 |
$html .= '</div>';
|
140 |
echo $html;
|
5 |
class MeowApps_Admin {
|
6 |
|
7 |
public static $loaded = false;
|
8 |
+
public static $admin_version = "1.4";
|
9 |
|
10 |
public $prefix; // prefix used for actions, filters (mfrh)
|
11 |
public $mainfile; // plugin main file (media-file-renamer.php)
|
19 |
add_action( 'admin_menu', array( $this, 'admin_menu_start' ) );
|
20 |
add_action( 'admin_enqueue_scripts', array( $this, 'admin_enqueue_scripts' ) );
|
21 |
add_action( 'plugins_loaded', array( $this, 'plugins_loaded' ) );
|
22 |
+
add_filter( 'updraftplus_com_link', array( $this, 'updraftplus_com_link' ) );
|
23 |
}
|
24 |
MeowApps_Admin::$loaded = true;
|
25 |
}
|
29 |
$this->mainfile = $mainfile;
|
30 |
$this->domain = $domain;
|
31 |
|
32 |
+
register_activation_hook( $mainfile, array( $this, 'show_meowapps_create_rating_date' ) );
|
33 |
+
|
34 |
if ( is_admin() ) {
|
35 |
$license = get_option( $this->prefix . '_license', "" );
|
36 |
if ( ( !empty( $license ) ) && !file_exists( plugin_dir_path( $this->mainfile ) . 'common/meowapps/admin.php' ) ) {
|
37 |
add_action( 'admin_notices', array( $this, 'admin_notices_licensed_free' ) );
|
38 |
}
|
39 |
+
$rating_date = $this->create_rating_date();
|
40 |
+
if ( time() > $rating_date ) {
|
41 |
+
add_action( 'admin_notices', array( $this, 'admin_notices_rating' ) );
|
42 |
+
}
|
43 |
+
}
|
44 |
+
}
|
45 |
+
|
46 |
+
function updraftplus_com_link( $url ) {
|
47 |
+
$url = $url . "?afref=460";
|
48 |
+
return $url;
|
49 |
+
}
|
50 |
+
|
51 |
+
function show_meowapps_create_rating_date() {
|
52 |
+
delete_option( 'meowapps_hide_meowapps' );
|
53 |
+
$this->create_rating_date();
|
54 |
+
}
|
55 |
+
|
56 |
+
function create_rating_date() {
|
57 |
+
$rating_date = get_option( $this->prefix . '_rating_date' );
|
58 |
+
if ( empty( $rating_date ) ) {
|
59 |
+
$two_months = strtotime( '+2 months' );
|
60 |
+
$six_months = strtotime( '+6 months' );
|
61 |
+
$rating_date = mt_rand( $two_months, $six_months );
|
62 |
+
update_option( $this->prefix . '_rating_date', $rating_date, false );
|
63 |
}
|
64 |
+
return $rating_date;
|
65 |
+
}
|
66 |
+
|
67 |
+
function admin_notices_rating() {
|
68 |
+
if ( isset( $_POST[$this->prefix . '_remind_me'] ) ) {
|
69 |
+
$two_weeks = strtotime( '+2 weeks' );
|
70 |
+
$six_weeks = strtotime( '+6 weeks' );
|
71 |
+
$future_date = mt_rand( $two_weeks, $six_weeks );
|
72 |
+
update_option( $this->prefix . '_rating_date', $future_date, false );
|
73 |
+
return;
|
74 |
+
}
|
75 |
+
else if ( isset( $_POST[$this->prefix . '_never_remind_me'] ) ) {
|
76 |
+
$twenty_years = strtotime( '+20 years' );
|
77 |
+
update_option( $this->prefix . '_rating_date', $twenty_years, false );
|
78 |
+
return;
|
79 |
+
}
|
80 |
+
else if ( isset( $_POST[$this->prefix . '_did_it'] ) ) {
|
81 |
+
$twenty_years = strtotime( '+100 years' );
|
82 |
+
update_option( $this->prefix . '_rating_date', $twenty_years, false );
|
83 |
+
return;
|
84 |
+
}
|
85 |
+
$rating_date = get_option( $this->prefix . '_rating_date' );
|
86 |
+
echo '<div class="notice notice-success" data-rating-date="' . date( 'Y-m-d', $rating_date ) . '">';
|
87 |
+
echo '<p style="font-size: 100%;">You have been using <b>' . $this->nice_name_from_file( $this->mainfile ) . '</b> for some time now. If you enjoy it, could you share your thoughts and give the developers a sweet spike of motivation? In that case, please: <a target="_blank" href="https://wordpress.org/support/plugin/' . $this->nice_short_url_from_file( $this->mainfile ) . '/reviews/?rate=5#new-post">review it</a>. Thank you :)';
|
88 |
+
echo '<p>
|
89 |
+
<form method="post" action="" style="float: right;">
|
90 |
+
<input type="hidden" name="' . $this->prefix . '_never_remind_me" value="true">
|
91 |
+
<input type="submit" name="submit" id="submit" class="button button-red" value="Never remind me!">
|
92 |
+
</form>
|
93 |
+
<form method="post" action="" style="float: right; margin-right: 10px;">
|
94 |
+
<input type="hidden" name="' . $this->prefix . '_remind_me" value="true">
|
95 |
+
<input type="submit" name="submit" id="submit" class="button button-primary" value="Remind me in a few weeks...">
|
96 |
+
</form>
|
97 |
+
<form method="post" action="" style="float: right; margin-right: 10px;">
|
98 |
+
<input type="hidden" name="' . $this->prefix . '_did_it" value="true">
|
99 |
+
<input type="submit" name="submit" id="submit" class="button button-primary" value="Yes, I did it!">
|
100 |
+
</form>
|
101 |
+
<div style="clear: both;"></div>
|
102 |
+
</p>
|
103 |
+
';
|
104 |
+
echo '</div>';
|
105 |
+
}
|
106 |
+
|
107 |
+
function nice_short_url_from_file( $file ) {
|
108 |
+
$info = pathinfo( $file );
|
109 |
+
if ( !empty( $info ) ) {
|
110 |
+
$info['filename'] = str_replace( '-pro', '', $info['filename'] );
|
111 |
+
return $info['filename'];
|
112 |
+
}
|
113 |
+
return "";
|
114 |
+
}
|
115 |
+
|
116 |
+
function nice_name_from_file( $file ) {
|
117 |
+
$info = pathinfo( $file );
|
118 |
+
if ( !empty( $info ) ) {
|
119 |
+
if ( $info['filename'] == 'wplr-sync' ) {
|
120 |
+
return "WP/LR Sync";
|
121 |
+
}
|
122 |
+
$info['filename'] = str_replace( '-', ' ', $info['filename'] );
|
123 |
+
$file = ucwords( $info['filename'] );
|
124 |
+
}
|
125 |
+
return $file;
|
126 |
}
|
127 |
|
128 |
function admin_notices_licensed_free() {
|
132 |
return;
|
133 |
}
|
134 |
echo '<div class="error">';
|
135 |
+
echo '<p>It looks like you are using the free version of the plugin (<b>' . $this->nice_name_from_file( $this->mainfile ) . '</b>) but a license for the Pro version was also found. The Pro version might have been replaced by the Free version during an update (might be caused by a temporarily issue). If it is the case, <b>please download it again</b> from the <a target="_blank" href="https://store.meowapps.com">Meow Store</a>. If you wish to continue using the free version and clear this message, click on this button.';
|
136 |
echo '<p>
|
137 |
<form method="post" action="">
|
138 |
<input type="hidden" name="' . $this->prefix . '_reset_sub" value="true">
|
148 |
}
|
149 |
|
150 |
function display_title( $title = "Meow Apps",
|
151 |
+
$author = "By <a style='text-decoration: none;' href='https://meowapps.com' target='_blank'>Jordy Meow</a>" ) {
|
152 |
if ( !empty( $this->prefix ) )
|
153 |
$title = apply_filters( $this->prefix . '_plugin_title', $title );
|
154 |
if ( $this->display_ads() ) {
|
191 |
add_settings_field( 'meowapps_hide_meowapps', "Main Menu",
|
192 |
array( $this, 'meowapps_hide_dashboard_callback' ),
|
193 |
'meowapps_common_settings-menu', 'meowapps_common_settings' );
|
194 |
+
add_settings_field( 'meowapps_force_sslverify', "SSL Verify",
|
195 |
+
array( $this, 'meowapps_force_sslverify_callback' ),
|
196 |
+
'meowapps_common_settings-menu', 'meowapps_common_settings' );
|
197 |
add_settings_field( 'meowapps_hide_ads', "Ads",
|
198 |
array( $this, 'meowapps_hide_ads_callback' ),
|
199 |
'meowapps_common_settings-menu', 'meowapps_common_settings' );
|
200 |
+
register_setting( 'meowapps_common_settings', 'force_sslverify' );
|
201 |
register_setting( 'meowapps_common_settings', 'meowapps_hide_meowapps' );
|
202 |
register_setting( 'meowapps_common_settings', 'meowapps_hide_ads' );
|
203 |
}
|
206 |
$value = get_option( 'meowapps_hide_ads', null );
|
207 |
$html = '<input type="checkbox" id="meowapps_hide_ads" name="meowapps_hide_ads" value="1" ' .
|
208 |
checked( 1, get_option( 'meowapps_hide_ads' ), false ) . '/>';
|
209 |
+
$html .= __( '<label>Hide</label><br /><small>Doesn\'t display the ads.</small>', 'meowapps' );
|
210 |
echo $html;
|
211 |
}
|
212 |
|
214 |
$value = get_option( 'meowapps_hide_meowapps', null );
|
215 |
$html = '<input type="checkbox" id="meowapps_hide_meowapps" name="meowapps_hide_meowapps" value="1" ' .
|
216 |
checked( 1, get_option( 'meowapps_hide_meowapps' ), false ) . '/>';
|
217 |
+
$html .= __( '<label>Hide <b>Meow Apps</b> Menu</label><br /><small>Hide Meow Apps menu and all its components, for a cleaner admin. This option will be reset if a new Meow Apps plugin is installed. <b>Once activated, an option will be added in your General settings to display it again.</b></small>', 'meowapps' );
|
218 |
+
echo $html;
|
219 |
+
}
|
220 |
+
|
221 |
+
function meowapps_force_sslverify_callback() {
|
222 |
+
$value = get_option( 'force_sslverify', null );
|
223 |
+
$html = '<input type="checkbox" id="force_sslverify" name="force_sslverify" value="1" ' .
|
224 |
+
checked( 1, get_option( 'force_sslverify' ), false ) . '/>';
|
225 |
+
$html .= __( '<label>Force</label><br /><small>Updates and licenses checks are usually made without checking SSL certificates and it is actually fine this way. But if you are intransigent when it comes to SSL matters, this option will force it.</small>', 'meowapps' );
|
226 |
echo $html;
|
227 |
}
|
228 |
|
233 |
$html .= '<div class="inside">';
|
234 |
echo $html;
|
235 |
$html = apply_filters( $this->prefix . '_meowapps_license_input', ( 'More information about the Pro version here:
|
236 |
+
<a target="_blank" href="' . $url . '">' . $url . '</a>. If you actually bought the Pro version already, please remove the current plugin and download the Pro version from your account at the <a target="_blank" href="https://store.meowapps.com/account/downloads/">Meow Apps Store</a>.' ), $url );
|
237 |
$html .= '</div>';
|
238 |
$html .= '</div>';
|
239 |
echo $html;
|
core.php
CHANGED
@@ -87,13 +87,13 @@ class Meow_WR2X_Core {
|
|
87 |
return true;
|
88 |
}
|
89 |
|
90 |
-
function picture_buffer_start
|
91 |
ob_start( array( $this, "picture_rewrite" ) );
|
92 |
$this->log( "* HTML REWRITE FOR PICTUREFILL" );
|
93 |
}
|
94 |
|
95 |
-
function picture_buffer_end
|
96 |
-
ob_end_flush();
|
97 |
}
|
98 |
|
99 |
// Replace the IMG tags by PICTURE tags with SRCSET
|
@@ -232,7 +232,7 @@ class Meow_WR2X_Core {
|
|
232 |
}
|
233 |
|
234 |
function buffer_end () {
|
235 |
-
ob_end_flush();
|
236 |
}
|
237 |
|
238 |
// Replace the images by retina images (if available)
|
87 |
return true;
|
88 |
}
|
89 |
|
90 |
+
function picture_buffer_start() {
|
91 |
ob_start( array( $this, "picture_rewrite" ) );
|
92 |
$this->log( "* HTML REWRITE FOR PICTUREFILL" );
|
93 |
}
|
94 |
|
95 |
+
function picture_buffer_end() {
|
96 |
+
@ob_end_flush();
|
97 |
}
|
98 |
|
99 |
// Replace the IMG tags by PICTURE tags with SRCSET
|
232 |
}
|
233 |
|
234 |
function buffer_end () {
|
235 |
+
@ob_end_flush();
|
236 |
}
|
237 |
|
238 |
// Replace the images by retina images (if available)
|
dashboard.php
CHANGED
@@ -7,6 +7,12 @@ class Meow_WR2X_Dashboard {
|
|
7 |
public function __construct( $core ) {
|
8 |
$this->core = $core;
|
9 |
add_action( 'admin_menu', array( $this, 'admin_menu_dashboard' ) );
|
|
|
|
|
|
|
|
|
|
|
|
|
10 |
}
|
11 |
|
12 |
function admin_menu_dashboard () {
|
@@ -263,26 +269,31 @@ class Meow_WR2X_Dashboard {
|
|
263 |
if ( $view != 'issues' ) {
|
264 |
$this->core->update_issue_status( $post->ID, $issues, $info );
|
265 |
}
|
266 |
-
|
267 |
-
|
268 |
-
$original_height = $meta['height'];
|
269 |
-
}
|
270 |
|
271 |
$attachmentsrc = wp_get_attachment_image_src( $post->ID, 'thumbnail' );
|
272 |
echo "<tr class='wr2x-file-row' postId='" . $post->ID . "'>";
|
273 |
-
|
274 |
-
|
275 |
-
"<
|
276 |
-
|
277 |
-
|
278 |
-
|
279 |
-
echo "
|
280 |
-
|
281 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
282 |
|
283 |
// Media Sizes Retina-ized
|
284 |
echo '<td id="wr2x-info-' . $post->ID . '" style="padding-top: 10px;" class="wr2x-info">';
|
285 |
-
|
|
|
286 |
echo "</td>";
|
287 |
|
288 |
if ( $this->core->admin->is_registered() ) {
|
7 |
public function __construct( $core ) {
|
8 |
$this->core = $core;
|
9 |
add_action( 'admin_menu', array( $this, 'admin_menu_dashboard' ) );
|
10 |
+
add_filter( 'updraftplus_com_link', array( $this, 'updraftplus_com_link' ) );
|
11 |
+
}
|
12 |
+
|
13 |
+
function updraftplus_com_link( $url ) {
|
14 |
+
$url = $url . "?afref=460";
|
15 |
+
return $url;
|
16 |
}
|
17 |
|
18 |
function admin_menu_dashboard () {
|
269 |
if ( $view != 'issues' ) {
|
270 |
$this->core->update_issue_status( $post->ID, $issues, $info );
|
271 |
}
|
272 |
+
$original_width = ( isset( $meta ) && isset( $meta['width'] ) ) ? $meta['width'] : null;
|
273 |
+
$original_height = ( isset( $meta ) && isset( $meta['height'] ) ) ? $meta['height'] : null;
|
|
|
|
|
274 |
|
275 |
$attachmentsrc = wp_get_attachment_image_src( $post->ID, 'thumbnail' );
|
276 |
echo "<tr class='wr2x-file-row' postId='" . $post->ID . "'>";
|
277 |
+
|
278 |
+
if ( !$original_width || !$original_height ) {
|
279 |
+
echo "<td colspan='2' style='padding: 15px;'>The metadata for the <a href='media.php?attachment_id={$post->ID}&action=edit'>Media #{$post->ID}</a> is broken. You can try <b>Generate</b> for this media (in the Media Library), <b>Bulk Generate</b>, or a <b>Full-Size Replace</b>.</td>";
|
280 |
+
}
|
281 |
+
else {
|
282 |
+
echo "<td class='wr2x-image wr2x-info-thumbnail'><img src='" . $attachmentsrc[0] . "' /></td>";
|
283 |
+
echo "<td class='wr2x-title'><a href='media.php?attachment_id=" . $post->ID . "&action=edit'>" . ( $post->post_title ? $post->post_title : '<i>Untitled</i>' ) . '</a><br />' .
|
284 |
+
"<span class='resolution'>Full-Size: <span class='" . ( $original_width < $max_width ? "red" : "" ) . "'>" . $original_width . "</span>×<span class='" . ( $original_height < $max_height ? "red" : "" ) . "'>" . $original_height . "</span></span>";
|
285 |
+
echo "<div class='actions'>";
|
286 |
+
echo "<a style='position: relative;' onclick='wr2x_generate(" . $post->ID . ", true)' id='wr2x_generate_button_" . $post->ID . "' class='wr2x-button'>" . __( "GENERATE", 'wp-retina-2x' ) . "</a>";
|
287 |
+
if ( !$this->core->is_ignore( $post->ID ) )
|
288 |
+
echo " <a href='?page=wp-retina-2x&view=" . $view . "&paged=" . $paged . "&ignore=" . $post->ID . "' id='wr2x_generate_button_" . $post->ID . "' class='wr2x-button wr2x-button-ignore'>" . __( "IGNORE", 'wp-retina-2x' ) . "</a>";
|
289 |
+
echo " <a style='position: relative;' class='wr2x-button wr2x-button-view'>" . __( "DETAILS", 'wp-retina-2x' ) . "</a>";
|
290 |
+
echo "</div></td>";
|
291 |
+
}
|
292 |
|
293 |
// Media Sizes Retina-ized
|
294 |
echo '<td id="wr2x-info-' . $post->ID . '" style="padding-top: 10px;" class="wr2x-info">';
|
295 |
+
if ( $original_width && $original_height )
|
296 |
+
echo $this->core->html_get_basic_retina_info( $post, $info );
|
297 |
echo "</td>";
|
298 |
|
299 |
if ( $this->core->admin->is_registered() ) {
|
js/lazysizes.min.js
CHANGED
@@ -1,2 +1,2 @@
|
|
1 |
-
/*! lazysizes -
|
2 |
-
!function(a,b){var c=b(a,a.document);a.lazySizes=c,"object"==typeof module&&module.exports&&(module.exports=c)}(window,function(a,b){"use strict";if(b.getElementsByClassName){var c,d=b.documentElement,
|
1 |
+
/*! lazysizes - v4.0.1 */
|
2 |
+
!function(a,b){var c=b(a,a.document);a.lazySizes=c,"object"==typeof module&&module.exports&&(module.exports=c)}(window,function(a,b){"use strict";if(b.getElementsByClassName){var c,d,e=b.documentElement,f=a.Date,g=a.HTMLPictureElement,h="addEventListener",i="getAttribute",j=a[h],k=a.setTimeout,l=a.requestAnimationFrame||k,m=a.requestIdleCallback,n=/^picture$/i,o=["load","error","lazyincluded","_lazyloaded"],p={},q=Array.prototype.forEach,r=function(a,b){return p[b]||(p[b]=new RegExp("(\\s|^)"+b+"(\\s|$)")),p[b].test(a[i]("class")||"")&&p[b]},s=function(a,b){r(a,b)||a.setAttribute("class",(a[i]("class")||"").trim()+" "+b)},t=function(a,b){var c;(c=r(a,b))&&a.setAttribute("class",(a[i]("class")||"").replace(c," "))},u=function(a,b,c){var d=c?h:"removeEventListener";c&&u(a,b),o.forEach(function(c){a[d](c,b)})},v=function(a,d,e,f,g){var h=b.createEvent("CustomEvent");return e||(e={}),e.instance=c,h.initCustomEvent(d,!f,!g,e),a.dispatchEvent(h),h},w=function(b,c){var e;!g&&(e=a.picturefill||d.pf)?e({reevaluate:!0,elements:[b]}):c&&c.src&&(b.src=c.src)},x=function(a,b){return(getComputedStyle(a,null)||{})[b]},y=function(a,b,c){for(c=c||a.offsetWidth;c<d.minSize&&b&&!a._lazysizesWidth;)c=b.offsetWidth,b=b.parentNode;return c},z=function(){var a,c,d=[],e=[],f=d,g=function(){var b=f;for(f=d.length?e:d,a=!0,c=!1;b.length;)b.shift()();a=!1},h=function(d,e){a&&!e?d.apply(this,arguments):(f.push(d),c||(c=!0,(b.hidden?k:l)(g)))};return h._lsFlush=g,h}(),A=function(a,b){return b?function(){z(a)}:function(){var b=this,c=arguments;z(function(){a.apply(b,c)})}},B=function(a){var b,c=0,e=125,g=d.ricTimeout,h=function(){b=!1,c=f.now(),a()},i=m&&d.ricTimeout?function(){m(h,{timeout:g}),g!==d.ricTimeout&&(g=d.ricTimeout)}:A(function(){k(h)},!0);return function(a){var d;(a=a===!0)&&(g=33),b||(b=!0,d=e-(f.now()-c),0>d&&(d=0),a||9>d&&m?i():k(i,d))}},C=function(a){var b,c,d=99,e=function(){b=null,a()},g=function(){var a=f.now()-c;d>a?k(g,d-a):(m||e)(e)};return function(){c=f.now(),b||(b=k(g,d))}};!function(){var b,c={lazyClass:"lazyload",loadedClass:"lazyloaded",loadingClass:"lazyloading",preloadClass:"lazypreload",errorClass:"lazyerror",autosizesClass:"lazyautosizes",srcAttr:"data-src",srcsetAttr:"data-srcset",sizesAttr:"data-sizes",minSize:40,customMedia:{},init:!0,expFactor:1.5,hFac:.8,loadMode:2,loadHidden:!0,ricTimeout:300};d=a.lazySizesConfig||a.lazysizesConfig||{};for(b in c)b in d||(d[b]=c[b]);a.lazySizesConfig=d,k(function(){d.init&&F()})}();var D=function(){var g,l,m,o,p,y,D,F,G,H,I,J,K,L,M=/^img$/i,N=/^iframe$/i,O="onscroll"in a&&!/glebot/.test(navigator.userAgent),P=0,Q=0,R=0,S=-1,T=function(a){R--,a&&a.target&&u(a.target,T),(!a||0>R||!a.target)&&(R=0)},U=function(a,c){var d,f=a,g="hidden"==x(b.body,"visibility")||"hidden"!=x(a,"visibility");for(F-=c,I+=c,G-=c,H+=c;g&&(f=f.offsetParent)&&f!=b.body&&f!=e;)g=(x(f,"opacity")||1)>0,g&&"visible"!=x(f,"overflow")&&(d=f.getBoundingClientRect(),g=H>d.left&&G<d.right&&I>d.top-1&&F<d.bottom+1);return g},V=function(){var a,f,h,j,k,m,n,p,q,r=c.elements;if((o=d.loadMode)&&8>R&&(a=r.length)){f=0,S++,null==K&&("expand"in d||(d.expand=e.clientHeight>500&&e.clientWidth>500?500:370),J=d.expand,K=J*d.expFactor),K>Q&&1>R&&S>2&&o>2&&!b.hidden?(Q=K,S=0):Q=o>1&&S>1&&6>R?J:P;for(;a>f;f++)if(r[f]&&!r[f]._lazyRace)if(O)if((p=r[f][i]("data-expand"))&&(m=1*p)||(m=Q),q!==m&&(y=innerWidth+m*L,D=innerHeight+m,n=-1*m,q=m),h=r[f].getBoundingClientRect(),(I=h.bottom)>=n&&(F=h.top)<=D&&(H=h.right)>=n*L&&(G=h.left)<=y&&(I||H||G||F)&&(d.loadHidden||"hidden"!=x(r[f],"visibility"))&&(l&&3>R&&!p&&(3>o||4>S)||U(r[f],m))){if(ba(r[f]),k=!0,R>9)break}else!k&&l&&!j&&4>R&&4>S&&o>2&&(g[0]||d.preloadAfterLoad)&&(g[0]||!p&&(I||H||G||F||"auto"!=r[f][i](d.sizesAttr)))&&(j=g[0]||r[f]);else ba(r[f]);j&&!k&&ba(j)}},W=B(V),X=function(a){s(a.target,d.loadedClass),t(a.target,d.loadingClass),u(a.target,Z),v(a.target,"lazyloaded")},Y=A(X),Z=function(a){Y({target:a.target})},$=function(a,b){try{a.contentWindow.location.replace(b)}catch(c){a.src=b}},_=function(a){var b,c=a[i](d.srcsetAttr);(b=d.customMedia[a[i]("data-media")||a[i]("media")])&&a.setAttribute("media",b),c&&a.setAttribute("srcset",c)},aa=A(function(a,b,c,e,f){var g,h,j,l,o,p;(o=v(a,"lazybeforeunveil",b)).defaultPrevented||(e&&(c?s(a,d.autosizesClass):a.setAttribute("sizes",e)),h=a[i](d.srcsetAttr),g=a[i](d.srcAttr),f&&(j=a.parentNode,l=j&&n.test(j.nodeName||"")),p=b.firesLoad||"src"in a&&(h||g||l),o={target:a},p&&(u(a,T,!0),clearTimeout(m),m=k(T,2500),s(a,d.loadingClass),u(a,Z,!0)),l&&q.call(j.getElementsByTagName("source"),_),h?a.setAttribute("srcset",h):g&&!l&&(N.test(a.nodeName)?$(a,g):a.src=g),f&&(h||l)&&w(a,{src:g})),a._lazyRace&&delete a._lazyRace,t(a,d.lazyClass),z(function(){(!p||a.complete&&a.naturalWidth>1)&&(p?T(o):R--,X(o))},!0)}),ba=function(a){var b,c=M.test(a.nodeName),e=c&&(a[i](d.sizesAttr)||a[i]("sizes")),f="auto"==e;(!f&&l||!c||!a[i]("src")&&!a.srcset||a.complete||r(a,d.errorClass)||!r(a,d.lazyClass))&&(b=v(a,"lazyunveilread").detail,f&&E.updateElem(a,!0,a.offsetWidth),a._lazyRace=!0,R++,aa(a,b,f,e,c))},ca=function(){if(!l){if(f.now()-p<999)return void k(ca,999);var a=C(function(){d.loadMode=3,W()});l=!0,d.loadMode=3,W(),j("scroll",function(){3==d.loadMode&&(d.loadMode=2),a()},!0)}};return{_:function(){p=f.now(),c.elements=b.getElementsByClassName(d.lazyClass),g=b.getElementsByClassName(d.lazyClass+" "+d.preloadClass),L=d.hFac,j("scroll",W,!0),j("resize",W,!0),a.MutationObserver?new MutationObserver(W).observe(e,{childList:!0,subtree:!0,attributes:!0}):(e[h]("DOMNodeInserted",W,!0),e[h]("DOMAttrModified",W,!0),setInterval(W,999)),j("hashchange",W,!0),["focus","mouseover","click","load","transitionend","animationend","webkitAnimationEnd"].forEach(function(a){b[h](a,W,!0)}),/d$|^c/.test(b.readyState)?ca():(j("load",ca),b[h]("DOMContentLoaded",W),k(ca,2e4)),c.elements.length?(V(),z._lsFlush()):W()},checkElems:W,unveil:ba}}(),E=function(){var a,c=A(function(a,b,c,d){var e,f,g;if(a._lazysizesWidth=d,d+="px",a.setAttribute("sizes",d),n.test(b.nodeName||""))for(e=b.getElementsByTagName("source"),f=0,g=e.length;g>f;f++)e[f].setAttribute("sizes",d);c.detail.dataAttr||w(a,c.detail)}),e=function(a,b,d){var e,f=a.parentNode;f&&(d=y(a,f,d),e=v(a,"lazybeforesizes",{width:d,dataAttr:!!b}),e.defaultPrevented||(d=e.detail.width,d&&d!==a._lazysizesWidth&&c(a,f,e,d)))},f=function(){var b,c=a.length;if(c)for(b=0;c>b;b++)e(a[b])},g=C(f);return{_:function(){a=b.getElementsByClassName(d.autosizesClass),j("resize",g)},checkElems:g,updateElem:e}}(),F=function(){F.i||(F.i=!0,E._(),D._())};return c={cfg:d,autoSizer:E,loader:D,init:F,uP:w,aC:s,rC:t,hC:r,fire:v,gW:y,rAF:z}}});
|
readme.txt
CHANGED
@@ -2,8 +2,8 @@
|
|
2 |
Contributors: TigrouMeow
|
3 |
Tags: retina, images, image, responsive, lazysizes, lazy, attachment, media, files, iphone, ipad, high-dpi
|
4 |
Requires at least: 3.5
|
5 |
-
Tested up to: 4.
|
6 |
-
Stable tag: 5.
|
7 |
|
8 |
Make your website look beautiful and crisp on modern displays by creating and displaying retina images. WP 4.4+ is also supported and enhanced.
|
9 |
|
@@ -33,6 +33,13 @@ More information and tutorial available one http://meowapps.com/wp-retina-2x/.
|
|
33 |
|
34 |
== Changelog ==
|
35 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
36 |
= 5.1.4 =
|
37 |
* Add: wr2x_retina_extension, wr2x_delete_attachment, wr2x_get_pathinfo_from_image_src, wr2x_picture_rewrite in the API.
|
38 |
|
2 |
Contributors: TigrouMeow
|
3 |
Tags: retina, images, image, responsive, lazysizes, lazy, attachment, media, files, iphone, ipad, high-dpi
|
4 |
Requires at least: 3.5
|
5 |
+
Tested up to: 4.9
|
6 |
+
Stable tag: 5.2.0
|
7 |
|
8 |
Make your website look beautiful and crisp on modern displays by creating and displaying retina images. WP 4.4+ is also supported and enhanced.
|
9 |
|
33 |
|
34 |
== Changelog ==
|
35 |
|
36 |
+
= 5.2.0 =
|
37 |
+
* Fix: When metadata is broken, displays a message.
|
38 |
+
* Fix: A few icons weren't displayed nicely.
|
39 |
+
* Fix: When metadata is broken, displays a message.
|
40 |
+
* Update: From Lazysizes 3.0 to 4.0.1.
|
41 |
+
* Add: Option for forcing SSL Verify.
|
42 |
+
|
43 |
= 5.1.4 =
|
44 |
* Add: wr2x_retina_extension, wr2x_delete_attachment, wr2x_get_pathinfo_from_image_src, wr2x_picture_rewrite in the API.
|
45 |
|
wp-retina-2x.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
Plugin Name: WP Retina 2x
|
4 |
Plugin URI: http://meowapps.com
|
5 |
Description: Make your website look beautiful and crisp on modern displays by creating + displaying retina images.
|
6 |
-
Version: 5.
|
7 |
Author: Jordy Meow
|
8 |
Author URI: http://meowapps.com
|
9 |
Text Domain: wp-retina-2x
|
@@ -14,17 +14,25 @@ http://www.opensource.org/licenses/mit-license.php
|
|
14 |
http://www.gnu.org/licenses/gpl.html
|
15 |
|
16 |
Originally developed for two of my websites:
|
17 |
-
- Jordy Meow (http://
|
18 |
-
- Haikyo (http://
|
19 |
*/
|
20 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
21 |
global $wr2x_picturefill, $wr2x_retinajs, $wr2x_lazysizes,
|
22 |
$wr2x_retina_image, $wr2x_core;
|
23 |
|
24 |
-
$wr2x_version = '5.
|
25 |
$wr2x_retinajs = '2.0.0';
|
26 |
$wr2x_picturefill = '3.0.2';
|
27 |
-
$wr2x_lazysizes = '
|
28 |
$wr2x_retina_image = '1.7.2';
|
29 |
|
30 |
// Admin
|
3 |
Plugin Name: WP Retina 2x
|
4 |
Plugin URI: http://meowapps.com
|
5 |
Description: Make your website look beautiful and crisp on modern displays by creating + displaying retina images.
|
6 |
+
Version: 5.2.0
|
7 |
Author: Jordy Meow
|
8 |
Author URI: http://meowapps.com
|
9 |
Text Domain: wp-retina-2x
|
14 |
http://www.gnu.org/licenses/gpl.html
|
15 |
|
16 |
Originally developed for two of my websites:
|
17 |
+
- Jordy Meow (http://offbeatjapan.org)
|
18 |
+
- Haikyo (http://haikyo.org)
|
19 |
*/
|
20 |
|
21 |
+
if ( class_exists( 'Meow_WR2X_Core' ) ) {
|
22 |
+
function mfrh_admin_notices() {
|
23 |
+
echo '<div class="error"><p>Thanks for installing the Pro version of WP Retina 2x :) However, the free version is still enabled. Please disable or uninstall it.</p></div>';
|
24 |
+
}
|
25 |
+
add_action( 'admin_notices', 'mfrh_admin_notices' );
|
26 |
+
return;
|
27 |
+
}
|
28 |
+
|
29 |
global $wr2x_picturefill, $wr2x_retinajs, $wr2x_lazysizes,
|
30 |
$wr2x_retina_image, $wr2x_core;
|
31 |
|
32 |
+
$wr2x_version = '5.2.0';
|
33 |
$wr2x_retinajs = '2.0.0';
|
34 |
$wr2x_picturefill = '3.0.2';
|
35 |
+
$wr2x_lazysizes = '4.0.1';
|
36 |
$wr2x_retina_image = '1.7.2';
|
37 |
|
38 |
// Admin
|
wr2x_admin.css
CHANGED
@@ -9,13 +9,13 @@
|
|
9 |
}
|
10 |
|
11 |
.wr2x-hover-drop .wr2x-title {
|
12 |
-
background: url('
|
13 |
background-position: 5px 4px;
|
14 |
background-repeat: no-repeat;
|
15 |
}
|
16 |
|
17 |
.wr2x-loading-file .wr2x-title {
|
18 |
-
background: url('
|
19 |
background-position: 5px 1px;
|
20 |
background-repeat: no-repeat;
|
21 |
}
|
@@ -127,7 +127,7 @@
|
|
127 |
|
128 |
.wr2x-loading-file .wr2x-dragdrop {
|
129 |
background-color: rgb(243, 243, 243);
|
130 |
-
background-image: url('
|
131 |
background-size: 48px 48px;
|
132 |
background-position-y: 4px;
|
133 |
background-repeat: no-repeat;
|
9 |
}
|
10 |
|
11 |
.wr2x-hover-drop .wr2x-title {
|
12 |
+
background: url('replace.png');
|
13 |
background-position: 5px 4px;
|
14 |
background-repeat: no-repeat;
|
15 |
}
|
16 |
|
17 |
.wr2x-loading-file .wr2x-title {
|
18 |
+
background: url('loading.gif');
|
19 |
background-position: 5px 1px;
|
20 |
background-repeat: no-repeat;
|
21 |
}
|
127 |
|
128 |
.wr2x-loading-file .wr2x-dragdrop {
|
129 |
background-color: rgb(243, 243, 243);
|
130 |
+
background-image: url('loading.gif');
|
131 |
background-size: 48px 48px;
|
132 |
background-position-y: 4px;
|
133 |
background-repeat: no-repeat;
|
wr2x_admin.php
CHANGED
@@ -24,7 +24,7 @@ class Meow_WR2X_Admin extends MeowApps_Admin {
|
|
24 |
}
|
25 |
if ( class_exists( 'Jetpack' ) && Jetpack::is_module_active( 'photon' ) ) {
|
26 |
echo "<div class='error' style='margin-top: 20px;'><p>";
|
27 |
-
_e( "JetPack's <b>Photon</b> module breaks features built in WP Retina 2x
|
28 |
echo "</p></div>";
|
29 |
}
|
30 |
}
|
24 |
}
|
25 |
if ( class_exists( 'Jetpack' ) && Jetpack::is_module_active( 'photon' ) ) {
|
26 |
echo "<div class='error' style='margin-top: 20px;'><p>";
|
27 |
+
_e( "JetPack's <b>Photon</b> module breaks features built in WP Retina 2x (as Photos moves the files away). A common and better alternative to Photon is to use <a href='http://tracking.maxcdn.com/c/97349/3982/378'>MaxCDN</a> (very popular), CloudFlare or Fastly.", 'wp-retina-2x' );
|
28 |
echo "</p></div>";
|
29 |
}
|
30 |
}
|