Skip to content

Commit

Permalink
Merge branch 'release/1.5.2'
Browse files Browse the repository at this point in the history
  • Loading branch information
JiveDig committed Jun 28, 2023
2 parents f7c341d + 23831f8 commit f95be39
Show file tree
Hide file tree
Showing 55 changed files with 660 additions and 360 deletions.
4 changes: 4 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Changelog

## 1.5.2 (6/28/23)
* Changed: Update the updater.
* Fixed: TOC block and shortcode not respecting the minimum headings count.

## 1.5.1 (5/5/23)
* Fixed: Missing content on some post types when a TOC is not present.

Expand Down
6 changes: 3 additions & 3 deletions classes/class-table-of-contents.php
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ function get_toc() {
}

// Bail if not enough h2s.
if ( count( $this->data['matches'] ) < absint( $this->args['headings'] ) ) {
if ( count( $this->data['matches'] ) < $this->args['headings'] ) {
return $cache[ $this->post_id ];
}

Expand Down Expand Up @@ -323,8 +323,8 @@ function get_data() {
}
}

// If we have at least 3 h2 headings.
if ( count( $data['matches'] ) > 2 ) {
// If we have the minimum h2 headings.
if ( count( $data['matches'] ) >= $this->args['headings'] ) {
// Store TOC in new content.
$data['content'] = $dom->saveHTML();
}
Expand Down
14 changes: 7 additions & 7 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions mai-table-of-contents.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* Plugin Name: Mai Table of Contents
* Plugin URI: https://bizbudding.com/mai-design-pack/
* Description: Automatically create a table of contents from headings in your posts.
* Version: 1.5.1
* Version: 1.5.2
*
* Author: BizBudding
* Author URI: https://bizbudding.com
Expand Down Expand Up @@ -92,7 +92,7 @@ public function __wakeup() {
private function setup_constants() {
// Plugin version.
if ( ! defined( 'MAI_TABLE_OF_CONTENTS_VERSION' ) ) {
define( 'MAI_TABLE_OF_CONTENTS_VERSION', '1.5.1' );
define( 'MAI_TABLE_OF_CONTENTS_VERSION', '1.5.2' );
}

// Plugin Folder Path.
Expand Down
2 changes: 1 addition & 1 deletion vendor/composer/autoload_files.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,5 @@
$baseDir = dirname($vendorDir);

return array(
'5ff2501974ebd86c0be698ddfca6451e' => $vendorDir . '/yahnis-elsts/plugin-update-checker/load-v5p0.php',
'9b77ddcfb14408a32f5aaf74e0a11694' => $vendorDir . '/yahnis-elsts/plugin-update-checker/load-v5p1.php',
);
2 changes: 1 addition & 1 deletion vendor/composer/autoload_static.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
class ComposerStaticInit1782162e12bcf11213202aa27e2616cd
{
public static $files = array (
'5ff2501974ebd86c0be698ddfca6451e' => __DIR__ . '/..' . '/yahnis-elsts/plugin-update-checker/load-v5p0.php',
'9b77ddcfb14408a32f5aaf74e0a11694' => __DIR__ . '/..' . '/yahnis-elsts/plugin-update-checker/load-v5p1.php',
);

public static $classMap = array (
Expand Down
16 changes: 8 additions & 8 deletions vendor/composer/installed.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,29 +2,29 @@
"packages": [
{
"name": "yahnis-elsts/plugin-update-checker",
"version": "v5.0",
"version_normalized": "5.0.0.0",
"version": "v5.1",
"version_normalized": "5.1.0.0",
"source": {
"type": "git",
"url": "https://github.com/YahnisElsts/plugin-update-checker.git",
"reference": "81be284da76f12c8751b477b2a0fa44364d26f84"
"reference": "48b03e93c9c2587f9276dce00ce2b6d94c1190d2"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/YahnisElsts/plugin-update-checker/zipball/81be284da76f12c8751b477b2a0fa44364d26f84",
"reference": "81be284da76f12c8751b477b2a0fa44364d26f84",
"url": "https://api.github.com/repos/YahnisElsts/plugin-update-checker/zipball/48b03e93c9c2587f9276dce00ce2b6d94c1190d2",
"reference": "48b03e93c9c2587f9276dce00ce2b6d94c1190d2",
"shasum": ""
},
"require": {
"ext-json": "*",
"php": ">=5.6.20"
},
"time": "2022-10-28T17:46:32+00:00",
"time": "2023-05-20T11:55:43+00:00",
"type": "library",
"installation-source": "dist",
"autoload": {
"files": [
"load-v5p0.php"
"load-v5p1.php"
]
},
"notification-url": "https://packagist.org/downloads/",
Expand All @@ -49,7 +49,7 @@
],
"support": {
"issues": "https://github.com/YahnisElsts/plugin-update-checker/issues",
"source": "https://github.com/YahnisElsts/plugin-update-checker/tree/v5.0"
"source": "https://github.com/YahnisElsts/plugin-update-checker/tree/v5.1"
},
"install-path": "../yahnis-elsts/plugin-update-checker"
}
Expand Down
10 changes: 5 additions & 5 deletions vendor/composer/installed.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
'name' => '__root__',
'pretty_version' => 'dev-develop',
'version' => 'dev-develop',
'reference' => 'f4e7890d7d94bd0593a31b7604d7dc8e38b8a3e6',
'reference' => 'd85d6f58ef5e011135e6e304f79b2527c17c2935',
'type' => 'library',
'install_path' => __DIR__ . '/../../',
'aliases' => array(),
Expand All @@ -13,16 +13,16 @@
'__root__' => array(
'pretty_version' => 'dev-develop',
'version' => 'dev-develop',
'reference' => 'f4e7890d7d94bd0593a31b7604d7dc8e38b8a3e6',
'reference' => 'd85d6f58ef5e011135e6e304f79b2527c17c2935',
'type' => 'library',
'install_path' => __DIR__ . '/../../',
'aliases' => array(),
'dev_requirement' => false,
),
'yahnis-elsts/plugin-update-checker' => array(
'pretty_version' => 'v5.0',
'version' => '5.0.0.0',
'reference' => '81be284da76f12c8751b477b2a0fa44364d26f84',
'pretty_version' => 'v5.1',
'version' => '5.1.0.0',
'reference' => '48b03e93c9c2587f9276dce00ce2b6d94c1190d2',
'type' => 'library',
'install_path' => __DIR__ . '/../yahnis-elsts/plugin-update-checker',
'aliases' => array(),
Expand Down
1 change: 1 addition & 0 deletions vendor/yahnis-elsts/plugin-update-checker/.gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/build export-ignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

if ( !class_exists(PucFactory::class, false) ):

class PucFactory extends \YahnisElsts\PluginUpdateChecker\v5p0\PucFactory {
class PucFactory extends \YahnisElsts\PluginUpdateChecker\v5p1\PucFactory {
}

endif;
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

namespace YahnisElsts\PluginUpdateChecker\v5p0;
namespace YahnisElsts\PluginUpdateChecker\v5p1;

if ( !class_exists(Autoloader::class, false) ):

Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<?php
namespace YahnisElsts\PluginUpdateChecker\v5p0\DebugBar;
namespace YahnisElsts\PluginUpdateChecker\v5p1\DebugBar;

use YahnisElsts\PluginUpdateChecker\v5p0\PucFactory;
use YahnisElsts\PluginUpdateChecker\v5p0\UpdateChecker;
use YahnisElsts\PluginUpdateChecker\v5p1\PucFactory;
use YahnisElsts\PluginUpdateChecker\v5p1\UpdateChecker;

if ( !class_exists(Extension::class, false) ):

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php
namespace YahnisElsts\PluginUpdateChecker\v5p0\DebugBar;
namespace YahnisElsts\PluginUpdateChecker\v5p1\DebugBar;

use YahnisElsts\PluginUpdateChecker\v5p0\UpdateChecker;
use YahnisElsts\PluginUpdateChecker\v5p1\UpdateChecker;

if ( !class_exists(Panel::class, false) && class_exists('Debug_Bar_Panel', false) ):

Expand Down Expand Up @@ -160,11 +160,18 @@ private function formatTimestamp($unixTime) {

public function row($name, $value) {
if ( is_object($value) || is_array($value) ) {
//This is specifically for debugging, so print_r() is fine.
//phpcs:ignore WordPress.PHP.DevelopmentFunctions.error_log_print_r
$value = '<pre>' . htmlentities(print_r($value, true)) . '</pre>';
} else if ($value === null) {
$value = '<code>null</code>';
}
printf('<tr><th scope="row">%1$s</th> <td>%2$s</td></tr>', $name, $value);
printf(
'<tr><th scope="row">%1$s</th> <td>%2$s</td></tr>',
esc_html($name),
//phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- Escaped above.
$value
);
}
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<?php

namespace YahnisElsts\PluginUpdateChecker\v5p0\DebugBar;
namespace YahnisElsts\PluginUpdateChecker\v5p1\DebugBar;

use YahnisElsts\PluginUpdateChecker\v5p0\Plugin\UpdateChecker;
use YahnisElsts\PluginUpdateChecker\v5p1\Plugin\UpdateChecker;

if ( !class_exists(PluginExtension::class, false) ):

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php
namespace YahnisElsts\PluginUpdateChecker\v5p0\DebugBar;
namespace YahnisElsts\PluginUpdateChecker\v5p1\DebugBar;

use YahnisElsts\PluginUpdateChecker\v5p0\Plugin\UpdateChecker;
use YahnisElsts\PluginUpdateChecker\v5p1\Plugin\UpdateChecker;

if ( !class_exists(PluginPanel::class, false) ):

Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<?php

namespace YahnisElsts\PluginUpdateChecker\v5p0\DebugBar;
namespace YahnisElsts\PluginUpdateChecker\v5p1\DebugBar;

use YahnisElsts\PluginUpdateChecker\v5p0\Theme\UpdateChecker;
use YahnisElsts\PluginUpdateChecker\v5p1\Theme\UpdateChecker;

if ( !class_exists(ThemePanel::class, false) ):

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?php
namespace YahnisElsts\PluginUpdateChecker\v5p0;
namespace YahnisElsts\PluginUpdateChecker\v5p1;

if ( !class_exists(InstalledPackage::class, false) ):

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?php
namespace YahnisElsts\PluginUpdateChecker\v5p0;
namespace YahnisElsts\PluginUpdateChecker\v5p1;

use LogicException;
use stdClass;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?php
namespace YahnisElsts\PluginUpdateChecker\v5p0;
namespace YahnisElsts\PluginUpdateChecker\v5p1;

if ( !class_exists(OAuthSignature::class, false) ):

Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<?php
namespace YahnisElsts\PluginUpdateChecker\v5p0\Plugin;
namespace YahnisElsts\PluginUpdateChecker\v5p1\Plugin;

use YahnisElsts\PluginUpdateChecker\v5p0\InstalledPackage;
use YahnisElsts\PluginUpdateChecker\v5p0\PucFactory;
use YahnisElsts\PluginUpdateChecker\v5p1\InstalledPackage;
use YahnisElsts\PluginUpdateChecker\v5p1\PucFactory;

if ( !class_exists(Package::class, false) ):

Expand Down Expand Up @@ -51,7 +51,7 @@ public function getInstalledVersion() {
//This can happen if the filename points to something that is not a plugin.
$this->updateChecker->triggerError(
sprintf(
"Can't to read the Version header for '%s'. The filename is incorrect or is not a plugin.",
"Cannot read the Version header for '%s'. The filename is incorrect or is not a plugin.",
$this->updateChecker->pluginFile
),
E_USER_WARNING
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php
namespace YahnisElsts\PluginUpdateChecker\v5p0\Plugin;
namespace YahnisElsts\PluginUpdateChecker\v5p1\Plugin;

use YahnisElsts\PluginUpdateChecker\v5p0\Metadata;
use YahnisElsts\PluginUpdateChecker\v5p1\Metadata;

if ( !class_exists(PluginInfo::class, false) ):

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?php
namespace YahnisElsts\PluginUpdateChecker\v5p0\Plugin;
namespace YahnisElsts\PluginUpdateChecker\v5p1\Plugin;

if ( !class_exists('Ui', false) ):
/**
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php
namespace YahnisElsts\PluginUpdateChecker\v5p0\Plugin;
namespace YahnisElsts\PluginUpdateChecker\v5p1\Plugin;

use YahnisElsts\PluginUpdateChecker\v5p0\Update as BaseUpdate;
use YahnisElsts\PluginUpdateChecker\v5p1\Update as BaseUpdate;

if ( !class_exists(Update::class, false) ):

Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
<?php
namespace YahnisElsts\PluginUpdateChecker\v5p0\Plugin;
namespace YahnisElsts\PluginUpdateChecker\v5p1\Plugin;

use YahnisElsts\PluginUpdateChecker\v5p0\InstalledPackage;
use YahnisElsts\PluginUpdateChecker\v5p0\UpdateChecker as BaseUpdateChecker;
use YahnisElsts\PluginUpdateChecker\v5p0\Scheduler;
use YahnisElsts\PluginUpdateChecker\v5p0\DebugBar;
use YahnisElsts\PluginUpdateChecker\v5p1\InstalledPackage;
use YahnisElsts\PluginUpdateChecker\v5p1\UpdateChecker as BaseUpdateChecker;
use YahnisElsts\PluginUpdateChecker\v5p1\Scheduler;
use YahnisElsts\PluginUpdateChecker\v5p1\DebugBar;

if ( !class_exists(UpdateChecker::class, false) ):

Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
<?php

namespace YahnisElsts\PluginUpdateChecker\v5p0;
namespace YahnisElsts\PluginUpdateChecker\v5p1;

use YahnisElsts\PluginUpdateChecker\v5p0\Plugin;
use YahnisElsts\PluginUpdateChecker\v5p0\Theme;
use YahnisElsts\PluginUpdateChecker\v5p0\Vcs;
use YahnisElsts\PluginUpdateChecker\v5p1\Plugin;
use YahnisElsts\PluginUpdateChecker\v5p1\Theme;
use YahnisElsts\PluginUpdateChecker\v5p1\Vcs;

if ( !class_exists(PucFactory::class, false) ):

Expand Down Expand Up @@ -147,7 +147,7 @@ public static function buildUpdateChecker($metadataUrl, $fullPath, $slug = '', $
*
* Normalize a filesystem path. Introduced in WP 3.9.
* Copying here allows use of the class on earlier versions.
* This version adapted from WP 4.8.2 (unchanged since 4.5.0)
* This version adapted from WP 4.8.2 (unchanged since 4.5.1)
*
* @param string $path Path to normalize.
* @return string Normalized path.
Expand Down
Loading

0 comments on commit f95be39

Please sign in to comment.