Insert PHP Code Snippet - Version 1.2.1

Version Description

  • Nonces Added.
  • A few bug fixes.
Download this release

Release Info

Developer f1logic
Plugin Icon 128x128 Insert PHP Code Snippet
Version 1.2.1
Comparing to
See all releases

Code changes from version 1.2 to 1.2.1

add_shortcode_tynimce.php CHANGED
@@ -1,41 +1,43 @@
1
- <?php
2
-
3
- if(!class_exists('XYZ_Insert_Php_TinyMCESelector')):
4
-
5
- class XYZ_Insert_Php_TinyMCESelector{
6
- var $buttonName = 'xyz_ips_snippet_selecter';
7
- function addSelector(){
8
- // Don't bother doing this stuff if the current user lacks permissions
9
- if ( ! current_user_can('edit_posts') && ! current_user_can('edit_pages') )
10
- return;
11
-
12
- // Add only in Rich Editor mode
13
- if ( get_user_option('rich_editing') == 'true') {
14
- add_filter('mce_external_plugins', array($this, 'registerTmcePlugin'));
15
- //you can use the filters mce_buttons_2, mce_buttons_3 and mce_buttons_4
16
- //to add your button to other toolbars of your tinymce
17
- add_filter('mce_buttons', array($this, 'registerButton'));
18
- }
19
- }
20
-
21
- function registerButton($buttons){
22
- array_push($buttons, "separator", $this->buttonName);
23
- return $buttons;
24
- }
25
-
26
- function registerTmcePlugin($plugin_array){
27
- $plugin_array[$this->buttonName] =get_site_url() . '/index.php?wp_ips=editor_plugin_js';
28
- if ( get_user_option('rich_editing') == 'true')
29
- //var_dump($plugin_array);
30
- return $plugin_array;
31
- }
32
- }
33
-
34
- endif;
35
-
36
- if(!isset($shortcodesXYZEP)){
37
- $shortcodesXYZEP = new XYZ_Insert_Php_TinyMCESelector();
38
- add_action('admin_head', array($shortcodesXYZEP, 'addSelector'));
39
- }
40
-
41
- ?>
 
 
1
+ <?php
2
+ if ( ! defined( 'ABSPATH' ) )
3
+ exit;
4
+
5
+ if(!class_exists('XYZ_Insert_Php_TinyMCESelector')):
6
+
7
+ class XYZ_Insert_Php_TinyMCESelector{
8
+ var $buttonName = 'xyz_ips_snippet_selecter';
9
+ function addSelector(){
10
+ // Don't bother doing this stuff if the current user lacks permissions
11
+ if ( ! current_user_can('edit_posts') && ! current_user_can('edit_pages') )
12
+ return;
13
+
14
+ // Add only in Rich Editor mode
15
+ if ( get_user_option('rich_editing') == 'true') {
16
+ add_filter('mce_external_plugins', array($this, 'registerTmcePlugin'));
17
+ //you can use the filters mce_buttons_2, mce_buttons_3 and mce_buttons_4
18
+ //to add your button to other toolbars of your tinymce
19
+ add_filter('mce_buttons', array($this, 'registerButton'));
20
+ }
21
+ }
22
+
23
+ function registerButton($buttons){
24
+ array_push($buttons, "separator", $this->buttonName);
25
+ return $buttons;
26
+ }
27
+
28
+ function registerTmcePlugin($plugin_array){
29
+ $plugin_array[$this->buttonName] =get_site_url() . '/index.php?wp_ips=editor_plugin_js';
30
+ if ( get_user_option('rich_editing') == 'true')
31
+ //var_dump($plugin_array);
32
+ return $plugin_array;
33
+ }
34
+ }
35
+
36
+ endif;
37
+
38
+ if(!isset($shortcodesXYZEP)){
39
+ $shortcodesXYZEP = new XYZ_Insert_Php_TinyMCESelector();
40
+ add_action('admin_head', array($shortcodesXYZEP, 'addSelector'));
41
+ }
42
+
43
+ ?>
admin/about.php CHANGED
@@ -1,3 +1,9 @@
 
 
 
 
 
 
1
  <style>
2
  </style>
3
 
1
+ <?php
2
+ if ( ! defined( 'ABSPATH' ) )
3
+ exit;
4
+
5
+
6
+ ?>
7
  <style>
8
  </style>
9
 
admin/admin-notices.php ADDED
@@ -0,0 +1,73 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ function wp_ips_admin_notice()
3
+ {
4
+ add_thickbox();
5
+ $sharelink_text_array_ips = array
6
+ (
7
+ "I use Insert PHP Code Snippet wordpress plugin from @xyzscripts and you should too.",
8
+ "Insert PHP Code Snippet wordpress plugin from @xyzscripts is awesome",
9
+ "Thanks @xyzscripts for developing such a wonderful Insert PHP Code Snippet wordpress plugin",
10
+ "I was looking for a Insert PHP Code Snippet plugin and I found this. Thanks @xyzscripts",
11
+ "Its very easy to use Insert PHP Code Snippet wordpress plugin from @xyzscripts",
12
+ "I installed Insert PHP Code Snippet from @xyzscripts,it works flawlessly",
13
+ "Insert PHP Code Snippet wordpress plugin that i use works terrific",
14
+ "I am using Insert PHP Code Snippet wordpress plugin from @xyzscripts and I like it",
15
+ "The Insert PHP Code Snippet plugin from @xyzscripts is simple and works fine",
16
+ "I've been using this Insert PHP Code Snippet plugin for a while now and it is really good",
17
+ "Insert PHP Code Snippet wordpress plugin is a fantastic plugin",
18
+ "Insert PHP Code Snippet wordpress plugin is easy to use and works great. Thank you!",
19
+ "Good and flexible Insert PHP Code Snippet plugin especially for beginners",
20
+ "The best Insert PHP Code Snippet wordpress plugin I have used ! THANKS @xyzscripts",
21
+ );
22
+ $sharelink_text_ips = array_rand($sharelink_text_array_ips, 1);
23
+ $sharelink_text_ips = $sharelink_text_array_ips[$sharelink_text_ips];
24
+
25
+
26
+ echo '<style>
27
+ #TB_window { width:50% !important; height: 100px !important;
28
+ margin-left: 25% !important;
29
+ left: 0% !important;
30
+ }
31
+ </style>
32
+ <script type="text/javascript">
33
+ function xyz_ips_shareon_tckbox(){
34
+ tb_show("Share on","#TB_inline?width=500&amp;height=75&amp;inlineId=show_share_icons_ips&class=thickbox");
35
+ }
36
+ </script>
37
+ <div id="ips_notice_td" style="clear:both;width:98%;background: none repeat scroll 0pt 0pt #FBFCC5; border: 1px solid #EAEA09;padding:5px;">
38
+ <p>It looks like you have been enjoying using <a href="https://wordpress.org/plugins/insert-php-code-snippet/" target="_blank"> Insert PHP Code Snippet </a> plugin from Xyzscripts for atleast 30 days.Would you consider supporting us with the continued development of the plugin using any of the below methods?</p>
39
+ <p>
40
+ <a href="https://wordpress.org/support/view/plugin-reviews/insert-php-code-snippet" class="button" style="color:black;text-decoration:none;margin-right:4px;" target="_blank">Rate it 5★\'s on wordpress</a>';
41
+ if(get_option('xyz_credit_link')=="0")
42
+ echo '<a class="button xyz_ips_backlink" style="color:black;text-decoration:none;margin-right:4px;" target="_blank">Enable backlink</a>';
43
+
44
+ echo '<a class="button" onclick=xyz_ips_shareon_tckbox(); style="color:black;text-decoration:none;margin-right:4px;">Share on</a>
45
+
46
+
47
+ <a href="admin.php?page=insert-php-code-snippet-settings&ips_notice=hide" class="button" style="color:black;text-decoration:none;margin-right:4px;">Don\'t Show This Again</a>
48
+ </p>
49
+
50
+ <div id="show_share_icons_ips" style="display: none;">
51
+ <a class="button" style="background-color:#3b5998;color:white;margin-right:4px;margin-left:100px;margin-top: 25px;" href="http://www.facebook.com/sharer/sharer.php?u=http://xyzscripts.com/wordpress-plugins/insert-php-code-snippet/" target="_blank">Facebook</a>
52
+ <a class="button" style="background-color:#00aced;color:white;margin-right:4px;margin-left:20px;margin-top: 25px;" href="http://twitter.com/share?url=http://xyzscripts.com/wordpress-plugins/insert-php-code-snippet/&text='.$sharelink_text_ips.'" target="_blank">Twitter</a>
53
+ <a class="button" style="background-color:#007bb6;color:white;margin-right:4px;margin-left:20px;margin-top: 25px;" href="http://www.linkedin.com/shareArticle?mini=true&url=http://xyzscripts.com/wordpress-plugins/insert-php-code-snippet/" target="_blank">LinkedIn</a>
54
+ <a class="button" style="background-color:#dd4b39;color:white;margin-right:4px;margin-left:20px;margin-top: 25px;" href="https://plus.google.com/share?&hl=en&url=http://xyzscripts.com/wordpress-plugins/insert-php-code-snippet/" target="_blank">google+</a>
55
+
56
+ </div>
57
+ </div>';
58
+
59
+
60
+ }
61
+
62
+ $xyz_ips_installed_date = get_option('xyz_ips_installed_date');
63
+ if ($xyz_ips_installed_date=="") {
64
+ $xyz_ips_installed_date = time();
65
+ }
66
+ if($xyz_ips_installed_date < ( time() - (30*24*60*60) ))
67
+ {
68
+ if (get_option('xyz_ips_dnt_shw_notice') != "hide")
69
+ {
70
+ add_action('admin_notices', 'wp_ips_admin_notice');
71
+ }
72
+ }
73
+ ?>
admin/ajax-backlink.php CHANGED
@@ -1,4 +1,6 @@
1
  <?php
 
 
2
  add_action('wp_ajax_ajax_backlink', 'xyz_ips_ajax_backlink');
3
  function xyz_ips_ajax_backlink() {
4
 
1
  <?php
2
+ if ( ! defined( 'ABSPATH' ) )
3
+ exit;
4
  add_action('wp_ajax_ajax_backlink', 'xyz_ips_ajax_backlink');
5
  function xyz_ips_ajax_backlink() {
6
 
admin/footer.php CHANGED
@@ -1,3 +1,10 @@
 
 
 
 
 
 
 
1
  <div style="clear: both;"></div>
2
 
3
 
@@ -77,7 +84,7 @@ function verify_fields()
77
 
78
  }
79
  </script>
80
- <?php global $current_user; get_currentuserinfo(); ?>
81
  <form action="http://xyzscripts.com/newsletter/index.php?page=list/subscribe" method="post" name="email_subscription" id="email_subscription" >
82
  <input type="hidden" name="fieldNameIds" value="1,">
83
  <input type="hidden" name="redirActive" value="http://xyzscripts.com/subscription/pending/XYZWPIPSFRE">
1
+ <?php
2
+ if ( ! defined( 'ABSPATH' ) )
3
+ exit;
4
+
5
+ ?>
6
+
7
+
8
  <div style="clear: both;"></div>
9
 
10
 
84
 
85
  }
86
  </script>
87
+ <?php global $current_user; wp_get_current_user(); ?>
88
  <form action="http://xyzscripts.com/newsletter/index.php?page=list/subscribe" method="post" name="email_subscription" id="email_subscription" >
89
  <input type="hidden" name="fieldNameIds" value="1,">
90
  <input type="hidden" name="redirActive" value="http://xyzscripts.com/subscription/pending/XYZWPIPSFRE">
admin/header.php CHANGED
@@ -1,3 +1,7 @@
 
 
 
 
1
  <style>
2
  a.xyz_header_link:hover{text-decoration:underline;}
3
  .xyz_header_link{text-decoration:none;}
@@ -9,18 +13,19 @@ if(get_option('xyz_credit_link')=="0"){
9
  ?>
10
  <div style="float:left;background-color: #FFECB3;border-radius:5px;padding: 0px 5px;margin-top: 10px;border: 1px solid #E0AB1B" id="xyz_backlink_div">
11
 
12
- Please do a favour by enabling backlink to our site. <a id="xyz_ips_backlink" style="cursor: pointer;" >Okay, Enable</a>.
13
  <script type="text/javascript">
14
 
15
  jQuery(document).ready(function() {
16
 
17
- jQuery('#xyz_ips_backlink').click(function() {
18
  var dataString = {
19
  action: 'ajax_backlink',
20
  enable: 1
21
  };
22
 
23
  jQuery.post(ajaxurl, dataString, function(response) {
 
24
  jQuery("#xyz_backlink_div").html('Thank you for enabling backlink !');
25
  jQuery("#xyz_backlink_div").css('background-color', '#D8E8DA');
26
  jQuery("#xyz_backlink_div").css('border', '1px solid #0F801C');
@@ -55,10 +60,10 @@ if(get_option('xyz_credit_link')=="0"){
55
  <a onmouseover="tooltip.show('Please help us to keep this plugin free forever by donating a dollar');" onmouseout="tooltip.hide();" class="xyz_header_link" style="margin-left:8px;margin-right:12px;" target="_blank" href="http://xyzscripts.com/donate/1">Donate</a>
56
  </td>
57
  <td style="float:right;">
58
- <a class="xyz_header_link" style="margin-left:8px;" target="_blank" href="http://kb.xyzscripts.com/category/insert-php-code-snippet/">FAQ</a>
59
  </td>
60
  <td style="float:right;">
61
- <a class="xyz_header_link" style="margin-left:8px;" target="_blank" href="http://docs.xyzscripts.com/category/insert-php-code-snippet/">Docs</a>
62
  </td>
63
  <td style="float:right;">
64
  <a class="xyz_header_link" style="margin-left:8px;" target="_blank" href="http://xyzscripts.com/wordpress-plugins/insert-php-code-snippet/details">About</a>
1
+ <?php
2
+ if ( ! defined( 'ABSPATH' ) )
3
+ exit;
4
+ ?>
5
  <style>
6
  a.xyz_header_link:hover{text-decoration:underline;}
7
  .xyz_header_link{text-decoration:none;}
13
  ?>
14
  <div style="float:left;background-color: #FFECB3;border-radius:5px;padding: 0px 5px;margin-top: 10px;border: 1px solid #E0AB1B" id="xyz_backlink_div">
15
 
16
+ Please do a favour by enabling backlink to our site. <a class="xyz_ips_backlink" style="cursor: pointer;" >Okay, Enable</a>.
17
  <script type="text/javascript">
18
 
19
  jQuery(document).ready(function() {
20
 
21
+ jQuery('.xyz_ips_backlink').click(function() {
22
  var dataString = {
23
  action: 'ajax_backlink',
24
  enable: 1
25
  };
26
 
27
  jQuery.post(ajaxurl, dataString, function(response) {
28
+ jQuery('.xyz_ips_backlink').hide();
29
  jQuery("#xyz_backlink_div").html('Thank you for enabling backlink !');
30
  jQuery("#xyz_backlink_div").css('background-color', '#D8E8DA');
31
  jQuery("#xyz_backlink_div").css('border', '1px solid #0F801C');
60
  <a onmouseover="tooltip.show('Please help us to keep this plugin free forever by donating a dollar');" onmouseout="tooltip.hide();" class="xyz_header_link" style="margin-left:8px;margin-right:12px;" target="_blank" href="http://xyzscripts.com/donate/1">Donate</a>
61
  </td>
62
  <td style="float:right;">
63
+ <a class="xyz_header_link" style="margin-left:8px;" target="_blank" href="http://help.xyzscripts.com/docs/insert-php-code-snippet/faq/">FAQ</a>
64
  </td>
65
  <td style="float:right;">
66
+ <a class="xyz_header_link" style="margin-left:8px;" target="_blank" href="http://help.xyzscripts.com/docs/insert-php-code-snippet/">Docs</a>
67
  </td>
68
  <td style="float:right;">
69
  <a class="xyz_header_link" style="margin-left:8px;" target="_blank" href="http://xyzscripts.com/wordpress-plugins/insert-php-code-snippet/details">About</a>
admin/install.php CHANGED
@@ -1,5 +1,7 @@
1
  <?php
2
-
 
 
3
  function xyz_ips_network_install($networkwide) {
4
  global $wpdb;
5
 
@@ -44,6 +46,11 @@ function xyz_ips_install(){
44
  {
45
  add_option("xyz_credit_link",0);
46
  }
 
 
 
 
 
47
 
48
  add_option('xyz_ips_limit',20);
49
  $queryInsertPhp = "CREATE TABLE IF NOT EXISTS ".$wpdb->prefix."xyz_ips_short_code (
1
  <?php
2
+ if ( ! defined( 'ABSPATH' ) )
3
+ exit;
4
+
5
  function xyz_ips_network_install($networkwide) {
6
  global $wpdb;
7
 
46
  {
47
  add_option("xyz_credit_link",0);
48
  }
49
+ $xyz_ips_installed_date = get_option('xyz_ips_installed_date');
50
+ if ($xyz_ips_installed_date=="") {
51
+ $xyz_ips_installed_date = time();
52
+ update_option('xyz_ips_installed_date', $xyz_ips_installed_date);
53
+ }
54
 
55
  add_option('xyz_ips_limit',20);
56
  $queryInsertPhp = "CREATE TABLE IF NOT EXISTS ".$wpdb->prefix."xyz_ips_short_code (
admin/menu.php CHANGED
@@ -1,5 +1,7 @@
1
  <?php
2
-
 
 
3
  add_action('admin_menu', 'xyz_ips_menu');
4
 
5
 
1
  <?php
2
+ if ( ! defined( 'ABSPATH' ) )
3
+ exit;
4
+
5
  add_action('admin_menu', 'xyz_ips_menu');
6
 
7
 
admin/settings.php CHANGED
@@ -1,10 +1,33 @@
1
  <?php
 
 
2
 
3
  global $wpdb;
4
  // Load the options
5
-
6
-
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
7
  if($_POST){
 
 
 
 
 
 
8
 
9
  $_POST=xyz_trim_deep($_POST);
10
  $_POST = stripslashes_deep($_POST);
@@ -13,18 +36,19 @@ if($_POST){
13
  if($xyz_ips_limit==0)$xyz_ips_limit=20;
14
 
15
  $xyz_ips_credit = $_POST['xyz_ips_credit'];
 
 
16
 
17
- $xyz_ips_sortfield=$_POST['xyz_ips_sort_by_field'];
18
- $xyz_ips_sortorder=$_POST['xyz_ips_sort_by_order'];
19
-
20
- update_option('xyz_ips_limit',$xyz_ips_limit);
21
- update_option('xyz_credit_link',$xyz_ips_credit);
22
-
23
-
24
  update_option('xyz_ips_sort_field_name',$xyz_ips_sortfield);
25
- update_option('xyz_ips_sort_order',$xyz_ips_sortorder);
26
 
 
 
 
27
 
 
 
28
  ?>
29
 
30
  <div class="system_notice_area_style1" id="system_notice_area">
@@ -32,7 +56,7 @@ if($_POST){
32
  </div>
33
  <?php
34
  }
35
-
36
 
37
  ?>
38
 
@@ -40,6 +64,7 @@ if($_POST){
40
 
41
 
42
  <form method="post">
 
43
  <div style="float: left;width: 98%">
44
  <fieldset style=" width:100%; border:1px solid #F7F7F7; padding:10px 0px 15px 10px;">
45
  <legend ><h3>Settings</h3></legend>
@@ -67,9 +92,9 @@ if($_POST){
67
  </td>
68
  <td><select name="xyz_ips_credit" id="xyz_ips_credit">
69
  <option value="ips"
70
- <?php if(isset($_POST['xyz_ips_credit']) && $_POST['xyz_ips_credit']=='ips') { echo 'selected';}elseif(get_option('xyz_credit_link')=="ips"){echo 'selected';} ?>>Enable</option>
71
  <option value="0"
72
- <?php if(isset($_POST['xyz_ips_credit']) && $_POST['xyz_ips_credit']!='ips') { echo 'selected';}elseif(get_option('xyz_credit_link')!="ips"){echo 'selected';} ?>>Disable</option>
73
 
74
  </select>
75
  </td>
1
  <?php
2
+ if ( ! defined( 'ABSPATH' ) )
3
+ exit;
4
 
5
  global $wpdb;
6
  // Load the options
7
+ if(isset($_GET['ips_notice'])&& $_GET['ips_notice'] == 'hide')
8
+ {
9
+ update_option('xyz_ips_dnt_shw_notice', "hide");
10
+ ?>
11
+ <style type='text/css'>
12
+ #ips_notice_td
13
+ {
14
+ display:none;
15
+ }
16
+ </style>
17
+ <div class="system_notice_area_style1" id="system_notice_area">
18
+ Thanks again for using the plugin. We will never show the message again.
19
+ &nbsp;&nbsp;&nbsp;<span
20
+ id="system_notice_area_dismiss">Dismiss</span>
21
+ </div>
22
+ <?php
23
+ }
24
  if($_POST){
25
+
26
+ if (! isset( $_REQUEST['_wpnonce'] ) || ! wp_verify_nonce( $_REQUEST['_wpnonce'], 'snipp-psetting_' )) {
27
+ wp_nonce_ays( 'snipp-psetting_' );
28
+ exit;
29
+ }
30
+ else {
31
 
32
  $_POST=xyz_trim_deep($_POST);
33
  $_POST = stripslashes_deep($_POST);
36
  if($xyz_ips_limit==0)$xyz_ips_limit=20;
37
 
38
  $xyz_ips_credit = $_POST['xyz_ips_credit'];
39
+ if(($xyz_ips_credit=="ips")||($xyz_ips_credit==0))
40
+ update_option('xyz_credit_link',$xyz_ips_credit);
41
 
42
+ $xyz_ips_sortfield=$_POST['xyz_ips_sort_by_field'];
43
+ if(($xyz_ips_sortfield=="id")||($xyz_ips_sortfield=="title"))
 
 
 
 
 
44
  update_option('xyz_ips_sort_field_name',$xyz_ips_sortfield);
 
45
 
46
+ $xyz_ips_sortorder=$_POST['xyz_ips_sort_by_order'];
47
+ if(($xyz_ips_sortorder=="asc")||($xyz_ips_sortorder=="desc"))
48
+ update_option('xyz_ips_sort_order',$xyz_ips_sortorder);
49
 
50
+ update_option('xyz_ips_limit',$xyz_ips_limit);
51
+
52
  ?>
53
 
54
  <div class="system_notice_area_style1" id="system_notice_area">
56
  </div>
57
  <?php
58
  }
59
+ }
60
 
61
  ?>
62
 
64
 
65
 
66
  <form method="post">
67
+ <?php wp_nonce_field('snipp-psetting_');?>
68
  <div style="float: left;width: 98%">
69
  <fieldset style=" width:100%; border:1px solid #F7F7F7; padding:10px 0px 15px 10px;">
70
  <legend ><h3>Settings</h3></legend>
92
  </td>
93
  <td><select name="xyz_ips_credit" id="xyz_ips_credit">
94
  <option value="ips"
95
+ <?php selected(get_option('xyz_credit_link'),"ips"); ?>>Enable</option>
96
  <option value="0"
97
+ <?php if(get_option('xyz_credit_link')!="ips"){echo 'selected';} ?>>Disable</option>
98
 
99
  </select>
100
  </td>
admin/snippet-add.php CHANGED
@@ -1,4 +1,6 @@
1
  <?php
 
 
2
 
3
  global $wpdb;
4
 
@@ -7,49 +9,49 @@ $_POST = xyz_trim_deep($_POST);
7
 
8
  if(isset($_POST) && isset($_POST['addSubmit'])){
9
 
10
- // echo '<pre>';
11
- // print_r($_POST);
12
- // die("JJJ");
13
-
14
- $temp_xyz_ips_title = str_replace(' ', '', $_POST['snippetTitle']);
15
- $temp_xyz_ips_title = str_replace('-', '', $temp_xyz_ips_title);
16
-
17
- $xyz_ips_title = str_replace(' ', '-', $_POST['snippetTitle']);
18
-
19
-
20
- $xyz_ips_content = $_POST['snippetContent'];
21
-
22
- if($xyz_ips_title != "" && $xyz_ips_content != ""){
23
- if(ctype_alnum($temp_xyz_ips_title)){
24
-
25
- $snippet_count = $wpdb->query($wpdb->prepare( 'SELECT * FROM '.$wpdb->prefix.'xyz_ips_short_code WHERE title=%s',$xyz_ips_title) ) ;
26
- if($snippet_count == 0){
27
- $xyz_shortCode = '[xyz-ips snippet="'.$xyz_ips_title.'"]';
28
- $wpdb->insert($wpdb->prefix.'xyz_ips_short_code', array('title' =>$xyz_ips_title,'content'=>$xyz_ips_content,'short_code'=>$xyz_shortCode,'status'=>'1'),array('%s','%s','%s','%d'));
29
-
30
- header("Location:".admin_url('admin.php?page=insert-php-code-snippet-manage&xyz_ips_msg=1'));
 
 
 
 
 
31
  }else{
32
- ?>
33
- <div class="system_notice_area_style0" id="system_notice_area">
34
- PHP Snippet already exists. &nbsp;&nbsp;&nbsp;<span id="system_notice_area_dismiss">Dismiss</span>
35
- </div>
36
- <?php
 
37
  }
38
  }else{
39
- ?>
40
- <div class="system_notice_area_style0" id="system_notice_area">
41
- PHP Snippet title can have only alphabets,numbers or hyphen. &nbsp;&nbsp;&nbsp;<span id="system_notice_area_dismiss">Dismiss</span>
42
- </div>
43
- <?php
44
- }
45
- }else{
46
  ?>
47
- <div class="system_notice_area_style0" id="system_notice_area">
48
- Fill all mandatory fields. &nbsp;&nbsp;&nbsp;<span id="system_notice_area_dismiss">Dismiss</span>
49
- </div>
 
50
  <?php
 
51
  }
52
-
53
  }
54
 
55
  ?>
@@ -61,13 +63,18 @@ if(isset($_POST) && isset($_POST['addSubmit'])){
61
  <b>Add PHP Snippet</b>
62
  </legend>
63
  <form name="frmmainForm" id="frmmainForm" method="post">
64
-
65
  <div>
66
  <table
67
- style="width: 99%; background-color: #F9F9F9; border: 1px solid #E4E4E4; border-width: 1px;margin: 0 auto">
68
- <tr><td><br/>
69
- <div id="shortCode"></div>
70
- <br/></td></tr>
 
 
 
 
 
71
  <tr valign="top">
72
  <td style="border-bottom: none;width:20%;">&nbsp;&nbsp;&nbsp;Tracking Name&nbsp;<font color="red">*</font></td>
73
  <td style="border-bottom: none;width:1px;">&nbsp;:&nbsp;</td>
1
  <?php
2
+ if ( ! defined( 'ABSPATH' ) )
3
+ exit;
4
 
5
  global $wpdb;
6
 
9
 
10
  if(isset($_POST) && isset($_POST['addSubmit'])){
11
 
12
+ if (
13
+ ! isset( $_REQUEST['_wpnonce'] )
14
+ || ! wp_verify_nonce( $_REQUEST['_wpnonce'], 'snipp-padd_' )
15
+ ) {
16
+ wp_nonce_ays( 'snipp-padd_' );
17
+ exit;
18
+ } else {
19
+ $temp_xyz_ips_title = str_replace(' ', '', $_POST['snippetTitle']);
20
+ $temp_xyz_ips_title = str_replace('-', '', $temp_xyz_ips_title);
21
+ $xyz_ips_title = str_replace(' ', '-', $_POST['snippetTitle']);
22
+ $xyz_ips_content = $_POST['snippetContent'];
23
+ if($xyz_ips_title != "" && $xyz_ips_content != ""){
24
+ if(ctype_alnum($temp_xyz_ips_title)){
25
+ $snippet_count = $wpdb->query($wpdb->prepare( 'SELECT * FROM '.$wpdb->prefix.'xyz_ips_short_code WHERE title=%s',$xyz_ips_title) ) ;
26
+ if($snippet_count == 0){
27
+ $xyz_shortCode = '[xyz-ips snippet="'.$xyz_ips_title.'"]';
28
+ $wpdb->insert($wpdb->prefix.'xyz_ips_short_code', array('title' =>$xyz_ips_title,'content'=>$xyz_ips_content,'short_code'=>$xyz_shortCode,'status'=>'1'),array('%s','%s','%s','%d'));
29
+ header("Location:".admin_url('admin.php?page=insert-php-code-snippet-manage&xyz_ips_msg=1'));
30
+ }else{
31
+ ?>
32
+ <div class="system_notice_area_style0" id="system_notice_area">
33
+ PHP Snippet already exists. &nbsp;&nbsp;&nbsp;
34
+ <span id="system_notice_area_dismiss">Dismiss</span>
35
+ </div>
36
+ <?php
37
+ }
38
  }else{
39
+ ?>
40
+ <div class="system_notice_area_style0" id="system_notice_area">
41
+ PHP Snippet title can have only alphabets,numbers or hyphen. &nbsp;&nbsp;&nbsp;
42
+ <span id="system_notice_area_dismiss">Dismiss</span>
43
+ </div>
44
+ <?php
45
  }
46
  }else{
 
 
 
 
 
 
 
47
  ?>
48
+ <div class="system_notice_area_style0" id="system_notice_area">
49
+ Fill all mandatory fields. &nbsp;&nbsp;&nbsp;
50
+ <span id="system_notice_area_dismiss">Dismiss</span>
51
+ </div>
52
  <?php
53
+ }
54
  }
 
55
  }
56
 
57
  ?>
63
  <b>Add PHP Snippet</b>
64
  </legend>
65
  <form name="frmmainForm" id="frmmainForm" method="post">
66
+ <?php wp_nonce_field('snipp-padd_'); ?>
67
  <div>
68
  <table
69
+ style="width: 99%; background-color: #F9F9F9; border: 1px solid #E4E4E4; border-width: 1px;margin: 0 auto">
70
+ <tr>
71
+ <td>
72
+ <br/>
73
+ <div id="shortCode">
74
+ </div>
75
+ <br/>
76
+ </td>
77
+ </tr>
78
  <tr valign="top">
79
  <td style="border-bottom: none;width:20%;">&nbsp;&nbsp;&nbsp;Tracking Name&nbsp;<font color="red">*</font></td>
80
  <td style="border-bottom: none;width:1px;">&nbsp;:&nbsp;</td>
admin/snippet-delete.php CHANGED
@@ -1,4 +1,7 @@
1
  <?php
 
 
 
2
  global $wpdb;
3
 
4
  $_POST = stripslashes_deep($_POST);
@@ -7,6 +10,12 @@ $_GET = stripslashes_deep($_GET);
7
  $xyz_ips_snippetId = intval($_GET['snippetId']);
8
  $xyz_ips_pageno = intval($_GET['pageno']);
9
 
 
 
 
 
 
 
10
  if($xyz_ips_snippetId=="" || !is_numeric($xyz_ips_snippetId)){
11
  header("Location:".admin_url('admin.php?page=insert-php-code-snippet-manage'));
12
  exit();
@@ -23,6 +32,6 @@ if($snippetCount==0){
23
 
24
  header("Location:".admin_url('admin.php?page=insert-php-code-snippet-manage&xyz_ips_msg=3&pagenum='.$xyz_ips_pageno));
25
  exit();
26
-
27
  }
28
  ?>
1
  <?php
2
+ if ( ! defined( 'ABSPATH' ) )
3
+ exit;
4
+
5
  global $wpdb;
6
 
7
  $_POST = stripslashes_deep($_POST);
10
  $xyz_ips_snippetId = intval($_GET['snippetId']);
11
  $xyz_ips_pageno = intval($_GET['pageno']);
12
 
13
+
14
+ if (! isset( $_REQUEST['_wpnonce'] ) || ! wp_verify_nonce( $_REQUEST['_wpnonce'], 'snipp-pdel_'.$xyz_ips_snippetId )) {
15
+ wp_nonce_ays( 'snipp-pdel_'.$xyz_ips_snippetId );
16
+ exit;
17
+ }
18
+ else{
19
  if($xyz_ips_snippetId=="" || !is_numeric($xyz_ips_snippetId)){
20
  header("Location:".admin_url('admin.php?page=insert-php-code-snippet-manage'));
21
  exit();
32
 
33
  header("Location:".admin_url('admin.php?page=insert-php-code-snippet-manage&xyz_ips_msg=3&pagenum='.$xyz_ips_pageno));
34
  exit();
35
+ }
36
  }
37
  ?>
admin/snippet-edit.php CHANGED
@@ -1,8 +1,10 @@
1
  <?php
 
 
2
 
3
  global $wpdb;
4
  global $current_user;
5
- get_currentuserinfo();
6
 
7
  $xyz_ips_snippetId = $_GET['snippetId'];
8
 
@@ -26,6 +28,12 @@ if(isset($_POST) && isset($_POST['updateSubmit'])){
26
  // echo '<pre>';
27
  // print_r($_POST);
28
  // die("JJJ");
 
 
 
 
 
 
29
  $_POST = stripslashes_deep($_POST);
30
  $_POST = xyz_trim_deep($_POST);
31
 
@@ -80,7 +88,7 @@ if(isset($_POST) && isset($_POST['updateSubmit'])){
80
 
81
  }
82
 
83
-
84
  global $wpdb;
85
 
86
 
@@ -96,6 +104,7 @@ $snippetDetails = $snippetDetails[0];
96
  <b>Edit PHP Snippet</b>
97
  </legend>
98
  <form name="frmmainForm" id="frmmainForm" method="post">
 
99
  <input type="hidden" id="snippetId" name="snippetId"
100
  value="<?php if(isset($_POST['snippetId'])){ echo esc_attr($_POST['snippetId']);}else{ echo esc_attr($snippetDetails->id); }?>">
101
  <div>
1
  <?php
2
+ if ( ! defined( 'ABSPATH' ) )
3
+ exit;
4
 
5
  global $wpdb;
6
  global $current_user;
7
+ wp_get_current_user();
8
 
9
  $xyz_ips_snippetId = $_GET['snippetId'];
10
 
28
  // echo '<pre>';
29
  // print_r($_POST);
30
  // die("JJJ");
31
+ if (! isset( $_REQUEST['_wpnonce'] ) || ! wp_verify_nonce( $_REQUEST['_wpnonce'], 'snipp-pedit_'.$xyz_ips_snippetId )) {
32
+ wp_nonce_ays( 'snipp-pedit_'.$xyz_ips_snippetId );
33
+ exit;
34
+ }
35
+
36
+ else {
37
  $_POST = stripslashes_deep($_POST);
38
  $_POST = xyz_trim_deep($_POST);
39
 
88
 
89
  }
90
 
91
+ }
92
  global $wpdb;
93
 
94
 
104
  <b>Edit PHP Snippet</b>
105
  </legend>
106
  <form name="frmmainForm" id="frmmainForm" method="post">
107
+ <?php wp_nonce_field( 'snipp-pedit_'.$xyz_ips_snippetId ); ?>
108
  <input type="hidden" id="snippetId" name="snippetId"
109
  value="<?php if(isset($_POST['snippetId'])){ echo esc_attr($_POST['snippetId']);}else{ echo esc_attr($snippetDetails->id); }?>">
110
  <div>
admin/snippet-status.php CHANGED
@@ -1,5 +1,6 @@
1
  <?php
2
-
 
3
  global $wpdb;
4
 
5
  $_POST = stripslashes_deep($_POST);
@@ -8,6 +9,13 @@ $_GET = stripslashes_deep($_GET);
8
  $xyz_ips_snippetId = intval($_GET['snippetId']);
9
  $xyz_ips_snippetStatus = intval($_GET['status']);
10
  $xyz_ips_pageno = intval($_GET['pageno']);
 
 
 
 
 
 
 
11
  if($xyz_ips_snippetId=="" || !is_numeric($xyz_ips_snippetId)){
12
  header("Location:".admin_url('admin.php?page=insert-php-code-snippet-manage'));
13
  exit();
@@ -24,6 +32,6 @@ if($snippetCount==0){
24
  $wpdb->update($wpdb->prefix.'xyz_ips_short_code', array('status'=>$xyz_ips_snippetStatus), array('id'=>$xyz_ips_snippetId));
25
  header("Location:".admin_url('admin.php?page=insert-php-code-snippet-manage&xyz_ips_msg=4&pagenum='.$xyz_ips_pageno));
26
  exit();
27
-
28
  }
29
  ?>
1
  <?php
2
+ if ( ! defined( 'ABSPATH' ) )
3
+ exit;
4
  global $wpdb;
5
 
6
  $_POST = stripslashes_deep($_POST);
9
  $xyz_ips_snippetId = intval($_GET['snippetId']);
10
  $xyz_ips_snippetStatus = intval($_GET['status']);
11
  $xyz_ips_pageno = intval($_GET['pageno']);
12
+
13
+
14
+ if (! isset( $_REQUEST['_wpnonce'] ) || ! wp_verify_nonce( $_REQUEST['_wpnonce'], 'snipp-stat_'.$xyz_ips_snippetId )) {
15
+ wp_nonce_ays( 'snipp-pstat_'.$xyz_ips_snippetId );
16
+ exit;
17
+ }
18
+ else {
19
  if($xyz_ips_snippetId=="" || !is_numeric($xyz_ips_snippetId)){
20
  header("Location:".admin_url('admin.php?page=insert-php-code-snippet-manage'));
21
  exit();
32
  $wpdb->update($wpdb->prefix.'xyz_ips_short_code', array('status'=>$xyz_ips_snippetStatus), array('id'=>$xyz_ips_snippetId));
33
  header("Location:".admin_url('admin.php?page=insert-php-code-snippet-manage&xyz_ips_msg=4&pagenum='.$xyz_ips_pageno));
34
  exit();
35
+ }
36
  }
37
  ?>
admin/snippets.php CHANGED
@@ -1,4 +1,7 @@
1
  <?php
 
 
 
2
  global $wpdb;
3
  $_GET = stripslashes_deep($_GET);
4
  $xyz_ips_message = '';
@@ -122,18 +125,20 @@ id="system_notice_area_dismiss">Dismiss</span>
122
  </td>
123
  <?php
124
  if($entry->status == 2){
 
125
  ?>
126
  <td style="text-align: center;"><a
127
- href='<?php echo admin_url('admin.php?page=insert-php-code-snippet-manage&action=snippet-status&snippetId='.$entry->id.'&status=1&pageno='.$pagenum); ?>'><img
128
  id="img" title="Activate"
129
  src="<?php echo plugins_url('insert-php-code-snippet/images/activate.png')?>">
130
  </a>
131
  </td>
132
  <?php
133
  }elseif ($entry->status == 1){
 
134
  ?>
135
  <td style="text-align: center;"><a
136
- href='<?php echo admin_url('admin.php?page=insert-php-code-snippet-manage&action=snippet-status&snippetId='.$entry->id.'&status=2&pageno='.$pagenum); ?>'><img
137
  id="img" title="Deactivate"
138
  src="<?php echo plugins_url('insert-php-code-snippet/images/pause.png')?>">
139
  </a>
@@ -149,8 +154,10 @@ id="system_notice_area_dismiss">Dismiss</span>
149
  src="<?php echo plugins_url('insert-php-code-snippet/images/edit.png')?>">
150
  </a>
151
  </td>
 
 
152
  <td style="text-align: center;" ><a
153
- href='<?php echo admin_url('admin.php?page=insert-php-code-snippet-manage&action=snippet-delete&snippetId='.$entry->id.'&pageno='.$pagenum); ?>'
154
  onclick="javascript: return confirm('Please click \'OK\' to confirm ');"><img
155
  id="img" title="Delete Snippet"
156
  src="<?php echo plugins_url('insert-php-code-snippet/images/delete.png')?>">
1
  <?php
2
+ if ( ! defined( 'ABSPATH' ) )
3
+ exit;
4
+
5
  global $wpdb;
6
  $_GET = stripslashes_deep($_GET);
7
  $xyz_ips_message = '';
125
  </td>
126
  <?php
127
  if($entry->status == 2){
128
+ $stat1 = admin_url('admin.php?page=insert-php-code-snippet-manage&action=snippet-status&snippetId='.$entry->id.'&status=1&pageno='.$pagenum);
129
  ?>
130
  <td style="text-align: center;"><a
131
+ href='<?php echo wp_nonce_url($stat1,'snipp-pstat_'.$entry->id); ?>'><img
132
  id="img" title="Activate"
133
  src="<?php echo plugins_url('insert-php-code-snippet/images/activate.png')?>">
134
  </a>
135
  </td>
136
  <?php
137
  }elseif ($entry->status == 1){
138
+ $stat2 = admin_url('admin.php?page=insert-php-code-snippet-manage&action=snippet-status&snippetId='.$entry->id.'&status=2&pageno='.$pagenum);
139
  ?>
140
  <td style="text-align: center;"><a
141
+ href='<?php echo wp_nonce_url($stat2,'snipp-pstat_'.$entry->id); ?>'><img
142
  id="img" title="Deactivate"
143
  src="<?php echo plugins_url('insert-php-code-snippet/images/pause.png')?>">
144
  </a>
154
  src="<?php echo plugins_url('insert-php-code-snippet/images/edit.png')?>">
155
  </a>
156
  </td>
157
+
158
+ <?php $delurl = admin_url('admin.php?page=insert-php-code-snippet-manage&action=snippet-delete&snippetId='.$entry->id.'&pageno='.$pagenum);?>
159
  <td style="text-align: center;" ><a
160
+ href='<?php echo wp_nonce_url($delurl,'snipp-pdel_'.$entry->id); ?>'
161
  onclick="javascript: return confirm('Please click \'OK\' to confirm ');"><img
162
  id="img" title="Delete Snippet"
163
  src="<?php echo plugins_url('insert-php-code-snippet/images/delete.png')?>">
admin/uninstall.php CHANGED
@@ -1,4 +1,6 @@
1
  <?php
 
 
2
 
3
  function xyz_ips_network_uninstall($networkwide) {
4
  global $wpdb;
@@ -26,6 +28,7 @@ global $wpdb;
26
  delete_option("xyz_ips_sort_order");
27
  delete_option("xyz_ips_sort_field_name");
28
  delete_option("xyz_ips_limit");
 
29
 
30
  /* table delete*/
31
  $wpdb->query("DROP TABLE ".$wpdb->prefix."xyz_ips_short_code");
1
  <?php
2
+ if ( ! defined( 'ABSPATH' ) )
3
+ exit;
4
 
5
  function xyz_ips_network_uninstall($networkwide) {
6
  global $wpdb;
28
  delete_option("xyz_ips_sort_order");
29
  delete_option("xyz_ips_sort_field_name");
30
  delete_option("xyz_ips_limit");
31
+ delete_option("xyz_ips_installed_date");
32
 
33
  /* table delete*/
34
  $wpdb->query("DROP TABLE ".$wpdb->prefix."xyz_ips_short_code");
ajax-handler.php CHANGED
@@ -1,5 +1,7 @@
1
  <?php
2
-
 
 
3
  require_once( dirname( __FILE__ ) . '/admin/ajax-backlink.php' );
4
 
5
  ?>
1
  <?php
2
+ if ( ! defined( 'ABSPATH' ) )
3
+ exit;
4
+
5
  require_once( dirname( __FILE__ ) . '/admin/ajax-backlink.php' );
6
 
7
  ?>
css/xyz_ips_styles.css CHANGED
File without changes
direct_call.php CHANGED
@@ -1,4 +1,7 @@
1
  <?php
 
 
 
2
  function xyz_ips_plugin_query_vars($vars) {
3
  $vars[] = 'wp_ips';
4
  return $vars;
1
  <?php
2
+ if ( ! defined( 'ABSPATH' ) )
3
+ exit;
4
+
5
  function xyz_ips_plugin_query_vars($vars) {
6
  $vars[] = 'wp_ips';
7
  return $vars;
editor_plugin.js.php CHANGED
@@ -1,4 +1,7 @@
1
  <?php
 
 
 
2
  header( 'Content-Type: text/javascript' );
3
  if ( ! is_user_logged_in() )
4
  die('You must be logged in to access this script.');
1
  <?php
2
+ if ( ! defined( 'ABSPATH' ) )
3
+ exit;
4
+
5
  header( 'Content-Type: text/javascript' );
6
  if ( ! is_user_logged_in() )
7
  die('You must be logged in to access this script.');
images/activate.png CHANGED
File without changes
images/delete.png CHANGED
File without changes
images/edit.png CHANGED
File without changes
images/facebook.png CHANGED
File without changes
images/gplus.png CHANGED
File without changes
images/linkedin.png CHANGED
File without changes
images/logo.png CHANGED
File without changes
images/pause.png CHANGED
File without changes
images/suggest.png CHANGED
File without changes
images/support.png CHANGED
File without changes
images/twitter.png CHANGED
File without changes
images/xyz_logo.png CHANGED
File without changes
insert-php-code-snippet.php CHANGED
@@ -3,7 +3,7 @@
3
  Plugin Name: Insert PHP Code Snippet
4
  Plugin URI: http://xyzscripts.com/wordpress-plugins/insert-php-code-snippet/
5
  Description: Insert and run PHP code in your pages and posts easily using shortcodes. This plugin lets you create a shortcode corresponding to any random PHP code and use the same in your posts, pages or widgets.
6
- Version: 1.2
7
  Author: xyzscripts.com
8
  Author URI: http://xyzscripts.com/
9
  Text Domain: insert-php-code-snippet
@@ -30,6 +30,8 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
30
  // echo "Hi there! I'm just a plugin, not much I can do when called directly.";
31
  // exit;
32
  // }
 
 
33
 
34
  ob_start();
35
 
@@ -55,7 +57,7 @@ require( dirname( __FILE__ ) . '/widget.php' );
55
 
56
  require( dirname( __FILE__ ) . '/direct_call.php' );
57
 
58
-
59
 
60
  if(get_option('xyz_credit_link')=="ips"){
61
 
3
  Plugin Name: Insert PHP Code Snippet
4
  Plugin URI: http://xyzscripts.com/wordpress-plugins/insert-php-code-snippet/
5
  Description: Insert and run PHP code in your pages and posts easily using shortcodes. This plugin lets you create a shortcode corresponding to any random PHP code and use the same in your posts, pages or widgets.
6
+ Version: 1.2.1
7
  Author: xyzscripts.com
8
  Author URI: http://xyzscripts.com/
9
  Text Domain: insert-php-code-snippet
30
  // echo "Hi there! I'm just a plugin, not much I can do when called directly.";
31
  // exit;
32
  // }
33
+ if ( ! defined( 'ABSPATH' ) )
34
+ exit;
35
 
36
  ob_start();
37
 
57
 
58
  require( dirname( __FILE__ ) . '/direct_call.php' );
59
 
60
+ require_once( dirname( __FILE__ ) . '/admin/admin-notices.php' );
61
 
62
  if(get_option('xyz_credit_link')=="ips"){
63
 
js/notice.js CHANGED
File without changes
readme.txt CHANGED
@@ -4,8 +4,8 @@ Donate link: http://xyzscripts.com/donate/
4
 
5
  Tags: insert PHP, add PHP, insert PHP code, insert PHP tag, insert PHP snippet, insert PHP code snippet , insert PHP snippet, add PHP code, insert PHP tag, add PHP snippet, add PHP code snippet, integrate PHP codes, raw PHP, embed PHP, PHP inserter, PHP code inserter, PHP snippet inserter
6
  Requires at least: 2.8
7
- Tested up to: 4.3
8
- Stable tag: 1.2
9
  License: GPLv2 or later
10
 
11
  Add PHP code to your pages and posts easily using shortcodes.
@@ -29,13 +29,13 @@ The shortcodes generated using the plugin are easily available as a dropdown in
29
 
30
  Insert PHP Code Snippet is developed and maintained by [XYZScripts](http://xyzscripts.com/ "xyzscripts.com"). For any support, you may [contact us](http://xyzscripts.com/support/ "XYZScripts Support").
31
 
32
- ★ [Insert PHP Code Snippet User Guide](http://docs.xyzscripts.com/wordpress-plugins/insert-php-code-snippet/ "Insert PHP Code Snippet User Guide")
33
- ★ [Insert PHP Code Snippet FAQ](http://kb.xyzscripts.com/wordpress-plugins/insert-php-code-snippet/ "Insert PHP Code Snippet FAQ")
34
 
35
  == Installation ==
36
 
37
- ★ [Insert PHP Code Snippet User Guide](http://docs.xyzscripts.com/wordpress-plugins/insert-php-code-snippet/ "Insert PHP Code Snippet User Guide")
38
- ★ [Insert PHP Code Snippet FAQ](http://kb.xyzscripts.com/wordpress-plugins/insert-php-code-snippet/ "Insert PHP Code Snippet FAQ")
39
 
40
  1. Extract `insert-php-code-snippet.zip` to your `/wp-content/plugins/` directory.
41
  2. In the admin panel under plugins activate Insert PHP Code Snippet.
@@ -44,8 +44,8 @@ If you need any further help, you may contact our [support desk](http://xyzscrip
44
 
45
  == Frequently Asked Questions ==
46
 
47
- ★ [Insert PHP Code Snippet User Guide](http://docs.xyzscripts.com/wordpress-plugins/insert-php-code-snippet/ "Insert PHP Code Snippet User Guide")
48
- ★ [Insert PHP Code Snippet FAQ](http://kb.xyzscripts.com/wordpress-plugins/insert-php-code-snippet/ "Insert PHP Code Snippet FAQ")
49
 
50
  = 1. The Insert PHP Code Snippet is not working properly. =
51
 
@@ -66,6 +66,9 @@ More questions ? [Drop a mail](http://xyzscripts.com/members/support/ "XYZScript
66
 
67
 
68
  == Changelog ==
 
 
 
69
 
70
  = 1.2 =
71
  * Compatibility with wordpress 4.3
@@ -84,8 +87,8 @@ More questions ? [Drop a mail](http://xyzscripts.com/members/support/ "XYZScript
84
 
85
  == More Information ==
86
 
87
- ★ [Insert PHP Code Snippet User Guide](http://docs.xyzscripts.com/wordpress-plugins/insert-php-code-snippet/ "Insert PHP Code Snippet User Guide")
88
- ★ [Insert PHP Code Snippet FAQ](http://kb.xyzscripts.com/wordpress-plugins/insert-php-code-snippet/ "Insert PHP Code Snippet FAQ")
89
 
90
  = Troubleshooting =
91
 
4
 
5
  Tags: insert PHP, add PHP, insert PHP code, insert PHP tag, insert PHP snippet, insert PHP code snippet , insert PHP snippet, add PHP code, insert PHP tag, add PHP snippet, add PHP code snippet, integrate PHP codes, raw PHP, embed PHP, PHP inserter, PHP code inserter, PHP snippet inserter
6
  Requires at least: 2.8
7
+ Tested up to: 4.7
8
+ Stable tag: 1.2.1
9
  License: GPLv2 or later
10
 
11
  Add PHP code to your pages and posts easily using shortcodes.
29
 
30
  Insert PHP Code Snippet is developed and maintained by [XYZScripts](http://xyzscripts.com/ "xyzscripts.com"). For any support, you may [contact us](http://xyzscripts.com/support/ "XYZScripts Support").
31
 
32
+ ★ [Insert PHP Code Snippet User Guide](http://help.xyzscripts.com/docs/insert-php-code-snippet/"Insert PHP Code Snippet User Guide")
33
+ ★ [Insert PHP Code Snippet FAQ](http://help.xyzscripts.com/docs/insert-php-code-snippet/faq/"Insert PHP Code Snippet FAQ")
34
 
35
  == Installation ==
36
 
37
+ ★ [Insert PHP Code Snippet User Guide](http://help.xyzscripts.com/docs/insert-php-code-snippet/ "Insert PHP Code Snippet User Guide")
38
+ ★ [Insert PHP Code Snippet FAQ](http://help.xyzscripts.com/docs/insert-php-code-snippet/faq/ "Insert PHP Code Snippet FAQ")
39
 
40
  1. Extract `insert-php-code-snippet.zip` to your `/wp-content/plugins/` directory.
41
  2. In the admin panel under plugins activate Insert PHP Code Snippet.
44
 
45
  == Frequently Asked Questions ==
46
 
47
+ ★ [Insert PHP Code Snippet User Guide](http://help.xyzscripts.com/docs/insert-php-code-snippet/"Insert PHP Code Snippet User Guide")
48
+ ★ [Insert PHP Code Snippet FAQ](http://help.xyzscripts.com/docs/insert-php-code-snippet/faq/"Insert PHP Code Snippet FAQ")
49
 
50
  = 1. The Insert PHP Code Snippet is not working properly. =
51
 
66
 
67
 
68
  == Changelog ==
69
+ = 1.2.1 =
70
+ * Nonces Added.
71
+ * A few bug fixes.
72
 
73
  = 1.2 =
74
  * Compatibility with wordpress 4.3
87
 
88
  == More Information ==
89
 
90
+ ★ [Insert PHP Code Snippet User Guide](http://help.xyzscripts.com/docs/insert-php-code-snippet/"Insert PHP Code Snippet User Guide")
91
+ ★ [Insert PHP Code Snippet FAQ](http://help.xyzscripts.com/docs/insert-php-code-snippet/faq/"Insert PHP Code Snippet FAQ")
92
 
93
  = Troubleshooting =
94
 
shortcode-handler.php CHANGED
@@ -1,4 +1,7 @@
1
  <?php
 
 
 
2
  global $wpdb;
3
 
4
  add_shortcode('xyz-ips','xyz_ips_display_content');
1
  <?php
2
+ if ( ! defined( 'ABSPATH' ) )
3
+ exit;
4
+
5
  global $wpdb;
6
 
7
  add_shortcode('xyz-ips','xyz_ips_display_content');
widget.php CHANGED
@@ -1,5 +1,6 @@
1
  <?php
2
-
 
3
  /**
4
  * XYZScripts Insert PHP Snippet Widget Class
5
  */
@@ -10,7 +11,7 @@ class Xyz_Insert_Php_Widget extends WP_Widget {
10
 
11
 
12
  /** constructor -- name this the same as the class above */
13
- function Xyz_Insert_Php_Widget() {
14
  parent::__construct(false, $name = 'Insert PHP Snippet');
15
  }
16
 
1
  <?php
2
+ if ( ! defined( 'ABSPATH' ) )
3
+ exit;
4
  /**
5
  * XYZScripts Insert PHP Snippet Widget Class
6
  */
11
 
12
 
13
  /** constructor -- name this the same as the class above */
14
+ function __construct() {
15
  parent::__construct(false, $name = 'Insert PHP Snippet');
16
  }
17
 
xyz-functions.php CHANGED
@@ -1,5 +1,7 @@
1
  <?php
2
-
 
 
3
  if(!function_exists('xyz_ips_plugin_get_version'))
4
  {
5
  function xyz_ips_plugin_get_version()
1
  <?php
2
+ if ( ! defined( 'ABSPATH' ) )
3
+ exit;
4
+
5
  if(!function_exists('xyz_ips_plugin_get_version'))
6
  {
7
  function xyz_ips_plugin_get_version()