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

Yoast / wordpress-seo / 2d66c210b3cdb04e0cabd3a27852287fa31a581c

14 May 2024 08:05AM UTC coverage: 53.131% (+0.9%) from 52.242%
2d66c210b3cdb04e0cabd3a27852287fa31a581c

push

github

YoastBot
Bump version to 22.7 on free

7464 of 13622 branches covered (54.79%)

Branch coverage included in aggregate %.

28518 of 54101 relevant lines covered (52.71%)

41520.75 hits per line

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

0.0
/packages/js/src/elementor.js
1
import { dispatch, select } from "@wordpress/data";
2
import { doAction } from "@wordpress/hooks";
3
import initializeWordProofForElementorEditor from "../../../vendor_prefixed/wordproof/wordpress-sdk/resources/js/initializers/elementorEditor";
4
import initializeAiGenerator from "./ai-generator/initialize";
5
import initEditorStore from "./elementor/initializers/editor-store";
6
import initHighlightFocusKeyphraseForms from "./elementor/initializers/highlightFocusKeyphraseForms";
7
import initializeIntroduction from "./elementor/initializers/introduction";
8
import { applyModifications, pluginReady, pluginReloaded, registerModification, registerPlugin } from "./initializers/pluggable";
9
import initializeUsedKeywords from "./elementor/initializers/used-keywords-assessment";
10
import initReplaceVarPlugin, { addReplacement, ReplaceVar } from "./elementor/replaceVars/elementor-replacevar-plugin";
11
import { isWordProofIntegrationActive } from "./helpers/wordproof";
12
import initAnalysis, { collectData } from "./initializers/analysis";
13
import initElementorEditorIntegration from "./initializers/elementor-editor-integration";
14
import initializeInsights from "./insights/initializer";
15
import initElementorWatcher from "./watchers/elementorWatcher";
16
import { registerSearchAppearanceDescriptionMention } from "./shared-admin/helpers/search-appearance-description-mention";
17

18
/* eslint-disable complexity */
19
/**
20
 * Initializes Yoast SEO for Elementor.
21
 *
22
 * @returns {void}
23
 */
24
function initialize() {
25
        // Initialize the editor store and set it on the window.
26
        window.YoastSEO = window.YoastSEO || {};
×
27
        window.YoastSEO.store = initEditorStore();
×
28

29
        // Initialize the editor data watcher.
30
        initElementorWatcher();
×
31

32
        /*
33
         * Expose pluggable.
34
         *
35
         * Note: this is exposed on YoastSEO directly instead of in a pluggable scope.
36
         * This is so we don't have to adapt Premium or plugins.
37
         */
38
        window.YoastSEO.pluginReady = pluginReady;
×
39
        window.YoastSEO.pluginReloaded = pluginReloaded;
×
40
        window.YoastSEO.registerModification = registerModification;
×
41
        window.YoastSEO.registerPlugin = registerPlugin;
×
42
        window.YoastSEO.applyModifications = applyModifications;
×
43

44
        // Initialize analysis.
45
        window.YoastSEO.analysis = window.YoastSEO.analysis || {};
×
46
        window.YoastSEO.analysis.run = dispatch( "yoast-seo/editor" ).runAnalysis;
×
47
        window.YoastSEO.analysis.worker = initAnalysis();
×
48
        window.YoastSEO.analysis.collectData = collectData;
×
49

50
        // Initialize replacement variables plugin.
51
        initReplaceVarPlugin();
×
52
        window.YoastSEO.wp = window.YoastSEO.wp || {};
×
53
        window.YoastSEO.wp.replaceVarsPlugin = {
×
54
                addReplacement,
55
                ReplaceVar,
56
        };
57

58
        // Initialize the Used Keywords Assessment.
59
        initializeUsedKeywords();
×
60

61
        // Initialize insights.
62
        initializeInsights();
×
63

64
        // Initialize focus keyphrase forms highlighting.
65
        initHighlightFocusKeyphraseForms( window.YoastSEO.analysis.worker.runResearch );
×
66

67
        // Initialize the introduction.
68
        initializeIntroduction();
×
69

70
        // Initialize the editor integration.
71
        initElementorEditorIntegration();
×
72

73
        if ( isWordProofIntegrationActive() ) {
×
74
                initializeWordProofForElementorEditor();
×
75
        }
76

77
        const AI_IGNORED_POST_TYPES = [ "attachment", "product" ];
×
78

79
        if ( window.wpseoScriptData.postType && ! AI_IGNORED_POST_TYPES.includes( window.wpseoScriptData.postType ) ) {
×
80
                // Initialize the AI Generator upsell.
81
                initializeAiGenerator();
×
82
        }
83

84
        // Initialize the mentions.
85
        registerSearchAppearanceDescriptionMention( select( "yoast-seo/editor" ).getDateFromSettings );
×
86

87
        // Offer an action after our load.
88
        doAction( "yoast.elementor.loaded" );
×
89
}
90
/* eslint-enable complexity */
91

92
// Wait on `window.elementor`.
93
jQuery( window ).on( "elementor:init", () => {
×
94
        // Wait on Elementor app to have started.
95
        window.elementor.on( "panel:init", () => {
×
96
                setTimeout( initialize );
×
97
        } );
98
} );
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