Insert PHP Code Snippet - Version 1.2.2

Version Description

  • Automatic detection and correction of php opening and closing tags in snippet
  • Updated nonces and validations
  • Premium version details and comparison added
Download this release

Release Info

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

Code changes from version 1.2.1 to 1.2.2

add_shortcode_tynimce.php CHANGED
@@ -1,43 +1,43 @@
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
- ?>
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,41 +1,197 @@
1
  <?php
2
- if ( ! defined( 'ABSPATH' ) )
3
- exit;
4
-
5
-
6
  ?>
7
- <style>
8
- </style>
9
-
10
- <h1 style="visibility: visible;">Insert PHP Code Snippet (V <?php echo xyz_ips_plugin_get_version(); ?>)</h1>
11
- Integrate PHP code seamlessly to your wordpress. This plugin lets you generate a shortcode corresponding to any random PHP code. The shortcodes can be used in your pages, posts and widgets. Insert PHP Snippet is developed and maintained by <a href="http://xyzscripts.com">xyzscripts</a>.
12
 
13
 
14
- <br />
15
- <h2>Features</h2>
16
-
17
- <div>
18
- <p></p>
19
 
20
- <div style="float: left;">
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
21
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
22
 
23
- <ul>
24
- <li>Convert PHP Code snippets to shortcodes</li>
25
- <li>Support for shortcodes in widgets</li>
26
- <li>Dropdown menu in TinyMCE editor to pick snippets easily</li>
27
- </ul>
28
-
29
-
30
- </div>
31
-
32
-
33
-
34
- </div>
35
-
36
-
37
-
38
-
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
39
  <div style="clear: both;"></div>
 
40
 
41
-
1
  <?php
2
+ if( !defined('ABSPATH') ){ exit();}
 
 
 
3
  ?>
 
 
 
 
 
4
 
5
 
6
+ <h1 style="visibility: visible;">Insert PHP Code Snippet (V <?php echo xyz_ips_plugin_get_version(); ?>)</h1>
 
 
 
 
7
 
8
+ <div style="width: 99%">
9
+ <p style="text-align: justify">
10
+ Integrate PHP code seamlessly to your wordpress. This plugin lets you generate a shortcode corresponding to any random PHP code. The shortcodes can be used in your pages, posts and widgets. Insert PHP Snippet is developed and maintained by <a href="http://xyzscripts.com" target="_blank">xyzscripts</a>.</p>
11
+
12
+
13
+ <p style="text-align: justify">
14
+ If you would like to have more features , please try <a
15
+ href="https://xyzscripts.com/wordpress-plugins/xyz-wp-insert-code-snippet/details"
16
+ target="_blank">XYZ WP Insert Code Snippet</a> which is a premium version of this
17
+ plugin. We have included a quick comparison of the free and premium
18
+ plugins for your reference.
19
+ </p>
20
+ </div>
21
+ <table class="xyz-premium-comparison" cellspacing=0 style="width: 99%;">
22
+ <tr style="background-color: #EDEDED">
23
+ <td><h2>Feature group</h2></td>
24
+ <td><h2>Feature</h2></td>
25
+ <td><h2>Free</h2>
26
+ </td>
27
+ <td><h2>Premium</h2></td>
28
+ </tr>
29
+ <!-- Supported Media -->
30
+ <tr>
31
+ <td rowspan="5"><h4>Shortcodes</h4></td>
32
+ <td>Convert HTML snippets to shortcodes</td>
33
+ <td><img src="<?php echo plugins_url('images/tick.png',XYZ_INSERT_PHP_PLUGIN_FILE);?>">
34
+ </td>
35
+ <td><img src="<?php echo plugins_url('images/tick.png',XYZ_INSERT_PHP_PLUGIN_FILE);?>">
36
+ </td>
37
+ </tr>
38
 
39
+ <tr>
40
+ <td>Convert Javascript codes to shortcodes</td>
41
+ <td><img src="<?php echo plugins_url('images/tick.png',XYZ_INSERT_PHP_PLUGIN_FILE);?>">
42
+ </td>
43
+ <td><img src="<?php echo plugins_url('images/tick.png',XYZ_INSERT_PHP_PLUGIN_FILE);?>">
44
+ </td>
45
+ </tr>
46
+ <tr>
47
+ <td>Convert CSS codes to shortcodes</td>
48
+ <td><img src="<?php echo plugins_url('images/tick.png',XYZ_INSERT_PHP_PLUGIN_FILE);?>">
49
+ </td>
50
+ <td><img src="<?php echo plugins_url('images/tick.png',XYZ_INSERT_PHP_PLUGIN_FILE);?>">
51
+ </td>
52
+ </tr>
53
+ <tr>
54
+ <td>Convert PHP snippets to shortcodes</td>
55
+ <td><img src="<?php echo plugins_url('images/tick.png',XYZ_INSERT_PHP_PLUGIN_FILE);?>">
56
+ </td>
57
+ <td><img src="<?php echo plugins_url('images/tick.png',XYZ_INSERT_PHP_PLUGIN_FILE);?>">
58
+ </td>
59
+ </tr>
60
+ <tr>
61
+ <td><b>Passing custom parameters to shortcode</b></td>
62
+ <td><img src="<?php echo plugins_url('images/cross.png',XYZ_INSERT_PHP_PLUGIN_FILE);?>">
63
+ </td>
64
+ <td><img src="<?php echo plugins_url('images/tick.png',XYZ_INSERT_PHP_PLUGIN_FILE);?>">
65
+ </td>
66
+ </tr>
67
+ <!-- Posting Options -->
68
+ <tr>
69
+ <td rowspan="3"><h4>Third party code</h4></td>
70
+ <td>Insert adsense or any adcode</td>
71
+ <td><img src="<?php echo plugins_url('images/tick.png',XYZ_INSERT_PHP_PLUGIN_FILE);?>">
72
+ </td>
73
+ <td><img src="<?php echo plugins_url('images/tick.png',XYZ_INSERT_PHP_PLUGIN_FILE);?>">
74
+ </td>
75
+ </tr>
76
+
77
+ <tr>
78
+ <td>Insert addthis or any social bookmarking code</td>
79
+ <td><img src="<?php echo plugins_url('images/tick.png',XYZ_INSERT_PHP_PLUGIN_FILE);?>">
80
+ </td>
81
+ <td><img src="<?php echo plugins_url('images/tick.png',XYZ_INSERT_PHP_PLUGIN_FILE);?>">
82
+ </td>
83
+ </tr>
84
 
85
+ <tr>
86
+ <td>Insert flash, videos etc. to your posts,pages and widgets</td>
87
+ <td><img src="<?php echo plugins_url('images/tick.png',XYZ_INSERT_PHP_PLUGIN_FILE);?>">
88
+ </td>
89
+ <td><img src="<?php echo plugins_url('images/tick.png',XYZ_INSERT_PHP_PLUGIN_FILE);?>">
90
+ </td>
91
+ </tr>
92
+
93
+ <!-- Snippet Management -->
94
+
95
+ <tr>
96
+ <td rowspan="4"><h4>Snippet Management</h4></td>
97
+ <td><b>Syntax highlighter for snippet creation</b></td>
98
+ <td><img src="<?php echo plugins_url('images/cross.png',XYZ_INSERT_PHP_PLUGIN_FILE);?>">
99
+ </td>
100
+ <td><img src="<?php echo plugins_url('images/tick.png',XYZ_INSERT_PHP_PLUGIN_FILE);?>">
101
+ </td>
102
+ </tr>
103
+
104
+
105
+ <tr>
106
+ <td><b>Option to duplicate snippet</b></td>
107
+ <td><img src="<?php echo plugins_url('images/cross.png',XYZ_INSERT_PHP_PLUGIN_FILE);?>">
108
+ </td>
109
+ <td><img src="<?php echo plugins_url('images/tick.png',XYZ_INSERT_PHP_PLUGIN_FILE);?>">
110
+ </td>
111
+ </tr>
112
+
113
+ <tr>
114
+ <td><b>Export snippets</b></td>
115
+ <td><img src="<?php echo plugins_url('images/cross.png',XYZ_INSERT_PHP_PLUGIN_FILE);?>">
116
+ </td>
117
+ <td><img src="<?php echo plugins_url('images/tick.png',XYZ_INSERT_PHP_PLUGIN_FILE);?>">
118
+ </td>
119
+ </tr>
120
+ <tr>
121
+ <td><b>Import snippets</b></td>
122
+ <td><img src="<?php echo plugins_url('images/cross.png',XYZ_INSERT_PHP_PLUGIN_FILE);?>">
123
+ </td>
124
+ <td><img src="<?php echo plugins_url('images/tick.png',XYZ_INSERT_PHP_PLUGIN_FILE);?>">
125
+ </td>
126
+ </tr>
127
+
128
+ <!-- Privilege Management -->
129
+ <tr>
130
+ <td rowspan="3"><h4>Privilege Management</h4></td>
131
+ <td><b>Role/User based Snippet Management Privilege</b></td>
132
+ <td><img src="<?php echo plugins_url('images/cross.png',XYZ_INSERT_PHP_PLUGIN_FILE);?>">
133
+ </td>
134
+ <td><img src="<?php echo plugins_url('images/tick.png',XYZ_INSERT_PHP_PLUGIN_FILE);?>">
135
+ </td>
136
+ </tr>
137
+
138
+ <tr>
139
+ <td><b>Role/User based Snippet Usage Privilege</b></td>
140
+ <td><img src="<?php echo plugins_url('images/cross.png',XYZ_INSERT_PHP_PLUGIN_FILE);?>">
141
+ </td>
142
+ <td><img src="<?php echo plugins_url('images/tick.png',XYZ_INSERT_PHP_PLUGIN_FILE);?>">
143
+ </td>
144
+ </tr>
145
+ <tr>
146
+ <td><b>Master Password for super admin</b></td>
147
+ <td><img src="<?php echo plugins_url('images/cross.png',XYZ_INSERT_PHP_PLUGIN_FILE);?>">
148
+ </td>
149
+ <td><img src="<?php echo plugins_url('images/tick.png',XYZ_INSERT_PHP_PLUGIN_FILE);?>">
150
+ </td>
151
+ </tr>
152
+
153
+ <!-- Integration -->
154
+
155
+ <tr>
156
+ <td rowspan="3"><h4>Integration</h4></td>
157
+ <td>Integrate to posts/pages</td>
158
+ <td><img src="<?php echo plugins_url('images/tick.png',XYZ_INSERT_PHP_PLUGIN_FILE);?>">
159
+ </td>
160
+ <td><img src="<?php echo plugins_url('images/tick.png',XYZ_INSERT_PHP_PLUGIN_FILE);?>">
161
+ </td>
162
+ </tr>
163
+
164
+ <tr>
165
+ <td>Support for shortcodes in widgets</td>
166
+ <td><img src="<?php echo plugins_url('images/tick.png',XYZ_INSERT_PHP_PLUGIN_FILE);?>">
167
+ </td>
168
+ <td><img src="<?php echo plugins_url('images/tick.png',XYZ_INSERT_PHP_PLUGIN_FILE);?>">
169
+ </td>
170
+ </tr>
171
+
172
+ <tr>
173
+ <td>Dropdown menu in TinyMCE editor to pick snippets easily</td>
174
+ <td><img src="<?php echo plugins_url('images/tick.png',XYZ_INSERT_PHP_PLUGIN_FILE);?>">
175
+ </td>
176
+ <td><img src="<?php echo plugins_url('images/tick.png',XYZ_INSERT_PHP_PLUGIN_FILE);?>">
177
+ </td>
178
+ </tr>
179
+ <tr>
180
+ <td rowspan="2"><h4>Other</h4></td>
181
+ <td>Price</td>
182
+ <td>FREE</td>
183
+ <td>Starts from 19 USD</td>
184
+ </tr>
185
+ <tr>
186
+ <td>Purchase</td>
187
+ <td></td>
188
+ <td style="padding: 2px" ><a target="_blank"href="https://xyzscripts.com/members/product/purchase/XYZWPICSPRE" class="xyz-buy-button">Buy Now</a>
189
+ </td>
190
+ </tr>
191
+
192
+ </table>
193
+ <br/>
194
  <div style="clear: both;"></div>
195
+ <?php
196
 
197
+ ?>
admin/admin-notices.php CHANGED
@@ -34,24 +34,24 @@ $sharelink_text_ips = $sharelink_text_array_ips[$sharelink_text_ips];
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>';
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" class="error" style="color: #666666;margin-left: 2px; padding: 5px;line-height:16px;">
38
+ <p>Thank you for using <a href="https://wordpress.org/plugins/insert-php-code-snippet/" target="_blank"> Insert PHP Code Snippet </a> plugin from <a href="https://xyzscripts.com/" target="_blank">xyzscripts.com</a>. 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/plugin/insert-php-code-snippet/reviews" class="button xyz_rate_btn" 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 xyz_backlink_btn" target="_blank">Enable backlink</a>';
43
 
44
+ echo '<a class="button xyz_share_btn" onclick=xyz_ips_shareon_tckbox();>Share on</a>
45
+ <a href="https://xyzscripts.com/donate/5" class="button xyz_donate_btn" target="_blank">Donate</a>
46
 
47
+ <a href="admin.php?page=insert-php-code-snippet-settings&ips_notice=hide" class="button xyz_show_btn">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=https://wordpress.org/plugins/insert-php-code-snippet/&text='.$sharelink_text_ips.'" target="_blank">Facebook</a>
52
+ <a class="button" style="background-color:#00aced;color:white;margin-right:4px;margin-left:20px;margin-top: 25px;" href="https://twitter.com/share?url=https://wordpress.org/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="https://www.linkedin.com/shareArticle?mini=true&url=https://wordpress.org/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=https://wordpress.org/plugins/insert-php-code-snippet/" target="_blank">google+</a>
55
 
56
  </div>
57
  </div>';
admin/ajax-backlink.php DELETED
@@ -1,16 +0,0 @@
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
-
7
- global $wpdb;
8
-
9
- if($_POST){
10
- update_option('xyz_credit_link','ips');
11
-
12
- }
13
- }
14
-
15
-
16
- ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
admin/footer.php CHANGED
@@ -2,31 +2,102 @@
2
  if ( ! defined( 'ABSPATH' ) )
3
  exit;
4
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
5
  ?>
6
-
7
-
8
  <div style="clear: both;"></div>
9
 
10
-
11
- <p></p>
12
 
13
  <div style="width: 100%">
14
-
15
- <div class="xyz_feedback">
16
-
17
-
18
- <a target="_blank" href="http://xyzscripts.com/support/" class="xyz_suggest">Suggestions</a> -
19
- <a target="_blank" href="http://facebook.com/xyzscripts" class="xyz_fbook">Like us on Facebook</a> -
20
- <a target="_blank" href="http://twitter.com/xyzscripts" class="xyz_twitt">Follow us on Twitter</a> -
21
- <a target="_blank" href="https://plus.google.com/+Xyzscripts/" class="xyz_gplus">+1 us on Google+</a> -
22
- <a target="_blank" href="http://www.linkedin.com/company/xyzscripts" class="xyz_linkedin">Follow us on LinkedIn</a>
23
-
24
-
25
- </div>
26
-
27
- <p></p>
28
-
29
- <div class="xyz_subscribe">
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
30
 
31
  <script language="javascript">
32
  function check_email(emailString)
@@ -35,7 +106,7 @@ function check_email(emailString)
35
  var matchArray = emailString.match(mailPattern);
36
  if (emailString.length == 0)
37
  return false;
38
-
39
  if (matchArray == null) {
40
  return false;
41
  }else{
@@ -43,22 +114,22 @@ function check_email(emailString)
43
  }
44
  }
45
 
46
-
47
  function verify_lists(form)
48
  {
49
-
50
  var total=0;
51
  var checkBox=form['chk[]'];
52
-
53
  if(checkBox.length){
54
-
55
  for(var i=0;i<checkBox.length;i++){
56
  checkBox[i].checked?total++:null;
57
  }
58
  }else{
59
-
60
  checkBox.checked?total++:null;
61
-
62
  }
63
  if(total>0){
64
  return true;
@@ -67,7 +138,7 @@ function verify_lists(form)
67
  }
68
 
69
  }
70
-
71
  function verify_fields()
72
  {
73
 
@@ -84,73 +155,96 @@ function verify_fields()
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">
91
  <input type="hidden" name="redirPending" value="http://xyzscripts.com/subscription/active/XYZWPIPSFRE">
92
  <input type="hidden" name="mode" value="1">
93
-
94
- <b>Stay tuned to our updates :</b>
95
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
96
 
97
- Name :
98
- <input style="border: 1px solid #3fafe3; margin-right:10px;" type="text" name="field1" value="<?php
99
- if ($current_user->user_firstname != "" || $current_user->user_lastname != "")
100
  {
101
- echo $current_user->user_firstname . " " . $current_user->user_lastname;
102
- }
103
- else if (strcasecmp($current_user->display_name, 'admin')!=0 && strcasecmp($current_user->display_name , "administrator")!=0 )
104
  {
105
- echo $current_user->display_name;
106
- }
107
- else if (strcasecmp($current_user->user_login ,"admin")!=0 && strcasecmp($current_user->user_login , "administrator")!=0 )
108
  {
109
- echo $current_user->user_login;
110
  }
111
  ?>" >
112
 
113
- Email Address :
114
- <input style="border: 1px solid #3fafe3;" name="email"
115
- type="text" value="<?php echo $current_user->user_email; ?>" /><span style="color:#FF0000">*</span>
116
 
117
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
118
- <input id="submit_ips" style="color:#FFFFFF;border-radius:4px;border:1px solid #1A87B9;" type="submit" value="Subscribe" name="Submit" onclick="javascript: if(!verify_fields()) return false; " />
119
 
120
  <input type="hidden" name="listName" value="6,1,"/>
121
  </form>
122
-
123
 
124
 
125
- </div>
126
 
127
 
128
- <div style="clear: both;"></div>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
129
  <div style="width: 100%">
130
 
131
- <div class="xyz_our_plugins">
132
- Our Plugins :
133
-
134
-
135
- <a target="_blank" href="http://wordpress.org/extend/plugins/insert-html-snippet/">Insert HTML Snippet</a>
136
- <a target="_blank" href="http://wordpress.org/extend/plugins/lightbox-pop/">Lightbox Pop</a>
137
- <a target="_blank" href="http://wordpress.org/extend/plugins/full-screen-popup/">Full Screen Popup</a>
138
- <a target="_blank" href="http://wordpress.org/extend/plugins/popup-dialog-box/">Popup Dialog Box</a> ★
139
- <a target="_blank" href="http://wordpress.org/extend/plugins/quick-bar/">Quick Bar</a>
140
- <a target="_blank" href="http://wordpress.org/extend/plugins/quick-box-popup/">Quick Box Popup</a>
141
- <a target="_blank" href="http://wordpress.org/extend/plugins/contact-form-manager/">Contact Form Manager</a>
142
- <a target="_blank" href="http://wordpress.org/extend/plugins/newsletter-manager/">Newsletter Manager</a>
143
- <a target="_blank" href="http://wordpress.org/extend/plugins/social-media-auto-publish/">Social Media Auto Publish</a>★
144
- <a target="_blank" href="http://wordpress.org/extend/plugins/facebook-auto-publish/">Facebook Auto Publish</a> ★
145
- <a target="_blank" href="http://wordpress.org/extend/plugins/linkedin-auto-publish/">LinkedIn Auto Publish</a> ★
146
- <a target="_blank" href="http://wordpress.org/extend/plugins/twitter-auto-publish/">Twitter Auto Publish</a> ★
147
- <a target="_blank" href="http://wordpress.org/extend/plugins/insert-php-code-snippet/">Insert PHP Code Snippet</a>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
148
  </div>
149
- </div>
150
- <div class="poweredBy">
151
  Powered by <a href="http://xyzscripts.com" target="_blank">XYZScripts</a>
152
- </div>
153
  <div style="clear: both;"></div>
154
 
155
- </div>
156
- <p style="clear: both;"></p>
2
  if ( ! defined( 'ABSPATH' ) )
3
  exit;
4
 
5
+ if(get_option('xyz_ips_premium_version_ads')==1){?>
6
+ <div id="xyz-ips-premium">
7
+
8
+ <div style="float: left; padding: 0 5px">
9
+ <h2 style="vertical-align: middle;">
10
+ <a target="_blank"
11
+ href="https://xyzscripts.com/wordpress-plugins/xyz-wp-insert-code-snippet/details
12
+ ">Fully Featured XYZ WP Insert Code Snippet Premium Plugin</a> - Just 19 USD
13
+ </h2>
14
+ </div>
15
+ <div style="float: left; margin-top: 3px">
16
+ <a target="_blank"
17
+ href="https://xyzscripts.com/members/product/purchase/XYZWPICSPRE"><img
18
+ src="<?php echo plugins_url("images/orange_buynow.png",XYZ_INSERT_PHP_PLUGIN_FILE); ?>">
19
+ </a>
20
+ </div>
21
+ <div style="float: left; padding: 0 5px">
22
+ <h2 style="vertical-align: middle;text-shadow: 1px 1px 1px #686868">
23
+ ( <a href="<?php echo admin_url('admin.php?page=insert-php-code-snippet-about');?>">Compare Features</a> )
24
+ </h2>
25
+ </div>
26
+ </div>
27
+ <?php
28
+ }
29
  ?>
 
 
30
  <div style="clear: both;"></div>
31
 
 
 
32
 
33
  <div style="width: 100%">
34
+
35
+
36
+ <div class="xyz_ips_social_media">
37
+
38
+
39
+ <h3 class="xyz_ips_inner_head">Follow Us </h3>
40
+
41
+
42
+ <a target="_blank" href="http://facebook.com/xyzscripts" class="xyz_home_fbook"></a>
43
+ <a target="_blank" href="http://twitter.com/xyzscripts" class="xyz_home_twitt"></a>
44
+ <a target="_blank" href="https://plus.google.com/+Xyzscripts/" class="xyz_home_gplus"></a>
45
+ <a style="margin-right:0px;" target="_blank" href="https://www.linkedin.com/company/xyzscripts" class="xyz_home_linkedin"></a>
46
+
47
+
48
+ </div>
49
+
50
+ <div class="xyz_rate_us">
51
+
52
+
53
+ <h3 class="xyz_ips_inner_head">Rate Us & Donate</h3>
54
+
55
+ <p><a target="_blank" href="https://wordpress.org/support/plugin/insert-php-code-snippet/reviews/" >Please Rate Us
56
+
57
+ </a></p>
58
+
59
+
60
+ <a target="_blank" href="https://wordpress.org/support/plugin/insert-php-code-snippet/reviews/" ><span class="xyz_new_star"></span></a>
61
+
62
+ <p><a target="_blank" href="https://xyzscripts.com/donate/5" >Donate</a></p>
63
+
64
+ </div>
65
+
66
+ <div class="xyz_ips_sugession">
67
+
68
+
69
+ <h3 class="xyz_ips_inner_head">Support</h3>
70
+
71
+
72
+ <p><a target="_blank" href="https://wordpress.org/support/plugin/insert-php-code-snippet/" >Create a ticket at Wordpress forum</a></p>
73
+ <p><a target="_blank" href="https://xyzscripts.com/support/" >Contact Us</a></p>
74
+
75
+
76
+
77
+ </div>
78
+
79
+
80
+
81
+
82
+
83
+
84
+
85
+
86
+
87
+
88
+ <div class="xyz_new_subscribe">
89
+
90
+
91
+ <h3 class="xyz_ips_inner_head">Stay tuned for our updates</h3>
92
+
93
+
94
+
95
+
96
+
97
+
98
+
99
+
100
+
101
 
102
  <script language="javascript">
103
  function check_email(emailString)
106
  var matchArray = emailString.match(mailPattern);
107
  if (emailString.length == 0)
108
  return false;
109
+
110
  if (matchArray == null) {
111
  return false;
112
  }else{
114
  }
115
  }
116
 
117
+
118
  function verify_lists(form)
119
  {
120
+
121
  var total=0;
122
  var checkBox=form['chk[]'];
123
+
124
  if(checkBox.length){
125
+
126
  for(var i=0;i<checkBox.length;i++){
127
  checkBox[i].checked?total++:null;
128
  }
129
  }else{
130
+
131
  checkBox.checked?total++:null;
132
+
133
  }
134
  if(total>0){
135
  return true;
138
  }
139
 
140
  }
141
+
142
  function verify_fields()
143
  {
144
 
155
 
156
  }
157
  </script>
158
+ <?php global $current_user; wp_get_current_user();?>
159
+ <form action="https://xyzscripts.com/newsletter/index.php?page=list/subscribe" method="post" name="email_subscription" id="email_subscription" target="_blank">
160
  <input type="hidden" name="fieldNameIds" value="1,">
161
  <input type="hidden" name="redirActive" value="http://xyzscripts.com/subscription/pending/XYZWPIPSFRE">
162
  <input type="hidden" name="redirPending" value="http://xyzscripts.com/subscription/active/XYZWPIPSFRE">
163
  <input type="hidden" name="mode" value="1">
 
 
 
164
 
165
+ <input class="xyz_name" type="text" placeholder="Name" name="field1" value="<?php
166
+ if ($current_user->user_firstname != "" || $current_user->user_lastname != "")
 
167
  {
168
+ echo $current_user->user_firstname . " " . $current_user->user_lastname;
169
+ }
170
+ else if (strcasecmp($current_user->display_name, 'admin')!=0 && strcasecmp($current_user->display_name , "administrator")!=0 )
171
  {
172
+ echo $current_user->display_name;
173
+ }
174
+ else if (strcasecmp($current_user->user_login ,"admin")!=0 && strcasecmp($current_user->user_login , "administrator")!=0 )
175
  {
176
+ echo $current_user->user_login;
177
  }
178
  ?>" >
179
 
180
+ <input class="xyz_email" name="email"
181
+ type="text" placeholder="Email" value="<?php echo $current_user->user_email; ?>" />
 
182
 
183
+ <input id="xyz_ips_submit_ips" type="submit" value="Subscribe" name="Submit" onclick="javascript: if(!verify_fields()) return false; " />
 
184
 
185
  <input type="hidden" name="listName" value="6,1,"/>
186
  </form>
 
187
 
188
 
 
189
 
190
 
191
+
192
+
193
+
194
+ </div>
195
+
196
+
197
+
198
+
199
+
200
+
201
+ </div>
202
+
203
+
204
+
205
+
206
+
207
+ <div style="clear: both;"></div>
208
  <div style="width: 100%">
209
 
210
+ <div class="xyz_our_plugins_new">
211
+ <p class="xyz_plugin_head">Our Plugins : </p>
212
+
213
+ <a target="_blank" href="https://xyzscripts.com/wordpress-plugins/social-media-auto-publish/"><span>1</span>Social Media Auto Publish</a>
214
+ <a target="_blank" href="https://xyzscripts.com/wordpress-plugins/facebook-auto-publish/"><span>2</span>Facebook Auto Publish</a>
215
+ <a target="_blank" href="https://xyzscripts.com/wordpress-plugins/twitter-auto-publish/"><span>3</span>Twitter Auto Publish</a>
216
+ <a target="_blank" href="https://xyzscripts.com/wordpress-plugins/linkedin-auto-publish/"><span>4</span>LinkedIn Auto Publish</a>
217
+
218
+ <a target="_blank" href="https://xyzscripts.com/wordpress-plugins/insert-html-snippet/"><span>5</span>Insert HTML Snippet</a>
219
+ <a target="_blank" href="https://xyzscripts.com/wordpress-plugins/insert-php-code-snippet/"><span>6</span>Insert PHP Code Snippet</a>
220
+ <a target="_blank" href="https://xyzscripts.com/wordpress-plugins/contact-form-manager/"><span>7</span>Contact Form Manager</a>
221
+ <a target="_blank" href="https://xyzscripts.com/wordpress-plugins/newsletter-manager/"><span>8</span>Newsletter Manager</a>
222
+
223
+
224
+
225
+
226
+
227
+ <a target="_blank" href="https://xyzscripts.com/wordpress-plugins/lightbox-pop/"><span>9</span>Lightbox Pop</a>
228
+ <a target="_blank" href="https://xyzscripts.com/wordpress-plugins/full-screen-popup/"><span>10</span>Full Screen Popup</a>
229
+ <a target="_blank" href="https://xyzscripts.com/wordpress-plugins/popup-dialog-box/"><span>11</span>Popup Dialog Box</a>
230
+ <a target="_blank" href="https://xyzscripts.com/wordpress-plugins/quick-bar/"><span>12</span>Quick Bar</a>
231
+ <a target="_blank" href="https://xyzscripts.com/wordpress-plugins/quick-box-popup/"><span>13</span>Quick Box Popup</a>
232
+
233
+
234
+
235
+
236
+ <a target="_blank" href="https://xyzscripts.com/wordpress-plugins/custom-field-manager/"><span>14</span> Custom Field Manager</a>
237
+
238
+
239
+ <a target="_blank" href="https://xyzscripts.com/wordpress-plugins/wp-filter-posts/"><span>15</span> WP Filter Posts</a>
240
+
241
+ <a target="_blank" href="https://xyzscripts.com/wordpress-plugins/wp-gallery-manager/"><span>16</span> WP Gallery Manager</a>
242
  </div>
243
+ </div>
244
+ <div class="xyz_ips_poweredBy">
245
  Powered by <a href="http://xyzscripts.com" target="_blank">XYZScripts</a>
246
+ </div>
247
  <div style="clear: both;"></div>
248
 
249
+
250
+ <p style="clear: both;"></p>
admin/header.php CHANGED
@@ -3,39 +3,96 @@ if ( ! defined( 'ABSPATH' ) )
3
  exit;
4
  ?>
5
  <style>
6
- a.xyz_header_link:hover{text-decoration:underline;}
7
- .xyz_header_link{text-decoration:none;}
8
  </style>
9
 
10
- <?php
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
11
 
12
- if(get_option('xyz_credit_link')=="0"){
 
 
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');
32
- });
33
- });
34
- });
35
 
36
  </script>
37
  </div>
38
- <?php
39
  }
40
  ?>
41
 
@@ -57,23 +114,23 @@ if(get_option('xyz_credit_link')=="0"){
57
  <table style="float:right; ">
58
  <tr>
59
  <td style="float:right;" >
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>
70
  </td>
71
  <td style="float:right;">
72
- <a class="xyz_header_link" target="_blank" href="http://xyzscripts.com">XYZScripts</a>
73
  </td>
74
 
75
  </tr>
76
  </table>
77
  </div>
78
 
79
- <div style="clear: both"></div>
3
  exit;
4
  ?>
5
  <style>
6
+ a.xyz_header_link:hover{text-decoration:underline;}
7
+ .xyz_header_link{text-decoration:none;}
8
  </style>
9
 
10
+ <?php
11
+ if(isset($_POST['xyz_ips_pre_ads'])){
12
+ $xyz_ips_pre_ads = intval($_POST['xyz_ips_pre_ads']);
13
+ update_option('xyz_ips_premium_version_ads',$xyz_ips_pre_ads);
14
+ }
15
+
16
+ if(get_option('xyz_ips_premium_version_ads')==1){
17
+
18
+ ?>
19
+ <div id="xyz-ips-premium">
20
+
21
+ <div style="float: left; padding: 0 5px">
22
+ <h2 style="vertical-align: middle;">
23
+ <a target="_blank" href="https://xyzscripts.com/wordpress-plugins/xyz-wp-insert-code-snippet/details">Fully Featured XYZ WP Insert Code Snippet Premium Plugin</a> - Just 19 USD
24
+ </h2>
25
+ </div>
26
+ <div style="float: left; margin-top: 3px">
27
+ <a target="_blank"
28
+ href="https://xyzscripts.com/members/product/purchase/XYZWPICSPRE"><img
29
+ src="<?php echo plugins_url("images/orange_buynow.png",XYZ_INSERT_PHP_PLUGIN_FILE); ?>">
30
+ </a>
31
+ </div>
32
+ <div style="float: left; padding: 0 5px">
33
+ <h2 style="vertical-align: middle;text-shadow: 1px 1px 1px #686868">
34
+ ( <a href="<?php echo admin_url('admin.php?page=insert-php-code-snippet-about');?>">Compare Features</a> )
35
+ </h2>
36
+ </div>
37
+ </div>
38
+ <?php }
39
+ if($_POST && isset($_POST['xyz_ips_credit']))
40
+ {
41
+ if (! isset( $_REQUEST['_wpnonce'] )|| ! wp_verify_nonce( $_REQUEST['_wpnonce'],'ips-psetting_')){
42
+ wp_nonce_ays( 'ips-psetting_' );
43
+ exit;
44
+ }
45
+ $xyz_ips_credit_link=sanitize_text_field($_POST['xyz_ips_credit']);
46
+ update_option('xyz_credit_link', $xyz_ips_credit_link);
47
+ }
48
 
49
+
50
+
51
+ if((get_option('xyz_credit_link')=="0")&&(get_option('xyz_ips_credit_dismiss')=="0")){
52
  ?>
53
+ <div style="float:left;background-color: #FFECB3;border-radius:5px;padding: 0px 5px;margin-top: 10px;border: 1px solid #E0AB1B" id="xyz_ips_backlink_div">
54
+
55
+ Please do a favour by enabling backlink to our site. <a id="xyz_ips_backlink" style="cursor: pointer;" >Okay, Enable</a>. <a id="xyz_ips_dismiss" style="cursor: pointer;" >Dismiss</a>.
56
  <script type="text/javascript">
57
+ jQuery(document).ready(function() {
58
+ jQuery('#xyz_ips_backlink').click(function(){
59
+ xyz_filter_blink(1)
60
+ });
61
+
62
+ jQuery('#xyz_ips_dismiss').click(function(){
63
+ xyz_filter_blink(-1)
64
+ });
65
+
66
+ function xyz_filter_blink(stat){
67
+
68
+ <?php $ajax_fltr_nonce = wp_create_nonce( "xyz-ips-blink" );?>
69
+ var dataString = {
70
+ action: 'ips_backlink',
71
+ security:'<?php echo $ajax_fltr_nonce; ?>',
72
+ enable: stat
73
+ };
74
+
75
+ jQuery.post(ajaxurl, dataString, function(response) {
76
+
77
+ if(response==1){
78
+ jQuery("#xyz_ips_backlink_div").html('Thank you for enabling backlink!');
79
+ jQuery("#xyz_ips_backlink_div").css('background-color', '#D8E8DA');
80
+ jQuery("#xyz_ips_backlink_div").css('border', '1px solid #0F801C');
81
+ jQuery("select[id=xyz_ips_credit] option[value=ips]").attr("selected", true);
82
+ }
83
 
84
+ if(response==-1){
85
+ jQuery("#xyz_ips_backlink_div").remove();
86
 
87
+ }
 
 
 
 
88
 
89
+ });
90
+ }
91
+ });
 
 
 
 
 
92
 
93
  </script>
94
  </div>
95
+ <?php
96
  }
97
  ?>
98
 
114
  <table style="float:right; ">
115
  <tr>
116
  <td style="float:right;" >
117
+ <a class="xyz_header_link" style="margin-left:8px;margin-right:12px;" target="_blank" href="http://xyzscripts.com/donate/5">Donate</a>
118
  </td>
119
  <td style="float:right;">
120
  <a class="xyz_header_link" style="margin-left:8px;" target="_blank" href="http://help.xyzscripts.com/docs/insert-php-code-snippet/faq/">FAQ</a>
121
  </td>
122
  <td style="float:right;">
123
+ <a class="xyz_header_link" style="margin-left:8px;" target="_blank" href="http://help.xyzscripts.com/docs/insert-php-code-snippet/">Readme</a>
124
  </td>
125
  <td style="float:right;">
126
+ <a class="xyz_header_link" style="margin-left:8px;" target="_blank" href="https://xyzscripts.com/wordpress-plugins/insert-php-code-snippet/details">About</a>
127
  </td>
128
  <td style="float:right;">
129
+ <a class="xyz_header_link" target="_blank" href="https://xyzscripts.com">XYZScripts</a>
130
  </td>
131
 
132
  </tr>
133
  </table>
134
  </div>
135
 
136
+ <div style="clear: both"></div>
admin/install.php CHANGED
@@ -1,72 +1,70 @@
1
  <?php
2
  if ( ! defined( 'ABSPATH' ) )
3
- exit;
4
-
5
- function xyz_ips_network_install($networkwide) {
6
- global $wpdb;
7
 
8
- if (function_exists('is_multisite') && is_multisite()) {
9
- // check if it is a network activation - if so, run the activation function for each blog id
10
- if ($networkwide) {
11
- $old_blog = $wpdb->blogid;
12
- // Get all blog ids
13
- $blogids = $wpdb->get_col("SELECT blog_id FROM $wpdb->blogs");
14
- foreach ($blogids as $blog_id) {
15
- switch_to_blog($blog_id);
16
- xyz_ips_install();
17
- }
18
- switch_to_blog($old_blog);
19
- return;
20
- }
21
- }
22
- xyz_ips_install();
 
 
23
  }
24
 
25
 
26
  function xyz_ips_install(){
27
-
28
- global $wpdb;
29
- //global $current_user; get_currentuserinfo();
30
-
31
 
32
- if(get_option('xyz_ips_sort_order')=='')
33
- {
34
- add_option('xyz_ips_sort_order','desc');
35
- }
36
- if(get_option('xyz_ips_sort_field_name')=='')
37
- {
38
- add_option('xyz_ips_sort_field_name','id');
39
- }
40
-
41
-
42
-
43
-
44
-
45
- if(get_option('xyz_credit_link') == "")
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 (
57
- `id` int NOT NULL AUTO_INCREMENT,
58
- `title` varchar(1000) COLLATE utf8_unicode_ci NOT NULL,
59
- `content` longtext COLLATE utf8_unicode_ci NOT NULL,
60
- `short_code` varchar(2000) COLLATE utf8_unicode_ci NOT NULL,
61
- `status` int NOT NULL,
62
- PRIMARY KEY (`id`)
63
- ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=1";
64
- $wpdb->query($queryInsertPhp);
65
  }
 
 
 
66
 
67
- register_activation_hook( XYZ_INSERT_PHP_PLUGIN_FILE ,'xyz_ips_network_install');
68
-
 
69
 
 
 
 
70
 
 
 
 
71
 
 
 
 
72
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
  <?php
2
  if ( ! defined( 'ABSPATH' ) )
3
+ exit;
4
+
 
 
5
 
6
+ function xyz_ips_network_install($networkwide) {
7
+ global $wpdb;
8
+ if (function_exists('is_multisite') && is_multisite()) {
9
+ // check if it is a network activation - if so, run the activation function for each blog id
10
+ if ($networkwide) {
11
+ $old_blog = $wpdb->blogid;
12
+ // Get all blog ids
13
+ $blogids = $wpdb->get_col("SELECT blog_id FROM $wpdb->blogs");
14
+ foreach ($blogids as $blog_id) {
15
+ switch_to_blog($blog_id);
16
+ xyz_ips_install();
17
+ }
18
+ switch_to_blog($old_blog);
19
+ return;
20
+ }
21
+ }
22
+ xyz_ips_install();
23
  }
24
 
25
 
26
  function xyz_ips_install(){
27
+ global $wpdb;
 
 
 
28
 
29
+ $pluginName = 'xyz-wp-insert-code-snippet/xyz-wp-insert-code-snippet.php';
30
+ if (is_plugin_active($pluginName)) {
31
+ wp_die( "The plugin Insert PHP Code Snippet cannot be activated unless the premium version of this plugin is deactivated. Back to <a href='".admin_url()."plugins.php'>Plugin Installation</a>." );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
32
  }
33
+ if(get_option('xyz_ips_sort_order')==''){
34
+ add_option('xyz_ips_sort_order','desc');
35
+ }
36
 
37
+ if(get_option('xyz_ips_sort_field_name')==''){
38
+ add_option('xyz_ips_sort_field_name','id');
39
+ }
40
 
41
+ if(get_option('xyz_credit_link') == ""){
42
+ add_option("xyz_credit_link",0);
43
+ }
44
 
45
+ if(get_option('xyz_ips_credit_dismiss') == ""){
46
+ add_option("xyz_ips_credit_dismiss",0);
47
+ }
48
 
49
+ if(get_option('xyz_ips_premium_version_ads')==""){
50
+ add_option('xyz_ips_premium_version_ads',1);
51
+ }
52
 
53
+ $xyz_ips_installed_date = get_option('xyz_ips_installed_date');
54
+ if ($xyz_ips_installed_date=="") {
55
+ $xyz_ips_installed_date = time();
56
+ update_option('xyz_ips_installed_date', $xyz_ips_installed_date);
57
+ }
58
+ add_option('xyz_ips_limit',20);
59
+ $queryInsertPhp = "CREATE TABLE IF NOT EXISTS ".$wpdb->prefix."xyz_ips_short_code (
60
+ `id` int NOT NULL AUTO_INCREMENT,
61
+ `title` varchar(1000) COLLATE utf8_unicode_ci NOT NULL,
62
+ `content` longtext COLLATE utf8_unicode_ci NOT NULL,
63
+ `short_code` varchar(2000) COLLATE utf8_unicode_ci NOT NULL,
64
+ `status` int NOT NULL,
65
+ PRIMARY KEY (`id`)
66
+ ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=1";
67
+ $wpdb->query($queryInsertPhp);
68
+ }
69
+ register_activation_hook( XYZ_INSERT_PHP_PLUGIN_FILE ,'xyz_ips_network_install');
70
+ ?>
admin/menu.php CHANGED
@@ -1,13 +1,28 @@
1
  <?php
2
  if ( ! defined( 'ABSPATH' ) )
3
  exit;
 
 
 
 
4
 
5
- add_action('admin_menu', 'xyz_ips_menu');
 
 
 
 
 
 
 
 
 
 
6
 
 
7
 
8
  function xyz_ips_menu(){
9
 
10
- add_menu_page('insert-php-code-snippet', 'XYZ PHP Code', 'manage_options', 'insert-php-code-snippet-manage','xyz_ips_snippets',plugins_url('insert-php-code-snippet/images/logo.png'));
11
 
12
  add_submenu_page('insert-php-code-snippet-manage', 'PHPCode Snippets', 'PHPCode Snippets', 'manage_options', 'insert-php-code-snippet-manage','xyz_ips_snippets');
13
  add_submenu_page('insert-php-code-snippet-manage', 'PHPCode Snippets - Manage settings', 'Settings', 'manage_options', 'insert-php-code-snippet-settings' ,'xyz_ips_settings');
@@ -30,7 +45,7 @@ function xyz_ips_snippets(){
30
  $formflag=1;
31
  }
32
  if(isset($_GET['action']) && $_GET['action']=='snippet-add' )
33
- {
34
  require( dirname( __FILE__ ) . '/header.php' );
35
  require( dirname( __FILE__ ) . '/snippet-add.php' );
36
  require( dirname( __FILE__ ) . '/footer.php' );
@@ -64,19 +79,16 @@ function xyz_ips_about(){
64
 
65
 
66
  function xyz_ips_add_style_script(){
67
-
68
  wp_enqueue_script('jquery');
69
 
70
- wp_register_script( 'xyz_notice_script', plugins_url('insert-php-code-snippet/js/notice.js') );
71
  wp_enqueue_script( 'xyz_notice_script' );
72
 
73
  // Register stylesheets
74
- wp_register_style('xyz_ips_style', plugins_url('insert-php-code-snippet/css/xyz_ips_styles.css'));
75
  wp_enqueue_style('xyz_ips_style');
76
  }
77
  add_action('admin_enqueue_scripts', 'xyz_ips_add_style_script');
78
 
79
-
80
-
81
-
82
  ?>
1
  <?php
2
  if ( ! defined( 'ABSPATH' ) )
3
  exit;
4
+
5
+ if(isset($_GET['action']) && $_GET['action']=='snippet-status' ){
6
+ ob_start();
7
+ }
8
 
9
+ if(isset($_GET['action']) && $_GET['action']=='snippet-add' ){
10
+ ob_start();
11
+ }
12
+
13
+ if(isset($_GET['action']) && $_GET['action']=='snippet-delete' ){
14
+ ob_start();
15
+ }
16
+
17
+ if(isset($_GET['action']) && $_GET['action']=='snippet-edit' ){
18
+ ob_start();
19
+ }
20
 
21
+ add_action('admin_menu', 'xyz_ips_menu');
22
 
23
  function xyz_ips_menu(){
24
 
25
+ add_menu_page('insert-php-code-snippet', 'XYZ PHP Code', 'manage_options', 'insert-php-code-snippet-manage','xyz_ips_snippets',plugins_url('images/logo.png',XYZ_INSERT_PHP_PLUGIN_FILE));
26
 
27
  add_submenu_page('insert-php-code-snippet-manage', 'PHPCode Snippets', 'PHPCode Snippets', 'manage_options', 'insert-php-code-snippet-manage','xyz_ips_snippets');
28
  add_submenu_page('insert-php-code-snippet-manage', 'PHPCode Snippets - Manage settings', 'Settings', 'manage_options', 'insert-php-code-snippet-settings' ,'xyz_ips_settings');
45
  $formflag=1;
46
  }
47
  if(isset($_GET['action']) && $_GET['action']=='snippet-add' )
48
+ {
49
  require( dirname( __FILE__ ) . '/header.php' );
50
  require( dirname( __FILE__ ) . '/snippet-add.php' );
51
  require( dirname( __FILE__ ) . '/footer.php' );
79
 
80
 
81
  function xyz_ips_add_style_script(){
82
+
83
  wp_enqueue_script('jquery');
84
 
85
+ wp_register_script( 'xyz_notice_script', plugins_url ('js/notice.js' , XYZ_INSERT_PHP_PLUGIN_FILE ));
86
  wp_enqueue_script( 'xyz_notice_script' );
87
 
88
  // Register stylesheets
89
+ wp_register_style('xyz_ips_style', plugins_url('css/xyz_ips_styles.css', XYZ_INSERT_PHP_PLUGIN_FILE));
90
  wp_enqueue_style('xyz_ips_style');
91
  }
92
  add_action('admin_enqueue_scripts', 'xyz_ips_add_style_script');
93
 
 
 
 
94
  ?>
admin/settings.php CHANGED
@@ -14,45 +14,47 @@ if(isset($_GET['ips_notice'])&& $_GET['ips_notice'] == 'hide')
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);
34
-
 
 
35
  $xyz_ips_limit = abs(intval($_POST['xyz_ips_limit']));
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">
55
- Settings updated successfully. &nbsp;&nbsp;&nbsp;<span id="system_notice_area_dismiss">Dismiss</span>
56
  </div>
57
  <?php
58
  }
@@ -64,7 +66,7 @@ if($_POST){
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,9 +94,9 @@ if($_POST){
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>
@@ -106,14 +108,23 @@ if($_POST){
106
  id="xyz_ips_limit" value="<?php if(isset($_POST['xyz_ips_limit']) ){echo abs(intval($_POST['xyz_ips_limit']));}else{print(get_option('xyz_ips_limit'));} ?>" />
107
  </td>
108
  </tr>
109
-
110
  <tr valign="top">
111
- <td scope="row" class=" settingInput" id="bottomBorderNone">
112
- </td>
113
- <td id="bottomBorderNone"><input style="margin:10px 0 20px 0;" id="submit" class="button-primary bottonWidth" type="submit" value=" Update Settings " />
114
  </td>
 
 
 
 
 
 
115
  </tr>
116
-
 
 
 
 
 
117
  </table>
118
  </fieldset>
119
 
14
  display:none;
15
  }
16
  </style>
17
+ <div class="xyz_system_notice_area_style1" id="xyz_system_notice_area">
18
  Thanks again for using the plugin. We will never show the message again.
19
  &nbsp;&nbsp;&nbsp;<span
20
+ id="xyz_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'], 'ips-psetting_' )) {
27
+ wp_nonce_ays( 'ips-psetting_' );
28
  exit;
29
  }
30
  else {
31
 
32
  $_POST=xyz_trim_deep($_POST);
33
  $_POST = stripslashes_deep($_POST);
34
+
35
+ $xyz_ips_pre_ads = intval($_POST['xyz_ips_pre_ads']);
36
+
37
  $xyz_ips_limit = abs(intval($_POST['xyz_ips_limit']));
38
  if($xyz_ips_limit==0)$xyz_ips_limit=20;
39
 
40
+ $xyz_ips_credit = sanitize_text_field($_POST['xyz_ips_credit']);
41
  if(($xyz_ips_credit=="ips")||($xyz_ips_credit==0))
42
+ update_option('xyz_ips_credit_link',$xyz_ips_credit);
43
 
44
+ $xyz_ips_sortfield=sanitize_text_field($_POST['xyz_ips_sort_by_field']);
45
  if(($xyz_ips_sortfield=="id")||($xyz_ips_sortfield=="title"))
46
  update_option('xyz_ips_sort_field_name',$xyz_ips_sortfield);
47
 
48
+ $xyz_ips_sortorder=sanitize_text_field($_POST['xyz_ips_sort_by_order']);
49
  if(($xyz_ips_sortorder=="asc")||($xyz_ips_sortorder=="desc"))
50
  update_option('xyz_ips_sort_order',$xyz_ips_sortorder);
51
 
52
  update_option('xyz_ips_limit',$xyz_ips_limit);
53
+
54
  ?>
55
 
56
+ <div class="xyz_system_notice_area_style1" id="xyz_system_notice_area">
57
+ Settings updated successfully. &nbsp;&nbsp;&nbsp;<span id="xyz_system_notice_area_dismiss">Dismiss</span>
58
  </div>
59
  <?php
60
  }
66
 
67
 
68
  <form method="post">
69
+ <?php wp_nonce_field('ips-psetting_');?>
70
  <div style="float: left;width: 98%">
71
  <fieldset style=" width:100%; border:1px solid #F7F7F7; padding:10px 0px 15px 10px;">
72
  <legend ><h3>Settings</h3></legend>
94
  </td>
95
  <td><select name="xyz_ips_credit" id="xyz_ips_credit">
96
  <option value="ips"
97
+ <?php selected(get_option('xyz_ips_credit_link'),"ips"); ?>>Enable</option>
98
  <option value="0"
99
+ <?php if(get_option('xyz_ips_credit_link')!="ips"){echo 'selected';} ?>>Disable</option>
100
 
101
  </select>
102
  </td>
108
  id="xyz_ips_limit" value="<?php if(isset($_POST['xyz_ips_limit']) ){echo abs(intval($_POST['xyz_ips_limit']));}else{print(get_option('xyz_ips_limit'));} ?>" />
109
  </td>
110
  </tr>
 
111
  <tr valign="top">
112
+ <td scope="row">
113
+ <label for="xyz_ips_pre_ads">Premium Version Ads</label>
 
114
  </td>
115
+ <td>
116
+ <select name="xyz_ips_pre_ads" id="xyz_ips_pre_ads">
117
+ <option value="0">Disable</option>
118
+ <option value="1" <?php selected(get_option('xyz_ips_premium_version_ads'),1);?>>Enable</option>
119
+ </select>
120
+ </td>
121
  </tr>
122
+ <tr valign="top">
123
+ <td scope="row" class=" settingInput" id="xyz_ips_bottomBorderNone">
124
+ </td>
125
+ <td id="xyz_ips_bottomBorderNone"><input style="margin:10px 0 20px 0;" id="submit" class="button-primary xyz_ips_bottonWidth" type="submit" value=" Update Settings " />
126
+ </td>
127
+ </tr>
128
  </table>
129
  </fieldset>
130
 
admin/snippet-add.php CHANGED
@@ -1,105 +1,163 @@
1
- <?php
2
- if ( ! defined( 'ABSPATH' ) )
3
- exit;
4
-
5
  global $wpdb;
6
-
7
  $_POST = stripslashes_deep($_POST);
8
  $_POST = xyz_trim_deep($_POST);
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
  ?>
58
-
59
  <div >
60
- <fieldset
61
- style="width: 99%; border: 1px solid #F7F7F7; padding: 10px 0px;">
62
- <legend>
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>
81
- <td><input style="width:80%;"
82
- type="text" name="snippetTitle" id="snippetTitle"
83
- value="<?php if(isset($_POST['snippetTitle'])){ echo esc_attr($_POST['snippetTitle']);}?>"></td>
84
- </tr>
85
- <tr>
86
- <td style="border-bottom: none;width:20%; ">&nbsp;&nbsp;&nbsp;PHP code (without &lt;?php ?&gt;)&nbsp;<font color="red">*</font></td>
87
- <td style="border-bottom: none;width:1px;">&nbsp;:&nbsp;</td>
88
- <td >
89
- <textarea name="snippetContent" style="width:80%;height:150px;"><?php if(isset($_POST['snippetContent'])){ echo esc_textarea($_POST['snippetContent']);}?></textarea>
90
- </td>
91
- </tr>
92
-
93
- <tr>
94
- <td></td><td></td>
95
- <td><input class="button-primary" style="cursor: pointer;"
96
- type="submit" name="addSubmit" value="Create"></td>
97
- </tr>
98
- <tr><td><br/></td></tr>
99
- </table>
100
- </div>
101
-
102
- </form>
103
- </fieldset>
104
-
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
105
  </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'], 'ips-padd_' )
11
+ ) {
12
+ wp_nonce_ays( 'ips-padd_' );
13
+ exit;
14
+ }
15
+ $temp_xyz_ips_title = str_replace(' ', '', $_POST['snippetTitle']);
16
+ $temp_xyz_ips_title = str_replace('-', '', $temp_xyz_ips_title);
17
+ $xyz_ips_title = str_replace(' ', '-', $_POST['snippetTitle']);
18
+ $xyz_ips_content = $_POST['snippetContent'];
19
+ if($xyz_ips_title != "" && $xyz_ips_content != ""){
20
+ if(ctype_alnum($temp_xyz_ips_title)){
21
+ $snippet_count = $wpdb->query($wpdb->prepare( 'SELECT * FROM '.$wpdb->prefix.'xyz_ips_short_code WHERE title=%s',$xyz_ips_title) ) ;
22
+ if($snippet_count == 0){
23
+
24
+ $xyz_ips_content_start='<?php';
25
+ $new_line="\r\n";
26
+ $xyz_ips_content_end='?>';
27
+
28
+ if (stripos($xyz_ips_content, '<?php') !== false)
29
+ $tag_start_position=stripos($xyz_ips_content,'<?php');
30
+ else
31
+ $tag_start_position="-1";
32
+
33
+ if (stripos($xyz_ips_content, '?>') !== false)
34
+ $tag_end_position=stripos($xyz_ips_content,'?>');
35
+ else
36
+ $tag_end_position="-1";
37
+
38
+ //echo "<br>start-".$tag_start_position;
39
+ //echo "<br>end-".$tag_end_position;
40
+
41
+ if(stripos($xyz_ips_content, '<?php') === false && stripos($xyz_ips_content, '?>') === false)
42
+ {
43
+ $xyz_ips_content=$xyz_ips_content_start.$new_line.$xyz_ips_content;
44
+ }
45
+ else if(stripos($xyz_ips_content, '<?php') !== false)
46
+ {
47
+ if($tag_start_position>=0 && $tag_end_position>=0 && $tag_start_position>$tag_end_position)
48
+ {
49
+ $xyz_ips_content=$xyz_ips_content_start.$new_line.$xyz_ips_content;
50
+ }
51
+ }
52
+ else if(stripos($xyz_ips_content, '<?php') === false)
53
+ {
54
+ if (stripos($xyz_ips_content, '?>') !== false)
55
+ {
56
+ $xyz_ips_content=$xyz_ips_content_start.$new_line.$xyz_ips_content;
57
+ }
58
+ }
59
+
60
 
61
+
62
+ $xyz_shortCode = '[xyz-ips snippet="'.$xyz_ips_title.'"]';
63
+ $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'));
64
+ header("Location:".admin_url('admin.php?page=insert-php-code-snippet-manage&xyz_ips_msg=1'));
65
+ }
66
+ else{
 
 
 
 
 
 
 
 
 
 
 
 
 
67
  ?>
68
+ <div class="xyz_system_notice_area_style0" id="xyz_system_notice_area">
69
+ PHP Snippet already exists. &nbsp;&nbsp;&nbsp;
70
+ <span id="xyz_system_notice_area_dismiss">Dismiss</span>
71
  </div>
72
+ <?php
73
+ }
74
+ }
75
+ else{
76
  ?>
77
+ <div class="xyz_system_notice_area_style0" id="xyz_system_notice_area">
78
+ PHP Snippet title can have only alphabets,numbers or hyphen. &nbsp;&nbsp;&nbsp;
79
+ <span id="xyz_system_notice_area_dismiss">Dismiss</span>
80
  </div>
81
  <?php
82
+ }
83
+ }else{
84
+ ?>
85
+ <div class="xyz_system_notice_area_style0" id="xyz_system_notice_area">
86
+ Fill all mandatory fields. &nbsp;&nbsp;&nbsp;
87
+ <span id="xyz_system_notice_area_dismiss">Dismiss</span>
88
  </div>
89
+ <?php
90
+ }
 
91
  }
 
92
  ?>
 
93
  <div >
94
+ <fieldset
95
+ style="width: 99%; border: 1px solid #F7F7F7; padding: 10px 0px;">
96
+ <legend>
97
+ <b>
98
+ Add PHP Snippet
99
+ </b>
100
+ </legend>
101
+ <form name="frmmainForm" id="frmmainForm" method="post">
102
+ <?php wp_nonce_field('ips-padd_'); ?>
103
+ <div>
104
+ <table
105
+ style="width: 99%; background-color: #F9F9F9; border: 1px solid #E4E4E4; border-width: 1px;margin: 0 auto">
106
+ <tr>
107
+ <td>
108
+ <br/>
109
+ <div id="shortCode">
110
+ </div>
111
+ <br/>
112
+ </td>
113
+ </tr>
114
+ <tr valign="top">
115
+ <td style="border-bottom: none;width:20%;">
116
+ &nbsp;&nbsp;&nbsp;Tracking Name&nbsp;
117
+ <font color="red">
118
+ *
119
+ </font>
120
+ </td>
121
+ <td style="border-bottom: none;width:1px;">
122
+ &nbsp;:&nbsp;
123
+ </td>
124
+ <td>
125
+ <input style="width:80%;"
126
+ type="text" name="snippetTitle" id="snippetTitle"
127
+ value="<?php if(isset($_POST['snippetTitle'])){ echo esc_attr($_POST['snippetTitle']);}?>">
128
+ </td>
129
+ </tr>
130
+ <tr>
131
+ <td style="border-bottom: none;width:20%; ">
132
+ &nbsp;&nbsp;&nbsp;PHP code
133
+ <font color="red">
134
+ *
135
+ </font>
136
+ </td>
137
+ <td style="border-bottom: none;width:1px;">
138
+ &nbsp;:&nbsp;
139
+ </td>
140
+ <td >
141
+ <textarea name="snippetContent" style="width:80%;height:150px;"><?php if(isset($_POST['snippetContent'])){ echo esc_textarea($_POST['snippetContent']);}?></textarea>
142
+ </td>
143
+ </tr>
144
+ <tr>
145
+ <td>
146
+ </td>
147
+ <td>
148
+ </td>
149
+ <td>
150
+ <input class="button-primary" style="cursor: pointer;"
151
+ type="submit" name="addSubmit" value="Create">
152
+ </td>
153
+ </tr>
154
+ <tr>
155
+ <td>
156
+ <br/>
157
+ </td>
158
+ </tr>
159
+ </table>
160
+ </div>
161
+ </form>
162
+ </fieldset>
163
  </div>
admin/snippet-delete.php CHANGED
@@ -1,37 +1,33 @@
1
  <?php
2
  if ( ! defined( 'ABSPATH' ) )
3
- exit;
4
-
5
- global $wpdb;
6
 
 
7
  $_POST = stripslashes_deep($_POST);
8
  $_GET = stripslashes_deep($_GET);
9
-
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();
 
22
 
23
- }
24
- $snippetCount = $wpdb->query($wpdb->prepare( 'SELECT * FROM '.$wpdb->prefix.'xyz_ips_short_code WHERE id=%d LIMIT 0,1',$xyz_ips_snippetId )) ;
25
 
26
- if($snippetCount==0){
27
- header("Location:".admin_url('admin.php?page=insert-php-code-snippet-manage&xyz_ips_msg=2'));
28
- exit();
29
- }else{
30
-
31
- $wpdb->query($wpdb->prepare( 'DELETE FROM '.$wpdb->prefix.'xyz_ips_short_code WHERE id=%d',$xyz_ips_snippetId)) ;
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
  ?>
1
  <?php
2
  if ( ! defined( 'ABSPATH' ) )
3
+ exit;
 
 
4
 
5
+ global $wpdb;
6
  $_POST = stripslashes_deep($_POST);
7
  $_GET = stripslashes_deep($_GET);
 
8
  $xyz_ips_snippetId = intval($_GET['snippetId']);
9
  $xyz_ips_pageno = intval($_GET['pageno']);
10
 
11
+ if(! isset( $_REQUEST['_wpnonce'] ) || ! wp_verify_nonce( $_REQUEST['_wpnonce'], 'ips-pdel_'.$xyz_ips_snippetId )) {
12
+ wp_nonce_ays( 'ips-pdel_'.$xyz_ips_snippetId );
13
+ exit;
 
14
  }
15
  else{
16
+ if($xyz_ips_snippetId=="" || !is_numeric($xyz_ips_snippetId)){
17
+ header("Location:".admin_url('admin.php?page=insert-php-code-snippet-manage'));
18
+ exit();
19
+ }
20
 
21
+ $snippetCount = $wpdb->query($wpdb->prepare( 'SELECT * FROM '.$wpdb->prefix.'xyz_ips_short_code WHERE id=%d LIMIT 0,1',$xyz_ips_snippetId )) ;
 
22
 
23
+ if($snippetCount==0){
24
+ header("Location:".admin_url('admin.php?page=insert-php-code-snippet-manage&xyz_ips_msg=2'));
25
+ exit();
26
+ }
27
+ else{
28
+ $wpdb->query($wpdb->prepare( 'DELETE FROM '.$wpdb->prefix.'xyz_ips_short_code WHERE id=%d',$xyz_ips_snippetId)) ;
29
+ header("Location:".admin_url('admin.php?page=insert-php-code-snippet-manage&xyz_ips_msg=3&pagenum='.$xyz_ips_pageno));
30
+ exit();
31
+ }
 
32
  }
33
  ?>
admin/snippet-edit.php CHANGED
@@ -1,143 +1,184 @@
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
 
 
11
  $xyz_ips_message='';
12
  if(isset($_GET['xyz_ips_msg'])){
13
- $xyz_ips_message = $_GET['xyz_ips_msg'];
14
  }
15
  if($xyz_ips_message == 1){
16
-
17
- ?>
18
- <div class="system_notice_area_style1" id="system_notice_area">
19
- PHP Snippet updated successfully. &nbsp;&nbsp;&nbsp;<span id="system_notice_area_dismiss">Dismiss</span>
20
  </div>
21
-
22
- <?php
23
-
24
-
25
  }
26
  if(isset($_POST) && isset($_POST['updateSubmit'])){
27
 
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
-
40
- $xyz_ips_snippetId = $_GET['snippetId'];
41
- $temp_xyz_ips_title = str_replace(' ', '', $_POST['snippetTitle']);
42
- $temp_xyz_ips_title = str_replace('-', '', $temp_xyz_ips_title);
43
- $xyz_ips_title = str_replace(' ', '-', $_POST['snippetTitle']);
44
- $xyz_ips_content = $_POST['snippetContent'];
45
-
46
- if($xyz_ips_title != "" && $xyz_ips_content != ""){
47
-
48
- if(ctype_alnum($temp_xyz_ips_title))
49
- {
50
- $snippet_count = $wpdb->query($wpdb->prepare( 'SELECT * FROM '.$wpdb->prefix.'xyz_ips_short_code WHERE id!=%d AND title=%s LIMIT 0,1',$xyz_ips_snippetId,$xyz_ips_title)) ;
51
-
52
- if($snippet_count == 0){
53
- $xyz_shortCode = '[xyz-ips snippet="'.$xyz_ips_title.'"]';
54
-
55
- $wpdb->update($wpdb->prefix.'xyz_ips_short_code', array('title'=>$xyz_ips_title,'content'=>$xyz_ips_content,'short_code'=>$xyz_shortCode,), array('id'=>$xyz_ips_snippetId));
56
-
57
- header("Location:".admin_url('admin.php?page=insert-php-code-snippet-manage&action=snippet-edit&snippetId='.$xyz_ips_snippetId.'&xyz_ips_msg=1'));
58
-
59
-
60
-
61
- }else{
62
- ?>
63
- <div class="system_notice_area_style0" id="system_notice_area">
64
- PHP Snippet already exists. &nbsp;&nbsp;&nbsp;<span id="system_notice_area_dismiss">Dismiss</span>
65
- </div>
66
- <?php
67
-
68
- }
69
- }
70
- else
71
- {
72
- ?>
73
- <div class="system_notice_area_style0" id="system_notice_area">
74
- PHP Snippet title can have only alphabets,numbers or hyphen. &nbsp;&nbsp;&nbsp;<span id="system_notice_area_dismiss">Dismiss</span>
75
- </div>
76
- <?php
77
-
78
- }
79
-
80
-
81
- }else{
82
- ?>
83
- <div class="system_notice_area_style0" id="system_notice_area">
84
- Fill all mandatory fields. &nbsp;&nbsp;&nbsp;<span id="system_notice_area_dismiss">Dismiss</span>
85
- </div>
86
- <?php
87
- }
88
-
89
- }
90
-
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
91
  }
92
  global $wpdb;
93
-
94
-
95
  $snippetDetails = $wpdb->get_results($wpdb->prepare( 'SELECT * FROM '.$wpdb->prefix.'xyz_ips_short_code WHERE id=%d LIMIT 0,1',$xyz_ips_snippetId )) ;
96
  $snippetDetails = $snippetDetails[0];
97
-
98
  ?>
99
-
100
  <div >
101
- <fieldset
102
- style="width: 99%; border: 1px solid #F7F7F7; padding: 10px 0px;">
103
- <legend>
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>
111
- <table
112
- style="width: 99%; background-color: #F9F9F9; border: 1px solid #E4E4E4; border-width: 1px;margin: 0 auto">
113
- <tr><td><br/>
114
- <div id="shortCode"></div>
115
- <br/></td></tr>
116
- <tr valign="top">
117
- <td style="border-bottom: none;width:20%;">&nbsp;&nbsp;&nbsp;Tracking Name&nbsp;<font color="red">*</font></td>
118
- <td style="border-bottom: none;width:1px;">&nbsp;:&nbsp;</td>
119
- <td><input style="width:80%;"
120
- type="text" name="snippetTitle" id="snippetTitle"
121
- value="<?php if(isset($_POST['snippetTitle'])){ echo esc_attr($_POST['snippetTitle']);}else{ echo esc_attr($snippetDetails->title); }?>"></td>
122
- </tr>
123
- <tr>
124
- <td style="border-bottom: none;width:20%; ">&nbsp;&nbsp;&nbsp;PHP code (without &lt;?php ?&gt;)&nbsp;<font color="red">*</font></td>
125
- <td style="border-bottom: none;width:1px;">&nbsp;:&nbsp;</td>
126
- <td >
127
- <textarea name="snippetContent" style="width:80%;height:150px;"><?php if(isset($_POST['snippetContent'])){ echo esc_textarea($_POST['snippetContent']);}else{ echo esc_textarea($snippetDetails->content); }?></textarea>
128
- </td>
129
- </tr>
130
-
131
- <tr>
132
- <td></td><td></td>
133
- <td><input class="button-primary" style="cursor: pointer;"
134
- type="submit" name="updateSubmit" value="Update"></td>
135
- </tr>
136
- <tr><td><br/></td></tr>
137
- </table>
138
- </div>
139
-
140
- </form>
141
- </fieldset>
142
-
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
143
  </div>
1
+ <?php
2
+ if ( ! defined( 'ABSPATH' ) )
3
  exit;
4
 
5
  global $wpdb;
 
 
 
 
6
 
7
+ $xyz_ips_snippetId = intval($_GET['snippetId']);
8
  $xyz_ips_message='';
9
  if(isset($_GET['xyz_ips_msg'])){
10
+ $xyz_ips_message = intval($_GET['xyz_ips_msg']);
11
  }
12
  if($xyz_ips_message == 1){
13
+ ?>
14
+ <div class="xyz_system_notice_area_style1" id="xyz_system_notice_area">
15
+ PHP Snippet updated successfully. &nbsp;&nbsp;&nbsp;
16
+ <span id="xyz_system_notice_area_dismiss">Dismiss</span>
17
  </div>
18
+ <?php
 
 
 
19
  }
20
  if(isset($_POST) && isset($_POST['updateSubmit'])){
21
 
22
+ if (! isset( $_REQUEST['_wpnonce'] ) || ! wp_verify_nonce( $_REQUEST['_wpnonce'], 'ips-pedit_'.$xyz_ips_snippetId )) {
23
+ wp_nonce_ays( 'ips-pedit_'.$xyz_ips_snippetId );
24
+ exit;
25
+ }
26
+
27
+ $_POST = stripslashes_deep($_POST);
28
+ $_POST = xyz_trim_deep($_POST);
29
+ $xyz_ips_snippetId = intval($_GET['snippetId']);
30
+ $temp_xyz_ips_title = str_replace(' ', '', $_POST['snippetTitle']);
31
+ $temp_xyz_ips_title = str_replace('-', '', $temp_xyz_ips_title);
32
+ $xyz_ips_title = str_replace(' ', '-', $_POST['snippetTitle']);
33
+ $xyz_ips_content = $_POST['snippetContent'];
34
+
35
+ $xyz_ips_content_start='<?php';
36
+ $new_line="\r\n";
37
+ $xyz_ips_content_end='?>';
38
+
39
+ if (stripos($xyz_ips_content, '<?php') !== false)
40
+ $tag_start_position=stripos($xyz_ips_content,'<?php');
41
+ else
42
+ $tag_start_position="-1";
43
+
44
+ if (stripos($xyz_ips_content, '?>') !== false)
45
+ $tag_end_position=stripos($xyz_ips_content,'?>');
46
+ else
47
+ $tag_end_position="-1";
48
+
49
+ //echo "<br>start-".$tag_start_position;
50
+ //echo "<br>end-".$tag_end_position;
51
+
52
+ if(stripos($xyz_ips_content, '<?php') === false && stripos($xyz_ips_content, '?>') === false)
53
+ {
54
+ $xyz_ips_content=$xyz_ips_content_start.$new_line.$xyz_ips_content;
55
+ }
56
+ else if(stripos($xyz_ips_content, '<?php') !== false)
57
+ {
58
+ if($tag_start_position>=0 && $tag_end_position>=0 && $tag_start_position>$tag_end_position)
59
+ {
60
+ $xyz_ips_content=$xyz_ips_content_start.$new_line.$xyz_ips_content;
61
+ }
62
+ }
63
+ else if(stripos($xyz_ips_content, '<?php') === false)
64
+ {
65
+ if (stripos($xyz_ips_content, '?>') !== false)
66
+ {
67
+ $xyz_ips_content=$xyz_ips_content_start.$new_line.$xyz_ips_content;
68
+ }
69
+ }
70
+
71
+ if($xyz_ips_title != "" && $xyz_ips_content != ""){
72
+ if(ctype_alnum($temp_xyz_ips_title)){
73
+ $snippet_count = $wpdb->query($wpdb->prepare( 'SELECT * FROM '.$wpdb->prefix.'xyz_ips_short_code WHERE id!=%d AND title=%s LIMIT 0,1',$xyz_ips_snippetId,$xyz_ips_title)) ;
74
+ if($snippet_count == 0){
75
+ $xyz_shortCode = '[xyz-ips snippet="'.$xyz_ips_title.'"]';
76
+ $wpdb->update($wpdb->prefix.'xyz_ips_short_code', array('title'=>$xyz_ips_title,'content'=>$xyz_ips_content,'short_code'=>$xyz_shortCode,), array('id'=>$xyz_ips_snippetId));
77
+ header("Location:".admin_url('admin.php?page=insert-php-code-snippet-manage&action=snippet-edit&snippetId='.$xyz_ips_snippetId.'&xyz_ips_msg=1'));
78
+ }
79
+ else{
80
+ ?>
81
+ <div class="xyz_system_notice_area_style0" id="xyz_system_notice_area">
82
+ PHP Snippet already exists. &nbsp;&nbsp;&nbsp;
83
+ <span id="xyz_system_notice_area_dismiss">Dismiss</span>
84
+ </div>
85
+ <?php
86
+ }
87
+ }
88
+ else{
89
+ ?>
90
+ <div class="xyz_system_notice_area_style0" id="xyz_system_notice_area">
91
+ PHP Snippet title can have only alphabets,numbers or hyphen. &nbsp;&nbsp;&nbsp;
92
+ <span id="xyz_system_notice_area_dismiss">Dismiss</span>
93
+ </div>
94
+ <?php
95
+ }
96
+ }
97
+ else{
98
+ ?>
99
+ <div class="xyz_system_notice_area_style0" id="xyz_system_notice_area">
100
+ Fill all mandatory fields. &nbsp;&nbsp;&nbsp;
101
+ <span id="xyz_system_notice_area_dismiss">Dismiss</span>
102
+ </div>
103
+ <?php
104
+ }
105
  }
106
  global $wpdb;
 
 
107
  $snippetDetails = $wpdb->get_results($wpdb->prepare( 'SELECT * FROM '.$wpdb->prefix.'xyz_ips_short_code WHERE id=%d LIMIT 0,1',$xyz_ips_snippetId )) ;
108
  $snippetDetails = $snippetDetails[0];
 
109
  ?>
 
110
  <div >
111
+ <fieldset
112
+ style="width: 99%; border: 1px solid #F7F7F7; padding: 10px 0px;">
113
+ <legend>
114
+ <b>
115
+ Edit PHP Snippet
116
+ </b>
117
+ </legend>
118
+ <form name="frmmainForm" id="frmmainForm" method="post">
119
+ <?php wp_nonce_field( 'ips-pedit_'.$xyz_ips_snippetId ); ?>
120
+ <input type="hidden" id="snippetId" name="snippetId"
121
+ value="
122
+ <?php if(isset($_POST['snippetId'])){ echo esc_attr($_POST['snippetId']);}else{ echo esc_attr($snippetDetails->id); }?>">
123
+ <div>
124
+ <table
125
+ style="width: 99%; background-color: #F9F9F9; border: 1px solid #E4E4E4; border-width: 1px;margin: 0 auto">
126
+ <tr>
127
+ <td>
128
+ <br/>
129
+ <div id="shortCode">
130
+ </div>
131
+ <br/>
132
+ </td>
133
+ </tr>
134
+ <tr valign="top">
135
+ <td style="border-bottom: none;width:20%;">
136
+ &nbsp;&nbsp;&nbsp;Tracking Name&nbsp;
137
+ <font color="red">
138
+ *
139
+ </font>
140
+ </td>
141
+ <td style="border-bottom: none;width:1px;">
142
+ &nbsp;:&nbsp;
143
+ </td>
144
+ <td>
145
+ <input style="width:80%;"
146
+ type="text" name="snippetTitle" id="snippetTitle"
147
+ value="
148
+ <?php if(isset($_POST['snippetTitle'])){ echo esc_attr($_POST['snippetTitle']);}else{ echo esc_attr($snippetDetails->title); }?>">
149
+ </td>
150
+ </tr>
151
+ <tr>
152
+ <td style="border-bottom: none;width:20%; ">
153
+ &nbsp;&nbsp;&nbsp;PHP code
154
+ <font color="red">
155
+ *
156
+ </font>
157
+ </td>
158
+ <td style="border-bottom: none;width:1px;">
159
+ &nbsp;:&nbsp;
160
+ </td>
161
+ <td >
162
+ <textarea name="snippetContent" style="width:80%;height:150px;"><?php if(isset($_POST['snippetContent'])){ echo esc_textarea($_POST['snippetContent']);}else{ echo esc_textarea($snippetDetails->content); }?></textarea>
163
+ </td>
164
+ </tr>
165
+ <tr>
166
+ <td>
167
+ </td>
168
+ <td>
169
+ </td>
170
+ <td>
171
+ <input class="button-primary" style="cursor: pointer;"
172
+ type="submit" name="updateSubmit" value="Update">
173
+ </td>
174
+ </tr>
175
+ <tr>
176
+ <td>
177
+ <br/>
178
+ </td>
179
+ </tr>
180
+ </table>
181
+ </div>
182
+ </form>
183
+ </fieldset>
184
  </div>
admin/snippet-status.php CHANGED
@@ -1,37 +1,34 @@
1
  <?php
2
  if ( ! defined( 'ABSPATH' ) )
3
- exit;
4
- global $wpdb;
5
 
 
6
  $_POST = stripslashes_deep($_POST);
7
  $_GET = stripslashes_deep($_GET);
8
-
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();
22
-
23
- }
24
-
25
- $snippetCount = $wpdb->query($wpdb->prepare( 'SELECT * FROM '.$wpdb->prefix.'xyz_ips_short_code WHERE id=%d LIMIT 0,1' ,$xyz_ips_snippetId)) ;
26
 
27
- if($snippetCount==0){
28
- header("Location:".admin_url('admin.php?page=insert-php-code-snippet-manage&xyz_ips_msg=2'));
29
- exit();
30
- }else{
31
-
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
  ?>
1
  <?php
2
  if ( ! defined( 'ABSPATH' ) )
3
+ exit;
 
4
 
5
+ global $wpdb;
6
  $_POST = stripslashes_deep($_POST);
7
  $_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
 
12
+ if (! isset( $_REQUEST['_wpnonce'] ) || ! wp_verify_nonce( $_REQUEST['_wpnonce'], 'ips-pstat_'.$xyz_ips_snippetId )) {
13
+ wp_nonce_ays( 'ips-pstat_'.$xyz_ips_snippetId );
14
+ exit;
 
15
  }
16
+ else{
17
+ if($xyz_ips_snippetId=="" || !is_numeric($xyz_ips_snippetId)){
18
+ header("Location:".admin_url('admin.php?page=insert-php-code-snippet-manage'));
19
+ exit();
20
+ }
 
 
 
21
 
22
+ $snippetCount = $wpdb->query($wpdb->prepare( 'SELECT * FROM '.$wpdb->prefix.'xyz_ips_short_code WHERE id=%d LIMIT 0,1' ,$xyz_ips_snippetId)) ;
23
+
24
+ if($snippetCount==0){
25
+ header("Location:".admin_url('admin.php?page=insert-php-code-snippet-manage&xyz_ips_msg=2'));
26
+ exit();
27
+ }
28
+ else{
29
+ $wpdb->update($wpdb->prefix.'xyz_ips_short_code', array('status'=>$xyz_ips_snippetStatus), array('id'=>$xyz_ips_snippetId));
30
+ header("Location:".admin_url('admin.php?page=insert-php-code-snippet-manage&xyz_ips_msg=4&pagenum='.$xyz_ips_pageno));
31
+ exit();
32
+ }
33
  }
34
  ?>
admin/snippets.php CHANGED
@@ -6,14 +6,14 @@ global $wpdb;
6
  $_GET = stripslashes_deep($_GET);
7
  $xyz_ips_message = '';
8
  if(isset($_GET['xyz_ips_msg'])){
9
- $xyz_ips_message = $_GET['xyz_ips_msg'];
10
  }
11
  if($xyz_ips_message == 1){
12
 
13
  ?>
14
- <div class="system_notice_area_style1" id="system_notice_area">
15
  PHP Snippet successfully added.&nbsp;&nbsp;&nbsp;<span
16
- id="system_notice_area_dismiss">Dismiss</span>
17
  </div>
18
  <?php
19
 
@@ -21,9 +21,9 @@ id="system_notice_area_dismiss">Dismiss</span>
21
  if($xyz_ips_message == 2){
22
 
23
  ?>
24
- <div class="system_notice_area_style0" id="system_notice_area">
25
  PHP Snippet not found.&nbsp;&nbsp;&nbsp;<span
26
- id="system_notice_area_dismiss">Dismiss</span>
27
  </div>
28
  <?php
29
 
@@ -31,9 +31,9 @@ id="system_notice_area_dismiss">Dismiss</span>
31
  if($xyz_ips_message == 3){
32
 
33
  ?>
34
- <div class="system_notice_area_style1" id="system_notice_area">
35
  PHP Snippet successfully deleted.&nbsp;&nbsp;&nbsp;<span
36
- id="system_notice_area_dismiss">Dismiss</span>
37
  </div>
38
  <?php
39
 
@@ -41,9 +41,9 @@ id="system_notice_area_dismiss">Dismiss</span>
41
  if($xyz_ips_message == 4){
42
 
43
  ?>
44
- <div class="system_notice_area_style1" id="system_notice_area">
45
  PHP Snippet status successfully changed.&nbsp;&nbsp;&nbsp;<span
46
- id="system_notice_area_dismiss">Dismiss</span>
47
  </div>
48
  <?php
49
 
@@ -51,9 +51,9 @@ id="system_notice_area_dismiss">Dismiss</span>
51
  if($xyz_ips_message == 5){
52
 
53
  ?>
54
- <div class="system_notice_area_style1" id="system_notice_area">
55
  PHP Snippet successfully updated.&nbsp;&nbsp;&nbsp;<span
56
- id="system_notice_area_dismiss">Dismiss</span>
57
  </div>
58
  <?php
59
 
@@ -83,7 +83,7 @@ id="system_notice_area_dismiss">Dismiss</span>
83
 
84
 
85
  ?>
86
- <input id="submit_ips"
87
  style="cursor: pointer; margin-bottom:10px; margin-left:8px;" type="button"
88
  name="textFieldButton2" value="Add New PHP Code Snippet"
89
  onClick='document.location.href="<?php echo admin_url('admin.php?page=insert-php-code-snippet-manage&action=snippet-add');?>"'>
@@ -105,15 +105,15 @@ id="system_notice_area_dismiss">Dismiss</span>
105
  $class = ( $count % 2 == 0 ) ? ' class="alternate"' : '';
106
  ?>
107
  <tr <?php echo $class; ?>>
108
- <td id="vAlign"><?php
109
  echo esc_html($entry->title);
110
  ?></td>
111
- <td id="vAlign"><?php
112
  if($entry->status == 2){echo 'NA';}
113
  else
114
  echo '[xyz-ips snippet="'.esc_html($entry->title).'"]';
115
  ?></td>
116
- <td id="vAlign">
117
  <?php
118
  if($entry->status == 2){
119
  echo "Inactive";
@@ -128,9 +128,9 @@ id="system_notice_area_dismiss">Dismiss</span>
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
@@ -138,9 +138,9 @@ id="system_notice_area_dismiss">Dismiss</span>
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>
145
  </td>
146
  <?php
@@ -150,17 +150,17 @@ id="system_notice_area_dismiss">Dismiss</span>
150
 
151
  <td style="text-align: center;"><a
152
  href='<?php echo admin_url('admin.php?page=insert-php-code-snippet-manage&action=snippet-edit&snippetId='.$entry->id.'&pageno='.$pagenum); ?>'><img
153
- id="img" title="Edit Snippet"
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')?>">
164
  </a></td>
165
  </tr>
166
  <?php
@@ -174,7 +174,7 @@ id="system_notice_area_dismiss">Dismiss</span>
174
  </tbody>
175
  </table>
176
 
177
- <input id="submit_ips"
178
  style="cursor: pointer; margin-top:10px;margin-left:8px;" type="button"
179
  name="textFieldButton2" value="Add New PHP Code Snippet"
180
  onClick='document.location.href="<?php echo admin_url('admin.php?page=insert-php-code-snippet-manage&action=snippet-add');?>"'>
6
  $_GET = stripslashes_deep($_GET);
7
  $xyz_ips_message = '';
8
  if(isset($_GET['xyz_ips_msg'])){
9
+ $xyz_ips_message = intval($_GET['xyz_ips_msg']);
10
  }
11
  if($xyz_ips_message == 1){
12
 
13
  ?>
14
+ <div class="xyz_system_notice_area_style1" id="xyz_system_notice_area">
15
  PHP Snippet successfully added.&nbsp;&nbsp;&nbsp;<span
16
+ id="xyz_system_notice_area_dismiss">Dismiss</span>
17
  </div>
18
  <?php
19
 
21
  if($xyz_ips_message == 2){
22
 
23
  ?>
24
+ <div class="xyz_system_notice_area_style0" id="xyz_system_notice_area">
25
  PHP Snippet not found.&nbsp;&nbsp;&nbsp;<span
26
+ id="xyz_system_notice_area_dismiss">Dismiss</span>
27
  </div>
28
  <?php
29
 
31
  if($xyz_ips_message == 3){
32
 
33
  ?>
34
+ <div class="xyz_system_notice_area_style1" id="xyz_system_notice_area">
35
  PHP Snippet successfully deleted.&nbsp;&nbsp;&nbsp;<span
36
+ id="xyz_system_notice_area_dismiss">Dismiss</span>
37
  </div>
38
  <?php
39
 
41
  if($xyz_ips_message == 4){
42
 
43
  ?>
44
+ <div class="xyz_system_notice_area_style1" id="xyz_system_notice_area">
45
  PHP Snippet status successfully changed.&nbsp;&nbsp;&nbsp;<span
46
+ id="xyz_system_notice_area_dismiss">Dismiss</span>
47
  </div>
48
  <?php
49
 
51
  if($xyz_ips_message == 5){
52
 
53
  ?>
54
+ <div class="xyz_system_notice_area_style1" id="xyz_system_notice_area">
55
  PHP Snippet successfully updated.&nbsp;&nbsp;&nbsp;<span
56
+ id="xyz_system_notice_area_dismiss">Dismiss</span>
57
  </div>
58
  <?php
59
 
83
 
84
 
85
  ?>
86
+ <input id="xyz_ips_submit_ips"
87
  style="cursor: pointer; margin-bottom:10px; margin-left:8px;" type="button"
88
  name="textFieldButton2" value="Add New PHP Code Snippet"
89
  onClick='document.location.href="<?php echo admin_url('admin.php?page=insert-php-code-snippet-manage&action=snippet-add');?>"'>
105
  $class = ( $count % 2 == 0 ) ? ' class="alternate"' : '';
106
  ?>
107
  <tr <?php echo $class; ?>>
108
+ <td id="xyz_ips_vAlign"><?php
109
  echo esc_html($entry->title);
110
  ?></td>
111
+ <td id="xyz_ips_vAlign"><?php
112
  if($entry->status == 2){echo 'NA';}
113
  else
114
  echo '[xyz-ips snippet="'.esc_html($entry->title).'"]';
115
  ?></td>
116
+ <td id="xyz_ips_vAlign">
117
  <?php
118
  if($entry->status == 2){
119
  echo "Inactive";
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,'ips-pstat_'.$entry->id); ?>'><img
132
+ id="xyz_ips_img" title="Activate"
133
+ src="<?php echo plugins_url('images/activate.png',XYZ_INSERT_PHP_PLUGIN_FILE)?>">
134
  </a>
135
  </td>
136
  <?php
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,'ips-pstat_'.$entry->id); ?>'><img
142
+ id="xyz_ips_img" title="Deactivate"
143
+ src="<?php echo plugins_url('images/pause.png',XYZ_INSERT_PHP_PLUGIN_FILE)?>">
144
  </a>
145
  </td>
146
  <?php
150
 
151
  <td style="text-align: center;"><a
152
  href='<?php echo admin_url('admin.php?page=insert-php-code-snippet-manage&action=snippet-edit&snippetId='.$entry->id.'&pageno='.$pagenum); ?>'><img
153
+ id="xyz_ips_img" title="Edit Snippet"
154
+ src="<?php echo plugins_url('images/edit.png',XYZ_INSERT_PHP_PLUGIN_FILE)?>">
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,'ips-pdel_'.$entry->id); ?>'
161
  onclick="javascript: return confirm('Please click \'OK\' to confirm ');"><img
162
+ id="xyz_ips_img" title="Delete Snippet"
163
+ src="<?php echo plugins_url('images/delete.png',XYZ_INSERT_PHP_PLUGIN_FILE)?>">
164
  </a></td>
165
  </tr>
166
  <?php
174
  </tbody>
175
  </table>
176
 
177
+ <input id="xyz_ips_submit_ips"
178
  style="cursor: pointer; margin-top:10px;margin-left:8px;" type="button"
179
  name="textFieldButton2" value="Add New PHP Code Snippet"
180
  onClick='document.location.href="<?php echo admin_url('admin.php?page=insert-php-code-snippet-manage&action=snippet-add');?>"'>
admin/uninstall.php CHANGED
@@ -29,7 +29,7 @@ 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");
35
 
29
  delete_option("xyz_ips_sort_field_name");
30
  delete_option("xyz_ips_limit");
31
  delete_option("xyz_ips_installed_date");
32
+ delete_option('xyz_ips_credit_dismiss');
33
  /* table delete*/
34
  $wpdb->query("DROP TABLE ".$wpdb->prefix."xyz_ips_short_code");
35
 
ajax-handler.php CHANGED
@@ -1,7 +1,24 @@
1
  <?php
2
  if ( ! defined( 'ABSPATH' ) )
3
- exit;
4
-
5
- require_once( dirname( __FILE__ ) . '/admin/ajax-backlink.php' );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
6
 
7
  ?>
1
  <?php
2
  if ( ! defined( 'ABSPATH' ) )
3
+ exit;
4
+
5
+ add_action('wp_ajax_ips_backlink', 'xyz_ips_ajax_backlink');
6
+ function xyz_ips_ajax_backlink() {
7
+
8
+ check_ajax_referer('xyz-ips-blink','security');
9
+ if(current_user_can('administrator')){
10
+ global $wpdb;
11
+ if(isset($_POST)){
12
+ if(intval($_POST['enable'])==1){
13
+ update_option('xyz_credit_link','ips');
14
+ echo 1;
15
+ }
16
+ if(intval($_POST['enable'])==-1){
17
+ update_option('xyz_ips_credit_dismiss','dis');
18
+ echo -1;
19
+ }
20
+ }
21
+ }die;
22
+ }
23
 
24
  ?>
css/xyz_ips_styles.css CHANGED
@@ -1,14 +1,14 @@
1
 
2
- #system_notice_area_dismiss{
3
  color: #FFFFFF;
4
  cursor: pointer;
5
  }
6
- .system_notice_area_style1 {
7
  background: #00C348;
8
  border: 1px solid green;
9
  }
10
 
11
- .system_notice_area_style0 {
12
  background: #FA5A6A;
13
  border: 1px solid brown;
14
  }
@@ -23,51 +23,58 @@ cursor: pointer;
23
  border-radius: 40px;
24
  }
25
 
26
- #button:hover {
27
- border: 1px solid #797979;
 
 
 
 
 
 
 
 
 
 
 
 
28
  }
29
 
30
- a {
31
- text-decoration: none;
32
- }
33
 
34
- label{
35
- cursor:default;
36
  }
37
 
38
- #img{
 
39
  width:20px;
40
  height: 20px;
41
  }
42
 
43
- #vAlign{
44
  vertical-align: middle;
45
  }
46
 
47
- #tdCenter{
48
  text-align: center;
49
  }
50
- .bottonWidth{
51
  width:120px;
52
  }
53
- #buttonDesign{
54
  width:120px;
55
  }
56
 
57
- #bottomBorderNone {
58
  border-bottom:none;
59
  }
60
 
61
- legend{
62
- font-size: 14px;
63
- }
64
  #content_xyz_ips_snippet_selecterList_text{
65
  width:90px;
66
  }
67
 
68
  /*admin style*/
69
 
70
- #system_notice_area {
71
  position: fixed;
72
  margin-bottom:40px;
73
  left:25%;
@@ -86,56 +93,72 @@ z-index:100000;
86
  }
87
 
88
 
89
- .xyz_suggest,.xyz_star,.xyz_donate,.xyz_fbook,.xyz_support,.xyz_twitt,.xyz_gplus,.xyz_linkedin{
90
  height:16px;
91
  background-repeat: no-repeat;
92
- background-position: left center;
93
  padding-left: 20px;
94
  text-decoration: none;
95
-
96
  vertical-align: middle;
97
  display: inline-block;
98
-
99
  }
100
-
101
  .xyz_suggest{
102
-
103
  background-image: url('../images/suggest.png');
104
  }
105
-
106
- .xyz_star{
107
- background-image: url('../images/star.png');
108
- }
109
 
110
  .xyz_donate{
111
-
112
  background-image: url('../images/donate.png');
113
  }
114
 
115
-
116
  .xyz_fbook{
117
-
118
  background-image: url('../images/facebook.png');
119
  }
120
  .xyz_support{
121
-
122
  background-image: url('../images/support.png');
123
  }
124
  .xyz_twitt{
125
-
126
  background-image: url('../images/twitter.png');
127
  }
128
  .xyz_gplus{
129
-
130
  background-image: url('../images/gplus.png');
131
  }
132
  .xyz_linkedin{
133
-
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
134
  background-image: url('../images/linkedin.png');
135
  }
136
 
137
  #insert-php-code-snippet .plugin-version-author-uri {
138
-
139
  background-color: #F4F4F4;
140
  min-height:16px;
141
  border-radius:5px;
@@ -147,7 +170,7 @@ z-index:100000;
147
  -webkit-box-shadow: 0 8px 6px -6px black;
148
  -moz-box-shadow: 0 8px 6px -6px black;
149
  box-shadow: 0 8px 6px -6px black;
150
-
151
  }
152
  #insert-php-code-snippet th,#insert-php-code-snippet td{
153
  background: #a9e8f5; /* Old browsers */
@@ -174,11 +197,11 @@ text-decoration: blink;
174
  #insert-php-code-snippet .plugin-version-author-uri a:hover,
175
  #insert-php-code-snippet .plugin-version-author-uri a:active,
176
  #insert-php-code-snippet .plugin-version-author-uri a:visited{
177
-
178
-
179
  color: #111111;
180
  text-decoration: none;
181
-
182
  }
183
  #insert-php-code-snippet .plugin-version-author-uri a:hover{
184
 
@@ -193,81 +216,431 @@ background-position: left bottom;
193
  }
194
 
195
 
196
- #submit_ips{
197
- background:#25A6E1;
198
- background:-moz-linear-gradient(top,#25A6E1 0%,#188BC0 100%);
199
- background:-webkit-gradient(linear,left top,left bottom,color-stop(0%,#25A6E1),color-stop(100%,#188BC0));
200
- background:-webkit-linear-gradient(top,#25A6E1 0%,#188BC0 100%);
201
- background:-o-linear-gradient(top,#25A6E1 0%,#188BC0 100%);
202
- background:-ms-linear-gradient(top,#25A6E1 0%,#188BC0 100%);
203
- background:linear-gradient(top,#25A6E1 0%,#188BC0 100%);
204
- filter:progid:DXImageTransform.Microsoft.gradient(startColorstr="#25A6E1",endColorstr="#188BC0",GradientType=0);
205
- padding:1px 13px;
206
- color:#ffffff;
207
- font-family:"Helvetica Neue",sans-serif;
208
- font-size:15px;
209
- cursor:pointer;
210
- border: 1px solid #1A87B9;
211
- border-radius: 4px 4px 4px 4px;
212
- font-weight: normal;
213
- font-size: 13px;
214
  }
215
 
216
- .xyz_our_plugins{
217
- background: #F2F2F2; /* Old browsers */
218
- border: 1px solid #DFDFDF;
219
- border-radius:3px;
220
- width: 98%;
221
- padding-left: 10px;
222
- padding-top:10px;
223
- height:auto;
224
- min-height: 40px;
225
- margin-top:13px;
226
- }
227
-
228
- .xyz_our_plugins a{
229
  text-decoration: none;
230
  }
231
-
232
- .poweredBy{
233
  padding-top: 10px;float:left; text-align: center; width: 100%;
234
  }
235
-
236
- .poweredBy a{
237
  text-decoration: none;
238
  }
239
-
240
  .xyz_feedback{
241
  background: #CEEAF7; /* Old browsers */
242
  border: 1px solid #64cfe8;
243
  border-radius:3px;
244
- width: 98%;
245
  height:30px;
246
  padding-top:10px;
247
  padding-left: 10px;
248
  font-weight: bold;
249
  line-height: 20px;
250
  }
251
-
252
-
253
  .xyz_feedback a{
254
  text-decoration: none
255
  }
256
 
257
-
258
- .xyz_subscribe{
259
- background: #bae598; /* Old browsers */
260
- border: 1px solid #4d8a1d;
261
- border-radius:3px;
262
- width: 98%;
263
- height:35px;
264
- padding-top:10px;
265
- padding-left: 10px;
266
- }
267
- .xyz_subscribe td{
268
  padding:0;
269
  }
270
-
271
  i.xyz-ips-own-icon {
272
  background-image: url('../images/logo.png');
273
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
 
2
+ #xyz_system_notice_area_dismiss{
3
  color: #FFFFFF;
4
  cursor: pointer;
5
  }
6
+ .xyz_system_notice_area_style1 {
7
  background: #00C348;
8
  border: 1px solid green;
9
  }
10
 
11
+ .xyz_system_notice_area_style0 {
12
  background: #FA5A6A;
13
  border: 1px solid brown;
14
  }
23
  border-radius: 40px;
24
  }
25
 
26
+ .xyz-buy-button {
27
+ color:white;
28
+ padding:5px 21px;
29
+ background: #545454;
30
+ border: 0;
31
+ border-bottom: 2px solid #545454;
32
+ cursor: pointer;
33
+ -webkit-box-shadow: inset 0 -2px #545454;
34
+ box-shadow: inset 0 -2px #545454;
35
+ text-decoration: none;
36
+ font-size: 14px;
37
+ width:60px;
38
+ font-weight: bold;
39
+ border-radius:3px;
40
  }
41
 
 
 
 
42
 
43
+ #button:hover {
44
+ border: 1px solid #797979;
45
  }
46
 
47
+
48
+ #xyz_ips_img{
49
  width:20px;
50
  height: 20px;
51
  }
52
 
53
+ #xyz_ips_vAlign{
54
  vertical-align: middle;
55
  }
56
 
57
+ #xyz_ips_tdCenter{
58
  text-align: center;
59
  }
60
+ .xyz_ips_bottonWidth{
61
  width:120px;
62
  }
63
+ #xyz_ips_buttonDesign{
64
  width:120px;
65
  }
66
 
67
+ #xyz_ips_bottomBorderNone {
68
  border-bottom:none;
69
  }
70
 
 
 
 
71
  #content_xyz_ips_snippet_selecterList_text{
72
  width:90px;
73
  }
74
 
75
  /*admin style*/
76
 
77
+ #xyz_system_notice_area {
78
  position: fixed;
79
  margin-bottom:40px;
80
  left:25%;
93
  }
94
 
95
 
96
+ .xyz_suggest,.xyz_star,.xyz_donate,.xyz_fbook,.xyz_support,.xyz_twitt,.xyz_gplus,.xyz_linkedin{
97
  height:16px;
98
  background-repeat: no-repeat;
99
+ background-size: contain;
100
  padding-left: 20px;
101
  text-decoration: none;
 
102
  vertical-align: middle;
103
  display: inline-block;
104
+
105
  }
106
+
107
  .xyz_suggest{
108
+
109
  background-image: url('../images/suggest.png');
110
  }
111
+
 
 
 
112
 
113
  .xyz_donate{
114
+
115
  background-image: url('../images/donate.png');
116
  }
117
 
118
+
119
  .xyz_fbook{
120
+
121
  background-image: url('../images/facebook.png');
122
  }
123
  .xyz_support{
124
+
125
  background-image: url('../images/support.png');
126
  }
127
  .xyz_twitt{
128
+
129
  background-image: url('../images/twitter.png');
130
  }
131
  .xyz_gplus{
132
+
133
  background-image: url('../images/gplus.png');
134
  }
135
  .xyz_linkedin{
136
+
137
+ background-image: url('../images/linkedin.png');
138
+ }
139
+
140
+
141
+ .xyz_home_fbook{
142
+
143
+ background-image: url('../images/facebook.png');
144
+ }
145
+
146
+
147
+ .xyz_home_twitt{
148
+
149
+ background-image: url('../images/twitter.png');
150
+ }
151
+ .xyz_home_gplus{
152
+
153
+ background-image: url('../images/gplus.png');
154
+ }
155
+ .xyz_home_linkedin{
156
+
157
  background-image: url('../images/linkedin.png');
158
  }
159
 
160
  #insert-php-code-snippet .plugin-version-author-uri {
161
+
162
  background-color: #F4F4F4;
163
  min-height:16px;
164
  border-radius:5px;
170
  -webkit-box-shadow: 0 8px 6px -6px black;
171
  -moz-box-shadow: 0 8px 6px -6px black;
172
  box-shadow: 0 8px 6px -6px black;
173
+
174
  }
175
  #insert-php-code-snippet th,#insert-php-code-snippet td{
176
  background: #a9e8f5; /* Old browsers */
197
  #insert-php-code-snippet .plugin-version-author-uri a:hover,
198
  #insert-php-code-snippet .plugin-version-author-uri a:active,
199
  #insert-php-code-snippet .plugin-version-author-uri a:visited{
200
+
201
+
202
  color: #111111;
203
  text-decoration: none;
204
+
205
  }
206
  #insert-php-code-snippet .plugin-version-author-uri a:hover{
207
 
216
  }
217
 
218
 
219
+ #xyz_ips_submit_ips{
220
+ color: #FFFFFF;
221
+ background-color: #094969;
222
+ border: 1px solid #eee;
223
+ border-radius: 3px;
224
+ cursor: pointer;
225
+ line-height: 23px;
 
 
 
 
 
 
 
 
 
 
 
226
  }
227
 
228
+
229
+
230
+ .xyz_our_plugins_new a{
 
 
 
 
 
 
 
 
 
 
231
  text-decoration: none;
232
  }
233
+
234
+ .xyz_ips_poweredBy{
235
  padding-top: 10px;float:left; text-align: center; width: 100%;
236
  }
237
+
238
+ .xyz_ips_poweredBy a{
239
  text-decoration: none;
240
  }
241
+
242
  .xyz_feedback{
243
  background: #CEEAF7; /* Old browsers */
244
  border: 1px solid #64cfe8;
245
  border-radius:3px;
246
+ width: 98%;
247
  height:30px;
248
  padding-top:10px;
249
  padding-left: 10px;
250
  font-weight: bold;
251
  line-height: 20px;
252
  }
253
+
254
+
255
  .xyz_feedback a{
256
  text-decoration: none
257
  }
258
 
259
+
260
+
261
+ .xyz_new_subscribe td{
 
 
 
 
 
 
 
 
262
  padding:0;
263
  }
264
+
265
  i.xyz-ips-own-icon {
266
  background-image: url('../images/logo.png');
267
  }
268
+
269
+ #xyz-ips-premium {
270
+ border: 1px solid #FCC328;
271
+ margin-bottom: 20px;
272
+ margin-top: 20px;
273
+ background-color: #FFF6D6;
274
+ min-height: 50px;
275
+ padding: 5px;
276
+ width: 98%;
277
+ border-radius:3px;
278
+ float: left;
279
+ }
280
+
281
+ .xyz-premium-comparison {
282
+ width: 99%;
283
+ padding: 0px;
284
+ border: 1px solid #CCCCCC;
285
+ border-radius: 3px;
286
+ }
287
+
288
+ .xyz-premium-comparison td {
289
+ padding: 1px;
290
+ border: 1px solid #CCCCCC;
291
+ height: 25px;
292
+ }
293
+
294
+
295
+
296
+ /*new design start*/
297
+
298
+
299
+
300
+
301
+
302
+ .xyz_ips_social_media{
303
+ background-color: #80766D;
304
+ width: 21% ;
305
+ float: left;
306
+ min-height: 80px;
307
+ margin: 10px 10px 10px 0px;
308
+ padding: 10px;
309
+ border: 1px solid #312a23;
310
+ border-radius: 5px;}
311
+
312
+
313
+
314
+ .xyz_ips_sugession{
315
+ background-color: #A2A240;
316
+ width: 20%;
317
+ float: left;
318
+ min-height: 80px;
319
+ margin: 10px 10px 10px 0px;
320
+ padding: 10px;
321
+ border: 1px solid #797900;
322
+ border-radius: 5px;}
323
+
324
+ .xyz_ips_sugession a{color:#fafa66; text-decoration:underline; }
325
+
326
+ .xyz_ips_sugession a:hover{color:#fafa66; text-decoration:underline;}
327
+
328
+
329
+ .xyz_ips_sugession p{margin: 0px !important;
330
+ font-size: 12px;
331
+ color: #ffffff;}
332
+
333
+
334
+
335
+ .xyz_rate_us{
336
+ background-color: #094969;
337
+ width: 21% ;
338
+ float: left;
339
+ min-height: 80px;
340
+ margin: 10px 10px 10px 0px;
341
+ padding: 10px;
342
+ border: 1px solid #fff;
343
+ border-radius: 5px;}
344
+
345
+
346
+ .xyz_rate_us p{
347
+ display: block;
348
+ float: left;
349
+ line-height: 20px;
350
+ width: 100%;
351
+ margin: 0px; width:50%;}
352
+
353
+
354
+ .xyz_new_star{background-image: url(../images/new_star.png);
355
+ width: 80px;
356
+ height: 20px;
357
+ display: block;
358
+ background-repeat: no-repeat;
359
+ float: left;
360
+
361
+
362
+ }
363
+
364
+
365
+
366
+
367
+ .xyz_rate_us a{color:#94dbff; text-decoration:underline; float:left;}
368
+
369
+ .xyz_rate_us a:hover{color:#94dbff; text-decoration:underline;}
370
+
371
+
372
+ .xyz_new_subscribe{
373
+ background-color: #E39124;
374
+ width: 27%;
375
+ float: left;
376
+ min-height: 80px;
377
+ margin: 10px 10px 10px 0px;
378
+ padding: 10px;
379
+ border: 1px solid #b86a02;
380
+ border-radius: 5px;}
381
+
382
+
383
+ .xyz_new_subscribe input{font-size:11px;}
384
+
385
+
386
+
387
+ .xyz_ips_social_media a{
388
+ margin: 0px 13px 5px 0px;
389
+ border: 1px solid #ddd;
390
+ width: 30px;
391
+ height: 30px;
392
+ padding-left: 0px;
393
+ display: block;
394
+ float: left;}
395
+
396
+
397
+ .xyz_ips_inner_head{ color: #ffffff;
398
+ font-weight: 300;
399
+ border-bottom: 1px solid #eee;
400
+ margin: 0px 0px 10px;
401
+ padding-bottom: 10px;}
402
+
403
+
404
+
405
+
406
+ .xyz_plugin_head{margin: 0px;
407
+ font-size: 22px;
408
+ font-weight: 300;
409
+ padding: 0px 10px 5px;}
410
+
411
+
412
+ .xyz_name{border:none; width:32%;}
413
+
414
+ .xyz_email{border:none; width:39.5%;}
415
+
416
+
417
+ .xyz_our_plugins_new{
418
+ background: #ffffff;
419
+ border: 1px solid #eeeeee;
420
+ border-radius: 3px;
421
+ width: 98%;
422
+ height: auto;
423
+ margin-top: 13px;
424
+ line-height: 33px;
425
+ padding: 10px 0 10px 10px ;
426
+ float:left;
427
+ }
428
+
429
+ .xyz_our_plugins_new a{
430
+ text-decoration: none;
431
+ display: block;
432
+ background-color: #ddd;
433
+ float: left;
434
+ width: 23%;
435
+ margin: 1px;
436
+ padding: 0px 10px 0px 0px;
437
+ color: #094969;
438
+ outline: 0 !important;
439
+ line-height: 27px;
440
+ }
441
+
442
+
443
+ .xyz_our_plugins_new a:hover{text-decoration:underline;}
444
+
445
+ ..xyz_our_plugins_new a:active{box-shadow:none !important;}
446
+
447
+ .xyz_our_plugins_new a span{
448
+ background-color: #ef4a44;
449
+ color: #FFFFFF;
450
+ width: 30px;
451
+ min-height: 28px;
452
+ display: block;
453
+ float: left;
454
+ text-align: center;
455
+ margin-right: 10px;
456
+ border-right: 2px solid #fff;}
457
+
458
+
459
+ .xyz_rate_btn{color: #E77E22 !important;
460
+ text-decoration: none !important;
461
+ margin-right: 4px !important;
462
+ font-weight: bold;
463
+ background-color: #fff1d6 !important;
464
+ border: 1px solid #E77E22 !important;
465
+ box-shadow:none !important;}
466
+
467
+ .xyz_backlink_btn{color: #00a016 !important;
468
+ text-decoration: none !important;
469
+ margin-right: 4px !important;
470
+ font-weight: bold;
471
+ background-color: #f0fff2 !important;
472
+ border: 1px solid #00a016 !important;
473
+ box-shadow:none !important;}
474
+
475
+
476
+ .xyz_share_btn{color: #177ABD !important;
477
+ text-decoration: none !important;
478
+ margin-right: 4px !important;
479
+ font-weight: bold;
480
+ border: 1px solid #177ABD !important;
481
+ background-color: #edf8ff !important;
482
+ box-shadow:none !important;}
483
+
484
+ .xyz_donate_btn{color: #C12AA2 !important;
485
+ text-decoration: none !important;
486
+ margin-right: 4px !important;
487
+ font-weight: bold;
488
+ border: 1px solid #C12AA2 !important;
489
+ background-color: #feeafa !important;
490
+ box-shadow:none !important;}
491
+
492
+
493
+ .xyz_show_btn{color: #F15E77 !important;
494
+ text-decoration: none !important;
495
+ margin-right: 4px !important;
496
+ font-weight: bold;
497
+ border: 1px solid #F15E77 !important;
498
+ background-color: #ffeddf !important;
499
+ box-shadow: none !important;}
500
+
501
+
502
+
503
+
504
+
505
+
506
+ @media screen and (max-width: 1351px) {
507
+
508
+
509
+ .xyz_ips_social_media{width:21%;}
510
+
511
+ .xyz_new_subscribe{width:24%;}
512
+
513
+ .xyz_rate_us{width:21%;}
514
+
515
+ .xyz_ips_sugession{width:20%;}
516
+
517
+
518
+
519
+ .xyz_name{border:none; width:25%;}
520
+
521
+ .xyz_email{border:none; width:37.5%;}
522
+
523
+ .xyz_ips_sugession p{
524
+ font-size: 11px;
525
+
526
+
527
+ }
528
+
529
+ .xyz_our_plugins_new a{width:23%;}
530
+
531
+ }
532
+
533
+ @media screen and (max-width: 1251px) {
534
+
535
+
536
+
537
+ .xyz_ips_social_media{width:21%;}
538
+
539
+ .xyz_new_subscribe{width:24%;}
540
+
541
+ .xyz_rate_us{width:21%;}
542
+
543
+ .xyz_ips_sugession{width:20%;}
544
+
545
+ .xyz_name{border:none; width:25%;}
546
+
547
+ .xyz_email{border:none; width:37.5%;}
548
+
549
+ #xyz_ips_submit_ips{line-height:20px;}
550
+
551
+
552
+ .xyz_our_plugins_new a{width:23.6%;}
553
+ }
554
+
555
+
556
+
557
+ @media screen and (max-width:1155px)
558
+ {
559
+
560
+
561
+ .xyz_ips_social_media{width:45%;}
562
+
563
+ .xyz_new_subscribe{width:45%;}
564
+
565
+ .xyz_rate_us{width:45%;}
566
+
567
+ .xyz_ips_sugession{width:45%;}
568
+ .xyz_our_plugins_new a{width:31%;}
569
+
570
+ }
571
+
572
+
573
+ @media screen and (max-width: 782px)
574
+ {
575
+ .xyz_ips_social_media{width:43%;}
576
+
577
+ .xyz_new_subscribe{width:43%;}
578
+
579
+ .xyz_rate_us{width:43%;}
580
+
581
+ .xyz_ips_sugession{width:43%;}
582
+
583
+
584
+ .xyz_our_plugins_new a{width:30%;}
585
+
586
+ .xyz_name{border:none; width:32%;}
587
+
588
+ .xyz_email{border:none; width:37.5%;}
589
+
590
+
591
+ }
592
+
593
+
594
+ @media screen and (max-width: 768px)
595
+ {
596
+
597
+
598
+
599
+ #xyz_ips_submit_ips{line-height:20px;}
600
+ .xyz_our_plugins_new a{width:30%; font-size:11px;}
601
+
602
+ }
603
+
604
+
605
+ @media screen and (max-width: 675px)
606
+ {
607
+
608
+ .xyz_our_plugins_new a{width:45%; font-size:11px;}
609
+
610
+
611
+ .xyz_name{border:none; width:28%;}
612
+
613
+ }
614
+
615
+
616
+ @media screen and (max-width: 562px)
617
+ {
618
+ .xyz_ips_sugession{width:92.5%;}
619
+
620
+
621
+ .xyz_new_subscribe{width:92.5%;}
622
+
623
+ }
624
+
625
+
626
+ @media screen and (max-width: 532px){
627
+
628
+
629
+ .xyz_ips_social_media{width:92.5%;}
630
+
631
+ .xyz_new_subscribe{width:92.5%;}
632
+
633
+ .xyz_rate_us{width:92.5%;}
634
+
635
+ .xyz_ips_sugession{width:92.5%;}
636
+
637
+
638
+ .xyz_our_plugins_new a{width:92.5%;}
639
+
640
+ .xyz_name{border:none; width:32%;}
641
+
642
+ .xyz_email{border:none; width:37.5%;}
643
+ }
644
+
645
+
646
+ /*new design end*/
editor_plugin.js.php CHANGED
@@ -46,7 +46,7 @@ if(floatval(get_bloginfo('version'))>=3.9)
46
 
47
  $xyz_snippets = array(
48
  'title' =>'Insert PHP Code Snippet',
49
- 'url' => plugins_url('insert-php-code-snippet/images/logo.png'),
50
  'xyz_ips_snippets' => $xyz_snippets_arr
51
  );
52
  ?>
46
 
47
  $xyz_snippets = array(
48
  'title' =>'Insert PHP Code Snippet',
49
+ 'url' => plugins_url('images/logo.png', XYZ_INSERT_PHP_PLUGIN_FILE),
50
  'xyz_ips_snippets' => $xyz_snippets_arr
51
  );
52
  ?>
images/cross.png ADDED
Binary file
images/facebook.png CHANGED
Binary file
images/gplus.png CHANGED
Binary file
images/linkedin.png CHANGED
Binary file
images/new_star.png ADDED
Binary file
images/orange_buynow.png ADDED
Binary file
images/tick.png ADDED
Binary file
images/twitter.png CHANGED
Binary file
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.1
7
  Author: xyzscripts.com
8
  Author URI: http://xyzscripts.com/
9
  Text Domain: insert-php-code-snippet
@@ -33,8 +33,6 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
33
  if ( ! defined( 'ABSPATH' ) )
34
  exit;
35
 
36
- ob_start();
37
-
38
  //error_reporting(E_ALL);
39
 
40
  define('XYZ_INSERT_PHP_PLUGIN_FILE',__FILE__);
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.2
7
  Author: xyzscripts.com
8
  Author URI: http://xyzscripts.com/
9
  Text Domain: insert-php-code-snippet
33
  if ( ! defined( 'ABSPATH' ) )
34
  exit;
35
 
 
 
36
  //error_reporting(E_ALL);
37
 
38
  define('XYZ_INSERT_PHP_PLUGIN_FILE',__FILE__);
js/notice.js CHANGED
@@ -1,11 +1,11 @@
1
  jQuery(document).ready(function() {
2
- jQuery('#system_notice_area').animate({
3
  opacity : 'show',
4
  height : 'show'
5
  }, 500);
6
 
7
- jQuery('#system_notice_area_dismiss').click(function() {
8
- jQuery('#system_notice_area').animate({
9
  opacity : 'hide',
10
  height : 'hide'
11
  }, 500);
1
  jQuery(document).ready(function() {
2
+ jQuery('#xyz_system_notice_area').animate({
3
  opacity : 'show',
4
  height : 'show'
5
  }, 500);
6
 
7
+ jQuery('#xyz_system_notice_area_dismiss').click(function() {
8
+ jQuery('#xyz_system_notice_area').animate({
9
  opacity : 'hide',
10
  height : 'hide'
11
  }, 500);
readme.txt CHANGED
@@ -1,11 +1,11 @@
1
- === Insert PHP Code Snippet ===
2
  Contributors: f1logic
3
  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.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.
@@ -21,7 +21,7 @@ A quicklook into Insert PHP Code Snippet
21
 
22
  = Features in Detail =
23
 
24
- Insert PHP Code Snippet allows you to create shortcodes corresponding to PHP code snippets. You can create a shortcode corresponding to any random PHP code such as ad codes, login validation etc. and use the same in your posts, pages or widgets.
25
 
26
  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 PHP snippets with your posts and pages.
27
 
@@ -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://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,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://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,29 +66,36 @@ More questions ? [Drop a mail](http://xyzscripts.com/members/support/ "XYZScript
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
75
- * Added options to sort snippets in admin area by id and title
76
- * Removed redirection after snippet edit
77
 
78
  = 1.1 =
79
- * Snippet chooser TinyMCE plugin modified
80
  * Compatibility with wordpress 3.9
81
- * A few bug fixes
 
82
  = 1.0 =
83
- * First official launch.
84
 
85
  == Upgrade Notice ==
86
-
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
 
@@ -97,7 +104,7 @@ Please read the FAQ first if you are having problems.
97
  = Requirements =
98
 
99
  WordPress 3.0+
100
- PHP 5+
101
 
102
  = Feedback =
103
 
1
+ === Insert PHP Code Snippet ===
2
  Contributors: f1logic
3
  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.9.1
8
+ Stable tag: 1.2.2
9
  License: GPLv2 or later
10
 
11
  Add PHP code to your pages and posts easily using shortcodes.
21
 
22
  = Features in Detail =
23
 
24
+ Insert PHP Code Snippet allows you to create shortcodes corresponding to PHP code snippets. You can create a shortcode corresponding to any random PHP code such as ad codes, login validation etc. and use the same in your posts, pages or widgets.
25
 
26
  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 PHP snippets with your posts and pages.
27
 
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/user-guide)
33
+ ★ [Insert PHP Code Snippet FAQ](http://help.xyzscripts.com/docs/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/user-guide)
38
+ ★ [Insert PHP Code Snippet FAQ](http://help.xyzscripts.com/docs/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/user-guide)
48
+ ★ [Insert PHP Code Snippet FAQ](http://help.xyzscripts.com/docs/insert-php-code-snippet/faq/)
49
 
50
  = 1. The Insert PHP Code Snippet is not working properly. =
51
 
66
 
67
 
68
  == Changelog ==
69
+
70
+ = 1.2.2 =
71
+ * Automatic detection and correction of php opening and closing tags in snippet
72
+ * Updated nonces and validations
73
+ * Premium version details and comparison added
74
+
75
  = 1.2.1 =
76
+ * Nonces Added
77
+ * A few bug fixes
78
 
79
  = 1.2 =
80
  * Compatibility with wordpress 4.3
81
+ * Added options to sort snippets in admin area by id and title
82
+ * Removed redirection after snippet edit
83
 
84
  = 1.1 =
85
+ * Snippet chooser TinyMCE plugin modified
86
  * Compatibility with wordpress 3.9
87
+ * A few bug fixes
88
+
89
  = 1.0 =
90
+ * First official launch
91
 
92
  == Upgrade Notice ==
93
+
94
+
95
  == More Information ==
96
 
97
+ ★ [Insert PHP Code Snippet User Guide](http://help.xyzscripts.com/docs/insert-php-code-snippet/user-guide)
98
+ ★ [Insert PHP Code Snippet FAQ](http://help.xyzscripts.com/docs/insert-php-code-snippet/faq/)
99
 
100
  = Troubleshooting =
101
 
104
  = Requirements =
105
 
106
  WordPress 3.0+
107
+ PHP 5+
108
 
109
  = Feedback =
110
 
shortcode-handler.php CHANGED
@@ -1,62 +1,85 @@
1
- <?php
2
  if ( ! defined( 'ABSPATH' ) )
3
- exit;
4
-
5
  global $wpdb;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
6
 
7
- add_shortcode('xyz-ips','xyz_ips_display_content');
8
 
9
- function xyz_ips_display_content($xyz_snippet_name){
10
- global $wpdb;
11
-
12
- if(is_array($xyz_snippet_name)){
13
- $snippet_name = $xyz_snippet_name['snippet'];
14
-
15
- $query = $wpdb->get_results($wpdb->prepare( "SELECT * FROM ".$wpdb->prefix."xyz_ips_short_code WHERE title=%s" ,$snippet_name));
16
-
17
- if(count($query)>0){
18
-
19
- foreach ($query as $sippetdetails){
20
- if($sippetdetails->status==1){
21
-
22
- if(is_numeric(ini_get('output_buffering'))){
23
- $tmp=ob_get_contents();
24
- ob_clean();
25
- ob_start();
26
- $content_to_eval=$sippetdetails->content;
27
- if(substr($content_to_eval, 0,5)=='<?php')
28
- $content_to_eval='?>'.$content_to_eval;
29
- eval($content_to_eval);
30
- $xyz_em_content = ob_get_contents();
31
- ob_clean();
32
- echo $tmp;
33
- return $xyz_em_content;
34
- }else{
35
- eval($sippetdetails->content);
36
- }
37
-
38
-
39
-
40
- }else{
41
- return '';
42
- }
43
- break;
44
- }
45
-
46
- }else{
47
-
48
- return '';
49
- /* return "<div style='padding:20px; font-size:16px; color:#FA5A6A; width:93%;text-align:center;background:lightyellow;border:1px solid #3FAFE3; margin:20px 0 20px 0'>
50
-
51
- Please use a valid short code to call snippet.
52
-
53
-
54
- </div>";
55
- */
56
- }
57
-
58
- }
59
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
60
 
61
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
62
  add_filter('widget_text', 'do_shortcode'); // to run shortcodes in text widgets
1
+ <?php
2
  if ( ! defined( 'ABSPATH' ) )
3
+ exit;
 
4
  global $wpdb;
5
+ add_shortcode('xyz-ips','xyz_ips_display_content');
6
+ function xyz_ips_display_content($xyz_snippet_name){
7
+ global $wpdb;
8
+ if(is_array($xyz_snippet_name)){
9
+ $snippet_name = $xyz_snippet_name['snippet'];
10
+ $query = $wpdb->get_results($wpdb->prepare( "SELECT * FROM ".$wpdb->prefix."xyz_ips_short_code WHERE title=%s" ,$snippet_name));
11
+ if(count($query)>0){
12
+ foreach ($query as $sippetdetails){
13
+ if($sippetdetails->status==1){
14
+ if(is_numeric(ini_get('output_buffering'))){
15
+ $tmp=ob_get_contents();
16
+ ob_clean();
17
+ ob_start();
18
+ $content_to_eval=$sippetdetails->content;
19
 
20
+ /***** to handle old codes : start *****/
21
 
22
+ $xyz_ips_content_start='<?php';
23
+ $new_line="\r\n";
24
+ $xyz_ips_content_end='?>';
25
+
26
+ if (stripos($content_to_eval, '<?php') !== false)
27
+ $tag_start_position=stripos($content_to_eval,'<?php');
28
+ else
29
+ $tag_start_position="-1";
30
+
31
+ if (stripos($content_to_eval, '?>') !== false)
32
+ $tag_end_position=stripos($content_to_eval,'?>');
33
+ else
34
+ $tag_end_position="-1";
35
+
36
+ //echo "<br>start-".$tag_start_position;
37
+ //echo "<br>end-".$tag_end_position;
38
+
39
+ if(stripos($content_to_eval, '<?php') === false && stripos($content_to_eval, '?>') === false)
40
+ {
41
+ $content_to_eval=$xyz_ips_content_start.$new_line.$content_to_eval;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
42
  }
43
+ else if(stripos($content_to_eval, '<?php') !== false)
44
+ {
45
+ if($tag_start_position>=0 && $tag_end_position>=0 && $tag_start_position>$tag_end_position)
46
+ {
47
+ $content_to_eval=$xyz_ips_content_start.$new_line.$content_to_eval;
48
+ }
49
+ }
50
+ else if(stripos($content_to_eval, '<?php') === false)
51
+ {
52
+ if (stripos($content_to_eval, '?>') !== false)
53
+ {
54
+ $content_to_eval=$xyz_ips_content_start.$new_line.$content_to_eval;
55
+ }
56
+ }
57
+
58
+ /***** to handle old codes : end *****/
59
 
60
 
61
+
62
+ $content_to_eval='?>'.$content_to_eval;
63
+
64
+ eval($content_to_eval);
65
+ $xyz_em_content = ob_get_contents();
66
+ ob_clean();
67
+ echo $tmp;
68
+ return $xyz_em_content;
69
+ }
70
+ else{
71
+ eval($sippetdetails->content);
72
+ }
73
+ }
74
+ else{
75
+ return '';
76
+ }
77
+ break;
78
+ }
79
+ }
80
+ else{
81
+ return '';
82
+ }
83
+ }
84
+ }
85
  add_filter('widget_text', 'do_shortcode'); // to run shortcodes in text widgets
widget.php CHANGED
@@ -8,89 +8,132 @@ if ( ! defined( 'ABSPATH' ) )
8
  ////*****************************Sidebar Widget**********************************////
9
 
10
  class Xyz_Insert_Php_Widget extends WP_Widget {
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
-
18
  /** @see WP_Widget::widget -- do not rename this */
19
- function widget($args, $instance) {
20
  extract( $args );
21
  global $wpdb;
22
  $title = apply_filters('widget_title', $instance['title']);
23
  $xyz_ips_id = $instance['message'];
24
 
25
  $entries = $wpdb->get_results($wpdb->prepare( "SELECT content FROM ".$wpdb->prefix."xyz_ips_short_code WHERE id=%d",$xyz_ips_id ));
26
-
27
  $entry = $entries[0];
28
 
29
  echo $before_widget;
30
  if ( $title )
31
- echo $before_title . $title . $after_title;
32
- $content_to_eval=$entry->content;
33
- if(substr($content_to_eval, 0,5)=='<?php')
34
- $content_to_eval='?>'.$content_to_eval;
35
- eval($content_to_eval);
36
-
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
37
  echo $after_widget;
38
-
39
  }
40
-
41
  /** @see WP_Widget::update -- do not rename this */
42
- function update($new_instance, $old_instance) {
43
  $instance = $old_instance;
44
  $instance['title'] = strip_tags($new_instance['title']);
45
  $instance['message'] = strip_tags($new_instance['message']);
46
  return $instance;
47
  }
48
-
49
  /** @see WP_Widget::form -- do not rename this */
50
- function form($instance) {
51
  global $wpdb;
52
  $entries = $wpdb->get_results($wpdb->prepare( "SELECT * FROM ".$wpdb->prefix."xyz_ips_short_code WHERE status=%d ORDER BY id DESC",1 ));
53
-
54
-
55
  if(isset($instance['title'])){
56
  $title = esc_attr($instance['title']);
57
  }else{
58
  $title = '';
59
  }
60
-
61
  if(isset($instance['message'])){
62
  $message = esc_attr($instance['message']);
63
  }else{
64
  $message = '';
65
  }
66
-
67
  ?>
68
  <p>
69
- <label for="<?php echo $this->get_field_id('title'); ?>"><?php _e('Title:'); ?></label>
70
  <input class="widefat" id="<?php echo $this->get_field_id('title'); ?>" name="<?php echo $this->get_field_name('title'); ?>" type="text" value="<?php echo $title; ?>" />
71
  </p>
72
  <p>
73
- <label for="<?php echo $this->get_field_id('message'); ?>"><?php _e('Choose Snippet :'); ?></label>
74
-
75
  <!-- <input class="widefat" id="<?php echo $this->get_field_id('message'); ?>" name="<?php echo $this->get_field_name('message'); ?>" type="text" value="<?php echo $message; ?>" />-->
76
  <select name="<?php echo $this->get_field_name('message'); ?>">
77
- <?php
78
  if( count($entries)>0 ) {
79
  $count=1;
80
  $class = '';
81
  foreach( $entries as $entry ) {
82
  ?>
83
  <option value="<?php echo $entry->id;?>" <?php if($message==$entry->id)echo "selected"; ?>><?php echo $entry->title;?></option>
84
- <?php
85
  }
86
  }
87
  ?>
88
  </select>
89
  </p>
90
- <?php
91
  }
92
-
93
-
94
  } // end class Xyz_Insert_Php_Widget
95
  add_action('widgets_init', create_function('', 'return register_widget("Xyz_Insert_Php_Widget");'));
96
- ?>
8
  ////*****************************Sidebar Widget**********************************////
9
 
10
  class Xyz_Insert_Php_Widget extends WP_Widget {
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
+
18
  /** @see WP_Widget::widget -- do not rename this */
19
+ function widget($args, $instance) {
20
  extract( $args );
21
  global $wpdb;
22
  $title = apply_filters('widget_title', $instance['title']);
23
  $xyz_ips_id = $instance['message'];
24
 
25
  $entries = $wpdb->get_results($wpdb->prepare( "SELECT content FROM ".$wpdb->prefix."xyz_ips_short_code WHERE id=%d",$xyz_ips_id ));
26
+
27
  $entry = $entries[0];
28
 
29
  echo $before_widget;
30
  if ( $title )
31
+ echo $before_title . $title . $after_title;
32
+
33
+ $content_to_eval=$entry->content;
34
+
35
+
36
+ /***** to handle old codes : start *****/
37
+
38
+ $xyz_ips_content_start='<?php';
39
+ $new_line="\r\n";
40
+ $xyz_ips_content_end='?>';
41
+
42
+ if (stripos($content_to_eval, '<?php') !== false)
43
+ $tag_start_position=stripos($content_to_eval,'<?php');
44
+ else
45
+ $tag_start_position="-1";
46
+
47
+ if (stripos($content_to_eval, '?>') !== false)
48
+ $tag_end_position=stripos($content_to_eval,'?>');
49
+ else
50
+ $tag_end_position="-1";
51
+
52
+ //echo "<br>start-".$tag_start_position;
53
+ //echo "<br>end-".$tag_end_position;
54
+
55
+ if(stripos($content_to_eval, '<?php') === false && stripos($content_to_eval, '?>') === false)
56
+ {
57
+ $content_to_eval=$xyz_ips_content_start.$new_line.$content_to_eval;
58
+ }
59
+ else if(stripos($content_to_eval, '<?php') !== false)
60
+ {
61
+ if($tag_start_position>=0 && $tag_end_position>=0 && $tag_start_position>$tag_end_position)
62
+ {
63
+ $content_to_eval=$xyz_ips_content_start.$new_line.$content_to_eval;
64
+ }
65
+ }
66
+ else if(stripos($content_to_eval, '<?php') === false)
67
+ {
68
+ if (stripos($content_to_eval, '?>') !== false)
69
+ {
70
+ $content_to_eval=$xyz_ips_content_start.$new_line.$content_to_eval;
71
+ }
72
+ }
73
+
74
+ /***** to handle old codes : end *****/
75
+
76
+ $content_to_eval='?>'.$content_to_eval;
77
+
78
+ eval($content_to_eval);
79
+
80
  echo $after_widget;
81
+
82
  }
83
+
84
  /** @see WP_Widget::update -- do not rename this */
85
+ function update($new_instance, $old_instance) {
86
  $instance = $old_instance;
87
  $instance['title'] = strip_tags($new_instance['title']);
88
  $instance['message'] = strip_tags($new_instance['message']);
89
  return $instance;
90
  }
91
+
92
  /** @see WP_Widget::form -- do not rename this */
93
+ function form($instance) {
94
  global $wpdb;
95
  $entries = $wpdb->get_results($wpdb->prepare( "SELECT * FROM ".$wpdb->prefix."xyz_ips_short_code WHERE status=%d ORDER BY id DESC",1 ));
96
+
97
+
98
  if(isset($instance['title'])){
99
  $title = esc_attr($instance['title']);
100
  }else{
101
  $title = '';
102
  }
103
+
104
  if(isset($instance['message'])){
105
  $message = esc_attr($instance['message']);
106
  }else{
107
  $message = '';
108
  }
109
+
110
  ?>
111
  <p>
112
+ <label for="<?php echo $this->get_field_id('title'); ?>"><?php _e('Title:'); ?></label>
113
  <input class="widefat" id="<?php echo $this->get_field_id('title'); ?>" name="<?php echo $this->get_field_name('title'); ?>" type="text" value="<?php echo $title; ?>" />
114
  </p>
115
  <p>
116
+ <label for="<?php echo $this->get_field_id('message'); ?>"><?php _e('Choose Snippet :'); ?></label>
117
+
118
  <!-- <input class="widefat" id="<?php echo $this->get_field_id('message'); ?>" name="<?php echo $this->get_field_name('message'); ?>" type="text" value="<?php echo $message; ?>" />-->
119
  <select name="<?php echo $this->get_field_name('message'); ?>">
120
+ <?php
121
  if( count($entries)>0 ) {
122
  $count=1;
123
  $class = '';
124
  foreach( $entries as $entry ) {
125
  ?>
126
  <option value="<?php echo $entry->id;?>" <?php if($message==$entry->id)echo "selected"; ?>><?php echo $entry->title;?></option>
127
+ <?php
128
  }
129
  }
130
  ?>
131
  </select>
132
  </p>
133
+ <?php
134
  }
135
+
136
+
137
  } // end class Xyz_Insert_Php_Widget
138
  add_action('widgets_init', create_function('', 'return register_widget("Xyz_Insert_Php_Widget");'));
139
+ ?>
xyz-functions.php CHANGED
@@ -1,54 +1,53 @@
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()
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_PHP_PLUGIN_FILE ) ) );
12
- // print_r($plugin_folder);
13
- return $plugin_folder['insert-php-code-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_ips_links')){
39
- function xyz_ips_links($links, $file) {
40
- $base = plugin_basename(XYZ_INSERT_PHP_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_ips_links',10,2);
53
-
54
  ?>
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()
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_PHP_PLUGIN_FILE ) ) );
12
+ return $plugin_folder['insert-php-code-snippet.php']['Version'];
13
+ }
14
+ }
15
+
16
+ if(!function_exists('xyz_trim_deep'))
17
+ {
18
+
19
+ function xyz_trim_deep($value) {
20
+ if ( is_array($value) ) {
21
+ $value = array_map('xyz_trim_deep', $value);
22
+ } elseif ( is_object($value) ) {
23
+ $vars = get_object_vars( $value );
24
+ foreach ($vars as $key=>$data) {
25
+ $value->{$key} = xyz_trim_deep( $data );
26
+ }
27
+ } else {
28
+ $value = trim($value);
29
+ }
30
+
31
+ return $value;
32
+ }
33
+
34
+ }
35
+
36
+
37
+ if(!function_exists('xyz_ips_links')){
38
+ function xyz_ips_links($links, $file) {
39
+ $base = plugin_basename(XYZ_INSERT_PHP_PLUGIN_FILE);
40
+ if ($file == $base) {
41
+
42
+ $links[] = '<a href="https://xyzscripts.com/support/" class="xyz_support" title="Support"></a>';
43
+ $links[] = '<a href="https://twitter.com/xyzscripts" class="xyz_twitt" title="Follow us on Twitter"></a>';
44
+ $links[] = '<a href="https://www.facebook.com/xyzscripts" class="xyz_fbook" title="Like us on Facebook"></a>';
45
+ $links[] = '<a href="https://plus.google.com/+Xyzscripts/" class="xyz_gplus" title="+1 us on Google+"></a>';
46
+ $links[] = '<a href="https://www.linkedin.com/company/xyzscripts" class="xyz_linkedin" title="Follow us on LinkedIn"></a>';
47
+ }
48
+ return $links;
49
+ }
50
+ }
51
+ add_filter( 'plugin_row_meta','xyz_ips_links',10,2);
52
+
 
53
  ?>