• Resolved mkrause

    (@mkrause)


    Hi, first of all, thanks for the plugin, I like it a lot. The only problem I have is with the temp subfolder inside the plugin main folder. Since it needs to be writable for the web server, it causes me a lot of problems when updating the plugin. I manage a lot of sites with wp-cli, so the plugins folder is not writable for the web server by default. Every update requires me to change the permissions on the temp folder and its subfolders, and sometimes it even happens that the update ends with the old version deleted, but the main folder with the temp subfolder still in place, effectively blocking the installation of the new version.

    I think plugins should prefer to write temporary data outside their main folder, like caching plugins do for example. It would be easier to manage the plugin if the temp folder was in wp-content/uploads, which is always writable, or directly in wp-content (something like wp-content/ia-temp or so). This will make it much easier to manage WordPress sites with Independent Analytics installed. Thanks for considering this change.

Viewing 8 replies - 1 through 8 (of 8 total)
  • Plugin Author Ben Sibley

    (@bensibley)

    Hi there,

    I’m glad you reached out about this because we do have a solution prepared for this situation.

    In order to change the location of the temp folder, you can add the following snippet to your site:

    add_filter('iawp_temp_directory_path', function ($value) {
      return '/code/wp-content/uploads/iawp/';
    });

    Then, IA will write this content to the location you set, rather than inside the plugin folder.

    We used to place the temp folder in wp-content/uploads/, but we had even more issues there, so we moved it into the plugin’s folder instead.

    Thread Starter mkrause

    (@mkrause)

    Hi Ben, thanks for your reply – the filter works like a charm, problem solved ??

    Plugin Author Ben Sibley

    (@bensibley)

    Glad to hear that, and thanks for the review!

    joegasper

    (@joegasper)

    Is this something you could move to a variable we could define in wp-config.php?

    Plugin Author Ben Sibley

    (@bensibley)

    Yea that’s a great idea. We’ll add the option to define a variable in wp-config.php as well. I’ll post back here once that’s available.

    Plugin Author Ben Sibley

    (@bensibley)

    @joegasper we released version 2.3 today, and it supports a constant called IAWP_TEMP_DIR to define the temp folder location.

    @bensibley Thank you. Can you please provide a full example for placing in wp-config.php please? An example for placing under /uploads/iawp/ would helpful.

    Plugin Author Ben Sibley

    (@bensibley)

    Sure, here’s an example of what you would place into wp-config.php:

    define( 'IAWP_TEMP_DIR', 'public_html/wordpress/wp-content/uploads/iawp');

    The path is relative so the beginning (public_html) is going to be different for each host, but the rest of the code will stay the same.

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘Issues with temp folder’ is closed to new replies.