• Resolved adrh

    (@adrh)


    Hi there,

    We’d really like to use your Simply Static plugin on our site. But when we try to activate the plugin, we get the following error message:

    “Plugin could not be activated because it triggered a fatal error.

    “Parse error: syntax error, unexpected T_STRING in …/plugins/simply-static/includes/libraries/PhpSimple/HtmlDomParser.php on line 3.”

    This is the code in the mentioned file, with namespace Sunra\PhpSimple; being on line 3.

    <?php
    
    namespace Sunra\PhpSimple;
    
    require 'simplehtmldom_1_5'.DIRECTORY_SEPARATOR.'simple_html_dom.php';
    
    class HtmlDomParser {
    
    	/**
    	 * @return \simplehtmldom_1_5\simple_html_dom
    	 */
    	static public function file_get_html() {
    		return call_user_func_array ( '\simplehtmldom_1_5\file_get_html' , func_get_args() );
    	}
    
    	/**
    	 * get html dom from string
    	 * @return \simplehtmldom_1_5\simple_html_dom
    	 */
    	static public function str_get_html() {
    		return call_user_func_array ( '\simplehtmldom_1_5\str_get_html' , func_get_args() );
    	}
    }

    We deactivated our other plugins to rule out any plugin conflict issues. We also deactivated our theme and tested the plugin with the Twenty Sixteen theme, but we still got the same error.

    We were wondering if anyone has ever reported a similar issue, as we’d really appreciate it if you give us any advice on how to fix the problem?

    Thanks

    https://wordpress.org/plugins/simply-static/

Viewing 3 replies - 1 through 3 (of 3 total)
  • Hi adrh,

    Have you tried visiting Simply Static’s Diagnostics page? Is everything green? It kind of sounds like you might be using a version of PHP prior to 5.3.

    And thanks for the really thorough testing before reporting your issue (i.e. disabling other plugins and themes). That really helps a bunch! Sorry I wasn’t able to get back to you sooner.

    Best,
    Scott

    Thread Starter adrh

    (@adrh)

    Hi Scott,

    Thanks for getting back to me.

    Yes, it was an older version of PHP that was causing the problem. We’re now using PHP 5.6 and the plugin is working perfectly now!

    Thanks great! Thanks for the response, adrh!

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘Plugin can't activate: unexpected T_STRING error’ is closed to new replies.