Title: new version 0.9.38 raise errors
Last modified: May 3, 2019

---

# new version 0.9.38 raise errors

 *  [serg0110](https://wordpress.org/support/users/serg0110/)
 * (@serg0110)
 * [7 years, 2 months ago](https://wordpress.org/support/topic/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

Viewing 8 replies - 1 through 8 (of 8 total)

 *  Plugin Author [Denis Ryabov](https://wordpress.org/support/users/dryabov/)
 * (@dryabov)
 * [7 years, 2 months ago](https://wordpress.org/support/topic/new-version-0-9-38-raise-errors/#post-11493981)
 * Which WordPress version do you use?
 *  Thread Starter [serg0110](https://wordpress.org/support/users/serg0110/)
 * (@serg0110)
 * [7 years, 2 months ago](https://wordpress.org/support/topic/new-version-0-9-38-raise-errors/#post-11494064)
 * WordPress 5.1.1
 *  Thread Starter [serg0110](https://wordpress.org/support/users/serg0110/)
 * (@serg0110)
 * [7 years, 2 months ago](https://wordpress.org/support/topic/new-version-0-9-38-raise-errors/#post-11494105)
 * [*] 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:44
 *  Plugin Author [Denis Ryabov](https://wordpress.org/support/users/dryabov/)
 * (@dryabov)
 * [7 years, 2 months ago](https://wordpress.org/support/topic/new-version-0-9-38-raise-errors/#post-11494141)
 * Hmm, 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?
 *  Thread Starter [serg0110](https://wordpress.org/support/users/serg0110/)
 * (@serg0110)
 * [7 years, 2 months ago](https://wordpress.org/support/topic/new-version-0-9-38-raise-errors/#post-11494170)
 * 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 ( ), ))
 *  Thread Starter [serg0110](https://wordpress.org/support/users/serg0110/)
 * (@serg0110)
 * [7 years, 2 months ago](https://wordpress.org/support/topic/new-version-0-9-38-raise-errors/#post-11494175)
 * 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”: [] }
 *  Plugin Author [Denis Ryabov](https://wordpress.org/support/users/dryabov/)
 * (@dryabov)
 * [7 years, 2 months ago](https://wordpress.org/support/topic/new-version-0-9-38-raise-errors/#post-11494409)
 * 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 following `if` condition:
 *     ```
                           if (count($widths)) {
                               $ress_options['plugins']['Ressio_Plugin_WpLazyload']['srcsetwidth'] = array_keys($widths);
                           }
       ```
   
 *  Thread Starter [serg0110](https://wordpress.org/support/users/serg0110/)
 * (@serg0110)
 * [7 years, 2 months ago](https://wordpress.org/support/topic/new-version-0-9-38-raise-errors/#post-11495331)
 * 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!

Viewing 8 replies - 1 through 8 (of 8 total)

The topic ‘new version 0.9.38 raise errors’ is closed to new replies.

 * ![](https://ps.w.org/psn-pagespeed-ninja/assets/icon.svg?rev=1722219)
 * [PageSpeed Ninja - Cache, Minify, Defer CSS JavaScript, Critical CSS, Optimize Images, Convert WebP](https://wordpress.org/plugins/psn-pagespeed-ninja/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/psn-pagespeed-ninja/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/psn-pagespeed-ninja/)
 * [Active Topics](https://wordpress.org/support/plugin/psn-pagespeed-ninja/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/psn-pagespeed-ninja/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/psn-pagespeed-ninja/reviews/)

 * 8 replies
 * 2 participants
 * Last reply from: [serg0110](https://wordpress.org/support/users/serg0110/)
 * Last activity: [7 years, 2 months ago](https://wordpress.org/support/topic/new-version-0-9-38-raise-errors/#post-11495331)
 * Status: not resolved