SuperPWA / super-progressive-web-apps

SuperPWA helps to convert your WordPress website into Progressive Web Apps instantly. PWA (Progressive Web Apps) demo at : https://superpwa.com and Plugin :
https://wordpress.org/plugins/super-progressive-web-apps/
GNU General Public License v2.0
382 stars 82 forks source link

Prompted to add to the home screen on Firefox, but not on chrome #19

Closed raveesh-me closed 1 week ago

raveesh-me commented 6 years ago

Hi! Use case: WordPress Multisite Running on shared hosting on https://yogaandnaturopathy.in

My lighthouse audits are like this: pwa report

This medium article seems related: https://medium.com/progressive-web-apps/im-trying-to-make-a-progressive-web-app-part-5-100-pwa-e27799afd095 As a result, I am prompted to add to the home screen on Firefox, but not on chrome. Do you think this can be resolved?

I would love to contribute eventually, but I am still learning web development ATM. Amazing project BTW.

josevarghese commented 6 years ago

Hello @raveesh-me

Thanks for using our plugin Super Progressive Web Apps. I just checked your website https://yogaandnaturopathy.in and here's my findings why PWA is not supporting upon your website.

The issue is mainly caused because you have installed the WordPress within a folder called "wordpress" in your server and you're redirecting all URLs (may be using a plugin) to without "wordpress".

See: https://yogaandnaturopathy.in/wordpress/wp-content/themes/astra/assets/css/minified/style.min.css?ver=1.2.7.2 the URL states files are installed within a folder called wordpress

PWA only works from the folder which you have installed WordPress, as for your case the folder name is "wordpress". That's the issue why PWA is not working within your website.

The best option that I can suggest is to move the files to the root folder and update database accordingly. Don't forget to take the backup of files and database before doing this.

Hope you have got it. Looking forward to hearing from you soon.

Thanks, Jose SuperPWA

raveesh-me commented 6 years ago

you're redirecting all URLs (may be using a plugin)

I am using .htaccess redirect rule that WordPress generated for me during the multisite installation process.

PWA only works from the folder which you have installed WordPress, as for your case the folder name is "wordpress". That's the issue why PWA is not working within your website.

Please elaborate

The best option that I can suggest is to move the files to the root folder and update database accordingly. Don't forget to take the backup of files and database before doing this.

But I do not want to do that. It is fairly common to run WordPress from a separate folder. Also, I have a multi-domain setup where multiple domains are being redirected to the same WordPress multisite folder. I guess the worst case scenario for plugin developers.

Please let me know if there is a way with which I could add support for my use case for your plugin. I will be really thankful for your guidance.

josevarghese commented 6 years ago

Hello,

Within your website https://yogaandnaturopathy.in our plugin checks the site address for creation of settings of SW and Manifest and it retrieves https://yogaandnaturopathy.in/wordpress/ as your site sddress (See General Settings within your WP dashboard page).

It's because the files are at "wordpress" named folder.

Our plugin checks wpurl for the generation of settings , so it cannot retrieve any URLs if you manually added any .htaccess redirect rules. To overcome this you can change the files to root (ie; https://yogaandnaturopathy.in) and change the DB accordingly and save settings of our plugin again. It will surely help you!

Thanks, Jose

raveesh-me commented 6 years ago

I don't want to run WordPress from the root directory. Can this problem be solved? Can your plugin provide support for this feature? What changes will we need to make for the same?

arunbasillal commented 6 years ago

Hello @raveesh-me

By design service workers have access to only the files and sub-directories of the directory that it lies in. So if the service worker is in the /wordpress/ directory, it can only work on the example.com/wordpress directory and below that. This is what happens by default.

I have recently come across a way to make this work for folder installs like yours, I need to test it out before I can confirm if it can be done or not. I will update you on the progress here.

As you said, folder installs are not that rare, so its worth checking into.

raveesh-me commented 6 years ago

Please let me know the same. You could add another option where we could give the directory name for our wordpress directory and you could add that folder to the reference.

milenpav commented 6 years ago

Hi thnaks for SuperPWA works great but my site also is instaled in a folder because i use hosting for more then one site. Do you heve some progress about this issue?

arunbasillal commented 6 years ago

Hello @fred4o, thanks for the feedback, glad to hear that!

We are looking into dynamic manifest and service worker files as suggested and discussed in #38. If that goes through, then this will easily be resolved.

Sanjeevsetu commented 1 week ago

Closing the ticket due to inactivity. Still have an issue, Please create a new ticket or contact us.