I am working with the WordPress VIP team and their platform does not allow Scripts Organizer to work without a patch. The reason has to do with the file open process. Here is the note they provided:

Currently this fopen is set to wa+ which means:

Open the file for reading and writing, truncate the file to 0 bytes and set the pointer to the beginning and the end of the file. This non-standard way of opening a file doesn’t seem to be in spec for PHP, but core PHP seems to loosely allow it to work. Our file system is a bit more strict with modes and is failing this fopen().

Patching the plugin to use a standard w+ seems to allow it to work as intended in my testing.

I am not sure if there is a reason you took this approach or if it is something that could be looked at. Just wanted to make you aware.

3 responses to “Error opening file”

  1. cmsexpertss says:

    Hi,

    Thank you for sharing this. Please have a look at PHP’s official documentation about “fopen” https://www.php.net/manual/en/function.fopen.php where “wa+” is explained and as its part of official documentation so it means its a standard feature, I don’t know why the plugin authors mentioned that its not a standard way of opening a file.

    And we are using it because some libraries that we are using, code generated by them need “wa+”

    Regards,
    Muhammad Osama

  2. stphnwlkr says:

    Thank you for the reply and apologies for not going and looking at the documentation myself. I made an assumption that they knew what they were talking about. I will send the link to the VIP team.

  3. stphnwlkr says:

    This can be closed.

Leave a Reply

Your email address will not be published.