Skip to content

Latest commit

Β 

History

3 Commits

Folders and files

NameName
Last commit message
Last commit date
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Any Site to WordPress Widget

WordPress Plugin PHP License GitHub Stars GitHub Issues GitHub Forks WordPress

πŸš€ 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 Admin β†’ Plugins β†’ Add 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 Admin β†’ Site 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 Admin β†’ Appearance β†’ Widgets
  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!

GitHub Stars Twitter


πŸ“Š Statistics

GitHub language count GitHub top language GitHub repo size GitHub last commit GitHub contributors


Made with ❀️ by yhajizada

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


About

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

Resources

Contributing

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages