Skip to content

Commit c2be9fd

Browse files
authored
Merge pull request #36 from brainstormforce/wp-update-readme
chore: updated the tested up to version.
2 parents 55d5edc + 11b4428 commit c2be9fd

File tree

14 files changed

+1674
-549
lines changed

14 files changed

+1674
-549
lines changed

README.md

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
**Donate link:** https://www.paypal.me/BrainstormForce
44
**Tags:** custom adobe fonts, theme custom fonts, unlimited typekit custom fonts
55
**Requires at least:** 4.4
6-
**Tested up to:** 5.4.2
7-
**Stable tag:** 1.0.17
6+
**Tested up to:** 5.5
7+
**Stable tag:** 1.0.18
88
**License:** GPLv2 or later
99
**License URI:** http://www.gnu.org/licenses/gpl-2.0.html
1010

@@ -49,6 +49,9 @@ If you're not using any of the supported plugins and theme, you can write the cu
4949

5050
## Changelog ##
5151

52+
### 1.0.18 ###
53+
- Fix: Fixed compatibility with other plugins with respect to the admin notice.
54+
5255
### 1.0.17 ###
5356
- New: Users can now share non-personal usage data to help us test and develop better products. ( https://store.brainstormforce.com/usage-tracking/?utm_source=wp_dashboard&utm_medium=general_settings&utm_campaign=usage_tracking )
5457
- Fix: "PHP Notice: Trying to access array offset on value of type bool" when user is migrating from 1.0.8 or lower version.

admin/bsf-analytics/assets/css/minified/style-rtl.min.css

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

admin/bsf-analytics/assets/css/minified/style.min.css

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,21 @@
1-
#bsf-optin-notice {
1+
[ID*="-optin-notice"] {
22
padding: 1px 12px;
33
border-right-color: #007cba;
44
}
55

6-
#bsf-optin-notice .notice-container {
6+
[ID*="-optin-notice"] .notice-container {
77
padding-top: 10px;
88
padding-bottom: 12px;
99
}
1010

11-
#bsf-optin-notice .notice-content {
11+
[ID*="-optin-notice"] .notice-content {
1212
margin: 0;
1313
}
1414

15-
#bsf-optin-notice .notice-heading {
15+
[ID*="-optin-notice"] .notice-heading {
1616
padding: 0 0 12px 20px;
1717
}
1818

19-
#bsf-optin-notice .button-primary {
19+
[ID*="-optin-notice"] .button-primary {
2020
margin-left: 5px;
2121
}
Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,21 @@
1-
#bsf-optin-notice {
1+
[ID*="-optin-notice"] {
22
padding: 1px 12px;
33
border-left-color: #007cba;
44
}
55

6-
#bsf-optin-notice .notice-container {
6+
[ID*="-optin-notice"] .notice-container {
77
padding-top: 10px;
88
padding-bottom: 12px;
99
}
1010

11-
#bsf-optin-notice .notice-content {
11+
[ID*="-optin-notice"] .notice-content {
1212
margin: 0;
1313
}
1414

15-
#bsf-optin-notice .notice-heading {
15+
[ID*="-optin-notice"] .notice-heading {
1616
padding: 0 20px 12px 0;
1717
}
1818

19-
#bsf-optin-notice .button-primary {
19+
[ID*="-optin-notice"] .button-primary {
2020
margin-right: 5px;
2121
}
Lines changed: 118 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,118 @@
1+
<?php
2+
/**
3+
* BSF analytics loader file.
4+
*
5+
* @version 1.0.0
6+
*
7+
* @package bsf-analytics
8+
*/
9+
10+
if ( ! defined( 'ABSPATH' ) ) {
11+
exit();
12+
}
13+
14+
/**
15+
* Class BSF_Analytics_Loader.
16+
*/
17+
class BSF_Analytics_Loader {
18+
19+
/**
20+
* Analytics Entities.
21+
*
22+
* @access private
23+
* @var array Entities array.
24+
*/
25+
private $entities = array();
26+
27+
/**
28+
* Analytics Version.
29+
*
30+
* @access private
31+
* @var float analytics version.
32+
*/
33+
private $analytics_version = '';
34+
35+
/**
36+
* Analytics path.
37+
*
38+
* @access private
39+
* @var string path array.
40+
*/
41+
private $analytics_path = '';
42+
43+
/**
44+
* Instance
45+
*
46+
* @access private
47+
* @var object Class object.
48+
*/
49+
private static $instance = null;
50+
51+
/**
52+
* Get instace of class.
53+
*
54+
* @return object
55+
*/
56+
public static function get_instance() {
57+
if ( null === self::$instance ) {
58+
self::$instance = new self();
59+
}
60+
61+
return self::$instance;
62+
}
63+
64+
/**
65+
* Constructor
66+
*/
67+
public function __construct() {
68+
add_action( 'init', array( $this, 'load_analytics' ) );
69+
}
70+
71+
/**
72+
* Set entity for analytics.
73+
*
74+
* @param string $data Entity attributes data.
75+
* @return void
76+
*/
77+
public function set_entity( $data ) {
78+
array_push( $this->entities, $data );
79+
}
80+
81+
/**
82+
* Load Analytics library.
83+
*
84+
* @return void
85+
*/
86+
public function load_analytics() {
87+
$unique_entities = array();
88+
89+
if ( ! empty( $this->entities ) ) {
90+
foreach ( $this->entities as $entity ) {
91+
foreach ( $entity as $key => $data ) {
92+
93+
if ( isset( $data['path'] ) ) {
94+
if ( file_exists( $data['path'] . '/version.json' ) ) {
95+
$file_contents = file_get_contents( $data['path'] . '/version.json' ); // phpcs:ignore WordPress.WP.AlternativeFunctions.file_get_contents_file_get_contents
96+
$analytics_version = json_decode( $file_contents, 1 );
97+
$analytics_version = $analytics_version['bsf-analytics-ver'];
98+
99+
if ( version_compare( $analytics_version, $this->analytics_version, '>' ) ) {
100+
$this->analytics_version = $analytics_version;
101+
$this->analytics_path = $data['path'];
102+
}
103+
}
104+
}
105+
106+
if ( ! isset( $unique_entities[ $key ] ) ) {
107+
$unique_entities[ $key ] = $data;
108+
}
109+
}
110+
}
111+
112+
if ( file_exists( $this->analytics_path ) && ! class_exists( 'BSF_Analytics' ) ) {
113+
require_once $this->analytics_path . '/class-bsf-analytics.php';
114+
new BSF_Analytics( $unique_entities, $this->analytics_path, $this->analytics_version );
115+
}
116+
}
117+
}
118+
}

admin/bsf-analytics/class-bsf-analytics-stats.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,6 @@ private function get_curl_ssl_version() {
194194
* @since 1.0.0
195195
*/
196196
private function get_curl_version() {
197-
$curl = array();
198197
if ( function_exists( 'curl_version' ) ) {
199198
$curl = curl_version(); // phpcs:ignore WordPress.WP.AlternativeFunctions.curl_curl_version
200199
}

0 commit comments

Comments
 (0)