前言介紹
- 這款 WordPress 外掛「Enable CORS」是 2023-03-29 上架。
- 目前有 5000 個安裝啟用數。
- 上一次更新是 2025-03-15,距離現在已有 49 天。
- 外掛最低要求 WordPress 4.7 以上版本才可以安裝。
- 外掛要求網站主機運作至少需要 PHP 版本 7.1 以上。
- 有 2 人給過評分。
- 還沒有人在論壇上發問,可能目前使用數不多,還沒有什麼大問題。
外掛協作開發者
devkabir |
外掛標籤
fix | ajax | cors | error | enable |
內容簡介
外掛會收集網站 URL 與啟用的外掛列表,以提供支援。但不會分享給第三方。本外掛可幫助解決CORS問題,讓您輕鬆存取跨域資源。只需幾個簡單點擊,就能在網站上啟用CORS支援,告別繁瑣的錯誤訊息。此外,該工具易於使用,並與所有主要瀏覽器兼容。不要錯過這個可改變遊戲規則的解決方案!趕快試用,革新您存取跨域資源的方式。
1. 什麼是CORS?
- CORS (Cross-Origin Resource Sharing) 是由網路瀏覽器所實作的安全功能,會封鎖網頁向不同於該頁面的伺服器所發送的請求。這是為了防止惡意網站以使用者身份發佈未授權的請求至其他網站。
- 然而,也有合法原因需要網頁向不同域名發送請求,例如存取第三方 API 或 CDN 中的資源。在這些情況下,網頁發送請求的伺服器可以在其回應中加入特殊標頭以告知瀏覽器允許網頁存取該資源。
- 如果網頁向不同的域名發送請求,而該伺服器沒有在其回應中加入必要的CORS標頭,則瀏覽器會阻擋該請求,並且網頁會收到CORS錯誤。對開發人員來說,這可能令他們無法存取所需的資源以建置他們的網站或應用程式。
2. 在WordPress上會發生CORS錯誤嗎?
- 是的,WordPress網站也可能發生CORS錯誤。WordPress是一種在網頁伺服器上運行並通過網路瀏覽器向使用者提供網頁的內容管理系統(CMS)。與任何其他網頁一樣,當WordPress網站嘗試向不同域名發送請求而該伺服器並沒有在回應中包含必要的CORS標頭時,就會發生CORS錯誤。
- WordPress網站可能因多種原因遇到CORS錯誤。例如,該網站可能使用外掛或主題向外部API發送請求,或從不同的域名包含資源。在這種情況下,底層的API或資源伺服器需要在回應中包含必要的CORS標頭,才能讓WordPress網站存取它們。
- 在WordPress網站上發生CORS錯誤的另一個可能原因是網站托管在沒有啟用CORS標頭的伺服器上。在這種情況下,該網站將無法向其他域名發送請求,即使該網站伺服器包含了必要的CORS標頭。
3. 如何在WordPress中不使用外掛啟用CORS?
- 有幾種不同的方法可以在WordPress網站上啟用CORS支援,而不使用外掛。
- 修改伺服器配置:如果您可以使用您的WordPress網站托管的伺服器,則可以通過在該伺服器的配置中添加必要的標頭來啟用CORS支援。實際操作方式會依據您使用的伺服器類型以及其設定方式而有所不同。
- 請注意,修改伺服器配置或向您的WordPress網站添加程式碼可能會產生意外後果,因此在部署於應用生產環境之前,務必進行充分的測試。
4. 本外掛如何幫助支援CORS?
- 本外掛可幫助您解決CORS問題,讓您輕鬆存取跨域資源。只需幾個簡單點擊,就能在網站上啟用CORS支援,告別繁瑣的錯誤訊息。此外,該工具易於使用,並與所有主要瀏覽器兼容。讓您不要錯過這個可改變遊戲規則的解決方案!趕快試用,革新您存取跨域資源的方式。
原文外掛簡介
Are you tired of dealing with pesky CORS errors on your website? Do you want to finally be able to access cross-origin resources with ease? Look no further! This plugin is here to solve all of your CORS issues. With just a few simple clicks, you can enable CORS support on your website and say goodbye to frustrating error messages. Plus, This tool is easy to use and compatible with all major browsers. Don’t miss out on this game-changing solution! Try today and revolutionize the way you access cross-origin resources.
What is CORS ?
CORS (Cross-Origin Resource Sharing) is a security feature implemented by web browsers that blocks web pages from making requests to a different domain than the one that served the web page. This is done to prevent malicious websites from making unauthorized requests to other websites on behalf of the user.
However, there may be legitimate reasons for a web page to make requests to a different domain, such as accessing a third-party API or including resources from a CDN. In these cases, the server that the web page is making the request to can include special headers in its responses that tell the browser to allow the web page to access the resources.
If a web page tries to make a request to a different domain and the server doesn’t include the necessary CORS headers, the browser will block the request and the web page will receive a CORS error. This can be frustrating for developers, as it can prevent them from accessing resources they need to build their websites or applications.
Does the cors error occur on WordPress?
Yes, CORS errors can occur on WordPress websites. WordPress is a content management system (CMS) that runs on a web server and serves web pages to users through a web browser. As with any other web page, CORS errors can occur when a WordPress website tries to make requests to a different domain and the server doesn’t include the necessary CORS headers in its responses.
There are several reasons why a WordPress website might encounter CORS errors. For example, the website might be using a plugin or theme that makes requests to an external API or includes resources from a different domain. In this case, the server hosting the API or resources would need to include the necessary CORS headers in its responses to allow the WordPress website to access them.
Another possible cause of CORS errors on WordPress websites is if the website is hosted on a server that has CORS headers disabled. In this case, the website would not be able to make requests to any other domains, even if the server hosting those domains includes the necessary CORS headers.
To fix CORS errors on a WordPress website, you will need to either configure the server to include the necessary CORS headers or modify the website to make requests to a different domain that does include the necessary headers. It’s also possible to use a plugin or other tool to enable CORS support on your WordPress website.
How do I enable cors without a plugin in WordPress?
There are a few different ways you can enable CORS support on a WordPress website without using a plugin.
Modify the server configuration: If you have access to the server that your WordPress website is hosted on, you can enable CORS by adding the necessary headers to the server’s configuration. The exact steps for doing this will depend on the type of server you are using and how it is configured.
Be aware that modifying the server configuration or adding code to your WordPress website can have unintended consequences, so it’s a good idea to test any changes thoroughly before deploying them to a production environment.
How does your plugin help with CORS support?
This plugin adds support for CORS to your WordPress website, allowing you to specify which domains are allowed to access your website’s resources, and which types of requests are allowed. This helps to ensure that your website remains secure while allowing authorized access to resources from other domains.
If your site is serving data to others, then This plugin will work. Otherwise, do not install this plugin, It will be waste of your time only.
Why Choose ‘Enable CORS’
Save Time: No more manual configuration of CORS headers. This plugin does it for you.
Improve Security: Specify which domains are allowed to access your website’s resources.
Ease of Use: This plugin is easy to use and compatible with all major browsers.
Excellent Support: I offer top-notch paid support to assist you whenever you need help.
Try ‘Enable CORS’ today and experience the difference!
Testing Your Setup
Source Site:
Install and activate the Enable CORS plugin.
Install and activate the Cors Tester plugin.
Target Site:
Install and activate the CORS Shortcode Plugin.
It will add a page with a short code [cors_display]
Edit and save the page content as follows:
php
[cors_display base_url="http://source-site.com"]
If you don’t provide a base_url, it will default to the target site’s URL. So cors will be failed.
Testing:
Visit the page where you added the shortcode. If everything is set up correctly, the current time data from the Source Site will be displayed.
For a detailed walkthrough and additional help on testing your configuration, please refer to the following link: How to Test Your Setup
Note to all users
I appreciate your understanding that this project is pursued in my spare time, outside of my regular professional commitments. As such, there may be delays in responding to inquiries or implementing updates. I assure you that I am committed to this project, as I personally use this plugin for my own website and for several of my clients. If you are comfortable with this arrangement, I encourage you to install the plugin. However, if immediate support and frequent updates are crucial for you, I kindly suggest exploring other options that may better suit your needs.
Thank You
Dakini and Irina for their contributions to the Russian translation.
各版本下載點
- 方法一:點下方版本號的連結下載 ZIP 檔案後,登入網站後台左側選單「外掛」的「安裝外掛」,然後選擇上方的「上傳外掛」,把下載回去的 ZIP 外掛打包檔案上傳上去安裝與啟用。
- 方法二:透過「安裝外掛」的畫面右方搜尋功能,搜尋外掛名稱「Enable CORS」來進行安裝。
(建議使用方法二,確保安裝的版本符合當前運作的 WordPress 環境。
1.2.2 | 1.2.3 | 1.2.4 | 2.0.0 | trunk |
延伸相關外掛(你可能也想知道)
WP Maximum Execution Time Exceeded 》, 注意:請先閱讀安裝說明。WP Maximum Execution Time Exceeded外掛需要您進行網站備份程序。, , WP Maximum Execution Time Exceeded是一個非常簡單且有效...。
WPS Bidouille 》繁體中文, WPS Bidouille 提供有關您的 WordPress 的資訊並包含優化工具。, 您將能夠了解有關您伺服器的所有資訊,優化某些設定並下載這些值的 TXT 報告。, ,...。
Link Juice Keeper 》錯誤 404 ( 找不到頁面 ) 很常見,也是造成搜尋引擎,例如 Google,把網站排名降低的主要原因之一。處理 404 錯誤對於非技術人員來說可能相當複雜。有了這個...。
Fatal Error Notify 》該外掛在偵測到網站發生致命錯誤(或其他錯誤層級,可配置)時,會發送電子郵件通知給您。, 與傳統的運行時間監控服務不同,這個外掛可以在偵測到任何頁面或...。
410 for WordPress 》此外掛會對你的網誌上已經不存在的文章發出 HTTP 410 回應。當你刪除一篇文章或頁面時,此外掛會記錄該網址,並在該網址被請求時發出 410 回應。你也可以手動...。
WordPress Error Monitoring by Bugsnag 》Bugsnag 是一個 WordPress 外掛程式,可以自動偵測你的 WordPress 網站上的錯誤和當機問題,並透過電子郵件、聊天或工單系統通知你。, 所有的網站都有可能會...。
Rollbar 》Rollbar 蒐集您的應用程式中發生的錯誤、通知並分析這些錯誤,以方便您進行除錯並加以修復。, 此外掛可將 Rollbar 整合到 WordPress 安裝程式中。, 透過這裡...。
Better 404 Redirect To Homepage 》, 此外掛已被整合至Slim SEO外掛中,並將由Slim SEO維護。請改使用Slim SEO外掛。, , 避免404錯誤,因為當你有許多404連結時,它會對SEO產生嚴重的影響。404...。
Custom Error Pages 》WordPress 內建自訂 404 頁面支援所有主題。但是其他常見錯誤如 401 和 403 呢?你只能看到 Web Server 提供的平庸錯誤頁面。, 使用此外掛,你可以輕鬆建立任...。
Custom Error Messages for Gravity Forms 》這個外掛可以讓您為GravityForms的輸入欄位自訂錯誤訊息。我們支援必填欄位、唯一性驗證以及電子郵件格式驗證錯誤訊息的自訂。, 連結, , 網站, 支援, 。
BugFu Console Debugger 》使用瀏覽器控制台(不需要擴充)將您的佈景主題/外掛 PHP 代碼記錄/除錯。專為佈景主題和外掛開發人員製作。, 如何檢查 BugFu 是否運作, 打開您的瀏覽器控制...。
F4 Error Pages 》有時候 WordPress 預設的錯誤頁面處理功能不夠,因為它只顯示簡單的文字,或者您必須建立包含 (更多) 靜態內容的自訂 404 模板。, F4 Error Pages 允許您將任...。
WP Output Log File 》這個外掛可以控制輸出日誌檔案,無論是否開啟 WP_DEBUG 模式。, 使用此外掛,您可以指定輸出目錄和檔案名稱,並可下載和刪除檔案。, 除此之外,您還可以指定...。
Safe Mode 》此外掛可為 WordPress 啟用安全模式,這意味著:, , 不會載入任何外掛。, 會臨時啟用預設佈景主題(若已安裝)。, , 為什麼有用?, 當 WordPress 網站出現問...。
Disable Errors in Plugins 》禁用外掛錯誤(Disable Errors in Plugins)是一個 WordPress 外掛,它可以簡單地停用所有外掛的錯誤報告和錯誤日誌。, 這個外掛主要用於開發目的。它並不鼓...。