Download the PHP package justinholtweb/craft-lightning without Composer

On this page you can find all versions of the php package justinholtweb/craft-lightning. 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-lightning

Lightning

Google PageSpeed Insights for Craft CMS 5. Get performance scores, Core Web Vitals, and optimization suggestions right inside the control panel.

Features

Requirements

Installation

Add the repository and require the package with Composer:

Then install the plugin:

Or install from the control panel under Settings > Plugins.

Setup

  1. Get a free API key from the Google Cloud Console
  2. Enable the PageSpeed Insights API in your Google Cloud project
  3. In the Craft control panel, go to Settings > Lightning
  4. Enter your API key (or use an environment variable like $GOOGLE_PSI_API_KEY)
  5. Choose a default strategy (Mobile, Desktop, or Both)

Using an environment variable

Add to your .env file:

Then enter $GOOGLE_PSI_API_KEY in the plugin settings.

Usage

Dashboard Widget

  1. Go to the Dashboard
  2. Click New Widget > PageSpeed Insights
  3. Enter the URL to audit and choose a strategy
  4. Click Run Audit to see results

Add multiple widgets to monitor different pages.

Entry Sidebar

The sidebar panel appears automatically on any entry that has a public URL. Click Run Audit to get the current performance data for that entry's page.

Scores

Scores follow Google's thresholds:

Range Rating
90–100 Good (green)
50–89 Needs Improvement (orange)
0–49 Poor (red)

API Rate Limits

With an API key, you get approximately 25,000 requests per day. Each "Both" audit uses 2 requests (one mobile, one desktop). Without a key the API will not work — a key is required in plugin settings.

License

This plugin is licensed under The Craft License.

Development

The project ships with a DDEV environment providing PHP 8.2 and MariaDB 10.11. The integration suite needs the database, so run everything through it:

Test suites

Suite Location Runner Needs a database
Unit tests/unit PHPUnit No
Integration tests/integration Codeception + Craft Yes

Unit tests cover the Craft-free response parsing in ResponseParser. Integration tests boot a real Craft installation with the plugin loaded to exercise the plugin lifecycle, settings, widget, service, and controller.

Run them individually with:

The integration suite installs Craft into the DDEV database and drops all its tables between runs, so point it at a throwaway database only. Credentials live in tests/.env, which is untracked — copy tests/.env.example to create it.

Static analysis and code style checks:


All versions of craft-lightning with dependencies

PHP Build Version
Package Version
Requires php Version ^8.2
craftcms/cms Version ^5.3.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 justinholtweb/craft-lightning contains the following files

Loading the files please wait ...