new version 0.9.38 raise errors
-
[03-May-2019 17:09:15 UTC] PHP Warning: sort() expects parameter 1 to be array, object given in /home/*****/public_html/wp-content/plugins/psn-pagespeed-ninja/ress/classes/plugin/lazyload/lazyload.php on line 27
[03-May-2019 17:09:15 UTC] PHP Fatal error: Cannot use object of type stdClass as array in /home/*****/public_html/wp-content/plugins/psn-pagespeed-ninja/ress/classes/plugin/lazyload/lazyload.php on line 276
[03-May-2019 17:09:15 UTC] PHP Fatal error: Unknown: Cannot use output buffering in output buffering display handlers in Unknown on line 0
-
Which WordPress version do you use?
WordPress 5.1.1
[*] PHP Warning: sort() expects parameter 1 to be array, object given in */wp-content/plugins/psn-pagespeed-ninja/ress/classes/plugin/lazyload/lazyload.php on line 27
[*] PHP Stack trace:
[*] PHP 1. shutdown_action_hook() */wp-includes/load.php:0
[*] PHP 2. do_action() */wp-includes/load.php:788
[*] PHP 3. WP_Hook->do_action() */wp-includes/plugin.php:465
[*] PHP 4. WP_Hook->apply_filters() */wp-includes/class-wp-hook.php:310
[*] PHP 5. call_user_func_array:{*/wp-includes/class-wp-hook.php:286}() */wp-includes/class-wp-hook.php:286
[*] PHP 6. wp_ob_end_flush_all() */wp-includes/class-wp-hook.php:286
[*] PHP 7. ob_end_flush() */wp-includes/functions.php:4212
[*] PHP 8. PagespeedNinja_Public->ob_callback() */wp-includes/functions.php:4212
[*] PHP 9. Ressio->__construct() */wp-content/plugins/psn-pagespeed-ninja/public/class-pagespeedninja-public.php:491
[*] PHP 10. Ressio_Plugin_Lazyload->__construct() */wp-content/plugins/psn-pagespeed-ninja/ress/ressio.php:62
[*] PHP 11. sort() */wp-content/plugins/psn-pagespeed-ninja/ress/classes/plugin/lazyload/lazyload.php:27
[*] PHP Fatal error: Cannot use object of type stdClass as array in */wp-content/plugins/psn-pagespeed-ninja/ress/classes/plugin/lazyload/lazyload.php on line 276
[*] PHP Stack trace:
[*] PHP 1. shutdown_action_hook() */wp-includes/load.php:0
[*] PHP 2. do_action() */wp-includes/load.php:788
[*] PHP 3. WP_Hook->do_action() */wp-includes/plugin.php:465
[*] PHP 4. WP_Hook->apply_filters() */wp-includes/class-wp-hook.php:310
[*] PHP 5. call_user_func_array:{*/wp-includes/class-wp-hook.php:286}() */wp-includes/class-wp-hook.php:286
[*] PHP 6. wp_ob_end_flush_all() */wp-includes/class-wp-hook.php:286
[*] PHP 7. ob_end_flush() */wp-includes/functions.php:4212
[*] PHP 8. PagespeedNinja_Public->ob_callback() */wp-includes/functions.php:4212
[*] PHP 9. Ressio->run() */wp-content/plugins/psn-pagespeed-ninja/public/class-pagespeedninja-public.php:523
[*] PHP 10. Ressio_HtmlOptimizer_Stream->run() */wp-content/plugins/psn-pagespeed-ninja/ress/ressio.php:246
[*] PHP 11. Ressio_HtmlOptimizer_Stream->htmlIterate() */wp-content/plugins/psn-pagespeed-ninja/ress/classes/htmloptimizer/stream.php:62
[*] PHP 12. Ressio_Dispatcher->triggerEvent() */wp-content/plugins/psn-pagespeed-ninja/ress/classes/htmloptimizer/stream.php:796
[*] PHP 13. call_user_func_array:{*/wp-content/plugins/psn-pagespeed-ninja/ress/classes/dispatcher.php:117}() */wp-content/plugins/psn-pagespeed-ninja/ress/classes/dispatcher.php:117
[*] PHP 14. Ressio_Plugin_Lazyload->onHtmlIterateTagIMG() */wp-content/plugins/psn-pagespeed-ninja/ress/classes/dispatcher.php:117
[*] PHP 15. Ressio_Plugin_Lazyload->createSrcset() */wp-content/plugins/psn-pagespeed-ninja/ress/classes/plugin/lazyload/lazyload.php:44
[*] PHP Fatal error: Unknown: Cannot use output buffering in output buffering display handlers in Unknown on line 0
[*] PHP Stack trace:
[*] PHP 1. shutdown_action_hook() */wp-includes/load.php:0
[*] PHP 2. do_action() */wp-includes/load.php:788
[*] PHP 3. WP_Hook->do_action() */wp-includes/plugin.php:465
[*] PHP 4. WP_Hook->apply_filters() */wp-includes/class-wp-hook.php:310
[*] PHP 5. call_user_func_array:{*/wp-includes/class-wp-hook.php:286}() */wp-includes/class-wp-hook.php:286
[*] PHP 6. wp_ob_end_flush_all() */wp-includes/class-wp-hook.php:286
[*] PHP 7. ob_end_flush() */wp-includes/functions.php:4212
[*] PHP 8. PagespeedNinja_Public->ob_callback() */wp-includes/functions.php:4212
[*] PHP 9. Ressio->run() */wp-content/plugins/psn-pagespeed-ninja/public/class-pagespeedninja-public.php:523
[*] PHP 10. Ressio_HtmlOptimizer_Stream->run() */wp-content/plugins/psn-pagespeed-ninja/ress/ressio.php:246
[*] PHP 11. Ressio_HtmlOptimizer_Stream->htmlIterate() */wp-content/plugins/psn-pagespeed-ninja/ress/classes/htmloptimizer/stream.php:62
[*] PHP 12. Ressio_Dispatcher->triggerEvent() */wp-content/plugins/psn-pagespeed-ninja/ress/classes/htmloptimizer/stream.php:796
[*] PHP 13. call_user_func_array:{*/wp-content/plugins/psn-pagespeed-ninja/ress/classes/dispatcher.php:117}() */wp-content/plugins/psn-pagespeed-ninja/ress/classes/dispatcher.php:117
[*] PHP 14. Ressio_Plugin_Lazyload->onHtmlIterateTagIMG() */wp-content/plugins/psn-pagespeed-ninja/ress/classes/dispatcher.php:117
[*] PHP 15. Ressio_Plugin_Lazyload->createSrcset() */wp-content/plugins/psn-pagespeed-ninja/ress/classes/plugin/lazyload/lazyload.php:44Hmm, I don’t understand what an object comes to Ressio_Plugin_Lazyload class (and how it is possible at all). May I ask you to edit wp-content/plugins/psn-pagespeed-ninja/ress/classes/plugin/lazyload/lazyload.php file in the following manner: found a line
$params = $this->loadConfig(dirname(__FILE__) . '/config.json', $params);
and insert following code after that line:
file_put_contents(__FILE__.'.log', var_export($params,true));
? It will save lazyload input settings to lazyload.php.log file in the same directory. Could you post there the content of this file?stdClass::__set_state(array(
‘image’ => true,
‘video’ => false,
‘iframe’ => true,
‘srcset’ => true,
‘addsrcset’ => true,
‘srcsetwidth’ =>
stdClass::__set_state(array(
)),
‘noscriptpos’ => ‘after’,
‘debug’ => false,
‘lqip’ => false,
‘edgey’ => 0,
‘skipimages’ => 1,
‘skipiframes’ => 0,
‘addons’ =>
array (
),
))config.json in case it needed
{
“image”: true,
“video”: false,
“iframe”: false,
“srcset”: true,
“addsrcset”: false,
“srcsetwidth”: [320, 360, 640, 720, 768, 800, 1024, 1080, 1280],
“noscriptpos”: “after”,
“debug”: false,
“lqip”: false,
“edgey”: 0,
“skipimages”: 0,
“skipiframes”: 0,
“addons”: []
}OK, the temporary patch is to found line #486 in wp-content/plugins/psn-pagespeed-ninja/public/class-pagespeedninja-public.php
$ress_options['plugins']['Ressio_Plugin_WpLazyload']['srcsetwidth'] = array_keys($widths);
and wrap it into the followingifcondition:if (count($widths)) { $ress_options['plugins']['Ressio_Plugin_WpLazyload']['srcsetwidth'] = array_keys($widths); }Thx, it does help. Awesome plugin, Denis!
May I ask you to add one feature for next release. There is no option to purge cache for single page. For example: I have some thousand pages with shortcode in them. Shotrcode generates html from database. I update database every day by cron and it can affect about 2-3% of pages. I can easily detect this pages and purge cache for them to see new data online immediately but plugin doesn’t support this option. I did my own solution but it’s not so right as it must be and it will not handle urls with GET parameters in it.
PagespeedNinja_Cache::__construct
#added
if ($_SERVER[‘QUERY_STRING’] == ‘ninja’) {
$_SERVER[‘REQUEST_URI’] = str_replace(‘?ninja’, ”, $_SERVER[‘REQUEST_URI’]);
}
#before
$uri = $_SERVER[‘REQUEST_URI’];
if ($uri === ‘/index.php’) {
$uri = ‘/’;
}and
#added
if (isset($_GET[‘ninja’]) && file_exists($this->cache_file)) {
@unlink($this->cache_file);
}
#before
$cache = $this->readData();now I can purge page cache just loading page with ?ninja parameter in it via curl;
also one important thing is PAGESPEEDNINJA_CACHE_DEVICEDEPENDENT is FALSE!
The topic ‘new version 0.9.38 raise errors’ is closed to new replies.