PluginProbe
Optimole – Optimize Images | Convert WebP & AVIF | CDN & Lazy Load | Image Optimization / 4.2.15
Optimole – Optimize Images | Convert WebP & AVIF | CDN & Lazy Load | Image Optimization v4.2.15
4.2.15 4.2.14 4.2.13 4.2.12 4.2.11 4.2.10 4.2.9 4.2.8 4.2.7 4.2.6 4.2.5 2.5.5 2.5.6 2.5.7 3.0.0 3.0.1 3.1.0 3.1.1 3.1.2 3.1.3 3.10.0 3.11.0 3.11.1 3.11.2 3.11.3 All 136 releases
← All changes | inc/compatibilities/envira.php +10 -7 3.11.3 → 4.2.15 View file →
@@ -1,6 +1,9 @@
1 1 <?php
2 2
3 +use Optimole\Sdk\Resource\ImageProperty\ResizeTypeProperty;
4 +use Optimole\Sdk\ValueObject\Position;
5 +
3 6 /**
4 7 * Class Optml_shortcode_ultimate.
5 8 *
6 9 * @reason The gallery output contains a different src attribute used for lazyload
@@ -12,10 +15,10 @@
12 15 * Should we load the integration logic.
13 16 *
14 17 * @return bool Should we load.
15 18 */
16 - function should_load() {
17 - include_once( ABSPATH . 'wp-admin/includes/plugin.php' );
19 + public function should_load() {
20 + include_once ABSPATH . 'wp-admin/includes/plugin.php';
18 21
19 22 return ( is_plugin_active( 'envira-gallery-lite/envira-gallery-lite.php' ) || is_plugin_active( 'envira-gallery/envira-gallery.php' ) );
20 23 }
21 24
@@ -35,9 +38,9 @@
35 38 * @param string $image Image url.
36 39 *
37 40 * @return string Original url.
38 41 */
39 - function revert_src( $image ) {
42 + public function revert_src( $image ) {
40 43 $pos = strpos( $image, '/http' );
41 44 if ( $pos !== false ) {
42 45 return ltrim( substr( $image, $pos ), '/' );
43 46 }
@@ -52,13 +55,13 @@
52 55 * @param string $tag Image tag.
53 56 *
54 57 * @return array Resize conf.
55 58 */
56 - function check_resize_tag( $old_resize, $tag ) {
59 + public function check_resize_tag( $old_resize, $tag ) {
57 60 if ( preg_match( '/(_c)\.(?:' . implode( '|', array_keys( Optml_Config::$image_extensions ) ) . ')/i', $tag, $match ) ) {
58 61 return [
59 - 'type' => Optml_Resize::RESIZE_FILL,
60 - 'gravity' => Optml_Resize::GRAVITY_CENTER,
62 + 'type' => ResizeTypeProperty::FILL,
63 + 'gravity' => Position::CENTER,
61 64 ];
62 65 }
63 66
64 67 return [];
@@ -70,9 +73,9 @@
70 73 * @param array $strings Old strings.
71 74 *
72 75 * @return array New flags.
73 76 */
74 - function add_lazyflag( $strings = [] ) {
77 + public function add_lazyflag( $strings = [] ) {
75 78
76 79 $strings[] = 'envira-gallery-image';
77 80
78 81 return $strings;