Version Description
2019-08-15 * UPDATED: All snippets list now shows 20 snippets in the first page instead of 10 * ADDED: Replaced Specific Custom Post Types under Site Display to include the functionality to add code snippets to all post types, including posts, pages, custom post types & attachments * UPDATED: Compatibility with WordPress 5.2.2
Download this release
Release Info
Developer | 99robots |
Plugin | Header Footer Code Manager |
Version | 1.1.4 |
Comparing to | |
See all releases |
Code changes from version 1.1.3 to 1.1.4
- 99robots-header-footer-code-manager.php +22 -3
- includes/hfcm-add-edit.php +3 -4
- includes/hfcm-list.php +2 -2
- readme.txt +10 -2
99robots-header-footer-code-manager.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
* Plugin Name: Header Footer Code Manager
|
4 |
* Plugin URI: https://99robots.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://99robots.com/"> official page</a>.
|
6 |
-
* Version: 1.1.
|
7 |
* Author: 99robots
|
8 |
* Author URI: https://99robots.com/
|
9 |
* Disclaimer: Use at your own risk. No warranty expressed or implied is provided.
|
@@ -23,6 +23,10 @@ $hfcm_db_version = '1.1';
|
|
23 |
// function to create the DB / Options / Defaults
|
24 |
function hfcm_options_install() {
|
25 |
|
|
|
|
|
|
|
|
|
26 |
global $wpdb;
|
27 |
global $hfcm_db_version;
|
28 |
|
@@ -55,6 +59,7 @@ function hfcm_options_install() {
|
|
55 |
require_once( ABSPATH . 'wp-admin/includes/upgrade.php' );
|
56 |
dbDelta( $sql );
|
57 |
add_option( 'hfcm_db_version', $hfcm_db_version );
|
|
|
58 |
}
|
59 |
register_activation_hook( __FILE__, 'hfcm_options_install' );
|
60 |
|
@@ -197,6 +202,21 @@ function hfcm_add_plugin_page_settings_link( $links ) {
|
|
197 |
return $links;
|
198 |
}
|
199 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
200 |
// Create the Admin Notice
|
201 |
function hfcm_review_push_notice() {
|
202 |
|
@@ -209,7 +229,7 @@ function hfcm_review_push_notice() {
|
|
209 |
|
210 |
$user_id = get_current_user_id();
|
211 |
// Check if current user has already dismissed it
|
212 |
-
|
213 |
if ( !get_user_meta( $user_id, 'hfcm_plugin_notice_dismissed') && in_array($screen, $allowed_pages_notices)) {
|
214 |
?>
|
215 |
<div id="hfcm-message" class="notice notice-success">
|
@@ -219,7 +239,6 @@ function hfcm_review_push_notice() {
|
|
219 |
<?php
|
220 |
}
|
221 |
}
|
222 |
-
add_action( 'admin_notices', 'hfcm_review_push_notice' );
|
223 |
|
224 |
// Check if current user has already dismissed it
|
225 |
function hfcm_plugin_notice_dismissed() {
|
3 |
* Plugin Name: Header Footer Code Manager
|
4 |
* Plugin URI: https://99robots.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://99robots.com/"> official page</a>.
|
6 |
+
* Version: 1.1.4
|
7 |
* Author: 99robots
|
8 |
* Author URI: https://99robots.com/
|
9 |
* Disclaimer: Use at your own risk. No warranty expressed or implied is provided.
|
23 |
// function to create the DB / Options / Defaults
|
24 |
function hfcm_options_install() {
|
25 |
|
26 |
+
$hfcm_now = strtotime( "now" );
|
27 |
+
add_option( 'hfcm_activation_date', $hfcm_now );
|
28 |
+
update_option( 'hfcm_activation_date', $hfcm_now );
|
29 |
+
|
30 |
global $wpdb;
|
31 |
global $hfcm_db_version;
|
32 |
|
59 |
require_once( ABSPATH . 'wp-admin/includes/upgrade.php' );
|
60 |
dbDelta( $sql );
|
61 |
add_option( 'hfcm_db_version', $hfcm_db_version );
|
62 |
+
|
63 |
}
|
64 |
register_activation_hook( __FILE__, 'hfcm_options_install' );
|
65 |
|
202 |
return $links;
|
203 |
}
|
204 |
|
205 |
+
//Check Installation Date
|
206 |
+
function hfcm_check_installation_date() {
|
207 |
+
|
208 |
+
$install_date = get_option( 'hfcm_activation_date' );
|
209 |
+
$past_date = strtotime( '-7 days' );
|
210 |
+
|
211 |
+
if ( $past_date >= $install_date ) {
|
212 |
+
|
213 |
+
add_action( 'admin_notices', 'hfcm_review_push_notice' );
|
214 |
+
|
215 |
+
}
|
216 |
+
|
217 |
+
}
|
218 |
+
add_action( 'admin_init', 'hfcm_check_installation_date' );
|
219 |
+
|
220 |
// Create the Admin Notice
|
221 |
function hfcm_review_push_notice() {
|
222 |
|
229 |
|
230 |
$user_id = get_current_user_id();
|
231 |
// Check if current user has already dismissed it
|
232 |
+
$install_date = get_option( 'hfcm_activation_date' );
|
233 |
if ( !get_user_meta( $user_id, 'hfcm_plugin_notice_dismissed') && in_array($screen, $allowed_pages_notices)) {
|
234 |
?>
|
235 |
<div id="hfcm-message" class="notice notice-success">
|
239 |
<?php
|
240 |
}
|
241 |
}
|
|
|
242 |
|
243 |
// Check if current user has already dismissed it
|
244 |
function hfcm_plugin_notice_dismissed() {
|
includes/hfcm-add-edit.php
CHANGED
@@ -71,7 +71,7 @@ wp_enqueue_script( 'hfcm_showboxes' );
|
|
71 |
's_posts' => esc_html__( 'Specific Posts', '99robots-header-footer-code-manager' ),
|
72 |
's_pages' => esc_html__( 'Specific Pages', '99robots-header-footer-code-manager' ),
|
73 |
's_categories' => esc_html__( 'Specific Categories', '99robots-header-footer-code-manager' ),
|
74 |
-
's_custom_posts' => esc_html__( 'Specific
|
75 |
's_tags' => esc_html__( 'Specific Tags', '99robots-header-footer-code-manager' ),
|
76 |
'latest_posts' => esc_html__( 'Latest Posts', '99robots-header-footer-code-manager' ),
|
77 |
'manual' => esc_html__( 'Shortcode Only', '99robots-header-footer-code-manager' ),
|
@@ -165,10 +165,9 @@ wp_enqueue_script( 'hfcm_showboxes' );
|
|
165 |
$lpcountstyle = 'latest_posts' === $display_on ? '' : 'display:none;';
|
166 |
$locationstyle = 'manual' === $display_on ? 'display:none;' : '';
|
167 |
|
168 |
-
// Get all names of
|
169 |
$args = array(
|
170 |
'public' => true,
|
171 |
-
'_builtin' => false,
|
172 |
);
|
173 |
|
174 |
$output = 'names';
|
@@ -213,7 +212,7 @@ wp_enqueue_script( 'hfcm_showboxes' );
|
|
213 |
</td>
|
214 |
</tr>
|
215 |
<tr id="c_posttype" style="<?php echo $cpostssstyle; ?>">
|
216 |
-
<th class="hfcm-th-width"><?php esc_html_e( '
|
217 |
<td>
|
218 |
<select name="data[s_custom_posts][]" multiple>
|
219 |
<?php
|
71 |
's_posts' => esc_html__( 'Specific Posts', '99robots-header-footer-code-manager' ),
|
72 |
's_pages' => esc_html__( 'Specific Pages', '99robots-header-footer-code-manager' ),
|
73 |
's_categories' => esc_html__( 'Specific Categories', '99robots-header-footer-code-manager' ),
|
74 |
+
's_custom_posts' => esc_html__( 'Specific Post Types', '99robots-header-footer-code-manager' ),
|
75 |
's_tags' => esc_html__( 'Specific Tags', '99robots-header-footer-code-manager' ),
|
76 |
'latest_posts' => esc_html__( 'Latest Posts', '99robots-header-footer-code-manager' ),
|
77 |
'manual' => esc_html__( 'Shortcode Only', '99robots-header-footer-code-manager' ),
|
165 |
$lpcountstyle = 'latest_posts' === $display_on ? '' : 'display:none;';
|
166 |
$locationstyle = 'manual' === $display_on ? 'display:none;' : '';
|
167 |
|
168 |
+
// Get all names of Post Types
|
169 |
$args = array(
|
170 |
'public' => true,
|
|
|
171 |
);
|
172 |
|
173 |
$output = 'names';
|
212 |
</td>
|
213 |
</tr>
|
214 |
<tr id="c_posttype" style="<?php echo $cpostssstyle; ?>">
|
215 |
+
<th class="hfcm-th-width"><?php esc_html_e( 'Post Types', '99robots-header-footer-code-manager' ); ?></th>
|
216 |
<td>
|
217 |
<select name="data[s_custom_posts][]" multiple>
|
218 |
<?php
|
includes/hfcm-list.php
CHANGED
@@ -25,7 +25,7 @@ class Hfcm_Snippets_List extends WP_List_Table {
|
|
25 |
*
|
26 |
* @return mixed
|
27 |
*/
|
28 |
-
public static function get_snippets( $per_page =
|
29 |
|
30 |
global $wpdb;
|
31 |
$table_name = "{$wpdb->prefix}hfcm_scripts";
|
@@ -320,7 +320,7 @@ class Hfcm_Snippets_List extends WP_List_Table {
|
|
320 |
/** Process bulk action */
|
321 |
$this->process_bulk_action();
|
322 |
$this->views();
|
323 |
-
$per_page = $this->get_items_per_page( 'snippets_per_page',
|
324 |
$current_page = $this->get_pagenum();
|
325 |
$total_items = self::record_count();
|
326 |
|
25 |
*
|
26 |
* @return mixed
|
27 |
*/
|
28 |
+
public static function get_snippets( $per_page = 20, $page_number = 1, $customvar = 'all' ) {
|
29 |
|
30 |
global $wpdb;
|
31 |
$table_name = "{$wpdb->prefix}hfcm_scripts";
|
320 |
/** Process bulk action */
|
321 |
$this->process_bulk_action();
|
322 |
$this->views();
|
323 |
+
$per_page = $this->get_items_per_page( 'snippets_per_page', 20 );
|
324 |
$current_page = $this->get_pagenum();
|
325 |
$total_items = self::record_count();
|
326 |
|
readme.txt
CHANGED
@@ -2,8 +2,8 @@
|
|
2 |
Contributors: 99robots, charliepatel
|
3 |
Tags: header, footer, code manager, snippet, functions.php, tracking, google analytics, adsense, verification, pixel
|
4 |
Requires at least: 4.0
|
5 |
-
Tested up to: 5.
|
6 |
-
Stable tag: 1.1.
|
7 |
License: GPLv2 or later
|
8 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
9 |
Donate link: https://99robots.com
|
@@ -96,6 +96,9 @@ http://www.99robots.com/docs/header-footer-code-manager
|
|
96 |
= Q. Where are this plugin’s Settings located? =
|
97 |
A. After activating the plugin, you can click on settings link under the plugin name OR you can click the HFCM tab on the left side navigation. From there, you can add, edit, remove, and review code snippets.
|
98 |
|
|
|
|
|
|
|
99 |
= Q. I have a question =
|
100 |
A. Since this is a free plugin, please ask all questions on the support forum here on WordPress.org. We will try to respond to every question within 48 hours.
|
101 |
|
@@ -107,6 +110,11 @@ A. If your script is not supported, just let us know and we'll look into it imme
|
|
107 |
|
108 |
== Changelog ==
|
109 |
|
|
|
|
|
|
|
|
|
|
|
110 |
= 1.1.3 = 2019-05-03
|
111 |
* UPDATED: Compatibility with WordPress 5.1.1
|
112 |
|
2 |
Contributors: 99robots, charliepatel
|
3 |
Tags: header, footer, code manager, snippet, functions.php, tracking, google analytics, adsense, verification, pixel
|
4 |
Requires at least: 4.0
|
5 |
+
Tested up to: 5.2.2
|
6 |
+
Stable tag: 1.1.4
|
7 |
License: GPLv2 or later
|
8 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
9 |
Donate link: https://99robots.com
|
96 |
= Q. Where are this plugin’s Settings located? =
|
97 |
A. After activating the plugin, you can click on settings link under the plugin name OR you can click the HFCM tab on the left side navigation. From there, you can add, edit, remove, and review code snippets.
|
98 |
|
99 |
+
= Q. How do I add code snippets to all my posts/pages? =
|
100 |
+
A. With the version 1.1.4 of the HFCM plugin, we have replaced the Specific Custom Post Types with the ability to add code to All Post Types which include posts, pages, attachments and custom post types.
|
101 |
+
|
102 |
= Q. I have a question =
|
103 |
A. Since this is a free plugin, please ask all questions on the support forum here on WordPress.org. We will try to respond to every question within 48 hours.
|
104 |
|
110 |
|
111 |
== Changelog ==
|
112 |
|
113 |
+
= 1.1.4 = 2019-08-15
|
114 |
+
* UPDATED: All snippets list now shows 20 snippets in the first page instead of 10
|
115 |
+
* ADDED: Replaced Specific Custom Post Types under Site Display to include the functionality to add code snippets to all post types, including posts, pages, custom post types & attachments
|
116 |
+
* UPDATED: Compatibility with WordPress 5.2.2
|
117 |
+
|
118 |
= 1.1.3 = 2019-05-03
|
119 |
* UPDATED: Compatibility with WordPress 5.1.1
|
120 |
|