plausible / wordpress

Plausible Analytics WordPress plugin
https://plausible.io/wordpress-analytics-plugin
MIT License
50 stars 26 forks source link
analytics plausible-analytics privacy wordpress wordpress-plugin

Gitpod ready-to-code

Plausible Analytics

Github CI WordPress version WordPress Rating WordPress Downloads

Welcome to the Plausible Analytics WordPress Plugin GitHub repository. This is the code source and the center of active development. Here you can browse the source, look at open issues, and contribute to the project.

Getting Started

If you're looking to contribute or actively develop on Plausible Analytics then skip ahead to the Local Development section below. The following is if you're looking to actively use the plugin on your WordPress site.

Minimum Requirements

Automatic installation

Automatic installation is the easiest option as WordPress handles the file transfers itself, and you don't need to leave your web browser. To do an automatic installation of Plausible Analytics, log in to your WordPress dashboard, navigate to the Plugins menu and click "Add New".

In the search field type "Plausible Analytics" and click Search Plugins. Once you have found the plugin you can view details about it such as the point release, rating and description. Most importantly of course, you can install it by simply clicking "Install Now".

Manual installation

The manual installation method involves downloading our plugin and uploading it to your server via your favorite FTP application. The WordPress codex contains instructions on how to do this.

Support

This repository is not suitable for support. Please don't use GitHub issues for support requests. To get support please use the following channels:

Available Actions, Filters and Toggles

Filters

Actions

Toggles

Using constants, you can modify the behavior of the plugin. wp-config.php is the best place to define constants. If you're using a custom plugin, make sure its code is loaded before this plugin.

Local Development

To get started developing on the Plausible Analytics WordPress Plugin you will need to perform the following steps:

  1. Create a new WordPress site with plausible.test as the URL
  2. cd into your local plugins directory: /path/to/wp-content/plugins/
  3. Clone this repository from GitHub into your plugins directory: https://github.com/plausible/wordpress.git
  4. Run composer to set up dependencies: composer install
  5. Run npm install to get the necessary npm packages: npm install
  6. Activate the plugin in WordPress

That's it. You're now ready to start development.

NPM Commands

Plausible Analytics relies on several npm commands to get you started:

Development Notes

Regenerating the OpenAPI PHP Client

This plugin uses a OpenAPI PHP Client which is autogenerated by the OpenAPI generator to reduce contract violations, etc. to a minimum. But, since this is a WordPress plugin, some manual modifications need to be done to make sure it doesn't conflict with other plugins: