Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions src/Admin/Module.php
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,7 @@ public function install() {
private function show_module_not_installed_error() {
$message = sprintf(
wp_kses(
// translators: %s: URL to manual proxy speed module installation instructions.
__(
'The proxy is enabled, but the proxy\'s speed module failed to install. Try <a href="%s" target="_blank">installing it manually</a>.',
'plausible-analytics'
Expand Down Expand Up @@ -211,6 +212,7 @@ public function maybe_enable_proxy( $settings, $old_settings ) {
if ( ! $is_ssl ) {
Messages::set_notice(
sprintf(
// translators: %s: URL to list of potential proxy solutions.
__(
'Please check that your proxy is functioning correctly. If you encounter any issues with tracking, <a href="%s" target="_blank">click here</a> for a list of potential solutions',
'plausible-analytics'
Expand All @@ -227,6 +229,7 @@ public function maybe_enable_proxy( $settings, $old_settings ) {
Messages::set_error(
sprintf(
wp_kses(
// translators: 1: Proxy endpoint URL, 2: URL to Plausible support.
__(
'Plausible\'s proxy couldn\'t be enabled, because the WordPress API is inaccessible. This might be due to a conflicting setting in a (security) plugin or server firewall. Make sure you whitelist requests to the Proxy\'s endpoint: <code>%1$s</code>. <a href="%2$s" target="_blank">Contact support</a> if you need help locating the issue.',
'plausible-analytics'
Expand Down
9 changes: 6 additions & 3 deletions src/Admin/Settings/API.php
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,9 @@ public function settings_page() {
];
$this->slides_description = [
'welcome' => sprintf(
// translators: 1: URL to Plausible website, 2: URL to Plausible registration page.
__(
'<p><a href="%s" target="_blank">Plausible Analytics</a> is an easy to use, open source, lightweight and privacy-friendly alternative to Google Analytics. We\'re super excited to have you on board!</p><p>To use our plugin, you need to <a href="%s" target="_blank">register an account</a>. To explore the product, we offer you a free 30-day trial. No credit card is required to sign up for the trial.</p><p>Already have an account? Please do follow the following steps to get the most out of your Plausible experience.</p>',
'<p><a href="%1$s" target="_blank">Plausible Analytics</a> is an easy to use, open source, lightweight and privacy-friendly alternative to Google Analytics. We\'re super excited to have you on board!</p><p>To use our plugin, you need to <a href="%2$s" target="_blank">register an account</a>. To explore the product, we offer you a free 30-day trial. No credit card is required to sign up for the trial.</p><p>Already have an account? Please do follow the following steps to get the most out of your Plausible experience.</p>',
'plausible-analytics'
),
'https://plausible.io/?utm_source=WordPress&utm_medium=Referral&utm_campaign=WordPress+plugin',
Expand All @@ -95,8 +96,9 @@ public function settings_page() {
'plausible-analytics'
),
'success' => sprintf(
// translators: 1: URL to Plausible statistics dashboard, 2: URL to plugin settings, 3: URL to Plausible documentation, 4: URL to Plausible contact.
__(
'<p>Congrats! Your traffic is now being counted without compromising the user experience and privacy of your visitors. You can now check out <a href="%s" target="_blank">your intuitive, fast-loading and privacy-friendly dashboard</a>.</p><p>Note that visits from logged in users aren\'t tracked. If you want to track visits for certain user roles, then please specify them in the <a href="%s">plugin\'s settings</a>.</p><p>Need help? <a href="%s" target="_blank">Our documentation</a> is the best place to find most answers right away.</p><p>Still haven\'t found the answer you\'re looking for? We\'re here to help. Please <a href="%s" target="_blank">contact our support</a>.</p>',
'<p>Congrats! Your traffic is now being counted without compromising the user experience and privacy of your visitors. You can now check out <a href="%1$s" target="_blank">your intuitive, fast-loading and privacy-friendly dashboard</a>.</p><p>Note that visits from logged in users aren\'t tracked. If you want to track visits for certain user roles, then please specify them in the <a href="%2$s">plugin\'s settings</a>.</p><p>Need help? <a href="%3$s" target="_blank">Our documentation</a> is the best place to find most answers right away.</p><p>Still haven\'t found the answer you\'re looking for? We\'re here to help. Please <a href="%4$s" target="_blank">contact our support</a>.</p>',
'plausible-analytics'
),
admin_url( 'index.php?page=plausible_analytics_statistics' ),
Expand All @@ -108,8 +110,9 @@ public function settings_page() {

if ( empty( $settings['enable_analytics_dashboard'] ) ) {
$this->slides_description['success'] = sprintf(
// translators: 1: URL to plugin settings, 2: URL to Plausible documentation, 3: URL to Plausible contact.
__(
'<p>Congrats! Your traffic is now being counted without compromising the user experience and privacy of your visitors.</p><p>Note that visits from logged in users aren\'t tracked. If you want to track visits for certain user roles, then please specify them in the <a href="%s">plugin\'s settings</a>.</p><p>Need help? <a href="%s" target="_blank">Our documentation</a> is the best place to find most answers right away.</p><p>Still haven\'t found the answer you\'re looking for? We\'re here to help. Please <a href="%s" target="_blank">contact our support</a>.</p>',
'<p>Congrats! Your traffic is now being counted without compromising the user experience and privacy of your visitors.</p><p>Note that visits from logged in users aren\'t tracked. If you want to track visits for certain user roles, then please specify them in the <a href="%1$s">plugin\'s settings</a>.</p><p>Need help? <a href="%2$s" target="_blank">Our documentation</a> is the best place to find most answers right away.</p><p>Still haven\'t found the answer you\'re looking for? We\'re here to help. Please <a href="%3$s" target="_blank">contact our support</a>.</p>',
'plausible-analytics'
),
admin_url( 'admin-ajax.php?action=plausible_analytics_quit_wizard&_nonce=' ) . wp_create_nonce( 'plausible_analytics_quit_wizard' ) . '&redirect=tracked_user_roles',
Expand Down
2 changes: 2 additions & 0 deletions src/Admin/Settings/Hooks.php
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ public function proxy_warning() {
} else {
echo sprintf(
wp_kses(
// translators: %s: URL to Plausible contact page.
__(
'After enabling this option, please check your Plausible dashboard to make sure stats are being recorded. Are stats not being recorded? Do <a href="%s" target="_blank">reach out to us</a>. We\'re here to help!',
'plausible-analytics'
Expand Down Expand Up @@ -110,6 +111,7 @@ public function enable_analytics_dashboard_notice() {
if ( ! empty( Helpers::get_settings()[ 'enable_analytics_dashboard' ] ) ) {
echo sprintf(
wp_kses(
// translators: %s: URL to the analytics dashboard.
__(
'Your analytics dashboard is available <a href="%s">here</a>.',
'plausible-analytics'
Expand Down
10 changes: 9 additions & 1 deletion src/Admin/Settings/Page.php
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@ public function __construct() {
'type' => 'group',
'desc' => sprintf(
wp_kses(
// translators: %s: URL to Plausible account settings.
__(
'Ensure your domain name matches the one in <a href="%s" target="_blank">your Plausible account</a>, then <a class="hover:cursor-pointer underline plausible-create-api-token">create a Plugin Token</a> (link opens in a new window) and paste it into the \'Plugin Token\' field.',
'plausible-analytics'
Expand Down Expand Up @@ -181,6 +182,7 @@ public function __construct() {
'affiliate-links-patterns' => [
'slug' => 'affiliate_links',
'description' => sprintf(
// translators: %s: Example URL to affiliate product.
__(
'Enter the (partial) URLs you\'d like to track. E.g. enter <strong>/recommends/</strong> if you want to track <code>%s</code>.',
'plausible-analytics'
Expand Down Expand Up @@ -232,6 +234,7 @@ public function __construct() {
'query-params-patterns' => [
'slug' => 'query_params',
'description' => sprintf(
// translators: %s: Example URL with query parameter.
__(
'Enter the query parameters you\'d like to track. E.g. enter <strong>lang</strong> if you want to track <code>%s</code>.',
'plausible-analytics'
Expand Down Expand Up @@ -266,6 +269,7 @@ public function __construct() {
'type' => 'group',
'desc' => sprintf(
wp_kses(
// translators: 1: Proxy endpoint prefix, 2: Proxy endpoint details, 3: URL to learn more about proxy.
__(
'Concerned about ad blockers? You can run the Plausible script as a first-party connection from your domain name to count visitors who use ad blockers. The proxy uses WordPress\' API with a randomly generated endpoint, starting with <code>%1$s</code> and %2$s. <a href="%3$s" target="_blank">Learn more &raquo;</a>',
'plausible-analytics'
Expand Down Expand Up @@ -423,6 +427,7 @@ public function __construct() {
'slug' => 'self_hosted_shared_link',
'type' => 'group',
'desc' => sprintf(
// translators: %s: URL to Plausible shared link documentation.
'<ol><li>' . __(
'<a href="%s" target="_blank">Create a secure and private shared link</a> in your Plausible account.',
'plausible-analytics'
Expand All @@ -439,7 +444,8 @@ public function __construct() {
'type' => 'text',
'value' => $settings['self_hosted_shared_link'],
'placeholder' => sprintf(
wp_kses( __( 'E.g. %s/share/%s?auth=XXXXXXXXXXXX', 'plausible-analytics' ), 'post' ),
// translators: 1: Plausible hosted domain URL, 2: Site domain name.
wp_kses( __( 'E.g. %1$s/share/%2$s?auth=XXXXXXXXXXXX', 'plausible-analytics' ), 'post' ),
Helpers::get_hosted_domain_url(),
Helpers::get_domain()
),
Expand Down Expand Up @@ -734,6 +740,7 @@ public function render_analytics_dashboard() {
<p>
<?php if ( $settings['self_hosted_domain'] ) : ?>
<?php echo sprintf(
// translators: %s: URL to self-hosted settings page.
__(
'Please enter your <em>Shared Link</em> under <a href="%s">Self-Hosted Settings</a>.',
'plausible-analytics'
Expand All @@ -742,6 +749,7 @@ public function render_analytics_dashboard() {
); ?>
<?php else: ?>
<?php echo sprintf(
// translators: %s: URL to plugin settings page.
__(
'Please <a href="%s">click here</a> to enable <strong>View Stats in WordPress</strong>.',
'plausible-analytics'
Expand Down
6 changes: 4 additions & 2 deletions src/Admin/Upgrades.php
Original file line number Diff line number Diff line change
Expand Up @@ -409,7 +409,8 @@ public function show_ce_api_token_notice() {

?>
<div class="notice notice-warning">
<p><?php echo sprintf( __( 'A plugin token for Plausible is required. Please create one from the <a href="%s">Settings screen</a> and upgrade Plausible CE if necessary.', 'plausible-analytics' ), $url ); ?></p>
<p><?php // translators: %s: URL to Plausible Analytics settings page.
echo sprintf( __( 'A plugin token for Plausible is required. Please create one from the <a href="%s">Settings screen</a> and upgrade Plausible CE if necessary.', 'plausible-analytics' ), $url ); ?></p>
</div>
<?php
}
Expand All @@ -424,7 +425,8 @@ public function show_cloud_api_token_notice() {

?>
<div class="notice notice-warning">
<p><?php echo sprintf( __( 'Almost there! Stats tracking requires a Plausible plugin token. Create one on the <a href="%s">Settings screen</a>, and press Connect to complete setup.', 'plausible-analytics' ), $url ); ?></p>
<p><?php // translators: %s: URL to Plausible Analytics settings page.
echo sprintf( __( 'Almost there! Stats tracking requires a Plausible plugin token. Create one on the <a href="%s">Settings screen</a>, and press Connect to complete setup.', 'plausible-analytics' ), $url ); ?></p>
</div>
<?php
}
Expand Down
3 changes: 2 additions & 1 deletion src/Ajax.php
Original file line number Diff line number Diff line change
Expand Up @@ -425,8 +425,9 @@ private function validate_api_token( $token = '' ) {

Messages::set_error(
sprintf(
// translators: 1: URL to create a new plugin token, 2: URL to read more.
__(
'Oops! The Plugin Token you used is invalid. Please <a href="%s" target="_blank">create a new token</a>. <a target="_blank" href="%s">Read more</a>',
'Oops! The Plugin Token you used is invalid. Please <a href="%1$s" target="_blank">create a new token</a>. <a target="_blank" href="%2$s">Read more</a>',
'plausible-analytics'
),
"$hosted_domain/$domain/settings/integrations?new_token=WordPress",
Expand Down
6 changes: 6 additions & 0 deletions src/Client.php
Original file line number Diff line number Diff line change
Expand Up @@ -232,6 +232,7 @@ public function update_tracker_script_configuration( $tracker_script_config_upda
} catch ( Exception $e ) {
$this->send_json_error(
$e,
// translators: %s: Error message.
__(
'Something went wrong while updating tracker script configuration: %s',
'plausible-analytics'
Expand Down Expand Up @@ -303,6 +304,7 @@ public function create_shared_link() {
$result = $this->bulk_create_shared_links();
// @codeCoverageIgnoreStart
} catch ( Exception $e ) {
// translators: %s: Error message.
$this->send_json_error( $e, __( 'Something went wrong while creating Shared Link: %s', 'plausible-analytics' ) );
// @codeCoverageIgnoreEnd
}
Expand Down Expand Up @@ -341,6 +343,7 @@ public function create_goals( $goals ) {
try {
return $this->api_instance->goalGetOrCreate( $goals );
} catch ( Exception $e ) {
// translators: %s: Error message.
$this->send_json_error( $e, __( 'Something went wrong while creating Custom Event Goal: %s', 'plausible-analytics' ) );
}
}
Expand All @@ -358,6 +361,7 @@ public function create_funnel( $funnel ) {
try {
return $this->api_instance->funnelGetOrCreate( $funnel );
} catch ( Exception $e ) {
// translators: %s: Error message.
$this->send_json_error( $e, __( 'Something went wrong while creating Funnel: %s', 'plausible-analytics' ) );
}
}
Expand All @@ -375,6 +379,7 @@ public function delete_goal( $id ) {
} catch ( Exception $e ) {
$this->send_json_error(
$e,
// translators: %s: Error message.
__(
'Something went wrong while deleting a Custom Event Goal: %s',
'plausible-analytics'
Expand All @@ -398,6 +403,7 @@ public function enable_custom_property( $enable_request ) {
} catch ( Exception $e ) {
$this->send_json_error(
$e,
// translators: %s: Error message.
__(
'Something went wrong while enabling Pageview Properties: %s',
'plausible-analytics'
Expand Down
1 change: 1 addition & 0 deletions src/Integrations/EDD.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ public function __construct( $init = true ) {
}

$this->event_goals = [
// translators: %s: Product page URI pattern.
'view-product' => sprintf( __( 'Visit %s*', 'plausible-analytics' ), $uri ),
'add-to-cart' => __( 'EDD Add to Cart', 'plausible-analytics' ),
'remove-from-cart' => __( 'EDD Remove from Cart', 'plausible-analytics' ),
Expand Down
1 change: 1 addition & 0 deletions src/Integrations/WooCommerce.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ public function __construct( $init = true ) {
}

$this->event_goals = [
// translators: %s: Product page URI pattern.
'view-product' => sprintf( __( 'Visit %s*', 'plausible-analytics' ), $uri ),
'add-to-cart' => __( 'Woo Add to Cart', 'plausible-analytics' ),
'remove-from-cart' => __( 'Woo Remove from Cart', 'plausible-analytics' ),
Expand Down
Loading