Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
7535f4a
Run Tests against WordPress 6.9 Beta
n7studios Oct 23, 2025
00202a5
Bump DB version
n7studios Oct 23, 2025
90ff202
Refresh Resources: Improve detection of block editor in 6.9 using wp.…
n7studios Oct 24, 2025
df693e5
Use wp.editPost check to register pre-publish actions
n7studios Oct 24, 2025
1b3284b
JS Coding Standards
n7studios Oct 24, 2025
e10ba93
Merge branch 'improve-block-editor-detection' into test-wp-6.9
n7studios Oct 24, 2025
b21bd1b
Merge branch 'improve-block-editor-detection' into test-wp-6.9
n7studios Oct 24, 2025
9befd61
Merge branch 'improve-block-editor-detection' into test-wp-6.9
n7studios Oct 25, 2025
cdd82eb
Fix Divi Tests
n7studios Oct 27, 2025
c569a4f
Fix Uncode tests
n7studios Oct 27, 2025
c29a1c0
Merge remote-tracking branch 'origin/improve-divi-tests' into test-wp…
n7studios Oct 27, 2025
cc4dbee
Merge remote-tracking branch 'origin/improve-divi-tests' into test-wp…
n7studios Oct 28, 2025
a1fe73d
Merge remote-tracking branch 'origin/improve-divi-tests' into test-wp…
n7studios Oct 28, 2025
2fbc043
Tests: Uncode: Restrict Content: Ignore xdebug errors
n7studios Oct 28, 2025
8718010
Member Content: Product: Display No Access Notice
n7studios Nov 3, 2025
1a9f8a3
Merge branch 'main' into test-wp-6.9
n7studios Nov 3, 2025
78773b5
Run Tests against WordPress 6.9 beta 2
n7studios Nov 3, 2025
a3525a8
Run Coding Standards against WordPress 6.9 beta 2
n7studios Nov 3, 2025
0793992
Tests: Coding Standards: Use `contains` for PHP version check
n7studios Nov 4, 2025
3988f56
Remove typo
n7studios Nov 4, 2025
3af6a7c
Block Editor: Add `convertKitGutenbergEnabled` helper
n7studios Nov 4, 2025
ddb9c95
Merge pull request #946 from Kit/tests-coding-standards-php-version-c…
n7studios Nov 5, 2025
4f4eb07
Merge pull request #945 from Kit/restrict-content-product-no-access-n…
n7studios Nov 5, 2025
ca3c302
Merge pull request #947 from Kit/gutenberg-detection-helper
n7studios Nov 5, 2025
4fcbd2a
Merge pull request #939 from Kit/improve-divi-tests
n7studios Nov 5, 2025
f89d234
Merge pull request #938 from Kit/improve-block-editor-detection
n7studios Nov 5, 2025
d6bba89
3.0.8
n7studios Nov 5, 2025
3eaaedd
Merge pull request #949 from Kit/release-3.0.8
n7studios Nov 5, 2025
565c163
Merge branch 'main' into test-wp-6.9
n7studios Nov 6, 2025
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
6 changes: 3 additions & 3 deletions .github/workflows/coding-standards.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ jobs:
# Defines the WordPress and PHP Versions matrix to run tests on.
strategy:
matrix:
wp-versions: [ 'latest' ] #[ '6.1.1', 'latest' ]
wp-versions: [ '6.9-beta2' ] #[ 'latest', '6.9-beta1' ]
php-versions: [ '7.2', '7.3', '7.4', '8.0', '8.1', '8.2', '8.3', '8.4' ] #[ '7.3', '7.4', '8.0', '8.1' ]

# Steps to install, configure and run tests
Expand Down Expand Up @@ -125,7 +125,7 @@ jobs:
# Run PHP Coding Standards on Tests.
- name: Run WordPress PHP Coding Standards on Tests
working-directory: ${{ env.PLUGIN_DIR }}
if: ${{ matrix.php-versions == '8.1' || matrix.php-versions == '8.2' || matrix.php-versions == '8.3' || matrix.php-versions == '8.4' }}
if: ${{ contains('8.1 8.2 8.3 8.4', matrix.php-versions) }}
run: php vendor/bin/phpcs -q --standard=phpcs.tests.xml --report=checkstyle ./tests | cs2pr

# Run PHP Coding Standards on Plugin.
Expand All @@ -146,5 +146,5 @@ jobs:
# Run PHPStan for static analysis.
- name: Run PHPStan Static Analysis
working-directory: ${{ env.PLUGIN_DIR }}
if: ${{ matrix.php-versions == '8.0' || matrix.php-versions == '8.1' || matrix.php-versions == '8.2' || matrix.php-versions == '8.3' || matrix.php-versions == '8.4' }}
if: ${{ contains('8.0 8.1 8.2 8.3 8.4', matrix.php-versions) }}
run: php vendor/bin/phpstan analyse --memory-limit=1250M
2 changes: 1 addition & 1 deletion .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ jobs:
strategy:
fail-fast: false
matrix:
wp-versions: [ 'latest' ] #[ '6.1.1', 'latest' ]
wp-versions: [ '6.9-beta2' ] #[ 'latest', '6.9-beta1' ]
php-versions: [ '8.1', '8.2', '8.3', '8.4' ] #[ '7.4', '8.0', '8.1' ]

# Folder names within the 'tests' folder to run tests in parallel.
Expand Down
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
### 3.0.8 2025-11-05
* Fix: Member Content: Product: Display 'no access' notice when logged in and no access

### 3.0.7 2025-10-30
* Added: Settings: Improve override description wording to make clearer how it operates
* Fix: Settings: Handle `WP_Error` gracefully when attempting to fetch Kit account information
Expand Down
4 changes: 2 additions & 2 deletions languages/convertkit.pot
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@
# This file is distributed under the GPLv3 or later.
msgid ""
msgstr ""
"Project-Id-Version: Kit (formerly ConvertKit) 3.0.7\n"
"Project-Id-Version: Kit (formerly ConvertKit) 3.0.8\n"
"Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/convertkit\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"POT-Creation-Date: 2025-10-29T15:15:04+00:00\n"
"POT-Creation-Date: 2025-11-05T03:11:47+00:00\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"X-Generator: WP-CLI 2.12.0\n"
"X-Domain: convertkit\n"
Expand Down
5 changes: 4 additions & 1 deletion readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ Tags: email marketing, email newsletter, subscribers, landing page, membership
Requires at least: 5.6
Tested up to: 6.8
Requires PHP: 7.1
Stable tag: 3.0.7
Stable tag: 3.0.8
License: GPLv3 or later
License URI: https://www.gnu.org/licenses/gpl-3.0.html

Expand Down Expand Up @@ -179,6 +179,9 @@ Full Plugin documentation can be found [here](https://help.kit.com/en/articles/2

== Changelog ==

### 3.0.8 2025-11-05
* Fix: Member Content: Product: Display 'no access' notice when logged in and no access

### 3.0.7 2025-10-30
* Added: Settings: Improve override description wording to make clearer how it operates
* Fix: Settings: Handle `WP_Error` gracefully when attempting to fetch Kit account information
Expand Down
2 changes: 1 addition & 1 deletion resources/backend/js/gutenberg-block-formatters.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
// Register Gutenberg Block Toolbar formatters if the Gutenberg Editor is loaded on screen.
// This prevents JS errors if this script is accidentally enqueued on a non-
// Gutenberg editor screen, or the Classic Editor Plugin is active.
if (typeof wp !== 'undefined' && typeof wp.blockEditor !== 'undefined') {
if (convertKitGutenbergEnabled()) {
// Register each ConvertKit formatter in Gutenberg.
for (const formatter in convertkit_block_formatters) {
convertKitGutenbergRegisterBlockFormatter(
Expand Down
16 changes: 15 additions & 1 deletion resources/backend/js/gutenberg.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
// Register Gutenberg Blocks if the Gutenberg Editor is loaded on screen.
// This prevents JS errors if this script is accidentally enqueued on a non-
// Gutenberg editor screen, or the Classic Editor Plugin is active.
if (typeof wp !== 'undefined' && typeof wp.blockEditor !== 'undefined') {
if (convertKitGutenbergEnabled()) {
// Register each ConvertKit Block in Gutenberg.
for (const block in convertkit_blocks) {
convertKitGutenbergRegisterBlock(convertkit_blocks[block]);
Expand Down Expand Up @@ -942,3 +942,17 @@ function convertKitEditingPostInGutenberg() {
// If the user is editing a post in the block editor, wp.editPost will be defined.
return typeof wp !== 'undefined' && typeof wp.editPost !== 'undefined';
}

/**
* Checks if the Gutenberg editor is loaded on screen.
*
* Returns true when editing a Post, Page or Custom Post Type in the block editor,
* or using the site editor.
*
* @since 3.0.8
*
* @return {boolean} Block editor is loaded
*/
function convertKitGutenbergEnabled() {
return typeof wp !== 'undefined' && typeof wp.blockEditor !== 'undefined';
}
Original file line number Diff line number Diff line change
Expand Up @@ -250,6 +250,60 @@ public function testRestrictContentModalByProduct(EndToEndTester $I)
$I->testRestrictedContentModal($I, $url);
}

/**
* Test that restricting content by a Product specified in the Page Settings displays
* an inline error message when the subscriber logged in to view content gated
* by a Kit Form, and then views content gated by a Kit Product where the subscriber does
* not have access to the Product.
*
* @since 3.0.8
*
* @param EndToEndTester $I Tester.
*/
public function testRestrictContentDisplaysNoticeWhenNoAccess(EndToEndTester $I)
{
// Setup Kit Plugin.
$I->setupKitPlugin($I);

// Add a Page using the Gutenberg editor.
$I->addGutenbergPage(
$I,
title: 'Kit: Page: Restrict Content: Product: No Access'
);

// Configure metabox's Restrict Content setting = Product name.
$I->configureMetaboxSettings(
$I,
metabox: 'wp-convertkit-meta-box',
configuration: [
'form' => [ 'select2', 'None' ],
'restrict_content' => [ 'select2', $_ENV['CONVERTKIT_API_PRODUCT_NAME'] ],
]
);

// Add blocks.
$I->addGutenbergParagraphBlock($I, 'Visible content.');
$I->addGutenbergBlock(
$I,
blockName: 'More',
blockProgrammaticName: 'more'
);
$I->addGutenbergParagraphBlock($I, 'Member-only content.');

// Publish Page.
$url = $I->publishGutenbergPage($I);

// Set cookie with signed subscriber ID, as if we logged in before to e.g. content gated by a Kit Form.
$I->setRestrictContentCookieAndReload($I, $_ENV['CONVERTKIT_API_SIGNED_SUBSCRIBER_ID_NO_ACCESS'], $url);

// View page.
$I->amOnUrl($url);

// Confirm an inline error message is displayed.
$options = $I->getRestrictedContentOptionsWithDefaultsMerged();
$I->seeRestrictContentError($I, $options['settings']['no_access_text']);
}

/**
* Test that restricting content by a Product that does not exist does not output
* a fatal error and instead displays all of the Page's content.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,9 @@ public function testRestrictContentByProductWithUncodeThemeAndVisualComposer(End
options: [
'visible_content' => '',
'member_content' => 'Member-only content.',
]
],
// Don't check for warnings and notices, as Uncode uses deprecated functions which WordPress 6.9 warn about.
checkNoWarningsAndNotices: false
);

// Deactivate Uncode theme and Plugins.
Expand Down Expand Up @@ -131,7 +133,9 @@ public function testRestrictContentByProductWithUncodeTheme(EndToEndTester $I)
options: [
'visible_content' => '',
'member_content' => 'Member-only content.',
]
],
// Don't check for warnings and notices, as Uncode uses deprecated functions which WordPress 6.9 warn about.
checkNoWarningsAndNotices: false
);

// Deactivate Uncode theme and Plugins.
Expand Down
4 changes: 2 additions & 2 deletions tests/Support/Data/dump.sql
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ INSERT INTO `wp_options` (`option_id`, `option_name`, `option_value`, `autoload`
(43, 'html_type', 'text/html', 'on'),
(44, 'use_trackback', '0', 'on'),
(45, 'default_role', 'subscriber', 'on'),
(46, 'db_version', '60421', 'on'),
(46, 'db_version', '60717', 'on'),
(47, 'uploads_use_yearmonth_folders', '1', 'on'),
(48, 'upload_path', '', 'on'),
(49, 'blog_public', '1', 'on'),
Expand Down Expand Up @@ -208,7 +208,7 @@ INSERT INTO `wp_options` (`option_id`, `option_name`, `option_value`, `autoload`
(96, 'auto_update_core_minor', 'enabled', 'on'),
(97, 'auto_update_core_major', 'enabled', 'on'),
(98, 'wp_force_deactivated_plugins', 'a:0:{}', 'on'),
(99, 'initial_db_version', '60421', 'on'),
(99, 'initial_db_version', '60717', 'on'),
(100, 'wp_user_roles', 'a:5:{s:13:\"administrator\";a:2:{s:4:\"name\";s:13:\"Administrator\";s:12:\"capabilities\";a:61:{s:13:\"switch_themes\";b:1;s:11:\"edit_themes\";b:1;s:16:\"activate_plugins\";b:1;s:12:\"edit_plugins\";b:1;s:10:\"edit_users\";b:1;s:10:\"edit_files\";b:1;s:14:\"manage_options\";b:1;s:17:\"moderate_comments\";b:1;s:17:\"manage_categories\";b:1;s:12:\"manage_links\";b:1;s:12:\"upload_files\";b:1;s:6:\"import\";b:1;s:15:\"unfiltered_html\";b:1;s:10:\"edit_posts\";b:1;s:17:\"edit_others_posts\";b:1;s:20:\"edit_published_posts\";b:1;s:13:\"publish_posts\";b:1;s:10:\"edit_pages\";b:1;s:4:\"read\";b:1;s:8:\"level_10\";b:1;s:7:\"level_9\";b:1;s:7:\"level_8\";b:1;s:7:\"level_7\";b:1;s:7:\"level_6\";b:1;s:7:\"level_5\";b:1;s:7:\"level_4\";b:1;s:7:\"level_3\";b:1;s:7:\"level_2\";b:1;s:7:\"level_1\";b:1;s:7:\"level_0\";b:1;s:17:\"edit_others_pages\";b:1;s:20:\"edit_published_pages\";b:1;s:13:\"publish_pages\";b:1;s:12:\"delete_pages\";b:1;s:19:\"delete_others_pages\";b:1;s:22:\"delete_published_pages\";b:1;s:12:\"delete_posts\";b:1;s:19:\"delete_others_posts\";b:1;s:22:\"delete_published_posts\";b:1;s:20:\"delete_private_posts\";b:1;s:18:\"edit_private_posts\";b:1;s:18:\"read_private_posts\";b:1;s:20:\"delete_private_pages\";b:1;s:18:\"edit_private_pages\";b:1;s:18:\"read_private_pages\";b:1;s:12:\"delete_users\";b:1;s:12:\"create_users\";b:1;s:17:\"unfiltered_upload\";b:1;s:14:\"edit_dashboard\";b:1;s:14:\"update_plugins\";b:1;s:14:\"delete_plugins\";b:1;s:15:\"install_plugins\";b:1;s:13:\"update_themes\";b:1;s:14:\"install_themes\";b:1;s:11:\"update_core\";b:1;s:10:\"list_users\";b:1;s:12:\"remove_users\";b:1;s:13:\"promote_users\";b:1;s:18:\"edit_theme_options\";b:1;s:13:\"delete_themes\";b:1;s:6:\"export\";b:1;}}s:6:\"editor\";a:2:{s:4:\"name\";s:6:\"Editor\";s:12:\"capabilities\";a:34:{s:17:\"moderate_comments\";b:1;s:17:\"manage_categories\";b:1;s:12:\"manage_links\";b:1;s:12:\"upload_files\";b:1;s:15:\"unfiltered_html\";b:1;s:10:\"edit_posts\";b:1;s:17:\"edit_others_posts\";b:1;s:20:\"edit_published_posts\";b:1;s:13:\"publish_posts\";b:1;s:10:\"edit_pages\";b:1;s:4:\"read\";b:1;s:7:\"level_7\";b:1;s:7:\"level_6\";b:1;s:7:\"level_5\";b:1;s:7:\"level_4\";b:1;s:7:\"level_3\";b:1;s:7:\"level_2\";b:1;s:7:\"level_1\";b:1;s:7:\"level_0\";b:1;s:17:\"edit_others_pages\";b:1;s:20:\"edit_published_pages\";b:1;s:13:\"publish_pages\";b:1;s:12:\"delete_pages\";b:1;s:19:\"delete_others_pages\";b:1;s:22:\"delete_published_pages\";b:1;s:12:\"delete_posts\";b:1;s:19:\"delete_others_posts\";b:1;s:22:\"delete_published_posts\";b:1;s:20:\"delete_private_posts\";b:1;s:18:\"edit_private_posts\";b:1;s:18:\"read_private_posts\";b:1;s:20:\"delete_private_pages\";b:1;s:18:\"edit_private_pages\";b:1;s:18:\"read_private_pages\";b:1;}}s:6:\"author\";a:2:{s:4:\"name\";s:6:\"Author\";s:12:\"capabilities\";a:10:{s:12:\"upload_files\";b:1;s:10:\"edit_posts\";b:1;s:20:\"edit_published_posts\";b:1;s:13:\"publish_posts\";b:1;s:4:\"read\";b:1;s:7:\"level_2\";b:1;s:7:\"level_1\";b:1;s:7:\"level_0\";b:1;s:12:\"delete_posts\";b:1;s:22:\"delete_published_posts\";b:1;}}s:11:\"contributor\";a:2:{s:4:\"name\";s:11:\"Contributor\";s:12:\"capabilities\";a:5:{s:10:\"edit_posts\";b:1;s:4:\"read\";b:1;s:7:\"level_1\";b:1;s:7:\"level_0\";b:1;s:12:\"delete_posts\";b:1;}}s:10:\"subscriber\";a:2:{s:4:\"name\";s:10:\"Subscriber\";s:12:\"capabilities\";a:2:{s:4:\"read\";b:1;s:7:\"level_0\";b:1;}}}', 'on'),
(101, 'fresh_site', '1', 'on'),
(102, 'user_count', '1', 'off'),
Expand Down
37 changes: 22 additions & 15 deletions tests/Support/Helper/KitRestrictContent.php
Original file line number Diff line number Diff line change
Expand Up @@ -193,8 +193,9 @@ public function createRestrictedContentPage($I, $options = false)
* @type string $member_content Content that should only be available to authenticated subscribers.
* @type array $settings Restrict content settings. If not defined, uses expected defaults.
* }
* @param bool $checkNoWarningsAndNotices Whether to check for errors.
*/
public function testRestrictedContentByProductOnFrontend($I, $urlOrPageID, $options = false)
public function testRestrictedContentByProductOnFrontend($I, $urlOrPageID, $options = false, $checkNoWarningsAndNotices = true)
{
// Setup test.
$options = $this->setupRestrictContentTest($I, $options, $urlOrPageID);
Expand All @@ -203,7 +204,7 @@ public function testRestrictedContentByProductOnFrontend($I, $urlOrPageID, $opti
$I->seeInSource('<link rel="stylesheet" id="convertkit-restrict-content-css" href="' . $_ENV['WORDPRESS_URL'] . '/wp-content/plugins/convertkit/resources/frontend/css/restrict-content.css');

// Check content is not displayed, and CTA displays with expected text.
$this->testRestrictContentByProductHidesContentWithCTA($I, $options);
$this->testRestrictContentByProductHidesContentWithCTA($I, $options, $checkNoWarningsAndNotices);

// Login as a Kit subscriber who does not exist in Kit.
$this->loginToRestrictContentWithEmail($I, 'fail@kit.com');
Expand All @@ -212,7 +213,7 @@ public function testRestrictedContentByProductOnFrontend($I, $urlOrPageID, $opti
$this->seeRestrictContentError($I, 'invalid: Email address is invalid');

// Check content is not displayed, and CTA displays with expected text.
$this->testRestrictContentByProductHidesContentWithCTA($I, $options);
$this->testRestrictContentByProductHidesContentWithCTA($I, $options, $checkNoWarningsAndNotices);

// Set cookie with signed subscriber ID and reload the restricted content page, as if we entered the
// code sent in the email as a Kit subscriber who has not subscribed to the product.
Expand All @@ -222,7 +223,7 @@ public function testRestrictedContentByProductOnFrontend($I, $urlOrPageID, $opti
$this->seeRestrictContentError($I, $options['settings']['no_access_text']);

// Check content is not displayed, and CTA displays with expected text.
$this->testRestrictContentByProductHidesContentWithCTA($I, $options);
$this->testRestrictContentByProductHidesContentWithCTA($I, $options, $checkNoWarningsAndNotices);

// Login as a Kit subscriber who has subscribed to the product.
$this->loginToRestrictContentWithEmail($I, $_ENV['CONVERTKIT_API_SUBSCRIBER_EMAIL']);
Expand All @@ -248,7 +249,7 @@ public function testRestrictedContentByProductOnFrontend($I, $urlOrPageID, $opti
// Test that the restricted content displays when a valid signed subscriber ID is used,
// as if we entered the code sent in the email.
$this->setRestrictContentCookieAndReload($I, $_ENV['CONVERTKIT_API_SIGNED_SUBSCRIBER_ID'], $urlOrPageID);
$this->testRestrictContentDisplaysContent($I, $options);
$this->testRestrictContentDisplaysContent($I, $options, $checkNoWarningsAndNotices);
}

/**
Expand Down Expand Up @@ -618,14 +619,17 @@ public function testRestrictedContentModal($I, $urlOrPageID, $options = false)
* @type string $member_content Content that should only be available to authenticated subscribers.
* @type array $settings Restrict content settings. If not defined, uses expected defaults.
* }
* @param bool $checkNoWarningsAndNotices Whether to check for errors.
*/
public function testRestrictContentByProductHidesContentWithCTA($I, $options = false)
public function testRestrictContentByProductHidesContentWithCTA($I, $options = false, $checkNoWarningsAndNotices = true)
{
// Merge options with defaults.
$options = $this->_getRestrictedContentOptionsWithDefaultsMerged($options);
$options = $this->getRestrictedContentOptionsWithDefaultsMerged($options);

// Check that no PHP warnings or notices were output.
$I->checkNoWarningsAndNoticesOnScreen($I);
if ($checkNoWarningsAndNotices) {
$I->checkNoWarningsAndNoticesOnScreen($I);
}

// Confirm that the visible text displays, hidden text does not display and the CTA displays.
if ( ! empty($options['visible_content'])) {
Expand Down Expand Up @@ -671,7 +675,7 @@ public function testRestrictContentByProductHidesContentWithCTA($I, $options = f
public function testRestrictContentByTagHidesContentWithCTA($I, $options = false, $testRecaptcha = false)
{
// Merge options with defaults.
$options = $this->_getRestrictedContentOptionsWithDefaultsMerged($options);
$options = $this->getRestrictedContentOptionsWithDefaultsMerged($options);

// Check that no PHP warnings or notices were output.
$I->checkNoWarningsAndNoticesOnScreen($I);
Expand Down Expand Up @@ -710,7 +714,7 @@ public function testRestrictContentByTagHidesContentWithCTA($I, $options = false
public function testRestrictContentByFormHidesContentWithCTA($I, $formID, $options = false)
{
// Merge options with defaults.
$options = $this->_getRestrictedContentOptionsWithDefaultsMerged($options);
$options = $this->getRestrictedContentOptionsWithDefaultsMerged($options);

// Check that no PHP warnings or notices were output.
$I->checkNoWarningsAndNoticesOnScreen($I);
Expand Down Expand Up @@ -750,14 +754,17 @@ public function testRestrictContentByFormHidesContentWithCTA($I, $formID, $optio
* @type string $member_content Content that should only be available to authenticated subscribers.
* @type array $settings Restrict content settings. If not defined, uses expected defaults.
* }
* @param bool $checkNoWarningsAndNotices Whether to check for errors.
*/
public function testRestrictContentDisplaysContent($I, $options = false)
public function testRestrictContentDisplaysContent($I, $options = false, $checkNoWarningsAndNotices = true)
{
// Merge options with defaults.
$options = $this->_getRestrictedContentOptionsWithDefaultsMerged($options);
$options = $this->getRestrictedContentOptionsWithDefaultsMerged($options);

// Check that no PHP warnings or notices were output.
$I->checkNoWarningsAndNoticesOnScreen($I);
if ($checkNoWarningsAndNotices) {
$I->checkNoWarningsAndNoticesOnScreen($I);
}

// Confirm that the visible and hidden text displays.
if ( ! empty($options['visible_content'])) {
Expand Down Expand Up @@ -789,7 +796,7 @@ public function testRestrictContentDisplaysContent($I, $options = false)
public function setupRestrictContentTest($I, $options, $urlOrPageID)
{
// Merge options with defaults.
$options = $this->_getRestrictedContentOptionsWithDefaultsMerged($options);
$options = $this->getRestrictedContentOptionsWithDefaultsMerged($options);

// Clear any existing cookie from a previous test and reload.
$I->clearRestrictContentCookie($I);
Expand Down Expand Up @@ -952,7 +959,7 @@ public function clearRestrictContentCookie($I)
* @type array $settings Restrict content settings. If not defined, uses expected defaults.
* }
*/
private function _getRestrictedContentOptionsWithDefaultsMerged($options = false)
public function getRestrictedContentOptionsWithDefaultsMerged($options = false)
{
// Define default options for Restrict Content tests.
$defaults = [
Expand Down
3 changes: 3 additions & 0 deletions views/frontend/restrict-content/product.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,5 +22,8 @@

// Output a login link or form, if require login enabled.
require 'login.php';

// Output notices.
require 'notices.php';
?>
</div>
Loading
Loading