The OXID eSales Consistency Check component is designed to perform various consistency checks on your eShop. It primarily focuses on detecting unused images and provides multiple actions such as
- Performing a dry-run to see how many images would be affected
 - Moving unused images to another location
 - Deleting unused images to free up storage
 
This component ensures that your eShop remains optimized by helping you remove or move unnecessary image files while keeping track of the changes.
- Provides commands to move or delete unused images.
 - Supports dry-run mode, allowing safe testing before making changes.
 - Filter unused images across product, categories, and manufacturers.
 - Progress bar for real-time feedback
 - Logs all actions in log/oe_consistency_check.log for review and auditing.
 - Customizable directory paths for images.
 
This component assumes you have OXID eShop Compilation version 7.4.0 installed.
To install this component in your OXID eShop environment, use Composer:
$ composer require oxid-esales/consistency-check-toolThe installation instructions below are shown for the current SDK for shop 7.4. Make sure your system meets the requirements of the SDK.
- 
Ensure all docker containers are down to avoid port conflicts
 - 
Clone the SDK for the new project
 
echo MyProject && git clone https://github.com/OXID-eSales/docker-eshop-sdk.git $_ && cd $_- Clone the repository to the source directory
 
git clone --recurse-submodules https://github.com/OXID-eSales/consistency-check-tool.git --branch=b-7.4.x ./source- Run the recipe to setup the development environment
 
./source/recipes/setup-development.shYou should be able to access the shop with http://localhost.local and the admin panel with http://localhost.local/admin (credentials: noreply@oxid-esales.com / admin)
The tool provides several commands for managing unused images.
Move unused images to a specific directory (e.g., /backup/images)
$ vendor/bin/oe-console oe:consistency_check:move-unused-images --destination=out/pictures/backup/When specifying a destination folder for moving images, note that paths are relative to the shop root.
For example:
- If you set 
destinationto/, the source and target directories will be identical. - To move images to 
out/pictures/backup/, simply provideout/pictures/backup/as the destination. 
Permanently delete unused images:
$ vendor/bin/oe-console oe:consistency_check:delete-unused-imagesTo perform a dry-run (simulate the move without making changes):
$ vendor/bin/oe-console oe:consistency_check:delete-unused-images --dry-run
$ vendor/bin/oe-console oe:consistency_check:move-unused-images --destination=/path/to/backup --dry-runTo view detailed logs of affected files (e.g., which images would be deleted or moved), you can pass the -v flag along with your command:
$ vendor/bin/oe-console oe:consistency_check:delete-unused-images --dry-run -v
$ vendor/bin/oe-console oe:consistency_check:move-unused-images --destination=/path/to/backup --dry-run -vWhen -v is enabled, the command displays relevant entries from the consistency check log file directly in the console output. This is especially useful for shop owners who want to inspect which images are impacted before taking action.
Process specific entity types (e.g., product, category, manufacturer):
$ vendor/bin/oe-console oe:consistency_check:delete-unused-images --type=productIf this parameter is not set the application perform actions on all images.
All operations, including moved and deleted images, are logged in:
log/oe_consistency_check.log
This log file helps you track the changes and verify actions performed by the tool.
There are several parameters in the services.yaml that can be customized for the module:
app.log_file_path- Path to the log file where the consistency check results will be stored.
To modify the parameters, create the configurable_services.yaml file in the var/configuration folder as
described in the Documentation,
and overwrite the parameters you want to change. Ex.:
parameters:
  app.log_file_path: '/my/custom/filepath/to.log'If you are using custom directory paths for storing images (products, categories, manufacturers), overwrite the
services defined in src/ImageManager/Entity/services.yaml by using the same procedure described in the
Documentation
for service overriding - use already mentioned configurable_services.yaml file in the var/configuration folder.:
Example override for product images:
services:
  oxid_esales.consistency_check.entity.image_entity.product.oxpic1:
    class: OxidEsales\ConsistencyCheck\ImageManager\Entity\ImageEntity
    arguments:
      $name: 'Product'
      $table: 'oxarticles'
      $fieldName: 'OXPIC1'
      $directory: 'custom/directory/to/pictures/master/products/1'
    tags: ['oe.consistency_check.image_entity']
$ composer update
$ composer static- 
Install this component in a running OXID eShop
 - 
run Unit + Integration tests
 
$ composer phpunit- run Unit tests
 
$ ./vendor/bin/phpunit -c vendor/oxid-esales/consistency-check-tool/tests/phpunit.xml- run Integration tests
 
$ ./vendor/bin/phpunit --bootstrap=./source/bootstrap.php -c vendor/oxid-esales/consistency-check-tool/tests/phpintegration.xmlThis tool uses a default log path /var/www/source/log/oe_consistency_check.log in a standard OXID eShop
directory structure. However, if your project uses a different structure (e.g. /var/www/custom/source/log), this
directory may not exist, and you may encounter an error like:
There is no existing directory at "/var/www/custom/source/log" and its not buildable: Permission denied.
Refer to the "Customizable parameters" section to learn how to change the log file path.