2017 © Pedro Peláez
 

silverstripe-vendormodule externallinks

Adds tracking of broken external links to the SilverStripe CMS

image

silverstripe/externallinks

Adds tracking of broken external links to the SilverStripe CMS

  • Monday, June 18, 2018
  • by tractorcow
  • Repository
  • 10 Watchers
  • 9 Stars
  • 34,371 Installations
  • PHP
  • 3 Dependents
  • 0 Suggesters
  • 13 Forks
  • 9 Open issues
  • 22 Versions
  • 11 % Grown

The README.md

External links

Build Status Scrutinizer Code Quality codecov SilverStripe supported module, (*1)

Introduction

The external links module is a task and ModelAdmin to track and to report on broken external links., (*2)

Maintainer Contact

Requirements

  • SilverStripe ^4.0

Note: For a SilverStripe 3.x compatible version, please use the 1.x release line., (*3)

Features

  • Add external links to broken links reports
  • Add a task to track external broken links

Installation

  1. Require the module via composer: composer require silverstripe/externallinks
  2. Run /dev/build in your browser to rebuild the database.
  3. Run the following task http://path.to.silverstripe/dev/tasks/CheckExternalLinks to check for broken external links

Report

A new report is added called 'External Broken links report'. When viewing this report, a user may press the "Create new report" button which will trigger an ajax request to initiate a report run., (*4)

In this initial ajax request this module will do one of two things, depending on which modules are included:, (*5)

  • If the queuedjobs module is installed, a new queued job will be initiated. The queuedjobs module will then manage the progress of the task.
  • If the queuedjobs module is absent, then the controller will fallback to running a buildtask in the background. This is less robust, as a failure or error during this process will abort the run.

In either case, the background task will loop over every page in the system, inspecting all external urls and checking the status code returned by requesting each one. If a URL returns a response code that is considered "broken" (defined as < 200 or > 302) then the ss-broken css class will be assigned to that url, and a line item will be added to the report. If a previously broken link has been corrected or fixed, then this class is removed., (*6)

In the actual report generated the user can click on any broken link item to either view the link in their browser, or edit the containing page in the CMS., (*7)

While a report is running the current status of this report will be displayed on the report details page, along with the status. The user may leave this page and return to it later to view the ongoing status of this report., (*8)

Any subsequent report may not be generated until a prior report has completed., (*9)

Dev task

Run the following task http://path.to.silverstripe/dev/tasks/CheckExternalLinksTask to check your site for external broken links., (*10)

Queued job

If you have the queuedjobs module installed you can set the task to be run every so often., (*11)

Whitelisting codes

If you want to ignore or whitelist certain HTTP codes this can be setup via ignore_codes in the config.yml file in mysite/_config:, (*12)

SilverStripe\ExternalLinks\Tasks\CheckExternalLinksTask:
  ignore_codes:
    - 401
    - 403
    - 501

Upgrading from 1.x to 2.x

When upgrading from 1.x to 2.x (SilverStripe 3.x to 4.x) you will need to be aware of the following API changes:, (*13)

  • Configuration property CheckExternalLinksTask.IgnoreCodes renamed to CheckExternalLinksTask.ignore_codes
  • Configuration property CheckExternalLinksTask.FollowLocation and BypassCache renamed to follow_location and bypass_cache

Follow 301 redirects

You may want to follow a redirected URL a example of this would be redirecting from http to https can give you a false poitive as the http code of 301 will be returned which will be classed as a working link., (*14)

To allow redirects to be followed setup the following config in your config.yml, (*15)

# Follow 301 redirects
SilverStripe\ExternalLinks\Tasks\CurlLinkChecker:
  follow_location: 1

Bypass cache

By default the task will attempt to cache any results the cache can be bypassed with the following config in config.yml., (*16)

# Bypass SS_Cache
SilverStripe\ExternalLinks\Tasks\CurlLinkChecker::
  bypass_cache: 1

The Versions

18/06 2018

dev-master

9999999-dev

Adds tracking of broken external links to the SilverStripe CMS

  Sources   Download

BSD-3-Clause

The Requires

 

The Development Requires

by Kirk Mayo

silverstripe links broken href

06/04 2018

2.0.x-dev

2.0.9999999.9999999-dev

Adds tracking of broken external links to the SilverStripe CMS

  Sources   Download

BSD-3-Clause

The Requires

 

The Development Requires

by Kirk Mayo

silverstripe links broken href

06/04 2018

2.0.2

2.0.2.0

Adds tracking of broken external links to the SilverStripe CMS

  Sources   Download

BSD-3-Clause

The Requires

 

The Development Requires

by Kirk Mayo

silverstripe links broken href

06/04 2018

2.0.1

2.0.1.0

Adds tracking of broken external links to the SilverStripe CMS

  Sources   Download

BSD-3-Clause

The Requires

 

The Development Requires

by Kirk Mayo

silverstripe links broken href

26/03 2018

dev-raissanorth-patch-1

dev-raissanorth-patch-1

Adds tracking of broken external links to the SilverStripe CMS

  Sources   Download

BSD-3-Clause

The Requires

 

The Development Requires

by Kirk Mayo

silverstripe links broken href

22/02 2018

2.0.0

2.0.0.0

Adds tracking of broken external links to the SilverStripe CMS

  Sources   Download

BSD-3-Clause

The Requires

 

The Development Requires

by Kirk Mayo

silverstripe links broken href

21/02 2018

1.x-dev

1.9999999.9999999.9999999-dev

Adds tracking of external broken links to the SilverStripe CMS

  Sources   Download

BSD-3-Clause

The Requires

 

The Development Requires

by Kirk Mayo

silverstripe links broken href

21/02 2018

1.1.x-dev

1.1.9999999.9999999-dev

Adds tracking of external broken links to the SilverStripe CMS

  Sources   Download

BSD-3-Clause

The Requires

 

The Development Requires

by Kirk Mayo

silverstripe links broken href

21/02 2018

1.1.0

1.1.0.0

Adds tracking of external broken links to the SilverStripe CMS

  Sources   Download

BSD-3-Clause

The Requires

 

The Development Requires

by Kirk Mayo

silverstripe links broken href

29/11 2017

2.0.0-beta1

2.0.0.0-beta1

Adds tracking of broken external links to the SilverStripe CMS

  Sources   Download

BSD-3-Clause

The Requires

 

The Development Requires

by Kirk Mayo

silverstripe links broken href

27/11 2017

1.0.x-dev

1.0.9999999.9999999-dev

Adds tracking of external broken links to the SilverStripe CMS

  Sources   Download

BSD-3-Clause

The Requires

 

The Development Requires

by Kirk Mayo

silverstripe links broken href

25/08 2017

1.0.10

1.0.10.0

Adds tracking of external broken links to the SilverStripe CMS

  Sources   Download

BSD-3-Clause

The Requires

 

The Development Requires

by Kirk Mayo

silverstripe links broken href

25/08 2017

1.0.9

1.0.9.0

Adds tracking of external broken links to the SilverStripe CMS

  Sources   Download

BSD-3-Clause

The Requires

 

The Development Requires

by Kirk Mayo

silverstripe links broken href

17/11 2016

1.0.7

1.0.7.0

Adds tracking of external broken links to the SilverStripe CMS

  Sources   Download

BSD-3-Clause

The Requires

 

The Development Requires

by Kirk Mayo

silverstripe links broken href

17/11 2016

1.0.8

1.0.8.0

Adds tracking of external broken links to the SilverStripe CMS

  Sources   Download

BSD-3-Clause

The Requires

 

The Development Requires

by Kirk Mayo

silverstripe links broken href

17/08 2016

1.0.6

1.0.6.0

Adds tracking of external broken links to the SilverStripe CMS

  Sources   Download

BSD-3-Clause

The Requires

 

The Development Requires

by Kirk Mayo

silverstripe links broken href

18/05 2016

1.0.5

1.0.5.0

Adds tracking of external broken links to the SilverStripe CMS

  Sources   Download

BSD-3-Clause

The Requires

 

The Development Requires

by Kirk Mayo

silverstripe links broken href

04/02 2016

1.0.4

1.0.4.0

Adds tracking of external broken links to the SilverStripe CMS

  Sources   Download

BSD-3-Clause

The Requires

 

The Development Requires

by Kirk Mayo

silverstripe links broken href

19/11 2015

1.0.3

1.0.3.0

Adds tracking of external broken links to the SilverStripe CMS

  Sources   Download

BSD-3-Clause

The Requires

 

The Development Requires

by Kirk Mayo

silverstripe links broken href

27/05 2015

1.0.2

1.0.2.0

Adds tracking of external broken links to the SilverStripe CMS

  Sources   Download

BSD-3-Clause

The Requires

 

The Development Requires

by Kirk Mayo

silverstripe links broken href

18/11 2014

1.0.1

1.0.1.0

Adds tracking of external broken links to the SilverStripe CMS

  Sources   Download

BSD-3-Clause

The Requires

 

The Development Requires

by Kirk Mayo

silverstripe links broken href

13/08 2014

1.0.0

1.0.0.0

Adds tracking of external broken links to the SilverStripe CMS

  Sources   Download

BSD-3-Clause

The Requires

 

The Development Requires

by Kirk Mayo

silverstripe links broken href