WP Offload S3 Lite - Version 1.3

Version Description

= 1.1 = This is a major change, which ensures S3 URLs are no longer saved in post content. Instead, local URLs are filtered on page generation and replaced with the S3 version. If you depend on the S3 URLs being stored in post content you will need to make modifications to support this version.

= 0.6 = This version requires PHP 5.3.3+ and the Amazon Web Services plugin

Download this release

Release Info

Developer deliciousbrains
Plugin Icon 128x128 WP Offload S3 Lite
Version 1.3
Comparing to
See all releases

Code changes from version 1.2.1 to 1.3

Files changed (267) hide show
  1. README.md +18 -1
  2. assets/css/notice.css +1 -1
  3. assets/css/styles.css +1 -1
  4. assets/img/as3cf-banner-bw.jpg +0 -0
  5. assets/img/as3cf-banner-bw@2x.jpg +0 -0
  6. assets/img/as3cf-banner.jpg +0 -0
  7. assets/img/as3cf-banner@2x.jpg +0 -0
  8. assets/img/aws-logo.svg +17 -0
  9. assets/img/icon-assets-pull.svg +10 -0
  10. assets/img/icon16.png +0 -0
  11. assets/img/snail-banner.jpg +0 -0
  12. assets/img/snail-banner@2x.jpg +0 -0
  13. assets/js/script.js +145 -14
  14. assets/js/script.min.js +1 -1
  15. assets/sass/notice.scss +5 -1
  16. assets/sass/styles.scss +205 -30
  17. classes/amazon-s3-and-cloudfront.php +366 -136
  18. classes/amazon-web-services.php +167 -0
  19. classes/{wp-aws-compatibility-check.php → as3cf-compatibility-check.php} +175 -19
  20. classes/as3cf-filter.php +14 -0
  21. classes/as3cf-plugin-base.php +605 -0
  22. classes/as3cf-plugin-compatibility.php +86 -1
  23. classes/as3cf-stream-wrapper.php +6 -3
  24. classes/as3cf-utils.php +17 -71
  25. classes/filters/as3cf-local-to-s3.php +51 -14
  26. classes/upgrades/upgrade.php +1 -1
  27. composer.json +2 -2
  28. languages/amazon-s3-and-cloudfront-en.pot +375 -150
  29. readme.txt +18 -1
  30. vendor/Aws2/aws/aws-sdk-php/LICENSE.md +141 -0
  31. vendor/Aws2/aws/aws-sdk-php/NOTICE.md +112 -0
  32. vendor/Aws2/aws/aws-sdk-php/composer.json +51 -0
  33. vendor/Aws2/aws/aws-sdk-php/src/Aws/Common/Aws.php +97 -0
  34. vendor/Aws2/aws/aws-sdk-php/src/Aws/Common/Client/AbstractClient.php +215 -0
  35. vendor/Aws2/aws/aws-sdk-php/src/Aws/Common/Client/AwsClientInterface.php +107 -0
  36. vendor/Aws2/aws/aws-sdk-php/src/Aws/Common/Client/ClientBuilder.php +429 -0
  37. vendor/Aws2/aws/aws-sdk-php/src/Aws/Common/Client/DefaultClient.php +63 -0
  38. vendor/Aws2/aws/aws-sdk-php/src/Aws/Common/Client/ExpiredCredentialsChecker.php +68 -0
  39. vendor/Aws2/aws/aws-sdk-php/src/Aws/Common/Client/ThrottlingErrorChecker.php +60 -0
  40. vendor/Aws2/aws/aws-sdk-php/src/Aws/Common/Client/UploadBodyListener.php +87 -0
  41. vendor/Aws2/aws/aws-sdk-php/src/Aws/Common/Client/UserAgentListener.php +58 -0
  42. vendor/Aws2/aws/aws-sdk-php/src/Aws/Common/Command/AwsQueryVisitor.php +108 -0
  43. vendor/Aws2/aws/aws-sdk-php/src/Aws/Common/Command/JsonCommand.php +43 -0
  44. vendor/Aws2/aws/aws-sdk-php/src/Aws/Common/Command/QueryCommand.php +49 -0
  45. vendor/Aws2/aws/aws-sdk-php/src/Aws/Common/Command/XmlResponseLocationVisitor.php +63 -0
  46. vendor/Aws2/aws/aws-sdk-php/src/Aws/Common/Credentials/AbstractCredentialsDecorator.php +120 -0
  47. vendor/Aws2/aws/aws-sdk-php/src/Aws/Common/Credentials/AbstractRefreshableCredentials.php +80 -0
  48. vendor/Aws2/aws/aws-sdk-php/src/Aws/Common/Credentials/CacheableCredentials.php +69 -0
  49. vendor/Aws2/aws/aws-sdk-php/src/Aws/Common/Credentials/Credentials.php +270 -0
  50. vendor/Aws2/aws/aws-sdk-php/src/Aws/Common/Credentials/CredentialsInterface.php +88 -0
  51. vendor/Aws2/aws/aws-sdk-php/src/Aws/Common/Credentials/NullCredentials.php +59 -0
  52. vendor/Aws2/aws/aws-sdk-php/src/Aws/Common/Credentials/RefreshableInstanceProfileCredentials.php +75 -0
  53. vendor/Aws2/aws/aws-sdk-php/src/Aws/Common/Enum.php +51 -0
  54. vendor/Aws2/aws/aws-sdk-php/src/Aws/Common/Enum/ClientOptions.php +142 -0
  55. vendor/Aws2/aws/aws-sdk-php/src/Aws/Common/Enum/DateFormat.php +30 -0
  56. vendor/Aws2/aws/aws-sdk-php/src/Aws/Common/Enum/Region.php +52 -0
  57. vendor/Aws2/aws/aws-sdk-php/src/Aws/Common/Enum/Size.php +46 -0
  58. vendor/Aws2/aws/aws-sdk-php/src/Aws/Common/Enum/Time.php +39 -0
  59. vendor/Aws2/aws/aws-sdk-php/src/Aws/Common/Enum/UaString.php +49 -0
  60. vendor/Aws2/aws/aws-sdk-php/src/Aws/Common/Exception/AwsExceptionInterface.php +30 -0
  61. vendor/Aws2/aws/aws-sdk-php/src/Aws/Common/Exception/BadMethodCallException.php +24 -0
  62. vendor/Aws2/aws/aws-sdk-php/src/Aws/Common/Exception/DomainException.php +24 -0
  63. vendor/Aws2/aws/aws-sdk-php/src/Aws/Common/Exception/ExceptionFactoryInterface.php +35 -0
  64. vendor/Aws2/aws/aws-sdk-php/src/Aws/Common/Exception/ExceptionListener.php +55 -0
  65. vendor/Aws2/aws/aws-sdk-php/src/Aws/Common/Exception/InstanceProfileCredentialsException.php +47 -0
  66. vendor/Aws2/aws/aws-sdk-php/src/Aws/Common/Exception/InvalidArgumentException.php +24 -0
  67. vendor/Aws2/aws/aws-sdk-php/src/Aws/Common/Exception/LogicException.php +24 -0
  68. vendor/Aws2/aws/aws-sdk-php/src/Aws/Common/Exception/MultipartUploadException.php +47 -0
  69. vendor/Aws2/aws/aws-sdk-php/src/Aws/Common/Exception/NamespaceExceptionFactory.php +89 -0
  70. vendor/Aws2/aws/aws-sdk-php/src/Aws/Common/Exception/OutOfBoundsException.php +24 -0
  71. vendor/Aws2/aws/aws-sdk-php/src/Aws/Common/Exception/OverflowException.php +24 -0
  72. vendor/Aws2/aws/aws-sdk-php/src/Aws/Common/Exception/Parser/AbstractJsonExceptionParser.php +54 -0
  73. vendor/Aws2/aws/aws-sdk-php/src/Aws/Common/Exception/Parser/DefaultXmlExceptionParser.php +93 -0
  74. vendor/Aws2/aws/aws-sdk-php/src/Aws/Common/Exception/Parser/ExceptionParserInterface.php +41 -0
  75. vendor/Aws2/aws/aws-sdk-php/src/Aws/Common/Exception/Parser/JsonQueryExceptionParser.php +39 -0
  76. vendor/Aws2/aws/aws-sdk-php/src/Aws/Common/Exception/Parser/JsonRestExceptionParser.php +44 -0
  77. vendor/Aws2/aws/aws-sdk-php/src/Aws/Common/Exception/RequiredExtensionNotLoadedException.php +24 -0
  78. vendor/Aws2/aws/aws-sdk-php/src/Aws/Common/Exception/RuntimeException.php +24 -0
  79. vendor/Aws2/aws/aws-sdk-php/src/Aws/Common/Exception/ServiceResponseException.php +194 -0
  80. vendor/Aws2/aws/aws-sdk-php/src/Aws/Common/Exception/TransferException.php +25 -0
  81. vendor/Aws2/aws/aws-sdk-php/src/Aws/Common/Exception/UnexpectedValueException.php +24 -0
  82. vendor/Aws2/aws/aws-sdk-php/src/Aws/Common/Facade/Facade.php +65 -0
  83. vendor/Aws2/aws/aws-sdk-php/src/Aws/Common/Facade/FacadeInterface.php +34 -0
  84. vendor/Aws2/aws/aws-sdk-php/src/Aws/Common/Facade/facade-classes.php +249 -0
  85. vendor/Aws2/aws/aws-sdk-php/src/Aws/Common/Hash/ChunkHash.php +77 -0
  86. vendor/Aws2/aws/aws-sdk-php/src/Aws/Common/Hash/ChunkHashInterface.php +49 -0
  87. vendor/Aws2/aws/aws-sdk-php/src/Aws/Common/Hash/HashUtils.php +70 -0
  88. vendor/Aws2/aws/aws-sdk-php/src/Aws/Common/Hash/TreeHash.php +169 -0
  89. vendor/Aws2/aws/aws-sdk-php/src/Aws/Common/HostNameUtils.php +75 -0
  90. vendor/Aws2/aws/aws-sdk-php/src/Aws/Common/InstanceMetadata/InstanceMetadataClient.php +81 -0
  91. vendor/Aws2/aws/aws-sdk-php/src/Aws/Common/InstanceMetadata/Waiter/ServiceAvailable.php +46 -0
  92. vendor/Aws2/aws/aws-sdk-php/src/Aws/Common/Iterator/AwsResourceIterator.php +152 -0
  93. vendor/Aws2/aws/aws-sdk-php/src/Aws/Common/Iterator/AwsResourceIteratorFactory.php +84 -0
  94. vendor/Aws2/aws/aws-sdk-php/src/Aws/Common/Model/MultipartUpload/AbstractTransfer.php +219 -0
  95. vendor/Aws2/aws/aws-sdk-php/src/Aws/Common/Model/MultipartUpload/AbstractTransferState.php +145 -0
  96. vendor/Aws2/aws/aws-sdk-php/src/Aws/Common/Model/MultipartUpload/AbstractUploadBuilder.php +131 -0
  97. vendor/Aws2/aws/aws-sdk-php/src/Aws/Common/Model/MultipartUpload/AbstractUploadId.php +81 -0
  98. vendor/Aws2/aws/aws-sdk-php/src/Aws/Common/Model/MultipartUpload/AbstractUploadPart.php +91 -0
  99. vendor/Aws2/aws/aws-sdk-php/src/Aws/Common/Model/MultipartUpload/TransferInterface.php +61 -0
  100. vendor/Aws2/aws/aws-sdk-php/src/Aws/Common/Model/MultipartUpload/TransferStateInterface.php +84 -0
  101. vendor/Aws2/aws/aws-sdk-php/src/Aws/Common/Model/MultipartUpload/UploadIdInterface.php +38 -0
  102. vendor/Aws2/aws/aws-sdk-php/src/Aws/Common/Model/MultipartUpload/UploadPartInterface.php +44 -0
  103. vendor/Aws2/aws/aws-sdk-php/src/Aws/Common/Resources/aws-config.php +17 -0
  104. vendor/Aws2/aws/aws-sdk-php/src/Aws/Common/Resources/public-endpoints.php +3 -0
  105. vendor/Aws2/aws/aws-sdk-php/src/Aws/Common/Resources/sdk1-config.php +17 -0
  106. vendor/Aws2/aws/aws-sdk-php/src/Aws/Common/RulesEndpointProvider.php +55 -0
  107. vendor/Aws2/aws/aws-sdk-php/src/Aws/Common/Signature/AbstractSignature.php +39 -0
  108. vendor/Aws2/aws/aws-sdk-php/src/Aws/Common/Signature/EndpointSignatureInterface.php +41 -0
  109. vendor/Aws2/aws/aws-sdk-php/src/Aws/Common/Signature/SignatureInterface.php +46 -0
  110. vendor/Aws2/aws/aws-sdk-php/src/Aws/Common/Signature/SignatureListener.php +76 -0
  111. vendor/Aws2/aws/aws-sdk-php/src/Aws/Common/Signature/SignatureV2.php +86 -0
  112. vendor/Aws2/aws/aws-sdk-php/src/Aws/Common/Signature/SignatureV3Https.php +47 -0
  113. vendor/Aws2/aws/aws-sdk-php/src/Aws/Common/Signature/SignatureV4.php +360 -0
  114. vendor/Aws2/aws/aws-sdk-php/src/Aws/Common/Waiter/AbstractResourceWaiter.php +48 -0
  115. vendor/Aws2/aws/aws-sdk-php/src/Aws/Common/Waiter/AbstractWaiter.php +120 -0
  116. vendor/Aws2/aws/aws-sdk-php/src/Aws/Common/Waiter/CallableWaiter.php +73 -0
  117. vendor/Aws2/aws/aws-sdk-php/src/Aws/Common/Waiter/CompositeWaiterFactory.php +81 -0
  118. vendor/Aws2/aws/aws-sdk-php/src/Aws/Common/Waiter/ConfigResourceWaiter.php +185 -0
  119. vendor/Aws2/aws/aws-sdk-php/src/Aws/Common/Waiter/ResourceWaiterInterface.php +33 -0
  120. vendor/Aws2/aws/aws-sdk-php/src/Aws/Common/Waiter/WaiterClassFactory.php +95 -0
  121. vendor/Aws2/aws/aws-sdk-php/src/Aws/Common/Waiter/WaiterConfig.php +64 -0
  122. vendor/Aws2/aws/aws-sdk-php/src/Aws/Common/Waiter/WaiterConfigFactory.php +86 -0
  123. vendor/Aws2/aws/aws-sdk-php/src/Aws/Common/Waiter/WaiterFactoryInterface.php +40 -0
  124. vendor/Aws2/aws/aws-sdk-php/src/Aws/Common/Waiter/WaiterInterface.php +56 -0
  125. vendor/Aws2/aws/aws-sdk-php/src/Aws/S3/AcpListener.php +68 -0
  126. vendor/Aws2/aws/aws-sdk-php/src/Aws/S3/BucketStyleListener.php +73 -0
  127. vendor/Aws2/aws/aws-sdk-php/src/Aws/S3/Command/S3Command.php +57 -0
  128. vendor/Aws2/aws/aws-sdk-php/src/Aws/S3/Enum/CannedAcl.php +31 -0
  129. vendor/Aws2/aws/aws-sdk-php/src/Aws/S3/Enum/EncodingType.php +26 -0
  130. vendor/Aws2/aws/aws-sdk-php/src/Aws/S3/Enum/Event.php +26 -0
  131. vendor/Aws2/aws/aws-sdk-php/src/Aws/S3/Enum/GranteeType.php +28 -0
  132. vendor/Aws2/aws/aws-sdk-php/src/Aws/S3/Enum/Group.php +28 -0
  133. vendor/Aws2/aws/aws-sdk-php/src/Aws/S3/Enum/MFADelete.php +27 -0
  134. vendor/Aws2/aws/aws-sdk-php/src/Aws/S3/Enum/MetadataDirective.php +27 -0
  135. vendor/Aws2/aws/aws-sdk-php/src/Aws/S3/Enum/Payer.php +27 -0
  136. vendor/Aws2/aws/aws-sdk-php/src/Aws/S3/Enum/Permission.php +30 -0
  137. vendor/Aws2/aws/aws-sdk-php/src/Aws/S3/Enum/Protocol.php +27 -0
  138. vendor/Aws2/aws/aws-sdk-php/src/Aws/S3/Enum/ServerSideEncryption.php +26 -0
  139. vendor/Aws2/aws/aws-sdk-php/src/Aws/S3/Enum/Status.php +27 -0
  140. vendor/Aws2/aws/aws-sdk-php/src/Aws/S3/Enum/Storage.php +28 -0
  141. vendor/Aws2/aws/aws-sdk-php/src/Aws/S3/Enum/StorageClass.php +27 -0
  142. vendor/Aws2/aws/aws-sdk-php/src/Aws/S3/Exception/AccessDeniedException.php +24 -0
  143. vendor/Aws2/aws/aws-sdk-php/src/Aws/S3/Exception/AccountProblemException.php +24 -0
  144. vendor/Aws2/aws/aws-sdk-php/src/Aws/S3/Exception/AmbiguousGrantByEmailAddressException.php +24 -0
  145. vendor/Aws2/aws/aws-sdk-php/src/Aws/S3/Exception/BadDigestException.php +24 -0
  146. vendor/Aws2/aws/aws-sdk-php/src/Aws/S3/Exception/BucketAlreadyExistsException.php +24 -0
  147. vendor/Aws2/aws/aws-sdk-php/src/Aws/S3/Exception/BucketAlreadyOwnedByYouException.php +24 -0
  148. vendor/Aws2/aws/aws-sdk-php/src/Aws/S3/Exception/BucketNotEmptyException.php +24 -0
  149. vendor/Aws2/aws/aws-sdk-php/src/Aws/S3/Exception/CredentialsNotSupportedException.php +24 -0
  150. vendor/Aws2/aws/aws-sdk-php/src/Aws/S3/Exception/CrossLocationLoggingProhibitedException.php +24 -0
  151. vendor/Aws2/aws/aws-sdk-php/src/Aws/S3/Exception/DeleteMultipleObjectsException.php +46 -0
  152. vendor/Aws2/aws/aws-sdk-php/src/Aws/S3/Exception/EntityTooLargeException.php +24 -0
  153. vendor/Aws2/aws/aws-sdk-php/src/Aws/S3/Exception/EntityTooSmallException.php +24 -0
  154. vendor/Aws2/aws/aws-sdk-php/src/Aws/S3/Exception/ExpiredTokenException.php +24 -0
  155. vendor/Aws2/aws/aws-sdk-php/src/Aws/S3/Exception/IllegalVersioningConfigurationException.php +24 -0
  156. vendor/Aws2/aws/aws-sdk-php/src/Aws/S3/Exception/IncompleteBodyException.php +24 -0
  157. vendor/Aws2/aws/aws-sdk-php/src/Aws/S3/Exception/IncorrectNumberOfFilesInPostRequestException.php +24 -0
  158. vendor/Aws2/aws/aws-sdk-php/src/Aws/S3/Exception/InlineDataTooLargeException.php +24 -0
  159. vendor/Aws2/aws/aws-sdk-php/src/Aws/S3/Exception/InternalErrorException.php +24 -0
  160. vendor/Aws2/aws/aws-sdk-php/src/Aws/S3/Exception/InvalidAccessKeyIdException.php +24 -0
  161. vendor/Aws2/aws/aws-sdk-php/src/Aws/S3/Exception/InvalidAddressingHeaderException.php +24 -0
  162. vendor/Aws2/aws/aws-sdk-php/src/Aws/S3/Exception/InvalidArgumentException.php +24 -0
  163. vendor/Aws2/aws/aws-sdk-php/src/Aws/S3/Exception/InvalidBucketNameException.php +24 -0
  164. vendor/Aws2/aws/aws-sdk-php/src/Aws/S3/Exception/InvalidBucketStateException.php +24 -0
  165. vendor/Aws2/aws/aws-sdk-php/src/Aws/S3/Exception/InvalidDigestException.php +24 -0
  166. vendor/Aws2/aws/aws-sdk-php/src/Aws/S3/Exception/InvalidLocationConstraintException.php +24 -0
  167. vendor/Aws2/aws/aws-sdk-php/src/Aws/S3/Exception/InvalidPartException.php +24 -0
  168. vendor/Aws2/aws/aws-sdk-php/src/Aws/S3/Exception/InvalidPartOrderException.php +24 -0
  169. vendor/Aws2/aws/aws-sdk-php/src/Aws/S3/Exception/InvalidPayerException.php +24 -0
  170. vendor/Aws2/aws/aws-sdk-php/src/Aws/S3/Exception/InvalidPolicyDocumentException.php +24 -0
  171. vendor/Aws2/aws/aws-sdk-php/src/Aws/S3/Exception/InvalidRangeException.php +24 -0
  172. vendor/Aws2/aws/aws-sdk-php/src/Aws/S3/Exception/InvalidRequestException.php +24 -0
  173. vendor/Aws2/aws/aws-sdk-php/src/Aws/S3/Exception/InvalidSOAPRequestException.php +24 -0
  174. vendor/Aws2/aws/aws-sdk-php/src/Aws/S3/Exception/InvalidSecurityException.php +24 -0
  175. vendor/Aws2/aws/aws-sdk-php/src/Aws/S3/Exception/InvalidStorageClassException.php +24 -0
  176. vendor/Aws2/aws/aws-sdk-php/src/Aws/S3/Exception/InvalidTagErrorException.php +25 -0
  177. vendor/Aws2/aws/aws-sdk-php/src/Aws/S3/Exception/InvalidTargetBucketForLoggingException.php +24 -0
  178. vendor/Aws2/aws/aws-sdk-php/src/Aws/S3/Exception/InvalidTokenException.php +24 -0
  179. vendor/Aws2/aws/aws-sdk-php/src/Aws/S3/Exception/InvalidURIException.php +24 -0
  180. vendor/Aws2/aws/aws-sdk-php/src/Aws/S3/Exception/KeyTooLongException.php +24 -0
  181. vendor/Aws2/aws/aws-sdk-php/src/Aws/S3/Exception/MalformedACLErrorException.php +24 -0
  182. vendor/Aws2/aws/aws-sdk-php/src/Aws/S3/Exception/MalformedPOSTRequestException.php +24 -0
  183. vendor/Aws2/aws/aws-sdk-php/src/Aws/S3/Exception/MalformedXMLException.php +24 -0
  184. vendor/Aws2/aws/aws-sdk-php/src/Aws/S3/Exception/MaxMessageLengthExceededException.php +24 -0
  185. vendor/Aws2/aws/aws-sdk-php/src/Aws/S3/Exception/MaxPostPreDataLengthExceededErrorException.php +24 -0
  186. vendor/Aws2/aws/aws-sdk-php/src/Aws/S3/Exception/MetadataTooLargeException.php +24 -0
  187. vendor/Aws2/aws/aws-sdk-php/src/Aws/S3/Exception/MethodNotAllowedException.php +24 -0
  188. vendor/Aws2/aws/aws-sdk-php/src/Aws/S3/Exception/MissingAttachmentException.php +24 -0
  189. vendor/Aws2/aws/aws-sdk-php/src/Aws/S3/Exception/MissingContentLengthException.php +24 -0
  190. vendor/Aws2/aws/aws-sdk-php/src/Aws/S3/Exception/MissingRequestBodyErrorException.php +24 -0
  191. vendor/Aws2/aws/aws-sdk-php/src/Aws/S3/Exception/MissingSecurityElementException.php +24 -0
  192. vendor/Aws2/aws/aws-sdk-php/src/Aws/S3/Exception/MissingSecurityHeaderException.php +24 -0
  193. vendor/Aws2/aws/aws-sdk-php/src/Aws/S3/Exception/NoLoggingStatusForKeyException.php +24 -0
  194. vendor/Aws2/aws/aws-sdk-php/src/Aws/S3/Exception/NoSuchBucketException.php +24 -0
  195. vendor/Aws2/aws/aws-sdk-php/src/Aws/S3/Exception/NoSuchBucketPolicyException.php +24 -0
  196. vendor/Aws2/aws/aws-sdk-php/src/Aws/S3/Exception/NoSuchCORSConfigurationException.php +24 -0
  197. vendor/Aws2/aws/aws-sdk-php/src/Aws/S3/Exception/NoSuchKeyException.php +24 -0
  198. vendor/Aws2/aws/aws-sdk-php/src/Aws/S3/Exception/NoSuchLifecycleConfigurationException.php +24 -0
  199. vendor/Aws2/aws/aws-sdk-php/src/Aws/S3/Exception/NoSuchTagSetException.php +24 -0
  200. vendor/Aws2/aws/aws-sdk-php/src/Aws/S3/Exception/NoSuchUploadException.php +24 -0
  201. vendor/Aws2/aws/aws-sdk-php/src/Aws/S3/Exception/NoSuchVersionException.php +24 -0
  202. vendor/Aws2/aws/aws-sdk-php/src/Aws/S3/Exception/NoSuchWebsiteConfigurationException.php +24 -0
  203. vendor/Aws2/aws/aws-sdk-php/src/Aws/S3/Exception/NotImplementedException.php +24 -0
  204. vendor/Aws2/aws/aws-sdk-php/src/Aws/S3/Exception/NotSignedUpException.php +24 -0
  205. vendor/Aws2/aws/aws-sdk-php/src/Aws/S3/Exception/NotSuchBucketPolicyException.php +24 -0
  206. vendor/Aws2/aws/aws-sdk-php/src/Aws/S3/Exception/ObjectAlreadyInActiveTierErrorException.php +24 -0
  207. vendor/Aws2/aws/aws-sdk-php/src/Aws/S3/Exception/ObjectNotInActiveTierErrorException.php +24 -0
  208. vendor/Aws2/aws/aws-sdk-php/src/Aws/S3/Exception/OperationAbortedException.php +24 -0
  209. vendor/Aws2/aws/aws-sdk-php/src/Aws/S3/Exception/Parser/S3ExceptionParser.php +65 -0
  210. vendor/Aws2/aws/aws-sdk-php/src/Aws/S3/Exception/PermanentRedirectException.php +24 -0
  211. vendor/Aws2/aws/aws-sdk-php/src/Aws/S3/Exception/PreconditionFailedException.php +24 -0
  212. vendor/Aws2/aws/aws-sdk-php/src/Aws/S3/Exception/RedirectException.php +24 -0
  213. vendor/Aws2/aws/aws-sdk-php/src/Aws/S3/Exception/RequestIsNotMultiPartContentException.php +24 -0
  214. vendor/Aws2/aws/aws-sdk-php/src/Aws/S3/Exception/RequestTimeTooSkewedException.php +24 -0
  215. vendor/Aws2/aws/aws-sdk-php/src/Aws/S3/Exception/RequestTimeoutException.php +24 -0
  216. vendor/Aws2/aws/aws-sdk-php/src/Aws/S3/Exception/RequestTorrentOfBucketErrorException.php +24 -0
  217. vendor/Aws2/aws/aws-sdk-php/src/Aws/S3/Exception/S3Exception.php +25 -0
  218. vendor/Aws2/aws/aws-sdk-php/src/Aws/S3/Exception/ServiceUnavailableException.php +24 -0
  219. vendor/Aws2/aws/aws-sdk-php/src/Aws/S3/Exception/SignatureDoesNotMatchException.php +24 -0
  220. vendor/Aws2/aws/aws-sdk-php/src/Aws/S3/Exception/SlowDownException.php +24 -0
  221. vendor/Aws2/aws/aws-sdk-php/src/Aws/S3/Exception/TemporaryRedirectException.php +24 -0
  222. vendor/Aws2/aws/aws-sdk-php/src/Aws/S3/Exception/TokenRefreshRequiredException.php +24 -0
  223. vendor/Aws2/aws/aws-sdk-php/src/Aws/S3/Exception/TooManyBucketsException.php +24 -0
  224. vendor/Aws2/aws/aws-sdk-php/src/Aws/S3/Exception/UnexpectedContentException.php +24 -0
  225. vendor/Aws2/aws/aws-sdk-php/src/Aws/S3/Exception/UnresolvableGrantByEmailAddressException.php +24 -0
  226. vendor/Aws2/aws/aws-sdk-php/src/Aws/S3/Exception/UserKeyMustBeSpecifiedException.php +24 -0
  227. vendor/Aws2/aws/aws-sdk-php/src/Aws/S3/IncompleteMultipartUploadChecker.php +44 -0
  228. vendor/Aws2/aws/aws-sdk-php/src/Aws/S3/Iterator/ListBucketsIterator.php +45 -0
  229. vendor/Aws2/aws/aws-sdk-php/src/Aws/S3/Iterator/ListMultipartUploadsIterator.php +43 -0
  230. vendor/Aws2/aws/aws-sdk-php/src/Aws/S3/Iterator/ListObjectVersionsIterator.php +45 -0
  231. vendor/Aws2/aws/aws-sdk-php/src/Aws/S3/Iterator/ListObjectsIterator.php +62 -0
  232. vendor/Aws2/aws/aws-sdk-php/src/Aws/S3/Iterator/OpendirIterator.php +75 -0
  233. vendor/Aws2/aws/aws-sdk-php/src/Aws/S3/Model/Acp.php +208 -0
  234. vendor/Aws2/aws/aws-sdk-php/src/Aws/S3/Model/AcpBuilder.php +120 -0
  235. vendor/Aws2/aws/aws-sdk-php/src/Aws/S3/Model/ClearBucket.php +161 -0
  236. vendor/Aws2/aws/aws-sdk-php/src/Aws/S3/Model/DeleteObjectsBatch.php +72 -0
  237. vendor/Aws2/aws/aws-sdk-php/src/Aws/S3/Model/DeleteObjectsTransfer.php +112 -0
  238. vendor/Aws2/aws/aws-sdk-php/src/Aws/S3/Model/Grant.php +114 -0
  239. vendor/Aws2/aws/aws-sdk-php/src/Aws/S3/Model/Grantee.php +211 -0
  240. vendor/Aws2/aws/aws-sdk-php/src/Aws/S3/Model/MultipartUpload/AbstractTransfer.php +83 -0
  241. vendor/Aws2/aws/aws-sdk-php/src/Aws/S3/Model/MultipartUpload/ParallelTransfer.php +100 -0
  242. vendor/Aws2/aws/aws-sdk-php/src/Aws/S3/Model/MultipartUpload/SerialTransfer.php +65 -0
  243. vendor/Aws2/aws/aws-sdk-php/src/Aws/S3/Model/MultipartUpload/TransferState.php +38 -0
  244. vendor/Aws2/aws/aws-sdk-php/src/Aws/S3/Model/MultipartUpload/UploadBuilder.php +243 -0
  245. vendor/Aws2/aws/aws-sdk-php/src/Aws/S3/Model/MultipartUpload/UploadId.php +30 -0
  246. vendor/Aws2/aws/aws-sdk-php/src/Aws/S3/Model/MultipartUpload/UploadPart.php +62 -0
  247. vendor/Aws2/aws/aws-sdk-php/src/Aws/S3/Model/PostObject.php +229 -0
  248. vendor/Aws2/aws/aws-sdk-php/src/Aws/S3/Resources/s3-2006-03-01.php +17 -0
  249. vendor/Aws2/aws/aws-sdk-php/src/Aws/S3/ResumableDownload.php +150 -0
  250. vendor/Aws2/aws/aws-sdk-php/src/Aws/S3/S3Client.php +524 -0
  251. vendor/Aws2/aws/aws-sdk-php/src/Aws/S3/S3Md5Listener.php +65 -0
  252. vendor/Aws2/aws/aws-sdk-php/src/Aws/S3/S3Signature.php +191 -0
  253. vendor/Aws2/aws/aws-sdk-php/src/Aws/S3/S3SignatureInterface.php +25 -0
  254. vendor/Aws2/aws/aws-sdk-php/src/Aws/S3/S3SignatureV4.php +53 -0
  255. vendor/Aws2/aws/aws-sdk-php/src/Aws/S3/SocketTimeoutChecker.php +60 -0
  256. vendor/Aws2/aws/aws-sdk-php/src/Aws/S3/SseCpkListener.php +54 -0
  257. vendor/Aws2/aws/aws-sdk-php/src/Aws/S3/StreamWrapper.php +757 -0
  258. vendor/Aws2/aws/aws-sdk-php/src/Aws/S3/Sync/AbstractSync.php +114 -0
  259. vendor/Aws2/aws/aws-sdk-php/src/Aws/S3/Sync/AbstractSyncBuilder.php +359 -0
  260. vendor/Aws2/aws/aws-sdk-php/src/Aws/S3/Sync/ChangedFilesIterator.php +105 -0
  261. vendor/Aws2/aws/aws-sdk-php/src/Aws/S3/Sync/DownloadSync.php +83 -0
  262. vendor/Aws2/aws/aws-sdk-php/src/Aws/S3/Sync/DownloadSyncBuilder.php +97 -0
  263. vendor/Aws2/aws/aws-sdk-php/src/Aws/S3/Sync/FilenameConverterInterface.php +32 -0
  264. vendor/Aws2/aws/aws-sdk-php/src/Aws/S3/Sync/KeyConverter.php +55 -0
  265. vendor/Aws2/aws/aws-sdk-php/src/Aws/S3/Sync/UploadSync.php +61 -0
  266. vendor/Aws2/aws/aws-sdk-php/src/Aws/S3/Sync/UploadSyncBuilder.php +147 -0
  267. vendor/Aws2/guzzle/guzzle/CHANGELOG.md +729 -0
README.md CHANGED
@@ -3,7 +3,7 @@
3
  **Tags:** uploads, amazon, s3, amazon s3, mirror, admin, media, cdn, cloudfront
4
  **Requires at least:** 4.6
5
  **Tested up to:** 4.9
6
- **Stable tag:** 1.2.1
7
  **License:** GPLv3
8
 
9
  Copies files to Amazon S3 as they are uploaded to the Media Library. Optionally configure Amazon CloudFront for faster delivery.
@@ -69,6 +69,23 @@ This version requires PHP 5.3.3+ and the Amazon Web Services plugin
69
 
70
  ## Changelog ##
71
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
72
  ### WP Offload S3 Lite 1.2.1 - 2017-11-20 ###
73
  * New: Compatibility with HTML Widget
74
  * New: Dismissible admin notice that WP Offload S3 Lite will soon require PHP 5.5+
3
  **Tags:** uploads, amazon, s3, amazon s3, mirror, admin, media, cdn, cloudfront
4
  **Requires at least:** 4.6
5
  **Tested up to:** 4.9
6
+ **Stable tag:** 1.3
7
  **License:** GPLv3
8
 
9
  Copies files to Amazon S3 as they are uploaded to the Media Library. Optionally configure Amazon CloudFront for faster delivery.
69
 
70
  ## Changelog ##
71
 
72
+ ### WP Offload S3 Lite 1.3 - 2018-02-20 ###
73
+ * [Release Summary Blog Post](https://deliciousbrains.com/wp-offload-s3-1-6-released/?utm_campaign=changelogs&utm_source=wordpress.org&utm_medium=free%2Bplugin%2Blisting)
74
+ * New: [Amazon Web Services plugin](https://wordpress.org/plugins/amazon-web-services/) is no longer required to run WP Offload S3 Lite
75
+ * New: Added [`as3cf_local_domains`](https://deliciousbrains.com/wp-offload-s3/doc/filtering-urls-for-multiple-domains/?utm_campaign=changelogs&utm_source=wordpress.org&utm_medium=free%2Bplugin%2Blisting) filter for when site content is updated through multiple domains
76
+ * Improvement: AWS keys can be set in new "Settings" tab if not defined in wp-config.php
77
+ * Improvement: Minor tweaks to settings page UI including right aligning tabs and consistent title across Lite and Pro plugins
78
+ * Improvement: cURL version, theme version and parent theme information added to diagnostics
79
+ * Bug fix: Incompatible with plugins that include AWS PHP SDK v3
80
+ * Bug fix: Regenerate Thumbnails v3.0+ does not work with Remove Files From Server option
81
+ * Bug fix: "Warning: count(): Parameter must be an array or an object that implements Countable" error with PHP 7.2
82
+ * Bug fix: Force HTTPS not being applied to non-srcset S3 URLs in pages served over HTTP
83
+ * Bug fix: Content URLs not filtered to S3 URLs if AWS keys not set
84
+ * Bug fix: URL preview can be coerced to display invalid URL
85
+ * Bug fix: Changes to upload made via `as3cf_object_meta` filter are not reflected in amazonS3_info records
86
+ * Bug fix: Settings link not showing in network admin plugins page
87
+ * Bug fix: License in composer.json fails Packagist validation
88
+
89
  ### WP Offload S3 Lite 1.2.1 - 2017-11-20 ###
90
  * New: Compatibility with HTML Widget
91
  * New: Dismissible admin notice that WP Offload S3 Lite will soon require PHP 5.5+
assets/css/notice.css CHANGED
@@ -1 +1 @@
1
- .as3cf-notice p,.aws-compatibility-notice p{max-width:800px}.as3cf-license-notice p:not(.as3cf-before):before{display:none}
1
+ .as3cf-notice p,.as3cf-compatibility-notice p{max-width:800px}.as3cf-license-notice p:not(.as3cf-before):before{display:none}.as3cf-notice-warning{border-left-color:#ffba00}
assets/css/styles.css CHANGED
@@ -1 +1 @@
1
- .aws-main.wrap{position:relative}.aws-main.wrap>h1{float:left}.aws-main.wrap .as3cf-notice,.aws-main.wrap .as3cf-updated,.aws-main.wrap .as3cf-error{-webkit-box-sizing:border-box;box-sizing:border-box}.aws-main.wrap .as3cf-error.fatal{clear:both}.aws-main.wrap h2.nav-tab-wrapper{float:none;margin-bottom:15px;width:650px;margin-top:10px;padding:9px 0 0 5px}.aws-main.wrap h2.nav-tab-wrapper a.nav-tab-active{color:#464646;cursor:default}.aws-main.wrap h2.nav-tab-wrapper a:focus{-webkit-box-shadow:none;box-shadow:none}.aws-main.wrap .more-info{white-space:nowrap}.aws-main.wrap .error pre{background:#eaeaea;background:rgba(0,0,0,0.07);display:block;padding:10px 15px}.aws-main.wrap .error pre code{padding:0;background:none}.aws-main.wrap[data-tab="support"] .as3cf-notice,.aws-main.wrap[data-tab="support"] .error,.aws-main.wrap[data-tab="support"] .updated,.aws-main.wrap[data-tab="support"] .updated.show{display:none}.aws-main.wrap[data-tab="support"] .fatal .error,.aws-main.wrap[data-tab="support"] .as3cf-notice.important,.aws-main.wrap[data-tab="support"] .dbrains-api-down{display:block}.aws-main.wrap .as3cf-notice,.aws-main.wrap .error,.aws-main.wrap .updated{max-width:650px;margin-top:15px;-webkit-box-sizing:border-box;box-sizing:border-box}.aws-main.wrap .as3cf-updated{display:none}.aws-main.wrap .as3cf-updated.as3cf-notice,.aws-main.wrap .as3cf-updated.show{display:block}.as3cf-tab .as3cf-main-settings{display:none}.as3cf-tab .as3cf-bucket-container{display:block}.as3cf-tab.as3cf-has-bucket .as3cf-main-settings{display:block}.as3cf-tab.as3cf-has-bucket .as3cf-bucket-container{display:none}.as3cf-tab{display:none;position:relative;width:650px}.as3cf-tab .as3cf-main-settings p{font-size:13px}.as3cf-tab .as3cf-main-settings p a{color:#444}.as3cf-tab .object-prefix-desc em{white-space:nowrap}.as3cf-tab .as3cf-url-preview-wrap{background:#fff;text-align:center;padding:20px 0 0;max-width:650px;width:100%;-webkit-box-sizing:border-box;box-sizing:border-box}.as3cf-tab .as3cf-url-preview-wrap .as3cf-url-preview{margin-top:10px;padding:0 20px 10px;overflow-x:scroll}.as3cf-tab .as3cf-url-preview-wrap span{color:#aaa;text-transform:uppercase;font-weight:bold}.as3cf-tab .as3cf-radio-group label{display:block;margin-bottom:10px}.as3cf-tab .as3cf-radio-group label.disabled,.as3cf-tab .as3cf-radio-group label.disabled p{color:#bbb;cursor:default}.as3cf-tab .as3cf-radio-group p{padding-left:25px;color:#6b6b6b;margin:0;font-size:12px}.as3cf-tab .as3cf-radio-group p.as3cf-setting{margin-top:5px}.as3cf-tab .as3cf-switch{position:relative;display:inline-block;padding:2px;overflow:hidden;border-radius:2px;-webkit-border-radius:2px;background-color:#d4d3d3;cursor:pointer}.as3cf-tab .as3cf-switch.on{background-color:#ade7b5}.as3cf-tab .as3cf-switch span{visibility:hidden;-webkit-box-sizing:border-box;box-sizing:border-box;float:left;display:inline-block;height:100%;font-size:12px;line-height:20px;border-radius:2px;-webkit-border-radius:2px;font-weight:bold;padding:4px 8px;background:#fff;color:#8d8d8d;z-index:1}.as3cf-tab .as3cf-switch span.on{color:#82d78b}.as3cf-tab .as3cf-switch span.checked{visibility:visible}.as3cf-tab .as3cf-switch.disabled{cursor:default;background:#e6e6e6}.as3cf-tab .as3cf-switch.disabled span{background:#f1f1f1;color:#d6d6d6}.as3cf-tab .as3cf-switch input[type="checkbox"]{position:absolute !important;top:0;left:0;opacity:0;filter:alpha(opacity=0);z-index:-1}.as3cf-tab .as3cf-setting.hide{display:none}.as3cf-tab div.as3cf-setting{margin-top:4px}.as3cf-tab h3{font-weight:normal;text-transform:uppercase;margin:15px 0}.as3cf-tab .form-table{margin:0}.as3cf-tab .form-table tr.as3cf-border-bottom td{border-bottom:1px solid #ddd;padding:20px 0px}.as3cf-tab .form-table tr.as3cf-setting-title td{padding-bottom:0}.as3cf-tab .form-table tr.as3cf-setting-title:first-child td{padding-top:20px}.as3cf-tab .form-table tr td{padding:15px 0}.as3cf-tab .form-table tr td:first-child{vertical-align:top;min-width:120px}.as3cf-tab .form-table tr td .as3cf-notice:last-child{margin-bottom:0}.as3cf-tab .form-table tr td>p:first-child{margin-top:0}.as3cf-tab .form-table tr:first-of-type td{padding-top:5px}.as3cf-tab .form-table tr.as3cf-bucket-setting .as3cf-defined-in-config{float:none}.as3cf-tab .form-table h3{padding:0;margin:0}.as3cf-tab .form-table h4{margin:0}.as3cf-tab .as3cf-active-bucket{font-weight:bold;margin-right:10px}.as3cf-tab .as3cf-view-bucket{color:#444;text-decoration:none;margin-right:10px}.as3cf-tab .as3cf-view-bucket:hover,.as3cf-tab .as3cf-view-bucket:active{color:#00a0d2}.as3cf-tab .as3cf-view-bucket:focus{-webkit-box-shadow:none;box-shadow:none}.as3cf-tab .as3cf-view-bucket .dashicons-external{margin-top:-2px}.as3cf-tab .tooltip{position:relative;z-index:2;cursor:pointer}.as3cf-tab .tooltip:before,.as3cf-tab .tooltip:after{visibility:hidden;-ms-filter:"progid:DXImageTransform.Microsoft.Alpha(Opacity=0)";filter:progid:DXImageTransform.Microsoft.Alpha(Opacity=0);opacity:0;pointer-events:none}.as3cf-tab .tooltip:before{position:absolute;bottom:150%;left:50%;margin-bottom:5px;margin-left:-250px;padding:10px;width:500px;border-radius:3px;background-color:#000;background-color:rgba(51,51,51,0.9);color:#fff;content:attr(data-tooltip);text-align:center;font-size:14px;line-height:1.3}.as3cf-tab .tooltip:after{position:absolute;bottom:150%;left:50%;margin-left:-5px;width:0;border-top:5px solid #000;border-top:5px solid rgba(51,51,51,0.9);border-right:5px solid transparent;border-left:5px solid transparent;content:" ";font-size:0;line-height:0}.as3cf-tab .tooltip:hover:before,.as3cf-tab .tooltip:hover:after{visibility:visible;-ms-filter:"progid:DXImageTransform.Microsoft.Alpha(Opacity=100)";filter:progid:DXImageTransform.Microsoft.Alpha(Opacity=100);opacity:1}.as3cf-tab .as3cf-defined-in-config{background:#ccc;color:#fff;padding:2px 5px;margin:0 0 5px 5px;float:right}.as3cf-tab .as3cf-defined-setting{color:#bbb}.as3cf-tab .as3cf-defined-setting label{cursor:default}.as3cf-tab .as3cf-defined-setting p .more-info a{color:#bbb}.as3cf-tab .as3cf-defined-setting .as3cf-radio-group p{color:#bbb}.as3cf-tab .as3cf-defined-setting .as3cf-notice{display:none !important}#tab-media{display:block}#tab-media .as3cf-main-settings{display:none}#tab-media .as3cf-bucket-container{display:block}#tab-media.as3cf-has-bucket .as3cf-main-settings{display:block}#tab-media.as3cf-has-bucket .as3cf-bucket-container{display:none}.as3cf-bucket-container h3{line-height:1.3;text-transform:none}.as3cf-bucket-container a:focus{-webkit-box-shadow:none;box-shadow:none;outline:none}.as3cf-bucket-container input[type=text]{-webkit-box-sizing:border-box;box-sizing:border-box;width:100%}.as3cf-bucket-container select{-webkit-box-sizing:border-box;box-sizing:border-box;width:50%}.as3cf-bucket-container .form-table td{padding:5px 0}.as3cf-bucket-container .form-table td:first-child{width:100px;line-height:30px;vertical-align:top}.as3cf-bucket-container .bucket-actions{margin:15px 0;border-top:1px solid #ccc;padding-top:15px;overflow:hidden}.as3cf-bucket-container .bucket-actions button,.as3cf-bucket-container .bucket-actions .right{float:right;margin-right:0}.as3cf-bucket-container .bucket-actions span{display:inline-block;margin-right:20px;line-height:28px}.as3cf-bucket-container .bucket-actions .bucket-action-cancel{color:#a00;text-decoration:none}.as3cf-bucket-container .bucket-actions .bucket-action-cancel:hover{color:red}.as3cf-bucket-container .as3cf-bucket-list{padding:15px;max-height:200px;overflow-x:hidden;overflow-y:auto;background-color:#fff;font-size:14px}.as3cf-bucket-container .as3cf-bucket-list li:last-of-type{margin-bottom:0}.as3cf-bucket-container .as3cf-bucket-list a{color:#444;text-decoration:none}.as3cf-bucket-container .as3cf-bucket-list a:hover{color:#0074a2}.as3cf-bucket-container .as3cf-bucket-list a.selected{font-weight:bold;color:#0074a2}.as3cf-bucket-container .as3cf-bucket-list a .dashicons{margin-right:5px}.as3cf-bucket-container .as3cf-bucket-select,.as3cf-bucket-container .as3cf-bucket-create{display:none}.as3cf-bucket-container .bucket-actions.select{display:none}.as3cf-tab{display:none}#tab-media{display:block}#tab-support{min-height:900px}#tab-support .as3cf-sidebar{top:11px}#tab-support .support-section{border-bottom:1px solid #ccc;padding-bottom:20px;margin-bottom:20px}#tab-support .debug textarea{width:100%;min-height:200px;font-family:Consolas, Monaco, monospace;margin-bottom:5px}.as3cf-sidebar{position:absolute;top:9px;left:670px;width:292px}.as3cf-sidebar .block{padding:20px;border:1px solid #ccc}.as3cf-sidebar .subscribe{border-top:none}.as3cf-sidebar .subscribe h2{padding:0;margin:0;margin-bottom:0.5em;color:#666;font-size:20px;line-height:1.2em;float:none}.as3cf-sidebar .subscribe h3{font-size:16px;margin:0}.as3cf-sidebar .subscribe p{margin:0}.as3cf-sidebar .subscribe .intro{margin-bottom:1em;line-height:1.4}.as3cf-sidebar .subscribe li{line-height:1.4}.as3cf-sidebar .subscribe .links{margin-bottom:2em}.as3cf-sidebar .subscribe .links a{text-decoration:none}.as3cf-sidebar .subscribe .promise{color:#999;font-size:12px;line-height:1.4em}.as3cf-sidebar .subscribe .field{margin-bottom:0.5em}.as3cf-sidebar .subscribe .field p{margin-bottom:0.3em}.as3cf-sidebar .subscribe .field input[type=text],.as3cf-sidebar .subscribe .field input[type=email]{width:100%}.as3cf-sidebar .subscribe .field.submit-button{margin-bottom:1em}.as3cf-sidebar .credits{border-top:0}.as3cf-sidebar .credits h4{font-size:16px;margin-top:0;margin-bottom:10px}.as3cf-sidebar .credits ul{margin:0}.as3cf-sidebar .credits li{overflow:hidden}.as3cf-sidebar .credits li:last-child{margin-bottom:0}.as3cf-sidebar .credits img{float:left;margin-right:10px}.as3cf-sidebar .credits span{float:left;display:block;line-height:32px}.as3cf-sidebar .credits a{display:block;text-decoration:none;color:#444;font-size:16px;text-align:center}.as3cf-sidebar .credits a:hover{color:#888}@media screen and (max-width: 1052px){.as3cf-sidebar{position:relative;top:auto;right:auto}}.as3cf-banner{margin-top:35px;width:292px;height:200px;display:block;background:#f8cfae url(../img/os3-banner.svg) left bottom/220px 220px no-repeat}.as3cf-banner:focus{-webkit-box-shadow:none;box-shadow:none}.wrap .as3cf-upgrade-details{background-color:#4e0d33;padding:10px 20px 20px 20px;color:#eee;font-size:13px;margin:0;display:block;text-decoration:none}.wrap .as3cf-upgrade-details h1{font-size:28px;color:#eee;margin:0 0 15px 0;padding:0;text-decoration:none;font-weight:200;line-height:1}.wrap .as3cf-upgrade-details p{margin:0}.wrap .as3cf-upgrade-details a{color:#eee;font-weight:bold;text-decoration:none;font-size:16px;-webkit-box-shadow:none;box-shadow:none}.wrap .as3cf-upgrade-details a:hover{color:#fff}.wrap .as3cf-upgrade-details ul{margin-top:0;margin-left:16px;list-style-type:disc}.aws-compatibility-notice.error{clear:both;margin:5px 20px 5px 0}.as3cf-bucket-error span.title{font-weight:bold}.as3cf-invalid-bucket-name,.as3cf-validation-error{display:block;margin-top:2px;font-size:12px;color:#a00}.as3cf-notice-toggle-content{max-height:100px;overflow-y:scroll}.as3cf-notice-toggle-content .as3cf-notice-toggle-list{margin-top:0;margin-left:0;padding-left:40px;color:#dc3232}
1
+ .as3cf-content,.as3cf-updated,.as3cf-compatibility-notice{-webkit-box-sizing:border-box;box-sizing:border-box;max-width:650px}.settings_page_amazon-s3-and-cloudfront .error,.settings_page_amazon-s3-and-cloudfront .notice,.settings_page_amazon-s3-and-cloudfront .updated{-webkit-box-sizing:border-box;box-sizing:border-box;max-width:650px}.as3cf-main.wrap{position:relative}.as3cf-main.wrap>h1{float:left}.as3cf-main.wrap .as3cf-notice,.as3cf-main.wrap .as3cf-updated,.as3cf-main.wrap .as3cf-error{-webkit-box-sizing:border-box;box-sizing:border-box}.as3cf-main.wrap .as3cf-error.fatal{clear:both}.as3cf-main.wrap h2.nav-tab-wrapper{float:none;margin-bottom:15px;width:650px;margin-top:10px;padding:9px 0 0 5px}.as3cf-main.wrap h2.nav-tab-wrapper .nav-tab-container{float:right}.as3cf-main.wrap h2.nav-tab-wrapper .nav-tab-container :last-child{margin-right:5px}.as3cf-main.wrap h2.nav-tab-wrapper a.nav-tab-active{color:#464646;cursor:default}.as3cf-main.wrap h2.nav-tab-wrapper a:focus{-webkit-box-shadow:none;box-shadow:none}.as3cf-main.wrap .more-info{white-space:nowrap}.as3cf-main.wrap .error pre{background:#eaeaea;background:rgba(0,0,0,0.07);display:block;padding:10px 15px}.as3cf-main.wrap .error pre code{padding:0;background:none}.as3cf-main.wrap[data-tab="support"] .as3cf-notice,.as3cf-main.wrap[data-tab="support"] .error,.as3cf-main.wrap[data-tab="support"] .updated,.as3cf-main.wrap[data-tab="support"] .updated.show{display:none}.as3cf-main.wrap[data-tab="support"] .fatal .error,.as3cf-main.wrap[data-tab="support"] .as3cf-notice.important,.as3cf-main.wrap[data-tab="support"] .dbrains-api-down{display:block}.as3cf-main.wrap .as3cf-notice,.as3cf-main.wrap .error,.as3cf-main.wrap .updated{max-width:650px;margin-top:15px;-webkit-box-sizing:border-box;box-sizing:border-box}.as3cf-main.wrap .as3cf-updated{display:none}.as3cf-main.wrap .as3cf-updated.as3cf-notice,.as3cf-main.wrap .as3cf-updated.show{display:block}.as3cf-main.wrap .alignleft{margin-right:20px;margin-bottom:20px}.as3cf-main.wrap .spinner{min-width:20px}.as3cf-tab .as3cf-main-settings{display:none}.as3cf-tab .as3cf-bucket-container{display:block}.as3cf-tab.as3cf-has-bucket .as3cf-main-settings{display:block}.as3cf-tab.as3cf-has-bucket .as3cf-bucket-container{display:none}.as3cf-content>section{margin-bottom:20px}.as3cf-content>section+section.as3cf-access-keys{padding-top:20px;border-top:1px solid #d3d3d3}.as3cf-content>section+section.as3cf-access-keys .as3cf-section-heading{margin-top:0}.as3cf-tab{display:none;position:relative;width:650px}.as3cf-tab .as3cf-main-settings p{font-size:13px}.as3cf-tab .as3cf-main-settings p a{color:#444}.as3cf-tab .object-prefix-desc em{white-space:nowrap}.as3cf-tab .as3cf-url-preview-wrap{background:#fff;text-align:center;padding:20px 0 0;max-width:650px;width:100%;-webkit-box-sizing:border-box;box-sizing:border-box}.as3cf-tab .as3cf-url-preview-wrap .as3cf-url-preview{margin-top:10px;padding:0 20px 10px;overflow-x:scroll}.as3cf-tab .as3cf-url-preview-wrap span{color:#aaa;text-transform:uppercase;font-weight:bold}.as3cf-tab .as3cf-radio-group label{display:block;margin-bottom:10px}.as3cf-tab .as3cf-radio-group label.disabled,.as3cf-tab .as3cf-radio-group label.disabled p{color:#bbb;cursor:default}.as3cf-tab .as3cf-radio-group p{padding-left:25px;color:#6b6b6b;margin:0;font-size:12px}.as3cf-tab .as3cf-radio-group p.as3cf-setting{margin-top:5px}.as3cf-tab .as3cf-switch{position:relative;display:inline-block;padding:2px;overflow:hidden;border-radius:2px;background-color:#d4d3d3;cursor:pointer}.as3cf-tab .as3cf-switch.on{background-color:#ade7b5}.as3cf-tab .as3cf-switch span{visibility:hidden;-webkit-box-sizing:border-box;box-sizing:border-box;float:left;display:inline-block;height:100%;font-size:12px;line-height:20px;border-radius:2px;font-weight:bold;padding:4px 8px;background:#fff;color:#8d8d8d;z-index:1}.as3cf-tab .as3cf-switch span.on{color:#82d78b}.as3cf-tab .as3cf-switch span.checked{visibility:visible}.as3cf-tab .as3cf-switch.disabled{cursor:default;background:#e6e6e6}.as3cf-tab .as3cf-switch.disabled span{background:#f1f1f1;color:#d6d6d6}.as3cf-tab .as3cf-switch input[type="checkbox"]{position:absolute !important;top:0;left:0;opacity:0;filter:alpha(opacity=0);z-index:-1}.as3cf-tab .as3cf-setting.hide{display:none}.as3cf-tab div.as3cf-setting{margin-top:4px}.as3cf-tab h3{font-weight:normal;text-transform:uppercase}.as3cf-tab .form-table{margin:0}.as3cf-tab .form-table tr.as3cf-border-bottom td{border-bottom:1px solid #ddd;padding:20px 0px}.as3cf-tab .form-table tr.as3cf-setting-title td{padding-bottom:0}.as3cf-tab .form-table tr.as3cf-setting-title:first-child td{padding-top:20px}.as3cf-tab .form-table tr td{padding:15px 0}.as3cf-tab .form-table tr td:first-child{vertical-align:top;min-width:120px}.as3cf-tab .form-table tr td .as3cf-notice:last-child{margin-bottom:0}.as3cf-tab .form-table tr td>p:first-child{margin-top:0}.as3cf-tab .form-table tr.as3cf-bucket-setting .as3cf-defined-in-config{float:none}.as3cf-tab .form-table h3{padding:0;margin:0}.as3cf-tab .form-table h4{margin:0}.as3cf-tab .as3cf-active-bucket{font-weight:bold;margin-right:10px}.as3cf-tab .as3cf-view-bucket{color:#444;text-decoration:none;margin-right:10px}.as3cf-tab .as3cf-view-bucket:hover,.as3cf-tab .as3cf-view-bucket:active{color:#00a0d2}.as3cf-tab .as3cf-view-bucket:focus{-webkit-box-shadow:none;box-shadow:none}.as3cf-tab .as3cf-view-bucket .dashicons-external{margin-top:-2px}.as3cf-tab .tooltip{position:relative;z-index:2;cursor:pointer}.as3cf-tab .tooltip:before,.as3cf-tab .tooltip:after{visibility:hidden;-ms-filter:"progid:DXImageTransform.Microsoft.Alpha(Opacity=0)";filter:progid:DXImageTransform.Microsoft.Alpha(Opacity=0);opacity:0;pointer-events:none}.as3cf-tab .tooltip:before{position:absolute;bottom:150%;left:50%;margin-bottom:5px;margin-left:-250px;padding:10px;width:500px;border-radius:3px;background-color:#000;background-color:rgba(51,51,51,0.9);color:#fff;content:attr(data-tooltip);text-align:center;font-size:14px;line-height:1.3}.as3cf-tab .tooltip:after{position:absolute;bottom:150%;left:50%;margin-left:-5px;width:0;border-top:5px solid #000;border-top:5px solid rgba(51,51,51,0.9);border-right:5px solid transparent;border-left:5px solid transparent;content:" ";font-size:0;line-height:0}.as3cf-tab .tooltip:hover:before,.as3cf-tab .tooltip:hover:after{visibility:visible;-ms-filter:"progid:DXImageTransform.Microsoft.Alpha(Opacity=100)";filter:progid:DXImageTransform.Microsoft.Alpha(Opacity=100);opacity:1}.as3cf-tab .as3cf-defined-in-config{background:#ccc;color:#fff;padding:2px 5px;margin:0 0 5px 5px;float:right;white-space:nowrap}.as3cf-tab .as3cf-defined-setting{color:#bbb}.as3cf-tab .as3cf-defined-setting label{cursor:default}.as3cf-tab .as3cf-defined-setting p .more-info a{color:#bbb}.as3cf-tab .as3cf-defined-setting .as3cf-radio-group p{color:#bbb}.as3cf-tab .as3cf-defined-setting .as3cf-notice{display:none !important}#tab-media{display:block}#tab-media .as3cf-main-settings{display:none}#tab-media .as3cf-bucket-setting td{padding-top:5px}#tab-media .as3cf-bucket-container{display:block}#tab-media.as3cf-has-bucket .as3cf-main-settings{display:block}#tab-media.as3cf-has-bucket .as3cf-bucket-container{display:none}.as3cf-bucket-container h3{line-height:1.3;text-transform:none}.as3cf-bucket-container a:focus{-webkit-box-shadow:none;box-shadow:none;outline:none}.as3cf-bucket-container input[type=text]{-webkit-box-sizing:border-box;box-sizing:border-box;width:100%}.as3cf-bucket-container select{-webkit-box-sizing:border-box;box-sizing:border-box;width:50%}.as3cf-bucket-container .form-table td{padding:5px 0}.as3cf-bucket-container .form-table td:first-child{width:100px;line-height:30px;vertical-align:top}.as3cf-bucket-container .bucket-actions{margin:15px 0;border-top:1px solid #ccc;padding-top:15px;overflow:hidden}.as3cf-bucket-container .bucket-actions button,.as3cf-bucket-container .bucket-actions .right{float:right;margin-right:0}.as3cf-bucket-container .bucket-actions span{display:inline-block;margin-right:20px;line-height:28px}.as3cf-bucket-container .bucket-actions .bucket-action-cancel{color:#a00;text-decoration:none}.as3cf-bucket-container .bucket-actions .bucket-action-cancel:hover{color:red}.as3cf-bucket-container .as3cf-bucket-list{padding:15px;max-height:200px;overflow-x:hidden;overflow-y:auto;background-color:#fff;font-size:14px}.as3cf-bucket-container .as3cf-bucket-list li:last-of-type{margin-bottom:0}.as3cf-bucket-container .as3cf-bucket-list a{color:#444;text-decoration:none}.as3cf-bucket-container .as3cf-bucket-list a:hover{color:#0074a2}.as3cf-bucket-container .as3cf-bucket-list a.selected{font-weight:bold;color:#0074a2}.as3cf-bucket-container .as3cf-bucket-list a .dashicons{margin-right:5px}.as3cf-bucket-container .as3cf-bucket-select,.as3cf-bucket-container .as3cf-bucket-create{display:none}.as3cf-bucket-container .bucket-actions.select{display:none}#tab-media{display:block}#tab-settings .as3cf-field-wrap{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-box-align:center;-webkit-align-items:center;-ms-flex-align:center;align-items:center}#tab-settings .as3cf-field-wrap input{width:100%}#tab-settings .as3cf-field-wrap button,#tab-settings .as3cf-field-wrap .as3cf-defined-in-config{margin-left:20px}#tab-settings .as3cf-field-wrap .as3cf-defined-in-config{display:none;margin-bottom:0}#tab-settings .as3cf-field-wrap.as3cf-defined button{display:none}#tab-settings .as3cf-field-wrap.as3cf-defined .as3cf-defined-in-config{display:inline-block}#tab-settings .as3cf-field-wrap.as3cf-saved-field .as3cf-activate-licence{display:none}#tab-settings .as3cf-field-wrap.as3cf-licence-not-entered .as3cf-remove-licence{display:none}#tab-support{min-height:900px}#tab-support .as3cf-sidebar{top:11px}#tab-support .support-section{border-bottom:1px solid #ccc;padding-bottom:20px;margin-bottom:20px}#tab-support .support-section h3{font-size:20px}#tab-support .debug textarea{width:100%;min-height:200px;font-family:Consolas, Monaco, monospace;margin-bottom:5px}.as3cf-sidebar{position:absolute;top:9px;left:670px;width:292px}.as3cf-sidebar .block{padding:20px;border:1px solid #ccc}.as3cf-sidebar .subscribe{border-top:none}.as3cf-sidebar .subscribe h2{padding:0;margin:0;margin-bottom:0.5em;color:#666;font-size:20px;line-height:1.2em;float:none}.as3cf-sidebar .subscribe h3{font-size:16px;margin:0}.as3cf-sidebar .subscribe p{margin:0}.as3cf-sidebar .subscribe .intro{margin-bottom:1em;line-height:1.4}.as3cf-sidebar .subscribe li{line-height:1.4}.as3cf-sidebar .subscribe .links{margin-bottom:2em}.as3cf-sidebar .subscribe .links a{text-decoration:none}.as3cf-sidebar .subscribe .promise{color:#999;font-size:12px;line-height:1.4em}.as3cf-sidebar .subscribe .field{margin-bottom:0.5em}.as3cf-sidebar .subscribe .field p{margin-bottom:0.3em}.as3cf-sidebar .subscribe .field input[type=text],.as3cf-sidebar .subscribe .field input[type=email]{width:100%}.as3cf-sidebar .subscribe .field.submit-button{margin-bottom:1em}.as3cf-sidebar .credits{border-top:0}.as3cf-sidebar .credits h4{font-size:16px;margin-top:0;margin-bottom:10px}.as3cf-sidebar .credits ul{margin:0}.as3cf-sidebar .credits li{overflow:hidden}.as3cf-sidebar .credits li:last-child{margin-bottom:0}.as3cf-sidebar .credits img{float:left;margin-right:10px}.as3cf-sidebar .credits span{float:left;display:block;line-height:32px}.as3cf-sidebar .credits a{display:block;text-decoration:none;color:#444;font-size:16px;text-align:center}.as3cf-sidebar .credits a:hover{color:#888}@media screen and (max-width: 1052px){.as3cf-sidebar{position:relative;top:auto;right:auto}}.as3cf-banner{margin-top:35px;width:292px;height:200px;display:block;background:#f8cfae url(../img/os3-banner.svg) left bottom/220px 220px no-repeat}.as3cf-banner:focus{-webkit-box-shadow:none;box-shadow:none}.wrap .as3cf-upgrade-details{background-color:#4e0d33;padding:10px 20px 20px 20px;color:#eee;font-size:13px;margin:0;display:block;text-decoration:none}.wrap .as3cf-upgrade-details h1{font-size:28px;color:#eee;margin:0 0 15px 0;padding:0;text-decoration:none;font-weight:200;line-height:1}.wrap .as3cf-upgrade-details p{margin:0}.wrap .as3cf-upgrade-details a{color:#eee;font-weight:bold;text-decoration:none;font-size:16px;-webkit-box-shadow:none;box-shadow:none}.wrap .as3cf-upgrade-details a:hover{color:#fff}.wrap .as3cf-upgrade-details ul{margin-top:0;margin-left:16px;list-style-type:disc}.as3cf-compatibility-notice.error{clear:both;margin:5px 20px 5px 0}.as3cf-bucket-error span.title{font-weight:bold}.as3cf-invalid-bucket-name,.as3cf-validation-error{display:block;margin-top:2px;font-size:12px;color:#a00}.as3cf-notice-toggle-content{max-height:100px;overflow-y:scroll}.as3cf-notice-toggle-content .as3cf-notice-toggle-list{margin-top:0;margin-left:0;padding-left:40px;color:#dc3232}.as3cf-need-help{background-color:white;font-size:16px;font-weight:bold;padding:1em}.as3cf-need-help a{text-decoration:none}.as3cf-aws-logo{color:white;background-color:#f7a80d;padding:1em}.as3cf-settings h3{font-size:20px}.as3cf-settings p{font-size:14px}.as3cf-addons,.as3cf-tab .as3cf-compatibility-notice{max-width:cover}textarea.as3cf-access-key-constants-snippet.code{width:100%;white-space:pre;overflow:hidden;font-size:12px;padding:10px;height:53px}.as3cf-addons .as3cf-addons-list{margin:20px 0 200px;padding-top:5px}.as3cf-addons .as3cf-addon{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;padding:20px;font-size:14px}.as3cf-addons .as3cf-addon-info{min-height:100px}.as3cf-addons .as3cf-addon-links{float:right}.as3cf-addons .as3cf-addon-links span{padding:4px 6px}.as3cf-addons .as3cf-addon-icon{float:left;margin-right:20px}.as3cf-addons .as3cf-addon-details{white-space:nowrap}.as3cf-addons .as3cf-addon-title,.as3cf-addons .as3cf-addon-description{font-weight:100}.as3cf-addons .as3cf-addon+.as3cf-addon{margin-top:20px}.as3cf-addons .as3cf-addon.amazon-s3-and-cloudfront-assets-pull{background-color:#0769ad;color:white}.as3cf-addons .as3cf-addon.amazon-s3-and-cloudfront-assets-pull .as3cf-addon-title,.as3cf-addons .as3cf-addon.amazon-s3-and-cloudfront-assets-pull .as3cf-addon-description,.as3cf-addons .as3cf-addon.amazon-s3-and-cloudfront-assets-pull a{color:white}.as3cf-addons .as3cf-addon.amazon-s3-and-cloudfront-assets-pull .extra{background:white}.as3cf-addons .as3cf-addon.amazon-s3-and-cloudfront-assets-pull .extra a{color:#0769ad;text-decoration:none}
assets/img/as3cf-banner-bw.jpg ADDED
Binary file
assets/img/as3cf-banner-bw@2x.jpg ADDED
Binary file
assets/img/as3cf-banner.jpg ADDED
Binary file
assets/img/as3cf-banner@2x.jpg ADDED
Binary file
assets/img/aws-logo.svg ADDED
@@ -0,0 +1,17 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0" encoding="utf-8"?>
2
+ <!-- Generator: Adobe Illustrator 18.1.1, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
3
+ <svg version="1.1"
4
+ id="svg2" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:svg="http://www.w3.org/2000/svg" xmlns:cc="http://creativecommons.org/ns#"
5
+ xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
6
+ viewBox="-243.4 335.3 101.3 79.8" enable-background="new -243.4 335.3 101.3 79.8" xml:space="preserve">
7
+ <path id="polygon287" fill="#FFFFFF" d="M-213.9,386.2l-9.3,4l8.6,3.7l10-3.7L-213.9,386.2z M-227.8,391.1l-0.3,17.9l13.6,6v-18.6
8
+ L-227.8,391.1z M-199.9,391.1l-12.3,4.7v17.6l12.3-5V391.1z"/>
9
+ <path id="polygon311" fill="#FFFFFF" d="M-185.3,335.3l-9.3,4l8.7,3.7l10-3.7L-185.3,335.3z M-198.2,340.6v17.9l11.6,3.4l0.4-16.3
10
+ L-198.2,340.6z M-172.3,341.6l-11,4.7v17.6l11-5V341.6z"/>
11
+ <path id="use3387" fill="#FFFFFF" d="M-229.2,360.6l-9.3,4l8.6,3.7l10-3.7L-229.2,360.6z M-243.1,365.6l-0.3,17.9l13.6,6v-18.6
12
+ L-243.1,365.6z M-215.2,365.6l-12.3,4.7v17.6l12.3-5V365.6z"/>
13
+ <path id="use3389" fill="#FFFFFF" d="M-199.2,359.9l-9.3,4l8.6,3.7l10-3.7L-199.2,359.9z M-213.2,364.9l-0.3,17.9l13.6,6v-18.6
14
+ L-213.2,364.9z M-185.3,364.9l-12.3,4.7v17.6l12.3-5V364.9z"/>
15
+ <path id="use3391" fill="#FFFFFF" d="M-156,335.3l-9.3,4l8.6,3.7l10-3.7L-156,335.3z M-170,340.3l-0.3,17.9l13.6,6v-18.6L-170,340.3
16
+ z M-142.1,340.3l-12.3,4.7v17.6l12.3-5V340.3z"/>
17
+ </svg>
assets/img/icon-assets-pull.svg ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0" encoding="UTF-8" standalone="no"?>
2
+ <svg width="354px" height="318px" viewBox="0 0 354 318" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:sketch="http://www.bohemiancoding.com/sketch/ns">
3
+ <!-- Generator: Sketch 3.2.2 (9983) - http://www.bohemiancoding.com/sketch -->
4
+ <title>Untitled</title>
5
+ <desc>Created with Sketch.</desc>
6
+ <defs></defs>
7
+ <g id="Page-1" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd" sketch:type="MSPage">
8
+ <path d="M51.269,159 C68.955,166.75 81.519,183.5 81.519,213 L81.519,247.457 C81.519,272.412 103.898,280.369 123.066,280.951 L123.066,317.812 C70.802,317.812 39.955,299.912 39.955,251.578 L39.955,213.195 C39.955,188.648 20.455,177.658 0.601,177.658 L0.601,140.342 C20.455,140.342 39.955,129.353 39.955,104.806 L39.955,66.422 C39.955,18.089 70.803,0.188 123.066,0.188 L123.066,37.049 C103.898,37.631 81.519,45.588 81.519,70.544 L81.519,105 C81.519,134.5 68.954,151.25 51.269,159 L51.269,159 Z M272.481,105 L272.481,70.544 C272.481,45.588 250.102,37.631 230.934,37.049 L230.934,0.188 C283.198,0.188 314.045,18.089 314.045,66.422 L314.045,104.806 C314.045,129.353 333.545,140.342 353.399,140.342 L353.399,177.658 C333.545,177.658 314.045,188.648 314.045,213.195 L314.045,251.578 C314.045,299.912 283.197,317.812 230.934,317.812 L230.934,280.951 C250.102,280.369 272.481,272.412 272.481,247.457 L272.481,213 C272.481,183.5 285.045,166.75 302.731,159 C285.046,151.25 272.481,134.5 272.481,105 L272.481,105 Z M204.546,175.288 L204.546,206.442 C204.546,234.293 186.946,256.827 161.302,261.899 L156.442,251.395 C168.318,246.92 175.85,232.55 175.85,221.755 L155.804,221.755 L155.804,175.287 L204.546,175.287 L204.546,175.288 Z M204.546,75.051 L155.804,75.051 L155.804,123.872 L204.546,123.872 L204.546,75.051 L204.546,75.051 Z" id="javascript-code-icon" fill="#FFFFFF" sketch:type="MSShapeGroup"></path>
9
+ </g>
10
+ </svg>
assets/img/icon16.png ADDED
Binary file
assets/img/snail-banner.jpg DELETED
Binary file
assets/img/snail-banner@2x.jpg DELETED
Binary file
assets/js/script.js CHANGED
@@ -4,7 +4,9 @@
4
  var bucketNamePattern = /[^a-z0-9.-]/;
5
  var refreshBucketListOnLoad = false;
6
 
 
7
  var $tabs = $( '.as3cf-tab' );
 
8
  var $activeTab;
9
 
10
  /**
@@ -68,7 +70,7 @@
68
  $activeTab.show();
69
  $( '.nav-tab' ).removeClass( 'nav-tab-active' );
70
  $( 'a.nav-tab[data-tab="' + hash + '"]' ).addClass( 'nav-tab-active' );
71
- $( '.aws-main' ).data( 'tab', hash );
72
  if ( $activeTab.data( 'prefix' ) ) {
73
  as3cfModal.prefix = $activeTab.data( 'prefix' );
74
  }
@@ -294,6 +296,8 @@
294
 
295
  // Make sure the bucket list will refresh the next time the modal loads
296
  refreshBucketListOnLoad = true;
 
 
297
  } else {
298
  that.showError( as3cf.strings.save_bucket_error, data[ 'error' ], 'as3cf-bucket-manual' );
299
  }
@@ -358,6 +362,8 @@
358
  if ( 'undefined' !== typeof data[ 'success' ] ) {
359
  that.set( bucketName, data[ 'region' ], data[ 'can_write' ] );
360
  $( '#' + as3cfModal.prefix + '-bucket-select' ).val( '' );
 
 
361
  } else {
362
  that.showError( as3cf.strings.save_bucket_error, data[ 'error' ], 'as3cf-bucket-select' );
363
  $( '.as3cf-bucket-list a' ).removeClass( 'selected' );
@@ -518,6 +524,8 @@
518
 
519
  // Make sure the bucket list will refresh the next time the modal loads
520
  refreshBucketListOnLoad = true;
 
 
521
  } else {
522
  that.showError( as3cf.strings.create_bucket_error, data[ 'error' ], 'as3cf-bucket-create' );
523
  }
@@ -571,6 +579,35 @@
571
 
572
  };
573
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
574
  /**
575
  * Get the link to the bucket on the AWS Console and update the DOM
576
  *
@@ -667,6 +704,85 @@
667
  $( document ).trigger( 'as3cf.tabRendered', [ location.hash.replace( '#', '' ) ] );
668
  }
669
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
670
  $( document ).ready( function() {
671
 
672
  // Tabs
@@ -687,8 +803,8 @@
687
  };
688
 
689
  // Move any compatibility errors below the nav tabs
690
- var $navTabs = $( '.wrap.aws-main .nav-tab-wrapper' );
691
- $( '.aws-compatibility-notice, div.updated, div.error, div.notice' ).not( '.below-h2, .inline' ).insertAfter( $navTabs );
692
 
693
  // Settings
694
  // --------------------
@@ -791,17 +907,17 @@
791
  $( '#tab-media > .as3cf-bucket-error' ).detach().insertAfter( '.as3cf-bucket-container h3' );
792
 
793
  // Action click handlers
794
- $( 'body' ).on( 'click', '.bucket-action-manual', function( e ) {
795
  e.preventDefault();
796
  $( '.as3cf-bucket-container.' + as3cfModal.prefix + ' .as3cf-bucket-manual' ).show().siblings().hide();
797
  } );
798
- $( 'body' ).on( 'click', '.bucket-action-browse', function( e ) {
799
  e.preventDefault();
800
  $( '.as3cf-bucket-container.' + as3cfModal.prefix + ' .as3cf-bucket-select' ).show().siblings().hide();
801
  as3cf.buckets.loadList( refreshBucketListOnLoad );
802
  refreshBucketListOnLoad = false;
803
  } );
804
- $( 'body' ).on( 'click', '.bucket-action-create', function( e ) {
805
  e.preventDefault();
806
 
807
  // Reset create bucket modal
@@ -810,27 +926,27 @@
810
 
811
  $( '.as3cf-bucket-container.' + as3cfModal.prefix + ' .as3cf-bucket-create' ).show().siblings().hide();
812
  } );
813
- $( 'body' ).on( 'click', '.bucket-action-cancel', function( e ) {
814
  e.preventDefault();
815
  as3cf.buckets.resetModal();
816
  } );
817
- $( 'body' ).on( 'click', '.bucket-action-save', function( e ) {
818
  e.preventDefault();
819
  as3cf.buckets.saveManual();
820
  } );
821
- $( 'body' ).on( 'click', '.as3cf-create-bucket-form button[type="submit"]', function( e ) {
822
  e.preventDefault();
823
  as3cf.buckets.create();
824
  } );
825
 
826
  // Bucket list refresh handler
827
- $( 'body' ).on( 'click', '.bucket-action-refresh', function( e ) {
828
  e.preventDefault();
829
  as3cf.buckets.loadList( true );
830
  } );
831
 
832
  // Bucket list click handler
833
- $( 'body' ).on( 'click', '.as3cf-bucket-list a', function( e ) {
834
  e.preventDefault();
835
  as3cf.buckets.saveSelected( $( this ) );
836
  } );
@@ -844,7 +960,7 @@
844
  } );
845
 
846
  // Modal open
847
- $( 'body' ).on( 'as3cf-modal-open', function( e, target ) {
848
  if ( '.as3cf-bucket-container.' + as3cfModal.prefix === target ) {
849
 
850
  // Reset modal
@@ -862,7 +978,7 @@
862
  as3cf.buckets.disabledButtons();
863
 
864
  // Validate bucket name on create
865
- $( 'body' ).on( 'input keyup', '.as3cf-create-bucket-form .as3cf-bucket-name', function( e ) {
866
  var bucketName = $( this ).val();
867
  var $createBucketForm = $( '.as3cf-bucket-container.' + as3cfModal.prefix + ' .as3cf-create-bucket-form' );
868
 
@@ -875,7 +991,7 @@
875
  } );
876
 
877
  // Check bucket name length on manual
878
- $( 'body' ).on( 'input keyup', '.as3cf-manual-save-bucket-form .as3cf-bucket-name', function( e ) {
879
  var $manualBucketForm = $( '.as3cf-bucket-container.' + as3cfModal.prefix + ' .as3cf-manual-save-bucket-form' );
880
 
881
  if ( $manualBucketForm.find( '.as3cf-bucket-name' ).val().length < as3cf.buckets.validLength ) {
@@ -885,6 +1001,21 @@
885
  }
886
  } );
887
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
888
  } );
889
 
890
  })( jQuery, as3cfModal );
4
  var bucketNamePattern = /[^a-z0-9.-]/;
5
  var refreshBucketListOnLoad = false;
6
 
7
+ var $body = $( 'body' );
8
  var $tabs = $( '.as3cf-tab' );
9
+ var $settings = $( '.as3cf-settings' );
10
  var $activeTab;
11
 
12
  /**
70
  $activeTab.show();
71
  $( '.nav-tab' ).removeClass( 'nav-tab-active' );
72
  $( 'a.nav-tab[data-tab="' + hash + '"]' ).addClass( 'nav-tab-active' );
73
+ $( '.as3cf-main' ).data( 'tab', hash );
74
  if ( $activeTab.data( 'prefix' ) ) {
75
  as3cfModal.prefix = $activeTab.data( 'prefix' );
76
  }
296
 
297
  // Make sure the bucket list will refresh the next time the modal loads
298
  refreshBucketListOnLoad = true;
299
+
300
+ as3cf.showSettingsSavedNotice();
301
  } else {
302
  that.showError( as3cf.strings.save_bucket_error, data[ 'error' ], 'as3cf-bucket-manual' );
303
  }
362
  if ( 'undefined' !== typeof data[ 'success' ] ) {
363
  that.set( bucketName, data[ 'region' ], data[ 'can_write' ] );
364
  $( '#' + as3cfModal.prefix + '-bucket-select' ).val( '' );
365
+
366
+ as3cf.showSettingsSavedNotice();
367
  } else {
368
  that.showError( as3cf.strings.save_bucket_error, data[ 'error' ], 'as3cf-bucket-select' );
369
  $( '.as3cf-bucket-list a' ).removeClass( 'selected' );
524
 
525
  // Make sure the bucket list will refresh the next time the modal loads
526
  refreshBucketListOnLoad = true;
527
+
528
+ as3cf.showSettingsSavedNotice();
529
  } else {
530
  that.showError( as3cf.strings.create_bucket_error, data[ 'error' ], 'as3cf-bucket-create' );
531
  }
579
 
580
  };
581
 
582
+ /**
583
+ * Reload the page, and show the persistent updated notice.
584
+ *
585
+ * Intended for use on plugin settings page.
586
+ */
587
+ as3cf.reloadUpdated = function() {
588
+ var url = location.pathname + location.search;
589
+
590
+ if ( ! location.search.match( /[?&]updated=/ ) ) {
591
+ url += '&updated=1';
592
+ }
593
+
594
+ url += location.hash;
595
+
596
+ location.assign( url );
597
+ };
598
+
599
+ /**
600
+ * Show the standard "Settings saved." notice if not already visible.
601
+ */
602
+ as3cf.showSettingsSavedNotice = function() {
603
+ if ( 0 < $( '#setting-error-settings_updated:visible' ).length || 0 < $( '#as3cf-settings_updated:visible' ).length ) {
604
+ return;
605
+ }
606
+ var settingsUpdatedNotice = '<div id="as3cf-settings_updated" class="updated settings-error notice is-dismissible"><p><strong>' + as3cf.strings.settings_saved + '</strong></p></div>';
607
+ $( 'h2.nav-tab-wrapper' ).after( settingsUpdatedNotice );
608
+ $( document ).trigger( 'wp-updates-notice-added' ); // Hack to run WP Core's makeNoticesDismissible() function.
609
+ };
610
+
611
  /**
612
  * Get the link to the bucket on the AWS Console and update the DOM
613
  *
704
  $( document ).trigger( 'as3cf.tabRendered', [ location.hash.replace( '#', '' ) ] );
705
  }
706
 
707
+ /**
708
+ * Access Keys API object
709
+ * @constructor
710
+ */
711
+ var AccessKeys = function() {
712
+ this.$key = $settings.find( 'input[name="aws-access-key-id"]' );
713
+ this.$secret = $settings.find( 'input[name="aws-secret-access-key"]' );
714
+ this.$spinner = $settings.find( '[data-as3cf-aws-keys-spinner]' );
715
+ this.$feedback = $settings.find( '[data-as3cf-aws-keys-feedback]' );
716
+ };
717
+
718
+ /**
719
+ * Set the access keys using the values in the settings fields.
720
+ */
721
+ AccessKeys.prototype.set = function() {
722
+ this.sendRequest( 'set', {
723
+ 'aws-access-key-id': this.$key.val(),
724
+ 'aws-secret-access-key': this.$secret.val()
725
+ } ).done( function( response ) {
726
+ if ( response.success ) {
727
+ this.$secret.val( as3cf.strings.not_shown_placeholder );
728
+ }
729
+ }.bind( this ) );
730
+ };
731
+
732
+ /**
733
+ * Remove the access keys from the database and clear the fields.
734
+ */
735
+ AccessKeys.prototype.remove = function() {
736
+ this.sendRequest( 'remove' )
737
+ .done( function( response ) {
738
+ if ( response.success ) {
739
+ this.$key.val( '' );
740
+ this.$secret.val( '' );
741
+ }
742
+ }.bind( this ) )
743
+ ;
744
+ };
745
+
746
+ /**
747
+ * Send the request to the server to update the access keys.
748
+ *
749
+ * @param {string} action The action to perform with the keys
750
+ * @param {undefined|Object} params Extra parameters to send with the request
751
+ *
752
+ * @returns {jqXHR}
753
+ */
754
+ AccessKeys.prototype.sendRequest = function( action, params ) {
755
+ var data = {
756
+ action: 'as3cf-aws-keys-' + action,
757
+ _ajax_nonce: as3cf.nonces[ 'aws_keys_' + action ]
758
+ };
759
+
760
+ if ( _.isObject( params ) ) {
761
+ data = _.extend( data, params );
762
+ }
763
+
764
+ this.$spinner.addClass( 'is-active' );
765
+
766
+ return $.post( ajaxurl, data )
767
+ .done( function( response ) {
768
+ this.$feedback
769
+ .toggleClass( 'notice-success', response.success )
770
+ .toggleClass( 'notice-error', ! response.success );
771
+
772
+ if ( response.data && response.data.message ) {
773
+ this.$feedback.html( '<p>' + response.data.message + '</p>' ).show();
774
+ }
775
+
776
+ if ( response.success ) {
777
+ as3cf.reloadUpdated();
778
+ }
779
+ }.bind( this ) )
780
+ .always( function() {
781
+ this.$spinner.removeClass( 'is-active' );
782
+ }.bind( this ) )
783
+ ;
784
+ };
785
+
786
  $( document ).ready( function() {
787
 
788
  // Tabs
803
  };
804
 
805
  // Move any compatibility errors below the nav tabs
806
+ var $navTabs = $( '.as3cf-main .nav-tab-wrapper' );
807
+ $( '.as3cf-compatibility-notice, div.updated, div.error, div.notice' ).not( '.below-h2, .inline' ).insertAfter( $navTabs );
808
 
809
  // Settings
810
  // --------------------
907
  $( '#tab-media > .as3cf-bucket-error' ).detach().insertAfter( '.as3cf-bucket-container h3' );
908
 
909
  // Action click handlers
910
+ $body.on( 'click', '.bucket-action-manual', function( e ) {
911
  e.preventDefault();
912
  $( '.as3cf-bucket-container.' + as3cfModal.prefix + ' .as3cf-bucket-manual' ).show().siblings().hide();
913
  } );
914
+ $body.on( 'click', '.bucket-action-browse', function( e ) {
915
  e.preventDefault();
916
  $( '.as3cf-bucket-container.' + as3cfModal.prefix + ' .as3cf-bucket-select' ).show().siblings().hide();
917
  as3cf.buckets.loadList( refreshBucketListOnLoad );
918
  refreshBucketListOnLoad = false;
919
  } );
920
+ $body.on( 'click', '.bucket-action-create', function( e ) {
921
  e.preventDefault();
922
 
923
  // Reset create bucket modal
926
 
927
  $( '.as3cf-bucket-container.' + as3cfModal.prefix + ' .as3cf-bucket-create' ).show().siblings().hide();
928
  } );
929
+ $body.on( 'click', '.bucket-action-cancel', function( e ) {
930
  e.preventDefault();
931
  as3cf.buckets.resetModal();
932
  } );
933
+ $body.on( 'click', '.bucket-action-save', function( e ) {
934
  e.preventDefault();
935
  as3cf.buckets.saveManual();
936
  } );
937
+ $body.on( 'click', '.as3cf-create-bucket-form button[type="submit"]', function( e ) {
938
  e.preventDefault();
939
  as3cf.buckets.create();
940
  } );
941
 
942
  // Bucket list refresh handler
943
+ $body.on( 'click', '.bucket-action-refresh', function( e ) {
944
  e.preventDefault();
945
  as3cf.buckets.loadList( true );
946
  } );
947
 
948
  // Bucket list click handler
949
+ $body.on( 'click', '.as3cf-bucket-list a', function( e ) {
950
  e.preventDefault();
951
  as3cf.buckets.saveSelected( $( this ) );
952
  } );
960
  } );
961
 
962
  // Modal open
963
+ $body.on( 'as3cf-modal-open', function( e, target ) {
964
  if ( '.as3cf-bucket-container.' + as3cfModal.prefix === target ) {
965
 
966
  // Reset modal
978
  as3cf.buckets.disabledButtons();
979
 
980
  // Validate bucket name on create
981
+ $body.on( 'input keyup', '.as3cf-create-bucket-form .as3cf-bucket-name', function( e ) {
982
  var bucketName = $( this ).val();
983
  var $createBucketForm = $( '.as3cf-bucket-container.' + as3cfModal.prefix + ' .as3cf-create-bucket-form' );
984
 
991
  } );
992
 
993
  // Check bucket name length on manual
994
+ $body.on( 'input keyup', '.as3cf-manual-save-bucket-form .as3cf-bucket-name', function( e ) {
995
  var $manualBucketForm = $( '.as3cf-bucket-container.' + as3cfModal.prefix + ' .as3cf-manual-save-bucket-form' );
996
 
997
  if ( $manualBucketForm.find( '.as3cf-bucket-name' ).val().length < as3cf.buckets.validLength ) {
1001
  }
1002
  } );
1003
 
1004
+ $settings
1005
+ .on( 'click', '[data-as3cf-toggle-access-keys-form]', function( event ) {
1006
+ event.preventDefault();
1007
+ $( '#as3cf_access_keys' ).toggle();
1008
+ } )
1009
+ .on( 'click', '[data-as3cf-aws-keys-action]', function( event ) {
1010
+ event.preventDefault();
1011
+ var action = $( this ).data( 'as3cfAwsKeysAction' );
1012
+ var api = new AccessKeys();
1013
+
1014
+ if ( 'function' === typeof api[action] ) {
1015
+ api[action]();
1016
+ }
1017
+ } )
1018
+ ;
1019
  } );
1020
 
1021
  })( jQuery, as3cfModal );
assets/js/script.min.js CHANGED
@@ -1 +1 @@
1
- !function(a,b){function c(b){return a("#"+b+" .as3cf-main-settings form").find("input:not(.no-compare)").serialize()}function d(a){var b=k.find("#"+a),c=b.find("input[type=checkbox]");b.toggleClass("on").find("span").toggleClass("checked");var d=b.find("span.on").hasClass("checked");c.prop("checked",d).trigger("change")}function e(b){var c=b.next(".as3cf-validation-error"),d=a("#"+k.attr("id")+' form button[type="submit"]'),e=/[^a-zA-Z0-9\.\-]/;e.test(b.val())?(c.show(),d.prop("disabled",!0)):(c.hide(),d.prop("disabled",!1))}function f(){var c=a("#"+b.prefix+"-bucket").val(),d=k.find('input[name="object-prefix"]'),e=d.val();""!==e&&(e="&prefix="+encodeURIComponent(e));var f=as3cf.aws_bucket_link+c+e;a("#"+b.prefix+"-view-bucket").attr("href",f)}function g(){a(".as3cf-url-preview").html("Generating...");var b={_nonce:as3cf.nonces.get_url_preview};a.each(a("#tab-"+as3cf.tabs.defaultTab+" .as3cf-main-settings form").serializeArray(),function(c,d){var e=d.name,f=d.value;e=e.replace("[]",""),b[e]=void 0===b[e]?f:a.isArray(b[e])?b[e].concat(f):[b[e],f]}),b.action="as3cf-get-url-preview",a.ajax({url:ajaxurl,type:"POST",dataType:"JSON",data:b,error:function(a,b,c){alert(as3cf.strings.get_url_preview_error+c)},success:function(b,c,d){"undefined"!=typeof b.success?a(".as3cf-url-preview").html(b.url):alert(as3cf.strings.get_url_preview_error+b.error)}})}function h(){a("#as3cf-remove-local-file").is(":checked")&&a("#as3cf-serve-from-s3").is(":not(:checked)")?a("#as3cf-lost-files-notice").show():a("#as3cf-lost-files-notice").hide()}function i(){a("#as3cf-remove-local-file").is(":checked")?a("#as3cf-remove-local-notice").show():a("#as3cf-remove-local-notice").hide()}function j(){return"#"+as3cf.tabs.defaultTab===location.hash?void(location.hash=""):(as3cf.tabs.toggle(location.hash.replace("#",""),!0),void a(document).trigger("as3cf.tabRendered",[location.hash.replace("#","")]))}var k,l={},m=/[^a-z0-9.-]/,n=!1,o=a(".as3cf-tab");as3cf.tabs={defaultTab:"media",toggle:function(c,d){c=as3cf.tabs.sanitizeHash(c),o.hide(),k=a("#tab-"+c),k.show(),a(".nav-tab").removeClass("nav-tab-active"),a('a.nav-tab[data-tab="'+c+'"]').addClass("nav-tab-active"),a(".aws-main").data("tab",c),k.data("prefix")&&(b.prefix=k.data("prefix")),d||a(".as3cf-updated").removeClass("show"),"support"===c&&as3cf.tabs.getDiagnosticInfo()},getDiagnosticInfo:function(){var b=a(".debug-log-textarea");b.html(as3cf.strings.get_diagnostic_info);var c={action:"as3cf-get-diagnostic-info",_nonce:as3cf.nonces.get_diagnostic_info};a.ajax({url:ajaxurl,type:"POST",dataType:"JSON",data:c,error:function(a,c,d){b.html(d)},success:function(a,c,d){"undefined"!=typeof a.success?b.html(a.diagnostic_info):(b.html(as3cf.strings.get_diagnostic_info_error),b.append(a.error))}})},sanitizeHash:function(b){var c=a("#tab-"+b);return 0===c.length&&(b=as3cf.tabs.defaultTab),b}},as3cf.buckets={validLength:3,bucketSelectLock:!1,loadList:function(c){"undefined"==typeof c&&(c=!1);var d=a(".as3cf-bucket-container."+b.prefix+" .as3cf-bucket-list"),e=a("#"+b.prefix+"-bucket").val();if(!1===c&&d.find("li").length>1)return a(".as3cf-bucket-list a").removeClass("selected"),a('.as3cf-bucket-list a[data-bucket="'+e+'"]').addClass("selected"),void this.scrollToSelected();d.html('<li class="loading">'+d.data("working")+"</li>");var f={action:b.prefix+"-get-buckets",_nonce:window[b.prefix.replace(/-/g,"_")].nonces.get_buckets},g=this;a.ajax({url:ajaxurl,type:"POST",dataType:"JSON",data:f,error:function(a,b,c){d.html(""),g.showError(as3cf.strings.get_buckets_error,c,"as3cf-bucket-select")},success:function(b,c,f){d.html(""),"undefined"!=typeof b.success?(a(".as3cf-bucket-error").hide(),a(b.buckets).each(function(a,b){var c=b.Name===e?"selected":"";d.append('<li><a class="'+c+'" href="#" data-bucket="'+b.Name+'"><span class="bucket"><span class="dashicons dashicons-portfolio"></span> '+b.Name+'</span><span class="spinner"></span></span></a></li>')}),g.scrollToSelected()):g.showError(as3cf.strings.get_buckets_error,b.error,"as3cf-bucket-select")}})},scrollToSelected:function(){if(a(".as3cf-bucket-list a.selected").length){var b=a("ul.as3cf-bucket-list li").first().position().top+150;a(".as3cf-bucket-list").animate({scrollTop:a("ul.as3cf-bucket-list li a.selected").position().top-b})}},resetModal:function(){var c=a(".as3cf-bucket-container."+b.prefix);!1===k.hasClass("as3cf-has-bucket")||"manual"===a("#"+b.prefix+"-bucket-select").val()?(c.find(".as3cf-bucket-manual").show().siblings().hide(),c.find(".bucket-actions.manual").show().siblings(".bucket-actions").hide()):(c.find(".as3cf-bucket-select").show().siblings().hide(),c.find(".bucket-actions.select").show().siblings(".bucket-actions").hide(),this.loadList(n),n=!1),c.find(".as3cf-bucket-error").hide();var d=a("#"+b.prefix+"-bucket").val();c.find(".as3cf-bucket-manual .as3cf-bucket-name").val(d),this.bucketSelectLock=!1},saveManual:function(){var c=a(".as3cf-bucket-container."+b.prefix+" .as3cf-manual-save-bucket-form"),d=c.find(".as3cf-bucket-name"),e=c.find("button[type=submit]"),f=d.val(),g=e.first().text();if(f===a("#"+b.prefix+"-active-bucket").text())return a(".as3cf-bucket-error").hide(),k.addClass("as3cf-has-bucket"),void b.close();a(".as3cf-bucket-error").hide(),e.text(e.data("working")),e.prop("disabled",!0);var h={action:b.prefix+"-manual-save-bucket",bucket_name:f,_nonce:window[b.prefix.replace(/-/g,"_")].nonces.manual_bucket},i=this;a.ajax({url:ajaxurl,type:"POST",dataType:"JSON",data:h,error:function(a,b,c){e.text(g),i.showError(as3cf.strings.save_bucket_error,c,"as3cf-bucket-manual")},success:function(c,d,h){e.text(g),e.prop("disabled",!1),"undefined"!=typeof c.success?(i.set(f,c.region,c.can_write),a("#"+b.prefix+"-bucket-select").val("manual"),a(".as3cf-bucket-list a").removeClass("selected").filter('[data-bucket="'+f+'"]').addClass("selected"),n=!0):i.showError(as3cf.strings.save_bucket_error,c.error,"as3cf-bucket-manual")}})},saveSelected:function(c){var d=a(".as3cf-bucket-list");if(!this.bucketSelectLock){if(this.bucketSelectLock=!0,c.hasClass("selected"))return k.addClass("as3cf-has-bucket"),void b.close();var e=a(".as3cf-bucket-list a.selected").data("bucket");a(".as3cf-bucket-list a").removeClass("selected"),c.addClass("selected"),d.addClass("saving"),c.find(".spinner").show().css("visibility","visible");var f=c.data("bucket"),g={action:b.prefix+"-save-bucket",bucket_name:f,_nonce:window[b.prefix.replace(/-/g,"_")].nonces.save_bucket},h=this;a.ajax({url:ajaxurl,type:"POST",dataType:"JSON",data:g,error:function(b,c,f){d.removeClass("saving"),h.showError(as3cf.strings.save_bucket_error,f,"as3cf-bucket-select"),a(".as3cf-bucket-list a").removeClass("selected"),a('.as3cf-bucket-list a[data-bucket="'+e+'"]').addClass("selected")},success:function(g,i,j){c.find(".spinner").hide().css("visibility","hidden"),d.removeClass("saving"),"undefined"!=typeof g.success?(h.set(f,g.region,g.can_write),a("#"+b.prefix+"-bucket-select").val("")):(h.showError(as3cf.strings.save_bucket_error,g.error,"as3cf-bucket-select"),a(".as3cf-bucket-list a").removeClass("selected"),a('.as3cf-bucket-list a[data-bucket="'+e+'"]').addClass("selected"))}})}},disabledButtons:function(){if(0!==a(".as3cf-bucket-container."+b.prefix+" .as3cf-create-bucket-form").length){var c=a(".as3cf-bucket-container."+b.prefix+" .as3cf-create-bucket-form"),d=a(".as3cf-bucket-container."+b.prefix+" .as3cf-manual-save-bucket-form");c.find(".as3cf-bucket-name").val().length<3?c.find("button[type=submit]").prop("disabled",!0):c.find("button[type=submit]").prop("disabled",!1),d.find(".as3cf-bucket-name").val().length<3?d.find("button[type=submit]").prop("disabled",!0):d.find("button[type=submit]").prop("disabled",!1)}},showError:function(b,c,d){var e=a(".as3cf-bucket-container").children(":visible"),f=e.find(".as3cf-bucket-error");d="undefined"==typeof d?null:d,d&&!e.hasClass(d)||(f.find("span.title").html(b+" &mdash;"),f.find("span.message").html(c),f.show(),this.bucketSelectLock=!1)},set:function(e,h,i){var j=a(".as3cf-bucket-container."+b.prefix+" .as3cf-manual-save-bucket-form"),m=a("#"+b.prefix+"-active-bucket");if("as3cf"===b.prefix&&0===m.text().trim().length){d("as3cf-copy-to-s3-wrap"),d("as3cf-serve-from-s3-wrap");var n=k.attr("id");l[n]=c(n)}a(".as3cf-error.fatal").hide(),m.text(e),j.find(".as3cf-bucket-name").val(e),a("#"+b.prefix+"-bucket").val(e),a("#"+b.prefix+"-region").val(h),a(".updated").not(".as3cf-notice").show(),k.addClass("as3cf-has-bucket"),k.find(".as3cf-can-write-error").toggle(!i),k.find(".as3cf-bucket-error").hide(),"as3cf"===b.prefix&&g(),f(),b.close(function(){k.trigger("bucket-change",[i]),as3cf.buckets.bucketSelectLock=!1})},create:function(){var c=a(".as3cf-bucket-container."+b.prefix+" .as3cf-create-bucket-form"),d=c.find(".as3cf-bucket-name"),e=c.find(".bucket-create-region"),f=c.find("button[type=submit]"),g=d.val(),h=f.text();a(".as3cf-bucket-error").hide(),f.text(f.data("working")),f.prop("disabled",!0);var i={action:b.prefix+"-create-bucket",bucket_name:g,_nonce:window[b.prefix.replace(/-/g,"_")].nonces.create_bucket};e.val()&&(i.region=e.val());var j=this;a.ajax({url:ajaxurl,type:"POST",dataType:"JSON",data:i,error:function(a,b,c){f.text(h),j.showError(as3cf.strings.create_bucket_error,c,"as3cf-bucket-create")},success:function(b,c,e){f.text(h),f.prop("disabled",!1),"undefined"!=typeof b.success?(j.set(g,b.region,b.can_write),a(".as3cf-bucket-select-region").hide(),a(".as3cf-bucket-select-region").prop("selected",!1),d.val(""),f.prop("disabled",!0),n=!0):j.showError(as3cf.strings.create_bucket_error,b.error,"as3cf-bucket-create")}})},isValidName:function(a){return!(a.length<3||a.length>63)&&!0!==m.test(a)},updateNameNotice:function(b){var c=null;!0===m.test(b)?c=as3cf.strings.create_bucket_invalid_chars:b.length<3?c=as3cf.strings.create_bucket_name_short:b.length>63&&(c=as3cf.strings.create_bucket_name_long),c&&b.length>0?a(".as3cf-invalid-bucket-name").html(c):a(".as3cf-invalid-bucket-name").html("")}},a(document).ready(function(){j(),window.onhashchange=function(a){"function"==typeof history.replaceState&&"#"===location.href.slice(-1)&&history.replaceState({},"",location.href.slice(0,-1)),j()};var m=a(".wrap.aws-main .nav-tab-wrapper");a(".aws-compatibility-notice, div.updated, div.error, div.notice").not(".below-h2, .inline").insertAfter(m),o.length&&o.each(function(a,b){l[b.id]=c(b.id)}),a(window).on("beforeunload.as3cf-settings",function(){if(!a.isEmptyObject(l)){var b=k.attr("id");return c(b)!==l[b]?as3cf.strings.save_alert:void 0}}),a(document).on("submit",".as3cf-main-settings form",function(b){a(window).off("beforeunload.as3cf-settings")}),a(".as3cf-switch").on("click",function(b){a(this).hasClass("disabled")||d(a(this).attr("id"))}),o.on("change",".sub-toggle",function(b){var c=a(this).attr("id");a(".as3cf-setting."+c).toggleClass("hide")}),a(".as3cf-domain").on("change",'input[type="radio"]',function(b){var c=a(this).closest('input:radio[name="domain"]:checked'),d=c.val(),e=a(this).parents(".as3cf-domain").find(".as3cf-setting.cloudfront"),f="cloudfront"===d;e.toggleClass("hide",!f)}),a(".url-preview").on("change","input",function(a){g()}),h(),a("#as3cf-serve-from-s3,#as3cf-remove-local-file").on("change",function(a){h()}),i(),a("#as3cf-remove-local-file").on("change",function(a){i()}),a('.as3cf-setting input[type="text"]').keypress(function(a){if(13===a.which)return a.preventDefault(),!1}),a('input[name="cloudfront"]').on("keyup",function(b){e(a(this))}),a('input[name="domain"]').on("change",function(b){var c=a(this),d=a("#"+k.attr("id")+' form button[type="submit"]');"cloudfront"!==c.val()?d.prop("disabled",!1):e(c.next(".as3cf-setting").find('input[name="cloudfront"]'))}),a('input[name="object-prefix"]').on("change",function(a){f()}),a("#tab-media > .as3cf-bucket-error").detach().insertAfter(".as3cf-bucket-container h3"),a("body").on("click",".bucket-action-manual",function(c){c.preventDefault(),a(".as3cf-bucket-container."+b.prefix+" .as3cf-bucket-manual").show().siblings().hide()}),a("body").on("click",".bucket-action-browse",function(c){c.preventDefault(),a(".as3cf-bucket-container."+b.prefix+" .as3cf-bucket-select").show().siblings().hide(),as3cf.buckets.loadList(n),n=!1}),a("body").on("click",".bucket-action-create",function(c){c.preventDefault(),a(".as3cf-bucket-name").val(""),a(".as3cf-invalid-bucket-name").html(""),a(".as3cf-bucket-container."+b.prefix+" .as3cf-bucket-create").show().siblings().hide()}),a("body").on("click",".bucket-action-cancel",function(a){a.preventDefault(),as3cf.buckets.resetModal()}),a("body").on("click",".bucket-action-save",function(a){a.preventDefault(),as3cf.buckets.saveManual()}),a("body").on("click",'.as3cf-create-bucket-form button[type="submit"]',function(a){a.preventDefault(),as3cf.buckets.create()}),a("body").on("click",".bucket-action-refresh",function(a){a.preventDefault(),as3cf.buckets.loadList(!0)}),a("body").on("click",".as3cf-bucket-list a",function(b){b.preventDefault(),as3cf.buckets.saveSelected(a(this))}),a(".as3cf-bucket-container").on("click","a.js-link",function(b){return b.preventDefault(),window.open(a(this).attr("href")),!1}),a("body").on("as3cf-modal-open",function(c,d){if(".as3cf-bucket-container."+b.prefix===d){as3cf.buckets.resetModal();var e=a(".as3cf-bucket-manual h3").data("modal-title");a(".as3cf-bucket-manual h3").text(e),as3cf.buckets.disabledButtons()}}),as3cf.buckets.disabledButtons(),a("body").on("input keyup",".as3cf-create-bucket-form .as3cf-bucket-name",function(c){var d=a(this).val(),e=a(".as3cf-bucket-container."+b.prefix+" .as3cf-create-bucket-form");as3cf.buckets.isValidName(d)?e.find("button[type=submit]").prop("disabled",!1):e.find("button[type=submit]").prop("disabled",!0),as3cf.buckets.updateNameNotice(d)}),a("body").on("input keyup",".as3cf-manual-save-bucket-form .as3cf-bucket-name",function(c){var d=a(".as3cf-bucket-container."+b.prefix+" .as3cf-manual-save-bucket-form");d.find(".as3cf-bucket-name").val().length<as3cf.buckets.validLength?d.find("button[type=submit]").prop("disabled",!0):d.find("button[type=submit]").prop("disabled",!1)})})}(jQuery,as3cfModal);
1
+ !function(a,b){function c(b){return a("#"+b+" .as3cf-main-settings form").find("input:not(.no-compare)").serialize()}function d(a){var b=k.find("#"+a),c=b.find("input[type=checkbox]");b.toggleClass("on").find("span").toggleClass("checked");var d=b.find("span.on").hasClass("checked");c.prop("checked",d).trigger("change")}function e(b){var c=b.next(".as3cf-validation-error"),d=a("#"+k.attr("id")+' form button[type="submit"]'),e=/[^a-zA-Z0-9\.\-]/;e.test(b.val())?(c.show(),d.prop("disabled",!0)):(c.hide(),d.prop("disabled",!1))}function f(){var c=a("#"+b.prefix+"-bucket").val(),d=k.find('input[name="object-prefix"]'),e=d.val();""!==e&&(e="&prefix="+encodeURIComponent(e));var f=as3cf.aws_bucket_link+c+e;a("#"+b.prefix+"-view-bucket").attr("href",f)}function g(){a(".as3cf-url-preview").html("Generating...");var b={_nonce:as3cf.nonces.get_url_preview};a.each(a("#tab-"+as3cf.tabs.defaultTab+" .as3cf-main-settings form").serializeArray(),function(c,d){var e=d.name,f=d.value;e=e.replace("[]",""),b[e]=void 0===b[e]?f:a.isArray(b[e])?b[e].concat(f):[b[e],f]}),b.action="as3cf-get-url-preview",a.ajax({url:ajaxurl,type:"POST",dataType:"JSON",data:b,error:function(a,b,c){alert(as3cf.strings.get_url_preview_error+c)},success:function(b,c,d){"undefined"!=typeof b.success?a(".as3cf-url-preview").html(b.url):alert(as3cf.strings.get_url_preview_error+b.error)}})}function h(){a("#as3cf-remove-local-file").is(":checked")&&a("#as3cf-serve-from-s3").is(":not(:checked)")?a("#as3cf-lost-files-notice").show():a("#as3cf-lost-files-notice").hide()}function i(){a("#as3cf-remove-local-file").is(":checked")?a("#as3cf-remove-local-notice").show():a("#as3cf-remove-local-notice").hide()}function j(){return"#"+as3cf.tabs.defaultTab===location.hash?void(location.hash=""):(as3cf.tabs.toggle(location.hash.replace("#",""),!0),void a(document).trigger("as3cf.tabRendered",[location.hash.replace("#","")]))}var k,l={},m=/[^a-z0-9.-]/,n=!1,o=a("body"),p=a(".as3cf-tab"),q=a(".as3cf-settings");as3cf.tabs={defaultTab:"media",toggle:function(c,d){c=as3cf.tabs.sanitizeHash(c),p.hide(),k=a("#tab-"+c),k.show(),a(".nav-tab").removeClass("nav-tab-active"),a('a.nav-tab[data-tab="'+c+'"]').addClass("nav-tab-active"),a(".as3cf-main").data("tab",c),k.data("prefix")&&(b.prefix=k.data("prefix")),d||a(".as3cf-updated").removeClass("show"),"support"===c&&as3cf.tabs.getDiagnosticInfo()},getDiagnosticInfo:function(){var b=a(".debug-log-textarea");b.html(as3cf.strings.get_diagnostic_info);var c={action:"as3cf-get-diagnostic-info",_nonce:as3cf.nonces.get_diagnostic_info};a.ajax({url:ajaxurl,type:"POST",dataType:"JSON",data:c,error:function(a,c,d){b.html(d)},success:function(a,c,d){"undefined"!=typeof a.success?b.html(a.diagnostic_info):(b.html(as3cf.strings.get_diagnostic_info_error),b.append(a.error))}})},sanitizeHash:function(b){var c=a("#tab-"+b);return 0===c.length&&(b=as3cf.tabs.defaultTab),b}},as3cf.buckets={validLength:3,bucketSelectLock:!1,loadList:function(c){"undefined"==typeof c&&(c=!1);var d=a(".as3cf-bucket-container."+b.prefix+" .as3cf-bucket-list"),e=a("#"+b.prefix+"-bucket").val();if(!1===c&&d.find("li").length>1)return a(".as3cf-bucket-list a").removeClass("selected"),a('.as3cf-bucket-list a[data-bucket="'+e+'"]').addClass("selected"),void this.scrollToSelected();d.html('<li class="loading">'+d.data("working")+"</li>");var f={action:b.prefix+"-get-buckets",_nonce:window[b.prefix.replace(/-/g,"_")].nonces.get_buckets},g=this;a.ajax({url:ajaxurl,type:"POST",dataType:"JSON",data:f,error:function(a,b,c){d.html(""),g.showError(as3cf.strings.get_buckets_error,c,"as3cf-bucket-select")},success:function(b,c,f){d.html(""),"undefined"!=typeof b.success?(a(".as3cf-bucket-error").hide(),a(b.buckets).each(function(a,b){var c=b.Name===e?"selected":"";d.append('<li><a class="'+c+'" href="#" data-bucket="'+b.Name+'"><span class="bucket"><span class="dashicons dashicons-portfolio"></span> '+b.Name+'</span><span class="spinner"></span></span></a></li>')}),g.scrollToSelected()):g.showError(as3cf.strings.get_buckets_error,b.error,"as3cf-bucket-select")}})},scrollToSelected:function(){if(a(".as3cf-bucket-list a.selected").length){var b=a("ul.as3cf-bucket-list li").first().position().top+150;a(".as3cf-bucket-list").animate({scrollTop:a("ul.as3cf-bucket-list li a.selected").position().top-b})}},resetModal:function(){var c=a(".as3cf-bucket-container."+b.prefix);!1===k.hasClass("as3cf-has-bucket")||"manual"===a("#"+b.prefix+"-bucket-select").val()?(c.find(".as3cf-bucket-manual").show().siblings().hide(),c.find(".bucket-actions.manual").show().siblings(".bucket-actions").hide()):(c.find(".as3cf-bucket-select").show().siblings().hide(),c.find(".bucket-actions.select").show().siblings(".bucket-actions").hide(),this.loadList(n),n=!1),c.find(".as3cf-bucket-error").hide();var d=a("#"+b.prefix+"-bucket").val();c.find(".as3cf-bucket-manual .as3cf-bucket-name").val(d),this.bucketSelectLock=!1},saveManual:function(){var c=a(".as3cf-bucket-container."+b.prefix+" .as3cf-manual-save-bucket-form"),d=c.find(".as3cf-bucket-name"),e=c.find("button[type=submit]"),f=d.val(),g=e.first().text();if(f===a("#"+b.prefix+"-active-bucket").text())return a(".as3cf-bucket-error").hide(),k.addClass("as3cf-has-bucket"),void b.close();a(".as3cf-bucket-error").hide(),e.text(e.data("working")),e.prop("disabled",!0);var h={action:b.prefix+"-manual-save-bucket",bucket_name:f,_nonce:window[b.prefix.replace(/-/g,"_")].nonces.manual_bucket},i=this;a.ajax({url:ajaxurl,type:"POST",dataType:"JSON",data:h,error:function(a,b,c){e.text(g),i.showError(as3cf.strings.save_bucket_error,c,"as3cf-bucket-manual")},success:function(c,d,h){e.text(g),e.prop("disabled",!1),"undefined"!=typeof c.success?(i.set(f,c.region,c.can_write),a("#"+b.prefix+"-bucket-select").val("manual"),a(".as3cf-bucket-list a").removeClass("selected").filter('[data-bucket="'+f+'"]').addClass("selected"),n=!0,as3cf.showSettingsSavedNotice()):i.showError(as3cf.strings.save_bucket_error,c.error,"as3cf-bucket-manual")}})},saveSelected:function(c){var d=a(".as3cf-bucket-list");if(!this.bucketSelectLock){if(this.bucketSelectLock=!0,c.hasClass("selected"))return k.addClass("as3cf-has-bucket"),void b.close();var e=a(".as3cf-bucket-list a.selected").data("bucket");a(".as3cf-bucket-list a").removeClass("selected"),c.addClass("selected"),d.addClass("saving"),c.find(".spinner").show().css("visibility","visible");var f=c.data("bucket"),g={action:b.prefix+"-save-bucket",bucket_name:f,_nonce:window[b.prefix.replace(/-/g,"_")].nonces.save_bucket},h=this;a.ajax({url:ajaxurl,type:"POST",dataType:"JSON",data:g,error:function(b,c,f){d.removeClass("saving"),h.showError(as3cf.strings.save_bucket_error,f,"as3cf-bucket-select"),a(".as3cf-bucket-list a").removeClass("selected"),a('.as3cf-bucket-list a[data-bucket="'+e+'"]').addClass("selected")},success:function(g,i,j){c.find(".spinner").hide().css("visibility","hidden"),d.removeClass("saving"),"undefined"!=typeof g.success?(h.set(f,g.region,g.can_write),a("#"+b.prefix+"-bucket-select").val(""),as3cf.showSettingsSavedNotice()):(h.showError(as3cf.strings.save_bucket_error,g.error,"as3cf-bucket-select"),a(".as3cf-bucket-list a").removeClass("selected"),a('.as3cf-bucket-list a[data-bucket="'+e+'"]').addClass("selected"))}})}},disabledButtons:function(){if(0!==a(".as3cf-bucket-container."+b.prefix+" .as3cf-create-bucket-form").length){var c=a(".as3cf-bucket-container."+b.prefix+" .as3cf-create-bucket-form"),d=a(".as3cf-bucket-container."+b.prefix+" .as3cf-manual-save-bucket-form");c.find(".as3cf-bucket-name").val().length<3?c.find("button[type=submit]").prop("disabled",!0):c.find("button[type=submit]").prop("disabled",!1),d.find(".as3cf-bucket-name").val().length<3?d.find("button[type=submit]").prop("disabled",!0):d.find("button[type=submit]").prop("disabled",!1)}},showError:function(b,c,d){var e=a(".as3cf-bucket-container").children(":visible"),f=e.find(".as3cf-bucket-error");d="undefined"==typeof d?null:d,d&&!e.hasClass(d)||(f.find("span.title").html(b+" &mdash;"),f.find("span.message").html(c),f.show(),this.bucketSelectLock=!1)},set:function(e,h,i){var j=a(".as3cf-bucket-container."+b.prefix+" .as3cf-manual-save-bucket-form"),m=a("#"+b.prefix+"-active-bucket");if("as3cf"===b.prefix&&0===m.text().trim().length){d("as3cf-copy-to-s3-wrap"),d("as3cf-serve-from-s3-wrap");var n=k.attr("id");l[n]=c(n)}a(".as3cf-error.fatal").hide(),m.text(e),j.find(".as3cf-bucket-name").val(e),a("#"+b.prefix+"-bucket").val(e),a("#"+b.prefix+"-region").val(h),a(".updated").not(".as3cf-notice").show(),k.addClass("as3cf-has-bucket"),k.find(".as3cf-can-write-error").toggle(!i),k.find(".as3cf-bucket-error").hide(),"as3cf"===b.prefix&&g(),f(),b.close(function(){k.trigger("bucket-change",[i]),as3cf.buckets.bucketSelectLock=!1})},create:function(){var c=a(".as3cf-bucket-container."+b.prefix+" .as3cf-create-bucket-form"),d=c.find(".as3cf-bucket-name"),e=c.find(".bucket-create-region"),f=c.find("button[type=submit]"),g=d.val(),h=f.text();a(".as3cf-bucket-error").hide(),f.text(f.data("working")),f.prop("disabled",!0);var i={action:b.prefix+"-create-bucket",bucket_name:g,_nonce:window[b.prefix.replace(/-/g,"_")].nonces.create_bucket};e.val()&&(i.region=e.val());var j=this;a.ajax({url:ajaxurl,type:"POST",dataType:"JSON",data:i,error:function(a,b,c){f.text(h),j.showError(as3cf.strings.create_bucket_error,c,"as3cf-bucket-create")},success:function(b,c,e){f.text(h),f.prop("disabled",!1),"undefined"!=typeof b.success?(j.set(g,b.region,b.can_write),a(".as3cf-bucket-select-region").hide(),a(".as3cf-bucket-select-region").prop("selected",!1),d.val(""),f.prop("disabled",!0),n=!0,as3cf.showSettingsSavedNotice()):j.showError(as3cf.strings.create_bucket_error,b.error,"as3cf-bucket-create")}})},isValidName:function(a){return!(a.length<3||a.length>63)&&!0!==m.test(a)},updateNameNotice:function(b){var c=null;!0===m.test(b)?c=as3cf.strings.create_bucket_invalid_chars:b.length<3?c=as3cf.strings.create_bucket_name_short:b.length>63&&(c=as3cf.strings.create_bucket_name_long),c&&b.length>0?a(".as3cf-invalid-bucket-name").html(c):a(".as3cf-invalid-bucket-name").html("")}},as3cf.reloadUpdated=function(){var a=location.pathname+location.search;location.search.match(/[?&]updated=/)||(a+="&updated=1"),a+=location.hash,location.assign(a)},as3cf.showSettingsSavedNotice=function(){if(!(0<a("#setting-error-settings_updated:visible").length||0<a("#as3cf-settings_updated:visible").length)){var b='<div id="as3cf-settings_updated" class="updated settings-error notice is-dismissible"><p><strong>'+as3cf.strings.settings_saved+"</strong></p></div>";a("h2.nav-tab-wrapper").after(b),a(document).trigger("wp-updates-notice-added")}};var r=function(){this.$key=q.find('input[name="aws-access-key-id"]'),this.$secret=q.find('input[name="aws-secret-access-key"]'),this.$spinner=q.find("[data-as3cf-aws-keys-spinner]"),this.$feedback=q.find("[data-as3cf-aws-keys-feedback]")};r.prototype.set=function(){this.sendRequest("set",{"aws-access-key-id":this.$key.val(),"aws-secret-access-key":this.$secret.val()}).done(function(a){a.success&&this.$secret.val(as3cf.strings.not_shown_placeholder)}.bind(this))},r.prototype.remove=function(){this.sendRequest("remove").done(function(a){a.success&&(this.$key.val(""),this.$secret.val(""))}.bind(this))},r.prototype.sendRequest=function(b,c){var d={action:"as3cf-aws-keys-"+b,_ajax_nonce:as3cf.nonces["aws_keys_"+b]};return _.isObject(c)&&(d=_.extend(d,c)),this.$spinner.addClass("is-active"),a.post(ajaxurl,d).done(function(a){this.$feedback.toggleClass("notice-success",a.success).toggleClass("notice-error",!a.success),a.data&&a.data.message&&this.$feedback.html("<p>"+a.data.message+"</p>").show(),a.success&&as3cf.reloadUpdated()}.bind(this)).always(function(){this.$spinner.removeClass("is-active")}.bind(this))},a(document).ready(function(){j(),window.onhashchange=function(a){"function"==typeof history.replaceState&&"#"===location.href.slice(-1)&&history.replaceState({},"",location.href.slice(0,-1)),j()};var m=a(".as3cf-main .nav-tab-wrapper");a(".as3cf-compatibility-notice, div.updated, div.error, div.notice").not(".below-h2, .inline").insertAfter(m),p.length&&p.each(function(a,b){l[b.id]=c(b.id)}),a(window).on("beforeunload.as3cf-settings",function(){if(!a.isEmptyObject(l)){var b=k.attr("id");return c(b)!==l[b]?as3cf.strings.save_alert:void 0}}),a(document).on("submit",".as3cf-main-settings form",function(b){a(window).off("beforeunload.as3cf-settings")}),a(".as3cf-switch").on("click",function(b){a(this).hasClass("disabled")||d(a(this).attr("id"))}),p.on("change",".sub-toggle",function(b){var c=a(this).attr("id");a(".as3cf-setting."+c).toggleClass("hide")}),a(".as3cf-domain").on("change",'input[type="radio"]',function(b){var c=a(this).closest('input:radio[name="domain"]:checked'),d=c.val(),e=a(this).parents(".as3cf-domain").find(".as3cf-setting.cloudfront"),f="cloudfront"===d;e.toggleClass("hide",!f)}),a(".url-preview").on("change","input",function(a){g()}),h(),a("#as3cf-serve-from-s3,#as3cf-remove-local-file").on("change",function(a){h()}),i(),a("#as3cf-remove-local-file").on("change",function(a){i()}),a('.as3cf-setting input[type="text"]').keypress(function(a){if(13===a.which)return a.preventDefault(),!1}),a('input[name="cloudfront"]').on("keyup",function(b){e(a(this))}),a('input[name="domain"]').on("change",function(b){var c=a(this),d=a("#"+k.attr("id")+' form button[type="submit"]');"cloudfront"!==c.val()?d.prop("disabled",!1):e(c.next(".as3cf-setting").find('input[name="cloudfront"]'))}),a('input[name="object-prefix"]').on("change",function(a){f()}),a("#tab-media > .as3cf-bucket-error").detach().insertAfter(".as3cf-bucket-container h3"),o.on("click",".bucket-action-manual",function(c){c.preventDefault(),a(".as3cf-bucket-container."+b.prefix+" .as3cf-bucket-manual").show().siblings().hide()}),o.on("click",".bucket-action-browse",function(c){c.preventDefault(),a(".as3cf-bucket-container."+b.prefix+" .as3cf-bucket-select").show().siblings().hide(),as3cf.buckets.loadList(n),n=!1}),o.on("click",".bucket-action-create",function(c){c.preventDefault(),a(".as3cf-bucket-name").val(""),a(".as3cf-invalid-bucket-name").html(""),a(".as3cf-bucket-container."+b.prefix+" .as3cf-bucket-create").show().siblings().hide()}),o.on("click",".bucket-action-cancel",function(a){a.preventDefault(),as3cf.buckets.resetModal()}),o.on("click",".bucket-action-save",function(a){a.preventDefault(),as3cf.buckets.saveManual()}),o.on("click",'.as3cf-create-bucket-form button[type="submit"]',function(a){a.preventDefault(),as3cf.buckets.create()}),o.on("click",".bucket-action-refresh",function(a){a.preventDefault(),as3cf.buckets.loadList(!0)}),o.on("click",".as3cf-bucket-list a",function(b){b.preventDefault(),as3cf.buckets.saveSelected(a(this))}),a(".as3cf-bucket-container").on("click","a.js-link",function(b){return b.preventDefault(),window.open(a(this).attr("href")),!1}),o.on("as3cf-modal-open",function(c,d){if(".as3cf-bucket-container."+b.prefix===d){as3cf.buckets.resetModal();var e=a(".as3cf-bucket-manual h3").data("modal-title");a(".as3cf-bucket-manual h3").text(e),as3cf.buckets.disabledButtons()}}),as3cf.buckets.disabledButtons(),o.on("input keyup",".as3cf-create-bucket-form .as3cf-bucket-name",function(c){var d=a(this).val(),e=a(".as3cf-bucket-container."+b.prefix+" .as3cf-create-bucket-form");as3cf.buckets.isValidName(d)?e.find("button[type=submit]").prop("disabled",!1):e.find("button[type=submit]").prop("disabled",!0),as3cf.buckets.updateNameNotice(d)}),o.on("input keyup",".as3cf-manual-save-bucket-form .as3cf-bucket-name",function(c){var d=a(".as3cf-bucket-container."+b.prefix+" .as3cf-manual-save-bucket-form");d.find(".as3cf-bucket-name").val().length<as3cf.buckets.validLength?d.find("button[type=submit]").prop("disabled",!0):d.find("button[type=submit]").prop("disabled",!1)}),q.on("click","[data-as3cf-toggle-access-keys-form]",function(b){b.preventDefault(),a("#as3cf_access_keys").toggle()}).on("click","[data-as3cf-aws-keys-action]",function(b){b.preventDefault();var c=a(this).data("as3cfAwsKeysAction"),d=new r;"function"==typeof d[c]&&d[c]()})})}(jQuery,as3cfModal);
assets/sass/notice.scss CHANGED
@@ -2,7 +2,7 @@
2
  * Common as3cf-notice styles.
3
  */
4
  .as3cf-notice,
5
- .aws-compatibility-notice {
6
  p {
7
  max-width: 800px;
8
  }
@@ -14,3 +14,7 @@
14
  .as3cf-license-notice p:not(.as3cf-before):before {
15
  display: none;
16
  }
 
 
 
 
2
  * Common as3cf-notice styles.
3
  */
4
  .as3cf-notice,
5
+ .as3cf-compatibility-notice {
6
  p {
7
  max-width: 800px;
8
  }
14
  .as3cf-license-notice p:not(.as3cf-before):before {
15
  display: none;
16
  }
17
+
18
+ .as3cf-notice-warning {
19
+ border-left-color: #ffba00;
20
+ }
assets/sass/styles.scss CHANGED
@@ -1,7 +1,23 @@
1
- /**
2
- * AWS wrap
3
- */
4
- .aws-main.wrap {
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
5
  position: relative;
6
 
7
  & > h1 {
@@ -9,8 +25,6 @@
9
  }
10
 
11
  .as3cf-notice, .as3cf-updated, .as3cf-error {
12
- -webkit-box-sizing: border-box;
13
- -moz-box-sizing: border-box;
14
  box-sizing: border-box;
15
  }
16
 
@@ -25,13 +39,20 @@
25
  margin-top: 10px;
26
  padding: 9px 0 0 5px;
27
 
 
 
 
 
 
 
 
 
28
  a.nav-tab-active {
29
  color: #464646;
30
  cursor: default;
31
  }
32
 
33
  a:focus {
34
- -webkit-box-shadow: none;
35
  box-shadow: none;
36
  }
37
  }
@@ -65,8 +86,6 @@
65
  .as3cf-notice, .error, .updated {
66
  max-width: 650px;
67
  margin-top: 15px;
68
- -webkit-box-sizing: border-box;
69
- -moz-box-sizing: border-box;
70
  box-sizing: border-box;
71
  }
72
 
@@ -76,6 +95,15 @@
76
  display: block;
77
  }
78
  }
 
 
 
 
 
 
 
 
 
79
  }
80
 
81
  /**
@@ -101,6 +129,21 @@
101
  }
102
  }
103
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
104
  /**
105
  * Settings
106
  */
@@ -130,8 +173,6 @@
130
  padding: 20px 0 0;
131
  max-width: 650px;
132
  width: 100%;
133
- -webkit-box-sizing: border-box;
134
- -moz-box-sizing: border-box;
135
  box-sizing: border-box;
136
 
137
  .as3cf-url-preview {
@@ -173,7 +214,6 @@
173
  padding: 2px;
174
  overflow: hidden;
175
  border-radius: 2px;
176
- -webkit-border-radius: 2px;
177
  background-color: #d4d3d3;
178
  cursor: pointer;
179
 
@@ -183,8 +223,6 @@
183
 
184
  span {
185
  visibility: hidden;
186
- -webkit-box-sizing: border-box;
187
- -moz-box-sizing: border-box;
188
  box-sizing: border-box;
189
  float: left;
190
  display: inline-block;
@@ -192,7 +230,6 @@
192
  font-size: 12px;
193
  line-height: 20px;
194
  border-radius: 2px;
195
- -webkit-border-radius: 2px;
196
  font-weight: bold;
197
  padding: 4px 8px;
198
  background: #fff;
@@ -241,7 +278,6 @@
241
  h3 {
242
  font-weight: normal;
243
  text-transform: uppercase;
244
- margin: 15px 0;
245
  }
246
 
247
  .form-table {
@@ -273,12 +309,6 @@
273
  margin-top: 0;
274
  }
275
  }
276
-
277
- &:first-of-type {
278
- td {
279
- padding-top: 5px;
280
- }
281
- }
282
  }
283
 
284
  tr.as3cf-bucket-setting .as3cf-defined-in-config {
@@ -338,8 +368,6 @@
338
  margin-left: -250px;
339
  padding: 10px;
340
  width: 500px;
341
- -webkit-border-radius: 3px;
342
- -moz-border-radius: 3px;
343
  border-radius: 3px;
344
  background-color: #000;
345
  background-color: hsla(0, 0%, 20%, 0.9);
@@ -381,6 +409,7 @@
381
  padding: 2px 5px;
382
  margin: 0 0 5px 5px;
383
  float: right;
 
384
  }
385
 
386
  .as3cf-defined-setting {
@@ -414,6 +443,10 @@
414
  display: none;
415
  }
416
 
 
 
 
 
417
  .as3cf-bucket-container {
418
  display: block;
419
  }
@@ -439,7 +472,6 @@
439
  }
440
 
441
  a:focus {
442
- -webkit-box-shadow: none;
443
  box-shadow: none;
444
  outline: none;
445
  }
@@ -535,14 +567,47 @@
535
  }
536
  }
537
 
538
- .as3cf-tab {
539
- display: none;
540
- }
541
-
542
  #tab-media {
543
  display: block;
544
  }
545
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
546
  #tab-support {
547
  min-height: 900px;
548
  .as3cf-sidebar {
@@ -553,6 +618,10 @@
553
  border-bottom: 1px solid #ccc;
554
  padding-bottom: 20px;
555
  margin-bottom: 20px;
 
 
 
 
556
  }
557
 
558
  .debug {
@@ -750,7 +819,7 @@
750
  }
751
  }
752
 
753
- .aws-compatibility-notice.error {
754
  clear: both;
755
  margin: 5px 20px 5px 0;
756
  }
@@ -780,3 +849,109 @@
780
  color: #dc3232;
781
  }
782
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ $aws_orange: #f7a80d;
2
+ $as3cf_assets: #0769ad;
3
+
4
+ .as3cf-content,
5
+ .as3cf-updated,
6
+ .as3cf-compatibility-notice {
7
+ box-sizing: border-box;
8
+ max-width: 650px;
9
+ }
10
+
11
+ .settings_page_amazon-s3-and-cloudfront {
12
+ .error,
13
+ .notice,
14
+ .updated {
15
+ box-sizing: border-box;
16
+ max-width: 650px;
17
+ }
18
+ }
19
+
20
+ .as3cf-main.wrap {
21
  position: relative;
22
 
23
  & > h1 {
25
  }
26
 
27
  .as3cf-notice, .as3cf-updated, .as3cf-error {
 
 
28
  box-sizing: border-box;
29
  }
30
 
39
  margin-top: 10px;
40
  padding: 9px 0 0 5px;
41
 
42
+ .nav-tab-container {
43
+ float: right;
44
+
45
+ :last-child {
46
+ margin-right: 5px;
47
+ }
48
+ }
49
+
50
  a.nav-tab-active {
51
  color: #464646;
52
  cursor: default;
53
  }
54
 
55
  a:focus {
 
56
  box-shadow: none;
57
  }
58
  }
86
  .as3cf-notice, .error, .updated {
87
  max-width: 650px;
88
  margin-top: 15px;
 
 
89
  box-sizing: border-box;
90
  }
91
 
95
  display: block;
96
  }
97
  }
98
+
99
+ .alignleft {
100
+ margin-right: 20px;
101
+ margin-bottom: 20px;
102
+ }
103
+
104
+ .spinner {
105
+ min-width: 20px;
106
+ }
107
  }
108
 
109
  /**
129
  }
130
  }
131
 
132
+ .as3cf-content {
133
+ > section {
134
+ margin-bottom: 20px;
135
+ }
136
+
137
+ > section + section.as3cf-access-keys {
138
+ padding-top: 20px;
139
+ border-top: 1px solid #d3d3d3;
140
+
141
+ .as3cf-section-heading {
142
+ margin-top: 0;
143
+ }
144
+ }
145
+ }
146
+
147
  /**
148
  * Settings
149
  */
173
  padding: 20px 0 0;
174
  max-width: 650px;
175
  width: 100%;
 
 
176
  box-sizing: border-box;
177
 
178
  .as3cf-url-preview {
214
  padding: 2px;
215
  overflow: hidden;
216
  border-radius: 2px;
 
217
  background-color: #d4d3d3;
218
  cursor: pointer;
219
 
223
 
224
  span {
225
  visibility: hidden;
 
 
226
  box-sizing: border-box;
227
  float: left;
228
  display: inline-block;
230
  font-size: 12px;
231
  line-height: 20px;
232
  border-radius: 2px;
 
233
  font-weight: bold;
234
  padding: 4px 8px;
235
  background: #fff;
278
  h3 {
279
  font-weight: normal;
280
  text-transform: uppercase;
 
281
  }
282
 
283
  .form-table {
309
  margin-top: 0;
310
  }
311
  }
 
 
 
 
 
 
312
  }
313
 
314
  tr.as3cf-bucket-setting .as3cf-defined-in-config {
368
  margin-left: -250px;
369
  padding: 10px;
370
  width: 500px;
 
 
371
  border-radius: 3px;
372
  background-color: #000;
373
  background-color: hsla(0, 0%, 20%, 0.9);
409
  padding: 2px 5px;
410
  margin: 0 0 5px 5px;
411
  float: right;
412
+ white-space: nowrap;
413
  }
414
 
415
  .as3cf-defined-setting {
443
  display: none;
444
  }
445
 
446
+ .as3cf-bucket-setting td {
447
+ padding-top: 5px;
448
+ }
449
+
450
  .as3cf-bucket-container {
451
  display: block;
452
  }
472
  }
473
 
474
  a:focus {
 
475
  box-shadow: none;
476
  outline: none;
477
  }
567
  }
568
  }
569
 
 
 
 
 
570
  #tab-media {
571
  display: block;
572
  }
573
 
574
+ #tab-settings {
575
+ .as3cf-field-wrap {
576
+ display: flex;
577
+ align-items: center;
578
+
579
+ input {
580
+ width: 100%;
581
+ }
582
+
583
+ button, .as3cf-defined-in-config {
584
+ margin-left: 20px;
585
+ }
586
+
587
+ .as3cf-defined-in-config {
588
+ display: none;
589
+ margin-bottom: 0;
590
+ }
591
+
592
+ &.as3cf-defined {
593
+ button {
594
+ display: none;
595
+ }
596
+ .as3cf-defined-in-config {
597
+ display: inline-block;
598
+ }
599
+ }
600
+
601
+ &.as3cf-saved-field .as3cf-activate-licence {
602
+ display: none;
603
+ }
604
+
605
+ &.as3cf-licence-not-entered .as3cf-remove-licence {
606
+ display: none;
607
+ }
608
+ }
609
+ }
610
+
611
  #tab-support {
612
  min-height: 900px;
613
  .as3cf-sidebar {
618
  border-bottom: 1px solid #ccc;
619
  padding-bottom: 20px;
620
  margin-bottom: 20px;
621
+
622
+ h3 {
623
+ font-size: 20px;
624
+ }
625
  }
626
 
627
  .debug {
819
  }
820
  }
821
 
822
+ .as3cf-compatibility-notice.error {
823
  clear: both;
824
  margin: 5px 20px 5px 0;
825
  }
849
  color: #dc3232;
850
  }
851
  }
852
+
853
+ .as3cf-need-help {
854
+ background-color: white;
855
+ font-size: 16px;
856
+ font-weight: bold;
857
+ padding: 1em;
858
+
859
+ a {
860
+ text-decoration: none;
861
+ }
862
+ }
863
+
864
+ .as3cf-aws-logo {
865
+ color: white;
866
+ background-color: $aws_orange;
867
+ padding: 1em;
868
+ }
869
+
870
+ .as3cf-settings {
871
+ h3 {
872
+ font-size: 20px;
873
+ }
874
+
875
+ p {
876
+ font-size: 14px;
877
+ }
878
+ }
879
+
880
+ .as3cf-addons,
881
+ .as3cf-tab .as3cf-compatibility-notice {
882
+ max-width: cover;
883
+ }
884
+
885
+ textarea.as3cf-access-key-constants-snippet.code {
886
+ width: 100%;
887
+ white-space: pre;
888
+ overflow: hidden;
889
+ font-size: 12px;
890
+ padding: 10px;
891
+ height: 53px;
892
+ }
893
+
894
+ /**
895
+ * Addons Tab
896
+ */
897
+ .as3cf-addons {
898
+ .as3cf-addons-list {
899
+ margin: 20px 0 200px;
900
+ padding-top: 5px;
901
+ }
902
+
903
+ .as3cf-addon {
904
+ display: flex;
905
+ padding: 20px;
906
+ font-size: 14px;
907
+
908
+ &-info {
909
+ min-height: 100px;
910
+ }
911
+
912
+ &-links {
913
+ float: right;
914
+
915
+ span {
916
+ padding: 4px 6px;
917
+ }
918
+ }
919
+
920
+ &-icon {
921
+ float: left;
922
+ margin-right: 20px;
923
+ }
924
+
925
+ &-details {
926
+ white-space: nowrap;
927
+ }
928
+
929
+ &-title,
930
+ &-description {
931
+ font-weight: 100;
932
+ }
933
+
934
+ + .as3cf-addon {
935
+ margin-top: 20px;
936
+ }
937
+
938
+ &.amazon-s3-and-cloudfront-assets-pull {
939
+ background-color: $as3cf_assets;
940
+ color: white;
941
+
942
+ .as3cf-addon-title,
943
+ .as3cf-addon-description,
944
+ a {
945
+ color: white;
946
+ }
947
+
948
+ .extra {
949
+ background: white;
950
+ a {
951
+ color: $as3cf_assets;
952
+ text-decoration: none;
953
+ }
954
+ }
955
+ }
956
+ }
957
+ }
classes/amazon-s3-and-cloudfront.php CHANGED
@@ -1,6 +1,8 @@
1
  <?php
2
 
 
3
  use DeliciousBrains\WP_Offload_S3\Null_S3_Client;
 
4
  use DeliciousBrains\WP_Offload_S3\Upgrades\Upgrade_Content_Replace_URLs;
5
  use DeliciousBrains\WP_Offload_S3\Upgrades\Upgrade_EDD_Replace_URLs;
6
  use DeliciousBrains\WP_Offload_S3\Upgrades\Upgrade_File_Sizes;
@@ -8,7 +10,7 @@ use DeliciousBrains\WP_Offload_S3\Upgrades\Upgrade_Filter_Post_Excerpt;
8
  use DeliciousBrains\WP_Offload_S3\Upgrades\Upgrade_Meta_WP_Error;
9
  use DeliciousBrains\WP_Offload_S3\Upgrades\Upgrade_Region_Meta;
10
 
11
- class Amazon_S3_And_CloudFront extends AWS_Plugin_Base {
12
 
13
  /**
14
  * @var Amazon_Web_Services
@@ -16,10 +18,15 @@ class Amazon_S3_And_CloudFront extends AWS_Plugin_Base {
16
  private $aws;
17
 
18
  /**
19
- * @var Aws\S3\S3Client
20
  */
21
  private $s3client;
22
 
 
 
 
 
 
23
  /**
24
  * @var array
25
  */
@@ -40,21 +47,11 @@ class Amazon_S3_And_CloudFront extends AWS_Plugin_Base {
40
  */
41
  protected static $admin_notices = array();
42
 
43
- /**
44
- * @var
45
- */
46
- protected static $plugin_page;
47
-
48
  /**
49
  * @var string
50
  */
51
  protected $plugin_prefix = 'as3cf';
52
 
53
- /**
54
- * @var string
55
- */
56
- protected $default_tab = '';
57
-
58
  /**
59
  * @var AS3CF_Local_To_S3
60
  */
@@ -98,16 +95,20 @@ class Amazon_S3_And_CloudFront extends AWS_Plugin_Base {
98
  const LATEST_UPGRADE_ROUTINE = 6;
99
 
100
  /**
101
- * @param string $plugin_file_path
102
- * @param Amazon_Web_Services $aws
103
- * @param string|null $slug
104
  */
105
- function __construct( $plugin_file_path, $aws, $slug = null ) {
106
  $this->plugin_slug = ( is_null( $slug ) ) ? 'amazon-s3-and-cloudfront' : $slug;
107
 
108
  parent::__construct( $plugin_file_path );
109
 
110
- $this->aws = $aws;
 
 
 
 
111
  $this->notices = AS3CF_Notices::get_instance( $this );
112
 
113
  $this->init( $plugin_file_path );
@@ -119,9 +120,11 @@ class Amazon_S3_And_CloudFront extends AWS_Plugin_Base {
119
  * @param string $plugin_file_path
120
  */
121
  function init( $plugin_file_path ) {
122
- self::$plugin_page = $this->plugin_slug;
123
- $this->plugin_title = __( 'Offload S3 Lite', 'amazon-s3-and-cloudfront' );
124
- $this->plugin_menu_title = __( 'S3 and CloudFront', 'amazon-s3-and-cloudfront' );
 
 
125
 
126
  new Upgrade_Region_Meta( $this );
127
  new Upgrade_File_Sizes( $this );
@@ -131,11 +134,15 @@ class Amazon_S3_And_CloudFront extends AWS_Plugin_Base {
131
  new Upgrade_Filter_Post_Excerpt( $this );
132
 
133
  // Plugin setup
134
- add_action( 'aws_admin_menu', array( $this, 'admin_menu' ) );
 
 
135
  add_filter( 'plugin_action_links', array( $this, 'plugin_actions_settings_link' ), 10, 2 );
136
- add_filter( 'pre_get_space_used', array( $this, 'multisite_get_spaced_used' ) );
 
137
  // display a notice when either lite or pro is automatically deactivated
138
  add_action( 'pre_current_active_plugins', array( $this, 'plugin_deactivated_notice' ) );
 
139
 
140
  // Attachment screens/modals
141
  add_action( 'load-upload.php', array( $this, 'load_media_assets' ), 11 );
@@ -150,6 +157,8 @@ class Amazon_S3_And_CloudFront extends AWS_Plugin_Base {
150
  add_action( 'wp_ajax_as3cf-get-url-preview', array( $this, 'ajax_get_url_preview' ) );
151
  add_action( 'wp_ajax_as3cf_get_attachment_s3_details', array( $this, 'ajax_get_attachment_s3_details' ) );
152
  add_action( 'wp_ajax_as3cf-get-diagnostic-info', array( $this, 'ajax_get_diagnostic_info' ) );
 
 
153
 
154
  // Rewriting URLs, doesn't depend on plugin being setup
155
  add_filter( 'wp_get_attachment_url', array( $this, 'wp_get_attachment_url' ), 99, 2 );
@@ -184,6 +193,13 @@ class Amazon_S3_And_CloudFront extends AWS_Plugin_Base {
184
  $this->register_modal_assets();
185
  }
186
 
 
 
 
 
 
 
 
187
  /**
188
  * Get the plugin title to be used in page headings
189
  *
@@ -252,6 +268,7 @@ class Amazon_S3_And_CloudFront extends AWS_Plugin_Base {
252
  function get_setting( $key, $default = '' ) {
253
  // use settings from $_POST when generating URL preview via AJAX
254
  if ( isset( $_POST['action'] ) && 'as3cf-get-url-preview' == sanitize_key( $_POST['action'] ) ) { // input var okay
 
255
  $value = 0;
256
  if ( isset( $_POST[ $key ] ) ) { // input var okay
257
  $value = $_POST[ $key ]; // input var okay
@@ -752,6 +769,80 @@ class Amazon_S3_And_CloudFront extends AWS_Plugin_Base {
752
  $this->end_ajax( $out );
753
  }
754
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
755
  /**
756
  * Delete bulk objects from an S3 bucket
757
  *
@@ -828,7 +919,7 @@ class Amazon_S3_And_CloudFront extends AWS_Plugin_Base {
828
  * to cope with possible different regions
829
  */
830
  function delete_attachment( $post_id, $force_new_s3_client = false ) {
831
- if ( ! $this->is_plugin_setup() ) {
832
  return;
833
  }
834
 
@@ -851,7 +942,7 @@ class Amazon_S3_And_CloudFront extends AWS_Plugin_Base {
851
  * @return array
852
  */
853
  function wp_update_attachment_metadata( $data, $post_id ) {
854
- if ( ! $this->is_plugin_setup() ) {
855
  return $data;
856
  }
857
 
@@ -947,9 +1038,7 @@ class Amazon_S3_And_CloudFront extends AWS_Plugin_Base {
947
  // use existing bucket
948
  $bucket = $old_s3object['bucket'];
949
  // get existing region
950
- if ( isset( $old_s3object['region'] ) ) {
951
- $region = $old_s3object['region'];
952
- };
953
  } else {
954
  // derive prefix from various settings
955
  if ( isset( $data['file'] ) ) {
@@ -972,19 +1061,6 @@ class Amazon_S3_And_CloudFront extends AWS_Plugin_Base {
972
  $acl = apply_filters( 'wps3_upload_acl', $acl, $type, $data, $post_id, $this ); // Old naming convention, will be deprecated soon
973
  $acl = apply_filters( 'as3cf_upload_acl', $acl, $data, $post_id );
974
 
975
- $s3object = array(
976
- 'bucket' => $bucket,
977
- 'key' => $prefix . $file_name,
978
- 'region' => $region,
979
- );
980
-
981
- // store acl if not default
982
- if ( $acl != self::DEFAULT_ACL ) {
983
- $s3object['acl'] = $acl;
984
- }
985
-
986
- $s3client = $this->get_s3client( $region, $force_new_s3_client );
987
-
988
  $args = array(
989
  'Bucket' => $bucket,
990
  'Key' => $prefix . $file_name,
@@ -1005,11 +1081,24 @@ class Amazon_S3_And_CloudFront extends AWS_Plugin_Base {
1005
 
1006
  $image_size = wp_attachment_is_image( $post_id ) ? 'full' : '';
1007
  $args = apply_filters( 'as3cf_object_meta', $args, $post_id, $image_size, false );
 
 
 
 
 
 
 
 
 
 
 
1008
 
1009
  do_action( 'as3cf_upload_attachment_pre_remove', $post_id, $s3object, $prefix, $args );
1010
 
1011
  $files_to_remove = array();
1012
 
 
 
1013
  try {
1014
  $s3client->putObject( $args );
1015
  $files_to_remove[] = $file_path;
@@ -1341,7 +1430,7 @@ class Amazon_S3_And_CloudFront extends AWS_Plugin_Base {
1341
  * @return string
1342
  */
1343
  public function filter_unique_filename( $filename, $post_id = null ) {
1344
- if ( ! $this->get_setting( 'copy-to-s3' ) || ! $this->is_plugin_setup() ) {
1345
  return $filename;
1346
  }
1347
 
@@ -1514,10 +1603,12 @@ class Amazon_S3_And_CloudFront extends AWS_Plugin_Base {
1514
  /**
1515
  * Check the plugin is correctly setup
1516
  *
 
 
1517
  * @return bool
1518
  */
1519
- function is_plugin_setup() {
1520
- if ( $this->aws->needs_access_keys() ) {
1521
  // AWS not configured
1522
  return false;
1523
  }
@@ -1842,7 +1933,7 @@ class Amazon_S3_And_CloudFront extends AWS_Plugin_Base {
1842
  }
1843
  }
1844
 
1845
- if ( ! is_null( $expires ) && $this->is_plugin_setup() ) {
1846
  try {
1847
  $expires = time() + apply_filters( 'as3cf_expires', $expires );
1848
  $secure_url = $this->get_s3client( $region )
@@ -2183,7 +2274,7 @@ class Amazon_S3_And_CloudFront extends AWS_Plugin_Base {
2183
  * @return string
2184
  */
2185
  function update_attached_file( $file, $attachment_id ) {
2186
- if ( ! $this->is_plugin_setup() ) {
2187
  return $file;
2188
  }
2189
 
@@ -2438,12 +2529,11 @@ class Amazon_S3_And_CloudFront extends AWS_Plugin_Base {
2438
  }
2439
 
2440
  /**
2441
- * Add the settings menu item
2442
- *
2443
- * @param Amazon_Web_Services $aws
2444
  */
2445
- function admin_menu( $aws ) {
2446
- $hook_suffix = $aws->add_page(
 
2447
  $this->get_plugin_page_title(),
2448
  $this->plugin_menu_title,
2449
  'manage_options',
@@ -2451,10 +2541,24 @@ class Amazon_S3_And_CloudFront extends AWS_Plugin_Base {
2451
  array( $this, 'render_page' )
2452
  );
2453
 
2454
- if ( false !== $hook_suffix ) {
2455
- $this->hook_suffix = $hook_suffix;
2456
- add_action( 'load-' . $this->hook_suffix, array( $this, 'plugin_load' ) );
2457
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2458
  }
2459
 
2460
  /**
@@ -2463,10 +2567,13 @@ class Amazon_S3_And_CloudFront extends AWS_Plugin_Base {
2463
  * @param bool|string $region specify region to client for signature
2464
  * @param bool $force force return of new S3 client when swapping regions
2465
  *
2466
- * @return Aws\S3\S3Client
2467
  */
2468
  public function get_s3client( $region = false, $force = false ) {
2469
- if ( is_null( $this->s3client ) || $force ) {
 
 
 
2470
 
2471
  $args = array(
2472
  'version' => self::S3_API_VERSION,
@@ -2477,9 +2584,11 @@ class Amazon_S3_And_CloudFront extends AWS_Plugin_Base {
2477
  $args['signature'] = self::AWS_SIGNATURE;
2478
  }
2479
 
 
 
2480
  try {
2481
  $aws_client = $this->aws->get_client();
2482
- $this->set_client( $aws_client->get( 's3', $args ) );
2483
  } catch ( \Exception $e ) {
2484
  AS3CF_Error::log( $e->getMessage() );
2485
  $this->set_client( new Null_S3_Client );
@@ -2493,9 +2602,14 @@ class Amazon_S3_And_CloudFront extends AWS_Plugin_Base {
2493
  * Setter for S3 client
2494
  *
2495
  * @param Aws\S3\S3Client|Null_S3_Client $client
 
2496
  */
2497
- public function set_client( $client ) {
2498
  $this->s3client = $client;
 
 
 
 
2499
  }
2500
 
2501
  /**
@@ -2633,6 +2747,11 @@ class Amazon_S3_And_CloudFront extends AWS_Plugin_Base {
2633
  * @return bool|WP_Error
2634
  */
2635
  function check_write_permission( $bucket = null, $region = null ) {
 
 
 
 
 
2636
  if ( is_null( $bucket ) ) {
2637
  if ( ! ( $bucket = $this->get_setting( 'bucket' ) ) ) {
2638
  // if no bucket set then no need check
@@ -2720,8 +2839,20 @@ class Amazon_S3_And_CloudFront extends AWS_Plugin_Base {
2720
  * On plugin load.
2721
  */
2722
  public function plugin_load() {
 
 
 
 
 
 
 
 
 
 
 
 
2723
  $this->enqueue_style( 'as3cf-styles', 'assets/css/styles', array( 'as3cf-modal' ) );
2724
- $this->enqueue_script( 'as3cf-script', 'assets/js/script', array( 'jquery', 'as3cf-modal' ) );
2725
 
2726
  wp_localize_script( 'as3cf-script',
2727
  'as3cf',
@@ -2737,6 +2868,9 @@ class Amazon_S3_And_CloudFront extends AWS_Plugin_Base {
2737
  'save_alert' => __( 'The changes you made will be lost if you navigate away from this page', 'amazon-s3-and-cloudfront' ),
2738
  'get_diagnostic_info' => __( 'Getting diagnostic info...', 'amazon-s3-and-cloudfront' ),
2739
  'get_diagnostic_info_error' => __( 'Error getting diagnostic info: ', 'amazon-s3-and-cloudfront' ),
 
 
 
2740
  ),
2741
  'nonces' => array(
2742
  'create_bucket' => wp_create_nonce( 'as3cf-create-bucket' ),
@@ -2745,6 +2879,8 @@ class Amazon_S3_And_CloudFront extends AWS_Plugin_Base {
2745
  'save_bucket' => wp_create_nonce( 'as3cf-save-bucket' ),
2746
  'get_url_preview' => wp_create_nonce( 'as3cf-get-url-preview' ),
2747
  'get_diagnostic_info' => wp_create_nonce( 'as3cf-get-diagnostic-info' ),
 
 
2748
  ),
2749
  'is_pro' => $this->is_pro(),
2750
  'aws_bucket_link' => $this->get_aws_bucket_link(),
@@ -2810,7 +2946,6 @@ class Amazon_S3_And_CloudFront extends AWS_Plugin_Base {
2810
  do_action( 'as3cf_pre_save_settings' );
2811
 
2812
  $post_vars = $this->get_settings_whitelist();
2813
- $skip_sanitize = $this->get_skip_sanitize_settings();
2814
 
2815
  foreach ( $post_vars as $var ) {
2816
  $this->remove_setting( $var );
@@ -2819,11 +2954,7 @@ class Amazon_S3_And_CloudFront extends AWS_Plugin_Base {
2819
  continue;
2820
  }
2821
 
2822
- if ( in_array( $var, $skip_sanitize ) ) {
2823
- $value = wp_strip_all_tags( $_POST[ $var ] ); // input var okay
2824
- } else {
2825
- $value = sanitize_text_field( $_POST[ $var ] ); // input var okay
2826
- }
2827
 
2828
  $this->set_setting( $var, $value );
2829
  }
@@ -2835,72 +2966,20 @@ class Amazon_S3_And_CloudFront extends AWS_Plugin_Base {
2835
  exit;
2836
  }
2837
 
2838
- /**
2839
- * Helper method to return the settings page URL for the plugin
2840
- *
2841
- * @param array $args
2842
- * @param string $url_method To prepend to admin_url()
2843
- * @param bool $escape Should we escape the URL
2844
- *
2845
- * @return string
2846
- */
2847
- function get_plugin_page_url( $args = array(), $url_method = 'network', $escape = true ) {
2848
- $default_args = array(
2849
- 'page' => self::$plugin_page,
2850
- );
2851
-
2852
- $args = array_merge( $default_args, $args );
2853
-
2854
- switch ( $url_method ) {
2855
- case 'self':
2856
- $base_url = self_admin_url( 'admin.php' );
2857
- break;
2858
- case '':
2859
- $base_url = admin_url( 'admin.php' );
2860
- break;
2861
- default:
2862
- $base_url = network_admin_url( 'admin.php' );
2863
- }
2864
-
2865
- // Add a hash to the URL
2866
- $hash = false;
2867
- if ( isset( $args['hash'] ) ) {
2868
- $hash = $args['hash'];
2869
- unset( $args['hash'] );
2870
- } else if ( $this->default_tab ) {
2871
- $hash = $this->default_tab;
2872
- }
2873
-
2874
- $url = add_query_arg( $args, $base_url );
2875
-
2876
- if ( $hash ) {
2877
- $url .= '#' . $hash;
2878
- }
2879
-
2880
- if ( $escape ) {
2881
- $url = esc_url_raw( $url );
2882
- }
2883
-
2884
- return $url;
2885
- }
2886
-
2887
  /**
2888
  * Display the main settings page for the plugin
2889
  */
2890
  function render_page() {
2891
- $this->aws->render_view( 'header', array( 'page_title' => $this->get_plugin_page_title(), 'page' => 'as3cf' ) );
 
2892
 
2893
- try {
2894
- $this->aws->get_client();
2895
- $this->render_view( 'settings-tabs' );
2896
- do_action( 'as3cf_pre_settings_render' );
2897
- $this->render_view( 'settings' );
2898
- do_action( 'as3cf_post_settings_render' );
2899
- } catch ( \Exception $e ) {
2900
- $this->render_view( 'error-fatal', array( 'message' => $e->getMessage() ) );
2901
- }
2902
 
2903
- $this->aws->render_view( 'footer' );
2904
  }
2905
 
2906
  /**
@@ -2910,13 +2989,33 @@ class Amazon_S3_And_CloudFront extends AWS_Plugin_Base {
2910
  */
2911
  function get_settings_tabs() {
2912
  $tabs = array(
2913
- 'media' => _x( 'Media Library', 'Show the media library tab', 'amazon-s3-and-cloudfront' ),
2914
- 'support' => _x( 'Support', 'Show the support tab', 'amazon-s3-and-cloudfront' ),
 
 
2915
  );
2916
 
2917
  return apply_filters( 'as3cf_settings_tabs', $tabs );
2918
  }
2919
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2920
  /**
2921
  * Get the prefix path for the files. Ignores WP media library
2922
  * year month subdirectory setting and just uses S3 setting
@@ -3137,7 +3236,7 @@ class Amazon_S3_And_CloudFront extends AWS_Plugin_Base {
3137
  * Check if PHP GD and Imagick is installed
3138
  */
3139
  function check_for_gd_imagick() {
3140
- if ( ! $this->is_plugin_setup() ) {
3141
  // No notice until plugin is setup
3142
  return;
3143
  }
@@ -3339,7 +3438,8 @@ class Amazon_S3_And_CloudFront extends AWS_Plugin_Base {
3339
 
3340
  $output .= 'cURL: ';
3341
  if ( function_exists( 'curl_init' ) ) {
3342
- $output .= 'Enabled';
 
3343
  } else {
3344
  $output .= 'Disabled';
3345
  }
@@ -3492,10 +3592,21 @@ class Amazon_S3_And_CloudFront extends AWS_Plugin_Base {
3492
  }
3493
 
3494
  $theme_info = wp_get_theme();
3495
- $output .= "Active Theme Name: " . esc_html( $theme_info->get( 'Name' ) ) . "\r\n";
3496
- $output .= "Active Theme Folder: " . esc_html( basename( $theme_info->get_stylesheet_directory() ) ) . "\r\n";
3497
- if ( $theme_info->get( 'Template' ) ) {
3498
- $output .= "Parent Theme Folder: " . esc_html( $theme_info->get( 'Template' ) ) . "\r\n";
 
 
 
 
 
 
 
 
 
 
 
3499
  }
3500
  if ( ! file_exists( $theme_info->get_stylesheet_directory() ) ) {
3501
  $output .= "WARNING: Active Theme Folder Not Found\r\n";
@@ -3748,6 +3859,10 @@ class Amazon_S3_And_CloudFront extends AWS_Plugin_Base {
3748
  * @return string
3749
  */
3750
  function get_access_denied_notice_message( $single = true ) {
 
 
 
 
3751
  $url = $this->dbrains_url( '/wp-offload-s3/doc/quick-start-guide/', array(
3752
  'utm_campaign' => 'error+messages',
3753
  ), 'bucket-restrictions' );
@@ -3770,7 +3885,7 @@ class Amazon_S3_And_CloudFront extends AWS_Plugin_Base {
3770
  *
3771
  * @return float|int
3772
  */
3773
- function multisite_get_spaced_used( $space_used ) {
3774
  global $wpdb;
3775
 
3776
  // Sum the total file size (including image sizes) for all S3 attachments
@@ -3962,10 +4077,10 @@ class Amazon_S3_And_CloudFront extends AWS_Plugin_Base {
3962
  }
3963
 
3964
  $url = $this->dbrains_url( $path, $args, $hash );
3965
- $text = __( 'More&nbsp;info', 'amazon-s3-and-cloudfront' );
3966
  $link = AS3CF_Utils::dbrains_link( $url, $text );
3967
 
3968
- return sprintf( '<span class="more-info">%s&nbsp;&raquo;</span>', $link );
3969
  }
3970
 
3971
  /**
@@ -4404,4 +4519,119 @@ class Amazon_S3_And_CloudFront extends AWS_Plugin_Base {
4404
 
4405
  return $errors;
4406
  }