Ultimate Member 終極會員 後台設置慢的問題是由於使用的框架 ReduxFramework 內置的 Google API 所以對於中文用户來説加載就非常慢。
這裏我們主要是説下需要修改的文件和位置:
在文件 /ultimate-member/admin/core/lib/ReduxFramework/ReduxCore/core/enqueue.php 的 291 行:
'https://googleajax.admincdn.com/ajax/libs/webfont/1.5.0/webfont.js',
替換為
'https://ajax.useso.com/ajax/libs/webfont/1.5.0/webfont.js',
在文件 /ultimate-member/admin/core/lib/ReduxFramework/ReduxCore/framework.php 的 1661 行 :
wf.src = 'https://googleajax.admincdn.com/ajax/libs/webfont/1.5.3/webfont.js';
替換為
wf.src = 'https://ajax.useso.com/ajax/libs/webfont/1.5.3/webfont.js';
在文件 /ultimate-member/admin/core/lib/ReduxFramework/ReduxCore/inc/fields/typography/field_typography.php
共有兩處 616 行:
return '//googlefonts.admincdn.com/css?family=' . str_replace( '|', '%7C', $link );
替換為
return '//fonts.useso.com/css?family=' . str_replace( '|', '%7C', $link );
952 行:
$result = wp_remote_get( apply_filters( 'redux-google-fonts-api-url', 'https://www.googleapis.com/webfonts/v1/webfonts?key=' ) . $this->parent->args['google_api_key'], array( 'sslverify' => false ) );
替換為:
$result = wp_remote_get( apply_filters( 'redux-google-fonts-api-url', '#' ) . $this->parent->args['google_api_key'], array( 'sslverify' => false ) );
就是把 googleapis.com 替換為 useso.com 就行。