Version Description
2022-03-05 * ADDED: Ability to apply snippets to search, home, archive page only * ADDED: Snippet search functionality * ADDED: Snippet type filter * ADDED: Snippet sort by location * ADDED: Delete snippet button on edit snippet page
Download this release
Release Info
Developer | 99robots |
Plugin | Header Footer Code Manager |
Version | 1.1.18 |
Comparing to | |
See all releases |
Code changes from version 1.1.17 to 1.1.18
- 99robots-header-footer-code-manager.php +24 -5
- css/style-admin.css +1 -1
- includes/class-hfcm-snippets-list.php +100 -14
- includes/hfcm-add-edit.php +17 -6
- readme.txt +8 -1
99robots-header-footer-code-manager.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
* Plugin Name: Header Footer Code Manager
|
4 |
* Plugin URI: https://draftpress.com/products
|
5 |
* Description: Header Footer Code Manager by 99 Robots is a quick and simple way for you to add tracking code snippets, conversion pixels, or other scripts required by third party services for analytics, tracking, marketing, or chat functions. For detailed documentation, please visit the plugin's <a href="https://draftpress.com/"> official page</a>.
|
6 |
-
* Version: 1.1.
|
7 |
* Requires at least: 4.9
|
8 |
* Requires PHP: 5.6.20
|
9 |
* Author: 99robots
|
@@ -41,7 +41,7 @@ if ( !class_exists( 'NNR_HFCM' ) ) :
|
|
41 |
|
42 |
class NNR_HFCM
|
43 |
{
|
44 |
-
public static $nnr_hfcm_db_version = "1.
|
45 |
public static $nnr_hfcm_table = "hfcm_scripts";
|
46 |
|
47 |
|
@@ -77,7 +77,7 @@ if ( !class_exists( 'NNR_HFCM' ) ) :
|
|
77 |
`snippet_type` enum('html', 'js', 'css') DEFAULT 'html',
|
78 |
`device_type` enum('mobile','desktop', 'both') DEFAULT 'both',
|
79 |
`location` varchar(100) NOT NULL,
|
80 |
-
`display_on` enum('All','s_pages', 's_posts','s_categories','s_custom_posts','s_tags','latest_posts','manual') NOT NULL DEFAULT 'All',
|
81 |
`lp_count` int(10) DEFAULT NULL,
|
82 |
`s_pages` varchar(300) DEFAULT NULL,
|
83 |
`ex_pages` varchar(300) DEFAULT NULL,
|
@@ -153,6 +153,9 @@ if ( !class_exists( 'NNR_HFCM' ) ) :
|
|
153 |
|
154 |
$nnr_alter_sql = "ALTER TABLE `$table_name` CHANGE `snippet` `snippet` LONGTEXT NULL";
|
155 |
$wpdb->query( $nnr_alter_sql );
|
|
|
|
|
|
|
156 |
}
|
157 |
self::hfcm_options_install();
|
158 |
}
|
@@ -486,6 +489,21 @@ if ( !class_exists( 'NNR_HFCM' ) ) :
|
|
486 |
$out = self::hfcm_render_snippet( $scriptdata );
|
487 |
}
|
488 |
break;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
489 |
case 's_pages':
|
490 |
$is_not_empty_s_pages = self::hfcm_not_empty( $scriptdata, 's_pages' );
|
491 |
if ( $is_not_empty_s_pages ) {
|
@@ -1011,8 +1029,8 @@ if ( !class_exists( 'NNR_HFCM' ) ) :
|
|
1011 |
if ( $is_pro_version_active ) {
|
1012 |
?>
|
1013 |
<div class="notice hfcm-warning-notice notice-warning">
|
1014 |
-
<?php _e( 'Please deactivate the
|
1015 |
-
You can use our tools to import all the snippets from the
|
1016 |
</div>
|
1017 |
<?php
|
1018 |
}
|
@@ -1051,6 +1069,7 @@ if ( !class_exists( 'NNR_HFCM' ) ) :
|
|
1051 |
<form method="post">
|
1052 |
<?php
|
1053 |
$snippet_obj->prepare_items();
|
|
|
1054 |
$snippet_obj->display();
|
1055 |
?>
|
1056 |
</form>
|
3 |
* Plugin Name: Header Footer Code Manager
|
4 |
* Plugin URI: https://draftpress.com/products
|
5 |
* Description: Header Footer Code Manager by 99 Robots is a quick and simple way for you to add tracking code snippets, conversion pixels, or other scripts required by third party services for analytics, tracking, marketing, or chat functions. For detailed documentation, please visit the plugin's <a href="https://draftpress.com/"> official page</a>.
|
6 |
+
* Version: 1.1.18
|
7 |
* Requires at least: 4.9
|
8 |
* Requires PHP: 5.6.20
|
9 |
* Author: 99robots
|
41 |
|
42 |
class NNR_HFCM
|
43 |
{
|
44 |
+
public static $nnr_hfcm_db_version = "1.4";
|
45 |
public static $nnr_hfcm_table = "hfcm_scripts";
|
46 |
|
47 |
|
77 |
`snippet_type` enum('html', 'js', 'css') DEFAULT 'html',
|
78 |
`device_type` enum('mobile','desktop', 'both') DEFAULT 'both',
|
79 |
`location` varchar(100) NOT NULL,
|
80 |
+
`display_on` enum('All','s_pages', 's_posts','s_categories','s_custom_posts','s_tags', 's_is_home', 's_is_search', 's_is_archive','latest_posts','manual') NOT NULL DEFAULT 'All',
|
81 |
`lp_count` int(10) DEFAULT NULL,
|
82 |
`s_pages` varchar(300) DEFAULT NULL,
|
83 |
`ex_pages` varchar(300) DEFAULT NULL,
|
153 |
|
154 |
$nnr_alter_sql = "ALTER TABLE `$table_name` CHANGE `snippet` `snippet` LONGTEXT NULL";
|
155 |
$wpdb->query( $nnr_alter_sql );
|
156 |
+
|
157 |
+
$nnr_alter_sql = "ALTER TABLE `$table_name` CHANGE `display_on` `display_on` ENUM('All','s_pages','s_posts','s_categories','s_custom_posts','s_tags','s_is_home','s_is_archive','s_is_search','latest_posts','manual') DEFAULT 'All' NOT NULL";
|
158 |
+
$wpdb->query( $nnr_alter_sql );
|
159 |
}
|
160 |
self::hfcm_options_install();
|
161 |
}
|
489 |
$out = self::hfcm_render_snippet( $scriptdata );
|
490 |
}
|
491 |
break;
|
492 |
+
case 's_is_home':
|
493 |
+
if ( is_home() ) {
|
494 |
+
$out = self::hfcm_render_snippet( $scriptdata );
|
495 |
+
}
|
496 |
+
break;
|
497 |
+
case 's_is_archive':
|
498 |
+
if ( is_archive() ) {
|
499 |
+
$out = self::hfcm_render_snippet( $scriptdata );
|
500 |
+
}
|
501 |
+
break;
|
502 |
+
case 's_is_search':
|
503 |
+
if ( is_search() ) {
|
504 |
+
$out = self::hfcm_render_snippet( $scriptdata );
|
505 |
+
}
|
506 |
+
break;
|
507 |
case 's_pages':
|
508 |
$is_not_empty_s_pages = self::hfcm_not_empty( $scriptdata, 's_pages' );
|
509 |
if ( $is_not_empty_s_pages ) {
|
1029 |
if ( $is_pro_version_active ) {
|
1030 |
?>
|
1031 |
<div class="notice hfcm-warning-notice notice-warning">
|
1032 |
+
<?php _e( 'Please deactivate the free version of this plugin in order to avoid duplication of the snippets.
|
1033 |
+
You can use our tools to import all the snippets from the free version of this plugin.', '99robots-header-footer-code-manager' ); ?>
|
1034 |
</div>
|
1035 |
<?php
|
1036 |
}
|
1069 |
<form method="post">
|
1070 |
<?php
|
1071 |
$snippet_obj->prepare_items();
|
1072 |
+
$snippet_obj->search_box( 'Search Snippets', 'search_id' );
|
1073 |
$snippet_obj->display();
|
1074 |
?>
|
1075 |
</form>
|
css/style-admin.css
CHANGED
@@ -17,7 +17,7 @@
|
|
17 |
#nnr_newcontent {
|
18 |
width: 75%;
|
19 |
}
|
20 |
-
.nnr-btnsave {
|
21 |
margin-top: 10px !important;
|
22 |
}
|
23 |
.padding20 {
|
17 |
#nnr_newcontent {
|
18 |
width: 75%;
|
19 |
}
|
20 |
+
.nnr-btnsave, .nnr-btndelete {
|
21 |
margin-top: 10px !important;
|
22 |
}
|
23 |
.padding20 {
|
includes/class-hfcm-snippets-list.php
CHANGED
@@ -40,7 +40,7 @@ class Hfcm_Snippets_List extends WP_List_Table
|
|
40 |
|
41 |
if ( !empty( $_GET['orderby'] ) ) {
|
42 |
$orderby = sanitize_sql_orderby( $_GET['orderby'] );
|
43 |
-
if ( empty( $orderby ) || !in_array( $orderby, array( 'script_id', 'name' ) ) ) {
|
44 |
$orderby = 'script_id';
|
45 |
}
|
46 |
}
|
@@ -51,10 +51,22 @@ class Hfcm_Snippets_List extends WP_List_Table
|
|
51 |
}
|
52 |
}
|
53 |
|
54 |
-
$sql = "SELECT * FROM $table_name";
|
55 |
if ( in_array( $customvar, array( 'inactive', 'active' ) ) ) {
|
56 |
-
$sql .= "
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
57 |
}
|
|
|
|
|
|
|
|
|
|
|
58 |
$sql .= ' ORDER BY ' . $orderby . ' ' . $order . ' LIMIT ' . $per_page . ' OFFSET ' . ($page_number - 1) * $per_page;
|
59 |
|
60 |
$result = $wpdb->get_results( $sql, 'ARRAY_A' );
|
@@ -177,6 +189,9 @@ class Hfcm_Snippets_List extends WP_List_Table
|
|
177 |
's_categories' => esc_html__( 'Specific Categories', '99robots-header-footer-code-manager' ),
|
178 |
's_custom_posts' => esc_html__( 'Specific Custom Post Types', '99robots-header-footer-code-manager' ),
|
179 |
's_tags' => esc_html__( 'Specific Tags', '99robots-header-footer-code-manager' ),
|
|
|
|
|
|
|
180 |
'latest_posts' => esc_html__( 'Latest Posts', '99robots-header-footer-code-manager' ),
|
181 |
'manual' => esc_html__( 'Shortcode Only', '99robots-header-footer-code-manager' ),
|
182 |
);
|
@@ -224,6 +239,13 @@ class Hfcm_Snippets_List extends WP_List_Table
|
|
224 |
} else {
|
225 |
return esc_html( $item[ $column_name ] );
|
226 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
227 |
|
228 |
case 'status':
|
229 |
|
@@ -289,10 +311,10 @@ class Hfcm_Snippets_List extends WP_List_Table
|
|
289 |
|
290 |
$nnr_current_screen = get_current_screen();
|
291 |
|
292 |
-
if(!empty($nnr_current_screen->parent_base)) {
|
293 |
-
$page
|
294 |
} else {
|
295 |
-
$page
|
296 |
}
|
297 |
$actions = array(
|
298 |
'edit' => sprintf( '<a href="?page=%s&action=%s&id=%s&_wpnonce=%s">' . esc_html__( 'Edit', '99robots-header-footer-code-manager' ) . '</a>', esc_attr( 'hfcm-update' ), 'edit', absint( $item['script_id'] ), $edit_nonce ),
|
@@ -310,14 +332,15 @@ class Hfcm_Snippets_List extends WP_List_Table
|
|
310 |
function get_columns()
|
311 |
{
|
312 |
$columns = array(
|
313 |
-
'cb'
|
314 |
-
'script_id'
|
315 |
-
'status'
|
316 |
-
'name'
|
317 |
-
'display_on'
|
318 |
-
'location'
|
319 |
-
'
|
320 |
-
'
|
|
|
321 |
);
|
322 |
|
323 |
return $columns;
|
@@ -333,6 +356,7 @@ class Hfcm_Snippets_List extends WP_List_Table
|
|
333 |
|
334 |
return array(
|
335 |
'name' => array( 'name', true ),
|
|
|
336 |
'script_id' => array( 'script_id', false ),
|
337 |
);
|
338 |
}
|
@@ -352,6 +376,44 @@ class Hfcm_Snippets_List extends WP_List_Table
|
|
352 |
);
|
353 |
}
|
354 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
355 |
/**
|
356 |
* Handles data query and filter, sorting, and pagination.
|
357 |
*/
|
@@ -490,5 +552,29 @@ class Hfcm_Snippets_List extends WP_List_Table
|
|
490 |
return;
|
491 |
}
|
492 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
493 |
}
|
494 |
|
40 |
|
41 |
if ( !empty( $_GET['orderby'] ) ) {
|
42 |
$orderby = sanitize_sql_orderby( $_GET['orderby'] );
|
43 |
+
if ( empty( $orderby ) || !in_array( $orderby, array( 'script_id', 'name', 'location' ) ) ) {
|
44 |
$orderby = 'script_id';
|
45 |
}
|
46 |
}
|
51 |
}
|
52 |
}
|
53 |
|
54 |
+
$sql = "SELECT * FROM $table_name WHERE 1";
|
55 |
if ( in_array( $customvar, array( 'inactive', 'active' ) ) ) {
|
56 |
+
$sql .= " AND status = '$customvar'";
|
57 |
+
|
58 |
+
}
|
59 |
+
if ( !empty( $_POST['snippet_type'] ) ) {
|
60 |
+
$snippet_type = addslashes( sanitize_text_field( $_POST['snippet_type'] ) );
|
61 |
+
if ( in_array( $snippet_type, array( 'html', 'css', 'js' ) ) ) {
|
62 |
+
$sql .= " AND snippet_type = '$snippet_type'";
|
63 |
+
}
|
64 |
}
|
65 |
+
if ( !empty( $_POST['s'] ) ) {
|
66 |
+
$search_query = addslashes( sanitize_text_field( $_POST['s'] ) );
|
67 |
+
$sql .= " AND name LIKE '%$search_query%'";
|
68 |
+
}
|
69 |
+
|
70 |
$sql .= ' ORDER BY ' . $orderby . ' ' . $order . ' LIMIT ' . $per_page . ' OFFSET ' . ($page_number - 1) * $per_page;
|
71 |
|
72 |
$result = $wpdb->get_results( $sql, 'ARRAY_A' );
|
189 |
's_categories' => esc_html__( 'Specific Categories', '99robots-header-footer-code-manager' ),
|
190 |
's_custom_posts' => esc_html__( 'Specific Custom Post Types', '99robots-header-footer-code-manager' ),
|
191 |
's_tags' => esc_html__( 'Specific Tags', '99robots-header-footer-code-manager' ),
|
192 |
+
's_is_home' => esc_html__( 'Home Page', '99robots-header-footer-code-manager' ),
|
193 |
+
's_is_search' => esc_html__( 'Search Page', '99robots-header-footer-code-manager' ),
|
194 |
+
's_is_archive' => esc_html__( 'Archive Page', '99robots-header-footer-code-manager' ),
|
195 |
'latest_posts' => esc_html__( 'Latest Posts', '99robots-header-footer-code-manager' ),
|
196 |
'manual' => esc_html__( 'Shortcode Only', '99robots-header-footer-code-manager' ),
|
197 |
);
|
239 |
} else {
|
240 |
return esc_html( $item[ $column_name ] );
|
241 |
}
|
242 |
+
case 'snippet_type':
|
243 |
+
$snippet_types = array(
|
244 |
+
'html' => esc_html__( 'HTML', '99robots-header-footer-code-manager' ),
|
245 |
+
'css' => esc_html__( 'CSS', '99robots-header-footer-code-manager' ),
|
246 |
+
'js' => esc_html__( 'Javascript', '99robots-header-footer-code-manager' )
|
247 |
+
);
|
248 |
+
return esc_html( $snippet_types[ $item[ $column_name ] ] );
|
249 |
|
250 |
case 'status':
|
251 |
|
311 |
|
312 |
$nnr_current_screen = get_current_screen();
|
313 |
|
314 |
+
if ( !empty( $nnr_current_screen->parent_base ) ) {
|
315 |
+
$page = $nnr_current_screen->parent_base;
|
316 |
} else {
|
317 |
+
$page = sanitize_text_field( $_GET['page'] );
|
318 |
}
|
319 |
$actions = array(
|
320 |
'edit' => sprintf( '<a href="?page=%s&action=%s&id=%s&_wpnonce=%s">' . esc_html__( 'Edit', '99robots-header-footer-code-manager' ) . '</a>', esc_attr( 'hfcm-update' ), 'edit', absint( $item['script_id'] ), $edit_nonce ),
|
332 |
function get_columns()
|
333 |
{
|
334 |
$columns = array(
|
335 |
+
'cb' => '<input type="checkbox" />',
|
336 |
+
'script_id' => esc_html__( 'ID', '99robots-header-footer-code-manager' ),
|
337 |
+
'status' => esc_html__( 'Status', '99robots-header-footer-code-manager' ),
|
338 |
+
'name' => esc_html__( 'Snippet Name', '99robots-header-footer-code-manager' ),
|
339 |
+
'display_on' => esc_html__( 'Display On', '99robots-header-footer-code-manager' ),
|
340 |
+
'location' => esc_html__( 'Location', '99robots-header-footer-code-manager' ),
|
341 |
+
'snippet_type' => esc_html__( 'Snippet Type', '99robots-header-footer-code-manager' ),
|
342 |
+
'device_type' => esc_html__( 'Devices', '99robots-header-footer-code-manager' ),
|
343 |
+
'shortcode' => esc_html__( 'Shortcode', '99robots-header-footer-code-manager' ),
|
344 |
);
|
345 |
|
346 |
return $columns;
|
356 |
|
357 |
return array(
|
358 |
'name' => array( 'name', true ),
|
359 |
+
'location' => array( 'location', true ),
|
360 |
'script_id' => array( 'script_id', false ),
|
361 |
);
|
362 |
}
|
376 |
);
|
377 |
}
|
378 |
|
379 |
+
/**
|
380 |
+
* Add filters and extra actions above and below the table
|
381 |
+
*
|
382 |
+
* @param string $which Are the actions displayed on the table top or bottom
|
383 |
+
*/
|
384 |
+
public function extra_tablenav( $which )
|
385 |
+
{
|
386 |
+
if ( 'top' === $which ) {
|
387 |
+
$query = isset( $_POST['snippet_type'] ) ? sanitize_text_field( $_POST['snippet_type'] ) : '';
|
388 |
+
$snippet_type = array(
|
389 |
+
'html' => esc_html__( 'HTML', '99robots-header-footer-code-manager' ),
|
390 |
+
'css' => esc_html__( 'CSS', '99robots-header-footer-code-manager' ),
|
391 |
+
'js' => esc_html__( 'Javascript', '99robots-header-footer-code-manager' )
|
392 |
+
);
|
393 |
+
|
394 |
+
echo '<div class="alignleft actions">';
|
395 |
+
echo '<select name="snippet_type">';
|
396 |
+
echo '<option value="">' . esc_html__( 'All Snippet Types', '99robots-header-footer-code-manager' ) . '</option>';
|
397 |
+
|
398 |
+
foreach ( $snippet_type as $key_type => $type ) {
|
399 |
+
if ( $key_type == $query ) {
|
400 |
+
echo '<option value="' . $key_type . '" selected>' . $type . '</option>';
|
401 |
+
} else {
|
402 |
+
echo '<option value="' . $key_type . '">' . $type . '</option>';
|
403 |
+
}
|
404 |
+
}
|
405 |
+
|
406 |
+
echo '</select>';
|
407 |
+
submit_button( __( 'Filter', '99robots-header-footer-code-manager' ), 'button', 'filter_action', false );
|
408 |
+
echo '</div>';
|
409 |
+
}
|
410 |
+
|
411 |
+
echo '<div class="alignleft actions">';
|
412 |
+
|
413 |
+
|
414 |
+
echo '</div>';
|
415 |
+
}
|
416 |
+
|
417 |
/**
|
418 |
* Handles data query and filter, sorting, and pagination.
|
419 |
*/
|
552 |
return;
|
553 |
}
|
554 |
}
|
555 |
+
|
556 |
+
/**
|
557 |
+
* Displays the search box.
|
558 |
+
*
|
559 |
+
* @param string $text The 'submit' button label.
|
560 |
+
* @param string $input_id ID attribute value for the search input field.
|
561 |
+
* @since 3.1.0
|
562 |
+
*
|
563 |
+
*/
|
564 |
+
public function search_box( $text, $input_id )
|
565 |
+
{
|
566 |
+
if ( empty( $_REQUEST['s'] ) && !$this->has_items() ) {
|
567 |
+
return;
|
568 |
+
}
|
569 |
+
$input_id = $input_id . '-search-input';
|
570 |
+
?>
|
571 |
+
<p class="search-box">
|
572 |
+
<label class="screen-reader-text" for="<?php echo esc_attr( $input_id ); ?>"><?php echo $text; ?>:</label>
|
573 |
+
<input type="search" id="<?php echo esc_attr( $input_id ); ?>" name="s"
|
574 |
+
value="<?php _admin_search_query(); ?>"/>
|
575 |
+
<?php submit_button( $text, '', '', false, array( 'id' => 'search-submit' ) ); ?>
|
576 |
+
</p>
|
577 |
+
<?php
|
578 |
+
}
|
579 |
}
|
580 |
|
includes/hfcm-add-edit.php
CHANGED
@@ -100,6 +100,9 @@ wp_enqueue_script( 'hfcm_showboxes' );
|
|
100 |
's_categories' => esc_html__( 'Specific Categories (Archive & Posts)', '99robots-header-footer-code-manager' ),
|
101 |
's_custom_posts' => esc_html__( 'Specific Post Types (Archive & Posts)', '99robots-header-footer-code-manager' ),
|
102 |
's_tags' => esc_html__( 'Specific Tags (Archive & Posts)', '99robots-header-footer-code-manager' ),
|
|
|
|
|
|
|
103 |
'latest_posts' => esc_html__( 'Latest Posts', '99robots-header-footer-code-manager' ),
|
104 |
'manual' => esc_html__( 'Shortcode Only', '99robots-header-footer-code-manager' ),
|
105 |
); ?>
|
@@ -296,17 +299,19 @@ wp_enqueue_script( 'hfcm_showboxes' );
|
|
296 |
}
|
297 |
?>
|
298 |
</select>
|
299 |
-
<p
|
|
|
|
|
300 |
</td>
|
301 |
</tr>
|
302 |
<?php $nnr_hfcm_device_type_array = array(
|
303 |
-
|
304 |
-
|
305 |
-
|
306 |
) ?>
|
307 |
<?php $nnr_hfcm_status_array = array(
|
308 |
-
|
309 |
-
|
310 |
) ?>
|
311 |
<tr>
|
312 |
<th class="hfcm-th-width"><?php esc_html_e( 'Device Display', '99robots-header-footer-code-manager' ); ?></th>
|
@@ -374,6 +379,12 @@ wp_enqueue_script( 'hfcm_showboxes' );
|
|
374 |
name="<?php echo $update ? 'update' : 'insert'; ?>"
|
375 |
value="<?php echo $update ? esc_html__( 'Update', '99robots-header-footer-code-manager' ) : esc_html__( 'Save', '99robots-header-footer-code-manager' ) ?>"
|
376 |
class="button button-primary button-large nnr-btnsave">
|
|
|
|
|
|
|
|
|
|
|
|
|
377 |
</div>
|
378 |
</div>
|
379 |
</div>
|
100 |
's_categories' => esc_html__( 'Specific Categories (Archive & Posts)', '99robots-header-footer-code-manager' ),
|
101 |
's_custom_posts' => esc_html__( 'Specific Post Types (Archive & Posts)', '99robots-header-footer-code-manager' ),
|
102 |
's_tags' => esc_html__( 'Specific Tags (Archive & Posts)', '99robots-header-footer-code-manager' ),
|
103 |
+
's_is_home' => esc_html__( 'Home Page', '99robots-header-footer-code-manager' ),
|
104 |
+
's_is_search' => esc_html__( 'Search Page', '99robots-header-footer-code-manager' ),
|
105 |
+
's_is_archive' => esc_html__( 'Archive Page', '99robots-header-footer-code-manager' ),
|
106 |
'latest_posts' => esc_html__( 'Latest Posts', '99robots-header-footer-code-manager' ),
|
107 |
'manual' => esc_html__( 'Shortcode Only', '99robots-header-footer-code-manager' ),
|
108 |
); ?>
|
299 |
}
|
300 |
?>
|
301 |
</select>
|
302 |
+
<p>
|
303 |
+
<b><?php _e( "Note", '99robots-header-footer-code-manager' ); ?></b>: <?php _e( "Snippet will only execute if the placement hook exists on the page", '99robots-header-footer-code-manager' ); ?>
|
304 |
+
.</p>
|
305 |
</td>
|
306 |
</tr>
|
307 |
<?php $nnr_hfcm_device_type_array = array(
|
308 |
+
'both' => __( 'Show on All Devices', '99robots-header-footer-code-manager' ),
|
309 |
+
'desktop' => __( 'Only Desktop', '99robots-header-footer-code-manager' ),
|
310 |
+
'mobile' => __( 'Only Mobile Devices', '99robots-header-footer-code-manager' )
|
311 |
) ?>
|
312 |
<?php $nnr_hfcm_status_array = array(
|
313 |
+
'active' => __( 'Active', '99robots-header-footer-code-manager' ),
|
314 |
+
'inactive' => __( 'Inactive', '99robots-header-footer-code-manager' )
|
315 |
) ?>
|
316 |
<tr>
|
317 |
<th class="hfcm-th-width"><?php esc_html_e( 'Device Display', '99robots-header-footer-code-manager' ); ?></th>
|
379 |
name="<?php echo $update ? 'update' : 'insert'; ?>"
|
380 |
value="<?php echo $update ? esc_html__( 'Update', '99robots-header-footer-code-manager' ) : esc_html__( 'Save', '99robots-header-footer-code-manager' ) ?>"
|
381 |
class="button button-primary button-large nnr-btnsave">
|
382 |
+
<?php if ( $update ) :
|
383 |
+
$delete_nonce = wp_create_nonce( 'hfcm_delete_snippet' );
|
384 |
+
?>
|
385 |
+
<a href="<?php echo esc_url( admin_url( 'admin.php?page=hfcm-list&action=delete&_wpnonce=' . $delete_nonce . '&snippet=' . $id ) ); ?>"
|
386 |
+
class="button button-secondary button-large nnr-btndelete"><?php esc_html_e( 'Delete', '99robots-header-footer-code-manager' ); ?></a>
|
387 |
+
<?php endif; ?>
|
388 |
</div>
|
389 |
</div>
|
390 |
</div>
|
readme.txt
CHANGED
@@ -4,7 +4,7 @@ Tags: header, footer, code manager, snippet, functions.php, tracking, google ana
|
|
4 |
Requires at least: 4.9
|
5 |
Requires PHP: 5.6.20
|
6 |
Tested up to: 5.9
|
7 |
-
Stable tag: 1.1.
|
8 |
License: GPLv2 or later
|
9 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
10 |
Donate link: https://draftpress.com
|
@@ -114,6 +114,13 @@ A. Free plugins rely on user feedback. Therefore, the best thing you can do for
|
|
114 |
A. If your script is not supported, just let us know and we'll look into it immediately. We will do our best to ensure all reputable services are supported. When requesting support for a particular script, it would be nice to get a sample of the script so that we can see its structure.
|
115 |
|
116 |
== Changelog ==
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
117 |
= 1.1.17 = 2022-02-17
|
118 |
* FIXED: XSS vulnerability with request parameter page in the HFCM snippet listing screen
|
119 |
* UPDATED: Compatibility with WordPress 5.9
|
4 |
Requires at least: 4.9
|
5 |
Requires PHP: 5.6.20
|
6 |
Tested up to: 5.9
|
7 |
+
Stable tag: 1.1.18
|
8 |
License: GPLv2 or later
|
9 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
10 |
Donate link: https://draftpress.com
|
114 |
A. If your script is not supported, just let us know and we'll look into it immediately. We will do our best to ensure all reputable services are supported. When requesting support for a particular script, it would be nice to get a sample of the script so that we can see its structure.
|
115 |
|
116 |
== Changelog ==
|
117 |
+
= 1.1.18 = 2022-03-05
|
118 |
+
* ADDED: Ability to apply snippets to search, home, archive page only
|
119 |
+
* ADDED: Snippet search functionality
|
120 |
+
* ADDED: Snippet type filter
|
121 |
+
* ADDED: Snippet sort by location
|
122 |
+
* ADDED: Delete snippet button on edit snippet page
|
123 |
+
|
124 |
= 1.1.17 = 2022-02-17
|
125 |
* FIXED: XSS vulnerability with request parameter page in the HFCM snippet listing screen
|
126 |
* UPDATED: Compatibility with WordPress 5.9
|