Skip to content

Commit 756617f

Browse files
Merge pull request #2374 from Automattic/alpha
Release Mar 27
2 parents 7b54cce + 27c7d6f commit 756617f

File tree

29 files changed

+2212
-321
lines changed

29 files changed

+2212
-321
lines changed

.circleci/config.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
version: 2.1
22

33
orbs:
4-
newspack: adekbadek/newspack@1.4.3
4+
newspack: newspack/newspack@1.4.3
55

66
workflows:
77
version: 2

CHANGELOG.md

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,31 @@
1+
# [1.110.0-alpha.1](https://github.com/Automattic/newspack-plugin/compare/v1.109.0...v1.110.0-alpha.1) (2023-03-24)
2+
3+
4+
### Bug Fixes
5+
6+
* **ads:** proper usage of useEffect cleanup function ([#2335](https://github.com/Automattic/newspack-plugin/issues/2335)) ([58e4c10](https://github.com/Automattic/newspack-plugin/commit/58e4c10c212a294137128071fae5a9463cf3d3e6))
7+
* **cli:** setup config path ([6de5d36](https://github.com/Automattic/newspack-plugin/commit/6de5d3624e17a62da1e2fb1fbb6abac472c866a5))
8+
* **data-events:** mailchimp metadata keys ([#2331](https://github.com/Automattic/newspack-plugin/issues/2331)) ([de82e06](https://github.com/Automattic/newspack-plugin/commit/de82e063c5461354e6b65da2627411022a44b859))
9+
* **modal-checkout:** provide conversion URL for ESP ([feca20d](https://github.com/Automattic/newspack-plugin/commit/feca20df57f483ee5bb159b74a05c3245890a4b7))
10+
* only show perfmatters notice if defaults are used ([bdae0b2](https://github.com/Automattic/newspack-plugin/commit/bdae0b2a452d870579c886b6283289dac4be957a))
11+
* **perfmatters:** add twitter.com to JS delay list ([34bac52](https://github.com/Automattic/newspack-plugin/commit/34bac52e258f1f464e100998e77e9c91bcce858e))
12+
* post-release merge conflict ([3d03cd2](https://github.com/Automattic/newspack-plugin/commit/3d03cd256ef3513596c03c6001f6d6a8c1b769e8))
13+
* show handoff to finish Newspack setup only if setup is incomplete ([#2343](https://github.com/Automattic/newspack-plugin/issues/2343)) ([b0a85ef](https://github.com/Automattic/newspack-plugin/commit/b0a85efe181b33d00ce1b98d93f1bb7d1aee8874))
14+
* toggling settings section ([#2349](https://github.com/Automattic/newspack-plugin/issues/2349)) ([87d5218](https://github.com/Automattic/newspack-plugin/commit/87d5218bc599f38221def09abf5f866fd9894379))
15+
* **webhooks:** endpoint requests modal label ([#2332](https://github.com/Automattic/newspack-plugin/issues/2332)) ([fd99ff2](https://github.com/Automattic/newspack-plugin/commit/fd99ff27ceda43f6fb28b5c57ef398a7b7601905))
16+
* **webhooks:** grid layout ([4aa898f](https://github.com/Automattic/newspack-plugin/commit/4aa898fa1f52cc5ff759d7a7aded79925b973ede))
17+
* **wizards:** broken rendering in WP 6.2 ([a6cef5a](https://github.com/Automattic/newspack-plugin/commit/a6cef5a1f2fc785f31cc2c478ebde7791db1c2f9))
18+
19+
20+
### Features
21+
22+
* add GA4 donation events ([#2326](https://github.com/Automattic/newspack-plugin/issues/2326)) ([a1377a2](https://github.com/Automattic/newspack-plugin/commit/a1377a26300caa8d3eb0eae4afbc5817667ec74a))
23+
* Add GA4 Newsletters subscriptions events ([#2330](https://github.com/Automattic/newspack-plugin/issues/2330)) ([86ffc66](https://github.com/Automattic/newspack-plugin/commit/86ffc66c62492801c57bc06aeb20b9d0ce4e5fb5))
24+
* Add popup events to GA4 ([#2337](https://github.com/Automattic/newspack-plugin/issues/2337)) ([62c738e](https://github.com/Automattic/newspack-plugin/commit/62c738e86c9599ed166b908bd827a3d8d09597b6))
25+
* Add popups donation events ([#2310](https://github.com/Automattic/newspack-plugin/issues/2310)) ([53e0c4a](https://github.com/Automattic/newspack-plugin/commit/53e0c4afdef1a564cd7069ff63f9afeca77327ad))
26+
* **amp-deprecation:** polyfills for amp-img, amp-iframe, amp-fit-text, amp-youtube ([#2308](https://github.com/Automattic/newspack-plugin/issues/2308)) ([7419cd5](https://github.com/Automattic/newspack-plugin/commit/7419cd5977e4a226669f4a23f05e576945bd9bd0))
27+
* **health-check:** mark some plugins as supported ([#2329](https://github.com/Automattic/newspack-plugin/issues/2329)) ([c1774e3](https://github.com/Automattic/newspack-plugin/commit/c1774e3d42bec0f3f51e265613fd5ca84d49c27b))
28+
129
# [1.109.0](https://github.com/Automattic/newspack-plugin/compare/v1.108.0...v1.109.0) (2023-03-24)
230

331

assets/blocks/reader-registration/index.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -413,9 +413,9 @@ function process_form() {
413413
$metadata['current_page_url'] = home_url( add_query_arg( array(), $metadata['referer'] ) );
414414
$metadata['registration_method'] = 'registration-block';
415415

416-
$popup_id = isset( $_REQUEST['newspack_popup_id'] ) ? (int) $_REQUEST['newspack_popup_id'] : false;
416+
$popup_id = isset( $_REQUEST['newspack_popup_id'] ) ? (int) $_REQUEST['newspack_popup_id'] : false;
417+
$metadata['newspack_popup_id'] = $popup_id;
417418
if ( $popup_id ) {
418-
$metadata['newspack_popup_id'] = $popup_id;
419419
$metadata['registration_method'] = 'registration-block-popup';
420420
}
421421

@@ -426,9 +426,9 @@ function process_form() {
426426
*
427427
* @param string $email Email address of the reader.
428428
* @param int|false|\WP_Error $user_id The created user ID in case of registration, false if not created or a WP_Error object.
429-
* @param int|false $popup_id The ID of the popup that triggered the registration, or false if not triggered by a popup.
429+
* @param array $metadata Array with metadata about the user being registered.
430430
*/
431-
\do_action( 'newspack_reader_registration_form_processed', $email, $user_id, $popup_id );
431+
\do_action( 'newspack_reader_registration_form_processed', $email, $user_id, $metadata );
432432

433433
if ( \is_wp_error( $user_id ) ) {
434434
return send_form_response( $user_id );

assets/components/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,8 @@
2424
},
2525
"dependencies": {
2626
"@wordpress/base-styles": "^4.0.0",
27-
"@wordpress/components": "^21.3.0",
28-
"@wordpress/element": "^4.0.1",
27+
"@wordpress/components": "^23.6.0",
28+
"@wordpress/element": "^5.5.0",
2929
"@wordpress/i18n": "^4.2.2",
3030
"@wordpress/icons": "^9.11.0",
3131
"classnames": "^2.3.1",

assets/components/src/plugin-settings/index.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,13 @@ class PluginSettings extends Component {
9090
},
9191
} )
9292
.then( settings => {
93+
this.setState( {
94+
settings: {
95+
...this.state.settings,
96+
[ sectionKey ]: settings[ sectionKey ],
97+
},
98+
error: null,
99+
} );
93100
if ( 'function' === typeof afterUpdate ) {
94101
afterUpdate( settings );
95102
}

assets/wizards/advertising/components/ad-refresh-control/index.js

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -84,14 +84,17 @@ export default function AdRefreshControlSettings() {
8484
const [ inFlight, setInFlight ] = useState( false );
8585
const [ error, setError ] = useState( null );
8686
const [ settings, setSettings ] = useState( null );
87-
useEffect( async () => {
88-
setInFlight( true );
89-
try {
90-
setSettings( await apiFetch( { path: '/newspack-ads/v1/ad-refresh-control' } ) );
91-
} catch ( err ) {
92-
setSettings( null );
93-
}
94-
setInFlight( false );
87+
useEffect( () => {
88+
const fetchSettings = async () => {
89+
setInFlight( true );
90+
try {
91+
setSettings( await apiFetch( { path: '/newspack-ads/v1/ad-refresh-control' } ) );
92+
} catch ( err ) {
93+
setSettings( null );
94+
}
95+
setInFlight( false );
96+
};
97+
fetchSettings();
9598
}, [] );
9699
const handleChange = ( key, value ) => {
97100
setSettings( {

assets/wizards/advertising/views/placements/index.js

Lines changed: 20 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -98,23 +98,26 @@ const Placements = () => {
9898
};
9999

100100
// Fetch placements, providers and bidders.
101-
useEffect( async () => {
102-
setInFlight( true );
103-
await placementsApiFetch( { path: '/newspack-ads/v1/placements' } );
104-
try {
105-
const data = await apiFetch( { path: '/newspack-ads/v1/providers' } );
106-
setProviders( data );
107-
} catch ( err ) {
108-
setError( err );
109-
}
110-
try {
111-
const data = await apiFetch( { path: '/newspack-ads/v1/bidders' } );
112-
setBidders( data );
113-
} catch ( err ) {
114-
setBiddersError( err );
115-
}
116-
setInitialized( true );
117-
setInFlight( false );
101+
useEffect( () => {
102+
const fetchData = async () => {
103+
setInFlight( true );
104+
await placementsApiFetch( { path: '/newspack-ads/v1/placements' } );
105+
try {
106+
const data = await apiFetch( { path: '/newspack-ads/v1/providers' } );
107+
setProviders( data );
108+
} catch ( err ) {
109+
setError( err );
110+
}
111+
try {
112+
const data = await apiFetch( { path: '/newspack-ads/v1/bidders' } );
113+
setBidders( data );
114+
} catch ( err ) {
115+
setBiddersError( err );
116+
}
117+
setInitialized( true );
118+
setInFlight( false );
119+
};
120+
fetchData();
118121
}, [] );
119122

120123
// Silently refetch placements data when exiting edit modal.

assets/wizards/advertising/views/suppression/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ const Suppression = () => {
3030
apiFetch( { path: '/newspack-ads/v1/suppression' } ).then( setConfig );
3131
};
3232
const fetchPostTypes = () => {
33-
return apiFetch( {
33+
apiFetch( {
3434
path: addQueryArgs( '/wp/v2/types', { context: 'edit' } ),
3535
} )
3636
.then( result => {

assets/wizards/connections/views/main/recaptcha.js

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -24,16 +24,19 @@ const Recaptcha = () => {
2424
const [ settings, setSettings ] = useState( {} );
2525
const [ settingsToUpdate, setSettingsToUpdate ] = useState( {} );
2626

27-
// Check the Mailchimp connectivity status.
28-
useEffect( async () => {
29-
setIsLoading( true );
30-
try {
31-
setSettings( await apiFetch( { path: '/newspack/v1/recaptcha' } ) );
32-
} catch ( e ) {
33-
setError( e.message || __( 'Error fetching settings.', 'newspack' ) );
34-
} finally {
35-
setIsLoading( false );
36-
}
27+
// Check the reCAPTCHA connectivity status.
28+
useEffect( () => {
29+
const fetchSettings = async () => {
30+
setIsLoading( true );
31+
try {
32+
setSettings( await apiFetch( { path: '/newspack/v1/recaptcha' } ) );
33+
} catch ( e ) {
34+
setError( e.message || __( 'Error fetching settings.', 'newspack' ) );
35+
} finally {
36+
setIsLoading( false );
37+
}
38+
};
39+
fetchSettings();
3740
}, [] );
3841

3942
const updateSettings = async data => {

assets/wizards/connections/views/main/webhooks.js

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,11 @@ const getDisplayUrl = url => {
3737
return displayUrl;
3838
};
3939

40+
const getEndpointLabel = endpoint => {
41+
const { label, url } = endpoint;
42+
return label || getDisplayUrl( url );
43+
};
44+
4045
const getEndpointTitle = endpoint => {
4146
const { label, url } = endpoint;
4247
return (
@@ -361,7 +366,7 @@ const Webhooks = () => {
361366
{ sprintf(
362367
// translators: %s is the endpoint title (shortened URL).
363368
__( 'Most recent requests for %s', 'newspack' ),
364-
getEndpointTitle( viewing )
369+
getEndpointLabel( viewing )
365370
) }
366371
</p>
367372
{ viewing.requests.length > 0 ? (
@@ -516,7 +521,7 @@ const Webhooks = () => {
516521
'newspack'
517522
) }
518523
</p>
519-
<Grid columns={ 3 } gutter={ 16 }>
524+
<Grid columns={ 2 } gutter={ 16 }>
520525
{ actions.map( ( action, i ) => (
521526
<CheckboxControl
522527
key={ i }

0 commit comments

Comments
 (0)