diff --git a/CHANGELOG.txt b/CHANGELOG.txt index 08a6389c53..aed2a6c955 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -1,5 +1,8 @@ == Changelog == += 1.0.1 - 2020-10-17 +Fixed: CC icon not showing in some installations #289 + = 1.0.0 - 2020-10-01 New: Complete new set of sample products created specifically for CC #284 Updated: All documentation links now point to classiccommerce.cc #274, #278, #281 @@ -10,7 +13,6 @@ Improved: Stock levels are now hidden on the dashboard widget if inventory is di Improved: Additional checks made during build process #269 Tweaks: Some well-hidden instances of WC purple changes to CC aqua #270, #271 - = 1.0.0-rc.2 - 2020-08-29 Fixed: Corrected color of two images to CC aqua, missed in rc1. #255 diff --git a/classic-commerce.php b/classic-commerce.php index fb1102b93d..0769b156d9 100644 --- a/classic-commerce.php +++ b/classic-commerce.php @@ -3,7 +3,7 @@ * Plugin Name: Classic Commerce * Plugin URI: https://github.com/ClassicPress-plugins/classic-commerce * Description: A simple, powerful and independent e-commerce platform. Sell anything with ease. - * Version: 1.0.0 + * Version: 1.0.1 * Author: ClassicPress Research Team * Author URI: https://github.com/ClassicPress-plugins/classic-commerce * Text Domain: classic-commerce diff --git a/includes/admin/class-wc-admin-menus.php b/includes/admin/class-wc-admin-menus.php index 028a1b53cd..b841acf981 100644 --- a/includes/admin/class-wc-admin-menus.php +++ b/includes/admin/class-wc-admin-menus.php @@ -53,14 +53,19 @@ public function __construct() { public function admin_menu() { global $menu; - $icon_svg = file_get_contents( WC()->plugin_url() . '/assets/images/classic-commerce-dashicon-white-on-transparent.svg' ); - $cc_icon = base64_encode( $icon_svg ); + $cc_icon = ''; + $icon_file = WC_ABSPATH . 'assets/images/classic-commerce-dashicon-white-on-transparent.svg'; + + if ( file_exists( $icon_file ) ) { + $icon_svg = file_get_contents( $icon_file ); + $cc_icon = 'data:image/svg+xml;base64,' . base64_encode( $icon_svg ); + } if ( current_user_can( 'manage_woocommerce' ) ) { $menu[] = array( '', 'read', 'separator-woocommerce', '', 'wp-menu-separator woocommerce' ); // WPCS: override ok. } - add_menu_page( __( 'Classic Commerce', 'classic-commerce' ), __( 'WooCommerce', 'classic-commerce' ), 'manage_woocommerce', 'woocommerce', null, 'data:image/svg+xml;base64,' . $cc_icon, '55.5' ); + add_menu_page( __( 'Classic Commerce', 'classic-commerce' ), __( 'WooCommerce', 'classic-commerce' ), 'manage_woocommerce', 'woocommerce', null, $cc_icon, '55.5' ); // A default icon will be used if $cc_icon is empty add_submenu_page( 'edit.php?post_type=product', __( 'Attributes', 'classic-commerce' ), __( 'Attributes', 'classic-commerce' ), 'manage_product_terms', 'product_attributes', array( $this, 'attributes_page' ) ); } @@ -366,7 +371,7 @@ public function nav_menu_links() { * Add the "Visit Store" link in admin bar main menu. * * @since WC-2.4.0 - * + * * @param WP_Admin_Bar $wp_admin_bar Admin bar instance. */ public function admin_bar_menus( $wp_admin_bar ) { diff --git a/includes/class-woocommerce.php b/includes/class-woocommerce.php index fbbb3792be..5b1e6ab558 100644 --- a/includes/class-woocommerce.php +++ b/includes/class-woocommerce.php @@ -21,7 +21,7 @@ final class WooCommerce { * @var string */ public $version = '3.5.3'; - public $cc_version = '1.0.0'; + public $cc_version = '1.0.1'; /** * The single instance of the class.