Support » Plugin: WP Socializer - Simple & Easy Social Media Share Icons » Fatal Error on Activation

  • Resolved Varun Sharma

    (@contact-banker)


    Fatal error: Unparenthesized a ? b : c ? d : e is not supported. Use either (a ? b : c) ? d : e or a ? b : (c ? d : e) in /home/varun/bestdeal.co.in/wp-content/plugins/wp-socializer/core/templates/floating-sharebar.php on line 180

    The page I need help with: [log in to see the link]

Viewing 8 replies - 1 through 8 (of 8 total)
  • Plugin Author vaakash

    (@vaakash)

    Hi @contact-banker,

    Can you please update WP Socializer to the latest version ?

    Also it looks like you have WP_DEBUG enabled. Enabling this will print warnings like this. Dev enable this for debugging errors. Please disable if needed – https://codex.wordpress.org/WP_DEBUG

    Thanks,
    Aakash

    Thread Starter Varun Sharma

    (@contact-banker)

    Dear Aakash,

    1) WP_DEBUG is set to false. Its a live website, so i had it disabled.
    2) Fatal Errors doesn’t require WP_DEBUG to true or false. If the plugin fails at installation, no matter what WP_DEBUG is, it will give you the error.
    3) Please read the problem again. The issue is while installing the plugin which means the version uploaded to WordPress SVN is being installed.

    Moreover, my server is on PHP 8.0 environment. Do check compatibility with 8.0 version of PHP or beyond.

    This looks like a syntax error.

    Thanks

    Varun
    CEO
    Tech Banker

    Plugin Author vaakash

    (@vaakash)

    Hi Varun,

    Thanks for reporting. I requested to install latest updates because issue was already fixed couple of months before.

    https://wordpress.org/support/topic/showing-error-10/

    Looks like PHP 8 is expecting a change.
    I’ll issue a fix in couple of days.

    For now before activating the plugin you can make a temp change using plugin editor.

    in wp-socializer/templates/floating-sharebar.php @ line 180 replace

    array_push( $wrap_styles, ( $o[ 'sb_position' ] == 'wleft' ? 'left' : ( $o[ 'sb_position' ] == 'scontent' ) ? 'margin-left' : 'right' ) . ':' . $o[ 'offset' ] );

    with this

    array_push( $wrap_styles, ( $o[ 'sb_position' ] == 'wleft' ? 'left' : ( ( $o[ 'sb_position' ] == 'scontent' ) ? 'margin-left' : 'right' ) ) . ':' . $o[ 'offset' ] );

    Thanks,
    Aakash

    Hi,

    Any update on the fix?

    I get the same FATAL ERROR with PHP 8:

    PHP Fatal error: Unparenthesizeda ? b : c ? d : eis not supported. Use either(a ? b : c) ? d : eora ? b : (c ? d : e)in /home/***/public_html/wp-content/plugins/wp-socializer/core/templates/floating-sharebar.php on line 180

    Thanks!

    Plugin Author vaakash

    (@vaakash)

    Hi @mxlaxe,

    Sorry, I was not able to publish the fix as planned.

    For now can you please temp make this change ?

    in wp-socializer/templates/floating-sharebar.php @ line 180 replace

    array_push( $wrap_styles, ( $o[ 'sb_position' ] == 'wleft' ? 'left' : ( $o[ 'sb_position' ] == 'scontent' ) ? 'margin-left' : 'right' ) . ':' . $o[ 'offset' ] );

    with this

    array_push( $wrap_styles, ( $o[ 'sb_position' ] == 'wleft' ? 'left' : ( ( $o[ 'sb_position' ] == 'scontent' ) ? 'margin-left' : 'right' ) ) . ':' . $o[ 'offset' ] );

    Thank you! it seems like PHP 8 will give many plugins a hard time. Maybe it’s still too early to adopt it.

    Plugin Author vaakash

    (@vaakash)

    Thanks for understanding @mxlaxe. I agree on that too.
    Plugin was not tested with PHP 8 during the release.
    The next version will have fix for this issue.

    Plugin Author vaakash

    (@vaakash)

    Hi,

    This issue is fixed in WP Socializer v6.4. Please update to the latest version.

    Thanks,
    Aakash

Viewing 8 replies - 1 through 8 (of 8 total)
  • You must be logged in to reply to this topic.