Skip to content

Commit

Permalink
* Fix for not activating when installed via Composer
Browse files Browse the repository at this point in the history
* Removed deprecated filters and actions
  • Loading branch information
jawngee committed Oct 9, 2019
1 parent 89846c7 commit c810298
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 54 deletions.
4 changes: 0 additions & 4 deletions classes/Tools/Imgix/ImgixTool.php
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,6 @@ public function setup() {
return $this->renderPDF;
});

do_action_deprecated('ilab_imgix_setup', [], '3.0.0', 'media-cloud/imgix/setup');
do_action('media-cloud/imgix/setup');

if ($this->detectFaces) {
Expand Down Expand Up @@ -332,7 +331,6 @@ public function buildSizedImage($id, $size) {
'fm' => 'jpg'
];

$params = apply_filters_deprecated('ilab-imgix-filter-parameters', [$params, $size, $id, $meta], '3.0.0', 'media-cloud/dynamic-images/filter-parameters');
$params = apply_filters('media-cloud/dynamic-images/filter-parameters', $params, $size, $id, $meta);

$imageFile = (isset($meta['s3'])) ? $meta['s3']['key'] : $meta['file'];
Expand Down Expand Up @@ -452,7 +450,6 @@ public function buildImage($id, $size, $params = null, $skipParams = false, $mer
}

$params = $this->buildImgixParams($params, $mimetype);
$params = apply_filters_deprecated('ilab-imgix-filter-parameters', [$params, $size, $id, $meta], '3.0.0', 'media-cloud/dynamic-images/filter-parameters');
$params = apply_filters('media-cloud/dynamic-images/filter-parameters', $params, $size, $id, $meta);

if(!isset($meta['file'])) {
Expand Down Expand Up @@ -676,7 +673,6 @@ public function buildImage($id, $size, $params = null, $skipParams = false, $mer
}

$params = $this->buildImgixParams($params, $mimetype);
$params = apply_filters_deprecated('ilab-imgix-filter-parameters', [$params, $size, $id, $meta], '3.0.0', 'media-cloud/dynamic-images/filter-parameters');
$params = apply_filters('media-cloud/dynamic-images/filter-parameters', $params, $size, $id, $meta);

$imageFile = (isset($meta['s3'])) ? $meta['s3']['key'] : $meta['file'];
Expand Down
50 changes: 4 additions & 46 deletions classes/Tools/Storage/StorageTool.php
Original file line number Diff line number Diff line change
Expand Up @@ -608,12 +608,6 @@ public function updateAttachmentMetadata(


if ( isset( $data['s3'] ) ) {
$data = apply_filters_deprecated(
'ilab_s3_after_upload',
[ $data, $id ],
'3.0.0',
'media-cloud/storage/after-upload'
);
$data = apply_filters( 'media-cloud/storage/after-upload', $data, $id );
$data = apply_filters( 'media-cloud/vision/process-meta', $data, $id );
}
Expand Down Expand Up @@ -798,13 +792,7 @@ public function handleUpload( $upload, $context = 'upload' )
if ( isset( $_REQUEST["action"] ) && $_REQUEST["action"] == "upload-plugin" ) {
return $upload;
}
$shouldHandle = apply_filters_deprecated(
'ilab_s3_should_handle_upload',
[ true, $upload ],
'3.0.0',
'media-cloud/storage/should-handle-upload'
);
$shouldHandle = apply_filters( 'media-cloud/storage/should-handle-upload', $shouldHandle, $upload );
$shouldHandle = apply_filters( 'media-cloud/storage/should-handle-upload', true, $upload );
if ( !$shouldHandle ) {
return $upload;
}
Expand Down Expand Up @@ -1158,13 +1146,7 @@ public function calculateSrcSet(
$attachment_id
)
{
$canCalculateSrcSet = apply_filters_deprecated(
'ilab_s3_can_calculate_srcset',
[ true ],
'3.0.0',
'media-cloud/storage/can-calculate-srcset'
);
if ( !apply_filters( 'media-cloud/storage/can-calculate-srcset', $canCalculateSrcSet ) ) {
if ( !apply_filters( 'media-cloud/storage/can-calculate-srcset', true ) ) {
return $sources;
}
if ( $this->disableSrcSet ) {
Expand Down Expand Up @@ -1623,13 +1605,7 @@ private function getOffloadS3URL(
*/
public function filterContent( $content )
{
$canFilterContent = apply_filters_deprecated(
'ilab_media_cloud_filter_content',
[ true ],
'3.0.0',
'media-cloud/storage/can-filter-content'
);
if ( !apply_filters( 'media-cloud/storage/can-filter-content', $canFilterContent ) ) {
if ( !apply_filters( 'media-cloud/storage/can-filter-content', true ) ) {
return $content;
}
if ( !preg_match_all( '/<img [^>]+>/', $content, $matches ) ) {
Expand Down Expand Up @@ -1894,13 +1870,7 @@ public function processFile(
$this->deleteFile( $key );
}

$shouldUseCustomPrefix = apply_filters_deprecated(
'ilab_storage_should_use_custom_prefix',
[ true ],
'3.0.0',
'media-cloud/storage/should-use-custom-prefix'
);
$shouldUseCustomPrefix = apply_filters( 'media-cloud/storage/should-use-custom-prefix', $shouldUseCustomPrefix );
$shouldUseCustomPrefix = apply_filters( 'media-cloud/storage/should-use-custom-prefix', true );
$shouldUseCustomPrefix = !empty(StorageSettings::prefixFormat()) && $shouldUseCustomPrefix;

if ( $preserveFilePath == 'replace' ) {
Expand Down Expand Up @@ -3047,12 +3017,6 @@ public function importImageAttachmentFromStorage( $fileInfo, $thumbs = array() )
if ( is_wp_error( $post ) ) {
return false;
}
$meta = apply_filters_deprecated(
'ilab_s3_after_upload',
[ $meta, $post ],
'3.0.0',
'media-cloud/storage/after-upload'
);
$meta = apply_filters( 'media-cloud/storage/after-upload', $meta, $post );
$meta = apply_filters( 'media-cloud/vision/process-meta', $meta, $post );
add_post_meta( $post, '_wp_attached_file', $fileInfo->key() );
Expand Down Expand Up @@ -3273,12 +3237,6 @@ public function importAttachmentFromStorage( $fileInfo, $thumbs = array() )
if ( is_wp_error( $post ) ) {
return false;
}
$meta = apply_filters_deprecated(
'ilab_s3_after_upload',
[ $meta, $post ],
'3.0.0',
'media-cloud/storage/after-upload'
);
$meta = apply_filters( 'media-cloud/storage/after-upload', $meta, $post );
add_post_meta( $post, '_wp_attached_file', $fileInfo->key() );
add_post_meta( $post, '_wp_attachment_metadata', $meta );
Expand Down
6 changes: 3 additions & 3 deletions ilab-media-tools.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
Plugin URI: https://github.com/interfacelab/ilab-media-tools
Description: Automatically upload media to Amazon S3 and integrate with Imgix, a real-time image processing CDN. Boosts site performance and simplifies workflows.
Author: interfacelab
Version: 3.2.1
Version: 3.2.2
Author URI: http://interfacelab.io
*/
// Copyright (c) 2016 Interfacelab LLC. All rights reserved.
Expand Down Expand Up @@ -78,7 +78,7 @@
}


if ( class_exists( '\\ILAB\\MediaCloud\\Tools\\ToolsManager' ) ) {
if ( defined( 'MEDIA_CLOUD_VERSION' ) ) {
deactivate_plugins( plugin_basename( __FILE__ ) );
add_action( 'admin_notices', function () {
?>
Expand All @@ -93,7 +93,7 @@
}

// Version Defines
define( 'MEDIA_CLOUD_VERSION', '3.2.1' );
define( 'MEDIA_CLOUD_VERSION', '3.2.2' );
define( 'MEDIA_CLOUD_INFO_VERSION', '1.0.0' );
// Directory defines
define( 'ILAB_TOOLS_DIR', dirname( __FILE__ ) );
Expand Down
7 changes: 6 additions & 1 deletion readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ Requires at least: 4.4
Tested up to: 5.2.2
License: GPLv3 or later
License URI: http://www.gnu.org/licenses/gpl-3.0.html
Stable tag: 3.2.0
Stable tag: 3.2.2
Requires PHP: 5.6.4

Automatically store media on Amazon S3, Google Cloud Storage, DigitalOcean Spaces + others. Serve CSS/JS assets through CDNs. Integrate with Imgix.
Expand Down Expand Up @@ -109,6 +109,11 @@ No, I'm just one very enthusiastic customer.

== Changelog ==

= 3.2.2 =

* Fix for not activating when installed via Composer
* Removed deprecated filters and actions

= 3.2.1 =

* Fix for task heartbeat
Expand Down

0 comments on commit c810298

Please sign in to comment.