Plugin Directory

Changeset 3260922


Ignore:
Timestamp:
03/24/2025 03:30:42 PM (12 months ago)
Author:
EdwardBock
Message:

update 1.3.2

Location:
permalink-history/trunk
Files:
2 added
10 edited
1 copied

Legend:

Unmodified
Added
Removed
  • permalink-history/trunk/Plugin.php

    r3246273 r3260922  
    33 * Plugin Name: Permalink History
    44 * Description: Saves a history of posts permalinks
    5  * Version: 1.3.1
     5 * Version: 1.3.2
    66 * Author: PALASTHOTEL (by Edward Bock, Lucas Regalar)
    77 * Author URI: https://palasthotel.de
  • permalink-history/trunk/classes/HistoryItem.php

    r2147533 r3260922  
    11<?php
    2 /**
    3  * Created by PhpStorm.
    4  * User: edward
    5  * Date: 2019-04-10
    6  * Time: 18:02
    7  */
    82
    93namespace Palasthotel\PermalinkHistory;
    104
    11 
    12 /**
    13  * @property int|null id
    14  * @property int content_id
    15  * @property string content_type
    16  * @property string permalink
    17  */
    185class HistoryItem {
    196
    20     /**
    21      * HistoryItem constructor.
    22      *
    23      * @param int $content_id
    24      * @param string $content_type
    25      * @param string $permalink
    26      * @param int|null $id
    27      */
    28     private function __construct($content_id, $content_type, $permalink, $id) {
    29         $this->id = $id;
    30         $this->content_id = $content_id;
    31         $this->content_type = $content_type;
    32         $this->permalink = $permalink;
     7    private function __construct(public int $content_id, public string $content_type, public string $permalink, public ?int $id = null) {
    338    }
    349
    35     /**
    36      * @param int $content_id
    37      * @param string $content_type
    38      * @param string $permalink
    39      * @param int|null $id
    40      *
    41      * @return HistoryItem
    42      */
    43     public static function build($content_id, $content_type, $permalink, $id = null){
     10    public static function build(int $content_id, string $content_type, string $permalink, ?int $id = null){
    4411        return new HistoryItem($content_id, $content_type, $permalink, $id);
    4512    }
     
    4815     * @param object|null $resultObject
    4916     *
    50      * @return HistoryItem
    5117     */
    5218    public static function parse($resultObject){
  • permalink-history/trunk/classes/MetaBox.php

    r3246273 r3260922  
    3030    public function render(){
    3131        $permalink = $this->plugin->post->getEscapedPermalink(get_the_ID());
    32         $history = array_filter($this->plugin->database->getHistoryFor(get_the_ID(), get_post_type()), function($item) use ($permalink){
     32        $history = array_filter($this->plugin->database->getHistoryFor(get_the_ID(), Database::CONTENT_TYPE_POST), function($item) use ($permalink){
    3333            return $item->permalink !== $permalink;
    3434        });
     35
    3536        if(count($history)){
    3637            echo "<ul>";
  • permalink-history/trunk/readme.txt

    r3246273 r3260922  
    55Requires at least: 5.0
    66Tested up to: 6.7.2
    7 Stable tag: 1.3.1
     7Stable tag: 1.3.2
    88License: GPLv3
    99License URI: http://www.gnu.org/licenses/gpl
     
    4242== Changelog ==
    4343
     44= 1.3.2 =
     45* Fix: meta box for all other post types than post itself
     46
    4447= 1.3.1 =
    4548* Php 8.2 compatibility warning fix
  • permalink-history/trunk/vendor/autoload.php

    r3246273 r3260922  
    33// autoload.php @generated by Composer
    44
     5if (PHP_VERSION_ID < 50600) {
     6    if (!headers_sent()) {
     7        header('HTTP/1.1 500 Internal Server Error');
     8    }
     9    $err = 'Composer 2.3.0 dropped support for autoloading on PHP <5.6 and you are running '.PHP_VERSION.', please upgrade PHP or use Composer 2.2 LTS via "composer self-update --2.2". Aborting.'.PHP_EOL;
     10    if (!ini_get('display_errors')) {
     11        if (PHP_SAPI === 'cli' || PHP_SAPI === 'phpdbg') {
     12            fwrite(STDERR, $err);
     13        } elseif (!headers_sent()) {
     14            echo $err;
     15        }
     16    }
     17    trigger_error(
     18        $err,
     19        E_USER_ERROR
     20    );
     21}
     22
    523require_once __DIR__ . '/composer/autoload_real.php';
    624
  • permalink-history/trunk/vendor/composer/ClassLoader.php

    r3246273 r3260922  
    4343class ClassLoader
    4444{
     45    /** @var \Closure(string):void */
     46    private static $includeFile;
     47
     48    /** @var string|null */
    4549    private $vendorDir;
    4650
    4751    // PSR-4
     52    /**
     53     * @var array<string, array<string, int>>
     54     */
    4855    private $prefixLengthsPsr4 = array();
     56    /**
     57     * @var array<string, list<string>>
     58     */
    4959    private $prefixDirsPsr4 = array();
     60    /**
     61     * @var list<string>
     62     */
    5063    private $fallbackDirsPsr4 = array();
    5164
    5265    // PSR-0
     66    /**
     67     * List of PSR-0 prefixes
     68     *
     69     * Structured as array('F (first letter)' => array('Foo\Bar (full prefix)' => array('path', 'path2')))
     70     *
     71     * @var array<string, array<string, list<string>>>
     72     */
    5373    private $prefixesPsr0 = array();
     74    /**
     75     * @var list<string>
     76     */
    5477    private $fallbackDirsPsr0 = array();
    5578
     79    /** @var bool */
    5680    private $useIncludePath = false;
     81
     82    /**
     83     * @var array<string, string>
     84     */
    5785    private $classMap = array();
     86
     87    /** @var bool */
    5888    private $classMapAuthoritative = false;
     89
     90    /**
     91     * @var array<string, bool>
     92     */
    5993    private $missingClasses = array();
     94
     95    /** @var string|null */
    6096    private $apcuPrefix;
    6197
     98    /**
     99     * @var array<string, self>
     100     */
    62101    private static $registeredLoaders = array();
    63102
     103    /**
     104     * @param string|null $vendorDir
     105     */
    64106    public function __construct($vendorDir = null)
    65107    {
    66108        $this->vendorDir = $vendorDir;
    67     }
    68 
     109        self::initializeIncludeClosure();
     110    }
     111
     112    /**
     113     * @return array<string, list<string>>
     114     */
    69115    public function getPrefixes()
    70116    {
     
    76122    }
    77123
     124    /**
     125     * @return array<string, list<string>>
     126     */
    78127    public function getPrefixesPsr4()
    79128    {
     
    81130    }
    82131
     132    /**
     133     * @return list<string>
     134     */
    83135    public function getFallbackDirs()
    84136    {
     
    86138    }
    87139
     140    /**
     141     * @return list<string>
     142     */
    88143    public function getFallbackDirsPsr4()
    89144    {
     
    91146    }
    92147
     148    /**
     149     * @return array<string, string> Array of classname => path
     150     */
    93151    public function getClassMap()
    94152    {
     
    97155
    98156    /**
    99      * @param array $classMap Class to filename map
     157     * @param array<string, string> $classMap Class to filename map
     158     *
     159     * @return void
    100160     */
    101161    public function addClassMap(array $classMap)
     
    112172     * appending or prepending to the ones previously set for this prefix.
    113173     *
    114      * @param string       $prefix  The prefix
    115      * @param array|string $paths   The PSR-0 root directories
    116      * @param bool         $prepend Whether to prepend the directories
     174     * @param string              $prefix  The prefix
     175     * @param list<string>|string $paths   The PSR-0 root directories
     176     * @param bool                $prepend Whether to prepend the directories
     177     *
     178     * @return void
    117179     */
    118180    public function add($prefix, $paths, $prepend = false)
    119181    {
     182        $paths = (array) $paths;
    120183        if (!$prefix) {
    121184            if ($prepend) {
    122185                $this->fallbackDirsPsr0 = array_merge(
    123                     (array) $paths,
     186                    $paths,
    124187                    $this->fallbackDirsPsr0
    125188                );
     
    127190                $this->fallbackDirsPsr0 = array_merge(
    128191                    $this->fallbackDirsPsr0,
    129                     (array) $paths
     192                    $paths
    130193                );
    131194            }
     
    136199        $first = $prefix[0];
    137200        if (!isset($this->prefixesPsr0[$first][$prefix])) {
    138             $this->prefixesPsr0[$first][$prefix] = (array) $paths;
     201            $this->prefixesPsr0[$first][$prefix] = $paths;
    139202
    140203            return;
     
    142205        if ($prepend) {
    143206            $this->prefixesPsr0[$first][$prefix] = array_merge(
    144                 (array) $paths,
     207                $paths,
    145208                $this->prefixesPsr0[$first][$prefix]
    146209            );
     
    148211            $this->prefixesPsr0[$first][$prefix] = array_merge(
    149212                $this->prefixesPsr0[$first][$prefix],
    150                 (array) $paths
     213                $paths
    151214            );
    152215        }
     
    157220     * appending or prepending to the ones previously set for this namespace.
    158221     *
    159      * @param string       $prefix  The prefix/namespace, with trailing '\\'
    160      * @param array|string $paths   The PSR-4 base directories
    161      * @param bool         $prepend Whether to prepend the directories
     222     * @param string              $prefix  The prefix/namespace, with trailing '\\'
     223     * @param list<string>|string $paths   The PSR-4 base directories
     224     * @param bool                $prepend Whether to prepend the directories
    162225     *
    163226     * @throws \InvalidArgumentException
     227     *
     228     * @return void
    164229     */
    165230    public function addPsr4($prefix, $paths, $prepend = false)
    166231    {
     232        $paths = (array) $paths;
    167233        if (!$prefix) {
    168234            // Register directories for the root namespace.
    169235            if ($prepend) {
    170236                $this->fallbackDirsPsr4 = array_merge(
    171                     (array) $paths,
     237                    $paths,
    172238                    $this->fallbackDirsPsr4
    173239                );
     
    175241                $this->fallbackDirsPsr4 = array_merge(
    176242                    $this->fallbackDirsPsr4,
    177                     (array) $paths
     243                    $paths
    178244                );
    179245            }
     
    185251            }
    186252            $this->prefixLengthsPsr4[$prefix[0]][$prefix] = $length;
    187             $this->prefixDirsPsr4[$prefix] = (array) $paths;
     253            $this->prefixDirsPsr4[$prefix] = $paths;
    188254        } elseif ($prepend) {
    189255            // Prepend directories for an already registered namespace.
    190256            $this->prefixDirsPsr4[$prefix] = array_merge(
    191                 (array) $paths,
     257                $paths,
    192258                $this->prefixDirsPsr4[$prefix]
    193259            );
     
    196262            $this->prefixDirsPsr4[$prefix] = array_merge(
    197263                $this->prefixDirsPsr4[$prefix],
    198                 (array) $paths
     264                $paths
    199265            );
    200266        }
     
    205271     * replacing any others previously set for this prefix.
    206272     *
    207      * @param string       $prefix The prefix
    208      * @param array|string $paths  The PSR-0 base directories
     273     * @param string              $prefix The prefix
     274     * @param list<string>|string $paths  The PSR-0 base directories
     275     *
     276     * @return void
    209277     */
    210278    public function set($prefix, $paths)
     
    221289     * replacing any others previously set for this namespace.
    222290     *
    223      * @param string       $prefix The prefix/namespace, with trailing '\\'
    224      * @param array|string $paths  The PSR-4 base directories
     291     * @param string              $prefix The prefix/namespace, with trailing '\\'
     292     * @param list<string>|string $paths  The PSR-4 base directories
    225293     *
    226294     * @throws \InvalidArgumentException
     295     *
     296     * @return void
    227297     */
    228298    public function setPsr4($prefix, $paths)
     
    244314     *
    245315     * @param bool $useIncludePath
     316     *
     317     * @return void
    246318     */
    247319    public function setUseIncludePath($useIncludePath)
     
    266338     *
    267339     * @param bool $classMapAuthoritative
     340     *
     341     * @return void
    268342     */
    269343    public function setClassMapAuthoritative($classMapAuthoritative)
     
    286360     *
    287361     * @param string|null $apcuPrefix
     362     *
     363     * @return void
    288364     */
    289365    public function setApcuPrefix($apcuPrefix)
     
    306382     *
    307383     * @param bool $prepend Whether to prepend the autoloader or not
     384     *
     385     * @return void
    308386     */
    309387    public function register($prepend = false)
     
    325403    /**
    326404     * Unregisters this instance as an autoloader.
     405     *
     406     * @return void
    327407     */
    328408    public function unregister()
     
    344424    {
    345425        if ($file = $this->findFile($class)) {
    346             includeFile($file);
     426            $includeFile = self::$includeFile;
     427            $includeFile($file);
    347428
    348429            return true;
     
    395476
    396477    /**
    397      * Returns the currently registered loaders indexed by their corresponding vendor directories.
    398      *
    399      * @return self[]
     478     * Returns the currently registered loaders keyed by their corresponding vendor directories.
     479     *
     480     * @return array<string, self>
    400481     */
    401482    public static function getRegisteredLoaders()
     
    404485    }
    405486
     487    /**
     488     * @param  string       $class
     489     * @param  string       $ext
     490     * @return string|false
     491     */
    406492    private function findFileWithExtension($class, $ext)
    407493    {
     
    469555        return false;
    470556    }
     557
     558    /**
     559     * @return void
     560     */
     561    private static function initializeIncludeClosure()
     562    {
     563        if (self::$includeFile !== null) {
     564            return;
     565        }
     566
     567        /**
     568         * Scope isolated include.
     569         *
     570         * Prevents access to $this/self from included files.
     571         *
     572         * @param  string $file
     573         * @return void
     574         */
     575        self::$includeFile = \Closure::bind(static function($file) {
     576            include $file;
     577        }, null, null);
     578    }
    471579}
    472 
    473 /**
    474  * Scope isolated include.
    475  *
    476  * Prevents access to $this/self from included files.
    477  */
    478 function includeFile($file)
    479 {
    480     include $file;
    481 }
  • permalink-history/trunk/vendor/composer/autoload_classmap.php

    r3246273 r3260922  
    33// autoload_classmap.php @generated by Composer
    44
    5 $vendorDir = dirname(dirname(__FILE__));
     5$vendorDir = dirname(__DIR__);
    66$baseDir = dirname($vendorDir);
    77
  • permalink-history/trunk/vendor/composer/autoload_namespaces.php

    r3246273 r3260922  
    33// autoload_namespaces.php @generated by Composer
    44
    5 $vendorDir = dirname(dirname(__FILE__));
     5$vendorDir = dirname(__DIR__);
    66$baseDir = dirname($vendorDir);
    77
  • permalink-history/trunk/vendor/composer/autoload_psr4.php

    r3246273 r3260922  
    33// autoload_psr4.php @generated by Composer
    44
    5 $vendorDir = dirname(dirname(__FILE__));
     5$vendorDir = dirname(__DIR__);
    66$baseDir = dirname($vendorDir);
    77
  • permalink-history/trunk/vendor/composer/autoload_real.php

    r3246273 r3260922  
    2424
    2525        spl_autoload_register(array('ComposerAutoloaderInit3d3f8d1991bb14c91265db0ad36c78b3', 'loadClassLoader'), true, true);
    26         self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname(\dirname(__FILE__)));
     26        self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname(__DIR__));
    2727        spl_autoload_unregister(array('ComposerAutoloaderInit3d3f8d1991bb14c91265db0ad36c78b3', 'loadClassLoader'));
    2828
    29         $useStaticLoader = PHP_VERSION_ID >= 50600 && !defined('HHVM_VERSION') && (!function_exists('zend_loader_file_encoded') || !zend_loader_file_encoded());
    30         if ($useStaticLoader) {
    31             require __DIR__ . '/autoload_static.php';
    32 
    33             call_user_func(\Composer\Autoload\ComposerStaticInit3d3f8d1991bb14c91265db0ad36c78b3::getInitializer($loader));
    34         } else {
    35             $map = require __DIR__ . '/autoload_namespaces.php';
    36             foreach ($map as $namespace => $path) {
    37                 $loader->set($namespace, $path);
    38             }
    39 
    40             $map = require __DIR__ . '/autoload_psr4.php';
    41             foreach ($map as $namespace => $path) {
    42                 $loader->setPsr4($namespace, $path);
    43             }
    44 
    45             $classMap = require __DIR__ . '/autoload_classmap.php';
    46             if ($classMap) {
    47                 $loader->addClassMap($classMap);
    48             }
    49         }
     29        require __DIR__ . '/autoload_static.php';
     30        call_user_func(\Composer\Autoload\ComposerStaticInit3d3f8d1991bb14c91265db0ad36c78b3::getInitializer($loader));
    5031
    5132        $loader->register(true);
  • permalink-history/trunk/vendor/composer/installed.php

    r3006602 r3260922  
    44        'pretty_version' => 'dev-master',
    55        'version' => 'dev-master',
    6         'reference' => '7206d39a95fb6d6edf59150455596d8190de614c',
     6        'reference' => '566e0573e62ccaaa967a4a1f5cf3125ced3926cb',
    77        'type' => 'library',
    88        'install_path' => __DIR__ . '/../../',
     
    1414            'pretty_version' => 'dev-master',
    1515            'version' => 'dev-master',
    16             'reference' => '7206d39a95fb6d6edf59150455596d8190de614c',
     16            'reference' => '566e0573e62ccaaa967a4a1f5cf3125ced3926cb',
    1717            'type' => 'library',
    1818            'install_path' => __DIR__ . '/../../',
Note: See TracChangeset for help on using the changeset viewer.