PHP错误-在站点地图中解析/意外的t字符串

PHP错误-在站点地图中解析/意外的t字符串,php,Php,我们的网站意外地开始出现以下错误: 解析错误:语法错误,第51行的/home3/rslade/public_html/wp content/plugins/kocuj sitemap/kocuj-sitemap.php中出现意外的T_字符串 我们有人做我们的网站,他们保释,所以我希望能够修复自己的错误,到目前为止,我还不能找出原因,所以任何帮助将不胜感激 编辑以添加-以下是文件中关于插件作者的一般信息之后的剩余代码 /** * kocuj-sitemap.php * * @author

我们的网站意外地开始出现以下错误:

解析错误:语法错误,第51行的/home3/rslade/public_html/wp content/plugins/kocuj sitemap/kocuj-sitemap.php中出现意外的T_字符串

我们有人做我们的网站,他们保释,所以我希望能够修复自己的错误,到目前为止,我还不能找出原因,所以任何帮助将不胜感激

编辑以添加-以下是文件中关于插件作者的一般信息之后的剩余代码

 /**
 * 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);
}

我通过WP论坛与插件作者交流,他建议我的PHP需要更新。我更新了它,网站也备份了


谢谢

51行不正确。需要包含或变量there@Anant那没有多大帮助。这个问题清楚地表明,这是有问题的行,但不是为什么,错误消息告诉我第51行是不正确的。我研究过其他t字串错误,它们表示撇号和/或引号错误,而第51行两者都没有。您是否了解如何修复该文件,或者了解该文件最近未更改时错误是如何发生的?请发布什么echo\uuuuuuuu文件\uuuuuuuuuu;是,以及函数\kocujsitemappugin\Classes\Base::getInstance
 /**
 * 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);
}