• [deleted]

  • Edited

JasperVriends New problem, If i add any image with embed code and manually post that discussion on twitter, embed image not appear on tweet, just shows site favicon.

Problem is in source code:

<meta name="twitter:image" content="https://site.com/assets/favicon.png">

Why does ignore embedded image within the topic? This code needs to be updated dynamically.
Please fix it for twitter and facebook.

Temporary fix for facebook: Remove codes in PageListener.php
under vendor/v17development/flarum-seo/src/listeners

 if($applicationFavicon !== null)
        {
            $this->setMetaPropertyTag('og:image', $this->applicationUrl . '/assets/' . $applicationFavicon);
            $this->setMetaTag('twitter:image', $this->applicationUrl . '/assets/' . $applicationFavicon);
            $this->setSchemaJson('image', $this->applicationUrl . '/assets/' . $applicationFavicon);
        }[/code)
6 days later

solo1988 Hi Solo, thank you very much fo the GitHub issue and your descriptions of the problems!

I'm at the moment very busy, I still have some unfinished things to do what have priority over this project (customer related stuff and school)... I hope I'll have more time very soon so I can fix these problems and implement suggestions!

If anyone else has some time to contribute to the project, I would ❤️ that! It isn't open-source for nothing! 🙂

Fixing issue with Cyrillic descriptions not showing in meta tags.

This is not recommended to directly edit your vendor files. But for quick fix like in my situation this is great solution.
@JasperVriends please consider to reviewing this issue. For lack of time i can't create PR or etc fixing this bug.

This method also works with any other multibyte language.
Notice: php mb_string extension must be turned on

Open /vendor/v17development/flarum-seo/src/Listeners/PageListener.php

Find setDescription() function

Change
$description = trim(preg_replace('/\s+/', ' ', substr($description, 0, 157))) . (strlen($description) > 157 ? '...' : '');

To
$description = trim(preg_replace('/\s+/', ' ', mb_substr($description, 0, 157))) . (mb_strlen($description) > 157 ? '...' : '');

I don't even noticed that descriptions doesn't showing on my website. So Google and Yandex bots index entire site without descriptions.

    ReaZzon Tnx bro!!! It works perfect!!! I have my site on russian language and Yandex bot doesn't want to set the description for main page in Yandex Search, it always shows "somethings went wrong (in russian)" but another pages is ok. Can you help me?)))

      ReaZzon I sent main page on re-indexing.

      In webmaster description allways is correct

      But in Yandex-Search i have this view

      ReaZzon Thank you for that! I will update the plugin tonight with your suggested fix. If I'm not mistaken, mbstring should be already enabled to run Flarum? So technically it should be enabled on all forums that are running Flarum already (correct me when I'm mistaken)?

      Screenshot of the 'Server requirements' of Flarum suggesting that the function 'mbstring' must be enabled:

        JasperVriends If I'm not mistaken, mbstring should be already enabled to run Flarum?
        So technically it should be enabled on all forums that are running Flarum already (correct me when I'm mistaken)?

        You are right, it should be.

        5 days later
        7 days later

        solo1988 robots.txt today is nothing to search robots, if you really want to delete this links from search you need to edit canonical link.

        Any way to turn off the logo thing? IF I post any links on Reddit, for example, it now shows my favicon automatically....

        And my favicon always is super blurry:

        I would like it to pick a picture from a post or use nothing at all. I think the blurriness hurts me on social media.

          Or at least it should allow to choose a dedicated (global) image for Open Graph (Facebook/Reddit/Telegram/etc.) and Twitter 🙂

          • [deleted]

          • Edited

          question answer snippet be able to disabled by user.
          embedded images not appears when sharing to the discussions on social sites.

          15 days later

          Update Flarum SEO Beta 4

          Some improvements mentioned above. It will official fix the problems that ReaZzon and @solo1988 had. (issue v17development/flarum-seo11)

          Also this version fixed a page crash when there was no first post set up for the discussion. Now the extension won't add a description to that page and will continue working. (it should fix the issues v17development/flarum-seo12 and v17development/flarum-seo11)

          Also this version will fix the duplicated header tags issue (issue v17development/flarum-seo10)

          Update the extension

          Run the following command on your server to update the plugin:

          composer update v17development/flarum-seo

          If anyone has trouble with anything or have feature requests, keep creating issues on GitHub to improve this extension: https://github.com/v17development/flarum-seo/issues

          MikeJones That's not possible yet, I might try tomorrow/tonight some frontend stuff in the admin panel to create a option window. I think I'll need some time before that will work 😛

            MikeJones Hi Mike, thanks for letting me know! I actually get the same when using composer update

            composer require v17development/flarum-seo

            Seems to work, I have no idea why composer update doesn't want to update the extension... Maybe you can try again using composer update? As I already have it installed now