iframe - Version 4.5

Version Description

  • sanitize URL.
Download this release

Release Info

Developer webvitaly
Plugin Icon wp plugin iframe
Version 4.5
Comparing to
See all releases

Code changes from version 4.4 to 4.5

Files changed (2) hide show
  1. iframe.php +8 -5
  2. readme.txt +12 -9
iframe.php CHANGED
@@ -2,8 +2,8 @@
2
  /*
3
  Plugin Name: iframe
4
  Plugin URI: http://wordpress.org/plugins/iframe/
5
- Description: [iframe src="http://www.youtube.com/embed/4qsGTXLnmKs" width="100%" height="500"] shortcode
6
- Version: 4.4
7
  Author: webvitaly
8
  Author URI: http://web-profile.net/wordpress/plugins/
9
  License: GPLv3
@@ -13,11 +13,11 @@ if ( ! defined( 'ABSPATH' ) ) { // Avoid direct calls to this file and prevent f
13
  exit;
14
  }
15
 
16
- define('IFRAME_PLUGIN_VERSION', '4.4');
17
 
18
  function iframe_plugin_add_shortcode_cb( $atts ) {
19
  $defaults = array(
20
- 'src' => 'http://www.youtube.com/embed/4qsGTXLnmKs',
21
  'width' => '100%',
22
  'height' => '500',
23
  'scrolling' => 'yes',
@@ -34,6 +34,9 @@ function iframe_plugin_add_shortcode_cb( $atts ) {
34
  $html = "\n".'<!-- iframe plugin v.'.IFRAME_PLUGIN_VERSION.' wordpress.org/plugins/iframe/ -->'."\n";
35
  $html .= '<iframe';
36
  foreach( $atts as $attr => $value ) {
 
 
 
37
  if ( strtolower($attr) != 'same_height_as' AND strtolower($attr) != 'onload'
38
  AND strtolower($attr) != 'onpageshow' AND strtolower($attr) != 'onclick') { // remove some attributes
39
  if ( $value != '' ) { // adding all attributes
@@ -68,7 +71,7 @@ function iframe_plugin_row_meta_cb( $links, $file ) {
68
  $row_meta = array(
69
  'support' => '<a href="http://web-profile.net/wordpress/plugins/iframe/" target="_blank">' . __( 'Iframe', 'iframe' ) . '</a>',
70
  'donate' => '<a href="http://web-profile.net/donate/" target="_blank">' . __( 'Donate', 'iframe' ) . '</a>',
71
- 'pro' => '<a href="http://codecanyon.net/item/antispam-pro/6491169?ref=webvitalii" target="_blank">' . __( 'Anti-spam Pro', 'iframe' ) . '</a>'
72
  );
73
  $links = array_merge( $links, $row_meta );
74
  }
2
  /*
3
  Plugin Name: iframe
4
  Plugin URI: http://wordpress.org/plugins/iframe/
5
+ Description: [iframe src="http://www.youtube.com/embed/oDlbBy9vfgI" width="100%" height="500"] shortcode
6
+ Version: 4.5
7
  Author: webvitaly
8
  Author URI: http://web-profile.net/wordpress/plugins/
9
  License: GPLv3
13
  exit;
14
  }
15
 
16
+ define('IFRAME_PLUGIN_VERSION', '4.5');
17
 
18
  function iframe_plugin_add_shortcode_cb( $atts ) {
19
  $defaults = array(
20
+ 'src' => 'http://www.youtube.com/embed/oDlbBy9vfgI',
21
  'width' => '100%',
22
  'height' => '500',
23
  'scrolling' => 'yes',
34
  $html = "\n".'<!-- iframe plugin v.'.IFRAME_PLUGIN_VERSION.' wordpress.org/plugins/iframe/ -->'."\n";
35
  $html .= '<iframe';
36
  foreach( $atts as $attr => $value ) {
37
+ if ( strtolower($attr) == 'src' ) { // sanitize url
38
+ $value = esc_url( $value );
39
+ }
40
  if ( strtolower($attr) != 'same_height_as' AND strtolower($attr) != 'onload'
41
  AND strtolower($attr) != 'onpageshow' AND strtolower($attr) != 'onclick') { // remove some attributes
42
  if ( $value != '' ) { // adding all attributes
71
  $row_meta = array(
72
  'support' => '<a href="http://web-profile.net/wordpress/plugins/iframe/" target="_blank">' . __( 'Iframe', 'iframe' ) . '</a>',
73
  'donate' => '<a href="http://web-profile.net/donate/" target="_blank">' . __( 'Donate', 'iframe' ) . '</a>',
74
+ 'pro' => '<a href="https://1.envato.market/Ym5aq" target="_blank">' . __( 'Advanced iFrame Pro', 'iframe' ) . '</a>'
75
  );
76
  $links = array_merge( $links, $row_meta );
77
  }
readme.txt CHANGED
@@ -3,24 +3,24 @@ Contributors: webvitaly
3
  Donate link: http://web-profile.net/donate/
4
  Tags: iframe, embed, youtube, vimeo, google-map, google-maps
5
  Requires at least: 3.0
6
- Tested up to: 5.0
7
- Stable tag: 4.4
8
  License: GPLv3
9
  License URI: http://www.gnu.org/licenses/gpl.html
10
 
11
- [iframe src="http://www.youtube.com/embed/4qsGTXLnmKs" width="100%" height="500"] shortcode
12
 
13
  == Description ==
14
 
15
- * **[Anti-spam Pro](http://codecanyon.net/item/antispam-pro/6491169?ref=webvitalii "Block Spam in Comments")**
16
  * **[iframe](http://web-profile.net/wordpress/plugins/iframe/ "Plugin page")**
17
  * **[Donate](http://web-profile.net/donate/ "Support the development")**
18
  * **[GitHub](https://github.com/webvitalii/iframe "Fork")**
19
 
20
- [iframe src="http://www.youtube.com/embed/4qsGTXLnmKs" width="100%" height="500"] shortcode
21
  should show something like this:
22
 
23
- [youtube http://www.youtube.com/watch?v=4qsGTXLnmKs]
24
 
25
 
26
  WordPress removes iframe html tags because of security reasons.
@@ -28,7 +28,7 @@ Iframe shortcode is the replacement of the iframe html tag and accepts the same
28
  You may use iframe shortcode to embed content from YouTube, Vimeo, Google Maps or from any external page.
29
 
30
 
31
- If you need to embed content from YouTube, Vimeo, SlideShare, SoundCloud, Twitter via direct link, you may use `[embed]http://www.youtube.com/watch?v=4qsGTXLnmKs[/embed]` shortcode.
32
  [embed] shortcode is a core WordPress feature and can [embed content from many resources via direct link](http://codex.wordpress.org/Embeds).
33
 
34
  **Important**: You can not embed HTTP pages into HTTPS pages and vice versa.
@@ -36,7 +36,7 @@ So the protocol (http or httpS) for parent and embedded page should match.
36
 
37
 
38
  = iframe params: =
39
- * **src** - source of the iframe: `[iframe src="http://www.youtube.com/embed/4qsGTXLnmKs"]`; by default src="http://www.youtube.com/embed/4qsGTXLnmKs";
40
  * **width** - width in pixels or in percents: `[iframe width="100%"]` or `[iframe width="600"]`; by default width="100%";
41
  * **height** - height in pixels: `[iframe height="500"]`; by default height="500";
42
  * **scrolling** - with or without the scrollbar: `[iframe scrolling="no"]`; by default scrolling="yes";
@@ -57,6 +57,9 @@ So the protocol (http or httpS) for parent and embedded page should match.
57
 
58
  == Changelog ==
59
 
 
 
 
60
  = 4.4 =
61
  * minor cleanup.
62
 
@@ -149,4 +152,4 @@ If you still need this feature you can [download iframe ver 3.0[(https://wordpre
149
  == Installation ==
150
 
151
  1. install and activate the plugin on the Plugins page
152
- 2. add shortcode `[iframe src="http://www.youtube.com/embed/4qsGTXLnmKs" width="100%" height="500"]` to page or post content
3
  Donate link: http://web-profile.net/donate/
4
  Tags: iframe, embed, youtube, vimeo, google-map, google-maps
5
  Requires at least: 3.0
6
+ Tested up to: 5.4
7
+ Stable tag: 4.5
8
  License: GPLv3
9
  License URI: http://www.gnu.org/licenses/gpl.html
10
 
11
+ [iframe src="http://www.youtube.com/embed/oDlbBy9vfgI" width="100%" height="500"] shortcode
12
 
13
  == Description ==
14
 
15
+ * **[Advanced iFrame Pro](https://1.envato.market/Ym5aq "Advanced iFrame Pro")**
16
  * **[iframe](http://web-profile.net/wordpress/plugins/iframe/ "Plugin page")**
17
  * **[Donate](http://web-profile.net/donate/ "Support the development")**
18
  * **[GitHub](https://github.com/webvitalii/iframe "Fork")**
19
 
20
+ [iframe src="http://www.youtube.com/embed/oDlbBy9vfgI" width="100%" height="500"] shortcode
21
  should show something like this:
22
 
23
+ [youtube http://www.youtube.com/watch?v=oDlbBy9vfgI]
24
 
25
 
26
  WordPress removes iframe html tags because of security reasons.
28
  You may use iframe shortcode to embed content from YouTube, Vimeo, Google Maps or from any external page.
29
 
30
 
31
+ If you need to embed content from YouTube, Vimeo, SlideShare, SoundCloud, Twitter via direct link, you may use `[embed]http://www.youtube.com/watch?v=oDlbBy9vfgI[/embed]` shortcode.
32
  [embed] shortcode is a core WordPress feature and can [embed content from many resources via direct link](http://codex.wordpress.org/Embeds).
33
 
34
  **Important**: You can not embed HTTP pages into HTTPS pages and vice versa.
36
 
37
 
38
  = iframe params: =
39
+ * **src** - source of the iframe: `[iframe src="http://www.youtube.com/embed/oDlbBy9vfgI"]`; by default src="http://www.youtube.com/embed/oDlbBy9vfgI";
40
  * **width** - width in pixels or in percents: `[iframe width="100%"]` or `[iframe width="600"]`; by default width="100%";
41
  * **height** - height in pixels: `[iframe height="500"]`; by default height="500";
42
  * **scrolling** - with or without the scrollbar: `[iframe scrolling="no"]`; by default scrolling="yes";
57
 
58
  == Changelog ==
59
 
60
+ = 4.5 =
61
+ * sanitize URL.
62
+
63
  = 4.4 =
64
  * minor cleanup.
65
 
152
  == Installation ==
153
 
154
  1. install and activate the plugin on the Plugins page
155
+ 2. add shortcode `[iframe src="http://www.youtube.com/embed/oDlbBy9vfgI" width="100%" height="500"]` to page or post content