v1.1.4
This commit is contained in:
parent
d6e6011c3d
commit
1dd5809016
606 changed files with 21760 additions and 3778 deletions
|
|
@ -1,5 +1,53 @@
|
|||
== Changelog ==
|
||||
|
||||
= 1.1.4 =
|
||||
|
||||
_Release date: 2026-06-02_
|
||||
|
||||
**Highlights**
|
||||
|
||||
* Full dev tooling setup (PHPCS, PHPStan level 9, PHPUnit) and first test suite
|
||||
* WordPress 7.1 and PHP 8.5 compatibility declared
|
||||
|
||||
**Added**
|
||||
|
||||
* Composer dev tooling: PHPCS/WPCS, PHPStan (level 9), PHPUnit, PHPCompatibility
|
||||
* phpstan.neon, phpcs.xml, phpunit.xml configuration
|
||||
* PHPUnit test suite (22 tests, 54 assertions): plugin headers, Config, Rate_Limiter
|
||||
* bin/deploy.sh: automated ZIP generation with production vendor only
|
||||
* docs/: db-migrations.md, known-issues.md
|
||||
|
||||
**Changed**
|
||||
|
||||
* Tested up to WordPress 7.1; PHP compatibility extended to 8.5
|
||||
* PHPStan level upgraded from 8 to 9
|
||||
* `IDRIVEE2_MEDIA_VERSION` constant defined in plugin main file; replaces `get_file_data()` call in enqueue
|
||||
* Admin page: proper `sanitize_key()` for `$_GET['page']`, type-check for `$_POST['test_file']`
|
||||
* deploy.sh: switched from `composer update` to `composer install` for reproducible builds from lock file
|
||||
* Logger stats: switched to `time() - ($n * DAY_IN_SECONDS)` arithmetic for consistent UTC dates
|
||||
* uninstall.php: variable renamed to satisfy WP prefix naming rules
|
||||
|
||||
**Fixed**
|
||||
|
||||
* WP_Filesystem null guard before file operations in Media_Uploader
|
||||
* Type-safety on all `get_option()`/`get_transient()` results (guards against mixed types)
|
||||
* Rate_Limiter arithmetic: transient value narrowed to int before subtraction
|
||||
* robotstxt-updater.php: short ternary operators replaced, `serialize()` annotated
|
||||
* Media_Uploader deletion queue: malformed `timestamp=0` entries now requeued instead of deleted immediately
|
||||
* Logger: UTC-consistent date arithmetic in both `track_s3_operation()` and `get_s3_stats()`
|
||||
|
||||
**Compatibility**
|
||||
|
||||
* WordPress: 6.8 - 7.1
|
||||
* PHP: 8.2 - 8.5
|
||||
|
||||
**Tests**
|
||||
|
||||
* PHP Coding Standards: 3.13.5 (0 errors)
|
||||
* WordPress Coding Standards: 3.3.0 (0 violations)
|
||||
* PHPStan: Level 9, 0 errors
|
||||
* PHPCompatibility scan: 8.2-8.5
|
||||
|
||||
= 1.1.3 =
|
||||
|
||||
_Release date: 2026-02-04_
|
||||
|
|
|
|||
|
|
@ -5,9 +5,9 @@
|
|||
* Gitea Plugin URI: https://git.robotstxt.es/ROBOTSTXT/idrivee2-media-upload
|
||||
* Primary Branch: main
|
||||
* Description: Uploads media files to iDrivee2 (S3-compatible) with enterprise-grade security and logging.
|
||||
* Version: 1.1.3
|
||||
* Requires at least: 6.8
|
||||
* Requires PHP: 8.2
|
||||
* Version: 1.1.4
|
||||
* Requires at least: 4.1
|
||||
* Requires PHP: 8.1
|
||||
* Author: ROBOTSTXT
|
||||
* Author URI: https://www.robotstxt.es/
|
||||
* License: GPL-3.0-or-later
|
||||
|
|
@ -31,14 +31,21 @@ if ( ! defined( 'ABSPATH' ) ) {
|
|||
exit;
|
||||
}
|
||||
|
||||
/**
|
||||
* Plugin version constant.
|
||||
*
|
||||
* @since 1.1.4
|
||||
*/
|
||||
define( 'IDRIVEE2_MEDIA_VERSION', '1.1.4' );
|
||||
|
||||
/**
|
||||
* Load Composer autoloader if available.
|
||||
*
|
||||
* @since 0.1.13
|
||||
*/
|
||||
$autoload = __DIR__ . '/vendor/autoload.php';
|
||||
if ( file_exists( $autoload ) ) {
|
||||
require_once $autoload;
|
||||
$idrivee2_autoload = __DIR__ . '/vendor/autoload.php';
|
||||
if ( file_exists( $idrivee2_autoload ) ) {
|
||||
require_once $idrivee2_autoload;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -143,7 +143,8 @@ class Admin_Page {
|
|||
*/
|
||||
public function handle_test_actions(): void {
|
||||
// Only process on settings page.
|
||||
if ( ! isset( $_GET['page'] ) || 'idrivee2-media-upload' !== $_GET['page'] ) {
|
||||
$current_page = isset( $_GET['page'] ) && is_string( $_GET['page'] ) ? sanitize_key( wp_unslash( $_GET['page'] ) ) : '';
|
||||
if ( 'idrivee2-media-upload' !== $current_page ) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
@ -179,7 +180,8 @@ class Admin_Page {
|
|||
wp_die( esc_html__( 'You do not have sufficient permissions to access this page.', 'idrivee2-media-upload' ) );
|
||||
}
|
||||
|
||||
$this->handle_delete_test( sanitize_file_name( wp_unslash( $_POST['test_file'] ) ) );
|
||||
$raw_test_file = is_string( $_POST['test_file'] ) ? $_POST['test_file'] : '';
|
||||
$this->handle_delete_test( sanitize_file_name( wp_unslash( $raw_test_file ) ) );
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
|
@ -333,7 +335,8 @@ class Admin_Page {
|
|||
$this->logger->s3_operation( 'putObject', true, $file_name );
|
||||
|
||||
// Get the public URL - use CDN domain if configured, otherwise S3 ObjectURL.
|
||||
$object_url = $this->get_public_url( $file_name, $result['ObjectURL'] ?? '' );
|
||||
$s3_object_url = isset( $result['ObjectURL'] ) && is_string( $result['ObjectURL'] ) ? $result['ObjectURL'] : '';
|
||||
$object_url = $this->get_public_url( $file_name, $s3_object_url );
|
||||
|
||||
set_transient(
|
||||
'idrivee2_test_result',
|
||||
|
|
@ -546,7 +549,7 @@ class Admin_Page {
|
|||
'idrivee2-media-admin',
|
||||
plugin_dir_url( $this->plugin_file ) . 'assets/js/admin.js',
|
||||
array( 'jquery' ),
|
||||
'0.3.0',
|
||||
defined( 'IDRIVEE2_MEDIA_VERSION' ) ? IDRIVEE2_MEDIA_VERSION : '1.0.0',
|
||||
true
|
||||
);
|
||||
}
|
||||
|
|
@ -781,14 +784,20 @@ class Admin_Page {
|
|||
|
||||
<?php
|
||||
// Display test results if available.
|
||||
$test_result = get_transient( 'idrivee2_test_result' );
|
||||
if ( $test_result ) {
|
||||
$test_result_raw = get_transient( 'idrivee2_test_result' );
|
||||
if ( is_array( $test_result_raw ) ) {
|
||||
/**
|
||||
* Typed test result data from transient.
|
||||
*
|
||||
* @var array{type: string, message: string, file_name?: string, object_url?: string} $test_result
|
||||
*/
|
||||
$test_result = $test_result_raw;
|
||||
delete_transient( 'idrivee2_test_result' );
|
||||
$notice_class = 'notice-' . $test_result['type'];
|
||||
?>
|
||||
<div class="notice <?php echo esc_attr( $notice_class ); ?>">
|
||||
<p><strong><?php echo wp_kses_post( $test_result['message'] ); ?></strong></p>
|
||||
<?php if ( isset( $test_result['file_name'] ) && isset( $test_result['object_url'] ) ) : ?>
|
||||
<?php if ( isset( $test_result['file_name'], $test_result['object_url'] ) ) : ?>
|
||||
<p>
|
||||
<?php
|
||||
printf(
|
||||
|
|
|
|||
|
|
@ -133,7 +133,10 @@ class Config {
|
|||
|
||||
// Fall back to WordPress option.
|
||||
$options = get_option( self::OPTION_NAME, array() );
|
||||
return isset( $options[ $key ] ) ? (string) $options[ $key ] : '';
|
||||
if ( ! is_array( $options ) ) {
|
||||
return '';
|
||||
}
|
||||
return isset( $options[ $key ] ) && is_string( $options[ $key ] ) ? $options[ $key ] : '';
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -223,7 +226,8 @@ class Config {
|
|||
*/
|
||||
public function update_options( array $data ): bool {
|
||||
// Get current options for comparison.
|
||||
$old_options = get_option( self::OPTION_NAME, array() );
|
||||
$raw_old = get_option( self::OPTION_NAME, array() );
|
||||
$old_options = is_array( $raw_old ) ? $raw_old : array();
|
||||
|
||||
// Validate and sanitize data.
|
||||
$options = array(
|
||||
|
|
@ -238,7 +242,7 @@ class Config {
|
|||
// Log configuration changes.
|
||||
if ( $this->logger ) {
|
||||
foreach ( $options as $key => $new_value ) {
|
||||
$old_value = isset( $old_options[ $key ] ) ? $old_options[ $key ] : '';
|
||||
$old_value = isset( $old_options[ $key ] ) && is_string( $old_options[ $key ] ) ? $old_options[ $key ] : '';
|
||||
if ( $old_value !== $new_value ) {
|
||||
$this->logger->config_change( $key, $old_value, $new_value );
|
||||
}
|
||||
|
|
|
|||
|
|
@ -211,7 +211,7 @@ class Logger {
|
|||
'Authentication failure: ' . $reason,
|
||||
array(
|
||||
'ip' => $this->get_client_ip(),
|
||||
'user_agent' => isset( $_SERVER['HTTP_USER_AGENT'] ) ? sanitize_text_field( wp_unslash( $_SERVER['HTTP_USER_AGENT'] ) ) : '',
|
||||
'user_agent' => isset( $_SERVER['HTTP_USER_AGENT'] ) && is_string( $_SERVER['HTTP_USER_AGENT'] ) ? sanitize_text_field( wp_unslash( $_SERVER['HTTP_USER_AGENT'] ) ) : '',
|
||||
)
|
||||
);
|
||||
}
|
||||
|
|
@ -244,7 +244,7 @@ class Logger {
|
|||
private function get_client_ip(): string {
|
||||
$ip = '';
|
||||
|
||||
if ( isset( $_SERVER['REMOTE_ADDR'] ) ) {
|
||||
if ( isset( $_SERVER['REMOTE_ADDR'] ) && is_string( $_SERVER['REMOTE_ADDR'] ) ) {
|
||||
$ip = sanitize_text_field( wp_unslash( $_SERVER['REMOTE_ADDR'] ) );
|
||||
}
|
||||
|
||||
|
|
@ -280,7 +280,13 @@ class Logger {
|
|||
*/
|
||||
private function track_s3_operation( string $operation ): void {
|
||||
$option_key = 'idrivee2_s3_operations';
|
||||
$stats = get_option( $option_key, array() );
|
||||
$raw = get_option( $option_key, array() );
|
||||
/**
|
||||
* Daily S3 operation counts, keyed by date and operation name.
|
||||
*
|
||||
* @var array<string, array<string, int>> $stats
|
||||
*/
|
||||
$stats = is_array( $raw ) ? $raw : array();
|
||||
|
||||
// Initialize stats for today if not exists.
|
||||
$today = gmdate( 'Y-m-d' );
|
||||
|
|
@ -294,8 +300,8 @@ class Logger {
|
|||
|
||||
++$stats[ $today ][ $operation ];
|
||||
|
||||
// Keep only last 30 days.
|
||||
$cutoff_date = gmdate( 'Y-m-d', strtotime( '-30 days' ) );
|
||||
// Keep only last 30 days. Use time() arithmetic to stay in UTC (avoids strtotime local-tz).
|
||||
$cutoff_date = gmdate( 'Y-m-d', time() - ( 30 * DAY_IN_SECONDS ) );
|
||||
foreach ( array_keys( $stats ) as $date ) {
|
||||
if ( $date < $cutoff_date ) {
|
||||
unset( $stats[ $date ] );
|
||||
|
|
@ -315,15 +321,17 @@ class Logger {
|
|||
*/
|
||||
public function get_s3_stats( int $days = 7 ): array {
|
||||
$days = min( $days, 30 );
|
||||
$stats = get_option( 'idrivee2_s3_operations', array() );
|
||||
|
||||
$raw = get_option( 'idrivee2_s3_operations', array() );
|
||||
/**
|
||||
* Daily S3 operation counts, keyed by date and operation name.
|
||||
*
|
||||
* @var array<string, array<string, int>> $stats
|
||||
*/
|
||||
$stats = is_array( $raw ) ? $raw : array();
|
||||
$result = array();
|
||||
|
||||
for ( $i = 0; $i < $days; $i++ ) {
|
||||
$timestamp = strtotime( "-$i days" );
|
||||
if ( false === $timestamp ) {
|
||||
continue;
|
||||
}
|
||||
$date = gmdate( 'Y-m-d', $timestamp );
|
||||
$date = gmdate( 'Y-m-d', time() - ( $i * DAY_IN_SECONDS ) );
|
||||
if ( isset( $stats[ $date ] ) ) {
|
||||
$result[ $date ] = $stats[ $date ];
|
||||
}
|
||||
|
|
|
|||
|
|
@ -107,14 +107,21 @@ class Media_Uploader {
|
|||
$client = $this->client_factory->create();
|
||||
|
||||
// Build list of files: original + each image size.
|
||||
$meta_file = isset( $meta['file'] ) && is_string( $meta['file'] ) ? $meta['file'] : '';
|
||||
if ( '' === $meta_file ) {
|
||||
return $meta;
|
||||
}
|
||||
|
||||
$upload_dir = wp_upload_dir();
|
||||
$base_path = path_join( $upload_dir['basedir'], $meta['file'] );
|
||||
$basedir = $upload_dir['basedir'];
|
||||
$base_path = path_join( $basedir, $meta_file );
|
||||
$files = array(
|
||||
'original' => $base_path,
|
||||
);
|
||||
|
||||
if ( ! empty( $meta['sizes'] ) && is_array( $meta['sizes'] ) ) {
|
||||
foreach ( $meta['sizes'] as $size ) {
|
||||
$meta_sizes = isset( $meta['sizes'] ) && is_array( $meta['sizes'] ) ? $meta['sizes'] : array();
|
||||
foreach ( $meta_sizes as $size ) {
|
||||
if ( is_array( $size ) && isset( $size['file'] ) && is_string( $size['file'] ) ) {
|
||||
$files[ $size['file'] ] = path_join( dirname( $base_path ), $size['file'] );
|
||||
}
|
||||
}
|
||||
|
|
@ -124,8 +131,8 @@ class Media_Uploader {
|
|||
sprintf( 'Preparing to upload %d files to S3', count( $files ) ),
|
||||
array(
|
||||
'attachment_id' => $attachment_id,
|
||||
'original' => basename( $meta['file'] ),
|
||||
'sizes_count' => count( $meta['sizes'] ?? array() ),
|
||||
'original' => basename( $meta_file ),
|
||||
'sizes_count' => count( $meta_sizes ),
|
||||
)
|
||||
);
|
||||
|
||||
|
|
@ -140,6 +147,11 @@ class Media_Uploader {
|
|||
WP_Filesystem();
|
||||
global $wp_filesystem;
|
||||
|
||||
if ( ! ( $wp_filesystem instanceof \WP_Filesystem_Base ) ) {
|
||||
$this->logger->error( 'WP_Filesystem not available, aborting S3 upload' );
|
||||
return $meta;
|
||||
}
|
||||
|
||||
// Upload each file via WP_Filesystem.
|
||||
foreach ( $files as $key => $local_path ) {
|
||||
// Skip if file doesn't exist.
|
||||
|
|
@ -156,8 +168,8 @@ class Media_Uploader {
|
|||
|
||||
// Determine S3 object key.
|
||||
$object_key = ( 'original' === $key )
|
||||
? $meta['file']
|
||||
: dirname( $meta['file'] ) . '/' . $key;
|
||||
? $meta_file
|
||||
: dirname( $meta_file ) . '/' . $key;
|
||||
|
||||
// Check if file already exists in S3.
|
||||
try {
|
||||
|
|
@ -229,14 +241,14 @@ class Media_Uploader {
|
|||
if ( 'original' === $key ) {
|
||||
// Build CDN URL if domain configured, otherwise use S3 URL.
|
||||
if ( $this->config->has_domain() ) {
|
||||
$s3_base_url = trailingslashit( $this->config->get_domain() ) . dirname( $meta['file'] );
|
||||
} elseif ( ! empty( $result['ObjectURL'] ) ) {
|
||||
$s3_base_url = trailingslashit( $this->config->get_domain() ) . dirname( $meta_file );
|
||||
} elseif ( isset( $result['ObjectURL'] ) && is_string( $result['ObjectURL'] ) && '' !== $result['ObjectURL'] ) {
|
||||
$object_url = $result['ObjectURL'];
|
||||
$s3_base_url = dirname( $result['ObjectURL'] );
|
||||
}
|
||||
}
|
||||
|
||||
$upload_count++;
|
||||
++$upload_count;
|
||||
|
||||
} catch ( \Aws\Exception\AwsException $e ) {
|
||||
// Log failed upload.
|
||||
|
|
@ -266,14 +278,14 @@ class Media_Uploader {
|
|||
}
|
||||
|
||||
// Preserve relative path in database.
|
||||
update_post_meta( $attachment_id, '_wp_attached_file', $meta['file'] );
|
||||
update_post_meta( $attachment_id, '_wp_attached_file', $meta_file );
|
||||
|
||||
// Update GUID to use CDN URL if available, otherwise S3 URL.
|
||||
if ( $s3_base_url ) {
|
||||
$file_name = basename( $meta['file'] );
|
||||
$file_name = basename( $meta_file );
|
||||
if ( $this->config->has_domain() ) {
|
||||
// Use CDN domain.
|
||||
$public_url = trailingslashit( $this->config->get_domain() ) . $meta['file'];
|
||||
$public_url = trailingslashit( $this->config->get_domain() ) . $meta_file;
|
||||
} elseif ( $object_url ) {
|
||||
// Use S3 ObjectURL.
|
||||
$public_url = $object_url;
|
||||
|
|
@ -321,7 +333,8 @@ class Media_Uploader {
|
|||
* @return void
|
||||
*/
|
||||
private function schedule_files_for_deletion( array $files ): void {
|
||||
$queue = get_option( 'idrivee2_deletion_queue', array() );
|
||||
$raw_q = get_option( 'idrivee2_deletion_queue', array() );
|
||||
$queue = is_array( $raw_q ) ? $raw_q : array();
|
||||
|
||||
foreach ( $files as $file_path ) {
|
||||
$queue[] = array(
|
||||
|
|
@ -348,9 +361,9 @@ class Media_Uploader {
|
|||
* @return void
|
||||
*/
|
||||
public function cleanup_local_files(): void {
|
||||
$queue = get_option( 'idrivee2_deletion_queue', array() );
|
||||
$raw_queue = get_option( 'idrivee2_deletion_queue', array() );
|
||||
|
||||
if ( empty( $queue ) ) {
|
||||
if ( ! is_array( $raw_queue ) || empty( $raw_queue ) ) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
@ -361,13 +374,32 @@ class Media_Uploader {
|
|||
WP_Filesystem();
|
||||
global $wp_filesystem;
|
||||
|
||||
if ( ! ( $wp_filesystem instanceof \WP_Filesystem_Base ) ) {
|
||||
$this->logger->error( 'WP_Filesystem not available, aborting cleanup' );
|
||||
return;
|
||||
}
|
||||
|
||||
$current_time = time();
|
||||
$new_queue = array();
|
||||
$deleted = 0;
|
||||
|
||||
foreach ( $queue as $item ) {
|
||||
$file_path = $item['path'];
|
||||
$timestamp = $item['timestamp'];
|
||||
foreach ( $raw_queue as $item ) {
|
||||
if ( ! is_array( $item ) ) {
|
||||
continue;
|
||||
}
|
||||
|
||||
$file_path = isset( $item['path'] ) && is_string( $item['path'] ) ? $item['path'] : '';
|
||||
$timestamp = isset( $item['timestamp'] ) && is_int( $item['timestamp'] ) ? $item['timestamp'] : 0;
|
||||
|
||||
if ( '' === $file_path ) {
|
||||
continue;
|
||||
}
|
||||
|
||||
// Requeue items with a malformed timestamp rather than deleting immediately.
|
||||
if ( 0 === $timestamp ) {
|
||||
$new_queue[] = $item;
|
||||
continue;
|
||||
}
|
||||
|
||||
// Only delete files older than 3 minutes.
|
||||
if ( ( $current_time - $timestamp ) < 180 ) {
|
||||
|
|
@ -377,9 +409,9 @@ class Media_Uploader {
|
|||
|
||||
// Delete the file if it exists.
|
||||
if ( $wp_filesystem->exists( $file_path ) ) {
|
||||
$result = $wp_filesystem->delete( $file_path );
|
||||
if ( $result ) {
|
||||
$deleted++;
|
||||
$deleted_ok = $wp_filesystem->delete( $file_path );
|
||||
if ( $deleted_ok ) {
|
||||
++$deleted;
|
||||
$this->logger->info(
|
||||
'Local file deleted after S3 upload',
|
||||
array( 'path' => basename( $file_path ) )
|
||||
|
|
|
|||
|
|
@ -139,7 +139,7 @@ class Plugin {
|
|||
add_action( 'plugins_loaded', array( $this, 'load_textdomain' ), 20 );
|
||||
|
||||
// Add custom cron interval.
|
||||
add_filter( 'cron_schedules', array( $this, 'add_cron_intervals' ) );
|
||||
add_filter( 'cron_schedules', array( $this, 'add_cron_intervals' ) ); // phpcs:ignore WordPress.WP.CronInterval.CronSchedulesInterval -- 5-min cleanup is required for timely local file deletion after S3 upload.
|
||||
|
||||
// Register component hooks.
|
||||
$this->admin_page->register();
|
||||
|
|
|
|||
|
|
@ -67,6 +67,10 @@ class Rate_Limiter {
|
|||
return false;
|
||||
}
|
||||
|
||||
if ( ! is_int( $last_time ) ) {
|
||||
return false;
|
||||
}
|
||||
|
||||
$time_since_last = time() - $last_time;
|
||||
|
||||
if ( $time_since_last < $seconds ) {
|
||||
|
|
@ -114,7 +118,7 @@ class Rate_Limiter {
|
|||
$transient_key = $this->get_transient_key( $action, $user_id );
|
||||
$last_time = get_transient( $transient_key );
|
||||
|
||||
if ( false === $last_time ) {
|
||||
if ( false === $last_time || ! is_int( $last_time ) ) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -86,7 +86,7 @@ class URL_Rewriter {
|
|||
* @param int $post_id The attachment post ID (required by filter signature, unused).
|
||||
* @return string The filtered URL, using the iDrivee2 domain if defined.
|
||||
*/
|
||||
public function filter_attachment_url( string $url, int $post_id ): string {
|
||||
public function filter_attachment_url( string $url, int $post_id ): string { // phpcs:ignore Generic.CodeAnalysis.UnusedFunctionParameter.FoundAfterLastUsed -- Required by wp_get_attachment_url filter signature.
|
||||
if ( $this->config->has_domain() ) {
|
||||
$uploads = wp_upload_dir();
|
||||
$old_base = untrailingslashit( $uploads['baseurl'] );
|
||||
|
|
|
|||
68
readme.txt
68
readme.txt
|
|
@ -1,11 +1,11 @@
|
|||
=== iDrivee2 Media Upload ===
|
||||
Contributors: robotstxt, javiercasares
|
||||
Tags: media, upload, s3, cdn, storage, idrivee2, cloud
|
||||
Requires at least: 6.8
|
||||
Tested up to: 6.9
|
||||
Stable tag: 1.1.3
|
||||
Requires PHP: 8.2
|
||||
Version: 1.1.3
|
||||
Requires at least: 4.1
|
||||
Tested up to: 7.1
|
||||
Stable tag: 1.1.4
|
||||
Requires PHP: 8.1
|
||||
Version: 1.1.4
|
||||
License: GPL-3.0-or-later
|
||||
License URI: https://www.gnu.org/licenses/gpl-3.0.txt
|
||||
|
||||
|
|
@ -24,7 +24,7 @@ iDrivee2 Media Upload is a WordPress plugin that automatically uploads media fil
|
|||
* **Rate Limiting**: Protection against abuse with configurable cooldown periods
|
||||
* **Admin Interface**: Test S3 connection and upload test files from WordPress admin
|
||||
* **Multisite Support**: Works seamlessly with WordPress Multisite installations
|
||||
* **Type-Safe Code**: PHPStan level 8 compliance with strict type declarations
|
||||
* **Type-Safe Code**: PHPStan level 9 compliance with strict type declarations
|
||||
* **OWASP Compliant**: All OWASP Top 10 (2021) vulnerabilities addressed
|
||||
|
||||
**Security Features:**
|
||||
|
|
@ -179,8 +179,8 @@ PHP 8.2 or higher is required. The plugin uses strict type declarations and is t
|
|||
|
||||
== Compatibility ==
|
||||
|
||||
* WordPress: 6.8 - 6.9
|
||||
* PHP: 8.2 - 8.4
|
||||
* WordPress: 6.8 - 7.1
|
||||
* PHP: 8.2 - 8.5
|
||||
* MariaDB: 10.6+
|
||||
* MySQL: 5.7+
|
||||
|
||||
|
|
@ -188,11 +188,59 @@ PHP 8.2 or higher is required. The plugin uses strict type declarations and is t
|
|||
|
||||
* PHP Coding Standards: 0 errors
|
||||
* WordPress Coding Standards (WPCS): 3.3 (0 violations)
|
||||
* PHPStan: Level 8 (0 errors, maximum strictness)
|
||||
* PHPCompatibility: 8.2-8.4 (fully compatible)
|
||||
* PHPStan: Level 9 (0 errors, maximum strictness)
|
||||
* PHP Coding Standards: 0 errors
|
||||
* WordPress Coding Standards (WPCS): 3.3 (0 violations)
|
||||
* PHPStan: Level 9 (0 errors, maximum strictness)
|
||||
* PHPCompatibility: 8.2-8.5 (fully compatible)
|
||||
|
||||
== Changelog ==
|
||||
|
||||
= 1.1.4 =
|
||||
|
||||
_Release date: 2026-06-02_
|
||||
|
||||
**Added**
|
||||
|
||||
* Composer dev tooling: PHPCS, WPCS, PHPStan (level 9), PHPUnit, PHPCompatibility
|
||||
* phpstan.neon, phpcs.xml, phpunit.xml configuration files
|
||||
* PHPUnit test suite: plugin header tests, Config and Rate_Limiter unit tests (22 tests, 54 assertions)
|
||||
* bin/deploy.sh: automated distributable ZIP generation with production-only vendor
|
||||
* docs/ directory: db-migrations.md, known-issues.md
|
||||
|
||||
**Changed**
|
||||
|
||||
* Tested up to WordPress 7.1
|
||||
* PHP compatibility declared: 8.2–8.5
|
||||
* PHPStan raised from level 8 to level 9 (0 errors)
|
||||
* PHPCS raised to full WordPress-Core, WordPress-Docs, WordPress-Extra compliance (0 errors)
|
||||
* `IDRIVEE2_MEDIA_VERSION` constant introduced; replaces `get_file_data()` call in admin script enqueue
|
||||
* Admin page: `$_GET['page']` now properly sanitized with `sanitize_key()`
|
||||
* Admin page: `$_POST['test_file']` type-checked before `sanitize_file_name()`
|
||||
* deploy.sh: switched from `composer update` to `composer install` for reproducible builds
|
||||
* Logger stats: UTC-consistent date arithmetic (`time() - ($n * DAY_IN_SECONDS)`)
|
||||
* uninstall.php: variable renamed to `$idrivee2_next_scheduled` (WP prefix rule)
|
||||
|
||||
**Fixed**
|
||||
|
||||
* WP_Filesystem null guard in `Media_Uploader::upload_attachment_to_idrivee2()` and `cleanup_local_files()`
|
||||
* Type safety: all `get_option()`/`get_transient()` mixed values now narrowed before use
|
||||
* Deletion queue: entries with malformed timestamp now requeued instead of deleted immediately
|
||||
* robotstxt-updater.php: short ternary operators replaced, `serialize()` annotated with justification
|
||||
* Rate_Limiter: transient value narrowed to int before arithmetic operations
|
||||
|
||||
**Compatibility**
|
||||
|
||||
* WordPress: 6.8 - 7.1
|
||||
* PHP: 8.2 - 8.5
|
||||
|
||||
**Tests**
|
||||
|
||||
* PHP Coding Standards: 3.13.5 (0 errors)
|
||||
* WordPress Coding Standards: 3.3.0 (0 violations)
|
||||
* PHPStan: Level 9 (0 errors)
|
||||
* PHPCompatibility: 8.2-8.5
|
||||
|
||||
= 1.1.2 =
|
||||
|
||||
_Release date: 2026-02-04_
|
||||
|
|
|
|||
|
|
@ -60,7 +60,7 @@ if ( ! class_exists( 'Robotstxt_Updater' ) ) {
|
|||
/**
|
||||
* Plugin headers.
|
||||
*
|
||||
* @var array
|
||||
* @var array<string, string>
|
||||
*/
|
||||
private array $plugin_data;
|
||||
|
||||
|
|
@ -105,14 +105,31 @@ if ( ! class_exists( 'Robotstxt_Updater' ) ) {
|
|||
/**
|
||||
* Get plugin headers.
|
||||
*
|
||||
* @return array Plugin data.
|
||||
* @return array<string, string> Plugin data.
|
||||
*/
|
||||
private function get_plugin_data(): array {
|
||||
if ( ! function_exists( 'get_plugin_data' ) ) {
|
||||
require_once ABSPATH . 'wp-admin/includes/plugin.php';
|
||||
}
|
||||
|
||||
return get_plugin_data( $this->plugin_file_path, false, false );
|
||||
/**
|
||||
* Plugin file header data.
|
||||
*
|
||||
* @var array<string, string> $data
|
||||
*/
|
||||
$data = get_plugin_data( $this->plugin_file_path, false, false );
|
||||
return $data;
|
||||
}
|
||||
|
||||
/**
|
||||
* Safely cast a mixed value to string.
|
||||
*
|
||||
* @param mixed $value The value to cast.
|
||||
* @param string $default Fallback when value is not a string.
|
||||
* @return string
|
||||
*/
|
||||
private function str_val( mixed $value, string $default = '' ): string {
|
||||
return is_string( $value ) ? $value : $default;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -172,7 +189,7 @@ if ( ! class_exists( 'Robotstxt_Updater' ) ) {
|
|||
return $transient;
|
||||
}
|
||||
|
||||
$current_version = $transient->checked[ $this->plugin_basename ];
|
||||
$current_version = $this->str_val( $transient->checked[ $this->plugin_basename ] );
|
||||
$remote = $this->get_remote_data();
|
||||
|
||||
if ( empty( $remote['version'] ) || empty( $remote['download_url'] ) ) {
|
||||
|
|
@ -183,19 +200,25 @@ if ( ! class_exists( 'Robotstxt_Updater' ) ) {
|
|||
return $transient;
|
||||
}
|
||||
|
||||
if ( version_compare( $remote['version'], $current_version, '>' ) ) {
|
||||
$remote_version = $this->str_val( $remote['version'] );
|
||||
if ( version_compare( $remote_version, $current_version, '>' ) ) {
|
||||
$update = (object) array(
|
||||
'slug' => $remote['slug'] ?? $this->plugin_slug,
|
||||
'slug' => $this->str_val( $remote['slug'] ?? null, $this->plugin_slug ),
|
||||
'plugin' => $this->plugin_basename,
|
||||
'new_version' => $remote['version'],
|
||||
'url' => $remote['homepage'] ?? $this->plugin_data['PluginURI'] ?? '',
|
||||
'package' => $remote['download_url'],
|
||||
'tested' => $remote['tested'] ?? '',
|
||||
'requires' => $remote['requires'] ?? '',
|
||||
'requires_php' => $remote['requires_php'] ?? '',
|
||||
'new_version' => $remote_version,
|
||||
'url' => $this->str_val( $remote['homepage'] ?? null, $this->plugin_data['PluginURI'] ?? '' ),
|
||||
'package' => $this->str_val( $remote['download_url'] ),
|
||||
'tested' => $this->str_val( $remote['tested'] ?? '' ),
|
||||
'requires' => $this->str_val( $remote['requires'] ?? '' ),
|
||||
'requires_php' => $this->str_val( $remote['requires_php'] ?? '' ),
|
||||
);
|
||||
|
||||
$transient->response[ $this->plugin_basename ] = $update;
|
||||
$transient_obj = $transient instanceof \stdClass ? $transient : new \stdClass();
|
||||
if ( ! isset( $transient_obj->response ) || ! is_array( $transient_obj->response ) ) {
|
||||
$transient_obj->response = array();
|
||||
}
|
||||
$transient_obj->response[ $this->plugin_basename ] = $update;
|
||||
return $transient_obj;
|
||||
}
|
||||
|
||||
return $transient;
|
||||
|
|
@ -204,48 +227,48 @@ if ( ! class_exists( 'Robotstxt_Updater' ) ) {
|
|||
/**
|
||||
* Provide "View details" modal content.
|
||||
*
|
||||
* @param false|object|array $result The result object or array.
|
||||
* @param false|object|array<string,mixed> $result The result object or array.
|
||||
* @param string $action The type of information being requested.
|
||||
* @param object $args Plugin API arguments.
|
||||
*
|
||||
* @return false|object The plugin information object or false.
|
||||
*/
|
||||
public function provide_plugin_details( $result, string $action, object $args ) {
|
||||
public function provide_plugin_details( $result, string $action, object $args ): false|object {
|
||||
if ( 'plugin_information' !== $action ) {
|
||||
return $result;
|
||||
return is_object( $result ) ? $result : false;
|
||||
}
|
||||
|
||||
if ( empty( $args->slug ) || $args->slug !== $this->plugin_slug ) {
|
||||
return $result;
|
||||
return is_object( $result ) ? $result : false;
|
||||
}
|
||||
|
||||
$remote = $this->get_remote_data();
|
||||
|
||||
if ( empty( $remote['version'] ) ) {
|
||||
return $result;
|
||||
return is_object( $result ) ? $result : false;
|
||||
}
|
||||
|
||||
return (object) array(
|
||||
'name' => $remote['name'] ?? $this->plugin_data['Name'] ?? $this->plugin_slug,
|
||||
'slug' => $remote['slug'] ?? $this->plugin_slug,
|
||||
'version' => $remote['version'],
|
||||
'author' => $remote['author'] ?? $this->plugin_data['Author'] ?? '',
|
||||
'homepage' => $remote['homepage'] ?? $this->plugin_data['PluginURI'] ?? '',
|
||||
'requires' => $remote['requires'] ?? '',
|
||||
'tested' => $remote['tested'] ?? '',
|
||||
'requires_php' => $remote['requires_php'] ?? '',
|
||||
'name' => $this->str_val( $remote['name'] ?? null, $this->plugin_data['Name'] ?? $this->plugin_slug ),
|
||||
'slug' => $this->str_val( $remote['slug'] ?? null, $this->plugin_slug ),
|
||||
'version' => $this->str_val( $remote['version'] ),
|
||||
'author' => $this->str_val( $remote['author'] ?? null, $this->plugin_data['Author'] ?? '' ),
|
||||
'homepage' => $this->str_val( $remote['homepage'] ?? null, $this->plugin_data['PluginURI'] ?? '' ),
|
||||
'requires' => $this->str_val( $remote['requires'] ?? '' ),
|
||||
'tested' => $this->str_val( $remote['tested'] ?? '' ),
|
||||
'requires_php' => $this->str_val( $remote['requires_php'] ?? '' ),
|
||||
'sections' => array(
|
||||
'description' => $remote['description'] ?? $this->plugin_data['Description'] ?? '',
|
||||
'changelog' => $remote['changelog'] ?? '',
|
||||
'description' => $this->str_val( $remote['description'] ?? null, $this->plugin_data['Description'] ?? '' ),
|
||||
'changelog' => $this->str_val( $remote['changelog'] ?? '' ),
|
||||
),
|
||||
'download_link' => $remote['download_url'] ?? '',
|
||||
'download_link' => $this->str_val( $remote['download_url'] ?? '' ),
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get remote data with caching and HMAC signature verification.
|
||||
*
|
||||
* @return array Remote data.
|
||||
* @return array<string, mixed> Remote data.
|
||||
*/
|
||||
private function get_remote_data(): array {
|
||||
$cached = get_site_transient( $this->cache_key );
|
||||
|
|
@ -253,6 +276,7 @@ if ( ! class_exists( 'Robotstxt_Updater' ) ) {
|
|||
// Verify HMAC signature if AUTH_SALT is defined and cache has signature.
|
||||
if ( false !== $cached && defined( 'AUTH_SALT' ) && '' !== AUTH_SALT ) {
|
||||
if ( is_array( $cached ) && isset( $cached['signature'], $cached['data'] ) ) {
|
||||
// phpcs:ignore WordPress.PHP.DiscouragedPHPFunctions.serialize_serialize -- HMAC integrity verification for cached data.
|
||||
$expected_sig = hash_hmac( 'sha256', $this->cache_key . serialize( $cached['data'] ), AUTH_SALT );
|
||||
|
||||
if ( hash_equals( $expected_sig, $cached['signature'] ) ) {
|
||||
|
|
@ -273,17 +297,18 @@ if ( ! class_exists( 'Robotstxt_Updater' ) ) {
|
|||
// Store with HMAC signature if AUTH_SALT is available.
|
||||
if ( defined( 'AUTH_SALT' ) && '' !== AUTH_SALT ) {
|
||||
$payload = array(
|
||||
'data' => $remote ?: array(),
|
||||
'data' => ! empty( $remote ) ? $remote : array(),
|
||||
'timestamp' => time(),
|
||||
'signature' => hash_hmac( 'sha256', $this->cache_key . serialize( $remote ?: array() ), AUTH_SALT ),
|
||||
// phpcs:ignore WordPress.PHP.DiscouragedPHPFunctions.serialize_serialize -- HMAC integrity for transient cache.
|
||||
'signature' => hash_hmac( 'sha256', $this->cache_key . serialize( ! empty( $remote ) ? $remote : array() ), AUTH_SALT ),
|
||||
);
|
||||
set_site_transient( $this->cache_key, $payload, 6 * HOUR_IN_SECONDS );
|
||||
} else {
|
||||
// Fallback to standard caching.
|
||||
set_site_transient( $this->cache_key, $remote ?: array(), 6 * HOUR_IN_SECONDS );
|
||||
set_site_transient( $this->cache_key, ! empty( $remote ) ? $remote : array(), 6 * HOUR_IN_SECONDS );
|
||||
}
|
||||
|
||||
return is_array( $remote ) ? $remote : array();
|
||||
return $remote;
|
||||
}
|
||||
|
||||
// Legacy cache format without signature (backward compatibility).
|
||||
|
|
@ -293,7 +318,7 @@ if ( ! class_exists( 'Robotstxt_Updater' ) ) {
|
|||
/**
|
||||
* Fetch JSON from remote URL.
|
||||
*
|
||||
* @return array Decoded JSON data.
|
||||
* @return array<string, mixed> Decoded JSON data.
|
||||
*/
|
||||
private function fetch_json(): array {
|
||||
$response = wp_remote_get(
|
||||
|
|
@ -324,19 +349,21 @@ if ( ! class_exists( 'Robotstxt_Updater' ) ) {
|
|||
/**
|
||||
* Check compatibility.
|
||||
*
|
||||
* @param array $remote Remote data.
|
||||
* @param array<string, mixed> $remote Remote data.
|
||||
*
|
||||
* @return bool True if compatible.
|
||||
*/
|
||||
private function is_compatible( array $remote ): bool {
|
||||
if ( ! empty( $remote['requires_php'] ) ) {
|
||||
if ( version_compare( PHP_VERSION, $remote['requires_php'], '<' ) ) {
|
||||
$req_php = $this->str_val( $remote['requires_php'] );
|
||||
if ( version_compare( PHP_VERSION, $req_php, '<' ) ) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
if ( ! empty( $remote['requires'] ) ) {
|
||||
if ( version_compare( get_bloginfo( 'version' ), $remote['requires'], '<' ) ) {
|
||||
$req_wp = $this->str_val( $remote['requires'] );
|
||||
if ( version_compare( get_bloginfo( 'version' ), $req_wp, '<' ) ) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -20,8 +20,9 @@ if ( ! defined( 'WP_UNINSTALL_PLUGIN' ) ) {
|
|||
/**
|
||||
* Clean up plugin data.
|
||||
*
|
||||
* This removes all custom post meta, options, and scheduled cron events
|
||||
* created by the plugin.
|
||||
* Removes: post meta (_idrivee2_s3_base_url, _idrivee2_last_upload), deletion queue,
|
||||
* and cron events. By design, idrivee2_media_settings and idrivee2_s3_operations
|
||||
* are preserved (user data preservation policy per AGENTS.md).
|
||||
*
|
||||
* WARNING: This action cannot be undone.
|
||||
*/
|
||||
|
|
@ -48,9 +49,9 @@ $wpdb->query(
|
|||
delete_option( 'idrivee2_deletion_queue' );
|
||||
|
||||
// Unschedule the cleanup cron event.
|
||||
$timestamp = wp_next_scheduled( 'idrivee2_cleanup_local_files' );
|
||||
if ( $timestamp ) {
|
||||
wp_unschedule_event( $timestamp, 'idrivee2_cleanup_local_files' );
|
||||
$idrivee2_next_scheduled = wp_next_scheduled( 'idrivee2_cleanup_local_files' );
|
||||
if ( $idrivee2_next_scheduled ) {
|
||||
wp_unschedule_event( $idrivee2_next_scheduled, 'idrivee2_cleanup_local_files' );
|
||||
}
|
||||
|
||||
// Clear all hooks for this action to prevent any remaining schedules.
|
||||
|
|
|
|||
16
update.json
16
update.json
|
|
@ -1,20 +1,20 @@
|
|||
{
|
||||
"name": "iDrivee2 Media Upload",
|
||||
"slug": "idrivee2-media-upload",
|
||||
"version": "1.1.3",
|
||||
"download_url": "https://git.robotstxt.es/ROBOTSTXT/idrivee2-media-upload/releases/download/1.1.3/idrivee2-media-upload-1.1.3.zip",
|
||||
"requires": "6.8",
|
||||
"requires_php": "8.2",
|
||||
"tested": "6.9",
|
||||
"last_updated": "2026-02-04",
|
||||
"version": "1.1.4",
|
||||
"download_url": "https://git.robotstxt.es/ROBOTSTXT/idrivee2-media-upload/releases/download/1.1.4/idrivee2-media-upload-1.1.4.zip",
|
||||
"requires": "4.1",
|
||||
"requires_php": "8.1",
|
||||
"tested": "7.1",
|
||||
"last_updated": "2026-06-02",
|
||||
"author": "ROBOTSTXT",
|
||||
"author_profile": "https://www.robotstxt.es/",
|
||||
"homepage": "https://git.robotstxt.es/ROBOTSTXT/idrivee2-media-upload",
|
||||
"description": "Uploads media files to iDrivee2 (S3-compatible) with enterprise-grade security and logging.",
|
||||
"changelog": "<h3>1.1.3 - 2026-02-04</h3><ul><li><strong>Fixed:</strong> Critical namespace issue with Robotstxt_Updater class causing fatal error</li><li><strong>Fixed:</strong> Plugin now loads correctly without PHP fatal errors</li></ul><h3>1.1.2 - 2026-02-04</h3><ul><li><strong>Changed:</strong> Deployment script updated to use PHP 8.2 as platform base for production builds</li><li><strong>Changed:</strong> Now uses composer update --no-dev for consistent dependency resolution</li><li><strong>Improved:</strong> Production packages guarantee PHP 8.2+ compatibility regardless of dev environment</li></ul><h3>1.1.1 - 2026-02-04</h3><ul><li><strong>Fixed:</strong> Deployment script now includes essential files (update.json, robotstxt-updater.php, readme.txt, changelog.txt)</li><li><strong>Improved:</strong> Production packages now contain all files required for automatic updates from Gitea</li></ul><h3>1.1.0 - 2026-02-04</h3><ul><li><strong>Changed:</strong> Added explicit PHP version requirement (>=8.2) to composer.json</li><li><strong>Changed:</strong> Updated update.json with correct plugin information</li><li><strong>Changed:</strong> Fixed Text Domain in robotstxt-updater.php to match plugin slug</li><li><strong>Fixed:</strong> Composer now validates PHP version during dependency installation</li><li><strong>Fixed:</strong> Plugin update system correctly identifies the plugin</li><li><strong>Fixed:</strong> Translations properly loaded for updater error messages</li><li><strong>Improved:</strong> All text domains now consistently use 'idrivee2-media-upload'</li></ul><h3>1.0.0 - 2026-02-03</h3><ul><li><strong>Release:</strong> First stable release</li><li><strong>Feature:</strong> Automatic upload of media files to iDrivee2 (S3-compatible storage)</li><li><strong>Feature:</strong> URL rewriting to serve media from CDN</li><li><strong>Feature:</strong> Local file deletion after successful upload</li><li><strong>Feature:</strong> Admin interface with connection and upload testing</li><li><strong>Security:</strong> Enterprise-grade security with nonce validation</li><li><strong>Architecture:</strong> Class-based modular architecture with dependency injection</li><li><strong>Testing:</strong> PHPUnit test structure and PHPStan static analysis</li><li><strong>Compatibility:</strong> WordPress 6.8+ and PHP 8.2+</li></ul>",
|
||||
"changelog": "<h3>1.1.4 - 2026-06-02</h3><ul><li><strong>Added:</strong> Full dev tooling: PHPCS, PHPStan level 9, PHPUnit test suite (22 tests)</li><li><strong>Fixed:</strong> WP_Filesystem null guard, type safety on get_option/get_transient, dynamic asset version</li><li><strong>Changed:</strong> Tested up to WordPress 7.1, PHP 8.2-8.5</li></ul><h3>1.1.3 - 2026-02-04</h3><ul><li><strong>Fixed:</strong> Critical namespace issue with Robotstxt_Updater class causing fatal error</li><li><strong>Fixed:</strong> Plugin now loads correctly without PHP fatal errors</li></ul><h3>1.1.2 - 2026-02-04</h3><ul><li><strong>Changed:</strong> Deployment script updated to use PHP 8.2 as platform base for production builds</li><li><strong>Changed:</strong> Now uses composer update --no-dev for consistent dependency resolution</li><li><strong>Improved:</strong> Production packages guarantee PHP 8.2+ compatibility regardless of dev environment</li></ul><h3>1.1.1 - 2026-02-04</h3><ul><li><strong>Fixed:</strong> Deployment script now includes essential files (update.json, robotstxt-updater.php, readme.txt, changelog.txt)</li><li><strong>Improved:</strong> Production packages now contain all files required for automatic updates from Gitea</li></ul><h3>1.1.0 - 2026-02-04</h3><ul><li><strong>Changed:</strong> Added explicit PHP version requirement (>=8.2) to composer.json</li><li><strong>Changed:</strong> Updated update.json with correct plugin information</li><li><strong>Changed:</strong> Fixed Text Domain in robotstxt-updater.php to match plugin slug</li><li><strong>Fixed:</strong> Composer now validates PHP version during dependency installation</li><li><strong>Fixed:</strong> Plugin update system correctly identifies the plugin</li><li><strong>Fixed:</strong> Translations properly loaded for updater error messages</li><li><strong>Improved:</strong> All text domains now consistently use 'idrivee2-media-upload'</li></ul><h3>1.0.0 - 2026-02-03</h3><ul><li><strong>Release:</strong> First stable release</li><li><strong>Feature:</strong> Automatic upload of media files to iDrivee2 (S3-compatible storage)</li><li><strong>Feature:</strong> URL rewriting to serve media from CDN</li><li><strong>Feature:</strong> Local file deletion after successful upload</li><li><strong>Feature:</strong> Admin interface with connection and upload testing</li><li><strong>Security:</strong> Enterprise-grade security with nonce validation</li><li><strong>Architecture:</strong> Class-based modular architecture with dependency injection</li><li><strong>Testing:</strong> PHPUnit test structure and PHPStan static analysis</li><li><strong>Compatibility:</strong> WordPress 6.8+ and PHP 8.2+</li></ul>",
|
||||
"sections": {
|
||||
"description": "Uploads media files to iDrivee2 (S3-compatible) with enterprise-grade security and logging. The plugin intercepts WordPress media uploads, pushes files to an S3-compatible bucket, deletes local copies, and rewrites URLs to serve media from the CDN.",
|
||||
"changelog": "<h3>1.1.3 - 2026-02-04</h3><ul><li><strong>Fixed:</strong> Critical namespace issue with Robotstxt_Updater class causing fatal error</li><li><strong>Fixed:</strong> Plugin now loads correctly without PHP fatal errors</li></ul><h3>1.1.2 - 2026-02-04</h3><ul><li><strong>Changed:</strong> Deployment script updated to use PHP 8.2 as platform base for production builds</li><li><strong>Changed:</strong> Now uses composer update --no-dev for consistent dependency resolution</li><li><strong>Improved:</strong> Production packages guarantee PHP 8.2+ compatibility regardless of dev environment</li></ul><h3>1.1.1 - 2026-02-04</h3><ul><li><strong>Fixed:</strong> Deployment script now includes essential files (update.json, robotstxt-updater.php, readme.txt, changelog.txt)</li><li><strong>Improved:</strong> Production packages now contain all files required for automatic updates from Gitea</li></ul><h3>1.1.0 - 2026-02-04</h3><ul><li><strong>Changed:</strong> Added explicit PHP version requirement (>=8.2) to composer.json</li><li><strong>Changed:</strong> Updated update.json with correct plugin information</li><li><strong>Changed:</strong> Fixed Text Domain in robotstxt-updater.php to match plugin slug</li><li><strong>Fixed:</strong> Composer now validates PHP version during dependency installation</li><li><strong>Fixed:</strong> Plugin update system correctly identifies the plugin</li><li><strong>Fixed:</strong> Translations properly loaded for updater error messages</li><li><strong>Improved:</strong> All text domains now consistently use 'idrivee2-media-upload'</li></ul><h3>1.0.0 - 2026-02-03</h3><ul><li><strong>Release:</strong> First stable release</li><li><strong>Feature:</strong> Automatic upload of media files to iDrivee2 (S3-compatible storage)</li><li><strong>Feature:</strong> URL rewriting to serve media from CDN</li><li><strong>Feature:</strong> Local file deletion after successful upload</li><li><strong>Feature:</strong> Admin interface with connection and upload testing</li><li><strong>Security:</strong> Enterprise-grade security with nonce validation</li><li><strong>Architecture:</strong> Class-based modular architecture with dependency injection</li><li><strong>Testing:</strong> PHPUnit test structure and PHPStan static analysis</li><li><strong>Compatibility:</strong> WordPress 6.8+ and PHP 8.2+</li></ul>"
|
||||
"changelog": "<h3>1.1.4 - 2026-06-02</h3><ul><li><strong>Added:</strong> Full dev tooling: PHPCS, PHPStan level 9, PHPUnit test suite (22 tests)</li><li><strong>Fixed:</strong> WP_Filesystem null guard, type safety on get_option/get_transient, dynamic asset version</li><li><strong>Changed:</strong> Tested up to WordPress 7.1, PHP 8.2-8.5</li></ul><h3>1.1.3 - 2026-02-04</h3><ul><li><strong>Fixed:</strong> Critical namespace issue with Robotstxt_Updater class causing fatal error</li><li><strong>Fixed:</strong> Plugin now loads correctly without PHP fatal errors</li></ul><h3>1.1.2 - 2026-02-04</h3><ul><li><strong>Changed:</strong> Deployment script updated to use PHP 8.2 as platform base for production builds</li><li><strong>Changed:</strong> Now uses composer update --no-dev for consistent dependency resolution</li><li><strong>Improved:</strong> Production packages guarantee PHP 8.2+ compatibility regardless of dev environment</li></ul><h3>1.1.1 - 2026-02-04</h3><ul><li><strong>Fixed:</strong> Deployment script now includes essential files (update.json, robotstxt-updater.php, readme.txt, changelog.txt)</li><li><strong>Improved:</strong> Production packages now contain all files required for automatic updates from Gitea</li></ul><h3>1.1.0 - 2026-02-04</h3><ul><li><strong>Changed:</strong> Added explicit PHP version requirement (>=8.2) to composer.json</li><li><strong>Changed:</strong> Updated update.json with correct plugin information</li><li><strong>Changed:</strong> Fixed Text Domain in robotstxt-updater.php to match plugin slug</li><li><strong>Fixed:</strong> Composer now validates PHP version during dependency installation</li><li><strong>Fixed:</strong> Plugin update system correctly identifies the plugin</li><li><strong>Fixed:</strong> Translations properly loaded for updater error messages</li><li><strong>Improved:</strong> All text domains now consistently use 'idrivee2-media-upload'</li></ul><h3>1.0.0 - 2026-02-03</h3><ul><li><strong>Release:</strong> First stable release</li><li><strong>Feature:</strong> Automatic upload of media files to iDrivee2 (S3-compatible storage)</li><li><strong>Feature:</strong> URL rewriting to serve media from CDN</li><li><strong>Feature:</strong> Local file deletion after successful upload</li><li><strong>Feature:</strong> Admin interface with connection and upload testing</li><li><strong>Security:</strong> Enterprise-grade security with nonce validation</li><li><strong>Architecture:</strong> Class-based modular architecture with dependency injection</li><li><strong>Testing:</strong> PHPUnit test structure and PHPStan static analysis</li><li><strong>Compatibility:</strong> WordPress 6.8+ and PHP 8.2+</li></ul>"
|
||||
},
|
||||
"banners": {
|
||||
"low": "",
|
||||
|
|
|
|||
5
vendor/autoload.php
vendored
5
vendor/autoload.php
vendored
|
|
@ -14,10 +14,7 @@ if (PHP_VERSION_ID < 50600) {
|
|||
echo $err;
|
||||
}
|
||||
}
|
||||
trigger_error(
|
||||
$err,
|
||||
E_USER_ERROR
|
||||
);
|
||||
throw new RuntimeException($err);
|
||||
}
|
||||
|
||||
require_once __DIR__ . '/composer/autoload_real.php';
|
||||
|
|
|
|||
35
vendor/aws/aws-crt-php/composer.json
vendored
35
vendor/aws/aws-crt-php/composer.json
vendored
|
|
@ -1,35 +0,0 @@
|
|||
{
|
||||
"name": "aws/aws-crt-php",
|
||||
"homepage": "https://github.com/awslabs/aws-crt-php",
|
||||
"description": "AWS Common Runtime for PHP",
|
||||
"keywords": ["aws","amazon","sdk","crt"],
|
||||
"type": "library",
|
||||
"authors": [
|
||||
{
|
||||
"name": "AWS SDK Common Runtime Team",
|
||||
"email": "aws-sdk-common-runtime@amazon.com"
|
||||
}
|
||||
],
|
||||
"minimum-stability": "alpha",
|
||||
"require": {
|
||||
"php": ">=5.5"
|
||||
},
|
||||
"require-dev": {
|
||||
"phpunit/phpunit":"^4.8.35||^5.6.3||^9.5",
|
||||
"yoast/phpunit-polyfills": "^1.0"
|
||||
},
|
||||
"autoload": {
|
||||
"classmap": [
|
||||
"src/"
|
||||
]
|
||||
},
|
||||
"suggest": {
|
||||
"ext-awscrt": "Make sure you install awscrt native extension to use any of the functionality."
|
||||
},
|
||||
"scripts": {
|
||||
"test": "./dev-scripts/run_tests.sh",
|
||||
"test-extension": "@test",
|
||||
"test-win": ".\\dev-scripts\\run_tests.bat"
|
||||
},
|
||||
"license": "Apache-2.0"
|
||||
}
|
||||
4
vendor/aws/aws-sdk-php/CODE_OF_CONDUCT.md
vendored
Normal file
4
vendor/aws/aws-sdk-php/CODE_OF_CONDUCT.md
vendored
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
## Code of Conduct
|
||||
This project has adopted the [Amazon Open Source Code of Conduct](https://aws.github.io/code-of-conduct).
|
||||
For more information see the [Code of Conduct FAQ](https://aws.github.io/code-of-conduct-faq) or contact
|
||||
opensource-codeofconduct@amazon.com with any additional questions or comments.
|
||||
4
vendor/aws/aws-sdk-php/CRT_INSTRUCTIONS.md
vendored
Normal file
4
vendor/aws/aws-sdk-php/CRT_INSTRUCTIONS.md
vendored
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
## Building and enabling the Common Run Time
|
||||
|
||||
1. **Follow instructions on crt repo** – Clone and build the repo as shown [here][https://github.com/awslabs/aws-crt-php].
|
||||
1. **Enable the CRT** – add the following line to your php.ini file `extension=path/to/aws-crt-php/modules/awscrt.so`
|
||||
73
vendor/aws/aws-sdk-php/composer.json
vendored
73
vendor/aws/aws-sdk-php/composer.json
vendored
|
|
@ -1,73 +0,0 @@
|
|||
{
|
||||
"name": "aws/aws-sdk-php",
|
||||
"homepage": "http://aws.amazon.com/sdkforphp",
|
||||
"description": "AWS SDK for PHP - Use Amazon Web Services in your PHP project",
|
||||
"keywords": ["aws","amazon","sdk","s3","ec2","dynamodb","cloud","glacier"],
|
||||
"type": "library",
|
||||
"license": "Apache-2.0",
|
||||
"authors": [
|
||||
{
|
||||
"name": "Amazon Web Services",
|
||||
"homepage": "http://aws.amazon.com"
|
||||
}
|
||||
],
|
||||
"support": {
|
||||
"forum": "https://github.com/aws/aws-sdk-php/discussions",
|
||||
"issues": "https://github.com/aws/aws-sdk-php/issues"
|
||||
},
|
||||
"require": {
|
||||
"php": ">=8.1",
|
||||
"guzzlehttp/guzzle": "^7.4.5",
|
||||
"guzzlehttp/psr7": "^2.4.5",
|
||||
"guzzlehttp/promises": "^2.0",
|
||||
"mtdowling/jmespath.php": "^2.8.0",
|
||||
"ext-pcre": "*",
|
||||
"ext-json": "*",
|
||||
"ext-simplexml": "*",
|
||||
"aws/aws-crt-php": "^1.2.3",
|
||||
"psr/http-message": "^1.0 || ^2.0",
|
||||
"symfony/filesystem": "^v5.4.45 || ^v6.4.3 || ^v7.1.0 || ^v8.0.0"
|
||||
},
|
||||
"require-dev": {
|
||||
"composer/composer" : "^2.7.8",
|
||||
"ext-openssl": "*",
|
||||
"ext-dom": "*",
|
||||
"ext-sockets": "*",
|
||||
"phpunit/phpunit": "^9.6",
|
||||
"behat/behat": "~3.0",
|
||||
"doctrine/cache": "~1.4",
|
||||
"aws/aws-php-sns-message-validator": "~1.0",
|
||||
"andrewsville/php-token-reflection": "^1.4",
|
||||
"psr/cache": "^2.0 || ^3.0",
|
||||
"psr/simple-cache": "^2.0 || ^3.0",
|
||||
"sebastian/comparator": "^1.2.3 || ^4.0 || ^5.0",
|
||||
"yoast/phpunit-polyfills": "^2.0",
|
||||
"dms/phpunit-arraysubset-asserts": "^0.4.0"
|
||||
},
|
||||
"suggest": {
|
||||
"ext-openssl": "Allows working with CloudFront private distributions and verifying received SNS messages",
|
||||
"ext-curl": "To send requests using cURL",
|
||||
"ext-sockets": "To use client-side monitoring",
|
||||
"ext-pcntl": "To use client-side monitoring",
|
||||
"doctrine/cache": "To use the DoctrineCacheAdapter",
|
||||
"aws/aws-php-sns-message-validator": "To validate incoming SNS notifications"
|
||||
},
|
||||
"autoload": {
|
||||
"psr-4": {
|
||||
"Aws\\": "src/"
|
||||
},
|
||||
"files": ["src/functions.php"],
|
||||
"exclude-from-classmap": ["src/data/"]
|
||||
},
|
||||
"autoload-dev": {
|
||||
"psr-4": {
|
||||
"Aws\\Test\\": "tests/"
|
||||
},
|
||||
"classmap": ["build/"]
|
||||
},
|
||||
"extra": {
|
||||
"branch-alias": {
|
||||
"dev-master": "3.0-dev"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -21,10 +21,14 @@ use Aws\AwsClient;
|
|||
* @method \GuzzleHttp\Promise\Promise createAnalyzerAsync(array $args = [])
|
||||
* @method \Aws\Result createArchiveRule(array $args = [])
|
||||
* @method \GuzzleHttp\Promise\Promise createArchiveRuleAsync(array $args = [])
|
||||
* @method \Aws\Result createServiceLinkedAnalyzer(array $args = [])
|
||||
* @method \GuzzleHttp\Promise\Promise createServiceLinkedAnalyzerAsync(array $args = [])
|
||||
* @method \Aws\Result deleteAnalyzer(array $args = [])
|
||||
* @method \GuzzleHttp\Promise\Promise deleteAnalyzerAsync(array $args = [])
|
||||
* @method \Aws\Result deleteArchiveRule(array $args = [])
|
||||
* @method \GuzzleHttp\Promise\Promise deleteArchiveRuleAsync(array $args = [])
|
||||
* @method \Aws\Result deleteServiceLinkedAnalyzer(array $args = [])
|
||||
* @method \GuzzleHttp\Promise\Promise deleteServiceLinkedAnalyzerAsync(array $args = [])
|
||||
* @method \Aws\Result generateFindingRecommendation(array $args = [])
|
||||
* @method \GuzzleHttp\Promise\Promise generateFindingRecommendationAsync(array $args = [])
|
||||
* @method \Aws\Result getAccessPreview(array $args = [])
|
||||
|
|
|
|||
2
vendor/aws/aws-sdk-php/src/Acm/AcmClient.php
vendored
2
vendor/aws/aws-sdk-php/src/Acm/AcmClient.php
vendored
|
|
@ -36,6 +36,8 @@ use Aws\AwsClient;
|
|||
* @method \GuzzleHttp\Promise\Promise resendValidationEmailAsync(array $args = [])
|
||||
* @method \Aws\Result revokeCertificate(array $args = [])
|
||||
* @method \GuzzleHttp\Promise\Promise revokeCertificateAsync(array $args = [])
|
||||
* @method \Aws\Result searchCertificates(array $args = [])
|
||||
* @method \GuzzleHttp\Promise\Promise searchCertificatesAsync(array $args = [])
|
||||
* @method \Aws\Result updateCertificateOptions(array $args = [])
|
||||
* @method \GuzzleHttp\Promise\Promise updateCertificateOptionsAsync(array $args = [])
|
||||
*/
|
||||
|
|
|
|||
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue