PluginProbe
Jetpack – WP Security, Backup, Speed, & Growth / 16.3-beta
Jetpack – WP Security, Backup, Speed, & Growth v16.3-beta
16.3-beta 16.3-a.5 16.3-a.7 16.3-a.3 16.3-a.1 16.2 16.2-beta 12.0.3 12.1.3 12.2.3 12.3.2 12.4.2 12.5.2 12.6.4 12.7.3 12.8.3 12.9.5 13.0.2 13.1.5 13.2.4 13.3.3 13.4.5 13.5.2 13.6.2 13.7.2 All 507 releases
← All changes | jetpack_vendor/automattic/jetpack-stats/src/class-options.php +11 -6 12.0.3 → 16.3-beta View file →
@@ -30,13 +30,13 @@
30 30
31 31 /**
32 32 * Stats Get Options.
33 33 *
34 - * @return array.
34 + * @return array
35 35 */
36 36 public static function get_options() {
37 37 // Make sure we only get options from the database once per connection.
38 - if ( count( self::$options ) > 0 ) {
38 + if ( array() !== self::$options ) {
39 39 return self::$options;
40 40 }
41 41
42 42 self::$options = get_option( self::OPTION_NAME, array() );
@@ -49,12 +49,12 @@
49 49 return self::$options;
50 50 }
51 51
52 52 /**
53 - * Get Stats Option..
53 + * Get Stats Option.
54 54 *
55 55 * @param string $option Option name.
56 - * @return mixed|null.
56 + * @return mixed|null
57 57 */
58 58 public static function get_option( $option ) {
59 59 if ( 'blog_id' === $option ) {
60 60 return Jetpack_Options::get_option( 'id' );
@@ -73,9 +73,9 @@
73 73 * Stats Set Option.
74 74 *
75 75 * @param string $option The option name.
76 76 * @param mixed $value The option Value.
77 - * @return bool.
77 + * @return bool
78 78 */
79 79 public static function set_option( $option, $value ) {
80 80 $options = self::get_options();
81 81
@@ -150,11 +150,15 @@
150 150
151 151 /**
152 152 * Default Stats related options.
153 153 *
154 + * Exposed so consumers (e.g. the Abilities API surface) can introspect
155 + * each option's default value and infer its type without redeclaring
156 + * a parallel allow-list of bool/array fields.
157 + *
154 158 * @return array
155 159 */
156 - protected static function get_defaults() {
160 + public static function get_defaults() {
157 161 return array(
158 162 'admin_bar' => true,
159 163 'roles' => array( 'administrator' ),
160 164 'count_roles' => array(),
@@ -165,7 +169,8 @@
165 169 'enable_odyssey_stats' => true,
166 170 'odyssey_stats_changed_at' => 0,
167 171 'notices' => array(),
168 172 'views' => 0,
173 + 'honor_cookie_consent' => false,
169 174 );
170 175 }
171 176 }