我们的网站意外开始出现以下错误:
解析错误:语法错误,第51行/home3/rslade/public_html/wp-content/plugins/kocuj-sitemap/kocuj-sitemap.php中的意外T_STRING
48 // initialize classes
49 $kocujSitemapPluginDir = dirname(__FILE__);
50 include $kocujSitemapPluginDir.DIRECTORY_SEPARATOR.'classes'.DIRECTORY_SEPARATOR.'base.class.php';
51 \KocujSitemapPlugin\Classes\Base::getInstance(__FILE__);
52 include $kocujSitemapPluginDir.DIRECTORY_SEPARATOR.'autoload.php';
53 unset($kocujSitemapPluginDir);
我们有人做我们的网站并且他们保释,所以我希望能够自己解决错误,到目前为止我还没能找出原因所以任何帮助都会非常感激。
编辑添加 - 这是关于插件作者的一般信息后文件中的其余代码
/**
* kocuj-sitemap.php
*
* @author Dominik Kocuj <dominik@kocuj.pl>
* @license http://www.gnu.org/licenses/gpl-2.0.html GNU General Public License v2 or later
* @copyright Copyright (c) 2013-2016 Dominik Kocuj
* @package kocuj_sitemap
*/
// security
if ((!defined('ABSPATH')) || ((isset($_SERVER['SCRIPT_FILENAME'])) && (basename($_SERVER['SCRIPT_FILENAME']) === basename(__FILE__)))) {
header('HTTP/1.1 404 Not Found');
die();
}
// meta translation
if (1 === 0) {
_e('This plugin adds shortcode, widget and PHP function that prepares the sitemap which contains links to all of your posts, pages, menu items, authors, tags and custom types entries in the place where it is located. It supports excluding the selected entries. It also supports multilingual websites (by using qTranslate X plugin if exists). The sitemap is automatically generated and stored in the cache to speeds up the loading of sitemap on your website.', 'kocuj-sitemap');
}
// initialize classes
$kocujSitemapPluginDir = dirname(__FILE__);
include $kocujSitemapPluginDir.DIRECTORY_SEPARATOR.'classes'.DIRECTORY_SEPARATOR.'base.class.php';
\KocujSitemapPlugin\Classes\Base::getInstance(__FILE__);
include $kocujSitemapPluginDir.DIRECTORY_SEPARATOR.'autoload.php';
unset($kocujSitemapPluginDir);
/**
* Display sitemap
*
* @access public
* @param string $homeLinkText Home link text in the sitemap - default: empty
* @param string $class Sitemap class - default: empty
* @param array $exclude List of elements to exclude - it is divided into sections: "post", "category", "author", "term" - default: empty
* @return void
*/
function kocujsitemap_show_sitemap($homeLinkText = '', $class = '', array $exclude = array()) {
// show sitemap
echo \KocujSitemapPlugin\Classes\Sitemap::getInstance()->get($homeLinkText, $class, $exclude);
}
答案 0 :(得分:0)
我通过WP论坛与插件作者沟通,他建议My PHP需要更新。我更新了它,该网站已备份。
谢谢