Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,16 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [1.3.1] - 2025-06-25

### Fixed

- Added `defined( 'ABSPATH' ) || exit` guards to all PHP source files

### Added

- `uninstall.php` for clean plugin removal

## [1.3.0] - 2026-02-07

### Fixed
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "vmfa-rules-engine",
"version": "1.3.0",
"version": "1.3.1",
"description": "Rule-based automatic folder assignment for media uploads",
"author": "Per Soderlind",
"license": "GPL-2.0-or-later",
Expand Down
6 changes: 5 additions & 1 deletion readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ Tags: media library, virtual folders, automation, rules engine, media organizati
Requires at least: 6.8
Tested up to: 6.8
Requires PHP: 8.3
Stable tag: 1.3.0
Stable tag: 1.3.1
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Expand Down Expand Up @@ -108,6 +108,10 @@ Each imported file will be evaluated against your rules and assigned to the matc

== Changelog ==

= 1.3.1 =
* Fixed: Added ABSPATH guards to all PHP source files
* Added: uninstall.php for clean plugin removal

= 1.3.0 =
* Fixed: Changed `vmfa_rules_engine_skip_if_assigned` filter default from `false` to `true`
* Fixed: Rules Engine now respects folder assignments made by Editorial Workflow by default
Expand Down
2 changes: 2 additions & 0 deletions src/php/Conditions/AuthorMatcher.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@

namespace VmfaRulesEngine\Conditions;

defined( 'ABSPATH' ) || exit;

/**
* Matches upload author (user ID).
*/
Expand Down
2 changes: 2 additions & 0 deletions src/php/Conditions/DimensionsMatcher.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@

namespace VmfaRulesEngine\Conditions;

defined( 'ABSPATH' ) || exit;

/**
* Matches image dimensions (width/height).
*/
Expand Down
2 changes: 2 additions & 0 deletions src/php/Conditions/ExifCameraMatcher.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@

namespace VmfaRulesEngine\Conditions;

defined( 'ABSPATH' ) || exit;

/**
* Matches EXIF camera model.
*/
Expand Down
2 changes: 2 additions & 0 deletions src/php/Conditions/ExifDateMatcher.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@

namespace VmfaRulesEngine\Conditions;

defined( 'ABSPATH' ) || exit;

/**
* Matches EXIF date taken.
*/
Expand Down
2 changes: 2 additions & 0 deletions src/php/Conditions/FileSizeMatcher.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@

namespace VmfaRulesEngine\Conditions;

defined( 'ABSPATH' ) || exit;

/**
* Matches file size.
*/
Expand Down
2 changes: 2 additions & 0 deletions src/php/Conditions/FilenameRegexMatcher.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@

namespace VmfaRulesEngine\Conditions;

defined( 'ABSPATH' ) || exit;

/**
* Matches filename against a regular expression.
*/
Expand Down
2 changes: 2 additions & 0 deletions src/php/Conditions/IptcKeywordsMatcher.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@

namespace VmfaRulesEngine\Conditions;

defined( 'ABSPATH' ) || exit;

/**
* Matches IPTC keywords embedded in the image.
*/
Expand Down
2 changes: 2 additions & 0 deletions src/php/Conditions/MatcherInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@

namespace VmfaRulesEngine\Conditions;

defined( 'ABSPATH' ) || exit;

/**
* Interface for condition matchers.
*/
Expand Down
2 changes: 2 additions & 0 deletions src/php/Conditions/MimeTypeMatcher.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@

namespace VmfaRulesEngine\Conditions;

defined( 'ABSPATH' ) || exit;

/**
* Matches file MIME type.
*/
Expand Down
2 changes: 2 additions & 0 deletions src/php/Plugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@

namespace VmfaRulesEngine;

defined( 'ABSPATH' ) || exit;

use VmfaRulesEngine\Admin\SettingsPage;
use VmfaRulesEngine\REST\RulesController;
use VmfaRulesEngine\Services\RuleEvaluator;
Expand Down
2 changes: 2 additions & 0 deletions src/php/REST/RulesController.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@

namespace VmfaRulesEngine\REST;

defined( 'ABSPATH' ) || exit;

use VmfaRulesEngine\Repository\RuleRepository;
use VmfaRulesEngine\Services\BatchProcessor;
use WP_REST_Controller;
Expand Down
2 changes: 2 additions & 0 deletions src/php/Repository/RuleRepository.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@

namespace VmfaRulesEngine\Repository;

defined( 'ABSPATH' ) || exit;

/**
* Handles CRUD operations for rules stored in WordPress options.
*/
Expand Down
2 changes: 2 additions & 0 deletions src/php/Services/BatchProcessor.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@

namespace VmfaRulesEngine\Services;

defined( 'ABSPATH' ) || exit;

/**
* Handles batch rule application to existing media library.
*/
Expand Down
2 changes: 2 additions & 0 deletions src/php/Services/RuleEvaluator.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@

namespace VmfaRulesEngine\Services;

defined( 'ABSPATH' ) || exit;

use VmfaRulesEngine\Repository\RuleRepository;
use VmfaRulesEngine\Conditions\MatcherInterface;
use VmfaRulesEngine\Conditions\FilenameRegexMatcher;
Expand Down
4 changes: 3 additions & 1 deletion src/php/Update/GitHubPluginUpdater.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@

namespace VmfaRulesEngine\Update;

defined( 'ABSPATH' ) || exit;

use YahnisElsts\PluginUpdateChecker\v5\PucFactory;

/**
Expand All @@ -11,7 +13,7 @@
* A reusable class for handling WordPress plugin updates from GitHub repositories
* using the plugin-update-checker library.
*
* @package ContentPoll\Update
* @package VmfaRulesEngine\Update
* @version 1.0.0
* @author Per Soderlind
* @license GPL-2.0+
Expand Down
19 changes: 19 additions & 0 deletions uninstall.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<?php
/**
* Uninstall handler for Virtual Media Folders - Rules Engine.
*
* Fired when the plugin is deleted via the WordPress admin.
*
* @package VmfaRulesEngine
*/

// Exit if not called by WordPress.
if ( ! defined( 'WP_UNINSTALL_PLUGIN' ) ) {
exit;
}

// Delete plugin options.
delete_option( 'vmfa_rules_engine_rules' );

// Delete transients.
delete_transient( 'vmfa_rules_engine_preview_cache' );
4 changes: 2 additions & 2 deletions vmfa-rules-engine.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* Plugin Name: Virtual Media Folders - Rules Engine
* Plugin URI: https://github.com/soderlind/vmfa-rules-engine
* Description: Rule-based automatic folder assignment for media uploads. Add-on for Virtual Media Folders.
* Version: 1.3.0
* Version: 1.3.1
* Author: Per Soderlind
* Author URI: https://soderlind.no
* License: GPL-2.0-or-later
Expand All @@ -20,7 +20,7 @@
defined( 'ABSPATH' ) || exit;

// Plugin constants.
define( 'VMFA_RULES_ENGINE_VERSION', '1.3.0' );
define( 'VMFA_RULES_ENGINE_VERSION', '1.3.1' );
define( 'VMFA_RULES_ENGINE_FILE', __FILE__ );
define( 'VMFA_RULES_ENGINE_PATH', plugin_dir_path( __FILE__ ) );
define( 'VMFA_RULES_ENGINE_URL', plugin_dir_url( __FILE__ ) );
Expand Down