Skip to content

Commit

Permalink
V3.4.0 (#290)
Browse files Browse the repository at this point in the history
* Fix HPOS compatibility.

* WP 6.4, WC 8.2.

* Do not autoload hcaptcha_login_data option.

* Fix fatal and other errors caused by broken backward compatibility in Ultimate Member 2.7.0.

* Update readme.txt.

* Update tests due to changes in WC 8.2.

* Update yarn to 4.0 and packages.

* Update composer packages.

* Remove unneeded steps from ci.yml.

* Update create-zip.yml.

* Update create-zip.yml.

* Update deploy-to-wp-org.yml.

* Purge hcaptcha_login_data option to keep it small.

* Update readme.txt.

* Fix SystemInfo on multisite.

* Update readme.txt.

* MailPoet integration

* Fix tests.

* MailPoet integration.

* Simple Download Monitor integration.

* Fix missing dependency of wc checkout script.

* Add WP Job Openings integration.

* Fix jest test.

* Add Simple Basic Contact Form Integration.

* Add Easy Digital Downloads Login Form integration.

* WPCS.

* WPCS.

* WPCS.

* Add Easy Digital Downloads Login Form integration.

* Add Easy Digital Downloads Register Form integration.

* Add Easy Digital Downloads Register Form integration.

* ESLint.

* JS security fixes.

* Raise test coverage for CF7 classes to 100%.

* Fix abstraction of Settings classes.

* Fix fatal error occurring during login under some conditions.

* Cover ACF integration by tests.

* Do not show Get Keys notification when keys are entered.

* Add hCaptcha vs Turnstile post link.

* Add hCaptcha vs reCaptcha post link.

* Shuffle notifications.

* Fix disappearing notice-dismiss button after Reset notifications.

* Fix showing all other notifications after dismissing one.

* Fix enqueuing of styles in admin.

* Fix enqueuing of styles in admin.

* Fix sorting of plugins on integrations page.

* Fix unit tests.

* Fix ACFE unit tests.

* Add unit tests for Notifications.php.

* Bump up version.

* Update post links in Notifications.php.

* Fix the inability to send the Divi Contact Form when Divi Email Optin was active.
  • Loading branch information
kagg-design authored Nov 7, 2023
1 parent 23b452b commit 66b4a1e
Show file tree
Hide file tree
Showing 65 changed files with 5,989 additions and 4,089 deletions.
21 changes: 4 additions & 17 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,19 +39,11 @@ jobs:
php-version: ${{ matrix.php-version }}
extensions: json, mysqli, mbstring, zip

- name: Setup Composer caching
- name: Install dependencies with caching
uses: ramsey/composer-install@v2
with:
working-directory: ${{ env.wp-plugin-directory }}

- name: Install dependencies
working-directory: ${{ env.wp-plugin-directory }}
run: |
composer config github-oauth.github.com ${{ secrets.GITHUB_TOKEN }}
composer install
env:
COMPOSER_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Run code sniffer
working-directory: ${{ env.wp-plugin-directory }}
run: composer phpcs
Expand Down Expand Up @@ -101,20 +93,15 @@ jobs:
working-directory: ${{ env.wp-directory }}
run: wp plugin install bbpress buddypress ultimate-member wpforms-lite wpforo

- name: Install plugins requiring 7.1
if: ${{ matrix.php-version >= '7.1' }}
- name: Install plugins requiring 7.2
if: ${{ matrix.php-version >= '7.2' }}
working-directory: ${{ env.wp-directory }}
run: wp plugin install ninja-forms

- name: Install plugins requiring 7.3
if: ${{ matrix.php-version >= '7.3' }}
working-directory: ${{ env.wp-directory }}
run: wp plugin install woocommerce

- name: Install plugins requiring 7.4
if: ${{ matrix.php-version >= '7.4' }}
working-directory: ${{ env.wp-directory }}
run: wp plugin install contact-form-7
run: wp plugin install contact-form-7 woocommerce

- name: Run WP tests
working-directory: ${{ env.wp-plugin-directory }}
Expand Down
11 changes: 5 additions & 6 deletions .github/workflows/create-zip.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,17 +13,16 @@ jobs:
- name: Checkout code
uses: actions/checkout@v3

- name: Setup Composer caching
- name: Install dependencies with caching
uses: ramsey/composer-install@v2
with:
composer-options: "--no-dev --optimize-autoloader --classmap-authoritative"

- name: Install dependencies in prod version
- name: Install packages
run: |
composer config github-oauth.github.com ${{ secrets.GITHUB_TOKEN }}
composer install --no-dev --optimize-autoloader --classmap-authoritative
yarn set version stable
yarn
yarn prod
env:
COMPOSER_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Create zip file
run: |
Expand Down
11 changes: 5 additions & 6 deletions .github/workflows/deploy-to-wp-org.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,17 +15,16 @@ jobs:
- name: Checkout code
uses: actions/checkout@v3

- name: Setup Composer caching
- name: Install dependencies with caching
uses: ramsey/composer-install@v2
with:
composer-options: "--no-dev --optimize-autoloader --classmap-authoritative"

- name: Install dependencies in prod version
- name: Install packages
run: |
composer config github-oauth.github.com ${{ secrets.GITHUB_TOKEN }}
composer install --no-dev --optimize-autoloader --classmap-authoritative
yarn set version stable
yarn
yarn prod
env:
COMPOSER_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: WordPress Plugin Deploy
id: deploy
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ global.jQuery = $;
global.$ = $;

// Import the script you want to test
require( '../../../assets/js/hcaptcha-wc' );
require( '../../../assets/js/hcaptcha-wc-checkout' );

// Simulate jQuery.ready
window.hCaptchaWC( $ );
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,6 @@
use Mockery;
use ReflectionException;
use stdClass;
use tad\FunctionMocker\FunctionMocker;
use function PHPUnit\Framework\assertSame;

/**
* Test Main class.
Expand All @@ -52,7 +50,7 @@
* @group bp
* @group subscriber
*/
class AMainTest extends HCaptchaWPTestCase {
class AAAMainTest extends HCaptchaWPTestCase {

/**
* Included components in test_load_modules().
Expand Down Expand Up @@ -86,6 +84,8 @@ public function tearDown(): void { // phpcs:ignore PHPCompatibility.FunctionDecl

$this->set_protected_property( $hcaptcha, 'loaded_classes', $loaded_classes );

delete_option( 'hcaptcha_settings' );

wp_dequeue_script( 'hcaptcha' );
wp_deregister_script( 'hcaptcha' );

Expand Down Expand Up @@ -449,6 +449,7 @@ public function test_print_inline_styles() {
#wpdiscuz-subscribe-form .h-captcha {
margin-left: auto;
}
div.wpforms-container-full .wpforms-form .h-captcha,
#wpforo #wpforo-wrap div .h-captcha,
.h-captcha {
Expand All @@ -458,54 +459,68 @@ public function test_print_inline_styles() {
padding: 0;
clear: both;
}
#hcaptcha-options .h-captcha {
margin-bottom: 0;
}
#af-wrapper div.editor-row.editor-row-hcaptcha {
display: flex;
flex-direction: row-reverse;
}
#af-wrapper div.editor-row.editor-row-hcaptcha .h-captcha {
margin-bottom: 0;
}
.brz-forms2.brz-forms2__item .h-captcha {
margin-bottom: 0;
}
form.wpsc-create-ticket .h-captcha {
margin: 0 15px 15px 15px;
}
.frm-fluent-form .h-captcha {
line-height: 0;
margin-bottom: 0;
}
.passster-form .h-captcha {
margin-bottom: 5px;
}
#wpforo #wpforo-wrap.wpft-topic div .h-captcha,
#wpforo #wpforo-wrap.wpft-forum div .h-captcha {
margin: 0 -20px;
}
.wpdm-button-area + .h-captcha {
margin-bottom: 1rem;
}
.w3eden .btn-primary {
background-color: var(--color-primary) !important;
color: #fff !important;
}
div.wpforms-container-full .wpforms-form .h-captcha[data-size="normal"],
.h-captcha[data-size="normal"] {
width: 303px;
height: 78px;
}
div.wpforms-container-full .wpforms-form .h-captcha[data-size="compact"],
.h-captcha[data-size="compact"] {
width: 164px;
height: 144px;
}
div.wpforms-container-full .wpforms-form .h-captcha[data-size="invisible"],
.h-captcha[data-size="invisible"] {
display: none;
}
.h-captcha::before {
content: \'\';
display: block;
Expand All @@ -516,49 +531,61 @@ public function test_print_inline_styles() {
border: 1px solid transparent;
border-radius: 4px;
}
.h-captcha[data-size="normal"]::before {
width: 300px;
height: 74px;
background-position: 94% 28%;
}
.h-captcha[data-size="compact"]::before {
width: 156px;
height: 136px;
background-position: 50% 79%;
}
.h-captcha[data-theme="light"]::before {
background-color: #fafafa;
border: 1px solid #e0e0e0;
}
.h-captcha[data-theme="dark"]::before {
background-image: url(' . $div_logo_url_white . ');
background-repeat: no-repeat;
background-color: #333;
border: 1px solid #f5f5f5;
}
.h-captcha[data-size="invisible"]::before {
display: none;
}
div.wpforms-container-full .wpforms-form .h-captcha iframe,
.h-captcha iframe {
position: relative;
}
span[data-name="hcap-cf7"] .h-captcha {
margin-bottom: 0;
}
span[data-name="hcap-cf7"] ~ input[type="submit"],
span[data-name="hcap-cf7"] ~ button[type="submit"] {
margin-top: 2rem;
}
.elementor-field-type-hcaptcha .elementor-field {
background: transparent !important;
}
.elementor-field-type-hcaptcha .h-captcha {
margin-bottom: unset;
}
#wppb-loginform .h-captcha {
margin-bottom: 14px;
}
div[style*="z-index: 2147483647"] div[style*="border-width: 11px"][style*="position: absolute"][style*="pointer-events: none"] {
border-style: none;
}
Expand All @@ -584,6 +611,7 @@ public function test_login_head() {
justify-content: center;
}
}
@media (min-width: 350px) {
#login {
width: 350px;
Expand Down Expand Up @@ -804,23 +832,6 @@ public function dp_test_print_footer_scripts(): array {
];
}

/**
* Test declare_wc_compatibility().
*
* @return void
*/
public function test_declare_wc_compatibility() {
$declare_compatibility = FunctionMocker::replace(
'Automattic\WooCommerce\Utilities\FeaturesUtil::declare_compatibility',
true
);

$subject = new Main();
$subject->declare_wc_compatibility();

$declare_compatibility->wasCalledWithOnce( [ 'custom_order_tables', HCAPTCHA_FILE, true ] );
}

/**
* Test whitelist_ip().
*
Expand Down
Loading

0 comments on commit 66b4a1e

Please sign in to comment.