Giter Site home page Giter Site logo

magento2-module-seo's People

Contributors

audef1 avatar avstudnitz avatar davidlambauer avatar gtlt avatar nunziodev avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

magento2-module-seo's Issues

Type hints in AlternativeUrlService mean that we can't use DI to override a class

Hola All,

The type hints in the AlternativeUrlService are against a specific implementation class rather than an interface. Accordingly, with the strict type hitns, we can't replace the class. See

https://github.com/staempfli/magento2-module-seo/blob/develop/Service/HrefLang/AlternativeUrlService.php#L27

Ideally I would replace these with interfaces, and set a preference to consume the implementation in this interface. This would allow a nice clean override of that class as required, with another that implemented the required interface.

For now, this DI doesn't 'work:

<?xml version="1.0" encoding="UTF-8" ?>
<!--
/**
 * An extension that creates an association between CMS pages of different stores, such that the appropriate redirects
 * or links can be mapped.
 */
-->
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
        xsi:noNamespaceSchemaLocation="urn:magento:framework:Api/etc/extension_attributes.xsd">

    <preference for="Staempfli\Seo\Service\HrefLang\CmsPageUrlRetriever"
                type="Sitewards\Seo\Service\HrefLang\CmsPageUrlRetriever
CmsPageUrlRetriever" />
</config>

The class does implement an interface, but because 4 different types of concrete implementation implement that interface we can't modify the type hints there either.

does not share image on twitter card

I am not able to share product image to Twitter cause as pointed in different post regarding this problem (but not specifically with Magento2 and your extension) Twitter has changed twitter:image to twitter:image:src

where do I change this?

Error: Malformed UTF-8 characters, possibly incorrectly encoded

\Staempfli\Seo\Model\Property::getFilteredInput filters data incorrectly when using non-english characters in product description, which causes
\Staempfli\Seo\Model\Property::setDescription to set og:description and twitter:description to the value containing non-utf8 character. This non-utf8 character crashes Magento2 when trying to execute
\Magento\Framework\App\PageCache\Kernel::process:151

Example product description:

<p>Kurtka robocza HAMMER z odpinanymi rękawami co daje nam bezrękawnik.</p>
<p><strong>Charakterystyka:</strong></p>
<ul>
<li>Gramatura: 270 g/m2</li>
<li>Kurtka wykonana z T/S 35% bawełna / 65% poliester</li>
<li>Dodatki wzmacniające wykonane z materiału odpornego na ścieranie/rozerwanie - oxford</li>
<li>Posiada odpinane rękawy</li>
<li>Kolor: szary</li>
</ul>
<p><strong>Zastosowanie:</strong></p>
<ul>
<li>Prace budowlane</li>
<li>Terenowe</li>
<li>W warsztatach samochodowych</li>
</ul>

html meta tag generated by Staempfli\Seo module:
<meta property="og:description" content="Kurtka robocza HAMMER z odpinanymi rękawami co daje nam bezrękawnik.Charakterystyka:Gramatura: 270 g/m2Kurtka wykonana z T/S 35% bawełna / 65% poliesterDodatki wzmacniające wykonane z materia� ..." />

Preconditions (*)

"staempfli/magento2-module-seo": "^1.7"
Magento 2.x

Steps to reproduce (*)

  1. Set product description that have non-english character at the end of the substr
  2. Save product
  3. Product Detail Page won't load and throw Exception #0 (InvalidArgumentException): Unable to serialize value. Error: Malformed UTF-8 characters, possibly incorrectly encoded

Expected result (*)

PDP loads correctly.

Actual result (*)

PDP throws exception.

[SEO Problem] Wrong product url hreflang

Hi,
I found an error on hreflang url in all product page.
The hreflang url not include the category path.

This is my solution at the problem, and work for me. ;-)

Fixed file:
magento/vendor/staempfli/magento2-module-seo/Service/HrefLang/ProductUrlRetriever.php

namespace Staempfli\Seo\Service\HrefLang;

use Magento\Catalog\Api\ProductRepositoryInterface;
use Magento\Catalog\Model\Product;
use Magento\CatalogUrlRewrite\Model\ProductUrlPathGenerator;
use Magento\Store\Model\Store;
use Staempfli\Seo\Api\ProductUrlRetrieverInterface;
use Staempfli\Seo\Service\HrefLang\CategoryUrlRetriever; //FIX

class ProductUrlRetriever implements ProductUrlRetrieverInterface
{
    /**
     * @var ProductRepositoryInterface
     */
    private $productRepository;
    /**
     * @var ProductUrlPathGenerator
     */
    private $productUrlPathGenerator;
    /**
     * @var CategoryUrlRetriever
     */
    private $categoryUrlRetriever;

    public function __construct(
        ProductRepositoryInterface $productRepository,
        ProductUrlPathGenerator $productUrlPathGenerator,
        CategoryUrlRetriever $categoryUrlRetriever
    ) {
        $this->productRepository = $productRepository;
        $this->productUrlPathGenerator = $productUrlPathGenerator;
        $this->categoryUrlRetriever = $categoryUrlRetriever; //FIX
    }

    /**
     * @param int $identifier the product ID
     * @param Store $store
     * @return string
     */
    public function getUrl($identifier, $store)
    {
        /** @var Product $product */
        $product = $this->productRepository->getById($identifier, false, $store->getId());
        $path = $this->productUrlPathGenerator->getUrlPathWithSuffix($product, $store->getId());
        //FIX
        if(!empty($product->getCategoryId())) {
            $categoryUrl = $this->categoryUrlRetriever->getUrl($product->getCategoryId(), $store);
            if(!empty($categoryUrl)) {
                return $categoryUrl . '/' . $path;
            }
        }
        return $store->getBaseUrl() . $path; 
    }
}

Magento 2.4 support

Hi, I'm upgrading to Magento 2.4, but this module is causing my upgrade to fail since there is no newer version. Is it possible to add support to 2.4, or this project is abandoned?

Add a tag on master branch

Hi, can you add a tag on master branch so that we don't have to use dev-master as composer version? It's really unsecure to use dev-master. The last tag is a bit outdated and hasn't some fixes and features

Missing argument 3 in afterGetModulesByFrontName()

Hello guys,

I have installed this module in Magento 2.1.15 and I get this error:

Exception #0 (Exception): Warning: Missing argument 3 for Staempfli\Seo\Plugin\RouteConfigPlugin::afterGetModulesByFrontName(), called in /lib/internal/Magento/Framework/Interception/Interceptor.php on line 152 and defined in /vendor/staempfli/magento2-module-seo/Plugin/RouteConfigPlugin.php on line 19

Any idea?

Set specific description tags in home cms page

I need to set a specific twitter:description and og:description tags for homepage, but i can't override your vendor\staempfli\magento2-module-seo\Model\Property.php class into my local pool, since is being declared as final. Is there any way to modify Property class behaviour?

Each language version must list itself as well as all other language versions

Hi,

Your module seems to exclude the current store for the alternate links even though it is specified in google that it must list itself.

Our SEO specialist is also confirming this.

Google documentation on alternate links: "Each language version must list itself as well as all other language versions"
https://support.google.com/webmasters/answer/189077?hl=en

Code involved:

if ((!$this->isCurrentStore($store)) && $url = $this->getStoreUrl($store)) {

href alternative lang page links at website scope?

Is there a way to get this module to display href alternate lang tags for pages at website scope levels?

I have Magento 2 setup like this:

website 1: example.com/gb (UK website)
website 2: example.com/us (US website)
website 2: example.com/fr (France website)
website 3: example.com/de (Germany website)

The categories, menu and products are all identical. They have just been translated to accommodate more languages.

Flat category and multiple stores cause the NoSuchEntityException

Hi,
We set different stores in Magento 2. When we choose flat category option, the function getAlternatives:
staempfli/magento2-module-seo/Block/HrefLang.php Line 39-43

public function getAlternatives()
    {
        $data = [];
        foreach ($this->getStores() as $store) {
            if ((!$this->isCurrentStore($store)) && $url = $this->getStoreUrl($store)) {
                $data[$this->getLocaleCode($store)] = $url;
            }
        }
        return $data;
    }

will cause
magento/module-catalog/Model/CategoryRepository.php 141
to throw exception:

public function get($categoryId, $storeId = null)
    {
        $cacheKey = null !== $storeId ? $storeId : 'all';
        if (!isset($this->instances[$categoryId][$cacheKey])) {
            /** @var Category $category */
            $category = $this->categoryFactory->create();
            if (null !== $storeId) {
                $category->setStoreId($storeId);
            }
            $category->load($categoryId);
            if (!$category->getId()) {
                throw NoSuchEntityException::singleField('id', $categoryId);
            }
            $this->instances[$categoryId][$cacheKey] = $category;
        }
        return $this->instances[$categoryId][$cacheKey];
    }

It will load category from flat category table for a specific store(For example:catalog_category_flat_store_5) but not the category table for all stores. It will return empty result and cause CategoryRepository.php to throw exception.

Version 1.6.2 not working on Magento <= 2.1.x

Original function parameters can be passed to after plugins only in Magento versions >=2.2.0.
This plugin added on version 1.6.2 is not compatible with previous versions.

See also:

A quick solution will probably be to use around plugin instead as it has the same format in all Magento versions

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.