Plugin Directory

Changeset 2792647


Ignore:
Timestamp:
09/30/2022 06:59:33 PM (4 years ago)
Author:
jrfoell
Message:

Committing wp-strava 2.12.0

Location:
wp-strava/trunk
Files:
1 deleted
11 edited

Legend:

Unmodified
Added
Removed
  • wp-strava/trunk

    • Property svn:ignore
      •  

        old new  
        1 .git
        2 .gitignore
        3 .gitattributes
        4 phpcs.xml
        5 composer.lock
        6 composer.json
         1.git*
         2phpcs.*
         3.phpunit*
         4phpunit*
         5tests
         6composer.*
        77vendor
         8package.json
         9package-lock.json
         10node_modules
        811.vscode
         12.nvmrc
         13.eslintrc
  • wp-strava/trunk/build/index.asset.php

    r2651185 r2792647  
    1 <?php return array('dependencies' => array('wp-blocks', 'wp-editor', 'wp-element', 'wp-polyfill'), 'version' => '3fc205c4608dbba755fa2b6d94bc1084');
     1<?php return array('dependencies' => array('wp-blocks', 'wp-editor', 'wp-element', 'wp-polyfill'), 'version' => '76f44c0d2c7e826d88715932914fc218');
  • wp-strava/trunk/build/index.js

    r2651185 r2792647  
    1 !function(t){var e={};function r(n){if(e[n])return e[n].exports;var o=e[n]={i:n,l:!1,exports:{}};return t[n].call(o.exports,o,o.exports,r),o.l=!0,o.exports}r.m=t,r.c=e,r.d=function(t,e,n){r.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:n})},r.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},r.t=function(t,e){if(1&e&&(t=r(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var o in t)r.d(n,o,function(e){return t[e]}.bind(null,o));return n},r.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return r.d(e,"a",e),e},r.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},r.p="",r(r.s=15)}([function(t,e){t.exports=window.wp.element},function(t,e){t.exports=function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t},t.exports.default=t.exports,t.exports.__esModule=!0},function(t,e){function r(e){return t.exports=r=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)},t.exports.default=t.exports,t.exports.__esModule=!0,r(e)}t.exports=r,t.exports.default=t.exports,t.exports.__esModule=!0},function(t,e){t.exports=window.wp.blocks},function(t,e){t.exports=function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")},t.exports.default=t.exports,t.exports.__esModule=!0},function(t,e){function r(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}t.exports=function(t,e,n){return e&&r(t.prototype,e),n&&r(t,n),t},t.exports.default=t.exports,t.exports.__esModule=!0},function(t,e,r){var n=r(13);t.exports=function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&n(t,e)},t.exports.default=t.exports,t.exports.__esModule=!0},function(t,e,r){var n=r(14).default,o=r(1);t.exports=function(t,e){if(e&&("object"===n(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return o(t)},t.exports.default=t.exports,t.exports.__esModule=!0},function(t){t.exports=JSON.parse('{"name":"wp-strava/activity","title":"Strava Activity","category":"embed","icon":"chart-line","description":"Embed a Strava Activity","keywords":["activity","ride","map"],"textdomain":"wp-strava","attributes":{"url":{"type":"string","default":""},"imageOnly":{"type":"boolean","default":false},"displayMarkers":{"type":"boolean","default":false},"som":{"type":"string","default":null}},"editorScript":"file:../../../build/index.js","editorStyle":"file:../../../build/editor.css","style":"file:../../../build/style.css"}')},function(t){t.exports=JSON.parse('{"name":"wp-strava/route","title":"Strava Route","category":"embed","icon":"location-alt","description":"Embed a Strava Route","keywords":["route","map"],"textdomain":"wp-strava","attributes":{"url":{"type":"string","default":""},"imageOnly":{"type":"boolean","default":false},"displayMarkers":{"type":"boolean","default":false},"som":{"type":"string","default":null}},"editorScript":"file:../../../build/index.js","editorStyle":"file:../../../build/editor.css","style":"file:../../../build/style.css"}')},function(t){t.exports=JSON.parse('{"name":"wp-strava/segment","title":"Strava Segment","category":"embed","icon":"chart-area","description":"Embed a Strava Segment","keywords":["segment","map"],"textdomain":"wp-strava","attributes":{"url":{"type":"string","default":""},"imageOnly":{"type":"boolean","default":false},"displayMarkers":{"type":"boolean","default":true},"som":{"type":"string","default":null}},"editorScript":"file:../../../build/index.js","editorStyle":"file:../../../build/editor.css","style":"file:../../../build/style.css"}')},function(t){t.exports=JSON.parse('{"name":"wp-strava/activitieslist","title":"Strava Activities List","category":"embed","icon":"editor-ul","description":"List of Strava Activities","keywords":["activity","ride"],"textdomain":"wp-strava","attributes":{"som":{"type":"string","default":null}},"editorScript":"file:../../../build/index.js","editorStyle":"file:../../../build/editor.css","style":"file:../../../build/style.css"}')},function(t,e){t.exports=window.wp.editor},function(t,e){function r(e,n){return t.exports=r=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t},t.exports.default=t.exports,t.exports.__esModule=!0,r(e,n)}t.exports=r,t.exports.default=t.exports,t.exports.__esModule=!0},function(t,e){function r(e){return"function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?(t.exports=r=function(t){return typeof t},t.exports.default=t.exports,t.exports.__esModule=!0):(t.exports=r=function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},t.exports.default=t.exports,t.exports.__esModule=!0),r(e)}t.exports=r,t.exports.default=t.exports,t.exports.__esModule=!0},function(t,e,r){"use strict";r.r(e);var n=r(3),o=r(4),a=r.n(o),s=r(5),i=r.n(s),l=r(1),c=r.n(l),u=r(6),p=r.n(u),f=r(7),d=r.n(f),y=r(2),m=r.n(y),b=r(0),v=r(12),g=wp.i18n,h=(g.__,g._x),O=wp.components,w=O.Button,k=O.Placeholder,S=function(t){var e=t.icon,r=t.label,n=t.instructions,o=t.placeholder,a=t.value,s=t.onSubmit,i=t.onChange;return Object(b.createElement)(k,{icon:Object(b.createElement)(v.BlockIcon,{icon:e,showColors:!0}),label:r,className:"wp-block-embed",instructions:n},Object(b.createElement)("form",{onSubmit:s},Object(b.createElement)("input",{type:"url",value:a||"",className:"components-placeholder__input","aria-label":r,placeholder:o,onChange:i}),Object(b.createElement)(w,{isPrimary:!0,type:"submit"},h("Embed","button label","wp-strava"))))},x=wp.i18n.__,j=wp.components,M=j.Icon,R=j.Button,E=j.Toolbar,_=function(t){var e=t.switchBackToURLInput;return Object(b.createElement)(b.Fragment,null,Object(b.createElement)(v.BlockControls,null,Object(b.createElement)(E,{label:x("Options","wp-strava")},Object(b.createElement)(R,{label:x("Edit URL","wp-strava"),onClick:e},Object(b.createElement)(M,{icon:"edit"})))))};function U(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=m()(t);if(e){var o=m()(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return d()(this,r)}}var C=wp.i18n.__,I=wp.element.Component,T=wp.components,B=T.Button,L=T.ButtonGroup,D=function(t){p()(r,t);var e=U(r);function r(){var t;return a()(this,r),(t=e.apply(this,arguments)).onChange=t.onChange.bind(c()(t)),t.state={som:""},t}return i()(r,[{key:"onChange",value:function(t){this.setState({som:t.target.value}),this.props.onChange(t.target.value)}},{key:"render",value:function(){var t=this.state.som;return Object(b.createElement)("div",{className:"wp-block-wp-strava-som-control"},Object(b.createElement)("p",{className:"wp-block-wp-strava-som-control-row"},C("System of Measure (override from settings)")),Object(b.createElement)("div",{className:"wp-block-wp-strava-som-control-row"},Object(b.createElement)(L,{"aria-label":C("System of Measure","wp-strava")},Object(b.createElement)(B,{isSmall:!0,isPrimary:"english"==t,isPressed:"english"==t,value:"english",onClick:this.onChange},C("English","wp-strava")),Object(b.createElement)(B,{isSmall:!0,isPrimary:"metric"==t,isPressed:"metric"==t,value:"metric",onClick:this.onChange},C("Metric","wp-strava"))),Object(b.createElement)(B,{isSmall:!0,value:"",onClick:this.onChange},C("Reset","wp-strava"))))}}]),r}(I);function P(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=m()(t);if(e){var o=m()(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return d()(this,r)}}var A=wp.i18n.__,N=wp.element.Component,F=wp.editor.InspectorControls,J=wp.components,W=J.PanelBody,G=J.ToggleControl,q=J.ServerSideRender,z=lodash.isEmpty,H=function(t){p()(r,t);var e=P(r);function r(){var t;return a()(this,r),(t=e.apply(this,arguments)).setUrl=t.setUrl.bind(c()(t)),t.switchBackToURLInput=t.switchBackToURLInput.bind(c()(t)),t.toggleImageOnly=t.toggleImageOnly.bind(c()(t)),t.toggleDisplayMarkers=t.toggleDisplayMarkers.bind(c()(t)),t.overrideSOM=t.overrideSOM.bind(c()(t)),t.state={url:t.props.attributes.url,imageOnly:t.props.attributes.imageOnly,displayMarkers:t.props.attributes.displayMarkers,som:t.props.attributes.som,editingURL:!!z(t.props.attributes.url)},t}return i()(r,[{key:"setUrl",value:function(t){t&&t.preventDefault(),this.setState({editingURL:!1}),this.props.setAttributes({url:this.state.url})}},{key:"switchBackToURLInput",value:function(){this.setState({editingURL:!0})}},{key:"toggleImageOnly",value:function(t){this.setState({imageOnly:t}),this.props.setAttributes({imageOnly:t})}},{key:"toggleDisplayMarkers",value:function(t){this.setState({displayMarkers:t}),this.props.setAttributes({displayMarkers:t})}},{key:"overrideSOM",value:function(t){this.setState({som:t}),this.props.setAttributes({som:t})}},{key:"render",value:function(){var t=this,e=this.state,r=e.url,n=e.editingURL,o=e.imageOnly,a=e.displayMarkers,s=e.som;return n?Object(b.createElement)(S,{icon:"chart-line",label:A("Strava Activity","wp-strava"),instructions:A("Paste a link to the Strava Activity you want to display on your site.","wp-strava"),placeholder:A("Enter Activity URL to embed here…","wp-strava"),onSubmit:this.setUrl,value:r,onChange:function(e){return t.setState({url:e.target.value})}}):Object(b.createElement)(b.Fragment,null,Object(b.createElement)(_,{switchBackToURLInput:this.switchBackToURLInput}),Object(b.createElement)(q,{block:"wp-strava/activity",attributes:{url:r,imageOnly:o,displayMarkers:a,som:s}}),Object(b.createElement)(F,null,Object(b.createElement)(W,{title:A("Display Options","wp-strava")},Object(b.createElement)(G,{label:A("Image Only","wp-strava"),checked:o,onChange:function(e){return t.toggleImageOnly(e)}}),Object(b.createElement)(G,{label:A("Display Markers","wp-strava"),checked:a,onChange:function(e){return t.toggleDisplayMarkers(e)}}),Object(b.createElement)(D,{onChange:this.overrideSOM}))))}}]),r}(N),K=r(8);function Q(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=m()(t);if(e){var o=m()(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return d()(this,r)}}K.edit=H,K.save=function(){return null},K.transforms={from:[{type:"raw",isMatch:function(t){return"P"===t.nodeName&&t.innerText.startsWith("https://www.strava.com/activities/")},transform:function(t){return Object(n.createBlock)(K.name,{url:t.innerText})}},{type:"block",blocks:["core/paragraph"],isMatch:function(t){return t.content.startsWith("https://www.strava.com/activities/")},transform:function(t){return Object(n.createBlock)(K.name,{url:t.content})}},{type:"shortcode",tag:["activity","ride"],attributes:{url:{type:"string",shortcode:function(t){return"https://www.strava.com/activities/"+t.named.id}}}}],to:[{type:"block",blocks:["core/paragraph"],transform:function(t){return Object(n.createBlock)("core/paragraph",{content:t.url})}}]},Object(n.registerBlockType)(K.name,K);var V=wp.i18n.__,X=wp.element.Component,Y=wp.editor.InspectorControls,Z=wp.components,$=Z.PanelBody,tt=Z.ToggleControl,et=Z.ServerSideRender,rt=lodash.isEmpty,nt=function(t){p()(r,t);var e=Q(r);function r(){var t;return a()(this,r),(t=e.apply(this,arguments)).setUrl=t.setUrl.bind(c()(t)),t.switchBackToURLInput=t.switchBackToURLInput.bind(c()(t)),t.toggleImageOnly=t.toggleImageOnly.bind(c()(t)),t.toggleDisplayMarkers=t.toggleDisplayMarkers.bind(c()(t)),t.overrideSOM=t.overrideSOM.bind(c()(t)),t.state={url:t.props.attributes.url,imageOnly:t.props.attributes.imageOnly,displayMarkers:t.props.attributes.displayMarkers,som:t.props.attributes.som,editingURL:!!rt(t.props.attributes.url)},t}return i()(r,[{key:"setUrl",value:function(t){t&&t.preventDefault(),this.setState({editingURL:!1}),this.props.setAttributes({url:this.state.url})}},{key:"switchBackToURLInput",value:function(){this.setState({editingURL:!0})}},{key:"toggleImageOnly",value:function(t){this.setState({imageOnly:t}),this.props.setAttributes({imageOnly:t})}},{key:"toggleDisplayMarkers",value:function(t){this.setState({displayMarkers:t}),this.props.setAttributes({displayMarkers:t})}},{key:"overrideSOM",value:function(t){this.setState({som:t}),this.props.setAttributes({som:t})}},{key:"render",value:function(){var t=this,e=this.state,r=e.url,n=e.editingURL,o=e.imageOnly,a=e.displayMarkers,s=e.som;return n?Object(b.createElement)(S,{icon:"location-alt",label:V("Strava Route","wp-strava"),instructions:V("Paste a link to the Strava Route you want to display on your site.","wp-strava"),placeholder:V("Enter Route URL to embed here…","wp-strava"),onSubmit:this.setUrl,value:r,onChange:function(e){return t.setState({url:e.target.value})}}):Object(b.createElement)(b.Fragment,null,Object(b.createElement)(_,{switchBackToURLInput:this.switchBackToURLInput}),Object(b.createElement)(et,{block:"wp-strava/route",attributes:{url:r,imageOnly:o,displayMarkers:a,som:s}}),Object(b.createElement)(Y,null,Object(b.createElement)($,{title:V("Display Options","wp-strava")},Object(b.createElement)(tt,{label:V("Image Only","wp-strava"),checked:o,onChange:function(e){return t.toggleImageOnly(e)}}),Object(b.createElement)(tt,{label:V("Display Markers","wp-strava"),checked:a,onChange:function(e){return t.toggleDisplayMarkers(e)}}),Object(b.createElement)(D,{onChange:this.overrideSOM}))))}}]),r}(X),ot=r(9);function at(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=m()(t);if(e){var o=m()(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return d()(this,r)}}ot.edit=nt,ot.save=function(){return null},ot.transforms={from:[{type:"raw",priority:10,isMatch:function(t){return"P"===t.nodeName&&t.innerText.startsWith("https://www.strava.com/routes/")},transform:function(t){return Object(n.createBlock)(ot.name,{url:t.innerText})}}]},Object(n.registerBlockType)(ot.name,ot);var st=wp.i18n.__,it=wp.element.Component,lt=wp.editor.InspectorControls,ct=wp.components,ut=ct.PanelBody,pt=(ct.ToggleControl,ct.ServerSideRender),ft=function(t){p()(r,t);var e=at(r);function r(){var t;return a()(this,r),(t=e.apply(this,arguments)).overrideSOM=t.overrideSOM.bind(c()(t)),t.state={som:t.props.attributes.som},t}return i()(r,[{key:"overrideSOM",value:function(t){this.setState({som:t}),this.props.setAttributes({som:t})}},{key:"render",value:function(){var t=this.state.som;return Object(b.createElement)(b.Fragment,null,Object(b.createElement)(pt,{block:"wp-strava/activitieslist",attributes:{som:t}}),Object(b.createElement)(lt,null,Object(b.createElement)(ut,{title:st("Display Options","wp-strava")},Object(b.createElement)(D,{onChange:this.overrideSOM}))))}}]),r}(it),dt=r(11);function yt(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=m()(t);if(e){var o=m()(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return d()(this,r)}}dt.edit=ft,dt.save=function(){return null},Object(n.registerBlockType)(dt.name,dt);var mt=wp.i18n.__,bt=wp.element.Component,vt=wp.editor.InspectorControls,gt=wp.components,ht=gt.PanelBody,Ot=gt.ToggleControl,wt=gt.ServerSideRender,kt=lodash.isEmpty,St=function(t){p()(r,t);var e=yt(r);function r(){var t;return a()(this,r),(t=e.apply(this,arguments)).setUrl=t.setUrl.bind(c()(t)),t.switchBackToURLInput=t.switchBackToURLInput.bind(c()(t)),t.toggleImageOnly=t.toggleImageOnly.bind(c()(t)),t.toggleDisplayMarkers=t.toggleDisplayMarkers.bind(c()(t)),t.overrideSOM=t.overrideSOM.bind(c()(t)),t.state={url:t.props.attributes.url,imageOnly:t.props.attributes.imageOnly,displayMarkers:t.props.attributes.displayMarkers,som:t.props.attributes.som,editingURL:!!kt(t.props.attributes.url)},t}return i()(r,[{key:"setUrl",value:function(t){t&&t.preventDefault(),this.setState({editingURL:!1}),this.props.setAttributes({url:this.state.url})}},{key:"switchBackToURLInput",value:function(){this.setState({editingURL:!0})}},{key:"toggleImageOnly",value:function(t){this.setState({imageOnly:t}),this.props.setAttributes({imageOnly:t})}},{key:"toggleDisplayMarkers",value:function(t){this.setState({displayMarkers:t}),this.props.setAttributes({displayMarkers:t})}},{key:"overrideSOM",value:function(t){this.setState({som:t}),this.props.setAttributes({som:t})}},{key:"render",value:function(){var t=this,e=this.state,r=e.url,n=e.editingURL,o=e.imageOnly,a=e.displayMarkers,s=e.som;return n?Object(b.createElement)(S,{icon:"location-alt",label:mt("Strava Segment","wp-strava"),instructions:mt("Paste a link to the Strava Segment you want to display on your site.","wp-strava"),placeholder:mt("Enter Segment URL to embed here…","wp-strava"),onSubmit:this.setUrl,value:r,onChange:function(e){return t.setState({url:e.target.value})}}):Object(b.createElement)(b.Fragment,null,Object(b.createElement)(_,{switchBackToURLInput:this.switchBackToURLInput}),Object(b.createElement)(wt,{block:"wp-strava/segment",attributes:{url:r,imageOnly:o,displayMarkers:a,som:s}}),Object(b.createElement)(vt,null,Object(b.createElement)(ht,{title:mt("Display Options","wp-strava")},Object(b.createElement)(Ot,{label:mt("Image Only","wp-strava"),checked:o,onChange:function(e){return t.toggleImageOnly(e)}}),Object(b.createElement)(Ot,{label:mt("Display Markers","wp-strava"),checked:a,onChange:function(e){return t.toggleDisplayMarkers(e)}}),Object(b.createElement)(D,{onChange:this.overrideSOM}))))}}]),r}(bt),xt=r(10);xt.edit=St,xt.save=function(){return null},xt.transforms={from:[{type:"raw",priority:10,isMatch:function(t){return"P"===t.nodeName&&t.innerText.startsWith("https://www.strava.com/segments/")},transform:function(t){return Object(n.createBlock)(xt.name,{url:t.innerText})}}]},Object(n.registerBlockType)(xt.name,xt)}]);
     1!function(t){var e={};function r(n){if(e[n])return e[n].exports;var o=e[n]={i:n,l:!1,exports:{}};return t[n].call(o.exports,o,o.exports,r),o.l=!0,o.exports}r.m=t,r.c=e,r.d=function(t,e,n){r.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:n})},r.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},r.t=function(t,e){if(1&e&&(t=r(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var o in t)r.d(n,o,function(e){return t[e]}.bind(null,o));return n},r.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return r.d(e,"a",e),e},r.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},r.p="",r(r.s=15)}([function(t,e){t.exports=window.wp.element},function(t,e){t.exports=function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t},t.exports.__esModule=!0,t.exports.default=t.exports},function(t,e){function r(e){return t.exports=r=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},t.exports.__esModule=!0,t.exports.default=t.exports,r(e)}t.exports=r,t.exports.__esModule=!0,t.exports.default=t.exports},function(t,e){t.exports=window.wp.blocks},function(t,e){t.exports=function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")},t.exports.__esModule=!0,t.exports.default=t.exports},function(t,e){function r(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}t.exports=function(t,e,n){return e&&r(t.prototype,e),n&&r(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t},t.exports.__esModule=!0,t.exports.default=t.exports},function(t,e,r){var n=r(13);t.exports=function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&n(t,e)},t.exports.__esModule=!0,t.exports.default=t.exports},function(t,e,r){var n=r(14).default,o=r(1);t.exports=function(t,e){if(e&&("object"===n(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return o(t)},t.exports.__esModule=!0,t.exports.default=t.exports},function(t){t.exports=JSON.parse('{"name":"wp-strava/activity","title":"Strava Activity","category":"embed","icon":"chart-line","description":"Embed a Strava Activity","keywords":["activity","ride","map"],"textdomain":"wp-strava","attributes":{"url":{"type":"string","default":""},"imageOnly":{"type":"boolean","default":false},"displayMarkers":{"type":"boolean","default":false},"som":{"type":"string","default":null}},"editorScript":"file:../../../build/index.js","editorStyle":"file:../../../build/editor.css","style":"file:../../../build/style.css"}')},function(t){t.exports=JSON.parse('{"name":"wp-strava/route","title":"Strava Route","category":"embed","icon":"location-alt","description":"Embed a Strava Route","keywords":["route","map"],"textdomain":"wp-strava","attributes":{"url":{"type":"string","default":""},"imageOnly":{"type":"boolean","default":false},"displayMarkers":{"type":"boolean","default":false},"som":{"type":"string","default":null}},"editorScript":"file:../../../build/index.js","editorStyle":"file:../../../build/editor.css","style":"file:../../../build/style.css"}')},function(t){t.exports=JSON.parse('{"name":"wp-strava/segment","title":"Strava Segment","category":"embed","icon":"chart-area","description":"Embed a Strava Segment","keywords":["segment","map"],"textdomain":"wp-strava","attributes":{"url":{"type":"string","default":""},"imageOnly":{"type":"boolean","default":false},"displayMarkers":{"type":"boolean","default":true},"som":{"type":"string","default":null}},"editorScript":"file:../../../build/index.js","editorStyle":"file:../../../build/editor.css","style":"file:../../../build/style.css"}')},function(t){t.exports=JSON.parse('{"name":"wp-strava/activitieslist","title":"Strava Activities List","category":"embed","icon":"editor-ul","description":"List of Strava Activities","keywords":["activity","ride"],"textdomain":"wp-strava","attributes":{"som":{"type":"string","default":null}},"editorScript":"file:../../../build/index.js","editorStyle":"file:../../../build/editor.css","style":"file:../../../build/style.css"}')},function(t,e){t.exports=window.wp.editor},function(t,e){function r(e,n){return t.exports=r=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},t.exports.__esModule=!0,t.exports.default=t.exports,r(e,n)}t.exports=r,t.exports.__esModule=!0,t.exports.default=t.exports},function(t,e){function r(e){return t.exports=r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},t.exports.__esModule=!0,t.exports.default=t.exports,r(e)}t.exports=r,t.exports.__esModule=!0,t.exports.default=t.exports},function(t,e,r){"use strict";r.r(e);var n=r(3),o=r(4),a=r.n(o),s=r(5),i=r.n(s),l=r(1),c=r.n(l),u=r(6),p=r.n(u),f=r(7),d=r.n(f),y=r(2),m=r.n(y),b=r(0),v=r(12),h=wp.i18n,g=(h.__,h._x),O=wp.components,w=O.Button,k=O.Placeholder,S=function(t){var e=t.icon,r=t.label,n=t.instructions,o=t.placeholder,a=t.value,s=t.onSubmit,i=t.onChange;return Object(b.createElement)(k,{icon:Object(b.createElement)(v.BlockIcon,{icon:e,showColors:!0}),label:r,className:"wp-block-embed",instructions:n},Object(b.createElement)("form",{onSubmit:s},Object(b.createElement)("input",{type:"url",value:a||"",className:"components-placeholder__input","aria-label":r,placeholder:o,onChange:i}),Object(b.createElement)(w,{isPrimary:!0,type:"submit"},g("Embed","button label","wp-strava"))))},j=wp.i18n.__,x=wp.components,M=x.Icon,R=x.Button,E=x.Toolbar,_=function(t){var e=t.switchBackToURLInput;return Object(b.createElement)(b.Fragment,null,Object(b.createElement)(v.BlockControls,null,Object(b.createElement)(E,{label:j("Options","wp-strava")},Object(b.createElement)(R,{label:j("Edit URL","wp-strava"),onClick:e},Object(b.createElement)(M,{icon:"edit"})))))};var B=wp.i18n.__,U=wp.element.Component,C=wp.components,I=C.Button,T=C.ButtonGroup,L=function(t){p()(o,t);var e,r,n=(e=o,r=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,n=m()(e);if(r){var o=m()(this).constructor;t=Reflect.construct(n,arguments,o)}else t=n.apply(this,arguments);return d()(this,t)});function o(){var t;return a()(this,o),(t=n.apply(this,arguments)).onChange=t.onChange.bind(c()(t)),t.state={som:""},t}return i()(o,[{key:"onChange",value:function(t){this.setState({som:t.target.value}),this.props.onChange(t.target.value)}},{key:"render",value:function(){var t=this.state.som;return Object(b.createElement)("div",{className:"wp-block-wp-strava-som-control"},Object(b.createElement)("p",{className:"wp-block-wp-strava-som-control-row"},B("System of Measure (override from settings)")),Object(b.createElement)("div",{className:"wp-block-wp-strava-som-control-row"},Object(b.createElement)(T,{"aria-label":B("System of Measure","wp-strava")},Object(b.createElement)(I,{isSmall:!0,isPrimary:"english"==t,isPressed:"english"==t,value:"english",onClick:this.onChange},B("English","wp-strava")),Object(b.createElement)(I,{isSmall:!0,isPrimary:"metric"==t,isPressed:"metric"==t,value:"metric",onClick:this.onChange},B("Metric","wp-strava"))),Object(b.createElement)(I,{isSmall:!0,value:"",onClick:this.onChange},B("Reset","wp-strava"))))}}]),o}(U);var P=wp.i18n.__,D=wp.element.Component,A=wp.editor.InspectorControls,N=wp.components,F=N.PanelBody,J=N.ToggleControl,W=N.ServerSideRender,G=lodash.isEmpty,q=function(t){p()(o,t);var e,r,n=(e=o,r=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,n=m()(e);if(r){var o=m()(this).constructor;t=Reflect.construct(n,arguments,o)}else t=n.apply(this,arguments);return d()(this,t)});function o(){var t;return a()(this,o),(t=n.apply(this,arguments)).setUrl=t.setUrl.bind(c()(t)),t.switchBackToURLInput=t.switchBackToURLInput.bind(c()(t)),t.toggleImageOnly=t.toggleImageOnly.bind(c()(t)),t.toggleDisplayMarkers=t.toggleDisplayMarkers.bind(c()(t)),t.overrideSOM=t.overrideSOM.bind(c()(t)),t.state={url:t.props.attributes.url,imageOnly:t.props.attributes.imageOnly,displayMarkers:t.props.attributes.displayMarkers,som:t.props.attributes.som,editingURL:!!G(t.props.attributes.url)},t}return i()(o,[{key:"setUrl",value:function(t){t&&t.preventDefault(),this.setState({editingURL:!1}),this.props.setAttributes({url:this.state.url})}},{key:"switchBackToURLInput",value:function(){this.setState({editingURL:!0})}},{key:"toggleImageOnly",value:function(t){this.setState({imageOnly:t}),this.props.setAttributes({imageOnly:t})}},{key:"toggleDisplayMarkers",value:function(t){this.setState({displayMarkers:t}),this.props.setAttributes({displayMarkers:t})}},{key:"overrideSOM",value:function(t){this.setState({som:t}),this.props.setAttributes({som:t})}},{key:"render",value:function(){var t=this,e=this.state,r=e.url,n=e.editingURL,o=e.imageOnly,a=e.displayMarkers,s=e.som;return n?Object(b.createElement)(S,{icon:"chart-line",label:P("Strava Activity","wp-strava"),instructions:P("Paste a link to the Strava Activity you want to display on your site.","wp-strava"),placeholder:P("Enter Activity URL to embed here…","wp-strava"),onSubmit:this.setUrl,value:r,onChange:function(e){return t.setState({url:e.target.value})}}):Object(b.createElement)(b.Fragment,null,Object(b.createElement)(_,{switchBackToURLInput:this.switchBackToURLInput}),Object(b.createElement)(W,{block:"wp-strava/activity",attributes:{url:r,imageOnly:o,displayMarkers:a,som:s}}),Object(b.createElement)(A,null,Object(b.createElement)(F,{title:P("Display Options","wp-strava")},Object(b.createElement)(J,{label:P("Image Only","wp-strava"),checked:o,onChange:function(e){return t.toggleImageOnly(e)}}),Object(b.createElement)(J,{label:P("Display Markers","wp-strava"),checked:a,onChange:function(e){return t.toggleDisplayMarkers(e)}}),Object(b.createElement)(L,{onChange:this.overrideSOM}))))}}]),o}(D),z=r(8);z.edit=q,z.save=function(){return null},z.transforms={from:[{type:"raw",isMatch:function(t){return"P"===t.nodeName&&t.innerText.startsWith("https://www.strava.com/activities/")},transform:function(t){return Object(n.createBlock)(z.name,{url:t.innerText})}},{type:"block",blocks:["core/paragraph"],isMatch:function(t){return t.content.startsWith("https://www.strava.com/activities/")},transform:function(t){return Object(n.createBlock)(z.name,{url:t.content})}},{type:"shortcode",tag:["activity","ride"],attributes:{url:{type:"string",shortcode:function(t){return"https://www.strava.com/activities/"+t.named.id}}}}],to:[{type:"block",blocks:["core/paragraph"],transform:function(t){return Object(n.createBlock)("core/paragraph",{content:t.url})}}]},Object(n.registerBlockType)(z.name,z);var H=wp.i18n.__,K=wp.element.Component,Q=wp.editor.InspectorControls,V=wp.components,X=V.PanelBody,Y=V.ToggleControl,Z=V.ServerSideRender,$=lodash.isEmpty,tt=function(t){p()(o,t);var e,r,n=(e=o,r=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,n=m()(e);if(r){var o=m()(this).constructor;t=Reflect.construct(n,arguments,o)}else t=n.apply(this,arguments);return d()(this,t)});function o(){var t;return a()(this,o),(t=n.apply(this,arguments)).setUrl=t.setUrl.bind(c()(t)),t.switchBackToURLInput=t.switchBackToURLInput.bind(c()(t)),t.toggleImageOnly=t.toggleImageOnly.bind(c()(t)),t.toggleDisplayMarkers=t.toggleDisplayMarkers.bind(c()(t)),t.overrideSOM=t.overrideSOM.bind(c()(t)),t.state={url:t.props.attributes.url,imageOnly:t.props.attributes.imageOnly,displayMarkers:t.props.attributes.displayMarkers,som:t.props.attributes.som,editingURL:!!$(t.props.attributes.url)},t}return i()(o,[{key:"setUrl",value:function(t){t&&t.preventDefault(),this.setState({editingURL:!1}),this.props.setAttributes({url:this.state.url})}},{key:"switchBackToURLInput",value:function(){this.setState({editingURL:!0})}},{key:"toggleImageOnly",value:function(t){this.setState({imageOnly:t}),this.props.setAttributes({imageOnly:t})}},{key:"toggleDisplayMarkers",value:function(t){this.setState({displayMarkers:t}),this.props.setAttributes({displayMarkers:t})}},{key:"overrideSOM",value:function(t){this.setState({som:t}),this.props.setAttributes({som:t})}},{key:"render",value:function(){var t=this,e=this.state,r=e.url,n=e.editingURL,o=e.imageOnly,a=e.displayMarkers,s=e.som;return n?Object(b.createElement)(S,{icon:"location-alt",label:H("Strava Route","wp-strava"),instructions:H("Paste a link to the Strava Route you want to display on your site.","wp-strava"),placeholder:H("Enter Route URL to embed here…","wp-strava"),onSubmit:this.setUrl,value:r,onChange:function(e){return t.setState({url:e.target.value})}}):Object(b.createElement)(b.Fragment,null,Object(b.createElement)(_,{switchBackToURLInput:this.switchBackToURLInput}),Object(b.createElement)(Z,{block:"wp-strava/route",attributes:{url:r,imageOnly:o,displayMarkers:a,som:s}}),Object(b.createElement)(Q,null,Object(b.createElement)(X,{title:H("Display Options","wp-strava")},Object(b.createElement)(Y,{label:H("Image Only","wp-strava"),checked:o,onChange:function(e){return t.toggleImageOnly(e)}}),Object(b.createElement)(Y,{label:H("Display Markers","wp-strava"),checked:a,onChange:function(e){return t.toggleDisplayMarkers(e)}}),Object(b.createElement)(L,{onChange:this.overrideSOM}))))}}]),o}(K),et=r(9);et.edit=tt,et.save=function(){return null},et.transforms={from:[{type:"raw",priority:10,isMatch:function(t){return"P"===t.nodeName&&t.innerText.startsWith("https://www.strava.com/routes/")},transform:function(t){return Object(n.createBlock)(et.name,{url:t.innerText})}}]},Object(n.registerBlockType)(et.name,et);var rt=wp.i18n.__,nt=wp.element.Component,ot=wp.editor.InspectorControls,at=wp.components,st=at.PanelBody,it=(at.ToggleControl,at.ServerSideRender),lt=function(t){p()(o,t);var e,r,n=(e=o,r=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,n=m()(e);if(r){var o=m()(this).constructor;t=Reflect.construct(n,arguments,o)}else t=n.apply(this,arguments);return d()(this,t)});function o(){var t;return a()(this,o),(t=n.apply(this,arguments)).overrideSOM=t.overrideSOM.bind(c()(t)),t.state={som:t.props.attributes.som},t}return i()(o,[{key:"overrideSOM",value:function(t){this.setState({som:t}),this.props.setAttributes({som:t})}},{key:"render",value:function(){var t=this.state.som;return Object(b.createElement)(b.Fragment,null,Object(b.createElement)(it,{block:"wp-strava/activitieslist",attributes:{som:t}}),Object(b.createElement)(ot,null,Object(b.createElement)(st,{title:rt("Display Options","wp-strava")},Object(b.createElement)(L,{onChange:this.overrideSOM}))))}}]),o}(nt),ct=r(11);ct.edit=lt,ct.save=function(){return null},Object(n.registerBlockType)(ct.name,ct);var ut=wp.i18n.__,pt=wp.element.Component,ft=wp.editor.InspectorControls,dt=wp.components,yt=dt.PanelBody,mt=dt.ToggleControl,bt=dt.ServerSideRender,vt=lodash.isEmpty,ht=function(t){p()(o,t);var e,r,n=(e=o,r=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,n=m()(e);if(r){var o=m()(this).constructor;t=Reflect.construct(n,arguments,o)}else t=n.apply(this,arguments);return d()(this,t)});function o(){var t;return a()(this,o),(t=n.apply(this,arguments)).setUrl=t.setUrl.bind(c()(t)),t.switchBackToURLInput=t.switchBackToURLInput.bind(c()(t)),t.toggleImageOnly=t.toggleImageOnly.bind(c()(t)),t.toggleDisplayMarkers=t.toggleDisplayMarkers.bind(c()(t)),t.overrideSOM=t.overrideSOM.bind(c()(t)),t.state={url:t.props.attributes.url,imageOnly:t.props.attributes.imageOnly,displayMarkers:t.props.attributes.displayMarkers,som:t.props.attributes.som,editingURL:!!vt(t.props.attributes.url)},t}return i()(o,[{key:"setUrl",value:function(t){t&&t.preventDefault(),this.setState({editingURL:!1}),this.props.setAttributes({url:this.state.url})}},{key:"switchBackToURLInput",value:function(){this.setState({editingURL:!0})}},{key:"toggleImageOnly",value:function(t){this.setState({imageOnly:t}),this.props.setAttributes({imageOnly:t})}},{key:"toggleDisplayMarkers",value:function(t){this.setState({displayMarkers:t}),this.props.setAttributes({displayMarkers:t})}},{key:"overrideSOM",value:function(t){this.setState({som:t}),this.props.setAttributes({som:t})}},{key:"render",value:function(){var t=this,e=this.state,r=e.url,n=e.editingURL,o=e.imageOnly,a=e.displayMarkers,s=e.som;return n?Object(b.createElement)(S,{icon:"location-alt",label:ut("Strava Segment","wp-strava"),instructions:ut("Paste a link to the Strava Segment you want to display on your site.","wp-strava"),placeholder:ut("Enter Segment URL to embed here…","wp-strava"),onSubmit:this.setUrl,value:r,onChange:function(e){return t.setState({url:e.target.value})}}):Object(b.createElement)(b.Fragment,null,Object(b.createElement)(_,{switchBackToURLInput:this.switchBackToURLInput}),Object(b.createElement)(bt,{block:"wp-strava/segment",attributes:{url:r,imageOnly:o,displayMarkers:a,som:s}}),Object(b.createElement)(ft,null,Object(b.createElement)(yt,{title:ut("Display Options","wp-strava")},Object(b.createElement)(mt,{label:ut("Image Only","wp-strava"),checked:o,onChange:function(e){return t.toggleImageOnly(e)}}),Object(b.createElement)(mt,{label:ut("Display Markers","wp-strava"),checked:a,onChange:function(e){return t.toggleDisplayMarkers(e)}}),Object(b.createElement)(L,{onChange:this.overrideSOM}))))}}]),o}(pt),gt=r(10);gt.edit=ht,gt.save=function(){return null},gt.transforms={from:[{type:"raw",priority:10,isMatch:function(t){return"P"===t.nodeName&&t.innerText.startsWith("https://www.strava.com/segments/")},transform:function(t){return Object(n.createBlock)(gt.name,{url:t.innerText})}}]},Object(n.registerBlockType)(gt.name,gt)}]);
  • wp-strava/trunk/css/wp-strava.css

    r2716483 r2792647  
    1010    margin: 0 6px 2px 0;
    1111}
     12
    1213.wp-strava-activity-container {
    1314    display: table;
    1415    margin: 0 auto;
    1516}
     17
    1618.activity-details-table tr td {
    1719    padding: 5px;
    1820}
     21
    1922.activity-details-table th {
    2023    padding: 5px;
     
    2225    font-size: 0.8em;
    2326}
     27
     28.activity-details-table td:before {
     29    position: relative;
     30}
     31
    2432.activity-details-table td {
    2533    text-align: center;
    2634    border: 1px solid #e7e7e7;
    2735}
     36
    2837.activity-details-table-info {
    2938    font-size: 1.2em;
     
    3140    text-shadow: 1px 1px 0px rgba(0, 0, 0, 0.4);
    3241}
     42
    3343.activity-details-table-units {
    3444    font-size: 0.8em;
  • wp-strava/trunk/readme.txt

    r2716486 r2792647  
    44Tags: strava, activity, bicycle, cycling, biking, running, run, swimming, swim, paddle, kayak, gps, shortcode, widget, plugin, block, blocks
    55Requires at least: 4.6
    6 Tested up to: 5.8
    7 Stable tag: 2.11.1
     6Tested up to: 6.0
     7Stable tag: 2.12.0
    88Requires PHP: 5.3
    99License: GPLv2 or later
     
    2323= Blocks =
    2424
    25 *Available in WordPress 5.0 and up.*
     25*Available in WordPress 5.0 and up.* Embeds described in this section will only work in the WP Block (Gutenberg) editor. Compatibility with WPBakery, Visual Composer, Elementor, Beaver Builder, etc. may differ.
    2626
    2727== Strava Activity ==
     
    104104= Why is my Google Map not showing up? =
    105105
    106 If your API key works with other Google Maps plugins but not WP Strava, you may need to enable the "Static Maps" functionality on your google account. This is especially true for people using G Suite accounts (not just a @gmail.com address). While logged into your G Suite email, visit https://console.developers.google.com/apis/library/static-maps-backend.googleapis.com/?q=static and make sure the "Static Maps API" is enabled. For more details see https://wordpress.org/support/topic/no-data-errors/
     106If your API key works with other Google Maps plugins but not WP-Strava, you may need to enable the "Static Maps" functionality on your google account. This is especially true for people using G Suite accounts (not just a @gmail.com address). While logged into your G Suite email, visit https://console.developers.google.com/apis/library/static-maps-backend.googleapis.com/?q=static and make sure the "Static Maps API" is enabled. For more details see https://wordpress.org/support/topic/no-data-errors/
    107107
    108108
     
    119119== Screenshots ==
    120120
    121 1. WP Strava settings - this walks you through connecting the WP Strava plugin to your Strava account. You can connect multiple accounts by authenticating each one here. Add your Google Maps key for map display here. You can also set the system of measurement (miles/kilometers) and clear any saved data.
     1211. WP-Strava settings - this walks you through connecting the WP-Strava plugin to your Strava account. You can connect multiple accounts by authenticating each one here. Add your Google Maps key for map display here. You can also set the system of measurement (miles/kilometers) and clear any saved data.
    1221222. Strava Activities List Widget - shows a list of the most recent activities for the selected athlete.
    1231233. Strava Activities List Widget Settings - settings for the Strava Activities List Widget.
     
    135135== Changelog ==
    136136
     137= 2.12.0 =
     138Update documentation around block embeds https://wordpress.org/support/topic/which-editor-to-use-2/
     139Added debugging for API GET/POST to troubleshoot 401 errors https://wordpress.org/support/topic/wp-strava-error-401-unauthorized/
     140
     141
    137142= 2.11.1 =
    138143Add class selector to responsive tables https://wordpress.org/support/topic/shortcode-embed-responsive-table-styling-issues/
     144
    139145
    140146= 2.11.0 =
  • wp-strava/trunk/src/WPStrava.php

    r2651185 r2792647  
    244244
    245245        // automatically load dependencies and version
    246         $asset_file = include WPSTRAVA_PLUGIN_DIR . 'build/index.asset.php';
     246        $asset_file = require WPSTRAVA_PLUGIN_DIR . 'build/index.asset.php';
    247247
    248248        wp_register_script(
  • wp-strava/trunk/src/WPStrava/API.php

    r2504177 r2792647  
    4545
    4646        $response = wp_remote_post( $url . $uri, $args );
     47
     48        if ( WPSTRAVA_DEBUG ) {
     49            // phpcs:disable WordPress.PHP.DevelopmentFunctions -- Debug output.
     50            error_log(
     51                print_r(
     52                    array(
     53                        'url'      => $url . $uri,
     54                        'args'     => $args,
     55                        'response' => $response,
     56                    ),
     57                    true
     58                )
     59            );
     60            // phpcs:enable
     61        }
    4762
    4863        if ( is_wp_error( $response ) ) {
     
    137152
    138153        $response = wp_remote_get( $url, $get_args );
     154
     155        if ( WPSTRAVA_DEBUG ) {
     156            // phpcs:disable WordPress.PHP.DevelopmentFunctions -- Debug output.
     157            error_log(
     158                print_r(
     159                    array(
     160                        'url'      => $url,
     161                        'args'     => $get_args,
     162                        'response' => $response,
     163                    ),
     164                    true
     165                )
     166            );
     167            // phpcs:enable
     168        }
     169
    139170        if ( is_wp_error( $response ) ) {
    140171            throw WPStrava_Exception::from_wp_error( $response );
     
    147178            if ( $auth instanceof WPStrava_AuthRefresh ) {
    148179                $auth->auth_refresh();
    149                 $access_token = $this->get_access_token();
    150                 if ( $access_token ) {
    151                     $get_args['headers']['Authorization'] = 'Bearer ' . $access_token;
    152                 }
    153                 return $this->remote_get( $uri, $get_args );
     180                // Try again.
     181                return $this->remote_get( $uri, $args );
    154182            }
    155183        }
  • wp-strava/trunk/src/WPStrava/Auth.php

    r2604596 r2792647  
    4848                'flags'  => FILTER_REQUIRE_SCALAR,
    4949            ),
    50             'strava_client_secret' => FILTER_SANITIZE_STRING,
     50            'strava_client_secret' => FILTER_SANITIZE_FULL_SPECIAL_CHARS,
    5151        );
    5252
     
    5858
    5959        // Redirect only if all the right options are in place.
    60         if ( $settings->is_settings_updated( $value ) && $settings->is_option_page() ) {
     60        if ( $settings->is_settings_updated( $value ) && $settings->is_options_page() ) {
    6161            // Only re-auth if client ID and secret were saved.
    6262            if ( ! empty( $input['strava_client_id'] ) && ! empty( $input['strava_client_secret'] ) ) {
     
    7272
    7373        $input_args = array(
    74             'settings-updated' => FILTER_SANITIZE_STRING,
    75             'code'             => FILTER_SANITIZE_STRING,
     74            'settings-updated' => FILTER_SANITIZE_FULL_SPECIAL_CHARS,
     75            'code'             => FILTER_SANITIZE_FULL_SPECIAL_CHARS,
    7676        );
    7777
  • wp-strava/trunk/src/WPStrava/Settings.php

    r2651185 r2792647  
    1313    private $ids            = array();
    1414    private $page_name      = 'wp-strava-options';
    15     private $option_page    = 'wp-strava-settings-group';
     15    private $option_group   = 'wp-strava-settings-group';
    1616    private $adding_athlete = true;
    1717
     
    5959        $ids = $this->get_ids();
    6060        if ( $this->ids_empty( $ids ) ) {
    61             register_setting( $this->option_page, 'strava_client_id', array( $this, 'sanitize_client_id' ) );
    62             register_setting( $this->option_page, 'strava_client_secret', array( $this, 'sanitize_client_secret' ) );
    63             register_setting( $this->option_page, 'strava_nickname', array( $this, 'sanitize_nickname' ) );
     61            register_setting( $this->option_group, 'strava_client_id', array( $this, 'sanitize_client_id' ) );
     62            register_setting( $this->option_group, 'strava_client_secret', array( $this, 'sanitize_client_secret' ) );
     63            register_setting( $this->option_group, 'strava_nickname', array( $this, 'sanitize_nickname' ) );
    6464
    6565            add_settings_field( 'strava_client_id', __( 'Strava Client ID', 'wp-strava' ), array( $this, 'print_client_input' ), 'wp-strava', 'strava_api' );
     
    6767            add_settings_field( 'strava_nickname', __( 'Strava Nickname', 'wp-strava' ), array( $this, 'print_nickname_input' ), 'wp-strava', 'strava_api' );
    6868        } else {
    69             register_setting( $this->option_page, 'strava_id', array( $this, 'sanitize_id' ) );
     69            register_setting( $this->option_group, 'strava_id', array( $this, 'sanitize_id' ) );
    7070            add_settings_field( 'strava_id', __( 'Saved ID', 'wp-strava' ), array( $this, 'print_id_input' ), 'wp-strava', 'strava_api' );
    7171
    7272            // Add additional fields
    73             register_setting( $this->option_page, 'strava_client_id', array( $this, 'sanitize_client_id' ) );
    74             register_setting( $this->option_page, 'strava_client_secret', array( $this, 'sanitize_client_secret' ) );
    75             register_setting( $this->option_page, 'strava_nickname', array( $this, 'sanitize_nickname' ) );
     73            register_setting( $this->option_group, 'strava_client_id', array( $this, 'sanitize_client_id' ) );
     74            register_setting( $this->option_group, 'strava_client_secret', array( $this, 'sanitize_client_secret' ) );
     75            register_setting( $this->option_group, 'strava_nickname', array( $this, 'sanitize_nickname' ) );
    7676
    7777            add_settings_field( 'strava_client_id', __( 'Additional Athlete Client ID', 'wp-strava' ), array( $this, 'print_client_input' ), 'wp-strava', 'strava_api' );
     
    8383        add_settings_section( 'strava_maps', __( 'Maps', 'wp-strava' ), null, 'wp-strava' );
    8484
    85         register_setting( $this->option_page, 'strava_map_type', array( $this, 'sanitize_map_type' ) );
     85        register_setting( $this->option_group, 'strava_map_type', array( $this, 'sanitize_map_type' ) );
    8686        add_settings_field( 'strava_map_type', __( 'Map Type', 'wp-strava' ), array( $this, 'print_map_type_input' ), 'wp-strava', 'strava_maps' );
    8787
    88         register_setting( $this->option_page, 'strava_gmaps_key', array( $this, 'sanitize_gmaps_key' ) );
     88        register_setting( $this->option_group, 'strava_gmaps_key', array( $this, 'sanitize_gmaps_key' ) );
    8989        add_settings_field( 'strava_gmaps_key', __( 'Google Static Maps API Key', 'wp-strava' ), array( $this, 'print_gmaps_key_input' ), 'wp-strava', 'strava_maps' );
    9090
    91         register_setting( $this->option_page, 'strava_mapbox_token', array( $this, 'sanitize_mapbox_token' ) );
     91        register_setting( $this->option_group, 'strava_mapbox_token', array( $this, 'sanitize_mapbox_token' ) );
    9292        add_settings_field( 'strava_mapbox_token', __( 'Mapbox Public Token', 'wp-strava' ), array( $this, 'print_mapbox_token_input' ), 'wp-strava', 'strava_maps' );
    9393
    9494        // System of Measurement.
    95         register_setting( $this->option_page, 'strava_som', array( $this, 'sanitize_som' ) );
     95        register_setting( $this->option_group, 'strava_som', array( $this, 'sanitize_som' ) );
    9696        add_settings_section( 'strava_options', __( 'Options', 'wp-strava' ), null, 'wp-strava' );
    9797        add_settings_field( 'strava_som', __( 'System of Measurement', 'wp-strava' ), array( $this, 'print_som_input' ), 'wp-strava', 'strava_options' );
    9898
    9999        // Hide Options.
    100         register_setting( $this->option_page, 'strava_hide_time', array( $this, 'sanitize_hide_time' ) );
     100        register_setting( $this->option_group, 'strava_hide_time', array( $this, 'sanitize_hide_time' ) );
    101101        add_settings_field( 'strava_hide_time', __( 'Time', 'wp-strava' ), array( $this, 'print_hide_time_input' ), 'wp-strava', 'strava_options' );
    102         register_setting( $this->option_page, 'strava_hide_elevation', array( $this, 'sanitize_hide_elevation' ) );
     102        register_setting( $this->option_group, 'strava_hide_elevation', array( $this, 'sanitize_hide_elevation' ) );
    103103        add_settings_field( 'strava_hide_elevation', __( 'Elevation', 'wp-strava' ), array( $this, 'print_hide_elevation_input' ), 'wp-strava', 'strava_options' );
    104104
    105105        // No Activity Links.
    106         register_setting( $this->option_page, 'strava_no_link', array( $this, 'sanitize_no_link' ) );
     106        register_setting( $this->option_group, 'strava_no_link', array( $this, 'sanitize_no_link' ) );
    107107        add_settings_field( 'strava_no_link', __( 'Links', 'wp-strava' ), array( $this, 'print_no_link_input' ), 'wp-strava', 'strava_options' );
    108108
    109109        // Cache lifetime.
    110         register_setting( $this->option_page, 'strava_cache_time', array( $this, 'sanitize_cache_time' ) );
     110        register_setting( $this->option_group, 'strava_cache_time', array( $this, 'sanitize_cache_time' ) );
    111111        add_settings_section( 'strava_cache', __( 'Cache', 'wp-strava' ), null, 'wp-strava' );
    112112        add_settings_field( 'strava_cache_time', __( 'Cache time', 'wp-strava' ), array( $this, 'print_cache_input' ), 'wp-strava', 'strava_cache' );
    113113
    114114        // Clear cache.
    115         register_setting( $this->option_page, 'strava_cache_clear', array( $this, 'sanitize_cache_clear' ) );
     115        register_setting( $this->option_group, 'strava_cache_clear', array( $this, 'sanitize_cache_clear' ) );
    116116        add_settings_field( 'strava_cache_clear', __( 'Clear cache', 'wp-strava' ), array( $this, 'print_clear_input' ), 'wp-strava', 'strava_cache' );
     117
     118        if ( WPSTRAVA_DEBUG ) {
     119            add_settings_section( 'strava_debug', __( 'Debug', 'wp-strava' ), null, 'wp-strava' );
     120            add_settings_field( 'strava_debug_info', __( 'Connection Info', 'wp-strava' ), array( $this, 'print_debug_info' ), 'wp-strava', 'strava_debug' );
     121        }
    117122    }
    118123
     
    450455
    451456        foreach ( $infos as $id => $info ) {
    452             if ( ! in_array( $id, $ids ) ) { // phpcs:ignore WordPress.PHP.StrictInArray.MissingTrueStrict -- loose OK.
     457            // phpcs:ignore WordPress.PHP.StrictInArray.MissingTrueStrict -- Loose comparison OK.
     458            if ( ! in_array( $id, $ids ) ) {
    453459                $update = true;
    454460                unset( $infos[ $id ] );
     
    676682        <p class="description"><?php esc_html_e( 'How often to refresh data from the Strava API', 'wp-strava' ); ?></p>
    677683        <?php
     684    }
     685
     686    /**
     687     * Print stored connection info.
     688     *
     689     * @author Justin Foell <justin@foell.org>
     690     * @since  NEXT
     691     */
     692    public function print_debug_info() {
     693        // phpcs:ignore Squiz.PHP.EmbeddedPhp, WordPress.PHP.DevelopmentFunctions -- Formatting & debug OK.
     694        ?><textarea style="width: 100%;" rows="11" readonly="readonly"><?php var_export( get_option( 'strava_info' ) ); ?></textarea><?php
    678695    }
    679696
     
    869886
    870887    /**
    871      * Whether or not we're on the options page.
     888     * Whether or not we're on the options.php page (saving options).
    872889     *
    873890     * @return boolean
     
    875892     * @since  2.0.0
    876893     */
    877     public function is_option_page() {
    878         return filter_input( INPUT_POST, 'option_page', FILTER_SANITIZE_STRING ) === $this->option_page;
     894    public function is_options_page() {
     895        $screen = get_current_screen();
     896        return isset( $screen->id ) && 'options' === $screen->id;
    879897    }
    880898
     
    887905     */
    888906    public function is_settings_page() {
    889         return filter_input( INPUT_GET, 'page', FILTER_SANITIZE_STRING ) === $this->page_name;
     907        return filter_input( INPUT_GET, 'page', FILTER_SANITIZE_FULL_SPECIAL_CHARS ) === $this->page_name;
    890908    }
    891909
     
    909927     */
    910928    private function is_adding_athlete() {
    911         return filter_input( INPUT_POST, 'strava_client_id', FILTER_SANITIZE_NUMBER_INT ) && filter_input( INPUT_POST, 'strava_client_secret', FILTER_SANITIZE_STRING );
     929        return filter_input( INPUT_POST, 'strava_client_id', FILTER_SANITIZE_NUMBER_INT ) &&
     930            filter_input( INPUT_POST, 'strava_client_secret', FILTER_SANITIZE_FULL_SPECIAL_CHARS );
    912931    }
    913932
  • wp-strava/trunk/templates/admin-settings.php

    r2184737 r2792647  
    44
    55    <form method="post" action="<?php echo esc_attr( admin_url( 'options.php' ) ); ?>">
    6         <?php settings_fields( $this->option_page ); ?>
     6        <?php settings_fields( $this->option_group ); ?>
    77        <?php do_settings_sections( 'wp-strava' ); ?>
    88
  • wp-strava/trunk/wp-strava.php

    r2716483 r2792647  
    44 * Plugin URI: https://wordpress.org/plugins/wp-strava/
    55 * Description: Show your strava.com activity on your WordPress site. Some Icons are Copyright © Yusuke Kamiyamane. All rights reserved. Licensed under a Creative Commons Attribution 3.0 license.
    6  * Version: 2.11.1
     6 * Version: 2.12.0
    77 * Author: Carlos Santa Cruz, Justin Foell, Lance Willett, Daniel Lintott, Sebastian Erb
    88 * License: GPL2
     
    2828*/
    2929
    30 define( 'WPSTRAVA_PLUGIN_VERSION', '2.11.1' );
     30
     31define( 'WPSTRAVA_PLUGIN_VERSION', '2.12.0' );
    3132define( 'WPSTRAVA_PLUGIN_FILE', __FILE__ );
    3233define( 'WPSTRAVA_PLUGIN_DIR', trailingslashit( dirname( __FILE__ ) ) );
Note: See TracChangeset for help on using the changeset viewer.