• Resolved MaxD

    (@max-dayala)


    Hi,

    On my local development environment I’m running an Apache server on a Windows 11 machine.

    If I try to save Custom Styling on the Plugin Options page it seems to save to the database fine but the files are not written to the file system.

    I stepped through some of the code with a debugger and it seems the write fails becuase the file names have absolute windows paths.

    This is in class-css.php function _custom_css_save_help which calls validate_file and returns a value of 2:
    A return value of 2 means the file path contains a Windows drive path.

    Hence, is this behaviour by design, in that it is designed to not save on a windows machine?

    Thanks for any ideas about this.

    Max

    Block Theme: yes
    TablePress: 3.2.6
    TablePress (DB): 120
    TablePress table scheme: 3
    Plan: Free
    Plugin installed: 2018/05/09 12:54:34
    WordPress: 6.9
    Multisite: no
    PHP: 8.3.26
    mySQL (Server): 10.11.14-MariaDB
    mySQL (Client): mysqlnd 8.3.26
    mbstring: yes
    ZipArchive: yes
    DOMDocument: yes
    simplexml_load_string: yes
    libxml_disable_entity_loader: yes
    UTF-8 conversion: yes
    WP Memory Limit: 40M
    Server Memory Limit: 512M
    WP_DEBUG: true
    WP_POST_REVISIONS: true
Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author Tobias Bäthge

    (@tobiasbg)

    Hi!

    Thanks for your post and sorry for the trouble!

    Hmm, that’s a very interesting case. Unfortunately, I’m not too experienced with WordPress development on Windows, so that I’m not sure why this is happening like that. It’s certainly not my intention to block Windows or anything, and the code for saving these CSS files is very close to what WordPress uses in several places itself. So far, as TablePress uses the WordPress Filesystem API functions, my assumption was that WordPress internally handles the conversion of the different file and path formats.

    Unfortunately, as I’m not really sure what to do here, and as this has only very minor implications (TablePress will simply load the CSS code directly if it can’t write it to files) on a development site, I can’t really promise a solution in the near future here. I will however add this to my list of things to investigate more deeply! So, definitely thanks a lot for bringing this up and reporting this!

    In the meantime, do you maybe have a chance to test this on e.g. a Linux setup, or a Docker/container-based development setup? This could also have the advantage to being closer to common production environments for WordPress sites.

    Best wishes,
    Tobias

    Thread Starter MaxD

    (@max-dayala)

    Yes, no worries. It works on a linux server.

    Looking at the code in a bit more detail I can see you’d need to do quite a bit of rework to get the saving (and probably the loading too) working on Windows. One for the backlog for sure!

    Thanks,

    Max

    Plugin Author Tobias Bäthge

    (@tobiasbg)

    Hi Max,

    Thanks for your reply and feedback! I’ll definitely look into this more!

    Best wishes,
    Tobias

Viewing 3 replies - 1 through 3 (of 3 total)

You must be logged in to reply to this topic.