Easy Table of Contents - Version 2.0.1

Version Description

Requires WordPress >

Download this release

Release Info

Developer shazahm1@hotmail.com
Plugin Icon 128x128 Easy Table of Contents
Version 2.0.1
Comparing to
See all releases

Code changes from version 2.0 to 2.0.1

README.txt CHANGED
@@ -5,7 +5,7 @@ Tags: table of contents, toc
5
  Requires at least: 5.2
6
  Tested up to: 5.3
7
  Requires PHP: 5.6.20
8
- Stable tag: 2.0
9
  License: GPLv2 or later
10
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
11
 
@@ -89,6 +89,14 @@ Easy Table Contents is a fork of the excellent [Table of Contents Plus](https://
89
 
90
  == Changelog ==
91
 
 
 
 
 
 
 
 
 
92
  = 2.0 02/01/2020 =
93
  * NEW: Major rewrite of all code and processing logic to make it faster and more reliable.
94
  * NEW: Support for the <!--nextpage--> tag.
@@ -311,3 +319,6 @@ Requires WordPress >= 4.4 and PHP >= 5.3. PHP version >= 7.1 recommended.
311
 
312
  = 2.0-rc4 =
313
  Requires WordPress >= 5.0 and PHP version >= 5.6.20 (>= 7.1 is recommended).
 
 
 
5
  Requires at least: 5.2
6
  Tested up to: 5.3
7
  Requires PHP: 5.6.20
8
+ Stable tag: 2.0.1
9
  License: GPLv2 or later
10
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
11
 
89
 
90
  == Changelog ==
91
 
92
+ = 2.0.1 03/09/2020 =
93
+ * COMPATIBILITY: Exclude the WordPress Related Posts plugin nodes.
94
+ * COMPATIBILITY: Exclude a couple Atomic Block plugin nodes.
95
+ * COMPATIBILITY: Exclude JetPack Related Posts from heading eligibility.
96
+ * COMPATIBILITY: Exclude Ultimate Addons for VC Composer Tabs from heading eligibility.
97
+ * COMPATIBILITY: Exclude WP Product Reviews from heading eligibility.
98
+ * TWEAK: Prevent possible "strpos(): Empty needle in" warnings when excluding nodes from TOC eligibility.
99
+
100
  = 2.0 02/01/2020 =
101
  * NEW: Major rewrite of all code and processing logic to make it faster and more reliable.
102
  * NEW: Support for the <!--nextpage--> tag.
319
 
320
  = 2.0-rc4 =
321
  Requires WordPress >= 5.0 and PHP version >= 5.6.20 (>= 7.1 is recommended).
322
+
323
+ = 2.0.1 =
324
+ Requires WordPress >= 5.0 and PHP version >= 5.6.20 (>= 7.1 is recommended).
easy-table-of-contents.php CHANGED
@@ -3,7 +3,7 @@
3
  * Plugin Name: Easy Table of Contents
4
  * Plugin URI: http://connections-pro.com/
5
  * Description: Adds a user friendly and fully automatic way to create and display a table of contents generated from the page content.
6
- * Version: 2.0
7
  * Author: Steven A. Zahm
8
  * Author URI: http://connections-pro.com/
9
  * Text Domain: easy-table-of-contents
@@ -26,7 +26,7 @@
26
  * @package Easy Table of Contents
27
  * @category Plugin
28
  * @author Steven A. Zahm
29
- * @version 2.0
30
  */
31
 
32
  use function Easy_Plugins\Table_Of_Contents\String\mb_find_replace;
@@ -47,7 +47,7 @@ if ( ! class_exists( 'ezTOC' ) ) {
47
  * @since 1.0
48
  * @var string
49
  */
50
- const VERSION = '2.0';
51
 
52
  /**
53
  * Stores the instance of this class.
3
  * Plugin Name: Easy Table of Contents
4
  * Plugin URI: http://connections-pro.com/
5
  * Description: Adds a user friendly and fully automatic way to create and display a table of contents generated from the page content.
6
+ * Version: 2.0.1
7
  * Author: Steven A. Zahm
8
  * Author URI: http://connections-pro.com/
9
  * Text Domain: easy-table-of-contents
26
  * @package Easy Table of Contents
27
  * @category Plugin
28
  * @author Steven A. Zahm
29
+ * @version 2.0.1
30
  */
31
 
32
  use function Easy_Plugins\Table_Of_Contents\String\mb_find_replace;
47
  * @since 1.0
48
  * @var string
49
  */
50
+ const VERSION = '2.0.1';
51
 
52
  /**
53
  * Stores the instance of this class.
includes/class.post.php CHANGED
@@ -442,6 +442,11 @@ class ezTOC_Post {
442
 
443
  foreach ( $this->excludedNodes as $node ) {
444
 
 
 
 
 
 
445
  if ( false !== strpos( $node, $string ) ) {
446
 
447
  return true;
442
 
443
  foreach ( $this->excludedNodes as $node ) {
444
 
445
+ if ( empty( $node ) ) {
446
+
447
+ return false;
448
+ }
449
+
450
  if ( false !== strpos( $node, $string ) ) {
451
 
452
  return true;
includes/inc.plugin-compatibility.php CHANGED
@@ -82,7 +82,8 @@ add_filter(
82
  'ez_toc_exclude_by_selector',
83
  function( $selectors ) {
84
 
85
- $selectors['jetpack-sharedaddy'] = '.sharedaddy';
 
86
 
87
  return $selectors;
88
  }
@@ -247,3 +248,64 @@ add_filter(
247
  return $selectors;
248
  }
249
  );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
82
  'ez_toc_exclude_by_selector',
83
  function( $selectors ) {
84
 
85
+ $selectors['jetpack-sharedaddy'] = '.sharedaddy';
86
+ $selectors['jetpack-relatedposts'] = '.jp-relatedposts';
87
 
88
  return $selectors;
89
  }
248
  return $selectors;
249
  }
250
  );
251
+
252
+ /**
253
+ * Remove the WordPress Related Posts plugin node from the post content before extracting headings.
254
+ * @link
255
+ * @since 2.0
256
+ */
257
+ add_filter(
258
+ 'ez_toc_exclude_by_selector',
259
+ function( $selectors ) {
260
+
261
+ $selectors['wordpress-23-related-posts-plugin'] = '.wp_rp_content';
262
+
263
+ return $selectors;
264
+ }
265
+ );
266
+
267
+ /**
268
+ * Remove the Atomic Blocks plugin node from the post content before extracting headings.
269
+ * @link
270
+ * @since 2.0
271
+ */
272
+ add_filter(
273
+ 'ez_toc_exclude_by_selector',
274
+ function( $selectors ) {
275
+
276
+ $selectors['atomic-blocks-cta'] = '.ab-block-cta';
277
+ $selectors['atomic-blocks-testimonial'] = '.ab-block-testimonial';
278
+
279
+ return $selectors;
280
+ }
281
+ );
282
+
283
+ /**
284
+ * Remove the Ultimate Addons for VC Composer node from the post content before extracting headings.
285
+ * @link
286
+ * @since 2.0
287
+ */
288
+ add_filter(
289
+ 'ez_toc_exclude_by_selector',
290
+ function( $selectors ) {
291
+
292
+ $selectors['ultimate-addons-for-vc-composer'] = '.ult_tabs';
293
+
294
+ return $selectors;
295
+ }
296
+ );
297
+
298
+ /**
299
+ * Remove the WP Product Review node from the post content before extracting headings.
300
+ * @link
301
+ * @since 2.0
302
+ */
303
+ add_filter(
304
+ 'ez_toc_exclude_by_selector',
305
+ function( $selectors ) {
306
+
307
+ $selectors['wp-product-review'] = '.wppr-review-container';
308
+
309
+ return $selectors;
310
+ }
311
+ );