Plugin Directory

Changeset 3453070


Ignore:
Timestamp:
02/03/2026 04:34:50 PM (8 weeks ago)
Author:
grandplugins
Message:
  • Update to WP 6.9
Location:
pdf-password-protect/trunk
Files:
1 added
13 edited

Legend:

Unmodified
Added
Removed
  • pdf-password-protect/trunk/includes/pages/AdminPage.php

    r2895893 r3453070  
    22namespace GPLSCore\GPLS_PLUGIN_PSRPDF\pages;
    33
     4if ( ! defined( 'ABSPATH' ) ) {
     5    exit;
     6}
     7
     8use GPLSCore\GPLS_PLUGIN_PSRPDF\Base;
    49use GPLSCore\GPLS_PLUGIN_PSRPDF\Utils\Helpers;
    510use GPLSCore\GPLS_PLUGIN_PSRPDF\Utils\NoticeUtils;
    611use GPLSCore\GPLS_PLUGIN_PSRPDF\Settings;
    712
    8 if ( ! defined( 'ABSPATH' ) ) {
    9     exit;
    10 }
    1113
    1214/**
    1315 * Admin Page Class
    1416 */
    15 abstract class AdminPage {
     17abstract class AdminPage extends Base {
    1618
    1719    use Helpers;
     
    1921
    2022    /**
    21      * Core Objet
    22      *
    23      * @var object
    24      */
    25     protected static $core;
    26     /**
    27      * Plugin Info
    28      *
    29      * @var object
    30      */
    31     protected static $plugin_info;
    32 
    33     /**
    3423     * Parent Slug.
    3524     *
    36      * @var string|nul
     25     * @var string|null
    3726     */
    3827    protected $parent_slug = null;
     
    228217     * @param AdminPage $parent_page
    229218     */
    230     public static function get_instance( $core, $plugin_info, $parent_page = null ) {
     219    public static function get_instance() {
    231220        if ( is_null( static::$instance ) ) {
    232             static::$instance = new static( $core, $plugin_info, $parent_page );
     221            static::$instance = new static();
    233222        }
    234223        return static::$instance;
     
    239228     */
    240229    protected function __construct() {
     230        add_action( 'init', array( $this, 'start_setup' ) );
     231    }
     232
     233    /**
     234     * Start Setup.
     235     * @return void
     236     */
     237    public function start_setup() {
    241238        $this->init();
    242239        $this->setup();
     
    325322        add_action( 'wp_loaded', array( $this, 'page_form_submit' ) );
    326323        add_action( 'admin_enqueue_scripts', array( $this, 'assets' ), 100, 1 );
     324
     325        $this->hooks();
    327326
    328327        if ( $this->allow_ajax_submit ) {
  • pdf-password-protect/trunk/includes/pages/class-pdf-password-settings.php

    r2895893 r3453070  
    5252     * @param array     $other_pages
    5353     */
    54     public function __construct( $core, $plugin_info, $parent_page = null, $other_pages = array() ) {
    55         self::$core        = $core;
    56         self::$plugin_info = $plugin_info;
    57         $this->parent_page = $parent_page;
    58         $this->other_pages = $other_pages;
    59 
     54    public function __construct() {
    6055        parent::__construct();
    61         $this->hooks();
    6256    }
    6357
  • pdf-password-protect/trunk/includes/pages/pagesList.php

    r2895893 r3453070  
    1111 * Init Pages.
    1212 */
    13 function setup_pages( $core, $plugin_info ) {
    14     PDF_Password_Settings::get_instance( $core, $plugin_info );
     13function setup_pages() {
     14    PDF_Password_Settings::get_instance();
    1515}
  • pdf-password-protect/trunk/pdf-password-protect.php

    r3448697 r3453070  
    99 * Text Domain:       pdf-password-protect
    1010 * Std Name:          gpls-psrpdf-password-protected-pdf
    11  * Version:           1.0.4
     11 * Version:           1.0.5
    1212 * Requires at least: 5.8.0
    1313 * Requires PHP:      7.2.5
     
    2020}
    2121
     22
    2223use GPLSCore\GPLS_PLUGIN_PSRPDF\Core;
     24use GPLSCore\GPLS_PLUGIN_PSRPDF\Base;
    2325use GPLSCore\GPLS_PLUGIN_PSRPDF\PDF_Password_Protected;
    2426use function GPLSCore\GPLS_PLUGIN_PSRPDF\pages\setup_pages;
     
    7981            require_once trailingslashit( plugin_dir_path( __FILE__ ) ) . 'core/bootstrap.php';
    8082            self::$core = new Core( self::$plugin_info );
     83            Base::start( self::$core, self::$plugin_info );
    8184            if ( 'activated' === $action_type ) {
    8285                self::$core->plugin_activated();
     
    155158        public function load() {
    156159            self::$core = new Core( self::$plugin_info );
    157             setup_pages( self::$core, self::$plugin_info );
     160            Base::start( self::$core, self::$plugin_info );
     161            setup_pages();
    158162            PDF_Password_Protected::init( self::$core, self::$plugin_info );
    159163        }
  • pdf-password-protect/trunk/readme.txt

    r3448697 r3453070  
    44Requires at least: 5.8.0
    55Requires PHP: 7.2.5
    6 Stable Tag: 1.0.4
    7 Version: 1.0.4
     6Stable Tag: 1.0.5
     7Version: 1.0.5
    88Contributors: grandplugins
    99Author: GrandPlugins
  • pdf-password-protect/trunk/vendor/autoload.php

    r2895893 r3453070  
    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
  • pdf-password-protect/trunk/vendor/composer/ClassLoader.php

    r2785060 r3453070  
    4343class ClassLoader
    4444{
     45    /** @var \Closure(string):void */
     46    private static $includeFile;
     47
     48    /** @var string|null */
     49    private $vendorDir;
     50
    4551    // PSR-4
     52    /**
     53     * @var array<string, array<string, int>>
     54     */
    4655    private $prefixLengthsPsr4 = array();
     56    /**
     57     * @var array<string, list<string>>
     58     */
    4759    private $prefixDirsPsr4 = array();
     60    /**
     61     * @var list<string>
     62     */
    4863    private $fallbackDirsPsr4 = array();
    4964
    5065    // 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     */
    5173    private $prefixesPsr0 = array();
     74    /**
     75     * @var list<string>
     76     */
    5277    private $fallbackDirsPsr0 = array();
    5378
     79    /** @var bool */
    5480    private $useIncludePath = false;
     81
     82    /**
     83     * @var array<string, string>
     84     */
    5585    private $classMap = array();
     86
     87    /** @var bool */
    5688    private $classMapAuthoritative = false;
     89
     90    /**
     91     * @var array<string, bool>
     92     */
    5793    private $missingClasses = array();
     94
     95    /** @var string|null */
    5896    private $apcuPrefix;
    5997
     98    /**
     99     * @var array<string, self>
     100     */
     101    private static $registeredLoaders = array();
     102
     103    /**
     104     * @param string|null $vendorDir
     105     */
     106    public function __construct($vendorDir = null)
     107    {
     108        $this->vendorDir = $vendorDir;
     109        self::initializeIncludeClosure();
     110    }
     111
     112    /**
     113     * @return array<string, list<string>>
     114     */
    60115    public function getPrefixes()
    61116    {
     
    67122    }
    68123
     124    /**
     125     * @return array<string, list<string>>
     126     */
    69127    public function getPrefixesPsr4()
    70128    {
     
    72130    }
    73131
     132    /**
     133     * @return list<string>
     134     */
    74135    public function getFallbackDirs()
    75136    {
     
    77138    }
    78139
     140    /**
     141     * @return list<string>
     142     */
    79143    public function getFallbackDirsPsr4()
    80144    {
     
    82146    }
    83147
     148    /**
     149     * @return array<string, string> Array of classname => path
     150     */
    84151    public function getClassMap()
    85152    {
     
    88155
    89156    /**
    90      * @param array $classMap Class to filename map
     157     * @param array<string, string> $classMap Class to filename map
     158     *
     159     * @return void
    91160     */
    92161    public function addClassMap(array $classMap)
     
    103172     * appending or prepending to the ones previously set for this prefix.
    104173     *
    105      * @param string       $prefix  The prefix
    106      * @param array|string $paths   The PSR-0 root directories
    107      * @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
    108179     */
    109180    public function add($prefix, $paths, $prepend = false)
    110181    {
     182        $paths = (array) $paths;
    111183        if (!$prefix) {
    112184            if ($prepend) {
    113185                $this->fallbackDirsPsr0 = array_merge(
    114                     (array) $paths,
     186                    $paths,
    115187                    $this->fallbackDirsPsr0
    116188                );
     
    118190                $this->fallbackDirsPsr0 = array_merge(
    119191                    $this->fallbackDirsPsr0,
    120                     (array) $paths
     192                    $paths
    121193                );
    122194            }
     
    127199        $first = $prefix[0];
    128200        if (!isset($this->prefixesPsr0[$first][$prefix])) {
    129             $this->prefixesPsr0[$first][$prefix] = (array) $paths;
     201            $this->prefixesPsr0[$first][$prefix] = $paths;
    130202
    131203            return;
     
    133205        if ($prepend) {
    134206            $this->prefixesPsr0[$first][$prefix] = array_merge(
    135                 (array) $paths,
     207                $paths,
    136208                $this->prefixesPsr0[$first][$prefix]
    137209            );
     
    139211            $this->prefixesPsr0[$first][$prefix] = array_merge(
    140212                $this->prefixesPsr0[$first][$prefix],
    141                 (array) $paths
     213                $paths
    142214            );
    143215        }
     
    148220     * appending or prepending to the ones previously set for this namespace.
    149221     *
    150      * @param string       $prefix  The prefix/namespace, with trailing '\\'
    151      * @param array|string $paths   The PSR-4 base directories
    152      * @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
    153225     *
    154226     * @throws \InvalidArgumentException
     227     *
     228     * @return void
    155229     */
    156230    public function addPsr4($prefix, $paths, $prepend = false)
    157231    {
     232        $paths = (array) $paths;
    158233        if (!$prefix) {
    159234            // Register directories for the root namespace.
    160235            if ($prepend) {
    161236                $this->fallbackDirsPsr4 = array_merge(
    162                     (array) $paths,
     237                    $paths,
    163238                    $this->fallbackDirsPsr4
    164239                );
     
    166241                $this->fallbackDirsPsr4 = array_merge(
    167242                    $this->fallbackDirsPsr4,
    168                     (array) $paths
     243                    $paths
    169244                );
    170245            }
     
    176251            }
    177252            $this->prefixLengthsPsr4[$prefix[0]][$prefix] = $length;
    178             $this->prefixDirsPsr4[$prefix] = (array) $paths;
     253            $this->prefixDirsPsr4[$prefix] = $paths;
    179254        } elseif ($prepend) {
    180255            // Prepend directories for an already registered namespace.
    181256            $this->prefixDirsPsr4[$prefix] = array_merge(
    182                 (array) $paths,
     257                $paths,
    183258                $this->prefixDirsPsr4[$prefix]
    184259            );
     
    187262            $this->prefixDirsPsr4[$prefix] = array_merge(
    188263                $this->prefixDirsPsr4[$prefix],
    189                 (array) $paths
     264                $paths
    190265            );
    191266        }
     
    196271     * replacing any others previously set for this prefix.
    197272     *
    198      * @param string       $prefix The prefix
    199      * @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
    200277     */
    201278    public function set($prefix, $paths)
     
    212289     * replacing any others previously set for this namespace.
    213290     *
    214      * @param string       $prefix The prefix/namespace, with trailing '\\'
    215      * @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
    216293     *
    217294     * @throws \InvalidArgumentException
     295     *
     296     * @return void
    218297     */
    219298    public function setPsr4($prefix, $paths)
     
    235314     *
    236315     * @param bool $useIncludePath
     316     *
     317     * @return void
    237318     */
    238319    public function setUseIncludePath($useIncludePath)
     
    257338     *
    258339     * @param bool $classMapAuthoritative
     340     *
     341     * @return void
    259342     */
    260343    public function setClassMapAuthoritative($classMapAuthoritative)
     
    277360     *
    278361     * @param string|null $apcuPrefix
     362     *
     363     * @return void
    279364     */
    280365    public function setApcuPrefix($apcuPrefix)
     
    297382     *
    298383     * @param bool $prepend Whether to prepend the autoloader or not
     384     *
     385     * @return void
    299386     */
    300387    public function register($prepend = false)
    301388    {
    302389        spl_autoload_register(array($this, 'loadClass'), true, $prepend);
     390
     391        if (null === $this->vendorDir) {
     392            return;
     393        }
     394
     395        if ($prepend) {
     396            self::$registeredLoaders = array($this->vendorDir => $this) + self::$registeredLoaders;
     397        } else {
     398            unset(self::$registeredLoaders[$this->vendorDir]);
     399            self::$registeredLoaders[$this->vendorDir] = $this;
     400        }
    303401    }
    304402
    305403    /**
    306404     * Unregisters this instance as an autoloader.
     405     *
     406     * @return void
    307407     */
    308408    public function unregister()
    309409    {
    310410        spl_autoload_unregister(array($this, 'loadClass'));
     411
     412        if (null !== $this->vendorDir) {
     413            unset(self::$registeredLoaders[$this->vendorDir]);
     414        }
    311415    }
    312416
     
    315419     *
    316420     * @param  string    $class The name of the class
    317      * @return bool|null True if loaded, null otherwise
     421     * @return true|null True if loaded, null otherwise
    318422     */
    319423    public function loadClass($class)
    320424    {
    321425        if ($file = $this->findFile($class)) {
    322             includeFile($file);
     426            $includeFile = self::$includeFile;
     427            $includeFile($file);
    323428
    324429            return true;
    325430        }
     431
     432        return null;
    326433    }
    327434
     
    368475    }
    369476
     477    /**
     478     * Returns the currently registered loaders keyed by their corresponding vendor directories.
     479     *
     480     * @return array<string, self>
     481     */
     482    public static function getRegisteredLoaders()
     483    {
     484        return self::$registeredLoaders;
     485    }
     486
     487    /**
     488     * @param  string       $class
     489     * @param  string       $ext
     490     * @return string|false
     491     */
    370492    private function findFileWithExtension($class, $ext)
    371493    {
     
    433555        return false;
    434556    }
     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    }
    435579}
    436 
    437 /**
    438  * Scope isolated include.
    439  *
    440  * Prevents access to $this/self from included files.
    441  */
    442 function includeFile($file)
    443 {
    444     include $file;
    445 }
  • pdf-password-protect/trunk/vendor/composer/autoload_classmap.php

    r2895893 r3453070  
    33// autoload_classmap.php @generated by Composer
    44
    5 $vendorDir = dirname(dirname(__FILE__));
     5$vendorDir = dirname(__DIR__);
    66$baseDir = dirname($vendorDir);
    77
     
    1010    'Composer\\InstalledVersions' => $vendorDir . '/composer/InstalledVersions.php',
    1111    'FPDF' => $vendorDir . '/setasign/fpdf/fpdf.php',
     12    'GPLSCore\\GPLS_PLUGIN_PSRPDF\\Base' => $baseDir . '/includes/Base.php',
    1213    'GPLSCore\\GPLS_PLUGIN_PSRPDF\\Core' => $baseDir . '/core/core.php',
    1314    'GPLSCore\\GPLS_PLUGIN_PSRPDF\\FPDI_Wrapper' => $baseDir . '/includes/class-fpdi-wrapper.php',
  • pdf-password-protect/trunk/vendor/composer/autoload_files.php

    r2895893 r3453070  
    33// autoload_files.php @generated by Composer
    44
    5 $vendorDir = dirname(dirname(__FILE__));
     5$vendorDir = dirname(__DIR__);
    66$baseDir = dirname($vendorDir);
    77
  • pdf-password-protect/trunk/vendor/composer/autoload_namespaces.php

    r2785060 r3453070  
    33// autoload_namespaces.php @generated by Composer
    44
    5 $vendorDir = dirname(dirname(__FILE__));
     5$vendorDir = dirname(__DIR__);
    66$baseDir = dirname($vendorDir);
    77
  • pdf-password-protect/trunk/vendor/composer/autoload_psr4.php

    r2785060 r3453070  
    33// autoload_psr4.php @generated by Composer
    44
    5 $vendorDir = dirname(dirname(__FILE__));
     5$vendorDir = dirname(__DIR__);
    66$baseDir = dirname($vendorDir);
    77
  • pdf-password-protect/trunk/vendor/composer/autoload_real.php

    r2895893 r3453070  
    2626
    2727        spl_autoload_register(array('ComposerAutoloaderInit5551fb3f78da44412b00b46a010ee23e', 'loadClassLoader'), true, true);
    28         self::$loader = $loader = new \Composer\Autoload\ClassLoader();
     28        self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname(__DIR__));
    2929        spl_autoload_unregister(array('ComposerAutoloaderInit5551fb3f78da44412b00b46a010ee23e', 'loadClassLoader'));
    3030
    31         $useStaticLoader = PHP_VERSION_ID >= 50600 && !defined('HHVM_VERSION') && (!function_exists('zend_loader_file_encoded') || !zend_loader_file_encoded());
    32         if ($useStaticLoader) {
    33             require __DIR__ . '/autoload_static.php';
    34 
    35             call_user_func(\Composer\Autoload\ComposerStaticInit5551fb3f78da44412b00b46a010ee23e::getInitializer($loader));
    36         } else {
    37             $map = require __DIR__ . '/autoload_namespaces.php';
    38             foreach ($map as $namespace => $path) {
    39                 $loader->set($namespace, $path);
    40             }
    41 
    42             $map = require __DIR__ . '/autoload_psr4.php';
    43             foreach ($map as $namespace => $path) {
    44                 $loader->setPsr4($namespace, $path);
    45             }
    46 
    47             $classMap = require __DIR__ . '/autoload_classmap.php';
    48             if ($classMap) {
    49                 $loader->addClassMap($classMap);
    50             }
    51         }
     31        require __DIR__ . '/autoload_static.php';
     32        call_user_func(\Composer\Autoload\ComposerStaticInit5551fb3f78da44412b00b46a010ee23e::getInitializer($loader));
    5233
    5334        $loader->register(true);
    5435
    55         if ($useStaticLoader) {
    56             $includeFiles = Composer\Autoload\ComposerStaticInit5551fb3f78da44412b00b46a010ee23e::$files;
    57         } else {
    58             $includeFiles = require __DIR__ . '/autoload_files.php';
    59         }
    60         foreach ($includeFiles as $fileIdentifier => $file) {
    61             composerRequire5551fb3f78da44412b00b46a010ee23e($fileIdentifier, $file);
     36        $filesToLoad = \Composer\Autoload\ComposerStaticInit5551fb3f78da44412b00b46a010ee23e::$files;
     37        $requireFile = \Closure::bind(static function ($fileIdentifier, $file) {
     38            if (empty($GLOBALS['__composer_autoload_files'][$fileIdentifier])) {
     39                $GLOBALS['__composer_autoload_files'][$fileIdentifier] = true;
     40
     41                require $file;
     42            }
     43        }, null, null);
     44        foreach ($filesToLoad as $fileIdentifier => $file) {
     45            $requireFile($fileIdentifier, $file);
    6246        }
    6347
     
    6549    }
    6650}
    67 
    68 function composerRequire5551fb3f78da44412b00b46a010ee23e($fileIdentifier, $file)
    69 {
    70     if (empty($GLOBALS['__composer_autoload_files'][$fileIdentifier])) {
    71         require $file;
    72 
    73         $GLOBALS['__composer_autoload_files'][$fileIdentifier] = true;
    74     }
    75 }
  • pdf-password-protect/trunk/vendor/composer/autoload_static.php

    r2895893 r3453070  
    6868        'Composer\\InstalledVersions' => __DIR__ . '/..' . '/composer/InstalledVersions.php',
    6969        'FPDF' => __DIR__ . '/..' . '/setasign/fpdf/fpdf.php',
     70        'GPLSCore\\GPLS_PLUGIN_PSRPDF\\Base' => __DIR__ . '/../..' . '/includes/Base.php',
    7071        'GPLSCore\\GPLS_PLUGIN_PSRPDF\\Core' => __DIR__ . '/../..' . '/core/core.php',
    7172        'GPLSCore\\GPLS_PLUGIN_PSRPDF\\FPDI_Wrapper' => __DIR__ . '/../..' . '/includes/class-fpdi-wrapper.php',
Note: See TracChangeset for help on using the changeset viewer.