PHPackages                             yapro/seo-bundle - 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. yapro/seo-bundle

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

yapro/seo-bundle
================

v1.0.2(3y ago)04PHPPHP &gt;=7.4.0CI passing

Since Jul 17Pushed 8mo ago1 watchersCompare

[ Source](https://github.com/yapro/seo-bundle)[ Packagist](https://packagist.org/packages/yapro/seo-bundle)[ RSS](/packages/yapro-seo-bundle/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (3)Dependencies (1)Versions (3)Used By (0)

SEO bundle
==========

[](#seo-bundle)

SEO useful functionality

[![lib tests](https://github.com/yapro/seo-bundle/actions/workflows/main.yml/badge.svg)](https://github.com/yapro/seo-bundle/actions/workflows/main.yml/badge.svg)

Installation
------------

[](#installation)

Add as a requirement in your `composer.json` file or run for prod:

```
composer require yapro/seo-bundle
```

As dev:

```
composer require yapro/seo-bundle dev-main
```

How to configure bundle
-----------------------

[](#how-to-configure-bundle)

Add to config/services.yaml

```
parameters:
  yapro.seo_bundle.redirect_page: '/redirect/page'
  yapro.seo_bundle.security_key: 'securityKey'
  yapro.seo_bundle.current_http_host: 'site.com'
  yapro.seo_bundle.protocols: ['https', 'http', 'ftp']
```

How to use bundle
-----------------

[](#how-to-use-bundle)

Replace external links with safe seo links:

```
class MyController extends AbstractController
{
    /**
     * @Route("/article/{id}", methods={"GET"})
     */
    public function article(
        Article $article
        ContentManager $contentManager
    ): Response {
        $textWithSeoLinks = $contentManager->getSafeHtmlWithSeoLinks($article->getText());
        return new Response($textWithSeoLinks);
    }
}
```

Write a redirect for safe seo link to an external link:

```
/**
 * @Route("/redirect/page", methods={"GET"})
 */
public function seoRedirect(Request $request, LinkManager $linkManager): Response
{
    $redirect = $linkManager->getRedirect($request->getRequestUri());
    if ($redirect->getHttpStatus() === 200) {
        return new Response('', 404);
    }
    throw $this->createNotFoundException('Redirect page not found');
}
```

Add to robots.txt

```
User-agent: *
Disallow: /redirect/page

```

Extra
-----

[](#extra)

You can automatically mark all pages with any get variables with header "X-Robots-Tag: noindex" by adding to config/services.yaml:

```
YaPro\SeoBundle\NoindexResponseListener:
    tags:
        - { name: kernel.event_listener, event: kernel.response }
```

You can automatically redirect URL has uppercase symbols ("get variables" are checked too) to the lowercase URL by adding to config/services.yaml:

```
YaPro\SeoBundle\CaseSensitiveRequestListener:
    tags:
        - { name: kernel.event_listener, event: kernel.request }
```

You can automatically register the information about site pages without LastModified header:

```
YaPro\SeoBundle\LastModifiedResponseListener:
    arguments:
        - "@monolog.logger"
        - ["/admin", "/login", "/etc"]
    tags:
        - { name: kernel.event_listener, event: kernel.response }
```

Development
-----------

[](#development)

Build:

```
docker build -t yapro/seo-bundle:latest -f ./Dockerfile ./
```

Tests:

```
wget https://phar.phpunit.de/phpunit-9.5.16.phar -O phpunit.phar && chmod +x ./phpunit.phar
docker run --user=1000:1000 --rm -v $(pwd):/app -w /app yapro/seo-bundle:latest bash -c "
  composer install --optimize-autoloader --no-scripts --no-interaction &&
  ./phpunit.phar tests"
```

Installation dev`s requirements:

```
docker run --user=1000:1000 --add-host=host.docker.internal:host-gateway -it --rm -v $(pwd):/app -w /app yapro/seo-bundle:latest bash
composer install -o
```

Debug PHP:

```
PHP_IDE_CONFIG="serverName=common" \
XDEBUG_SESSION=common \
XDEBUG_MODE=debug \
XDEBUG_CONFIG="max_nesting_level=200 client_port=9003 client_host=host.docker.internal" \
./phpunit.phar --cache-result-file=/tmp/phpunit.cache -v --stderr --stop-on-incomplete --stop-on-defect \
--stop-on-failure --stop-on-warning --fail-on-warning --stop-on-risky --fail-on-risky tests
```

Cs-Fixer:

```
wget https://github.com/FriendsOfPHP/PHP-CS-Fixer/releases/download/v3.8.0/php-cs-fixer.phar && chmod +x ./php-cs-fixer.phar
docker run --user=1000:1000 --rm -v $(pwd):/app -w /app yapro/seo-bundle:latest ./php-cs-fixer.phar fix --config=.php-cs-fixer.dist.php -v --using-cache=no --allow-risky=yes
```

Update phpmd rules:

```
wget https://github.com/phpmd/phpmd/releases/download/2.12.0/phpmd.phar && chmod +x ./phpmd.phar
docker run --user=1000:1000 --rm -v $(pwd):/app -w /app yapro/seo-bundle:latest ./phpmd.phar . text phpmd.xml --exclude .github/workflows,vendor --strict --generate-baseline
```

###  Health Score

27

—

LowBetter than 49% of packages

Maintenance42

Moderate activity, may be stable

Popularity3

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity48

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 ~21 days

Total

2

Last Release

1377d ago

PHP version history (2 changes)1.0PHP 7.4.\*

v1.0.2PHP &gt;=7.4.0

### Community

Maintainers

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

---

Top Contributors

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

### Embed Badge

![Health badge](/badges/yapro-seo-bundle/health.svg)

```
[![Health](https://phpackages.com/badges/yapro-seo-bundle/health.svg)](https://phpackages.com/packages/yapro-seo-bundle)
```

PHPackages © 2026

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