forked from samsk/include-url
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathreadme.txt
More file actions
91 lines (58 loc) · 2.71 KB
/
readme.txt
File metadata and controls
91 lines (58 loc) · 2.71 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
=== Include URL ===
Tags: include, url
Requires at least: 4.0
Tested up to: 5.4.0
Stable tag: 0.3.5
Contributors: SamSK
Donate link: https://devel.dob.sk/include-url
License: GPLv3 or later
Include URL allows to include any URL in posts or pages.
== Description ==
= Features =
Include URL is a Wordpress plugin for seamless inclusion of data from remote urls, optionally passing GET parameters to it..
* Get remote url content
* Pass given GET params to url
* Cache fetched content locally in Wordpress DB (for extremely slow sources)
= Usage =
`[include-url href="<URL>" params="param1,param2,param3..." timeout="seconds" cache="seconds" allow-file="1" allow-shortcode="1"]`
* *href* - url starting with http:// or https:// (required)
* *params* - list of comma separated GET parameters, that should be passed to include url
* *timeout* - request timeout in seconds
* *cache* - cache request data locally in wordpress database (default = 0 seconds / disabled)
* *allow-file* - allow file:// urls in *href* (default = 0 / disabled, 1 = prepend file with document root, 2 = use absolute path)
* *allow-other* - allow any other protocol supported by cURL
* *allow-shortcode* - allow and process wordpress shortcodes in included content
= Examples =
* Search frontend page for [SOLR](https://lucene.apache.org/solr/)
`
[include-url href="http://localhost:8080/solr/core1/select?wt=xslt&wt=results.xslt" params="q,fq" cache="1800"]
`
This requests data from local SOLR instance, that will return search results formatted as HTML (ie. table) via its XSLT handler, optionally passing q (query) and fq (filter) params to it. Data will be cached for 1800 seconds in Wordpress database.
* Read file from document_root
`
[include-url href="file://robots.txt" allow-file="1"]
`
* Read file specified by absolute path
`
[include-url href="file:///var/www/html/robots.txt" allow-file="2"]
`
== Installation ==
1. Make sure you are using WordPress 4.0 or later and that your server is running PHP 5.2.4 or later (same requirement as WordPress itself)
1. Install and activate the plugin as usual from the 'Plugins' menu in WordPress.
1. Use shortcode in page or post
== Changelog ==
= 0.3.5 (2020-07-28) =
* Fix some undefined warnings and add timeout to file_get_contents() call (Thanks Marco Baumgartl for reporting it)
= 0.3.4 (2019-05-22) =
* Improve shortcode attributes processing
= 0.3.2 (2018-05-17) =
* Add allow-shortcode option
= 0.3.1 (2017-04-03) =
* Fix cached content processing
= 0.3.0 (2016-12-15) =
* Allow file:// urls if allow-file="1" or allow-file="2" param is given
* Allow all cURL protocols if allow-other="1" param is given
= 0.2.1 (2016-08-26) =
* Restrict urls to http:// and https://
= 0.2.0 (2016-08-25) =
* Initial release