44
55[ ![ Github CI] ( https://github.com/plausible/wordpress/actions/workflows/push.yml/badge.svg )] ( https://github.com/plausible/wordpress/actions/workflows/push.yml ) ![ WordPress version] ( https://img.shields.io/wordpress/plugin/v/plausible-analytics.svg ) ![ WordPress Rating] ( https://img.shields.io/wordpress/plugin/r/plausible-analytics.svg ) ![ WordPress Downloads] ( https://img.shields.io/wordpress/plugin/dt/plausible-analytics.svg )
66
7- Welcome to the Plausible Analytics WordPress Plugin GitHub repository. This is the code source and the center of active development. Here you can
7+ Welcome to the Plausible Analytics WordPress Plugin GitHub repository. This is the code source and the center of active
8+ development. Here you can
89browse the source, look at open issues, and contribute to the project.
910
1011## Getting Started
1112
1213If you're looking to contribute or actively develop on Plausible Analytics then skip ahead to
13- the [ Local Development] ( https://github.com/plausible/wordpress/#local-development ) section below. The following is if you're looking to actively use
14+ the [ Local Development] ( https://github.com/plausible/wordpress/#local-development ) section below. The following is if
15+ you're looking to actively use
1416the plugin on your WordPress site.
1517
1618### Minimum Requirements
1719
18- * WordPress 5.3 or greater
20+ * WordPress 5.9 or greater
1921* PHP version 7.4 or greater
2022* MySQL version 5.5 or greater
2123
2224### Automatic installation
2325
24- 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
25- automatic installation of Plausible Analytics, log in to your WordPress dashboard, navigate to the Plugins menu and click "Add New".
26+ Automatic installation is the easiest option as WordPress handles the file transfers itself, and you don't need to leave
27+ your web browser. To do an
28+ automatic installation of Plausible Analytics, log in to your WordPress dashboard, navigate to the Plugins menu and
29+ click "Add New".
2630
27- 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
31+ In the search field type "Plausible Analytics" and click Search Plugins. Once you have found the plugin you can view
32+ details about it such as the
2833point release, rating and description. Most importantly of course, you can install it by simply clicking "Install Now".
2934
3035### Manual installation
3136
32- The manual installation method involves downloading our plugin and uploading it to your server via your favorite FTP application. The
33- WordPress codex contains [ instructions on how to do this] ( https://codex.wordpress.org/Managing_Plugins#Manual_Plugin_Installation ) .
37+ The manual installation method involves downloading our plugin and uploading it to your server via your favorite FTP
38+ application. The
39+ WordPress codex
40+ contains [ instructions on how to do this] ( https://codex.wordpress.org/Managing_Plugins#Manual_Plugin_Installation ) .
3441
3542### Support
3643
37- This repository is not suitable for support. Please don't use GitHub issues for support requests. To get support please use the following channels:
44+ This repository is not suitable for support. Please don't use GitHub issues for support requests. To get support please
45+ use the following channels:
3846
3947* [ WP.org Support Forums] ( https://wordpress.org/support/plugin/plausible-analytics ) - for all users
4048
@@ -45,25 +53,33 @@ This repository is not suitable for support. Please don't use GitHub issues for
4553- ` plausible_analytics_settings ` : Allows you to modify and/or force values for each of the plugin's settings.
4654- ` plausible_load_js_in_footer ` : Allows you to load the JS code snippet in the footer.
4755- ` plausible_analytics_script_params ` : Allows you to modify the ` script ` element, loading the Plausible JS library.
48- - Example: using this filter and the ` file-types ` attribute will allow you to track downloads of certain file types when File Downloads tracking is
56+ - Example: using this filter and the ` file-types ` attribute will allow you to track downloads of certain file types
57+ when File Downloads tracking is
4958 enabled.
50- - ` plausible_analytics_pageview_properties ` : Allows you to add custom pageview properties when the Pageview Properties option is enabled under
51- Enhanced Measurements. For examples, read the [ documentation on Pageview Properties] ( https://plausible.io/docs/custom-props/for-pageviews ) .
59+ - ` plausible_analytics_pageview_properties ` : Allows you to add custom pageview properties when the Pageview Properties
60+ option is enabled under
61+ Enhanced Measurements. For examples, read
62+ the [ documentation on Pageview Properties] ( https://plausible.io/docs/custom-props/for-pageviews ) .
5263
5364### Actions
5465
5566- ` plausible_analytics_settings_saved ` : Trigger additional tasks directly after settings are saved.
56- - ` plausible_analytics_after_register_assets ` : This action allows you to trigger additional tasks or add custom JS (e.g. events) to the tracking code.
67+ - ` plausible_analytics_after_register_assets ` : This action allows you to trigger additional tasks or add custom JS (e.g.
68+ events) to the tracking code.
5769
5870### Toggles
5971
60- 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,
72+ Using constants, you can modify the behavior of the plugin. ` wp-config.php ` is the best place to define constants. If
73+ you're using a custom plugin,
6174make sure its code is loaded before this plugin.
6275
63- - ` PLAUSIBLE_SELF_HOSTED_DOMAIN ` : Especially useful for Multisite instances using the self-hosted version of Plausible, this constant allows you to
64- specify the Self-Hosted Domain for all subsites at once. ** IMPORTANT** : this constant takes precedence over the plugin's setting. So, if this
76+ - ` PLAUSIBLE_SELF_HOSTED_DOMAIN ` : Especially useful for Multisite instances using the self-hosted version of Plausible,
77+ this constant allows you to
78+ specify the Self-Hosted Domain for all subsites at once. ** IMPORTANT** : this constant takes precedence over the
79+ plugin's setting. So, if this
6580 constant is defined, changing the setting won't have any effect.
66- - ` plausible_proxy ` : Appending this ` GET ` -parameter will force enable the proxy on the page you\' re calling it. This will allow you to test your proxy
81+ - ` plausible_proxy ` : Appending this ` GET ` -parameter will force enable the proxy on the page you\' re calling it. This
82+ will allow you to test your proxy
6783 in the frontend, before enabling the option.
6884
6985## Local Development
@@ -83,15 +99,17 @@ That's it. You're now ready to start development.
8399
84100Plausible Analytics relies on several npm commands to get you started:
85101
86- * ` npm run watch ` - Live reloads JS and SASS files. Typically, you'll run this command before you start development. It's necessary to build the
102+ * ` npm run watch ` - Live reloads JS and SASS files. Typically, you'll run this command before you start development.
103+ It's necessary to build the
87104 JS/CSS
88105 however if you're working strictly within PHP it may not be necessary to run.
89106* ` npm run dev ` - Runs a one time build for development. No production files are created.
90107* ` npm run production ` - Builds the minified production files for release.
91108
92109### Development Notes
93110
94- * Ensure that you have ` SCRIPT_DEBUG ` enabled within your wp-config.php file. Here's a good example of wp-config.php for debugging:
111+ * Ensure that you have ` SCRIPT_DEBUG ` enabled within your wp-config.php file. Here's a good example of wp-config.php for
112+ debugging:
95113 ```
96114 // Enable WP_DEBUG mode
97115 define( 'WP_DEBUG', true );
@@ -103,21 +121,27 @@ Plausible Analytics relies on several npm commands to get you started:
103121 define( 'SCRIPT_DEBUG', true );
104122 ```
105123* Commit the `package.lock` file. Read more about why [here](https://docs.npmjs.com/files/package-lock.json).
106- * Your editor should recognize the `.eslintrc` and `.editorconfig` files within the Repo's root directory. Please only submit PRs following those
124+ * Your editor should recognize the `.eslintrc` and `.editorconfig` files within the Repo's root directory. Please only
125+ submit PRs following those
107126 coding style rulesets.
108127
109128### Regenerating the OpenAPI PHP Client
110129
111- This plugin uses a OpenAPI PHP Client which is autogenerated by the OpenAPI generator to reduce contract violations, etc. to a minimum. But, since
112- this is a WordPress plugin, some manual modifications need to be done to make sure it doesn't conflict with other plugins:
130+ This plugin uses a OpenAPI PHP Client which is autogenerated by the OpenAPI generator to reduce contract violations,
131+ etc. to a minimum. But, since
132+ this is a WordPress plugin, some manual modifications need to be done to make sure it doesn't conflict with other
133+ plugins:
113134
114- - (Re)generate the PHP client using the following command (trigger it from the Plugin's root dir as output will be saved to `src/Client`):
135+ - (Re)generate the PHP client using the following command (trigger it from the Plugin's root dir as output will be saved
136+ to `src/Client`):
115137 `openapi-generator-cli generate -i https://plausible.io/api/plugins/spec/openapi -g php -o src/Client --additional-properties=identifierNamingConvention=snake_case,invokerPackage="Plausible\\Analytics\\WP\\Client" --global-property=apis,models,supportingFiles,modelDocs=false,modelTests=false,apiDocs=false,apiTests=false`
116138- (When regenerating the PHP client this step can be skipped) Navigate to the `src/Client` director and install Composer
117139 dependencies: `composer install --no-dev`
118- - (When regenerating the PHP client this step can be skipped) Run `mozart compose` from the `src/Client` directory (Make sure Mozart is installed
140+ - (When regenerating the PHP client this step can be skipped) Run `mozart compose` from the `src/Client` directory (Make
141+ sure Mozart is installed
119142 globally)
120- - In the `src/Client/lib` directory, replace all occurrences of ` GuzzleHttp` (mind the space) with ` Plausible\Analytics\WP\Client\Lib\GuzzleHttp` (
143+ - In the `src/Client/lib` directory, replace all occurrences of ` GuzzleHttp` (mind the space) with
144+ ` Plausible\Analytics\WP\Client\Lib\GuzzleHttp` (
121145 again, mind the space at the beginning)
122146- In the same directory, replace all occurrences of ` \GuzzleHttp` (mind the space and backslash)
123147 with ` \Plausible\Analytics\WP\Client\Lib\GuzzleHttp`.
0 commit comments