orbital-flight/craft-delete-assets 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

orbital-flight/craft-delete-assets

Composer 安装命令:

composer require orbital-flight/craft-delete-assets

包简介

Free up space by getting rid of those unused assets!

README 文档

README

Free up space by getting rid of those unused assets!

Delete Unused Assets is a simple plugin allowing you to optimize your project by deleting all unused assets in one click.

The plugin detects which assets are used only in a draft or a revision element, and offers an option to delete them as well.

The plugin checks the relations table to determine if an asset is used (related to) anything.

This plugin is in active development and will feature upcoming quality of life updates along with translations.

Analyses

Analyses (also known as scans) are only started from the plugin section*, and thus won't impact your project performance in case it would feature a very large number of assets.

When you access the plugin page, a scan of any unanalyzed volumes is automatically triggered. The plugin also detects if the amount of assets in a given volume has changed since the last scan, which also triggers an analysis.

As of 2.x, changes in assets relationships are not automatically detected (yet), and won't be displayed until the next analysis is performed. This however won't accidentally delete used assets, as any cleanup process always starts a fresh scan of the volume.

You can disable the auto-scan feature in the plugin settings.

*See below "Will it slow my project down?"

Will it slow my project down?

The plugin features several guards and routines to make in run like a breeze. Even if it keeps an eye out for changes in your volumes, the plugin would simply mark them as 'outdated' so they can be scanned later (we don't want a scan each time you add a new asset).

Scans are only run from the plugin's dedicated section and cannot take place anywhere else without you knowing about it. Those scans can be started manually or triggered automatically in case a volume is flagged as outdated. In the later case, only outdated volumes are scanned (you can disable the autoscan from the plugin settings).

The only exception is whenever you add your first asset in a new volume, in which case a micro-scan is performed to be able to keep track of that volume. This can still be avoided by disabling the autoscan feature in the plugin settings.

Disclaimer

The plugin checks the relations table, so it should work in almost every case.

However, and even though the plugin has been thoroughly tested with Craft, Craft Commerce, and most typical Craft installations, it still involves the hard deletion of content, you should therefore use it with caution.

We strongly advise you to have backups of your data, assets, and database in case anything goes wrong.

If any third-party plugin or custom code uses assets from your volumes without recording the relation in the Craft database, you *will* permanently lose them.

Additionally, if the volume from which you want to delete assets is shared by other Craft installations (i.e a staging installation sharing an Amazon S3 volume with the production environment), the plugin will check for relations with the database linked to the project from which it is run. This means it may delete assets that are potentially used in other installation(s).

Requirements

This plugin requires Craft CMS 4.3.5 or later, and PHP 8.0.2 or later.

Installation

You can install this plugin from the Plugin Store or with Composer.

From the Plugin Store

Go to the Plugin Store in your project’s Control Panel and search for “Delete Unused Assets”. Then press “Install”.

With Composer

Open your terminal and run the following commands:

# go to the project directory
cd /path/to/my-project.test

# tell Composer to load the plugin
composer require orbital-flight/craft-delete-assets

# tell Craft to install the plugin
./craft plugin/install delete-assets

orbital-flight/craft-delete-assets 适用场景与选型建议

orbital-flight/craft-delete-assets 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 101 次下载、GitHub Stars 达 1, 最近一次更新时间为 2023 年 11 月 22 日, 在 PHP 生态内属于活跃度较高的组件。

我们在过去多个企业项目中使用过 orbital-flight/craft-delete-assets 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。

围绕 orbital-flight/craft-delete-assets 我们能提供哪些服务?
定制开发 / 二次开发

基于 orbital-flight/craft-delete-assets 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。

BUG 修复 & 性能优化

线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。

项目外包 & 长期维护

承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。

yvsm@zunyunkeji.com QQ:316430983 微信:yvsm316 西安尊云信息科技 · 专注 PHP / Go / 分布式系统研发

统计信息

  • 总下载量: 101
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 1
  • 点击次数: 9
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 1
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: mit
  • 更新时间: 2023-11-22