Skip to content

Commit 0695ba1

Browse files
authored
release: fixes
- Updated dependencies - Fixed early textdomain loading issue
2 parents 239efd0 + 678642c commit 0695ba1

File tree

8 files changed

+47
-62
lines changed

8 files changed

+47
-62
lines changed

.github/workflows/create-build-zip.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ jobs:
2525
run: |
2626
echo "::set-output name=dir::$(composer config cache-files-dir)"
2727
- name: Configure Composer cache
28-
uses: actions/cache@v1
28+
uses: actions/cache@v4
2929
with:
3030
path: ${{ steps.composer-cache.outputs.dir }}
3131
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}

.github/workflows/deploy-s3-store.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@ jobs:
1212
- uses: actions/checkout@master
1313
- name: Setup node 14
1414
uses: actions/setup-node@v1
15-
with:
16-
node-version: 14.x
15+
with:
16+
node-version: 14.x
1717
- name: Build & create dist/artifact
1818
run: |
1919
yarn install --frozen-lockfile

.github/workflows/test-js.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ jobs:
2222
- name: Get yarn cache directory path
2323
id: yarn-cache-dir-path
2424
run: echo "::set-output name=dir::$(yarn cache dir)"
25-
- uses: actions/cache@v2
25+
- uses: actions/cache@v4
2626
id: yarn-cache
2727
with:
2828
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
@@ -34,4 +34,4 @@ jobs:
3434
- name: Build source
3535
run: yarn run build
3636
- name: Run lint checks
37-
run: yarn run lint
37+
run: yarn run lint

.github/workflows/test-php.yml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,17 +3,17 @@ name: Test PHP
33
on:
44
push:
55
branches-ignore:
6-
- 'master'
6+
- "master"
77

88
jobs:
99
phplint:
1010
name: Phplint
11-
runs-on: ubuntu-latest
11+
runs-on: ubuntu-22.04
1212
steps:
1313
- name: Setup PHP version
1414
uses: shivammathur/setup-php@v2
1515
with:
16-
php-version: '7.2'
16+
php-version: "7.2"
1717
extensions: simplexml
1818
- name: Checkout source code
1919
uses: actions/checkout@v2
@@ -22,7 +22,7 @@ jobs:
2222
run: |
2323
echo "::set-output name=dir::$(composer config cache-files-dir)"
2424
- name: Setup Composer cache
25-
uses: actions/cache@v1
25+
uses: actions/cache@v4
2626
with:
2727
path: ${{ steps.composer-cache.outputs.dir }}
2828
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
@@ -34,7 +34,7 @@ jobs:
3434
run: composer run lint
3535
phpunit:
3636
name: Phpunit
37-
runs-on: ubuntu-latest
37+
runs-on: ubuntu-22.04
3838
services:
3939
mysql:
4040
image: mysql:5.7
@@ -47,7 +47,7 @@ jobs:
4747
- name: Setup PHP version
4848
uses: shivammathur/setup-php@v2
4949
with:
50-
php-version: '7.2'
50+
php-version: "7.2"
5151
extensions: simplexml, mysql
5252
tools: phpunit-polyfills
5353
- name: Checkout source code
@@ -60,7 +60,7 @@ jobs:
6060
run: |
6161
echo "::set-output name=dir::$(composer config cache-files-dir)"
6262
- name: Setup Composer cache
63-
uses: actions/cache@v1
63+
uses: actions/cache@v4
6464
with:
6565
path: ${{ steps.composer-cache.outputs.dir }}
6666
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
@@ -69,4 +69,4 @@ jobs:
6969
- name: Install composer
7070
run: composer install --prefer-dist --no-progress --no-suggest
7171
- name: Run phpunit
72-
run: composer run-script phpunit
72+
run: composer run-script phpunit

composer.lock

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

functions.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,7 @@ function define_constants() {
7171
define( 'JAXON_DEBUG', defined( 'WP_DEBUG' ) && WP_DEBUG === true );
7272
define( 'JAXON_DIR', trailingslashit( get_template_directory() ) );
7373
define( 'JAXON_URL', trailingslashit( get_template_directory_uri() ) );
74+
define( 'JAXON_PRODUCT_SLUG', basename( JAXON_DIR ) );
7475
}
7576

7677
/**

inc/Admin.php

Lines changed: 25 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ public function setup_admin_hooks() {
3333
add_action( 'admin_notices', array( $this, 'render_welcome_notice' ), 0 );
3434
add_action( 'wp_ajax_jaxon_dismiss_welcome_notice', array( $this, 'remove_welcome_notice' ) );
3535
add_action( 'wp_ajax_jaxon_set_otter_ref', array( $this, 'set_otter_ref' ) );
36-
add_action( 'admin_print_scripts', array( $this, 'add_nps_form' ) );
36+
add_action( 'admin_enqueue_scripts', array( $this, 'register_internal_page' ) );
3737

3838
add_action( 'enqueue_block_editor_assets', array( $this, 'add_fse_design_pack_notice' ) );
3939
add_action( 'wp_ajax_jaxon_dismiss_design_pack_notice', array( $this, 'remove_design_pack_notice' ) );
@@ -307,50 +307,35 @@ private function get_otter_status(): string {
307307
}
308308

309309
/**
310-
* Add NPS form.
310+
* Register internal pages.
311311
*
312312
* @return void
313313
*/
314-
public function add_nps_form() {
314+
public function register_internal_page() {
315315
$screen = get_current_screen();
316-
317-
if ( current_user_can( 'manage_options' ) && ( 'dashboard' === $screen->id || 'themes' === $screen->id ) ) {
318-
$website_url = preg_replace( '/[^a-zA-Z0-9]+/', '', get_site_url() );
319-
320-
$config = array(
321-
'environmentId' => 'clr7jjqypey8v8up0bg5lk2nw',
322-
'apiHost' => 'https://app.formbricks.com',
323-
'userId' => 'jaxon_' . $website_url,
324-
'attributes' => array(
325-
'days_since_install' => self::convert_to_category( round( ( time() - get_option( 'jaxon_install', time() ) ) / DAY_IN_SECONDS ) ),
326-
),
327-
);
328-
329-
echo '<script type="text/javascript">!function(){var t=document.createElement("script");t.type="text/javascript",t.async=!0,t.src="https://unpkg.com/@formbricks/js@^1.6.5/dist/index.umd.js";var e=document.getElementsByTagName("script")[0];e.parentNode.insertBefore(t,e),setTimeout(function(){window.formbricks.init(' . wp_json_encode( $config ) . ')},500)}();</script>';
316+
317+
if ( ! current_user_can( 'manage_options' ) || ( 'dashboard' !== $screen->id && 'themes' !== $screen->id ) ) {
318+
return;
330319
}
331-
}
320+
321+
add_filter(
322+
'themeisle-sdk/survey/' . JAXON_PRODUCT_SLUG,
323+
function( $data, $page_slug ) {
324+
$install_days_number = intval( ( time() - get_option( 'jaxon_install', time() ) ) / DAY_IN_SECONDS );
325+
326+
$data = array(
327+
'environmentId' => 'clr7jjqypey8v8up0bg5lk2nw',
328+
'attributes' => array(
329+
'install_days_number' => $install_days_number,
330+
'version' => JAXON_VERSION,
331+
),
332+
);
332333

333-
/**
334-
* Convert a number to a category.
335-
*
336-
* @param int $number Number to convert.
337-
* @param int $scale Scale.
338-
*
339-
* @return int
340-
*/
341-
public static function convert_to_category( $number, $scale = 1 ) {
342-
$normalized_number = intval( round( $number / $scale ) );
343-
344-
if ( 0 === $normalized_number || 1 === $normalized_number ) {
345-
return 0;
346-
} elseif ( $normalized_number > 1 && $normalized_number < 8 ) {
347-
return 7;
348-
} elseif ( $normalized_number >= 8 && $normalized_number < 31 ) {
349-
return 30;
350-
} elseif ( $normalized_number > 30 && $normalized_number < 90 ) {
351-
return 90;
352-
} elseif ( $normalized_number > 90 ) {
353-
return 91;
354-
}
334+
return $data;
335+
},
336+
10,
337+
2
338+
);
339+
do_action( 'themeisle_internal_page', JAXON_PRODUCT_SLUG, $screen->id );
355340
}
356341
}

inc/Block_Patterns.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,6 @@ class Block_Patterns {
3737
* Block_Patterns constructor.
3838
*/
3939
public function __construct() {
40-
$this->setup_properties();
41-
4240
add_action( 'init', array( $this, 'run' ) );
4341
}
4442

@@ -48,6 +46,7 @@ public function __construct() {
4846
* @return void
4947
*/
5048
public function run() {
49+
$this->setup_properties();
5150
$this->register_categories();
5251
$this->register_patterns();
5352
}

0 commit comments

Comments
 (0)