Changeset 3451226
- Timestamp:
- 02/01/2026 04:48:40 AM (3 weeks ago)
- Location:
- header-and-footer-scripts/trunk
- Files:
-
- 5 added
- 1 deleted
- 5 edited
-
css (added)
-
css/jamify-hfs-admin.css (added)
-
images/paypal-donate.gif (deleted)
-
inc/meta.php (modified) (1 diff)
-
inc/options.php (modified) (5 diffs)
-
inc/sidebar.php (modified) (1 diff)
-
lang/header-and-footer-scripts-en_US.po (added)
-
lang/header-and-footer-scripts-hi_IN.po (added)
-
lang/header-and-footer-scripts.pot (added)
-
readme.txt (modified) (6 diffs)
-
shfs.php (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
header-and-footer-scripts/trunk/inc/meta.php
r3444257 r3451226 16 16 <div class="jamify_hfs_meta_control"> 17 17 18 <p><?php esc_html_e('The script in the following textbox will be inserted to the <head> section', 'header-and-footer-scripts'); ?>.</p>18 <p><?php esc_html_e('The code below will be inserted into the <head> section of this specific page/post.', 'header-and-footer-scripts'); ?></p> 19 19 <p> 20 20 <textarea id="jamify_hfs_inpost_head_script" name="_inpost_head_script[synth_header_script]" rows="5" style="width:98%;font-family:monospace;"><?php if(!empty($meta['synth_header_script'])) echo esc_textarea( $meta['synth_header_script'] ); ?></textarea> -
header-and-footer-scripts/trunk/inc/options.php
r3444257 r3451226 26 26 <?php settings_fields( 'header-and-footer-scripts' ); ?> 27 27 28 <h3 class="shfs-labels"><?php esc_html_e( ' Who can insert scripts?', 'header-and-footer-scripts'); ?></h3>29 <p><?php esc_html_e( 'By default, only Administrators can add scripts. You can grant this ability to other roles below.', 'header-and-footer-scripts'); ?></p>28 <h3 class="shfs-labels"><?php esc_html_e( 'Permissions', 'header-and-footer-scripts'); ?></h3> 29 <p><?php esc_html_e( 'By default, only Administrators can add scripts. Use the options below to grant access to other roles.', 'header-and-footer-scripts'); ?></p> 30 30 31 31 <fieldset> 32 32 <label for="jamify_hfs_allow_author"> 33 33 <input type="checkbox" name="jamify_hfs_allow_author" id="jamify_hfs_allow_author" value="yes" <?php checked( 'yes', get_option( 'jamify_hfs_allow_author' ) ); ?>> 34 <?php esc_html_e( 'Allow Authors to add scripts (Grants unfiltered_html capability)', 'header-and-footer-scripts'); ?>34 <?php esc_html_e( 'Allow Authors to add scripts', 'header-and-footer-scripts'); ?> 35 35 </label> 36 36 <br> 37 37 <label for="jamify_hfs_allow_contributor"> 38 38 <input type="checkbox" name="jamify_hfs_allow_contributor" id="jamify_hfs_allow_contributor" value="yes" <?php checked( 'yes', get_option( 'jamify_hfs_allow_contributor' ) ); ?>> 39 <?php esc_html_e( 'Allow Contributors to add scripts (Grants unfiltered_html capability)', 'header-and-footer-scripts'); ?>39 <?php esc_html_e( 'Allow Contributors to add scripts', 'header-and-footer-scripts'); ?> 40 40 </label> 41 41 </fieldset> 42 42 43 43 <p class="description" style="color: #ea580c; font-weight: bold;"> 44 <?php esc_html_e( ' Caution: Enabling these options grants the "unfiltered_html" capability, allowing users to execute arbitrary JavaScript on your site. Only enablefor trusted users.', 'header-and-footer-scripts'); ?>44 <?php esc_html_e( 'Security Warning: Enabling these options grants the "unfiltered_html" capability. This allows users to execute arbitrary JavaScript. Only enable this for trusted users.', 'header-and-footer-scripts'); ?> 45 45 </p> 46 46 <hr /> 47 47 48 <h3 class="shfs-labels" for="jamify_hfs_insert_header"><?php esc_html_e( ' Scripts in header:', 'header-and-footer-scripts'); ?></h3>49 <p><?php esc_html_e( ' The following script, if any, will be inserted into the <head> section using wp_head hook.', 'header-and-footer-scripts'); ?></p>48 <h3 class="shfs-labels" for="jamify_hfs_insert_header"><?php esc_html_e( 'Head Scripts (<head>)', 'header-and-footer-scripts'); ?></h3> 49 <p><?php esc_html_e( 'Scripts entered here will be output in the <head> section.', 'header-and-footer-scripts'); ?></p> 50 50 <textarea style="width:98%;font-family:monospace;" rows="10" cols="57" id="jamify_hfs_insert_header" name="jamify_hfs_insert_header"><?php echo esc_html( get_option( 'jamify_hfs_insert_header' ) ); ?></textarea> 51 51 … … 53 53 <input type="number" value="<?php echo \esc_html( \get_option( 'jamify_hfs_insert_header_priority', 10 ) ); ?>" name="jamify_hfs_insert_header_priority" id="jamify_hfs_insert_header_priority" style="width:6em;" /> <?php \esc_html_e('Default', 'header-and-footer-scripts'); ?>: 10</p><hr /> 54 54 55 <h3 class="shfs-labels" for="jamify_hfs_insert_body"><?php esc_html_e( ' Scripts in body:', 'header-and-footer-scripts'); ?></h3>56 <p><?php esc_html_e( ' The following script, if any, will be inserted immediately after the <body> tag using wp_body_open hook.', 'header-and-footer-scripts'); ?></p>55 <h3 class="shfs-labels" for="jamify_hfs_insert_body"><?php esc_html_e( 'Body Scripts (After <body>)', 'header-and-footer-scripts'); ?></h3> 56 <p><?php esc_html_e( 'Scripts entered here will be output immediately after the opening <body> tag.', 'header-and-footer-scripts'); ?></p> 57 57 <textarea style="width:98%;font-family:monospace;" rows="10" cols="57" id="jamify_hfs_insert_body" name="jamify_hfs_insert_body"><?php echo esc_html( get_option( 'jamify_hfs_insert_body' ) ); ?></textarea> 58 58 … … 60 60 <input type="number" value="<?php echo \esc_html( \get_option( 'jamify_hfs_insert_body_priority', 10 ) ); ?>" name="jamify_hfs_insert_body_priority" id="jamify_hfs_insert_body_priority" style="width:6em;" /> <?php \esc_html_e('Default', 'header-and-footer-scripts'); ?>: 10</p><hr /> 61 61 62 <h3 class="shfs-labels footerlabel" for="jamify_hfs_insert_footer"><?php esc_html_e( ' Scripts in footer:', 'header-and-footer-scripts'); ?></h3>63 <p><?php esc_html_e( ' The following script, if any, will be inserted before </body> tag using wp_footer hook.', 'header-and-footer-scripts'); ?></p>62 <h3 class="shfs-labels footerlabel" for="jamify_hfs_insert_footer"><?php esc_html_e( 'Footer Scripts (Before </body>)', 'header-and-footer-scripts'); ?></h3> 63 <p><?php esc_html_e( 'Scripts entered here will be output immediately before the closing </body> tag.', 'header-and-footer-scripts'); ?></p> 64 64 <textarea style="width:98%;font-family:monospace;" rows="10" cols="57" id="jamify_hfs_insert_footer" name="jamify_hfs_insert_footer"><?php echo esc_html( get_option( 'jamify_hfs_insert_footer' ) ); ?></textarea> 65 65 … … 67 67 <input type="number" value="<?php echo \esc_html( \get_option( 'jamify_hfs_insert_footer_priority', 10 ) ); ?>" name="jamify_hfs_insert_footer_priority" id="jamify_hfs_insert_footer_priority" style="width:6em;" /> <?php \esc_html_e('Default', 'header-and-footer-scripts'); ?>: 10</p><hr /> 68 68 69 <h3 class="shfs-labels"><?php esc_html_e( 'Uninstall Settings', 'header-and-footer-scripts'); ?></h3>69 <h3 class="shfs-labels"><?php esc_html_e( 'Uninstall Code Cleanup', 'header-and-footer-scripts'); ?></h3> 70 70 <fieldset> 71 71 <label for="jamify_hfs_clean_on_uninstall"> … … 75 75 </fieldset> 76 76 <p class="description" style="color: #ea580c; font-weight: bold;"> 77 <?php esc_html_e( 'Warning: If checked, all s cripts and settings will be permanently deleted when you delete this plugin. Thiscannot be undone.', 'header-and-footer-scripts'); ?>77 <?php esc_html_e( 'Warning: If checked, all saved scripts and settings will be permanently erased when you delete the plugin. This action cannot be undone.', 'header-and-footer-scripts'); ?> 78 78 </p> 79 79 -
header-and-footer-scripts/trunk/inc/sidebar.php
r3444257 r3451226 18 18 <h3 class="hndle"><?php esc_html_e( 'Need Help?', 'header-and-footer-scripts'); ?></h3> 19 19 <div class="inside"> 20 <p><?php esc_html_e( ' Read plugin documentation for clarification or how to use it. OR just ask your query.', 'header-and-footer-scripts'); ?></p>20 <p><?php esc_html_e( 'Check the documentation for usage instructions, or ask a question if you need help.', 'header-and-footer-scripts'); ?></p> 21 21 <p><strong><a href="<?php echo esc_url( "https://github.com/anandkumar/header-and-footer-scripts/wiki" ); ?>" class="button"><?php esc_html_e('Explore Docs and Support', 'header-and-footer-scripts'); ?></a></strong></p> 22 22 </div> -
header-and-footer-scripts/trunk/readme.txt
r3450432 r3451226 6 6 Requires at least: 4.6 7 7 Tested up to: 6.9 8 Stable tag: 2.4. 18 Stable tag: 2.4.2 9 9 Requires PHP: 5.6 10 10 License: GPLv2 or later … … 14 14 15 15 == Description == 16 If you are running a WordPress site then sooner or later you need to insert some kind of code to your website. It is most likley a web analytics code like Google Analytics or may be social media script or some CSS stylesheet or may be Custom fonts. This plugin will do all the magic. Even if you want to insert those codes in a custom post type.16 An essential WordPress plugin to easily insert scripts and styles (like Google Analytics, CSS, etc.) into your website's header and footer. 17 17 18 **Note:** Although this plugin requires a minimum PHP version of 5.6, it is highly recommended to update to the latest PHP stack for better security and performance. 18 Looking for a way to add Google Analytics, Facebook Pixel, or custom tracking code to your website's header or footer? 19 19 20 All you have to do is adding appropriate html code. 20 Header and Footer Scripts is a simple yet powerful plugin that lets you inject code—such as Google Analytics, custom CSS, Facebook Pixel, and chat widgets—directly into your site's header (`<head>`) or footer. 21 22 No bloat, no ads. This lightweight plugin simply does what it says: inserts code into your header and footer efficiently. 23 24 All you have to do is add the appropriate HTML code. 21 25 22 26 Don't forget to wrap your code with proper tags. … … 33 37 34 38 = Why use this plugin: = 35 * To insert CSS and JavaScript codes to `<head>` or before `</body>`. 36 * To insert code to `<head>` of any single page or post. 39 * Insert scripts globally into the header and footer of your entire website. 40 * Supports all script types including HTML, JavaScript, and CSS. 41 * Add specific scripts to the header of individual posts or pages. 37 42 * To insert code to Custom Post Type [New Feature]. 38 43 … … 42 47 * You can't insert/execute PHP codes. 43 48 44 Almost all WordPress theme dosupport this "Header and Footer Scripts" plugin. If the codes are not appearing in your site [ask for support] or look at your theme file if they have standard `wp_head` and `wp_footer` hooks.49 Almost all WordPress themes support this "Header and Footer Scripts" plugin. If the codes are not appearing in your site [ask for support] or look at your theme file if they have standard `wp_head` and `wp_footer` hooks. 45 50 46 51 = Important Links = 47 For fur hter information you are welcomed to follow these links:52 For further information you are welcomed to follow these links: 48 53 49 54 * **[Read Documentation][1]** … … 60 65 Upload the plugin to `/wp-content/plugins` and activate. OR Search "Header and Footer Scripts" from `WP Dashbard --> Plugins --> Add New` then hit Install and then activate. 61 66 62 Once the plugin is activated you will see "Header and Footer Scripts" menu item under setting of WordPress dashboard. Also a meta box on Post and Page edit page.67 Once the plugin is activated you will see "Header and Footer Scripts" menu item under settings of WordPress dashboard. Also a meta box on Post and Page edit page. 63 68 64 69 == Screenshots == … … 77 82 78 83 == Changelog == 84 85 = 2.4.2 = 86 * Fix: Resolved critical issue where scripts added to per-post meta box were not saving. 87 * Fix: Corrected CodeMirror editor rendering (borders, height) and gutter visibility (line numbers) in meta box. 88 * Improvement: Updated English copy throughout the plugin for better clarity and professionalism. 89 * New: Added Hindi (hi_IN) translation. 90 * New: Included language template (.pot) and translation files. 79 91 80 92 = 2.4.1 = -
header-and-footer-scripts/trunk/shfs.php
r3444257 r3451226 4 4 * Plugin URI: https://github.com/anandkumar/header-and-footer-scripts 5 5 * Description: Essential WordPress plugin for almost every website to insert codes like Javascript and CSS. Inserting script to your wp_head and wp_footer made easy. 6 * Version: 2.4. 16 * Version: 2.4.2 7 7 * Author: Anand Kumar 8 8 * Author URI: http://www.anandkumar.net … … 131 131 $settings = wp_enqueue_code_editor( array( 'type' => 'text/html' ) ); 132 132 133 // Enqueue admin styles 134 wp_enqueue_style( 'jamify-hfs-admin-css', plugins_url( 'css/jamify-hfs-admin.css', __FILE__ ), array(), '2.4.2' ); 135 133 136 // If the code editor is enabled, we need to initialize it. 134 137 if ( false !== $settings ) { … … 137 140 sprintf( 138 141 'jQuery( function() { 139 if ( jQuery("#jamify_hfs_insert_header").length ) { wp.codeEditor.initialize( "jamify_hfs_insert_header", %1$s ); } 140 if ( jQuery("#jamify_hfs_insert_body").length ) { wp.codeEditor.initialize( "jamify_hfs_insert_body", %1$s ); } 141 if ( jQuery("#jamify_hfs_insert_footer").length ) { wp.codeEditor.initialize( "jamify_hfs_insert_footer", %1$s ); } 142 if ( jQuery("#jamify_hfs_inpost_head_script").length ) { wp.codeEditor.initialize( "jamify_hfs_inpost_head_script", %1$s ); } 143 } );', 142 if ( jQuery( "#jamify_hfs_insert_header" ).length ) { wp.codeEditor.initialize( "jamify_hfs_insert_header", %1$s ); } 143 if ( jQuery( "#jamify_hfs_insert_body" ).length ) { wp.codeEditor.initialize( "jamify_hfs_insert_body", %1$s ); } 144 if ( jQuery( "#jamify_hfs_insert_footer" ).length ) { wp.codeEditor.initialize( "jamify_hfs_insert_footer", %1$s ); } 145 if ( jQuery( "#jamify_hfs_inpost_head_script" ).length ) { 146 var inpostSettings = wp.codeEditor.initialize( "jamify_hfs_inpost_head_script", %1$s ); 147 var cm = inpostSettings.codemirror; 148 // Fallback for some WP versions where initialize returns jQuery object or structure differs. 149 if ( ! cm && jQuery( "#jamify_hfs_inpost_head_script" ).next( ".CodeMirror" ).length ) { 150 cm = jQuery( "#jamify_hfs_inpost_head_script" ).next( ".CodeMirror" ).get( 0 ).CodeMirror; 151 } 152 if ( cm ) { 153 cm.on( "change", function() { 154 cm.save(); 155 jQuery( "#jamify_hfs_inpost_head_script" ).trigger( "change" ); 156 } ); 157 // Refresh to ensure gutter renders correctly 158 setTimeout( function() { cm.refresh(); }, 1 ); 159 } 160 } 161 } );', 144 162 wp_json_encode( $settings ) 145 163 ) … … 280 298 // make sure data came from our meta box 281 299 if ( ! isset( $_POST['jamify_hfs_post_meta_noncename'] ) 282 || ! wp_verify_nonce( sanitize_ key( $_POST['jamify_hfs_post_meta_noncename']), 'jamify_hfs_post_meta_save' ) ) {300 || ! wp_verify_nonce( sanitize_text_field( wp_unslash( $_POST['jamify_hfs_post_meta_noncename'] ) ), 'jamify_hfs_post_meta_save' ) ) { 283 301 return $post_id; 284 302 }
Note: See TracChangeset
for help on using the changeset viewer.