WP Manifestindependent plugin directory
manifest / utilities / any-site-to-wordpress-widget

Any Site to WordPress Widget

Convert any website page to a WordPress HTML widget instantly. Just paste a URL and get clean, sanitized HTML code ready for WordPress.

by yhajizada · github.com/yhajizada/any-site-to-wordpress-widget · website

0stars
0forks

Install

No release zip yet. The repository archive installs, but the folder name will carry the branch suffix and updates will not flow:

wp plugin install https://github.com/yhajizada/any-site-to-wordpress-widget/archive/refs/heads/main.zip

Readme

Any Site to WordPress Widget

🚀 Convert any website page to a clean, sanitized WordPress HTML widget with one click.


📖 Table of Contents


✨ Features

Feature Description
🚀 One-Click Conversion Just paste a URL and get ready-to-use HTML
🧠 Smart Content Extraction Optionally extract only the main content area
🔒 Security First All HTML is sanitized using WordPress's wp_kses
🔌 WordPress Native Works as a WordPress plugin with admin interface
📋 Copy & Download Copy to clipboard or download as HTML file
👨‍💻 Developer Friendly Can be used programmatically as a PHP class
🆓 Free & Open Source 100% free with GPL-2.0 license
🌍 Multilingual Ready Translation ready with WordPress i18n
Lightweight Minimal footprint, no external dependencies
📱 Mobile Friendly Works on all devices

📸 Screenshots

Main Admin Interface

Main Admin Interface

Conversion Result

Conversion Result

Settings Page

Settings Page


📥 Installation

Method 1: WordPress Admin (Easiest)

  1. Download the latest ZIP file from Releases
  2. Go to WordPress AdminPluginsAdd New
  3. Click the "Upload Plugin" button at the top
  4. Select the downloaded ZIP file and click "Install Now"
  5. Click "Activate"

Method 2: Manual Installation (Advanced)

# Navigate to your WordPress plugins directory
cd wp-content/plugins/

# Clone the repository
git clone https://github.com/yhajizada/any-site-to-wordpress-widget.git

# Activate the plugin via WordPress Admin

Method 3: Composer (Developers)

composer require yhajizada/any-site-to-wordpress-widget

🚀 Quick Start

  1. After activation, go to WordPress AdminSite to Widget
  2. Enter any website URL (e.g., https://example.com/article-to-convert)
  3. Click "Convert to HTML"
  4. Copy the generated HTML
  5. Paste it into your WordPress page using the Custom HTML block

That's it! Your content is now a WordPress widget. 🎉


🔧 Usage Examples

Example 1: Convert a Blog Article

URL: https://techblog.com/interesting-article
Options: ✅ Extract main content only
Result: Clean, article-only HTML ready for WordPress

Example 2: Convert a Product Page

URL: https://store.com/product-page
Options: ❌ Extract main content only
Result: Full product description, images, and details as sanitized HTML

Example 3: Convert a News Article

URL: https://news.com/latest-headline
Options: ✅ Extract main content only
Result: Article content without ads, sidebars, or navigation

📋 How to Use in WordPress

Using Gutenberg (Block Editor)

  1. Copy the HTML code from the plugin
  2. Open any WordPress page or post
  3. Add a "Custom HTML" block
  4. Paste the code
  5. Publish or Update the page

Using Classic Editor

  1. Copy the HTML code from the plugin
  2. Open any WordPress page or post
  3. Switch to "Text" tab
  4. Paste the code
  5. Publish or Update the page

Using a Widget Area

  1. Copy the HTML code from the plugin
  2. Go to WordPress AdminAppearanceWidgets
  3. Add a "Text" widget to any widget area
  4. Paste the code
  5. Click "Save"

👨‍💻 Developer Usage

Basic Usage

// Include the class
require_once 'includes/class-url-to-widget.php';

// Create instance
$converter = new URL_to_Widget_Converter();

// Convert a URL
$html = $converter->process('https://example.com');

// Display the result
echo $html;

Advanced Usage

// Include the class
require_once 'includes/class-url-to-widget.php';

// Create instance with custom options
$converter = new URL_to_Widget_Converter();

// Convert with content extraction
$html = $converter->process('https://example.com', true);

// Check for errors
if ( false === $html ) {
    echo 'Failed to fetch URL';
} else {
    echo $html;
}

Custom Sanitization

// Extend the class for custom sanitization
class My_Custom_Converter extends URL_to_Widget_Converter {
    public function sanitize_html( $html ) {
        // Add custom tags
        $allowed_tags = array_merge(
            parent::get_allowed_tags(),
            array(
                'custom-tag' => array( 'custom-attr' => array() )
            )
        );
        return wp_kses( $html, $allowed_tags );
    }
}

🛡️ Security

This plugin uses WordPress's built-in wp_kses function for HTML sanitization.

Security Features

Type Status Description
Safe HTML tags ✅ Preserved p, div, h1-h6, a, img, tables, lists
JavaScript ❌ Removed script tags and inline JS
Event handlers ❌ Removed onclick, onload, onerror, etc.
iFrames ❌ Removed iframe, embed, object
CSS classes ✅ Preserved Safe CSS classes
CSS styles ✅ Preserved Safe inline styles
Links ✅ Preserved href attributes with validation
Images ✅ Preserved src, alt, width, height
Meta tags ❌ Removed meta, link, script, style

WordPress Security Standards

This plugin follows WordPress security best practices:

  • ✅ Uses wp_kses for input sanitization
  • ✅ Uses wp_remote_get for HTTP requests
  • ✅ Uses esc_url_raw for URL validation
  • ✅ Uses esc_html for output escaping
  • ✅ Uses wp_nonce_field for CSRF protection
  • ✅ No direct database queries
  • ✅ No file system operations

📊 System Requirements

Minimum Requirements

  • WordPress: 5.0 or higher
  • PHP: 7.2 or higher
  • Server: allow_url_fopen or cURL enabled
  • Memory: 64MB minimum (128MB recommended)

Recommended Requirements

  • WordPress: 6.0 or higher
  • PHP: 8.0 or higher
  • Server: cURL enabled with SSL support
  • Memory: 128MB or higher

Server Compatibility

Server Status
Apache ✅ Fully compatible
Nginx ✅ Fully compatible
LiteSpeed ✅ Fully compatible
IIS ✅ Compatible (with PHP)
WP Engine ✅ Tested and working
Kinsta ✅ Tested and working
SiteGround ✅ Tested and working
Bluehost ✅ Tested and working

🤝 Contributing

Contributions are welcome! Here's how you can help:

Ways to Contribute

  1. Report Bugs - Use the Issue Tracker
  2. Suggest Features - Open a feature request issue
  3. Write Code - Submit pull requests
  4. Improve Documentation - Update README or docs
  5. Translate - Help translate into other languages

Development Setup

# Fork the repository
# Clone your fork
git clone https://github.com/your-username/any-site-to-wordpress-widget.git

# Create a feature branch
git checkout -b feature/amazing-feature

# Make your changes
# Test your changes
# Submit a pull request

Pull Request Guidelines

  1. Follow WordPress Coding Standards
  2. Use meaningful commit messages
  3. Test your changes thoroughly
  4. Update documentation if needed
  5. Keep pull requests focused on a single feature

📝 License

This project is licensed under the GPL-2.0+ License.

This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.

Full license text: LICENSE


🙏 Acknowledgments

  • WordPress Foundation - For the excellent CMS and APIs
  • PHP Community - For the awesome programming language
  • Open Source Community - For inspiring this project
  • All Contributors - Who helped make this plugin better

Built With


📞 Support

Documentation

Community Support

Commercial Support

Need priority support or custom development? Contact: [your-email@example.com]


⭐ Star History

Star History Chart


🌟 Show Your Support

If you like this project, please give it a star ⭐ on GitHub!


📊 Statistics


Made with ❤️ by yhajizada

If you like this plugin, please give it a star on GitHub!

Read the full README on GitHub →