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

Yoast / wordpress-seo / 4c5f9780cef7c22b7f9bfbace943d71badc638ed

08 Oct 2024 09:39AM UTC coverage: 54.494% (-0.04%) from 54.538%
4c5f9780cef7c22b7f9bfbace943d71badc638ed

push

github

YoastBot
Bump version to 23.6 on free

7502 of 13498 branches covered (55.58%)

Branch coverage included in aggregate %.

29530 of 54458 relevant lines covered (54.23%)

41951.32 hits per line

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

0.0
/packages/js/src/elementor/components/fills/ElementorFill.js
1
// External dependencies.
2
import { Fill } from "@wordpress/components";
3
import { Fragment, useEffect } from "@wordpress/element";
4
import { useSelect } from "@wordpress/data";
5
import { __ } from "@wordpress/i18n";
6
import PropTypes from "prop-types";
7
import { InternalLinkingSuggestionsUpsell } from "../../../components/modals/InternalLinkingSuggestionsUpsell";
8

9
// Internal dependencies.
10
import CollapsibleCornerstone from "../../../containers/CollapsibleCornerstone";
11
import { useFirstEligibleNotification } from "../../../hooks/use-first-eligible-notification";
12
import InsightsModal from "../../../insights/components/insights-modal";
13
import Alert from "../../containers/Alert";
14
import { KeywordInput, ReadabilityAnalysis, SeoAnalysis, InclusiveLanguageAnalysis } from "@yoast/externals/components";
15
import SidebarItem from "../../../components/SidebarItem";
16
import SearchAppearanceModal from "../../../components/modals/editorModals/SearchAppearanceModal";
17
import SocialAppearanceModal from "../../../components/modals/editorModals/SocialAppearanceModal";
18
import PremiumSEOAnalysisModal from "../../../components/modals/PremiumSEOAnalysisModal";
19
import SidebarCollapsible from "../../../components/SidebarCollapsible";
20
import SchemaTabContainer from "../../../containers/SchemaTab";
21
import AdvancedSettings from "../../../containers/AdvancedSettings";
22
import SEMrushRelatedKeyphrases from "../../../containers/SEMrushRelatedKeyphrases";
23
import WincherSEOPerformanceModal from "../../../containers/WincherSEOPerformanceModal";
24
import KeywordUpsell from "../../../components/modals/KeywordUpsell";
25

26
/* eslint-disable complexity */
27
/**
28
 * Creates the ElementorFill component.
29
 *
30
 * @param {Object} props The props.
31
 *
32
 * @returns {wp.Element} The Sidebar component.
33
 *
34
 * @constructor
35
 */
36
export default function ElementorFill( { isLoading, onLoad, settings } ) {
37
        const webinarIntroUrl = useSelect( select => select( "yoast-seo/editor" ).selectLink( "https://yoa.st/webinar-intro-elementor" ), [] );
×
38
        const FirstEligibleNotification = useFirstEligibleNotification( { webinarIntroUrl } );
×
39

40
        useEffect( () => {
×
41
                setTimeout( () => {
×
42
                        if ( isLoading ) {
×
43
                                onLoad();
×
44
                        }
45
                } );
46
        } );
47

48
        if ( isLoading ) {
×
49
                return null;
×
50
        }
51

52
        return (
×
53
                <>
54
                        <Fill name="YoastElementor">
55
                                <SidebarItem renderPriority={ 1 }>
56
                                        <Alert />
57
                                        { FirstEligibleNotification && (
×
58
                                                <div className="yst-inline-block yst-px-1.5">
59
                                                        <FirstEligibleNotification />
60
                                                </div>
61
                                        ) }
62
                                </SidebarItem>
63
                                { settings.isKeywordAnalysisActive && <SidebarItem renderPriority={ 8 }>
×
64
                                        <KeywordInput
65
                                                isSEMrushIntegrationActive={ settings.isSEMrushIntegrationActive }
66
                                        />
67
                                        { ! window.wpseoScriptData.metabox.isPremium && <Fill name="YoastRelatedKeyphrases">
×
68
                                                <SEMrushRelatedKeyphrases />
69
                                        </Fill> }
70
                                </SidebarItem> }
71
                                { settings.isKeywordAnalysisActive && <SidebarItem renderPriority={ 10 }>
×
72
                                        <Fragment>
73
                                                <SeoAnalysis
74
                                                        shouldUpsell={ settings.shouldUpsell }
75
                                                        shouldUpsellWordFormRecognition={ settings.isWordFormRecognitionActive }
76
                                                        shouldUpsellHighlighting={ settings.shouldUpsell }
77
                                                />
78
                                                { settings.shouldUpsell && <PremiumSEOAnalysisModal /> }
×
79
                                        </Fragment>
80
                                </SidebarItem> }
81
                                { settings.isContentAnalysisActive && <SidebarItem renderPriority={ 15 }>
×
82
                                        <ReadabilityAnalysis
83
                                                shouldUpsell={ settings.shouldUpsell }
84
                                                shouldUpsellHighlighting={ settings.shouldUpsell }
85
                                        />
86
                                </SidebarItem> }
87
                                { settings.isInclusiveLanguageAnalysisActive && <SidebarItem renderPriority={ 19 }>
×
88
                                        <InclusiveLanguageAnalysis
89
                                                shouldUpsellHighlighting={ settings.shouldUpsell }
90
                                        />
91
                                </SidebarItem> }
92
                                { settings.isKeywordAnalysisActive && <SidebarItem key="additional-keywords-upsell" renderPriority={ 22 }>
×
93
                                        { settings.shouldUpsell && <KeywordUpsell /> }
×
94
                                </SidebarItem> }
95
                                { settings.isKeywordAnalysisActive && settings.isWincherIntegrationActive &&
×
96
                                        <SidebarItem key="wincher-seo-performance" renderPriority={ 23 }>
97
                                                <WincherSEOPerformanceModal location="sidebar" shouldCloseOnClickOutside={ false } />
98
                                        </SidebarItem> }
99
                                { settings.shouldUpsell && <SidebarItem key="internal-linking-suggestions-upsell" renderPriority={ 24 }>
×
100
                                        <InternalLinkingSuggestionsUpsell />
101
                                </SidebarItem> }
102
                                <SidebarItem renderPriority={ 25 }>
103
                                        <SearchAppearanceModal />
104
                                </SidebarItem>
105
                                { ( settings.useOpenGraphData || settings.useTwitterData ) && <SidebarItem key="social-appearance" renderPriority={ 26 }>
×
106
                                        <SocialAppearanceModal
107
                                                useOpenGraphData={ settings.useOpenGraphData }
108
                                                useTwitterData={ settings.useTwitterData }
109
                                        />
110
                                </SidebarItem> }
111
                                { settings.displaySchemaSettings && <SidebarItem renderPriority={ 28 }>
×
112
                                        <SidebarCollapsible
113
                                                title={ __( "Schema", "wordpress-seo" ) }
114
                                        >
115
                                                <SchemaTabContainer />
116
                                        </SidebarCollapsible>
117
                                </SidebarItem> }
118
                                { settings.displayAdvancedTab && <SidebarItem renderPriority={ 29 }>
×
119
                                        <SidebarCollapsible
120
                                                title={ __( "Advanced", "wordpress-seo" ) }
121
                                                buttonId="yoast-seo-elementor-advanced-button"
122
                                        >
123
                                                <AdvancedSettings location="sidebar" />
124
                                        </SidebarCollapsible>
125
                                </SidebarItem> }
126
                                { settings.isCornerstoneActive && <SidebarItem renderPriority={ 30 }>
×
127
                                        <CollapsibleCornerstone />
128
                                </SidebarItem> }
129
                                { settings.isInsightsEnabled && <SidebarItem renderPriority={ 32 }>
×
130
                                        <InsightsModal location="elementor" />
131
                                </SidebarItem> }
132
                        </Fill>
133
                </>
134
        );
135
}
136

137
ElementorFill.propTypes = {
×
138
        isLoading: PropTypes.bool.isRequired,
139
        onLoad: PropTypes.func.isRequired,
140
        settings: PropTypes.object.isRequired,
141
};
142
/* eslint-enable complexity */
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