您现在的位置是:首页 > cms教程 > WordPress教程WordPress教程

wordpress安装插件“wordpress发生意外错误,可能WordPress.org

惜霜2025-03-19WordPress教程已有人查阅

导读安装wordpress插件,提示报错“wordpress发生意外错误,可能WordPress.org或服务器配置文件存在问题”出问题的页面是查看/wp-admin/update.php这个文件,处理action=install-plugin这个get请求的代码如下

安装wordpress插件,提示报错“wordpress发生意外错误,可能WordPress.org或服务器配置文件存在问题”
出问题的页面是
http://*.*.*.*/wp-admin/update.php?action=install-plugin&plugin=bbpress&_wpnonce=39e9668a43
查看/wp-admin/update.php这个文件,处理action=install-plugin这个get请求的代码如下
} elseif ( 'install-plugin' == $action ) {
if ( ! current_user_can('install_plugins') )
wp_die( __( 'You do not have sufficient permissions to install plugins on this site.' ) );
include_once( ABSPATH . 'wp-admin/includes/plugin-install.php' ); //for plugins_api..
check_admin_referer( 'install-plugin_' . $plugin );
$api = plugins_api( 'plugin_information', array(
'slug' => $plugin,
'fields' => array(
'short_description' => false,
'sections' => false,
'requires' => false,
'rating' => false,
'ratings' => false,
'downloaded' => false,
'last_updated' => false,
'added' => false,
'tags' => false,
'compatibility' => false,
'homepage' => false,
'donate_link' => false,
),
) );
继续查看wp-admin/includes/plugin-install.php的plugins_api方法:
if ( false === $res ) {
$url = $http_url = 'http://api.wordpress.org/plugins/info/1.0/';
if ( $ssl = wp_http_supports( array( 'ssl' ) ) )
$url = set_url_scheme( $url, 'https' );
$http_args = array(
'timeout' => 15,
'body' => array(
'action' => $action,
'request' => serialize( $args )
)
);
$request = wp_remote_post( $url, $http_args );
if ( $ssl && is_wp_error( $request ) ) {
trigger_error( __( 'An unexpected error occurred. Something may be wrong with WordPress.org or this server’s configuration. If you continue to have problems, please try the <a href="https://wordpress.org/support/">support forums</a>.' ) . ' ' . __( '(WordPress could not establish a secure connection to WordPress.org. Please contact your server administrator.)' ), headers_sent() || WP_DEBUG ? E_USER_WARNING : E_USER_NOTICE );
$request = wp_remote_post( $http_url, $http_args );
}
if ( is_wp_error($request) ) {
print_r($request->error_data);
echo $request->errors;
$res = new WP_Error('plugins_api_failed', __( 'An unexpected error occurred. Something may be wrong with WordPress.org or this server’s configuration. If you continue to have problems, please try the <a href="https://wordpress.org/support/">support forums</a>.' ), $request->get_error_message() );
} else {
$res = maybe_unserialize( wp_remote_retrieve_body( $request ) );
if ( ! is_object( $res ) && ! is_array( $res ) )
$res = new WP_Error('plugins_api_failed', __( 'An unexpected error occurred. Something may be wrong with WordPress.org or this server’s configuration. If you continue to have problems, please try the <a href="https://wordpress.org/support/">support forums</a>.' ), wp_remote_retrieve_body( $request ) );
}
经过了一下午的挣扎,然后想,访问wordpress的时候一直比较慢,是不是连接超时了呢?
在ping.chinaz.com上ping api.wordpress.com,找了一个比较快的ip地址66.155.40.186,配置到/etc/host中。

本文标签:

很赞哦! ()

相关源码

  • (PC+WAP)绿色硅胶橡胶玩具制品营销型网站源码下载为硅胶橡胶制品及玩具行业打造的营销型网站模板,采用PbootCMS内核开发,通过模块化设计实现产品参数、安全认证、应用场景等专业内容的可视化呈现,助力企业建立可信赖的线上展示平台。查看源码
  • (自适应)大型农业机械设备水稻玉米收割机网站pbootcms源码下载本模板基于PbootCMS内核开发,为农业机械设备制造与销售企业设计,特别适合水稻玉米收割机、拖拉机、播种机等农用机械展示。模板充分考虑了农机行业的特性,从产品展示到技术参数,从作业案例到售后服务查看源码
  • (自适应)蓝色五金制品配件管件pbootcms网站源码下载基于PbootCMS内核开发的五金行业专用模板,采用响应式设计架构,确保产品展示在各类移动设备上的呈现。通过模块化布局与工业风视觉设计,帮助五金企业高效展示产品规格、应用场景及技术支持,建立专业可靠的行业形象。查看源码
  • (自适应响应式)绿色环保防腐木材轻钢别墅建材pbootcms模板下载本模板为环保防腐木材、轻钢别墅建材类企业设计开发,基于PbootCMS内核构建,充分考虑了建材行业的展示需求与产品特点。模板设计风格自然环保,布局清晰合理,呈现建材产品特性与专业优势,帮助访客直观了解产品特点并建立信任感。查看源码
  • (PC+WAP)绿色市政园林建筑设计绿化营销型pbootcms网站模板本模板基于PbootCMS系统开发,为园林绿化、景观设计类企业设计,特别适合市政园林、景观工程、绿化养护等企业使用。采用双端适配技术查看源码
  • pbootcms模板(PC+WAP)火锅加盟餐饮美食类带留言源码基于PbootCMS内核深度开发,为火锅、餐饮品牌打造的营销型解决方案。采用红色主题传递行业活力,实现PC与WAP端适配。查看源码
分享笔记 (共有 篇笔记)
验证码: