Automatic Hyperlinks

Author: DAEXTPrice: $9

Automatic Links - 1

Automatic Hyperlinks is a PHP class that enables you to automatically practice hyperlinks on a HTML document.

This class is already in use in varied products from our portfolio. In particular, it’s adopted to practice the computerized hyperlinks in WordPress plugins with thousands of customers, esteem Interlinks Supervisor.

This class makes use of PHP customary expressions to generate the hyperlinks from a list of key phrases and URLs supplied by the user.

It’s rate noting that this class offers you entire administration over the algorithm typical to practice the hyperlinks. Namely, you may possibly well configure a excessive different of alternatives each on the class stage and on the computerized link stage to:

  • Limit the utmost different of computerized hyperlinks to a command number
  • Decide between a case gathered or a case insensitive search of the important thing phrase
  • Add the Nofollow attribute on the link component
  • Diagram a custom title attribute on the link component
  • Inaugurate the hyperlinks within the same tab or a unique tab
  • Get dangle of handiest the occurrences of the important thing phrase preceded or adopted by a command string
  • Configure particular note boundaries in accordance with the actual context or language
  • Prioritize individual key phrases over the others

We have also included varied stepped forward parts for the most traumatic customers. For example, you may possibly well:

  • Prevent the utility of the computerized link on particular HTML substances
  • Give a acquire to the distribution of the computerized hyperlinks with the “Random Prioritization” characteristic
  • Prevent the utility of the computerized hyperlinks that be privy to the unique URL
  • Limit the utmost different of computerized hyperlinks in accordance with the length of the supplied string
  • Limit the utmost different of computerized hyperlinks that be privy to the same URL

How one can use the class

Basically the most efficient usage example of this computerized hyperlinks class:

require_once( 'inc/class-daext-computerized-hyperlinks.php' );
$automatic_links = unique DaextAutomaticLinks();

echo $automatic_links->add_autolinks( '

Decide my book.

', [ [ 'keyword' => "book", 'url' => "https://example.com/" ] ] );

The above example will output:

Decide my book.

This varied script makes use of stepped forward alternatives to:

  • Inaugurate the generate hyperlinks on a unique tab
  • Limit the different of computerized hyperlinks to two
  • Give protection to particular tags
require_once( 'inc/class-daext-computerized-hyperlinks.php' );
$automatic_links = unique DaextAutomaticLinks();

$automatic_links->set_options(
    [
        'open_new_tab'         => true,
        'general_limit_amount' => 2,
        'protected_tags'       => [
            'h1',
            'h2',
            'h3',
            'h4',
            'h5',
            'h6',
            'strong',
            'pre',
            'code'
        ]
    ]
);

$article = '

iPhone 14 fluctuate

'; $article .= '

The iPhone 14 is an evident steal on our list.

'; echo $automatic_links->add_autolinks( $article, [ [ 'keyword' => "iPhone 14", 'url' => "https://example.com/iphone-14/" ] ] );

The above example will output:

iPhone 14 fluctuate

The iPhone 14 is an evident steal on our list.

Demonstrate that extra examples come in within the class demo and the plugin handbook.

Updates

15.03.2022 - v1.05
  - Improved documentation
14.03.2022 - v1.03
  - First free up

Compose you care about your websites’s websites positioning?

Give a acquire to your interior hyperlinks structure and procure extra visits for your WordPress websites with the Interlinks Supervisor plugin.

Interlinks Manager plugin for WordPress

Leave a Comment