Insert Html Snippet - Version 1.2.1

Version Description

  • A few bug fixes.
Download this release

Release Info

Developer f1logic
Plugin Icon 128x128 Insert Html 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_Html_TinyMCESelector')):
4
-
5
- class XYZ_Insert_Html_TinyMCESelector{
6
- var $buttonName = 'xyz_ihs_snippet_selector';
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_ihs=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($shortcodesXYZEH)){
37
- $shortcodesXYZEH = new XYZ_Insert_Html_TinyMCESelector();
38
- add_action('admin_head', array($shortcodesXYZEH, 'addSelector'));
39
- }
40
-
 
 
41
  ?>
1
+ <?php
2
+ if ( ! defined( 'ABSPATH' ) )
3
+ exit;
4
+
5
+ if(!class_exists('XYZ_Insert_Html_TinyMCESelector')):
6
+
7
+ class XYZ_Insert_Html_TinyMCESelector{
8
+ var $buttonName = 'xyz_ihs_snippet_selector';
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_ihs=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($shortcodesXYZEH)){
39
+ $shortcodesXYZEH = new XYZ_Insert_Html_TinyMCESelector();
40
+ add_action('admin_head', array($shortcodesXYZEH, 'addSelector'));
41
+ }
42
+
43
  ?>
admin/about.php CHANGED
@@ -1,3 +1,11 @@
 
 
 
 
 
 
 
 
1
  <style>
2
  </style>
3
 
1
+ <?php
2
+ if ( ! defined( 'ABSPATH' ) )
3
+ exit;
4
+
5
+ ?>
6
+
7
+
8
+
9
  <style>
10
  </style>
11
 
admin/admin-notices.php ADDED
@@ -0,0 +1,74 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <style>
2
+ #TB_window { width:50% !important; height: 100px !important;
3
+ margin-left: 25% !important;
4
+ left: 0% !important;
5
+ }
6
+ </style>
7
+ <?php add_thickbox();?>
8
+ <script type="text/javascript">
9
+ function share_html_code_snippet(){
10
+ tb_show("Share on","#TB_inline?width=500&amp;height=75&amp;inlineId=show_share_icons_ihs&class=thickbox");
11
+ }
12
+ </script>
13
+
14
+
15
+
16
+ <?php
17
+ function wp_ihsap_admin_notice()
18
+ {
19
+
20
+ $sharelink_text_array_ihs = array
21
+ (
22
+ "I use Insert HTML Code Snippet wordpress plugin from @xyzscripts and you should too.",
23
+ "Insert HTML Code Snippet wordpress plugin from @xyzscripts is awesome",
24
+ "Thanks @xyzscripts for developing such a wonderful wordpress plugin for inserting html",
25
+ "I was looking for a HTML Code Snippet insertion plugin and I found this. Thanks @xyzscripts",
26
+ "Its very easy to use Insert HTML Code Snippet wordpress plugin from @xyzscripts",
27
+ "I installed Insert HTML Code Snippet from @xyzscripts,it works flawlessly",
28
+ "Insert HTML Code Snippet wordpress plugin that i use works terrific",
29
+ "I am using Insert HTML Code Snippet wordpress plugin from @xyzscripts and I like it",
30
+ "The Insert HTML Code Snippet plugin from @xyzscripts is simple and works fine",
31
+ "I've been using this Snippet plugin for a while now and it is really good",
32
+ "Insert HTML Code Snippet wordpress plugin is a fantastic plugin",
33
+ "Insert HTML Code Snippet wordpress plugin is easy to use and works great. Thank you!",
34
+ "Good and flexible Insert HTML Code Snippet plugin especially for beginners",
35
+ "The best Insert HTML Code Snippet wordpress plugin I have used ! THANKS @xyzscripts",
36
+ );
37
+ $sharelink_text_ihs = array_rand($sharelink_text_array_ihs, 1);
38
+ $sharelink_text_ihs = $sharelink_text_array_ihs[$sharelink_text_ihs];
39
+
40
+
41
+ echo '<div id="ihs_notice_td" class="error" style="color: #666666;margin-left: 2px;background: none repeat scroll 0pt 0pt infobackground; border: 1px solid inactivecaption; padding: 5px;line-height:16px;">
42
+ <p>It looks like you have been enjoying using <a href="https://wordpress.org/plugins/insert-html-snippet/" target="_blank"> Insert HTML 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>
43
+ <p>
44
+ <a href="https://wordpress.org/support/view/plugin-reviews/insert-html-snippet" class="button" style="color:black;text-decoration:none;margin-right:4px;" target="_blank">Rate it 5★\'s on wordpress</a>';
45
+ if(get_option('xyz_credit_link')=="0")
46
+ echo '<a class="button xyz_ihs_backlink" style="color:black;text-decoration:none;margin-right:4px;" target="_blank">Enable Backlink</a>';
47
+
48
+ echo '<a class="button" onclick=share_html_code_snippet(); style="color:black;text-decoration:none;margin-right:4px;">Share on</a>
49
+
50
+ <a href="admin.php?page=insert-html-snippet-settings&ihsap_notice=hide" class="button" style="color:black;text-decoration:none;margin-right:4px;">Don\'t Show This Again</a>
51
+ </p>
52
+
53
+ <div id="show_share_icons_ihs" style="display: none;">
54
+ <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=https://wordpress.org/plugins/insert-html-snippet/&text='.$sharelink_text_ihs.'" target="_blank">Facebook</a>
55
+ <a class="button" style="background-color:#00aced;color:white;margin-right:4px;margin-left:20px;margin-top: 25px;" href="http://twitter.com/share?url=https://wordpress.org/plugins/insert-html-snippet/&text='.$sharelink_text_ihs.'" target="_blank">Twitter</a>
56
+ <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=https://wordpress.org/plugins/insert-html-snippet/" target="_blank">LinkedIn</a>
57
+ <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=https://wordpress.org/plugins/insert-html-snippet/" target="_blank">google+</a>
58
+ </div>
59
+ </div>';
60
+
61
+ }
62
+ $ihsap_installed_date = get_option('ihsap_installed_date');
63
+ if ($ihsap_installed_date=="") {
64
+ $ihsap_installed_date = time();
65
+ }
66
+
67
+ if($ihsap_installed_date < ( time() - (30*24*60*60) ))
68
+ {
69
+ if (get_option('xyz_ihsap_dnt_shw_notice') != "hide")
70
+ {
71
+ add_action('admin_notices', 'wp_ihsap_admin_notice');
72
+ }
73
+ }
74
+ ?>
admin/ajax-backlink.php CHANGED
@@ -1,14 +1,16 @@
1
- <?php
2
- add_action('wp_ajax_ajax_backlink', 'xyz_ihs_ajax_backlink');
 
 
3
  function xyz_ihs_ajax_backlink() {
4
-
5
- global $wpdb;
6
-
7
- if($_POST){
8
- update_option('xyz_credit_link','ihs');
9
-
10
  }
11
- }
12
-
13
-
14
  ?>
1
+ <?php
2
+ if ( ! defined( 'ABSPATH' ) )
3
+ exit;
4
+ add_action('wp_ajax_ajax_backlink', 'xyz_ihs_ajax_backlink');
5
  function xyz_ihs_ajax_backlink() {
6
+
7
+ global $wpdb;
8
+
9
+ if($_POST){
10
+ update_option('xyz_credit_link','ihs');
11
+
12
  }
13
+ }
14
+
15
+
16
  ?>
admin/footer.php CHANGED
@@ -1,149 +1,153 @@
1
- <div style="clear: both;"></div>
2
-
3
-
4
- <p></p>
5
-
6
- <div style="width: 100%">
7
-
8
- <div class="xyz_feedback">
9
-
10
-
11
- <a target="_blank" href="http://xyzscripts.com/support/" class="xyz_suggest">Suggestions</a> -
12
- <a target="_blank" href="http://facebook.com/xyzscripts" class="xyz_fbook">Like us on Facebook</a> -
13
- <a target="_blank" href="http://twitter.com/xyzscripts" class="xyz_twitt">Follow us on Twitter</a> -
14
- <a target="_blank" href="https://plus.google.com/+Xyzscripts/" class="xyz_gplus">+1 us on Google+</a> -
15
- <a target="_blank" href="http://www.linkedin.com/company/xyzscripts" class="xyz_linkedin">Follow us on LinkedIn</a>
16
-
17
-
18
- </div>
19
-
20
- <p></p>
21
-
22
- <div class="xyz_subscribe">
23
-
24
- <script language="javascript">
25
- function check_email(emailString)
26
- {
27
- var mailPattern = /^([A-Za-z0-9_\-\.])+\@([A-Za-z0-9_\-\.])+\.([A-Za-z]{2,})$/;
28
- var matchArray = emailString.match(mailPattern);
29
- if (emailString.length == 0)
30
- return false;
31
-
32
- if (matchArray == null) {
33
- return false;
34
- }else{
35
- return true;
36
- }
37
- }
38
-
39
-
40
- function verify_lists(form)
41
- {
42
-
43
- var total=0;
44
- var checkBox=form['chk[]'];
45
-
46
- if(checkBox.length){
47
-
48
- for(var i=0;i<checkBox.length;i++){
49
- checkBox[i].checked?total++:null;
50
- }
51
- }else{
52
-
53
- checkBox.checked?total++:null;
54
-
55
- }
56
- if(total>0){
57
- return true;
58
- }else{
59
- return false;
60
- }
61
-
62
- }
63
-
64
- function verify_fields()
65
- {
66
-
67
- if(check_email(document.email_subscription.email.value) == false){
68
- alert("Please check whether the email is correct.");
69
- document.email_subscription.email.select();
70
- return false;
71
- }else if(verify_lists(document.email_subscription)==false){
72
- alert("Select atleast one list.");
73
- }
74
- else{
75
- document.email_subscription.submit();
76
- }
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/XYZWPIHSFRE">
84
- <input type="hidden" name="redirPending" value="http://xyzscripts.com/subscription/active/XYZWPIHSFRE">
85
- <input type="hidden" name="mode" value="1">
86
-
87
- <b>Stay tuned to our updates :</b>
88
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
89
-
90
- Name :
91
- <input style="border: 1px solid #3fafe3; margin-right:10px;" type="text" name="field1" value="<?php
92
- if ($current_user->user_firstname != "" || $current_user->user_lastname != "")
93
- {
94
- echo $current_user->user_firstname . " " . $current_user->user_lastname;
95
- }
96
- else if (strcasecmp($current_user->display_name, 'admin')!=0 && strcasecmp($current_user->display_name , "administrator")!=0 )
97
- {
98
- echo $current_user->display_name;
99
- }
100
- else if (strcasecmp($current_user->user_login ,"admin")!=0 && strcasecmp($current_user->user_login , "administrator")!=0 )
101
- {
102
- echo $current_user->user_login;
103
- }
104
- ?>" >
105
-
106
- Email Address :
107
- <input style="border: 1px solid #3fafe3;" name="email"
108
- type="text" value="<?php echo $current_user->user_email; ?>" /><span style="color:#FF0000">*</span>
109
-
110
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
111
- <input id="submit_ihs" style="color:#FFFFFF;border-radius:4px;border:1px solid #1A87B9;" type="submit" value="Subscribe" name="Submit" onclick="javascript: if(!verify_fields()) return false; " />
112
-
113
- <input type="hidden" name="listName" value="6,1,"/>
114
- </form>
115
-
116
-
117
-
118
- </div>
119
-
120
-
121
- <div style="clear: both;"></div>
122
- <div style="width: 100%">
123
-
124
- <div class="xyz_our_plugins">
125
- Our Plugins :
126
-
127
-
128
- <a target="_blank" href="http://wordpress.org/extend/plugins/insert-html-snippet/">Insert HTML Snippet</a> ★
129
- <a target="_blank" href="http://wordpress.org/extend/plugins/lightbox-pop/">Lightbox Pop</a>
130
- <a target="_blank" href="http://wordpress.org/extend/plugins/full-screen-popup/">Full Screen Popup</a> ★
131
- <a target="_blank" href="http://wordpress.org/extend/plugins/popup-dialog-box/">Popup Dialog Box</a> ★
132
- <a target="_blank" href="http://wordpress.org/extend/plugins/quick-bar/">Quick Bar</a> ★
133
- <a target="_blank" href="http://wordpress.org/extend/plugins/quick-box-popup/">Quick Box Popup</a> ★
134
- <a target="_blank" href="http://wordpress.org/extend/plugins/contact-form-manager/">Contact Form Manager</a> ★
135
- <a target="_blank" href="http://wordpress.org/extend/plugins/newsletter-manager/">Newsletter Manager</a> ★
136
- <a target="_blank" href="http://wordpress.org/extend/plugins/social-media-auto-publish/">Social Media Auto Publish</a>★
137
- <a target="_blank" href="http://wordpress.org/extend/plugins/facebook-auto-publish/">Facebook Auto Publish</a> ★
138
- <a target="_blank" href="http://wordpress.org/extend/plugins/linkedin-auto-publish/">LinkedIn Auto Publish</a> ★
139
- <a target="_blank" href="http://wordpress.org/extend/plugins/twitter-auto-publish/">Twitter Auto Publish</a> ★
140
- <a target="_blank" href="http://wordpress.org/extend/plugins/insert-php-code-snippet/">Insert PHP Code Snippet</a>
141
- </div>
142
- </div>
143
- <div class="poweredBy">
144
- Powered by <a href="http://xyzscripts.com" target="_blank">XYZScripts</a>
145
- </div>
146
- <div style="clear: both;"></div>
147
-
148
- </div>
149
- <p style="clear: both;"></p>
 
 
 
 
1
+ <?php
2
+ if ( ! defined( 'ABSPATH' ) )
3
+ exit;
4
+ ?>
5
+ <div style="clear: both;"></div>
6
+
7
+
8
+ <p></p>
9
+
10
+ <div style="width: 100%">
11
+
12
+ <div class="xyz_feedback">
13
+
14
+
15
+ <a target="_blank" href="http://xyzscripts.com/support/" class="xyz_suggest">Suggestions</a> -
16
+ <a target="_blank" href="http://facebook.com/xyzscripts" class="xyz_fbook">Like us on Facebook</a> -
17
+ <a target="_blank" href="http://twitter.com/xyzscripts" class="xyz_twitt">Follow us on Twitter</a> -
18
+ <a target="_blank" href="https://plus.google.com/+Xyzscripts/" class="xyz_gplus">+1 us on Google+</a> -
19
+ <a target="_blank" href="http://www.linkedin.com/company/xyzscripts" class="xyz_linkedin">Follow us on LinkedIn</a>
20
+
21
+
22
+ </div>
23
+
24
+ <p></p>
25
+
26
+ <div class="xyz_subscribe">
27
+
28
+ <script language="javascript">
29
+ function check_email(emailString)
30
+ {
31
+ var mailPattern = /^([A-Za-z0-9_\-\.])+\@([A-Za-z0-9_\-\.])+\.([A-Za-z]{2,})$/;
32
+ var matchArray = emailString.match(mailPattern);
33
+ if (emailString.length == 0)
34
+ return false;
35
+
36
+ if (matchArray == null) {
37
+ return false;
38
+ }else{
39
+ return true;
40
+ }
41
+ }
42
+
43
+
44
+ function verify_lists(form)
45
+ {
46
+
47
+ var total=0;
48
+ var checkBox=form['chk[]'];
49
+
50
+ if(checkBox.length){
51
+
52
+ for(var i=0;i<checkBox.length;i++){
53
+ checkBox[i].checked?total++:null;
54
+ }
55
+ }else{
56
+
57
+ checkBox.checked?total++:null;
58
+
59
+ }
60
+ if(total>0){
61
+ return true;
62
+ }else{
63
+ return false;
64
+ }
65
+
66
+ }
67
+
68
+ function verify_fields()
69
+ {
70
+
71
+ if(check_email(document.email_subscription.email.value) == false){
72
+ alert("Please check whether the email is correct.");
73
+ document.email_subscription.email.select();
74
+ return false;
75
+ }else if(verify_lists(document.email_subscription)==false){
76
+ alert("Select atleast one list.");
77
+ }
78
+ else{
79
+ document.email_subscription.submit();
80
+ }
81
+
82
+ }
83
+ </script>
84
+ <?php global $current_user; wp_get_current_user(); ?>
85
+ <form action="http://xyzscripts.com/newsletter/index.php?page=list/subscribe" method="post" name="email_subscription" id="email_subscription" >
86
+ <input type="hidden" name="fieldNameIds" value="1,">
87
+ <input type="hidden" name="redirActive" value="http://xyzscripts.com/subscription/pending/XYZWPIHSFRE">
88
+ <input type="hidden" name="redirPending" value="http://xyzscripts.com/subscription/active/XYZWPIHSFRE">
89
+ <input type="hidden" name="mode" value="1">
90
+
91
+ <b>Stay tuned to our updates :</b>
92
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
93
+
94
+ Name :
95
+ <input style="border: 1px solid #3fafe3; margin-right:10px;" type="text" name="field1" value="<?php
96
+ if ($current_user->user_firstname != "" || $current_user->user_lastname != "")
97
+ {
98
+ echo $current_user->user_firstname . " " . $current_user->user_lastname;
99
+ }
100
+ else if (strcasecmp($current_user->display_name, 'admin')!=0 && strcasecmp($current_user->display_name , "administrator")!=0 )
101
+ {
102
+ echo $current_user->display_name;
103
+ }
104
+ else if (strcasecmp($current_user->user_login ,"admin")!=0 && strcasecmp($current_user->user_login , "administrator")!=0 )
105
+ {
106
+ echo $current_user->user_login;
107
+ }
108
+ ?>" >
109
+
110
+ Email Address :
111
+ <input style="border: 1px solid #3fafe3;" name="email"
112
+ type="text" value="<?php echo $current_user->user_email; ?>" /><span style="color:#FF0000">*</span>
113
+
114
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
115
+ <input id="submit_ihs" style="color:#FFFFFF;border-radius:4px;border:1px solid #1A87B9;" type="submit" value="Subscribe" name="Submit" onclick="javascript: if(!verify_fields()) return false; " />
116
+
117
+ <input type="hidden" name="listName" value="6,1,"/>
118
+ </form>
119
+
120
+
121
+
122
+ </div>
123
+
124
+
125
+ <div style="clear: both;"></div>
126
+ <div style="width: 100%">
127
+
128
+ <div class="xyz_our_plugins">
129
+ Our Plugins :
130
+
131
+
132
+ <a target="_blank" href="http://wordpress.org/extend/plugins/insert-html-snippet/">Insert HTML Snippet</a> ★
133
+ <a target="_blank" href="http://wordpress.org/extend/plugins/lightbox-pop/">Lightbox Pop</a> ★
134
+ <a target="_blank" href="http://wordpress.org/extend/plugins/full-screen-popup/">Full Screen Popup</a> ★
135
+ <a target="_blank" href="http://wordpress.org/extend/plugins/popup-dialog-box/">Popup Dialog Box</a> ★
136
+ <a target="_blank" href="http://wordpress.org/extend/plugins/quick-bar/">Quick Bar</a> ★
137
+ <a target="_blank" href="http://wordpress.org/extend/plugins/quick-box-popup/">Quick Box Popup</a> ★
138
+ <a target="_blank" href="http://wordpress.org/extend/plugins/contact-form-manager/">Contact Form Manager</a> ★
139
+ <a target="_blank" href="http://wordpress.org/extend/plugins/newsletter-manager/">Newsletter Manager</a> ★
140
+ <a target="_blank" href="http://wordpress.org/extend/plugins/social-media-auto-publish/">Social Media Auto Publish</a>★
141
+ <a target="_blank" href="http://wordpress.org/extend/plugins/facebook-auto-publish/">Facebook Auto Publish</a>
142
+ <a target="_blank" href="http://wordpress.org/extend/plugins/linkedin-auto-publish/">LinkedIn Auto Publish</a>
143
+ <a target="_blank" href="http://wordpress.org/extend/plugins/twitter-auto-publish/">Twitter Auto Publish</a> ★
144
+ <a target="_blank" href="http://wordpress.org/extend/plugins/insert-php-code-snippet/">Insert PHP Code Snippet</a>
145
+ </div>
146
+ </div>
147
+ <div class="poweredBy">
148
+ Powered by <a href="http://xyzscripts.com" target="_blank">XYZScripts</a>
149
+ </div>
150
+ <div style="clear: both;"></div>
151
+
152
+ </div>
153
+ <p style="clear: both;"></p>
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,12 +13,12 @@ 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_ihs_backlink" style="cursor: pointer;" >Okay, Enable</a>.
13
  <script type="text/javascript">
14
 
15
  jQuery(document).ready(function() {
16
 
17
- jQuery('#xyz_ihs_backlink').click(function() {
18
  var dataString = {
19
  action: 'ajax_backlink',
20
  enable: 1
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_ihs_backlink" style="cursor: pointer;" >Okay, Enable</a>.
17
  <script type="text/javascript">
18
 
19
  jQuery(document).ready(function() {
20
 
21
+ jQuery('.xyz_ihs_backlink').click(function() {
22
  var dataString = {
23
  action: 'ajax_backlink',
24
  enable: 1
admin/install.php CHANGED
@@ -1,5 +1,6 @@
1
  <?php
2
-
 
3
  function xyz_ihs_network_install($networkwide) {
4
  global $wpdb;
5
 
@@ -24,7 +25,7 @@ function xyz_ihs_network_install($networkwide) {
24
  function xyz_ihs_install(){
25
 
26
  global $wpdb;
27
- //global $current_user; get_currentuserinfo();
28
  if(get_option('xyz_ihs_sort_order')=='')
29
  {
30
  add_option('xyz_ihs_sort_order','desc');
@@ -34,6 +35,11 @@ function xyz_ihs_install(){
34
  add_option('xyz_ihs_sort_field_name','id');
35
  }
36
 
 
 
 
 
 
37
 
38
  if(get_option('xyz_credit_link') == "")
39
  {
1
  <?php
2
+ if ( ! defined( 'ABSPATH' ) )
3
+ exit;
4
  function xyz_ihs_network_install($networkwide) {
5
  global $wpdb;
6
 
25
  function xyz_ihs_install(){
26
 
27
  global $wpdb;
28
+ //global $current_user; wp_get_current_user();
29
  if(get_option('xyz_ihs_sort_order')=='')
30
  {
31
  add_option('xyz_ihs_sort_order','desc');
35
  add_option('xyz_ihs_sort_field_name','id');
36
  }
37
 
38
+ $ihsap_installed_date = get_option('ihsap_installed_date');
39
+ if ($ihsap_installed_date=="") {
40
+ $ihsap_installed_date = time();
41
+ update_option('ihsap_installed_date', $ihsap_installed_date);
42
+ }
43
 
44
  if(get_option('xyz_credit_link') == "")
45
  {
admin/menu.php CHANGED
@@ -1,5 +1,7 @@
1
  <?php
2
-
 
 
3
  add_action('admin_menu', 'xyz_ihs_menu');
4
 
5
 
1
  <?php
2
+ if ( ! defined( 'ABSPATH' ) )
3
+ exit;
4
+
5
  add_action('admin_menu', 'xyz_ihs_menu');
6
 
7
 
admin/settings.php CHANGED
@@ -1,100 +1,129 @@
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);
 
 
 
 
 
 
 
 
 
 
 
 
 
11
 
12
-
13
-
 
 
 
 
 
 
 
 
14
  $xyz_ihs_limit = abs(intval($_POST['xyz_ihs_limit']));
15
  if($xyz_ihs_limit==0)$xyz_ihs_limit=20;
16
-
17
  $xyz_ihs_credit = $_POST['xyz_ihs_credit'];
18
-
 
 
 
 
19
  $xyz_ihs_sortfield=$_POST['xyz_ihs_sort_by_field'];
 
 
 
 
 
20
  $xyz_ihs_sortorder=$_POST['xyz_ihs_sort_by_order'];
 
 
 
 
 
 
21
  update_option('xyz_ihs_limit',$xyz_ihs_limit);
22
- update_option('xyz_credit_link',$xyz_ihs_credit);
23
 
24
- update_option('xyz_ihs_sort_field_name',$xyz_ihs_sortfield);
25
- update_option('xyz_ihs_sort_order',$xyz_ihs_sortorder);
26
-
27
  ?>
28
-
29
-
30
  <div class="system_notice_area_style1" id="system_notice_area">
31
- Settings updated successfully. &nbsp;&nbsp;&nbsp;<span id="system_notice_area_dismiss">Dismiss</span>
 
32
  </div>
33
-
34
-
35
  <?php
36
- }
37
-
38
-
39
  ?>
40
-
41
  <div>
42
-
43
-
44
  <form method="post">
45
- <div style="float: left;width: 98%">
46
- <fieldset style=" width:100%; border:1px solid #F7F7F7; padding:10px 0px 15px 10px;">
47
- <legend ><h3>Settings</h3></legend>
48
- <table class="widefat" style="width:99%;">
49
-
50
- <tr valign="top">
51
- <td scope="row" ><label for="xyz_ihs_sort">Sorting of snippets</label>
52
- </td>
53
- <td>
54
- <select id="xyz_ihs_sort_by_field" name="xyz_ihs_sort_by_field">
55
- <option value="id" <?php if(isset($_POST['xyz_ihs_sort_by_field']) && $_POST['xyz_ihs_sort_by_field']=='id'){echo 'selected';} else if(get_option('xyz_ihs_sort_field_name')=="id"){echo 'selected';} ?>>Based on create time</option>
56
- <option value="title" <?php if(isset($_POST['xyz_ihs_sort_by_field']) && $_POST['xyz_ihs_sort_by_field']=='title'){ echo 'selected';}elseif(get_option('xyz_ihs_sort_field_name')=="title"){echo 'selected';} ?>>Based on name</option>
57
-
58
-
59
- </select>&nbsp;
60
- <select id="xyz_ihs_sort_by_order" name="xyz_ihs_sort_by_order" >
61
- <option value="asc" <?php if(isset($_POST['xyz_ihs_sort_by_order']) && $_POST['xyz_ihs_sort_by_order']=='asc'){ echo 'selected';}elseif(get_option('xyz_ihs_sort_order')=="asc"){echo 'selected';} ?>>Ascending</option>
62
- <option value="desc" <?php if(isset($_POST['xyz_ihs_sort_by_order']) && $_POST['xyz_ihs_sort_by_order']=='desc'){echo 'selected';} elseif(get_option('xyz_ihs_sort_order')=="desc"){echo 'selected';} ?>>Descending</option>
63
-
64
- </select>
65
- </td>
66
- </tr>
67
- <tr valign="top">
68
- <td scope="row" ><label for="xyz_ihs_credit">Credit link to author</label>
69
- </td>
70
- <td><select name="xyz_ihs_credit" id="xyz_ihs_credit">
71
- <option value="ihs"
72
- <?php if(isset($_POST['xyz_ihs_credit']) && $_POST['xyz_ihs_credit']=='ihs') { echo 'selected';}elseif(get_option('xyz_credit_link')=="ihs"){echo 'selected';} ?>>Enable</option>
73
- <option value="0"
74
- <?php if(isset($_POST['xyz_ihs_credit']) && $_POST['xyz_ihs_credit']!='ihs') { echo 'selected';}elseif(get_option('xyz_credit_link')!="ihs"){echo 'selected';} ?>>Disable</option>
75
-
76
- </select>
77
- </td>
78
- </tr>
79
-
80
- <tr valign="top">
81
- <td scope="row" class=" settingInput" id=""><label for="xyz_ihs_limit">Pagination limit</label></td>
82
- <td id=""><input name="xyz_ihs_limit" type="text"
83
- id="xyz_ihs_limit" value="<?php if(isset($_POST['xyz_ihs_limit']) ){echo abs(intval($_POST['xyz_ihs_limit']));}else{print(get_option('xyz_ihs_limit'));} ?>" />
84
- </td>
85
- </tr>
86
-
87
- <tr valign="top">
88
- <td scope="row" class=" settingInput" id="bottomBorderNone">
89
- </td>
90
- <td id="bottomBorderNone"><input style="margin:10px 0 20px 0;" id="submit" class="button-primary bottonWidth" type="submit" value=" Update Settings " />
91
- </td>
92
- </tr>
93
-
94
- </table>
95
- </fieldset>
96
-
97
- </div>
98
-
 
 
99
  </form>
100
  </div>
1
  <?php
2
+ if ( ! defined( 'ABSPATH' ) )
3
+ exit;
4
  global $wpdb;
5
  // Load the options
6
 
7
 
8
+ if(isset($_GET['ihsap_notice'])&& $_GET['ihsap_notice'] == 'hide')
9
+ {
10
+ update_option('xyz_ihsap_dnt_shw_notice', "hide");
11
+ ?>
12
+ <style type='text/css'>
13
+ #ihs_notice_td
14
+ {
15
+ display:none;
16
+ }
17
+ </style>
18
+ <div class="system_notice_area_style1" id="system_notice_area">
19
+ Thanks again for using the plugin. We will never show the message again.
20
+ &nbsp;&nbsp;&nbsp;<span
21
+ id="system_notice_area_dismiss">Dismiss</span>
22
+ </div>
23
+ <?php
24
+ }
25
 
26
+
27
+
28
+ if($_POST){
29
+ if (! isset( $_REQUEST['_wpnonce'] ) || ! wp_verify_nonce( $_REQUEST['_wpnonce'], 'snipp-setting_' )) {
30
+ wp_nonce_ays( 'snipp-setting_' );
31
+ exit;
32
+ }
33
+ else {
34
+ $_POST=xyz_trim_deep($_POST);
35
+ $_POST = stripslashes_deep($_POST);
36
  $xyz_ihs_limit = abs(intval($_POST['xyz_ihs_limit']));
37
  if($xyz_ihs_limit==0)$xyz_ihs_limit=20;
 
38
  $xyz_ihs_credit = $_POST['xyz_ihs_credit'];
39
+ if($xyz_ihs_credit=="ihs" || $xyz_ihs_credit==0)
40
+ {
41
+ update_option('xyz_credit_link',$xyz_ihs_credit);
42
+ }
43
+
44
  $xyz_ihs_sortfield=$_POST['xyz_ihs_sort_by_field'];
45
+ if(($xyz_ihs_sortfield=="title")||($xyz_ihs_sortfield=="id"))
46
+ {
47
+ update_option('xyz_ihs_sort_field_name',$xyz_ihs_sortfield);
48
+ }
49
+
50
  $xyz_ihs_sortorder=$_POST['xyz_ihs_sort_by_order'];
51
+ if(($xyz_ihs_sortorder=="asc")||($xyz_ihs_sortorder=="desc"))
52
+ {
53
+ update_option('xyz_ihs_sort_order',$xyz_ihs_sortorder);
54
+ }
55
+
56
+
57
  update_option('xyz_ihs_limit',$xyz_ihs_limit);
 
58
 
59
+
60
+
 
61
  ?>
 
 
62
  <div class="system_notice_area_style1" id="system_notice_area">
63
+ Settings updated successfully. &nbsp;&nbsp;&nbsp;
64
+ <span id="system_notice_area_dismiss">Dismiss</span>
65
  </div>
 
 
66
  <?php
67
+ }
68
+ }
 
69
  ?>
 
70
  <div>
 
 
71
  <form method="post">
72
+ <?php wp_nonce_field('snipp-setting_');?>
73
+ <div style="float: left;width: 98%">
74
+ <fieldset style=" width:100%; border:1px solid #F7F7F7; padding:10px 0px 15px 10px;">
75
+ <legend ><h3>
76
+ Settings
77
+ </h3></legend>
78
+ <table class="widefat" style="width:99%;">
79
+ <tr valign="top">
80
+ <td scope="row" >
81
+ <label for="xyz_ihs_sort">Sorting of snippets</label>
82
+ </td>
83
+ <td>
84
+ <select id="xyz_ihs_sort_by_field" name="xyz_ihs_sort_by_field">
85
+ <option value="id" <?php if(isset($_POST['xyz_ihs_sort_by_field']) && $_POST['xyz_ihs_sort_by_field']=='id'){echo 'selected';} else if(get_option('xyz_ihs_sort_field_name')=="id"){echo 'selected';} ?>>Based on create time</option>
86
+ <option value="title" <?php if(isset($_POST['xyz_ihs_sort_by_field']) && $_POST['xyz_ihs_sort_by_field']=='title'){ echo 'selected';}elseif(get_option('xyz_ihs_sort_field_name')=="title"){echo 'selected';} ?>>Based on name</option>
87
+ </select>
88
+ &nbsp;
89
+ <select id="xyz_ihs_sort_by_order" name="xyz_ihs_sort_by_order" >
90
+ <option value="asc" <?php if(isset($_POST['xyz_ihs_sort_by_order']) && $_POST['xyz_ihs_sort_by_order']=='asc'){ echo 'selected';}elseif(get_option('xyz_ihs_sort_order')=="asc"){echo 'selected';} ?>>Ascending</option>
91
+ <option value="desc" <?php if(isset($_POST['xyz_ihs_sort_by_order']) && $_POST['xyz_ihs_sort_by_order']=='desc'){echo 'selected';} elseif(get_option('xyz_ihs_sort_order')=="desc"){echo 'selected';} ?>>Descending</option>
92
+ </select>
93
+ </td>
94
+ </tr>
95
+ <tr valign="top">
96
+ <td scope="row" >
97
+ <label for="xyz_ihs_credit">Credit link to author</label>
98
+ </td>
99
+ <td>
100
+ <select name="xyz_ihs_credit" id="xyz_ihs_credit">
101
+ <option value="ihs"
102
+ <?php selected(get_option('xyz_credit_link'),"ihs"); ?>>Enable</option>
103
+ <option value="0"
104
+ <?php if(get_option('xyz_credit_link')!="ihs"){echo 'selected';} ?>>Disable</option>
105
+ </select>
106
+ </td>
107
+ </tr>
108
+ <tr valign="top">
109
+ <td scope="row" class=" settingInput" id="">
110
+ <label for="xyz_ihs_limit">Pagination limit</label>
111
+ </td>
112
+ <td id="">
113
+ <input name="xyz_ihs_limit" type="text"
114
+ id="xyz_ihs_limit" value="
115
+ <?php if(isset($_POST['xyz_ihs_limit']) ){echo abs(intval($_POST['xyz_ihs_limit']));}else{print(get_option('xyz_ihs_limit'));} ?>" />
116
+ </td>
117
+ </tr>
118
+ <tr valign="top">
119
+ <td scope="row" class=" settingInput" id="bottomBorderNone">
120
+ </td>
121
+ <td id="bottomBorderNone">
122
+ <input style="margin:10px 0 20px 0;" id="submit" class="button-primary bottonWidth" type="submit" value=" Update Settings " />
123
+ </td>
124
+ </tr>
125
+ </table>
126
+ </fieldset>
127
+ </div>
128
  </form>
129
  </div>
admin/snippet-add.php CHANGED
@@ -1,103 +1,132 @@
1
  <?php
2
-
 
3
  global $wpdb;
4
-
5
  $_POST = stripslashes_deep($_POST);
6
  $_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_ihs_title = str_replace(' ', '', $_POST['snippetTitle']);
15
- $temp_xyz_ihs_title = str_replace('-', '', $temp_xyz_ihs_title);
16
-
17
- $xyz_ihs_title = str_replace(' ', '-', $_POST['snippetTitle']);
18
- $xyz_ihs_content = $_POST['snippetContent'];
19
-
20
- if($xyz_ihs_title != "" && $xyz_ihs_content != ""){
21
- if(ctype_alnum($temp_xyz_ihs_title))
22
- {
23
-
24
- $snippet_count = $wpdb->query($wpdb->prepare( 'SELECT * FROM '.$wpdb->prefix.'xyz_ihs_short_code WHERE title=%s' ,$xyz_ihs_title)) ;
25
- if($snippet_count == 0){
26
- $xyz_shortCode = '[xyz-ihs snippet="'.$xyz_ihs_title.'"]';
27
- $wpdb->insert($wpdb->prefix.'xyz_ihs_short_code', array('title' =>$xyz_ihs_title,'content'=>$xyz_ihs_content,'short_code'=>$xyz_shortCode,'status'=>'1'),array('%s','%s','%s','%d'));
28
-
29
- header("Location:".admin_url('admin.php?page=insert-html-snippet-manage&xyz_ihs_msg=1'));
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
30
  }else{
31
- ?>
32
- <div class="system_notice_area_style0" id="system_notice_area">
33
- HTML Snippet already exists. &nbsp;&nbsp;&nbsp;<span id="system_notice_area_dismiss">Dismiss</span>
34
- </div>
35
- <?php
36
-
37
- }
38
- }
39
- else
40
- {
41
- ?>
42
- <div class="system_notice_area_style0" id="system_notice_area">
43
- HTML Snippet title can have only alphabets,numbers or hyphen. &nbsp;&nbsp;&nbsp;<span id="system_notice_area_dismiss">Dismiss</span>
44
- </div>
45
- <?php
46
-
47
- }
48
-
49
-
50
- }else{
51
  ?>
52
- <div class="system_notice_area_style0" id="system_notice_area">
53
- Fill all mandatory fields. &nbsp;&nbsp;&nbsp;<span id="system_notice_area_dismiss">Dismiss</span>
54
- </div>
 
55
  <?php
 
56
  }
57
-
58
  }
59
-
60
  ?>
61
-
62
  <div >
63
  <fieldset
64
- style="width: 99%; border: 1px solid #F7F7F7; padding: 10px 0px;">
65
  <legend>
66
- <b>Add HTML Snippet</b>
 
 
67
  </legend>
68
  <form name="frmmainForm" id="frmmainForm" method="post">
69
-
 
 
70
  <div>
71
  <table
72
- style="width: 99%; background-color: #F9F9F9; border: 1px solid #E4E4E4; border-width: 1px;margin: 0 auto">
73
- <tr><td><br/>
74
- <div id="shortCode"></div>
75
- <br/></td></tr>
 
 
 
 
 
76
  <tr valign="top">
77
- <td style="border-bottom: none;width:20%;">&nbsp;&nbsp;&nbsp;Tracking Name&nbsp;<font color="red">*</font></td>
78
- <td style="border-bottom: none;width:1px;">&nbsp;:&nbsp;</td>
79
- <td><input style="width:80%;"
 
 
 
 
 
 
 
 
80
  type="text" name="snippetTitle" id="snippetTitle"
81
- value="<?php if(isset($_POST['snippetTitle'])){ echo esc_attr($_POST['snippetTitle']);}?>"></td>
 
 
82
  </tr>
83
  <tr>
84
- <td style="border-bottom: none;width:20%; ">&nbsp;&nbsp;&nbsp;HTML code &nbsp;<font color="red">*</font></td>
85
- <td style="border-bottom: none;width:1px;">&nbsp;:&nbsp;</td>
 
 
 
 
 
 
 
86
  <td >
87
  <textarea name="snippetContent" style="width:80%;height:150px;"><?php if(isset($_POST['snippetContent'])){ echo esc_textarea($_POST['snippetContent']);}?></textarea>
88
  </td>
89
- </tr>
90
-
91
- <tr>
92
- <td></td><td></td>
93
- <td><input class="button-primary" style="cursor: pointer;"
94
- type="submit" name="addSubmit" value="Create"></td>
95
- </tr>
96
- <tr><td><br/></td></tr>
 
 
 
 
 
 
 
 
97
  </table>
98
  </div>
99
-
100
  </form>
101
  </fieldset>
102
-
103
  </div>
1
  <?php
2
+ if ( ! defined( 'ABSPATH' ) )
3
+ exit;
4
  global $wpdb;
 
5
  $_POST = stripslashes_deep($_POST);
6
  $_POST = xyz_trim_deep($_POST);
 
7
  if(isset($_POST) && isset($_POST['addSubmit'])){
8
+ if (
9
+ ! isset( $_REQUEST['_wpnonce'] )
10
+ || ! wp_verify_nonce( $_REQUEST['_wpnonce'], 'snipp-add_' )
11
+ ) {
12
+ wp_nonce_ays( 'snipp-add_' );
13
+ exit;
14
+ } else {
15
+ // echo '<pre>';
16
+ // print_r($_POST);
17
+ // die("JJJ");
18
+ $temp_xyz_ihs_title = str_replace(' ', '', $_POST['snippetTitle']);
19
+ $temp_xyz_ihs_title = str_replace('-', '', $temp_xyz_ihs_title);
20
+ $xyz_ihs_title = str_replace(' ', '-', $_POST['snippetTitle']);
21
+ $xyz_ihs_content = $_POST['snippetContent'];
22
+ if($xyz_ihs_title != "" && $xyz_ihs_content != ""){
23
+ if(ctype_alnum($temp_xyz_ihs_title))
24
+ {
25
+ $snippet_count = $wpdb->query($wpdb->prepare( 'SELECT * FROM '.$wpdb->prefix.'xyz_ihs_short_code WHERE title=%s' ,$xyz_ihs_title)) ;
26
+ if($snippet_count == 0){
27
+ $xyz_shortCode = '[xyz-ihs snippet="'.$xyz_ihs_title.'"]';
28
+ $wpdb->insert($wpdb->prefix.'xyz_ihs_short_code', array('title' =>$xyz_ihs_title,'content'=>$xyz_ihs_content,'short_code'=>$xyz_shortCode,'status'=>'1'),array('%s','%s','%s','%d'));
29
+ header("Location:".admin_url('admin.php?page=insert-html-snippet-manage&xyz_ihs_msg=1'));
30
+ }else{
31
+ ?>
32
+ <div class="system_notice_area_style0" id="system_notice_area">
33
+ HTML Snippet already exists. &nbsp;&nbsp;&nbsp;
34
+ <span id="system_notice_area_dismiss">Dismiss</span>
35
+ </div>
36
+ <?php
37
+ }
38
+ }
39
+ else
40
+ {
41
+ ?>
42
+ <div class="system_notice_area_style0" id="system_notice_area">
43
+ HTML Snippet title can have only alphabets,numbers or hyphen. &nbsp;&nbsp;&nbsp;
44
+ <span id="system_notice_area_dismiss">Dismiss</span>
45
+ </div>
46
+ <?php
47
+ }
48
  }else{
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
49
  ?>
50
+ <div class="system_notice_area_style0" id="system_notice_area">
51
+ Fill all mandatory fields. &nbsp;&nbsp;&nbsp;
52
+ <span id="system_notice_area_dismiss">Dismiss</span>
53
+ </div>
54
  <?php
55
+ }
56
  }
 
57
  }
 
58
  ?>
 
59
  <div >
60
  <fieldset
61
+ style="width: 99%; border: 1px solid #F7F7F7; padding: 10px 0px;">
62
  <legend>
63
+ <b>
64
+ Add HTML Snippet
65
+ </b>
66
  </legend>
67
  <form name="frmmainForm" id="frmmainForm" method="post">
68
+ <?php
69
+ wp_nonce_field('snipp-add_');
70
+ ?>
71
  <div>
72
  <table
73
+ style="width: 99%; background-color: #F9F9F9; border: 1px solid #E4E4E4; border-width: 1px;margin: 0 auto">
74
+ <tr>
75
+ <td>
76
+ <br/>
77
+ <div id="shortCode">
78
+ </div>
79
+ <br/>
80
+ </td>
81
+ </tr>
82
  <tr valign="top">
83
+ <td style="border-bottom: none;width:20%;">
84
+ &nbsp;&nbsp;&nbsp;Tracking Name&nbsp;
85
+ <font color="red">
86
+ *
87
+ </font>
88
+ </td>
89
+ <td style="border-bottom: none;width:1px;">
90
+ &nbsp;:&nbsp;
91
+ </td>
92
+ <td>
93
+ <input style="width:80%;"
94
  type="text" name="snippetTitle" id="snippetTitle"
95
+ value="
96
+ <?php if(isset($_POST['snippetTitle'])){ echo esc_attr($_POST['snippetTitle']);}?>">
97
+ </td>
98
  </tr>
99
  <tr>
100
+ <td style="border-bottom: none;width:20%; ">
101
+ &nbsp;&nbsp;&nbsp;HTML code &nbsp;
102
+ <font color="red">
103
+ *
104
+ </font>
105
+ </td>
106
+ <td style="border-bottom: none;width:1px;">
107
+ &nbsp;:&nbsp;
108
+ </td>
109
  <td >
110
  <textarea name="snippetContent" style="width:80%;height:150px;"><?php if(isset($_POST['snippetContent'])){ echo esc_textarea($_POST['snippetContent']);}?></textarea>
111
  </td>
112
+ </tr>
113
+ <tr>
114
+ <td>
115
+ </td>
116
+ <td>
117
+ </td>
118
+ <td>
119
+ <input class="button-primary" style="cursor: pointer;"
120
+ type="submit" name="addSubmit" value="Create">
121
+ </td>
122
+ </tr>
123
+ <tr>
124
+ <td>
125
+ <br/>
126
+ </td>
127
+ </tr>
128
  </table>
129
  </div>
 
130
  </form>
131
  </fieldset>
 
132
  </div>
admin/snippet-delete.php CHANGED
@@ -1,28 +1,28 @@
1
  <?php
 
 
2
  global $wpdb;
3
-
4
  $_POST = stripslashes_deep($_POST);
5
  $_GET = stripslashes_deep($_GET);
6
-
7
  $xyz_ihs_snippetId = intval($_GET['snippetId']);
8
  $xyz_ihs_pageno = intval($_GET['pageno']);
9
-
10
- if($xyz_ihs_snippetId=="" || !is_numeric($xyz_ihs_snippetId)){
11
- header("Location:".admin_url('admin.php?page=insert-html-snippet-manage'));
12
- exit();
13
-
14
- }
15
- $snippetCount = $wpdb->query($wpdb->prepare( 'SELECT * FROM '.$wpdb->prefix.'xyz_ihs_short_code WHERE id=%d LIMIT 0,1',$xyz_ihs_snippetId )) ;
16
-
17
- if($snippetCount==0){
18
- header("Location:".admin_url('admin.php?page=insert-html-snippet-manage&xyz_ihs_msg=2'));
19
- exit();
20
- }else{
21
-
22
- $wpdb->query($wpdb->prepare( 'DELETE FROM '.$wpdb->prefix.'xyz_ihs_short_code WHERE id=%d',$xyz_ihs_snippetId)) ;
23
-
24
- header("Location:".admin_url('admin.php?page=insert-html-snippet-manage&xyz_ihs_msg=3&pagenum='.$xyz_ihs_pageno));
25
- exit();
26
-
27
  }
28
  ?>
1
  <?php
2
+ if ( ! defined( 'ABSPATH' ) )
3
+ exit;
4
  global $wpdb;
 
5
  $_POST = stripslashes_deep($_POST);
6
  $_GET = stripslashes_deep($_GET);
 
7
  $xyz_ihs_snippetId = intval($_GET['snippetId']);
8
  $xyz_ihs_pageno = intval($_GET['pageno']);
9
+ if (! isset( $_REQUEST['_wpnonce'] ) || ! wp_verify_nonce( $_REQUEST['_wpnonce'], 'snipp-del_'.$xyz_ihs_snippetId )) {
10
+ wp_nonce_ays( 'snipp-del_'.$xyz_ihs_snippetId );
11
+ exit;
12
+ }
13
+ else {
14
+ if($xyz_ihs_snippetId=="" || !is_numeric($xyz_ihs_snippetId)){
15
+ header("Location:".admin_url('admin.php?page=insert-html-snippet-manage'));
16
+ exit();
17
+ }
18
+ $snippetCount = $wpdb->query($wpdb->prepare( 'SELECT * FROM '.$wpdb->prefix.'xyz_ihs_short_code WHERE id=%d LIMIT 0,1',$xyz_ihs_snippetId )) ;
19
+ if($snippetCount==0){
20
+ header("Location:".admin_url('admin.php?page=insert-html-snippet-manage&xyz_ihs_msg=2'));
21
+ exit();
22
+ }else{
23
+ $wpdb->query($wpdb->prepare( 'DELETE FROM '.$wpdb->prefix.'xyz_ihs_short_code WHERE id=%d',$xyz_ihs_snippetId)) ;
24
+ header("Location:".admin_url('admin.php?page=insert-html-snippet-manage&xyz_ihs_msg=3&pagenum='.$xyz_ihs_pageno));
25
+ exit();
26
+ }
27
  }
28
  ?>
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_ihs_snippetId = $_GET['snippetId'];
8
 
@@ -22,16 +24,23 @@ id="system_notice_area_dismiss">Dismiss</span>
22
 
23
 
24
 
25
-
26
  if(isset($_POST) && isset($_POST['updateSubmit'])){
27
 
28
  // echo '<pre>';
29
  // print_r($_POST);
30
  // die("JJJ");
 
 
 
 
 
 
 
31
  $_POST = stripslashes_deep($_POST);
32
  $_POST = xyz_trim_deep($_POST);
33
 
34
- $xyz_ihs_snippetId = $_GET['snippetId'];
35
 
36
  $temp_xyz_ihs_title = str_replace(' ', '', $_POST['snippetTitle']);
37
  $temp_xyz_ihs_title = str_replace('-', '', $temp_xyz_ihs_title);
@@ -79,11 +88,11 @@ if(isset($_POST) && isset($_POST['updateSubmit'])){
79
  Fill all mandatory fields. &nbsp;&nbsp;&nbsp;<span id="system_notice_area_dismiss">Dismiss</span>
80
  </div>
81
  <?php
82
- }
83
 
 
84
  }
85
 
86
-
87
  global $wpdb;
88
 
89
 
@@ -99,6 +108,7 @@ $snippetDetails = $snippetDetails[0];
99
  <b>Edit HTML Snippet</b>
100
  </legend>
101
  <form name="frmmainForm" id="frmmainForm" method="post">
 
102
  <input type="hidden" id="snippetId" name="snippetId"
103
  value="<?php if(isset($_POST['snippetId'])){ echo esc_attr($_POST['snippetId']);}else{ echo esc_attr($snippetDetails->id); }?>">
104
  <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_ihs_snippetId = $_GET['snippetId'];
10
 
24
 
25
 
26
 
27
+ $xyz_ihs_snippetId = $_GET['snippetId'];
28
  if(isset($_POST) && isset($_POST['updateSubmit'])){
29
 
30
  // echo '<pre>';
31
  // print_r($_POST);
32
  // die("JJJ");
33
+
34
+ if (! isset( $_REQUEST['_wpnonce'] ) || ! wp_verify_nonce( $_REQUEST['_wpnonce'], 'snipp-edit_'.$xyz_ihs_snippetId )) {
35
+ wp_nonce_ays( 'snipp-edit_'.$xyz_ihs_snippetId );
36
+ exit;
37
+ }
38
+
39
+ else {
40
  $_POST = stripslashes_deep($_POST);
41
  $_POST = xyz_trim_deep($_POST);
42
 
43
+
44
 
45
  $temp_xyz_ihs_title = str_replace(' ', '', $_POST['snippetTitle']);
46
  $temp_xyz_ihs_title = str_replace('-', '', $temp_xyz_ihs_title);
88
  Fill all mandatory fields. &nbsp;&nbsp;&nbsp;<span id="system_notice_area_dismiss">Dismiss</span>
89
  </div>
90
  <?php
91
+ }
92
 
93
+ }
94
  }
95
 
 
96
  global $wpdb;
97
 
98
 
108
  <b>Edit HTML Snippet</b>
109
  </legend>
110
  <form name="frmmainForm" id="frmmainForm" method="post">
111
+ <?php wp_nonce_field( 'snipp-edit_'.$xyz_ihs_snippetId ); ?>
112
  <input type="hidden" id="snippetId" name="snippetId"
113
  value="<?php if(isset($_POST['snippetId'])){ echo esc_attr($_POST['snippetId']);}else{ echo esc_attr($snippetDetails->id); }?>">
114
  <div>
admin/snippet-status.php CHANGED
@@ -1,29 +1,31 @@
1
  <?php
2
-
 
3
  global $wpdb;
4
-
5
  $_POST = stripslashes_deep($_POST);
6
  $_GET = stripslashes_deep($_GET);
7
-
8
  $xyz_ihs_snippetId = intval($_GET['snippetId']);
9
  $xyz_ihs_snippetStatus = intval($_GET['status']);
10
  $xyz_ihs_pageno = intval($_GET['pageno']);
11
- if($xyz_ihs_snippetId=="" || !is_numeric($xyz_ihs_snippetId)){
12
- header("Location:".admin_url('admin.php?page=insert-html-snippet-manage'));
13
- exit();
14
-
15
- }
16
 
17
- $snippetCount = $wpdb->query($wpdb->prepare( 'SELECT * FROM '.$wpdb->prefix.'xyz_ihs_short_code WHERE id=%d LIMIT 0,1' ,$xyz_ihs_snippetId)) ;
18
 
19
- if($snippetCount==0){
20
- header("Location:".admin_url('admin.php?page=insert-html-snippet-manage&xyz_ihs_msg=2'));
21
- exit();
22
- }else{
23
-
24
- $wpdb->update($wpdb->prefix.'xyz_ihs_short_code', array('status'=>$xyz_ihs_snippetStatus), array('id'=>$xyz_ihs_snippetId));
25
- header("Location:".admin_url('admin.php?page=insert-html-snippet-manage&xyz_ihs_msg=4&pagenum='.$xyz_ihs_pageno));
26
- exit();
27
-
 
 
 
 
 
 
 
 
 
28
  }
29
  ?>
1
  <?php
2
+ if ( ! defined( 'ABSPATH' ) )
3
+ exit;
4
  global $wpdb;
 
5
  $_POST = stripslashes_deep($_POST);
6
  $_GET = stripslashes_deep($_GET);
 
7
  $xyz_ihs_snippetId = intval($_GET['snippetId']);
8
  $xyz_ihs_snippetStatus = intval($_GET['status']);
9
  $xyz_ihs_pageno = intval($_GET['pageno']);
 
 
 
 
 
10
 
 
11
 
12
+ if (! isset( $_REQUEST['_wpnonce'] ) || ! wp_verify_nonce( $_REQUEST['_wpnonce'], 'snipp-stat_'.$xyz_ihs_snippetId )) {
13
+ wp_nonce_ays( 'snipp-stat_'.$xyz_ihs_snippetId );
14
+ exit;
15
+ }
16
+ else {
17
+ if($xyz_ihs_snippetId=="" || !is_numeric($xyz_ihs_snippetId)){
18
+ header("Location:".admin_url('admin.php?page=insert-html-snippet-manage'));
19
+ exit();
20
+ }
21
+ $snippetCount = $wpdb->query($wpdb->prepare( 'SELECT * FROM '.$wpdb->prefix.'xyz_ihs_short_code WHERE id=%d LIMIT 0,1' ,$xyz_ihs_snippetId)) ;
22
+ if($snippetCount==0){
23
+ header("Location:".admin_url('admin.php?page=insert-html-snippet-manage&xyz_ihs_msg=2'));
24
+ exit();
25
+ }else{
26
+ $wpdb->update($wpdb->prefix.'xyz_ihs_short_code', array('status'=>$xyz_ihs_snippetStatus), array('id'=>$xyz_ihs_snippetId));
27
+ header("Location:".admin_url('admin.php?page=insert-html-snippet-manage&xyz_ihs_msg=4&pagenum='.$xyz_ihs_pageno));
28
+ exit();
29
+ }
30
  }
31
  ?>
admin/snippets.php CHANGED
@@ -1,4 +1,7 @@
1
  <?php
 
 
 
2
  global $wpdb;
3
  $_GET = stripslashes_deep($_GET);
4
  $xyz_ihs_message = '';
@@ -118,25 +121,27 @@ id="system_notice_area_dismiss">Dismiss</span>
118
  </td>
119
  <?php
120
  if($entry->status == 2){
 
121
  ?>
122
  <td style="text-align: center;"><a
123
- href='<?php echo admin_url('admin.php?page=insert-html-snippet-manage&action=snippet-status&snippetId='.$entry->id.'&status=1&pageno='.$pagenum); ?>'><img
124
  id="img" title="Activate"
125
  src="<?php echo plugins_url('insert-html-snippet/images/activate.png')?>">
126
  </a>
127
  </td>
128
  <?php
129
  }elseif ($entry->status == 1){
 
130
  ?>
131
  <td style="text-align: center;"><a
132
- href='<?php echo admin_url('admin.php?page=insert-html-snippet-manage&action=snippet-status&snippetId='.$entry->id.'&status=2&pageno='.$pagenum); ?>'><img
133
  id="img" title="Deactivate"
134
  src="<?php echo plugins_url('insert-html-snippet/images/pause.png')?>">
135
  </a>
136
  </td>
137
  <?php
138
  }
139
-
140
  ?>
141
 
142
  <td style="text-align: center;"><a
@@ -145,8 +150,10 @@ id="system_notice_area_dismiss">Dismiss</span>
145
  src="<?php echo plugins_url('insert-html-snippet/images/edit.png')?>">
146
  </a>
147
  </td>
 
 
148
  <td style="text-align: center;" ><a
149
- href='<?php echo admin_url('admin.php?page=insert-html-snippet-manage&action=snippet-delete&snippetId='.$entry->id.'&pageno='.$pagenum); ?>'
150
  onclick="javascript: return confirm('Please click \'OK\' to confirm ');"><img
151
  id="img" title="Delete Snippet"
152
  src="<?php echo plugins_url('insert-html-snippet/images/delete.png')?>">
1
  <?php
2
+ if ( ! defined( 'ABSPATH' ) )
3
+ exit;
4
+
5
  global $wpdb;
6
  $_GET = stripslashes_deep($_GET);
7
  $xyz_ihs_message = '';
121
  </td>
122
  <?php
123
  if($entry->status == 2){
124
+ $stat1 = admin_url('admin.php?page=insert-html-snippet-manage&action=snippet-status&snippetId='.$entry->id.'&status=1&pageno='.$pagenum);
125
  ?>
126
  <td style="text-align: center;"><a
127
+ href='<?php echo wp_nonce_url($stat1,'snipp-stat_'.$entry->id); ?>'><img
128
  id="img" title="Activate"
129
  src="<?php echo plugins_url('insert-html-snippet/images/activate.png')?>">
130
  </a>
131
  </td>
132
  <?php
133
  }elseif ($entry->status == 1){
134
+ $stat2 = admin_url('admin.php?page=insert-html-snippet-manage&action=snippet-status&snippetId='.$entry->id.'&status=2&pageno='.$pagenum);
135
  ?>
136
  <td style="text-align: center;"><a
137
+ href='<?php echo wp_nonce_url($stat2,'snipp-stat_'.$entry->id); ?>'><img
138
  id="img" title="Deactivate"
139
  src="<?php echo plugins_url('insert-html-snippet/images/pause.png')?>">
140
  </a>
141
  </td>
142
  <?php
143
  }
144
+
145
  ?>
146
 
147
  <td style="text-align: center;"><a
150
  src="<?php echo plugins_url('insert-html-snippet/images/edit.png')?>">
151
  </a>
152
  </td>
153
+
154
+ <?php $delurl = admin_url('admin.php?page=insert-html-snippet-manage&action=snippet-delete&snippetId='.$entry->id.'&pageno='.$pagenum);?>
155
  <td style="text-align: center;" ><a
156
+ href='<?php echo wp_nonce_url($delurl,'snipp-del_'.$entry->id); ?>'
157
  onclick="javascript: return confirm('Please click \'OK\' to confirm ');"><img
158
  id="img" title="Delete Snippet"
159
  src="<?php echo plugins_url('insert-html-snippet/images/delete.png')?>">
admin/uninstall.php CHANGED
@@ -1,5 +1,7 @@
1
  <?php
2
-
 
 
3
  function xyz_ihs_network_uninstall($networkwide) {
4
  global $wpdb;
5
 
1
  <?php
2
+ if ( ! defined( 'ABSPATH' ) )
3
+ exit;
4
+
5
  function xyz_ihs_network_uninstall($networkwide) {
6
  global $wpdb;
7
 
ajax-handler.php CHANGED
@@ -1,4 +1,6 @@
1
  <?php
 
 
2
 
3
  require_once( dirname( __FILE__ ) . '/admin/ajax-backlink.php' );
4
 
1
  <?php
2
+ if ( ! defined( 'ABSPATH' ) )
3
+ exit;
4
 
5
  require_once( dirname( __FILE__ ) . '/admin/ajax-backlink.php' );
6
 
css/xyz_ihs_styles.css CHANGED
File without changes
direct_call.php CHANGED
@@ -1,4 +1,7 @@
1
  <?php
 
 
 
2
  function xyz_ihs_plugin_query_vars($vars) {
3
  $vars[] = 'wp_ihs';
4
  return $vars;
1
  <?php
2
+ if ( ! defined( 'ABSPATH' ) )
3
+ exit;
4
+
5
  function xyz_ihs_plugin_query_vars($vars) {
6
  $vars[] = 'wp_ihs';
7
  return $vars;
editor_plugin.js.php CHANGED
@@ -1,122 +1,125 @@
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.');
5
-
6
- if(!isset($shortcodesXYZEH))
7
- $shortcodesXYZEH = new XYZ_Insert_Html_TinyMCESelector();
8
-
9
- global $wpdb;
10
-
11
-
12
- $xyz_snippets_arr=$wpdb->get_results($wpdb->prepare( "SELECT id,title FROM ".$wpdb->prefix."xyz_ihs_short_code WHERE status=%d ORDER BY id DESC",1),ARRAY_A );
13
- // print_r($xyz_snippets_arr);
14
- if(count($xyz_snippets_arr)==0)
15
- die;
16
-
17
- if(floatval(get_bloginfo('version'))>=3.9)
18
- {
19
- ?>
20
- (function() {
21
-
22
- tinymce.PluginManager.add('<?php echo $shortcodesXYZEH->buttonName; ?>', function( editor, url ) {
23
- editor.addButton( '<?php echo $shortcodesXYZEH->buttonName; ?>', {
24
- title: 'Insert HTML Snippet',
25
- type: 'menubutton',
26
- icon: 'icon xyz-ihs-own-icon',
27
- menu: [
28
- <?php foreach ($xyz_snippets_arr as $key=>$val) { ?>
29
- {
30
- text: '<?php echo addslashes($val['title']); ?>',
31
- value: '[xyz-ihs snippet="<?php echo addslashes($val['title']); ?>"]',
32
- onclick: function() {
33
- editor.insertContent(this.value());
34
- }
35
- },
36
- <?php } ?>
37
- ]
38
- });
39
- });
40
-
41
- })();
42
- <?php } else {
43
-
44
- $xyz_snippets = array(
45
- 'title' =>'Insert HTML Snippet',
46
- 'url' => plugins_url('insert-html-snippet/images/logo.png'),
47
- 'xyz_ihs_snippets' => $xyz_snippets_arr
48
- );
49
- ?>
50
-
51
- var tinymce_<?php echo $shortcodesXYZEH->buttonName; ?> =<?php echo json_encode($xyz_snippets) ?>;
52
-
53
-
54
- (function() {
55
- //******* Load plugin specific language pack
56
-
57
- tinymce.create('tinymce.plugins.<?php echo $shortcodesXYZEH->buttonName; ?>', {
58
- /**
59
- * Initializes the plugin, this will be executed after the plugin has been created.
60
- * This call is done before the editor instance has finished it's initialization so use the onInit event
61
- * of the editor instance to intercept that event.
62
- *
63
- * @param {tinymce.Editor} ed Editor instance that the plugin is initialized in.
64
- * @param {string} url Absolute URL to where the plugin is located.
65
- */
66
- init : function(ed, url) {
67
-
68
- tinymce_<?php echo $shortcodesXYZEH->buttonName; ?>.insert = function(){
69
- if(this.v && this.v != ''){
70
- tinymce.execCommand('mceInsertContent', false, '[xyz-ihs snippet="'+tinymce_<?php echo $shortcodesXYZEH->buttonName; ?>.xyz_ihs_snippets[this.v]['title']+'"]');
71
- }
72
- };
73
-
74
- },
75
-
76
- /**
77
- * Creates control instances based in the incomming name. This method is normally not
78
- * needed since the addButton method of the tinymce.Editor class is a more easy way of adding buttons
79
- * but you sometimes need to create more complex controls like listboxes, split buttons etc then this
80
- * method can be used to create those.
81
- *
82
- * @param {String} n Name of the control to create.
83
- * @param {tinymce.ControlManager} cm Control manager to use inorder to create new control.
84
- * @return {tinymce.ui.Control} New control instance or null if no control was created.
85
- */
86
- createControl : function(n, cm) {
87
- if(n=='<?php echo $shortcodesXYZEH->buttonName; ?>'){
88
- var c = cm.createSplitButton('<?php echo $shortcodesXYZEH->buttonName; ?>', {
89
- title : tinymce_<?php echo $shortcodesXYZEH->buttonName; ?>.title,
90
- image : tinymce_<?php echo $shortcodesXYZEH->buttonName; ?>.url,
91
- onclick : tinymce_<?php echo $shortcodesXYZEH->buttonName; ?>.insert
92
- });
93
-
94
- // Add some values to the list box
95
-
96
-
97
- c.onRenderMenu.add(function(c, m){
98
- for (var id in tinymce_<?php echo $shortcodesXYZEH->buttonName; ?>.xyz_ihs_snippets){
99
- m.add({
100
- v : id,
101
- title : tinymce_<?php echo $shortcodesXYZEH->buttonName; ?>.xyz_ihs_snippets[id]['title'],
102
- onclick : tinymce_<?php echo $shortcodesXYZEH->buttonName; ?>.insert
103
- });
104
- }
105
- });
106
-
107
-
108
- // Return the new listbox instance
109
- return c;
110
- }
111
-
112
- return null;
113
- },
114
-
115
-
116
- });
117
-
118
- // Register plugin
119
- tinymce.PluginManager.add('<?php echo $shortcodesXYZEH->buttonName; ?>', tinymce.plugins.<?php echo $shortcodesXYZEH->buttonName; ?>);
120
- })();
121
-
122
- <?php } ?>
 
 
 
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.');
8
+
9
+ if(!isset($shortcodesXYZEH))
10
+ $shortcodesXYZEH = new XYZ_Insert_Html_TinyMCESelector();
11
+
12
+ global $wpdb;
13
+
14
+
15
+ $xyz_snippets_arr=$wpdb->get_results($wpdb->prepare( "SELECT id,title FROM ".$wpdb->prefix."xyz_ihs_short_code WHERE status=%d ORDER BY id DESC",1),ARRAY_A );
16
+ // print_r($xyz_snippets_arr);
17
+ if(count($xyz_snippets_arr)==0)
18
+ die;
19
+
20
+ if(floatval(get_bloginfo('version'))>=3.9)
21
+ {
22
+ ?>
23
+ (function() {
24
+
25
+ tinymce.PluginManager.add('<?php echo $shortcodesXYZEH->buttonName; ?>', function( editor, url ) {
26
+ editor.addButton( '<?php echo $shortcodesXYZEH->buttonName; ?>', {
27
+ title: 'Insert HTML Snippet',
28
+ type: 'menubutton',
29
+ icon: 'icon xyz-ihs-own-icon',
30
+ menu: [
31
+ <?php foreach ($xyz_snippets_arr as $key=>$val) { ?>
32
+ {
33
+ text: '<?php echo addslashes($val['title']); ?>',
34
+ value: '[xyz-ihs snippet="<?php echo addslashes($val['title']); ?>"]',
35
+ onclick: function() {
36
+ editor.insertContent(this.value());
37
+ }
38
+ },
39
+ <?php } ?>
40
+ ]
41
+ });
42
+ });
43
+
44
+ })();
45
+ <?php } else {
46
+
47
+ $xyz_snippets = array(
48
+ 'title' =>'Insert HTML Snippet',
49
+ 'url' => plugins_url('insert-html-snippet/images/logo.png'),
50
+ 'xyz_ihs_snippets' => $xyz_snippets_arr
51
+ );
52
+ ?>
53
+
54
+ var tinymce_<?php echo $shortcodesXYZEH->buttonName; ?> =<?php echo json_encode($xyz_snippets) ?>;
55
+
56
+
57
+ (function() {
58
+ //******* Load plugin specific language pack
59
+
60
+ tinymce.create('tinymce.plugins.<?php echo $shortcodesXYZEH->buttonName; ?>', {
61
+ /**
62
+ * Initializes the plugin, this will be executed after the plugin has been created.
63
+ * This call is done before the editor instance has finished it's initialization so use the onInit event
64
+ * of the editor instance to intercept that event.
65
+ *
66
+ * @param {tinymce.Editor} ed Editor instance that the plugin is initialized in.
67
+ * @param {string} url Absolute URL to where the plugin is located.
68
+ */
69
+ init : function(ed, url) {
70
+
71
+ tinymce_<?php echo $shortcodesXYZEH->buttonName; ?>.insert = function(){
72
+ if(this.v && this.v != ''){
73
+ tinymce.execCommand('mceInsertContent', false, '[xyz-ihs snippet="'+tinymce_<?php echo $shortcodesXYZEH->buttonName; ?>.xyz_ihs_snippets[this.v]['title']+'"]');
74
+ }
75
+ };
76
+
77
+ },
78
+
79
+ /**
80
+ * Creates control instances based in the incomming name. This method is normally not
81
+ * needed since the addButton method of the tinymce.Editor class is a more easy way of adding buttons
82
+ * but you sometimes need to create more complex controls like listboxes, split buttons etc then this
83
+ * method can be used to create those.
84
+ *
85
+ * @param {String} n Name of the control to create.
86
+ * @param {tinymce.ControlManager} cm Control manager to use inorder to create new control.
87
+ * @return {tinymce.ui.Control} New control instance or null if no control was created.
88
+ */
89
+ createControl : function(n, cm) {
90
+ if(n=='<?php echo $shortcodesXYZEH->buttonName; ?>'){
91
+ var c = cm.createSplitButton('<?php echo $shortcodesXYZEH->buttonName; ?>', {
92
+ title : tinymce_<?php echo $shortcodesXYZEH->buttonName; ?>.title,
93
+ image : tinymce_<?php echo $shortcodesXYZEH->buttonName; ?>.url,
94
+ onclick : tinymce_<?php echo $shortcodesXYZEH->buttonName; ?>.insert
95
+ });
96
+
97
+ // Add some values to the list box
98
+
99
+
100
+ c.onRenderMenu.add(function(c, m){
101
+ for (var id in tinymce_<?php echo $shortcodesXYZEH->buttonName; ?>.xyz_ihs_snippets){
102
+ m.add({
103
+ v : id,
104
+ title : tinymce_<?php echo $shortcodesXYZEH->buttonName; ?>.xyz_ihs_snippets[id]['title'],
105
+ onclick : tinymce_<?php echo $shortcodesXYZEH->buttonName; ?>.insert
106
+ });
107
+ }
108
+ });
109
+
110
+
111
+ // Return the new listbox instance
112
+ return c;
113
+ }
114
+
115
+ return null;
116
+ },
117
+
118
+
119
+ });
120
+
121
+ // Register plugin
122
+ tinymce.PluginManager.add('<?php echo $shortcodesXYZEH->buttonName; ?>', tinymce.plugins.<?php echo $shortcodesXYZEH->buttonName; ?>);
123
+ })();
124
+
125
+ <?php } ?>
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-html-snippet.php CHANGED
@@ -3,7 +3,7 @@
3
  Plugin Name: Insert HTML Snippet
4
  Plugin URI: http://xyzscripts.com/wordpress-plugins/insert-html-snippet/
5
  Description: Add HTML code to your pages and posts easily using shortcodes. This plugin lets you create a shortcode corresponding to any random HTML code such as ad codes, javascript, video embedding, etc. 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-html-snippet
@@ -26,10 +26,8 @@ along with this program; if not, write to the Free Software
26
  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
27
  */
28
 
29
- // if ( !function_exists( 'add_action' ) ) {
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 +53,7 @@ require( dirname( __FILE__ ) . '/widget.php' );
55
 
56
  require( dirname( __FILE__ ) . '/direct_call.php' );
57
 
58
-
59
 
60
  if(get_option('xyz_credit_link')=="ihs"){
61
 
3
  Plugin Name: Insert HTML Snippet
4
  Plugin URI: http://xyzscripts.com/wordpress-plugins/insert-html-snippet/
5
  Description: Add HTML code to your pages and posts easily using shortcodes. This plugin lets you create a shortcode corresponding to any random HTML code such as ad codes, javascript, video embedding, etc. 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-html-snippet
26
  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
27
  */
28
 
29
+ if ( ! defined( 'ABSPATH' ) )
30
+ exit;
 
 
31
 
32
  ob_start();
33
 
53
 
54
  require( dirname( __FILE__ ) . '/direct_call.php' );
55
 
56
+ require( dirname( __FILE__ ) . '/admin/admin-notices.php' );
57
 
58
  if(get_option('xyz_credit_link')=="ihs"){
59
 
js/notice.js CHANGED
File without changes
readme.txt CHANGED
@@ -1,117 +1,120 @@
1
- === Insert Html Snippet ===
2
- Contributors: f1logic
3
- Donate link: http://xyzscripts.com/donate/
4
-
5
- Tags: insert HTML, add HTML, insert adsense, insert ads, insert addthis code, insert flash , insert javascript, add javascript, insert css, add css, HTML to shortcode, integrate ad codes, raw html, embed html, html inserter, ad inserter, css 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 HTML, CSS and javascript code to your pages and posts easily using shortcodes.
12
-
13
- == Description ==
14
-
15
- A quicklook into Insert Html Snippet
16
-
17
- ★ Convert HTML snippets to shortcodes
18
- ★ Convert Javascript codes to shortcodes
19
- ★ Convert CSS codes to shortcodes
20
- ★ Support for snippet shortcodes in widgets
21
- ★ Dropdown menu in TinyMCE editor to pick snippet shortcodes easily
22
- ★ Insert adsense or any adcode
23
- ★ Insert addthis or any social bookmarking code
24
- ★ Insert flash, videos etc. to your posts,pages and widgets
25
-
26
- = Features in Detail =
27
-
28
- Insert Html Snippet allows you to create shortcodes corresponding to html snippets. You can create a shortcode corresponding to any random HTML code such as ad codes (adsense or any adserver), javascript codes (addthis), video embedding codes, css codes etc. and use the same in your posts, pages or widgets.
29
-
30
- The shortcodes generated using the plugin are easily available as a dropdown in the standard wordpress content editor as well as in widget settings, thereby giving you ease of integrating your HTML snippets with your posts and pages.
31
-
32
- = About =
33
-
34
- Insert Html 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").
35
-
36
- ★ [Insert HTML Snippet User Guide](http://docs.xyzscripts.com/wordpress-plugins/insert-html-snippet/ "Insert HTML Snippet User Guide")
37
- ★ [Insert HTML Snippet FAQ](http://kb.xyzscripts.com/wordpress-plugins/insert-html-snippet/ "Insert HTML Snippet FAQ")
38
-
39
- == Installation ==
40
-
41
- ★ [Insert HTML Snippet User Guide](http://docs.xyzscripts.com/wordpress-plugins/insert-html-snippet/ "Insert HTML Snippet User Guide")
42
- ★ [Insert HTML Snippet FAQ](http://kb.xyzscripts.com/wordpress-plugins/insert-html-snippet/ "Insert HTML Snippet FAQ")
43
-
44
- 1. Extract `insert-html-snippet.zip` to your `/wp-content/plugins/` directory.
45
- 2. In the admin panel under plugins activate Insert Html Snippet.
46
-
47
- If you need any further help, you may contact our [support desk](http://xyzscripts.com/support/ "XYZScripts Support").
48
-
49
- == Frequently Asked Questions ==
50
-
51
- ★ [Insert HTML Snippet User Guide](http://docs.xyzscripts.com/wordpress-plugins/insert-html-snippet/ "Insert HTML Snippet User Guide")
52
- ★ [Insert HTML Snippet FAQ](http://kb.xyzscripts.com/wordpress-plugins/insert-html-snippet/ "Insert HTML Snippet FAQ")
53
-
54
- = The Insert Html Snippet is not working properly. =
55
-
56
- Please check the wordpress version you are using. Make sure it meets the minimum version recommended by us. Make sure all files of the `insert html snippet` plugin uploaded to the folder `wp-content/plugins/`
57
-
58
- = Can I use shortcodes in html snippet ? =
59
-
60
- Yes ofcourse.
61
-
62
- = I have 2 html shortcodes placed adjacently, but only one of them works. =
63
-
64
- Please use a whitespace to separate 2 shortcodes.
65
-
66
- More questions ? [Drop a mail](http://xyzscripts.com/members/support/ "XYZScripts Support") and we shall get back to you with the answers.
67
-
68
-
69
- == Screenshots ==
70
-
71
- 1. This is the shortcode generator page
72
- 2. This is page where you can manage all your snippets
73
- 3. The shortcodes are easily accessible in the content editor
74
-
75
-
76
- == Changelog ==
77
-
78
- = 1.2 =
79
- * Compatibility with wordpress 4.3
80
- * Added options to sort snippets in admin area by id and title
81
- * Removed redirection after snippet edit
82
-
83
- = 1.1.1 =
84
- * Compatibility with wordpress 3.9
85
-
86
- = 1.1 =
87
- * Support for shortcodes in html content
88
- * Snippet chooser TinyMCE plugin modified
89
- * A few bug fixes
90
-
91
- = 1.0.1 =
92
- * Support for network installation
93
- * Pagination bug fix
94
-
95
- = 1.0 =
96
- * First official launch.
97
-
98
- == Upgrade Notice ==
99
-
100
-
101
- == More Information ==
102
-
103
- ★ [Insert HTML Snippet User Guide](http://docs.xyzscripts.com/wordpress-plugins/insert-html-snippet/ "Insert HTML Snippet User Guide")
104
- [Insert HTML Snippet FAQ](http://kb.xyzscripts.com/wordpress-plugins/insert-html-snippet/ "Insert HTML Snippet FAQ")
105
-
106
- = Troubleshooting =
107
-
108
- Please read the FAQ first if you are having problems.
109
-
110
- = Requirements =
111
-
112
- WordPress 3.0+
113
- PHP 5+
114
-
115
- = Feedback =
116
-
117
- We would like to receive your feedback and suggestions. You may submit them at our [support desk](http://xyzscripts.com/members/support/ "XYZScripts Support").
 
 
 
1
+ === Insert Html Snippet ===
2
+ Contributors: f1logic
3
+ Donate link: http://xyzscripts.com/donate/
4
+
5
+ Tags: insert HTML, add HTML, insert adsense, insert ads, insert addthis code, insert flash , insert javascript, add javascript, insert css, add css, HTML to shortcode, integrate ad codes, raw html, embed html, html inserter, ad inserter, css inserter
6
+ Requires at least: 2.8
7
+ Tested up to: 4.6.1
8
+ Stable tag: 1.2.1
9
+ License: GPLv2 or later
10
+
11
+ Add HTML, CSS and javascript code to your pages and posts easily using shortcodes.
12
+
13
+ == Description ==
14
+
15
+ A quicklook into Insert Html Snippet
16
+
17
+ ★ Convert HTML snippets to shortcodes
18
+ ★ Convert Javascript codes to shortcodes
19
+ ★ Convert CSS codes to shortcodes
20
+ ★ Support for snippet shortcodes in widgets
21
+ ★ Dropdown menu in TinyMCE editor to pick snippet shortcodes easily
22
+ ★ Insert adsense or any adcode
23
+ ★ Insert addthis or any social bookmarking code
24
+ ★ Insert flash, videos etc. to your posts,pages and widgets
25
+
26
+ = Features in Detail =
27
+
28
+ Insert Html Snippet allows you to create shortcodes corresponding to html snippets. You can create a shortcode corresponding to any random HTML code such as ad codes (adsense or any adserver), javascript codes (addthis), video embedding codes, css codes etc. and use the same in your posts, pages or widgets.
29
+
30
+ The shortcodes generated using the plugin are easily available as a dropdown in the standard wordpress content editor as well as in widget settings, thereby giving you ease of integrating your HTML snippets with your posts and pages.
31
+
32
+ = About =
33
+
34
+ Insert Html 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").
35
+
36
+ ★ [Insert HTML Snippet User Guide](http://docs.xyzscripts.com/wordpress-plugins/insert-html-snippet/ "Insert HTML Snippet User Guide")
37
+ ★ [Insert HTML Snippet FAQ](http://kb.xyzscripts.com/wordpress-plugins/insert-html-snippet/ "Insert HTML Snippet FAQ")
38
+
39
+ == Installation ==
40
+
41
+ ★ [Insert HTML Snippet User Guide](http://docs.xyzscripts.com/wordpress-plugins/insert-html-snippet/ "Insert HTML Snippet User Guide")
42
+ ★ [Insert HTML Snippet FAQ](http://kb.xyzscripts.com/wordpress-plugins/insert-html-snippet/ "Insert HTML Snippet FAQ")
43
+
44
+ 1. Extract `insert-html-snippet.zip` to your `/wp-content/plugins/` directory.
45
+ 2. In the admin panel under plugins activate Insert Html Snippet.
46
+
47
+ If you need any further help, you may contact our [support desk](http://xyzscripts.com/support/ "XYZScripts Support").
48
+
49
+ == Frequently Asked Questions ==
50
+
51
+ ★ [Insert HTML Snippet User Guide](http://docs.xyzscripts.com/wordpress-plugins/insert-html-snippet/ "Insert HTML Snippet User Guide")
52
+ ★ [Insert HTML Snippet FAQ](http://kb.xyzscripts.com/wordpress-plugins/insert-html-snippet/ "Insert HTML Snippet FAQ")
53
+
54
+ = The Insert Html Snippet is not working properly. =
55
+
56
+ Please check the wordpress version you are using. Make sure it meets the minimum version recommended by us. Make sure all files of the `insert html snippet` plugin uploaded to the folder `wp-content/plugins/`
57
+
58
+ = Can I use shortcodes in html snippet ? =
59
+
60
+ Yes ofcourse.
61
+
62
+ = I have 2 html shortcodes placed adjacently, but only one of them works. =
63
+
64
+ Please use a whitespace to separate 2 shortcodes.
65
+
66
+ More questions ? [Drop a mail](http://xyzscripts.com/members/support/ "XYZScripts Support") and we shall get back to you with the answers.
67
+
68
+
69
+ == Screenshots ==
70
+
71
+ 1. This is the shortcode generator page
72
+ 2. This is page where you can manage all your snippets
73
+ 3. The shortcodes are easily accessible in the content editor
74
+
75
+
76
+ == Changelog ==
77
+
78
+ = 1.2.1 =
79
+ * A few bug fixes.
80
+
81
+ = 1.2 =
82
+ * Compatibility with wordpress 4.3
83
+ * Added options to sort snippets in admin area by id and title
84
+ * Removed redirection after snippet edit
85
+
86
+ = 1.1.1 =
87
+ * Compatibility with wordpress 3.9
88
+
89
+ = 1.1 =
90
+ * Support for shortcodes in html content
91
+ * Snippet chooser TinyMCE plugin modified
92
+ * A few bug fixes
93
+
94
+ = 1.0.1 =
95
+ * Support for network installation
96
+ * Pagination bug fix
97
+
98
+ = 1.0 =
99
+ * First official launch.
100
+
101
+ == Upgrade Notice ==
102
+
103
+
104
+ == More Information ==
105
+
106
+ [Insert HTML Snippet User Guide](http://docs.xyzscripts.com/wordpress-plugins/insert-html-snippet/ "Insert HTML Snippet User Guide")
107
+ ★ [Insert HTML Snippet FAQ](http://kb.xyzscripts.com/wordpress-plugins/insert-html-snippet/ "Insert HTML Snippet FAQ")
108
+
109
+ = Troubleshooting =
110
+
111
+ Please read the FAQ first if you are having problems.
112
+
113
+ = Requirements =
114
+
115
+ WordPress 3.0+
116
+ PHP 5+
117
+
118
+ = Feedback =
119
+
120
+ We would like to receive your feedback and suggestions. You may submit them at our [support desk](http://xyzscripts.com/members/support/ "XYZScripts Support").
shortcode-handler.php CHANGED
@@ -1,4 +1,7 @@
1
  <?php
 
 
 
2
  global $wpdb;
3
 
4
  add_shortcode('xyz-ihs','xyz_ihs_display_content');
1
  <?php
2
+ if ( ! defined( 'ABSPATH' ) )
3
+ exit;
4
+
5
  global $wpdb;
6
 
7
  add_shortcode('xyz-ihs','xyz_ihs_display_content');
widget.php CHANGED
@@ -1,5 +1,6 @@
1
  <?php
2
-
 
3
  /**
4
  * XYZScripts Insert HTML Snippet Widget Class
5
  */
1
  <?php
2
+ if ( ! defined( 'ABSPATH' ) )
3
+ exit;
4
  /**
5
  * XYZScripts Insert HTML Snippet Widget Class
6
  */
xyz-functions.php CHANGED
@@ -1,52 +1,54 @@
1
- <?php
2
-
3
- if(!function_exists('xyz_ihs_plugin_get_version'))
4
- {
5
- function xyz_ihs_plugin_get_version()
6
- {
7
- if ( ! function_exists( 'get_plugins' ) )
8
- require_once( ABSPATH . 'wp-admin/includes/plugin.php' );
9
- $plugin_folder = get_plugins( '/' . plugin_basename( dirname( XYZ_INSERT_HTML_PLUGIN_FILE ) ) );
10
- // print_r($plugin_folder);
11
- return $plugin_folder['insert-html-snippet.php']['Version'];
12
- }
13
- }
14
-
15
- if(!function_exists('xyz_trim_deep'))
16
- {
17
-
18
- function xyz_trim_deep($value) {
19
- if ( is_array($value) ) {
20
- $value = array_map('xyz_trim_deep', $value);
21
- } elseif ( is_object($value) ) {
22
- $vars = get_object_vars( $value );
23
- foreach ($vars as $key=>$data) {
24
- $value->{$key} = xyz_trim_deep( $data );
25
- }
26
- } else {
27
- $value = trim($value);
28
- }
29
-
30
- return $value;
31
- }
32
-
33
- }
34
-
35
-
36
- if(!function_exists('xyz_ihs_links')){
37
- function xyz_ihs_links($links, $file) {
38
- $base = plugin_basename(XYZ_INSERT_HTML_PLUGIN_FILE);
39
- if ($file == $base) {
40
-
41
- $links[] = '<a href="http://xyzscripts.com/support/" class="xyz_support" title="Support"></a>';
42
- $links[] = '<a href="http://twitter.com/xyzscripts" class="xyz_twitt" title="Follow us on Twitter"></a>';
43
- $links[] = '<a href="https://www.facebook.com/xyzscripts" class="xyz_fbook" title="Like us on Facebook"></a>';
44
- $links[] = '<a href="https://plus.google.com/+Xyzscripts/" class="xyz_gplus" title="+1 us on Google+"></a>';
45
- $links[] = '<a href="http://www.linkedin.com/company/xyzscripts" class="xyz_linkedin" title="Follow us on LinkedIn"></a>';
46
- }
47
- return $links;
48
- }
49
- }
50
- add_filter( 'plugin_row_meta','xyz_ihs_links',10,2);
51
-
 
 
52
  ?>
1
+ <?php
2
+ if ( ! defined( 'ABSPATH' ) )
3
+ exit;
4
+
5
+ if(!function_exists('xyz_ihs_plugin_get_version'))
6
+ {
7
+ function xyz_ihs_plugin_get_version()
8
+ {
9
+ if ( ! function_exists( 'get_plugins' ) )
10
+ require_once( ABSPATH . 'wp-admin/includes/plugin.php' );
11
+ $plugin_folder = get_plugins( '/' . plugin_basename( dirname( XYZ_INSERT_HTML_PLUGIN_FILE ) ) );
12
+ // print_r($plugin_folder);
13
+ return $plugin_folder['insert-html-snippet.php']['Version'];
14
+ }
15
+ }
16
+
17
+ if(!function_exists('xyz_trim_deep'))
18
+ {
19
+
20
+ function xyz_trim_deep($value) {
21
+ if ( is_array($value) ) {
22
+ $value = array_map('xyz_trim_deep', $value);
23
+ } elseif ( is_object($value) ) {
24
+ $vars = get_object_vars( $value );
25
+ foreach ($vars as $key=>$data) {
26
+ $value->{$key} = xyz_trim_deep( $data );
27
+ }
28
+ } else {
29
+ $value = trim($value);
30
+ }
31
+
32
+ return $value;
33
+ }
34
+
35
+ }
36
+
37
+
38
+ if(!function_exists('xyz_ihs_links')){
39
+ function xyz_ihs_links($links, $file) {
40
+ $base = plugin_basename(XYZ_INSERT_HTML_PLUGIN_FILE);
41
+ if ($file == $base) {
42
+
43
+ $links[] = '<a href="http://xyzscripts.com/support/" class="xyz_support" title="Support"></a>';
44
+ $links[] = '<a href="http://twitter.com/xyzscripts" class="xyz_twitt" title="Follow us on Twitter"></a>';
45
+ $links[] = '<a href="https://www.facebook.com/xyzscripts" class="xyz_fbook" title="Like us on Facebook"></a>';
46
+ $links[] = '<a href="https://plus.google.com/+Xyzscripts/" class="xyz_gplus" title="+1 us on Google+"></a>';
47
+ $links[] = '<a href="http://www.linkedin.com/company/xyzscripts" class="xyz_linkedin" title="Follow us on LinkedIn"></a>';
48
+ }
49
+ return $links;
50
+ }
51
+ }
52
+ add_filter( 'plugin_row_meta','xyz_ihs_links',10,2);
53
+
54
  ?>