Changeset 2730785
- Timestamp:
- 05/25/2022 01:10:51 PM (4 years ago)
- Location:
- courier-notices
- Files:
-
- 60 edited
- 1 copied
-
tags/1.4.6 (copied) (copied from courier-notices/trunk)
-
tags/1.4.6/CHANGELOG.md (modified) (1 diff)
-
tags/1.4.6/courier-notices.php (modified) (2 diffs)
-
tags/1.4.6/courier-notices/CHANGELOG.md (modified) (1 diff)
-
tags/1.4.6/courier-notices/courier-notices.php (modified) (2 diffs)
-
tags/1.4.6/courier-notices/js/courier-notices.js (modified) (1 diff)
-
tags/1.4.6/courier-notices/output.log (modified) (1 diff)
-
tags/1.4.6/courier-notices/package.json (modified) (4 diffs)
-
tags/1.4.6/courier-notices/readme.txt (modified) (1 diff)
-
tags/1.4.6/courier-notices/src/Controller/Courier_REST_Controller.php (modified) (11 diffs)
-
tags/1.4.6/courier-notices/vendor/autoload.php (modified) (1 diff)
-
tags/1.4.6/courier-notices/vendor/composer/InstalledVersions.php (modified) (1 diff)
-
tags/1.4.6/courier-notices/vendor/composer/autoload_classmap.php (modified) (1 diff)
-
tags/1.4.6/courier-notices/vendor/composer/autoload_namespaces.php (modified) (1 diff)
-
tags/1.4.6/courier-notices/vendor/composer/autoload_psr4.php (modified) (1 diff)
-
tags/1.4.6/courier-notices/vendor/composer/autoload_real.php (modified) (2 diffs)
-
tags/1.4.6/courier-notices/vendor/composer/autoload_static.php (modified) (2 diffs)
-
tags/1.4.6/courier-notices/vendor/composer/installed.php (modified) (2 diffs)
-
tags/1.4.6/js/courier-notices.js (modified) (1 diff)
-
tags/1.4.6/output.log (modified) (1 diff)
-
tags/1.4.6/package.json (modified) (4 diffs)
-
tags/1.4.6/readme.txt (modified) (1 diff)
-
tags/1.4.6/src/Controller/Courier_REST_Controller.php (modified) (11 diffs)
-
tags/1.4.6/vendor/autoload.php (modified) (1 diff)
-
tags/1.4.6/vendor/composer/InstalledVersions.php (modified) (1 diff)
-
tags/1.4.6/vendor/composer/autoload_classmap.php (modified) (1 diff)
-
tags/1.4.6/vendor/composer/autoload_namespaces.php (modified) (1 diff)
-
tags/1.4.6/vendor/composer/autoload_psr4.php (modified) (1 diff)
-
tags/1.4.6/vendor/composer/autoload_real.php (modified) (2 diffs)
-
tags/1.4.6/vendor/composer/autoload_static.php (modified) (2 diffs)
-
tags/1.4.6/vendor/composer/installed.php (modified) (2 diffs)
-
trunk/CHANGELOG.md (modified) (1 diff)
-
trunk/courier-notices.php (modified) (2 diffs)
-
trunk/courier-notices/CHANGELOG.md (modified) (1 diff)
-
trunk/courier-notices/courier-notices.php (modified) (2 diffs)
-
trunk/courier-notices/js/courier-notices.js (modified) (1 diff)
-
trunk/courier-notices/output.log (modified) (1 diff)
-
trunk/courier-notices/package.json (modified) (4 diffs)
-
trunk/courier-notices/readme.txt (modified) (1 diff)
-
trunk/courier-notices/src/Controller/Courier_REST_Controller.php (modified) (11 diffs)
-
trunk/courier-notices/vendor/autoload.php (modified) (1 diff)
-
trunk/courier-notices/vendor/composer/InstalledVersions.php (modified) (1 diff)
-
trunk/courier-notices/vendor/composer/autoload_classmap.php (modified) (1 diff)
-
trunk/courier-notices/vendor/composer/autoload_namespaces.php (modified) (1 diff)
-
trunk/courier-notices/vendor/composer/autoload_psr4.php (modified) (1 diff)
-
trunk/courier-notices/vendor/composer/autoload_real.php (modified) (2 diffs)
-
trunk/courier-notices/vendor/composer/autoload_static.php (modified) (2 diffs)
-
trunk/courier-notices/vendor/composer/installed.php (modified) (2 diffs)
-
trunk/js/courier-notices.js (modified) (1 diff)
-
trunk/output.log (modified) (1 diff)
-
trunk/package.json (modified) (4 diffs)
-
trunk/readme.txt (modified) (1 diff)
-
trunk/src/Controller/Courier_REST_Controller.php (modified) (11 diffs)
-
trunk/vendor/autoload.php (modified) (1 diff)
-
trunk/vendor/composer/InstalledVersions.php (modified) (1 diff)
-
trunk/vendor/composer/autoload_classmap.php (modified) (1 diff)
-
trunk/vendor/composer/autoload_namespaces.php (modified) (1 diff)
-
trunk/vendor/composer/autoload_psr4.php (modified) (1 diff)
-
trunk/vendor/composer/autoload_real.php (modified) (2 diffs)
-
trunk/vendor/composer/autoload_static.php (modified) (2 diffs)
-
trunk/vendor/composer/installed.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
courier-notices/tags/1.4.6/CHANGELOG.md
r2699180 r2730785 6 6 7 7 ## [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 8 14 9 15 ## [1.4.5] - 2022-03-24 -
courier-notices/tags/1.4.6/courier-notices.php
r2699180 r2730785 4 4 * Plugin URI: https://wordpress.org/plugins/courier-notices 5 5 * Description: A way to display, manage, and control front end notifications for your WordPress install. 6 * Version: 1.4. 56 * Version: 1.4.6 7 7 * Author: Linchpin 8 8 * Author URI: https://linchpin.com … … 23 23 24 24 if ( ! defined( 'COURIER_NOTICES_VERSION' ) ) { 25 define( 'COURIER_NOTICES_VERSION', '1.4. 5' );25 define( 'COURIER_NOTICES_VERSION', '1.4.6' ); 26 26 } 27 27 28 28 if ( ! defined( 'COURIER_NOTICES_RELEASE_DATE' ) ) { 29 define( 'COURIER_NOTICES_RELEASE_DATE', '0 3/24/2022' );29 define( 'COURIER_NOTICES_RELEASE_DATE', '05/24/2022' ); 30 30 } 31 31 -
courier-notices/tags/1.4.6/courier-notices/CHANGELOG.md
r2699180 r2730785 6 6 7 7 ## [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 8 14 9 15 ## [1.4.5] - 2022-03-24 -
courier-notices/tags/1.4.6/courier-notices/courier-notices.php
r2699180 r2730785 4 4 * Plugin URI: https://wordpress.org/plugins/courier-notices 5 5 * Description: A way to display, manage, and control front end notifications for your WordPress install. 6 * Version: 1.4. 56 * Version: 1.4.6 7 7 * Author: Linchpin 8 8 * Author URI: https://linchpin.com … … 23 23 24 24 if ( ! defined( 'COURIER_NOTICES_VERSION' ) ) { 25 define( 'COURIER_NOTICES_VERSION', '1.4. 5' );25 define( 'COURIER_NOTICES_VERSION', '1.4.6' ); 26 26 } 27 27 28 28 if ( ! defined( 'COURIER_NOTICES_RELEASE_DATE' ) ) { 29 define( 'COURIER_NOTICES_RELEASE_DATE', '0 3/24/2022' );29 define( 'COURIER_NOTICES_RELEASE_DATE', '05/24/2022' ); 30 30 } 31 31 -
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 17 17 048644398ce6: Pulling fs layer 18 18 d51a319c6584: Pulling fs layer 19 1766f36e2432: Waiting 19 20 4c13e0891ac6: Waiting 20 1766f36e2432: Waiting21 21 96910ad0ba0c: Waiting 22 22 0e19de6ed54b: Waiting 23 23 048644398ce6: Waiting 24 24 d51a319c6584: Waiting 25 2bc599114627: Verifying Checksum26 2bc599114627: Download complete27 7c7da25b2876: Download complete28 25 927a0b37a45a: Verifying Checksum 29 26 927a0b37a45a: Download complete 27 2bc599114627: Download complete 28 7c7da25b2876: Verifying Checksum 29 7c7da25b2876: Download complete 30 30 4c13e0891ac6: Verifying Checksum 31 31 4c13e0891ac6: Download complete 32 32 7c7da25b2876: Pull complete 33 0e19de6ed54b: Downloadcomplete33 2bc599114627: Pull complete 34 34 1766f36e2432: Verifying Checksum 35 35 1766f36e2432: Download complete 36 2bc599114627: Pull complete36 927a0b37a45a: Pull complete 37 37 96910ad0ba0c: Verifying Checksum 38 38 96910ad0ba0c: Download complete 39 927a0b37a45a: Pull complete 39 0e19de6ed54b: Verifying Checksum 40 0e19de6ed54b: Download complete 41 1766f36e2432: Pull complete 42 4c13e0891ac6: Pull complete 40 43 048644398ce6: Verifying Checksum 41 44 048644398ce6: Download complete 42 1766f36e2432: Pull complete43 4c13e0891ac6: Pull complete44 45 d51a319c6584: Verifying Checksum 45 46 d51a319c6584: Download complete -
courier-notices/tags/1.4.6/courier-notices/package.json
r2699180 r2730785 1 1 { 2 2 "name": "courier-notices", 3 "version": "1.4. 5",3 "version": "1.4.6", 4 4 "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.", 5 5 "main": "gulpfile.babel.js", … … 16 16 "save-dev": "0.0.1-security", 17 17 "through2": "4.0.2", 18 "what-input": "5.2.1 0"18 "what-input": "5.2.11" 19 19 }, 20 20 "devDependencies": { 21 "@babel/core": "7.1 7.2",22 "@babel/preset-env": "7.1 6.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", 27 27 "gulp": "4.0.2", 28 28 "gulp-babel": "8.0.0", … … 43 43 "kind-of": "6.0.3", 44 44 "node-sass": "^7.0.1", 45 "postcss": "^8.4. 6",45 "postcss": "^8.4.14", 46 46 "rimraf": "3.0.2", 47 47 "vinyl-named": "1.1.0", 48 "webpack": "5. 68.0",48 "webpack": "5.72.1", 49 49 "webpack-stream": "7.0.0", 50 "yargs": "17. 3.1"50 "yargs": "17.5.1" 51 51 }, 52 52 "repository": { … … 59 59 }, 60 60 "engines": { 61 "node": ">= 14.10.0"61 "node": ">= v14.19.3" 62 62 }, 63 63 "browserslist": [ -
courier-notices/tags/1.4.6/courier-notices/readme.txt
r2699180 r2730785 4 4 Requires at least: 5.0 5 5 Tested up to: 5.9 6 Stable tag: 1.4. 56 Stable tag: 1.4.6 7 7 Requires PHP: 7.3 8 8 License: GPLv2 or later -
courier-notices/tags/1.4.6/courier-notices/src/Controller/Courier_REST_Controller.php
r2676712 r2730785 36 36 $namespace, 37 37 '/' . $base . '/(?P<notice_id>\d+)/', 38 array(39 array(38 [ 39 [ 40 40 '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 ] 46 46 ); 47 47 … … 50 50 $namespace, 51 51 '/' . $base . '/(?P<notice_id>\d+)/dismiss', 52 array(53 array(52 [ 53 [ 54 54 '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. 63 63 register_rest_route( 64 64 $namespace, 65 65 '/notices/display/', 66 array(67 array(66 [ 67 [ 68 68 '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' => [ 73 73 'description' => esc_html__( 'Set where the notices should display.', 'courier-notices' ), 74 74 'type' => 'string', 75 75 'sanitize_callback' => 'sanitize_text_field', 76 76 'validate_callback' => 'rest_validate_request_arg', 77 ),78 'format' => array(77 ], 78 'format' => [ 79 79 'description' => esc_html__( 'Set the response, either html or json.', 'courier-notices' ), 80 80 'type' => 'string', 81 81 'sanitize_callback' => 'sanitize_text_field', 82 82 '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 ] 87 98 ); 88 99 … … 100 111 */ 101 112 public function get_notice( WP_REST_Request $request ) { 102 $data = array();103 104 $args = array(113 $data = []; 114 115 $args = [ 105 116 'post_type' => 'courier_notice', 106 117 'post_status' => 'publish', … … 108 119 'posts_per_page' => 1, 109 120 'p' => (int) $request['notice_id'], 110 );121 ]; 111 122 112 123 $search = new \WP_Query( $args ); … … 161 172 162 173 if ( empty( $notifications ) ) { 163 $notifications = array();174 $notifications = []; 164 175 } 165 176 … … 199 210 */ 200 211 public function display_notices( WP_REST_Request $request ) { 201 $defaults = array(212 $defaults = [ 202 213 'user_id' => '', 203 214 'include_global' => true, … … 207 218 'number' => 10, // @todo this should be a setting. 208 219 'placement' => 'header', 209 'query_args' => array(),210 );220 'query_args' => [], 221 ]; 211 222 212 223 $defaults = apply_filters( 'courier_notices_get_notices_default_settings', $defaults ); 213 224 $args = wp_parse_args( 214 array(225 [ 215 226 'contentType' => $request->get_param( 'contentType' ), 216 227 'placement' => $request->get_param( 'placement' ), 217 228 'format' => $request->get_param( 'format' ), 218 ),229 ], 219 230 $defaults 220 231 ); … … 225 236 226 237 if ( 'html' === $args['format'] ) { 227 $notices = array();238 $notices = []; 228 239 229 240 foreach ( $notice_posts as $courier_notice ) { … … 315 326 return array( 316 327 'page' => array( 317 'description' => 'Current page of the collection.',328 'description' => __( 'Current page of the collection.', 'courier-notices' ), 318 329 'type' => 'integer', 319 330 'default' => 1, … … 321 332 ), 322 333 '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' ), 324 335 'type' => 'integer', 325 336 'default' => 100, … … 327 338 ), 328 339 'search' => array( 329 'description' => 'Limit results to those matching a string.',340 'description' => __( 'Limit results to those matching a string.', 'courier-notices' ), 330 341 'type' => 'string', 331 342 'sanitize_callback' => 'sanitize_text_field', -
courier-notices/tags/1.4.6/courier-notices/vendor/autoload.php
r2699180 r2730785 3 3 // autoload.php @generated by Composer 4 4 5 if (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 5 10 require_once __DIR__ . '/composer/autoload_real.php'; 6 11 7 return ComposerAutoloaderInit8 3edf73b15e0c05f977ad1f815506f66::getLoader();12 return ComposerAutoloaderInit8a6b813a521d45538abe4ce7229f355a::getLoader(); -
courier-notices/tags/1.4.6/courier-notices/vendor/composer/InstalledVersions.php
r2676712 r2730785 22 22 * 23 23 * To require its presence, you can require `composer-runtime-api ^2.0` 24 * 25 * @final 24 26 */ 25 27 class InstalledVersions -
courier-notices/tags/1.4.6/courier-notices/vendor/composer/autoload_classmap.php
r2676712 r2730785 3 3 // autoload_classmap.php @generated by Composer 4 4 5 $vendorDir = dirname( dirname(__FILE__));5 $vendorDir = dirname(__DIR__); 6 6 $baseDir = dirname($vendorDir); 7 7 -
courier-notices/tags/1.4.6/courier-notices/vendor/composer/autoload_namespaces.php
r2676712 r2730785 3 3 // autoload_namespaces.php @generated by Composer 4 4 5 $vendorDir = dirname( dirname(__FILE__));5 $vendorDir = dirname(__DIR__); 6 6 $baseDir = dirname($vendorDir); 7 7 -
courier-notices/tags/1.4.6/courier-notices/vendor/composer/autoload_psr4.php
r2676712 r2730785 3 3 // autoload_psr4.php @generated by Composer 4 4 5 $vendorDir = dirname( dirname(__FILE__));5 $vendorDir = dirname(__DIR__); 6 6 $baseDir = dirname($vendorDir); 7 7 -
courier-notices/tags/1.4.6/courier-notices/vendor/composer/autoload_real.php
r2699180 r2730785 3 3 // autoload_real.php @generated by Composer 4 4 5 class ComposerAutoloaderInit8 3edf73b15e0c05f977ad1f815506f665 class ComposerAutoloaderInit8a6b813a521d45538abe4ce7229f355a 6 6 { 7 7 private static $loader; … … 25 25 require __DIR__ . '/platform_check.php'; 26 26 27 spl_autoload_register(array('ComposerAutoloaderInit8 3edf73b15e0c05f977ad1f815506f66', 'loadClassLoader'), true, true);28 self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname( \dirname(__FILE__)));29 spl_autoload_unregister(array('ComposerAutoloaderInit8 3edf73b15e0c05f977ad1f815506f66', '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')); 30 30 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)); 52 33 53 34 $loader->register(true); -
courier-notices/tags/1.4.6/courier-notices/vendor/composer/autoload_static.php
r2699180 r2730785 5 5 namespace Composer\Autoload; 6 6 7 class ComposerStaticInit8 3edf73b15e0c05f977ad1f815506f667 class ComposerStaticInit8a6b813a521d45538abe4ce7229f355a 8 8 { 9 9 public static $prefixLengthsPsr4 = array ( … … 38 38 { 39 39 return \Closure::bind(function () use ($loader) { 40 $loader->prefixLengthsPsr4 = ComposerStaticInit8 3edf73b15e0c05f977ad1f815506f66::$prefixLengthsPsr4;41 $loader->prefixDirsPsr4 = ComposerStaticInit8 3edf73b15e0c05f977ad1f815506f66::$prefixDirsPsr4;42 $loader->prefixesPsr0 = ComposerStaticInit8 3edf73b15e0c05f977ad1f815506f66::$prefixesPsr0;43 $loader->classMap = ComposerStaticInit8 3edf73b15e0c05f977ad1f815506f66::$classMap;40 $loader->prefixLengthsPsr4 = ComposerStaticInit8a6b813a521d45538abe4ce7229f355a::$prefixLengthsPsr4; 41 $loader->prefixDirsPsr4 = ComposerStaticInit8a6b813a521d45538abe4ce7229f355a::$prefixDirsPsr4; 42 $loader->prefixesPsr0 = ComposerStaticInit8a6b813a521d45538abe4ce7229f355a::$prefixesPsr0; 43 $loader->classMap = ComposerStaticInit8a6b813a521d45538abe4ce7229f355a::$classMap; 44 44 45 45 }, null, ClassLoader::class); -
courier-notices/tags/1.4.6/courier-notices/vendor/composer/installed.php
r2699180 r2730785 1 1 <?php return array( 2 2 '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', 5 5 'type' => 'wordpress-plugin', 6 6 'install_path' => __DIR__ . '/../../', … … 21 21 ), 22 22 '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', 25 25 'type' => 'wordpress-plugin', 26 26 '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 17 17 048644398ce6: Pulling fs layer 18 18 d51a319c6584: Pulling fs layer 19 1766f36e2432: Waiting 19 20 4c13e0891ac6: Waiting 20 1766f36e2432: Waiting21 21 96910ad0ba0c: Waiting 22 22 0e19de6ed54b: Waiting 23 23 048644398ce6: Waiting 24 24 d51a319c6584: Waiting 25 2bc599114627: Verifying Checksum26 2bc599114627: Download complete27 7c7da25b2876: Download complete28 25 927a0b37a45a: Verifying Checksum 29 26 927a0b37a45a: Download complete 27 2bc599114627: Download complete 28 7c7da25b2876: Verifying Checksum 29 7c7da25b2876: Download complete 30 30 4c13e0891ac6: Verifying Checksum 31 31 4c13e0891ac6: Download complete 32 32 7c7da25b2876: Pull complete 33 0e19de6ed54b: Downloadcomplete33 2bc599114627: Pull complete 34 34 1766f36e2432: Verifying Checksum 35 35 1766f36e2432: Download complete 36 2bc599114627: Pull complete36 927a0b37a45a: Pull complete 37 37 96910ad0ba0c: Verifying Checksum 38 38 96910ad0ba0c: Download complete 39 927a0b37a45a: Pull complete 39 0e19de6ed54b: Verifying Checksum 40 0e19de6ed54b: Download complete 41 1766f36e2432: Pull complete 42 4c13e0891ac6: Pull complete 40 43 048644398ce6: Verifying Checksum 41 44 048644398ce6: Download complete 42 1766f36e2432: Pull complete43 4c13e0891ac6: Pull complete44 45 d51a319c6584: Verifying Checksum 45 46 d51a319c6584: Download complete -
courier-notices/tags/1.4.6/package.json
r2699180 r2730785 1 1 { 2 2 "name": "courier-notices", 3 "version": "1.4. 5",3 "version": "1.4.6", 4 4 "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.", 5 5 "main": "gulpfile.babel.js", … … 16 16 "save-dev": "0.0.1-security", 17 17 "through2": "4.0.2", 18 "what-input": "5.2.1 0"18 "what-input": "5.2.11" 19 19 }, 20 20 "devDependencies": { 21 "@babel/core": "7.1 7.2",22 "@babel/preset-env": "7.1 6.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", 27 27 "gulp": "4.0.2", 28 28 "gulp-babel": "8.0.0", … … 43 43 "kind-of": "6.0.3", 44 44 "node-sass": "^7.0.1", 45 "postcss": "^8.4. 6",45 "postcss": "^8.4.14", 46 46 "rimraf": "3.0.2", 47 47 "vinyl-named": "1.1.0", 48 "webpack": "5. 68.0",48 "webpack": "5.72.1", 49 49 "webpack-stream": "7.0.0", 50 "yargs": "17. 3.1"50 "yargs": "17.5.1" 51 51 }, 52 52 "repository": { … … 59 59 }, 60 60 "engines": { 61 "node": ">= 14.10.0"61 "node": ">= v14.19.3" 62 62 }, 63 63 "browserslist": [ -
courier-notices/tags/1.4.6/readme.txt
r2699180 r2730785 4 4 Requires at least: 5.0 5 5 Tested up to: 5.9 6 Stable tag: 1.4. 56 Stable tag: 1.4.6 7 7 Requires PHP: 7.3 8 8 License: GPLv2 or later -
courier-notices/tags/1.4.6/src/Controller/Courier_REST_Controller.php
r2676052 r2730785 36 36 $namespace, 37 37 '/' . $base . '/(?P<notice_id>\d+)/', 38 array(39 array(38 [ 39 [ 40 40 '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 ] 46 46 ); 47 47 … … 50 50 $namespace, 51 51 '/' . $base . '/(?P<notice_id>\d+)/dismiss', 52 array(53 array(52 [ 53 [ 54 54 '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. 63 63 register_rest_route( 64 64 $namespace, 65 65 '/notices/display/', 66 array(67 array(66 [ 67 [ 68 68 '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' => [ 73 73 'description' => esc_html__( 'Set where the notices should display.', 'courier-notices' ), 74 74 'type' => 'string', 75 75 'sanitize_callback' => 'sanitize_text_field', 76 76 'validate_callback' => 'rest_validate_request_arg', 77 ),78 'format' => array(77 ], 78 'format' => [ 79 79 'description' => esc_html__( 'Set the response, either html or json.', 'courier-notices' ), 80 80 'type' => 'string', 81 81 'sanitize_callback' => 'sanitize_text_field', 82 82 '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 ] 87 98 ); 88 99 … … 100 111 */ 101 112 public function get_notice( WP_REST_Request $request ) { 102 $data = array();103 104 $args = array(113 $data = []; 114 115 $args = [ 105 116 'post_type' => 'courier_notice', 106 117 'post_status' => 'publish', … … 108 119 'posts_per_page' => 1, 109 120 'p' => (int) $request['notice_id'], 110 );121 ]; 111 122 112 123 $search = new \WP_Query( $args ); … … 161 172 162 173 if ( empty( $notifications ) ) { 163 $notifications = array();174 $notifications = []; 164 175 } 165 176 … … 199 210 */ 200 211 public function display_notices( WP_REST_Request $request ) { 201 $defaults = array(212 $defaults = [ 202 213 'user_id' => '', 203 214 'include_global' => true, … … 207 218 'number' => 10, // @todo this should be a setting. 208 219 'placement' => 'header', 209 'query_args' => array(),210 );220 'query_args' => [], 221 ]; 211 222 212 223 $defaults = apply_filters( 'courier_notices_get_notices_default_settings', $defaults ); 213 224 $args = wp_parse_args( 214 array(225 [ 215 226 'contentType' => $request->get_param( 'contentType' ), 216 227 'placement' => $request->get_param( 'placement' ), 217 228 'format' => $request->get_param( 'format' ), 218 ),229 ], 219 230 $defaults 220 231 ); … … 225 236 226 237 if ( 'html' === $args['format'] ) { 227 $notices = array();238 $notices = []; 228 239 229 240 foreach ( $notice_posts as $courier_notice ) { … … 315 326 return array( 316 327 'page' => array( 317 'description' => 'Current page of the collection.',328 'description' => __( 'Current page of the collection.', 'courier-notices' ), 318 329 'type' => 'integer', 319 330 'default' => 1, … … 321 332 ), 322 333 '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' ), 324 335 'type' => 'integer', 325 336 'default' => 100, … … 327 338 ), 328 339 'search' => array( 329 'description' => 'Limit results to those matching a string.',340 'description' => __( 'Limit results to those matching a string.', 'courier-notices' ), 330 341 'type' => 'string', 331 342 'sanitize_callback' => 'sanitize_text_field', -
courier-notices/tags/1.4.6/vendor/autoload.php
r2699180 r2730785 3 3 // autoload.php @generated by Composer 4 4 5 if (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 5 10 require_once __DIR__ . '/composer/autoload_real.php'; 6 11 7 return ComposerAutoloaderInit8 3edf73b15e0c05f977ad1f815506f66::getLoader();12 return ComposerAutoloaderInit8a6b813a521d45538abe4ce7229f355a::getLoader(); -
courier-notices/tags/1.4.6/vendor/composer/InstalledVersions.php
r2675851 r2730785 22 22 * 23 23 * To require its presence, you can require `composer-runtime-api ^2.0` 24 * 25 * @final 24 26 */ 25 27 class InstalledVersions -
courier-notices/tags/1.4.6/vendor/composer/autoload_classmap.php
r2676052 r2730785 3 3 // autoload_classmap.php @generated by Composer 4 4 5 $vendorDir = dirname( dirname(__FILE__));5 $vendorDir = dirname(__DIR__); 6 6 $baseDir = dirname($vendorDir); 7 7 -
courier-notices/tags/1.4.6/vendor/composer/autoload_namespaces.php
r2344125 r2730785 3 3 // autoload_namespaces.php @generated by Composer 4 4 5 $vendorDir = dirname( dirname(__FILE__));5 $vendorDir = dirname(__DIR__); 6 6 $baseDir = dirname($vendorDir); 7 7 -
courier-notices/tags/1.4.6/vendor/composer/autoload_psr4.php
r2676052 r2730785 3 3 // autoload_psr4.php @generated by Composer 4 4 5 $vendorDir = dirname( dirname(__FILE__));5 $vendorDir = dirname(__DIR__); 6 6 $baseDir = dirname($vendorDir); 7 7 -
courier-notices/tags/1.4.6/vendor/composer/autoload_real.php
r2699180 r2730785 3 3 // autoload_real.php @generated by Composer 4 4 5 class ComposerAutoloaderInit8 3edf73b15e0c05f977ad1f815506f665 class ComposerAutoloaderInit8a6b813a521d45538abe4ce7229f355a 6 6 { 7 7 private static $loader; … … 25 25 require __DIR__ . '/platform_check.php'; 26 26 27 spl_autoload_register(array('ComposerAutoloaderInit8 3edf73b15e0c05f977ad1f815506f66', 'loadClassLoader'), true, true);28 self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname( \dirname(__FILE__)));29 spl_autoload_unregister(array('ComposerAutoloaderInit8 3edf73b15e0c05f977ad1f815506f66', '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')); 30 30 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)); 52 33 53 34 $loader->register(true); -
courier-notices/tags/1.4.6/vendor/composer/autoload_static.php
r2699180 r2730785 5 5 namespace Composer\Autoload; 6 6 7 class ComposerStaticInit8 3edf73b15e0c05f977ad1f815506f667 class ComposerStaticInit8a6b813a521d45538abe4ce7229f355a 8 8 { 9 9 public static $prefixLengthsPsr4 = array ( … … 38 38 { 39 39 return \Closure::bind(function () use ($loader) { 40 $loader->prefixLengthsPsr4 = ComposerStaticInit8 3edf73b15e0c05f977ad1f815506f66::$prefixLengthsPsr4;41 $loader->prefixDirsPsr4 = ComposerStaticInit8 3edf73b15e0c05f977ad1f815506f66::$prefixDirsPsr4;42 $loader->prefixesPsr0 = ComposerStaticInit8 3edf73b15e0c05f977ad1f815506f66::$prefixesPsr0;43 $loader->classMap = ComposerStaticInit8 3edf73b15e0c05f977ad1f815506f66::$classMap;40 $loader->prefixLengthsPsr4 = ComposerStaticInit8a6b813a521d45538abe4ce7229f355a::$prefixLengthsPsr4; 41 $loader->prefixDirsPsr4 = ComposerStaticInit8a6b813a521d45538abe4ce7229f355a::$prefixDirsPsr4; 42 $loader->prefixesPsr0 = ComposerStaticInit8a6b813a521d45538abe4ce7229f355a::$prefixesPsr0; 43 $loader->classMap = ComposerStaticInit8a6b813a521d45538abe4ce7229f355a::$classMap; 44 44 45 45 }, null, ClassLoader::class); -
courier-notices/tags/1.4.6/vendor/composer/installed.php
r2699180 r2730785 1 1 <?php return array( 2 2 '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', 5 5 'type' => 'wordpress-plugin', 6 6 'install_path' => __DIR__ . '/../../', … … 21 21 ), 22 22 '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', 25 25 'type' => 'wordpress-plugin', 26 26 'install_path' => __DIR__ . '/../../', -
courier-notices/trunk/CHANGELOG.md
r2699180 r2730785 6 6 7 7 ## [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 8 14 9 15 ## [1.4.5] - 2022-03-24 -
courier-notices/trunk/courier-notices.php
r2699180 r2730785 4 4 * Plugin URI: https://wordpress.org/plugins/courier-notices 5 5 * Description: A way to display, manage, and control front end notifications for your WordPress install. 6 * Version: 1.4. 56 * Version: 1.4.6 7 7 * Author: Linchpin 8 8 * Author URI: https://linchpin.com … … 23 23 24 24 if ( ! defined( 'COURIER_NOTICES_VERSION' ) ) { 25 define( 'COURIER_NOTICES_VERSION', '1.4. 5' );25 define( 'COURIER_NOTICES_VERSION', '1.4.6' ); 26 26 } 27 27 28 28 if ( ! defined( 'COURIER_NOTICES_RELEASE_DATE' ) ) { 29 define( 'COURIER_NOTICES_RELEASE_DATE', '0 3/24/2022' );29 define( 'COURIER_NOTICES_RELEASE_DATE', '05/24/2022' ); 30 30 } 31 31 -
courier-notices/trunk/courier-notices/CHANGELOG.md
r2699180 r2730785 6 6 7 7 ## [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 8 14 9 15 ## [1.4.5] - 2022-03-24 -
courier-notices/trunk/courier-notices/courier-notices.php
r2699180 r2730785 4 4 * Plugin URI: https://wordpress.org/plugins/courier-notices 5 5 * Description: A way to display, manage, and control front end notifications for your WordPress install. 6 * Version: 1.4. 56 * Version: 1.4.6 7 7 * Author: Linchpin 8 8 * Author URI: https://linchpin.com … … 23 23 24 24 if ( ! defined( 'COURIER_NOTICES_VERSION' ) ) { 25 define( 'COURIER_NOTICES_VERSION', '1.4. 5' );25 define( 'COURIER_NOTICES_VERSION', '1.4.6' ); 26 26 } 27 27 28 28 if ( ! defined( 'COURIER_NOTICES_RELEASE_DATE' ) ) { 29 define( 'COURIER_NOTICES_RELEASE_DATE', '0 3/24/2022' );29 define( 'COURIER_NOTICES_RELEASE_DATE', '05/24/2022' ); 30 30 } 31 31 -
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 17 17 048644398ce6: Pulling fs layer 18 18 d51a319c6584: Pulling fs layer 19 1766f36e2432: Waiting 19 20 4c13e0891ac6: Waiting 20 1766f36e2432: Waiting21 21 96910ad0ba0c: Waiting 22 22 0e19de6ed54b: Waiting 23 23 048644398ce6: Waiting 24 24 d51a319c6584: Waiting 25 2bc599114627: Verifying Checksum26 2bc599114627: Download complete27 7c7da25b2876: Download complete28 25 927a0b37a45a: Verifying Checksum 29 26 927a0b37a45a: Download complete 27 2bc599114627: Download complete 28 7c7da25b2876: Verifying Checksum 29 7c7da25b2876: Download complete 30 30 4c13e0891ac6: Verifying Checksum 31 31 4c13e0891ac6: Download complete 32 32 7c7da25b2876: Pull complete 33 0e19de6ed54b: Downloadcomplete33 2bc599114627: Pull complete 34 34 1766f36e2432: Verifying Checksum 35 35 1766f36e2432: Download complete 36 2bc599114627: Pull complete36 927a0b37a45a: Pull complete 37 37 96910ad0ba0c: Verifying Checksum 38 38 96910ad0ba0c: Download complete 39 927a0b37a45a: Pull complete 39 0e19de6ed54b: Verifying Checksum 40 0e19de6ed54b: Download complete 41 1766f36e2432: Pull complete 42 4c13e0891ac6: Pull complete 40 43 048644398ce6: Verifying Checksum 41 44 048644398ce6: Download complete 42 1766f36e2432: Pull complete43 4c13e0891ac6: Pull complete44 45 d51a319c6584: Verifying Checksum 45 46 d51a319c6584: Download complete -
courier-notices/trunk/courier-notices/package.json
r2699180 r2730785 1 1 { 2 2 "name": "courier-notices", 3 "version": "1.4. 5",3 "version": "1.4.6", 4 4 "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.", 5 5 "main": "gulpfile.babel.js", … … 16 16 "save-dev": "0.0.1-security", 17 17 "through2": "4.0.2", 18 "what-input": "5.2.1 0"18 "what-input": "5.2.11" 19 19 }, 20 20 "devDependencies": { 21 "@babel/core": "7.1 7.2",22 "@babel/preset-env": "7.1 6.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", 27 27 "gulp": "4.0.2", 28 28 "gulp-babel": "8.0.0", … … 43 43 "kind-of": "6.0.3", 44 44 "node-sass": "^7.0.1", 45 "postcss": "^8.4. 6",45 "postcss": "^8.4.14", 46 46 "rimraf": "3.0.2", 47 47 "vinyl-named": "1.1.0", 48 "webpack": "5. 68.0",48 "webpack": "5.72.1", 49 49 "webpack-stream": "7.0.0", 50 "yargs": "17. 3.1"50 "yargs": "17.5.1" 51 51 }, 52 52 "repository": { … … 59 59 }, 60 60 "engines": { 61 "node": ">= 14.10.0"61 "node": ">= v14.19.3" 62 62 }, 63 63 "browserslist": [ -
courier-notices/trunk/courier-notices/readme.txt
r2699180 r2730785 4 4 Requires at least: 5.0 5 5 Tested up to: 5.9 6 Stable tag: 1.4. 56 Stable tag: 1.4.6 7 7 Requires PHP: 7.3 8 8 License: GPLv2 or later -
courier-notices/trunk/courier-notices/src/Controller/Courier_REST_Controller.php
r2676712 r2730785 36 36 $namespace, 37 37 '/' . $base . '/(?P<notice_id>\d+)/', 38 array(39 array(38 [ 39 [ 40 40 '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 ] 46 46 ); 47 47 … … 50 50 $namespace, 51 51 '/' . $base . '/(?P<notice_id>\d+)/dismiss', 52 array(53 array(52 [ 53 [ 54 54 '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. 63 63 register_rest_route( 64 64 $namespace, 65 65 '/notices/display/', 66 array(67 array(66 [ 67 [ 68 68 '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' => [ 73 73 'description' => esc_html__( 'Set where the notices should display.', 'courier-notices' ), 74 74 'type' => 'string', 75 75 'sanitize_callback' => 'sanitize_text_field', 76 76 'validate_callback' => 'rest_validate_request_arg', 77 ),78 'format' => array(77 ], 78 'format' => [ 79 79 'description' => esc_html__( 'Set the response, either html or json.', 'courier-notices' ), 80 80 'type' => 'string', 81 81 'sanitize_callback' => 'sanitize_text_field', 82 82 '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 ] 87 98 ); 88 99 … … 100 111 */ 101 112 public function get_notice( WP_REST_Request $request ) { 102 $data = array();103 104 $args = array(113 $data = []; 114 115 $args = [ 105 116 'post_type' => 'courier_notice', 106 117 'post_status' => 'publish', … … 108 119 'posts_per_page' => 1, 109 120 'p' => (int) $request['notice_id'], 110 );121 ]; 111 122 112 123 $search = new \WP_Query( $args ); … … 161 172 162 173 if ( empty( $notifications ) ) { 163 $notifications = array();174 $notifications = []; 164 175 } 165 176 … … 199 210 */ 200 211 public function display_notices( WP_REST_Request $request ) { 201 $defaults = array(212 $defaults = [ 202 213 'user_id' => '', 203 214 'include_global' => true, … … 207 218 'number' => 10, // @todo this should be a setting. 208 219 'placement' => 'header', 209 'query_args' => array(),210 );220 'query_args' => [], 221 ]; 211 222 212 223 $defaults = apply_filters( 'courier_notices_get_notices_default_settings', $defaults ); 213 224 $args = wp_parse_args( 214 array(225 [ 215 226 'contentType' => $request->get_param( 'contentType' ), 216 227 'placement' => $request->get_param( 'placement' ), 217 228 'format' => $request->get_param( 'format' ), 218 ),229 ], 219 230 $defaults 220 231 ); … … 225 236 226 237 if ( 'html' === $args['format'] ) { 227 $notices = array();238 $notices = []; 228 239 229 240 foreach ( $notice_posts as $courier_notice ) { … … 315 326 return array( 316 327 'page' => array( 317 'description' => 'Current page of the collection.',328 'description' => __( 'Current page of the collection.', 'courier-notices' ), 318 329 'type' => 'integer', 319 330 'default' => 1, … … 321 332 ), 322 333 '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' ), 324 335 'type' => 'integer', 325 336 'default' => 100, … … 327 338 ), 328 339 'search' => array( 329 'description' => 'Limit results to those matching a string.',340 'description' => __( 'Limit results to those matching a string.', 'courier-notices' ), 330 341 'type' => 'string', 331 342 'sanitize_callback' => 'sanitize_text_field', -
courier-notices/trunk/courier-notices/vendor/autoload.php
r2699180 r2730785 3 3 // autoload.php @generated by Composer 4 4 5 if (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 5 10 require_once __DIR__ . '/composer/autoload_real.php'; 6 11 7 return ComposerAutoloaderInit8 3edf73b15e0c05f977ad1f815506f66::getLoader();12 return ComposerAutoloaderInit8a6b813a521d45538abe4ce7229f355a::getLoader(); -
courier-notices/trunk/courier-notices/vendor/composer/InstalledVersions.php
r2676712 r2730785 22 22 * 23 23 * To require its presence, you can require `composer-runtime-api ^2.0` 24 * 25 * @final 24 26 */ 25 27 class InstalledVersions -
courier-notices/trunk/courier-notices/vendor/composer/autoload_classmap.php
r2676712 r2730785 3 3 // autoload_classmap.php @generated by Composer 4 4 5 $vendorDir = dirname( dirname(__FILE__));5 $vendorDir = dirname(__DIR__); 6 6 $baseDir = dirname($vendorDir); 7 7 -
courier-notices/trunk/courier-notices/vendor/composer/autoload_namespaces.php
r2676712 r2730785 3 3 // autoload_namespaces.php @generated by Composer 4 4 5 $vendorDir = dirname( dirname(__FILE__));5 $vendorDir = dirname(__DIR__); 6 6 $baseDir = dirname($vendorDir); 7 7 -
courier-notices/trunk/courier-notices/vendor/composer/autoload_psr4.php
r2676712 r2730785 3 3 // autoload_psr4.php @generated by Composer 4 4 5 $vendorDir = dirname( dirname(__FILE__));5 $vendorDir = dirname(__DIR__); 6 6 $baseDir = dirname($vendorDir); 7 7 -
courier-notices/trunk/courier-notices/vendor/composer/autoload_real.php
r2699180 r2730785 3 3 // autoload_real.php @generated by Composer 4 4 5 class ComposerAutoloaderInit8 3edf73b15e0c05f977ad1f815506f665 class ComposerAutoloaderInit8a6b813a521d45538abe4ce7229f355a 6 6 { 7 7 private static $loader; … … 25 25 require __DIR__ . '/platform_check.php'; 26 26 27 spl_autoload_register(array('ComposerAutoloaderInit8 3edf73b15e0c05f977ad1f815506f66', 'loadClassLoader'), true, true);28 self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname( \dirname(__FILE__)));29 spl_autoload_unregister(array('ComposerAutoloaderInit8 3edf73b15e0c05f977ad1f815506f66', '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')); 30 30 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)); 52 33 53 34 $loader->register(true); -
courier-notices/trunk/courier-notices/vendor/composer/autoload_static.php
r2699180 r2730785 5 5 namespace Composer\Autoload; 6 6 7 class ComposerStaticInit8 3edf73b15e0c05f977ad1f815506f667 class ComposerStaticInit8a6b813a521d45538abe4ce7229f355a 8 8 { 9 9 public static $prefixLengthsPsr4 = array ( … … 38 38 { 39 39 return \Closure::bind(function () use ($loader) { 40 $loader->prefixLengthsPsr4 = ComposerStaticInit8 3edf73b15e0c05f977ad1f815506f66::$prefixLengthsPsr4;41 $loader->prefixDirsPsr4 = ComposerStaticInit8 3edf73b15e0c05f977ad1f815506f66::$prefixDirsPsr4;42 $loader->prefixesPsr0 = ComposerStaticInit8 3edf73b15e0c05f977ad1f815506f66::$prefixesPsr0;43 $loader->classMap = ComposerStaticInit8 3edf73b15e0c05f977ad1f815506f66::$classMap;40 $loader->prefixLengthsPsr4 = ComposerStaticInit8a6b813a521d45538abe4ce7229f355a::$prefixLengthsPsr4; 41 $loader->prefixDirsPsr4 = ComposerStaticInit8a6b813a521d45538abe4ce7229f355a::$prefixDirsPsr4; 42 $loader->prefixesPsr0 = ComposerStaticInit8a6b813a521d45538abe4ce7229f355a::$prefixesPsr0; 43 $loader->classMap = ComposerStaticInit8a6b813a521d45538abe4ce7229f355a::$classMap; 44 44 45 45 }, null, ClassLoader::class); -
courier-notices/trunk/courier-notices/vendor/composer/installed.php
r2699180 r2730785 1 1 <?php return array( 2 2 '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', 5 5 'type' => 'wordpress-plugin', 6 6 'install_path' => __DIR__ . '/../../', … … 21 21 ), 22 22 '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', 25 25 'type' => 'wordpress-plugin', 26 26 '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 17 17 048644398ce6: Pulling fs layer 18 18 d51a319c6584: Pulling fs layer 19 1766f36e2432: Waiting 19 20 4c13e0891ac6: Waiting 20 1766f36e2432: Waiting21 21 96910ad0ba0c: Waiting 22 22 0e19de6ed54b: Waiting 23 23 048644398ce6: Waiting 24 24 d51a319c6584: Waiting 25 2bc599114627: Verifying Checksum26 2bc599114627: Download complete27 7c7da25b2876: Download complete28 25 927a0b37a45a: Verifying Checksum 29 26 927a0b37a45a: Download complete 27 2bc599114627: Download complete 28 7c7da25b2876: Verifying Checksum 29 7c7da25b2876: Download complete 30 30 4c13e0891ac6: Verifying Checksum 31 31 4c13e0891ac6: Download complete 32 32 7c7da25b2876: Pull complete 33 0e19de6ed54b: Downloadcomplete33 2bc599114627: Pull complete 34 34 1766f36e2432: Verifying Checksum 35 35 1766f36e2432: Download complete 36 2bc599114627: Pull complete36 927a0b37a45a: Pull complete 37 37 96910ad0ba0c: Verifying Checksum 38 38 96910ad0ba0c: Download complete 39 927a0b37a45a: Pull complete 39 0e19de6ed54b: Verifying Checksum 40 0e19de6ed54b: Download complete 41 1766f36e2432: Pull complete 42 4c13e0891ac6: Pull complete 40 43 048644398ce6: Verifying Checksum 41 44 048644398ce6: Download complete 42 1766f36e2432: Pull complete43 4c13e0891ac6: Pull complete44 45 d51a319c6584: Verifying Checksum 45 46 d51a319c6584: Download complete -
courier-notices/trunk/package.json
r2699180 r2730785 1 1 { 2 2 "name": "courier-notices", 3 "version": "1.4. 5",3 "version": "1.4.6", 4 4 "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.", 5 5 "main": "gulpfile.babel.js", … … 16 16 "save-dev": "0.0.1-security", 17 17 "through2": "4.0.2", 18 "what-input": "5.2.1 0"18 "what-input": "5.2.11" 19 19 }, 20 20 "devDependencies": { 21 "@babel/core": "7.1 7.2",22 "@babel/preset-env": "7.1 6.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", 27 27 "gulp": "4.0.2", 28 28 "gulp-babel": "8.0.0", … … 43 43 "kind-of": "6.0.3", 44 44 "node-sass": "^7.0.1", 45 "postcss": "^8.4. 6",45 "postcss": "^8.4.14", 46 46 "rimraf": "3.0.2", 47 47 "vinyl-named": "1.1.0", 48 "webpack": "5. 68.0",48 "webpack": "5.72.1", 49 49 "webpack-stream": "7.0.0", 50 "yargs": "17. 3.1"50 "yargs": "17.5.1" 51 51 }, 52 52 "repository": { … … 59 59 }, 60 60 "engines": { 61 "node": ">= 14.10.0"61 "node": ">= v14.19.3" 62 62 }, 63 63 "browserslist": [ -
courier-notices/trunk/readme.txt
r2699180 r2730785 4 4 Requires at least: 5.0 5 5 Tested up to: 5.9 6 Stable tag: 1.4. 56 Stable tag: 1.4.6 7 7 Requires PHP: 7.3 8 8 License: GPLv2 or later -
courier-notices/trunk/src/Controller/Courier_REST_Controller.php
r2676052 r2730785 36 36 $namespace, 37 37 '/' . $base . '/(?P<notice_id>\d+)/', 38 array(39 array(38 [ 39 [ 40 40 '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 ] 46 46 ); 47 47 … … 50 50 $namespace, 51 51 '/' . $base . '/(?P<notice_id>\d+)/dismiss', 52 array(53 array(52 [ 53 [ 54 54 '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. 63 63 register_rest_route( 64 64 $namespace, 65 65 '/notices/display/', 66 array(67 array(66 [ 67 [ 68 68 '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' => [ 73 73 'description' => esc_html__( 'Set where the notices should display.', 'courier-notices' ), 74 74 'type' => 'string', 75 75 'sanitize_callback' => 'sanitize_text_field', 76 76 'validate_callback' => 'rest_validate_request_arg', 77 ),78 'format' => array(77 ], 78 'format' => [ 79 79 'description' => esc_html__( 'Set the response, either html or json.', 'courier-notices' ), 80 80 'type' => 'string', 81 81 'sanitize_callback' => 'sanitize_text_field', 82 82 '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 ] 87 98 ); 88 99 … … 100 111 */ 101 112 public function get_notice( WP_REST_Request $request ) { 102 $data = array();103 104 $args = array(113 $data = []; 114 115 $args = [ 105 116 'post_type' => 'courier_notice', 106 117 'post_status' => 'publish', … … 108 119 'posts_per_page' => 1, 109 120 'p' => (int) $request['notice_id'], 110 );121 ]; 111 122 112 123 $search = new \WP_Query( $args ); … … 161 172 162 173 if ( empty( $notifications ) ) { 163 $notifications = array();174 $notifications = []; 164 175 } 165 176 … … 199 210 */ 200 211 public function display_notices( WP_REST_Request $request ) { 201 $defaults = array(212 $defaults = [ 202 213 'user_id' => '', 203 214 'include_global' => true, … … 207 218 'number' => 10, // @todo this should be a setting. 208 219 'placement' => 'header', 209 'query_args' => array(),210 );220 'query_args' => [], 221 ]; 211 222 212 223 $defaults = apply_filters( 'courier_notices_get_notices_default_settings', $defaults ); 213 224 $args = wp_parse_args( 214 array(225 [ 215 226 'contentType' => $request->get_param( 'contentType' ), 216 227 'placement' => $request->get_param( 'placement' ), 217 228 'format' => $request->get_param( 'format' ), 218 ),229 ], 219 230 $defaults 220 231 ); … … 225 236 226 237 if ( 'html' === $args['format'] ) { 227 $notices = array();238 $notices = []; 228 239 229 240 foreach ( $notice_posts as $courier_notice ) { … … 315 326 return array( 316 327 'page' => array( 317 'description' => 'Current page of the collection.',328 'description' => __( 'Current page of the collection.', 'courier-notices' ), 318 329 'type' => 'integer', 319 330 'default' => 1, … … 321 332 ), 322 333 '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' ), 324 335 'type' => 'integer', 325 336 'default' => 100, … … 327 338 ), 328 339 'search' => array( 329 'description' => 'Limit results to those matching a string.',340 'description' => __( 'Limit results to those matching a string.', 'courier-notices' ), 330 341 'type' => 'string', 331 342 'sanitize_callback' => 'sanitize_text_field', -
courier-notices/trunk/vendor/autoload.php
r2699180 r2730785 3 3 // autoload.php @generated by Composer 4 4 5 if (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 5 10 require_once __DIR__ . '/composer/autoload_real.php'; 6 11 7 return ComposerAutoloaderInit8 3edf73b15e0c05f977ad1f815506f66::getLoader();12 return ComposerAutoloaderInit8a6b813a521d45538abe4ce7229f355a::getLoader(); -
courier-notices/trunk/vendor/composer/InstalledVersions.php
r2675851 r2730785 22 22 * 23 23 * To require its presence, you can require `composer-runtime-api ^2.0` 24 * 25 * @final 24 26 */ 25 27 class InstalledVersions -
courier-notices/trunk/vendor/composer/autoload_classmap.php
r2676052 r2730785 3 3 // autoload_classmap.php @generated by Composer 4 4 5 $vendorDir = dirname( dirname(__FILE__));5 $vendorDir = dirname(__DIR__); 6 6 $baseDir = dirname($vendorDir); 7 7 -
courier-notices/trunk/vendor/composer/autoload_namespaces.php
r2344125 r2730785 3 3 // autoload_namespaces.php @generated by Composer 4 4 5 $vendorDir = dirname( dirname(__FILE__));5 $vendorDir = dirname(__DIR__); 6 6 $baseDir = dirname($vendorDir); 7 7 -
courier-notices/trunk/vendor/composer/autoload_psr4.php
r2676052 r2730785 3 3 // autoload_psr4.php @generated by Composer 4 4 5 $vendorDir = dirname( dirname(__FILE__));5 $vendorDir = dirname(__DIR__); 6 6 $baseDir = dirname($vendorDir); 7 7 -
courier-notices/trunk/vendor/composer/autoload_real.php
r2699180 r2730785 3 3 // autoload_real.php @generated by Composer 4 4 5 class ComposerAutoloaderInit8 3edf73b15e0c05f977ad1f815506f665 class ComposerAutoloaderInit8a6b813a521d45538abe4ce7229f355a 6 6 { 7 7 private static $loader; … … 25 25 require __DIR__ . '/platform_check.php'; 26 26 27 spl_autoload_register(array('ComposerAutoloaderInit8 3edf73b15e0c05f977ad1f815506f66', 'loadClassLoader'), true, true);28 self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname( \dirname(__FILE__)));29 spl_autoload_unregister(array('ComposerAutoloaderInit8 3edf73b15e0c05f977ad1f815506f66', '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')); 30 30 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)); 52 33 53 34 $loader->register(true); -
courier-notices/trunk/vendor/composer/autoload_static.php
r2699180 r2730785 5 5 namespace Composer\Autoload; 6 6 7 class ComposerStaticInit8 3edf73b15e0c05f977ad1f815506f667 class ComposerStaticInit8a6b813a521d45538abe4ce7229f355a 8 8 { 9 9 public static $prefixLengthsPsr4 = array ( … … 38 38 { 39 39 return \Closure::bind(function () use ($loader) { 40 $loader->prefixLengthsPsr4 = ComposerStaticInit8 3edf73b15e0c05f977ad1f815506f66::$prefixLengthsPsr4;41 $loader->prefixDirsPsr4 = ComposerStaticInit8 3edf73b15e0c05f977ad1f815506f66::$prefixDirsPsr4;42 $loader->prefixesPsr0 = ComposerStaticInit8 3edf73b15e0c05f977ad1f815506f66::$prefixesPsr0;43 $loader->classMap = ComposerStaticInit8 3edf73b15e0c05f977ad1f815506f66::$classMap;40 $loader->prefixLengthsPsr4 = ComposerStaticInit8a6b813a521d45538abe4ce7229f355a::$prefixLengthsPsr4; 41 $loader->prefixDirsPsr4 = ComposerStaticInit8a6b813a521d45538abe4ce7229f355a::$prefixDirsPsr4; 42 $loader->prefixesPsr0 = ComposerStaticInit8a6b813a521d45538abe4ce7229f355a::$prefixesPsr0; 43 $loader->classMap = ComposerStaticInit8a6b813a521d45538abe4ce7229f355a::$classMap; 44 44 45 45 }, null, ClassLoader::class); -
courier-notices/trunk/vendor/composer/installed.php
r2699180 r2730785 1 1 <?php return array( 2 2 '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', 5 5 'type' => 'wordpress-plugin', 6 6 'install_path' => __DIR__ . '/../../', … … 21 21 ), 22 22 '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', 25 25 'type' => 'wordpress-plugin', 26 26 'install_path' => __DIR__ . '/../../',
Note: See TracChangeset
for help on using the changeset viewer.