Support » Plugin: Super Progressive Web Apps » Can you make

  • Can you please mass replace write directory to root with some filterable variable? So for example on roots.io bedrock when wordpress core is in wp subdirectory, so I could specify instead of ABSPATH a different directory, because ABSPATH is within webroot/wp, while I need it to be in plugins case at webroot

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author Arun Basil Lal

    (@arunbasillal)

    Hello @juslintek

    Good to hear from you again.

    We have seen this and similar issues in a variety of configs where there is either a write permission problem, sub-directory install and custom structures like bedrock.

    I will try to see if a dynamic service worker and manifest instead of a static one can work and that should solve these problems quite easily.

    I will experiment with these possibilities soon. If these do not pan out, at least a filter can be added, yes.

    Hope that makes sense.

    Okay, so for time being I will create a fork. P.S. write permissions are server side, unless home_user(on which php-fpm is running)/nginx/apache user has permission to change permissions on dirs and files, you can’t do anything else without any hacks, like scandiring for writable directory and saving files there while changing paths accordingly and creating urls from those paths and saving them to db.

    • This reply was modified 1 year, 5 months ago by  juslintek.
    • This reply was modified 1 year, 5 months ago by  juslintek.

    +1

    I need it too

    I did pull request to changes.
    You can use mine in your custom git package on composer:
    https://github.com/juslintek/Super-Progressive-Web-Apps

    After that in your functions php, just add this one:

    
    /**
     * Super Progressive Web App filename overrides
     */
    add_filter('superpwa_manifest_filename', 'superpwa_filename_change', 10, 2);
    add_filter('superpwa_sw_filename', 'superpwa_filename_change', 10, 2);
    
    /**
     * @param string $filename
     * @param string $arg (filename, abs, src)
     */
    function superpwa_filename_change($filename, $arg) {
        if (in_array($arg, [
            'abs',
            'src'
        ])) {
            return '../' . $filename;
        }
        return $filename;
    }
Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Can you make’ is closed to new replies.