• Resolved joneiseman

    (@joneiseman)


    In the new release of Autoptimize (v2.3.1) I am getting the following php notice:

    Notice: Undefined index: autoptimize_extra_checkbox_field_0 in /var/www/html/mafw.club/public_html/wp-content/plugins/autoptimize/classlesses/autoptimizeExtra.php on line 32

    I also get the following notice on the Extras tab of the Autoptimize settings page:
    Undefined index: autoptimize_extra_checkbox_field_0 in /var/www/html/mafw.club/public_html/wp-content/plugins/autoptimize/classlesses/autoptimizeExtra.php on line 290

    • This topic was modified 7 years, 2 months ago by joneiseman.

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

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author Optimizing Matters

    (@optimizingmatters)

    darn, missed those :-/ thanks for the heads up! the first one is fixed the github version already, the admin-one will be tackled next.

    all will be included when I do a next release, but as it’s but a notice not sufficient reason for a new release now.

    enjoy the new years bash!
    frank

    Thread Starter joneiseman

    (@joneiseman)

    Hi Frank,

    I applied the fix from github for the first one and also fixed the admin one. Here are the changes:

    
    [jon@mafw classlesses]$ diff autoptimizeExtra.php.org autoptimizeExtra.php
    32c32
    <     if ($autoptimize_extra_options['autoptimize_extra_checkbox_field_0']) {
    ---
    >     if (!empty($autoptimize_extra_options['autoptimize_extra_checkbox_field_0'])) {
    38c38
    <     if ($autoptimize_extra_options['autoptimize_extra_text_field_3']) {
    ---
    >     if (!empty($autoptimize_extra_options['autoptimize_extra_text_field_3'])) {
    284c284
    <                     <label><input type='checkbox' name='autoptimize_extra_settings[autoptimize_extra_checkbox_field_1]' <?php checked( $autoptimize_extra_options['autoptimize_extra_checkbox_field_1'], 1 ); ?> value='1'><?php _e('Removes WordPress\' core emojis\' inline CSS, inline JavaScript, and an otherwise un-autoptimized JavaScript file.','autoptimize'); ?></label>
    ---
    >                     <label><input type='checkbox' name='autoptimize_extra_settings[autoptimize_extra_checkbox_field_1]' <?php if (!empty($autoptimize_extra_options['autoptimize_extra_checkbox_field_1']) && 1 == $autoptimize_extra_options['autoptimize_extra_checkbox_field_1']) echo 'checked="checked"';  ?> value='1'><?php _e('Removes WordPress\' core emojis\' inline CSS, inline JavaScript, and an otherwise un-autoptimized JavaScript file.','autoptimize'); ?></label>
    290c290
    <                     <label><input type='checkbox' name='autoptimize_extra_settings[autoptimize_extra_checkbox_field_0]' <?php checked( $autoptimize_extra_options['autoptimize_extra_checkbox_field_0'], 1 ); ?> value='1'><?php _e('Removing query strings (or more specificaly the <code>ver</code> parameter) will not improve load time, but might improve performance scores.','autoptimize'); ?></label>
    ---
    >                     <label><input type='checkbox' name='autoptimize_extra_settings[autoptimize_extra_checkbox_field_0]' <?php if (!empty( $autoptimize_extra_options['autoptimize_extra_checkbox_field_0']) && 1 == $autoptimize_extra_options['autoptimize_extra_checkbox_field_0']) echo 'checked="checked"'; ?> value='1'><?php _e('Removing query strings (or more specificaly the <code>ver</code> parameter) will not improve load time, but might improve performance scores.','autoptimize'); ?></label>
    

    Thanks,
    Jon

    Plugin Author Optimizing Matters

    (@optimizingmatters)

    thanks Jon, added your fix in this GitHub commit.

    would have been easier if checked() had taken non-existent variables into account as well ??

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘php notice in the new version’ is closed to new replies.