From 41972f45fe5d74ce431b46c8f85d5a27f8f504a6 Mon Sep 17 00:00:00 2001 From: Jon Gilkison Date: Wed, 26 Apr 2017 00:53:18 +0700 Subject: [PATCH] Improve new user on-boarding --- classes/ilab-media-tool-base.php | 3 ++- classes/ilab-media-tools-manager.php | 2 +- classes/tools/s3/ilab-media-s3-tool.php | 6 ++++++ ilab-media-tools.php | 2 +- readme.txt | 5 ++++- 5 files changed, 14 insertions(+), 4 deletions(-) diff --git a/classes/ilab-media-tool-base.php b/classes/ilab-media-tool-base.php index 63081e84..622c7bb8 100644 --- a/classes/ilab-media-tool-base.php +++ b/classes/ilab-media-tool-base.php @@ -131,7 +131,8 @@ public function uninstall() */ public function enabled() { - $enabled=get_option("ilab-media-tool-enabled-$this->toolName",($this->env_variable) ? env($this->env_variable) : true); + $env = ($this->env_variable) ? getenv($this->env_variable) : false; + $enabled=get_option("ilab-media-tool-enabled-$this->toolName", $env); if ($enabled && isset($this->toolInfo['dependencies'])) { diff --git a/classes/ilab-media-tools-manager.php b/classes/ilab-media-tools-manager.php index e2ed93a3..bd2248d3 100644 --- a/classes/ilab-media-tools-manager.php +++ b/classes/ilab-media-tools-manager.php @@ -44,7 +44,7 @@ public function __construct() add_action('admin_menu', function(){ add_menu_page('Settings', 'Media Cloud', 'manage_options', 'media-tools-top', [$this,'renderSettings'],'dashicons-cloud'); - add_submenu_page( 'media-tools-top', 'ILab Tools', 'Tools', 'manage_options', 'media-tools-top', [$this,'renderSettings']); + add_submenu_page( 'media-tools-top', 'Media CLoud Tools', 'Enable/Disable Tools', 'manage_options', 'media-tools-top', [$this,'renderSettings']); add_settings_section('ilab-media-tools','Enabled Tools',[$this,'renderSettingsSection'],'media-tools-top'); diff --git a/classes/tools/s3/ilab-media-s3-tool.php b/classes/tools/s3/ilab-media-s3-tool.php index fcb7f0d0..c6f556d3 100644 --- a/classes/tools/s3/ilab-media-s3-tool.php +++ b/classes/tools/s3/ilab-media-s3-tool.php @@ -123,6 +123,12 @@ public function s3enabled() { return false; } + $penabled = parent::enabled(); + if (!$penabled) { + $this->displayAdminNotice('error',"To start using S3, you will need to enable it."); + return false; + } + if ($this->settingsError) return false; diff --git a/ilab-media-tools.php b/ilab-media-tools.php index 0d4fe02d..4bec5eef 100644 --- a/ilab-media-tools.php +++ b/ilab-media-tools.php @@ -4,7 +4,7 @@ Plugin URI: http://interfacelab.com/media-tools Description: Automatically upload media to Amazon S3 and integrate with Imgix, a real-time image processing CDN. Boosts site performance and simplifies workflows. Author: interfacelab -Version: 1.4.2 +Version: 1.4.3 Author URI: http://interfacelab.io */ diff --git a/readme.txt b/readme.txt index a8b31e1f..f2d86e55 100644 --- a/readme.txt +++ b/readme.txt @@ -6,7 +6,7 @@ Tested up to: 4.7.4 License: GPLv3 or later Donate link: http://www2.jdrf.org/site/TR?fr_id=6912&pg=personal&px=11429802 License URI: http://www.gnu.org/licenses/gpl-3.0.html -Stable tag: 1.4.2 +Stable tag: 1.4.3 Automatically upload media to Amazon S3 and integrate with Imgix, a real-time image processing CDN. Boosts site performance and simplifies workflows. @@ -99,6 +99,9 @@ No, I'm just one very enthusiastic customer. == Changelog == += 1.4.3 = +* Improve new user on-boarding + = 1.4.2 = * Changed plugin name * Ability to import non-standard image types such as TIFF, Adobe Photoshop, and Adobe Illustrator (requires Imgix)