Skip to content

Commit

Permalink
Merge pull request #30 from shubhw12/wp-update-analytics
Browse files Browse the repository at this point in the history
fix: Admin notice CSS console error in admin area.
  • Loading branch information
Nikschavan authored Aug 21, 2020
2 parents 0293136 + 8017116 commit d2b089f
Show file tree
Hide file tree
Showing 5 changed files with 38 additions and 30 deletions.
5 changes: 4 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
**Tags:** customizer, search
**Requires at least:** 4.6
**Tested up to:** 5.5
**Stable tag:** 1.1.5
**Stable tag:** 1.1.6
**License:** GPLv2 or later
**License URI:** http://www.gnu.org/licenses/gpl-2.0.html

Expand All @@ -26,6 +26,9 @@ https://www.youtube.com/watch?v=IBFfap_vGzg

## Changelog ##

### 1.1.6 ###
- Fix: Admin notice CSS console error in admin area.

### 1.1.5 ###
- Fix: Fixed compatibility with other plugins with respect to the admin notice.

Expand Down
25 changes: 15 additions & 10 deletions admin/bsf-analytics/class-bsf-analytics.php
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,12 @@ public function set_actions() {
* @since 1.0.0
*/
public function get_analytics_url( $analytics_path ) {
return str_replace( WP_CONTENT_DIR, content_url(), $analytics_path );

$content_dir_path = wp_normalize_path( WP_CONTENT_DIR );

$analytics_path = wp_normalize_path( $analytics_path );

return str_replace( $content_dir_path, content_url(), $analytics_path );
}

/**
Expand Down Expand Up @@ -208,10 +213,10 @@ public function option_notice() {
}

/* translators: %s product name */
$notice_string = __( 'Want to help make <strong>%1s</strong> even more awesome? Allow us to collect non-sensitive diagnostic data and usage information. ' );
$notice_string = __( 'Want to help make <strong>%1s</strong> even more awesome? Allow us to collect non-sensitive diagnostic data and usage information. ', 'customizer-search' );

if ( is_multisite() ) {
$notice_string .= __( 'This will be applicable for all sites from the network.' );
$notice_string .= __( 'This will be applicable for all sites from the network.', 'customizer-search' );
}

$language_dir = is_rtl() ? 'rtl' : 'ltr';
Expand All @@ -235,15 +240,15 @@ public function option_notice() {
</div>
</div>',
/* translators: %s usage doc link */
sprintf( $notice_string . '<span dir="%2s"><a href="%3s" target="_blank" rel="noreferrer noopener">%4s</a><span>', esc_html( $data['product_name'] ), $language_dir, esc_url( $usage_doc_link ), __( ' Know More.', 'astra' ) ),
sprintf( $notice_string . '<span dir="%2s"><a href="%3s" target="_blank" rel="noreferrer noopener">%4s</a><span>', esc_html( $data['product_name'] ), $language_dir, esc_url( $usage_doc_link ), __( ' Know More.', 'customizer-search' ) ),
add_query_arg(
array(
$key . '_analytics_optin' => 'yes',
$key . '_analytics_nonce' => wp_create_nonce( $key . '_analytics_optin' ),
'bsf_analytics_source' => $key,
)
),
__( 'Yes! Allow it' ),
__( 'Yes! Allow it', 'customizer-search' ),
add_query_arg(
array(
$key . '_analytics_optin' => 'no',
Expand All @@ -252,7 +257,7 @@ public function option_notice() {
)
),
MONTH_IN_SECONDS,
__( 'No Thanks' )
__( 'No Thanks', 'customizer-search' )
),
'show_if' => true,
'repeat-notice-after' => false,
Expand Down Expand Up @@ -356,7 +361,7 @@ public function register_usage_tracking_setting() {

add_settings_field(
$key . '-analytics-optin', // Field ID.
__( 'Usage Tracking' ), // Field title.
__( 'Usage Tracking', 'customizer-search' ), // Field title.
array( $this, 'render_settings_field_html' ), // Field callback function.
'general',
'default', // Settings page slug.
Expand Down Expand Up @@ -400,15 +405,15 @@ public function render_settings_field_html( $args ) {
<input id="<?php echo esc_attr( $args['id'] ); ?>" type="checkbox" value="1" name="<?php echo esc_attr( $args['name'] ); ?>" <?php checked( get_site_option( $args['name'], 'no' ), 'yes' ); ?>>
<?php
/* translators: %s Product title */
echo esc_html( sprintf( __( 'Allow %s products to track non-sensitive usage tracking data.' ), $args['title'] ) );// phpcs:ignore WordPress.WP.I18n.NonSingularStringLiteralText
echo esc_html( sprintf( __( 'Allow %s products to track non-sensitive usage tracking data.', 'customizer-search' ), $args['title'] ) );// phpcs:ignore WordPress.WP.I18n.NonSingularStringLiteralText

if ( is_multisite() ) {
esc_html_e( ' This will be applicable for all sites from the network.' );
esc_html_e( ' This will be applicable for all sites from the network.', 'customizer-search' );
}
?>
</label>
<?php
echo wp_kses_post( sprintf( '<a href="%1s" target="_blank" rel="noreferrer noopener">%2s</a>', esc_url( $args['usage_doc_link'] ), __( 'Learn More.' ) ) );
echo wp_kses_post( sprintf( '<a href="%1s" target="_blank" rel="noreferrer noopener">%2s</a>', esc_url( $args['usage_doc_link'] ), __( 'Learn More.', 'customizer-search' ) ) );
?>
</fieldset>
<?php
Expand Down
4 changes: 2 additions & 2 deletions customizer-search.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,12 @@
* Author URI: https://www.brainstormforce.com/
* Text Domain: customizer-search
* Domain Path: /languages
* Version: 1.1.5
* Version: 1.1.6
*
* @package Customizer_Search
*/

define( 'BSFCS_VER', '1.1.5' );
define( 'BSFCS_VER', '1.1.6' );
define( 'BSFCS_DIR', plugin_dir_path( __FILE__ ) );
define( 'BSFCS_URL', plugins_url( '/', __FILE__ ) );
define( 'BSFCS_PATH', plugin_basename( __FILE__ ) );
Expand Down
29 changes: 13 additions & 16 deletions languages/customizer-search.pot
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@
# This file is distributed under the same license as the Customizer Search package.
msgid ""
msgstr ""
"Project-Id-Version: Customizer Search 1.1.4\n"
"Project-Id-Version: Customizer Search 1.1.6\n"
"Report-Msgid-Bugs-To: "
"https://wordpress.org/support/plugin/customizer-search\n"
"POT-Creation-Date: 2020-06-15 05:32:03+00:00\n"
"POT-Creation-Date: 2020-08-19 10:41:52+00:00\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=utf-8\n"
"Content-Transfer-Encoding: 8bit\n"
Expand All @@ -25,47 +25,44 @@ msgstr ""
"X-Textdomain-Support: yes\n"
"X-Generator: grunt-wp-i18n 1.0.3\n"

#: admin/bsf-analytics/class-bsf-analytics.php:183
#: admin/bsf-analytics/class-bsf-analytics.php:216
#. translators: %s product name
msgid ""
"Want to help make <strong>%1s</strong> even more awesome? Allow us to "
"collect non-sensitive diagnostic data and usage information. "
msgstr ""

#: admin/bsf-analytics/class-bsf-analytics.php:186
#: admin/bsf-analytics/class-bsf-analytics.php:219
msgid "This will be applicable for all sites from the network."
msgstr ""

#: admin/bsf-analytics/class-bsf-analytics.php:210
#: admin/bsf-analytics/class-bsf-analytics.php:243
#. translators: %s usage doc link
msgid " Know More."
msgstr ""

#: admin/bsf-analytics/class-bsf-analytics.php:217
#: admin/bsf-analytics/class-bsf-analytics.php:251
msgid "Yes! Allow it"
msgstr ""

#: admin/bsf-analytics/class-bsf-analytics.php:225
#: admin/bsf-analytics/class-bsf-analytics.php:260
msgid "No Thanks"
msgstr ""

#: admin/bsf-analytics/class-bsf-analytics.php:294
msgid "Every two days"
msgstr ""

#: admin/bsf-analytics/class-bsf-analytics.php:348
#: admin/bsf-analytics/class-bsf-analytics.php:364
msgid "Usage Tracking"
msgstr ""

#: admin/bsf-analytics/class-bsf-analytics.php:380
msgid "Allow Brainstorm Force products to track non-sensitive usage tracking data."
#: admin/bsf-analytics/class-bsf-analytics.php:408
#. translators: %s Product title
msgid "Allow %s products to track non-sensitive usage tracking data."
msgstr ""

#: admin/bsf-analytics/class-bsf-analytics.php:383
#: admin/bsf-analytics/class-bsf-analytics.php:411
msgid " This will be applicable for all sites from the network."
msgstr ""

#: admin/bsf-analytics/class-bsf-analytics.php:388
#: admin/bsf-analytics/class-bsf-analytics.php:416
msgid "Learn More."
msgstr ""

Expand Down
5 changes: 4 additions & 1 deletion readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Donate link: https://www.paypal.me/BrainstormForce
Tags: customizer, search
Requires at least: 4.6
Tested up to: 5.5
Stable tag: 1.1.5
Stable tag: 1.1.6
License: GPLv2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html

Expand All @@ -26,6 +26,9 @@ https://www.youtube.com/watch?v=IBFfap_vGzg

== Changelog ==

= 1.1.6 =
- Fix: Admin notice CSS console error in admin area.

= 1.1.5 =
- Fix: Fixed compatibility with other plugins with respect to the admin notice.

Expand Down

0 comments on commit d2b089f

Please sign in to comment.