Giter Site home page Giter Site logo

rtcamp / pwa-extension Goto Github PK

View Code? Open in Web Editor NEW
3.0 16.0 2.0 155 KB

Enables PWA features such as add to homescreen, offline reading features.

PHP 83.92% JavaScript 6.69% Shell 9.39%
research-development wp-plugin pwa pwa-extension offline addtohomescreen offline-analytics offline-form-submissions

pwa-extension's Introduction

The latest PWA plugin 0.6.0 now has offline caching for theme assets, uploaded images, navigations and manifest for app icon as well, so this extension is no longer needed.

PWA Extension

Project Status: Active โ€“ The project has reached a stable, usable state and is being actively developed.

An extension to PWA to enable/activate add to homescreen and offline reading features of PWA.

Author: rtCamp

Tags: pwa Requires at least: 4.9 Tested up to: 5.7.1 License: GPLv2 or later Requires PHP: 5.4+

Requirements

  • The Official PWA Plugin.
  • Generate the PWA Icons and put the icons in theme's /assets/img/ directory. You can use this site to generate icons. (Example path for 512x512 size will be /assets/img/icon-512x512.png)

Features

  • Add to Home Screen popup for mobiles with custom icon setup in WP theme (your-theme/assets/img/icon-{width}x{height}.png).
  • Offline reading by caching assets and pages.

Offline Form Submission.

  • Submit gravity form even if you are offline. The plugin will send form response once you get back online.
  • The offline form submission will only work for the routes added to the plugin settings page.
  • If no routes are set the offline form submission script will not be enqueued. e.g Enable offline form submission with following settings for the forms available on routes example.com/contact and example.com/feedback
/contact
/feedback

Steps to setup add to home screen for your site.

  • Add app icon images of all sizes in your WordPress theme assets folder with /assets/img/icon-{width}x{height}.png path
  • The valid size of the images can be 72x72, 96x96, 128x128, 144x144, 152x152, 192x192, 384x384, 512x512.
  • Example image file name icon-192x192.png.
  • The path of the icons can be changed with rt_pwa_extensions_app_icon_{height}_{width} filter
  • Example snippet to change icon src.
add_filter( 'rt_pwa_extensions_app_icon_72_72', 'update_icon_src' );
/**
 * Updates icon src.
 *
 * @return string
 */
function update_icon_src() {
	return 'www.example.com/new-image.png';
}

Integration with izooto plugin.

  • The iZooto plugin must be installed and activated to use the izooto notification services.
  • Registers izooto service worker using wp_front_service_worker hook to main service worker file
  • Removes Service worker code of izooto from ?izooto=sw to prevent conflicting it with main service worker.

Contributors

Contribute

Reporting a bug ๐Ÿž

Before creating a new issue, do browse through the existing issues for resolution or upcoming fixes.

If you still need to log an issue, making sure to include as much detail as you can, including clear steps to reproduce your issue if possible.

Creating a pull request

Want to contribute a new feature? Start a conversation by logging an issue.

Once you're ready to send a pull request, please run through the following checklist:

  1. Browse through the existing issues for anything related to what you want to work on. If you don't find any related issues, open a new one.

  2. Fork this repository.

  3. Create a branch from develop for each issue you'd like to address and commit your changes.

  4. Push the code changes from your local clone to your fork.

  5. Open a pull request and that's it! We'll with feedback as soon as possible (Isn't collaboration a great thing? ๐Ÿ˜Œ)

  6. Once your pull request has passed final code review and tests, it will be merged into develop and be in the pipeline for the next release. Props to you! ๐ŸŽ‰

Change Log

v1.0.3 (14-07-2020)

  • Add support for gravity form offline submission.
  • Add rt_pwa_extensions_app_icon_{height}_{width} filter to change app icon path.

v1.0.2 (24-12-2019)

  • Restructure plugin.

v1.0.1 (24-12-2019)

  • izooto push notifications plugin integration.

v1.0.0 (12-09-2019)

  • Add to Home Screen popup for mobiles with custom icon setup in WP theme (<your-theme>/assets/img/icon-{width}x{height}.png'.
  • Offline reading by caching assets and pages.

Unit testing

  • Setup local unit test environment by running script from terminal

./bin/install-wp-tests.sh <db-name> <db-user> <db-pass> [db-host] [wp-version] [skip-database-creation]

  • Execute phpunit in terminal from repository to run all test cases.

  • Execute phpunit ./tests/inc/test-class.php in terminal with file path to run specific tests.

Does this interest you?

Join us at rtCamp, we specialize in providing high performance enterprise WordPress solutions

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.