PHPackages                             elistone/social-share-preview - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. elistone/social-share-preview

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

elistone/social-share-preview
=============================

Generate social share previews

v1.0.0(4y ago)05MITPHPPHP &gt;=7.4

Since Sep 13Pushed 4y ago1 watchersCompare

[ Source](https://github.com/elistone/social-share-preview)[ Packagist](https://packagist.org/packages/elistone/social-share-preview)[ RSS](/packages/elistone-social-share-preview/feed)WikiDiscussions main Synced 3w ago

READMEChangelog (1)DependenciesVersions (3)Used By (0)

Social Share Preview
====================

[](#social-share-preview)

The social share preview is a library designed to pass in certain content such as title, description, image url &amp; a web url then request a preview will be generated based upon certain social media sites.

Install
-------

[](#install)

### Composer *Recommend*

[](#composer-recommend)

```
composer require elistone/social-share-preview

```

### Manually

[](#manually)

Download this package manually and add it to your projected

Usage
-----

[](#usage)

```
// init preview library.
$preview = new Preview();

// set the common content.
$preview->setTitle("This is my example title");
$preview->setDescription("This is my example description");
$preview->setImageUrl("https://source.unsplash.com/random");
$preview->setUrl("https://example.com");

// set the type of preview.
$preview->setType("facebook"); // Facebook, LinkedIn or Twitter.

// generate and display the preview.
echo $preview->generate();
```

Styling
-------

[](#styling)

This library contains some basic styling for the generated output this can be found at `css/social-share-preview.css`.

Example
-------

[](#example)

There is an example file found in this project which can be launched with php serve.

```
php -S localhost:8001

```

Then visiting  will load the example.

###  Health Score

23

—

LowBetter than 26% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity4

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity52

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~0 days

Total

2

Last Release

1753d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/c3f477b9c66c08201958c59096372eac739899e814e39407a04485fbc6b239ea?d=identicon)[elistone](/maintainers/elistone)

---

Top Contributors

[![elistone](https://avatars.githubusercontent.com/u/2546188?v=4)](https://github.com/elistone "elistone (4 commits)")

### Embed Badge

![Health badge](/badges/elistone-social-share-preview/health.svg)

```
[![Health](https://phpackages.com/badges/elistone-social-share-preview/health.svg)](https://phpackages.com/packages/elistone-social-share-preview)
```

###  Alternatives

[codaxis/cakephp-bootstrap3-helpers

CakePHP highly configurable helpers for Bootstrap 3 framework.

4111.8k2](/packages/codaxis-cakephp-bootstrap3-helpers)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
