Plugins List

外掛說明

這是一個旨在提供外掛及外掛開發者外部連結的簡易 WordPress 外掛。

這個外掛會使用短代碼方式將 XHTML 清單插入任何文章/頁面。如需自訂清單顯示結果,使用格式引數便能輸出指定的清單內容格式。此外,這個外掛的短代碼也包含一個能顯示未啟用外掛的格式引數。

主要功能

  • 提供能進行格式化並顯示外掛資訊的簡易範本
  • 範本提供的標籤可以自動連結文字內容
  • 可選擇要輸出哪些外掛資料
  • 如果需要,可以同時顯示未啟用的外掛及已啟用的外掛
  • 經過快取的輸出結果,能提供非常快的回應
  • 提供一個可顯示網站外掛數量的獨立短代碼

感謝 Matej Nastran 所開發的 My plugins,這是 Plugins List 的開發構想來源。

前往這個外掛的 GitHub 存放庫,便能取得開發中的最新程式碼、瞭解規劃中的改進功能及外掛已知問題。

使用方式說明

如果要顯示網站上已安裝並啟用的外掛清單,請在文章或頁面插入以下短代碼:

<ul>[plugins_list]</ul>

短代碼中可以使用 format 引數及數個預先定義的標籤自訂並格式化輸出結果。範例如下:

[plugins_list format="{{LinkedTitle}} - {{LinkedAuthor}}</br>"]

這些預先定義的標籤為 TitlePluginURIAuthorAuthorURIVersionDescriptionLinkedTitleLinkedAuthor。請以雙括號括住這些標籤。

如果需要將未啟用的外掛一併顯示在外掛清單中,請在短代碼中加入 show_inactive=true 參數。

<ul>[plugins_list show_inactive=true]</ul>

外掛列表可以透過 CSS 將顯示結果樣式化,僅需在 format 引數或其周圍的元素放置 classid 屬性。

依照預設,搜尋引擎機器人會前往外掛清單提供的連結;如果想讓將這些連結標註為 nofollow (不前往),僅需加入 nofollow=true 參數。範例如下:

<ul>[plugins_list nofollow=true]</ul>

也可以要求瀏覽器在新分頁/新視窗中開啟連結。範例如下:

<ul>[plugins_list target="_blank"]</ul>

最後,如果外掛清單輸出結果需要以開發者名稱排序而非以外掛名稱排序,請使用 by_author 參數。範例如下:

<ul>[plugins_list by_author=true]</ul><h3>Using HTML</h3>

如果要使用 HTML 程式碼格式化外掛清單是可行的,但這可能會導致視覺化編輯器的剖析錯誤,甚至會讓不需要出現的字元 (例如異常的執行個體段落標籤) 顯示在清單輸出中。如果真的要使用 HTML 程式碼,強烈建議使用雙括號取代 <> 將 HTML 標籤括住。這個外掛會在輸出前修正這個問題,但這也代表視覺化編輯器不會試著解譯 HTML 程式碼。

範例如下:

<ul>[plugins_list format="{{li}}{{LinkedTitle}} - {{LinkedAuthor}}{{/li}}"]</ul>

這些雙括號字元會在輸出時進行修正,然後在頁面上輸出正確的項目清單。

Plugins List 的外掛清單快取機制

依照預設,Plugins List 所產生的外掛清單會每 5 分鐘重新快取一次,確保盡可能不影響主機效能。如需變更這項預設設定,請使用 cache 參數並設定整數分鐘值;如果將這個參數值設定為 false,便會關閉這個外掛的外掛清單頁面快取機制。

範例如下:

<ul>[plugins_list cache=60]</ul>

上列參數值會將頁面快取保留 1 小時 (60 分鐘),而下列設定則會關閉快取機制。

<ul>[plugins_list cache=false]</ul><h3>Plugin Count</h3>

這個外掛還提供一個可以顯示網站外掛安裝數量的短代碼。只要將 [plugins_number] 插入文章或頁面,預設會傳回目前已啟用外掛的數量。

如果需要顯示已啟用及未啟用的外掛總計數量,請使用 [plugins_number inactive=true],而使用 [plugins_number inactive=true active=false] 可以只未啟用外掛的數量。

這個短代碼預設一樣會將結果進行快取。如需變更快取的小時數,請使用 cache 參數,而將參數值設定為 false 便能關閉快取。範例如下:

[plugins_number inactive=true cache=2]<h3>Reviews & Mentions</h3>

預設的 WordPress 內容頁面結構整齊

螢幕擷圖

  • 外掛清單使用範例

安裝方式

在 WordPress 管理後台的 [外掛] 選單 ([外掛]→[新增外掛]) 中可以找到及安裝 Plugins List,也可以從 WordPress.org 手動下載並安裝…

  1. 將完整的 plugins-list 資料夾上傳至網站的 wp-content/plugins/ 目錄中。
  2. 請在 WordPress 管理後台的 [外掛] 選單啟用這個外掛。

完成後便可使用。

常見問題集

這個外掛將括住標籤的井號變更為雙括號的原因為何?

在範本中使用雙括號 (即 {{{{) 是最標準的作法,因此這個外掛會朝這個目標邁進。但是我 (指開發者) 不想貿然終止現有的使用方式,因此這個外掛會同時支援新舊兩種方法。不過我沒有將舊方法記錄於此,因為我希望大家改用雙括號這種新方法。

使用者評論

2019 年 5 月 15 日
I like to show a credit page on my websites but each time you add or replace a plugin, you are supposed to update that page. That's a burden! This light plugin takes care of it. Awsome! 🙂
2018 年 7 月 22 日
A nice way to expose the work of the plugin designers on his site!
2018 年 6 月 22 日
I have been looking for a simple plugin that will provide a list of all plugins on my client(s) site. This is the one. Thank you.
2016 年 9 月 3 日
I think this is question, when you see a great website, you might want to get answered. So here's a handy dandy plugin that does it all for you. The only thing you have to add to it, is to answer this question ~ which ones could you not live without and why?
閱讀全部 10 則使用者評論

參與者及開發者

以下人員參與了開源軟體〈Plugins List〉的開發相關工作。

參與者

Plugins List 外掛目前已有 3 個本地化語言版本。 感謝全部譯者為這個外掛做出的貢獻。

將 Plugins List 外掛本地化為台灣繁體中文版

對開發相關資訊感興趣?

任何人均可瀏覽程式碼、查看 SVN 存放庫,或透過 RSS 訂閱開發記錄

變更記錄

Learn more about my version numbering methodology

2.4.4

  • Enhancement: To reduce the plugin’s output footprint, I’ve removed the HTML comments – they were useful for the rare case of debugging but adding un-needed content to each page load for the 99.99999% rest of the time
  • Enhancement: Now follows the best code standards – not just the official WordPress standards but also the strictest WordPress VIP standards too
  • Enhancement: Added donation links back in and generally improved the plugin meta
  • Maintenance: Removed PHP version check as this is now covered in the plugin README

2.4.3

  • Enhancement: A PHP detection function has been added, so an error will be reported if the required level of PHP is not available
  • Bug: Now using uasort instead of usort to get around an issue with array keys. Thanks to dgw

2.4.2

  • Maintenance: This release sees the minimum PHP version required, increased to PHP 7. If you’re running on an older release, please continue to use 2.4.1 until you’re able to upgrade your PHP
  • Enhancement: Because minimal VIP coding standards are not enough, it now passes the full-fat VIP standards as well
  • Enhancement: Can now sort the output by author

2.4.1

  • Enhancement: Code quality enhancements to bring it in line with WordPress.com VIP coding standards

2.4

  • Enhancement: Now uses the standard double braces for templates (and HTML as well)
  • Enhancement: Can now specify to list just inactive plugins
  • Enhancement: Now using a time constant instead of a hard-coded number
  • Enhancement: Added Github links to plugin meta
  • Maintenance: Changed caching from hours to minutes
  • Maintenance: Tidying up of code

2.3.2

  • Maintenance: Updates to README
  • Maintenance: Removed un-needed language folder and domain path
  • Maintenance: Removed donation links

2.3.1

  • Bug: A number of the tags had stopped working. I don’t know what I’d been drinking when I tested the last release but it can’t have been good. Now all fixed
  • Maintenance: Plugin now requires WP 4.6 to work as we need to move with the times
  • Maintenance: Updated the links to my site because I like to move around
  • Maintenance: Tweaked this README to reflect the changes above but also the new plugin directory layout

2.3

  • Enhancement: Improved the performance of the search/replace of tags
  • Enhancement: Added a method of adding HTML to the formatting without causing issues with the visual editor
  • Enhancement: After WP 4.6 you no longer need to include the plugin domain. So I don’t!
  • Maintenance: Merged all the included files together as the total amount of code wasn’t enough to justify having it split!

2.2.7

  • Maintenance: Updated branding, inc. adding donation links

2.2.6

  • Maintenance: Updated branding
  • Maintenance: Stopped the naughty behavior of hard-coding the plugin folder name in INCLUDES
  • Maintenance: Removed the apl- prefix from the file names

2.2.5

  • Maintenance: Added text domain and domain path

2.2.4

  • Enhancement: Added internationalization

2.2.3

  • Maintenance: Updated links and changed branding

2.2.2

  • Bug: Accidentally left some debug output in place. Sorry!

2.2.1

  • Bug: Fixed PHP error
  • Bug: Corrected caching
  • Enhancement: Added uninstaller – cache will be wiped upon uninstall

2.2

  • Maintenance: Added instructions for generating list via PHP function call
  • Enhancement: Improved caching so that data is not left behind on options table
  • Enhancement: Prevent plugin’s HTML comment from appearing around each entry
  • Enhancement: Add link target and nofollow option
  • Enhancement: Added shortcode to return number of plugins

2.1

  • Maintenance: Divided code into separate files all of which, except the main launch file, have been added into an ‘includes’ folder
  • Maintenance: Split main code into separate functions to make future enhancement easier. This and the previous change have been made in preparation for version 3.
  • Enhancement: Added caching
  • Enhancement: Comment added to HTML output with debug information on

2.0

  • Maintenance: Renamed plugin and functions within it
  • Maintenance: Improved code readability, including adding PHPDoc comments
  • Maintenance: Re-written README
  • Maintenance: Changed default format to not display plugin version, as this is a security risk
  • Enhancement: Added links to plugin meta