Skip to content

Commit

Permalink
1.1.7 version update
Browse files Browse the repository at this point in the history
  • Loading branch information
mediafoks committed Oct 5, 2024
1 parent 46f70ae commit bf43194
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 13 deletions.
2 changes: 1 addition & 1 deletion ksopengraph.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<copyright>Copyright (C) 2024 Sergey Kuznetsov</copyright>
<license>MIT</license>
<authorEmail>mediafoks@google.com</authorEmail>
<version>1.1.6</version>
<version>1.1.7</version>
<description>PLG_CONTENT_KS_OPEN_GRAPH_XML_DESCRIPTION</description>
<namespace path="src">Joomla\Plugin\Content\KsOpenGraph</namespace>
<files>
Expand Down
2 changes: 1 addition & 1 deletion services/provider.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
*
* @return void
*
* @since 1.1.6
* @since 1.1.7
*/
public function register(Container $container)
{
Expand Down
11 changes: 2 additions & 9 deletions src/Extension/KsOpenGraph.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php

/**
* @version 1.1.6
* @version 1.1.4
* @package ksopengraph (plugin)
* @author Sergey Kuznetsov - mediafoks@google.com
* @copyright Copyright (c) 2024 Sergey Kuznetsov
Expand Down Expand Up @@ -111,13 +111,6 @@ public function renderTag($name, $value, $type = 1)
}
}

public function catDescription($str, $length)
{
$str_clear_tags = strip_tags($str);
$new_str = substr($str_clear_tags, 0, strpos($str_clear_tags, " ", $length) ?: $length);
return (strlen($new_str) > $length) ? $new_str . "..." : $new_str;
}

public function onContentAfterDisplay(AfterDisplayEvent $event): void
{
$app = $this->getApplication();
Expand Down Expand Up @@ -217,7 +210,7 @@ public function onContentAfterDisplay(AfterDisplayEvent $event): void

$this->renderTag('og:site_name', $config->get('sitename'), $type);
$this->renderTag('og:title', $thisTitle, $type);
$this->renderTag('og:description', $this->catDescription($thisDescription, 300), $type);
$this->renderTag('og:description', mb_strimwidth(strip_tags($thisDescription), 0, 300, "..."), $type);
$this->renderTag('og:url', Uri::current(), $type);
$this->renderTag('og:image', $this->setImage($this->realCleanImageURL($thisImage)), $type);
$this->renderTag('og:type', $thisOgType, $type);
Expand Down
4 changes: 2 additions & 2 deletions update.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
<element>ksopengraph</element>
<type>plugin</type>
<folder>content</folder>
<version>1.1.6</version>
<version>1.1.7</version>
<downloads>
<downloadurl type="full" format="zip">https://github.com/mediafoks/plg_content_ksopengraph/archive/refs/tags/v1.1.6.zip</downloadurl>
<downloadurl type="full" format="zip">https://github.com/mediafoks/plg_content_ksopengraph/archive/refs/tags/v1.1.7.zip</downloadurl>
</downloads>
<tags>
<tag>stable</tag>
Expand Down

0 comments on commit bf43194

Please sign in to comment.