HowTo
加載速度慢如牛?揭秘如何找出Wordpress網站加載緩慢的原因!
WordPress作為一個老牌的CMS系統,有著龐大插件與豐富的社群資源。然而,它自身也是變得相當臃腫。優化WordPress網站的速度已經成為一個老生常談的話題,其解決方法無非就是以下幾種:
Google Pixel 7a 免 Root 解鎖 VoLTE 功能
·955 字·2 分鐘
Y Cheung 有張SIM卡很奇怪,在 Pixel 7a手機上無法使用,能識別出號碼,但是就是無法註冊網絡,而這張卡在iPhone上使用是沒問題的。於是上網查了一下,原來是Google搞的鬼!連韓國網友也深受其害。幸好不是沒有解決方案,一二三,搞起!
修復wp_redirect跳轉被瀏覽器緩存
Wordpress中某個下載頁面匿名用戶只能在提交表單後訪問,方法是在頁面加載的時候檢查表單提交成功的標記是否存在,不存在就跳轉去表單頁面,這裡使用了 wp_redirect() 方法。
解決 Drupal 9 Media 列表縮略圖無法生成問題
站點安裝設置失誤導致在S3上缺失了 public://media-icons/ 下的所有文件,如今在media 中上傳任何 video、document、audio 都無法生成縮略圖,fallback 到本地path 提示 404 not found,檢視 Recent log messages 日誌,發現了相關錯誤信息:
Google Universal Analytics 遷移至 Google Analytics 4(GA4)
·687 字·2 分鐘
近來登錄 Google Analytics 管理後台常看到催用戶改用GA4的通知信息(關於通用 Analytics (分析) 即將停止服務說明詳情):
🔔Universal Analytics will no longer process new data in standard properties beginning July 1, 2023. Prepare now by setting up and switching over to a Google Analytics 4 property.
Drupal 9 Views 分頁器設置首頁顯示不同的條目個數
在Drupal Views 中自帶了分頁功能 Pager,可以在界面上自定義每頁要顯示條目個數 Items to display,要跳過的個數 Offset (number of items to skip),總頁數 Number of pages,分頁的標籤 Page Link Labels,指定分頁顯示的個數 Number of pager links visible。
Cross-Origin Resource Sharing (CORS) 跨來源資源共用錯誤解決方法
·932 字·2 分鐘
最近Y cheung 遇到了兩個典型 CORS error問題,XMLHttpRequest 和 Fetch 請求了跨來源資源被瀏覽器阻擋,記錄一下解決方法。
什麼是Cross-Origin Resource Sharing (CORS) 跨來源資源共用? # Cross-Origin Resource Sharing (CORS) is an HTTP-header based mechanism that allows a server to indicate any origins (domain, scheme, or port) other than its own from which a browser should permit loading resources. CORS also relies on a mechanism by which browsers make a “preflight” request to the server hosting the cross-origin resource, in order to check that the server will permit the actual request. In that preflight, the browser sends headers that indicate the HTTP method and headers that will be used in the actual request.
Drupal 9 多語言站點解決 Paragraphs 字段在custom block 中I18翻譯無法正確顯示問題
Drupal 9 多語言站點啟用 Paragraphs 模組,如果在 custom block 中使用了 paragraphs 類型的字段 ,會遇到字段內文字的翻譯無法顯示問題。該 paragraphs 字段的內容始終加載的是 default 的語言內容(通常是英文),需要在custom module 代碼中使用 hook_preprocess_block() 修改一下。