{"id":29437,"date":"2014-05-19T23:12:02","date_gmt":"2014-05-19T23:12:02","guid":{"rendered":"https:\/\/wordpress.org\/plugins-wp\/remote-content-shortcode\/"},"modified":"2019-06-14T18:40:08","modified_gmt":"2019-06-14T18:40:08","slug":"remote-content-shortcode","status":"closed","type":"plugin","link":"https:\/\/da.wordpress.org\/plugins\/remote-content-shortcode\/","author":10308872,"comment_status":"closed","ping_status":"closed","template":"","meta":{"version":"1.5","stable_tag":"1.5","tested":"5.2.24","requires":"2.8","requires_php":"","requires_plugins":"","header_name":"Remote Content Shortcode","header_author":"Justin Silver","header_description":"","assets_banners_color":"","last_updated":"2019-06-14 18:40:08","external_support_url":"","external_repository_url":"","donate_link":"","header_plugin_uri":"http:\/\/www.doublesharp.com","header_author_uri":"http:\/\/doublesharp.com","rating":5,"author_block_rating":0,"active_installs":800,"downloads":10044,"num_ratings":7,"support_threads":0,"support_threads_resolved":0,"author_block_count":0,"sections":["description","installation","faq","changelog"],"tags":[],"upgrade_notice":[],"ratings":{"1":0,"2":0,"3":0,"4":0,"5":"7"},"assets_icons":[],"assets_banners":[],"assets_blueprints":{},"all_blocks":[],"tagged_versions":["1.0","1.1","1.2","1.3","1.3.1","1.3.2","1.3.3","1.4","1.4.1","1.4.2","1.5"],"block_files":[],"assets_screenshots":[],"screenshots":{"1":"Shortcode example to fetch source from a WordPress Plugin Subversion Repository.","2":"Displaying the contents of a PHP file from the WordPress Plugin Subversion Repository using SyntaxHighlighter."}},"plugin_section":[],"plugin_tags":[529,947,87,80,19647],"plugin_category":[43,59],"plugin_contributors":[82089],"plugin_business_model":[],"class_list":["post-29437","plugin","type-plugin","status-closed","hentry","plugin_tags-content","plugin_tags-http","plugin_tags-import","plugin_tags-shortcode","plugin_tags-web-page","plugin_category-customization","plugin_category-utilities-and-tools","plugin_contributors-doublesharp","plugin_committers-doublesharp"],"banners":[],"icons":{"svg":false,"icon":"https:\/\/s.w.org\/plugins\/geopattern-icon\/remote-content-shortcode.svg","icon_2x":false,"generated":true},"screenshots":[],"raw_content":"<!--section=description-->\n<p>Use the <code>[remote_content url=\"http:\/\/www.example.com\"]<\/code> shortcode to import remotely hosted content into your posts or page using <code>cURL<\/code>. Supports HTML <code>GET<\/code> and <code>POST<\/code>, <code>BASIC<\/code> authentication, HTML entity escaping\/encoding, CSS selectors and element removal, regular expression replacements, and caching.<\/p>\n\n<p>This shortcode will let you...<\/p>\n\n<ul>\n<li>Display the contents of a document stored in Subversion or Git repository into a post where it can then be formatted using SyntaxHighlighter.<\/li>\n<li>Quickly integrate content from other CMS systems, for example a company intranet.<\/li>\n<li>Control access to protected data using WordPress' permissions.<\/li>\n<li>Select and remove DOM elements based on CSS selectors (like jQuery).<\/li>\n<li>Find and replace text based on PHP regular expressions.<\/li>\n<li>HTML encode the remote content.<\/li>\n<li>Strip tags from the remote content.<\/li>\n<li>Cache the remote content.<\/li>\n<\/ul>\n\n<h4>Usage<\/h4>\n\n<p><strong>Attributes<\/strong>\n    [remote_content url=\"http:\/\/www.example.com\" method=\"GET\" timeout=\"10\" userpwd=\"username:password\" htmlentities=\"false\" strip_tags=\"false\" decode_atts=\"false\" selector=\"body\" remove=\"img\" find=\"~domain&#046;com~\" replace=\"new-domain.com\" cache=\"true\" cache_ttl=\"3600\"]<\/p>\n\n<ul>\n<li><strong><code>url<\/code><\/strong>\n\n<ul>\n<li>The url that you want to request.<\/li>\n<\/ul><\/li>\n<li><code>method=[<\/code><strong><code>GET<\/code><\/strong><code>| POST ]<\/code>\n\n<ul>\n<li>The HTTP request type, defaults to <strong><code>GET<\/code><\/strong>.<\/li>\n<\/ul><\/li>\n<li><code>params=\"key=value, foo, bar\"<\/code>\n\n<ul>\n<li>The keys listed here will be parsed from the querystring and appended to the <code>url<\/code>. Separate keys by with commas. If the value is not found in the querystring the default value can be specified by placing it after an equals sign: <code>parameter=default<\/code>.<\/li>\n<\/ul><\/li>\n<li><code>timeout=[ 0-9...<\/code><strong><code>10<\/code><\/strong><code>]<\/code>\n\n<ul>\n<li>The request timeout in seconds if it can't be fetched from the cache, defaults to <strong><code>10<\/code> seconds<\/strong>.<\/li>\n<\/ul><\/li>\n<li><code>userpwd=[<\/code>**<code>username:password<\/code> **<code>| post_meta | site_option | constant ]<\/code>\n\n<ul>\n<li>The username and password to send for <code>BASIC<\/code> authentication. It is recommended to not set the username and password directly in the tag, as <strong><em>YOUR PASSWORD WILL BE PUBLICLY VISIBLE ON YOUR WEBSITE IF THIS PLUGIN IS DISABLED<\/em><\/strong>, and instead use one of the other options. By order of priority, if the value matches a post <code>meta_key<\/code> the <code>meta_value<\/code> is used, if it matches a <code>site_option<\/code> the <code>option_value<\/code> is used, and if it matches a constant the constant value is used, otherwise the string data is parsed as is. The format is <code>username:password<\/code>.<\/li>\n<\/ul><\/li>\n<li><code>htmlentities=[<\/code><strong><code>false<\/code><\/strong><code>| true ]<\/code>\n\n<ul>\n<li>If you want to HTML encode the content for display, set to <code>true<\/code>, defaults to <strong><code>false<\/code><\/strong>.<\/li>\n<\/ul><\/li>\n<li><code>strip_tags=[<\/code><strong><code>false<\/code><\/strong><code>| true ]<\/code>\n\n<ul>\n<li>strip all HTML tags from the response, defaults to <strong><code>false<\/code><\/strong>.<\/li>\n<\/ul><\/li>\n<li><code>decode_atts=[<\/code><strong><code>false<\/code><\/strong><code>| true ]<\/code>\n\n<ul>\n<li>The SyntaxHighlighter plugin will HTML encode your shortcode attributes, so <code>attr=\"blah\"<\/code> becomes <code>attr=&amp;quot;blah&amp;quot;<\/code>. This fixes it to the intended value when set to <code>true<\/code>, defaults to <strong><code>false<\/code><\/strong>.<\/li>\n<\/ul><\/li>\n<li><code>selector=[ CSS Selectors... ]<\/code>\n\n<ul>\n<li>The CSS selector or comma separated list or selectors for the content you would like to display, for example <code>div.main-content<\/code> or <code>div.this-class #this-id<\/code>, defaults to the <strong>entire document<\/strong>.<\/li>\n<\/ul><\/li>\n<li><code>remove=[ CSS Selectors... ]<\/code>\n\n<ul>\n<li>The CSS selector or comma separated list or selectors for the content that you would like to remove from the content, for example <code>h2.this-class<\/code> or <code>div#this-id<\/code>, defaults to no <strong>replacement<\/strong>.<\/li>\n<\/ul><\/li>\n<li><code>find=[ regex ]<\/code>\n\n<ul>\n<li>Use a PHP regular expression to find content and replace it based on the <code>replace<\/code> attribute, for example <code>~http:\/\/([^\\.]*?)\\.example\\.com~<\/code>, defaults to <strong>disabled<\/strong>.<\/li>\n<\/ul><\/li>\n<li><code>replace=[ regex ]<\/code>\n\n<ul>\n<li>The replacement text to use with the results of the <code>find<\/code> regular expression, for example <code>https:\/\/\\\\1.new-domain.com<\/code>, defaults to <strong>empty string replacement<\/strong>.<\/li>\n<\/ul><\/li>\n<li><code>cache=[<\/code><strong><code>true<\/code><\/strong><code>| false ]<\/code>\n\n<ul>\n<li>Set to <code>false<\/code> to prevent the contents from being cached in the WP-Cache\/WordPress transients, defaults to <strong><code>true<\/code><\/strong> for performance.<\/li>\n<\/ul><\/li>\n<li><code>cache_ttl=[ 0-9...<\/code><strong><code>3600<\/code><\/strong><code>]<\/code>\n\n<ul>\n<li>Set the number of seconds to cache the results, using 0 for \"as long as possible\", defaults to <strong>3600 seconds<\/strong> (one hour).<\/li>\n<\/ul><\/li>\n<\/ul>\n\n<p><strong>Shortcode Contents + POST<\/strong>\nIf there is any content within the shortcode tags, it is sent as part of the request to the remote server.<\/p>\n\n<pre><code>[remote_content url=\"http:\/\/www.example.com\" method=\"POST\"]\n{ json: { example: some_data } }\n[\/remote_content]\n<\/code><\/pre>\n\n<!--section=installation-->\n<ol>\n<li>Download the plugin and extract to the <code>\/wp-content\/plugins\/<\/code> directory<\/li>\n<li>Activate the plugin through the 'Plugins' menu in WordPress<\/li>\n<li>Use the <code>[remote_content url=\"example.com\"]<\/code> shortcode in your pages, posts, and custom post types.<\/li>\n<\/ol>\n\n<!--section=faq-->\n<dl>\n<dt>I've activated the Remote Content Shortcode plugin, but nothing happens<\/dt>\n<dd><p>Ensure that the following requirements are met.\n* Your server must allow outbound <code>HTTP<\/code> and outbound requests.\n* The remote server must be accessible to the server where your site is hosted.\n* Your authentication credentials must be set correctly to access password protected content.<\/p>\n\n<p>If you have command line access to your server, the <code>curl<\/code> command is a good way to verify that your server can access the content so that it can be displayed via the shortcode.<\/p><\/dd>\n\n<\/dl>\n\n<!--section=changelog-->\n<h4>1.5<\/h4>\n\n<ul>\n<li>PHP7 compatibility.\n\n<ul>\n<li>use <code>explode()<\/code> instead of <code>split()<\/code> for <code>phpquery<\/code>.<\/li>\n<\/ul><\/li>\n<li>Follow redirects with <code>CURLOPT_FOLLOWLOCATION<\/code><\/li>\n<\/ul>\n\n<h4>1.4.2<\/h4>\n\n<ul>\n<li>Add filters for third party modification of values.\n\n<ul>\n<li><code>remote_content_shortcode_url<\/code>, arguments: <code>$url<\/code><\/li>\n<li>Modify the URL before it is fetched<\/li>\n<li><code>remote_content_shortcode_postfields<\/code>, arguments: <code>$tag_content<\/code>, <code>$url<\/code><\/li>\n<li>Modify the tag content before it is POSTed<\/li>\n<li><code>remote_content_shortcode_ssl_verifyhost<\/code>, arguments: <code>false<\/code>, <code>$url<\/code><\/li>\n<li>Verify host SSL certificates<\/li>\n<li><code>remote_content_shortcode_ssl_verifypeer<\/code>, arguments: <code>false<\/code>, <code>$url<\/code><\/li>\n<li>Verify peer SSL certificates<\/li>\n<li><code>remote_content_shortcode_phpQuery<\/code>, arguments: <code>$response<\/code>, <code>$url<\/code>, <code>$selector<\/code>, <code>$remove<\/code><\/li>\n<li>Modify response content before it is sent to <code>phpQuery<\/code><\/li>\n<li><code>remote_content_shortcode_return<\/code>, arguments: <code>$response<\/code>, <code>$url<\/code><\/li>\n<li>Modify response before it is returned<\/li>\n<\/ul><\/li>\n<\/ul>\n\n<h4>1.4<\/h4>\n\n<ul>\n<li>Convert <code>&amp;amp;<\/code> to <code>&amp;<\/code> in URLs to account for Visual\/Text editor encoding.<\/li>\n<\/ul>\n\n<h4>1.3.3<\/h4>\n\n<ul>\n<li>Fix for multiple <code>params<\/code> attributes.<\/li>\n<\/ul>\n\n<h4>1.3.2<\/h4>\n\n<ul>\n<li>Fix for <code>params<\/code> attribute.<\/li>\n<\/ul>\n\n<h4>1.3.1<\/h4>\n\n<ul>\n<li>Add support for passing through querystring parameters.<\/li>\n<\/ul>\n\n<h4>1.3<\/h4>\n\n<ul>\n<li>Use double quotes in find\/replace by using <code>%QUOT%<\/code> in its place, for example <code>find=\"~ (src|href)=(%QUOT%|')?(\/)?~\" replace=\" \\\\1=\\\\2http:\/\/www.example.com\/\"<\/code><\/li>\n<li>Bug fix for regex\/non-empty replace.<\/li>\n<\/ul>\n\n<h4>1.2<\/h4>\n\n<ul>\n<li>Support case insensitive <code>true\/false<\/code> and <code>GET\/POST<\/code> values.<\/li>\n<li>Bug fix for remote content caching.<\/li>\n<\/ul>\n\n<h4>1.1<\/h4>\n\n<ul>\n<li>CSS selectors for filtering and removal.<\/li>\n<li>Regular expression replacement support.<\/li>\n<li>Support for <code>strip_tags<\/code>.<\/li>\n<li>Added attribute to allow caching to be disabled.<\/li>\n<\/ul>\n\n<h4>1.0<\/h4>\n\n<p>Initial version.<\/p>","raw_excerpt":"Embed remote content into a post or page using a shortcode. Easily select and replace DOM elements.","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/da.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin\/29437","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/da.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin"}],"about":[{"href":"https:\/\/da.wordpress.org\/plugins\/wp-json\/wp\/v2\/types\/plugin"}],"replies":[{"embeddable":true,"href":"https:\/\/da.wordpress.org\/plugins\/wp-json\/wp\/v2\/comments?post=29437"}],"author":[{"embeddable":true,"href":"https:\/\/da.wordpress.org\/plugins\/wp-json\/wporg\/v1\/users\/doublesharp"}],"wp:attachment":[{"href":"https:\/\/da.wordpress.org\/plugins\/wp-json\/wp\/v2\/media?parent=29437"}],"wp:term":[{"taxonomy":"plugin_section","embeddable":true,"href":"https:\/\/da.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_section?post=29437"},{"taxonomy":"plugin_tags","embeddable":true,"href":"https:\/\/da.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_tags?post=29437"},{"taxonomy":"plugin_category","embeddable":true,"href":"https:\/\/da.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_category?post=29437"},{"taxonomy":"plugin_contributors","embeddable":true,"href":"https:\/\/da.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_contributors?post=29437"},{"taxonomy":"plugin_business_model","embeddable":true,"href":"https:\/\/da.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_business_model?post=29437"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}