Changeset 3349833
- Timestamp:
- 08/25/2025 03:08:17 PM (7 months ago)
- Location:
- smarttoc-lite/trunk
- Files:
-
- 3 edited
-
includes/admin-settings.php (modified) (2 diffs)
-
readme.txt (modified) (5 diffs)
-
smarttoc-lite.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
smarttoc-lite/trunk/includes/admin-settings.php
r3349744 r3349833 716 716 } 717 717 718 public function padding_field_html() { 719 $defaults = array('top'=>10,'right'=>10,'bottom'=>10,'left'=>10); 720 $raw = get_option('smarttoc_lite_padding', $defaults); 721 $value = wp_parse_args( (array) $raw, $defaults ); 722 ?> 723 <div class="smarttoc-padding-fields" style="display:flex; gap:8px; align-items:center; flex-wrap:wrap;"> 724 <label for="smarttoc_padding_top"> 725 <?php esc_html_e('Top', 'smarttoc-lite'); ?> 726 <input id="smarttoc_padding_top" type="number" name="smarttoc_lite_padding[top]" 727 value="<?php echo esc_attr($value['top']); ?>" min="0" style="width:50px;" /> 728 </label> 729 730 <label for="smarttoc_padding_right"> 731 <?php esc_html_e('Right', 'smarttoc-lite'); ?> 732 <input id="smarttoc_padding_right" type="number" name="smarttoc_lite_padding[right]" 733 value="<?php echo esc_attr($value['right']); ?>" min="0" style="width:50px;" /> 734 </label> 735 736 <label for="smarttoc_padding_bottom"> 737 <?php esc_html_e('Bottom', 'smarttoc-lite'); ?> 738 <input id="smarttoc_padding_bottom" type="number" name="smarttoc_lite_padding[bottom]" 739 value="<?php echo esc_attr($value['bottom']); ?>" min="0" style="width:50px;" /> 740 </label> 741 742 <label for="smarttoc_padding_left"> 743 <?php esc_html_e('Left', 'smarttoc-lite'); ?> 744 <input id="smarttoc_padding_left" type="number" name="smarttoc_lite_padding[left]" 745 value="<?php echo esc_attr($value['left']); ?>" min="0" style="width:50px;" /> 746 </label> 747 </div> 748 <?php 749 echo '<span class="smarttoc-info">' . 750 esc_html__('Adjusts inner spacing for each side of the TOC box.', 'smarttoc-lite') . 751 '</span>'; 752 } 718 public function padding_field_html() 719 { 720 $defaults = array('top' => 10, 'right' => 10, 'bottom' => 10, 'left' => 10); 721 $raw = get_option('smarttoc_lite_padding', $defaults); 722 $value = wp_parse_args((array) $raw, $defaults); 723 ?> 724 <div class="smarttoc-padding-fields" style="display:flex; gap:8px; align-items:center; flex-wrap:wrap;"> 725 <label for="smarttoc_padding_top"> 726 <?php esc_html_e('Top', 'smarttoc-lite'); ?> 727 <input id="smarttoc_padding_top" type="number" name="smarttoc_lite_padding[top]" 728 value="<?php echo esc_attr($value['top']); ?>" min="0" style="width:50px;" /> 729 </label> 730 731 <label for="smarttoc_padding_right"> 732 <?php esc_html_e('Right', 'smarttoc-lite'); ?> 733 <input id="smarttoc_padding_right" type="number" name="smarttoc_lite_padding[right]" 734 value="<?php echo esc_attr($value['right']); ?>" min="0" style="width:50px;" /> 735 </label> 736 737 <label for="smarttoc_padding_bottom"> 738 <?php esc_html_e('Bottom', 'smarttoc-lite'); ?> 739 <input id="smarttoc_padding_bottom" type="number" name="smarttoc_lite_padding[bottom]" 740 value="<?php echo esc_attr($value['bottom']); ?>" min="0" style="width:50px;" /> 741 </label> 742 743 <label for="smarttoc_padding_left"> 744 <?php esc_html_e('Left', 'smarttoc-lite'); ?> 745 <input id="smarttoc_padding_left" type="number" name="smarttoc_lite_padding[left]" 746 value="<?php echo esc_attr($value['left']); ?>" min="0" style="width:50px;" /> 747 </label> 748 </div> 749 <?php 750 echo '<span class="smarttoc-info">' . 751 esc_html__('Adjusts inner spacing for each side of the TOC box.', 'smarttoc-lite') . 752 '</span>'; 753 } 753 754 754 755 … … 978 979 echo '<div class="smarttoc-list-content">'; 979 980 echo '<ul>'; 980 echo '<li class="toc-h2"><a href="#">Lorem ipsum dolor</a></li>'; 981 echo '<li class="toc-h2"><a href="#">Lorem ipsum dolor sit amet</a></li>'; 982 echo '<li class="toc-h2"><a href="#">Lorem ipsum</a></li>'; 983 echo '<li class="toc-h2"><a href="#">Lorem ipsum dolor sit</a></li>'; 984 echo '<li class="toc-h2"><a href="#">Lorem ipsum dolor sit amet</a></li>'; 985 echo '<li class="toc-h2"><a href="#">Lorem ipsum dolor</a></li>'; 981 echo '<li class="toc-h2"><a href="#">Automatic TOC generation</a></li>'; 982 echo '<li class="toc-h2"><a href="#">Visual customization</a></li>'; 983 echo '<li class="toc-h2"><a href="#">Live preview</a></li>'; 984 echo '<li class="toc-h2"><a href="#">Expand/Collapse toggle</a></li>'; 985 echo '<li class="toc-h2"><a href="#">Clean, semantic HTML</a></li>'; 986 echo '<li class="toc-h2"><a href="#">Shortcode support</a></li>'; 987 echo '<li class="toc-h2"><a href="#">Custom heading levels (H1–H6)</a></li>'; 988 echo '<li class="toc-h2"><a href="#">SEO-friendly structure</a></li>'; 989 echo '<li class="toc-h2"><a href="#">Lightweight & fast loading</a></li>'; 986 990 echo '</ul>'; 987 991 echo '</div>'; -
smarttoc-lite/trunk/readme.txt
r3349744 r3349833 1 1 === Table of Contents Generator - SmartTOC Lite === 2 2 Contributors: sinergodata 3 Tags: table of contents, wordpress toc, anchor links, accessibility, seo3 Tags: table of contents, wordpress toc, block editor, accessibility, seo 4 4 Requires at least: 5.6 5 5 Tested up to: 6.8 6 6 Requires PHP: 7.2 7 Stable tag: 1.1. 07 Stable tag: 1.1.1 8 8 License: GPLv2 or later 9 9 License URI: https://www.gnu.org/licenses/gpl-2.0.html 10 10 11 Easily add a clean, accessible Table of Contents to your posts and pages. Includes live preview, shortcode support, custom styles, and more.11 Create a clean, accessible Table of Contents — fast, customizable, and compatible with any theme or editor. 12 12 13 13 == Description == 14 14 15 **SmartTOC Lite** automatically creates a SEO-friendly table of contents based on your content's headings (H2, H3, etc.). Works with posts, pages, and custom post types. Helps improve user experience and on-page SEO. Lightweight, fast, and easy to configure.15 Unlike heavy TOC plugins, **SmartTOC Lite** is lightweight, fast, and built with accessibility in mind. It automatically generates a clean, SEO-friendly table of contents based on your content’s headings (H2, H3, etc.), making it easier for visitors to navigate your posts and pages. 16 16 17 **Main features include:** 17 SmartTOC Lite works with posts, pages, and custom post types, and is fully compatible with both the block editor (Gutenberg) and the classic editor. By improving content structure and readability, it also helps boost on-page SEO. 18 18 19 - ✅ Automatic insertion into posts, pages, or custom post types 20 - 🎨 Full visual customization (fonts, colors, spacing, borders, toggle style, and more) 21 - 🧪 Live preview inside the admin panel 22 - ⚙️ Shortcode support: `[smart_toc]` 23 - 🔠 Custom heading levels (h1–h6) 24 - 🧭 Expand/Collapse toggle with icon customization 25 - ♿ Accessibility-first markup and behavior 26 - 🌐 Clean HTML structure, ready for SEO 19 **Why choose SmartTOC Lite?** 20 - ⚡ **Lightweight & fast** — built for performance, won’t slow down your site. 21 - 🔍 **SEO-friendly** — semantic HTML with clean anchor links. 22 - ♿ **Accessibility-first** — designed to work for all users. 23 - 🎨 **Flexible design options** — customize fonts, colors, borders, and spacing. 24 - 🧪 **Instant live preview** — see your changes before publishing. 25 26 **Key features:** 27 - ✅ **Automatic TOC insertion** into posts, pages, or custom post types 28 - 🔠 **Custom heading levels** — choose which headings (H1–H6) to include 29 - ⚙️ **Shortcode support** — `[smart_toc]` for full manual control 30 - 🧭 **Expand/Collapse toggle** with multiple display options 31 - 🧩 **Theme-independent output** — clean, responsive HTML that fits any design 32 - 🖌️ **Visual customization** — adjust fonts, colors, spacing, and more from settings 27 33 28 34 **Shortcode example:** … … 34 40 1. Upload the plugin folder to `/wp-content/plugins/` or install it from the WordPress Plugins screen. 35 41 2. Activate the plugin through the ‘Plugins’ menu in WordPress. 36 3. Go to **S ettings → SmartTOC Lite** to configure your preferences.42 3. Go to **SmartTOC Lite** to configure your preferences. 37 43 4. Optionally, use `[smart_toc]` shortcode anywhere you want a manual TOC. 38 44 … … 48 54 Yes. You can disable it per post using the checkbox in the post editor. 49 55 56 = Does it work with the block editor (Gutenberg)? = 57 Yes. SmartTOC Lite works seamlessly with both Gutenberg and the classic editor. 58 59 = Will it slow down my website? = 60 No. The plugin is lightweight, uses clean HTML/CSS, and adds minimal overhead. 61 62 = Can I customize the styles? = 63 Yes. You can change fonts, colors, borders, spacing and more directly from the settings. 64 65 = Is it SEO-friendly? = 66 Yes. The TOC is generated with semantic HTML and anchor links that help search engines better understand your content. 67 50 68 == Screenshots == 51 69 … … 55 73 56 74 == Changelog == 75 76 = 1.1.1 = 77 * Update: improved TOC list in live preview 57 78 58 79 = 1.1.0 = … … 75 96 == Upgrade Notice == 76 97 98 = 1.1.1 = 99 * Update: improved TOC list in live preview 100 77 101 = 1.1.0 = 78 102 * Per-side padding replaces the single padding option; old numeric values migrate automatically. -
smarttoc-lite/trunk/smarttoc-lite.php
r3349744 r3349833 4 4 * Plugin URI: https://wordpress.org/plugins/smarttoc-lite/ 5 5 * Description: Create a responsive Table of Contents (TOC) for WordPress posts and pages. Features include automatic insertion, customizable styles, live preview, shortcode support, and accessibility. 6 * Version: 1.1. 06 * Version: 1.1.1 7 7 * Author: SinergoData 8 8 * Author URI: https://sinergodata.com/ … … 26 26 * Plugin version. 27 27 */ 28 const VERSION = '1.1. 0';28 const VERSION = '1.1.1'; 29 29 30 30 /**
Note: See TracChangeset
for help on using the changeset viewer.