Adds a new 'S3-Compatible Storage' provider that works with any
S3-API-compatible object storage service, including MinIO, Ceph,
Cloudflare R2, Backblaze B2, and others.
Changes:
- New provider class: classes/providers/storage/s3-compatible-provider.php
- Provider key: s3compatible
- Reads user-configured endpoint URL from settings
- Uses path-style URL access (required by most S3-compatible services)
- Supports credentials via AS3CF_S3COMPAT_ACCESS_KEY_ID /
AS3CF_S3COMPAT_SECRET_ACCESS_KEY wp-config.php constants
- Disables AWS-specific features (Block Public Access, Object Ownership)
- New provider SVG icons (s3compatible.svg, -link.svg, -round.svg)
- Registered provider in main plugin class with endpoint setting support
- Updated StorageProviderSubPage to show endpoint URL input for S3-compatible
- Built pro settings bundle with rollup (Svelte 4.2.19)
- Added package.json and updated rollup.config.mjs for pro-only builds
68 lines
1.9 KiB
PHP
68 lines
1.9 KiB
PHP
<?php
|
|
|
|
namespace DeliciousBrains\WP_Offload_Media\Pro\Tools\Analyze_And_Repair;
|
|
|
|
use DeliciousBrains\WP_Offload_Media\Pro\Background_Processes\Analyze_And_Repair\Verify_Add_Metadata_Process;
|
|
use DeliciousBrains\WP_Offload_Media\Pro\Background_Processes\Background_Tool_Process;
|
|
use DeliciousBrains\WP_Offload_Media\Pro\Tools\Analyze_And_Repair;
|
|
|
|
class Verify_Add_Metadata extends Analyze_And_Repair {
|
|
|
|
/**
|
|
* @var string
|
|
*/
|
|
protected $tool_key = 'verify_add_metadata';
|
|
|
|
/**
|
|
* @var array
|
|
*/
|
|
protected static $show_tool_constants = array(
|
|
'AS3CF_SHOW_VERIFY_ADD_METADATA_TOOL',
|
|
);
|
|
|
|
/**
|
|
* Get title text.
|
|
*
|
|
* @return string
|
|
*/
|
|
public function get_title_text() {
|
|
return __( 'Find items with files missing in bucket and remove metadata, mark others verified', 'amazon-s3-and-cloudfront' );
|
|
}
|
|
|
|
/**
|
|
* Get more info text.
|
|
*
|
|
* @return string
|
|
*/
|
|
public static function get_more_info_text() {
|
|
return __( 'You can use this tool to check that files exist in the bucket for items recently created with the Add Metadata tool. New metadata items with files missing from the bucket will be removed. It will not remove any offload metadata not created with the Add Metadata tool such as regular Media Library offloads.', 'amazon-s3-and-cloudfront' );
|
|
}
|
|
|
|
/**
|
|
* Get queued status text.
|
|
*
|
|
* @return string
|
|
*/
|
|
public function get_queued_status(): string {
|
|
return __( 'Finding items with files missing in bucket and removing their metadata, marking others as verified.', 'amazon-s3-and-cloudfront' );
|
|
}
|
|
|
|
/**
|
|
* Get short queued status text.
|
|
*
|
|
* @return string
|
|
*/
|
|
public function get_short_queued_status(): string {
|
|
return _x( 'Verifying…', 'Short tool running message', 'amazon-s3-and-cloudfront' );
|
|
}
|
|
|
|
/**
|
|
* Get background process class.
|
|
*
|
|
* @return Background_Tool_Process|null
|
|
*/
|
|
protected function get_background_process_class() {
|
|
return new Verify_Add_Metadata_Process( $this->as3cf, $this );
|
|
}
|
|
}
|