Introducing Socket Firewall: Free, Proactive Protection for Your Software Supply Chain.Learn More
Socket
Book a DemoInstallSign in
Socket

@fantassin/shadow

Package Overview
Dependencies
Maintainers
2
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@fantassin/shadow

If you want some internal linking optimization, you can obfuscate links with this library.

latest
Source
npmnpm
Version
2.1.1
Version published
Maintainers
2
Created
Source

If you want some internal linking optimization, you can obfuscate links with this library.

📦 How to install this project ?

composer require fantassin/shadow
npm install @fantassin/shadow

⚡ How it works ?

To generate obfuscate links you can use standalone Shadow class like this in your PHP file :

<?php

use Fantassin\Shadow\Shadow;

$shadow = new Shadow();
// Get encoded version of link.
$shadow->encode( 'https://www.fantassin.fr' ); // dWdnY2Y6Ly9qamouc25hZ25mZnZhLnNl

// Or you can get attributes generated automatically
echo '<span ' . $shadow->get_attributes( 'https://www.fantassin.fr' ) . '>Your anchor link</span>';

// And you will get :
// <span data-shdw="dWdnY2Y6Ly9qamouc25hZ25mZnZhLnNl">Your anchor link</span>

🎯 Advanced usage

1. Customize attributes
<?php

use Fantassin\Shadow\Shadow;

$shadow = new Shadow( 'your-attribute' );
// Get customize attributes
echo '<span ' . $shadow->get_attributes( 'https://www.fantassin.fr' ) . '>Your anchor link</span>';

// And you will get :
// <span your-attribute="dWdnY2Y6Ly9qamouc25hZ25mZnZhLnNl">Your anchor link</span>
2. Use target attribute
<?php

use Fantassin\Shadow\Shadow;

$shadow = new Shadow();
// Or you can get attributes generated automatically
echo '<span ' . $shadow->get_attributes( 'https://www.fantassin.fr', '_blank' ) . '>Your anchor link</span>';

// And you will get :
// <span data-shdw="dWdnY2Y6Ly9qamouc25hZ25mZnZhLnNl" data-shadow-target="_blank">Your anchor link</span>

$shadow = new Shadow( 'your-attribute' );
// Get customize attributes
echo '<span ' . $shadow->get_attributes( 'https://www.fantassin.fr', '_blank' ) . '>Your anchor link</span>';

// And you will get :
// <span your-attribute="dWdnY2Y6Ly9qamouc25hZ25mZnZhLnNl" your-attribute-target="_blank">Your anchor link</span>

Keywords

mixin

FAQs

Package last updated on 20 Nov 2020

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts