• Has anyone encountered this yet when trying to edit template files?

    “Unable to communicate back with site to check for fatal errors, so the PHP change was reverted. You will need to upload your PHP file change by some other means, such as by using SFTP.”

    It seems as though WP won’t let me edit template files directly anymore. If so, this is really, really bad.

    As a developer I understand the risk of not using a child theme. Shouldn’t this new feature be optional? If it is, please let me know how to turn it off.

    There’s also an issue now when trying to copy or paste in template files, the page jumps all over the place, and the paste ends up in random places..

    Thanks!

Viewing 11 replies - 1 through 11 (of 11 total)
  • This is a new feature with WP4.9. Editing such files directly in the editor is not advised. It was only originally intended for quick fixes but has broken many sites when not done well. Please review:

    Warning: Potential Danger Ahead!
    When you edit themes and plugins directly, WordPress 4.9 will politely warn you that this is a dangerous practice and will recommend that you draft and test changes before updating your file. Take the safe route: You’ll thank you. Your team and customers will thank you.

    WordPress 4.9 “Tipton”

    Yes same problem for me, and i have problem with file modified by filezilla.

    They make wordpress more dificult for normal user, need install another plugin for edit file : file manager

    • This reply was modified 7 years, 3 months ago by Pierre236.
    Thread Starter deepbevel

    (@deepbevel)

    Oh well, I just have to stay logged in to the sites host. That way I can maintain the liberty to mess up a site if I should so choose. I thought WordPress was all about freedoms? lol

    If you’re on your own server try to retake ownership of wordpress files and folders:
    from Linux terminal enter /home/www/WEBSITE and Assign 755 to folders and 644 to files in /home/www/WEBSITE :
    # sudo chown www-data:www-data -R *
    # sudo find . -type d -exec chmod 755 {} \;
    # sudo find . -type f -exec chmod 644 {} \;

    On shared hosting I could’t find a viable solution, only copying theme-editor.php from the old v4.8 WP-Admin files over the new v4.9.1 one. Use at own risk.

    • This reply was modified 7 years, 3 months ago by Blueyefinity.
    • This reply was modified 7 years, 3 months ago by Blueyefinity.
    • This reply was modified 7 years, 3 months ago by Blueyefinity.

    Update

    Deactivate/Reactivate all your plugins one by one and test the editor. Some plugins are interfering.
    On one of my websites I found out that an older version of the plugin “Facebook Open Graph, Google+ and Twitter Card Tags” would not let my editor to save changes. Deactivating it/updating it would fix the issue.

    Thread Starter deepbevel

    (@deepbevel)

    Thanks all, It’s not so important that I would employ a server hack. Also I need all my plugins, so I’ll have to wait until those plugins update to accommodate this. In the mean time I’m getting used to editing files on my server.

    Yes, we have this problem now with several sites.

    @pioneer Web Design (@swansonphotos) – keeping users from making mistakes by taking away usability is at least debatable. In our case we have a web admin with no access rights to the servers (not even via FTP). He totally relied on the option to edit specific php files if necessary through the dashboard. Now we are forced to send in a change request to IT and wait until they find the time to make the changes – for every single change of code – even adding something like a tracking snippet!

    This step is bad design in my opinion. It enforces people to use even more plugins, more plugins are by far less stable and safe than making some changes to the code. 60-80% of the functionality, that lazy people cover with plugins can be done by very small changes to the PHP files – you just have to do some research and learning. The result will always be faster, more reliable (no plugins being discontinued) and fully under your own control. You can’t do this, though, if the company has a structure that does not grant every second employee access to the root servers. WP was great at allowing webdamins access to specific files only. I really don’t get the reason for taking this away and force people to rebuild it now by setting up FTP clients with restricted access rights.

    I don’t see why it should be more unlikely to break one’s WP site now, by uploading buggy code via FTP instead of making changes to the file within the browser. Upload a broken PHP file and your site will go white anyway.

    euricsanti

    (@euricsanti)

    Is not wordpress fault that people can’t know how to manage information, for us, the one’s that do know what we are doing, is annoying. I have to go every time to CPanel, just add a tracker, a snippet or just to change a description on the meta data.

    You should really remove this or make it simply optional. Not cool at all. Is more time consuming, and if we have to add another plugin, means more computing power or slow site, which is not good for visitors.

    Thread Starter deepbevel

    (@deepbevel)

    Ok, new bug. I just tried again to update my functions file, I got the usual message “Unable to communicate back with site to check for fatal errors, so the PHP change was reverted. You will need to upload your PHP file change by some other means, such as by using SFTP.”

    However, my file was indeed updated anyway, but not with my changes. When I went to the file on my host, it was empty. WordPress completely erased my functions file.

    So it’s much worse than I thought. This new file protection thing doesn’t work consistently, and makes site editing even more dangerous than before!

    If you even attempt to update files from inside WordPress, you risk losing the entire file, regardless of the changes you may be trying to make. I was only updating hard coded links after assigning a domain to the site, seemingly safe enough, but apparently, not anymore. Developers beware!

    • This reply was modified 6 years, 11 months ago by deepbevel.
    Thread Starter deepbevel

    (@deepbevel)

    Just to be clear, I made changes to a template file from inside WordPress, I saved my changes, got the message that my changes couldn’t be saved like usual. So, I went on my host, again like usual. When I went to edit the file, it was blank. This shouldn’t be possible, as the point of the new template file protection is to prevent file changes from inside WordPress. If a file gets wiped clean, I call that a change!

    If this can be caused by a plugin incompatibility, then this new feature is too dangerous to employ, because the damage can’t be reversed by simply deactivating the culprit plugin.

    Agreed and ++++1. I lost the site for 30 minutes while I redeployed a back up in a local environment to get the header, post and page files that suddenly went to Zero Bytes. For a novice user, this “feature” that sets your edited files to “_____” could be a serious problem.

Viewing 11 replies - 1 through 11 (of 11 total)
  • The topic ‘Can’t edit template files direcly since 4.9’ is closed to new replies.