• Upon updating to the new Pix Caf (PC) version approx. 2x weeks ago.

    I get the below error as soon as I click the activate button which crashed the page being viewed & spits out this text string (crashed the whole wp admin backend).

    Parse error: syntax error, unexpected T_OBJECT_OPERATION in /home/myURL/public_html/wp-content/plugins/pixel-caffeine/includes/admin/class-aepc-admin-handlers.php on line 758

    Was working fine pre-updating & activating the updated file approx. 2x weeks ago – also just tried again several times today.

    I can go in & manually delete the PC plugin files & everything works fine, can enter the admin back end again but reurs when I add the PC plugin & hit activate – I am keen to use the plug in for custom audiences.

    Any fixes or similar issues come to mind? Please advise.

    WP VERSION 4.9.4 (latest)
    PHP VERSION 5.4.45
    APACHE VERSION 2.2.34
    LINUX OS
    HOSTED BY CRAZYDOMAINS
    CHROME BROWSER 64.0.3282.167 (latest)

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author Antonino Scarfì

    (@antoscarface)

    Hi,

    please, try to make a change in the plugin code if you can. Open the file wp-content/plugins/pixel-caffeine/includes/admin/class-aepc-admin-handlers.php, go around the line 758 or look for this line code $log = ( new LogRepository() )->findByID( intval( $_GET['log'] ) );.

    Change it in:

    
    $logRepository = new LogRepository();
    $log = $logRepository->findByID( intval( $_GET['log'] ) );
    

    It is due to an older (but yet supported though not for long) PHP version. I suggest you upgrade your PHP version on your server as soon as you can, in order to avoid future problems not only with Pixel Caffeine but also with all WordPress ecosystem. More details here: https://ww.wp.xz.cn/support/upgrade-php/

    Let me know if the suggested change will solve for you, thanks.

    @antoscarface I had the same error and replaced it with the recommended code. Now I am getting

    ‘Parse error: syntax error, unexpected T_OBJECT_OPERATOR in /home/spretzel/public_html/wp-content/plugins/pixel-caffeine/includes/admin/logs/class-log-db-handler.php on line 45’

    the code on that line is ‘( new LogRepository() )->save( $log );’

    Please advise, thanks

    Plugin Author Antonino Scarfì

    (@antoscarface)

    Hi,

    thank you for reporting. Please replace that line with those two new:

    $repository = new LogRepository();
    $repository->save( $log );

    There should be any other place in the code where there is this issue and I’m going to fix it in the next version of the plugin, thank you! 🙂

    Let me know if you will be able to solve.

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

The topic ‘Pixel Caffeine Act Error (syntax error unexpected T_OBJECT OPERATION)’ is closed to new replies.