JSM file_get_contents() Shortcode

JSM file_get_contents() Shortcode

Wordpress plugin

Install on Wordpress

App Details

A safe and reliable WordPress shortcode for PHP’s file_get_contents() function.

Shortcode Attributes

  • body = Keep only the content between <body></body> HTML tags (default is true).
  • cache = Number of seconds to cache the contents (defaults is 3600 seconds).
  • class = Add a class to the content ‘div’ container (default is none).
  • code = Wrap the content in a <code></code> container (default is false).
  • code_class = Add a class to the ‘code’ container (default is none).
  • code_lang = Escape HTML characters, wrap the content in a <pre><code></code></pre> container, and add a language class to the ‘code’ container (default is none).
  • esc_html = Escape HTML characters (default is false).
  • esc_html_pre_code = Escape HTML characters and wrap the content in a <pre><code></code></pre> container (default is false).
  • file = Path to a local file (relative to the wp-content/ folder).
  • filter = Apply the named filter to the content (default is none).
  • more = Add a more link on non-singular web pages (default is true).
  • pre = Wrap the content in a <pre></pre> container (default is false).
  • pre_class = Add a class to the ‘pre’ container (default is none).
  • pre_code = Wrap the content in a <pre><code></code></pre> container (default is false).
  • pre_lang = Escape HTML characters, wrap the content in a <pre><code></code></pre> container, and add a language class to the ‘pre’ container (default is none).
  • pre_title = Add a title to the ‘pre’ container (default is none).
  • url = URL or file URI.
  • utf8 = Encode HTML entities (default is true).

Note that all file paths (not URLs) are relative to the wp-content/ folder. For security reasons, it is not possible to include files outside the wp-content/ folder. As an example, the shortcode attributes url="file://dir/file.html" and file="/dir/file.html" are both read as wordpress/wp-contents/dir/file.html. The .. folder name is also stripped from file paths to prevent backing out of the wp-content/ folder.

Shortcode Name

The WPFGC_SHORTCODE_NAME constant can be defined in your wp-config.php file to add an additional custom shortcode name (the default shortcode names are ‘wp-file-get-contents’ and ‘wpfgc’).

define( 'WPFGC_SHORTCODE_NAME', 'include' ); 

Shortcode Examples

[wpfgc url="http://example.com/dir/file.html"] [wpfgc url="http://example.com/counter/" cache="7200"] [wpfgc url="file://dir/file.html"] [wpfgc file="/dir/file.txt" pre="true" filter="my_custom_filter_name" cache="600"] [wpfgc file="examples/example-1.php" code_lang="php"] 

Pricing

Starting from $0 per month.

Check Out the Right Click Protection Widget

By Common Ninja

Right Click ProtectionTry For Free!

App Info

Rating

Reviewers

1 reviews

Tags

file
file_get_contents
include
shortcode
url

Developed By

JS Morisset

Quick & Easy

Find the Best Wordpress plugins for you

Common Ninja has a large selection of powerful Wordpress plugins that are easy to use, fully customizable, mobile-friendly and rich with features — so be sure to check them out!

Testimonial

Testimonial plugins for Wordpress

Galleries

Galleries plugins for Wordpress

SEO

SEO plugins for Wordpress

Contact Form

Contact Form plugins for Wordpress

Forms

Forms plugins for Wordpress

Social Feeds

Social Feeds plugins for Wordpress

Social Sharing

Social Sharing plugins for Wordpress

Events Calendar

Events Calendar plugins for Wordpress

Sliders

Sliders plugins for Wordpress

Analytics

Analytics plugins for Wordpress

Reviews

Reviews plugins for Wordpress

Comments

Comments plugins for Wordpress

Portfolio

Portfolio plugins for Wordpress

Maps

Maps plugins for Wordpress

Security

Security plugins for Wordpress

Translation

Translation plugins for Wordpress

Ads

Ads plugins for Wordpress

Video Player

Video Player plugins for Wordpress

Music Player

Music Player plugins for Wordpress

Backup

Backup plugins for Wordpress

Privacy

Privacy plugins for Wordpress

Optimize

Optimize plugins for Wordpress

Chat

Chat plugins for Wordpress

Countdown

Countdown plugins for Wordpress

Email Marketing

Email Marketing plugins for Wordpress

Tabs

Tabs plugins for Wordpress

Membership

Membership plugins for Wordpress

popup

popup plugins for Wordpress

SiteMap

SiteMap plugins for Wordpress

Payment

Payment plugins for Wordpress

Coming Soon

Coming Soon plugins for Wordpress

Ecommerce

Ecommerce plugins for Wordpress

Customer Support

Customer Support plugins for Wordpress

Inventory

Inventory plugins for Wordpress

Video Player

Video Player plugins for Wordpress

Testimonials

Testimonials plugins for Wordpress

Tabs

Tabs plugins for Wordpress

Social Sharing

Social Sharing plugins for Wordpress

Social Feeds

Social Feeds plugins for Wordpress

Slider

Slider plugins for Wordpress

Reviews

Reviews plugins for Wordpress

Portfolio

Portfolio plugins for Wordpress

Membership

Membership plugins for Wordpress

Forms

Forms plugins for Wordpress

Events Calendar

Events Calendar plugins for Wordpress

Contact

Contact plugins for Wordpress

Comments

Comments plugins for Wordpress

Analytics

Analytics plugins for Wordpress

Common Ninja Apps

Some of the best Common Ninja plugins for Wordpress

Browse our extensive collection of compatible plugins, and easily embed them on any website, blog, online store, e-commerce platform, or site builder.

Right Click Protection for Wordpress logo

Right Click Protection

Use right click protection to prevent copying by disabling right click actions, protecting your content and reducing unauthorized reuse on your site.

 Headline With Background Image for Wordpress logo

Headline With Background Image

Create headlines with background images that blend text and visuals and let you control animation, position, and fonts.

Age Gate for Wordpress logo

Age Gate

Use an age verification popup to validate visitor age, meet regulatory requirements, and ensure only eligible users access restricted content.

Virtual Tour for Wordpress logo

Virtual Tour

Create immersive 360 virtual tours with interactive hotspots that let visitors explore spaces, view details clearly, and experience panoramic environments seamlessly.

Job Listings for Wordpress logo

Job Listings

Create job listings with a jobs board widget that lets you post openings, manage roles easily, and help candidates find the right positions quickly.

WordPress Feed for Wordpress logo

WordPress Feed

Show WordPress posts with a WordPress feed that keeps content fresh, improves navigation, and helps visitors discover more of your site.

Collapsible Content for Wordpress logo

Collapsible Content

Use Collapsible Content sections to structure information on your site and make it easier for visitors to find what they need.

Skill List for Wordpress logo

Skill List

Showcase your abilities with a structured skill list that highlights strengths clearly, builds credibility, and improves your chances of getting hired.

All in One Reviews for Wordpress logo

All in One Reviews

Display and manage customer reviews from multiple platforms in one place to build trust and highlight brand credibility.

Bluesky Feed Slider for Wordpress logo

Bluesky Feed Slider

Show Bluesky posts with a Bluesky feed slider that scrolls updates and keeps content visible while keeping visitors engaged.

Interactive Maps for Wordpress logo

Interactive Maps

Create interactive maps with color coding and tooltips to visualize data clearly and embed engaging maps on your site.

Social Votes for Wordpress logo

Social Votes

Encourage interaction with social votes that let visitors like, upvote, and rank content, boosting engagement and guiding better decisions.

Discover Apps By Platform

Discover the best apps for your website

WordPress
Wix
Shopify
Weebly
Webflow
Joomla
PrestaShop
Shift4Shop
WebsiteX5
MODX
Opencart
NopCommerce

Common Ninja Search Engine

The Common Ninja Search Engine platform helps website builders find the best site widgets, apps, plugins, tools, add-ons, and extensions! Compatible with all major website building platforms - big or small - and updated regularly, our Search Engine tool provides you with the business tools your site needs!

Multiple platforms