Skip to content

Commit 7342d10

Browse files
release: fixes
- Updated dependencies - Fixed onboarding issue
2 parents 79accd2 + b3fcd6c commit 7342d10

File tree

83 files changed

+4437
-1036
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

83 files changed

+4437
-1036
lines changed

composer.json

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -14,18 +14,17 @@
1414
],
1515
"require-dev": {
1616
"squizlabs/php_codesniffer": "^3.3",
17-
"wp-coding-standards/wpcs": "^1",
17+
"wp-coding-standards/wpcs": "^3.2",
1818
"phpcompatibility/php-compatibility": "^9",
1919
"dealerdirect/phpcodesniffer-composer-installer": "0.7.1",
20-
"automattic/vipwpcs": "^1.0.0",
2120
"phpunit/phpunit": "9.6.5",
2221
"yoast/phpunit-polyfills": "^4.0",
23-
"phpstan/phpstan": "^1.10",
24-
"szepeviktor/phpstan-wordpress": "^1.3",
22+
"phpstan/phpstan": "^2.1",
2523
"php-stubs/woocommerce-stubs": "^9.1",
2624
"php-stubs/acf-pro-stubs": "^6.0",
27-
"spaze/phpstan-stripe": "^2.4",
28-
"wpackagist-plugin/woocommerce": "*"
25+
"wpackagist-plugin/woocommerce": "*",
26+
"szepeviktor/phpstan-wordpress": "^2.0",
27+
"automattic/vipwpcs": "^3.0"
2928
},
3029
"license": "GPL-2.0+",
3130
"authors": [
@@ -39,7 +38,8 @@
3938
"format": "phpcbf",
4039
"phpunit": "phpunit",
4140
"phpstan": "phpstan analyse --memory-limit 2G",
42-
"format-dist": "phpcbf --standard=phpcs.export.xml"
41+
"phpstan:generate:baseline": "phpstan analyse --memory-limit 2G --generate-baseline",
42+
"format-dist": "phpcbf --standard=phpcs.xml.dist"
4343
},
4444
"prefer-stable": true,
4545
"config": {

composer.lock

Lines changed: 388 additions & 237 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

inc/class-base-css.php

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -107,31 +107,31 @@ public function autoload_block_classes() {
107107
/**
108108
* Check if string is empty without accepting zero
109109
*
110-
* @param string $var Var to check.
110+
* @param string $value Var to check.
111111
*
112112
* @return bool
113113
* @since 1.3.1
114114
* @access public
115115
*/
116-
public function is_empty( $var ) {
117-
return empty( $var ) && 0 !== $var;
116+
public function is_empty( $value ) {
117+
return empty( $value ) && 0 !== $value;
118118
}
119119

120120
/**
121121
* Get block attribute value with default
122122
*
123123
* @param mixed $attr Attributes.
124-
* @param mixed $default Default value.
124+
* @param mixed $default_value Default value.
125125
*
126126
* @return mixed
127127
* @since 1.3.0
128128
* @access public
129129
*/
130-
public function get_attr_value( $attr, $default = 'unset' ) {
130+
public function get_attr_value( $attr, $default_value = 'unset' ) {
131131
if ( ! $this->is_empty( $attr ) ) {
132132
return $attr;
133133
} else {
134-
return $default;
134+
return $default_value;
135135
}
136136
}
137137

@@ -150,10 +150,8 @@ public function get_google_fonts( $attr ) {
150150
'fontfamily' => $attr['fontFamily'],
151151
'fontvariant' => ( isset( $attr['fontVariant'] ) && ! empty( $attr['fontVariant'] ) ? array( $attr['fontVariant'] ) : array() ),
152152
);
153-
} else {
154-
if ( ! in_array( $attr['fontVariant'], self::$google_fonts[ $attr['fontFamily'] ]['fontvariant'], true ) ) {
153+
} elseif ( ! in_array( $attr['fontVariant'], self::$google_fonts[ $attr['fontFamily'] ]['fontvariant'], true ) ) {
155154
array_push( self::$google_fonts[ $attr['fontFamily'] ]['fontvariant'], ( isset( $attr['fontStyle'] ) && 'italic' === $attr['fontStyle'] ) ? $attr['fontVariant'] . ':i' : $attr['fontVariant'] );
156-
}
157155
}
158156
}
159157
}
@@ -644,7 +642,7 @@ public static function is_image_url( $url ) {
644642
* @access protected
645643
*/
646644
protected function get_dir() {
647-
return dirname( __FILE__ );
645+
return __DIR__;
648646
}
649647

650648
/**

inc/class-pro.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -384,7 +384,7 @@ public function add_cron_schedules( $schedules = array() ) {
384384
*/
385385
public function schedule_cron_events() {
386386
if ( ! wp_next_scheduled( 'otter_montly_scheduled_events' ) ) {
387-
wp_schedule_event( current_time( 'timestamp', true ), 'monthly', 'otter_montly_scheduled_events' );
387+
wp_schedule_event( time(), 'monthly', 'otter_montly_scheduled_events' );
388388
}
389389
}
390390

inc/class-registration.php

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -347,13 +347,11 @@ public function enqueue_block_assets() {
347347

348348
if ( is_singular() ) {
349349
$this->enqueue_dependencies();
350-
} else {
351-
if ( ! is_null( $wp_query->posts ) && 0 < count( $wp_query->posts ) ) {
350+
} elseif ( ! is_null( $wp_query->posts ) && 0 < count( $wp_query->posts ) ) {
352351
$posts = wp_list_pluck( $wp_query->posts, 'ID' );
353352

354-
foreach ( $posts as $post ) {
355-
$this->enqueue_dependencies( $post );
356-
}
353+
foreach ( $posts as $post ) {
354+
$this->enqueue_dependencies( $post );
357355
}
358356
}
359357

@@ -437,7 +435,7 @@ public function enqueue_dependencies( $post = null ) {
437435
$blocks = parse_blocks( $content );
438436
$blocks = array_filter(
439437
$blocks,
440-
function( $block ) {
438+
function ( $block ) {
441439
return 'core/block' === $block['blockName'] && isset( $block['attrs']['ref'] );
442440
}
443441
);
@@ -490,7 +488,7 @@ function( $block ) {
490488

491489
add_action(
492490
'wp_head',
493-
function() {
491+
function () {
494492
echo '
495493
<style type="text/css" data-source="otter-blocks">
496494
[class*="o-countdown-trigger-on-end-"] {

inc/css/blocks/class-accordion-css.php

Lines changed: 24 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -64,10 +64,10 @@ public function render_css( $block ) {
6464
array(
6565
'property' => '--border-width',
6666
'value' => 'borderWidth',
67-
'format' => function( $value ) {
67+
'format' => function ( $value ) {
6868
return $value;
6969
},
70-
'condition' => function( $attrs ) {
70+
'condition' => function ( $attrs ) {
7171
return isset( $attrs['borderWidth'] );
7272
},
7373
),
@@ -79,59 +79,59 @@ public function render_css( $block ) {
7979
'value' => 'boxShadow',
8080
'unit' => 'px',
8181
'default' => 0,
82-
'format' => function( $value ) {
82+
'format' => function ( $value ) {
8383
return $value['horizontal'];
8484
},
8585
),
8686
'vertical' => array(
8787
'value' => 'boxShadow',
8888
'unit' => 'px',
8989
'default' => 0,
90-
'format' => function( $value ) {
90+
'format' => function ( $value ) {
9191
return $value['vertical'];
9292
},
9393
),
9494
'blur' => array(
9595
'value' => 'boxShadow',
9696
'unit' => 'px',
9797
'default' => 5,
98-
'format' => function( $value ) {
98+
'format' => function ( $value ) {
9999
return $value['blur'];
100100
},
101101
),
102102
'spread' => array(
103103
'value' => 'boxShadow',
104104
'unit' => 'px',
105105
'default' => 1,
106-
'format' => function( $value ) {
106+
'format' => function ( $value ) {
107107
return $value['spread'];
108108
},
109109
),
110110
'color' => array(
111111
'value' => 'boxShadow',
112112
'default' => '#000',
113-
'format' => function( $value ) {
113+
'format' => function ( $value ) {
114114
$opacity = $value['colorOpacity'];
115115
$color = isset( $value['color'] ) ? $value['color'] : '#000000';
116116
return ( strpos( $color, '#' ) !== false && $opacity < 100 ) ? Base_CSS::hex2rgba( $color, $opacity / 100 ) : $color;
117117
},
118118
),
119119
),
120-
'condition' => function( $attrs ) {
120+
'condition' => function ( $attrs ) {
121121
return isset( $attrs['boxShadow'] ) && true === $attrs['boxShadow']['active'];
122122
},
123123
),
124124
array(
125125
'property' => '--gap',
126126
'value' => 'gap',
127-
'format' => function( $value, $attrs ) {
127+
'format' => function ( $value, $attrs ) {
128128
return $value . 'px';
129129
},
130130
),
131131
array(
132132
'property' => '--padding',
133133
'value' => 'padding',
134-
'format' => function( $value, $attrs ) {
134+
'format' => function ( $value, $attrs ) {
135135
return CSS_Utility::box_values(
136136
$value,
137137
array(
@@ -146,7 +146,7 @@ public function render_css( $block ) {
146146
array(
147147
'property' => '--padding-tablet',
148148
'value' => 'paddingTablet',
149-
'format' => function( $value, $attrs ) {
149+
'format' => function ( $value, $attrs ) {
150150
return CSS_Utility::box_values(
151151
$value,
152152
array(
@@ -161,7 +161,7 @@ public function render_css( $block ) {
161161
array(
162162
'property' => '--padding-mobile',
163163
'value' => 'paddingMobile',
164-
'format' => function( $value, $attrs ) {
164+
'format' => function ( $value, $attrs ) {
165165
return CSS_Utility::box_values(
166166
$value,
167167
array(
@@ -263,30 +263,30 @@ private function add_icon( $css ) {
263263
array(
264264
'property' => 'content',
265265
'value' => 'icon',
266-
'format' => function( $value ) use ( $fa_icons ) {
266+
'format' => function ( $value ) use ( $fa_icons ) {
267267
return '"\\\\' . $fa_icons[ $value['name'] ]['unicode'] . '"';
268268
},
269-
'condition' => function( $attrs ) {
269+
'condition' => function ( $attrs ) {
270270
return isset( $attrs['icon'] );
271271
},
272272
),
273273
array(
274274
'property' => 'font-weight',
275275
'value' => 'icon',
276-
'format' => function( $value ) {
276+
'format' => function ( $value ) {
277277
return 'fas' !== $value['prefix'] ? 400 : 900;
278278
},
279-
'condition' => function( $attrs ) {
279+
'condition' => function ( $attrs ) {
280280
return isset( $attrs['icon'] );
281281
},
282282
),
283283
array(
284284
'property' => 'font-family',
285285
'value' => 'icon',
286-
'format' => function( $value ) use ( $prefix_to_family ) {
286+
'format' => function ( $value ) use ( $prefix_to_family ) {
287287
return '"' . $prefix_to_family[ $value['prefix'] ] . '"';
288288
},
289-
'condition' => function( $attrs ) {
289+
'condition' => function ( $attrs ) {
290290
return isset( $attrs['icon'] );
291291
},
292292
),
@@ -301,30 +301,30 @@ private function add_icon( $css ) {
301301
array(
302302
'property' => 'content',
303303
'value' => 'openItemIcon',
304-
'format' => function( $value ) use ( $fa_icons ) {
304+
'format' => function ( $value ) use ( $fa_icons ) {
305305
return '"\\\\' . $fa_icons[ $value['name'] ]['unicode'] . '"';
306306
},
307-
'condition' => function( $attrs ) {
307+
'condition' => function ( $attrs ) {
308308
return isset( $attrs['openItemIcon'] );
309309
},
310310
),
311311
array(
312312
'property' => 'font-weight',
313313
'value' => 'openItemIcon',
314-
'format' => function( $value ) {
314+
'format' => function ( $value ) {
315315
return 'fas' !== $value['prefix'] ? 400 : 900;
316316
},
317-
'condition' => function( $attrs ) {
317+
'condition' => function ( $attrs ) {
318318
return isset( $attrs['openItemIcon'] );
319319
},
320320
),
321321
array(
322322
'property' => 'font-family',
323323
'value' => 'openItemIcon',
324-
'format' => function( $value ) use ( $prefix_to_family ) {
324+
'format' => function ( $value ) use ( $prefix_to_family ) {
325325
return '"' . $prefix_to_family[ $value['prefix'] ] . '"';
326326
},
327-
'condition' => function( $attrs ) {
327+
'condition' => function ( $attrs ) {
328328
return isset( $attrs['openItemIcon'] );
329329
},
330330
),

0 commit comments

Comments
 (0)