dachcom-digital / pimcore-seo

The last SEO Bundle for Pimcore you'll ever need!
Other
36 stars 14 forks source link

Content Analysis #13

Open ChrisB9 opened 4 years ago

ChrisB9 commented 4 years ago
Q A
Bug report? no
Feature request? yes
BC Break report? no
RFC? -

For a website, the client (previous wordpress user) has asked to have a more options similar to those of the likes of yoast. Now, while i don't think meta-keywords are a thing anymore, the only real difference seems to be a recommendation of how things can be approved.

This is how i could imagine this to look like for this extension too: image

Additionally, the way you seem to have drafted that in your images with the blue checkmarks does seem like a good too: image

I would create a PR for this but maybe you already have something similar in the pipeline. If not, then do you have ideas/concepts in this direction that way i can start on a solution and give it to my client.

solverat commented 4 years ago

Hey @ChrisB9 thanks for your input. Great idea! A quality analysis tool is on our roadmap (like you, we also always end up in a "yoast-comparing" discussion 😄).

The idea would be to add a colored (red, orange, green) badge-tab to the right of the tab-panel:

image

Beside the two checks you've already mentioned, we also want to have some semantic checks. In summary:

Technically all those "Modules" should be available as configurable and self-sustainable elements like the integrators already are. I think about a tagged symfony service and also a corresponding extjs object, for example:

Service

    SeoBundle\MetaData\Analysis\TitleDescriptionAnalyser:
        tags:
            - {name: seo.meta_data.analyser, identifier: title_description }

Php Class

<?php

namespace SeoBundle\MetaData\Analysis;

class TitleDescriptionAnalyser implements AnalyserInterface
{
    /**
     * {@inheritdoc}
     */
    public function analyse(array $elements, array $context)
    {
        return [];
    }
}

Extjs Module

pimcore.registerNS('Seo.MetaData.Analysis.TitleDescriptionAnalyser');
Seo.MetaData.Analysis.TitleDescriptionAnalyser = Class.create(Seo.MetaData.Analysis.AbstractAnalyser, {

    buildPanel: function () {
        return fields;
    },

    getRanking: function () {
        return 0;
    }

});

Controller

<?php

namespace SeoBundle\Controller\Admin;

class MetaDataController extends AdminController
{
    public function analyseElement(Request $request)
    {
        $data = [];
        $element = null; // @todo

        foreach($this->analysisManager->getAnalysers() as $name => $analyser) {
            $data[$name] = $analyser->analyse($element);
        }

        return $this->json([
            'data' => $data,
            'score' => $this->analysisManager->calculateScore($data)
        ]);
    }
}

But I'm not sure if we need a php class at all, since the analysis should work in real-time and with unpublished content. We should do some benchmark tests and POC first (change listener on all inputs could be a performance issue in extjs but also watching the iframe element in document context could be a tricky one.)


However, this is just a rough idea how we could achieve this. For now, we should implement the basic structure + your suggested title/description module. There is no active sprint for this feature therefor we need to discuss this internally first.

ChrisB9 commented 4 years ago

Yea, yoast did put up a really good tool for clients :D

But thats very promising and looks like a good direction. I could imagine a two-path analysis:

Would it performance-wise make sense, to put all the data into the localstorage on-edit and then the sementic checker pulls it from there asynchronosly on-change:localstorage [element-id] -> semantic check. This should then remove your iframe issue. I am doing the same thing with my PageBuilder-Bundle and it currently seems to work without major speed-implications


Do you need any help with building that feature?

dpfahlbusch commented 3 years ago

Is this still planned? :)