├── .gitignore ├── README.md ├── composer.json ├── manifest.xml ├── phpunit.xml.dist ├── plg_cccsocialmedia ├── cccsocialmedia.php ├── cccsocialmedia.xml ├── forms │ ├── cccsocialmedia_article.xml │ └── cccsocialmedia_menu.xml └── language │ ├── de-DE │ ├── de-DE.plg_system_cccsocialmedia.ini │ └── de-DE.plg_system_cccsocialmedia.sys.ini │ ├── en-GB │ ├── en-GB.plg_system_cccsocialmedia.ini │ └── en-GB.plg_system_cccsocialmedia.sys.ini │ ├── fr-FR │ ├── fr-FR.plg_system_cccsocialmedia.ini │ └── fr-FR.plg_system_cccsocialmedia.sys.ini │ └── nl-NL │ ├── plg_system_cccsocialmedia.ini │ └── plg_system_cccsocialmedia.sys.ini └── tests ├── PrivateAccess.php ├── SocialMediaTest.php ├── bootstrap.php ├── fixtures └── powered_by.png └── stubs ├── Application.php ├── CMSPlugin.php └── Document.php /.gitignore: -------------------------------------------------------------------------------- 1 | /.phpunit.cache/ 2 | /composer.lock 3 | .idea/ -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # plg_cccsocialmedia 2 | 3 | For Joomla 3.10.x and Joomla 4 - PHP 7.4 + 4 | 5 | Joomla Plugin to Display Open Graph and Twitter Options in your menu items and articles. The speciality about this plugin is the feature, that it recognizes the user agent and delivers the right open graph image to the various plattforms, as well as th e many fallback options to make sure anything is filled in the og data. 6 | 7 | This plugin creates a new tab in your menu items and your articles and enables you to add open graph and twitter data to your page. You can also set up global and/or fallback options in you plugin parameters. 8 | 9 | This plugin also does recognize the useragents google, facebook and pinterest and delivers the right open graph image according to the useragent. So if google scrapes an image from your site, google will receive the squared image. If pinterest is checking on your site, it will get the protrait image and if facebook or other agents want to get your open graph image it will get the 1:1.91 ratio image. 10 | 11 | The menu parameters overwrite the article parameters and the article parameters overwrite the global paramters. 12 | Means: 13 | - Priority A - Menu 14 | - Priority B - Article 15 | - Priority C - Global plugin params 16 | 17 | To make sure you have at least something in the open graph data the plugin has additional fallbacks: 18 | 19 | - if any of the open graph images are empty create a fallback to the article intro image and its alt-text 20 | - if any of the open graph images are empty and the intro image is empty create a fallback to the article fulltext image and its alt-text 21 | - if the open graph title is empty get the page title from menu item. If there is an article title take this one. 22 | - if the open graph or twitter description is empty use the meta description 23 | - if the open graph published time is empty get the creation date of the article if existent 24 | 25 | This SEO relevant plugin is also used on https://seo-sommer.de 26 | -------------------------------------------------------------------------------- /composer.json: -------------------------------------------------------------------------------- 1 | { 2 | "require-dev": { 3 | "phpunit/phpunit": "^9.5", 4 | "joomla/event": "^2.0", 5 | "joomla/registry": "^2.0", 6 | "joomla/di": "^2.0" 7 | }, 8 | "autoload": { 9 | "classmap": [ 10 | "plg_cccsocialmedia/cccsocialmedia.php" 11 | ] 12 | }, 13 | "autoload-dev": { 14 | "classmap": [ 15 | "tests/" 16 | ] 17 | }, 18 | "require": { 19 | "ext-json": "*" 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /manifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | plg_cccsocialmedia 4 | Joomla Plugin to display Open Graph and Twitter Options in your menu items and articles 5 | cccsocialmedia 6 | plugin 7 | site 8 | system 9 | 2.0.1 10 | 11 | https://github.com/coolcat-creations/plg_cccsocialmedia/releases/download/v2.0.1/plg_cccsocialmedia.zip 12 | 13 | 14 | stable 15 | 16 | 17 | https://raw.githubusercontent.com/coolcat-creations/plg_cccsocialmedia/blob/master/README.md 18 | 19 | Elisa Foltyn 20 | https://www.coolcat-creations.com 21 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /phpunit.xml.dist: -------------------------------------------------------------------------------- 1 | 2 | 13 | 14 | 15 | tests 16 | 17 | 18 | 19 | 21 | 22 | plg_cccsocialmedia 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /plg_cccsocialmedia/cccsocialmedia.php: -------------------------------------------------------------------------------- 1 | 6 | * @copyright COOLCAT creations - Elisa Foltyn 7 | * @license GNU General Public License version 2 or later; see LICENSE.txt 8 | * @link https://coolcat-creations.com 9 | */ 10 | 11 | use Joomla\CMS\Application\CMSApplication; 12 | use Joomla\CMS\Document\Document; 13 | use Joomla\CMS\Factory; 14 | use Joomla\CMS\Form\Form; 15 | use Joomla\CMS\Plugin\CMSPlugin; 16 | use Joomla\CMS\Table\Content; 17 | use Joomla\CMS\Uri\Uri; 18 | use Joomla\Database\DatabaseDriver; 19 | use Joomla\Registry\Registry; 20 | 21 | defined('_JEXEC') or die; 22 | 23 | /** 24 | * CCC Socialmedia plugin. 25 | * 26 | * @package CCC socialmedia 27 | * @since 1.0 28 | */ 29 | class plgSystemCccsocialmedia extends CMSPlugin 30 | { 31 | public const GOOGLE = 'google'; 32 | public const FACEBOOK = 'facebook'; 33 | public const PINTEREST = 'pinterest'; 34 | public const NONE = ''; 35 | 36 | /** 37 | * Application object 38 | * 39 | * The application is injected by parent constructor 40 | * 41 | * @var CMSApplication 42 | * @since 1.0 43 | */ 44 | protected $app; 45 | 46 | /** 47 | * Database object 48 | * 49 | * The database is injected by parent constructor 50 | * 51 | * @var DatabaseDriver|\JDatabaseDriver 52 | * @since 1.0 53 | */ 54 | protected $db; 55 | 56 | /** 57 | * Affects constructor behavior. If true, language files will be loaded automatically. 58 | * 59 | * @var boolean 60 | * @since 1.0 61 | */ 62 | protected $autoloadLanguage = true; 63 | 64 | /** 65 | * Add fields for the OpenGraph data to the form 66 | * 67 | * @param \Joomla\CMS\Form\Form $form 68 | * 69 | * @return boolean 70 | * @since 1.0 71 | */ 72 | public function onContentPrepareForm(Form $form): bool 73 | { 74 | $option = $this->app->input->get('option'); 75 | $client = $this->app->getName(); 76 | 77 | $whereToRun = $this->params->get('whereToRun', 'both'); 78 | if (($whereToRun === 'administrator' || $whereToRun === 'site') 79 | && $client !== $whereToRun) 80 | { 81 | return true; 82 | } 83 | 84 | switch ("$option.$client") 85 | { 86 | case 'com_menus.administrator': 87 | { 88 | $form::addFormPath(__DIR__ . '/forms'); 89 | $form->loadFile('cccsocialmedia_menu', false); 90 | 91 | break; 92 | } 93 | 94 | case 'com_content.administrator': 95 | case 'com_content.site': 96 | { 97 | $form::addFormPath(__DIR__ . '/forms'); 98 | $form->loadFile('cccsocialmedia_article', false); 99 | 100 | break; 101 | } 102 | } 103 | 104 | return true; 105 | } 106 | 107 | /** 108 | * Prepare the OpenGraph metadata for rendeering 109 | * 110 | * @return bool 111 | * @since 1.0 112 | */ 113 | public function onBeforeCompileHead(): bool 114 | { 115 | $input = $this->app->input; 116 | $option = $input->get('option', '', 'cmd'); 117 | $view = $input->get('view', '', 'cmd'); 118 | 119 | if (($option . '.' . $view) === 'com_finder.indexer') 120 | { 121 | return true; 122 | } 123 | 124 | if ($input->get('format', '', 'cmd') === 'feed') 125 | { 126 | return true; 127 | } 128 | 129 | $uniqueArticle = true; 130 | if(is_array($input->get('id', 0, 'int'))){ 131 | $uniqueArticle = false; 132 | } 133 | 134 | if (!$this->app->isClient('site')) 135 | { 136 | return true; 137 | } 138 | 139 | /** @var \Joomla\CMS\Document\Document $document */ 140 | $document = $this->app->getDocument(); 141 | 142 | if($uniqueArticle) { 143 | $article = $this->getArticle($input->get('id', 0, 'int')); 144 | } else { 145 | $article = false; 146 | } 147 | 148 | $menuParams = $this->getMenuParams(); 149 | $articleAttribs = new Registry($article->attribs ?? '{}'); 150 | $articleImages = new Registry($article->images ?? '{}'); 151 | $userAgent = $this->getBot(); 152 | 153 | $this->combineSettings($this->params, $articleAttribs, $menuParams); 154 | $this->addImageFallback($this->params, $articleImages, $view, $userAgent); 155 | $this->addTitleFallback($this->params, $articleAttribs, $menuParams, $document); 156 | $this->addDescriptionFallback($this->params, $menuParams, $document, $view); 157 | 158 | if($uniqueArticle) { 159 | $this->addPublishedFallback($this->params, $article); 160 | } 161 | 162 | $this->injectOpenGraphData($document, $this->params); 163 | 164 | return true; 165 | } 166 | 167 | /** 168 | * @param \Joomla\Registry\Registry $params 169 | * @param \Joomla\Registry\Registry $articleAttribs 170 | * @param \Joomla\Registry\Registry $menuParams 171 | * 172 | * @return void 173 | * @since 2.0.0 174 | */ 175 | private function combineSettings(Registry $params, Registry $articleAttribs, Registry $menuParams): void 176 | { 177 | static $settings = array( 178 | 'og_title', 179 | 'og_type', 180 | 'og_description', 181 | 'og_image', 182 | 'og_image_fb', 183 | 'og_image_pi', 184 | 'og_image_alt', 185 | 'og_article_published_time', 186 | 'og_article_author', 187 | 'og_product_availability', 188 | 'og_product_price_currency', 189 | 'og_product_price_amount', 190 | 'tw_title', 191 | 'tw_description', 192 | 'tw_image', 193 | 'tw_image_alt', 194 | 'tw_site', 195 | 'tw_type', 196 | 'tw_creator' 197 | ); 198 | 199 | $config = Factory::getConfig(); 200 | 201 | if ($config === null) 202 | { 203 | throw new \RuntimeException('Unable to load global configuration'); 204 | } 205 | 206 | $params->set('sitename', $config->get('sitename')); 207 | $params->set('base_url', Uri::base()); 208 | $params->set('url', Uri::getInstance()); 209 | 210 | foreach ($settings as $setting) 211 | { 212 | $params->set( 213 | $setting, 214 | // Priority A - Menu parameters 215 | $menuParams->get( 216 | $setting, 217 | // Priority B - Article parameters 218 | $articleAttribs->get( 219 | $setting, 220 | // Priority C - Module parameters 221 | $params->get( 222 | $setting, 223 | '' 224 | ) 225 | ) 226 | ) 227 | ); 228 | } 229 | } 230 | 231 | /** 232 | * @param \Joomla\Registry\Registry $params 233 | * @param \Joomla\Registry\Registry $articleImages 234 | * @param string $view 235 | * @param string $userAgent 236 | * 237 | * @return void 238 | * @since 2.0.0 239 | */ 240 | private function addImageFallback(Registry $params, Registry $articleImages, string $view, string $userAgent): void 241 | { 242 | 243 | $alt = $params->get('og_image_alt'); 244 | 245 | if ($userAgent === self::FACEBOOK && $params->get('og_image_fb') > '') 246 | { 247 | $image = $params->get('og_image_fb'); 248 | } 249 | elseif ($userAgent === self::GOOGLE && $params->get('og_image') > '') 250 | { 251 | $image = $params->get('og_image'); 252 | } 253 | elseif ($userAgent === self::PINTEREST && $params->get('og_image_pi') > '') 254 | { 255 | $image = $params->get('og_image_pi'); 256 | } 257 | elseif ($params->get('og_image_fb') > '') 258 | { 259 | $image = $params->get('og_image_fb'); 260 | } 261 | else 262 | { 263 | [$image, $alt] = $this->getArticleImage($articleImages); 264 | } 265 | 266 | $params->set('og_image', $image); 267 | $params->set('og_image_alt', $alt); 268 | $params->set('tw_image', $image); 269 | $params->set('tw_image_alt', $alt); 270 | } 271 | 272 | /** 273 | * @param \Joomla\Registry\Registry $params 274 | * @param \Joomla\Registry\Registry $articleAttribs 275 | * @param \Joomla\Registry\Registry $menuParams 276 | * @param \Joomla\CMS\Document\Document $document 277 | * 278 | * @return void 279 | * @since 2.0.0 280 | */ 281 | private function addTitleFallback( 282 | Registry $params, 283 | Registry $articleAttribs, 284 | Registry $menuParams, 285 | Document $document 286 | ): void { 287 | $title = $this->getTitle($articleAttribs, $menuParams, $document); 288 | 289 | $params->def('og_title', $title); 290 | $params->def('tw_title', $title); 291 | } 292 | 293 | /** 294 | * @param \Joomla\Registry\Registry $params 295 | * @param \Joomla\Registry\Registry $menuParams 296 | * @param \Joomla\CMS\Document\Document $document 297 | * @param $view 298 | * 299 | * @return void 300 | * @since 2.0.0 301 | */ 302 | private function addDescriptionFallback(Registry $params, Registry $menuParams, Document $document, $view): void 303 | { 304 | $description = $this->getDescription($menuParams, $document, $view); 305 | 306 | $params->def('og_description', $description); 307 | $params->def('tw_description', $description); 308 | } 309 | 310 | /** 311 | * @param \Joomla\Registry\Registry $params 312 | * @param \Joomla\CMS\Table\Content $article 313 | * 314 | * @return void 315 | * @since 2.0.0 316 | */ 317 | private function addPublishedFallback(Registry $params, Content $article): void 318 | { 319 | $params->def('og_article_published_time', $article->created ?? ''); 320 | } 321 | 322 | /** 323 | * Get the article with the given ID 324 | * 325 | * @param int $id 326 | * 327 | * @return \Joomla\CMS\Table\Content 328 | * @since 2.0.0 329 | */ 330 | private function getArticle(int $id): Content 331 | { 332 | $article = new Content($this->db); 333 | $article->load($id); 334 | 335 | return $article; 336 | } 337 | 338 | /** 339 | * @param \Joomla\Registry\Registry $articleImages 340 | * 341 | * @return array 342 | * @since 2.0.0 343 | */ 344 | private function getArticleImage(Registry $articleImages): array 345 | { 346 | $image = $alt = ''; 347 | 348 | if ($articleImages->get('image_intro') > '') { 349 | // get part before # in image if # exists 350 | if (strpos($articleImages->get('image_intro'), '#') !== false) { 351 | $image = substr($articleImages->get('image_intro'), 0, strpos($articleImages->get('image_intro'), '#')); 352 | } else { 353 | $image = $articleImages->get('image_intro'); 354 | } 355 | 356 | $alt = $articleImages->get('image_intro_alt', ''); 357 | 358 | } 359 | if ($articleImages->get('image_fulltext') > '') { 360 | 361 | if (strpos($articleImages->get('image_fulltext'), '#') !== false) { 362 | $image = substr($articleImages->get('image_fulltext'), 0, strpos($articleImages->get('image_fulltext'), '#')); 363 | } else { 364 | $image = $articleImages->get('image_fulltext'); 365 | } 366 | 367 | $alt = $articleImages->get('image_fulltext_alt', ''); 368 | 369 | } 370 | 371 | return array($image, $alt); 372 | } 373 | 374 | /** 375 | * @param \Joomla\Registry\Registry $articleAttribs 376 | * @param \Joomla\Registry\Registry $menuParams 377 | * @param \Joomla\CMS\Document\Document $document 378 | * 379 | * @return string 380 | * @since 2.0.0 381 | */ 382 | private function getTitle(Registry $articleAttribs, Registry $menuParams, Document $document): string 383 | { 384 | return $articleAttribs->get( 385 | 'article_page_title', 386 | $menuParams->get( 387 | 'page_title', 388 | $document->title ?? '' 389 | ) 390 | ); 391 | } 392 | 393 | /** 394 | * @param \Joomla\Registry\Registry $menuParams 395 | * @param \Joomla\CMS\Document\Document $document 396 | * @param $view 397 | * 398 | * @return string 399 | * @since 2.0.0 400 | */ 401 | private function getDescription(Registry $menuParams, Document $document, $view): string 402 | { 403 | if ($view === 'category') 404 | { 405 | $description = $menuParams->get( 406 | 'menu-meta_description', 407 | $menuParams->get( 408 | 'page_description', 409 | $document->description ?? '' 410 | ) 411 | ); 412 | } 413 | else 414 | { 415 | $description = $document->description ?? ''; 416 | } 417 | 418 | return $description; 419 | } 420 | 421 | /** 422 | * Get the bot, if any 423 | * 424 | * If the bot is self::FACEBOOK, gzip compression is turned off. 425 | * 426 | * @return string One of this class' constants 427 | * @since 2.0.0 428 | */ 429 | private function getBot(): string 430 | { 431 | static $userAgents = [ 432 | self::GOOGLE => ['googlebot'], 433 | self::FACEBOOK => ['facebot', 'facebook', 'LinkedInBot'], 434 | self::PINTEREST => ['pinterest'], 435 | ]; 436 | 437 | $bot = self::NONE; 438 | $useragent = null; 439 | 440 | if ($_SERVER['HTTP_USER_AGENT']) 441 | { 442 | $useragent = $_SERVER['HTTP_USER_AGENT']; 443 | } 444 | 445 | if (!empty($useragent)) 446 | { 447 | foreach ($userAgents as $key => $subStrings) 448 | { 449 | foreach ($subStrings as $subString) 450 | { 451 | if (stripos($useragent, $subString) !== false) 452 | { 453 | $bot = $key; 454 | break 2; 455 | } 456 | } 457 | } 458 | 459 | if ($bot === self::FACEBOOK) 460 | { 461 | $this->app->set('gzip', 0); 462 | } 463 | } 464 | 465 | return $bot; 466 | } 467 | 468 | /** 469 | * Get the parameters associated with the active menu item 470 | * 471 | * @return \Joomla\Registry\Registry 472 | * @since 2.0.0 473 | */ 474 | private function getMenuParams(): Registry 475 | { 476 | $menu = $this->app->getMenu(); 477 | 478 | if ($menu === null) 479 | { 480 | return new Registry([]); 481 | } 482 | 483 | $active = $menu->getActive(); 484 | 485 | if ($active === null) 486 | { 487 | return new Registry([]); 488 | } 489 | 490 | $itemId = $active->id; 491 | 492 | return $menu->getParams($itemId); 493 | } 494 | 495 | /** 496 | * Add OpenGraph data to document 497 | * 498 | * @param \Joomla\CMS\Document\Document $document 499 | * @param string|null $image 500 | * @param string|null $alt 501 | * @param string|null $baseUrl 502 | * 503 | * @return void 504 | * @since 2.0.0 505 | */ 506 | private function setOpenGraphImage( 507 | Document $document, 508 | ?string $image = '', 509 | ?string $alt = '', 510 | ?string $baseUrl = '' 511 | ): void { 512 | if (empty($image) || !empty($document->getMetaData('og:image'))) 513 | { 514 | return; 515 | } 516 | 517 | $image = preg_replace('~^([\w\-./\\\]+).*$~', '$1', $image); 518 | 519 | if (!file_exists($image)) 520 | { 521 | return; 522 | } 523 | 524 | $url = empty($baseUrl) ? '' : rtrim($baseUrl, '/') . '/'; 525 | $url .= $image; 526 | 527 | $this->setMetaData($document, 'og:image', $url, 'property'); 528 | $this->setMetaData($document, 'og:image:secure_url', $url, 'property'); 529 | $this->setMetaData($document, 'og:image:alt', $alt, 'property'); 530 | $this->setMetaDataIfNotSet($document, 'twitter:image', $url, 'name'); 531 | $this->setMetaDataIfNotSet($document, 'twitter:image:alt', $alt, 'name'); 532 | 533 | $info = getimagesize($image); 534 | 535 | if (\is_array($info)) 536 | { 537 | $this->setMetaData($document, 'og:image:type', $info['mime'], 'property'); 538 | $this->setMetaData($document, 'og:image:height', $info[1]); 539 | $this->setMetaData($document, 'og:image:width', $info[0]); 540 | } 541 | } 542 | 543 | /** 544 | * @param \Joomla\CMS\Document\Document $document 545 | * @param string|null $type 546 | * @param string|null $price 547 | * @param string|null $currency 548 | * @param string|null $availability 549 | * 550 | * @return void 551 | * @since 2.0.0 552 | */ 553 | private function setProduct( 554 | Document $document, 555 | ?string $type = '', 556 | ?string $price = '', 557 | ?string $currency = '', 558 | ?string $availability = '' 559 | ): void { 560 | if ($type === 'product') 561 | { 562 | $this->setMetaDataIfNotSet($document, 'product:price:amount', $price, 'property'); 563 | $this->setMetaDataIfNotSet($document, 'product:price:currency', $currency, 'property'); 564 | $this->setMetaDataIfNotSet($document, 'og:availability', $availability, 'property'); 565 | } 566 | } 567 | 568 | /** 569 | * Set metadata in document only if not already set 570 | * 571 | * @param \Joomla\CMS\Document\Document $document 572 | * @param string $key 573 | * @param string|null $value 574 | * @param string $attribute 575 | * 576 | * @return void 577 | * @since 2.0.0 578 | */ 579 | private function setMetaDataIfNotSet( 580 | Document $document, 581 | string $key, 582 | ?string $value = '', 583 | string $attribute = 'name' 584 | ): void { 585 | if (!empty($value) && empty($document->getMetaData($key))) 586 | { 587 | $this->setMetaData($document, $key, $value, $attribute); 588 | } 589 | } 590 | 591 | /** 592 | * Set metadata in document regardless previous content 593 | * 594 | * @param \Joomla\CMS\Document\Document $document 595 | * @param string $key 596 | * @param string|null $value 597 | * @param string $attribute 598 | * 599 | * @return void 600 | * @since 2.0.0 601 | */ 602 | private function setMetaData(Document $document, string $key, ?string $value = '', string $attribute = 'name'): void 603 | { 604 | $document->setMetaData($key, $value, $attribute); 605 | } 606 | 607 | /** 608 | * @param \Joomla\CMS\Document\Document $document 609 | * @param \Joomla\Registry\Registry $params 610 | * 611 | * @return void 612 | * @since 2.0.0 613 | */ 614 | private function injectOpenGraphData(Document $document, Registry $params): void 615 | { 616 | $this->setMetaData($document, 'og:url', $params->get('url'), 'property'); 617 | 618 | $this->setMetaData($document, 'og:site_name', $params->get('sitename'), 'property'); 619 | $this->setMetaDataIfNotSet($document, 'twitter:site', $params->get('tw_site'), 'name'); 620 | 621 | $this->setMetaDataIfNotSet($document, 'og:type', $params->get('og_type'), 'property'); 622 | $this->setMetaDataIfNotSet($document, 'twitter:card', $params->get('tw_type'), 'name'); 623 | 624 | $this->setMetaDataIfNotSet($document, 'og:title', $params->get('og_title'), 'property'); 625 | $this->setMetaDataIfNotSet($document, 'twitter:title', $params->get('tw_title'), 'name'); 626 | 627 | $this->setMetaDataIfNotSet($document, 'og:description', $params->get('og_description'), 'property'); 628 | $this->setMetaDataIfNotSet($document, 'twitter:description', $params->get('tw_description'), 'name'); 629 | 630 | $this->setMetaDataIfNotSet($document, 'article:author', $params->get('og_article_author'), 'property'); 631 | $this->setMetaDataIfNotSet($document, 'twitter:creator', $params->get('tw_creator'), 'name'); 632 | 633 | $this->setMetaDataIfNotSet( 634 | $document, 635 | 'article:published_time', 636 | $params->get('og_article_published_time'), 637 | 'property' 638 | ); 639 | 640 | $this->setOpenGraphImage( 641 | $document, 642 | $params->get('og_image'), 643 | $params->get('og_image_alt'), 644 | $params->get('base_url') 645 | ); 646 | 647 | $this->setProduct( 648 | $document, 649 | $params->get('og_type'), 650 | $params->get('og_product_price'), 651 | $params->get('og_product_currency'), 652 | $params->get('og_product_availability') 653 | ); 654 | } 655 | } 656 | -------------------------------------------------------------------------------- /plg_cccsocialmedia/cccsocialmedia.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | PLG_CCCSOCIALMEDIA 4 | 15.07.2023 5 | coolcat-creations.com - Elisa Foltyn 6 | mail@coolcat-creations.com 7 | http://www.coolcat-creations.com 8 | coolcat-creations.com 9 | GNU General Public License version 2 or later; see LICENSE.txt 10 | 2.0.1 11 | PLG_CCCSOCIALMEDIA_XML_DESCRIPTION 12 | 13 | 14 | 15 | de-DE/de-DE.plg_system_cccsocialmedia.ini 16 | de-DE/de-DE.plg_system_cccsocialmedia.sys.ini 17 | en-GB/en-GB.plg_system_cccsocialmedia.ini 18 | en-GB/en-GB.plg_system_cccsocialmedia.sys.ini 19 | fr-FR/fr-FR.plg_system_cccsocialmedia.ini 20 | fr-FR/fr-FR.plg_system_cccsocialmedia.sys.ini 21 | 22 | 23 | 24 | 25 | cccsocialmedia.php 26 | language 27 | forms 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 |
39 | 40 | 44 | 45 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 60 | 61 | 62 | 63 | 64 | 66 | 69 | 70 | 75 | 76 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 101 | 102 | 107 | 108 | 113 | 114 | 115 | 116 | 117 | 118 | 119 | 120 | 121 | 122 | 123 | 124 | 125 | 131 | 132 | 137 | 138 | 143 | 144 | 149 | 150 | 155 | 156 | 160 | 161 | 166 | 167 | 171 | 172 | 177 | 178 | 182 | 183 | 187 | 188 | 189 | 190 | 191 | 194 | 195 | 196 | 197 | 202 | 203 | 204 | 205 | 206 | 207 | 208 | 212 | 213 | 214 | 218 | 219 | 224 | 225 | 230 | 231 | 236 | 237 | 242 | 243 | 247 | 248 | 253 | 254 | 258 | 259 | 263 | 264 | 265 |
266 |
267 |
268 | 269 | 270 | https://raw.githubusercontent.com/coolcat-creations/plg_cccsocialmedia/master/manifest.xml 271 | 272 | 273 | 274 |
275 | -------------------------------------------------------------------------------- /plg_cccsocialmedia/forms/cccsocialmedia_article.xml: -------------------------------------------------------------------------------- 1 | 2 |
3 | 4 |
5 | 6 | 10 | 11 | 14 | 15 | 16 | 17 | 18 | 20 | 23 | 24 | 29 | 30 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 55 | 56 | 61 | 62 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 85 | 86 | 91 | 92 | 97 | 98 | 103 | 104 | 109 | 110 | 114 | 115 | 120 | 121 | 125 | 126 | 131 | 132 | 136 | 137 | 141 | 142 | 143 | 144 | 145 | 148 | 149 | 150 | 151 | 156 | 157 | 158 | 159 | 160 | 161 | 162 | 166 | 167 | 168 | 172 | 173 | 178 | 179 | 184 | 185 | 190 | 191 | 196 | 197 | 201 | 202 | 207 | 208 | 212 | 213 | 217 | 218 | 219 |
220 |
221 |
222 | -------------------------------------------------------------------------------- /plg_cccsocialmedia/forms/cccsocialmedia_menu.xml: -------------------------------------------------------------------------------- 1 | 2 |
3 | 4 |
5 | 6 | 10 | 11 | 14 | 15 | 16 | 17 | 18 | 20 | 23 | 24 | 29 | 30 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 55 | 56 | 61 | 62 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 85 | 86 | 91 | 92 | 97 | 98 | 103 | 104 | 109 | 110 | 114 | 115 | 120 | 121 | 125 | 126 | 131 | 132 | 136 | 137 | 141 | 142 | 143 | 144 | 145 | 148 | 149 | 150 | 151 | 156 | 157 | 158 | 159 | 160 | 161 | 162 | 166 | 167 | 168 | 172 | 173 | 178 | 179 | 184 | 185 | 190 | 191 | 196 | 197 | 201 | 202 | 207 | 208 | 212 | 213 | 217 | 218 | 219 |
220 |
221 | -------------------------------------------------------------------------------- /plg_cccsocialmedia/language/de-DE/de-DE.plg_system_cccsocialmedia.ini: -------------------------------------------------------------------------------- 1 | PLG_SYSTEM_CCCSOCIALMEDIA="CCC Social Media" 2 | PLG_SYSTEM_CCCSOCIALMEDIA_GB_HELP="
Bei Google werden OpenGraph Bilder meist zu Quadraten geschnitten.
Daher können Sie hier ein Quadratisches Bild hochladen.
Wenn der Google Bot auf diese Seite zugreift, bekommt dieser das optimierte Bild.
Eine optimale Größe sind 1200 x 1200px (Minimum 600 x 600)
Wenn Sie keines der OG Bilder im Plugin definieren, schaut das Plugin zunächst nach einem Intro Bild und dann nach einem Beitragsbild
" 3 | PLG_SYSTEM_CCCSOCIALMEDIA_FB_HELP="
Bei Facebook können Sie bereits gecachte Daten über den Facebook Debugger zurücksetzen.
Ein Facebook Bild ist im Querformat (1,91:1) und bestenfalls 1200 x 630px groß. (Minimum 600 x 315px)
Dieses Format benutzen viele Plattformen und ist daher immer das Standardbild wenn nichts anderes definiert ist.
" 4 | PLG_SYSTEM_CCCSOCIALMEDIA_PI_HELP="
Bei Pinterest müssen Sie zunächst Ihre Webseite bei dem Rich Pin Validator einreichen.
Diesen können Sie auch zum zurücksetzen der bereits gespeicherten OpenGraph Daten nutzen.
Ein Pinterest Bild ist im Hochformat (2:3) und bestenfalls 1200 x 1800px groß. (Minimum 600 x 900px)
" 5 | PLG_SYSTEM_CCCSOCIALMEDIA_TW_HELP="
Bei Twitter können Sie bereits gecachte Daten über den Twitter Validator zurücksetzen.
Ein Bild (jpg, gif, png) für die Twitter Summary ist im Format 1:1 und zwischen 144x144px bis 4096x4096px groß und übersteigt keine 5MB.
Bei der Summary mit großem Bild gilt das Format 2:1 mit mindestens 300x157px
" 6 | PLG_SYSTEM_CCCSOCIALMEDIA_HIDE_MESSAGES="Hinweise ausblenden" 7 | PLG_SYSTEM_CCCSOCIALMEDIA_ENABLE_OG="OpenGraph" 8 | PLG_SYSTEM_CCCSOCIALMEDIA_ENABLE_TW="Twitter" 9 | PLG_SYSTEM_CCCSOCIALMEDIA_ENABLE_IN="Formular aktivieren in" 10 | PLG_SYSTEM_CCCSOCIALMEDIA_ENABLE_IN_SELECT="- Auswählen wo Formular zu aktivieren -" 11 | PLG_SYSTEM_CCCSOCIALMEDIA_ENABLE_IN_BOTH="Beide" 12 | PLG_SYSTEM_CCCSOCIALMEDIA_FB_APP_ID_TITLE="Facebook App ID" 13 | PLG_SYSTEM_CCCSOCIALMEDIA_FB_APP_ID_DESC="Geben Sie hier Ihre Facebook App ID ein, falls vorhanden - Diese kann man unter developers.facebook.com anlegen" 14 | PLG_SYSTEM_CCCSOCIALMEDIA_FB_APP_ID_HINT="Leer lassen falls nicht vorhanden" 15 | PLG_SYSTEM_CCCSOCIALMEDIA_OG="OpenGraph" 16 | PLG_SYSTEM_CCCSOCIALMEDIA_OG_TITLE="Titel" 17 | PLG_SYSTEM_CCCSOCIALMEDIA_OG_TITLE_HINT="Leer lassen für Browsertitel" 18 | PLG_SYSTEM_CCCSOCIALMEDIA_OG_TITLE_DESC="Ein Metatitel setzen. Sollte zwischen 40 und 90 Zeichen haben, ab 50 Zeichen findet in etwa ein Zeilenumbruch statt." 19 | PLG_SYSTEM_CCCSOCIALMEDIA_OG_TYPE="Seiten-Typ" 20 | PLG_SYSTEM_CCCSOCIALMEDIA_OG_TYPE_DESC="Legen Sie den Seitentypen fest" 21 | PLG_SYSTEM_CCCSOCIALMEDIA_OG_DESC="Beschreibung" 22 | PLG_SYSTEM_CCCSOCIALMEDIA_OG_DESC_HINT="Leer lassen für Übernahme der Metadescription" 23 | PLG_SYSTEM_CCCSOCIALMEDIA_OG_DESC_DESC="Schreiben Sie hier einen werblichen Text mit Call-to Action Element mit maximaler Zeichenlänge von 297 Zeichen" 24 | PLG_SYSTEM_CCCSOCIALMEDIA_OG_IMAGE="Quadratisches OG Bild" 25 | PLG_SYSTEM_CCCSOCIALMEDIA_OG_IMAGE_DESC="Quadratisches OG Bild hochladen. Am besten im Format 600 x 600 Pixel (1:1 Quadrat)" 26 | PLG_SYSTEM_CCCSOCIALMEDIA_OG_PI_IMAGE="Pinterest OG Bild" 27 | PLG_SYSTEM_CCCSOCIALMEDIA_OG_PI_IMAGE_DESC="Bild für Pinterest hochladen. Am besten im Format 1200 x 1800 Pixel (2:3 Hochformat), eine mittelmäßige Qualität erreicht man mit 600 x 900px" 28 | PLG_SYSTEM_CCCSOCIALMEDIA_OG_FB_IMAGE="Facebook OG Bild" 29 | PLG_SYSTEM_CCCSOCIALMEDIA_OG_FB_IMAGE_DESC="Bild für Facebook und andere Platformen hochladen (Facebook ist immer der generische Fallback). Am besten im Format 1200 x 630 Pixel (1,91:1 Querformat), eine mittelmäßige Qualität erreicht man mit 600 x 315px" 30 | PLG_SYSTEM_CCCSOCIALMEDIA_OG_IMAGE_ALT="Alt-Text für das Bild" 31 | PLG_SYSTEM_CCCSOCIALMEDIA_OG_IMAGE_ALT_DESC="Bitte beschreiben Sie kurz was auf dem Bild zu sehen ist." 32 | PLG_SYSTEM_CCCSOCIALMEDIA_OG_ARTICLE_PUBLISHED_TIME="Veröffentlichungsdatum" 33 | PLG_SYSTEM_CCCSOCIALMEDIA_OG_ARTICLE_PUBLISHED_TIME_HINT="Leer lassen für Erstellungsdatum" 34 | PLG_SYSTEM_CCCSOCIALMEDIA_OG_ARTICLE_PUBLISHED_TIME_DESC="Tragen Sie hier ein Veröffentlichungsdatum ein, lassen Sie es leer wenn Sie das Joomla Veröffentlichungsdatum automatisch ziehen wollen" 35 | PLG_SYSTEM_CCCSOCIALMEDIA_OG_PRODUCT_PRICE_AMOUNT="Preis" 36 | PLG_SYSTEM_CCCSOCIALMEDIA_OG_PRODUCT_PRICE_AMOUNT_DESC="Tragen Sie hier den Preis mit Punkt statt Komma und ohne Währung ein. z.B. 99.0" 37 | PLG_SYSTEM_CCCSOCIALMEDIA_OG_PRODUCT_PRICE_CURRENCY="Währung" 38 | PLG_SYSTEM_CCCSOCIALMEDIA_OG_PRODUCT_PRICE_CURRENCY_DESC="Tragen Sie hier die Währung im internationalen Format ein. EUR für Euro" 39 | PLG_SYSTEM_CCCSOCIALMEDIA_OG_PRODUCT_AVAILABILITY="Verfügbarkeit" 40 | PLG_SYSTEM_CCCSOCIALMEDIA_OG_PRODUCT_AVAILABILITY_DESC="Wählen Sie hier die Verfügbarkeit aus" 41 | PLG_SYSTEM_CCCSOCIALMEDIA_OG_ARTICLE_AUTHOR="Autor" 42 | PLG_SYSTEM_CCCSOCIALMEDIA_OG_ARTICLE_AUTHOR_DESC="Tragen Sie hier den Verfasser des Beitrages ein" 43 | PLG_SYSTEM_CCCSOCIALMEDIA_PRODUCT_INSTOCK="Auf Lager" 44 | PLG_SYSTEM_CCCSOCIALMEDIA_PRODUCT_PREORDER="Auf Vorbestellung" 45 | PLG_SYSTEM_CCCSOCIALMEDIA_PRODUCT_BACKORDER="Lieferrückstand" 46 | PLG_SYSTEM_CCCSOCIALMEDIA_PRODUCT_PENDING="In Kürze verfügbar" 47 | PLG_SYSTEM_CCCSOCIALMEDIA_PRODUCT_OUTOFSTOCK="Ausverkauft" 48 | PLG_SYSTEM_CCCSOCIALMEDIA_TW="Twitter" 49 | PLG_SYSTEM_CCCSOCIALMEDIA_TW_TITLE="Titel" 50 | PLG_SYSTEM_CCCSOCIALMEDIA_TW_TITLE_DESC="Legen Sie den Titel für Twitter mit maximal 70 Zeichen fest" 51 | PLG_SYSTEM_CCCSOCIALMEDIA_TW_SITE="Twitter Seite" 52 | PLG_SYSTEM_CCCSOCIALMEDIA_TW_SITE_DESC="Schreiben Sie hier den Twitter @usernamen rein" 53 | PLG_SYSTEM_CCCSOCIALMEDIA_TW_CREATOR="Ersteller" 54 | PLG_SYSTEM_CCCSOCIALMEDIA_TW_CREATOR_DESC="Schreiben Sie wer der Ersteller ist. @ersteller" 55 | PLG_SYSTEM_CCCSOCIALMEDIA_TW_DESC="Beschreibung" 56 | PLG_SYSTEM_CCCSOCIALMEDIA_TW_DESC_DESC="Legen Sie hier die Beschreibung mit maximal 200 Zeichen fest" 57 | PLG_SYSTEM_CCCSOCIALMEDIA_TW_IMAGE="Twitter Bild" 58 | PLG_SYSTEM_CCCSOCIALMEDIA_TW_IMAGE_DESC="Ein Bild (jpg, gif, png) für die Twitter Summary ist im Format 1:1 und zwischen 144x144px bis 4096x4096px groß und übersteigt keine 5MB. Bei der Summary mit großem Bild gilt das Format 2:1 mit mindestens 300x157px" 59 | PLG_SYSTEM_CCCSOCIALMEDIA_TW_IMAGE_ALT="Alt-Text für das Bild" 60 | PLG_SYSTEM_CCCSOCIALMEDIA_TW_IMAGE_ALT_DESC="Bitte beschreiben Sie kurz was auf dem Bild zu sehen ist. Maximal 420 Zeichen." 61 | PLG_SYSTEM_CCCSOCIALMEDIA_TW_PLAYER="Video iFrame" 62 | PLG_SYSTEM_CCCSOCIALMEDIA_TW_PLAYER_DESC="Setzen Sie hier den embed Link zu einem Video ein" 63 | PLG_SYSTEM_CCCSOCIALMEDIA_TW_PLAYER_WIDTH="Breite" 64 | PLG_SYSTEM_CCCSOCIALMEDIA_TW_PLAYER_WIDTH_DESC="Breite des Videos" 65 | PLG_SYSTEM_CCCSOCIALMEDIA_TW_PLAYER_HEIGHT="Höhe" 66 | PLG_SYSTEM_CCCSOCIALMEDIA_TW_PLAYER_HEIGHT_DESC="Höhe des Videos" 67 | PLG_SYSTEM_CCCSOCIALMEDIA_ARTICLE="Beitrag" 68 | PLG_SYSTEM_CCCSOCIALMEDIA_BOOK="Buch" 69 | PLG_SYSTEM_CCCSOCIALMEDIA_PROFILE="Profil" 70 | PLG_SYSTEM_CCCSOCIALMEDIA_WEBSITE="Webseite" 71 | PLG_SYSTEM_CCCSOCIALMEDIA_VIDEO_MOVIE="Video - Film" 72 | PLG_SYSTEM_CCCSOCIALMEDIA_VIDEO_EPISODE="Video - Episode" 73 | PLG_SYSTEM_CCCSOCIALMEDIA_VIDEO_TVSHOW="Video - TV Show" 74 | PLG_SYSTEM_CCCSOCIALMEDIA_VIDEO_OTHER="Video - Sonstiges" 75 | PLG_SYSTEM_CCCSOCIALMEDIA_MUSIC_SONG="Musik - Lied" 76 | PLG_SYSTEM_CCCSOCIALMEDIA_MUSIC_ALBUM="Musik - Album" 77 | PLG_SYSTEM_CCCSOCIALMEDIA_MUSIC_PLAYLIST="Musik - Playliste" 78 | PLG_SYSTEM_CCCSOCIALMEDIA_MUSIC_RADIOSTATION="Musik - Radiostation" 79 | PLG_SYSTEM_CCCSOCIALMEDIA_PRODUCT="Produkt" 80 | PLG_SYSTEM_CCCSOCIALMEDIA_TW_TYPE_LABEL="Kartentyp" 81 | PLG_SYSTEM_CCCSOCIALMEDIA_TW_TYPE_DESC="Wählen Sie die Art der Twitter-Zusammenfassung" 82 | PLG_SYSTEM_CCCSOCIALMEDIA_TW_TYPE_SUMMARY="Summary" 83 | PLG_SYSTEM_CCCSOCIALMEDIA_TW_TYPE_SUMMARY_LARGE_IMAGE="Summary - Großes Bild" 84 | PLG_SYSTEM_CCCSOCIALMEDIA_TW_TYPE_CARD_APP="App" 85 | PLG_SYSTEM_CCCSOCIALMEDIA_TW_TYPE_PLAYER="Player" 86 | PLG_SYSTEM_CCCSOCIALMEDIA_DONATE="
Coolcat-Creations - Social Media Plugin
Danke, dass Sie mein Plugin nutzen!
Wenn Sie meine Arbeit wertschätzen, freue ich mich über eine Spende:
Über paypal.me spenden
" 87 | -------------------------------------------------------------------------------- /plg_cccsocialmedia/language/de-DE/de-DE.plg_system_cccsocialmedia.sys.ini: -------------------------------------------------------------------------------- 1 | ; 2 | ; Socialmedia language file 3 | ; 4 | 5 | PLG_CCCSOCIALMEDIA="CCC Socialmedia" 6 | PLG_CCCSOCIALMEDIA_XML_DESCRIPTION="CCC Socialmedia Plugin" 7 | -------------------------------------------------------------------------------- /plg_cccsocialmedia/language/en-GB/en-GB.plg_system_cccsocialmedia.ini: -------------------------------------------------------------------------------- 1 | PLG_SYSTEM_CCCSOCIALMEDIA="CCC Social Media" 2 | PLG_SYSTEM_CCCSOCIALMEDIA_GB_HELP="
Google OpenGraph images are usually cut to squares.
Therefore you can upload a square image here.
When the Google Bot accesses this page, it gets the optimized image.
An optimal size is 1200 x 1200px (minimum 600 x 600)
If you don't define any of the OG images in the plugin, the plugin will first look for an intro image and then for a article image
" 3 | PLG_SYSTEM_CCCSOCIALMEDIA_FB_HELP="
At Facebook you can reset already cached data with the Facebook Debugger.
A Facebook open graph image is in landscape format (1,91:1) and best in 1200 x 630px size (1,91:1). (Minimum 600 x 315px)
This format is used by many platforms and used therefore as fallback/default image if nothing else is defined.
". 4 | PLG_SYSTEM_CCCSOCIALMEDIA_PI_HELP="
At Pinterest you first have to initialize your website at Rich Pin Validator.
You can also use this tool to reset the already saved open graph data.
A Pinterest image is in portrait format (2:3) and at best 1200 x 1800px in size. (Minimum 600 x 900px)
" 5 | PLG_SYSTEM_CCCSOCIALMEDIA_TW_HELP="
At Twitter you can reset the already cached data at the Twitter Validator.
An image (jpg, gif, png) for the Twitter summary is 1:1 in format and between 144x144px and 4096x4096px in size and does not exceed 5MB.
For the large image summary, the format is 2:1 with at least 300x157px
". 6 | PLG_SYSTEM_CCCSOCIALMEDIA_HIDE_MESSAGES="Disable Messages" 7 | PLG_SYSTEM_CCCSOCIALMEDIA_ENABLE_OG="OpenGraph" 8 | PLG_SYSTEM_CCCSOCIALMEDIA_ENABLE_TW="Twitter" 9 | PLG_SYSTEM_CCCSOCIALMEDIA_ENABLE_IN="Enable Form in" 10 | PLG_SYSTEM_CCCSOCIALMEDIA_ENABLE_IN_SELECT="- Select where to display form -" 11 | PLG_SYSTEM_CCCSOCIALMEDIA_ENABLE_IN_BOTH="Both" 12 | PLG_SYSTEM_CCCSOCIALMEDIA_FB_APP_ID_TITLE="Facebook App ID" 13 | PLG_SYSTEM_CCCSOCIALMEDIA_FB_APP_ID_DESC="Input your Facebook App ID, if available. You can create a Facebook App ID at developers.facebook.com" 14 | PLG_SYSTEM_CCCSOCIALMEDIA_FB_APP_ID_HINT="Leave empty if not available" 15 | PLG_SYSTEM_CCCSOCIALMEDIA_OG="OpenGraph" 16 | PLG_SYSTEM_CCCSOCIALMEDIA_OG_TITLE="Title" 17 | PLG_SYSTEM_CCCSOCIALMEDIA_OG_TITLE_HINT="Leave empty for Browsertitle or global option" 18 | PLG_SYSTEM_CCCSOCIALMEDIA_OG_TITLE_DESC="Define a Meta title. It should be between 40 and 90 chars. After 50 characters a line break occurs." 19 | PLG_SYSTEM_CCCSOCIALMEDIA_OG_TYPE="Page type" 20 | PLG_SYSTEM_CCCSOCIALMEDIA_OG_TYPE_DESC="Define the page type" 21 | PLG_SYSTEM_CCCSOCIALMEDIA_OG_DESC="Description" 22 | PLG_SYSTEM_CCCSOCIALMEDIA_OG_DESC_HINT="Leave empty to use the meta description" 23 | PLG_SYSTEM_CCCSOCIALMEDIA_OG_DESC_DESC="Write a meaningful text with call to action with a maximum lenght of 297 characters." 24 | PLG_SYSTEM_CCCSOCIALMEDIA_OG_IMAGE="Squared OG image" 25 | PLG_SYSTEM_CCCSOCIALMEDIA_OG_IMAGE_DESC="Upload square open graph image for Google. Best in 1200 x 1200px (1:1 squared), minimum 600 x 600px" 26 | PLG_SYSTEM_CCCSOCIALMEDIA_OG_PI_IMAGE="Pinterest OG Image" 27 | PLG_SYSTEM_CCCSOCIALMEDIA_OG_PI_IMAGE_DESC="Upload image for Pinterest. Best in 1200 x 1800px (2:3 portrait), minimum 600 x 900px" 28 | PLG_SYSTEM_CCCSOCIALMEDIA_OG_FB_IMAGE="Facebook OG image" 29 | PLG_SYSTEM_CCCSOCIALMEDIA_OG_FB_IMAGE_DESC="Upload image for Facebook and other platforms (Facebook format is the generic fallback). Best in 1200 x 630px (1,91:1 horizonal), minimum 600 x 315px" 30 | PLG_SYSTEM_CCCSOCIALMEDIA_OG_IMAGE_ALT="Alt-text for the Image" 31 | PLG_SYSTEM_CCCSOCIALMEDIA_OG_IMAGE_ALT_DESC="Describe what is seen on the picture." 32 | PLG_SYSTEM_CCCSOCIALMEDIA_OG_ARTICLE_PUBLISHED_TIME="Published Time" 33 | PLG_SYSTEM_CCCSOCIALMEDIA_OG_ARTICLE_PUBLISHED_TIME_HINT="Leave empty for the creation date" 34 | PLG_SYSTEM_CCCSOCIALMEDIA_OG_ARTICLE_PUBLISHED_TIME_DESC="Please select a date for the Published Time, leave it empty to let the plugin get the created time of the item." 35 | PLG_SYSTEM_CCCSOCIALMEDIA_OG_PRODUCT_PRICE_AMOUNT="Price" 36 | PLG_SYSTEM_CCCSOCIALMEDIA_OG_PRODUCT_PRICE_AMOUNT_DESC="Write down the price for example 99.00" 37 | PLG_SYSTEM_CCCSOCIALMEDIA_OG_PRODUCT_PRICE_CURRENCY="Currency" 38 | PLG_SYSTEM_CCCSOCIALMEDIA_OG_PRODUCT_PRICE_CURRENCY_DESC="Please specify the currency in international formal USD, EUR etc." 39 | PLG_SYSTEM_CCCSOCIALMEDIA_OG_PRODUCT_AVAILABILITY="Availability" 40 | PLG_SYSTEM_CCCSOCIALMEDIA_OG_PRODUCT_AVAILABILITY_DESC="Please select the Availability of the Product" 41 | PLG_SYSTEM_CCCSOCIALMEDIA_OG_ARTICLE_AUTHOR="Author" 42 | PLG_SYSTEM_CCCSOCIALMEDIA_OG_ARTICLE_AUTHOR_DESC="Write down the Author of the Article" 43 | PLG_SYSTEM_CCCSOCIALMEDIA_PRODUCT_INSTOCK="In Stock" 44 | PLG_SYSTEM_CCCSOCIALMEDIA_PRODUCT_PREORDER="Pre order" 45 | PLG_SYSTEM_CCCSOCIALMEDIA_PRODUCT_BACKORDER="Back order" 46 | PLG_SYSTEM_CCCSOCIALMEDIA_PRODUCT_PENDING="Pending" 47 | PLG_SYSTEM_CCCSOCIALMEDIA_PRODUCT_OUTOFSTOCK="Out of Stock" 48 | PLG_SYSTEM_CCCSOCIALMEDIA_TW="Twitter" 49 | PLG_SYSTEM_CCCSOCIALMEDIA_TW_TITLE="Title" 50 | PLG_SYSTEM_CCCSOCIALMEDIA_TW_TITLE_DESC="Write down the Title for Twitter with max. 70 chars." 51 | PLG_SYSTEM_CCCSOCIALMEDIA_TW_SITE="Twitter Site" 52 | PLG_SYSTEM_CCCSOCIALMEDIA_TW_SITE_DESC="Write down the Twitter name @username" 53 | PLG_SYSTEM_CCCSOCIALMEDIA_TW_CREATOR="Author" 54 | PLG_SYSTEM_CCCSOCIALMEDIA_TW_CREATOR_DESC="Write down who the Author is (Twittername). @authorname" 55 | PLG_SYSTEM_CCCSOCIALMEDIA_TW_DESC="Description" 56 | PLG_SYSTEM_CCCSOCIALMEDIA_TW_DESC_DESC="Place add the Description with a maximum of 200 characters." 57 | PLG_SYSTEM_CCCSOCIALMEDIA_TW_IMAGE="Twitter Image" 58 | PLG_SYSTEM_CCCSOCIALMEDIA_TW_IMAGE_DESC="Image (jpg, gif, png) for the Twitter Summary in 1:1 format and between 144x144px an 4096x4096px dimensions < 5MB. If you chose Large Image Summary the format is 2:1 with minimum 300 x 157px" 59 | PLG_SYSTEM_CCCSOCIALMEDIA_TW_IMAGE_ALT="Alt-text for the image" 60 | PLG_SYSTEM_CCCSOCIALMEDIA_TW_IMAGE_ALT_DESC="Describe what you see on the image. Max. 420 characters." 61 | PLG_SYSTEM_CCCSOCIALMEDIA_TW_PLAYER="Video iFrame" 62 | PLG_SYSTEM_CCCSOCIALMEDIA_TW_PLAYER_DESC="Paste here the embed Link to your video." 63 | PLG_SYSTEM_CCCSOCIALMEDIA_TW_PLAYER_WIDTH="Width" 64 | PLG_SYSTEM_CCCSOCIALMEDIA_TW_PLAYER_WIDTH_DESC="Video Width" 65 | PLG_SYSTEM_CCCSOCIALMEDIA_TW_PLAYER_HEIGHT="Height" 66 | PLG_SYSTEM_CCCSOCIALMEDIA_TW_PLAYER_HEIGHT_DESC="Video Height" 67 | PLG_SYSTEM_CCCSOCIALMEDIA_ARTICLE="Article" 68 | PLG_SYSTEM_CCCSOCIALMEDIA_BOOK="Book" 69 | PLG_SYSTEM_CCCSOCIALMEDIA_PROFILE="Profile" 70 | PLG_SYSTEM_CCCSOCIALMEDIA_WEBSITE="Website" 71 | PLG_SYSTEM_CCCSOCIALMEDIA_VIDEO_MOVIE="Video - Movie" 72 | PLG_SYSTEM_CCCSOCIALMEDIA_VIDEO_EPISODE="Video - Episode" 73 | PLG_SYSTEM_CCCSOCIALMEDIA_VIDEO_TVSHOW="Video - TV Show" 74 | PLG_SYSTEM_CCCSOCIALMEDIA_VIDEO_OTHER="Video - Other" 75 | PLG_SYSTEM_CCCSOCIALMEDIA_MUSIC_SONG="Music - Song" 76 | PLG_SYSTEM_CCCSOCIALMEDIA_MUSIC_ALBUM="Music - Album" 77 | PLG_SYSTEM_CCCSOCIALMEDIA_MUSIC_PLAYLIST="Music - Playlist" 78 | PLG_SYSTEM_CCCSOCIALMEDIA_MUSIC_RADIOSTATION="Music - radio station" 79 | PLG_SYSTEM_CCCSOCIALMEDIA_PRODUCT="Product" 80 | PLG_SYSTEM_CCCSOCIALMEDIA_TW_TYPE_LABEL="Card Type" 81 | PLG_SYSTEM_CCCSOCIALMEDIA_TW_TYPE_DESC="Chose the type of Twitter card" 82 | PLG_SYSTEM_CCCSOCIALMEDIA_TW_TYPE_SUMMARY="Summary" 83 | PLG_SYSTEM_CCCSOCIALMEDIA_TW_TYPE_SUMMARY_LARGE_IMAGE="Summary - Large Image" 84 | PLG_SYSTEM_CCCSOCIALMEDIA_TW_TYPE_CARD_APP="App" 85 | PLG_SYSTEM_CCCSOCIALMEDIA_TW_TYPE_PLAYER="Player" 86 | PLG_SYSTEM_CCCSOCIALMEDIA_DONATE="
Coolcat-Creations - Social Media Plugin
Thank you for using my plugin!
If you appreciate my work, I would be happy about donations to do more stuff like this in my spare time:
To paypal.me
" 87 | -------------------------------------------------------------------------------- /plg_cccsocialmedia/language/en-GB/en-GB.plg_system_cccsocialmedia.sys.ini: -------------------------------------------------------------------------------- 1 | ; 2 | ; Socialmedia language file 3 | ; 4 | 5 | PLG_CCCSOCIALMEDIA="CCC Socialmedia" 6 | PLG_CCCSOCIALMEDIA_XML_DESCRIPTION="CCC Socialmedia Plugin" 7 | -------------------------------------------------------------------------------- /plg_cccsocialmedia/language/fr-FR/fr-FR.plg_system_cccsocialmedia.ini: -------------------------------------------------------------------------------- 1 | PLG_SYSTEM_CCCSOCIALMEDIA="CCC Social Media" 2 | PLG_SYSTEM_CCCSOCIALMEDIA_GB_HELP="
Google
Les images sont généralement affichées au format carré.
Vous pouvez donc charger une image carrée ici.
Lorsque Google Bot accède à votre page, il reçoit la version optimisée de votre image.
Le format optimal est de 1200 x 1200px (minimum 600 x 600)
Si vous ne définissez aucune image dans les paramètres du plugin, celui-ci cherchera d'abord s'il y a une image d'introduction et ensuite une image de l'article.
" 3 | PLG_SYSTEM_CCCSOCIALMEDIA_FB_HELP="
At Facebook
Vous pouvez vider le cache de Facebook en utilisant le programme de débug du partage.
Une image Facebook open graph doit être au format paysage (1,91:1) avec comme dimensions 1200 x 630px (au minimum 600 x 315px)
Ce format est utilisé par de nombreuses plate-formes et est utilisé par conséquent comme image par défaut si rien d'autre n'est défini.
". 4 | PLG_SYSTEM_CCCSOCIALMEDIA_PI_HELP="
Pinterest
Vous devez d'abord initialiser votre site avec le Rich Pin Validator.
Vous pouvez également utiliser cet outil pour effacer les données de votre site déjà présentes.
Une image Pinterest est au format portrait (2:3) avec comme dimensions 1200 x 1800px (au minimum 600 x 900px).
" 5 | PLG_SYSTEM_CCCSOCIALMEDIA_TW_HELP="
Twitter
Vous pouvez réinitialiser vos données grâce au Card Validator.
Une image pour le résumé Twitter (jpg, gif, png) est au format carré 1:1 avec des dimensions comprises entre 144 x 144px et 4096 x 4096px sans excéder 5MB.
Pour le format large, il doit être de 2:1 avec des dimensions minimum de 300 x 157px
". 6 | PLG_SYSTEM_CCCSOCIALMEDIA_HIDE_MESSAGES="Désactiver les messages" 7 | PLG_SYSTEM_CCCSOCIALMEDIA_ENABLE_OG="OpenGraph" 8 | PLG_SYSTEM_CCCSOCIALMEDIA_ENABLE_TW="Twitter" 9 | PLG_SYSTEM_CCCSOCIALMEDIA_ENABLE_IN="Activer le formulaire dans" 10 | PLG_SYSTEM_CCCSOCIALMEDIA_ENABLE_IN_SELECT="- Sélectionnez où afficher le formulaire -" 11 | PLG_SYSTEM_CCCSOCIALMEDIA_ENABLE_IN_BOTH="les deux" 12 | PLG_SYSTEM_CCCSOCIALMEDIA_FB_APP_ID_TITLE="Facebook App ID" 13 | PLG_SYSTEM_CCCSOCIALMEDIA_FB_APP_ID_DESC="Indiquez ici votre Facebook App ID, si disponible. Vous pouvez créer votre Facebook App ID à cette adresse developers.facebook.com" 14 | PLG_SYSTEM_CCCSOCIALMEDIA_FB_APP_ID_HINT="Laissez vide si non disponible" 15 | PLG_SYSTEM_CCCSOCIALMEDIA_OG="OpenGraph" 16 | PLG_SYSTEM_CCCSOCIALMEDIA_OG_TITLE="Titre" 17 | PLG_SYSTEM_CCCSOCIALMEDIA_OG_TITLE_HINT="Laissez vide pour utiliser le contenu de la balise title" 18 | PLG_SYSTEM_CCCSOCIALMEDIA_OG_TITLE_DESC="Votre balise title doit compter entre 40 et 90 caractères. Au dessus de 50 caractères, le titre sera tronqué." 19 | PLG_SYSTEM_CCCSOCIALMEDIA_OG_TYPE="Type de page" 20 | PLG_SYSTEM_CCCSOCIALMEDIA_OG_TYPE_DESC="Sélectionnez le type de page" 21 | PLG_SYSTEM_CCCSOCIALMEDIA_OG_DESC="Description" 22 | PLG_SYSTEM_CCCSOCIALMEDIA_OG_DESC_HINT="Laissez vide pour utiliser le contenu de la balise meta description" 23 | PLG_SYSTEM_CCCSOCIALMEDIA_OG_DESC_DESC="Ecrivez un texte engageant avec un call to action contenant au maximum 297 caractères." 24 | PLG_SYSTEM_CCCSOCIALMEDIA_OG_IMAGE="Image carrée pour Google" 25 | PLG_SYSTEM_CCCSOCIALMEDIA_OG_IMAGE_DESC="Chargez une image carrée pour l'open graph Google. Le mieux est un format 1:1 avec comme dimensions 1200 x 1200px (au minimum 600 x 600px)" 26 | PLG_SYSTEM_CCCSOCIALMEDIA_OG_PI_IMAGE="Image pour Pinterest" 27 | PLG_SYSTEM_CCCSOCIALMEDIA_OG_PI_IMAGE_DESC="Chargez une image pour Pinterest. Le mieux est un format 2:3 portrait avec comme dimensions 1200 x 1800px (au minimum 600 x 900px)" 28 | PLG_SYSTEM_CCCSOCIALMEDIA_OG_FB_IMAGE="Image pour Facebook" 29 | PLG_SYSTEM_CCCSOCIALMEDIA_OG_FB_IMAGE_DESC="Chargez une image pour Facebook. Le mieux est un format 1,91:1 paysage avec comme dimensions 1200 x 630px (au minimum de 600 x 315px)" 30 | PLG_SYSTEM_CCCSOCIALMEDIA_OG_IMAGE_ALT="Balise Alt pour cette image" 31 | PLG_SYSTEM_CCCSOCIALMEDIA_OG_IMAGE_ALT_DESC="Indiquez ce que représente l'image" 32 | PLG_SYSTEM_CCCSOCIALMEDIA_OG_ARTICLE_PUBLISHED_TIME="Date de publication" 33 | PLG_SYSTEM_CCCSOCIALMEDIA_OG_ARTICLE_PUBLISHED_TIME_HINT="La date de création sera utilisée si ce champ est laissé vide" 34 | PLG_SYSTEM_CCCSOCIALMEDIA_OG_ARTICLE_PUBLISHED_TIME_DESC="Indiquez la date de publication. Si laissé vide, le plugin utilisera la date de création de l'item." 35 | PLG_SYSTEM_CCCSOCIALMEDIA_OG_PRODUCT_PRICE_AMOUNT="Prix" 36 | PLG_SYSTEM_CCCSOCIALMEDIA_OG_PRODUCT_PRICE_AMOUNT_DESC="Indiquez le prix. Par exemple 99.00€" 37 | PLG_SYSTEM_CCCSOCIALMEDIA_OG_PRODUCT_PRICE_CURRENCY="Monnaie" 38 | PLG_SYSTEM_CCCSOCIALMEDIA_OG_PRODUCT_PRICE_CURRENCY_DESC="Indiquez la monnaie utilisée au format international : USD, EUR etc." 39 | PLG_SYSTEM_CCCSOCIALMEDIA_OG_PRODUCT_AVAILABILITY="Disponibilité" 40 | PLG_SYSTEM_CCCSOCIALMEDIA_OG_PRODUCT_AVAILABILITY_DESC="Indiquez la disponibilité du produit" 41 | PLG_SYSTEM_CCCSOCIALMEDIA_OG_ARTICLE_AUTHOR="Auteur" 42 | PLG_SYSTEM_CCCSOCIALMEDIA_OG_ARTICLE_AUTHOR_DESC="Indiquez le nom de l'auteur de l'article" 43 | PLG_SYSTEM_CCCSOCIALMEDIA_PRODUCT_INSTOCK="En stock" 44 | PLG_SYSTEM_CCCSOCIALMEDIA_PRODUCT_PREORDER="Pré-commande" 45 | PLG_SYSTEM_CCCSOCIALMEDIA_PRODUCT_BACKORDER="Back order" 46 | PLG_SYSTEM_CCCSOCIALMEDIA_PRODUCT_PENDING="En attente" 47 | PLG_SYSTEM_CCCSOCIALMEDIA_PRODUCT_OUTOFSTOCK="Stock épuisé" 48 | PLG_SYSTEM_CCCSOCIALMEDIA_TW="Twitter" 49 | PLG_SYSTEM_CCCSOCIALMEDIA_TW_TITLE="Titre" 50 | PLG_SYSTEM_CCCSOCIALMEDIA_TW_TITLE_DESC="Indiquez le titre pour Twitter. Maximum 70 caractères." 51 | PLG_SYSTEM_CCCSOCIALMEDIA_TW_SITE="Pseudo Twitter" 52 | PLG_SYSTEM_CCCSOCIALMEDIA_TW_SITE_DESC="Indiquez ici le pseudo Twitter sous la forme @username" 53 | PLG_SYSTEM_CCCSOCIALMEDIA_TW_CREATOR="Auteur" 54 | PLG_SYSTEM_CCCSOCIALMEDIA_TW_CREATOR_DESC="Indiquez ici le nom de l'auteur (Twittername) sous la forme @authorname" 55 | PLG_SYSTEM_CCCSOCIALMEDIA_TW_DESC="Description" 56 | PLG_SYSTEM_CCCSOCIALMEDIA_TW_DESC_DESC="Indiquez ici la description avec un maximum de 200 caractères." 57 | PLG_SYSTEM_CCCSOCIALMEDIA_TW_IMAGE="Image Twitter" 58 | PLG_SYSTEM_CCCSOCIALMEDIA_TW_IMAGE_DESC="Pour le résumé Twitter, utilisez une image (jpg, gif, png) au format 1:1, entre 144 x 144px et 4096 x 4096px et inférieure à 5MB. Si vous utilisez le format large, le format de l'image doit être de 2:1 avec des dimensions minimum de 300 x 157px" 59 | PLG_SYSTEM_CCCSOCIALMEDIA_TW_IMAGE_ALT="Balise Alt pour cette image" 60 | PLG_SYSTEM_CCCSOCIALMEDIA_TW_IMAGE_ALT_DESC="Indiquez ce que représente l'image. Maximum 420 caractères." 61 | PLG_SYSTEM_CCCSOCIALMEDIA_TW_PLAYER="Iframe vidéo" 62 | PLG_SYSTEM_CCCSOCIALMEDIA_TW_PLAYER_DESC="Collez ici le lien de votre vidéo." 63 | PLG_SYSTEM_CCCSOCIALMEDIA_TW_PLAYER_WIDTH="Largeur" 64 | PLG_SYSTEM_CCCSOCIALMEDIA_TW_PLAYER_WIDTH_DESC="Largeur de la vidéo" 65 | PLG_SYSTEM_CCCSOCIALMEDIA_TW_PLAYER_HEIGHT="Hauteur" 66 | PLG_SYSTEM_CCCSOCIALMEDIA_TW_PLAYER_HEIGHT_DESC="Hauteur de la vidéo" 67 | PLG_SYSTEM_CCCSOCIALMEDIA_ARTICLE="Article" 68 | PLG_SYSTEM_CCCSOCIALMEDIA_BOOK="Livre" 69 | PLG_SYSTEM_CCCSOCIALMEDIA_PROFILE="Profil" 70 | PLG_SYSTEM_CCCSOCIALMEDIA_WEBSITE="Site web" 71 | PLG_SYSTEM_CCCSOCIALMEDIA_VIDEO_MOVIE="Vidéo - Film" 72 | PLG_SYSTEM_CCCSOCIALMEDIA_VIDEO_EPISODE="Vidéo - Episode" 73 | PLG_SYSTEM_CCCSOCIALMEDIA_VIDEO_TVSHOW="Vidéo - Emission" 74 | PLG_SYSTEM_CCCSOCIALMEDIA_VIDEO_OTHER="Vidéo - Autre" 75 | PLG_SYSTEM_CCCSOCIALMEDIA_MUSIC_SONG="Musique - Chanson" 76 | PLG_SYSTEM_CCCSOCIALMEDIA_MUSIC_ALBUM="Musique - Album" 77 | PLG_SYSTEM_CCCSOCIALMEDIA_MUSIC_PLAYLIST="Musique - Playlist" 78 | PLG_SYSTEM_CCCSOCIALMEDIA_MUSIC_RADIOSTATION="Musique - Radio" 79 | PLG_SYSTEM_CCCSOCIALMEDIA_PRODUCT="Produit" 80 | PLG_SYSTEM_CCCSOCIALMEDIA_TW_TYPE_LABEL="Type de carte" 81 | PLG_SYSTEM_CCCSOCIALMEDIA_TW_TYPE_DESC="Indiquez le type de carte Twitter" 82 | PLG_SYSTEM_CCCSOCIALMEDIA_TW_TYPE_SUMMARY="Résumé" 83 | PLG_SYSTEM_CCCSOCIALMEDIA_TW_TYPE_SUMMARY_LARGE_IMAGE="Résumé - Image large" 84 | PLG_SYSTEM_CCCSOCIALMEDIA_TW_TYPE_CARD_APP="App" 85 | PLG_SYSTEM_CCCSOCIALMEDIA_TW_TYPE_PLAYER="Player" 86 | PLG_SYSTEM_CCCSOCIALMEDIA_DONATE="
Coolcat-Creations - Social Media Plugin
Merci d'utiliser mon plugin!
Si vous aimez mon travail, j'apprécierai vos dons pour continuer à produire ce type de création durant mon temps libre :
vers paypal.me
" 87 | -------------------------------------------------------------------------------- /plg_cccsocialmedia/language/fr-FR/fr-FR.plg_system_cccsocialmedia.sys.ini: -------------------------------------------------------------------------------- 1 | ; 2 | ; Socialmedia language file 3 | ; 4 | 5 | PLG_CCCSOCIALMEDIA="CCC Socialmedia" 6 | PLG_CCCSOCIALMEDIA_XML_DESCRIPTION="Plugin CCC Socialmedia" 7 | -------------------------------------------------------------------------------- /plg_cccsocialmedia/language/nl-NL/plg_system_cccsocialmedia.ini: -------------------------------------------------------------------------------- 1 | ; 2 | ; Socialmedia language file 3 | ; Translated by Peter Martin, https://db8.nl 4 | ; 5 | 6 | PLG_SYSTEM_CCCSOCIALMEDIA="CCC Social Media" 7 | PLG_SYSTEM_CCCSOCIALMEDIA_GB_HELP="
GoogleOpenGraph afbeeldingen worden gewoonlijk tot vierkanten gesneden.
Daarom kunt u hier een vierkante afbeelding uploaden.
Wanneer de Google Bot deze pagina benadert, krijgt die de geoptimaliseerde afbeelding.
Een optimale grootte is 1200 x 1200px (minimaal 600 x 600)
Als u geen van de OG afbeeldingen definieert in de plugin, zal de plugin eerst zoeken naar een intro afbeelding en dan naar een artikel afbeelding
" 8 | PLG_SYSTEM_CCCSOCIALMEDIA_FB_HELP="
Bij Facebook kunt u reeds gecachete gegevens resetten met de Facebook Debugger.
Een Facebook open graph afbeelding is in landscape formaat (1,91:1) en het beste in 1200 x 630px formaat (1,91:1). (Minimaal 600 x 315px)
Dit formaat wordt door veel platforms gebruikt en wordt daarom gebruikt als fallback/default image als er niets anders is gedefinieerd.
". 9 | PLG_SYSTEM_CCCSOCIALMEDIA_PI_HELP="
Op Pinterest dient u eerst uw website initialiseren bij Rich Pin Validator.
U kunt deze tool ook gebruiken om de reeds opgeslagen open graph gegevens te resetten. >Een Pinterest afbeelding is in staand formaat (2:3) en maximaal 1200 x 1800px groot. (Minimaal 600 x 900px)
" 10 | PLG_SYSTEM_CCCSOCIALMEDIA_TW_HELP="
Bij Twitter kunt u de reeds in de cache opgeslagen gegevens resetten bij de the Twitter Validator.
Een afbeelding (jpg, gif, png) voor de Twitter samenvatting is 1:1 in formaat en tussen 144x144px en 4096x4096px in grootte en is niet groter dan 5MB.
Voor de grote afbeelding samenvatting, is het formaat 2:1 met ten minste 300x157px
". 11 | PLG_SYSTEM_CCCSOCIALMEDIA_HIDE_MESSAGES="Berichten uitschakelen" 12 | PLG_SYSTEM_CCCSOCIALMEDIA_ENABLE_OG="OpenGraph" 13 | PLG_SYSTEM_CCCSOCIALMEDIA_ENABLE_TW="Twitter" 14 | PLG_SYSTEM_CCCSOCIALMEDIA_ENABLE_IN="Formulier inschakelen in" 15 | PLG_SYSTEM_CCCSOCIALMEDIA_ENABLE_IN_SELECT="- Selecteer waar formulier weer te geven -" 16 | PLG_SYSTEM_CCCSOCIALMEDIA_ENABLE_IN_BOTH="Beide" 17 | PLG_SYSTEM_CCCSOCIALMEDIA_FB_APP_ID_TITLE="Facebook App ID" 18 | PLG_SYSTEM_CCCSOCIALMEDIA_FB_APP_ID_DESC="Voer uw Facebook App ID in, indien beschikbaar. U kunt een Facebook App ID aanmaken op developers.facebook.com" 19 | PLG_SYSTEM_CCCSOCIALMEDIA_FB_APP_ID_HINT="Leeg laten indien niet beschikbaar" 20 | PLG_SYSTEM_CCCSOCIALMEDIA_OG="OpenGraph" 21 | PLG_SYSTEM_CCCSOCIALMEDIA_OG_TITLE="Titel" 22 | PLG_SYSTEM_CCCSOCIALMEDIA_OG_TITLE_HINT="Leeg laten voor Browsertitel of globale optie" 23 | PLG_SYSTEM_CCCSOCIALMEDIA_OG_TITLE_DESC="Definieer een Meta titel. Deze moet tussen 40 en 90 karakters zijn. Na 50 karakters volgt een regeleinde." 24 | PLG_SYSTEM_CCCSOCIALMEDIA_OG_TYPE="Pagina type" 25 | PLG_SYSTEM_CCCSOCIALMEDIA_OG_TYPE_DESC="Definieer het paginatype" 26 | PLG_SYSTEM_CCCSOCIALMEDIA_OG_DESC="Beschrijving" 27 | PLG_SYSTEM_CCCSOCIALMEDIA_OG_DESC_HINT="Leeg laten om de meta beschrijving te gebruiken" 28 | PLG_SYSTEM_CCCSOCIALMEDIA_OG_DESC_DESC="Schrijf een zinvolle tekst met een oproep tot actie met een maximum lengte van 297 tekens." 29 | PLG_SYSTEM_CCCSOCIALMEDIA_OG_IMAGE="Vierkante OG afbeelding" 30 | PLG_SYSTEM_CCCSOCIALMEDIA_OG_IMAGE_DESC="Upload vierkante open graph afbeelding voor Google. Beste formaat is 1200 x 1200px (1:1 vierkant), minimum 600 x 600px" 31 | PLG_SYSTEM_CCCSOCIALMEDIA_OG_PI_IMAGE="Pinterest OG Afbeelding" 32 | PLG_SYSTEM_CCCSOCIALMEDIA_OG_PI_IMAGE_DESC="Afbeelding uploaden voor Pinterest. Beste formaat is 1200 x 1800px (2:3 staand), minimaal 600 x 900px" 33 | PLG_SYSTEM_CCCSOCIALMEDIA_OG_FB_IMAGE="OG afbeelding voor Facebook" 34 | PLG_SYSTEM_CCCSOCIALMEDIA_OG_FB_IMAGE_DESC="Upload afbeelding voor Facebook en andere platformen (Facebook formaat is de generieke fallback). Beste formaat is 1200 x 630px (1,91:1 horizontaal), minimum 600 x 315px" 35 | PLG_SYSTEM_CCCSOCIALMEDIA_OG_IMAGE_ALT="Alt-tekst voor de afbeelding" 36 | PLG_SYSTEM_CCCSOCIALMEDIA_OG_IMAGE_ALT_DESC="Beschrijf wat er te zien is op de foto." 37 | PLG_SYSTEM_CCCSOCIALMEDIA_OG_ARTICLE_PUBLISHED_TIME="Gepubliceerde tijd" 38 | PLG_SYSTEM_CCCSOCIALMEDIA_OG_ARTICLE_PUBLISHED_TIME_HINT="Leeg laten voor de aanmaakdatum" 39 | PLG_SYSTEM_CCCSOCIALMEDIA_OG_ARTICLE_PUBLISHED_TIME_DESC="Selecteer aub een datum voor de gepubliceerde tijd, laat het leeg om de plugin de tijd te laten krijgen waarop het item is gemaakt." 40 | PLG_SYSTEM_CCCSOCIALMEDIA_OG_PRODUCT_PRICE_AMOUNT="Prijs". 41 | PLG_SYSTEM_CCCSOCIALMEDIA_OG_PRODUCT_PRICE_AMOUNT_DESC="Schrijf de prijs op, bijvoorbeeld 99,00" 42 | PLG_SYSTEM_CCCSOCIALMEDIA_OG_PRODUCT_PRICE_CURRENCY="Valuta". 43 | PLG_SYSTEM_CCCSOCIALMEDIA_OG_PRODUCT_PRICE_CURRENCY_DESC="Geef de munteenheid op in internationaal formeel USD, EUR etc." 44 | PLG_SYSTEM_CCCSOCIALMEDIA_OG_PRODUCT_AVAILABILITY="Beschikbaarheid". 45 | PLG_SYSTEM_CCCSOCIALMEDIA_OG_PRODUCT_AVAILABILITY_DESC="Selecteer a.u.b. de beschikbaarheid van het product" 46 | PLG_SYSTEM_CCCSOCIALMEDIA_OG_ARTICLE_AUTHOR="Auteur" 47 | PLG_SYSTEM_CCCSOCIALMEDIA_OG_ARTICLE_AUTHOR_DESC="Auteur van het artikel" 48 | PLG_SYSTEM_CCCSOCIALMEDIA_PRODUCT_INSTOCK="Op Voorraad" 49 | PLG_SYSTEM_CCCSOCIALMEDIA_PRODUCT_PREORDER="Vooraf bestellen" 50 | PLG_SYSTEM_CCCSOCIALMEDIA_PRODUCT_BACKORDER="Nabestelling" 51 | PLG_SYSTEM_CCCSOCIALMEDIA_PRODUCT_PENDING="In afwachting van" 52 | PLG_SYSTEM_CCCSOCIALMEDIA_PRODUCT_OUTOFSTOCK="Niet op voorraad" 53 | PLG_SYSTEM_CCCSOCIALMEDIA_TW="Twitter" 54 | PLG_SYSTEM_CCCSOCIALMEDIA_TW_TITLE="Title" 55 | PLG_SYSTEM_CCCSOCIALMEDIA_TW_TITLE_DESC="Geef de titel voor Twitter met max. 70 karakters." 56 | PLG_SYSTEM_CCCSOCIALMEDIA_TW_SITE="Twitter Site" 57 | PLG_SYSTEM_CCCSOCIALMEDIA_TW_SITE_DESC="Schrijf de Twitter naam op @username" 58 | PLG_SYSTEM_CCCSOCIALMEDIA_TW_CREATOR="Auteur" 59 | PLG_SYSTEM_CCCSOCIALMEDIA_TW_CREATOR_DESC="Geef op wie de auteur is (Twitternaam). @auteurnaam" 60 | PLG_SYSTEM_CCCSOCIALMEDIA_TW_DESC="Beschrijving" 61 | PLG_SYSTEM_CCCSOCIALMEDIA_TW_DESC_DESC="Plaats de Beschrijving met een maximum van 200 tekens." 62 | PLG_SYSTEM_CCCSOCIALMEDIA_TW_IMAGE="Twitter Plaatje" 63 | PLG_SYSTEM_CCCSOCIALMEDIA_TW_IMAGE_DESC="Plaatje (jpg, gif, png) voor de Twitter Summary in 1:1 formaat en tussen 144x144px en 4096x4096px afmetingen < 5MB. Als u kiest voor een groot beeldoverzicht is het formaat 2:1 met minimaal 300 x 157px" 64 | PLG_SYSTEM_CCCSOCIALMEDIA_TW_IMAGE_ALT="Alt-text voor het plaatje" 65 | PLG_SYSTEM_CCCSOCIALMEDIA_TW_IMAGE_ALT_DESC="Beschrijf wat u ziet op de afbeelding. Max. 420 tekens." 66 | PLG_SYSTEM_CCCSOCIALMEDIA_TW_PLAYER="Video iFrame" 67 | PLG_SYSTEM_CCCSOCIALMEDIA_TW_PLAYER_DESC="Plak hier de embed Link naar uw video." 68 | PLG_SYSTEM_CCCSOCIALMEDIA_TW_PLAYER_WIDTH="Breedte" 69 | PLG_SYSTEM_CCCSOCIALMEDIA_TW_PLAYER_WIDTH_DESC="Video Breedte" 70 | PLG_SYSTEM_CCCSOCIALMEDIA_TW_PLAYER_HEIGHT="Hoogte" 71 | PLG_SYSTEM_CCCSOCIALMEDIA_TW_PLAYER_HEIGHT_DESC="Video hoogte" 72 | PLG_SYSTEM_CCCSOCIALMEDIA_ARTICLE="Artikel" 73 | PLG_SYSTEM_CCCSOCIALMEDIA_BOOK="Boek" 74 | PLG_SYSTEM_CCCSOCIALMEDIA_PROFILE="Profiel" 75 | PLG_SYSTEM_CCCSOCIALMEDIA_WEBSITE="Website" 76 | PLG_SYSTEM_CCCSOCIALMEDIA_VIDEO_MOVIE="Video - Film" 77 | PLG_SYSTEM_CCCSOCIALMEDIA_VIDEO_EPISODE="Video - Aflevering" 78 | PLG_SYSTEM_CCCSOCIALMEDIA_VIDEO_TVSHOW="Video - TV-Show" 79 | PLG_SYSTEM_CCCSOCIALMEDIA_VIDEO_OTHER="Video - Andere" 80 | PLG_SYSTEM_CCCSOCIALMEDIA_MUSIC_SONG="Muziek - Liedje" 81 | PLG_SYSTEM_CCCSOCIALMEDIA_MUSIC_ALBUM="Muziek - Album" 82 | PLG_SYSTEM_CCCSOCIALMEDIA_MUSIC_PLAYLIST="Muziek - Afspeellijst" 83 | PLG_SYSTEM_CCCSOCIALMEDIA_MUSIC_RADIOSTATION="Muziek - radiozender" 84 | PLG_SYSTEM_CCCSOCIALMEDIA_PRODUCT="Product" 85 | PLG_SYSTEM_CCCSOCIALMEDIA_TW_TYPE_LABEL="Type kaart" 86 | PLG_SYSTEM_CCCSOCIALMEDIA_TW_TYPE_DESC="Kies het type Twitter kaart" 87 | PLG_SYSTEM_CCCSOCIALMEDIA_TW_TYPE_SUMMARY="Samenvatting" 88 | PLG_SYSTEM_CCCSOCIALMEDIA_TW_TYPE_SUMMARY_LARGE_IMAGE="Samenvatting - Grote afbeelding" 89 | PLG_SYSTEM_CCCSOCIALMEDIA_TW_TYPE_CARD_APP="App" 90 | PLG_SYSTEM_CCCSOCIALMEDIA_TW_TYPE_PLAYER="Speler" 91 | PLG_SYSTEM_CCCSOCIALMEDIA_DONATE="
Coolcat-Creations - Social Media Plugin
Dank u voor het gebruik van mijn plugin!
Als u mijn werk waardeert, zou ik blij zijn met donaties om meer van dit soort dingen te doen in mijn vrije tijd:
To paypal.me
" 92 | -------------------------------------------------------------------------------- /plg_cccsocialmedia/language/nl-NL/plg_system_cccsocialmedia.sys.ini: -------------------------------------------------------------------------------- 1 | ; 2 | ; Socialmedia language file 3 | ; Translated by Peter Martin, https://db8.nl 4 | ; 5 | 6 | PLG_CCCSOCIALMEDIA="CCC Socialmedia" 7 | PLG_CCCSOCIALMEDIA_XML_DESCRIPTION="CCC Socialmedia Plugin" 8 | -------------------------------------------------------------------------------- /tests/PrivateAccess.php: -------------------------------------------------------------------------------- 1 | object = $object; 12 | } 13 | 14 | /** 15 | * @throws ReflectionException 16 | */ 17 | public function __call(string $methodName, array $arguments) 18 | { 19 | $class = new ReflectionClass($this->object); 20 | $method = $class->getMethod($methodName); 21 | $method->setAccessible(true); 22 | 23 | return $method->invokeArgs($this->object, $arguments); 24 | } 25 | 26 | /** 27 | * @throws ReflectionException 28 | */ 29 | public function __get(string $name) 30 | { 31 | $class = new ReflectionObject($this->object); 32 | $property = $class->getProperty($name); 33 | $property->setAccessible(true); 34 | 35 | return $property->getValue($this->object); 36 | } 37 | 38 | /** 39 | * @throws ReflectionException 40 | */ 41 | public function __set(string $name, $value): void 42 | { 43 | $reflection = new ReflectionClass($this->object); 44 | $reflectionProperty = $reflection->getProperty($name); 45 | $reflectionProperty->setAccessible(true); 46 | $reflectionProperty->setValue($this->object, $value); 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /tests/SocialMediaTest.php: -------------------------------------------------------------------------------- 1 | [ 18 | 'article' => [ 19 | 'article_page_title' => 'Article Page Title', 20 | ], 21 | 'menu' => [ 22 | 'page_title' => 'Menu Page Title', 23 | ], 24 | 'document' => [ 25 | 'title' => 'Document Title', 26 | ], 27 | 'expected' => 'Article Page Title', 28 | ]; 29 | yield 'empty article page title' => [ 30 | 'article' => [ 31 | ], 32 | 'menu' => [ 33 | 'page_title' => 'Menu Page Title', 34 | ], 35 | 'document' => [ 36 | 'title' => 'Document Title', 37 | ], 38 | 'expected' => 'Menu Page Title', 39 | ]; 40 | yield 'empty article and menu page title' => [ 41 | 'article' => [ 42 | ], 43 | 'menu' => [ 44 | ], 45 | 'document' => [ 46 | 'title' => 'Document Title', 47 | ], 48 | 'expected' => 'Document Title', 49 | ]; 50 | } 51 | 52 | /** 53 | * @testdox Title fallback is retrieved with defined priority 54 | * @dataProvider casesTitle 55 | * 56 | * @param array $articleProperties 57 | * @param array $menuProperties 58 | * @param array $documentProperties 59 | * @param string $expected 60 | * 61 | * @return void 62 | */ 63 | public function testGetTitle( 64 | array $articleProperties, 65 | array $menuProperties, 66 | array $documentProperties, 67 | string $expected 68 | ): void { 69 | $articleParams = $this->createRegistry($articleProperties); 70 | $menuParams = $this->createRegistry($menuProperties); 71 | $document = $this->createDocument($documentProperties); 72 | $plugin = $this->createPlugin(); 73 | 74 | $this->assertEquals( 75 | $expected, 76 | private_access($plugin) 77 | ->getTitle($articleParams, $menuParams, $document) 78 | ); 79 | } 80 | 81 | /** 82 | * Test data for the getDescription method 83 | * 84 | * @return \Generator 85 | */ 86 | public function casesDescription(): Generator 87 | { 88 | yield 'all set for non-category' => [ 89 | 'menu' => [ 90 | 'menu-meta_description' => 'Menu Meta Description', 91 | 'page_description' => 'Page Description', 92 | ], 93 | 'document' => [ 94 | 'description' => 'Document Description' 95 | ], 96 | 'view' => 'article', 97 | 'expected' => 'Document Description', 98 | ]; 99 | yield 'all set for category' => [ 100 | 'menu' => [ 101 | 'menu-meta_description' => 'Menu Meta Description', 102 | 'page_description' => 'Page Description', 103 | ], 104 | 'document' => [ 105 | 'description' => 'Document Description' 106 | ], 107 | 'view' => 'category', 108 | 'expected' => 'Menu Meta Description', 109 | ]; 110 | yield 'empty menu meta description' => [ 111 | 'menu' => [ 112 | 'page_description' => 'Page Description', 113 | ], 114 | 'document' => [ 115 | 'description' => 'Document Description' 116 | ], 117 | 'view' => 'category', 118 | 'expected' => 'Page Description', 119 | ]; 120 | yield 'empty menu meta and page description' => [ 121 | 'menu' => [ 122 | ], 123 | 'document' => [ 124 | 'description' => 'Document Description' 125 | ], 126 | 'view' => 'category', 127 | 'expected' => 'Document Description', 128 | ]; 129 | } 130 | 131 | /** 132 | * @testdox Description fallback is retrieved with defined priority 133 | * @dataProvider casesDescription 134 | * 135 | * @param array $menuProperties 136 | * @param array $documentProperties 137 | * @param string $view 138 | * @param string $expected 139 | * 140 | * @return void 141 | */ 142 | public function testGetDescription( 143 | array $menuProperties, 144 | array $documentProperties, 145 | string $view, 146 | string $expected 147 | ): void { 148 | $menuParams = $this->createRegistry($menuProperties); 149 | $document = $this->createDocument($documentProperties); 150 | $plugin = $this->createPlugin(); 151 | 152 | $this->assertEquals( 153 | $expected, 154 | private_access($plugin) 155 | ->getDescription($menuParams, $document, $view) 156 | ); 157 | } 158 | 159 | /** 160 | * Test cases for bot detection 161 | * 162 | * @return \Generator 163 | */ 164 | public function casesBot(): Generator 165 | { 166 | yield 'googlebot' => [ 167 | 'useragent' => 'something containing googlebot as a signal', 168 | 'expected' => plgSystemCccsocialmedia::GOOGLE, 169 | ]; 170 | yield 'facebot' => [ 171 | 'useragent' => 'something containing facebot as a signal', 172 | 'expected' => plgSystemCccsocialmedia::FACEBOOK, 173 | ]; 174 | yield 'facebook' => [ 175 | 'useragent' => 'something containing facebook as a signal', 176 | 'expected' => plgSystemCccsocialmedia::FACEBOOK, 177 | ]; 178 | yield 'linkedinbot' => [ 179 | 'useragent' => 'something containing LinkedInBot as a signal', 180 | 'expected' => plgSystemCccsocialmedia::FACEBOOK, 181 | ]; 182 | yield 'pinterest' => [ 183 | 'useragent' => 'something containing pinterest as a signal', 184 | 'expected' => plgSystemCccsocialmedia::PINTEREST, 185 | ]; 186 | yield 'anything else' => [ 187 | 'useragent' => 'something containing none of the known signals', 188 | 'expected' => plgSystemCccsocialmedia::NONE, 189 | ]; 190 | } 191 | 192 | /** 193 | * @testdox Useragents are mapped correctly to bot identifiers 194 | * @dataProvider casesBot 195 | * 196 | * @param string $useragent 197 | * @param string $expected 198 | * 199 | * @return void 200 | */ 201 | public function testGetBot(string $useragent, string $expected): void 202 | { 203 | $app = new Application(); 204 | $app->setUserAgent($useragent); 205 | 206 | $plugin = $this->createPlugin( 207 | [], 208 | $app 209 | ); 210 | 211 | $this->assertEquals( 212 | $expected, 213 | private_access($plugin) 214 | ->getBot() 215 | ); 216 | } 217 | 218 | /** 219 | * Test data for the addImageFallback method 220 | * 221 | * @return \Generator 222 | */ 223 | public function casesImage(): Generator 224 | { 225 | yield 'category view' => [ 226 | 'plugin' => [ 227 | 'og_image' => 'OG Image Google', 228 | 'og_image_fb' => 'OG Image Facebook', 229 | 'og_image_pi' => 'OG Image Pinterest', 230 | 'og_image_alt' => 'OG Image alt text', 231 | ], 232 | 'images' => [ 233 | 'image_intro' => 'Article Intro Image', 234 | 'image_intro_alt' => 'Article Intro Image alt text', 235 | 'image_fulltext' => 'Article Fulltext Image', 236 | 'image_fulltext_alt' => 'Article Fulltext Image alt text', 237 | ], 238 | 'view' => 'category', 239 | 'user_agent' => plgSystemCccsocialmedia::GOOGLE, 240 | 'expected' => [ 241 | 'og_image' => 'OG Image Google', 242 | 'og_image_alt' => 'OG Image alt text', 243 | 'tw_image' => null, 244 | 'tw_image_alt' => null, 245 | ] 246 | ]; 247 | yield 'article view google' => [ 248 | 'plugin' => [ 249 | 'og_image' => 'OG Image Google', 250 | 'og_image_fb' => 'OG Image Facebook', 251 | 'og_image_pi' => 'OG Image Pinterest', 252 | 'og_image_alt' => 'OG Image alt text', 253 | ], 254 | 'images' => [ 255 | 'image_intro' => 'Article Intro Image', 256 | 'image_intro_alt' => 'Article Intro Image alt text', 257 | 'image_fulltext' => 'Article Fulltext Image', 258 | 'image_fulltext_alt' => 'Article Fulltext Image alt text', 259 | ], 260 | 'view' => 'article', 261 | 'user_agent' => plgSystemCccsocialmedia::GOOGLE, 262 | 'expected' => [ 263 | 'og_image' => 'OG Image Google', 264 | 'og_image_alt' => 'OG Image alt text', 265 | 'tw_image' => 'OG Image Google', 266 | 'tw_image_alt' => 'OG Image alt text', 267 | ] 268 | ]; 269 | yield 'article view facebook' => [ 270 | 'plugin' => [ 271 | 'og_image' => 'OG Image Google', 272 | 'og_image_fb' => 'OG Image Facebook', 273 | 'og_image_pi' => 'OG Image Pinterest', 274 | 'og_image_alt' => 'OG Image alt text', 275 | ], 276 | 'images' => [ 277 | 'image_intro' => 'Article Intro Image', 278 | 'image_intro_alt' => 'Article Intro Image alt text', 279 | 'image_fulltext' => 'Article Fulltext Image', 280 | 'image_fulltext_alt' => 'Article Fulltext Image alt text', 281 | ], 282 | 'view' => 'article', 283 | 'user_agent' => plgSystemCccsocialmedia::FACEBOOK, 284 | 'expected' => [ 285 | 'og_image' => 'OG Image Facebook', 286 | 'og_image_alt' => 'OG Image alt text', 287 | 'tw_image' => 'OG Image Facebook', 288 | 'tw_image_alt' => 'OG Image alt text', 289 | ] 290 | ]; 291 | yield 'article view pinterest' => [ 292 | 'plugin' => [ 293 | 'og_image' => 'OG Image Google', 294 | 'og_image_fb' => 'OG Image Facebook', 295 | 'og_image_pi' => 'OG Image Pinterest', 296 | 'og_image_alt' => 'OG Image alt text', 297 | ], 298 | 'images' => [ 299 | 'image_intro' => 'Article Intro Image', 300 | 'image_intro_alt' => 'Article Intro Image alt text', 301 | 'image_fulltext' => 'Article Fulltext Image', 302 | 'image_fulltext_alt' => 'Article Fulltext Image alt text', 303 | ], 304 | 'view' => 'article', 305 | 'user_agent' => plgSystemCccsocialmedia::PINTEREST, 306 | 'expected' => [ 307 | 'og_image' => 'OG Image Pinterest', 308 | 'og_image_alt' => 'OG Image alt text', 309 | 'tw_image' => 'OG Image Pinterest', 310 | 'tw_image_alt' => 'OG Image alt text', 311 | ] 312 | ]; 313 | yield 'article view facebook w/o fb image' => [ 314 | 'plugin' => [ 315 | 'og_image' => 'OG Image Google', 316 | 'og_image_pi' => 'OG Image Pinterest', 317 | 'og_image_alt' => 'OG Image alt text', 318 | ], 319 | 'images' => [ 320 | 'image_intro' => 'Article Intro Image', 321 | 'image_intro_alt' => 'Article Intro Image alt text', 322 | 'image_fulltext' => 'Article Fulltext Image', 323 | 'image_fulltext_alt' => 'Article Fulltext Image alt text', 324 | ], 325 | 'view' => 'article', 326 | 'user_agent' => plgSystemCccsocialmedia::FACEBOOK, 327 | 'expected' => [ 328 | 'og_image' => 'Article Intro Image', 329 | 'og_image_alt' => 'Article Intro Image alt text', 330 | 'tw_image' => 'Article Intro Image', 331 | 'tw_image_alt' => 'Article Intro Image alt text', 332 | ] 333 | ]; 334 | yield 'article view facebook w/o fb image w/o intro image' => [ 335 | 'plugin' => [ 336 | 'og_image' => 'OG Image Google', 337 | 'og_image_pi' => 'OG Image Pinterest', 338 | 'og_image_alt' => 'OG Image alt text', 339 | ], 340 | 'images' => [ 341 | 'image_intro' => '', 342 | 'image_intro_alt' => '', 343 | 'image_fulltext' => 'Article Fulltext Image', 344 | 'image_fulltext_alt' => 'Article Fulltext Image alt text', 345 | ], 346 | 'view' => 'article', 347 | 'user_agent' => plgSystemCccsocialmedia::FACEBOOK, 348 | 'expected' => [ 349 | 'og_image' => 'Article Fulltext Image', 350 | 'og_image_alt' => 'Article Fulltext Image alt text', 351 | 'tw_image' => 'Article Fulltext Image', 352 | 'tw_image_alt' => 'Article Fulltext Image alt text', 353 | ] 354 | ]; 355 | yield 'article view pinterest w/o pi image' => [ 356 | 'plugin' => [ 357 | 'og_image' => 'OG Image Google', 358 | 'og_image_fb' => 'OG Image Facebook', 359 | 'og_image_alt' => 'OG Image alt text', 360 | ], 361 | 'images' => [ 362 | 'image_intro' => 'Article Intro Image', 363 | 'image_intro_alt' => 'Article Intro Image alt text', 364 | 'image_fulltext' => 'Article Fulltext Image', 365 | 'image_fulltext_alt' => 'Article Fulltext Image alt text', 366 | ], 367 | 'view' => 'article', 368 | 'user_agent' => plgSystemCccsocialmedia::PINTEREST, 369 | 'expected' => [ 370 | 'og_image' => 'OG Image Facebook', 371 | 'og_image_alt' => 'OG Image alt text', 372 | 'tw_image' => 'OG Image Facebook', 373 | 'tw_image_alt' => 'OG Image alt text', 374 | ] 375 | ]; 376 | } 377 | 378 | /** 379 | * @testdox Images are retrieved with defined priority depending on useragent 380 | * @dataProvider casesImage 381 | * 382 | * @param array $pluginProperties 383 | * @param array $articleImageProperties 384 | * @param string $view 385 | * @param string $userAgent 386 | * @param array $expected 387 | * 388 | * @return void 389 | */ 390 | public function testAddImageFallback( 391 | array $pluginProperties, 392 | array $articleImageProperties, 393 | string $view, 394 | string $userAgent, 395 | array $expected 396 | ): void { 397 | $pluginParams = $this->createRegistry($pluginProperties); 398 | $articleImages = $this->createRegistry($articleImageProperties); 399 | $plugin = $this->createPlugin(); 400 | 401 | private_access($plugin)->addImageFallback($pluginParams, $articleImages, $view, $userAgent); 402 | 403 | $this->assertEquals( 404 | $expected['og_image'], 405 | $pluginParams->get('og_image'), 406 | 'og_image is not set correctly' 407 | ); 408 | 409 | $this->assertEquals( 410 | $expected['og_image_alt'], 411 | $pluginParams->get('og_image_alt'), 412 | 'og_image_alt is not set correctly' 413 | ); 414 | 415 | $this->assertEquals( 416 | $expected['tw_image'], 417 | $pluginParams->get('tw_image'), 418 | 'tw_image is not set correctly' 419 | ); 420 | 421 | $this->assertEquals( 422 | $expected['tw_image_alt'], 423 | $pluginParams->get('tw_image_alt'), 424 | 'tw_image_alt is not set correctly' 425 | ); 426 | } 427 | 428 | /** 429 | * Test cases for the setOpenGraphImage method 430 | * 431 | * @return \Generator 432 | */ 433 | public function casesOGImage(): Generator 434 | { 435 | yield 'nothing' => [ 436 | 'document' => [], 437 | 'image' => null, 438 | 'alt' => null, 439 | 'base_url' => null, 440 | 'expected' => [], 441 | ]; 442 | yield 'image with non-existing image' => [ 443 | 'document' => [], 444 | 'image' => 'image?query=string', 445 | 'alt' => null, 446 | 'base_url' => null, 447 | 'expected' => [], 448 | ]; 449 | yield 'image with leftover query string' => [ 450 | 'document' => [], 451 | 'image' => 'tests/fixtures/powered_by.png?query=string', 452 | 'alt' => null, 453 | 'base_url' => null, 454 | 'expected' => [ 455 | 'property' => [ 456 | 'og:image' => 'tests/fixtures/powered_by.png', 457 | 'og:image:secure_url' => 'tests/fixtures/powered_by.png', 458 | 'og:image:alt' => null, 459 | 'og:image:type' => 'image/png', 460 | ], 461 | 'name' => [ 462 | 'og:image:width' => '294', 463 | 'og:image:height' => '44', 464 | 'twitter:image' => 'tests/fixtures/powered_by.png', 465 | ], 466 | ], 467 | ]; 468 | yield 'no image in document' => [ 469 | 'document' => [], 470 | 'image' => 'tests/fixtures/powered_by.png', 471 | 'alt' => 'Powered by Joomla!', 472 | 'base_url' => null, 473 | 'expected' => [ 474 | 'property' => [ 475 | 'og:image' => 'tests/fixtures/powered_by.png', 476 | 'og:image:secure_url' => 'tests/fixtures/powered_by.png', 477 | 'og:image:alt' => 'Powered by Joomla!', 478 | 'og:image:type' => 'image/png', 479 | ], 480 | 'name' => [ 481 | 'og:image:width' => '294', 482 | 'og:image:height' => '44', 483 | 'twitter:image' => 'tests/fixtures/powered_by.png', 484 | 'twitter:image:alt' => 'Powered by Joomla!', 485 | ], 486 | ], 487 | ]; 488 | yield 'another image in document' => [ 489 | 'document' => [ 490 | '_metaTags' => [ 491 | 'property' => [ 492 | 'og:image' => 'preset-image.jpg', 493 | ], 494 | ], 495 | ], 496 | 'image' => 'tests/fixtures/powered_by.png', 497 | 'alt' => 'Powered by Joomla!', 498 | 'base_url' => null, 499 | 'expected' => [ 500 | 'property' => [ 501 | 'og:image' => 'tests/fixtures/powered_by.png', 502 | 'og:image:secure_url' => 'tests/fixtures/powered_by.png', 503 | 'og:image:alt' => 'Powered by Joomla!', 504 | 'og:image:type' => 'image/png', 505 | ], 506 | 'name' => [ 507 | 'og:image:width' => '294', 508 | 'og:image:height' => '44', 509 | 'twitter:image' => 'tests/fixtures/powered_by.png', 510 | 'twitter:image:alt' => 'Powered by Joomla!', 511 | ], 512 | ], 513 | ]; 514 | yield 'with base url' => [ 515 | 'document' => [], 516 | 'image' => 'tests/fixtures/powered_by.png', 517 | 'alt' => 'Powered by Joomla!', 518 | 'base_url' => 'https://example.com/', 519 | 'expected' => [ 520 | 'property' => [ 521 | 'og:image' => 'https://example.com/tests/fixtures/powered_by.png', 522 | 'og:image:secure_url' => 'https://example.com/tests/fixtures/powered_by.png', 523 | 'og:image:alt' => 'Powered by Joomla!', 524 | 'og:image:type' => 'image/png', 525 | ], 526 | 'name' => [ 527 | 'og:image:width' => '294', 528 | 'og:image:height' => '44', 529 | 'twitter:image' => 'https://example.com/tests/fixtures/powered_by.png', 530 | 'twitter:image:alt' => 'Powered by Joomla!', 531 | ], 532 | ], 533 | ]; 534 | yield 'with base url without slash' => [ 535 | 'document' => [], 536 | 'image' => 'tests/fixtures/powered_by.png', 537 | 'alt' => 'Powered by Joomla!', 538 | 'base_url' => 'https://example.com', 539 | 'expected' => [ 540 | 'property' => [ 541 | 'og:image' => 'https://example.com/tests/fixtures/powered_by.png', 542 | 'og:image:secure_url' => 'https://example.com/tests/fixtures/powered_by.png', 543 | 'og:image:alt' => 'Powered by Joomla!', 544 | 'og:image:type' => 'image/png', 545 | ], 546 | 'name' => [ 547 | 'og:image:width' => '294', 548 | 'og:image:height' => '44', 549 | 'twitter:image' => 'https://example.com/tests/fixtures/powered_by.png', 550 | 'twitter:image:alt' => 'Powered by Joomla!', 551 | ], 552 | ], 553 | ]; 554 | } 555 | 556 | /** 557 | * @testdox The required meta tags are set in the document 558 | * @dataProvider casesOGImage 559 | * 560 | * @param array $documentProperties 561 | * @param string|null $image 562 | * @param string|null $alt 563 | * @param string|null $baseUrl 564 | * @param array $expected 565 | * 566 | * @return void 567 | */ 568 | public function testSetOpenGraphImage( 569 | array $documentProperties, 570 | ?string $image, 571 | ?string $alt, 572 | ?string $baseUrl, 573 | array $expected 574 | ): void { 575 | $document = $this->createDocument($documentProperties); 576 | $plugin = $this->createPlugin(); 577 | 578 | private_access($plugin)->setOpenGraphImage( 579 | $document, 580 | $image, 581 | $alt, 582 | $baseUrl 583 | ); 584 | 585 | $this->assertEquals( 586 | $expected, 587 | $document->_metaTags 588 | ); 589 | } 590 | 591 | /** 592 | * Create a test document 593 | * 594 | * @param array $properties Optional properties of the document 595 | * 596 | * @return \Joomla\CMS\Document\Document 597 | */ 598 | private function createDocument(array $properties = []): Document 599 | { 600 | $document = new Document(); 601 | 602 | $document->title = 'Document Title'; 603 | $document->description = 'Document Description'; 604 | 605 | foreach ($properties as $key => $value) 606 | { 607 | $document->$key = $value; 608 | } 609 | 610 | return $document; 611 | } 612 | 613 | /** 614 | * Create a test registry 615 | * 616 | * @param array $properties Optional properties of the registry 617 | * 618 | * @return \Joomla\Registry\Registry 619 | */ 620 | private function createRegistry(array $properties = []): Registry 621 | { 622 | return new Registry($properties); 623 | } 624 | 625 | /** 626 | * Create a test plugin 627 | * 628 | * @param array $pluginParams 629 | * 630 | * @return \plgSystemCccsocialmedia 631 | */ 632 | private function createPlugin(array $pluginParams = [], object $app = null): plgSystemCccsocialmedia 633 | { 634 | $dispatcher = $this->createMock(Dispatcher::class); 635 | 636 | $plugin = new plgSystemCccsocialmedia( 637 | $dispatcher, 638 | [ 639 | 'params' => $pluginParams 640 | ] 641 | ); 642 | 643 | private_access($plugin)->app = $app; 644 | 645 | return $plugin; 646 | } 647 | } 648 | -------------------------------------------------------------------------------- /tests/bootstrap.php: -------------------------------------------------------------------------------- 1 | invokeMethod($user, 'encryptPassword', ['abcde']); 18 | * 19 | * // Use a wrapper class: 20 | * private_access($user)->encryprPassword('abcde'); 21 | */ 22 | function private_access(object $object) 23 | { 24 | return new PrivateAccess($object); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /tests/fixtures/powered_by.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/coolcat-creations/plg_cccsocialmedia/1dc0dc9803a0cafca00d0daa987b36114cb2705e/tests/fixtures/powered_by.png -------------------------------------------------------------------------------- /tests/stubs/Application.php: -------------------------------------------------------------------------------- 1 | client = (object)[ 10 | 'userAgent' => '', 11 | ]; 12 | } 13 | 14 | public function set($key, $value): void 15 | { 16 | } 17 | 18 | public function setUserAgent($userAgent): void 19 | { 20 | $this->client->userAgent = $userAgent; 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /tests/stubs/CMSPlugin.php: -------------------------------------------------------------------------------- 1 | params = $config['params']; 50 | } 51 | else 52 | { 53 | $this->params = new Registry($config['params']); 54 | } 55 | } 56 | 57 | // Get the plugin name. 58 | if (isset($config['name'])) 59 | { 60 | $this->_name = $config['name']; 61 | } 62 | 63 | // Get the plugin type. 64 | if (isset($config['type'])) 65 | { 66 | $this->_type = $config['type']; 67 | } 68 | } 69 | } 70 | -------------------------------------------------------------------------------- /tests/stubs/Document.php: -------------------------------------------------------------------------------- 1 | _metaTags[$attribute][$name] = $content; 64 | 65 | return $this; 66 | } 67 | 68 | /** 69 | * Gets a meta tag. 70 | * 71 | * @param string $name Name of the meta HTML tag 72 | * @param string $attribute Attribute to use in the meta HTML tag 73 | * 74 | * @return string 75 | */ 76 | public function getMetaData($name, $attribute = 'name') 77 | { 78 | // B/C old http_equiv parameter. 79 | if (!\is_string($attribute)) 80 | { 81 | $attribute = $attribute == true ? 'http-equiv' : 'name'; 82 | } 83 | 84 | return isset($this->_metaTags[$attribute]) && isset($this->_metaTags[$attribute][$name]) ? $this->_metaTags[$attribute][$name] : ''; 85 | } 86 | 87 | /** 88 | * Sets the description of the document 89 | * 90 | * @param string $description The description to set 91 | * 92 | * @return Document instance of $this to allow chaining 93 | */ 94 | public function setDescription($description) 95 | { 96 | $this->description = $description; 97 | 98 | return $this; 99 | } 100 | } 101 | --------------------------------------------------------------------------------