• Hello!

    I’m in the process of testing the migration of my hosting from php 7.4 to 8.1, as 7.4 isn’t maintained anymore, however I stumbled upon an issue I can’t quite figure out. May I humbly ask for help or tips, please? Thanks so much!

    The context:

    I observed it on a clone (files + database, just editing the settings path to its test subdirectory) of an active 6.1 wordpress blog fully working in a php 7.4 environment…

    BUT I also observed it on a brand new wordpress, installed on an empty directory with a freshly downloaded wordpress zip archive, using a brand new freshly created database. Only 1 plugin was added, Classic Widgets (to avoid the subjectively cumbersome block editing from the widgets management.)

    Environment: Debian Buster, webmin+virtualmin, the panel allows to fine-tune, directory per directory, which php execution mode is to be used, with a “default for everyone, save [chosen folders: php version x.y]” principle. The php versions used to test are 8.1.13 and (the default) 7.4.33.

    Final bit of context: I use the oh-so-precious Classic Widgets plugin, to avoid block editing thrown into the widgets menu (https://www.ads-software.com/plugins/classic-widgets/).

    The bug:

    Saving the text contents of widgets only works when this is basic html content. (Think p, center.)

    Anything more complex, a script, a form, or php, it won’t be saved. I click the “Save” button, a spinning wheel icon starts rotating left of the Save button… and nothing more happens. if I come back five actual minutes later to check, the button is still spinning, if I refresh the page, the change hasn’t been saved.

    A screenshot: https://imgur.com/a/cS8hCzQ

    An example of the code that won’t be saved into a widget area, this is, plainly, a search form, no more, no less:

    <div class="search_main">
    <form method="get" class="searchform" action="/" autocomplete="off">
    <input type="text" class="field s" name="s" value="Search..." onfocus="if (this.value == 'Search...') {this.value = '';}" onblur="if (this.value == '') {this.value = 'Search...';}" autocomplete="off">
    <button type="submit" class="fa fa-search submit" name="submit" value="Search"></button>
    </form>
    <div class="fix"></div>
    </div>

    I do possess a plugin for enhanced widgets, that allow php code to run, but I can assure you, if I deactivate this plugin and run the test again, the problem hasn’t gone. (The problem is also present on a fresh wordpress with default plugins and settings, save for the addition of Classic Widgets.)

    I tried without the “Classic widgets” feature that I use to disable block editing in wordpress widgets, went to create a “Code” widget, pasted inside the code I quoted above, and it gave “There was an error. The response is not a valid JSON response.”. No idea if that’s the same issue or not, though.

    I checked the website’s apache error log, without a risk of false positives as it was a test ground: nothing is recorded, at all, when I click the “Save” button and nothing happens.

    … And at this point, I’m at my wit’s end.

    Please, would anyone know what may be causing it, or how I may further debug it to find what may be causing it?

    All help and suggestions will be more than welcome, thank you!

    • This topic was modified 1 year, 10 months ago by Sabinooo.
    • This topic was modified 1 year, 10 months ago by Sabinooo.
Viewing 4 replies - 1 through 4 (of 4 total)
  • Moderator t-p

    (@t-p)

    I use the oh-so-precious Classic Widgets plugin

    I recommend reporting the issue at https://www.ads-software.com/support/plugin/classic-widgets/#new-post so its developers can help you with this.

    • This reply was modified 1 year, 10 months ago by t-p.
    Thread Starter Sabinooo

    (@sabinooo)

    You think it may be because of classic-widgets? Is that a hopeful guess, or would you believe there’s good reason to believe it is that plugin’s fault?

    Well, I’ll do that report. Thank you!

    Edit: report done.

    Edit 2: BTW, I just realized my screenshot was poorly done, the “spinning waiting circle” didn’t appear, my bad! New screenshot: https://imgur.com/a/y3cWLmB

    • This reply was modified 1 year, 10 months ago by Sabinooo.
    • This reply was modified 1 year, 10 months ago by Sabinooo.
    • This reply was modified 1 year, 10 months ago by Sabinooo.
    Moderator t-p

    (@t-p)

    You think it may be because of classic-widgets?

    Unless I misunderstood, Reading OP, I thought that plugin was the error.

    Also, WordPress 6.x is tested with PHP 8 and offers preliminary support, but we cannot guarantee compatibility for every and all plugins and themes since that is the responsibility of the plugin/theme developer.

    Thread Starter Sabinooo

    (@sabinooo)

    I’d be also inclined to suspect the classic widgets plugin, but there was this preoccupying “not a valid JSON response” when attempting to paste my code into a specifically “code” widget while classic widgets was deactivated, which made me doubt.

    Either that was a different issue, or it meant the culprit wasn’t classic widgets…

    Anyway, I reported it just in case, here’s to hoping.

    Cheers, thanks for your help!

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Can’t save code (html, script, php) in widgets, it used to work’ is closed to new replies.