Skip to content

Commit

Permalink
release: fixes
Browse files Browse the repository at this point in the history
* Fix image offloading process regression
  • Loading branch information
selul authored Aug 6, 2024
2 parents 56a72b5 + 71513a6 commit 93b6fbf
Show file tree
Hide file tree
Showing 6 changed files with 23 additions and 21 deletions.
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@
"require": {
"php": ">=7.4",
"codeinwp/themeisle-sdk": "^3.3",
"codeinwp/optimole-sdk": "^1.1",
"codeinwp/optimole-sdk": "^1.2",
"enshrined/svg-sanitize": "^0.18.0"
}
}
24 changes: 12 additions & 12 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion inc/api.php
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ public function get_cache_token( $token = '', $type = '', $api_key = '' ) {
*
* @return array|string|boolean|WP_Error Api data.
*/
private function request( $path, $method = 'GET', $params = [], $extra_headers = [] ) {
public function request( $path, $method = 'GET', $params = [], $extra_headers = [] ) {

$headers = [
'Optml-Site' => get_home_url(),
Expand Down
7 changes: 4 additions & 3 deletions inc/app_replacer.php
Original file line number Diff line number Diff line change
Expand Up @@ -404,9 +404,10 @@ public function set_properties() {
}
Optml_Config::init(
[
'key' => $service_data['cdn_key'],
'secret' => $service_data['cdn_secret'],
'domain' => $domain,
'key' => $service_data['cdn_key'],
'secret' => $service_data['cdn_secret'],
'domain' => $domain,
'api_key' => $this->settings->get( 'api_key' ),
]
);

Expand Down
7 changes: 4 additions & 3 deletions inc/config.php
Original file line number Diff line number Diff line change
Expand Up @@ -137,11 +137,12 @@ public static function init( $service_settings = [] ) {
$options['upload_api_url'] = OPTIML_UPLOAD_API_ROOT;
}

if ( isset( $service_settings['cdn_key'], $service_settings['cdn_secret'] ) ) {
if ( isset( $service_settings['key'], $service_settings['secret'], $service_settings['api_key'] ) ) {
$options['upload_api_credentials'] = [
'userKey' => $service_settings['cdn_key'],
'secret' => $service_settings['cdn_secret'],
'userKey' => $service_settings['key'],
'secret' => $service_settings['secret'],
];
$options['dashboard_api_key'] = $service_settings['api_key'];
}

Optimole::init( self::$key, $options );
Expand Down
2 changes: 1 addition & 1 deletion inc/media_offload.php
Original file line number Diff line number Diff line change
Expand Up @@ -1510,7 +1510,7 @@ public function generate_image_meta( $meta, $attachment_id ) {
return $meta;
}

unlink( $local_file );
@unlink( $local_file );

update_post_meta( $attachment_id, self::META_KEYS['offloaded'], 'true' );
update_post_meta( $attachment_id, self::OM_OFFLOADED_FLAG, true );
Expand Down

0 comments on commit 93b6fbf

Please sign in to comment.