• Resolved llazzaro

    (@llazzaro)


    We recently changed servers to a more secure server. After the switch we are geting a message from tablepress that it can’t save custom css and it is asking for FTP information. You can’t directly ftp to the server. I have given write access to the tablepress-custom.css and tablepress-custom.min.css yet I still get the message.

    Why am I getting the unable to write message when I have given write access to the css files?

    https://www.ads-software.com/plugins/tablepress/

Viewing 9 replies - 1 through 9 (of 9 total)
  • Plugin Author Tobias B?thge

    (@tobiasbg)

    Hi,

    thanks for your question, and sorry for the trouble.

    Just making the files writable is not sufficient, from what I know about the WordPress Filesystem API. This is basically the same as the process that WordPress uses for updating plugins, themes, and itself. For details, please see https://codex.www.ads-software.com/Filesystem_API as well as the explanation at https://core.trac.www.ads-software.com/ticket/33966#comment:2

    Note that your “Custom CSS” will still be saved to the database and loaded from there, even if the “Custom CSS” can not be written to a file. It will then simply be included into the page. Another option, if you don’t want to further mess with the permissions, would be to add the CSS to your theme’s CSS, although you would then not have the clear separation.

    Regards,
    Tobias

    Thread Starter llazzaro

    (@llazzaro)

    This doesn’t really make sense to me. Why would it need to use the Filesystem API like updating plugins and themes. Why wouldn’t work more like the media library to create a file. It really shouldn’t need FTP credentials to write a file out.

    Not to mention in trying to track this down for what file needed the permissions changed and tried on a local machine setup and it doesn’t appear to change any files not a single had the modified stamp changed.

    Plugin Author Tobias B?thge

    (@tobiasbg)

    Hi,

    it doesn’t need the FTP credentials by default. It only asks for those if the direct writing method fails, i.e. the FTP method is a fallback.
    The Media Library works in a different way, as the upload and file creating is handled differently there (usually by the webserver), so that PHP/WordPress only has to move and rename a file that a user uploaded.

    The written files are tablepress-custom.css, tablepress-custom.min.css, and tablepress-combined.min.css, in the “wp-content” folder. Why the “Modified” timestamp does not change, I don’t know, I’m afraid ??

    Regards,
    Tobias

    Thread Starter llazzaro

    (@llazzaro)

    Then something isn’t working right. I tried change the rights on those files to 777 on them. I also made the server system user the owner of them and it is still prompting me for ftp credentials. I did the same things I would do to the .htaccess file if I wanted wordpress to be able to change it directly and I am being prompted for ftp credentials

    Plugin Author Tobias B?thge

    (@tobiasbg)

    Hi,

    is the direct writing method maybe disabled? A good way to debug this is the Filesystem Module of the Core Control plugin from https://www.ads-software.com/plugins/core-control/

    Regards,
    Tobias

    Thread Starter llazzaro

    (@llazzaro)

    I’m not loading a plugin that hasn’t been updated in over 4 years. The direct writing method isn’t disabled. I can go to permalinks and it will update my .htaccess file. I have a security plugin that can update the .htaccess file and the wp-config file. Your plugin is the only one having problems writing to files.

    Plugin Author Tobias B?thge

    (@tobiasbg)

    Hi,

    that plugin has been written by a core committer (dd32) of WordPress. He’s the one who wrote most of the Filesystem API and the Update API, and that the plugin has not been updated in a while is also a sign of its quality. It just works. ??

    If you want, I can offer to take a direct look at this on your site. In that case, please create a temporary admin account for me and send me the details via email (the address is in the main plugin file “tablepress.php”)? That way, I can investigate this directly. Thanks!

    Regards,
    Tobias

    Thread Starter llazzaro

    (@llazzaro)

    Do to the security required I can not give anyone admin access to this wordpress install or server.

    Your use of the Filesystem API is what causes this problem. One my local machine running wamp it says it is updating the files but they are never written too. In the server highly secure server environment it defaults to ftp no matter what the permissons are to the directories or files you are trying to update. If you look at wordpress code they don’t use the filesystem API to update the .htaccess file when you save your permlinks. It is only used in the situation of wordpress updates. That makes sense. The work around I found is to for the FS_Method to direct in the wp-config.

    You could do it in your code also. You should only ever need direct when updating the css files. You can still check for proper write access.

    Plugin Author Tobias B?thge

    (@tobiasbg)

    Hi,

    unfortunately, I don’t know what exactly I could change about the use of the Filesystem API in TablePress ??
    It’s working totally fine for pretty much all other users of the plugin, as I don’t remember similar reports to yours at the moment.
    Due to the flexibility that it offers (the direct method, as well as the fallback to FTP where the direct method fails), I don’t want to switch away from it.

    Regards,
    Tobias

Viewing 9 replies - 1 through 9 (of 9 total)
  • The topic ‘Custom CSS Saving’ is closed to new replies.