From 0906bbd0ff0660c688c677070c7b4660e1623a07 Mon Sep 17 00:00:00 2001 From: CodeyGuyDylan Date: Wed, 8 Jan 2025 17:59:15 +0000 Subject: [PATCH] Add explanation firewall inactive when not supported (#40880) * Add tooltip text to let users know when firewall is disabled because of host * changelog * Show Inactive always if unsupported Committed via a GitHub action: https://github.com/Automattic/jetpack/actions/runs/12676086063 Upstream-Ref: Automattic/jetpack@3dc26529c45a9b0356e9940f7e7dc03d725eab8d --- CHANGELOG.md | 8 ++++++++ build/index.asset.php | 2 +- build/index.js | 14 +++++++------- global.d.ts | 1 + package.json | 2 +- src/class-initializer.php | 12 +++++++++--- 6 files changed, 27 insertions(+), 12 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8fdc37b..7497f4c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,13 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [5.3.1-alpha] - unreleased + +This is an alpha version! The changes listed here are not final. + +### Added +- Add new WAF status on Protect card for when WAF is unsupported + ## [5.3.0] - 2025-01-06 ### Added - My Jetpack: Added a new status for when Protect detects threats on the site. [#40628] @@ -1895,6 +1902,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Added - Created package +[5.3.1-alpha]: https://github.com/Automattic/jetpack-my-jetpack/compare/5.3.0...5.3.1-alpha [5.3.0]: https://github.com/Automattic/jetpack-my-jetpack/compare/5.2.0...5.3.0 [5.2.0]: https://github.com/Automattic/jetpack-my-jetpack/compare/5.1.2...5.2.0 [5.1.2]: https://github.com/Automattic/jetpack-my-jetpack/compare/5.1.1...5.1.2 diff --git a/build/index.asset.php b/build/index.asset.php index fb2ba47..88c1736 100644 --- a/build/index.asset.php +++ b/build/index.asset.php @@ -1 +1 @@ - array('jetpack-connection', 'jetpack-script-data', 'react', 'react-dom', 'react-jsx-runtime', 'wp-api-fetch', 'wp-components', 'wp-compose', 'wp-data', 'wp-date', 'wp-element', 'wp-i18n', 'wp-polyfill', 'wp-primitives', 'wp-url'), 'version' => '3a7c501ee17d67fa9338'); + array('jetpack-connection', 'jetpack-script-data', 'react', 'react-dom', 'react-jsx-runtime', 'wp-api-fetch', 'wp-components', 'wp-compose', 'wp-data', 'wp-date', 'wp-element', 'wp-i18n', 'wp-polyfill', 'wp-primitives', 'wp-url'), 'version' => '84046aa3393a0eb9cd9c'); diff --git a/build/index.js b/build/index.js index b52b0bd..d84f97a 100644 --- a/build/index.js +++ b/build/index.js @@ -53,16 +53,16 @@ __("Your speed has improved by %d points! Upgrade Boost to unlock automated CSS __("Last scan: %s","jetpack-my-jetpack"),g):null:(0,c.sprintf)(/* translators: %d is the number of plugins installed on the site. */ _n("%d plugin","%d plugins",p,"jetpack-my-jetpack"),p)+" "+/* translators: The ampersand symbol here (&) is meaning "and". */ __("&","jetpack-my-jetpack")+" "+(0,c.sprintf)(/* translators: %d is the number of themes installed on the site. */ -_n("%d theme","%d themes",h,"jetpack-my-jetpack").replace(" "," "),h)),[t,g,p,h])}},7915:(e,t,a)=>{"use strict";a.d(t,{T:()=>m});var c=a(6087),n=a(7723),r=a(1609),s=a(1504),i=a(4923),l=a(8242),o=a(4526),u=a(3658);const __=n.__,_n=n._n;function m(){const e=s.D_.PROTECT,{detail:t}=(0,i.A)(e),{standalonePluginInfo:a,hasPaidPlanForProduct:m,manageUrl:d}=t||{},{isStandaloneActive:p}=a||{},{recordEvent:h}=(0,o.A)(),{plugins:g,themes:v,protect:{scanData:f,wafConfig:k}}=(0,l.A$)(),{plugins:w,themes:E,num_threats:y=0,threats:A=[]}=f||{},{jetpack_waf_automatic_rules:b,blocked_logins:j,brute_force_protection:R}=k||{},_=w.length||Object.keys(g).length,C=E.length||Object.keys(v).length,x=(0,r.useMemo)((()=>A.length?A.reduce(((e,t)=>t.severity>=5?e+=1:e),0):0),[A]),N=(0,r.useMemo)((()=>p?"admin.php?page=jetpack-protect#/firewall":(0,u.w)()?"admin.php?page=jetpack#/settings":null),[p]),M=(0,r.useCallback)((()=>{h("jetpack_protect_card_tooltip_content_link_click",{page:"my-jetpack",feature:"jetpack-protect",location:"auto-firewall-tooltip",path:N})}),[h,N]),z=(0,r.useCallback)((()=>{h("jetpack_protect_card_tooltip_content_link_click",{page:"my-jetpack",feature:"jetpack-protect",location:"scan-threats-tooltip",path:d})}),[h,d]),S=p||(0,u.w)(),L=(0,r.useMemo)((()=>0===j?R?{title:__("Brute Force Protection: Active","jetpack-my-jetpack"),text:__("Brute Force Protection is actively blocking malicious login attempts. The number of blocked login attempts will display here soon!","jetpack-my-jetpack")}:{title:__("Brute Force Protection: Inactive","jetpack-my-jetpack"),text:N?(0,c.createInterpolateElement)((0,n.sprintf)(/* translators: %s is the location/page where the settings are located. Either "firewall settings" or "Jetpack settings". */ -__("Brute Force Protection is disabled and not actively blocking malicious login attempts. Go to %s to activate it.","jetpack-my-jetpack"),p?"firewall settings":"Jetpack settings"),{a:(0,r.createElement)("a",{href:N,onClick:M})}):__("Brute Force Protection is disabled and not actively blocking malicious login attempts.","jetpack-my-jetpack")}:R?void 0:S?{title:__("Brute Force Protection: Inactive","jetpack-my-jetpack"),text:N?(0,c.createInterpolateElement)((0,n.sprintf)(/* translators: %s is the location/page where the settings are located. Either "firewall settings" or "Jetpack settings". */ -__("Brute Force Protection is disabled and not actively blocking malicious login attempts. Go to %s to activate it.","jetpack-my-jetpack"),p?"firewall settings":"Jetpack settings"),{a:(0,r.createElement)("a",{href:N,onClick:M})}):__("Brute Force Protection is disabled and not actively blocking malicious login attempts.","jetpack-my-jetpack")}:{title:__("Brute Force Protection: Inactive","jetpack-my-jetpack"),text:__("For Brute Force Protection, activate the Jetpack or Protect plugin and enable it in settings.","jetpack-my-jetpack")}),[j,R,S,p,N,M]);return{pluginsThemesTooltip:{title:__("Improve site safety: secure plugins & themes","jetpack-my-jetpack"),text:(0,n.sprintf)(/* translators: %1$s the singular or plural of number of plugin(s), and %2$s is the singular or plural of the number of theme(s). */ +_n("%d theme","%d themes",h,"jetpack-my-jetpack").replace(" "," "),h)),[t,g,p,h])}},7915:(e,t,a)=>{"use strict";a.d(t,{T:()=>m});var c=a(6087),n=a(7723),r=a(1609),s=a(1504),i=a(4923),l=a(8242),o=a(4526),u=a(3658);const __=n.__,_n=n._n;function m(){const e=s.D_.PROTECT,{detail:t}=(0,i.A)(e),{standalonePluginInfo:a,hasPaidPlanForProduct:m,manageUrl:d}=t||{},{isStandaloneActive:p}=a||{},{recordEvent:h}=(0,o.A)(),{plugins:g,themes:v,protect:{scanData:f,wafConfig:k}}=(0,l.A$)(),{plugins:w,themes:E,num_threats:y=0,threats:A=[]}=f||{},{jetpack_waf_automatic_rules:b,blocked_logins:j,brute_force_protection:R,waf_supported:_}=k||{},C=w.length||Object.keys(g).length,x=E.length||Object.keys(v).length,N=(0,r.useMemo)((()=>A.length?A.reduce(((e,t)=>t.severity>=5?e+=1:e),0):0),[A]),M=(0,r.useMemo)((()=>p?"admin.php?page=jetpack-protect#/firewall":(0,u.w)()?"admin.php?page=jetpack#/settings":null),[p]),z=(0,r.useCallback)((()=>{h("jetpack_protect_card_tooltip_content_link_click",{page:"my-jetpack",feature:"jetpack-protect",location:"auto-firewall-tooltip",path:M})}),[h,M]),S=(0,r.useCallback)((()=>{h("jetpack_protect_card_tooltip_content_link_click",{page:"my-jetpack",feature:"jetpack-protect",location:"scan-threats-tooltip",path:d})}),[h,d]),L=p||(0,u.w)(),P=(0,r.useMemo)((()=>0===j?R?{title:__("Brute Force Protection: Active","jetpack-my-jetpack"),text:__("Brute Force Protection is actively blocking malicious login attempts. The number of blocked login attempts will display here soon!","jetpack-my-jetpack")}:{title:__("Brute Force Protection: Inactive","jetpack-my-jetpack"),text:M?(0,c.createInterpolateElement)((0,n.sprintf)(/* translators: %s is the location/page where the settings are located. Either "firewall settings" or "Jetpack settings". */ +__("Brute Force Protection is disabled and not actively blocking malicious login attempts. Go to %s to activate it.","jetpack-my-jetpack"),p?"firewall settings":"Jetpack settings"),{a:(0,r.createElement)("a",{href:M,onClick:z})}):__("Brute Force Protection is disabled and not actively blocking malicious login attempts.","jetpack-my-jetpack")}:R?void 0:L?{title:__("Brute Force Protection: Inactive","jetpack-my-jetpack"),text:M?(0,c.createInterpolateElement)((0,n.sprintf)(/* translators: %s is the location/page where the settings are located. Either "firewall settings" or "Jetpack settings". */ +__("Brute Force Protection is disabled and not actively blocking malicious login attempts. Go to %s to activate it.","jetpack-my-jetpack"),p?"firewall settings":"Jetpack settings"),{a:(0,r.createElement)("a",{href:M,onClick:z})}):__("Brute Force Protection is disabled and not actively blocking malicious login attempts.","jetpack-my-jetpack")}:{title:__("Brute Force Protection: Inactive","jetpack-my-jetpack"),text:__("For Brute Force Protection, activate the Jetpack or Protect plugin and enable it in settings.","jetpack-my-jetpack")}),[j,R,L,p,M,z]);return{pluginsThemesTooltip:{title:__("Improve site safety: secure plugins & themes","jetpack-my-jetpack"),text:(0,n.sprintf)(/* translators: %1$s the singular or plural of number of plugin(s), and %2$s is the singular or plural of the number of theme(s). */ __("Your site has %1$s and %2$s lacking security measures. Improve your site’s safety by adding protection at no cost.","jetpack-my-jetpack"),(0,n.sprintf)(/* translators: %d is the number of plugins installed on the site. */ -_n("%d plugin","%d plugins",_,"jetpack-my-jetpack"),_),(0,n.sprintf)(/* translators: %d is the number of themes installed on the site. */ -_n("%d theme","%d themes",C,"jetpack-my-jetpack"),C))},scanThreatsTooltip:m&&y?{title:__("Auto-fix threats","jetpack-my-jetpack"),text:x?(0,c.createInterpolateElement)((0,n.sprintf)(/* translators: %1$s is the number of threats, %2$s is the numner of critical threats on the site, and %3$s is either "Scan" or "Protect" (the type of dashboard). */ +_n("%d plugin","%d plugins",C,"jetpack-my-jetpack"),C),(0,n.sprintf)(/* translators: %d is the number of themes installed on the site. */ +_n("%d theme","%d themes",x,"jetpack-my-jetpack"),x))},scanThreatsTooltip:m&&y?{title:__("Auto-fix threats","jetpack-my-jetpack"),text:N?(0,c.createInterpolateElement)((0,n.sprintf)(/* translators: %1$s is the number of threats, %2$s is the numner of critical threats on the site, and %3$s is either "Scan" or "Protect" (the type of dashboard). */ __("The last scan identified %1$s (%2$d critical). But don’t worry, Protect is usually able to “Auto-fix” threats, in most cases. Visit the %3$s dashboard to view more details.","jetpack-my-jetpack"),(0,n.sprintf)(/* translators: %d is the number of detected scan threats on the site. */ -_n("%d threat","%d threats",y,"jetpack-my-jetpack"),y),x,p?"Protect":"Scan"),{a:(0,r.createElement)("a",{href:d,onClick:z})}):(0,c.createInterpolateElement)((0,n.sprintf)(/* translators: %1$s is the singular or plural of number of detected threats on the site, and %2$s is either "Scan" or "Protect" (the type of dashboard). */ +_n("%d threat","%d threats",y,"jetpack-my-jetpack"),y),N,p?"Protect":"Scan"),{a:(0,r.createElement)("a",{href:d,onClick:S})}):(0,c.createInterpolateElement)((0,n.sprintf)(/* translators: %1$s is the singular or plural of number of detected threats on the site, and %2$s is either "Scan" or "Protect" (the type of dashboard). */ __("The last scan identified %1$s. But don’t worry, Protect is usually able to “Auto-fix” threats, in most cases. Visit the %2$s dashboard to view more details.","jetpack-my-jetpack"),(0,n.sprintf)(/* translators: %d is the number of detected scan threats on the site. */ -_n("%d threat","%d threats",y,"jetpack-my-jetpack"),y),p?"Protect":"Scan"),{a:(0,r.createElement)("a",{href:d,onClick:z})})}:{title:__("Elevate your malware protection","jetpack-my-jetpack"),text:__("We’ve checked items against our database, and all appears well. For a more detailed, line-by-line malware scan, consider upgrading your plan.","jetpack-my-jetpack")},autoFirewallTooltip:m&&!b?{title:__("Auto-Firewall: Inactive","jetpack-my-jetpack"),text:(0,c.createInterpolateElement)(__("You have Auto-Firewall disabled, visit your Protect firewall settings to activate.","jetpack-my-jetpack"),{a:(0,r.createElement)("a",{href:N,onClick:M})})}:{title:__("Auto-Firewall: Inactive","jetpack-my-jetpack"),text:__("Upgrade required for activation. Manual rules available.","jetpack-my-jetpack")},blockedLoginsTooltip:L}}},2917:(e,t,a)=>{"use strict";a.d(t,{A:()=>r});var c=a(1504),n=a(6176);const r=({admin:e,recommendation:t})=>React.createElement(n.A,{slug:c.D_.RELATED_POSTS,admin:e,recommendation:t})},414:(e,t,a)=>{"use strict";a.d(t,{A:()=>u});var c=a(6072),n=a.n(c),r=a(8120),s=a.n(r),i=a(1504),l=a(6176);const o=e=>React.createElement(l.A,n()({slug:i.D_.SEARCH,showMenu:!0},e));o.propTypes={admin:s().bool};const u=o},7014:(e,t,a)=>{"use strict";a.d(t,{A:()=>r});var c=a(1504),n=a(6176);const r=({admin:e,recommendation:t})=>React.createElement(n.A,{slug:c.D_.SECURITY,showMenu:!0,admin:e,recommendation:t})},4169:(e,t,a)=>{"use strict";a.d(t,{A:()=>r});var c=a(1504),n=a(6176);const r=({admin:e,recommendation:t})=>React.createElement(n.A,{slug:c.D_.SITE_ACCELERATOR,admin:e,recommendation:t})},7769:(e,t,a)=>{"use strict";a.d(t,{A:()=>u});var c=a(6072),n=a.n(c),r=a(8120),s=a.n(r),i=a(1504),l=a(6176);const o=e=>React.createElement(l.A,n()({slug:i.D_.SOCIAL,showMenu:!0},e));o.propTypes={admin:s().bool};const u=o},4073:(e,t,a)=>{"use strict";a.d(t,{A:()=>u});var c=a(6072),n=a.n(c),r=a(8120),s=a.n(r),i=a(1504),l=a(6176);const o=e=>React.createElement(l.A,n()({slug:i.D_.STATS,showMenu:!0},e));o.propTypes={admin:s().bool};const u=o},7631:(e,t,a)=>{"use strict";a.d(t,{A:()=>f});var c=a(6072),n=a.n(c),r=a(7425),s=a(1609),i=a(8837),l=a(1504),o=a(4923),u=a(8242),m=a(6176),d=a(2660),p=a(6544),h=a(3554),g=a(7167);a(6101);const v=l.D_.VIDEOPRESS,f=e=>{const{detail:t}=(0,o.A)(v),{status:a}=t||{},{videopress:c}=(0,u.A$)(),{activeAndNoVideos:l}=(0,p.A)(),{videoCount:f=0,featuredStats:k}=c||{},w=a===i.hp.ACTIVE||a===i.hp.CAN_UPGRADE,E=(0,h.A)({isPluginActive:w,videoCount:f}),y={stats_period:k?.period,video_count:f},A=(0,s.useCallback)((()=>React.createElement(r.Ay,{variant:"body-small",className:"description"},E||t.description,w&&!f&&React.createElement(d.I,{className:"videopress-card__no-video-tooltip",tracksEventName:"videopress_card_tooltip_open",tracksEventProps:{location:"description",feature:"jetpack-videopress",status:a,video_count:f}},React.createElement("h3",null,l.title),React.createElement("p",null,l.text)))),[E,t.description,f,a,l,w]);return React.createElement(m.A,n()({},e,{slug:v,showMenu:!0,Description:A,customLoadTracks:y}),React.createElement(g.A,{isPluginActive:w,data:c}))}},6544:(e,t,a)=>{"use strict";a.d(t,{A:()=>o});var c=a(3924),n=a(6087),r=a(7723),s=a(1609),i=a(8242),l=a(4526);const __=r.__,_n=r._n,o=()=>{const{recordEvent:e}=(0,l.A)(),{videopress:t}=(0,i.A$)(),{featuredStats:a,videoCount:o}=t||{},{period:u}=a||{},m=(0,c.A)("jetpack-videopress-my-jetpack-tooltip"),d=(0,s.useCallback)((()=>{e("jetpack_videopress_card_tooltip_content_link_click",{location:"video_count",feature:"jetpack-videopress",page:"my-jetpack",path:m})}),[e,m]),p={title:__("The finest video for WordPress","jetpack-my-jetpack"),text:(0,n.createInterpolateElement)((0,r.sprintf)( +_n("%d threat","%d threats",y,"jetpack-my-jetpack"),y),p?"Protect":"Scan"),{a:(0,r.createElement)("a",{href:d,onClick:S})})}:{title:__("Elevate your malware protection","jetpack-my-jetpack"),text:__("We’ve checked items against our database, and all appears well. For a more detailed, line-by-line malware scan, consider upgrading your plan.","jetpack-my-jetpack")},autoFirewallTooltip:m&&!b||!_?{title:__("Auto-Firewall: Inactive","jetpack-my-jetpack"),text:_?(0,c.createInterpolateElement)(__("You have Auto-Firewall disabled, visit your Protect firewall settings to activate.","jetpack-my-jetpack"),{a:(0,r.createElement)("a",{href:M,onClick:z})}):__("Auto-Firewall is disabled as your hosting provider already includes a built-in firewall with similar rules for your site.","jetpack-my-jetpack")}:{title:__("Auto-Firewall: Inactive","jetpack-my-jetpack"),text:__("Upgrade required for activation. Manual rules available.","jetpack-my-jetpack")},blockedLoginsTooltip:P}}},2917:(e,t,a)=>{"use strict";a.d(t,{A:()=>r});var c=a(1504),n=a(6176);const r=({admin:e,recommendation:t})=>React.createElement(n.A,{slug:c.D_.RELATED_POSTS,admin:e,recommendation:t})},414:(e,t,a)=>{"use strict";a.d(t,{A:()=>u});var c=a(6072),n=a.n(c),r=a(8120),s=a.n(r),i=a(1504),l=a(6176);const o=e=>React.createElement(l.A,n()({slug:i.D_.SEARCH,showMenu:!0},e));o.propTypes={admin:s().bool};const u=o},7014:(e,t,a)=>{"use strict";a.d(t,{A:()=>r});var c=a(1504),n=a(6176);const r=({admin:e,recommendation:t})=>React.createElement(n.A,{slug:c.D_.SECURITY,showMenu:!0,admin:e,recommendation:t})},4169:(e,t,a)=>{"use strict";a.d(t,{A:()=>r});var c=a(1504),n=a(6176);const r=({admin:e,recommendation:t})=>React.createElement(n.A,{slug:c.D_.SITE_ACCELERATOR,admin:e,recommendation:t})},7769:(e,t,a)=>{"use strict";a.d(t,{A:()=>u});var c=a(6072),n=a.n(c),r=a(8120),s=a.n(r),i=a(1504),l=a(6176);const o=e=>React.createElement(l.A,n()({slug:i.D_.SOCIAL,showMenu:!0},e));o.propTypes={admin:s().bool};const u=o},4073:(e,t,a)=>{"use strict";a.d(t,{A:()=>u});var c=a(6072),n=a.n(c),r=a(8120),s=a.n(r),i=a(1504),l=a(6176);const o=e=>React.createElement(l.A,n()({slug:i.D_.STATS,showMenu:!0},e));o.propTypes={admin:s().bool};const u=o},7631:(e,t,a)=>{"use strict";a.d(t,{A:()=>f});var c=a(6072),n=a.n(c),r=a(7425),s=a(1609),i=a(8837),l=a(1504),o=a(4923),u=a(8242),m=a(6176),d=a(2660),p=a(6544),h=a(3554),g=a(7167);a(6101);const v=l.D_.VIDEOPRESS,f=e=>{const{detail:t}=(0,o.A)(v),{status:a}=t||{},{videopress:c}=(0,u.A$)(),{activeAndNoVideos:l}=(0,p.A)(),{videoCount:f=0,featuredStats:k}=c||{},w=a===i.hp.ACTIVE||a===i.hp.CAN_UPGRADE,E=(0,h.A)({isPluginActive:w,videoCount:f}),y={stats_period:k?.period,video_count:f},A=(0,s.useCallback)((()=>React.createElement(r.Ay,{variant:"body-small",className:"description"},E||t.description,w&&!f&&React.createElement(d.I,{className:"videopress-card__no-video-tooltip",tracksEventName:"videopress_card_tooltip_open",tracksEventProps:{location:"description",feature:"jetpack-videopress",status:a,video_count:f}},React.createElement("h3",null,l.title),React.createElement("p",null,l.text)))),[E,t.description,f,a,l,w]);return React.createElement(m.A,n()({},e,{slug:v,showMenu:!0,Description:A,customLoadTracks:y}),React.createElement(g.A,{isPluginActive:w,data:c}))}},6544:(e,t,a)=>{"use strict";a.d(t,{A:()=>o});var c=a(3924),n=a(6087),r=a(7723),s=a(1609),i=a(8242),l=a(4526);const __=r.__,_n=r._n,o=()=>{const{recordEvent:e}=(0,l.A)(),{videopress:t}=(0,i.A$)(),{featuredStats:a,videoCount:o}=t||{},{period:u}=a||{},m=(0,c.A)("jetpack-videopress-my-jetpack-tooltip"),d=(0,s.useCallback)((()=>{e("jetpack_videopress_card_tooltip_content_link_click",{location:"video_count",feature:"jetpack-videopress",page:"my-jetpack",path:m})}),[e,m]),p={title:__("The finest video for WordPress","jetpack-my-jetpack"),text:(0,n.createInterpolateElement)((0,r.sprintf)( // translators: %d is the number of videos in the Media Library that could benefit from VideoPress. _n("You have %d video in your Media Library that could benefit from VideoPress. Start hosting it today to unlock multiple benefits: enhanced quality add-free streaming, faster load times, customizable player controls.","You have %d videos in your Media Library that could benefit from VideoPress. Start hosting them today to unlock multiple benefits: enhanced quality add-free streaming, faster load times, customizable player controls.",o,"jetpack-my-jetpack"),o),{a:(0,s.createElement)("a",{href:m,target:"_blank",rel:"noreferrer noopener",onClick:d})})},h={title:__("The finest video for WordPress","jetpack-my-jetpack"),text:__("Give your videos a boost! 🚀 Try hosting with VideoPress for superior quality and performance.","jetpack-my-jetpack")},g={title:__("High-quality video, wherever your audience is","jetpack-my-jetpack"),text:__("Success! 🌟 Your video is live and gathering views.","jetpack-my-jetpack")},v=__("30-Day views","jetpack-my-jetpack"),f=__("Yearly views","jetpack-my-jetpack"),k=__("This metric shows your total video views over the past 30 days, compared to the previous 30 days.","jetpack-my-jetpack"),w=__("This metric shows your total video views over the past year.","jetpack-my-jetpack"),E={title:"day"===u?v:f,text:"day"===u?k:w},y=__("This metric shows your total video viewing time over the past 30 days, compared to the previous 30 days.","jetpack-my-jetpack"),A=__("This metric shows total video viewing time for the last year.","jetpack-my-jetpack");return{inactiveWithVideos:p,activeAndNoVideos:h,viewsWithoutPlan:g,viewsWithPlan:E,watchTime:{title:__("Total time watched","jetpack-my-jetpack"),text:"day"===u?y:A}}}},3554:(e,t,a)=>{"use strict";a.d(t,{A:()=>r});var c=a(7723),n=a(2434);const __=c.__,r=({isPluginActive:e,videoCount:t})=>!e&&t?(0,n.A)(__("Load your existing videos faster and without ads.","jetpack-my-jetpack")):e&&!t?(0,n.A)(__("Stunning-quality, ad-free video in the WordPress Editor. Begin by uploading your first video.","jetpack-my-jetpack")):""},7167:(e,t,a)=>{"use strict";a.d(t,{A:()=>v});var c=a(7723),n=a(1113),r=a(2510),s=a(6955),i=a(3022),l=a(1504),o=a(4923),u=a(6581),m=a(2753),d=a(2660),p=a(1218),h=a(6544);a(6101);const __=c.__,g=({value:e,previousValue:t,formattedValue:a,formattedDifference:c,period:l})=>{const o=e>t;return React.createElement("div",{className:"videopress-card__value-section__value-container"},React.createElement("span",{className:"videopress-card__value-section__value"},a),e!==t&&"day"===l&&React.createElement("div",{className:(0,i.A)("videopress-card__value-section__previous-value",o?"increase":"decrease")},React.createElement(n.A,{size:18,icon:o?r.A:s.A}),React.createElement("span",null,c)))},v=({isPluginActive:e,data:t})=>{const{detail:a}=(0,o.A)(l.D_.VIDEOPRESS),{status:c,hasPaidPlanForProduct:n}=a||{},{videoCount:r,featuredStats:s}=t||{},{inactiveWithVideos:v,viewsWithoutPlan:f,viewsWithPlan:k,watchTime:w}=(0,h.A)();if(!r)return null;const E={feature:"jetpack-videopress",has_paid_plan:n,status:c};if(!e)return React.createElement("div",{className:"videopress-card__value-section"},React.createElement("div",{className:"videopress-card__value-section__container"},React.createElement("span",{className:p.A.valueSectionHeading},__("Existing videos","jetpack-my-jetpack"),React.createElement(d.I,{className:"videopress-card__no-video-tooltip",tracksEventName:"videopress_card_tooltip_open",tracksEventProps:{location:"existing_videos",feature:"jetpack-videopress",status:c,video_count:r}},React.createElement("h3",null,v.title),React.createElement("p",null,v.text))),React.createElement("span",{className:"videopress-card__video-count"},r)));const y=s?.data?.views?.current,A=s?.data?.watch_time?.current,b=s?.data?.views?.previous,j=s?.data?.watch_time?.previous,R=s?.period,_=Math.abs(y-b),C=Math.abs(A-j);if(void 0===y||void 0===A)return null;const x=__("30-Day views","jetpack-my-jetpack"),N=__("Yearly views","jetpack-my-jetpack");return React.createElement("div",{className:"videopress-card__value-section"},React.createElement("div",{className:"videopress-card__value-section__container"},React.createElement("span",{className:(0,i.A)(p.A.valueSectionHeading,"videopress-card__value-section__heading")},"day"===R?x:N,React.createElement(d.I,{tracksEventName:"videopress_card_tooltip_open",tracksEventProps:{location:"views",current_views:y,previous_views:b,period:R,...E}},n||0===y?React.createElement(React.Fragment,null,React.createElement("h3",null,k.title),React.createElement("p",null,k.text)):React.createElement(React.Fragment,null,React.createElement("h3",null,f.title),React.createElement("p",null,f.text)))),React.createElement(g,{value:y,previousValue:b,formattedValue:(0,u.A)(y),formattedDifference:(0,u.A)(_),period:R})),React.createElement("div",{className:"videopress-card__value-section__container"},React.createElement("span",{className:(0,i.A)(p.A.valueSectionHeading,"videopress-card__value-section__heading")},__("Total time watched","jetpack-my-jetpack"),React.createElement(d.I,{tracksEventName:"videopress_card_tooltip_open",tracksEventProps:{location:"watch_time",current_watch_time:A,previous_watch_time:j,period:R,...E}},React.createElement("h3",null,w.title),React.createElement("p",null,w.text))),React.createElement(g,{value:A,previousValue:j,formattedValue:(0,m.A)(A),formattedDifference:(0,m.A)(C),period:R})))}},3614:(e,t,a)=>{"use strict";a.d(t,{A:()=>o});var c=a(6427),n=a(8120),r=a.n(n),s=a(1609),i=a.n(s);const l=({children:e,className:t,href:a,isLoading:n=!1,onClick:r,isPrimary:s=!0,disabled:l=!1})=>i().createElement(c.Button,{onClick:r,className:t,href:a,variant:s?"primary":"secondary",disabled:n||l},n?i().createElement(c.Spinner,null):e);l.propTypes={className:r().string,isLoading:r().bool,isPrimary:r().bool,disabled:r().bool};const o=l},4720:(e,t,a)=>{"use strict";a.d(t,{A:()=>R});var c=a(7397),n=a(7425),r=a(8478),s=a(2266),i=a(5879),l=a(9384),o=a(6427),u=a(7723),m=a(1113),d=a(5459),p=a(3883),h=a(3022),g=a(1609),v=a.n(g),f=a(4923),k=a(8242),w=a(4526),E=a(1524),y=a(3614),A=a(9084);const __=u.__;function b({value:e,currency:t,isOld:a}){if(!e||!t)return null;const r=(0,c.vA)(e,t),s=(0,h.A)(A.A.price,{[A.A["is-old"]]:a});return v().createElement(n.Ay,{className:s,variant:"headline-medium",component:"p"},v().createElement(n.Ay,{component:"sup",variant:"title-medium"},r.symbol),r.integer,v().createElement(n.Ay,{component:"sup",variant:"title-medium"},r.fraction))}const j=({component:e,onClick:t,hasMainCheckoutStarted:a,isFetching:c,isFetchingSuccess:r,cantInstallPlugin:s,isPrimary:i,className:l,label:o})=>{const[u,m]=(0,g.useState)(!1);(0,g.useEffect)((()=>{c||r||m(!1)}),[c,r]);const d=a||u,p=a||s||c||r;return v().createElement(n.Ay,{component:e,onClick:()=>{m(!0),t()},isLoading:d,disabled:p,isPrimary:i,className:l,variant:"body"},o)},R=({slug:e,onClick:t,trackButtonClick:a=()=>{},className:c,preferProductName:R,supportingInfo:_,ctaButtonLabel:C=null,hideTOS:x=!1,quantity:N=null,highlightLastFeature:M=!1,isFetching:z=!1,isFetchingSuccess:S=!1,isUpsell:L=!1})=>{const{fileSystemWriteAccess:P="no",siteSuffix:V="",adminUrl:H="",myJetpackCheckoutUri:I=""}=(0,k.A$)(),{detail:B}=(0,f.A)(e),{name:O,title:T,longDescription:F,features:D,disclaimers:U,pricingForUi:q,isBundle:G,supportedProducts:J,hasPaidPlanForProduct:$,status:W,pluginSlug:Q,postCheckoutUrl:K}=B,Z=G&&L,Y="plugin_absent"===W&&"no"===P,{isFree:X,trialAvailable:ee,fullPricePerMonth:te,currencyCode:ae,discountPricePerMonth:ce,wpcomProductSlug:ne,wpcomFreeProductSlug:re,introductoryOffer:se,productTerm:ie}=q,{recordEvent:le}=(0,w.A)(),oe=!X&&!$||null!=N,ue=(0,E.y)(),me=(0,g.useCallback)((()=>K||(ue||I)),[K,ue,I])(),{run:de,hasCheckoutStarted:pe}=(0,l.useProductCheckoutWorkflow)({productSlug:ne,redirectUrl:me,siteSuffix:V,adminUrl:H,connectAfterCheckout:!0,from:"my-jetpack",quantity:N,useBlogIdSuffix:!0}),{run:he,hasCheckoutStarted:ge}=(0,l.useProductCheckoutWorkflow)({productSlug:re,redirectUrl:me,siteSuffix:V,adminUrl:H,connectAfterCheckout:!0,from:"my-jetpack",quantity:N,useBlogIdSuffix:!0}),ve=Z?J.join("_plus_").split("_").map(((e,t)=>{if("plus"===e)return v().createElement(m.A,{className:A.A["plus-icon"],key:`icon-plugs${t}`,icon:d.A,size:14});const a=(0,r.Wy)(e);return v().createElement(a,{key:e,size:24})})):null;let fe;fe="month"===se?.intervalUnit&&1===se?.intervalCount?(0,u.sprintf)( // translators: %s is the monthly price for a product diff --git a/global.d.ts b/global.d.ts index cc0373c..7d34848 100644 --- a/global.d.ts +++ b/global.d.ts @@ -286,6 +286,7 @@ interface Window { jetpack_waf_share_data: '1' | ''; jetpack_waf_share_debug_data: boolean; standalone_mode: boolean; + waf_supported: boolean; }; }; videopress: { diff --git a/package.json b/package.json index 44eb48b..e4746ec 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "private": true, "name": "@automattic/jetpack-my-jetpack", - "version": "5.3.0", + "version": "5.3.1-alpha", "description": "WP Admin page with information and configuration shared among all Jetpack stand-alone plugins", "homepage": "https://github.com/Automattic/jetpack/tree/HEAD/projects/packages/my-jetpack/#readme", "bugs": { diff --git a/src/class-initializer.php b/src/class-initializer.php index ca64305..d322923 100644 --- a/src/class-initializer.php +++ b/src/class-initializer.php @@ -41,7 +41,7 @@ class Initializer { * * @var string */ - const PACKAGE_VERSION = '5.3.0'; + const PACKAGE_VERSION = '5.3.1-alpha'; /** * HTML container ID for the IDC screen on My Jetpack page. @@ -236,9 +236,12 @@ public static function enqueue_scripts() { $scan_data = Products\Protect::get_protect_data(); self::update_historically_active_jetpack_modules(); - $waf_config = array(); + $waf_config = array(); + $waf_supported = false; + if ( class_exists( 'Automattic\Jetpack\Waf\Waf_Runner' ) ) { - $waf_config = Waf_Runner::get_config(); + $waf_config = Waf_Runner::get_config(); + $waf_supported = Waf_Runner::is_supported_environment(); } wp_localize_script( @@ -297,6 +300,9 @@ public static function enqueue_scripts() { 'scanData' => $scan_data, 'wafConfig' => array_merge( $waf_config, + array( + 'waf_supported' => $waf_supported, + ), array( 'blocked_logins' => (int) get_site_option( 'jetpack_protect_blocked_attempts', 0 ) ) ), ),