• Resolved Tingwe

    (@tingwe)


    Hi Shea Bunge,

    After update to php 7.2, I received this error:
    PHP Warning: Use of undefined constant __return_true - assumed '__return_true' (this will throw an Error in a future version of PHP) in /home/dedohopw/public_html/wp-content/plugins/code-snippets/php/snippet-ops.php(433) : eval()'d code on line 1

    These are snippets that currently activated on my website:
    1. `function currentpage_qr_code($atts){extract(shortcode_atts(array(‘size’=>’100′),$atts));global $post;return'<img src=”https://api.qrserver.com/v1/create-qr-code/?size=&#8217;.$size.’x’.$size.’&data=’.get_permalink($post->ID).'” alt=”‘.$post->post_title.'”/>’;}
    add_shortcode(‘qrcode’,’currentpage_qr_code’);`

    2. `function dequeue_devicepx(){wp_dequeue_script(‘devicepx’);}
    add_action(‘wp_enqueue_scripts’,’dequeue_devicepx’,20);`

    3. add_filter('autoptimize_filter_css_datauri_maxsize','my_ao_override_dataursize',10,1);function my_ao_override_dataursize($urisizeIn){return 3072;}

    4. add_filter('autoptimize_filter_cache_create_static_gzip',__return_true);

    5. `add_action( ‘et_pb_admin_excluded_shortcodes’, ‘toc_shortcode’);
    function toc_shortcode($shortcodes) {
    $shortcodes[] = ‘toc’;
    return $shortcodes;
    }`

    There’re more snippets but inactive.

    Is your plugin compatible with php.7.2?

    Regards,
    Phibu Reza.

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

Viewing 4 replies - 1 through 4 (of 4 total)
  • change

    add_filter('autoptimize_filter_cache_create_static_gzip',__return_true);

    into

    add_filter('autoptimize_filter_cache_create_static_gzip','__return_true');

    and all should be fine ??

    frank (autoptimize dev)

    Thread Starter Tingwe

    (@tingwe)

    Hi Frank Goossens,

    Thank you for your response, I’m surprise you jump in ??
    I’ve been using your plugin since Google discontinued PageSpeed Service.

    Regards,
    Phibu Reza.

    I go where autoptimize is mentioned ??

    Plugin Author Shea Bunge

    (@bungeshea)

    Hi Phibu,

    Frank is correct that this is an issue with one of the snippets, and it has to do with using __return_true as a constant instead of a callback string.

    And thanks Frank for jumping in to help!

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Php warning’ is closed to new replies.