/windows-azure-storage

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

Primary LanguagePHPBSD 2-Clause "Simplified" LicenseBSD-2-Clause

Microsoft Azure Storage for WordPress

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

Support Level Release Version WordPress tested up to version BSD 2-Clause License

Description

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 Microsoft Azure Storage, please visit the Microsoft Azure website.

For more details on configuring a Microsoft Azure Storage account and on using the plugin with the Block Editor or Classic Editor, please visit the user guide.

Requirements

  • PHP 8.0+ (For PHP 7.4 support you need to use 4.3.5)
  • WordPress 5.7+

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.
  2. Activate the plugin through the 'Plugins' screen in WordPress.
  3. Use the Settings->Microsoft Azure screen to configure the plugin.

For multisites or to enforce Azure Blob Storage settings, you can define the following constants in wp-config.php:

  • MICROSOFT_AZURE_ACCOUNT_NAME - Account Name
  • MICROSOFT_AZURE_ACCOUNT_KEY - Account Primary Access Key
  • MICROSOFT_AZURE_CONTAINER - Azure Blob Container
  • MICROSOFT_AZURE_CNAME - Domain: must start with http(s)://
  • MICROSOFT_AZURE_USE_FOR_DEFAULT_UPLOAD - boolean (default false)

See Settings->Microsoft Azure for more information.

Upgrade Notice

3.0.0

This release features several security fixes and enhancements. It is highly recommended that all users upgrade immediately.

Support Level

Stable: 10up is not planning to develop any new features for this, but will still respond to bug reports and security concerns. We welcome PRs, but any that include new features should be small and easy to integrate and should not include breaking changes. We otherwise intend to keep this tested up to the most recent version of WordPress.

Known Issues

Storage Account Versions

Storage accounts can be created via CLI, classic Azure portal, or the new Azure portal, with varying results.

If a Storage account is created with the new Azure portal, authentication will fail, resulting in the inability to view/add containers or files. Creating a Storage account with the Azure CLI should allow the plugin to work with new Storage accounts.

Responsive Images in WordPress 4.4

Images uploaded to the Azure Storage service will not automatically receive responsive versions. 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.

Media Library Editor

Media editing tools are currently not working. The edited images are not uploaded to Azure Storage. Will be fixed in future releases.

Azure Storage Account Migration

At the moment, changing the Azure Storage account (and blob URLs) requires to manually update data in the WordPress database.

Data should be updated in these tables:

  1. wp_options (or wp-config.php or Settings > Microsoft Azure): plugin settings
  2. wp_posts:
  • links in post_content of pages and posts (rows with post_type = page or post)
  • guid of rows with post_type = attachment
  1. wp_postmeta: meta_value of rows with meta_key = _wp_attachment_metadata or windows_azure_storage_info

Note: data in wp_postmeta is PHP serialized, it cannot be updated with simple search-and-replace. There are multiple ways to do it:

  1. Using WP-CLI, detailed instructions here.
  2. Directly inside WordPress, using the Better Search Replace plugin.
  3. Using an external tool that supports PHP serialization, like Search Replace DB.

Changelog

A complete listing of all notable changes to Microsoft Azure Storage are documented in CHANGELOG.md.

Contributing

Please read CODE_OF_CONDUCT.md for details on our code of conduct, CONTRIBUTING.md for details on the process for submitting pull requests to us, and CREDITS.md for a listing of maintainers of, contributors to, and libraries used by Microsoft Azure Storage.

Like what you see?