• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

Yoast / wordpress-seo / 15936d2b846c322fa3b4b91e32ba3f7c002a45a6

13 May 2025 08:35AM UTC coverage: 58.702% (+0.06%) from 58.644%
15936d2b846c322fa3b4b91e32ba3f7c002a45a6

Pull #22258

github

web-flow
Merge pull request #22254 from Yoast/fix/ai-optimize-woo-upsell

Adds an upsell for AI Optimize on products
Pull Request #22258: Merges the feature branch `feature/ai-optimize-classic` to `trunk`

8175 of 14231 branches covered (57.45%)

Branch coverage included in aggregate %.

37 of 68 new or added lines in 11 files covered. (54.41%)

3 existing lines in 2 files now uncovered.

14070 of 23664 relevant lines covered (59.46%)

100886.47 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

0.0
/packages/js/src/introductions/initialize.js
1
import { dispatch } from "@wordpress/data";
2
import domReady from "@wordpress/dom-ready";
3
import { render } from "@wordpress/element";
4
import { Root } from "@yoast/ui-library";
5
import { get, isEmpty } from "lodash";
6
import { LINK_PARAMS_NAME, PLUGIN_URL_NAME, WISTIA_EMBED_PERMISSION_NAME } from "../shared-admin/store";
7
import { Introduction, IntroductionProvider } from "./components";
8
import { STORE_NAME_INTRODUCTIONS } from "./constants";
9
import { registerStore } from "./store";
10

11
const DATA_NAME = "wpseoIntroductions";
×
12

13
domReady( () => {
×
14
        const initialIntroductions = get( window, `${ DATA_NAME }.introductions`, [] );
×
15

16
        if ( isEmpty( initialIntroductions ) ) {
×
17
                return;
×
18
        }
19

20
        registerStore( {
×
21
                [ LINK_PARAMS_NAME ]: get( window, `${ DATA_NAME }.linkParams`, {} ),
22
                [ PLUGIN_URL_NAME ]: get( window, `${ DATA_NAME }.pluginUrl`, "" ),
23
                [ WISTIA_EMBED_PERMISSION_NAME ]: {
24
                        value: get( window, `${ DATA_NAME }.wistiaEmbedPermission`, false ) === "1",
25
                },
26
        } );
27
        dispatch( STORE_NAME_INTRODUCTIONS ).setIntroductions( initialIntroductions );
×
28

29
        const rootContext = {
×
30
                isRtl: Boolean( get( window, `${ DATA_NAME }.isRtl`, false ) ),
31
        };
NEW
32
        const initialComponents = {};
×
33

34
        const root = document.createElement( "div" );
×
35
        root.id = "wpseo-introductions";
×
36
        document.body.appendChild( root );
×
37

38
        render(
×
39
                (
40
                        <Root context={ rootContext }>
41
                                <IntroductionProvider initialComponents={ initialComponents }>
42
                                        <Introduction />
43
                                </IntroductionProvider>
44
                        </Root>
45
                ),
46
                root
47
        );
48
} );
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc