PWA

Deskripsi

Progressive Web Apps are user experiences that have the reach of the web, and are:

  • Reliable – Load instantly and never show the downasaur, even in uncertain network conditions.
  • Fast – Respond quickly to user interactions with silky smooth animations and no janky scrolling.
  • Engaging – Feel like a natural app on the device, with an immersive user experience.

This new level of quality allows Progressive Web Apps to earn a place on the user’s home screen.

Continue reading more about Progressive Web Apps (PWA) from Google.

In general a PWA depends on the following technologies to be available:

This plugin serves as a place to implement support for these in WordPress with the intention of being proposed for core merge, piece by piece.

This feature plugin is not intended to obsolete the other plugins and themes which turn WordPress sites into PWAs. Rather, this plugin is intended to provide the PWA building blocks and coordination mechanism for these themes and plugins to not reinvent the wheel and also to not conflict with each other. For example, a theme that implements the app shell model should be able to extend the core service worker while a plugin that provides push notifications should be able to do the same. Themes and plugins no longer should have to each create a service worker on their own, something which is inherently problematic because only one service worker can be active at a time: only one service worker can win. If you are developing a plugin or theme that includes a service worker, consider relying on this PWA plugin, or at least only use the built-in implementation as a fallback for when the PWA plugin is not available.

In versions prior to 0.6, no caching strategies were added by default. The only service worker behavior was to serve an offline template when the client’s connection is down or the site is down, and also to serve an error page when the server returns with 500 Internal Server Error. As of 0.6, there is a new “Offline browsing” toggle on the Reading Settings screen in the admin. It is disabled by default, but when enabled a network-first caching strategy is registered for navigations so that the offline page won’t be shown when accessing previously-accessed pages. The network-first strategy is also used for assets from themes, plugins, and WordPress core. In addition, uploaded images get served with a stale-while-revalidate strategy. For all the details on these changes, see the pull request.

Documentation for the plugin can be found on the GitHub project Wiki.

Development of this plugin is done on GitHub. Pull requests welcome. Please see issues reported there before going to the plugin forum.

Tanya Jawab

Please see the frequently asked questions on the GitHub project wiki. Don’t see an answer to your question? Please search the support forum to see if someone has asked your question. Otherwise, please open a new support topic.

Ulasan

6 Juli 2020
The plugin helped me to convert my blog in a PWA, only the short_name was an issue and fixed using the small plugin to include an extra field.
30 Mei 2020
I've been baking this into my themes and boilerplate manually for a while now. I'm stoked to see this on it's way to the core of WordPress. Thank you for your contributions!
24 Januari 2020
I believe PWAs are the future of mobile, I am using this plugin as well as the Drupal PWA module on 3 different sites/apps currently. I like how this uses Workbox and wondering when will support for background sync be included. Very useful and customizable plugin as it is.
10 Oktober 2019
Biggest speed improvement is when I added navigation pre-load filter: add_filter( 'wp_service_worker_navigation_caching_strategy', function() { return WP_Service_Worker_Caching_Routes::STRATEGY_STALE_WHILE_REVALIDATE; } ); add_filter( 'wp_service_worker_navigation_caching_strategy_args', function( $args ) { $args['cacheName'] = 'pages'; $args['plugins']['expiration']['maxEntries'] = 50; return $args; } ); Resulting in sub 200ms page load time! I'm also using it to cache images, css, js. Easy to update manifest as well through filter: function get_manifest_update( $manifest ) { /* $manifest = array( 'name' => wp_kses_decode_entities( get_bloginfo( 'name' ) ), 'start_url' => home_url( '/' ), 'display' => 'minimal-ui', 'dir' => is_rtl() ? 'rtl' : 'ltr', ); */ // Add argument to $manifest array $manifest['start_url'] .= 'en/page/support/'; $manifest['short_name'] = 'My App'; $manifest['name'] = 'Full name of app'; return $manifest; } add_filter( 'web_app_manifest', 'get_manifest_update' ); Hopefully this will be added to WP core soon! Thanks for making it easy to implement service workers with hooks as well, great way to introduce Devs to PWA!
Baca semua 11 ulasan

Kontributor & Pengembang

“PWA” adalah perangkat lunak open source. Berikut ini mereka yang sudah berkontribusi pada plugin ini.

Kontributor

“PWA” telah diterjemahkan dalam 5 bahasa. Terima kasih kepada para penerjemah untuk kontribusi-nya.

Terjemahkan “PWA” dalam bahasa Anda.

Tertarik mengembangkan?

Lihat kode, periksa repositori SVN , atau mendaftar ke log pengembangan melalui RSS.

Log Perubahan

For the plugin’s changelog, please see the Releases page on GitHub.