內容簡介
WP Composer Sync 是一款 WordPress 外掛,可將 WordPress 安裝的 composer.json 與已安裝的外掛保持同步。
使用方式
安裝後,外掛大部分情況下應可自行運作,但仍有幾個需要注意的事項:
1) 商業外掛並不會收錄在 WordPress.org 的外掛庫中,因此仍需手動修改庫(例如 wpackagist、wp-premium 或使用自訂安裝器或庫)或先添加自訂外掛。WP Composer Sync 將遵循這些庫並保持它們的同步。
2) 當 Composer 安裝套件時,它會完全清空目標目錄,然後再安裝新檔案。因此,WordPress 路徑應僅指定給 WordPress 核心檔案,而其他任何東西(例如外掛、佈景主題和 wp-config.php)都會在安裝或更新時被清除。建議您將 wp-config.php 檔案放在 WordPress 路徑的父目錄中(WordPress 可在那裡自動找到它),然後使用符號連接到實際的 wp-content 資料夾。請參閱連結了解更多詳細資訊。
3) Composer 要求版本號碼的通配符(例如 *, 1.* 等)將無法生效(因為 WordPress 不遵循這個)。它們將被 WordPress 使用的確切版本號碼替換。
關於
為何使用?
Composer 是管理 WordPress 和它的外掛的好方法。然而,在真實運作中,當管理使用者透過 wp-admin 或 S/FTP 安裝外掛時,它的內容可能會與實際網站不一致。
如何運作?
使用 WordPress 的「plugins_loaded」動作和連結,此外掛會檢查您的 composer.json 檔案是否有任何過時或未找到的外掛,並自動將它們添加到 require 段落中。
路線圖
該外掛已適用於生產環境,但未來將添加一些額外的功能和特性:
1) 添加能夠在https://github.com/balbuf/composer-wp和 wpackagist之間進行選擇的功能
2) 當前僅同步外掛和 WordPress 核心,添加同步佈景主題的功能
3) 研究一些更有效地監控外掛上傳和更改的方法(例如連結 連結,連結 和 連結或 Transients連結 連結 或連結)。
外掛標籤
開發者團隊
📦 歷史版本下載
原文外掛簡介
WP Composer Sync is a WordPress plugin that keeps a WordPress installation’s composer.json synchronised with the plugins installed.
Usage
Once installed the plugin should be largely set and forget, however there a couple of gotchas.
1) Commercial plugins that are not available from the WordPress.org plugins repository will still be added you will need to manually modify the repository (eg. wpackagist, wp-premium or using a custom installer or repository) or add your custom plugins first. WP Composer Sync will then honor these repositories and keep them synchronised as well.
2) When composer installs a package, it completely empties the target directory before installing the new files. As such, the WordPress path should be designated for WordPress core files only, as anything else (e.g. plugins, themes, and wp-config.php) will be wiped away on install or update. It is recommended that you keep your wp-config.php file in the parent directory of the WordPress path (WordPress can find it there automatically) and replace the wp-content directory with a symlink to your real wp-content folder. See link for more details.
3) Compposer require versioning wildcards (eg. *, 1.*, etc) will not be honoured (as WordPress does not adhere to this). They will be replaced by the exact version number in use by WordPress.
About
Why?
Composer is a great way to manage WordPress and its plugins. However in real life it runs the risk of becoming outdated with the actual contents of the website when admin users are installing plugins via wp-admin or S/FTP.
How?
Using WordPress’s “plugins_loaded” action and link, this plugin will check your composer.json file for any outdated or unfound plugins and will automatically add them to the require section.
Roadmap
The plugin is production ready however there are some additional functions and features which will be added in the future:
1) Add ability to select bewteen https://github.com/balbuf/composer-wp and wpackagist
2) Currently only syncs plugin and wordpress core, add ability to sync themes
3) Research some ways to monitor plugin-uploads and changes more effectively (eg. link link, link and link or Transients link link or link)
