It seems file_get_contents()
isn’t active in your server. Instead, use the wp_remote_get()
.
Note wp_remote_get()
is among the family of WordPress HTTP API specifically used for sending GET requests.
The advantage of wp_remote_get()
over file_get_contents()
and other PHP stream/transport function is – The WordPress HTTP API was created to standardize a single API that handled everything with regards to HTTP as simply as possible. The HTTP API supports various PHP HTTP transports or implementations to cater for different hosting environments and configurations.
In a nutshell, if file_get_contents()
isn’t enabled, wp_remote_get()
will use cURL if available, if not, it find and uses any available HTTP transport.
Related Posts:
- How to implement a customizable free OpenID authentication?
- Difference between add_filter and apply_filters
- Remote upload file to server B
- Checking if an attribute exists in a shortcode
- Creating Unique Post URLs for A/B Testing… Is this even possible?
- How to delete the Hello Dolly plugin automatically?
- Show Similar Post Titles ( Similar to Stack Exchange )
- How do I unlock a post programmatically?
- How to enable edit button in the theme’s customize UI?
- Delete Post With No Traffic?
- Automatically Creating Posts for Popular Forum Topics or Products [closed]
- Open external links in a new window
- How can I limit functionality in one version of a plugin?
- How to add usermeta to “Notice of Email Change” email message
- What’s the recommended process for organising collaborative posting?
- Any way to use a custom Parameter for youtube embed without using an iframe?
- WordPress 3.1 and Disqus throws Warning: number_format() error in Posts List
- Is there a plugin to display certain posts on certain pages? [closed]
- REST-API: extend media-endpoint
- How can I rewrite a plugin generated URL?
- How to make sexy bookmarks plugin work in WPMU
- register_post_status invisible but searchable
- Can’t create term for product attribute
- Leveraging WordPress Comments on Custom Plugin Object page
- Debugging Technique Question re: functions.php
- Is there a way to alter the order in which the plugins appear in the page?
- How to check what plugins used to be on a WordPress installation?
- Possible to replicate economist.com’s debate section in wordpress? [closed]
- FacetWP group listings by custom field [closed]
- Is it possible to use WordPress as an online portfolio for text content? What kind of theme would I look for?
- Custom Field Template seriously messed up in WP 3.1.1
- Plugin upgrade issue
- Get IDs of Images from Gallery Block in InnerBlocks of a Custom Gutenberg Block
- How to embed HTML code from WP Coder plugin (or other) into Main Index Template of the theme
- WordPress plugin – Error “Plugin generate 2890 characters of unexpected output when activated”
- I have no idea “How change font for elements in widget?”
- Remove Duplicator plugin from admin menu if not an administrator
- Add a custom form on the post-new.php admin page
- Edit Yoast SEO breadcrumbs output [closed]
- className not populating in custom block
- In the archive widget, how do I sort in between two years?
- Customization API for plugin development
- Fromcraft Plugin On click submit button [closed]
- creating a custom shop page display on archive woocommerce
- polylang + category/tag custom language link
- How to redirect users to their profile after they successfully edit their profile
- “No Add Button” for me to customize my WordPress with themes and pluggins
- Translation plugin to translate another plugins
- Creating Featured Content Boxes
- Contact Form 7 – Form name blank [closed]
- Customizing Titles on the Fly with Code
- Text change in Advanced Customs Fields [closed]
- Loop in elementor custom widget not working
- Overriding an Array in a Plugin’s Class/Function from functions.php
- Historical customisations won’t go away [closed]
- .php file for woocommerce edit category? [closed]
- How can i summerize posts or news automatically in word press site?
- wp_mail – using a custom field value
- Edit page header on a custom plugin
- How to display an alert when deleting a plugin?
- unregister a sidebar widget
- How to disable Wp-PageNavi at the top of the page
- 404 errors when updating options in admin dashboard
- Display WordPress comments before the plugins?
- Mobilepress fails to translate short codes
- woocommerce remove coupon link does not work
- Getting infinite scrolling working on my custom template
- Display posts by alphabetical order
- Making a list that can be filtered by category/tags
- Adding discount functionality to the cart
- Changing the CSS with a plugin
- how to change a static testimonials into dynamic
- Precheck fields when I add a new post
- Rename a folder via HTML POST request
- How can I add a custom Javascript snippet to display my feedback in footer?
- Custom wp_list_tables redirect on specfic page
- Issue calling my functions on Plugin activate in WordPress
- Paid Membership Pro displaying a user name in PHP
- User upload dashboard
- Automatically check “Enable stock management at product level” to the existing products?
- custom/automatic export function – one post at a time?
- Custom SportsPress list
- Creating Nested custom fields
- How to restrict “too soon” downloads with a general rule?
- Display Powerpress media url
- Plugin does not create a custom table upon activation
- Disable default posts (Posts,Pages,Comments and Media) in wp-admin
- Plugin program: JQuery not working in this plugin
- admin panel save option with ajax
- Get page type to display content
- How to fix vanilla comments extra iframe space
- Woocommerce quick checkout form [closed]
- How to add image for custom taxonomy
- Social network plugins for WordPress [closed]
- Why haven’t I see plugins using get_file_data to handle retrieving plugin version?
- Wrapping code in an if block
- How to give different user access to different people?
- How can I properly sanitize the update_option in WordPress?
- Create Custom Coupon Type
- Using ACF to allow user to add and edit multiple saved forms