This is a WordPress plugin that allows you to grab content from a URL and add it to your site.
- Plugin Name: CWP Grab Content
- Plugin URI: http://www.contexthq.com
- Description: This plugin will grab the content from a URL and add it to your site.
- Version: 1.0.0
- Author: Robert Andrews
- Author URI: http://www.contexthq.com
-
Set the maximum execution time and time limit in the plugin using the following code:
ini_set('max_execution_time', 3000); // 300 seconds = 5 minutes set_time_limit(3000);
-
Override the default HTTP request timeout using the
http_request_timeout
filter:// override timeout add_filter('http_request_timeout', function () { return 30000; // 300 seconds = 5 minutes });
-
Include the required autoload file:
require __DIR__ . '/vendor/autoload.php';
-
Register the Content Grabber page in the WordPress admin menu:
add_action('admin_menu', 'content_grabber_admin_menu');
-
Implement the
content_grabber_admin_menu
andcontent_grabber_admin_page
functions to handle the content grabbing process and display the plugin page.
- Access the "Grab New" page in the WordPress admin menu.
- Enter the URL of the article you want to grab in the provided input field.
- Click the "Fetch Post/s" button to initiate the content grabbing process.
Note: The plugin uses either the WordPress API or Graby parsing to retrieve the content from the URL, depending on whether the URL is a WordPress post or not.
This plugin is licensed under the MIT License.