[go: up one dir, main page]

Skip to content
Weston Ruter edited this page Sep 25, 2023 · 11 revisions

Frequently Asked Questions

Where are the plugin settings?

The plugin re-uses core settings. It uses your site icon as the icon in the web app manifest, and it uses your site title as the name. If you have a site title that is longer than 12 characters, a short name field is shown on the General Settings screen.

You can enable offline browsing in the Reading Settings screen of the WordPress admin.

The plugin also adds Site Health tests.

What is the plugin for?

The PWA plugin is primarily a set of APIs which are being iterated on to propose for integration into WordPress core. Themes and plugins can then integrate with the APIs to tailor the PWA experience for a given site.

We’re still looking at what makes sense to include in a default set of functionality, but one such extension plugin you should check out is this “Basic Site Caching” extension for the PWA plugin. It enables a network-first caching strategy for your site and ensures that the assets and uploaded files will be available offline as well. (Update: See pwa-wp#265 for the proposal to make this part of the plugin by default.) This has now been implemented. Read more about offline browsing.

Why am I getting a Lighthouse PWA audit warning about a missing short_name?

Note: This is largely obsolete since you can now specify the short name from the General Settings screen when the site title is longer than 12 characters.

The short_name will reuse your site title if it is 12 characters or less 12 characters or less. If your site title is longer than this, then it will omit the short_name and Lighthouse will warn about it being empty. While the plugin may add a UI to supply a short name, in the mean time this can be supplied via some PHP filter code that you put in a custom plugin or your custom theme's functions.php:

add_filter( 'web_app_manifest', function( $manifest ) {
    $manifest['short_name'] = 'Shortness';
    return $manifest;
} );

How can I have my PWA install like a standalone app?

By default a site PWA is installed with the minimal-ui for the display property. You can change it to be standalone for a more native feel via:

add_filter( 'web_app_manifest', function( $manifest ) {
    $manifest['display'] = 'standalone';
    return $manifest;
} );

See also #970 in which this setting is proposed to be exposed in the admin.

Are there downsides to offline reading?

Offline reading is about client-side caching. Offline reading mode will enable a “network-first caching strategy” for page visits. This means that when you click on a link, it will first try to get the latest version from the network. If this fails (or it takes longer than the default 2-second timeout), it will use the cached version if available. There is a filter to customize the timeout. So there's not really any downside. The only potential problem is that stale content may be served to users on slow connections, but that is probably what they would want.

Is there an install button I can add to the page?

The plugin relies on the browser to prompt the user to install the PWA. It is possible to add an install button on the page, but the plugin doesn't implement that. See How to provide your own in-app install experience.