Plugin Directory

Changeset 2464704


Ignore:
Timestamp:
01/29/2021 06:55:51 AM (5 years ago)
Author:
soysudhanshu
Message:

Release: v1.1.0

Location:
iframe-me/trunk
Files:
4 added
2 edited

Legend:

Unmodified
Added
Removed
  • iframe-me/trunk/iframe-me.php

    r2460535 r2464704  
    33 * Plugin Name: iFrame Me
    44 * Description: A simple solution for inserting iFrames.
    5  * Version: 1.0.0
     5 * Version: 1.1.0
    66 * Author: soysudhanshu
    77 * Author URI: https://soysudhanshu.com
     8 * Requires PHP: 7.4
     9 * Requires at least: 5.3
    810 */
     11
     12if(!defined('ABSPATH')){
     13    exit('');
     14}
     15
     16require __DIR__ . '/includes/class-iframe-me-exception.php';
     17require __DIR__ . '/includes/class-iframe-me-renderer.php';
     18require __DIR__ . '/includes/functions.php';
    919
    1020add_shortcode('iframe_me', 'render_iframe_me_shortcode');
     
    1222function render_iframe_me_shortcode($attributes, $content)
    1323{
    14     $allowed_protocols = ['http', 'https'];
    15     $url = esc_url($content, $allowed_protocols);
     24    $url = $content;
     25    if(empty($attributes)){
     26        $attributes = [];
     27    }
    1628
    17     if (empty($url)) {
    18         return <<<HTML
    19         <div style='color:tomato;
     29    try{
     30
     31        $iframe_renderer = new Iframe_Me_Renderer($url, $attributes);
     32        $output = $iframe_renderer->output();
     33    }catch(Iframe_Me_Exception $e){
     34        $output = "<div style='color:tomato;
    2035                    padding: 1rem;
    2136                    border-radius:7px;
     
    2338                    background: white'
    2439        >
    25             Invalid iFrame URL
    26         </div>
    27         HTML;
     40            {$e->getMessage()}
     41        </div>";
    2842    }
    2943
    30     return "<iframe src='$url' height='500'></iframe>";
     44    return $output;
    3145}
  • iframe-me/trunk/readme.txt

    r2460535 r2464704  
    11=== iFrame Me ===
    22Contributors: soysudhanshu
    3 Tags: iframe, embed, simple, iframe
    4 Requires at least: 5.0
     3Tags: iframe, embed, simple iframe, iframe me, external, content
    54Tested up to: 5.6
     5Requires at least: 5.3
    66Requires PHP: 7.4
     7License URI: http://www.gnu.org/licenses/gpl-2.0.html
    78License: GPL v2
    8 License URI: http://www.gnu.org/licenses/gpl-2.0.html
    99
    10 Easily add iframe with a simple shortcode
     10Easily add iframe with a simple shortcode.
    1111[iframe_me]https://example.com[/iframe_me]
    1212
    1313== Description ==
    14 Add iFrames without writing any HTML!
     14iFrame Me is a simple plugin for creating HTML iFrames which serve as window to another site for displaying embedded content
     15
     16== How to use ==
     17Simply write shortcode and add url between.`[iframe_me] YOUR URL [/iframe_me]`
     18
     19= Shortcode Params =
     20You can use these codes to customize iframe. Uses `[iframe_me height='100px'...` .
     21* *height* Height of output frame in pixels or percentage.
     22* *width* width of output frame in pixels or percentage.
     23
    1524
    1625== Changelog ==
    17 == 1.0.0 ==
     26= 1.1.0 =
     27* Custom iframe height and width support.
     28* Added Relative URL support.
     29
     30= 1.0.0 =
    1831* Initial Release
Note: See TracChangeset for help on using the changeset viewer.