Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions .github/workflows/cs-lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -62,9 +62,9 @@ jobs:
xml-schema-file: ./vendor/phpunit/phpunit/phpunit.xsd

# Check the code-style consistency of the PHP files.
# - name: Check PHP code style
# continue-on-error: true
# run: vendor/bin/phpcs --report-full --report-checkstyle=./phpcs-report.xml
- name: Check PHP code style
continue-on-error: true

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As this solves all CS violations, then I would remove this line, so that any changes (either from adjusted code, or fresher versions of PHPCS-related dependencies) get highlighted.

Suggested change
continue-on-error: true

run: vendor/bin/phpcs --report-full --report-checkstyle=./phpcs-report.xml

# - name: Show PHPCS results in PR
# run: cs2pr ./phpcs-report.xml
- name: Show PHPCS results in PR
run: cs2pr ./phpcs-report.xml
85 changes: 0 additions & 85 deletions .github/workflows/integrations.yml

This file was deleted.

40 changes: 24 additions & 16 deletions cheeztest-examples.php
Original file line number Diff line number Diff line change
@@ -1,29 +1,36 @@
<?php
// Here is an example test that you can use to get started.

// This test creates a test and a control group.
// The test group will get 30% of qualified users.
// The control group will get the remaining 70%.
/**
* An example test that you can use to get started.
*
* This test creates a test and a control group.
* The test group will get 30% of qualified users.
* The control group will get the remaining 70%.
*
* @package CheezTest
*/

// phpcs:ignore WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedVariableFound
$chrome_test = new CheezTest(
array(
'name' => 'chrome-ab',
'groups' => array(
'active' => array(
'name' => 'chrome-ab',
'groups' => array(
'active' => array(
'threshold' => 30,
),
'control' => array(
'threshold' => 70,
)
),
),
'is_qualified' => 'return stripos( $_SERVER[ "HTTP_USER_AGENT" ], "Chrome" ) !== false;'
'is_qualified' => 'return stripos( $_SERVER[ "HTTP_USER_AGENT" ], "Chrome" ) !== false;',
)
);

// This will display a fixed position bar at the bottom of the screen to users in the test condition (i.e. 30% of Chrome users)
// This will display a fixed position bar at the bottom of the screen to users in the test condition (i.e. 30% of Chrome users).
if ( CheezTest::is_in_group( 'chrome-ab', 'active' ) ) {
add_action( 'wp_footer', function() {
?>
add_action(
'wp_footer',
function() {
?>
<div id="ab-chrome-bar">
<span>Howdy, Chrome user!</span>
</div>
Expand All @@ -44,6 +51,7 @@
line-height: 28px;
}
</style>
<?php
} );
}
<?php
}
);
}
Loading