This commit is contained in:
Ty Clifford
2026-07-03 07:31:09 -04:00
commit cebb0d3af1
800 changed files with 89782 additions and 0 deletions
@@ -0,0 +1,9 @@
{
"plugin-data":
{
"name": "Open Graph",
"description": "Open Graph ви позволява да свържете вашето съдържание със социални мрежи."
},
"set-a-default-image-for-content": "Set a default image for the content without pictures.",
"set-your-facebook-app-id": "Set your Facebook App ID."
}
+8
View File
@@ -0,0 +1,8 @@
{
"plugin-data": {
"description": "Open Graph protokollen gør det muligt for ethvert websted, at blive et rigt objekt i en social graf.",
"name": "Open Graph"
},
"set-a-default-image-for-content": "Indsæt et standardbillede til indholdet uden billeder.",
"set-your-facebook-app-id": "Indsæt dit Facebook App ID."
}
@@ -0,0 +1,9 @@
{
"plugin-data":
{
"name": "Open Graph",
"description": "Plugin zur Verwendung des Open Graph Protocols (beispielsweise für Facebook)."
},
"set-a-default-image-for-content": "Set a default image for the content without pictures.",
"set-your-facebook-app-id": "Set your Facebook App ID."
}
@@ -0,0 +1,9 @@
{
"plugin-data":
{
"name": "Open Graph",
"description": "Plugin zur Verwendung des Open Graph Protocols (beispielsweise für Facebook)."
},
"set-a-default-image-for-content": "Set a default image for the content without pictures.",
"set-your-facebook-app-id": "Set your Facebook App ID."
}
+9
View File
@@ -0,0 +1,9 @@
{
"plugin-data":
{
"name": "Open Graph",
"description": "The Open Graph protocol enables any web page to become a rich object in a social graph."
},
"set-a-default-image-for-content": "Set a default image for the content without pictures.",
"set-your-facebook-app-id": "Set your Facebook App ID."
}
+9
View File
@@ -0,0 +1,9 @@
{
"plugin-data":
{
"name": "Open Graph",
"description": "Este complemento mejora las publicaciones en las redes sociales con este plugin."
},
"set-a-default-image-for-content": "Set a default image for the content without pictures.",
"set-your-facebook-app-id": "Set your Facebook App ID."
}
@@ -0,0 +1,9 @@
{
"plugin-data":
{
"name": "Open Graph",
"description": "پروتکل Open Graph یک صفحه وب را به یک شیء غنی در یک نمودار اجتماعی تبدیل می کند ."
},
"set-a-default-image-for-content": "قراردادن یک تصویر پیش‌فرض برای محتوایی که تصویر ندارد.",
"set-your-facebook-app-id": "قراردادن شناسه Facebook App."
}
@@ -0,0 +1,9 @@
{
"plugin-data":
{
"name": "Open Graph",
"description": "Permets à nimporte quelle page web de devenir lobjet enrichi dun graphe social. Par exemple, il est utilisé sur Facebook pour permettre à une page web de bénéficier des mêmes fonctionnalités que nimporte quel autre objet sur Facebook."
},
"set-a-default-image-for-content": "Définissez une image par défaut pour le contenu sans images.",
"set-your-facebook-app-id": "Définissez votre identifiant d'application Facebook."
}
+9
View File
@@ -0,0 +1,9 @@
{
"plugin-data":
{
"name": "Open Graph",
"description": "Il protocollo Open Graph permette a qualsiasi pagina web di diventare un rich object in un social graph."
},
"set-a-default-image-for-content": "Imposta un'immagine predefinita per il contenuto senza foto.",
"set-your-facebook-app-id": "Imposta il tuo Facebook App ID."
}
@@ -0,0 +1,9 @@
{
"plugin-data":
{
"name": "Open Graph",
"description": "The Open Graph protocol enables any web page to become a rich object in a social graph."
},
"set-a-default-image-for-content": "Set a default image for the content without pictures.",
"set-your-facebook-app-id": "Set your Facebook App ID."
}
@@ -0,0 +1,9 @@
{
"plugin-data":
{
"name": "Open Graph",
"description": "Met het Open Graph-protocol kan van iedere pagina een object in een sociale grafiek worden gemaakt."
},
"set-a-default-image-for-content": "Standaardafbeelding voor inhoud zonder afbeeldingen.",
"set-your-facebook-app-id": "Uw Facebook App-ID."
}
@@ -0,0 +1,9 @@
{
"plugin-data":
{
"name": "Open Graph",
"description": "Protokół Open Graph zezwala stronie na stosowanie meta tagów używanych w serwisach społecznościowych."
},
"set-a-default-image-for-content": "Set a default image for the content without pictures.",
"set-your-facebook-app-id": "Set your Facebook App ID."
}
@@ -0,0 +1,9 @@
{
"plugin-data":
{
"name": "Open Graph",
"description": "Протокол Open Graph дает возможность связывать свой контент с социальными сетями."
},
"set-a-default-image-for-content": "Установите изображение по умолчанию для контента без картинок.",
"set-your-facebook-app-id": "Установите свой идентификатор приложения Facebook (App ID)."
}
+9
View File
@@ -0,0 +1,9 @@
{
"plugin-data":
{
"name": "Open Graph",
"description": "Open Graph protokolü sosyal bir grafikte zengin bir nesne halinde herhangi bir web sayfasını sağlar."
},
"set-a-default-image-for-content": "Set a default image for the content without pictures.",
"set-your-facebook-app-id": "Set your Facebook App ID."
}
@@ -0,0 +1,9 @@
{
"plugin-data":
{
"name": "Open Graph",
"description": "Протокол Open Graph дозволяє ділитися будь-якою веб-сторінкою у соціальних мережах."
},
"set-a-default-image-for-content": "Set a default image for the content without pictures.",
"set-your-facebook-app-id": "Set your Facebook App ID."
}
@@ -0,0 +1,9 @@
{
"plugin-data":
{
"name": "開放社交關係圖",
"description": "開放社交關係圖協定可以讓任何網頁變成豐富的物件"
},
"set-a-default-image-for-content": "Set a default image for the content without pictures.",
"set-your-facebook-app-id": "Set your Facebook App ID."
}
+10
View File
@@ -0,0 +1,10 @@
{
"author": "Bludit",
"email": "",
"website": "https://plugins.bludit.com",
"version": "3.22.0",
"releaseDate": "2026-05-10",
"license": "MIT",
"compatible": "3.22",
"notes": ""
}
+159
View File
@@ -0,0 +1,159 @@
<?php
class pluginOpenGraph extends Plugin
{
public function init()
{
// Fields and default values for the database of this plugin
$this->dbFields = array(
'defaultImage' => '',
'fbAppId' => ''
);
}
public function form()
{
global $L;
$html = '<div class="alert alert-primary" role="alert">';
$html .= $this->description();
$html .= '</div>';
$html .= '<div>';
$html .= '<label>' . $L->get('Default image') . '</label>';
$html .= '<input id="jsdefaultImage" name="defaultImage" type="text" dir="auto" value="' . $this->getValue('defaultImage') . '" placeholder="https://">';
$html .= '<span class="tip">' . $L->g('set-a-default-image-for-content') . '</span>';
$html .= '</div>';
$html .= '<div>';
$html .= '<label>' . $L->get('Facebook App ID') . '</label>';
$html .= '<input name="fbAppId" type="text" dir="auto" value="' . $this->getValue('fbAppId') . '" placeholder="App ID">';
$html .= '<span class="tip">' . $L->g('set-your-facebook-app-id') . '</span>';
$html .= '</div>';
return $html;
}
/**
* Sanitize and escape content for use in meta tags
*/
private function sanitize($text, $maxLength = 0)
{
// Strip HTML tags
$text = strip_tags($text);
// Decode HTML entities first to avoid double encoding
$text = html_entity_decode($text, ENT_QUOTES, 'UTF-8');
// Trim whitespace
$text = trim($text);
// Truncate if needed
if ($maxLength > 0 && mb_strlen($text, 'UTF-8') > $maxLength) {
$text = mb_substr($text, 0, $maxLength, 'UTF-8') . '...';
}
// Escape for HTML attribute
return htmlspecialchars($text, ENT_QUOTES, 'UTF-8');
}
public function siteHead()
{
global $url;
global $site;
global $WHERE_AM_I;
global $page;
global $content;
$og = array(
'locale' => $site->locale(),
'type' => 'website',
'title' => $this->sanitize($site->title()),
'description' => $this->sanitize($site->description(), 200),
'url' => $site->url(),
'image' => '',
'siteName' => $this->sanitize($site->title()),
'publishedTime' => '',
'modifiedTime' => '',
'author' => ''
);
switch ($WHERE_AM_I) {
case 'page':
$og['type'] = 'article';
$og['title'] = $this->sanitize($page->title());
// Get description: use page description or fallback to content excerpt
$description = $page->description();
if (empty($description)) {
$description = Text::truncate(strip_tags($page->contentRaw()), 160);
}
$og['description'] = $this->sanitize($description, 200);
$og['url'] = $page->permalink($absolute = true);
$og['image'] = $page->coverImage($absolute = true);
// Article-specific meta tags (ISO 8601 format)
$og['publishedTime'] = $page->date('c');
$dateModified = $page->dateModified('c');
if (!empty($dateModified)) {
$og['modifiedTime'] = $dateModified;
}
$og['author'] = $this->sanitize($page->user('nickname'));
$pageContent = $page->content();
break;
default:
$pageContent = '';
if (Text::isNotEmpty($this->getValue('defaultImage'))) {
$og['image'] = $this->getValue('defaultImage');
} elseif (isset($content[0])) {
$og['image'] = $content[0]->coverImage($absolute = true);
$pageContent = $content[0]->content();
}
break;
}
// Build HTML output
$html = PHP_EOL . '<!-- Open Graph -->' . PHP_EOL;
$html .= '<meta property="og:locale" content="' . $og['locale'] . '">' . PHP_EOL;
$html .= '<meta property="og:type" content="' . $og['type'] . '">' . PHP_EOL;
$html .= '<meta property="og:title" content="' . $og['title'] . '">' . PHP_EOL;
$html .= '<meta property="og:description" content="' . $og['description'] . '">' . PHP_EOL;
$html .= '<meta property="og:url" content="' . $og['url'] . '">' . PHP_EOL;
$html .= '<meta property="og:site_name" content="' . $og['siteName'] . '">' . PHP_EOL;
// Article-specific tags
if ($og['type'] === 'article') {
if (!empty($og['publishedTime'])) {
$html .= '<meta property="article:published_time" content="' . $og['publishedTime'] . '">' . PHP_EOL;
}
if (!empty($og['modifiedTime'])) {
$html .= '<meta property="article:modified_time" content="' . $og['modifiedTime'] . '">' . PHP_EOL;
}
if (!empty($og['author'])) {
$html .= '<meta property="article:author" content="' . $og['author'] . '">' . PHP_EOL;
}
}
// If the page doesn't have a coverImage try to get an image from the HTML content
if (empty($og['image'])) {
$src = DOM::getFirstImage($pageContent);
if ($src !== false) {
$og['image'] = $src;
} elseif (Text::isNotEmpty($this->getValue('defaultImage'))) {
$og['image'] = $this->getValue('defaultImage');
}
}
if (!empty($og['image'])) {
$html .= '<meta property="og:image" content="' . $og['image'] . '">' . PHP_EOL;
// Add image alt for accessibility
$html .= '<meta property="og:image:alt" content="' . $og['title'] . '">' . PHP_EOL;
}
if (Text::isNotEmpty($this->getValue('fbAppId'))) {
$html .= '<meta property="fb:app_id" content="' . $this->getValue('fbAppId') . '">' . PHP_EOL;
}
return $html;
}
}