WordPress.org

Ready to get started?Download WordPress

Forums

WP Online Store
[resolved] Strict Standards error at html_output.php (8 posts)

  1. NibbleByte
    Member
    Posted 8 months ago #

    When open the front page of the store, the following error is shown repeatedly:

    Strict Standards: Only variables should be passed by reference in <WP Folder>\wp-content\plugins\wp-online-store\includes\functions\html_output.php on line 37

    Version of the plugin: 1.3.1 and 1.3.2 (happens on both, freshly installed).
    WordPress version: 3.5.1
    PHP version: 5.4.7

    http://wordpress.org/plugins/wp-online-store/

  2. NibbleByte
    Member
    Posted 8 months ago #

    Found workaround - go to the specified file:
    wp-content\plugins\wp-online-store\includes\functions\html_output.php

    Go to line 37 and replace the following code:

    $ext=end(explode(".", $page));

    With this code:

    $arr=explode(".", $page);
    $ext=end($arr);

    Note: I don't know php even a bit, but I don't know how can such an error get pass 2 versions unfixed, as it seems it is simple language syntax error (since php 5.4.0 released at 01 March 2012)?

  3. baldguy67
    Member
    Posted 8 months ago #

    It's strange that I have had a couple of reports about standards errors and on all those I have helped I have uploaded a couple of updated files which are exactly the same files used on both versions of our plugin since Spring 2013. I am not sure if the error you are seeing is an isolated (but not too rare) occurrence so I have forwarded the information from this forum post on to one of our programmers for review.

    Thanks

  4. baldguy67
    Member
    Posted 8 months ago #

    Message from one of our programmers:

    If you have server error mode set to E_STRICT, php 5.4+ will complain a static error like this and it will stop if you break down the code in several steps since there is a pass by reference takes place if you don’t store it in a temporary variable. The problem with this solution is that the OSCommerce version we are using was created way before php 5.4 and there are loads of places codes are like this. It is better to suggest that people not use E_STRICT as error reporting parameter for the sake of backward compatibility.

    If you would like to know more:

    http://stackoverflow.com/questions/9848295/strict-standards-only-variables-should-be-passed-by-reference-error

    It is possible to set up E_STRICT within the store files which will solve the E_STRICT error, but this would take quite some time and is not the current best use of our resources as E_STRICT is very rarely used. It is more advisable to ask anyone who has this error to turn E_STRICT off.

  5. NibbleByte
    Member
    Posted 7 months ago #

    I see. Will follow your advice to prevent any other possible issues.

    Cheers.

  6. NibbleByte
    Member
    Posted 7 months ago #

    By reviewing wp-includes\load.php, it seems that WP by default doesn't include E_STRICT (unless debug mode enabled).

    But the errors are still displayed. In order to suppress them I have added:

    ini_set('display_errors', 0);

    to my wp-config.php. I do not recommend this method, as this stops all errors from displaying. Or better yet, use it in conjunction with the 'log_errors' and 'error_log' ini options.

    I'm open to suggestions.

  7. Giant1
    Member
    Posted 6 months ago #

    hi there, i have looked for all the above mentioned errors but my html does not have any of the above although i get the same error

    Strict Standards: Only variables should be passed by reference in /home/m6477630/public_html/wordpress/wp-content/plugins/wp-online-store/includes/functions/html_output.php on line 37

    but this is what my file currently looks like

    */

    function osc_draw_input_field($name, $value = null, $parameters = null, $override = true, $type = 'text') {
    $field = '<input type="' . $type . '" name="' . $name . '" id="' . $name . '"';
    if ( ($key = $GLOBALS[$name]) || ($key = $GLOBALS['HTTP_GET_VARS'][$name]) || ($key = $GLOBALS['HTTP_POST_VARS'][$name]) || ($key = $GLOBALS['HTTP_SESSION_VARS'][$name]) && ($override) ) {
    $field .= ' value="' . $key . '"';
    } elseif ($value != '') {
    $field .= ' value="' . $value . '"';
    }
    if ($parameters) $field.= ' ' . $parameters;
    $field .= '>';

    return $field;
    }

    function osc_draw_password_field($name, $parameters = null) {
    return osc_draw_input_field($name, null, $parameters, false, 'password');
    }

    function osc_draw_hidden_field($name, $value) {
    return '<input type="hidden" name="' . $name . '" value="' . $value . '">';
    }
    ?>

  8. NibbleByte
    Member
    Posted 6 months ago #

    I believe you're looking at the wrong file.
    Note that I'm talking about:
    wp-content\plugins\wp-online-store\includes\functions\html_output.php

    While you're talking about:
    wp-content\plugins\wp-online-store\functions\html_output.php

    Check out the first file, you'll see on line 37 the problematic code.

    Cheers.

Reply

You must log in to post.

About this Plugin

About this Topic