Skip to content

Commit

Permalink
Remove third-party libs. Simplify code. Add comments (#7)
Browse files Browse the repository at this point in the history
* Remove third-party libs. Simplify code. Add comments

* Update tag

* Update `readme.txt`

* Add `Makefile` and `BASH` script to init and release the plugin to WordPress.org SVN

* Rename files

* Update assets file names

* Update `README`

* Update `README`
  • Loading branch information
aknysh committed Feb 1, 2018
1 parent 9847ea4 commit ce65839
Show file tree
Hide file tree
Showing 13 changed files with 381 additions and 2,078 deletions.
9 changes: 9 additions & 0 deletions Makefile
@@ -0,0 +1,9 @@
SHELL = /bin/bash

.PHONY : svn_init
svn_init:
./svn_init.sh

.PHONY : svn_release
svn_release:
./svn_release.sh
25 changes: 22 additions & 3 deletions README.md
@@ -1,6 +1,6 @@
# wp-quip

![WP Quip plugin Settings page](assets/icon-128×128.png)
![WP Quip plugin Settings page](assets/icon-128x128.png)


[Quip](https://quip.com/) integration for WordPress
Expand All @@ -17,13 +17,13 @@ https://codex.wordpress.org/Shortcode_API



## Installation
## Manual Installation

1. Upload `wp-quip` folder to the `/wp-content/plugins/` directory

2. Activate the `WP Quip` plugin through the `Plugins` menu in WordPress

3. On `Quip Settings` page (menu `Settings/WP Quip`), you can update the default value for `Time-to-Live` (see [Usage](#usage) for more details)
3. On `Quip Settings` page (menu `Settings/WP Quip`), update the default value for `Time-to-Live` if needed (see [Usage](#usage) for more details)

4. On `Quip Settings` page, enter and save `Quip API Access Token`

Expand All @@ -37,7 +37,25 @@ https://codex.wordpress.org/Shortcode_API
![WP Quip plugin Settings page](assets/screenshot-1.png)


#
## Installation from wordpress.org plugin repository

https://wordpress.org/plugins/wp-quip/

1. In WordPress Admin, search for `WP Quip` plugin and install it

2. Activate the `WP Quip` plugin

3. On `Quip Settings` page (menu `Settings/WP Quip`), update the default value for `Time-to-Live` if needed (see [Usage](#usage) for more details)

4. On `Quip Settings` page, enter and save `Quip API Access Token`


#
![WP Quip plugin Settings page](images/WordPress_WP_Quip.png)


#
## Usage

To embed the content of a [Quip](https://quip.com/) document into a WordPress page or blog post, use the `quip` shortcode.
Expand Down Expand Up @@ -85,6 +103,7 @@ and then set `ttl` back to its original value.
![Quip document embedded into a WordPress blog post](assets/screenshot-4.png)


#
## References

For more information on Quip API, visit https://quip.com/dev/automation/documentation
Expand Down
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
125 changes: 0 additions & 125 deletions functions.php

This file was deleted.

Binary file added images/WordPress_WP_Quip.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
51 changes: 25 additions & 26 deletions readme.txt
@@ -1,66 +1,63 @@
=== WP Quip ===
Contributors:
Contributors: cloudposse
Tags: quip, doc
Donate link:
Requires at least: 4.0
Requires at least: 4.2
Tested up to: 4.9.2
Requires PHP: 5.6
Stable tag: 1.0
Stable tag: 1.0.0
License: GPLv2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html

Quip integration for WordPress.
`WP Quip` plugin uses WordPress shortcodes to embed Quip documents into WordPress pages and blog posts.
Quip integration for WordPress


== Description ==

## Introduction

`WP Quip` plugin uses WordPress shortcodes to embed [Quip](https://quip.com/) documents into WordPress pages and blog posts.
WP Quip plugin uses WordPress shortcodes to embed Quip documents into WordPress pages and blog posts.

https://codex.wordpress.org/Shortcode

https://codex.wordpress.org/Shortcode_API


## Usage

To embed the content of a [Quip](https://quip.com/) document into a WordPress page or blog post, use the `quip` shortcode.
To embed the content of a Quip document into a WordPress page or blog post, use the 'quip' shortcode.

`quip` shortcode accepts two attributes and has the following format:
'quip' shortcode accepts two attributes and has the following format:

```
[quip id="mWnnAszre3MW" ttl=7200]
```


where

* `id` (Required) - The ID of the Quip document (_e.g._ https://quip.com/mWnnAszre3MW)
* 'id' (Required) - The ID of the Quip document (e.g. https://quip.com/mWnnAszre3MW)

* `ttl` (Optional) - Time-To-Live in seconds.
* 'ttl' (Optional) - Time-To-Live in seconds.
After the first request to the Quip API, the plugin caches the content of the document (HTML and images) for the specified amount of time (seconds).
All consecutive requests to the same page or blog post will not call the Quip API again but will retrieve the document from the internal cache, making the pages faster.
After the `ttl` expires, the plugin will call the Quip API and cache the result again.
If the `ttl` attribute is not provided, the default value of 7200 seconds (2 hours) is used.
You can change the default value in `Quip Settings` (menu `Settings/WP Quip`).
If `ttl` is set to `0`, the plugin will not cache the responses, and every request to the WordPress page or blog post will call the Quip API.
After the 'ttl' expires, the plugin will call the Quip API and cache the result again.
If the 'ttl' attribute is not provided, the default value of 7200 seconds (2 hours) is used.
You can change the default value in 'Quip Settings' (menu 'Settings/WP Quip').
If 'ttl' is set to '0', the plugin will not cache the responses, and every request to the WordPress page or blog post will call the Quip API.

__NOTE__: Setting `ttl` to `0` also invalidates the document cache.
__NOTE__: Setting 'ttl' to '0' also invalidates the document cache.
This could be used if you change the Quip document and want the changes to be reflected on the website immediately.
In this case, update the document in Quip, set `ttl` to `0` in the `quip` shortcode,
In this case, update the document in Quip, set 'ttl' to '0' in the 'quip' shortcode,
refresh the WordPress page or blog post in the browser to invalidate the cache,
and then set `ttl` back to its original value.
and then set 'ttl' back to its original value.


== Installation ==
1. Upload `wp-quip` folder to the `/wp-content/plugins/` directory
1. Install the 'WP Quip' plugin

2. Activate the `WP Quip` plugin through the `Plugins` menu in WordPress
2. Activate the plugin through the 'Plugins' menu in WordPress

3. On `Quip Settings` page (menu `Settings/WP Quip`), you can update the default value for `Time-to-Live`
3. On 'Quip Settings' page (menu 'Settings/WP Quip'), update the default value for 'Time-to-Live' if needed

4. On `Quip Settings` page, enter and save `Quip API Access Token`
4. On 'Quip Settings' page, enter and save 'Quip API Access Token'

NOTE: To generate a Quip API Access Token, visit this page: https://quip.com/dev/token .
Whenever you generate a new token, all previous tokens are automatically invalidated.
Expand All @@ -77,8 +74,10 @@ Whenever you generate a new token, all previous tokens are automatically invalid


== Changelog ==
= 1.0 =
* Initial release.
= 1.0.0 =
* Initial release


== Upgrade Notice ==
= 1.0.0 =
Initial release

0 comments on commit ce65839

Please sign in to comment.