Download the PHP package mikestecker/craft-readability without Composer

On this page you can find all versions of the php package mikestecker/craft-readability. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package craft-readability

Readability plugin for Craft CMS 3.x

The Readability plugin will help you to identify issues with your website content, especially with readability.

It allows you to measure the readability of text using common scoring systems, including:

You can learn more about these here.

This plugin is based off the Text Statistics library.

Requirements

This plugin requires Craft 3.0.0 or later.

Installation

To install the plugin, follow these instructions.

  1. Open your terminal and go to your Craft project:

    cd /path/to/project
  2. Then tell Composer to load the plugin:

    composer require mikestecker/craft-readability
  3. In the Control Panel, go to Settings → Plugins and click the “Install” button for Readability.

Readability Overview

This plugin was born out of me wanting a simple read time on text. When I discovered the Text Statistics library, I decided to wrap most everything in here.

Configuring Readability

There is nothing to configure.

Using Readability

Measuring Readability

Flesch Kincaid Reading Ease

This is one of the oldest readability scores, commonly used in academics and government and incorporated into most word processing software. The Flesch-Kincaid Reading Ease score is the result of a mathematical formula that incorporates the average number of syllables per word and the average number of words per sentence for a 100-word block of text. Results are measured on a scale of 1-100.

Flesch-Kincaid Reading Ease: {{ someContent | readingEase }}

Flesch-Kincaid Grade Level

Like the Flesch-Kincaid Reading Ease score, this is a mathematical formula that measures syllables and sentence length. However, the results are given as an academic grade level, from 0-12. Negative results are rated at 0, and any grade level over 12 is listed as 12. The Flesch-Kincaid Grade Level score was developed after the Reading Ease score to make it easier for parents, librarians and others to make decisions about reading content for children.

Flesch-Kincaid Grade Level: {{ someContent | schoolLevel }}

Gunning Fog Index

The Gunning Fog Index takes into account “complex” words, those with three or more syllables, as part of its mathematical formula for readability. It also omits proper nouns, jargon and compound words. The result? A grade-level score from 1-unlimited.

Gunning Fog Index: {{ someContent | gunningFogScore }}

Coleman Liau Index

Unlike most other readability tests, the Coleman Liau Index relies on number of characters instead of syllables per word for its calculation. It returns a U.S. grade-level score from 1-12.

Coleman Liau Index: {{ someContent | colemanLiauIndex }}

SMOG Index

It’s debatable whether SMOG is short for “Simple Measure of Gobbledygook,” but this index developed in 1969 is still a common measure of readability. Take 30 sentences (10 from the beginning, middle and end of your text), then count every word with three or more syllables in each group of sentences, then calculate the square root of that number and round it to the nearest 10, then add 3 to that number. Voila! You have the U.S. grade level that should be able to read that text. (And that’s one of the simpler of these readability formulas.)

SMOG Index: {{ someContent | smogIndex }}

Automated Readability Index

The Automated Readability Index (ARI) mathematical formula has two variables: characters per word (instead of syllables, similar to the Coleman Liau Index) and words per sentence. It has been around since 1967. Its scores correspond to U.S. grade levels. If you get a score result with a decimal, round up to the next whole number.

Automated Readability Index: {{ someContent | automatedReadabilityIndex }}

Dale-Chall Readability Score

The Dale-Chall formula is a vocabulary-based readability formula, matching its own list of words to the words in the material being evaluated, to determine the appropriate grade level. In addition, the Dale-Chall formula factors in the total number of words and sentences, arriving at an average sentence length.

Dale-Chall Readability Score: {{ someContent | daleChallReadabilityScore }}

Spache Readability Score

The formula calculates the grade level of a text sample based on sentence length and number of unfamiliar words. The Spache Formula considers “unfamiliar words” as words that 3rd grade and below do not recognize. The Spache Formula is best used to calculate the difficulty of text that falls at the 3rd grade level or below.

Spache Readability Score: {{ someContent | spacheReadabilityScore }}

Measuring How Long It Should Take To Read

Measuring how long it takes to read is based off the Flesch-Kincaid Reading Ease. According to this Wikipedia article, rates of reading include reading for memorization (fewer than 100 words per minute [wpm]); reading for learning (100–200 wpm); reading for comprehension (200–400 wpm); and skimming (400–700 wpm). Reading for comprehension is the essence of the daily reading of most people. Skimming is for superficially processing large quantities of text at a low level of comprehension (below 50%).

The estimated words per minute using the humanReadingTime filter takes the Flesch-Kincaid Reading Ease score and uses this to determine how easy the content is to read. If it's deemed more difficult to read, the calculated WPM is lowered and likewise, if the content is easy to read, then the WPM is increased.

How long will it take to read? {{ someContent | humanReadingTime }}

Output: 1 minute, 26 seconds

If you prefer to see this in the number of seconds only, use the filter readingTime

If you just want a simple average reading time, I made a new function to do simple math based off an average of 250 words per minute.

How long will it take to read? {{ someContent | humanAverageReadingTime }}

Output: 2 minutes, 17 seconds

If you prefer to see this in the number of seconds only, use the filter averageReadingTime

More Text Shenanigans!

Count Syllables

{{ someContent | syllableCount }}

Character, Letter, Sentence, Word Counts

{{ someContent | characterCount }}

{{ someContent | letterCount }}

{{ someContent | wordCount }}

{{ someContent | sentenceCount }}

Bonus tip!

Thanks to Andrew Welch (@nystudio107) for pointing out that with any of these twig filters, you can wrap multiple output fields Twig's special filter section:

Readability Roadmap

Some things to do, and ideas for potential features:

Pull requests are welcome to add new features!

Brought to you by Mike Stecker


All versions of craft-readability with dependencies

PHP Build Version
Package Version
Requires craftcms/cms Version ^3.0.0
davechild/textstatistics Version ^1.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package mikestecker/craft-readability contains the following files

Loading the files please wait ....