LuckyWP Table of Contents - Version 1.5

Version Description

  • Enhancements for search engines (Google and other).
Download this release

Release Info

Developer theluckywp
Plugin Icon 128x128 LuckyWP Table of Contents
Version 1.5
Comparing to
See all releases

Code changes from version 1.4.1 to 1.5

front/assets/main.min.js CHANGED
@@ -1 +1 @@
1
- !function(a){var t=function(t){t.each(function(){var n=a(this);n.data("smoothScroll")&&n.find(".lwptoc_items").on("click",'A[href^="#"]',function(t){t.preventDefault();var l=a("A[id="+this.hash.slice(1)+"]");if(l.length){var o=a(this).attr("href"),i=l.offset().top-n.data("smoothScrollOffset");a("html, body").animate({scrollTop:i<0?0:i},500,function(){if(l.focus(),l.is(":focus"))return!1;l.attr("tabindex","-1"),l.focus(),window.history.pushState&&window.history.pushState(null,null,o)})}})}),t.find(".lwptoc_toggle_label").click(function(){var t=a(this),l=t.closest(".lwptoc").find(".lwptoc_items"),o=t.data("label");return"none"==l.css("display")?(l.stop(!0).slideDown(300),t.data("label",t.html()).html(o)):l.stop(!0).slideUp(300,function(){t.data("label",t.html()).html(o)}),!1})};a(function(){t(a(".lwptoc"))})}(jQuery);
1
+ !function(n){var t=function(t){t.each(function(){var a=n(this);a.data("smoothScroll")&&a.find(".lwptoc_items").on("click",'A[href^="#"]',function(t){t.preventDefault();var l=this.hash,i=n(l);if(i.length){var o=i.offset().top-a.data("smoothScrollOffset");n(window).animate({scrollTop:o<0?0:o},500,function(){if(l!=location.hash){var t=i.attr("id"),o=n("<a> </a>").attr("id",t).css({position:"absolute",top:n(window).scrollTop(),left:n(window).scrollLeft(),visibility:"hidden"});i.attr("id",""),n("body").prepend(o),location.hash=l,o.remove(),i.attr("id",t)}})}})}),t.find(".lwptoc_toggle_label").click(function(){var t=n(this),o=t.closest(".lwptoc").find(".lwptoc_items"),l=t.data("label");return"none"==o.css("display")?(o.stop(!0).slideDown(300),t.data("label",t.html()).html(l)):o.stop(!0).slideUp(300,function(){t.data("label",t.html()).html(l)}),!1})};n(function(){t(n(".lwptoc"))})}(jQuery);
languages/lwptoc-ru_RU.mo CHANGED
Binary file
languages/lwptoc.pot CHANGED
@@ -1,8 +1,8 @@
1
  msgid ""
2
  msgstr ""
3
  "Project-Id-Version: \n"
4
- "POT-Creation-Date: 2019-06-01 18:08+0300\n"
5
- "PO-Revision-Date: 2019-06-01 18:09+0300\n"
6
  "Last-Translator: \n"
7
  "Language-Team: \n"
8
  "Language: ru_RU\n"
@@ -579,5 +579,5 @@ msgstr ""
579
  #: plugin/Plugin.php:389
580
  msgid ""
581
  "Creates a table of contents for your posts/pages. Works automatically or "
582
- "manually (via shortcode or Gutenberg block)."
583
  msgstr ""
1
  msgid ""
2
  msgstr ""
3
  "Project-Id-Version: \n"
4
+ "POT-Creation-Date: 2019-06-04 22:33+0300\n"
5
+ "PO-Revision-Date: 2019-06-04 22:34+0300\n"
6
  "Last-Translator: \n"
7
  "Language-Team: \n"
8
  "Language: ru_RU\n"
579
  #: plugin/Plugin.php:389
580
  msgid ""
581
  "Creates a table of contents for your posts/pages. Works automatically or "
582
+ "manually (via shortcode, Gutenberg block or widget)."
583
  msgstr ""
luckywp-table-of-contents.php CHANGED
@@ -2,8 +2,8 @@
2
  /*
3
  Plugin Name: LuckyWP Table of Contents
4
  Plugin URI: https://theluckywp.com/product/table-of-contents/
5
- Description: Creates a table of contents for your posts/pages. Works automatically or manually (via shortcode or Gutenberg block).
6
- Version: 1.4.1
7
  Author: LuckyWP
8
  Author URI: https://theluckywp.com/
9
  Text Domain: lwptoc
@@ -29,6 +29,6 @@ $lwptocAutoloader->register();
29
  $lwptocAutoloader->addNamespace('luckywp\tableOfContents', __DIR__);
30
 
31
  $config = require(__DIR__ . '/config/plugin.php');
32
- (new \luckywp\tableOfContents\plugin\Plugin($config))->run('1.4.1', __FILE__, 'lwptoc_');
33
 
34
  require_once __DIR__ . '/functions.php';
2
  /*
3
  Plugin Name: LuckyWP Table of Contents
4
  Plugin URI: https://theluckywp.com/product/table-of-contents/
5
+ Description: Creates a table of contents for your posts/pages. Works automatically or manually (via shortcode, Gutenberg block or widget).
6
+ Version: 1.5
7
  Author: LuckyWP
8
  Author URI: https://theluckywp.com/
9
  Text Domain: lwptoc
29
  $lwptocAutoloader->addNamespace('luckywp\tableOfContents', __DIR__);
30
 
31
  $config = require(__DIR__ . '/config/plugin.php');
32
+ (new \luckywp\tableOfContents\plugin\Plugin($config))->run('1.5', __FILE__, 'lwptoc_');
33
 
34
  require_once __DIR__ . '/functions.php';
plugin/Plugin.php CHANGED
@@ -386,6 +386,6 @@ class Plugin extends BasePlugin
386
 
387
  private function pluginI18n()
388
  {
389
- __('Creates a table of contents for your posts/pages. Works automatically or manually (via shortcode or Gutenberg block).', 'lwptdr');
390
  }
391
  }
386
 
387
  private function pluginI18n()
388
  {
389
+ __('Creates a table of contents for your posts/pages. Works automatically or manually (via shortcode, Gutenberg block or widget).', 'lwptdr');
390
  }
391
  }
plugin/contentHandling/ContentHandling.php CHANGED
@@ -39,9 +39,7 @@ class ContentHandling
39
  return $m[0];
40
  }
41
 
42
- $anchor = Html::a('', null, ['id' => $headingId]);
43
-
44
- return $anchor . $m[0];
45
  }, $dto->content);
46
 
47
  return $result;
39
  return $m[0];
40
  }
41
 
42
+ return '<h' . $headingIndex . $m[2] . '>' . Html::tag('span', $m[3], ['id' => $headingId]) . '</h' . $headingIndex . '>';
 
 
43
  }, $dto->content);
44
 
45
  return $result;
readme.txt CHANGED
@@ -1,23 +1,24 @@
1
  === LuckyWP Table of Contents ===
2
  Contributors: theluckywp
3
  Donate link: https://theluckywp.com/product/table-of-contents/
4
- Tags: table of contents, toc, navigation, links, heading
5
  Requires at least: 4.7
6
  Tested up to: 5.2.1
7
- Stable tag: 1.4.1
8
  Requires PHP: 5.6.20
9
  License: GPLv2 or later
10
  License URI: https://www.gnu.org/licenses/gpl-2.0.html
11
 
12
- Creates a table of contents for your posts/pages. Works automatically or manually (via shortcode, Gutenberg block or widget).
13
 
14
  == Description ==
15
 
16
- Creates a table of contents for your posts, pages or custom post types. Great customizable appearance.
17
 
18
  #### Features
19
 
20
  * Automatical insertion a table of contents (configure post types and position).
 
21
  * Insert by shortcode, Gutenberg block or widget.
22
  * Button on toolbar of the classic editor.
23
  * Gutenberg block into "Common Blocks".
@@ -127,6 +128,9 @@ For non-English websites it is recommended to enable the `Intl` PHP extension.
127
 
128
  == Changelog ==
129
 
 
 
 
130
  = 1.4.1 =
131
  * Bug fix
132
 
1
  === LuckyWP Table of Contents ===
2
  Contributors: theluckywp
3
  Donate link: https://theluckywp.com/product/table-of-contents/
4
+ Tags: table of contents, toc, navigation, links, seo
5
  Requires at least: 4.7
6
  Tested up to: 5.2.1
7
+ Stable tag: 1.5
8
  Requires PHP: 5.6.20
9
  License: GPLv2 or later
10
  License URI: https://www.gnu.org/licenses/gpl-2.0.html
11
 
12
+ Creates SEO-friendly table of contents for your posts/pages. Works automatically or manually (via shortcode, Gutenberg block or widget).
13
 
14
  == Description ==
15
 
16
+ Creates SEO-friendly table of contents for your posts, pages or custom post types. Great customizable appearance.
17
 
18
  #### Features
19
 
20
  * Automatical insertion a table of contents (configure post types and position).
21
+ * SEO-friendly: table of contents code is ready to use by Google for snippets on result page.
22
  * Insert by shortcode, Gutenberg block or widget.
23
  * Button on toolbar of the classic editor.
24
  * Gutenberg block into "Common Blocks".
128
 
129
  == Changelog ==
130
 
131
+ = 1.5 =
132
+ + Enhancements for search engines (Google and other).
133
+
134
  = 1.4.1 =
135
  * Bug fix
136