• Resolved neotechnomad

    (@neotechnomad)


    Today when attempting to update my theme files, I am now constantly getting this warning…

    “Something went wrong. Your change may not have been saved. Please try again. There is also a chance that you may need to manually fix and upload the file over https://FTP.”

    …and cannot update any theme files.

    I can update pages and posts but not theme files.

    Deactivated all plugins.
    Reloaded theme.
    Switched to default theme.
    Re-Updated WordPress core files.
    Checked htaccess and wp-config files.
    Site Health Status is ‘Good’.
    Security plugin logs no errors files.
    Checked site by FTP – no error files.
    All file permissions are 644.

    I am now at a loss as to where to go from here.
    Any suggestions?

Viewing 7 replies - 1 through 7 (of 7 total)
  • Dion

    (@diondesigns)

    Posts/pages are stored in the database; plugin/theme files are stored in the web-facing filesystem. This is a filesystem issue, and it’s almost always due to PHP running as a different user than the one that owns the web-facing filesystem.

    If you have FTP access, you should be editing theme/plugin files using FTP. It’s safer and more secure. Which leads me to a question: are you able to edit theme/plugin files using FTP? If not, then contact your host ASAP.

    You may want to contact your host anyway and ask whether they recently made any changes to your hosting plan’s default configuration.

    Thread Starter neotechnomad

    (@neotechnomad)

    @diondesigns I have FTP access which is how I checked the permissions, the htaccess and wp-config files. I always install WordPress myself via FTP.

    This site has been up for a month now with no issues. I always modify my files through the Theme Editor on all my sites in order to view the changes live on several different media.

    This is the first time I have encountered this issue on any of my sites (…I own 4 of them) which is why I thought it would be the theme. All the same plugins are used on all 4 of the sites.

    The only difference with this site is that I load the fonts through Google Fonts via their links in the header.php. I considered that and removed the links but still the issue continues.

    Dion

    (@diondesigns)

    The issue isn’t file permissions, it’s file ownership. If the permissions are 0644, only the user that owns the file can edit it. If PHP isn’t running as that user, you will not be able to edit files using the theme/plugin editor.

    So check the ownership, not the permissions, of the theme files. Compare the ownership to a media file that was uploaded through the “Add Mew” button on the Media Library page. The media files will be owned by the user that PHP runs under, and if it’s a different user than the owner of the theme files, you have found your problem.

    Note that FTP will report the ownership as a number. You’ll need to use SSH/SFTP to see the actual username that owns a file.

    Thread Starter neotechnomad

    (@neotechnomad)

    Owner/Group are all 1803/1807 everywhere including all the plugins which were all installed weeks ago and both themes (mine and default 2022).
    I uploaded images yesterday (the 13th) that are used in the theme’s CSS file and had updated that file yesterday as well as other files in the theme with no problems.
    Today… this issue.

    I just went into the plugins editor clicked the update button on one of the files in the Akismet plugin. Same result – the warning appeared.

    Perhaps this is something to do with my host?

    Dion

    (@diondesigns)

    Perhaps this is something to do with my host?

    That is a distinct possibility, which is why I said above:

    You may want to contact your host anyway and ask whether they recently made any changes to your hosting plan’s default configuration.

    Thread Starter neotechnomad

    (@neotechnomad)

    I have and it seems to be a mod security issue as I found multiple sever error logs concerning it. The host techs are investigating it now.

    Thread Starter neotechnomad

    (@neotechnomad)

    So, it was a modsecurity issue which the techs at my host resolved.
    This thread is closed now.

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Cannot Update Files In Theme Editor’ is closed to new replies.