diff --git a/.github/no-response.yml b/.github/no-response.yml index 3d0bde5..37cdea3 100644 --- a/.github/no-response.yml +++ b/.github/no-response.yml @@ -1,13 +1,13 @@ -# Configuration for probot-no-response - https://github.com/probot/no-response - -# Number of days of inactivity before an Issue is closed for lack of response -daysUntilClose: 7 -# Label requiring a response -responseRequiredLabel: waiting-customer-response -# Comment to post when closing an Issue for lack of response. Set to `false` to disable -closeComment: > - This issue has been automatically closed because there has been no response - to our request for more information from the original author. With only the - information that is currently in the issue, we don't have enough information - to take action. Please reach out if you have or find the answers we need so +# Configuration for probot-no-response - https://github.com/probot/no-response + +# Number of days of inactivity before an Issue is closed for lack of response +daysUntilClose: 7 +# Label requiring a response +responseRequiredLabel: waiting-customer-response +# Comment to post when closing an Issue for lack of response. Set to `false` to disable +closeComment: > + This issue has been automatically closed because there has been no response + to our request for more information from the original author. With only the + information that is currently in the issue, we don't have enough information + to take action. Please reach out if you have or find the answers we need so that we can investigate further. \ No newline at end of file diff --git a/Block/SocialShare.php b/Block/SocialShare.php index b152ad7..9152fac 100644 --- a/Block/SocialShare.php +++ b/Block/SocialShare.php @@ -22,6 +22,7 @@ namespace Mageplaza\SocialShare\Block; use Magento\Cms\Block\Page; +use Magento\Framework\Exception\NoSuchEntityException; use Magento\Framework\UrlInterface; use Magento\Framework\View\Element\Template; use Magento\Framework\View\Element\Template\Context; @@ -38,10 +39,10 @@ */ class SocialShare extends Template { - const SERVICES = ['facebook', 'twitter', 'google_plus', 'pinterest', 'linkedin', 'tumblr']; - const CLICK_FULL_MENU = '2'; - const CLICK_MENU = '1'; - const HOVER_MENU = '0'; + const SERVICES = ['facebook', 'twitter', 'facebook_messenger', 'pinterest', 'linkedin', 'tumblr']; + const CLICK_FULL_MENU = 2; + const CLICK_MENU = 1; + const HOVER_MENU = 0; /** * @var HelperData @@ -49,7 +50,7 @@ class SocialShare extends Template protected $_helperData; /** - * @var \Magento\Cms\Block\Page + * @var Page */ protected $_page; @@ -68,7 +69,7 @@ public function __construct( array $data = [] ) { $this->_helperData = $helperData; - $this->_page = $page; + $this->_page = $page; parent::__construct($context, $data); } @@ -91,15 +92,7 @@ public function isEnable() */ public function getIconColor() { - return $this->_helperData->getIconColor(); - } - - /** - * @return mixed - */ - public function getButtonColor() - { - return $this->_helperData->getButtonColor(); + return $this->_helperData->getButtonColor() . ',' . $this->_helperData->getIconColor(); } /** @@ -109,7 +102,7 @@ public function getBackgroundColor() { $color = $this->_helperData->getBackgroundColor(); - return "background: " . $color . ";"; + return 'background: ' . $color . ';'; } /** @@ -117,7 +110,7 @@ public function getBackgroundColor() */ public function getBorderRadius() { - return $this->_helperData->getBorderRadius() . "%"; + return $this->_helperData->getBorderRadius() . '%'; } /** @@ -129,15 +122,18 @@ public function isAddMoreShare() } /** + * @param string $service + * * @return string */ - public function getShareCounter() + public function getShareCounter($service) { - if ($this->_helperData->isShareCounter()) { - return "a2a_counter"; + $supportServices = ['facebook', 'pinterest', 'tumblr', 'a2a_dd']; + if ($this->_helperData->isShareCounter() && in_array($service, $supportServices, true)) { + return 'a2a_counter'; } - return ""; + return ''; } /** @@ -146,10 +142,10 @@ public function getShareCounter() public function getThankYou() { if ($this->_helperData->isThankYouPopup()) { - return "true"; + return 'true'; } - return "false"; + return 'false'; } /** @@ -160,7 +156,7 @@ public function getEnableService() $enableServices = []; foreach (self::SERVICES as $service) { if ($this->_helperData->isServiceEnable($service)) { - array_push($enableServices, $service); + $enableServices[] = $service; } } @@ -168,29 +164,28 @@ public function getEnableService() } /** - * @param $service + * @param string $service * - * @return string|null - * @throws \Magento\Framework\Exception\NoSuchEntityException + * @return string + * @throws NoSuchEntityException */ public function getImageUrl($service) { - $baseUrl = $this->_storeManager->getStore()->getBaseUrl(UrlInterface::URL_TYPE_MEDIA); + $baseUrl = $this->_storeManager->getStore()->getBaseUrl(UrlInterface::URL_TYPE_MEDIA); $modulePath = 'mageplaza/socialshare/'; - $imageUrl = null; - $imageUrl = $baseUrl . $modulePath . $service . '/' . $this->_helperData->getServiceImage($service); + $imageUrl = $baseUrl . $modulePath . $service . '/' . $this->_helperData->getServiceImage($service); return $imageUrl; } /** - * @param $service + * @param string $service * * @return bool */ public function isImageEnable($service) { - return $this->_helperData->getServiceImage($service) != null; + return $this->_helperData->getServiceImage($service) !== null; } /** @@ -200,20 +195,20 @@ public function getDisabledServices() { $disabledServices = []; foreach (self::SERVICES as $service) { - if ($this->_helperData->getDisableService($service) != null) { - array_push($disabledServices, $this->_helperData->getDisableService($service)); + if ($this->_helperData->getDisableService($service) !== null) { + $disabledServices[] = '"' . $this->_helperData->getDisableService($service) . '"'; } } - return implode(",", $disabledServices); + return implode(',', $disabledServices); } /** - * @return array|mixed + * @return int */ public function getNumberOfService() { - return $this->_helperData->getNumberOfServices(); + return (int) $this->_helperData->getNumberOfServices(); } /** @@ -222,7 +217,7 @@ public function getNumberOfService() public function getMenuType() { $menuType = $this->_helperData->getDisplayMenu(); - if ($menuType == DisplayMenu::ON_CLICK) { + if ($menuType === DisplayMenu::ON_CLICK) { if ($this->_helperData->isFullMenuOnClick()) { return self::CLICK_FULL_MENU; } @@ -239,10 +234,10 @@ public function getMenuType() public function getDisplayType() { $type = $this->getData('type'); - if ($type == 'float') { + if ($type === 'float') { return 'a2a_floating_style mp_social_share_float'; } - if ($type == 'inline') { + if ($type === 'inline') { return 'a2a_default_style'; } @@ -256,7 +251,7 @@ public function isDisplayInline() { $type = $this->getData('type'); - return $type == 'inline'; + return $type === 'inline'; } /** @@ -267,12 +262,8 @@ public function isDisplayInline() public function getContainerClass($displayType) { $position = $this->getData('position'); - if ($displayType == 'a2a_default_style') { - if ($position == 'under_cart') { - return "mp_social_share_inline_under_cart"; - } - - return "mp_social_share_inline"; + if ($displayType === 'a2a_default_style') { + return $position === 'under_cart' ? 'mp_social_share_inline_under_cart' : 'mp_social_share_inline'; } return null; @@ -289,33 +280,33 @@ public function getContainerClass($displayType) */ public function isThisPageEnable() { - $type = $this->getData('type'); - $thisPage = $this->getData('page'); + $type = $this->getData('type'); + $thisPage = $this->getData('page'); $allowPages = null; - if ($type == 'inline') { + if ($type === 'inline') { $allowPages = explode(',', $this->_helperData->getInlineApplyPages()); if ($this->isShowUnderCart()) { - array_push($allowPages, "under_cart"); + $allowPages[] = 'under_cart'; } - if (in_array($thisPage, $allowPages)) { + if (in_array($thisPage, $allowPages, true)) { return true; } } - if ($type == 'float') { - if ($this->_helperData->getFloatApplyPages() == FloatApplyFor::ALL_PAGES) { + if ($type === 'float') { + if ($this->_helperData->getFloatApplyPages() === FloatApplyFor::ALL_PAGES) { return true; } - if ($this->_helperData->getFloatApplyPages() == FloatApplyFor::SELECT_PAGES) { + if ($this->_helperData->getFloatApplyPages() === FloatApplyFor::SELECT_PAGES) { $selectPages = explode(',', $this->_helperData->getFloatSelectPages()); - $cmsPages = explode(',', $this->_helperData->getFloatCmsPages()); - if ($thisPage == "cms_page") { + $cmsPages = explode(',', $this->_helperData->getFloatCmsPages()); + if ($thisPage === 'cms_page') { $pageId = $this->_page->getPage()->getId(); - if (in_array($pageId, $cmsPages)) { + if (in_array($pageId, $cmsPages, true)) { return true; } } - if (in_array($thisPage, $selectPages)) { + if (in_array($thisPage, $selectPages, true)) { return true; } } @@ -337,17 +328,17 @@ public function isShowUnderCart() */ public function isThisPositionEnable() { - $thisPosition = $this->getData('position'); + $thisPosition = $this->getData('position'); $positionArray = []; - if ($thisPosition == "float_position") { + if ($thisPosition === 'float_position') { return true; } - $selectPosition = $this->_helperData->getInlinePosition(); - array_push($positionArray, $selectPosition); + $selectPosition = $this->_helperData->getInlinePosition(); + $positionArray[] = $selectPosition; if ($this->isShowUnderCart()) { - array_push($positionArray, "under_cart"); + $positionArray[] = 'under_cart'; } - if (in_array($thisPosition, $positionArray)) { + if (in_array($thisPosition, $positionArray, true)) { return true; } @@ -360,7 +351,7 @@ public function isThisPositionEnable() public function getButtonSize() { $type = $this->getData('type'); - if ($type == 'inline') { + if ($type === 'inline') { $inlineSize = $this->_helperData->getInlineButtonSize(); return $this->setButtonSize($inlineSize); @@ -371,30 +362,29 @@ public function getButtonSize() } /** - * @param $buttonSize + * @param string $buttonSize * * @return string */ public function setImageSize($buttonSize) { switch ($buttonSize) { - case "a2a_kit_size_16": - return 'width="16" height="16"'; - break; - case "a2a_kit_size_32": - return 'width="32" height="32"'; + case 'a2a_kit_size_16': + $imageSize = 'width="16" height="16"'; break; - case "a2a_kit_size_64": - return 'width="64" height="64"'; + case 'a2a_kit_size_64': + $imageSize = 'width="64" height="64"'; break; default: - return 'width="32" height="32"'; + $imageSize = 'width="32" height="32"'; break; } + + return $imageSize; } /** - * @param $buttonSize + * @param string $buttonSize * * @return string */ @@ -402,18 +392,17 @@ public function setButtonSize($buttonSize) { switch ($buttonSize) { case ButtonSize::SMALL: - return "a2a_kit_size_16"; - break; - case ButtonSize::MEDIUM: - return "a2a_kit_size_32"; + $buttonSizeStr = 'a2a_kit_size_16'; break; case ButtonSize::LARGE: - return "a2a_kit_size_64"; + $buttonSizeStr = 'a2a_kit_size_64'; break; default: - return "a2a_kit_size_32"; + $buttonSizeStr = 'a2a_kit_size_32'; break; } + + return $buttonSizeStr; } /** @@ -423,24 +412,21 @@ public function getFloatStyle() { if (!$this->isDisplayInline()) { $floatStyle = $this->_helperData->getFloatStyle(); - if ($floatStyle == Style::VERTICAL) { - return "a2a_vertical_style"; - } - return "a2a_default_style"; + return $floatStyle === Style::VERTICAL ? 'a2a_vertical_style' : 'a2a_default_style'; } return null; } /** - * @param $floatStyle + * @param string $floatStyle * * @return bool */ public function isVerticalStyle($floatStyle) { - return $floatStyle == "a2a_vertical_style"; + return $floatStyle === 'a2a_vertical_style'; } /** @@ -448,28 +434,19 @@ public function isVerticalStyle($floatStyle) */ public function getFloatPosition() { - $floatPosition = $this->_helperData->getFloatPosition(); - if ($floatPosition == FloatPosition::LEFT) { - return "left: 0px;"; - } - - return "right: 0px;"; + return $this->_helperData->getFloatPosition() === FloatPosition::LEFT ? 'left: 0px;' : 'right: 0px;'; } /** - * @param $type + * @param string $type * * @return string */ public function getFloatMargin($type) { - if ($type == "bottom") { - $floatMarginBottom = $this->_helperData->getFloatMarginBottom(); - - return "bottom: " . $floatMarginBottom . "px;"; - } - $floatMarginTop = $this->_helperData->getFloatMarginTop(); + $floatMarginTop = $this->_helperData->getFloatMarginTop(); + $floatMarginBottom = $this->_helperData->getFloatMarginBottom(); - return "top: " . $floatMarginTop . "px;"; + return $type === 'bottom' ? "bottom: {$floatMarginBottom}px;" : "top: {$floatMarginTop}px;"; } } diff --git a/CHANGELOG b/CHANGELOG index 0b79759..8ed9d16 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1 +1 @@ -CHANGELOG: https://www.mageplaza.com/releases/social-share/ +CHANGELOG: https://www.mageplaza.com/releases/social-share/ diff --git a/Helper/Data.php b/Helper/Data.php index 4beb54d..41ab23a 100644 --- a/Helper/Data.php +++ b/Helper/Data.php @@ -50,7 +50,7 @@ class Data extends AbstractData public function getIconColor($storeId = null) { $selectColor = $this->getConfigGeneral('icon_color', $storeId); - if ($selectColor == IconColor::CUSTOM) { + if ($selectColor === IconColor::CUSTOM) { return $this->getConfigGeneral('custom_icon_color', $storeId); } @@ -65,7 +65,7 @@ public function getIconColor($storeId = null) public function getButtonColor($storeId = null) { $selectColor = $this->getConfigGeneral('button_color', $storeId); - if ($selectColor == ButtonColor::CUSTOM) { + if ($selectColor === ButtonColor::CUSTOM) { return $this->getConfigGeneral('custom_button_color', $storeId); } @@ -80,7 +80,7 @@ public function getButtonColor($storeId = null) public function getBackgroundColor($storeId = null) { $selectColor = $this->getConfigGeneral('background_color', $storeId); - if ($selectColor == BackgroundColor::CUSTOM) { + if ($selectColor === BackgroundColor::CUSTOM) { return $this->getConfigGeneral('custom_background_color', $storeId); } diff --git a/LICENSE b/LICENSE index 87b119f..9e08325 100644 --- a/LICENSE +++ b/LICENSE @@ -1,33 +1,33 @@ -Copyright © 2016-present Mageplaza Co. Ltd. - -This License is entered by Mageplaza to govern the usage or redistribution of Mageplaza software. This is a legal agreement between you (either an individual or a single entity) and Mageplaza for Mageplaza software product(s) which may include extensions, templates and services. - -By purchasing, installing, or otherwise using Mageplaza products, you acknowledge that you have read this License and agree to be bound by the terms of this Agreement. If you do not agree to the terms of this License, do not install or use Mageplaza products. - -The Agreement becomes effective at the moment when you acquire software from our site or receive it through email or on data medium or by any other means. Mageplaza reserves the right to make reasonable changes to the terms of this license agreement and impose its clauses at any given time. - - 1. GRANT OF LICENSE: By purchasing a product of Mageplaza: - - 1. Customer will receive source code open 100%. - - 2. Customer will obtain a License Certificate which will remain valid until the Customer stops using the Product or until Mageplaza terminates this License because of Customer’s failure to comply with any of its Terms and Conditions. Each License Certificate includes a license serial which is valid for one live Magento installation only and unlimited test Magento installations. - - 3. You are allowed to customize our products to fit with your using purpose. - - 4. DESCRIPTION OF OTHER RIGHTS AND LIMITATIONS - - 5. Installation and Use - - 6. For each new Software installation, you are obliged to purchase a separate License. You are not permitted to use any part of the code in whole or part in any other software or product or website. You are legally bound to preserve the copyright information intact including the text/link at bottom. - - 2. Distribution: You are not allowed to distribute Mageplaza software to third parties. Any distribution without our permission, including non commercial distribution is considered as violation of this Agreement and entails liability, according to the current law. You may not place the Software onto a server that allows access to the Software via a public network or the Internet for distribution purposes. - - 3. Rental: You may not give, sell, sub-license, rent, lease or lend any portion of the Software to anyone. - - 4. Compliance with Applicable Laws: You must comply with all applicable laws regarding use of software products. Mageplaza software and a portion of it are protected by copyright laws and international copyright treaties, as well as other intellectual property laws and treaties. Accordingly, customer is required to treat the software like any other copyrighted material. Any activity violating copyright law will be prosecuted according to the current law. We retain the right to revoke the license of any user holding an invalid license. - - 5. TERMINATION: Without prejudice to any other rights, Mageplaza may terminate this License at any time if you fail to comply with the terms and conditions of this License. In such event, it constitutes a breach of the agreement, and your license to use the program is revoked and you must destroy all copies of Mageplaza products in your possession. After being notified of termination of your license, if you continue to use Mageplaza software, you hereby agree to accept an injunction to prevent you from its further use and to pay all costs (including but not limited to reasonable attorney fees) to enforce our revocation of your license and any damages suffered by us because of your misuse of the Software. We are not bound to return you the amount spent for purchase of the Software for the termination of this License. - - 6. LIMITATION OF LIABILITY: In no event shall Mageplaza be liable for any damages (including, without limitation, lost profits, business interruption, or lost information) rising out of ‘Authorized Users’ use of or inability to use the Mageplaza products, even if Mageplaza has been advised of the possibility of such damages. In no event will Mageplaza be liable for prosecution arising from use of the Software against law or for any illegal use. - +Copyright © 2016-present Mageplaza Co. Ltd. + +This License is entered by Mageplaza to govern the usage or redistribution of Mageplaza software. This is a legal agreement between you (either an individual or a single entity) and Mageplaza for Mageplaza software product(s) which may include extensions, templates and services. + +By purchasing, installing, or otherwise using Mageplaza products, you acknowledge that you have read this License and agree to be bound by the terms of this Agreement. If you do not agree to the terms of this License, do not install or use Mageplaza products. + +The Agreement becomes effective at the moment when you acquire software from our site or receive it through email or on data medium or by any other means. Mageplaza reserves the right to make reasonable changes to the terms of this license agreement and impose its clauses at any given time. + + 1. GRANT OF LICENSE: By purchasing a product of Mageplaza: + + 1. Customer will receive source code open 100%. + + 2. Customer will obtain a License Certificate which will remain valid until the Customer stops using the Product or until Mageplaza terminates this License because of Customer’s failure to comply with any of its Terms and Conditions. Each License Certificate includes a license serial which is valid for one live Magento installation only and unlimited test Magento installations. + + 3. You are allowed to customize our products to fit with your using purpose. + + 4. DESCRIPTION OF OTHER RIGHTS AND LIMITATIONS + + 5. Installation and Use + + 6. For each new Software installation, you are obliged to purchase a separate License. You are not permitted to use any part of the code in whole or part in any other software or product or website. You are legally bound to preserve the copyright information intact including the text/link at bottom. + + 2. Distribution: You are not allowed to distribute Mageplaza software to third parties. Any distribution without our permission, including non commercial distribution is considered as violation of this Agreement and entails liability, according to the current law. You may not place the Software onto a server that allows access to the Software via a public network or the Internet for distribution purposes. + + 3. Rental: You may not give, sell, sub-license, rent, lease or lend any portion of the Software to anyone. + + 4. Compliance with Applicable Laws: You must comply with all applicable laws regarding use of software products. Mageplaza software and a portion of it are protected by copyright laws and international copyright treaties, as well as other intellectual property laws and treaties. Accordingly, customer is required to treat the software like any other copyrighted material. Any activity violating copyright law will be prosecuted according to the current law. We retain the right to revoke the license of any user holding an invalid license. + + 5. TERMINATION: Without prejudice to any other rights, Mageplaza may terminate this License at any time if you fail to comply with the terms and conditions of this License. In such event, it constitutes a breach of the agreement, and your license to use the program is revoked and you must destroy all copies of Mageplaza products in your possession. After being notified of termination of your license, if you continue to use Mageplaza software, you hereby agree to accept an injunction to prevent you from its further use and to pay all costs (including but not limited to reasonable attorney fees) to enforce our revocation of your license and any damages suffered by us because of your misuse of the Software. We are not bound to return you the amount spent for purchase of the Software for the termination of this License. + + 6. LIMITATION OF LIABILITY: In no event shall Mageplaza be liable for any damages (including, without limitation, lost profits, business interruption, or lost information) rising out of ‘Authorized Users’ use of or inability to use the Mageplaza products, even if Mageplaza has been advised of the possibility of such damages. In no event will Mageplaza be liable for prosecution arising from use of the Software against law or for any illegal use. + The latest License: https://www.mageplaza.com/LICENSE.txt \ No newline at end of file diff --git a/Model/System/Config/Source/BackgroundColor.php b/Model/System/Config/Source/BackgroundColor.php index a0da418..60e5788 100644 --- a/Model/System/Config/Source/BackgroundColor.php +++ b/Model/System/Config/Source/BackgroundColor.php @@ -27,11 +27,11 @@ */ class BackgroundColor extends OptionArray { - const CUSTOM = "Custom"; - const NONE = "transparent"; - const WHITE = "#FFFFFF"; - const GRAY = "#808080"; - const BLACK = "#000000"; + const CUSTOM = 'Custom'; + const NONE = 'transparent'; + const WHITE = '#FFFFFF'; + const GRAY = '#808080'; + const BLACK = '#000000'; /** * @return array diff --git a/Model/System/Config/Source/ButtonColor.php b/Model/System/Config/Source/ButtonColor.php index 1dae027..2651ffd 100644 --- a/Model/System/Config/Source/ButtonColor.php +++ b/Model/System/Config/Source/ButtonColor.php @@ -27,11 +27,11 @@ */ class ButtonColor extends OptionArray { - const CUSTOM = "Custom"; - const WHITE = "#FFFFFF"; - const ORIGINAL = "unset"; - const GRAY = "#808080"; - const BLACK = "#000000"; + const CUSTOM = 'Custom'; + const WHITE = '#FFFFFF'; + const ORIGINAL = 'unset'; + const GRAY = '#808080'; + const BLACK = '#000000'; /** * @return array diff --git a/Model/System/Config/Source/ButtonSize.php b/Model/System/Config/Source/ButtonSize.php index 20c6637..421416b 100644 --- a/Model/System/Config/Source/ButtonSize.php +++ b/Model/System/Config/Source/ButtonSize.php @@ -27,9 +27,9 @@ */ class ButtonSize extends OptionArray { - const SMALL = "16x16"; - const MEDIUM = "32x32"; - const LARGE = "64x64"; + const SMALL = '16x16'; + const MEDIUM = '32x32'; + const LARGE = '64x64'; /** * @return array diff --git a/Model/System/Config/Source/DisplayMenu.php b/Model/System/Config/Source/DisplayMenu.php index 4ce1cd6..b2b97ed 100644 --- a/Model/System/Config/Source/DisplayMenu.php +++ b/Model/System/Config/Source/DisplayMenu.php @@ -27,8 +27,8 @@ */ class DisplayMenu extends OptionArray { - const ON_HOVER = "hover"; - const ON_CLICK = "click"; + const ON_HOVER = 'hover'; + const ON_CLICK = 'click'; /** * @return array diff --git a/Model/System/Config/Source/FloatApplyFor.php b/Model/System/Config/Source/FloatApplyFor.php index fe403d9..92a3342 100644 --- a/Model/System/Config/Source/FloatApplyFor.php +++ b/Model/System/Config/Source/FloatApplyFor.php @@ -27,8 +27,8 @@ */ class FloatApplyFor extends OptionArray { - const ALL_PAGES = "all_pages"; - const SELECT_PAGES = "select_pages"; + const ALL_PAGES = 'all_pages'; + const SELECT_PAGES = 'select_pages'; /** * @return array diff --git a/Model/System/Config/Source/FloatCmsPages.php b/Model/System/Config/Source/FloatCmsPages.php index 0c2a429..37503c2 100644 --- a/Model/System/Config/Source/FloatCmsPages.php +++ b/Model/System/Config/Source/FloatCmsPages.php @@ -30,7 +30,7 @@ class FloatCmsPages extends OptionArray { /** - * @var \Magento\Cms\Model\PageFactory + * @var PageFactory */ protected $_pageFactory; @@ -49,7 +49,7 @@ public function __construct(PageFactory $pageFactory) */ public function getOptionHash() { - $pages = $this->_pageFactory->create()->getCollection(); + $pages = $this->_pageFactory->create()->getCollection(); $cmsPages = []; foreach ($pages as $page) { diff --git a/Model/System/Config/Source/FloatPosition.php b/Model/System/Config/Source/FloatPosition.php index 9c2418c..59a67a8 100644 --- a/Model/System/Config/Source/FloatPosition.php +++ b/Model/System/Config/Source/FloatPosition.php @@ -27,8 +27,8 @@ */ class FloatPosition extends OptionArray { - const LEFT = "left"; - const RIGHT = "right"; + const LEFT = 'left'; + const RIGHT = 'right'; /** * @return array diff --git a/Model/System/Config/Source/FloatSelectPages.php b/Model/System/Config/Source/FloatSelectPages.php index fd6dc65..470f849 100644 --- a/Model/System/Config/Source/FloatSelectPages.php +++ b/Model/System/Config/Source/FloatSelectPages.php @@ -27,9 +27,9 @@ */ class FloatSelectPages extends OptionArray { - const CATEGORY_PAGE = "category_page"; - const PRODUCT_PAGE = "product_page"; - const CONTACT_US = "contact_us"; + const CATEGORY_PAGE = 'category_page'; + const PRODUCT_PAGE = 'product_page'; + const CONTACT_US = 'contact_us'; /** * @return array diff --git a/Model/System/Config/Source/IconColor.php b/Model/System/Config/Source/IconColor.php index 393574c..d336a43 100644 --- a/Model/System/Config/Source/IconColor.php +++ b/Model/System/Config/Source/IconColor.php @@ -27,10 +27,10 @@ */ class IconColor extends OptionArray { - const CUSTOM = "Custom"; - const WHITE = "#FFFFFF"; - const GRAY = "#808080"; - const BLACK = "#000000"; + const CUSTOM = 'Custom'; + const WHITE = '#FFFFFF'; + const GRAY = '#808080'; + const BLACK = '#000000'; /** * @return array diff --git a/Model/System/Config/Source/InlineApplyFor.php b/Model/System/Config/Source/InlineApplyFor.php index e5a3ffc..d475e88 100644 --- a/Model/System/Config/Source/InlineApplyFor.php +++ b/Model/System/Config/Source/InlineApplyFor.php @@ -27,9 +27,9 @@ */ class InlineApplyFor extends OptionArray { - const HOME_PAGE = "home_page"; - const CATEGORY_PAGE = "category_page"; - const PRODUCT_PAGE = "product_page"; + const HOME_PAGE = 'home_page'; + const CATEGORY_PAGE = 'category_page'; + const PRODUCT_PAGE = 'product_page'; /** * @return array diff --git a/Model/System/Config/Source/InlinePosition.php b/Model/System/Config/Source/InlinePosition.php index 259c3c5..24959b3 100644 --- a/Model/System/Config/Source/InlinePosition.php +++ b/Model/System/Config/Source/InlinePosition.php @@ -27,8 +27,8 @@ */ class InlinePosition extends OptionArray { - const TOP_CONTENT = "top_content"; - const BOTTOM_CONTENT = "bottom_content"; + const TOP_CONTENT = 'top_content'; + const BOTTOM_CONTENT = 'bottom_content'; /** * @return array diff --git a/Model/System/Config/Source/Style.php b/Model/System/Config/Source/Style.php index 8052d2e..8e0cee3 100644 --- a/Model/System/Config/Source/Style.php +++ b/Model/System/Config/Source/Style.php @@ -27,8 +27,8 @@ */ class Style extends OptionArray { - const HORIZONTAL = "horizontal"; - const VERTICAL = "vertical"; + const HORIZONTAL = 'horizontal'; + const VERTICAL = 'vertical'; /** * @return array diff --git a/USER-GUIDE.md b/USER-GUIDE.md index f0fc677..556b9d6 100644 --- a/USER-GUIDE.md +++ b/USER-GUIDE.md @@ -1,54 +1,54 @@ -## Documentation - -- Installation guide: https://www.mageplaza.com/install-magento-2-extension/#solution-1-ready-to-paste -- User Guide: https://docs.mageplaza.com/social-share/ -- Product page: https://www.mageplaza.com/magento-2-social-share/ -- FAQs: https://www.mageplaza.com/faqs/ -- Get Support: https://www.mageplaza.com/contact.html or support@mageplaza.com -- Changelog: https://www.mageplaza.com/releases/social-share/ -- License agreement: https://www.mageplaza.com/LICENSE.txt - -## How to install - -### Install ready-to-paste package (Recommended) - -- Installation guide: https://www.mageplaza.com/install-magento-2-extension/ - -## How to upgrade - -1. Backup - -Backup your Magento code, database before upgrading. - -2. Remove SocialShare folder - -In case of customization, you should backup the customized files and modify in newer version. -Now you remove `app/code/Mageplaza/SocialShare` folder. In this step, you can copy override SocialShare folder but this may cause of compilation issue. That why you should remove it. - -3. Upload new version -Upload this package to Magento root directory - -4. Run command line: - -``` -php bin/magento setup:upgrade -php bin/magento setup:static-content:deploy -``` - - -## FAQs - - -#### Q: I got error: `Mageplaza_Core has been already defined` -A: Read solution: https://github.com/mageplaza/module-core/issues/3 - - -#### Q: My site is down -A: Please follow this guide: https://www.mageplaza.com/blog/magento-site-down.html - - -## Support - -- FAQs: https://www.mageplaza.com/faqs/ -- https://mageplaza.freshdesk.com/ -- support@mageplaza.com +## Documentation + +- Installation guide: https://www.mageplaza.com/install-magento-2-extension/#solution-1-ready-to-paste +- User Guide: https://docs.mageplaza.com/social-share/ +- Product page: https://www.mageplaza.com/magento-2-social-share/ +- FAQs: https://www.mageplaza.com/faqs/ +- Get Support: https://www.mageplaza.com/contact.html or support@mageplaza.com +- Changelog: https://www.mageplaza.com/releases/social-share/ +- License agreement: https://www.mageplaza.com/LICENSE.txt + +## How to install + +### Install ready-to-paste package (Recommended) + +- Installation guide: https://www.mageplaza.com/install-magento-2-extension/ + +## How to upgrade + +1. Backup + +Backup your Magento code, database before upgrading. + +2. Remove SocialShare folder + +In case of customization, you should backup the customized files and modify in newer version. +Now you remove `app/code/Mageplaza/SocialShare` folder. In this step, you can copy override SocialShare folder but this may cause of compilation issue. That why you should remove it. + +3. Upload new version +Upload this package to Magento root directory + +4. Run command line: + +``` +php bin/magento setup:upgrade +php bin/magento setup:static-content:deploy +``` + + +## FAQs + + +#### Q: I got error: `Mageplaza_Core has been already defined` +A: Read solution: https://github.com/mageplaza/module-core/issues/3 + + +#### Q: My site is down +A: Please follow this guide: https://www.mageplaza.com/blog/magento-site-down.html + + +## Support + +- FAQs: https://www.mageplaza.com/faqs/ +- https://mageplaza.freshdesk.com/ +- support@mageplaza.com diff --git a/composer.json b/composer.json index 2466c52..4fb7fd6 100644 --- a/composer.json +++ b/composer.json @@ -1,26 +1,26 @@ -{ - "name": "mageplaza/module-social-share", - "description": "Magento 2 Social Share Extension", - "require": { - "mageplaza/module-core": "^1.4.0" - }, - "type": "magento2-module", - "version": "1.0.0", - "license": "proprietary", - "authors": [ - { - "name": "Mageplaza", - "email": "support@mageplaza.com", - "homepage": "https://www.mageplaza.com", - "role": "Technical Support" - } - ], - "autoload": { - "files": [ - "registration.php" - ], - "psr-4": { - "Mageplaza\\SocialShare\\": "" - } - } -} +{ + "name": "mageplaza/module-social-share", + "description": "Magento 2 Social Share Extension", + "require": { + "mageplaza/module-core": "^1.4.5" + }, + "type": "magento2-module", + "version": "1.0.1", + "license": "proprietary", + "authors": [ + { + "name": "Mageplaza", + "email": "support@mageplaza.com", + "homepage": "https://www.mageplaza.com", + "role": "Technical Support" + } + ], + "autoload": { + "files": [ + "registration.php" + ], + "psr-4": { + "Mageplaza\\SocialShare\\": "" + } + } +} diff --git a/etc/acl.xml b/etc/acl.xml index c357d1b..c026584 100644 --- a/etc/acl.xml +++ b/etc/acl.xml @@ -1,37 +1,37 @@ - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/etc/adminhtml/system.xml b/etc/adminhtml/system.xml index 82a0319..01937c0 100644 --- a/etc/adminhtml/system.xml +++ b/etc/adminhtml/system.xml @@ -1,264 +1,267 @@ - - - - -
- - mageplaza - Mageplaza_SocialShare::configuration - - - - - Magento\Config\Model\Config\Source\Yesno - Yes to enable this module]]> - - - - Mageplaza\SocialShare\Model\System\Config\Source\IconColor - Only apply for default icon - - - jscolor {hash:true,refine:false} - - Custom - - - - - Mageplaza\SocialShare\Model\System\Config\Source\ButtonColor - Only apply for default icon - - - jscolor {hash:true,refine:false} - - Custom - - - - - Mageplaza\SocialShare\Model\System\Config\Source\BackgroundColor - - - jscolor {hash:true,refine:false} - - Custom - - - - - The unit is %, ranging from 0% to 50%. - required-entry validate-digits validate-digits-range digits-range-0-50 - - - - Magento\Config\Model\Config\Source\Yesno - - - - Display after customers' sharing action. - Magento\Config\Model\Config\Source\Yesno - - - - - - Magento\Config\Model\Config\Source\Yesno - - - - Magento\Config\Model\Config\Backend\Image - mageplaza/socialshare/facebook - mageplaza/socialshare/facebook - If empty, the default icon will be used. - - - - - - - Magento\Config\Model\Config\Source\Yesno - - - - Magento\Config\Model\Config\Backend\Image - mageplaza/socialshare/twitter - mageplaza/socialshare/twitter - If empty, the default icon will be used. - - - - - - - Magento\Config\Model\Config\Source\Yesno - - - - Magento\Config\Model\Config\Backend\Image - mageplaza/socialshare/google_plus - mageplaza/socialshare/google - If empty, the default icon will be used. - - - - - - - Magento\Config\Model\Config\Source\Yesno - - - - Magento\Config\Model\Config\Backend\Image - mageplaza/socialshare/pinterest - mageplaza/socialshare/pinterest - If empty, the default icon will be used. - - - - - - - Magento\Config\Model\Config\Source\Yesno - - - - Magento\Config\Model\Config\Backend\Image - mageplaza/socialshare/linkedin - mageplaza/socialshare/linkedIn - If empty, the default icon will be used. - - - - - - - Magento\Config\Model\Config\Source\Yesno - - - - Magento\Config\Model\Config\Backend\Image - mageplaza/socialshare/tumblr - mageplaza/socialshare/tumblr - If empty, the default icon will be used. - - - - - - - Magento\Config\Model\Config\Source\Yesno - - - - Mageplaza\SocialShare\Model\System\Config\Source\DisplayMenu - - - - Magento\Config\Model\Config\Source\Yesno - - click - - - - - required-entry validate-digits validate-digits-range digits-range-1-400 - - 0 - - - - - - - - - Mageplaza\SocialShare\Model\System\Config\Source\FloatApplyFor - - - Mageplaza\SocialShare\Model\System\Config\Source\FloatSelectPages - - - select_pages - - - - Mageplaza\SocialShare\Model\System\Config\Source\FloatCmsPages - - - select_pages - - - - - Mageplaza\SocialShare\Model\System\Config\Source\Style - - - - Mageplaza\SocialShare\Model\System\Config\Source\FloatPosition - - - - Specify the top margin of sharing button block. Default is 150px. - required-entry validate-digits validate-digits-range digits-range-0-1000 - - vertical - - - - - Specify the bottom margin of sharing button block. Default is 0px. - required-entry validate-digits validate-digits-range digits-range-0-1000 - - horizontal - - - - - Mageplaza\SocialShare\Model\System\Config\Source\ButtonSize - 32x32 px button size is recommended. - - - - - - - Mageplaza\SocialShare\Model\System\Config\Source\InlineApplyFor - - - - Mageplaza\SocialShare\Model\System\Config\Source\InlinePosition - - - - Magento\Config\Model\Config\Source\Yesno - - - - Mageplaza\SocialShare\Model\System\Config\Source\ButtonSize - 32x32 px button size is recommended. - - -
-
+ + + + +
+ + mageplaza + Mageplaza_SocialShare::configuration + + + + + Magento\Config\Model\Config\Source\Yesno + Yes to enable this module]]> + + + + Mageplaza\SocialShare\Model\System\Config\Source\IconColor + Only apply for default icon + + + + jscolor {hash:true,refine:false} + + Custom + + + + + Mageplaza\SocialShare\Model\System\Config\Source\ButtonColor + Only apply for default icon + + + + jscolor {hash:true,refine:false} + + Custom + + + + + Mageplaza\SocialShare\Model\System\Config\Source\BackgroundColor + + + + jscolor {hash:true,refine:false} + + Custom + + + + + The unit is %, ranging from 0% to 50%. + required-entry validate-digits validate-digits-range digits-range-0-50 + + + + Magento\Config\Model\Config\Source\Yesno + + + + Display after customers' sharing action. + Magento\Config\Model\Config\Source\Yesno + + + + + + Magento\Config\Model\Config\Source\Yesno + + + + Magento\Config\Model\Config\Backend\Image + mageplaza/socialshare/facebook + mageplaza/socialshare/facebook + If empty, the default icon will be used. + + + + + + + Magento\Config\Model\Config\Source\Yesno + + + + Magento\Config\Model\Config\Backend\Image + mageplaza/socialshare/twitter + mageplaza/socialshare/twitter + If empty, the default icon will be used. + + + + + + + Magento\Config\Model\Config\Source\Yesno + + + + Magento\Config\Model\Config\Backend\Image + mageplaza/socialshare/facebook_messenger + mageplaza/socialshare/facebook_messenger + If empty, the default icon will be used. + + + + + + + Magento\Config\Model\Config\Source\Yesno + + + + Magento\Config\Model\Config\Backend\Image + mageplaza/socialshare/pinterest + mageplaza/socialshare/pinterest + If empty, the default icon will be used. + + + + + + + Magento\Config\Model\Config\Source\Yesno + + + + Magento\Config\Model\Config\Backend\Image + mageplaza/socialshare/linkedin + mageplaza/socialshare/linkedin + If empty, the default icon will be used. + + + + + + + Magento\Config\Model\Config\Source\Yesno + + + + Magento\Config\Model\Config\Backend\Image + mageplaza/socialshare/tumblr + mageplaza/socialshare/tumblr + If empty, the default icon will be used. + + + + + + + Magento\Config\Model\Config\Source\Yesno + + + + Mageplaza\SocialShare\Model\System\Config\Source\DisplayMenu + + + + Magento\Config\Model\Config\Source\Yesno + + click + + + + + required-entry validate-digits validate-digits-range digits-range-1-400 + + 0 + + + + + + + + + Mageplaza\SocialShare\Model\System\Config\Source\FloatApplyFor + + + Mageplaza\SocialShare\Model\System\Config\Source\FloatSelectPages + + + select_pages + + + + Mageplaza\SocialShare\Model\System\Config\Source\FloatCmsPages + + + select_pages + + + + + Mageplaza\SocialShare\Model\System\Config\Source\Style + + + + Mageplaza\SocialShare\Model\System\Config\Source\FloatPosition + + + + Specify the top margin of sharing button block. Default is 150px. + required-entry validate-digits validate-digits-range digits-range-0-1000 + + vertical + + + + + Specify the bottom margin of sharing button block. Default is 0px. + required-entry validate-digits validate-digits-range digits-range-0-1000 + + horizontal + + + + + Mageplaza\SocialShare\Model\System\Config\Source\ButtonSize + 32x32 px button size is recommended. + + + + + + + Mageplaza\SocialShare\Model\System\Config\Source\InlineApplyFor + + + + Mageplaza\SocialShare\Model\System\Config\Source\InlinePosition + + + + Magento\Config\Model\Config\Source\Yesno + + + + Mageplaza\SocialShare\Model\System\Config\Source\ButtonSize + 32x32 px button size is recommended. + + +
+
\ No newline at end of file diff --git a/etc/config.xml b/etc/config.xml index ab725e1..078d450 100644 --- a/etc/config.xml +++ b/etc/config.xml @@ -1,81 +1,81 @@ - - - - - - - 1 - - - 1 - #FFFFFF - #FFFFFF - unset - #FFFFFF - #FFFFFF - #FFFFFF - 0 - 1 - 1 - - 1 - - - 1 - - - 1 - - - 1 - - - 1 - - - 1 - - - 1 - click - 0 - 8 - - - - all_pages - - left - 150 - 0 - 32x32 - - - home_page - bottom_content - 1 - 32x32 - - - + + + + + + + 1 + + + 1 + #FFFFFF + #FFFFFF + unset + #FFFFFF + #FFFFFF + #FFFFFF + 0 + 1 + 1 + + 1 + + + 1 + + + 1 + + + 1 + + + 1 + + + 1 + + + 1 + click + 0 + 8 + + + + all_pages + + left + 150 + 0 + 32x32 + + + home_page + bottom_content + 1 + 32x32 + + + \ No newline at end of file diff --git a/etc/module.xml b/etc/module.xml index 0aa3b2e..265f66d 100644 --- a/etc/module.xml +++ b/etc/module.xml @@ -1,29 +1,29 @@ - - - - - - - - - + + + + + + + + + diff --git a/i18n/en_US.csv b/i18n/en_US.csv index e6b0db8..8267b22 100644 --- a/i18n/en_US.csv +++ b/i18n/en_US.csv @@ -27,8 +27,11 @@ Enable,Enable "Select Yes to enable this module","Select Yes to enable this module" "Icon Color","Icon Color" "Only apply for default icon","Only apply for default icon" +"Custom Icon Color","Custom Icon Color" "Button Color","Button Color" +"Custom Button Color","Custom Button Color" "Background Color","Background Color" +"Custom Background Color","Custom Background Color" "Border Radius","Border Radius" "The unit is %, ranging from 0% to 50%.","The unit is %, ranging from 0% to 50%." "Enable Share Counter","Enable Share Counter" @@ -38,7 +41,7 @@ Facebook,Facebook Image,Image "If empty, the default icon will be used.","If empty, the default icon will be used." Twitter,Twitter -Google+,Google+ +"Facebook Messenger","Facebook Messenger" Pinterest,Pinterest LinkedIn,LinkedIn Tumblr,Tumblr diff --git a/registration.php b/registration.php index b468db5..2397e19 100644 --- a/registration.php +++ b/registration.php @@ -19,8 +19,10 @@ * @license https://www.mageplaza.com/LICENSE.txt */ -\Magento\Framework\Component\ComponentRegistrar::register( - \Magento\Framework\Component\ComponentRegistrar::MODULE, +use Magento\Framework\Component\ComponentRegistrar; + +ComponentRegistrar::register( + ComponentRegistrar::MODULE, 'Mageplaza_SocialShare', __DIR__ ); diff --git a/travis.yml b/travis.yml index b2faef8..d6099f3 100644 --- a/travis.yml +++ b/travis.yml @@ -1,65 +1,65 @@ -language: php -php: - - 7.0 - - 7.1 - - 7.2 -sudo: required -dist: trusty -env: - global: - - COMPOSER_BIN_DIR=~/bin - - INTEGRATION_SETS=3 - - NODE_JS_VERSION=6 - - MAGENTO_HOST_NAME="magento2.travis" - - COMPOSER_MODULE=mageplaza/module-social-share - matrix: - - MAGENTO_VERSION=2.2.1 TEST_SUITE=integration INTEGRATION_INDEX=1 - - MAGENTO_VERSION=2.2.1 TEST_SUITE=integration INTEGRATION_INDEX=2 - - MAGENTO_VERSION=2.2.1 TEST_SUITE=integration INTEGRATION_INDEX=3 - - MAGENTO_VERSION=2.2.2 TEST_SUITE=static - - MAGENTO_VERSION=2.2.2 TEST_SUITE=js GRUNT_COMMAND=static - - MAGENTO_VERSION=2.2.2 TEST_SUITE=integration INTEGRATION_INDEX=1 - - MAGENTO_VERSION=2.2.2 TEST_SUITE=integration INTEGRATION_INDEX=2 - - MAGENTO_VERSION=2.2.2 TEST_SUITE=integration INTEGRATION_INDEX=3 - -matrix: - exclude: - - php: 7.0 - env: MAGENTO_VERSION=2.2.2 TEST_SUITE=js GRUNT_COMMAND=static - - php: 7.0 - env: MAGENTO_VERSION=2.2.2 TEST_SUITE=static -cache: - apt: true - directories: - - "$HOME/.composer/cache" - - "$HOME/.nvm" -addons: - apt: - packages: - - mysql-server-5.6 - - mysql-client-core-5.6 - - mysql-client-5.6 - - postfix - firefox: '46.0' - hosts: - - magento2.travis -before_install: -- git clone https://github.com/magento/magento2 --branch $MAGENTO_VERSION -- cd magento2 -- bash ./dev/travis/before_install.sh -install: -- composer install --no-interaction --prefer-dist -- composer require $COMPOSER_MODULE -before_script: -#- cp -f ${TRAVIS_BUILD_DIR}/dev/tests/integration/phpunit.xml.dist dev/tests/integration/ -- echo "vendor/$COMPOSER_MODULE" > dev/tests/static/testsuite/Magento/Test/Less/_files/whitelist/common.txt -- echo "vendor/$COMPOSER_MODULE" > dev/tests/static/testsuite/Magento/Test/Php/_files/whitelist/common.txt -- echo "vendor/$COMPOSER_MODULE/**/*.js" > dev/tests/static/testsuite/Magento/Test/Js/_files/whitelist/magento.txt -- bash ./dev/travis/before_script.sh -script: -- test $TEST_SUITE = "static" && TEST_FILTER='--filter "Magento\\Test\\Php\\LiveCodeTest"' || true -- test $TEST_SUITE = "functional" && TEST_FILTER='dev/tests/functional/testsuites/Magento/Mtf/TestSuite/InjectableTests.php' || true -- if [ $TEST_SUITE == "functional" ]; then dev/tests/functional/vendor/phpunit/phpunit/phpunit -c dev/tests/$TEST_SUITE $TEST_FILTER; fi -- if [ $TEST_SUITE != "functional" ] && [ $TEST_SUITE != "js" ]; then phpunit -c dev/tests/$TEST_SUITE $TEST_FILTER; fi -- if [ $TEST_SUITE == "js" ]; then grunt $GRUNT_COMMAND; fi - +language: php +php: + - 7.0 + - 7.1 + - 7.2 +sudo: required +dist: trusty +env: + global: + - COMPOSER_BIN_DIR=~/bin + - INTEGRATION_SETS=3 + - NODE_JS_VERSION=6 + - MAGENTO_HOST_NAME="magento2.travis" + - COMPOSER_MODULE=mageplaza/module-social-share + matrix: + - MAGENTO_VERSION=2.2.1 TEST_SUITE=integration INTEGRATION_INDEX=1 + - MAGENTO_VERSION=2.2.1 TEST_SUITE=integration INTEGRATION_INDEX=2 + - MAGENTO_VERSION=2.2.1 TEST_SUITE=integration INTEGRATION_INDEX=3 + - MAGENTO_VERSION=2.2.2 TEST_SUITE=static + - MAGENTO_VERSION=2.2.2 TEST_SUITE=js GRUNT_COMMAND=static + - MAGENTO_VERSION=2.2.2 TEST_SUITE=integration INTEGRATION_INDEX=1 + - MAGENTO_VERSION=2.2.2 TEST_SUITE=integration INTEGRATION_INDEX=2 + - MAGENTO_VERSION=2.2.2 TEST_SUITE=integration INTEGRATION_INDEX=3 + +matrix: + exclude: + - php: 7.0 + env: MAGENTO_VERSION=2.2.2 TEST_SUITE=js GRUNT_COMMAND=static + - php: 7.0 + env: MAGENTO_VERSION=2.2.2 TEST_SUITE=static +cache: + apt: true + directories: + - "$HOME/.composer/cache" + - "$HOME/.nvm" +addons: + apt: + packages: + - mysql-server-5.6 + - mysql-client-core-5.6 + - mysql-client-5.6 + - postfix + firefox: '46.0' + hosts: + - magento2.travis +before_install: +- git clone https://github.com/magento/magento2 --branch $MAGENTO_VERSION +- cd magento2 +- bash ./dev/travis/before_install.sh +install: +- composer install --no-interaction --prefer-dist +- composer require $COMPOSER_MODULE +before_script: +#- cp -f ${TRAVIS_BUILD_DIR}/dev/tests/integration/phpunit.xml.dist dev/tests/integration/ +- echo "vendor/$COMPOSER_MODULE" > dev/tests/static/testsuite/Magento/Test/Less/_files/whitelist/common.txt +- echo "vendor/$COMPOSER_MODULE" > dev/tests/static/testsuite/Magento/Test/Php/_files/whitelist/common.txt +- echo "vendor/$COMPOSER_MODULE/**/*.js" > dev/tests/static/testsuite/Magento/Test/Js/_files/whitelist/magento.txt +- bash ./dev/travis/before_script.sh +script: +- test $TEST_SUITE = "static" && TEST_FILTER='--filter "Magento\\Test\\Php\\LiveCodeTest"' || true +- test $TEST_SUITE = "functional" && TEST_FILTER='dev/tests/functional/testsuites/Magento/Mtf/TestSuite/InjectableTests.php' || true +- if [ $TEST_SUITE == "functional" ]; then dev/tests/functional/vendor/phpunit/phpunit/phpunit -c dev/tests/$TEST_SUITE $TEST_FILTER; fi +- if [ $TEST_SUITE != "functional" ] && [ $TEST_SUITE != "js" ]; then phpunit -c dev/tests/$TEST_SUITE $TEST_FILTER; fi +- if [ $TEST_SUITE == "js" ]; then grunt $GRUNT_COMMAND; fi + diff --git a/view/frontend/layout/catalog_category_view.xml b/view/frontend/layout/catalog_category_view.xml index e4a0bd6..079efd5 100644 --- a/view/frontend/layout/catalog_category_view.xml +++ b/view/frontend/layout/catalog_category_view.xml @@ -1,52 +1,52 @@ - - - - - - - - category_page - top_content - inline - - - - - - - category_page - float - float_position - - - - - category_page - bottom_content - inline - - - - - - + + + + + + + + category_page + top_content + inline + + + + + + + category_page + float + float_position + + + + + category_page + bottom_content + inline + + + + + + diff --git a/view/frontend/layout/catalog_product_view.xml b/view/frontend/layout/catalog_product_view.xml index d63c529..f480ab8 100644 --- a/view/frontend/layout/catalog_product_view.xml +++ b/view/frontend/layout/catalog_product_view.xml @@ -1,64 +1,64 @@ - - - - - - - - product_page - top_content - inline - - - - - - - - - under_cart - under_cart - inline - - - - - - - - - product_page - float_position - float - - - - - product_page - bottom_content - inline - - - - - + + + + + + + + product_page + top_content + inline + + + + + + + + + under_cart + under_cart + inline + + + + + + + + + product_page + float_position + float + + + + + product_page + bottom_content + inline + + + + + diff --git a/view/frontend/layout/cms_index_index.xml b/view/frontend/layout/cms_index_index.xml index 80b4974..0672c01 100644 --- a/view/frontend/layout/cms_index_index.xml +++ b/view/frontend/layout/cms_index_index.xml @@ -1,49 +1,49 @@ - - - - - - - - home_page - top_content - inline - - - - - home_page - bottom_content - inline - - - - - cms_page - float_position - float - - - - - + + + + + + + + home_page + top_content + inline + + + + + home_page + bottom_content + inline + + + + + cms_page + float_position + float + + + + + diff --git a/view/frontend/layout/cms_page_view.xml b/view/frontend/layout/cms_page_view.xml index 8ab4801..3483038 100644 --- a/view/frontend/layout/cms_page_view.xml +++ b/view/frontend/layout/cms_page_view.xml @@ -1,35 +1,35 @@ - - - - - - - - cms_page - float_position - float - - - - - + + + + + + + + cms_page + float_position + float + + + + + diff --git a/view/frontend/layout/contact_index_index.xml b/view/frontend/layout/contact_index_index.xml index 046d363..7283e64 100644 --- a/view/frontend/layout/contact_index_index.xml +++ b/view/frontend/layout/contact_index_index.xml @@ -1,35 +1,35 @@ - - - - - - - - contact_us - float_position - float - - - - - + + + + + + + + contact_us + float_position + float + + + + + diff --git a/view/frontend/layout/default.xml b/view/frontend/layout/default.xml index 9219756..78c26f5 100644 --- a/view/frontend/layout/default.xml +++ b/view/frontend/layout/default.xml @@ -1,34 +1,37 @@ - - - - - - - - float_position - float - - - - - + + + + + diff --git a/view/frontend/web/js/config.js b/view/frontend/web/js/config.js deleted file mode 100644 index 2636c40..0000000 --- a/view/frontend/web/js/config.js +++ /dev/null @@ -1,50 +0,0 @@ -/** - * Mageplaza - * - * NOTICE OF LICENSE - * - * This source file is subject to the Mageplaza.com license that is - * available through the world-wide-web at this URL: - * https://www.mageplaza.com/LICENSE.txt - * - * DISCLAIMER - * - * Do not edit or add to this file if you wish to upgrade this extension to newer - * version in the future. - * - * @category Mageplaza - * @package Mageplaza_SocialShare - * @copyright Copyright (c) Mageplaza (https://www.mageplaza.com/) - * @license https://www.mageplaza.com/LICENSE.txt - */ - -define([ - 'jquery', - 'uiComponent' -], function ($, component) { - 'use strict'; - return component.extend({ - initialize: function (config) { - require(['https://static.addtoany.com/menu/page.js']); - - var buttonColor = config.buttonColor, - iconColor = config.iconColor, - onClick = config.click, - popUp = config.popUp, - noService = config.service, - disabled = config.disable; - - var a2a = $('.a2a_kit'); - - var a2aJS = ''; - a2a.append(a2aJS); - } - }); -});