Skip to content

Commit

Permalink
Merge pull request #40 from 10up/release/4.1.0
Browse files Browse the repository at this point in the history
Release/4.1.0
  • Loading branch information
eugene-manuilov authored Nov 22, 2017
2 parents 1273c96 + f7c3a40 commit be84470
Show file tree
Hide file tree
Showing 25 changed files with 293 additions and 214 deletions.
12 changes: 10 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
4.1.0 / 2017-11
=================
* Added error message when SimpleXML library is not found
* Added ability to enter Cache-Control property
* Renamed plugin to be Microsoft Azure Storage for WordPress
* Fixed trailing slash issue which led to double slashes in URLs
* Fixed minor warnings

4.0.3 / 2017-10
=================
* Fixed uploading issue when year/month based folders are not used
Expand Down Expand Up @@ -196,10 +204,10 @@
* Use the localized object in the Azure plugin JS
* Add the stock WordPress JSHint ruleset
* Enqueue the plugin script before localizing
* Localize the JS for the Windows Azure Storage plugin
* Localize the JS for the Microsoft Azure Storage plugin
* Enqueue the plugin style directly without prior registration
* Updated docs for windows_azure_storage_dialog_scripts
* Add a stylesheet to Windows Azure Storage plugin
* Add a stylesheet to Microsoft Azure Storage plugin
* Enqueue JS and CSS instead of directly printing
* Set constants for use throughout the plugin
* Use absolute URLs for including assets
Expand Down
43 changes: 24 additions & 19 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,30 +1,37 @@
# Windows Azure Storage for WordPress
# Microsoft Azure Storage for WordPress

Use the Windows Azure Storage service to host your website's media files.
Use the Microsoft Azure Storage service to host your website's media files.

**Contributors:** [msopentech](https://profiles.wordpress.org/msopentech), [10up](https://profiles.wordpress.org/10up), [morganestes](https://profiles.wordpress.org/morganestes), [stevegrunwell](https://profiles.wordpress.org/stevegrunwell), [lpawlik](https://profiles.wordpress.org/lpawlik), [rittesh.patel](https://profiles.wordpress.org/rittesh.patel)
**Tags:** [Microsoft](https://wordpress.org/plugins/tags/microsoft), [Microsoft Open Technologies](https://wordpress.org/plugins/tags/microsoft-open-technologies), [Windows Azure](https://wordpress.org/plugins/tags/windows-azure), [Windows Azure Storage](https://wordpress.org/plugins/tags/windows-azure-storage), [Media Files](https://wordpress.org/plugins/tags/media-files), [Upload](https://wordpress.org/plugins/tags/upload), [CDN](https://wordpress.org/plugins/tags/cdn), [blob storage](https://wordpress.org/plugins/tags/blob-storage)
**Tags:** [Microsoft](https://wordpress.org/plugins/tags/microsoft), [Microsoft Open Technologies](https://wordpress.org/plugins/tags/microsoft-open-technologies), [Microsoft Azure](https://wordpress.org/plugins/tags/windows-azure), [Microsoft Azure Storage](https://wordpress.org/plugins/tags/windows-azure-storage), [Media Files](https://wordpress.org/plugins/tags/media-files), [Upload](https://wordpress.org/plugins/tags/upload), [CDN](https://wordpress.org/plugins/tags/cdn), [blob storage](https://wordpress.org/plugins/tags/blob-storage)
**Requires at least:** 4.0
**Tested up to:** 4.8.2
**Stable tag:** 4.0.3
**Tested up to:** 4.9
**Stable tag:** 4.1.0
**License:** [BSD 2-Clause](http://www.opensource.org/licenses/bsd-license.php)

## Description ##

This WordPress plugin allows you to use Windows Azure Storage Service to host
your media and uploads for your WordPress powered website. Windows Azure Storage is an effective way
This WordPress plugin allows you to use Microsoft Azure Storage Service to host
your media and uploads for your WordPress powered website. Microsoft Azure Storage is an effective way
to infinitely scale storage of your site and leverage Azure's global infrastructure.

For more details on Windows Azure Storage, please visit the <a href="https://azure.microsoft.com/en-us/services/storage/">Microsoft Azure website</a>.
For more details on Microsoft Azure Storage, please visit the <a href="https://azure.microsoft.com/en-us/services/storage/">Microsoft Azure website</a>.

## Installation ##

1. Upload the plugin files to the `/wp-content/plugins/windows-azure-storage` directory, or install the plugin through the WordPress plugins screen directly.
1. Activate the plugin through the 'Plugins' screen in WordPress.
1. Use the Settings->Windows Azure screen to configure the plugin.
1. Use the Settings->Microsoft Azure screen to configure the plugin.

## Changelog ##

### 4.1.0 ###
* Added error message when SimpleXML library is not found
* Added ability to enter Cache-Control property
* Renamed plugin to be Microsoft Azure Storage for WordPress
* Fixed trailing slash issue which led to double slashes in URLs
* Fixed minor warnings

### 4.0.3 ###
* Fixed uploading issue when year/month based folders are not used
* Fixed CNAME issue in the srcset attribute when year/month based folders are not used
Expand Down Expand Up @@ -75,34 +82,34 @@ For more details on Windows Azure Storage, please visit the <a href="https://azu
* Fixed the bug with year and month getting trimmed for file system images.

### 2.0 ###
* Updated to use Windows Azure SDK for PHP from https://github.com/WindowsAzure/azure-sdk-for-php and fixed to work with WordPress 3.4.1
* Updated to use Microsoft Azure SDK for PHP from https://github.com/WindowsAzure/azure-sdk-for-php and fixed to work with WordPress 3.4.1

### 1.9 ###
* Fixed case sensitivity error in file names on Linux

### 1.8 ###
* Bug fixed in generating blob storage URL when using Windows Azure Storage emulator
* Bug fixed in generating blob storage URL when using Microsoft Azure Storage emulator

### 1.7 ###
* Added support to upload video files to blob storage

### 1.5 ###
* Included Windows Azure SDK for PHP v4.1.0 with the plugin. Now setting mime-type for uploaded file to blob storage.
* Included Microsoft Azure SDK for PHP v4.1.0 with the plugin. Now setting mime-type for uploaded file to blob storage.

### 1.4 ###
* Included Windows Azure SDK for PHP v4.0.2 with the plugin.
* Included Microsoft Azure SDK for PHP v4.0.2 with the plugin.

### 1.3 ###
* Included Windows Azure SDK for PHP v4.0.1 with the plugin, so no need to install the SDK separetely. Also fixed thumbnail handling issue while uploading files when some specific theme is enabled.
* Included Microsoft Azure SDK for PHP v4.0.1 with the plugin, so no need to install the SDK separetely. Also fixed thumbnail handling issue while uploading files when some specific theme is enabled.

### 1.2 ###
* This release is compatible with Windows Azure SDK for PHP v3.0.0. It also fixes issue with deleting media files when thumbnails are associated.
* This release is compatible with Microsoft Azure SDK for PHP v3.0.0. It also fixes issue with deleting media files when thumbnails are associated.

### 1.1 ###
* This release is compatible with Windows Azure SDK for PHP v2.1.0 and WordPress 3.1
* This release is compatible with Microsoft Azure SDK for PHP v2.1.0 and WordPress 3.1

### 1.0 ###
* First release of Windows Azure Storage plugin for WordPress
* First release of Microsoft Azure Storage plugin for WordPress


## Upgrade Notice ##
Expand All @@ -127,5 +134,3 @@ Images uploaded to the Azure Storage service will not automatically receive resp
Images added through the WordPress Media Loader *should* get automatically converted to responsive
images when inserted into a post or page.
We are investigating options for full support of responsive images in the plugin.


2 changes: 1 addition & 1 deletion bin/wp-cli.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php
/**
* Windows Azure Storage command line client.
* Microsoft Azure Storage command line client.
*
* Version: 4.0.0
*
Expand Down
4 changes: 2 additions & 2 deletions css/windows-azure-storage.css
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
.wp-media-buttons .windows-azure-storage-media-icon {
display: inline-block;
height: 18px;
width: 20px;
height: 14px;
width: 16px;
margin: 0 2px;
padding: 0;
vertical-align: text-top;
Expand Down
2 changes: 1 addition & 1 deletion css/windows-azure-storage.min.css

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

Binary file added images/Azure 2017.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed images/WindowsAzure.jpg
Binary file not shown.
Binary file added images/azure-icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion includes/class-windows-azure-config-provider.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php

/**
* Windows Azure Storage config provider.
* Microsoft Azure Storage config provider.
*
* Version: 4.0.0
*
Expand Down
2 changes: 1 addition & 1 deletion includes/class-windows-azure-file-contents-provider.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php

/**
* Windows Azure Storage file contents provider.
* Microsoft Azure Storage file contents provider.
*
* Version: 4.0.0
*
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php

/**
* Windows Azure Storage REST API client.
* Microsoft Azure Storage REST API client.
*
* Version: 4.0.0
*
Expand Down
2 changes: 1 addition & 1 deletion includes/class-windows-azure-generic-list-response.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php

/**
* Windows Azure Storage REST API list containers response.
* Microsoft Azure Storage REST API list containers response.
*
* Version: 4.0.0
*
Expand Down
16 changes: 15 additions & 1 deletion includes/class-windows-azure-helper.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php

/**
* Windows Azure Storage helper class.
* Microsoft Azure Storage helper class.
*
* Version: 4.0.0
*
Expand Down Expand Up @@ -203,6 +203,17 @@ static public function delete_local_file() {
static public function get_cache_ttl() {
return (int) get_option( 'azure_browse_cache_results', 15 );
}

/**
* Returns cache-control.
*
* @since 4.1.0
*
* @return int Cache-control.
*/
static public function get_cache_control() {
return (int) get_option( 'azure_cache_control', 600 );
}

/**
* Return container ACL.
Expand Down Expand Up @@ -381,8 +392,10 @@ static public function put_uploaded_file_to_blob_storage( $container_name, $blob
$finfo = finfo_open( FILEINFO_MIME_TYPE );
$mime_type = finfo_file( $finfo, $local_path );
finfo_close( $finfo );

$rest_api_client->put_blob_properties( $container_name, $remote_path, array(
Windows_Azure_Rest_Api_Client::API_HEADER_MS_BLOB_CONTENT_TYPE => $mime_type,
Windows_Azure_Rest_Api_Client::API_HEADER_CACHE_CONTROL => sprintf( "max-age=%d, must-revalidate", Windows_Azure_Helper::get_cache_control() ),
) );

return $result;
Expand Down Expand Up @@ -449,6 +462,7 @@ static public function put_media_to_blob_storage( $container_name, $blob_name, $

$rest_api_client->put_blob_properties( $container_name, $blob_name, array(
Windows_Azure_Rest_Api_Client::API_HEADER_MS_BLOB_CONTENT_TYPE => $mime_type,
Windows_Azure_Rest_Api_Client::API_HEADER_CACHE_CONTROL => sprintf( "max-age=%d, must-revalidate", Windows_Azure_Helper::get_cache_control() ),
) );

return $result;
Expand Down
2 changes: 1 addition & 1 deletion includes/class-windows-azure-list-blobs-response.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php

/**
* Windows Azure Storage REST API list blobs response.
* Microsoft Azure Storage REST API list blobs response.
*
* Version: 4.0.0
*
Expand Down
2 changes: 1 addition & 1 deletion includes/class-windows-azure-list-containers-response.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php

/**
* Windows Azure Storage REST API list containers response.
* Microsoft Azure Storage REST API list containers response.
*
* Version: 4.0.0
*
Expand Down
13 changes: 8 additions & 5 deletions includes/class-windows-azure-rest-api-client.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php

/**
* Windows Azure Storage REST API client.
* Microsoft Azure Storage REST API client.
*
* Version: 4.0.0
*
Expand Down Expand Up @@ -1047,20 +1047,23 @@ protected function _send_request( $method, array $query_args = array(), array $h
// Remove this filter once request is done.
remove_filter( 'http_request_args', array( $this, 'inject_authorization_header' ), PHP_INT_MAX );

$body = wp_remote_retrieve_body( $result );

if ( is_wp_error( $result ) ) {
return $result;
}

$response_code = (int) wp_remote_retrieve_response_code( $result );

if ( $response_code < 200 || $response_code > 299 ) {
return new WP_Error( $response_code, wp_remote_retrieve_response_message( $result ) );
}

$xml_structure = simplexml_load_string( $body );
$body = wp_remote_retrieve_body( $result );
if ( ! empty( $body ) ) {
if ( ! function_exists( 'simplexml_load_string' ) ) {
$message = __( "SimpleXML library hasn't been found. Please, check your PHP config.", 'windows-azure-storage' );
return new WP_Error( 'simplexml', $message );
}

$xml_structure = simplexml_load_string( $body );
return json_decode( json_encode( $xml_structure ), true );
} else {
return $result;
Expand Down
2 changes: 1 addition & 1 deletion includes/class-windows-azure-wp-filesystem-direct.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php

/**
* Windows Azure Storage REST API client.
* Microsoft Azure Storage REST API client.
*
* Version: 4.0.0
*
Expand Down
2 changes: 1 addition & 1 deletion includes/compat.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php
/**
* Compatibility assistance for WordPress and Windows Azure Storage.
* Compatibility assistance for WordPress and Microsoft Azure Storage.
*/

namespace Microsoft\Azure\BlobStorage\Helpers;
Expand Down
Loading

0 comments on commit be84470

Please sign in to comment.