Plugin Directory

Changeset 2730785


Ignore:
Timestamp:
05/25/2022 01:10:51 PM (4 years ago)
Author:
aware
Message:

Update to version 1.4.6 from GitHub

Location:
courier-notices
Files:
60 edited
1 copied

Legend:

Unmodified
Added
Removed
  • courier-notices/tags/1.4.6/CHANGELOG.md

    r2699180 r2730785  
    66
    77## [Unreleased]
     8
     9## [1.4.6] - 2022-05-24
     10
     11### Fixes
     12
     13- fix: Fixed an issue where user_id was not being passed in the request for notices
    814
    915## [1.4.5] - 2022-03-24
  • courier-notices/tags/1.4.6/courier-notices.php

    r2699180 r2730785  
    44 * Plugin URI:  https://wordpress.org/plugins/courier-notices
    55 * Description: A way to display, manage, and control front end notifications for your WordPress install.
    6  * Version:     1.4.5
     6 * Version:     1.4.6
    77 * Author:      Linchpin
    88 * Author URI:  https://linchpin.com
     
    2323
    2424if ( ! defined( 'COURIER_NOTICES_VERSION' ) ) {
    25     define( 'COURIER_NOTICES_VERSION', '1.4.5' );
     25    define( 'COURIER_NOTICES_VERSION', '1.4.6' );
    2626}
    2727
    2828if ( ! defined( 'COURIER_NOTICES_RELEASE_DATE' ) ) {
    29     define( 'COURIER_NOTICES_RELEASE_DATE', '03/24/2022' );
     29    define( 'COURIER_NOTICES_RELEASE_DATE', '05/24/2022' );
    3030}
    3131
  • courier-notices/tags/1.4.6/courier-notices/CHANGELOG.md

    r2699180 r2730785  
    66
    77## [Unreleased]
     8
     9## [1.4.6] - 2022-05-24
     10
     11### Fixes
     12
     13- fix: Fixed an issue where user_id was not being passed in the request for notices
    814
    915## [1.4.5] - 2022-03-24
  • courier-notices/tags/1.4.6/courier-notices/courier-notices.php

    r2699180 r2730785  
    44 * Plugin URI:  https://wordpress.org/plugins/courier-notices
    55 * Description: A way to display, manage, and control front end notifications for your WordPress install.
    6  * Version:     1.4.5
     6 * Version:     1.4.6
    77 * Author:      Linchpin
    88 * Author URI:  https://linchpin.com
     
    2323
    2424if ( ! defined( 'COURIER_NOTICES_VERSION' ) ) {
    25     define( 'COURIER_NOTICES_VERSION', '1.4.5' );
     25    define( 'COURIER_NOTICES_VERSION', '1.4.6' );
    2626}
    2727
    2828if ( ! defined( 'COURIER_NOTICES_RELEASE_DATE' ) ) {
    29     define( 'COURIER_NOTICES_RELEASE_DATE', '03/24/2022' );
     29    define( 'COURIER_NOTICES_RELEASE_DATE', '05/24/2022' );
    3030}
    3131
  • courier-notices/tags/1.4.6/courier-notices/js/courier-notices.js

    r2676712 r2730785  
    1 !function(){"use strict";var e={n:function(o){var t=o&&o.__esModule?function(){return o.default}:function(){return o};return e.d(t,{a:t}),t},d:function(o,t){for(var n in t)e.o(t,n)&&!e.o(o,n)&&Object.defineProperty(o,n,{enumerable:!0,get:t[n]})},o:function(e,o){return Object.prototype.hasOwnProperty.call(e,o)}},o=jQuery,t=e.n(o),n=function(e){return e&&decodeURIComponent(document.cookie.replace(new RegExp("(?:(?:^|.*;)\\s*"+encodeURIComponent(e).replace(/[\-\.\+\*]/g,"\\$&")+"\\s*\\=\\s*([^;]*).*$)|^.*$"),"$1"))||null},i=t(),r=t(),a=r(window),c={contentType:"application/json",placement:"popup-modal",format:"html",post_info:{}},s=function(){var e=document.querySelector('.courier-notices.courier-location-popup-modal[data-courier-ajax="true"]'),o=[];if(e){void 0!==courier_notices_data.post_info&&(c.post_info=courier_notices_data.post_info);var t=n("dismissed_notices");t=(t=JSON.parse(t))||[],r.ajax({method:"GET",beforeSend:function(e){e.setRequestHeader("X-WP-Nonce",courier_notices_data.wp_rest_nonce)},url:courier_notices_data.notices_endpoint,data:c}).done((function(e){if(e.notices){for(var n in e.notices)-1===t.indexOf(parseInt(n))&&o.push(e.notices[n]);o.length>0&&(window.courier_notices_modal_notices=o,d(0))}}))}};function d(e){var o=r(window.courier_notices_modal_notices[e]);o.hide(),o.length<1||(r('.courier-notices[data-courier-placement="'+c.placement+'"] .courier-modal-overlay').append(o),r(".courier-modal-overlay").removeClass("hide").show(),o.slideDown("fast"),window.courier_notices_modal_notices.splice(e,1))}var u=t();function p(){function e(e){u(".courier_notice[data-courier-notice-id='"+e+"']").fadeOut(500,(function(){0===window.courier_notices_modal_notices.length?u(".courier-modal-overlay").addClass("hide").hide():d(0)})),function(e){var o=n("dismissed_notices");-1===(o=(o=JSON.parse(o))||[]).indexOf(e)&&o.push(e),function(e,o,t,n,i,r){if(!e||/^(?:expires|max\-age|path|domain|secure)$/i.test(e))return!1;n||(n="/");var a="";if(t)switch(t.constructor){case Number:a=t===1/0?"; expires=Fri, 31 Dec 9999 23:59:59 GMT":"; max-age="+t;break;case String:a="; expires="+t;break;case Date:a="; expires="+t.toUTCString()}document.cookie=encodeURIComponent(e)+"="+encodeURIComponent(o)+a+(i?"; domain="+i:"")+(n?"; path="+n:"")+(r?"; secure":"")}("dismissed_notices",JSON.stringify(o))}(e)}u("body").on("click",".courier-close, .trigger-close",(function(o){var t=u(this),n=t.attr("href");if(!0!==t.data("dismiss")){o.preventDefault(),o.stopPropagation(),t.data("dismiss",!0);var i=t.parents(".courier-notice"),r=parseInt(i.data("courier-notice-id"),10);if(0===i.length||isNaN(r))return;courier_notices_data.user_id&&courier_notices_data.user_id>0?(u.post({url:courier_notices_data.notice_endpoint+r+"/dismiss",data:{dismiss_nonce:courier_notices_data.dismiss_nonce,user_id:courier_notices_data.user_id},beforeSend:function(e){e.setRequestHeader("X-WP-Nonce",courier_notices_data.wp_rest_nonce)}}).done((function(){e(r)})),n&&"#"!==n&&u(document).ajaxComplete((function(e,o,t){window.location=n}))):(e(r),n&&"#"!==n&&(window.location=n))}}))}t()((function(){var e;e=function(){var e=i('.courier-notices[data-courier-ajax="true"]');if(e.attr("data-loaded",!1),0!==e.length){var o=document.querySelectorAll('.courier-notices:not(.courier-location-popup-modal)[data-courier-ajax="true"]'),t=new IntersectionObserver((function(e,o){e.forEach((function(e){if(1===e.intersectionRatio&&"false"===e.target.getAttribute("data-loaded")){var o={contentType:"application/json",placement:e.target.getAttribute("data-courier-placement"),format:"html",post_info:{}};void 0!==courier_notices_data.post_info&&(o.post_info=courier_notices_data.post_info);var t=n("dismissed_notices");t=(t=JSON.parse(t))||[],i.ajax({method:"GET",beforeSend:function(e){"0"!==courier_notices_data.user_id&&e.setRequestHeader("X-WP-Nonce",courier_notices_data.wp_rest_nonce)},url:courier_notices_data.notices_endpoint,data:o}).success((function(e){e.notices&&i.each(e.notices,(function(n){if(-1===t.indexOf(parseInt(n))){var r=i(e.notices[n]).hide();i('.courier-notices[data-courier-placement="'+o.placement+'"]').append(r),r.slideDown("fast","swing",(function(){var e=new CustomEvent("courierNoticeDisplayed",{detail:n});document.dispatchEvent(e)}))}}))})),e.target.setAttribute("data-loaded",!0)}}))}),{threshold:1});Array.prototype.forEach.call(o,(function(e){t.observe(e)}))}},"interactive"===document.readyState||"complete"===document.readyState?e():document.addEventListener("DOMContentLoaded",e),p(),a.on("load",s)}))}();
     1!function(){"use strict";var e={n:function(o){var t=o&&o.__esModule?function(){return o.default}:function(){return o};return e.d(t,{a:t}),t},d:function(o,t){for(var n in t)e.o(t,n)&&!e.o(o,n)&&Object.defineProperty(o,n,{enumerable:!0,get:t[n]})},o:function(e,o){return Object.prototype.hasOwnProperty.call(e,o)}},o=jQuery,t=e.n(o),n=function(e){return e&&decodeURIComponent(document.cookie.replace(new RegExp("(?:(?:^|.*;)\\s*"+encodeURIComponent(e).replace(/[\-\.\+\*]/g,"\\$&")+"\\s*\\=\\s*([^;]*).*$)|^.*$"),"$1"))||null},i=t(),r=t(),a=r(window),c={contentType:"application/json",placement:"popup-modal",format:"html",post_info:{}},s=function(){var e=document.querySelector('.courier-notices.courier-location-popup-modal[data-courier-ajax="true"]'),o=[];if(e){void 0!==courier_notices_data.post_info&&(c.post_info=courier_notices_data.post_info);var t=n("dismissed_notices");t=(t=JSON.parse(t))||[],r.ajax({method:"GET",beforeSend:function(e){e.setRequestHeader("X-WP-Nonce",courier_notices_data.wp_rest_nonce)},url:courier_notices_data.notices_endpoint,data:c}).done((function(e){if(e.notices){for(var n in e.notices)-1===t.indexOf(parseInt(n))&&o.push(e.notices[n]);o.length>0&&(window.courier_notices_modal_notices=o,d(0))}}))}};function d(e){var o=r(window.courier_notices_modal_notices[e]);o.hide(),o.length<1||(r('.courier-notices[data-courier-placement="'+c.placement+'"] .courier-modal-overlay').append(o),r(".courier-modal-overlay").removeClass("hide").show(),o.slideDown("fast"),window.courier_notices_modal_notices.splice(e,1))}var u=t();function _(){function e(e){u(".courier_notice[data-courier-notice-id='"+e+"']").fadeOut(500,(function(){0===window.courier_notices_modal_notices.length?u(".courier-modal-overlay").addClass("hide").hide():d(0)})),function(e){var o=n("dismissed_notices");-1===(o=(o=JSON.parse(o))||[]).indexOf(e)&&o.push(e),function(e,o,t,n,i,r){if(!e||/^(?:expires|max\-age|path|domain|secure)$/i.test(e))return!1;n||(n="/");var a="";if(t)switch(t.constructor){case Number:a=t===1/0?"; expires=Fri, 31 Dec 9999 23:59:59 GMT":"; max-age="+t;break;case String:a="; expires="+t;break;case Date:a="; expires="+t.toUTCString()}document.cookie=encodeURIComponent(e)+"="+encodeURIComponent(o)+a+(i?"; domain="+i:"")+(n?"; path="+n:"")+(r?"; secure":"")}("dismissed_notices",JSON.stringify(o))}(e)}u("body").on("click",".courier-close, .trigger-close",(function(o){var t=u(this),n=t.attr("href");if(!0!==t.data("dismiss")){o.preventDefault(),o.stopPropagation(),t.data("dismiss",!0);var i=t.parents(".courier-notice"),r=parseInt(i.data("courier-notice-id"),10);if(0===i.length||isNaN(r))return;courier_notices_data.user_id&&courier_notices_data.user_id>0?(u.post({url:courier_notices_data.notice_endpoint+r+"/dismiss",data:{dismiss_nonce:courier_notices_data.dismiss_nonce,user_id:courier_notices_data.user_id},beforeSend:function(e){e.setRequestHeader("X-WP-Nonce",courier_notices_data.wp_rest_nonce)}}).done((function(){e(r)})),n&&"#"!==n&&u(document).ajaxComplete((function(e,o,t){window.location=n}))):(e(r),n&&"#"!==n&&(window.location=n))}}))}t()((function(){var e;e=function(){var e=i('.courier-notices[data-courier-ajax="true"]');if(e.attr("data-loaded",!1),0!==e.length){var o=document.querySelectorAll('.courier-notices:not(.courier-location-popup-modal)[data-courier-ajax="true"]'),t=new IntersectionObserver((function(e,o){e.forEach((function(e){if(1===e.intersectionRatio&&"false"===e.target.getAttribute("data-loaded")){var o={contentType:"application/json",placement:e.target.getAttribute("data-courier-placement"),format:"html",post_info:{},user_id:"0"!==courier_notices_data.user_id?courier_notices_data.user_id:""};void 0!==courier_notices_data.post_info&&(o.post_info=courier_notices_data.post_info);var t=n("dismissed_notices");t=(t=JSON.parse(t))||[],i.ajax({method:"GET",beforeSend:function(e){"0"!==courier_notices_data.user_id&&e.setRequestHeader("X-WP-Nonce",courier_notices_data.wp_rest_nonce)},url:courier_notices_data.notices_endpoint,data:o}).success((function(e){e.notices&&i.each(e.notices,(function(n){if(-1===t.indexOf(parseInt(n))){var r=i(e.notices[n]).hide();i('.courier-notices[data-courier-placement="'+o.placement+'"]').append(r),r.slideDown("fast","swing",(function(){var e=new CustomEvent("courierNoticeDisplayed",{detail:n});document.dispatchEvent(e)}))}}))})),e.target.setAttribute("data-loaded",!0)}}))}),{threshold:1});Array.prototype.forEach.call(o,(function(e){t.observe(e)}))}},"interactive"===document.readyState||"complete"===document.readyState?e():document.addEventListener("DOMContentLoaded",e),_(),a.on("load",s)}))}();
  • courier-notices/tags/1.4.6/courier-notices/output.log

    r2699180 r2730785  
    1717048644398ce6: Pulling fs layer
    1818d51a319c6584: Pulling fs layer
     191766f36e2432: Waiting
    19204c13e0891ac6: Waiting
    20 1766f36e2432: Waiting
    212196910ad0ba0c: Waiting
    22220e19de6ed54b: Waiting
    2323048644398ce6: Waiting
    2424d51a319c6584: Waiting
    25 2bc599114627: Verifying Checksum
    26 2bc599114627: Download complete
    27 7c7da25b2876: Download complete
    2825927a0b37a45a: Verifying Checksum
    2926927a0b37a45a: Download complete
     272bc599114627: Download complete
     287c7da25b2876: Verifying Checksum
     297c7da25b2876: Download complete
    30304c13e0891ac6: Verifying Checksum
    31314c13e0891ac6: Download complete
    32327c7da25b2876: Pull complete
    33 0e19de6ed54b: Download complete
     332bc599114627: Pull complete
    34341766f36e2432: Verifying Checksum
    35351766f36e2432: Download complete
    36 2bc599114627: Pull complete
     36927a0b37a45a: Pull complete
    373796910ad0ba0c: Verifying Checksum
    383896910ad0ba0c: Download complete
    39 927a0b37a45a: Pull complete
     390e19de6ed54b: Verifying Checksum
     400e19de6ed54b: Download complete
     411766f36e2432: Pull complete
     424c13e0891ac6: Pull complete
    4043048644398ce6: Verifying Checksum
    4144048644398ce6: Download complete
    42 1766f36e2432: Pull complete
    43 4c13e0891ac6: Pull complete
    4445d51a319c6584: Verifying Checksum
    4546d51a319c6584: Download complete
  • courier-notices/tags/1.4.6/courier-notices/package.json

    r2699180 r2730785  
    11{
    22    "name": "courier-notices",
    3     "version": "1.4.5",
     3    "version": "1.4.6",
    44    "description": "A way to display, manage, and control front end notifications for users, globally or individually, in the header,footer, by shortcode or by page.",
    55    "main": "gulpfile.babel.js",
     
    1616        "save-dev": "0.0.1-security",
    1717        "through2": "4.0.2",
    18         "what-input": "5.2.10"
     18        "what-input": "5.2.11"
    1919    },
    2020    "devDependencies": {
    21         "@babel/core": "7.17.2",
    22         "@babel/preset-env": "7.16.11",
    23         "@babel/register": "7.17.0",
    24         "autoprefixer": "10.4.2",
    25         "babel-loader": "8.2.3",
    26         "browser-sync": "2.27.7",
     21        "@babel/core": "7.18.0",
     22        "@babel/preset-env": "7.18.0",
     23        "@babel/register": "7.17.7",
     24        "autoprefixer": "10.4.7",
     25        "babel-loader": "8.2.5",
     26        "browser-sync": "2.27.10",
    2727        "gulp": "4.0.2",
    2828        "gulp-babel": "8.0.0",
     
    4343        "kind-of": "6.0.3",
    4444        "node-sass": "^7.0.1",
    45         "postcss": "^8.4.6",
     45        "postcss": "^8.4.14",
    4646        "rimraf": "3.0.2",
    4747        "vinyl-named": "1.1.0",
    48         "webpack": "5.68.0",
     48        "webpack": "5.72.1",
    4949        "webpack-stream": "7.0.0",
    50         "yargs": "17.3.1"
     50        "yargs": "17.5.1"
    5151    },
    5252    "repository": {
     
    5959    },
    6060    "engines": {
    61         "node": ">= 14.10.0"
     61        "node": ">= v14.19.3"
    6262    },
    6363    "browserslist": [
  • courier-notices/tags/1.4.6/courier-notices/readme.txt

    r2699180 r2730785  
    44Requires at least: 5.0
    55Tested up to: 5.9
    6 Stable tag: 1.4.5
     6Stable tag: 1.4.6
    77Requires PHP: 7.3
    88License: GPLv2 or later
  • courier-notices/tags/1.4.6/courier-notices/src/Controller/Courier_REST_Controller.php

    r2676712 r2730785  
    3636            $namespace,
    3737            '/' . $base . '/(?P<notice_id>\d+)/',
    38             array(
    39                 array(
     38            [
     39                [
    4040                    'methods'             => \WP_REST_Server::READABLE,
    41                     'callback'            => array( $this, 'get_notice' ),
    42                     'permission_callback' => array( $this, 'get_notice_permissions_check' ),
    43                     'args'                => array(),
    44                 ),
    45             )
     41                    'callback'            => [ $this, 'get_notice' ],
     42                    'permission_callback' => [ $this, 'get_notice_permissions_check' ],
     43                    'args'                => [],
     44                ],
     45            ]
    4646        );
    4747
     
    5050            $namespace,
    5151            '/' . $base . '/(?P<notice_id>\d+)/dismiss',
    52             array(
    53                 array(
     52            [
     53                [
    5454                    'methods'             => \WP_REST_Server::EDITABLE,
    55                     'callback'            => array( $this, 'dismiss_notice' ),
    56                     'permission_callback' => array( $this, 'get_dismiss_notice_permissions_check' ),
    57                     'args'                => array(),
    58                 ),
    59             )
    60         );
    61 
    62         // Display all notices for the specific user
     55                    'callback'            => [ $this, 'dismiss_notice' ],
     56                    'permission_callback' => [ $this, 'get_dismiss_notice_permissions_check' ],
     57                    'args'                => [],
     58                ],
     59            ]
     60        );
     61
     62        // Display all notices for the specific user.
    6363        register_rest_route(
    6464            $namespace,
    6565            '/notices/display/',
    66             array(
    67                 array(
     66            [
     67                [
    6868                    'methods'             => \WP_REST_Server::READABLE,
    69                     'callback'            => array( $this, 'display_notices' ),
    70                     'permission_callback' => array( $this, 'get_notice_permissions_check' ),
    71                     'args'                => array(
    72                         'placement' => array(
     69                    'callback'            => [ $this, 'display_notices' ],
     70                    'permission_callback' => [ $this, 'get_notice_permissions_check' ],
     71                    'args'                => [
     72                        'placement' => [
    7373                            'description'       => esc_html__( 'Set where the notices should display.', 'courier-notices' ),
    7474                            'type'              => 'string',
    7575                            'sanitize_callback' => 'sanitize_text_field',
    7676                            'validate_callback' => 'rest_validate_request_arg',
    77                         ),
    78                         'format'    => array(
     77                        ],
     78                        'format'    => [
    7979                            'description'       => esc_html__( 'Set the response, either html or json.', 'courier-notices' ),
    8080                            'type'              => 'string',
    8181                            'sanitize_callback' => 'sanitize_text_field',
    8282                            'validate_callback' => 'rest_validate_request_arg',
    83                         ),
    84                     ),
    85                 ),
    86             )
     83                        ],
     84                        'post_info' => [
     85                            'description'       => esc_html__( 'Our queried post info', 'courier-notices' ),
     86                            'type'              => 'object',
     87                            'validate_callback' => 'rest_validate_request_arg',
     88                        ],
     89                        'user_id'   => [
     90                            'description'       => esc_html__( 'Our queried post info', 'courier-notices' ),
     91                            'type'              => 'int',
     92                            'sanitize_callback' => 'sanitize_text_field',
     93                            'validate_callback' => 'rest_validate_request_arg',
     94                        ],
     95                    ],
     96                ],
     97            ]
    8798        );
    8899
     
    100111     */
    101112    public function get_notice( WP_REST_Request $request ) {
    102         $data = array();
    103 
    104         $args = array(
     113        $data = [];
     114
     115        $args = [
    105116            'post_type'      => 'courier_notice',
    106117            'post_status'    => 'publish',
     
    108119            'posts_per_page' => 1,
    109120            'p'              => (int) $request['notice_id'],
    110         );
     121        ];
    111122
    112123        $search = new \WP_Query( $args );
     
    161172
    162173        if ( empty( $notifications ) ) {
    163             $notifications = array();
     174            $notifications = [];
    164175        }
    165176
     
    199210     */
    200211    public function display_notices( WP_REST_Request $request ) {
    201         $defaults = array(
     212        $defaults = [
    202213            'user_id'                      => '',
    203214            'include_global'               => true,
     
    207218            'number'                       => 10, // @todo this should be a setting.
    208219            'placement'                    => 'header',
    209             'query_args'                   => array(),
    210         );
     220            'query_args'                   => [],
     221        ];
    211222
    212223        $defaults       = apply_filters( 'courier_notices_get_notices_default_settings', $defaults );
    213224        $args           = wp_parse_args(
    214             array(
     225            [
    215226                'contentType' => $request->get_param( 'contentType' ),
    216227                'placement'   => $request->get_param( 'placement' ),
    217228                'format'      => $request->get_param( 'format' ),
    218             ),
     229            ],
    219230            $defaults
    220231        );
     
    225236
    226237        if ( 'html' === $args['format'] ) {
    227             $notices = array();
     238            $notices = [];
    228239
    229240            foreach ( $notice_posts as $courier_notice ) {
     
    315326        return array(
    316327            'page'     => array(
    317                 'description'       => 'Current page of the collection.',
     328                'description'       => __( 'Current page of the collection.', 'courier-notices' ),
    318329                'type'              => 'integer',
    319330                'default'           => 1,
     
    321332            ),
    322333            'per_page' => array(
    323                 'description'       => 'Maximum number of items to be returned in result set.',
     334                'description'       => __( 'Maximum number of items to be returned in result set.', 'courier-notices' ),
    324335                'type'              => 'integer',
    325336                'default'           => 100,
     
    327338            ),
    328339            'search'   => array(
    329                 'description'       => 'Limit results to those matching a string.',
     340                'description'       => __( 'Limit results to those matching a string.', 'courier-notices' ),
    330341                'type'              => 'string',
    331342                'sanitize_callback' => 'sanitize_text_field',
  • courier-notices/tags/1.4.6/courier-notices/vendor/autoload.php

    r2699180 r2730785  
    33// autoload.php @generated by Composer
    44
     5if (PHP_VERSION_ID < 50600) {
     6    echo '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;
     7    exit(1);
     8}
     9
    510require_once __DIR__ . '/composer/autoload_real.php';
    611
    7 return ComposerAutoloaderInit83edf73b15e0c05f977ad1f815506f66::getLoader();
     12return ComposerAutoloaderInit8a6b813a521d45538abe4ce7229f355a::getLoader();
  • courier-notices/tags/1.4.6/courier-notices/vendor/composer/InstalledVersions.php

    r2676712 r2730785  
    2222 *
    2323 * To require its presence, you can require `composer-runtime-api ^2.0`
     24 *
     25 * @final
    2426 */
    2527class InstalledVersions
  • courier-notices/tags/1.4.6/courier-notices/vendor/composer/autoload_classmap.php

    r2676712 r2730785  
    33// autoload_classmap.php @generated by Composer
    44
    5 $vendorDir = dirname(dirname(__FILE__));
     5$vendorDir = dirname(__DIR__);
    66$baseDir = dirname($vendorDir);
    77
  • courier-notices/tags/1.4.6/courier-notices/vendor/composer/autoload_namespaces.php

    r2676712 r2730785  
    33// autoload_namespaces.php @generated by Composer
    44
    5 $vendorDir = dirname(dirname(__FILE__));
     5$vendorDir = dirname(__DIR__);
    66$baseDir = dirname($vendorDir);
    77
  • courier-notices/tags/1.4.6/courier-notices/vendor/composer/autoload_psr4.php

    r2676712 r2730785  
    33// autoload_psr4.php @generated by Composer
    44
    5 $vendorDir = dirname(dirname(__FILE__));
     5$vendorDir = dirname(__DIR__);
    66$baseDir = dirname($vendorDir);
    77
  • courier-notices/tags/1.4.6/courier-notices/vendor/composer/autoload_real.php

    r2699180 r2730785  
    33// autoload_real.php @generated by Composer
    44
    5 class ComposerAutoloaderInit83edf73b15e0c05f977ad1f815506f66
     5class ComposerAutoloaderInit8a6b813a521d45538abe4ce7229f355a
    66{
    77    private static $loader;
     
    2525        require __DIR__ . '/platform_check.php';
    2626
    27         spl_autoload_register(array('ComposerAutoloaderInit83edf73b15e0c05f977ad1f815506f66', 'loadClassLoader'), true, true);
    28         self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname(\dirname(__FILE__)));
    29         spl_autoload_unregister(array('ComposerAutoloaderInit83edf73b15e0c05f977ad1f815506f66', 'loadClassLoader'));
     27        spl_autoload_register(array('ComposerAutoloaderInit8a6b813a521d45538abe4ce7229f355a', 'loadClassLoader'), true, true);
     28        self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname(__DIR__));
     29        spl_autoload_unregister(array('ComposerAutoloaderInit8a6b813a521d45538abe4ce7229f355a', '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\ComposerStaticInit83edf73b15e0c05f977ad1f815506f66::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\ComposerStaticInit8a6b813a521d45538abe4ce7229f355a::getInitializer($loader));
    5233
    5334        $loader->register(true);
  • courier-notices/tags/1.4.6/courier-notices/vendor/composer/autoload_static.php

    r2699180 r2730785  
    55namespace Composer\Autoload;
    66
    7 class ComposerStaticInit83edf73b15e0c05f977ad1f815506f66
     7class ComposerStaticInit8a6b813a521d45538abe4ce7229f355a
    88{
    99    public static $prefixLengthsPsr4 = array (
     
    3838    {
    3939        return \Closure::bind(function () use ($loader) {
    40             $loader->prefixLengthsPsr4 = ComposerStaticInit83edf73b15e0c05f977ad1f815506f66::$prefixLengthsPsr4;
    41             $loader->prefixDirsPsr4 = ComposerStaticInit83edf73b15e0c05f977ad1f815506f66::$prefixDirsPsr4;
    42             $loader->prefixesPsr0 = ComposerStaticInit83edf73b15e0c05f977ad1f815506f66::$prefixesPsr0;
    43             $loader->classMap = ComposerStaticInit83edf73b15e0c05f977ad1f815506f66::$classMap;
     40            $loader->prefixLengthsPsr4 = ComposerStaticInit8a6b813a521d45538abe4ce7229f355a::$prefixLengthsPsr4;
     41            $loader->prefixDirsPsr4 = ComposerStaticInit8a6b813a521d45538abe4ce7229f355a::$prefixDirsPsr4;
     42            $loader->prefixesPsr0 = ComposerStaticInit8a6b813a521d45538abe4ce7229f355a::$prefixesPsr0;
     43            $loader->classMap = ComposerStaticInit8a6b813a521d45538abe4ce7229f355a::$classMap;
    4444
    4545        }, null, ClassLoader::class);
  • courier-notices/tags/1.4.6/courier-notices/vendor/composer/installed.php

    r2699180 r2730785  
    11<?php return array(
    22    'root' => array(
    3         'pretty_version' => '1.4.5',
    4         'version' => '1.4.5.0',
     3        'pretty_version' => '1.4.6',
     4        'version' => '1.4.6.0',
    55        'type' => 'wordpress-plugin',
    66        'install_path' => __DIR__ . '/../../',
     
    2121        ),
    2222        'linchpin/courier' => array(
    23             'pretty_version' => '1.4.5',
    24             'version' => '1.4.5.0',
     23            'pretty_version' => '1.4.6',
     24            'version' => '1.4.6.0',
    2525            'type' => 'wordpress-plugin',
    2626            'install_path' => __DIR__ . '/../../',
  • courier-notices/tags/1.4.6/js/courier-notices.js

    r2676436 r2730785  
    1 !function(){"use strict";var e={n:function(o){var t=o&&o.__esModule?function(){return o.default}:function(){return o};return e.d(t,{a:t}),t},d:function(o,t){for(var n in t)e.o(t,n)&&!e.o(o,n)&&Object.defineProperty(o,n,{enumerable:!0,get:t[n]})},o:function(e,o){return Object.prototype.hasOwnProperty.call(e,o)}},o=jQuery,t=e.n(o),n=function(e){return e&&decodeURIComponent(document.cookie.replace(new RegExp("(?:(?:^|.*;)\\s*"+encodeURIComponent(e).replace(/[\-\.\+\*]/g,"\\$&")+"\\s*\\=\\s*([^;]*).*$)|^.*$"),"$1"))||null},i=t(),r=t(),a=r(window),c={contentType:"application/json",placement:"popup-modal",format:"html",post_info:{}},s=function(){var e=document.querySelector('.courier-notices.courier-location-popup-modal[data-courier-ajax="true"]'),o=[];if(e){void 0!==courier_notices_data.post_info&&(c.post_info=courier_notices_data.post_info);var t=n("dismissed_notices");t=(t=JSON.parse(t))||[],r.ajax({method:"GET",beforeSend:function(e){e.setRequestHeader("X-WP-Nonce",courier_notices_data.wp_rest_nonce)},url:courier_notices_data.notices_endpoint,data:c}).done((function(e){if(e.notices){for(var n in e.notices)-1===t.indexOf(parseInt(n))&&o.push(e.notices[n]);o.length>0&&(window.courier_notices_modal_notices=o,d(0))}}))}};function d(e){var o=r(window.courier_notices_modal_notices[e]);o.hide(),o.length<1||(r('.courier-notices[data-courier-placement="'+c.placement+'"] .courier-modal-overlay').append(o),r(".courier-modal-overlay").removeClass("hide").show(),o.slideDown("fast"),window.courier_notices_modal_notices.splice(e,1))}var u=t();function p(){function e(e){u(".courier_notice[data-courier-notice-id='"+e+"']").fadeOut(500,(function(){0===window.courier_notices_modal_notices.length?u(".courier-modal-overlay").addClass("hide").hide():d(0)})),function(e){var o=n("dismissed_notices");-1===(o=(o=JSON.parse(o))||[]).indexOf(e)&&o.push(e),function(e,o,t,n,i,r){if(!e||/^(?:expires|max\-age|path|domain|secure)$/i.test(e))return!1;n||(n="/");var a="";if(t)switch(t.constructor){case Number:a=t===1/0?"; expires=Fri, 31 Dec 9999 23:59:59 GMT":"; max-age="+t;break;case String:a="; expires="+t;break;case Date:a="; expires="+t.toUTCString()}document.cookie=encodeURIComponent(e)+"="+encodeURIComponent(o)+a+(i?"; domain="+i:"")+(n?"; path="+n:"")+(r?"; secure":"")}("dismissed_notices",JSON.stringify(o))}(e)}u("body").on("click",".courier-close, .trigger-close",(function(o){var t=u(this),n=t.attr("href");if(!0!==t.data("dismiss")){o.preventDefault(),o.stopPropagation(),t.data("dismiss",!0);var i=t.parents(".courier-notice"),r=parseInt(i.data("courier-notice-id"),10);if(0===i.length||isNaN(r))return;courier_notices_data.user_id&&courier_notices_data.user_id>0?(u.post({url:courier_notices_data.notice_endpoint+r+"/dismiss",data:{dismiss_nonce:courier_notices_data.dismiss_nonce,user_id:courier_notices_data.user_id},beforeSend:function(e){e.setRequestHeader("X-WP-Nonce",courier_notices_data.wp_rest_nonce)}}).done((function(){e(r)})),n&&"#"!==n&&u(document).ajaxComplete((function(e,o,t){window.location=n}))):(e(r),n&&"#"!==n&&(window.location=n))}}))}t()((function(){var e;e=function(){var e=i('.courier-notices[data-courier-ajax="true"]');if(e.attr("data-loaded",!1),0!==e.length){var o=document.querySelectorAll('.courier-notices:not(.courier-location-popup-modal)[data-courier-ajax="true"]'),t=new IntersectionObserver((function(e,o){e.forEach((function(e){if(1===e.intersectionRatio&&"false"===e.target.getAttribute("data-loaded")){var o={contentType:"application/json",placement:e.target.getAttribute("data-courier-placement"),format:"html",post_info:{}};void 0!==courier_notices_data.post_info&&(o.post_info=courier_notices_data.post_info);var t=n("dismissed_notices");t=(t=JSON.parse(t))||[],i.ajax({method:"GET",beforeSend:function(e){"0"!==courier_notices_data.user_id&&e.setRequestHeader("X-WP-Nonce",courier_notices_data.wp_rest_nonce)},url:courier_notices_data.notices_endpoint,data:o}).success((function(e){e.notices&&i.each(e.notices,(function(n){if(-1===t.indexOf(parseInt(n))){var r=i(e.notices[n]).hide();i('.courier-notices[data-courier-placement="'+o.placement+'"]').append(r),r.slideDown("fast","swing",(function(){var e=new CustomEvent("courierNoticeDisplayed",{detail:n});document.dispatchEvent(e)}))}}))})),e.target.setAttribute("data-loaded",!0)}}))}),{threshold:1});Array.prototype.forEach.call(o,(function(e){t.observe(e)}))}},"interactive"===document.readyState||"complete"===document.readyState?e():document.addEventListener("DOMContentLoaded",e),p(),a.on("load",s)}))}();
     1!function(){"use strict";var e={n:function(o){var t=o&&o.__esModule?function(){return o.default}:function(){return o};return e.d(t,{a:t}),t},d:function(o,t){for(var n in t)e.o(t,n)&&!e.o(o,n)&&Object.defineProperty(o,n,{enumerable:!0,get:t[n]})},o:function(e,o){return Object.prototype.hasOwnProperty.call(e,o)}},o=jQuery,t=e.n(o),n=function(e){return e&&decodeURIComponent(document.cookie.replace(new RegExp("(?:(?:^|.*;)\\s*"+encodeURIComponent(e).replace(/[\-\.\+\*]/g,"\\$&")+"\\s*\\=\\s*([^;]*).*$)|^.*$"),"$1"))||null},i=t(),r=t(),a=r(window),c={contentType:"application/json",placement:"popup-modal",format:"html",post_info:{}},s=function(){var e=document.querySelector('.courier-notices.courier-location-popup-modal[data-courier-ajax="true"]'),o=[];if(e){void 0!==courier_notices_data.post_info&&(c.post_info=courier_notices_data.post_info);var t=n("dismissed_notices");t=(t=JSON.parse(t))||[],r.ajax({method:"GET",beforeSend:function(e){e.setRequestHeader("X-WP-Nonce",courier_notices_data.wp_rest_nonce)},url:courier_notices_data.notices_endpoint,data:c}).done((function(e){if(e.notices){for(var n in e.notices)-1===t.indexOf(parseInt(n))&&o.push(e.notices[n]);o.length>0&&(window.courier_notices_modal_notices=o,d(0))}}))}};function d(e){var o=r(window.courier_notices_modal_notices[e]);o.hide(),o.length<1||(r('.courier-notices[data-courier-placement="'+c.placement+'"] .courier-modal-overlay').append(o),r(".courier-modal-overlay").removeClass("hide").show(),o.slideDown("fast"),window.courier_notices_modal_notices.splice(e,1))}var u=t();function _(){function e(e){u(".courier_notice[data-courier-notice-id='"+e+"']").fadeOut(500,(function(){0===window.courier_notices_modal_notices.length?u(".courier-modal-overlay").addClass("hide").hide():d(0)})),function(e){var o=n("dismissed_notices");-1===(o=(o=JSON.parse(o))||[]).indexOf(e)&&o.push(e),function(e,o,t,n,i,r){if(!e||/^(?:expires|max\-age|path|domain|secure)$/i.test(e))return!1;n||(n="/");var a="";if(t)switch(t.constructor){case Number:a=t===1/0?"; expires=Fri, 31 Dec 9999 23:59:59 GMT":"; max-age="+t;break;case String:a="; expires="+t;break;case Date:a="; expires="+t.toUTCString()}document.cookie=encodeURIComponent(e)+"="+encodeURIComponent(o)+a+(i?"; domain="+i:"")+(n?"; path="+n:"")+(r?"; secure":"")}("dismissed_notices",JSON.stringify(o))}(e)}u("body").on("click",".courier-close, .trigger-close",(function(o){var t=u(this),n=t.attr("href");if(!0!==t.data("dismiss")){o.preventDefault(),o.stopPropagation(),t.data("dismiss",!0);var i=t.parents(".courier-notice"),r=parseInt(i.data("courier-notice-id"),10);if(0===i.length||isNaN(r))return;courier_notices_data.user_id&&courier_notices_data.user_id>0?(u.post({url:courier_notices_data.notice_endpoint+r+"/dismiss",data:{dismiss_nonce:courier_notices_data.dismiss_nonce,user_id:courier_notices_data.user_id},beforeSend:function(e){e.setRequestHeader("X-WP-Nonce",courier_notices_data.wp_rest_nonce)}}).done((function(){e(r)})),n&&"#"!==n&&u(document).ajaxComplete((function(e,o,t){window.location=n}))):(e(r),n&&"#"!==n&&(window.location=n))}}))}t()((function(){var e;e=function(){var e=i('.courier-notices[data-courier-ajax="true"]');if(e.attr("data-loaded",!1),0!==e.length){var o=document.querySelectorAll('.courier-notices:not(.courier-location-popup-modal)[data-courier-ajax="true"]'),t=new IntersectionObserver((function(e,o){e.forEach((function(e){if(1===e.intersectionRatio&&"false"===e.target.getAttribute("data-loaded")){var o={contentType:"application/json",placement:e.target.getAttribute("data-courier-placement"),format:"html",post_info:{},user_id:"0"!==courier_notices_data.user_id?courier_notices_data.user_id:""};void 0!==courier_notices_data.post_info&&(o.post_info=courier_notices_data.post_info);var t=n("dismissed_notices");t=(t=JSON.parse(t))||[],i.ajax({method:"GET",beforeSend:function(e){"0"!==courier_notices_data.user_id&&e.setRequestHeader("X-WP-Nonce",courier_notices_data.wp_rest_nonce)},url:courier_notices_data.notices_endpoint,data:o}).success((function(e){e.notices&&i.each(e.notices,(function(n){if(-1===t.indexOf(parseInt(n))){var r=i(e.notices[n]).hide();i('.courier-notices[data-courier-placement="'+o.placement+'"]').append(r),r.slideDown("fast","swing",(function(){var e=new CustomEvent("courierNoticeDisplayed",{detail:n});document.dispatchEvent(e)}))}}))})),e.target.setAttribute("data-loaded",!0)}}))}),{threshold:1});Array.prototype.forEach.call(o,(function(e){t.observe(e)}))}},"interactive"===document.readyState||"complete"===document.readyState?e():document.addEventListener("DOMContentLoaded",e),_(),a.on("load",s)}))}();
  • courier-notices/tags/1.4.6/output.log

    r2699180 r2730785  
    1717048644398ce6: Pulling fs layer
    1818d51a319c6584: Pulling fs layer
     191766f36e2432: Waiting
    19204c13e0891ac6: Waiting
    20 1766f36e2432: Waiting
    212196910ad0ba0c: Waiting
    22220e19de6ed54b: Waiting
    2323048644398ce6: Waiting
    2424d51a319c6584: Waiting
    25 2bc599114627: Verifying Checksum
    26 2bc599114627: Download complete
    27 7c7da25b2876: Download complete
    2825927a0b37a45a: Verifying Checksum
    2926927a0b37a45a: Download complete
     272bc599114627: Download complete
     287c7da25b2876: Verifying Checksum
     297c7da25b2876: Download complete
    30304c13e0891ac6: Verifying Checksum
    31314c13e0891ac6: Download complete
    32327c7da25b2876: Pull complete
    33 0e19de6ed54b: Download complete
     332bc599114627: Pull complete
    34341766f36e2432: Verifying Checksum
    35351766f36e2432: Download complete
    36 2bc599114627: Pull complete
     36927a0b37a45a: Pull complete
    373796910ad0ba0c: Verifying Checksum
    383896910ad0ba0c: Download complete
    39 927a0b37a45a: Pull complete
     390e19de6ed54b: Verifying Checksum
     400e19de6ed54b: Download complete
     411766f36e2432: Pull complete
     424c13e0891ac6: Pull complete
    4043048644398ce6: Verifying Checksum
    4144048644398ce6: Download complete
    42 1766f36e2432: Pull complete
    43 4c13e0891ac6: Pull complete
    4445d51a319c6584: Verifying Checksum
    4546d51a319c6584: Download complete
  • courier-notices/tags/1.4.6/package.json

    r2699180 r2730785  
    11{
    22    "name": "courier-notices",
    3     "version": "1.4.5",
     3    "version": "1.4.6",
    44    "description": "A way to display, manage, and control front end notifications for users, globally or individually, in the header,footer, by shortcode or by page.",
    55    "main": "gulpfile.babel.js",
     
    1616        "save-dev": "0.0.1-security",
    1717        "through2": "4.0.2",
    18         "what-input": "5.2.10"
     18        "what-input": "5.2.11"
    1919    },
    2020    "devDependencies": {
    21         "@babel/core": "7.17.2",
    22         "@babel/preset-env": "7.16.11",
    23         "@babel/register": "7.17.0",
    24         "autoprefixer": "10.4.2",
    25         "babel-loader": "8.2.3",
    26         "browser-sync": "2.27.7",
     21        "@babel/core": "7.18.0",
     22        "@babel/preset-env": "7.18.0",
     23        "@babel/register": "7.17.7",
     24        "autoprefixer": "10.4.7",
     25        "babel-loader": "8.2.5",
     26        "browser-sync": "2.27.10",
    2727        "gulp": "4.0.2",
    2828        "gulp-babel": "8.0.0",
     
    4343        "kind-of": "6.0.3",
    4444        "node-sass": "^7.0.1",
    45         "postcss": "^8.4.6",
     45        "postcss": "^8.4.14",
    4646        "rimraf": "3.0.2",
    4747        "vinyl-named": "1.1.0",
    48         "webpack": "5.68.0",
     48        "webpack": "5.72.1",
    4949        "webpack-stream": "7.0.0",
    50         "yargs": "17.3.1"
     50        "yargs": "17.5.1"
    5151    },
    5252    "repository": {
     
    5959    },
    6060    "engines": {
    61         "node": ">= 14.10.0"
     61        "node": ">= v14.19.3"
    6262    },
    6363    "browserslist": [
  • courier-notices/tags/1.4.6/readme.txt

    r2699180 r2730785  
    44Requires at least: 5.0
    55Tested up to: 5.9
    6 Stable tag: 1.4.5
     6Stable tag: 1.4.6
    77Requires PHP: 7.3
    88License: GPLv2 or later
  • courier-notices/tags/1.4.6/src/Controller/Courier_REST_Controller.php

    r2676052 r2730785  
    3636            $namespace,
    3737            '/' . $base . '/(?P<notice_id>\d+)/',
    38             array(
    39                 array(
     38            [
     39                [
    4040                    'methods'             => \WP_REST_Server::READABLE,
    41                     'callback'            => array( $this, 'get_notice' ),
    42                     'permission_callback' => array( $this, 'get_notice_permissions_check' ),
    43                     'args'                => array(),
    44                 ),
    45             )
     41                    'callback'            => [ $this, 'get_notice' ],
     42                    'permission_callback' => [ $this, 'get_notice_permissions_check' ],
     43                    'args'                => [],
     44                ],
     45            ]
    4646        );
    4747
     
    5050            $namespace,
    5151            '/' . $base . '/(?P<notice_id>\d+)/dismiss',
    52             array(
    53                 array(
     52            [
     53                [
    5454                    'methods'             => \WP_REST_Server::EDITABLE,
    55                     'callback'            => array( $this, 'dismiss_notice' ),
    56                     'permission_callback' => array( $this, 'get_dismiss_notice_permissions_check' ),
    57                     'args'                => array(),
    58                 ),
    59             )
    60         );
    61 
    62         // Display all notices for the specific user
     55                    'callback'            => [ $this, 'dismiss_notice' ],
     56                    'permission_callback' => [ $this, 'get_dismiss_notice_permissions_check' ],
     57                    'args'                => [],
     58                ],
     59            ]
     60        );
     61
     62        // Display all notices for the specific user.
    6363        register_rest_route(
    6464            $namespace,
    6565            '/notices/display/',
    66             array(
    67                 array(
     66            [
     67                [
    6868                    'methods'             => \WP_REST_Server::READABLE,
    69                     'callback'            => array( $this, 'display_notices' ),
    70                     'permission_callback' => array( $this, 'get_notice_permissions_check' ),
    71                     'args'                => array(
    72                         'placement' => array(
     69                    'callback'            => [ $this, 'display_notices' ],
     70                    'permission_callback' => [ $this, 'get_notice_permissions_check' ],
     71                    'args'                => [
     72                        'placement' => [
    7373                            'description'       => esc_html__( 'Set where the notices should display.', 'courier-notices' ),
    7474                            'type'              => 'string',
    7575                            'sanitize_callback' => 'sanitize_text_field',
    7676                            'validate_callback' => 'rest_validate_request_arg',
    77                         ),
    78                         'format'    => array(
     77                        ],
     78                        'format'    => [
    7979                            'description'       => esc_html__( 'Set the response, either html or json.', 'courier-notices' ),
    8080                            'type'              => 'string',
    8181                            'sanitize_callback' => 'sanitize_text_field',
    8282                            'validate_callback' => 'rest_validate_request_arg',
    83                         ),
    84                     ),
    85                 ),
    86             )
     83                        ],
     84                        'post_info' => [
     85                            'description'       => esc_html__( 'Our queried post info', 'courier-notices' ),
     86                            'type'              => 'object',
     87                            'validate_callback' => 'rest_validate_request_arg',
     88                        ],
     89                        'user_id'   => [
     90                            'description'       => esc_html__( 'Our queried post info', 'courier-notices' ),
     91                            'type'              => 'int',
     92                            'sanitize_callback' => 'sanitize_text_field',
     93                            'validate_callback' => 'rest_validate_request_arg',
     94                        ],
     95                    ],
     96                ],
     97            ]
    8798        );
    8899
     
    100111     */
    101112    public function get_notice( WP_REST_Request $request ) {
    102         $data = array();
    103 
    104         $args = array(
     113        $data = [];
     114
     115        $args = [
    105116            'post_type'      => 'courier_notice',
    106117            'post_status'    => 'publish',
     
    108119            'posts_per_page' => 1,
    109120            'p'              => (int) $request['notice_id'],
    110         );
     121        ];
    111122
    112123        $search = new \WP_Query( $args );
     
    161172
    162173        if ( empty( $notifications ) ) {
    163             $notifications = array();
     174            $notifications = [];
    164175        }
    165176
     
    199210     */
    200211    public function display_notices( WP_REST_Request $request ) {
    201         $defaults = array(
     212        $defaults = [
    202213            'user_id'                      => '',
    203214            'include_global'               => true,
     
    207218            'number'                       => 10, // @todo this should be a setting.
    208219            'placement'                    => 'header',
    209             'query_args'                   => array(),
    210         );
     220            'query_args'                   => [],
     221        ];
    211222
    212223        $defaults       = apply_filters( 'courier_notices_get_notices_default_settings', $defaults );
    213224        $args           = wp_parse_args(
    214             array(
     225            [
    215226                'contentType' => $request->get_param( 'contentType' ),
    216227                'placement'   => $request->get_param( 'placement' ),
    217228                'format'      => $request->get_param( 'format' ),
    218             ),
     229            ],
    219230            $defaults
    220231        );
     
    225236
    226237        if ( 'html' === $args['format'] ) {
    227             $notices = array();
     238            $notices = [];
    228239
    229240            foreach ( $notice_posts as $courier_notice ) {
     
    315326        return array(
    316327            'page'     => array(
    317                 'description'       => 'Current page of the collection.',
     328                'description'       => __( 'Current page of the collection.', 'courier-notices' ),
    318329                'type'              => 'integer',
    319330                'default'           => 1,
     
    321332            ),
    322333            'per_page' => array(
    323                 'description'       => 'Maximum number of items to be returned in result set.',
     334                'description'       => __( 'Maximum number of items to be returned in result set.', 'courier-notices' ),
    324335                'type'              => 'integer',
    325336                'default'           => 100,
     
    327338            ),
    328339            'search'   => array(
    329                 'description'       => 'Limit results to those matching a string.',
     340                'description'       => __( 'Limit results to those matching a string.', 'courier-notices' ),
    330341                'type'              => 'string',
    331342                'sanitize_callback' => 'sanitize_text_field',
  • courier-notices/tags/1.4.6/vendor/autoload.php

    r2699180 r2730785  
    33// autoload.php @generated by Composer
    44
     5if (PHP_VERSION_ID < 50600) {
     6    echo '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;
     7    exit(1);
     8}
     9
    510require_once __DIR__ . '/composer/autoload_real.php';
    611
    7 return ComposerAutoloaderInit83edf73b15e0c05f977ad1f815506f66::getLoader();
     12return ComposerAutoloaderInit8a6b813a521d45538abe4ce7229f355a::getLoader();
  • courier-notices/tags/1.4.6/vendor/composer/InstalledVersions.php

    r2675851 r2730785  
    2222 *
    2323 * To require its presence, you can require `composer-runtime-api ^2.0`
     24 *
     25 * @final
    2426 */
    2527class InstalledVersions
  • courier-notices/tags/1.4.6/vendor/composer/autoload_classmap.php

    r2676052 r2730785  
    33// autoload_classmap.php @generated by Composer
    44
    5 $vendorDir = dirname(dirname(__FILE__));
     5$vendorDir = dirname(__DIR__);
    66$baseDir = dirname($vendorDir);
    77
  • courier-notices/tags/1.4.6/vendor/composer/autoload_namespaces.php

    r2344125 r2730785  
    33// autoload_namespaces.php @generated by Composer
    44
    5 $vendorDir = dirname(dirname(__FILE__));
     5$vendorDir = dirname(__DIR__);
    66$baseDir = dirname($vendorDir);
    77
  • courier-notices/tags/1.4.6/vendor/composer/autoload_psr4.php

    r2676052 r2730785  
    33// autoload_psr4.php @generated by Composer
    44
    5 $vendorDir = dirname(dirname(__FILE__));
     5$vendorDir = dirname(__DIR__);
    66$baseDir = dirname($vendorDir);
    77
  • courier-notices/tags/1.4.6/vendor/composer/autoload_real.php

    r2699180 r2730785  
    33// autoload_real.php @generated by Composer
    44
    5 class ComposerAutoloaderInit83edf73b15e0c05f977ad1f815506f66
     5class ComposerAutoloaderInit8a6b813a521d45538abe4ce7229f355a
    66{
    77    private static $loader;
     
    2525        require __DIR__ . '/platform_check.php';
    2626
    27         spl_autoload_register(array('ComposerAutoloaderInit83edf73b15e0c05f977ad1f815506f66', 'loadClassLoader'), true, true);
    28         self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname(\dirname(__FILE__)));
    29         spl_autoload_unregister(array('ComposerAutoloaderInit83edf73b15e0c05f977ad1f815506f66', 'loadClassLoader'));
     27        spl_autoload_register(array('ComposerAutoloaderInit8a6b813a521d45538abe4ce7229f355a', 'loadClassLoader'), true, true);
     28        self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname(__DIR__));
     29        spl_autoload_unregister(array('ComposerAutoloaderInit8a6b813a521d45538abe4ce7229f355a', '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\ComposerStaticInit83edf73b15e0c05f977ad1f815506f66::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\ComposerStaticInit8a6b813a521d45538abe4ce7229f355a::getInitializer($loader));
    5233
    5334        $loader->register(true);
  • courier-notices/tags/1.4.6/vendor/composer/autoload_static.php

    r2699180 r2730785  
    55namespace Composer\Autoload;
    66
    7 class ComposerStaticInit83edf73b15e0c05f977ad1f815506f66
     7class ComposerStaticInit8a6b813a521d45538abe4ce7229f355a
    88{
    99    public static $prefixLengthsPsr4 = array (
     
    3838    {
    3939        return \Closure::bind(function () use ($loader) {
    40             $loader->prefixLengthsPsr4 = ComposerStaticInit83edf73b15e0c05f977ad1f815506f66::$prefixLengthsPsr4;
    41             $loader->prefixDirsPsr4 = ComposerStaticInit83edf73b15e0c05f977ad1f815506f66::$prefixDirsPsr4;
    42             $loader->prefixesPsr0 = ComposerStaticInit83edf73b15e0c05f977ad1f815506f66::$prefixesPsr0;
    43             $loader->classMap = ComposerStaticInit83edf73b15e0c05f977ad1f815506f66::$classMap;
     40            $loader->prefixLengthsPsr4 = ComposerStaticInit8a6b813a521d45538abe4ce7229f355a::$prefixLengthsPsr4;
     41            $loader->prefixDirsPsr4 = ComposerStaticInit8a6b813a521d45538abe4ce7229f355a::$prefixDirsPsr4;
     42            $loader->prefixesPsr0 = ComposerStaticInit8a6b813a521d45538abe4ce7229f355a::$prefixesPsr0;
     43            $loader->classMap = ComposerStaticInit8a6b813a521d45538abe4ce7229f355a::$classMap;
    4444
    4545        }, null, ClassLoader::class);
  • courier-notices/tags/1.4.6/vendor/composer/installed.php

    r2699180 r2730785  
    11<?php return array(
    22    'root' => array(
    3         'pretty_version' => '1.4.5',
    4         'version' => '1.4.5.0',
     3        'pretty_version' => '1.4.6',
     4        'version' => '1.4.6.0',
    55        'type' => 'wordpress-plugin',
    66        'install_path' => __DIR__ . '/../../',
     
    2121        ),
    2222        'linchpin/courier' => array(
    23             'pretty_version' => '1.4.5',
    24             'version' => '1.4.5.0',
     23            'pretty_version' => '1.4.6',
     24            'version' => '1.4.6.0',
    2525            'type' => 'wordpress-plugin',
    2626            'install_path' => __DIR__ . '/../../',
  • courier-notices/trunk/CHANGELOG.md

    r2699180 r2730785  
    66
    77## [Unreleased]
     8
     9## [1.4.6] - 2022-05-24
     10
     11### Fixes
     12
     13- fix: Fixed an issue where user_id was not being passed in the request for notices
    814
    915## [1.4.5] - 2022-03-24
  • courier-notices/trunk/courier-notices.php

    r2699180 r2730785  
    44 * Plugin URI:  https://wordpress.org/plugins/courier-notices
    55 * Description: A way to display, manage, and control front end notifications for your WordPress install.
    6  * Version:     1.4.5
     6 * Version:     1.4.6
    77 * Author:      Linchpin
    88 * Author URI:  https://linchpin.com
     
    2323
    2424if ( ! defined( 'COURIER_NOTICES_VERSION' ) ) {
    25     define( 'COURIER_NOTICES_VERSION', '1.4.5' );
     25    define( 'COURIER_NOTICES_VERSION', '1.4.6' );
    2626}
    2727
    2828if ( ! defined( 'COURIER_NOTICES_RELEASE_DATE' ) ) {
    29     define( 'COURIER_NOTICES_RELEASE_DATE', '03/24/2022' );
     29    define( 'COURIER_NOTICES_RELEASE_DATE', '05/24/2022' );
    3030}
    3131
  • courier-notices/trunk/courier-notices/CHANGELOG.md

    r2699180 r2730785  
    66
    77## [Unreleased]
     8
     9## [1.4.6] - 2022-05-24
     10
     11### Fixes
     12
     13- fix: Fixed an issue where user_id was not being passed in the request for notices
    814
    915## [1.4.5] - 2022-03-24
  • courier-notices/trunk/courier-notices/courier-notices.php

    r2699180 r2730785  
    44 * Plugin URI:  https://wordpress.org/plugins/courier-notices
    55 * Description: A way to display, manage, and control front end notifications for your WordPress install.
    6  * Version:     1.4.5
     6 * Version:     1.4.6
    77 * Author:      Linchpin
    88 * Author URI:  https://linchpin.com
     
    2323
    2424if ( ! defined( 'COURIER_NOTICES_VERSION' ) ) {
    25     define( 'COURIER_NOTICES_VERSION', '1.4.5' );
     25    define( 'COURIER_NOTICES_VERSION', '1.4.6' );
    2626}
    2727
    2828if ( ! defined( 'COURIER_NOTICES_RELEASE_DATE' ) ) {
    29     define( 'COURIER_NOTICES_RELEASE_DATE', '03/24/2022' );
     29    define( 'COURIER_NOTICES_RELEASE_DATE', '05/24/2022' );
    3030}
    3131
  • courier-notices/trunk/courier-notices/js/courier-notices.js

    r2676712 r2730785  
    1 !function(){"use strict";var e={n:function(o){var t=o&&o.__esModule?function(){return o.default}:function(){return o};return e.d(t,{a:t}),t},d:function(o,t){for(var n in t)e.o(t,n)&&!e.o(o,n)&&Object.defineProperty(o,n,{enumerable:!0,get:t[n]})},o:function(e,o){return Object.prototype.hasOwnProperty.call(e,o)}},o=jQuery,t=e.n(o),n=function(e){return e&&decodeURIComponent(document.cookie.replace(new RegExp("(?:(?:^|.*;)\\s*"+encodeURIComponent(e).replace(/[\-\.\+\*]/g,"\\$&")+"\\s*\\=\\s*([^;]*).*$)|^.*$"),"$1"))||null},i=t(),r=t(),a=r(window),c={contentType:"application/json",placement:"popup-modal",format:"html",post_info:{}},s=function(){var e=document.querySelector('.courier-notices.courier-location-popup-modal[data-courier-ajax="true"]'),o=[];if(e){void 0!==courier_notices_data.post_info&&(c.post_info=courier_notices_data.post_info);var t=n("dismissed_notices");t=(t=JSON.parse(t))||[],r.ajax({method:"GET",beforeSend:function(e){e.setRequestHeader("X-WP-Nonce",courier_notices_data.wp_rest_nonce)},url:courier_notices_data.notices_endpoint,data:c}).done((function(e){if(e.notices){for(var n in e.notices)-1===t.indexOf(parseInt(n))&&o.push(e.notices[n]);o.length>0&&(window.courier_notices_modal_notices=o,d(0))}}))}};function d(e){var o=r(window.courier_notices_modal_notices[e]);o.hide(),o.length<1||(r('.courier-notices[data-courier-placement="'+c.placement+'"] .courier-modal-overlay').append(o),r(".courier-modal-overlay").removeClass("hide").show(),o.slideDown("fast"),window.courier_notices_modal_notices.splice(e,1))}var u=t();function p(){function e(e){u(".courier_notice[data-courier-notice-id='"+e+"']").fadeOut(500,(function(){0===window.courier_notices_modal_notices.length?u(".courier-modal-overlay").addClass("hide").hide():d(0)})),function(e){var o=n("dismissed_notices");-1===(o=(o=JSON.parse(o))||[]).indexOf(e)&&o.push(e),function(e,o,t,n,i,r){if(!e||/^(?:expires|max\-age|path|domain|secure)$/i.test(e))return!1;n||(n="/");var a="";if(t)switch(t.constructor){case Number:a=t===1/0?"; expires=Fri, 31 Dec 9999 23:59:59 GMT":"; max-age="+t;break;case String:a="; expires="+t;break;case Date:a="; expires="+t.toUTCString()}document.cookie=encodeURIComponent(e)+"="+encodeURIComponent(o)+a+(i?"; domain="+i:"")+(n?"; path="+n:"")+(r?"; secure":"")}("dismissed_notices",JSON.stringify(o))}(e)}u("body").on("click",".courier-close, .trigger-close",(function(o){var t=u(this),n=t.attr("href");if(!0!==t.data("dismiss")){o.preventDefault(),o.stopPropagation(),t.data("dismiss",!0);var i=t.parents(".courier-notice"),r=parseInt(i.data("courier-notice-id"),10);if(0===i.length||isNaN(r))return;courier_notices_data.user_id&&courier_notices_data.user_id>0?(u.post({url:courier_notices_data.notice_endpoint+r+"/dismiss",data:{dismiss_nonce:courier_notices_data.dismiss_nonce,user_id:courier_notices_data.user_id},beforeSend:function(e){e.setRequestHeader("X-WP-Nonce",courier_notices_data.wp_rest_nonce)}}).done((function(){e(r)})),n&&"#"!==n&&u(document).ajaxComplete((function(e,o,t){window.location=n}))):(e(r),n&&"#"!==n&&(window.location=n))}}))}t()((function(){var e;e=function(){var e=i('.courier-notices[data-courier-ajax="true"]');if(e.attr("data-loaded",!1),0!==e.length){var o=document.querySelectorAll('.courier-notices:not(.courier-location-popup-modal)[data-courier-ajax="true"]'),t=new IntersectionObserver((function(e,o){e.forEach((function(e){if(1===e.intersectionRatio&&"false"===e.target.getAttribute("data-loaded")){var o={contentType:"application/json",placement:e.target.getAttribute("data-courier-placement"),format:"html",post_info:{}};void 0!==courier_notices_data.post_info&&(o.post_info=courier_notices_data.post_info);var t=n("dismissed_notices");t=(t=JSON.parse(t))||[],i.ajax({method:"GET",beforeSend:function(e){"0"!==courier_notices_data.user_id&&e.setRequestHeader("X-WP-Nonce",courier_notices_data.wp_rest_nonce)},url:courier_notices_data.notices_endpoint,data:o}).success((function(e){e.notices&&i.each(e.notices,(function(n){if(-1===t.indexOf(parseInt(n))){var r=i(e.notices[n]).hide();i('.courier-notices[data-courier-placement="'+o.placement+'"]').append(r),r.slideDown("fast","swing",(function(){var e=new CustomEvent("courierNoticeDisplayed",{detail:n});document.dispatchEvent(e)}))}}))})),e.target.setAttribute("data-loaded",!0)}}))}),{threshold:1});Array.prototype.forEach.call(o,(function(e){t.observe(e)}))}},"interactive"===document.readyState||"complete"===document.readyState?e():document.addEventListener("DOMContentLoaded",e),p(),a.on("load",s)}))}();
     1!function(){"use strict";var e={n:function(o){var t=o&&o.__esModule?function(){return o.default}:function(){return o};return e.d(t,{a:t}),t},d:function(o,t){for(var n in t)e.o(t,n)&&!e.o(o,n)&&Object.defineProperty(o,n,{enumerable:!0,get:t[n]})},o:function(e,o){return Object.prototype.hasOwnProperty.call(e,o)}},o=jQuery,t=e.n(o),n=function(e){return e&&decodeURIComponent(document.cookie.replace(new RegExp("(?:(?:^|.*;)\\s*"+encodeURIComponent(e).replace(/[\-\.\+\*]/g,"\\$&")+"\\s*\\=\\s*([^;]*).*$)|^.*$"),"$1"))||null},i=t(),r=t(),a=r(window),c={contentType:"application/json",placement:"popup-modal",format:"html",post_info:{}},s=function(){var e=document.querySelector('.courier-notices.courier-location-popup-modal[data-courier-ajax="true"]'),o=[];if(e){void 0!==courier_notices_data.post_info&&(c.post_info=courier_notices_data.post_info);var t=n("dismissed_notices");t=(t=JSON.parse(t))||[],r.ajax({method:"GET",beforeSend:function(e){e.setRequestHeader("X-WP-Nonce",courier_notices_data.wp_rest_nonce)},url:courier_notices_data.notices_endpoint,data:c}).done((function(e){if(e.notices){for(var n in e.notices)-1===t.indexOf(parseInt(n))&&o.push(e.notices[n]);o.length>0&&(window.courier_notices_modal_notices=o,d(0))}}))}};function d(e){var o=r(window.courier_notices_modal_notices[e]);o.hide(),o.length<1||(r('.courier-notices[data-courier-placement="'+c.placement+'"] .courier-modal-overlay').append(o),r(".courier-modal-overlay").removeClass("hide").show(),o.slideDown("fast"),window.courier_notices_modal_notices.splice(e,1))}var u=t();function _(){function e(e){u(".courier_notice[data-courier-notice-id='"+e+"']").fadeOut(500,(function(){0===window.courier_notices_modal_notices.length?u(".courier-modal-overlay").addClass("hide").hide():d(0)})),function(e){var o=n("dismissed_notices");-1===(o=(o=JSON.parse(o))||[]).indexOf(e)&&o.push(e),function(e,o,t,n,i,r){if(!e||/^(?:expires|max\-age|path|domain|secure)$/i.test(e))return!1;n||(n="/");var a="";if(t)switch(t.constructor){case Number:a=t===1/0?"; expires=Fri, 31 Dec 9999 23:59:59 GMT":"; max-age="+t;break;case String:a="; expires="+t;break;case Date:a="; expires="+t.toUTCString()}document.cookie=encodeURIComponent(e)+"="+encodeURIComponent(o)+a+(i?"; domain="+i:"")+(n?"; path="+n:"")+(r?"; secure":"")}("dismissed_notices",JSON.stringify(o))}(e)}u("body").on("click",".courier-close, .trigger-close",(function(o){var t=u(this),n=t.attr("href");if(!0!==t.data("dismiss")){o.preventDefault(),o.stopPropagation(),t.data("dismiss",!0);var i=t.parents(".courier-notice"),r=parseInt(i.data("courier-notice-id"),10);if(0===i.length||isNaN(r))return;courier_notices_data.user_id&&courier_notices_data.user_id>0?(u.post({url:courier_notices_data.notice_endpoint+r+"/dismiss",data:{dismiss_nonce:courier_notices_data.dismiss_nonce,user_id:courier_notices_data.user_id},beforeSend:function(e){e.setRequestHeader("X-WP-Nonce",courier_notices_data.wp_rest_nonce)}}).done((function(){e(r)})),n&&"#"!==n&&u(document).ajaxComplete((function(e,o,t){window.location=n}))):(e(r),n&&"#"!==n&&(window.location=n))}}))}t()((function(){var e;e=function(){var e=i('.courier-notices[data-courier-ajax="true"]');if(e.attr("data-loaded",!1),0!==e.length){var o=document.querySelectorAll('.courier-notices:not(.courier-location-popup-modal)[data-courier-ajax="true"]'),t=new IntersectionObserver((function(e,o){e.forEach((function(e){if(1===e.intersectionRatio&&"false"===e.target.getAttribute("data-loaded")){var o={contentType:"application/json",placement:e.target.getAttribute("data-courier-placement"),format:"html",post_info:{},user_id:"0"!==courier_notices_data.user_id?courier_notices_data.user_id:""};void 0!==courier_notices_data.post_info&&(o.post_info=courier_notices_data.post_info);var t=n("dismissed_notices");t=(t=JSON.parse(t))||[],i.ajax({method:"GET",beforeSend:function(e){"0"!==courier_notices_data.user_id&&e.setRequestHeader("X-WP-Nonce",courier_notices_data.wp_rest_nonce)},url:courier_notices_data.notices_endpoint,data:o}).success((function(e){e.notices&&i.each(e.notices,(function(n){if(-1===t.indexOf(parseInt(n))){var r=i(e.notices[n]).hide();i('.courier-notices[data-courier-placement="'+o.placement+'"]').append(r),r.slideDown("fast","swing",(function(){var e=new CustomEvent("courierNoticeDisplayed",{detail:n});document.dispatchEvent(e)}))}}))})),e.target.setAttribute("data-loaded",!0)}}))}),{threshold:1});Array.prototype.forEach.call(o,(function(e){t.observe(e)}))}},"interactive"===document.readyState||"complete"===document.readyState?e():document.addEventListener("DOMContentLoaded",e),_(),a.on("load",s)}))}();
  • courier-notices/trunk/courier-notices/output.log

    r2699180 r2730785  
    1717048644398ce6: Pulling fs layer
    1818d51a319c6584: Pulling fs layer
     191766f36e2432: Waiting
    19204c13e0891ac6: Waiting
    20 1766f36e2432: Waiting
    212196910ad0ba0c: Waiting
    22220e19de6ed54b: Waiting
    2323048644398ce6: Waiting
    2424d51a319c6584: Waiting
    25 2bc599114627: Verifying Checksum
    26 2bc599114627: Download complete
    27 7c7da25b2876: Download complete
    2825927a0b37a45a: Verifying Checksum
    2926927a0b37a45a: Download complete
     272bc599114627: Download complete
     287c7da25b2876: Verifying Checksum
     297c7da25b2876: Download complete
    30304c13e0891ac6: Verifying Checksum
    31314c13e0891ac6: Download complete
    32327c7da25b2876: Pull complete
    33 0e19de6ed54b: Download complete
     332bc599114627: Pull complete
    34341766f36e2432: Verifying Checksum
    35351766f36e2432: Download complete
    36 2bc599114627: Pull complete
     36927a0b37a45a: Pull complete
    373796910ad0ba0c: Verifying Checksum
    383896910ad0ba0c: Download complete
    39 927a0b37a45a: Pull complete
     390e19de6ed54b: Verifying Checksum
     400e19de6ed54b: Download complete
     411766f36e2432: Pull complete
     424c13e0891ac6: Pull complete
    4043048644398ce6: Verifying Checksum
    4144048644398ce6: Download complete
    42 1766f36e2432: Pull complete
    43 4c13e0891ac6: Pull complete
    4445d51a319c6584: Verifying Checksum
    4546d51a319c6584: Download complete
  • courier-notices/trunk/courier-notices/package.json

    r2699180 r2730785  
    11{
    22    "name": "courier-notices",
    3     "version": "1.4.5",
     3    "version": "1.4.6",
    44    "description": "A way to display, manage, and control front end notifications for users, globally or individually, in the header,footer, by shortcode or by page.",
    55    "main": "gulpfile.babel.js",
     
    1616        "save-dev": "0.0.1-security",
    1717        "through2": "4.0.2",
    18         "what-input": "5.2.10"
     18        "what-input": "5.2.11"
    1919    },
    2020    "devDependencies": {
    21         "@babel/core": "7.17.2",
    22         "@babel/preset-env": "7.16.11",
    23         "@babel/register": "7.17.0",
    24         "autoprefixer": "10.4.2",
    25         "babel-loader": "8.2.3",
    26         "browser-sync": "2.27.7",
     21        "@babel/core": "7.18.0",
     22        "@babel/preset-env": "7.18.0",
     23        "@babel/register": "7.17.7",
     24        "autoprefixer": "10.4.7",
     25        "babel-loader": "8.2.5",
     26        "browser-sync": "2.27.10",
    2727        "gulp": "4.0.2",
    2828        "gulp-babel": "8.0.0",
     
    4343        "kind-of": "6.0.3",
    4444        "node-sass": "^7.0.1",
    45         "postcss": "^8.4.6",
     45        "postcss": "^8.4.14",
    4646        "rimraf": "3.0.2",
    4747        "vinyl-named": "1.1.0",
    48         "webpack": "5.68.0",
     48        "webpack": "5.72.1",
    4949        "webpack-stream": "7.0.0",
    50         "yargs": "17.3.1"
     50        "yargs": "17.5.1"
    5151    },
    5252    "repository": {
     
    5959    },
    6060    "engines": {
    61         "node": ">= 14.10.0"
     61        "node": ">= v14.19.3"
    6262    },
    6363    "browserslist": [
  • courier-notices/trunk/courier-notices/readme.txt

    r2699180 r2730785  
    44Requires at least: 5.0
    55Tested up to: 5.9
    6 Stable tag: 1.4.5
     6Stable tag: 1.4.6
    77Requires PHP: 7.3
    88License: GPLv2 or later
  • courier-notices/trunk/courier-notices/src/Controller/Courier_REST_Controller.php

    r2676712 r2730785  
    3636            $namespace,
    3737            '/' . $base . '/(?P<notice_id>\d+)/',
    38             array(
    39                 array(
     38            [
     39                [
    4040                    'methods'             => \WP_REST_Server::READABLE,
    41                     'callback'            => array( $this, 'get_notice' ),
    42                     'permission_callback' => array( $this, 'get_notice_permissions_check' ),
    43                     'args'                => array(),
    44                 ),
    45             )
     41                    'callback'            => [ $this, 'get_notice' ],
     42                    'permission_callback' => [ $this, 'get_notice_permissions_check' ],
     43                    'args'                => [],
     44                ],
     45            ]
    4646        );
    4747
     
    5050            $namespace,
    5151            '/' . $base . '/(?P<notice_id>\d+)/dismiss',
    52             array(
    53                 array(
     52            [
     53                [
    5454                    'methods'             => \WP_REST_Server::EDITABLE,
    55                     'callback'            => array( $this, 'dismiss_notice' ),
    56                     'permission_callback' => array( $this, 'get_dismiss_notice_permissions_check' ),
    57                     'args'                => array(),
    58                 ),
    59             )
    60         );
    61 
    62         // Display all notices for the specific user
     55                    'callback'            => [ $this, 'dismiss_notice' ],
     56                    'permission_callback' => [ $this, 'get_dismiss_notice_permissions_check' ],
     57                    'args'                => [],
     58                ],
     59            ]
     60        );
     61
     62        // Display all notices for the specific user.
    6363        register_rest_route(
    6464            $namespace,
    6565            '/notices/display/',
    66             array(
    67                 array(
     66            [
     67                [
    6868                    'methods'             => \WP_REST_Server::READABLE,
    69                     'callback'            => array( $this, 'display_notices' ),
    70                     'permission_callback' => array( $this, 'get_notice_permissions_check' ),
    71                     'args'                => array(
    72                         'placement' => array(
     69                    'callback'            => [ $this, 'display_notices' ],
     70                    'permission_callback' => [ $this, 'get_notice_permissions_check' ],
     71                    'args'                => [
     72                        'placement' => [
    7373                            'description'       => esc_html__( 'Set where the notices should display.', 'courier-notices' ),
    7474                            'type'              => 'string',
    7575                            'sanitize_callback' => 'sanitize_text_field',
    7676                            'validate_callback' => 'rest_validate_request_arg',
    77                         ),
    78                         'format'    => array(
     77                        ],
     78                        'format'    => [
    7979                            'description'       => esc_html__( 'Set the response, either html or json.', 'courier-notices' ),
    8080                            'type'              => 'string',
    8181                            'sanitize_callback' => 'sanitize_text_field',
    8282                            'validate_callback' => 'rest_validate_request_arg',
    83                         ),
    84                     ),
    85                 ),
    86             )
     83                        ],
     84                        'post_info' => [
     85                            'description'       => esc_html__( 'Our queried post info', 'courier-notices' ),
     86                            'type'              => 'object',
     87                            'validate_callback' => 'rest_validate_request_arg',
     88                        ],
     89                        'user_id'   => [
     90                            'description'       => esc_html__( 'Our queried post info', 'courier-notices' ),
     91                            'type'              => 'int',
     92                            'sanitize_callback' => 'sanitize_text_field',
     93                            'validate_callback' => 'rest_validate_request_arg',
     94                        ],
     95                    ],
     96                ],
     97            ]
    8798        );
    8899
     
    100111     */
    101112    public function get_notice( WP_REST_Request $request ) {
    102         $data = array();
    103 
    104         $args = array(
     113        $data = [];
     114
     115        $args = [
    105116            'post_type'      => 'courier_notice',
    106117            'post_status'    => 'publish',
     
    108119            'posts_per_page' => 1,
    109120            'p'              => (int) $request['notice_id'],
    110         );
     121        ];
    111122
    112123        $search = new \WP_Query( $args );
     
    161172
    162173        if ( empty( $notifications ) ) {
    163             $notifications = array();
     174            $notifications = [];
    164175        }
    165176
     
    199210     */
    200211    public function display_notices( WP_REST_Request $request ) {
    201         $defaults = array(
     212        $defaults = [
    202213            'user_id'                      => '',
    203214            'include_global'               => true,
     
    207218            'number'                       => 10, // @todo this should be a setting.
    208219            'placement'                    => 'header',
    209             'query_args'                   => array(),
    210         );
     220            'query_args'                   => [],
     221        ];
    211222
    212223        $defaults       = apply_filters( 'courier_notices_get_notices_default_settings', $defaults );
    213224        $args           = wp_parse_args(
    214             array(
     225            [
    215226                'contentType' => $request->get_param( 'contentType' ),
    216227                'placement'   => $request->get_param( 'placement' ),
    217228                'format'      => $request->get_param( 'format' ),
    218             ),
     229            ],
    219230            $defaults
    220231        );
     
    225236
    226237        if ( 'html' === $args['format'] ) {
    227             $notices = array();
     238            $notices = [];
    228239
    229240            foreach ( $notice_posts as $courier_notice ) {
     
    315326        return array(
    316327            'page'     => array(
    317                 'description'       => 'Current page of the collection.',
     328                'description'       => __( 'Current page of the collection.', 'courier-notices' ),
    318329                'type'              => 'integer',
    319330                'default'           => 1,
     
    321332            ),
    322333            'per_page' => array(
    323                 'description'       => 'Maximum number of items to be returned in result set.',
     334                'description'       => __( 'Maximum number of items to be returned in result set.', 'courier-notices' ),
    324335                'type'              => 'integer',
    325336                'default'           => 100,
     
    327338            ),
    328339            'search'   => array(
    329                 'description'       => 'Limit results to those matching a string.',
     340                'description'       => __( 'Limit results to those matching a string.', 'courier-notices' ),
    330341                'type'              => 'string',
    331342                'sanitize_callback' => 'sanitize_text_field',
  • courier-notices/trunk/courier-notices/vendor/autoload.php

    r2699180 r2730785  
    33// autoload.php @generated by Composer
    44
     5if (PHP_VERSION_ID < 50600) {
     6    echo '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;
     7    exit(1);
     8}
     9
    510require_once __DIR__ . '/composer/autoload_real.php';
    611
    7 return ComposerAutoloaderInit83edf73b15e0c05f977ad1f815506f66::getLoader();
     12return ComposerAutoloaderInit8a6b813a521d45538abe4ce7229f355a::getLoader();
  • courier-notices/trunk/courier-notices/vendor/composer/InstalledVersions.php

    r2676712 r2730785  
    2222 *
    2323 * To require its presence, you can require `composer-runtime-api ^2.0`
     24 *
     25 * @final
    2426 */
    2527class InstalledVersions
  • courier-notices/trunk/courier-notices/vendor/composer/autoload_classmap.php

    r2676712 r2730785  
    33// autoload_classmap.php @generated by Composer
    44
    5 $vendorDir = dirname(dirname(__FILE__));
     5$vendorDir = dirname(__DIR__);
    66$baseDir = dirname($vendorDir);
    77
  • courier-notices/trunk/courier-notices/vendor/composer/autoload_namespaces.php

    r2676712 r2730785  
    33// autoload_namespaces.php @generated by Composer
    44
    5 $vendorDir = dirname(dirname(__FILE__));
     5$vendorDir = dirname(__DIR__);
    66$baseDir = dirname($vendorDir);
    77
  • courier-notices/trunk/courier-notices/vendor/composer/autoload_psr4.php

    r2676712 r2730785  
    33// autoload_psr4.php @generated by Composer
    44
    5 $vendorDir = dirname(dirname(__FILE__));
     5$vendorDir = dirname(__DIR__);
    66$baseDir = dirname($vendorDir);
    77
  • courier-notices/trunk/courier-notices/vendor/composer/autoload_real.php

    r2699180 r2730785  
    33// autoload_real.php @generated by Composer
    44
    5 class ComposerAutoloaderInit83edf73b15e0c05f977ad1f815506f66
     5class ComposerAutoloaderInit8a6b813a521d45538abe4ce7229f355a
    66{
    77    private static $loader;
     
    2525        require __DIR__ . '/platform_check.php';
    2626
    27         spl_autoload_register(array('ComposerAutoloaderInit83edf73b15e0c05f977ad1f815506f66', 'loadClassLoader'), true, true);
    28         self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname(\dirname(__FILE__)));
    29         spl_autoload_unregister(array('ComposerAutoloaderInit83edf73b15e0c05f977ad1f815506f66', 'loadClassLoader'));
     27        spl_autoload_register(array('ComposerAutoloaderInit8a6b813a521d45538abe4ce7229f355a', 'loadClassLoader'), true, true);
     28        self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname(__DIR__));
     29        spl_autoload_unregister(array('ComposerAutoloaderInit8a6b813a521d45538abe4ce7229f355a', '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\ComposerStaticInit83edf73b15e0c05f977ad1f815506f66::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\ComposerStaticInit8a6b813a521d45538abe4ce7229f355a::getInitializer($loader));
    5233
    5334        $loader->register(true);
  • courier-notices/trunk/courier-notices/vendor/composer/autoload_static.php

    r2699180 r2730785  
    55namespace Composer\Autoload;
    66
    7 class ComposerStaticInit83edf73b15e0c05f977ad1f815506f66
     7class ComposerStaticInit8a6b813a521d45538abe4ce7229f355a
    88{
    99    public static $prefixLengthsPsr4 = array (
     
    3838    {
    3939        return \Closure::bind(function () use ($loader) {
    40             $loader->prefixLengthsPsr4 = ComposerStaticInit83edf73b15e0c05f977ad1f815506f66::$prefixLengthsPsr4;
    41             $loader->prefixDirsPsr4 = ComposerStaticInit83edf73b15e0c05f977ad1f815506f66::$prefixDirsPsr4;
    42             $loader->prefixesPsr0 = ComposerStaticInit83edf73b15e0c05f977ad1f815506f66::$prefixesPsr0;
    43             $loader->classMap = ComposerStaticInit83edf73b15e0c05f977ad1f815506f66::$classMap;
     40            $loader->prefixLengthsPsr4 = ComposerStaticInit8a6b813a521d45538abe4ce7229f355a::$prefixLengthsPsr4;
     41            $loader->prefixDirsPsr4 = ComposerStaticInit8a6b813a521d45538abe4ce7229f355a::$prefixDirsPsr4;
     42            $loader->prefixesPsr0 = ComposerStaticInit8a6b813a521d45538abe4ce7229f355a::$prefixesPsr0;
     43            $loader->classMap = ComposerStaticInit8a6b813a521d45538abe4ce7229f355a::$classMap;
    4444
    4545        }, null, ClassLoader::class);
  • courier-notices/trunk/courier-notices/vendor/composer/installed.php

    r2699180 r2730785  
    11<?php return array(
    22    'root' => array(
    3         'pretty_version' => '1.4.5',
    4         'version' => '1.4.5.0',
     3        'pretty_version' => '1.4.6',
     4        'version' => '1.4.6.0',
    55        'type' => 'wordpress-plugin',
    66        'install_path' => __DIR__ . '/../../',
     
    2121        ),
    2222        'linchpin/courier' => array(
    23             'pretty_version' => '1.4.5',
    24             'version' => '1.4.5.0',
     23            'pretty_version' => '1.4.6',
     24            'version' => '1.4.6.0',
    2525            'type' => 'wordpress-plugin',
    2626            'install_path' => __DIR__ . '/../../',
  • courier-notices/trunk/js/courier-notices.js

    r2676436 r2730785  
    1 !function(){"use strict";var e={n:function(o){var t=o&&o.__esModule?function(){return o.default}:function(){return o};return e.d(t,{a:t}),t},d:function(o,t){for(var n in t)e.o(t,n)&&!e.o(o,n)&&Object.defineProperty(o,n,{enumerable:!0,get:t[n]})},o:function(e,o){return Object.prototype.hasOwnProperty.call(e,o)}},o=jQuery,t=e.n(o),n=function(e){return e&&decodeURIComponent(document.cookie.replace(new RegExp("(?:(?:^|.*;)\\s*"+encodeURIComponent(e).replace(/[\-\.\+\*]/g,"\\$&")+"\\s*\\=\\s*([^;]*).*$)|^.*$"),"$1"))||null},i=t(),r=t(),a=r(window),c={contentType:"application/json",placement:"popup-modal",format:"html",post_info:{}},s=function(){var e=document.querySelector('.courier-notices.courier-location-popup-modal[data-courier-ajax="true"]'),o=[];if(e){void 0!==courier_notices_data.post_info&&(c.post_info=courier_notices_data.post_info);var t=n("dismissed_notices");t=(t=JSON.parse(t))||[],r.ajax({method:"GET",beforeSend:function(e){e.setRequestHeader("X-WP-Nonce",courier_notices_data.wp_rest_nonce)},url:courier_notices_data.notices_endpoint,data:c}).done((function(e){if(e.notices){for(var n in e.notices)-1===t.indexOf(parseInt(n))&&o.push(e.notices[n]);o.length>0&&(window.courier_notices_modal_notices=o,d(0))}}))}};function d(e){var o=r(window.courier_notices_modal_notices[e]);o.hide(),o.length<1||(r('.courier-notices[data-courier-placement="'+c.placement+'"] .courier-modal-overlay').append(o),r(".courier-modal-overlay").removeClass("hide").show(),o.slideDown("fast"),window.courier_notices_modal_notices.splice(e,1))}var u=t();function p(){function e(e){u(".courier_notice[data-courier-notice-id='"+e+"']").fadeOut(500,(function(){0===window.courier_notices_modal_notices.length?u(".courier-modal-overlay").addClass("hide").hide():d(0)})),function(e){var o=n("dismissed_notices");-1===(o=(o=JSON.parse(o))||[]).indexOf(e)&&o.push(e),function(e,o,t,n,i,r){if(!e||/^(?:expires|max\-age|path|domain|secure)$/i.test(e))return!1;n||(n="/");var a="";if(t)switch(t.constructor){case Number:a=t===1/0?"; expires=Fri, 31 Dec 9999 23:59:59 GMT":"; max-age="+t;break;case String:a="; expires="+t;break;case Date:a="; expires="+t.toUTCString()}document.cookie=encodeURIComponent(e)+"="+encodeURIComponent(o)+a+(i?"; domain="+i:"")+(n?"; path="+n:"")+(r?"; secure":"")}("dismissed_notices",JSON.stringify(o))}(e)}u("body").on("click",".courier-close, .trigger-close",(function(o){var t=u(this),n=t.attr("href");if(!0!==t.data("dismiss")){o.preventDefault(),o.stopPropagation(),t.data("dismiss",!0);var i=t.parents(".courier-notice"),r=parseInt(i.data("courier-notice-id"),10);if(0===i.length||isNaN(r))return;courier_notices_data.user_id&&courier_notices_data.user_id>0?(u.post({url:courier_notices_data.notice_endpoint+r+"/dismiss",data:{dismiss_nonce:courier_notices_data.dismiss_nonce,user_id:courier_notices_data.user_id},beforeSend:function(e){e.setRequestHeader("X-WP-Nonce",courier_notices_data.wp_rest_nonce)}}).done((function(){e(r)})),n&&"#"!==n&&u(document).ajaxComplete((function(e,o,t){window.location=n}))):(e(r),n&&"#"!==n&&(window.location=n))}}))}t()((function(){var e;e=function(){var e=i('.courier-notices[data-courier-ajax="true"]');if(e.attr("data-loaded",!1),0!==e.length){var o=document.querySelectorAll('.courier-notices:not(.courier-location-popup-modal)[data-courier-ajax="true"]'),t=new IntersectionObserver((function(e,o){e.forEach((function(e){if(1===e.intersectionRatio&&"false"===e.target.getAttribute("data-loaded")){var o={contentType:"application/json",placement:e.target.getAttribute("data-courier-placement"),format:"html",post_info:{}};void 0!==courier_notices_data.post_info&&(o.post_info=courier_notices_data.post_info);var t=n("dismissed_notices");t=(t=JSON.parse(t))||[],i.ajax({method:"GET",beforeSend:function(e){"0"!==courier_notices_data.user_id&&e.setRequestHeader("X-WP-Nonce",courier_notices_data.wp_rest_nonce)},url:courier_notices_data.notices_endpoint,data:o}).success((function(e){e.notices&&i.each(e.notices,(function(n){if(-1===t.indexOf(parseInt(n))){var r=i(e.notices[n]).hide();i('.courier-notices[data-courier-placement="'+o.placement+'"]').append(r),r.slideDown("fast","swing",(function(){var e=new CustomEvent("courierNoticeDisplayed",{detail:n});document.dispatchEvent(e)}))}}))})),e.target.setAttribute("data-loaded",!0)}}))}),{threshold:1});Array.prototype.forEach.call(o,(function(e){t.observe(e)}))}},"interactive"===document.readyState||"complete"===document.readyState?e():document.addEventListener("DOMContentLoaded",e),p(),a.on("load",s)}))}();
     1!function(){"use strict";var e={n:function(o){var t=o&&o.__esModule?function(){return o.default}:function(){return o};return e.d(t,{a:t}),t},d:function(o,t){for(var n in t)e.o(t,n)&&!e.o(o,n)&&Object.defineProperty(o,n,{enumerable:!0,get:t[n]})},o:function(e,o){return Object.prototype.hasOwnProperty.call(e,o)}},o=jQuery,t=e.n(o),n=function(e){return e&&decodeURIComponent(document.cookie.replace(new RegExp("(?:(?:^|.*;)\\s*"+encodeURIComponent(e).replace(/[\-\.\+\*]/g,"\\$&")+"\\s*\\=\\s*([^;]*).*$)|^.*$"),"$1"))||null},i=t(),r=t(),a=r(window),c={contentType:"application/json",placement:"popup-modal",format:"html",post_info:{}},s=function(){var e=document.querySelector('.courier-notices.courier-location-popup-modal[data-courier-ajax="true"]'),o=[];if(e){void 0!==courier_notices_data.post_info&&(c.post_info=courier_notices_data.post_info);var t=n("dismissed_notices");t=(t=JSON.parse(t))||[],r.ajax({method:"GET",beforeSend:function(e){e.setRequestHeader("X-WP-Nonce",courier_notices_data.wp_rest_nonce)},url:courier_notices_data.notices_endpoint,data:c}).done((function(e){if(e.notices){for(var n in e.notices)-1===t.indexOf(parseInt(n))&&o.push(e.notices[n]);o.length>0&&(window.courier_notices_modal_notices=o,d(0))}}))}};function d(e){var o=r(window.courier_notices_modal_notices[e]);o.hide(),o.length<1||(r('.courier-notices[data-courier-placement="'+c.placement+'"] .courier-modal-overlay').append(o),r(".courier-modal-overlay").removeClass("hide").show(),o.slideDown("fast"),window.courier_notices_modal_notices.splice(e,1))}var u=t();function _(){function e(e){u(".courier_notice[data-courier-notice-id='"+e+"']").fadeOut(500,(function(){0===window.courier_notices_modal_notices.length?u(".courier-modal-overlay").addClass("hide").hide():d(0)})),function(e){var o=n("dismissed_notices");-1===(o=(o=JSON.parse(o))||[]).indexOf(e)&&o.push(e),function(e,o,t,n,i,r){if(!e||/^(?:expires|max\-age|path|domain|secure)$/i.test(e))return!1;n||(n="/");var a="";if(t)switch(t.constructor){case Number:a=t===1/0?"; expires=Fri, 31 Dec 9999 23:59:59 GMT":"; max-age="+t;break;case String:a="; expires="+t;break;case Date:a="; expires="+t.toUTCString()}document.cookie=encodeURIComponent(e)+"="+encodeURIComponent(o)+a+(i?"; domain="+i:"")+(n?"; path="+n:"")+(r?"; secure":"")}("dismissed_notices",JSON.stringify(o))}(e)}u("body").on("click",".courier-close, .trigger-close",(function(o){var t=u(this),n=t.attr("href");if(!0!==t.data("dismiss")){o.preventDefault(),o.stopPropagation(),t.data("dismiss",!0);var i=t.parents(".courier-notice"),r=parseInt(i.data("courier-notice-id"),10);if(0===i.length||isNaN(r))return;courier_notices_data.user_id&&courier_notices_data.user_id>0?(u.post({url:courier_notices_data.notice_endpoint+r+"/dismiss",data:{dismiss_nonce:courier_notices_data.dismiss_nonce,user_id:courier_notices_data.user_id},beforeSend:function(e){e.setRequestHeader("X-WP-Nonce",courier_notices_data.wp_rest_nonce)}}).done((function(){e(r)})),n&&"#"!==n&&u(document).ajaxComplete((function(e,o,t){window.location=n}))):(e(r),n&&"#"!==n&&(window.location=n))}}))}t()((function(){var e;e=function(){var e=i('.courier-notices[data-courier-ajax="true"]');if(e.attr("data-loaded",!1),0!==e.length){var o=document.querySelectorAll('.courier-notices:not(.courier-location-popup-modal)[data-courier-ajax="true"]'),t=new IntersectionObserver((function(e,o){e.forEach((function(e){if(1===e.intersectionRatio&&"false"===e.target.getAttribute("data-loaded")){var o={contentType:"application/json",placement:e.target.getAttribute("data-courier-placement"),format:"html",post_info:{},user_id:"0"!==courier_notices_data.user_id?courier_notices_data.user_id:""};void 0!==courier_notices_data.post_info&&(o.post_info=courier_notices_data.post_info);var t=n("dismissed_notices");t=(t=JSON.parse(t))||[],i.ajax({method:"GET",beforeSend:function(e){"0"!==courier_notices_data.user_id&&e.setRequestHeader("X-WP-Nonce",courier_notices_data.wp_rest_nonce)},url:courier_notices_data.notices_endpoint,data:o}).success((function(e){e.notices&&i.each(e.notices,(function(n){if(-1===t.indexOf(parseInt(n))){var r=i(e.notices[n]).hide();i('.courier-notices[data-courier-placement="'+o.placement+'"]').append(r),r.slideDown("fast","swing",(function(){var e=new CustomEvent("courierNoticeDisplayed",{detail:n});document.dispatchEvent(e)}))}}))})),e.target.setAttribute("data-loaded",!0)}}))}),{threshold:1});Array.prototype.forEach.call(o,(function(e){t.observe(e)}))}},"interactive"===document.readyState||"complete"===document.readyState?e():document.addEventListener("DOMContentLoaded",e),_(),a.on("load",s)}))}();
  • courier-notices/trunk/output.log

    r2699180 r2730785  
    1717048644398ce6: Pulling fs layer
    1818d51a319c6584: Pulling fs layer
     191766f36e2432: Waiting
    19204c13e0891ac6: Waiting
    20 1766f36e2432: Waiting
    212196910ad0ba0c: Waiting
    22220e19de6ed54b: Waiting
    2323048644398ce6: Waiting
    2424d51a319c6584: Waiting
    25 2bc599114627: Verifying Checksum
    26 2bc599114627: Download complete
    27 7c7da25b2876: Download complete
    2825927a0b37a45a: Verifying Checksum
    2926927a0b37a45a: Download complete
     272bc599114627: Download complete
     287c7da25b2876: Verifying Checksum
     297c7da25b2876: Download complete
    30304c13e0891ac6: Verifying Checksum
    31314c13e0891ac6: Download complete
    32327c7da25b2876: Pull complete
    33 0e19de6ed54b: Download complete
     332bc599114627: Pull complete
    34341766f36e2432: Verifying Checksum
    35351766f36e2432: Download complete
    36 2bc599114627: Pull complete
     36927a0b37a45a: Pull complete
    373796910ad0ba0c: Verifying Checksum
    383896910ad0ba0c: Download complete
    39 927a0b37a45a: Pull complete
     390e19de6ed54b: Verifying Checksum
     400e19de6ed54b: Download complete
     411766f36e2432: Pull complete
     424c13e0891ac6: Pull complete
    4043048644398ce6: Verifying Checksum
    4144048644398ce6: Download complete
    42 1766f36e2432: Pull complete
    43 4c13e0891ac6: Pull complete
    4445d51a319c6584: Verifying Checksum
    4546d51a319c6584: Download complete
  • courier-notices/trunk/package.json

    r2699180 r2730785  
    11{
    22    "name": "courier-notices",
    3     "version": "1.4.5",
     3    "version": "1.4.6",
    44    "description": "A way to display, manage, and control front end notifications for users, globally or individually, in the header,footer, by shortcode or by page.",
    55    "main": "gulpfile.babel.js",
     
    1616        "save-dev": "0.0.1-security",
    1717        "through2": "4.0.2",
    18         "what-input": "5.2.10"
     18        "what-input": "5.2.11"
    1919    },
    2020    "devDependencies": {
    21         "@babel/core": "7.17.2",
    22         "@babel/preset-env": "7.16.11",
    23         "@babel/register": "7.17.0",
    24         "autoprefixer": "10.4.2",
    25         "babel-loader": "8.2.3",
    26         "browser-sync": "2.27.7",
     21        "@babel/core": "7.18.0",
     22        "@babel/preset-env": "7.18.0",
     23        "@babel/register": "7.17.7",
     24        "autoprefixer": "10.4.7",
     25        "babel-loader": "8.2.5",
     26        "browser-sync": "2.27.10",
    2727        "gulp": "4.0.2",
    2828        "gulp-babel": "8.0.0",
     
    4343        "kind-of": "6.0.3",
    4444        "node-sass": "^7.0.1",
    45         "postcss": "^8.4.6",
     45        "postcss": "^8.4.14",
    4646        "rimraf": "3.0.2",
    4747        "vinyl-named": "1.1.0",
    48         "webpack": "5.68.0",
     48        "webpack": "5.72.1",
    4949        "webpack-stream": "7.0.0",
    50         "yargs": "17.3.1"
     50        "yargs": "17.5.1"
    5151    },
    5252    "repository": {
     
    5959    },
    6060    "engines": {
    61         "node": ">= 14.10.0"
     61        "node": ">= v14.19.3"
    6262    },
    6363    "browserslist": [
  • courier-notices/trunk/readme.txt

    r2699180 r2730785  
    44Requires at least: 5.0
    55Tested up to: 5.9
    6 Stable tag: 1.4.5
     6Stable tag: 1.4.6
    77Requires PHP: 7.3
    88License: GPLv2 or later
  • courier-notices/trunk/src/Controller/Courier_REST_Controller.php

    r2676052 r2730785  
    3636            $namespace,
    3737            '/' . $base . '/(?P<notice_id>\d+)/',
    38             array(
    39                 array(
     38            [
     39                [
    4040                    'methods'             => \WP_REST_Server::READABLE,
    41                     'callback'            => array( $this, 'get_notice' ),
    42                     'permission_callback' => array( $this, 'get_notice_permissions_check' ),
    43                     'args'                => array(),
    44                 ),
    45             )
     41                    'callback'            => [ $this, 'get_notice' ],
     42                    'permission_callback' => [ $this, 'get_notice_permissions_check' ],
     43                    'args'                => [],
     44                ],
     45            ]
    4646        );
    4747
     
    5050            $namespace,
    5151            '/' . $base . '/(?P<notice_id>\d+)/dismiss',
    52             array(
    53                 array(
     52            [
     53                [
    5454                    'methods'             => \WP_REST_Server::EDITABLE,
    55                     'callback'            => array( $this, 'dismiss_notice' ),
    56                     'permission_callback' => array( $this, 'get_dismiss_notice_permissions_check' ),
    57                     'args'                => array(),
    58                 ),
    59             )
    60         );
    61 
    62         // Display all notices for the specific user
     55                    'callback'            => [ $this, 'dismiss_notice' ],
     56                    'permission_callback' => [ $this, 'get_dismiss_notice_permissions_check' ],
     57                    'args'                => [],
     58                ],
     59            ]
     60        );
     61
     62        // Display all notices for the specific user.
    6363        register_rest_route(
    6464            $namespace,
    6565            '/notices/display/',
    66             array(
    67                 array(
     66            [
     67                [
    6868                    'methods'             => \WP_REST_Server::READABLE,
    69                     'callback'            => array( $this, 'display_notices' ),
    70                     'permission_callback' => array( $this, 'get_notice_permissions_check' ),
    71                     'args'                => array(
    72                         'placement' => array(
     69                    'callback'            => [ $this, 'display_notices' ],
     70                    'permission_callback' => [ $this, 'get_notice_permissions_check' ],
     71                    'args'                => [
     72                        'placement' => [
    7373                            'description'       => esc_html__( 'Set where the notices should display.', 'courier-notices' ),
    7474                            'type'              => 'string',
    7575                            'sanitize_callback' => 'sanitize_text_field',
    7676                            'validate_callback' => 'rest_validate_request_arg',
    77                         ),
    78                         'format'    => array(
     77                        ],
     78                        'format'    => [
    7979                            'description'       => esc_html__( 'Set the response, either html or json.', 'courier-notices' ),
    8080                            'type'              => 'string',
    8181                            'sanitize_callback' => 'sanitize_text_field',
    8282                            'validate_callback' => 'rest_validate_request_arg',
    83                         ),
    84                     ),
    85                 ),
    86             )
     83                        ],
     84                        'post_info' => [
     85                            'description'       => esc_html__( 'Our queried post info', 'courier-notices' ),
     86                            'type'              => 'object',
     87                            'validate_callback' => 'rest_validate_request_arg',
     88                        ],
     89                        'user_id'   => [
     90                            'description'       => esc_html__( 'Our queried post info', 'courier-notices' ),
     91                            'type'              => 'int',
     92                            'sanitize_callback' => 'sanitize_text_field',
     93                            'validate_callback' => 'rest_validate_request_arg',
     94                        ],
     95                    ],
     96                ],
     97            ]
    8798        );
    8899
     
    100111     */
    101112    public function get_notice( WP_REST_Request $request ) {
    102         $data = array();
    103 
    104         $args = array(
     113        $data = [];
     114
     115        $args = [
    105116            'post_type'      => 'courier_notice',
    106117            'post_status'    => 'publish',
     
    108119            'posts_per_page' => 1,
    109120            'p'              => (int) $request['notice_id'],
    110         );
     121        ];
    111122
    112123        $search = new \WP_Query( $args );
     
    161172
    162173        if ( empty( $notifications ) ) {
    163             $notifications = array();
     174            $notifications = [];
    164175        }
    165176
     
    199210     */
    200211    public function display_notices( WP_REST_Request $request ) {
    201         $defaults = array(
     212        $defaults = [
    202213            'user_id'                      => '',
    203214            'include_global'               => true,
     
    207218            'number'                       => 10, // @todo this should be a setting.
    208219            'placement'                    => 'header',
    209             'query_args'                   => array(),
    210         );
     220            'query_args'                   => [],
     221        ];
    211222
    212223        $defaults       = apply_filters( 'courier_notices_get_notices_default_settings', $defaults );
    213224        $args           = wp_parse_args(
    214             array(
     225            [
    215226                'contentType' => $request->get_param( 'contentType' ),
    216227                'placement'   => $request->get_param( 'placement' ),
    217228                'format'      => $request->get_param( 'format' ),
    218             ),
     229            ],
    219230            $defaults
    220231        );
     
    225236
    226237        if ( 'html' === $args['format'] ) {
    227             $notices = array();
     238            $notices = [];
    228239
    229240            foreach ( $notice_posts as $courier_notice ) {
     
    315326        return array(
    316327            'page'     => array(
    317                 'description'       => 'Current page of the collection.',
     328                'description'       => __( 'Current page of the collection.', 'courier-notices' ),
    318329                'type'              => 'integer',
    319330                'default'           => 1,
     
    321332            ),
    322333            'per_page' => array(
    323                 'description'       => 'Maximum number of items to be returned in result set.',
     334                'description'       => __( 'Maximum number of items to be returned in result set.', 'courier-notices' ),
    324335                'type'              => 'integer',
    325336                'default'           => 100,
     
    327338            ),
    328339            'search'   => array(
    329                 'description'       => 'Limit results to those matching a string.',
     340                'description'       => __( 'Limit results to those matching a string.', 'courier-notices' ),
    330341                'type'              => 'string',
    331342                'sanitize_callback' => 'sanitize_text_field',
  • courier-notices/trunk/vendor/autoload.php

    r2699180 r2730785  
    33// autoload.php @generated by Composer
    44
     5if (PHP_VERSION_ID < 50600) {
     6    echo '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;
     7    exit(1);
     8}
     9
    510require_once __DIR__ . '/composer/autoload_real.php';
    611
    7 return ComposerAutoloaderInit83edf73b15e0c05f977ad1f815506f66::getLoader();
     12return ComposerAutoloaderInit8a6b813a521d45538abe4ce7229f355a::getLoader();
  • courier-notices/trunk/vendor/composer/InstalledVersions.php

    r2675851 r2730785  
    2222 *
    2323 * To require its presence, you can require `composer-runtime-api ^2.0`
     24 *
     25 * @final
    2426 */
    2527class InstalledVersions
  • courier-notices/trunk/vendor/composer/autoload_classmap.php

    r2676052 r2730785  
    33// autoload_classmap.php @generated by Composer
    44
    5 $vendorDir = dirname(dirname(__FILE__));
     5$vendorDir = dirname(__DIR__);
    66$baseDir = dirname($vendorDir);
    77
  • courier-notices/trunk/vendor/composer/autoload_namespaces.php

    r2344125 r2730785  
    33// autoload_namespaces.php @generated by Composer
    44
    5 $vendorDir = dirname(dirname(__FILE__));
     5$vendorDir = dirname(__DIR__);
    66$baseDir = dirname($vendorDir);
    77
  • courier-notices/trunk/vendor/composer/autoload_psr4.php

    r2676052 r2730785  
    33// autoload_psr4.php @generated by Composer
    44
    5 $vendorDir = dirname(dirname(__FILE__));
     5$vendorDir = dirname(__DIR__);
    66$baseDir = dirname($vendorDir);
    77
  • courier-notices/trunk/vendor/composer/autoload_real.php

    r2699180 r2730785  
    33// autoload_real.php @generated by Composer
    44
    5 class ComposerAutoloaderInit83edf73b15e0c05f977ad1f815506f66
     5class ComposerAutoloaderInit8a6b813a521d45538abe4ce7229f355a
    66{
    77    private static $loader;
     
    2525        require __DIR__ . '/platform_check.php';
    2626
    27         spl_autoload_register(array('ComposerAutoloaderInit83edf73b15e0c05f977ad1f815506f66', 'loadClassLoader'), true, true);
    28         self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname(\dirname(__FILE__)));
    29         spl_autoload_unregister(array('ComposerAutoloaderInit83edf73b15e0c05f977ad1f815506f66', 'loadClassLoader'));
     27        spl_autoload_register(array('ComposerAutoloaderInit8a6b813a521d45538abe4ce7229f355a', 'loadClassLoader'), true, true);
     28        self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname(__DIR__));
     29        spl_autoload_unregister(array('ComposerAutoloaderInit8a6b813a521d45538abe4ce7229f355a', '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\ComposerStaticInit83edf73b15e0c05f977ad1f815506f66::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\ComposerStaticInit8a6b813a521d45538abe4ce7229f355a::getInitializer($loader));
    5233
    5334        $loader->register(true);
  • courier-notices/trunk/vendor/composer/autoload_static.php

    r2699180 r2730785  
    55namespace Composer\Autoload;
    66
    7 class ComposerStaticInit83edf73b15e0c05f977ad1f815506f66
     7class ComposerStaticInit8a6b813a521d45538abe4ce7229f355a
    88{
    99    public static $prefixLengthsPsr4 = array (
     
    3838    {
    3939        return \Closure::bind(function () use ($loader) {
    40             $loader->prefixLengthsPsr4 = ComposerStaticInit83edf73b15e0c05f977ad1f815506f66::$prefixLengthsPsr4;
    41             $loader->prefixDirsPsr4 = ComposerStaticInit83edf73b15e0c05f977ad1f815506f66::$prefixDirsPsr4;
    42             $loader->prefixesPsr0 = ComposerStaticInit83edf73b15e0c05f977ad1f815506f66::$prefixesPsr0;
    43             $loader->classMap = ComposerStaticInit83edf73b15e0c05f977ad1f815506f66::$classMap;
     40            $loader->prefixLengthsPsr4 = ComposerStaticInit8a6b813a521d45538abe4ce7229f355a::$prefixLengthsPsr4;
     41            $loader->prefixDirsPsr4 = ComposerStaticInit8a6b813a521d45538abe4ce7229f355a::$prefixDirsPsr4;
     42            $loader->prefixesPsr0 = ComposerStaticInit8a6b813a521d45538abe4ce7229f355a::$prefixesPsr0;
     43            $loader->classMap = ComposerStaticInit8a6b813a521d45538abe4ce7229f355a::$classMap;
    4444
    4545        }, null, ClassLoader::class);
  • courier-notices/trunk/vendor/composer/installed.php

    r2699180 r2730785  
    11<?php return array(
    22    'root' => array(
    3         'pretty_version' => '1.4.5',
    4         'version' => '1.4.5.0',
     3        'pretty_version' => '1.4.6',
     4        'version' => '1.4.6.0',
    55        'type' => 'wordpress-plugin',
    66        'install_path' => __DIR__ . '/../../',
     
    2121        ),
    2222        'linchpin/courier' => array(
    23             'pretty_version' => '1.4.5',
    24             'version' => '1.4.5.0',
     23            'pretty_version' => '1.4.6',
     24            'version' => '1.4.6.0',
    2525            'type' => 'wordpress-plugin',
    2626            'install_path' => __DIR__ . '/../../',
Note: See TracChangeset for help on using the changeset viewer.