Plugin Directory

Changeset 3253378


Ignore:
Timestamp:
03/10/2025 02:23:53 PM (13 months ago)
Author:
andyexeter
Message:

Update to version 4.0.3 from GitHub

Location:
post-lockdown
Files:
8 added
4 deleted
10 edited
1 copied

Legend:

Unmodified
Added
Removed
  • post-lockdown/tags/4.0.3/post-lockdown.php

    r3197624 r3253378  
    44 * Plugin URI: https://github.com/andyexeter/post-lockdown
    55 * Description: Allows admins to protect selected posts and pages so they cannot be trashed or deleted by non-admin users.
    6  * Version: 4.0.2
     6 * Version: 4.0.3
    77 * Requires at least: 4.6
    88 * Requires PHP: 7.4
  • post-lockdown/tags/4.0.3/readme.txt

    r3197624 r3253378  
    55Requires at least: 4.6
    66Tested up to: 6.7
    7 Stable tag: 4.0.2
     7Stable tag: 4.0.3
    88License: GPLv2 or later
    99License URI: http://www.gnu.org/licenses/gpl-2.0.html
     
    6969
    7070= 4.0.2 =
    71 
    72 * Fixed a warning in WordPress 6.7 related to loading translations to early
     71* Fixed a warning in WordPress 6.7 related to loading translations too early
    7372
    7473= 4.0 =
  • post-lockdown/tags/4.0.3/src/PostLockdown/OptionsPage.php

    r3076973 r3253378  
    55class OptionsPage
    66{
    7     public const PAGE_TITLE = 'Post Lockdown';
     7    public const PAGE_TITLE  = 'Post Lockdown';
     8    public const AJAX_ACTION = 'pl_autocomplete';
    89    /** @var string Page hook returned by add_options_page(). */
    910    private $page_hook;
     
    1920
    2021        add_action('admin_enqueue_scripts', [$this, '_enqueue_scripts']);
    21         add_action('wp_ajax_pl_autocomplete', [$this, '_ajax_autocomplete']);
     22        add_action(sprintf('wp_ajax_%s', self::AJAX_ACTION), [$this, '_ajax_autocomplete']);
    2223
    2324        add_filter('option_page_capability_' . PostLockdown::KEY, [$this->postlockdown, 'get_admin_cap']);
     
    8788    public function _ajax_autocomplete()
    8889    {
     90        check_ajax_referer(self::AJAX_ACTION);
     91
     92        if (!current_user_can($this->postlockdown->get_admin_cap())) {
     93            wp_send_json_error(null, 403);
     94        }
     95
    8996        $posts = $this->postlockdown->get_posts([
    9097            's'              => $_REQUEST['term'],
     
    111118
    112119        $assets_path = $this->postlockdown->plugin_url . 'view/assets/';
    113         $extension   = (\defined('SCRIPT_DEBUG') && SCRIPT_DEBUG) ? '' : '.min';
    114120
    115         wp_enqueue_style(PostLockdown::KEY, $assets_path . 'css/postlockdown' . $extension . '.css', null, null);
    116         wp_enqueue_script(PostLockdown::KEY, $assets_path . 'js/postlockdown' . $extension . '.js', ['jquery-ui-autocomplete'], null, true);
     121        wp_enqueue_style(PostLockdown::KEY, $assets_path . 'postlockdown.css', null, null);
     122        wp_enqueue_script(PostLockdown::KEY, $assets_path . 'postlockdown.js', ['jquery-ui-autocomplete'], null, true);
    117123
    118124        $posts = $this->postlockdown->get_posts([
  • post-lockdown/tags/4.0.3/src/PostLockdown/PostLockdown.php

    r3197624 r3253378  
    77    /** Plugin key for options and the option page. */
    88    public const KEY     = 'postlockdown';
    9     public const VERSION = '4.0.2';
     9    public const VERSION = '4.0.3';
    1010
    1111    /** @var array List of post IDs which cannot be edited, trashed or deleted. */
  • post-lockdown/tags/4.0.3/view/options-page.php

    r3076973 r3253378  
    66            <?php esc_html_e('Select locked and protected posts by adding them to the boxes on the right. Use the search field to filter the list of posts.', 'post-lockdown'); ?>
    77        </p>
    8         <table class="form-table">
     8        <table class="form-table" data-ajax_action="<?= PostLockdown\OptionsPage::AJAX_ACTION; ?>" data-ajax_nonce="<?= esc_attr(wp_create_nonce(PostLockdown\OptionsPage::AJAX_ACTION)); ?>">
    99            <tbody>
    1010            <?php foreach ($blocks as $block): ?>
  • post-lockdown/trunk/post-lockdown.php

    r3197624 r3253378  
    44 * Plugin URI: https://github.com/andyexeter/post-lockdown
    55 * Description: Allows admins to protect selected posts and pages so they cannot be trashed or deleted by non-admin users.
    6  * Version: 4.0.2
     6 * Version: 4.0.3
    77 * Requires at least: 4.6
    88 * Requires PHP: 7.4
  • post-lockdown/trunk/readme.txt

    r3197624 r3253378  
    55Requires at least: 4.6
    66Tested up to: 6.7
    7 Stable tag: 4.0.2
     7Stable tag: 4.0.3
    88License: GPLv2 or later
    99License URI: http://www.gnu.org/licenses/gpl-2.0.html
     
    6969
    7070= 4.0.2 =
    71 
    72 * Fixed a warning in WordPress 6.7 related to loading translations to early
     71* Fixed a warning in WordPress 6.7 related to loading translations too early
    7372
    7473= 4.0 =
  • post-lockdown/trunk/src/PostLockdown/OptionsPage.php

    r3076973 r3253378  
    55class OptionsPage
    66{
    7     public const PAGE_TITLE = 'Post Lockdown';
     7    public const PAGE_TITLE  = 'Post Lockdown';
     8    public const AJAX_ACTION = 'pl_autocomplete';
    89    /** @var string Page hook returned by add_options_page(). */
    910    private $page_hook;
     
    1920
    2021        add_action('admin_enqueue_scripts', [$this, '_enqueue_scripts']);
    21         add_action('wp_ajax_pl_autocomplete', [$this, '_ajax_autocomplete']);
     22        add_action(sprintf('wp_ajax_%s', self::AJAX_ACTION), [$this, '_ajax_autocomplete']);
    2223
    2324        add_filter('option_page_capability_' . PostLockdown::KEY, [$this->postlockdown, 'get_admin_cap']);
     
    8788    public function _ajax_autocomplete()
    8889    {
     90        check_ajax_referer(self::AJAX_ACTION);
     91
     92        if (!current_user_can($this->postlockdown->get_admin_cap())) {
     93            wp_send_json_error(null, 403);
     94        }
     95
    8996        $posts = $this->postlockdown->get_posts([
    9097            's'              => $_REQUEST['term'],
     
    111118
    112119        $assets_path = $this->postlockdown->plugin_url . 'view/assets/';
    113         $extension   = (\defined('SCRIPT_DEBUG') && SCRIPT_DEBUG) ? '' : '.min';
    114120
    115         wp_enqueue_style(PostLockdown::KEY, $assets_path . 'css/postlockdown' . $extension . '.css', null, null);
    116         wp_enqueue_script(PostLockdown::KEY, $assets_path . 'js/postlockdown' . $extension . '.js', ['jquery-ui-autocomplete'], null, true);
     121        wp_enqueue_style(PostLockdown::KEY, $assets_path . 'postlockdown.css', null, null);
     122        wp_enqueue_script(PostLockdown::KEY, $assets_path . 'postlockdown.js', ['jquery-ui-autocomplete'], null, true);
    117123
    118124        $posts = $this->postlockdown->get_posts([
  • post-lockdown/trunk/src/PostLockdown/PostLockdown.php

    r3197624 r3253378  
    77    /** Plugin key for options and the option page. */
    88    public const KEY     = 'postlockdown';
    9     public const VERSION = '4.0.2';
     9    public const VERSION = '4.0.3';
    1010
    1111    /** @var array List of post IDs which cannot be edited, trashed or deleted. */
  • post-lockdown/trunk/view/options-page.php

    r3076973 r3253378  
    66            <?php esc_html_e('Select locked and protected posts by adding them to the boxes on the right. Use the search field to filter the list of posts.', 'post-lockdown'); ?>
    77        </p>
    8         <table class="form-table">
     8        <table class="form-table" data-ajax_action="<?= PostLockdown\OptionsPage::AJAX_ACTION; ?>" data-ajax_nonce="<?= esc_attr(wp_create_nonce(PostLockdown\OptionsPage::AJAX_ACTION)); ?>">
    99            <tbody>
    1010            <?php foreach ($blocks as $block): ?>
Note: See TracChangeset for help on using the changeset viewer.