Support » Plugin: Progressive WordPress (PWA) » WordPress Subfolder Install – PWA Manifest Site icon error and add button

  • Hi,
    I have one site which has wordpress in the root. In that if I activate PWA then the Add to Home button shows up correctly. But in another where I have the site under a sub folder
    for example like this : pwasitedemo{.url}/subfolder/ it does not show the Add to Home button.
    Also I find errors in the pwp-manifest json as the Site Icon URL is also wrong.

    When a site is under a sub folder the home page url would be like this

    pwasitedemo{.url}

    but the wp-content would be under a sub folder.

    Right now it shows the folder link like
    pwasitedemo{.url}/wp-content/uploads/{theicon.png}

    while the URL should actually be
    pwasitedemo{.url}/subfolder/wp-content/uploads/{theicon.png}

    Also any reason why the Add to Homepage would not work when wordpress is installed under a subfolder?

    Any fixes to this?

Viewing 9 replies - 1 through 9 (of 9 total)
  • Hi @nico_martin. Any help?

    Plugin Author Nico Martin

    (@nico_martin)

    Hi @cmsnext

    What’s the homeurl of your site (as declared under Settings -> General)? Is it pwasitedemo{.url}/subfolder/ or pwasitedemo{.url}/?

    Kind regards,
    Nico

    cmsnext

    (@cmsnext)

    Hi @nico_martin

    WordPress Address (URL) pwasitedemo{.url}/subfolder/
    Site Address (URL) pwasitedemo{.url}/

    Plugin Author Nico Martin

    (@nico_martin)

    Is there a reason why your site address is not the same as your home address? Could you update the siteadress to pwasitedemo{.url}/subfolder/ as well?

    cmsnext

    (@cmsnext)

    Hi @nico_martin. Yes WordPress allows subfolder installation so that wordpress url and main site url are different. Kindly check this – https://wordpress.org/support/article/giving-wordpress-its-own-directory/#moving-process

    In a way we have URL as pwasitedemo{.url} but wordpress is actually inside the subfolder pwasitedemo{.url}/subfolder/

    cmsnext

    (@cmsnext)

    Hi @nico_martin – any update on this? Because your plugin is the most easiest to use to waiting for a fix. Because even Add to Home does not work I think mostly due to this error. Thanks

    Hi @nico_martin as there was no response from you I did some code digging and find this

    in Classes/class-manifest.php

    line 124

    $manifest['icons'][] = [
    'src'   => $new_image[0],
    

    Changing this to

    $manifest['icons'][] = [
    					'src'   => get_site_icon_url($size),

    This fixes the issue

    Now even add to home page shows up successfully.

    I am not sure if the code I used is correct but that seems to fix the issue.

    So can you confirm if its right?

    Had an issue with the whole document root (/home/user/domains/domain.com/public_html) was included in the manifest json file.

    The above fix from @cmsnext fixed the issue.

    lauregch

    (@lauregch)

    Hi @nico_martin, any update on this ? I’m having the same issue, and using @cmsnext ‘s (great) fix, as we use Composer to version and deploy our plugins, is not a good solution for us as it would be lost at each update.
    Moreover there is no easy way to get around this flaw with hooks, unfortunately, so we are kind of stuck here.

    This plugin is amazing, and supporting a subfolder installation (which is not exactly an exotic setup) would make it perfect !

    Thank you.

Viewing 9 replies - 1 through 9 (of 9 total)
  • You must be logged in to reply to this topic.