Skip to content

Commit

Permalink
Cases explained for developers: when to use which content source.
Browse files Browse the repository at this point in the history
  • Loading branch information
Bimal Poudel committed Apr 18, 2016
1 parent b0ad90f commit 29895fc
Show file tree
Hide file tree
Showing 7 changed files with 32 additions and 15 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<?php
/**
* Implementation left for developers
* Cases: You may implement it yourself with your own logic
*/
class processor_database extends hosted_content_interface
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,11 @@
<?php
/**
* Reads a local file on the system.
* Cases: a file may be:
* - Edited over FTP
* - Replaced via Dropbox
* - symlinked from another user
*/
class processor_file extends hosted_content_interface
{
/**
Expand All @@ -12,7 +19,7 @@ class processor_file extends hosted_content_interface
public function fetch($file_name = '/tmp/readme.txt', $section_id = 0)
{
/**
* Do NOT use include/require for safety reasons
* Do NOT use include/require methods for safety reasons; serve the file as is.
*/

$content = '';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,10 @@
<?php
/**
* Reads and parses a remote .md markdown file.
*
* Cases: A file may be edited externally on:
* - GitHub like servers
*/
class processor_markdown extends hosted_content_interface
{
/**
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
<?php
/**
* Implementation left for developers
* A dummy processor - that does nothing.
* A dummy processor - that does nothing at all.
* Cases: Fail-over on reading processors from source="" parameter.
*/
class processor_none extends hosted_content_interface
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<?php
/**
* Implementation left for developers
* Cases: API based content pulling where server may require login/access.
*/
class processor_url extends hosted_content_interface
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<?php
/**
* Implementation left for developers
* Cases: To draw one small section of a huge article on Wikipedia like servers.
*/
class processor_wikipedia extends hosted_content_interface
{
Expand Down
26 changes: 13 additions & 13 deletions hosted-content-importer/readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,17 @@ Donate link: http://bimal.org.np/
Tags: content, embed, external, hci, hosted, markdown, remote, third
Requires at least: 4.5
Tested up to: 4.5
Stable tag: 4.5
Stable tag: 1.0.0
License: GPLv3 or later
License URI: http://www.gnu.org/licenses/gpl-3.0.html

Dynamically embeds a remotely hosted content.

Embeds a remotely hosted content. Maintainers can edit a portion of your blog externally, without having any access to your website.


== Description ==

Brings third party hosted contents within WordPress blog texts. Logically, it empowers you to allow other users externally edit a particular section of your blogs, without giving them any access to WordPress system.
Brings third party hosted contents within WordPress blog texts. It logically empowers you to allow other users to externally edit a particular section of your blogs, without giving them any access to your WordPress system.

After installation, it allows you to use shortcode tag [third] with few parameters.

Expand All @@ -23,17 +24,17 @@ Example:
`[third source="markdown" id="https://goo.gl/UpclKH" section=""]`

It will then embed remote markdown content inside your blog.
Additionally, it will convert to HTML using <a href="https://github.com/erusev/parsedown">Parsedown</a>.
Additionally, it will convert the text into HTML using <a href="https://github.com/erusev/parsedown">Parsedown</a>.

= Parameters explained =

**source**: Where to seek the data (eg. Content Hosting Server). Examples:

- markdown: implemented
- file: implemented
- database (implemented left for developers); [Join development](https://goo.gl/89KgSC)
- wikipedia (work in progress); [Join development](https://goo.gl/89KgSC)
- url/api (work in progress); [Join development](https://goo.gl/89KgSC)
- database (implemented, and left for developers) - [Join development](https://goo.gl/89KgSC)
- wikipedia (work in progress) - [Join development](https://goo.gl/89KgSC)
- url/api (work in progress) - [Join development](https://goo.gl/89KgSC)

**id**: Content ID (unique identifier) of the data you want. Often, full URL as well.

Expand All @@ -54,7 +55,7 @@ Additionally, it will convert to HTML using <a href="https://github.com/erusev/p

`[third source="database" id="0" section="recent"]`

Some implementations are left for developers. This plugin should act as proof of concept. Please feel free to modify it.
Some implementations are left for developers because of the nature. This plugin should act as proof of concept in such cases. Please feel free to modify it.


== Installation ==
Expand Down Expand Up @@ -105,11 +106,10 @@ Yes, but not necessarily. The usage is very tricky. You can remotely host your .

Please view the original development at: https://goo.gl/89KgSC for details, further plans and todos.

= 1.0 =
* Mentioned logical concepts of allowing other users edit portion of your blog externally, without giving them any access to your WordPress system.
* Splitted the fetcher files into individual class files.
* cURL follow redirects - now can use shortened URLs.
* Added usage examples (markdown, file, database) in readme.md.

= 1.0.0 =
* Cases explained for developers: when to use which content source.
* Initial release.


== Upgrade Notice ==
Expand Down

0 comments on commit 29895fc

Please sign in to comment.