[WordPress] 外掛分享: WP Hydra

WordPress 外掛 WP Hydra 的封面圖片。

前言介紹

  • 這款 WordPress 外掛「WP Hydra」是 2014-12-16 上架。
  • 目前有 1000 個安裝啟用數。
  • 上一次更新是 2019-01-22,距離現在已有 2293 天。超過一年沒更新,安裝要確認版本是否可用。以及後續維護問題!
  • 外掛最低要求 WordPress 4.0 以上版本才可以安裝。
  • 有 10 人給過評分。
  • 還沒有人在論壇上發問,可能目前使用數不多,還沒有什麼大問題。

外掛協作開發者

tyxla |

外掛標籤

wp | hydra | domains | multiple | installation |

內容簡介

WP Hydra 的目的非常簡單明瞭。假設您擁有一個 WordPress 網站,託管於example.com。同時,您也購買了 example.net 和 example.org,希望它們也可以使用相同的網站(同一個安裝),但是使用特定的域名以保持一致的使用者體驗。換句話說,您希望您的 WordPress 安裝可以在多個域名下解析和瀏覽。WP Hydra 可以幫助您實現這一點。

將多個網址指向同一個網站是指從多個不同的域名將流量引導到您的網站的好方法。有兩種實現方式:將其中一個網址重新導向到主要域名,或停放域名,使這些域名指向您的主要域名。

當在地址欄中輸入網址時,重新導向是指將訪問者發送到不同於輸入的網站(或 URL)的網站。如果這是您的首選情況,那麼 WP Hydra 就不需要您使用。

停放域名與重新導向相同,只是顯示在地址欄上的網站名稱不會更改。您可以將多個域名停放到同一個頁面。在停放域名之前,它們必須在有效的域名註冊機構進行註冊。而且,您需要確保名稱伺服器與您的主要網域相同(即您指向的域名)。

多個域名指向同一個網站後,您需要啟用外掛程式。不需要進行其他配置或設置。這將確保 css、js、圖像和連結,它們原本用於原始域與現在用於當前正在查看的域的相同性。這將確保用戶保持在他們原來訪問的站點上,提供一致的使用體驗。

配置

您只需要確保多個域名指向相同的託管和物理位置。

完成後,只需安裝並啟用外掛程式 - 不需要進行其他配置。

進一步自定義 - 過濾器

如果您有一些自定義內容,並且希望其中的 URL 支持多個域名,可以使用 wp_hydra_content 過濾器,例如:

// 我們假設您具有 $content 中的某些內容
$content = apply_filters( 'wp_hydra_content', $content );

如果您有一些自定義 URL 并希望它們支持多個域名,可以使用 wp_hydra_domain 過濾器,例如:

// 我們假設您具有 $content 中的某些內容
$url = apply_filters('wp_hydra_domain', $url);

開發人員的進一步自定義

由於 $wp_hydra 物件是全域的,您只需在其上調用 remove_action() 或 remove_filter 即可輕鬆取消任何默認功能。以下示例將刪除內容的 WP Hydra 行為,但僅針對存檔頁面上的 the_content() 調用:

add_action( 'wp_loaded', 'some_example_here' );
function some_example_here() {
global $wp_hydra;
if( is_archive() ) {
remove_filter( 'the_content', array( $wp_hydra, 'setup_content' ) );
}
}

原文外掛簡介

WP Hydra has a quite straightforward purpose. Say you have a WordPress site, hosted on example.com. You’ve also purchased example.net and example.org, and you want them to also use the same website (the same installation), but to persist with that particular domain to have a consistent user experience. In other terms, you want your WordPress installation to be resolved and browsed at multiple domains. WP Hydra can help you with this.
Pointing multiple URLs to the same website is a good way to direct traffic to your site from several different domain names. You can accomplish this in two ways: either redirect one of the URLs to your primary domain, or park the domains, which point these domains towards your primary domain.
A redirect occurs when typing a web address in the address bar sends a visitor to another website (or URL), different from the one typed in. If this is your preferred case, then WP Hydra will not be of any need to you.
Parking a domain does the same thing as a redirect, except that the website name shown on the address bar does not change. You can park several domains to the same page. They have to be registered with a valid domain registrar before you can park them. Also, you’ll need to make sure the nameservers are the same as your primary domain (the domain that you are pointing towards).
Once your multiple domains point to the same website, you have to activate the plugin. No additional configuration or setup is required. This will make sure that the css, js, images and links that are leading to the original domain are now leading to the domain that you’re currently viewing. This will assure that the users remain on the site that they’ve originally visited, providing consistent experience.
Configuration
You only need to make sure that your multiple domains point to the same hosting, and to the same physical location on your hosting account.
Once this is done, simply install and activate the plugin – no additional configuration is needed.
Further customization – filters
If you have some custom content and you want the URLs within it to support multiple domains, you can use the wp_hydra_content filter, like this:
// we assume that you have some content in $content
$content = apply_filters( 'wp_hydra_content', $content );

If you have some custom URLs somewhere and you want them multiple domains, you can use the wp_hydra_domain filter, like this:
// we assume that you have some content in $content
$url = apply_filters('wp_hydra_domain', $url);

Further customization for developers
Since the $wp_hydra object is global, you can easily unhook any of the default functionality by simply calling remove_action() or remove_filter on it. The following example will remove the WP Hydra behavior of the content, but only for the_content() calls on the archive page:
add_action( 'wp_loaded', 'some_example_here' );
function some_example_here() {
global $wp_hydra;
if( is_archive() ) {
remove_filter( 'the_content', array( $wp_hydra, 'setup_content' ) );
}
}

各版本下載點

  • 方法一:點下方版本號的連結下載 ZIP 檔案後,登入網站後台左側選單「外掛」的「安裝外掛」,然後選擇上方的「上傳外掛」,把下載回去的 ZIP 外掛打包檔案上傳上去安裝與啟用。
  • 方法二:透過「安裝外掛」的畫面右方搜尋功能,搜尋外掛名稱「WP Hydra」來進行安裝。

(建議使用方法二,確保安裝的版本符合當前運作的 WordPress 環境。


1.0 | 1.1 | 1.2 | 1.0.1 | 1.0.2 | 1.0.3 | 1.0.4 | trunk |

延伸相關外掛(你可能也想知道)

  • WPCore Plugin Manager 》WPCore 是一個工具,允許您管理 WordPress 外掛集合,然後快速安裝它們到任何 WordPress 網站上。您可以在 https://wpcore.com 生成您的集合,然後通過將唯一...。
  • WP Install Profiles 》透過自動下載一系列外掛,您可以節省設置新網站所需的時間。只需從 WordPress 外掛目錄中的外掛網址中添加外掛的別名,就可以添加新的外掛。例如,「All In O...。
  • Product Assembly / Gift Wrap / … Cost for WooCommerce 》此外掛可讓您在 WooCommerce 的產品頁面上加入額外選項,例如裝配、禮品包裝或其他服務,並可選擇對此收取費用。, 在 WooCommerce>設定>產品中,您可以設定...。
  • WordPress Sentinel 》WordPress Sentinel 追蹤 WordPress 安裝中的所有檔案(核心、佈景主題、外掛),然後定期重新檢查,並通知管理員有任何檔案在任何方面發生變化。, 大多數 Wo...。
  • Simple blueprint installer 》這個單一使用的外掛讓你在 WordPress 安裝時執行一些初始設定任務變得快速且輕鬆,透過增加兩個新分頁管理及快速執行一些重要任務,這個外掛可以讓你輕鬆地操...。
  • Plugin Installer Speedup 》加快插件安裝速度。, , 不加載特色插件。, 讓搜尋插件按鈕可見。, 將焦點設置到搜尋欄位。, 跳過插件安裝確認。, 添加管理員選單項目,包含『上傳插件』和『...。
  • Website remote Install vor Gravity, WPForms, Formidable, Ninja, Caldera 》這是一個DIY網站安裝系統。讓您的網頁訪客可以透過簡單的表格,使用Gravity Forms、WPForms、Formidable、Ninja Forms、Contact Form 7或Caldera Forms創建Wo...。
  • WP-Portability 》概述, WP-Portability是一個插件,旨在默默地使您的網站更易移植。它旨在促進移動 WordPress 安裝到另一個目錄或服務器或域名所需進行的工作。它使 WordPress...。
  • SVN Updater 》你曾經需要升級外掛到最新版(尚未發布)嗎?, 使用 SVN Updater,你在外掛頁面上會得到一個新的操作(Trunk)。, 此外掛的開發是在 GitHub 上進行的。, 歡迎...。
  • WP Tasks After Install 》這個外掛只能在每個WordPress安裝中使用一次,因為它執行以下初始任務:, , 刪除預設的“Hello World”文章。, 刪除預設的“範例頁面”。, 將未分類的預設類別的...。
  • Remote Control Panel 》遠端控制面板 (https://www.remotecontrolpanel.net/) 是一個網路服務,讓您能夠從一個易於使用的介面備份和管理多個 WordPress 網站。您可以添加多個 WordPr...。
  • QuickWP 》使用 QuickWP 時,您無需再手動安裝外掛程式。QuickWP 讓您可以上傳一個包含外掛程式清單的 txt 檔案,讓這些外掛程式可以自動安裝且啟用。此外掛程式特別適...。

文章
Filter
Apply Filters
Mastodon