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)?
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
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.
I see. Will follow your advice to prevent any other possible issues.
Cheers.
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.
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 . ‘”>’;
}
?>
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.