新版 WordPress 預設的佈景主體將不會使用 Google Fonts

新版 WordPress 的預設佈景主體 (Theme) 出於隱私考量,將不會使用 Google Fonts:「Google Fonts are included locally in bundled themes」。

這邊講的是年份系列的 Theme,從 Twenty Twelve (2012) 到 Twenty Seventeen (2017):

再更後新的版本,首先是沒有 Twelve Eighteen (2018) (可以從「Themes by WordPress.org | WordPress.org」這邊翻),而從 Twelve Nineteen (2019) 後都沒有使用 Google Fonts 了,在 GitHub 上的 WordPress/twentynineteen 這邊可以 clone 下來確認:

$ git grep google    
classes/class-twentynineteen-svg-icons.php:         'google-plus' => array(
classes/class-twentynineteen-svg-icons.php:                 'plus.google.com',
classes/class-twentynineteen-svg-icons.php:         'google-plus' => '
classes/class-twentynineteen-svg-icons.php:         'google'      => '

官方還是有給繼續使用 Google Fonts 的方法,在「Continuing to use Google Fonts」這段有提到設定的方式。

Terminal 的 Dark Theme

在「Automatic dark mode for terminal applications」這邊看到讓 terminal 的一些程式支援 Dark Theme 的方式,裡面引用的是「Automatic dark mode for terminal applications」這篇。

可以看到因為 terminal 下沒有標準,所以得 hack 事件發生時要送出的指令,文章裡面給出了 Vim (以及 Tmux)、Alacritty 這幾套程式的 hack。

不過這些 hack 過程算詳細 (而且有說明整個原理),如果有其他 terminal 下的程式有支援 Dark Theme 的話也可以用類似的邏輯套進去。

在手機上看 Trac 的套件

這邊講的是 Safari 這些瀏覽器看 Trac,而不是講 app...

這次從高雄回來,在高鐵上想說用手機看看 Trac,發現桌機版的界面是會動,但在手機上不太好用,所以找看看有什麼套件可以改善...

回到家後找到 BlueFlatTheme 這套 (需要透過 ThemeEnginePlugin 啟用),標語是「A responsive, flat, blue theme using Bootstrap」,拿官方的 screenshot 可以看出來有特地為了寬度比較窄的情況調整:

裝好後用手機測了一下,還是有不滿意的地方,不過改善不少了,先這樣撐著...

玩 Python 下的 ggplot

在「A Dramatic Tour through Python’s Data Visualization Landscape (including ggplot and Altair)」這邊又再次看到 Python 下的 ggplot,以為還算好裝,但實際上好像有點難裝 XD

我平常用的環境是 pyenv 跑 Python 3.5.2。而跑 ggplot 需要用到 _tkinter,這個模組,而這個模組在 Python 3 應該是內建的... 只要你有先裝 tk-dev @_@

所以在弄了半天發現這個問題後,先把 tk-dev 補裝上,再重新安裝 Python 3.5.2:

$ sudo apt-get install tk-dev
$ pyenv install -f 3.5.2
$ pip install -U ggplot

裝好後發現網路上一般建議的寫法好像不會動,又摸了一陣子後發現現在變得物件化了,要改成這樣的方式把檔案存起來:

p = ggplot(...) + ...
p.save('a.png')

另外資料的物件要透過 DataFrame 產生出來,反正不少枚枚角角的細節要了解後才知道怎麼用 @_@

Anyway,程式碼可以在 population-taiwan.py 這邊翻到,人口資料則是從中文維基百科的「臺灣人口普查」這邊拉出來的,最後產生出來的圖片會是這樣:

算是牛刀小試... 話說 theme_xkcd() 效果頗不賴 XDDD

WordPress 緊鑼密鼓的測試 PHP7...

看到「WordPress and PHP7」這篇,先講題外話,居然是 make.wordpress.org 這個網址... XD

回到主題,WordPress 正在測試 PHP 7 的相容性,並且呼籲 theme 與 plguin 作者也應該加入測試。

之所以會這麼重視 PHP 7,主要還是因為對效能的提昇感到興奮:

One of the most notably is substantial performance improvements.Benchmarks of WordPress using PHP7 are showing a 2-3x speed improvement compared to PHP5.6.

目前 blog 跑的是 5.6,等 7.0 正式出的時候來測一次吧,到時候要升級前先打一輪 5.6,升級後再打一輪 7.0,看看效能差異如何。

WordPress 的安全性資訊

在「WPScan Vulnerability Database WordPress Security Resource」這邊看到「WPScan Vulnerability Database」這個站台,直接列出了 WordPress 相關的安全性漏洞。

列出的漏洞包括了 WordPress 本身以及 Plugin、Theme 的部份。不過 WordPress 在有更新時自己應該會提醒才對?

這樣看起來主要是確認一直沒更新的安全性漏洞?