| @@ -4,31 +4,32 @@ | ||
| 4 | 4 | global $wpdb; |
| 5 | 5 | // Load the options |
| 6 | 6 | |
| 7 | 7 | |
| 8 | -if(isset($_GET['ihsap_notice'])&& $_GET['ihsap_notice'] == 'hide') | |
| 8 | +if(!$_POST && isset($_GET['ihs_notice'])&& $_GET['ihs_notice'] == 'hide') | |
| 9 | 9 | { |
| 10 | - update_option('xyz_ihsap_dnt_shw_notice', "hide"); | |
| 10 | + if (! isset( $_REQUEST['_wpnonce'] ) || ! wp_verify_nonce( $_REQUEST['_wpnonce'],'ihs-shw')){ | |
| 11 | + wp_nonce_ays( 'ihs-shw'); | |
| 12 | + exit; | |
| 13 | + } | |
| 14 | + update_option('xyz_ihs_dnt_shw_notice', "hide"); | |
| 11 | 15 | ?> |
| 12 | 16 | <style type='text/css'> |
| 13 | -#ihs_notice_td | |
| 17 | +#xyz_ihs_notice_td | |
| 14 | 18 | { |
| 15 | -display:none; | |
| 19 | +display:none !important; | |
| 16 | 20 | } |
| 17 | 21 | </style> |
| 18 | -<div class="system_notice_area_style1" id="system_notice_area"> | |
| 22 | +<div class="xyz_ihs_system_notice_area_style1" id="xyz_ihs_system_notice_area"> | |
| 19 | 23 | Thanks again for using the plugin. We will never show the message again. |
| 20 | - <span | |
| 21 | - id="system_notice_area_dismiss">Dismiss</span> | |
| 24 | + <span id="xyz_ihs_system_notice_area_dismiss">Dismiss</span> | |
| 22 | 25 | </div> |
| 23 | 26 | <?php |
| 24 | 27 | } |
| 25 | 28 | |
| 26 | - | |
| 27 | - | |
| 28 | 29 | if($_POST){ |
| 29 | - if (! isset( $_REQUEST['_wpnonce'] ) || ! wp_verify_nonce( $_REQUEST['_wpnonce'], 'snipp-setting_' )) { | |
| 30 | - wp_nonce_ays( 'snipp-setting_' ); | |
| 30 | + if (! isset( $_REQUEST['_wpnonce'] ) || ! wp_verify_nonce( $_REQUEST['_wpnonce'], 'ihs-setting_' )) { | |
| 31 | + wp_nonce_ays( 'ihs-setting_' ); | |
| 31 | 32 | exit; |
| 32 | 33 | } |
| 33 | 34 | else { |
| 34 | 35 | $_POST=xyz_trim_deep($_POST); |
| @@ -33,36 +34,42 @@ | ||
| 33 | 34 | else { |
| 34 | 35 | $_POST=xyz_trim_deep($_POST); |
| 35 | 36 | $_POST = stripslashes_deep($_POST); |
| 36 | 37 | $xyz_ihs_limit = abs(intval($_POST['xyz_ihs_limit'])); |
| 38 | + $xyz_ihs_pre_ads = intval($_POST['xyz_ihs_pre_ads']); | |
| 39 | + $xyz_ihs_exec_in_editor = intval($_POST['xyz_ihs_exec_in_editor']); | |
| 37 | 40 | if($xyz_ihs_limit==0)$xyz_ihs_limit=20; |
| 38 | - $xyz_ihs_credit = $_POST['xyz_ihs_credit']; | |
| 41 | + $xyz_ihs_credit = sanitize_text_field($_POST['xyz_ihs_credit']); | |
| 39 | 42 | if($xyz_ihs_credit=="ihs" || $xyz_ihs_credit==0) |
| 40 | 43 | { |
| 41 | 44 | update_option('xyz_credit_link',$xyz_ihs_credit); |
| 42 | 45 | } |
| 43 | - | |
| 44 | - $xyz_ihs_sortfield=$_POST['xyz_ihs_sort_by_field']; | |
| 46 | + | |
| 47 | + $xyz_ihs_sortfield=sanitize_text_field($_POST['xyz_ihs_sort_by_field']); | |
| 45 | 48 | if(($xyz_ihs_sortfield=="title")||($xyz_ihs_sortfield=="id")) |
| 46 | 49 | { |
| 47 | 50 | update_option('xyz_ihs_sort_field_name',$xyz_ihs_sortfield); |
| 48 | 51 | } |
| 49 | - | |
| 50 | - $xyz_ihs_sortorder=$_POST['xyz_ihs_sort_by_order']; | |
| 52 | + | |
| 53 | + $xyz_ihs_sortorder=sanitize_text_field($_POST['xyz_ihs_sort_by_order']); | |
| 51 | 54 | if(($xyz_ihs_sortorder=="asc")||($xyz_ihs_sortorder=="desc")) |
| 52 | 55 | { |
| 53 | 56 | update_option('xyz_ihs_sort_order',$xyz_ihs_sortorder); |
| 54 | 57 | } |
| 55 | 58 | |
| 59 | + $xyz_ihs_show_snippet_usage=intval($_POST['xyz_ihs_show_snippet_usage']); | |
| 60 | + update_option('xyz_ihs_show_snippet_usage',$xyz_ihs_show_snippet_usage); | |
| 56 | 61 | |
| 57 | 62 | update_option('xyz_ihs_limit',$xyz_ihs_limit); |
| 58 | - | |
| 59 | - | |
| 60 | - | |
| 63 | + update_option('xyz_ihs_exec_in_editor',$xyz_ihs_exec_in_editor); | |
| 64 | + | |
| 61 | 65 | ?> |
| 62 | -<div class="system_notice_area_style1" id="system_notice_area"> | |
| 66 | +<!-- <div class="xyz_ihs_system_notice_area_style1" id="xyz_ihs_system_notice_area"> | |
| 63 | 67 | Settings updated successfully. |
| 64 | - <span id="system_notice_area_dismiss">Dismiss</span> | |
| 68 | + <span id="xyz_ihs_system_notice_area_dismiss">Dismiss</span> | |
| 69 | +</div> --> | |
| 70 | + <div class="notice notice-success is-dismissible"> | |
| 71 | + <p><strong>Settings updated successfully. </strong></p> | |
| 65 | 72 | </div> |
| 66 | 73 | <?php |
| 67 | 74 | } |
| 68 | 75 | } |
| @@ -68,9 +75,9 @@ | ||
| 68 | 75 | } |
| 69 | 76 | ?> |
| 70 | 77 | <div> |
| 71 | 78 | <form method="post"> |
| 72 | - <?php wp_nonce_field('snipp-setting_');?> | |
| 79 | + <?php wp_nonce_field('ihs-setting_');?> | |
| 73 | 80 | <div style="float: left;width: 98%"> |
| 74 | 81 | <fieldset style=" width:100%; border:1px solid #F7F7F7; padding:10px 0px 15px 10px;"> |
| 75 | 82 | <legend ><h3> |
| 76 | 83 | Settings |
| @@ -105,9 +112,9 @@ | ||
| 105 | 112 | </select> |
| 106 | 113 | </td> |
| 107 | 114 | </tr> |
| 108 | 115 | <tr valign="top"> |
| 109 | - <td scope="row" class=" settingInput" id=""> | |
| 116 | + <td scope="row" class=" xyz_ihs_settingInput" id=""> | |
| 110 | 117 | <label for="xyz_ihs_limit">Pagination limit</label> |
| 111 | 118 | </td> |
| 112 | 119 | <td id=""> |
| 113 | 120 | <input name="xyz_ihs_limit" type="text" |
| @@ -115,12 +122,47 @@ | ||
| 115 | 122 | <?php if(isset($_POST['xyz_ihs_limit']) ){echo abs(intval($_POST['xyz_ihs_limit']));}else{print(get_option('xyz_ihs_limit'));} ?>" /> |
| 116 | 123 | </td> |
| 117 | 124 | </tr> |
| 118 | 125 | <tr valign="top"> |
| 119 | - <td scope="row" class=" settingInput" id="bottomBorderNone"> | |
| 126 | + <td scope="row"> | |
| 127 | + <label for="xyz_ihs_pre_ads">Premium Version Ads</label> | |
| 120 | 128 | </td> |
| 121 | - <td id="bottomBorderNone"> | |
| 122 | - <input style="margin:10px 0 20px 0;" id="submit" class="button-primary bottonWidth" type="submit" value=" Update Settings " /> | |
| 129 | + <td> | |
| 130 | + <select name="xyz_ihs_pre_ads" id="xyz_ihs_pre_ads"> | |
| 131 | + <option value="0">Disable</option> | |
| 132 | + <option value="1" <?php selected(get_option('xyz_ihs_premium_version_ads'),1);?>>Enable</option> | |
| 133 | + </select> | |
| 134 | + </td> | |
| 135 | + </tr> | |
| 136 | + <tr valign="top"> | |
| 137 | + <td scope="row"> | |
| 138 | + <label for="xyz_ihs_exec_in_editor">Execute shortcodes in editors</label><br/><span style="color: #1A87B9;font-size:13px;" >[Enable/Disable Shortcode Execution in Editors (Gutenberg, Classic, Elementor, etc.)]</span> | |
| 139 | + </td> | |
| 140 | + <td> | |
| 141 | + <select name="xyz_ihs_exec_in_editor" id="xyz_ihs_exec_in_editor"> | |
| 142 | + <option value="0" <?php selected(get_option('xyz_ihs_exec_in_editor'),0);?>>Disable</option> | |
| 143 | + <option value="1" <?php selected(get_option('xyz_ihs_exec_in_editor'),1);?>>Enable</option> | |
| 144 | + </select> | |
| 145 | + </td> | |
| 146 | + </tr> | |
| 147 | + <tr valign="top"> | |
| 148 | + <td scope="row"> | |
| 149 | + <label for="xyz_ihs_show_snippet_usage">Show Snippet Usage Details </label> | |
| 150 | + <img src="<?php echo plugins_url('insert-html-snippet/images/support.png')?>" onmouseover="document.getElementById('xyz_ihs_usage_note').style.display = '';" onmouseout="document.getElementById('xyz_ihs_usage_note').style.display = 'none';"> | |
| 151 | + <div id="xyz_ihs_usage_note" class="xyz_ihs_informationdiv" style="display: none;">Display where each snippet is used (posts/pages) within the admin panel.<br/>Usage data is maintained automatically after the initial sync.</div> | |
| 152 | + </td> | |
| 153 | + <td> | |
| 154 | + <select name="xyz_ihs_show_snippet_usage" id="xyz_ihs_show_snippet_usage"> | |
| 155 | + <option value="0" <?php selected(get_option('xyz_ihs_show_snippet_usage'),0);?>>Disable</option> | |
| 156 | + <option value="1" <?php selected(get_option('xyz_ihs_show_snippet_usage'),1);?>>Enable</option> | |
| 157 | + </select> | |
| 158 | + </td> | |
| 159 | + </tr> | |
| 160 | + <tr valign="top"> | |
| 161 | + <td scope="row" class=" xyz_ihs_settingInput" id="xyz_ihs_bottomBorderNone"> | |
| 162 | + </td> | |
| 163 | + <td id="xyz_ihs_bottomBorderNone"> | |
| 164 | + <input style="margin:10px 0 20px 0;" id="submit" class="button-primary xyz_ihs_bottonWidth" type="submit" value=" Update Settings " /> | |
| 123 | 165 | </td> |
| 124 | 166 | </tr> |
| 125 | 167 | </table> |
| 126 | 168 | </fieldset> |