diff --git a/README.md b/README.md index 9ef78f4..7c7ea05 100644 --- a/README.md +++ b/README.md @@ -1,9 +1,9 @@ # Amazon Web Services # **Contributors:** bradt, deliciousbrains **Tags:** amazon, amazon web services -**Requires at least:** 4.4 -**Tested up to:** 4.7.3 -**Stable tag:** 1.0.2 +**Requires at least:** 4.6 +**Tested up to:** 4.8 +**Stable tag:** 1.0.3 **License:** GPLv3 Houses the Amazon Web Services (AWS) PHP libraries and manages access keys. Required by other AWS plugins. @@ -13,7 +13,7 @@ Houses the Amazon Web Services (AWS) PHP libraries and manages access keys. Requ This plugin is required by other plugins, which use its libraries and its settings to connect to AWS services. Currently, there are only two plugins that require this plugin: * [WP Offload S3 Lite](http://wordpress.org/plugins/amazon-s3-and-cloudfront/) -* [WP Offload S3](https://deliciousbrains.com/wp-offload-s3/) +* [WP Offload S3](https://deliciousbrains.com/wp-offload-s3/?utm_campaign=WP%2BOffload%2BS3&utm_source=wordpress.org&utm_medium=free%2Bplugin%2Blisting&utm_content=AWS) ### Requirements ### @@ -35,6 +35,9 @@ This plugin is required by other plugins, which use its libraries and its settin ## Changelog ## +### 1.0.3 - 2017-06-19 ### +* Improvement: Compatibility with WP Offload S3 1.5 + ### 1.0.2 - 2017-03-13 ### * New: AWS SDK updated to 2.8.31 * New: London and Montreal regions added @@ -47,7 +50,7 @@ This plugin is required by other plugins, which use its libraries and its settin * Improvement: Compatibility with WP Offload S3 1.2 ### 0.3.7 - 2016-09-01 ### -* Improvement: No longer delete plugin data on uninstall. Manual removal possible, as per this [doc](https://deliciousbrains.com/wp-offload-s3/doc/uninstall/). +* Improvement: No longer delete plugin data on uninstall. Manual removal possible, as per this [doc](https://deliciousbrains.com/wp-offload-s3/doc/uninstall/?utm_campaign=changelogs&utm_source=wordpress.org&utm_medium=free%2Bplugin%2Blisting&utm_content=AWS). ### 0.3.6 - 2016-05-30 ### * Improvement: Now checks that the `curl_multi_exec` function is available. @@ -73,12 +76,12 @@ This plugin is required by other plugins, which use its libraries and its settin * Bug fix: Style inconsistencies on the _Addons_ screen ### 0.3 - 2015-07-08 ### -* New: Support for [IAM Roles on Amazon EC2](https://deliciousbrains.com/wp-offload-s3/doc/iam-roles/) using the `AWS_USE_EC2_IAM_ROLE` constant +* New: Support for [IAM Roles on Amazon EC2](https://deliciousbrains.com/wp-offload-s3/doc/iam-roles/?utm_campaign=changelogs&utm_source=wordpress.org&utm_medium=free%2Bplugin%2Blisting&utm_content=AWS) using the `AWS_USE_EC2_IAM_ROLE` constant * New: Redesigned _Access Keys_ and _Addons_ screens * Improvement: _Settings_ menu item renamed to _Access Keys_ * Improvement: _Access Keys_ link added to plugin row on _Plugins_ screen * Improvement: Activate addons directly from within _Addons_ screen -* Improvement: [Quick Start Guide](https://deliciousbrains.com/wp-offload-s3/doc/quick-start-guide/) documentation +* Improvement: [Quick Start Guide](https://deliciousbrains.com/wp-offload-s3/doc/quick-start-guide/?utm_campaign=changelogs&utm_source=wordpress.org&utm_medium=free%2Bplugin%2Blisting&utm_content=AWS) documentation ### 0.2.2 - 2015-01-19 ### * Bug Fix: Reverting AWS client config of region and signature diff --git a/amazon-web-services.php b/amazon-web-services.php index 63ec675..07de1bf 100644 --- a/amazon-web-services.php +++ b/amazon-web-services.php @@ -4,8 +4,8 @@ Plugin URI: http://wordpress.org/extend/plugins/amazon-web-services/ Description: Includes the Amazon Web Services PHP libraries, stores access keys, and allows other plugins to hook into it. Author: Delicious Brains -Version: 1.0.2 -Author URI: http://deliciousbrains.com/ +Version: 1.0.3 +Author URI: https://deliciousbrains.com/ Network: True Text Domain: amazon-web-services Domain Path: /languages/ @@ -22,7 +22,7 @@ // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. // ********************************************************************** -$GLOBALS['aws_meta']['amazon-web-services']['version'] = '1.0.2'; +$GLOBALS['aws_meta']['amazon-web-services']['version'] = '1.0.3'; $GLOBALS['aws_meta']['amazon-web-services']['supported_addon_versions'] = array( 'amazon-s3-and-cloudfront' => '0.9', diff --git a/assets/css/styles.css b/assets/css/styles.css index 0bd503f..e84296d 100644 --- a/assets/css/styles.css +++ b/assets/css/styles.css @@ -1 +1 @@ -.aws-content,.aws-updated,.aws-compatibility-notice{-webkit-box-sizing:border-box;box-sizing:border-box;max-width:650px}.toplevel_page_amazon-web-services .error,.toplevel_page_amazon-web-services .notice,.toplevel_page_amazon-web-services .updated{-webkit-box-sizing:border-box;box-sizing:border-box;max-width:650px}.aws-addons,.aws-main[data-view="addons"] .aws-compatibility-notice{max-width:772px}.aws-settings h3{font-size:20px}.aws-settings .need-help{background-color:#fff;padding:20px 20px 20px 50px;line-height:1;font-size:16px;font-weight:bold;position:relative}.aws-settings .need-help:before{font-family:"dashicons";content:"\f348";font-size:24px;line-height:1;width:24px;height:24px;position:absolute;top:16px;left:16px}.aws-settings .need-help a{text-decoration:none}.aws-settings p{font-size:14px}body.toplevel_page_amazon-web-services .wrap h1{color:#fff;font-weight:600;font-size:26px;line-height:1;margin:20px 0 15px 0;width:650px;padding:100px 0 0 25px;height:150px;background:#f7a80d url(../img/aws-logo.svg) right 40px center no-repeat;background-size:100px 79px;box-sizing:border-box;-moz-box-sizing:border-box;-webkit-box-sizing:border-box}.aws-addons .addons-list{margin:20px 0 200px;padding-top:5px;border-top:1px solid #ddd;font-size:14px}.aws-addons .addons-list li:last-child{margin-bottom:0}.aws-addons .addons-list article{margin-top:10px;width:100%;height:250px;position:relative;font-weight:300;line-height:1;overflow:hidden}.aws-addons .addons-list article .info{position:absolute;bottom:20px;left:20px}.aws-addons .addons-list article .info ul{margin:16px 0 0;color:rgba(255,255,255,0.7)}.aws-addons .addons-list article .info ul li{display:inline-block;margin:0 30px 0 0}.aws-addons .addons-list article .info ul li:last-child{margin-right:0}.aws-addons .addons-list article .info a{color:#fff;text-decoration:none}.aws-addons .addons-list article .info a:hover{text-decoration:underline}.aws-addons .addons-list article h1,.aws-addons .addons-list article h2{padding:0;color:#fff;line-height:1;font-weight:600}.aws-addons .addons-list article h1{margin:0;font-size:26px}.aws-addons .addons-list article h2{margin:4px 0 0;font-size:18px}.aws-addons .addons-list article .label{position:absolute;top:10px;right:10px;font-style:italic;color:#fff}.aws-addons .addons-list>li>ul{background-color:#fff;border-top:0;padding:10px;overflow:hidden}.aws-addons .addons-list>li>ul article{width:244px;float:left;margin-right:10px}.aws-addons .addons-list>li>ul article img{width:80px;height:80px}.aws-addons .addons-list>li>ul article h1{font-size:22px;line-height:1.2}.aws-addons .addons-list>li>ul article .info{left:0;right:0;margin:0 auto;width:210px;text-align:center}.aws-addons .addons-list>li>ul article .info ul li{margin-right:10px;font-size:13px;line-height:1.6}.aws-addons .addons-list>li>ul li{margin-bottom:0}.aws-addons .addons-list .amazon-s3-and-cloudfront>article{background-image:url(../img/as3cf-banner-bw.jpg);background-size:772px 150px;background-repeat:no-repeat;height:150px}@media (min--moz-device-pixel-ratio: 1.3), (-webkit-min-device-pixel-ratio: 1.3), (min-device-pixel-ratio: 1.3), (min-resolution: 1.3dppx){.aws-addons .addons-list .amazon-s3-and-cloudfront>article{background-image:url(../img/as3cf-banner-bw@2x.jpg)}}.aws-addons .addons-list .amazon-s3-and-cloudfront-pro>article{background-image:url(../img/as3cf-banner.jpg);background-size:772px 250px;background-repeat:no-repeat}@media (min--moz-device-pixel-ratio: 1.3), (-webkit-min-device-pixel-ratio: 1.3), (min-device-pixel-ratio: 1.3), (min-resolution: 1.3dppx){.aws-addons .addons-list .amazon-s3-and-cloudfront-pro>article{background-image:url(../img/as3cf-banner@2x.jpg)}}.aws-addons .addons-list .amazon-s3-and-cloudfront-woocommerce>article{background-color:#a46497;margin:0}.aws-addons .addons-list .amazon-s3-and-cloudfront-edd>article{background-color:#1d2428;background-position:center 50px}.aws-addons .addons-list .amazon-s3-and-cloudfront-assets>article{background-color:#0769ad;width:498px;margin-top:0}.aws-addons .addons-list .amazon-s3-and-cloudfront-assets>article img{width:100px;height:100px}.aws-addons .addons-list .amazon-s3-and-cloudfront-assets>article h1{font-size:30px}.aws-addons .addons-list .amazon-s3-and-cloudfront-wpml>article{background-color:#277f91}.aws-addons .addons-list .amazon-s3-and-cloudfront-meta-slider>article{background-color:#03b0d8;margin-right:0}.aws-addons .addons-list .amazon-s3-and-cloudfront-enable-media-replace>article{background-color:#33cc66}.aws-addons .addons-list .amazon-s3-and-cloudfront-enable-media-replace>article img{width:70px;height:70px;margin-bottom:10px}.aws-addons .addons-list .amazon-s3-and-cloudfront-acf-image-crop>article{background-color:#f55e4f} +.aws-content,.aws-updated,.aws-compatibility-notice{-webkit-box-sizing:border-box;box-sizing:border-box;max-width:650px}.toplevel_page_amazon-web-services .error,.toplevel_page_amazon-web-services .notice,.toplevel_page_amazon-web-services .updated{-webkit-box-sizing:border-box;box-sizing:border-box;max-width:650px}.aws-addons,.aws-main[data-view="addons"] .aws-compatibility-notice{max-width:772px}.aws-settings h3{font-size:20px}.aws-settings .need-help{background-color:#fff;padding:20px 20px 20px 50px;line-height:1;font-size:16px;font-weight:bold;position:relative}.aws-settings .need-help:before{font-family:"dashicons";content:"\f348";font-size:24px;line-height:1;width:24px;height:24px;position:absolute;top:16px;left:16px}.aws-settings .need-help a{text-decoration:none}.aws-settings p{font-size:14px}body.toplevel_page_amazon-web-services .wrap h1{color:#fff;font-weight:600;font-size:26px;line-height:1;margin:20px 0 15px 0;width:650px;padding:100px 0 0 25px;height:150px;background:#f7a80d url(../img/aws-logo.svg) right 40px center no-repeat;background-size:100px 79px;box-sizing:border-box;-moz-box-sizing:border-box;-webkit-box-sizing:border-box}.aws-addons .addons-list{margin:20px 0 200px;padding-top:5px;border-top:1px solid #ddd;font-size:14px}.aws-addons .addons-list li:last-child{margin-bottom:0}.aws-addons .addons-list article{margin-top:10px;width:100%;height:250px;position:relative;font-weight:300;line-height:1;overflow:hidden}.aws-addons .addons-list article .info{position:absolute;bottom:20px;left:20px}.aws-addons .addons-list article .info ul{margin:16px 0 0;color:rgba(255,255,255,0.7)}.aws-addons .addons-list article .info ul li{display:inline-block;margin:0 30px 0 0}.aws-addons .addons-list article .info ul li:last-child{margin-right:0}.aws-addons .addons-list article .info a{color:#fff;text-decoration:none}.aws-addons .addons-list article .info a:hover{text-decoration:underline}.aws-addons .addons-list article h1,.aws-addons .addons-list article h2{padding:0;color:#fff;line-height:1;font-weight:600}.aws-addons .addons-list article h1{margin:0;font-size:26px}.aws-addons .addons-list article h2{margin:4px 0 0;font-size:18px}.aws-addons .addons-list article .label{position:absolute;top:10px;right:10px;font-style:italic;color:#fff}.aws-addons .addons-list>li>ul{background-color:#fff;border-top:0;padding:10px;overflow:hidden}.aws-addons .addons-list>li>ul article{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;-webkit-box-pack:center;-webkit-justify-content:center;-ms-flex-pack:center;justify-content:center}.aws-addons .addons-list>li>ul article img{width:100px;height:100px}.aws-addons .addons-list>li>ul article h1{margin-top:8px;font-size:30px;line-height:1.2}.aws-addons .addons-list>li>ul article .info{display:block;left:auto;bottom:auto;margin:0 auto;text-align:center}.aws-addons .addons-list>li>ul article .info ul li{margin-right:10px;font-size:13px;line-height:1.6}.aws-addons .addons-list>li>ul li{margin-bottom:0}.aws-addons .addons-list .amazon-s3-and-cloudfront>article{background-image:url(../img/as3cf-banner-bw.jpg);background-size:772px 150px;background-repeat:no-repeat;height:150px}@media (min--moz-device-pixel-ratio: 1.3), (-webkit-min-device-pixel-ratio: 1.3), (min-device-pixel-ratio: 1.3), (min-resolution: 1.3dppx){.aws-addons .addons-list .amazon-s3-and-cloudfront>article{background-image:url(../img/as3cf-banner-bw@2x.jpg)}}.aws-addons .addons-list .amazon-s3-and-cloudfront-pro>article{background-image:url(../img/as3cf-banner.jpg);background-size:772px 250px;background-repeat:no-repeat}@media (min--moz-device-pixel-ratio: 1.3), (-webkit-min-device-pixel-ratio: 1.3), (min-device-pixel-ratio: 1.3), (min-resolution: 1.3dppx){.aws-addons .addons-list .amazon-s3-and-cloudfront-pro>article{background-image:url(../img/as3cf-banner@2x.jpg)}}.aws-addons .addons-list .amazon-s3-and-cloudfront-assets>article{background-color:#0769ad;margin-top:0} diff --git a/assets/img/icon-acf-image-crop.svg b/assets/img/icon-acf-image-crop.svg deleted file mode 100644 index f4edcf2..0000000 --- a/assets/img/icon-acf-image-crop.svg +++ /dev/null @@ -1,10 +0,0 @@ - - - - Untitled 5 - Created with Sketch. - - - - - \ No newline at end of file diff --git a/assets/img/icon-edd.svg b/assets/img/icon-edd.svg deleted file mode 100644 index bd54e03..0000000 --- a/assets/img/icon-edd.svg +++ /dev/null @@ -1,10 +0,0 @@ - - - - Untitled - Created with Sketch. - - - - - \ No newline at end of file diff --git a/assets/img/icon-enable-media-replace.svg b/assets/img/icon-enable-media-replace.svg deleted file mode 100644 index 879be0f..0000000 --- a/assets/img/icon-enable-media-replace.svg +++ /dev/null @@ -1,10 +0,0 @@ - - - - Slice 1 - Created with Sketch. - - - - - \ No newline at end of file diff --git a/assets/img/icon-meta-slider.svg b/assets/img/icon-meta-slider.svg deleted file mode 100644 index 3b4bac7..0000000 --- a/assets/img/icon-meta-slider.svg +++ /dev/null @@ -1,16 +0,0 @@ - - - - Untitled - Created with Sketch. - - - - - \ No newline at end of file diff --git a/assets/img/icon-woocommerce.svg b/assets/img/icon-woocommerce.svg deleted file mode 100644 index abbae68..0000000 --- a/assets/img/icon-woocommerce.svg +++ /dev/null @@ -1,10 +0,0 @@ - - - - Untitled - Created with Sketch. - - - - - \ No newline at end of file diff --git a/assets/img/icon-wpml.svg b/assets/img/icon-wpml.svg deleted file mode 100644 index 0258128..0000000 --- a/assets/img/icon-wpml.svg +++ /dev/null @@ -1,12 +0,0 @@ - - - - Slice 1 - Created with Sketch. - - - - - \ No newline at end of file diff --git a/assets/sass/styles.scss b/assets/sass/styles.scss index 51a5f63..a1e8d1a 100644 --- a/assets/sass/styles.scss +++ b/assets/sass/styles.scss @@ -161,25 +161,26 @@ body.toplevel_page_amazon-web-services .wrap { overflow: hidden; article { - width: 244px; - float: left; - margin-right: 10px; - + display: flex; + align-items: center; + justify-content: center; + img { - width: 80px; - height: 80px; + width: 100px; + height: 100px; } h1 { - font-size: 22px; + margin-top: 8px; + font-size: 30px; line-height: 1.2; } .info { - left: 0; - right: 0; + display: block; + left: auto; + bottom: auto; margin: 0 auto; - width: 210px; text-align: center; ul { @@ -226,52 +227,9 @@ body.toplevel_page_amazon-web-services .wrap { } } - .amazon-s3-and-cloudfront-woocommerce > article { - background-color: #a46497; - margin: 0; - } - - .amazon-s3-and-cloudfront-edd > article { - background-color: #1d2428; - background-position: center 50px; - } - .amazon-s3-and-cloudfront-assets > article { background-color: #0769ad; - width: 498px; margin-top: 0; - - img { - width: 100px; - height: 100px; - } - - h1 { - font-size: 30px; - } - } - - .amazon-s3-and-cloudfront-wpml > article { - background-color: #277f91; - } - - .amazon-s3-and-cloudfront-meta-slider > article { - background-color: #03b0d8; - margin-right: 0; - } - - .amazon-s3-and-cloudfront-enable-media-replace > article { - background-color: #33cc66; - - img { - width: 70px; - height: 70px; - margin-bottom: 10px; - } - } - - .amazon-s3-and-cloudfront-acf-image-crop > article { - background-color: #f55e4f; } } } \ No newline at end of file diff --git a/classes/amazon-web-services.php b/classes/amazon-web-services.php index 1782a29..05cf380 100644 --- a/classes/amazon-web-services.php +++ b/classes/amazon-web-services.php @@ -112,25 +112,18 @@ function add_page( $page_title, $menu_title, $capability, $menu_slug, $function /** * Load styles for the AWS menu item */ - function enqueue_menu_styles() { - $src = plugins_url( 'assets/css/global.css', $this->plugin_file_path ); - wp_enqueue_style( 'aws-global-styles', $src, array(), $this->get_asset_version() ); + public function enqueue_menu_styles() { + $this->enqueue_style( 'aws-global-styles', 'assets/css/global' ); } /** * Plugin loading enqueue scripts and styles */ - function plugin_load() { - $version = $this->get_asset_version(); - $suffix = $this->get_asset_suffix(); + public function plugin_load() { + $this->enqueue_style( 'aws-styles', 'assets/css/styles' ); + $this->enqueue_script( 'aws-script', 'assets/js/script', array( 'jquery' ) ); - $src = plugins_url( 'assets/css/styles.css', $this->plugin_file_path ); - wp_enqueue_style( 'aws-styles', $src, array(), $version ); - - $src = plugins_url( 'assets/js/script' . $suffix . '.js', $this->plugin_file_path ); - wp_enqueue_script( 'aws-script', $src, array( 'jquery' ), $version, true ); - - if ( isset( $_GET['page'] ) && 'aws-addons' == sanitize_key( $_GET['page'] ) ) { // input var okay + if ( isset( $_GET['page'] ) && 'aws-addons' === sanitize_key( $_GET['page'] ) ) { // input var okay add_filter( 'admin_body_class', array( $this, 'admin_plugin_body_class' ) ); wp_enqueue_script( 'plugin-install' ); add_thickbox(); @@ -356,65 +349,27 @@ function get_plugin_action_settings_text() { * * @return array */ - function get_addons( $unfiltered = false ) { + public function get_addons( $unfiltered = false ) { $addons = array( - 'amazon-s3-and-cloudfront' => array( + 'amazon-s3-and-cloudfront' => array( 'title' => __( 'WP Offload S3 Lite', 'amazon-web-services' ), 'url' => 'https://wordpress.org/plugins/amazon-s3-and-cloudfront/', 'install' => true, ), 'amazon-s3-and-cloudfront-pro' => array( 'title' => __( 'WP Offload S3', 'amazon-web-services' ), - 'url' => 'https://deliciousbrains.com/wp-offload-s3/', + 'url' => $this->dbrains_url( '/wp-offload-s3', array( + 'utm_campaign' => 'WP+Offload+S3', + ) ), 'addons' => array( - 'amazon-s3-and-cloudfront-assets' => array( + 'amazon-s3-and-cloudfront-assets' => array( 'title' => __( 'Assets', 'amazon-web-services' ), - 'url' => 'https://deliciousbrains.com/wp-offload-s3/doc/assets-addon/', + 'url' => $this->dbrains_url( '/wp-offload-s3/doc/assets-addon/', array( + 'utm_campaign' => 'addons+install', + ) ), 'label' => __( 'Feature', 'amazon-web-services' ), 'icon' => true, ), - 'amazon-s3-and-cloudfront-woocommerce' => array( - 'title' => __( 'WooCommerce', 'amazon-web-services' ), - 'url' => 'https://deliciousbrains.com/wp-offload-s3/doc/woocommerce-addon/', - 'label' => __( 'Integration', 'amazon-web-services' ), - 'parent_plugin_basename' => 'woocommerce/woocommerce.php', - 'icon' => true, - ), - 'amazon-s3-and-cloudfront-edd' => array( - 'title' => __( 'Easy Digital Downloads', 'amazon-web-services' ), - 'url' => 'https://deliciousbrains.com/wp-offload-s3/doc/edd-addon/', - 'label' => __( 'Integration', 'amazon-web-services' ), - 'parent_plugin_basename' => 'easy-digital-downloads/easy-digital-downloads.php', - 'icon' => true, - ), - 'amazon-s3-and-cloudfront-wpml' => array( - 'title' => __( 'WPML', 'amazon-web-services' ), - 'url' => 'https://deliciousbrains.com/wp-offload-s3/doc/wpml-addon/', - 'label' => __( 'Integration', 'amazon-web-services' ), - 'parent_plugin_basename' => 'wpml-media/plugin.php', - 'icon' => true, - ), - 'amazon-s3-and-cloudfront-meta-slider' => array( - 'title' => __( 'Meta Slider', 'amazon-web-services' ), - 'url' => 'https://deliciousbrains.com/wp-offload-s3/doc/meta-slider-addon/', - 'label' => __( 'Integration', 'amazon-web-services' ), - 'parent_plugin_basename' => 'ml-slider/ml-slider.php', - 'icon' => true, - ), - 'amazon-s3-and-cloudfront-enable-media-replace' => array( - 'title' => __( 'Enable Media Replace', 'amazon-web-services' ), - 'url' => 'https://deliciousbrains.com/wp-offload-s3/doc/enable-media-replace-addon/', - 'label' => __( 'Integration', 'amazon-web-services' ), - 'parent_plugin_basename' => 'enable-media-replace/enable-media-replace.php', - 'icon' => true, - ), - 'amazon-s3-and-cloudfront-acf-image-crop' => array( - 'title' => __( 'ACF Image Crop', 'amazon-web-services' ), - 'url' => 'https://deliciousbrains.com/wp-offload-s3/doc/acf-image-crop-addon/', - 'label' => __( 'Integration', 'amazon-web-services' ), - 'parent_plugin_basename' => 'acf-image-crop-add-on/acf-image-crop.php', - 'icon' => true, - ), ), ), ); diff --git a/classes/aws-plugin-base.php b/classes/aws-plugin-base.php index 14666b9..39eaec7 100644 --- a/classes/aws-plugin-base.php +++ b/classes/aws-plugin-base.php @@ -2,6 +2,8 @@ class AWS_Plugin_Base { + const DBRAINS_URL = 'https://deliciousbrains.com'; + protected $plugin_file_path; protected $plugin_dir_path; protected $plugin_slug; @@ -319,6 +321,36 @@ function plugin_actions_settings_link( $links, $file ) { return $links; } + /** + * Enqueue script. + * + * @param string $handle + * @param string $path + * @param array $deps + * @param bool $footer + */ + public function enqueue_script( $handle, $path, $deps = array(), $footer = true ) { + $version = $this->get_asset_version(); + $suffix = $this->get_asset_suffix(); + + $src = plugins_url( $path . $suffix . '.js', $this->plugin_file_path ); + wp_enqueue_script( $handle, $src, $deps, $version, $footer ); + } + + /** + * Enqueue style. + * + * @param string $handle + * @param string $path + * @param array $deps + */ + public function enqueue_style( $handle, $path, $deps = array() ) { + $version = $this->get_asset_version(); + + $src = plugins_url( $path . '.css', $this->plugin_file_path ); + wp_enqueue_style( $handle, $src, $deps, $version ); + } + /** * Get the version used for script enqueuing * @@ -361,4 +393,38 @@ public function get_aws_regions() { return apply_filters( 'aws_get_regions', $regions ); } + + /** + * Generate site URL with correct UTM tags. + * + * @param string $path + * @param array $args + * @param string $hash + * + * @return string + */ + public function dbrains_url( $path, $args = array(), $hash = '' ) { + $args = wp_parse_args( $args, array( + 'utm_medium' => 'insideplugin', + 'utm_source' => $this->get_utm_source(), + ) ); + $args = array_map( 'urlencode', $args ); + $url = trailingslashit( self::DBRAINS_URL ) . ltrim( $path, '/' ); + $url = add_query_arg( $args, $url ); + + if ( $hash ) { + $url .= '#' . $hash; + } + + return $url; + } + + /** + * Get UTM source for plugin. + * + * @return string + */ + protected function get_utm_source() { + return 'AWS'; + } } \ No newline at end of file diff --git a/languages/amazon-web-services-en.pot b/languages/amazon-web-services-en.pot index 1f2d72b..88b4390 100644 --- a/languages/amazon-web-services-en.pot +++ b/languages/amazon-web-services-en.pot @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: amazon-web-services\n" "Report-Msgid-Bugs-To: nom@deliciousbrains.com\n" -"POT-Creation-Date: 2017-03-13 13:11+0000\n" +"POT-Creation-Date: 2017-06-19 14:44+0100\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -18,7 +18,7 @@ msgstr "" "Content-Transfer-Encoding: 8bit\n" #: classes/amazon-web-services.php:51 -#: classes/amazon-web-services.php:195 +#: classes/amazon-web-services.php:188 msgid "Amazon Web Services" msgstr "" @@ -31,99 +31,66 @@ msgid "Addons" msgstr "" #: classes/amazon-web-services.php:83 -#: classes/amazon-web-services.php:349 -#: view/settings.php:14 +#: classes/amazon-web-services.php:342 +#: view/settings.php:16 msgid "Access Keys" msgstr "" -#: classes/amazon-web-services.php:153 +#: classes/amazon-web-services.php:146 msgid "Cheatin' eh?" msgstr "" -#: classes/amazon-web-services.php:204 +#: classes/amazon-web-services.php:197 msgid "Amazon Web Services: Addons" msgstr "" -#: classes/amazon-web-services.php:297 +#: classes/amazon-web-services.php:290 #, php-format msgid "" "You must first set your AWS access keys to use this addon." msgstr "" -#: classes/amazon-web-services.php:362 +#: classes/amazon-web-services.php:355 msgid "WP Offload S3 Lite" msgstr "" -#: classes/amazon-web-services.php:367 +#: classes/amazon-web-services.php:360 msgid "WP Offload S3" msgstr "" -#: classes/amazon-web-services.php:371 +#: classes/amazon-web-services.php:366 msgid "Assets" msgstr "" -#: classes/amazon-web-services.php:373 +#: classes/amazon-web-services.php:370 msgid "Feature" msgstr "" -#: classes/amazon-web-services.php:377 -msgid "WooCommerce" -msgstr "" - -#: classes/amazon-web-services.php:379 -#: classes/amazon-web-services.php:386 -#: classes/amazon-web-services.php:393 -#: classes/amazon-web-services.php:400 -#: classes/amazon-web-services.php:407 -#: classes/amazon-web-services.php:414 -msgid "Integration" -msgstr "" - -#: classes/amazon-web-services.php:384 -msgid "Easy Digital Downloads" -msgstr "" - -#: classes/amazon-web-services.php:391 -msgid "WPML" -msgstr "" - -#: classes/amazon-web-services.php:398 -msgid "Meta Slider" -msgstr "" - -#: classes/amazon-web-services.php:405 -msgid "Enable Media Replace" -msgstr "" - -#: classes/amazon-web-services.php:412 -msgid "ACF Image Crop" -msgstr "" - -#: classes/amazon-web-services.php:461 +#: classes/amazon-web-services.php:416 msgctxt "Plugin already installed and activated" msgid "Installed & Activated" msgstr "" -#: classes/amazon-web-services.php:463 +#: classes/amazon-web-services.php:418 msgctxt "Plugin already installed" msgid "Installed" msgstr "" -#: classes/amazon-web-services.php:464 +#: classes/amazon-web-services.php:419 msgctxt "Activate plugin now" msgid "Activate Now" msgstr "" -#: classes/amazon-web-services.php:467 +#: classes/amazon-web-services.php:422 msgctxt "Install plugin now" msgid "Install Now" msgstr "" -#: classes/amazon-web-services.php:503 +#: classes/amazon-web-services.php:458 msgid "Visit Site" msgstr "" -#: classes/amazon-web-services.php:506 +#: classes/amazon-web-services.php:461 msgctxt "View plugin details" msgid "View Details" msgstr "" @@ -154,7 +121,7 @@ msgid "" "7.16.2+ compiled with OpenSSL and zlib. Your server currently has" msgstr "" -#: classes/aws-plugin-base.php:296 +#: classes/aws-plugin-base.php:298 msgid "Settings" msgstr "" @@ -246,42 +213,42 @@ msgid "" "Guide →" msgstr "" -#: view/settings.php:19 +#: view/settings.php:21 msgid "You have enabled the use of IAM roles for Amazon EC2 instances." msgstr "" -#: view/settings.php:25 +#: view/settings.php:27 msgid "" "You’ve already defined your AWS access keys in your wp-config.php. If " "you’d prefer to manage them here and store them in the database (not " "recommended), simply remove the lines from your wp-config." msgstr "" -#: view/settings.php:31 +#: view/settings.php:33 msgid "" "We recommend defining your Access Keys in wp-config.php so long as you " "don’t commit it to source control (you shouldn’t be). Simply " "copy the following snippet and replace the stars with the keys." msgstr "" -#: view/settings.php:38 +#: view/settings.php:40 msgid "" "If you’d rather store your Access Keys in the database, click here to reveal a form." msgstr "" -#: view/settings.php:54 +#: view/settings.php:56 msgid "Access Key ID:" msgstr "" -#: view/settings.php:60 +#: view/settings.php:62 msgid "Secret Access Key:" msgstr "" -#: view/settings.php:67 +#: view/settings.php:69 msgid "Save Changes" msgstr "" -#: view/settings.php:70 +#: view/settings.php:72 msgid "Remove Keys" msgstr "" diff --git a/readme.txt b/readme.txt index 8b0470d..6c208c9 100644 --- a/readme.txt +++ b/readme.txt @@ -1,9 +1,9 @@ === Amazon Web Services === Contributors: bradt, deliciousbrains Tags: amazon, amazon web services -Requires at least: 4.4 -Tested up to: 4.7.3 -Stable tag: 1.0.2 +Requires at least: 4.6 +Tested up to: 4.8 +Stable tag: 1.0.3 License: GPLv3 Houses the Amazon Web Services (AWS) PHP libraries and manages access keys. Required by other AWS plugins. @@ -13,7 +13,7 @@ Houses the Amazon Web Services (AWS) PHP libraries and manages access keys. Requ This plugin is required by other plugins, which use its libraries and its settings to connect to AWS services. Currently, there are only two plugins that require this plugin: * [WP Offload S3 Lite](http://wordpress.org/plugins/amazon-s3-and-cloudfront/) -* [WP Offload S3](https://deliciousbrains.com/wp-offload-s3/) +* [WP Offload S3](https://deliciousbrains.com/wp-offload-s3/?utm_campaign=WP%2BOffload%2BS3&utm_source=wordpress.org&utm_medium=free%2Bplugin%2Blisting&utm_content=AWS) = Requirements = @@ -33,6 +33,9 @@ This plugin is required by other plugins, which use its libraries and its settin == Changelog == += 1.0.3 - 2017-06-19 = +* Improvement: Compatibility with WP Offload S3 1.5 + = 1.0.2 - 2017-03-13 = * New: AWS SDK updated to 2.8.31 * New: London and Montreal regions added @@ -45,7 +48,7 @@ This plugin is required by other plugins, which use its libraries and its settin * Improvement: Compatibility with WP Offload S3 1.2 = 0.3.7 - 2016-09-01 = -* Improvement: No longer delete plugin data on uninstall. Manual removal possible, as per this [doc](https://deliciousbrains.com/wp-offload-s3/doc/uninstall/). +* Improvement: No longer delete plugin data on uninstall. Manual removal possible, as per this [doc](https://deliciousbrains.com/wp-offload-s3/doc/uninstall/?utm_campaign=changelogs&utm_source=wordpress.org&utm_medium=free%2Bplugin%2Blisting&utm_content=AWS). = 0.3.6 - 2016-05-30 = * Improvement: Now checks that the `curl_multi_exec` function is available. @@ -71,12 +74,12 @@ This plugin is required by other plugins, which use its libraries and its settin * Bug fix: Style inconsistencies on the _Addons_ screen = 0.3 - 2015-07-08 = -* New: Support for [IAM Roles on Amazon EC2](https://deliciousbrains.com/wp-offload-s3/doc/iam-roles/) using the `AWS_USE_EC2_IAM_ROLE` constant +* New: Support for [IAM Roles on Amazon EC2](https://deliciousbrains.com/wp-offload-s3/doc/iam-roles/?utm_campaign=changelogs&utm_source=wordpress.org&utm_medium=free%2Bplugin%2Blisting&utm_content=AWS) using the `AWS_USE_EC2_IAM_ROLE` constant * New: Redesigned _Access Keys_ and _Addons_ screens * Improvement: _Settings_ menu item renamed to _Access Keys_ * Improvement: _Access Keys_ link added to plugin row on _Plugins_ screen * Improvement: Activate addons directly from within _Addons_ screen -* Improvement: [Quick Start Guide](https://deliciousbrains.com/wp-offload-s3/doc/quick-start-guide/) documentation +* Improvement: [Quick Start Guide](https://deliciousbrains.com/wp-offload-s3/doc/quick-start-guide/?utm_campaign=changelogs&utm_source=wordpress.org&utm_medium=free%2Bplugin%2Blisting&utm_content=AWS) documentation = 0.2.2 - 2015-01-19 = * Bug Fix: Reverting AWS client config of region and signature diff --git a/view/settings.php b/view/settings.php index 31cb519..46e71de 100644 --- a/view/settings.php +++ b/view/settings.php @@ -6,7 +6,9 @@ are_access_keys_set() && ! $use_ec2_iam_roles ) : ?>

- Check out the Quick Start Guide →', 'amazon-web-services' ), 'https://deliciousbrains.com/wp-offload-s3/doc/quick-start-guide/' ); ?> + Check out the Quick Start Guide →', 'amazon-web-services' ), $this->dbrains_url( '/wp-offload-s3/doc/quick-start-guide/', array( + 'utm_campaign' => 'support+docs', + ) ) ); ?>