It imports third party hosted contents within WordPress blog. You can define from which url/resource to fetch the content. The original source may be editable by anyone else whom you trust. Thus, it logically empowers you to allow other users to externally edit a particular section of your blogs. And, you do not have to give them any access credentials of your website.
After installation, use shortcode tag
[third] with few parameters as:
[third source="markdown" id="https://goo.gl/UpclKH" section=""]
sourceis a content processor type.
idis a URL or ID given by the third parties.
sectionis an optional parameter to access deeper content.
cacheis a boolean directive whether to reuse the cached content.
It will then embed remote markdown content inside your blog.
Additionally, it will convert the text into HTML using Parsedown.
source: Where to seek the data (eg. Content Hosting Server). Examples:
- analytics: ✔ implemented (Google Analytics)
- file: ✔ implemented (Read from local file)
- gist: ✔ implemented (Embed Gist Snippets)
- jotform: ✔ implemented (Embed Web Forms)
- markdown: ✔ implemented (Parse remote markdown files)
- qr: ✔ implemented
- For Custom Data,
- For current page’s URL
- youtube: ✔ implemented (Embeds a YouTube Video)
- database: Partially implemented, and left for developers
- url, api: Work in progress
- wikipedia: Work in progress, Strategy: Content JSON to Data Section
The list is not limited, you expand it. Join/Fork Development
id: Content ID (unique identifier) of the data you want. Often:
- Full URLs
- Database IDs
- Resource IDs provided by Service Providers eg. YouTube Video ID, JotForm Form ID, …
- Full Path of a Local File
section: Additional parameter to identify the specific section of the content.
Example: Parsing a remote .md file
[third source="markdown" id="https://goo.gl/UpclKH" section=""]
Learn to write your .md file.
Example: Embedding a gist code from GitHub
[third source="gist" id="000000000000" section="filename.php"]
Create your gists at GitHub.
Example: Embedding a JotForm
[third source="jotform" id="000000000000" section=""]
Create your own web form at JotForm website.
Example: Reading a server’s local file
[third source="file" id="/tmp/readme.txt" section=""]
Example: Accessing database – Expand it yourself
[third source="database" id="0" section="recent"]
Detailed implementations are left for the developers because of the nature. It is a proof of concept work. Please feel free to modify/expand it.
Example: Custom QR Code
[third source="qr" id="YOUR DATA" section=""]
Example: QR Code for Current Page (Full URL)
[third source="qr" id="url" section="internal"]
The above example is a full code. If you embed it anywhere, it lets your users copy that page’s URL into their mobile.
Example: Embedding a YouTube Video
[third source="youtube" id="v00000000000" section=""]
Choose your video from YouTube.
Personalized Content Processors
You may often consider writing your own Content Processor.
Refer to Custom Content Processor section in
[Other Notes] tab.
Custom Content Processors
If you want to develop your own Content Processor, it is much easier now.
Just create a tiny class file inside classes/processors as like one of the existing one. Simple examples are YouTube, JotForm and Gist processors.
- File name:
public function fetch($form_id = null, $section = null).
- Process your content.
- Return HTML string.
- For references, see
- Use as:
[third source="YOURNAME" section=""]
Click for real examples.
Just that much easy drop-in replacement.
Used from unsplash.com
- Cable Cars and Rope: Represents contents coming from various sources.
- Go to your WP Admin > Plugins > Add New page.
- Search for “Hosted Content Importer”.
- Click install. Click activate.
- Download this plugin as a .zip file.
- Go to WP Admin > Plugins > Add new > Upload Plugin.
- Upload the .zip file and activate the plugin.
- Download the file hosted-content-importer.zip.
- Unzip the file on your computer.
- Upload folder hosted-content-importer (you just unzipped) to /wp-content/plugins/ directory.
- Activate the plugin through the WP Admin > Plugins menu.
Click on how to install a WordPress Plugin for more details.
How can I use it?
Within your blog post or page, write a insert the similar snippet below:
[third source="markdown" id="FULLURL/README.md" section=""]
Your URL (ID) should be a full URL to your .md file on the remote server.
There are several other ways to include remote contents. Each unique content is processed by its own processor. View Source Codes for each processors.
How does it work?
The plugin brings your contents using the defined Source’s ID and Section. The parameters (source, id, section) are a stable list of names proposed to long term support the future development. When we add new Content Processes, they are less likely to change.
Does it work for everyone?
Yes, but not necessarily. The usage is very tricky. You can remotely host your .md files and embed them in your blogs. In some cases, you may consider editing this plugin and adding your own methods.
What happens if the third party content source is down?
We never thought of that downtime. In new release, a cache is enabled.
Are all the content sources processors implemented fully?
By the nature of the product, no. However, You can consider
source="file"as a completed codes. Any other implementation may require you to modify your plugin to suit it for yourself.
Is it safe to embed third party contents?
If you are maintainer of a portion of the content of any other websites, act responsibly; do NOT commit any unsafe contents. When you edit some file that you have access to, it may affect someone else’s website that you are authorised to manage contents.
Be good, do good. Always import contents only from the sources that you trust.
Also, you can create and host your own Micro Content Services. See an Example.
How to safeguard my remote contents?
The answer is beyond the scope of this plugin. But, always consume content from trusted sources only. Security depends on how you use remote contents. If the remote content is distorted, it may reflect back in your website. Do not allow weak security on your remotely edited contents. Files uploaded via Dropbox, GitHub, FTP/SSH, SVN/GIT may be considered safe as they require password to upload the contents.
Συνεισφέροντες & Προγραμματιστές
“Hosted Content Importer (HCI)” είναι λογισμικό ανοιχτού κώδικα. Οι παρακάτω έχουν συνεισφέρει στη δημιουργία του.Συντελεστές
Ενδιαφέρεστε για την ανάπτυξη;
Please view the original development at: https://goo.gl/89KgSC for details and further plans.
- Parsedown upgraded.
- Typos corrections.
- TinyMCE Plugin and text mode editor plugins added.
- As-Is request for not wrapping the HTML Output within HCI divs.
- Experimental: Dumped handlers or registered shortcodes.
- Screenshots added.
- Formatting and Documentation improved.
- Banners used.
- QR Code Added.
- Google Analytics snippet added.
- Build script created.
- Admin report page with content processors available.
- YouTube added.
- View reports on cached files and delete them.
- JotForm added.
- SPL Auto-Loading the content processors.
- Embedding gists: a new gist processor introduced.
- Product name has HCI word in it.
- WP Admin > Posts > With
[third]Tags: Reports on which posts/pages used this shortcode.
- Implemented caches to store once-fetched contents locally.
- Forced not to cache in cURL.
- Use cases explained for developers: when to use which content source processor.
- Initial release.