Skip to content

Commit 39d1398

Browse files
committed
remove old code replace by optimole sdk
1 parent 01b71a3 commit 39d1398

20 files changed

+74
-1134
lines changed

inc/asset.php

Lines changed: 0 additions & 112 deletions
This file was deleted.

inc/asset_properties/minify.php

Lines changed: 0 additions & 60 deletions
This file was deleted.

inc/compatibilities/envira.php

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
<?php
22

3+
use Optimole\Sdk\Resource\ImageProperty\ResizeTypeProperty;
4+
use Optimole\Sdk\ValueObject\Position;
5+
36
/**
47
* Class Optml_shortcode_ultimate.
58
*
@@ -56,8 +59,8 @@ function revert_src( $image ) {
5659
function check_resize_tag( $old_resize, $tag ) {
5760
if ( preg_match( '/(_c)\.(?:' . implode( '|', array_keys( Optml_Config::$image_extensions ) ) . ')/i', $tag, $match ) ) {
5861
return [
59-
'type' => Optml_Resize::RESIZE_FILL,
60-
'gravity' => Optml_Resize::GRAVITY_CENTER,
62+
'type' => ResizeTypeProperty::FILL,
63+
'gravity' => Position::CENTER,
6164
];
6265
}
6366

inc/compatibilities/shortcode_ultimate.php

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
<?php
22

3+
use Optimole\Sdk\Resource\ImageProperty\ResizeTypeProperty;
4+
use Optimole\Sdk\ValueObject\Position;
5+
36
/**
47
* Class Optml_shortcode_ultimate.
58
*
@@ -71,8 +74,8 @@ function alter_shortcode_output( $output, $tag, $attr ) {
7174
*/
7275
public function change_default_crop() {
7376
return [
74-
'type' => Optml_Resize::RESIZE_FILL,
75-
'gravity' => Optml_Resize::GRAVITY_CENTER,
77+
'type' => ResizeTypeProperty::FILL,
78+
'gravity' => Position::CENTER,
7679
];
7780
}
7881
}

inc/dam.php

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,9 @@
99
* @author Optimole <[email protected]>
1010
*/
1111

12+
use Optimole\Sdk\Resource\ImageProperty\GravityProperty;
13+
use Optimole\Sdk\ValueObject\Position;
14+
1215
/**
1316
* Class Optml_Dam
1417
*/
@@ -741,10 +744,10 @@ public function replace_dam_url_args( $args, $subject ) {
741744
$height = $args['height'];
742745
$crop = (bool) $args['crop'];
743746

744-
$gravity = Optml_Resize::GRAVITY_CENTER;
747+
$gravity = Position::CENTER;
745748

746749
if ( $this->settings->get( 'resize_smart' ) === 'enabled' ) {
747-
$gravity = Optml_Resize::GRAVITY_SMART;
750+
$gravity = GravityProperty::SMART;
748751
}
749752

750753
if ( $width === 0 ) {

0 commit comments

Comments
 (0)