• Resolved p3xhosting

    (@p3xhosting)


    Fatal Error

    2024-08-16T11:29:15+00:00 Kritisch Uncaught TypeError: implode(): Argument #1 ($array) must be of type array, string given in /var/www/vhosts/test.p3xhosting.de/httpdocs/wp-content/plugins/wp-optimize/minify/class-wp-optimize-minify-front-end.php:1383 Zus?tzlicher Kontext{ “error”: { “type”: 1, “file”: “/var/www/vhosts/test.p3xhosting.de/httpdocs/wp-content/plugins/wp-optimize/minify/class-wp-optimize-minify-front-end.php”, “line”: 1383 }, “backtrace”: [ “”, “#0 /var/www/vhosts/test.p3xhosting.de/httpdocs/wp-content/plugins/wp-optimize/minify/class-wp-optimize-minify-front-end.php(1383): implode()”, “#1 /var/www/vhosts/test.p3xhosting.de/httpdocs/wp-includes/class-wp-hook.php(324): WP_Optimize_Minify_Front_End->process_header_scripts()”, “#2 /var/www/vhosts/test.p3xhosting.de/httpdocs/wp-includes/class-wp-hook.php(348): WP_Hook->apply_filters()”, “#3 /var/www/vhosts/test.p3xhosting.de/httpdocs/wp-includes/plugin.php(517): WP_Hook->do_action()”, “#4 /var/www/vhosts/test.p3xhosting.de/httpdocs/wp-includes/script-loader.php(2215): do_action()”, “#5 /var/www/vhosts/test.p3xhosting.de/httpdocs/wp-includes/class-wp-hook.php(324): wp_print_head_scripts()”, “#6 /var/www/vhosts/test.p3xhosting.de/httpdocs/wp-includes/class-wp-hook.php(348): WP_Hook->apply_filters()”, “#7 /var/www/vhosts/test.p3xhosting.de/httpdocs/wp-includes/plugin.php(517): WP_Hook->do_action()”, “#8 /var/www/vhosts/test.p3xhosting.de/httpdocs/wp-includes/general-template.php(3065): do_action()”, “#9 /var/www/vhosts/test.p3xhosting.de/httpdocs/wp-content/themes/imarket/header.php(16): wp_head()”, “#10 /var/www/vhosts/test.p3xhosting.de/httpdocs/wp-includes/template.php(810): require_once(‘…’)”, “#11 /var/www/vhosts/test.p3xhosting.de/httpdocs/wp-includes/template.php(745): load_template()”, “#12 /var/www/vhosts/test.p3xhosting.de/httpdocs/wp-includes/general-template.php(48): locate_template()”, “#13 /var/www/vhosts/test.p3xhosting.de/httpdocs/wp-content/themes/imarket/page.php(17): get_header()”, “#14 /var/www/vhosts/test.p3xhosting.de/httpdocs/wp-includes/template-loader.php(106): include(‘…’)”, “#15 /var/www/vhosts/test.p3xhosting.de/httpdocs/wp-blog-header.php(19): require_once(‘…’)”, “#16 /var/www/vhosts/test.p3xhosting.de/httpdocs/index.php(17): require(‘…’)”, “#17 {main}”, “thrown” ] }

    The page I need help with: [log in to see the link]

Viewing 15 replies - 1 through 15 (of 15 total)
  • To help us assist you better, could you please provide the following details?

    • Which version of WP-Optimize were you trying to install when you encountered this error?
    • Did the error occur immediately after WP-Optimize activation, or were you able to use the plugin for a while before it happened with any other plugin’s activation?
    • Are there any other customizations or code snippets related to WP-Optimize or site optimization in your functions.php file or elsewhere in your WordPress setup?

    Your response will help us diagnose the problem more effectively and guide you toward a solution.

    Thread Starter p3xhosting

    (@p3xhosting)

    Hello, WP-Optimize version 3.5.0.

    Yes, the error occurred immediately after updating.

    No, no files were changed.

    With many thanks Felix

    Hi @p3xhosting ,

    I attempted to replicate the issue on my end, and the update from v3.4.2 to v3.5.0 was successful without any errors. If your previous version was lower than v3.4.2, please let us know so we can test with that version as well.

    In the meantime, I’ve forwarded the details to our developers for further investigation. They will review the situation and work on a possible patch if they identify any underlying issues.

    I really appreciate you bringing this to our attention, and I’ll keep you updated as soon as I receive any updates from the team.

    Thank you for your understanding.

    Best regards,

    Thread Starter p3xhosting

    (@p3xhosting)

    Hello, thank you very much for your help.

    I have updated from version 3.4.2 to.

    With many thanks Felix

    You’re welcome, @p3xhosting. Thank you for confirming that you updated from version 3.4.2.

    cconstantine

    (@cconstantine)

    I am running v3.5.0 of the plugin and I’m seeing the same error as the OP…

    [20-Aug-2024 11:39:30 UTC] PHP Fatal error:  Uncaught TypeError: implode(): Argument #1 ($array) must be of type array, string given in /home/open7/public_html/wp-content/plugins/wp-optimize/minify/class-wp-optimize-minify-front-end.php:1383
    Stack trace:
    #0 /home/open7/public_html/wp-content/plugins/wp-optimize/minify/class-wp-optimize-minify-front-end.php(1383): implode('', NULL)
    #1 /home/open7/public_html/wp-includes/class-wp-hook.php(324): WP_Optimize_Minify_Front_End->process_header_scripts('')
    #2 /home/open7/public_html/wp-includes/class-wp-hook.php(348): WP_Hook->apply_filters(NULL, Array)
    #3 /home/open7/public_html/wp-includes/plugin.php(517): WP_Hook->do_action(Array)
    #4 /home/open7/public_html/wp-includes/script-loader.php(2215): do_action('wp_print_script...')
    #5 /home/open7/public_html/wp-includes/class-wp-hook.php(324): wp_print_head_scripts('')
    #6 /home/open7/public_html/wp-includes/class-wp-hook.php(348): WP_Hook->apply_filters(Array, Array)
    #7 /home/open7/public_html/wp-includes/plugin.php(517): WP_Hook->do_action(Array)
    #8 /home/open7/public_html/wp-includes/general-template.php(3065): do_action('wp_head')
    #9 /home/open7/public_html/wp-includes/template-canvas.php(17): wp_head()
    #10 /home/open7/public_html/wp-includes/template-loader.php(106): include('/home/open7/pub...')
    #11 /home/open7/public_html/wp-blog-header.php(19): require_once('/home/open7/pub...')
    #12 /home/open7/public_html/index.php(17): require('/home/open7/pub...')
    #13 {main}
    thrown in /home/open7/public_html/wp-content/plugins/wp-optimize/minify/class-wp-optimize-minify-front-end.php on line 1383

    I have two separate WordPress installations (not multi-site, fully separate) exhibiting the same error. Both sites have the ActivityPub plugin installed. The error occurs only on the page (on each site) where I Have an ActivityPub shortcode. Disabling the ActivityPub plugin enables the page to load without this error.

    So it appears something ActivityPub is doing, pokes some un-handled edge case in WP-Optimize??

    cconstantine

    (@cconstantine)

    I’ve also started a discussion in the ActivityPub plugin support, https://github.com/Automattic/wordpress-activitypub/discussions/869

    Plugin Support vupdraft

    (@vupdraft)

    Can you try temporarily disabling the minification and see if the issue persists?

    cconstantine

    (@cconstantine)

    Yes, the pages (on both sites) load fine when I disable minification and enable the ActivityPub plugin.

    Thread Starter p3xhosting

    (@p3xhosting)

    Hallo,

    yes with me too.

    But the loading times of the page are no longer so good!

    Plugin Support vupdraft

    (@vupdraft)

    Apologies for the delay.

    Do you have merging enabled for CSS and JS?

    Can you check if your site support http2, if it does you should not have merging enabled as it will be slowing your site down (leave minify enabled)

    You can check if your site supports http2 here:https://tools.keycdn.com/http2-test

    In this screenshot merging is the only option enabled. This is for JavaScript but there is an identical option in CSS. Uncheck this option in both the CSS and JavaScript it to stop merging. You may find this fixes the issue.

    @p3xhosting the site you have mentioned does not support http2 but please try disabling merging anyhow. If this fixes it enable it again for JS and CSS one at a time so that you find the offending one (it’s more likely to be the JS). You will need to uncheck merging for the one that is causing the issue but check enable it where you can.

    If disabling the merging does not work, we will need to find the the script/CSS that is causing this and exclude it from processing

    Here are instructions of finding the JS file causing issues and excluding it from processing;

    • Open Developer Tools. You do that either by right-clicking and choosing Inspect Element, or at the top of the window go to: View >> Developer >>Developer Tools
    • Find the red error message indicator on the right-hand side
    • Click it to open the Console, then click the file referenced in the error notice:
    • This takes you directly to the code in the file that is related to the error. Look for the red underline and copy part of that code:
    • Open a new browser tab and load the un-cached version of the page. You will need to use an incognito window
    • Open Developer Tools, then click the 3 dots on the right side and select Search All Files:
    • Paste the problematic code in the search box and it will locate the file in which that code is found:
    • It’s not possible, unfortunately, to copy the filename from this screen. So to do that, click on the Network tab (reload the page if necessary to pull in the files). Then search for the file in the list:

      Once you’ve located the file, right-click on the filename, select Copy, then Copy Link Address to the exclusion list under Minify>> Javascript >> Exclude JavaScript from processing

    After saving this you can visit your site again, reload the page and check that there are no more JavaScript errors reported in the console.

    To find the problematic CSS

    • Install the Blue Button Chrome extension?
    • – Turn off minfication? and load the page in your browser.
    • – In Blue Button, click on Stylesheets or Scripts to get the list of internal and external CSS and JavaScript files on your site.?
    • -Turn on minify

    – Copy the list of CSS files and add them to Minify CSS >> Exclude the CSS files from processing.

    Then, remove the files one by one, checking as you go to see if the script is causing issues

    cconstantine

    (@cconstantine)

    @vupdraft were you also talking to me with that reply?

    Because… uh, no. WP-Optimize is passing a Null to a PHP function. That’s a PHP API violation. Other plugins misbehaving should never cause one’s code to do that.

    Unfortunately, I don’t have time to wade around in this.

    Do you have plans to fix the bug (write edge-case handling to avert calling with invalid argument)? I understand if you don’t plan to change it; it’s easy enough for me to work around by simply uninstalling WP-Optimize.

    Apologies for the confusion, and thank you for your patience. I have already raised this issue with our development team to fix the bug, and we’ve assigned it a higher priority. Our team is actively working on it, and we plan to push a patch in the upcoming release.

    Regarding @vupdraft’s suggestion about disabling merging for CSS and JavaScript, it was aimed at troubleshooting and identifying whether merging was contributing to the issue, especially since merging can sometimes cause conflicts or unexpected behavior with other plugins. This step was suggested as a temporary workaround to help alleviate the issue until a permanent fix is implemented.

    I’ll keep you updated on the status here, and we really appreciate you bringing this to our attention.

    Thank you for your understanding and cooperation.

    Thread Starter p3xhosting

    (@p3xhosting)

    What bad support!!!

    I’ve been waiting for an upgrade for 3 weeks because of the errors. Why should I tinker with the plug-in myself when I bought a license for €99? We will not extend the license, and we will also provide a bad review along the way. Nice day from the beautiful north

    Hi @p3xhosting,

    I sincerely apologize for the frustration this has caused, and I completely understand your disappointment. The issue has been resolved, and the official release is expected next week.

    Since you’re a licensed user, I’d like to offer you early access to the update. Please send an email to [email protected], and I’ll provide you with the zip file for the upcoming version so you can install it right away and resolve the issue.

    Thank you again for your patience and understanding.

    Best regards,

Viewing 15 replies - 1 through 15 (of 15 total)
  • The topic ‘Fatal Error’ is closed to new replies.