Skip to content

Commit

Permalink
Fixed Hooks
Browse files Browse the repository at this point in the history
  • Loading branch information
nathanialhenniges committed Nov 29, 2024
1 parent f45ffca commit 7eea3df
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 10 deletions.
18 changes: 10 additions & 8 deletions SELFHOST.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ I have made the following changes to the Plausible WordPress plugin to allow sel

$ip = $this->get_user_ip_address();

// Add this line if you want to allow self-hosted Plausible to Proxy
// Add this line if you want to allow self-hosted Plausible to Proxy
$url = 'https://plausible.io/api/event';
if ( defined( 'PLAUSIBLE_SELF_HOSTED_DOMAIN' ) ) {
$url = "https://" . PLAUSIBLE_SELF_HOSTED_DOMAIN . "/api/event/";
Expand Down Expand Up @@ -77,24 +77,26 @@ I have made the following changes to the Plausible WordPress plugin to allow sel
],
],

```
````
src/admin/settings/Hooks.php
## src/admin/settings/Hooks.php
```php
public function proxy_warning() {
// Remove this line if you want to allow self-hosted Plausible to Proxy
if ( ! empty( Helpers::get_settings()[ 'self_hosted_domain' ] ) ) {
// Remove this line if you want to allow self-hosted Plausible to Proxy
$this->option_na_in_ce();
// Add this line if you want to allow self-hosted Plausible to Proxy
echo sprintf(
// Add this line if you want to allow self-hosted Plausible to Proxy
echo sprintf(
wp_kses(
__(
'After enabling this option, please check your Plausible dashboard to make sure stats are being recorded. Are stats not being recorded? Check github issues for <a href="%s" target="_blank">known issues</a>. We\'re here to help!',
'After enabling this option, please check your Plausible dashboard to make sure stats are being recorded. Are stats not being recorded? Check github issues for <a href="%s" target="_blank">known issues</a>. We\'re here to help!',
'plausible-analytics'
),
'post'
),
'https://github.com/plausible/analytics/issues'
);
} else {
echo sprintf(
Expand All @@ -109,5 +111,5 @@ src/admin/settings/Hooks.php
);
}
}
```
````
5 changes: 3 additions & 2 deletions src/Admin/Settings/Hooks.php
Original file line number Diff line number Diff line change
Expand Up @@ -68,17 +68,18 @@ public function maybe_modify_success_message( $message, $option_name, $status )
* @since 1.3.0
* @output HTML
*/
public function proxy_warning() {
public function proxy_warning() {
if ( ! empty( Helpers::get_settings()[ 'self_hosted_domain' ] ) ) {
echo sprintf(
wp_kses(
__(
'After enabling this option, please check your Plausible dashboard to make sure stats are being recorded. Are stats not being recorded? Check github issues for <a href="%s" target="_blank">known issues</a>. We\'re here to help!',
'After enabling this option, please check your Plausible dashboard to make sure stats are being recorded. Are stats not being recorded? Check github issues for <a href="%s" target="_blank">known issues</a>. We\'re here to help!',
'plausible-analytics'
),
'post'
),
'https://github.com/plausible/analytics/issues'

);
} else {
echo sprintf(
Expand Down

0 comments on commit 7eea3df

Please sign in to comment.