Title: php illegal string offset warning in logs
Last modified: March 24, 2022

---

# php illegal string offset warning in logs

 *  Resolved [willjames](https://wordpress.org/support/users/willjames/)
 * (@willjames)
 * [4 years, 2 months ago](https://wordpress.org/support/topic/php-illegal-string-offset-warning-in-logs/)
 * Hi, I am getting the following warning message in the server logs. Doesn’t happen
   all the time, it is usually caused by bots going where nobody else does. However
   they do it a lot at ones and it seems to cause CPU spikes.
    This is one example:
   [https://www.truckpages.co.uk/seller/emirsanexport1gmail-com/](https://www.truckpages.co.uk/seller/emirsanexport1gmail-com/)
   I am getting no errors in the console when inspecting in Chrome tools.
 * I am using AO 3.0.0-beta-4 plus Rapidload and CCSS (all up to date)
 * Thanks in advance
 * AH01071: Got error ‘PHP message: PHP Warning: Illegal string offset ‘file’ in/
   var/www/vhosts/domainname.co.uk/httpdocs/wp-content/plugins/autoptimize-beta/
   classes/autoptimizeCriticalCSSCore.php on line 112PHP message: PHP Warning: Illegal
   string offset ‘file’ in /var/www/vhosts/domainname.co.uk/httpdocs/wp-content/
   plugins/autoptimize-beta/classes/autoptimizeCriticalCSSCore.php on line 112PHP
   message: PHP Warning: Illegal string offset ‘hash’ in /var/www/vhosts/domainname.
   co.uk/httpdocs/wp-content/plugins/autoptimize-beta/classes/autoptimizeCriticalCSSEnqueue.
   php on line 119PHP message: PHP Warning: Illegal string offset ‘hash’ in /var/
   www/vhosts/domainname.co.uk/httpdocs/wp-content/plugins/autoptimize-beta/classes/
   autoptimizeCriticalCSSEnqueue.php on line 144PHP message: PHP Warning: Illegal
   string offset ‘file’ in /var/www/vhosts/domainname.co.uk/httpdocs/wp-content/
   plugins/autoptimize-beta/classes/autoptimizeCriticalCSSEnqueue.php on line 144′
 * The page I need help with: _[[log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fwordpress.org%2Fsupport%2Ftopic%2Fphp-illegal-string-offset-warning-in-logs%2F%3Foutput_format%3Dmd&locale=en_US)
   to see the link]_

Viewing 15 replies - 1 through 15 (of 20 total)

1 [2](https://wordpress.org/support/topic/php-illegal-string-offset-warning-in-logs/page/2/?output_format=md)
[→](https://wordpress.org/support/topic/php-illegal-string-offset-warning-in-logs/page/2/?output_format=md)

 *  Plugin Author [Optimizing Matters](https://wordpress.org/support/users/optimizingmatters/)
 * (@optimizingmatters)
 * [4 years, 2 months ago](https://wordpress.org/support/topic/php-illegal-string-offset-warning-in-logs/#post-15493001)
 * OK, I’ll look into those [@willjames](https://wordpress.org/support/users/willjames/),
   more soon(ish) 🙂
 * and thanks for testing the Beta!
 *  Plugin Author [Optimizing Matters](https://wordpress.org/support/users/optimizingmatters/)
 * (@optimizingmatters)
 * [4 years, 2 months ago](https://wordpress.org/support/topic/php-illegal-string-offset-warning-in-logs/#post-15495591)
 * OK, think I identified and the problem and found the solution, can you re-download
   the beta and upload the zipfile to update your installation [@willjames](https://wordpress.org/support/users/willjames/)
   and then remove all rules (you’ll probably see a great deal of those with “critical
   css file” set to “undefined”, so those are broken) ?
 *  Thread Starter [willjames](https://wordpress.org/support/users/willjames/)
 * (@willjames)
 * [4 years, 2 months ago](https://wordpress.org/support/topic/php-illegal-string-offset-warning-in-logs/#post-15495601)
 * Thanks – remind me where I download the beta file from again? Only 2 of the AUTO
   CCSS jobs had ‘undefined’
 *  Plugin Author [Optimizing Matters](https://wordpress.org/support/users/optimizingmatters/)
 * (@optimizingmatters)
 * [4 years, 2 months ago](https://wordpress.org/support/topic/php-illegal-string-offset-warning-in-logs/#post-15495609)
 * sure; [https://github.com/futtta/autoptimize/archive/refs/heads/beta.zip](https://github.com/futtta/autoptimize/archive/refs/heads/beta.zip)
 * re. rules; you can remove just those 2, others can stay 🙂
 *  Thread Starter [willjames](https://wordpress.org/support/users/willjames/)
 * (@willjames)
 * [4 years, 2 months ago](https://wordpress.org/support/topic/php-illegal-string-offset-warning-in-logs/#post-15496253)
 * Thanks – I have done this a new error on the logs:
 * from this page:
    [https://www.truckpages.co.uk/vans-for-sale/](https://www.truckpages.co.uk/vans-for-sale/)
 * `AH01071: Got error 'PHP message: PHP Fatal error: Allowed memory size of 1073741824
   bytes exhausted (tried to allocate 28672 bytes) in /var/www/vhosts/truckpages.
   co.uk/httpdocs/wp-content/plugins/unusedcss/includes/modules/unused-css/UnusedCSS_DB.
   php on line 939PHP message: PHP Fatal error: Allowed memory size of 1073741824
   bytes exhausted (tried to allocate 81920 bytes) in /var/www/vhosts/truckpages.
   co.uk/httpdocs/wp-content/plugins/duplicate-post/vendor/composer/ClassLoader.
   php on line 571PHP message: PHP Fatal error: Allowed memory size of 1073741824
   bytes exhausted (tried to allocate 81920 bytes) in /var/www/vhosts/truckpages.
   co.uk/httpdocs/wp-content/plugins/wp-asset-clean-up-pro/classes/OptimiseAssets/
   OptimizeCss.php on line 533'`
 *  Plugin Author [Optimizing Matters](https://wordpress.org/support/users/optimizingmatters/)
 * (@optimizingmatters)
 * [4 years, 2 months ago](https://wordpress.org/support/topic/php-illegal-string-offset-warning-in-logs/#post-15496685)
 * Afraid memory exhaust issues are rarely due to one plugin willjames; the errors
   mention unused-CSS (rapidload), “duplicate post” and “wp asset cleanup”, but 
   all in all memory issues are due to many a straw breaking the camels back. try
   taking some straws off or make the camels back stronger by increasing PHP memory
   size?
 *  Thread Starter [willjames](https://wordpress.org/support/users/willjames/)
 * (@willjames)
 * [4 years, 2 months ago](https://wordpress.org/support/topic/php-illegal-string-offset-warning-in-logs/#post-15496824)
 * I had ticked some of these boxes in Rapidload and it caused the problem – unticked
   them all and OK now.
 *     ```
       Minify -- Minify and Remove CSS comments via the API (THIS WAS ALREADY TICKED AND OK)
   
        CSS Variables -- Remove unused CSS variables
   
        CSS Animation keyframes -- Remove unused keyframe animations
   
        CSS @font-face rules -- Remove unused @font-face rules
   
        Inline CSS -- Optimize Inline CSS
   
        Cache Busting -- Enable RapidLoad crawler to view pages with a random query string
       ```
   
 *  Plugin Author [Optimizing Matters](https://wordpress.org/support/users/optimizingmatters/)
 * (@optimizingmatters)
 * [4 years, 2 months ago](https://wordpress.org/support/topic/php-illegal-string-offset-warning-in-logs/#post-15497026)
 * happy it works that way, but do keep in mind memory issues might still be lurking
   around the corner even of you removed some straws of the camels back 😉
 * have you tried some of the new features in the beta already?
 *  Thread Starter [willjames](https://wordpress.org/support/users/willjames/)
 * (@willjames)
 * [4 years, 2 months ago](https://wordpress.org/support/topic/php-illegal-string-offset-warning-in-logs/#post-15502174)
 * Hi
    I have tried to work through the new features of 2.0 but after unchecking
   the ‘aggregate js files’ and ‘aggregate css files’ i found that some of the CSS
   was not being deferred at all leading to large issues in page speed. I have CCSS
   set up and it seems to be working but the following files still show as render
   blocking: /wp-includes/css/dist/block-library/style.min.css?ver=5.9.2 autoptimize_single_9d9b573802f7cbb5a8967eb9af830f06.
   css?ver=5.9.2 autoptimize_single_7ffae3dbc7bc585c36649749de14d8b8.css?ver=1.0.0.1.1581000692
   autoptimize_single_5c172d407053946161c2ad8117830e68.css?ver=668 /wp-content/themes/
   motors/style.css?ver=1.0.0.1.1581000692
 * I have taken out any exceptions that I had for CSS and JS when aggregated. Can’t
   understand why just these files are being called out as render blocking?
 * Info: I have also selected the ‘remove global styles’ feature.
 * Additionally, I used to add the name of the page I have added a manual ccss file
   to – so that I know that any changes have been updated and the correct CCSS is
   being called (for example .homepagev22{}) then I knew that if this was at the
   end that was the version of the homepage manual ccss. The system now seems to
   strip this off the end of the files?
 *  Plugin Author [Optimizing Matters](https://wordpress.org/support/users/optimizingmatters/)
 * (@optimizingmatters)
 * [4 years, 2 months ago](https://wordpress.org/support/topic/php-illegal-string-offset-warning-in-logs/#post-15502271)
 * thanks for the feedback!
 * -> re. render blocking CSS; I just looked at the Pagespeed result for the homepage
   and no CSS is being called out as render-blocking. what page did you get that
   message on?
    -> re. the name of the page; AO will now automatically minify inline
   JS/ CSS and that will likely also impact “empty” CSS-selectors. add some dummy
   CSS in there (e.g. `.homepagev22{a:b;}`) or enable “keep HTML comments” or use
   the code snippet below to disable inline CSS/ JS being minified;
 * `add_filter( 'autoptimize_html_minify_inline_js_css', '__return_false' );`
 *  Thread Starter [willjames](https://wordpress.org/support/users/willjames/)
 * (@willjames)
 * [4 years, 2 months ago](https://wordpress.org/support/topic/php-illegal-string-offset-warning-in-logs/#post-15502335)
 * I have just run on homepage and the same files are being called out – I have 
   been trying different options but it is now back to where it ‘should’ be except
   it is not deferring these css files.
 *  Plugin Author [Optimizing Matters](https://wordpress.org/support/users/optimizingmatters/)
 * (@optimizingmatters)
 * [4 years, 2 months ago](https://wordpress.org/support/topic/php-illegal-string-offset-warning-in-logs/#post-15503324)
 * Not entirely sure what is happening here (esp. as there are no differences in
   how CSS is optimized/ deferred between 2.9.x and 3.0 beta), but I have seen those
   files being flagged as render-blocking and then … not;
 * > [View post on imgur.com](https://imgur.com/9DBjluh)
 * > [View post on imgur.com](https://imgur.com/349fEOy)
 * I checked the HTML source and the files mentioned are indeed deferred using [the Filementgroup’s CSS deferring method](https://www.filamentgroup.com/lab/load-css-simpler/)
   so, I cannot but conclude that PageSpeed Insights is flipping a bit? 😉
 *  Thread Starter [willjames](https://wordpress.org/support/users/willjames/)
 * (@willjames)
 * [4 years, 2 months ago](https://wordpress.org/support/topic/php-illegal-string-offset-warning-in-logs/#post-15503371)
 * Is there a recommended route for the trial and error that I am carrying out here?
   with CCSS, Rapidload, WP Super Cache and AO I think I tie myself up in knots.
 * There are a lot of caches to clear each time I change a setting and they sometimes
   take a while to rebuild…?
 * It seems that an upgrade to my theme saw it introduce their own critical css 
   system – not sure if this is conflicting and causing bloat as well in the header?
   Have you seen anything like it before?
 * However, my largest problem that I am facing at the moment is that I am getting
   mixed content messages as Rapidload files seem to be requesting fonts from http:
   rather than https:
 * Have you had any other examples of this happening?
 * Thanks
 *  Thread Starter [willjames](https://wordpress.org/support/users/willjames/)
 * (@willjames)
 * [4 years, 2 months ago](https://wordpress.org/support/topic/php-illegal-string-offset-warning-in-logs/#post-15503425)
 * Sorry – We crossed over in messaging – I hadn’t seen your note prior to sending
   mine and vice versa).
 * I had this issue before with the fonts that the CCSS was injecting the http rather
   than the https: into the inline css even though there is no instruction to do
   so in the original css
 *  Thread Starter [willjames](https://wordpress.org/support/users/willjames/)
 * (@willjames)
 * [4 years, 2 months ago](https://wordpress.org/support/topic/php-illegal-string-offset-warning-in-logs/#post-15503614)
 * I have turned off CCSS and turned on the Rapidload one which seems to be working
   better, except that the main AO css file is now being called out as render blocking(
   when aggregating) or if not aggregating then there are 5 css files showing as
   render blocking.
 * The Rapidload critical css seems to work better than the CCSS one however.

Viewing 15 replies - 1 through 15 (of 20 total)

1 [2](https://wordpress.org/support/topic/php-illegal-string-offset-warning-in-logs/page/2/?output_format=md)
[→](https://wordpress.org/support/topic/php-illegal-string-offset-warning-in-logs/page/2/?output_format=md)

The topic ‘php illegal string offset warning in logs’ is closed to new replies.

 * ![](https://ps.w.org/autoptimize/assets/icon-256X256.png?rev=2211608)
 * [Autoptimize](https://wordpress.org/plugins/autoptimize/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/autoptimize/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/autoptimize/)
 * [Active Topics](https://wordpress.org/support/plugin/autoptimize/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/autoptimize/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/autoptimize/reviews/)

## Tags

 * [PHP Warning](https://wordpress.org/support/topic-tag/php-warning/)

 * 20 replies
 * 2 participants
 * Last reply from: [Optimizing Matters](https://wordpress.org/support/users/optimizingmatters/)
 * Last activity: [4 years, 1 month ago](https://wordpress.org/support/topic/php-illegal-string-offset-warning-in-logs/page/2/#post-15525191)
 * Status: resolved