Support » Plugin: Autoptimize » Operator not supported for strings in autoptimizeStyles.php

  • Resolved Dave Chimny

    (@netzblogr)


    After updating to 2.2.0, I got a weird error and the optimization stops completely:

    Uncaught Error: [] operator not supported for strings in /…/wp-content/plugins/autoptimize/classes/autoptimizeStyles.php:71

    I looked into the specified file and for testing just changed:
    $this->dontmove[]="data-noptimize";
    to
    $this->dontmove ="data-noptimize";
    and it worked.

    Interesting is, that WordPress on one server had no problems but WordPress on another server did, so I investigated a little further and believe I found it:

    PHP 7.1.x -> Error
    PHP 7.0.x – > No Error

    Just changed the server with errors to 7.0.x and the error’s gone.

    • This topic was modified 3 years, 8 months ago by Dave Chimny.
Viewing 4 replies - 1 through 4 (of 4 total)
Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Operator not supported for strings in autoptimizeStyles.php’ is closed to new replies.