Plugin Directory

Changeset 2744970


Ignore:
Timestamp:
06/20/2022 05:30:42 AM (4 years ago)
Author:
bebjakub
Message:

Update to version 1.0.4 from GitHub

Location:
on-demand-revalidation
Files:
12 edited
1 copied

Legend:

Unmodified
Added
Removed
  • on-demand-revalidation/tags/1.0.4/on-demand-revalidation.php

    r2744965 r2744970  
    44 *
    55 * Plugin Name:         On-Demand Revalidation
    6  * Plugin URI:          https://github.com/gdidentity/on-demand-revalidation
     6 * Plugin URI:          https://wordpress.org/plugins/on-demand-revalidation
    77 * GitHub Plugin URI:   https://github.com/gdidentity/on-demand-revalidation
    88 * Description:         Next.js On-Demand Revalidation on the post update, revalidate specific paths on the post update.
    9  * Version:             1.0.3
     9 * Version:             1.0.4
    1010 * Author:              GD IDENTITY
    1111 * Author URI:          https://gdidentity.sk
     
    116116            // Plugin version.
    117117            if ( ! defined( 'ON_DEMAND_REVALIDATION_VERSION' ) ) {
    118                 define( 'ON_DEMAND_REVALIDATION_VERSION', '1.0.3' );
     118                define( 'ON_DEMAND_REVALIDATION_VERSION', '1.0.4' );
    119119            }
    120120
  • on-demand-revalidation/tags/1.0.4/readme.txt

    r2744965 r2744970  
    44Requires at least: 4.7
    55Tested up to: 6.0
    6 Stable tag: 1.0.3
     6Stable tag: 1.0.4
    77Requires PHP: 5.6
    88License: GPL-3
     
    1313Next.js On-Demand Revalidation for Wordpress on the post update, revalidate specific paths on the post update.
    1414
     15Feel free to create PR to https://github.com/gdidentity/on-demand-revalidation.
     16
    1517== Installation ==
    1618
     
    18202. Click the “Install Now” button, followed by "Activate".
    19213. Add Next.js URL and Revalidate Secret Key in the Settings -> Next.js On-Demand Revalidation
    20 4. In your Next.js project add new file `/pages/api/revalidate.ts` with this code:
    21 ```
    22 import { NextApiRequest, NextApiResponse } from "next"
    23 
    24 export default async function handler(req: NextApiRequest, res: NextApiResponse) {
    25     const {
    26         body: { paths },
    27         method,
    28     } = req
    29 
    30     if (req.headers.authorization !== `Bearer ${process.env.REVALIDATE_SECRET_KEY}`) {
    31         return res.status(401).json({ message: 'Invalid token' })
    32     }
    33 
    34     if (method !== 'PUT') {
    35         return res.status(405).json({ message: `Method ${method} Not Allowed` })
    36     }
    37 
    38     if (!paths) {
    39         return res.status(412).json({ message: 'No paths' })
    40     }
    41 
    42     try {
    43         const revalidatePaths = paths
    44             .filter((path: string) => path.startsWith('/'))
    45             .map((path: string) => res.unstable_revalidate(
    46                 path,
    47                 { unstable_onlyGenerated: false }
    48             ));
    49 
    50         await Promise.all(revalidatePaths);
    51 
    52         return res.json({ revalidated: true, message: 'Paths revalidated' })
    53 
    54     } catch (err) {
    55 
    56         return res.status(500).json({ message: err.message })
    57     }
    58 }
    59 ```
     224. In your Next.js project add a new file `/pages/api/revalidate.ts` with a code snippet, you'll find [here](https://github.com/gdidentity/on-demand-revalidation).
    60235. Add `REVALIDATE_SECRET_KEY` env variable to your Next.js with Revalidate Secret Key value you added in the Plugin Settings.
    6124
    62 === Development ===
    63 
    64 Feel free to create PR to https://github.com/gdidentity/on-demand-revalidation.
    6525
    6626== Changelog ==
    6727
    68 
    69 = 1.0.3 =
     28= 1.0.4 =
    7029- publish plugin
  • on-demand-revalidation/tags/1.0.4/vendor/autoload.php

    r2744965 r2744970  
    1010require_once __DIR__ . '/composer/autoload_real.php';
    1111
    12 return ComposerAutoloaderInitbf69715a6cfc144ba848678e0a080558::getLoader();
     12return ComposerAutoloaderInite7e9d8b9dcc139583013a53e85289027::getLoader();
  • on-demand-revalidation/tags/1.0.4/vendor/composer/autoload_real.php

    r2744965 r2744970  
    33// autoload_real.php @generated by Composer
    44
    5 class ComposerAutoloaderInitbf69715a6cfc144ba848678e0a080558
     5class ComposerAutoloaderInite7e9d8b9dcc139583013a53e85289027
    66{
    77    private static $loader;
     
    2323        }
    2424
    25         spl_autoload_register(array('ComposerAutoloaderInitbf69715a6cfc144ba848678e0a080558', 'loadClassLoader'), true, true);
     25        spl_autoload_register(array('ComposerAutoloaderInite7e9d8b9dcc139583013a53e85289027', 'loadClassLoader'), true, true);
    2626        self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname(__DIR__));
    27         spl_autoload_unregister(array('ComposerAutoloaderInitbf69715a6cfc144ba848678e0a080558', 'loadClassLoader'));
     27        spl_autoload_unregister(array('ComposerAutoloaderInite7e9d8b9dcc139583013a53e85289027', 'loadClassLoader'));
    2828
    2929        require __DIR__ . '/autoload_static.php';
    30         call_user_func(\Composer\Autoload\ComposerStaticInitbf69715a6cfc144ba848678e0a080558::getInitializer($loader));
     30        call_user_func(\Composer\Autoload\ComposerStaticInite7e9d8b9dcc139583013a53e85289027::getInitializer($loader));
    3131
    3232        $loader->register(true);
  • on-demand-revalidation/tags/1.0.4/vendor/composer/autoload_static.php

    r2744965 r2744970  
    55namespace Composer\Autoload;
    66
    7 class ComposerStaticInitbf69715a6cfc144ba848678e0a080558
     7class ComposerStaticInite7e9d8b9dcc139583013a53e85289027
    88{
    99    public static $prefixLengthsPsr4 = array (
     
    3232    {
    3333        return \Closure::bind(function () use ($loader) {
    34             $loader->prefixLengthsPsr4 = ComposerStaticInitbf69715a6cfc144ba848678e0a080558::$prefixLengthsPsr4;
    35             $loader->prefixDirsPsr4 = ComposerStaticInitbf69715a6cfc144ba848678e0a080558::$prefixDirsPsr4;
    36             $loader->classMap = ComposerStaticInitbf69715a6cfc144ba848678e0a080558::$classMap;
     34            $loader->prefixLengthsPsr4 = ComposerStaticInite7e9d8b9dcc139583013a53e85289027::$prefixLengthsPsr4;
     35            $loader->prefixDirsPsr4 = ComposerStaticInite7e9d8b9dcc139583013a53e85289027::$prefixDirsPsr4;
     36            $loader->classMap = ComposerStaticInite7e9d8b9dcc139583013a53e85289027::$classMap;
    3737
    3838        }, null, ClassLoader::class);
  • on-demand-revalidation/tags/1.0.4/vendor/composer/installed.php

    r2744965 r2744970  
    22    'root' => array(
    33        'name' => 'gdidentity/on-demand-revalidation',
    4         'pretty_version' => '1.0.3',
    5         'version' => '1.0.3.0',
    6         'reference' => '875ff3bf5d16ce060fc4121195354ed6cb7e840c',
     4        'pretty_version' => '1.0.4',
     5        'version' => '1.0.4.0',
     6        'reference' => '57a9a95c230180e9d82010b0f91d38ef579edb69',
    77        'type' => 'wordpress-plugin',
    88        'install_path' => __DIR__ . '/../../',
     
    1212    'versions' => array(
    1313        'gdidentity/on-demand-revalidation' => array(
    14             'pretty_version' => '1.0.3',
    15             'version' => '1.0.3.0',
    16             'reference' => '875ff3bf5d16ce060fc4121195354ed6cb7e840c',
     14            'pretty_version' => '1.0.4',
     15            'version' => '1.0.4.0',
     16            'reference' => '57a9a95c230180e9d82010b0f91d38ef579edb69',
    1717            'type' => 'wordpress-plugin',
    1818            'install_path' => __DIR__ . '/../../',
  • on-demand-revalidation/trunk/on-demand-revalidation.php

    r2744965 r2744970  
    44 *
    55 * Plugin Name:         On-Demand Revalidation
    6  * Plugin URI:          https://github.com/gdidentity/on-demand-revalidation
     6 * Plugin URI:          https://wordpress.org/plugins/on-demand-revalidation
    77 * GitHub Plugin URI:   https://github.com/gdidentity/on-demand-revalidation
    88 * Description:         Next.js On-Demand Revalidation on the post update, revalidate specific paths on the post update.
    9  * Version:             1.0.3
     9 * Version:             1.0.4
    1010 * Author:              GD IDENTITY
    1111 * Author URI:          https://gdidentity.sk
     
    116116            // Plugin version.
    117117            if ( ! defined( 'ON_DEMAND_REVALIDATION_VERSION' ) ) {
    118                 define( 'ON_DEMAND_REVALIDATION_VERSION', '1.0.3' );
     118                define( 'ON_DEMAND_REVALIDATION_VERSION', '1.0.4' );
    119119            }
    120120
  • on-demand-revalidation/trunk/readme.txt

    r2744965 r2744970  
    44Requires at least: 4.7
    55Tested up to: 6.0
    6 Stable tag: 1.0.3
     6Stable tag: 1.0.4
    77Requires PHP: 5.6
    88License: GPL-3
     
    1313Next.js On-Demand Revalidation for Wordpress on the post update, revalidate specific paths on the post update.
    1414
     15Feel free to create PR to https://github.com/gdidentity/on-demand-revalidation.
     16
    1517== Installation ==
    1618
     
    18202. Click the “Install Now” button, followed by "Activate".
    19213. Add Next.js URL and Revalidate Secret Key in the Settings -> Next.js On-Demand Revalidation
    20 4. In your Next.js project add new file `/pages/api/revalidate.ts` with this code:
    21 ```
    22 import { NextApiRequest, NextApiResponse } from "next"
    23 
    24 export default async function handler(req: NextApiRequest, res: NextApiResponse) {
    25     const {
    26         body: { paths },
    27         method,
    28     } = req
    29 
    30     if (req.headers.authorization !== `Bearer ${process.env.REVALIDATE_SECRET_KEY}`) {
    31         return res.status(401).json({ message: 'Invalid token' })
    32     }
    33 
    34     if (method !== 'PUT') {
    35         return res.status(405).json({ message: `Method ${method} Not Allowed` })
    36     }
    37 
    38     if (!paths) {
    39         return res.status(412).json({ message: 'No paths' })
    40     }
    41 
    42     try {
    43         const revalidatePaths = paths
    44             .filter((path: string) => path.startsWith('/'))
    45             .map((path: string) => res.unstable_revalidate(
    46                 path,
    47                 { unstable_onlyGenerated: false }
    48             ));
    49 
    50         await Promise.all(revalidatePaths);
    51 
    52         return res.json({ revalidated: true, message: 'Paths revalidated' })
    53 
    54     } catch (err) {
    55 
    56         return res.status(500).json({ message: err.message })
    57     }
    58 }
    59 ```
     224. In your Next.js project add a new file `/pages/api/revalidate.ts` with a code snippet, you'll find [here](https://github.com/gdidentity/on-demand-revalidation).
    60235. Add `REVALIDATE_SECRET_KEY` env variable to your Next.js with Revalidate Secret Key value you added in the Plugin Settings.
    6124
    62 === Development ===
    63 
    64 Feel free to create PR to https://github.com/gdidentity/on-demand-revalidation.
    6525
    6626== Changelog ==
    6727
    68 
    69 = 1.0.3 =
     28= 1.0.4 =
    7029- publish plugin
  • on-demand-revalidation/trunk/vendor/autoload.php

    r2744965 r2744970  
    1010require_once __DIR__ . '/composer/autoload_real.php';
    1111
    12 return ComposerAutoloaderInitbf69715a6cfc144ba848678e0a080558::getLoader();
     12return ComposerAutoloaderInite7e9d8b9dcc139583013a53e85289027::getLoader();
  • on-demand-revalidation/trunk/vendor/composer/autoload_real.php

    r2744965 r2744970  
    33// autoload_real.php @generated by Composer
    44
    5 class ComposerAutoloaderInitbf69715a6cfc144ba848678e0a080558
     5class ComposerAutoloaderInite7e9d8b9dcc139583013a53e85289027
    66{
    77    private static $loader;
     
    2323        }
    2424
    25         spl_autoload_register(array('ComposerAutoloaderInitbf69715a6cfc144ba848678e0a080558', 'loadClassLoader'), true, true);
     25        spl_autoload_register(array('ComposerAutoloaderInite7e9d8b9dcc139583013a53e85289027', 'loadClassLoader'), true, true);
    2626        self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname(__DIR__));
    27         spl_autoload_unregister(array('ComposerAutoloaderInitbf69715a6cfc144ba848678e0a080558', 'loadClassLoader'));
     27        spl_autoload_unregister(array('ComposerAutoloaderInite7e9d8b9dcc139583013a53e85289027', 'loadClassLoader'));
    2828
    2929        require __DIR__ . '/autoload_static.php';
    30         call_user_func(\Composer\Autoload\ComposerStaticInitbf69715a6cfc144ba848678e0a080558::getInitializer($loader));
     30        call_user_func(\Composer\Autoload\ComposerStaticInite7e9d8b9dcc139583013a53e85289027::getInitializer($loader));
    3131
    3232        $loader->register(true);
  • on-demand-revalidation/trunk/vendor/composer/autoload_static.php

    r2744965 r2744970  
    55namespace Composer\Autoload;
    66
    7 class ComposerStaticInitbf69715a6cfc144ba848678e0a080558
     7class ComposerStaticInite7e9d8b9dcc139583013a53e85289027
    88{
    99    public static $prefixLengthsPsr4 = array (
     
    3232    {
    3333        return \Closure::bind(function () use ($loader) {
    34             $loader->prefixLengthsPsr4 = ComposerStaticInitbf69715a6cfc144ba848678e0a080558::$prefixLengthsPsr4;
    35             $loader->prefixDirsPsr4 = ComposerStaticInitbf69715a6cfc144ba848678e0a080558::$prefixDirsPsr4;
    36             $loader->classMap = ComposerStaticInitbf69715a6cfc144ba848678e0a080558::$classMap;
     34            $loader->prefixLengthsPsr4 = ComposerStaticInite7e9d8b9dcc139583013a53e85289027::$prefixLengthsPsr4;
     35            $loader->prefixDirsPsr4 = ComposerStaticInite7e9d8b9dcc139583013a53e85289027::$prefixDirsPsr4;
     36            $loader->classMap = ComposerStaticInite7e9d8b9dcc139583013a53e85289027::$classMap;
    3737
    3838        }, null, ClassLoader::class);
  • on-demand-revalidation/trunk/vendor/composer/installed.php

    r2744965 r2744970  
    22    'root' => array(
    33        'name' => 'gdidentity/on-demand-revalidation',
    4         'pretty_version' => '1.0.3',
    5         'version' => '1.0.3.0',
    6         'reference' => '875ff3bf5d16ce060fc4121195354ed6cb7e840c',
     4        'pretty_version' => '1.0.4',
     5        'version' => '1.0.4.0',
     6        'reference' => '57a9a95c230180e9d82010b0f91d38ef579edb69',
    77        'type' => 'wordpress-plugin',
    88        'install_path' => __DIR__ . '/../../',
     
    1212    'versions' => array(
    1313        'gdidentity/on-demand-revalidation' => array(
    14             'pretty_version' => '1.0.3',
    15             'version' => '1.0.3.0',
    16             'reference' => '875ff3bf5d16ce060fc4121195354ed6cb7e840c',
     14            'pretty_version' => '1.0.4',
     15            'version' => '1.0.4.0',
     16            'reference' => '57a9a95c230180e9d82010b0f91d38ef579edb69',
    1717            'type' => 'wordpress-plugin',
    1818            'install_path' => __DIR__ . '/../../',
Note: See TracChangeset for help on using the changeset viewer.