Skip to content

Commit

Permalink
Merge branch 'main' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
arielk authored May 26, 2024
2 parents c8feced + f596ca3 commit 1f003ff
Show file tree
Hide file tree
Showing 332 changed files with 13,561 additions and 3,396 deletions.
15 changes: 15 additions & 0 deletions .github/SECURITY.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# Security Policy

<a href="https://elementor.com/?utm_source=github-repo&utm_medium=link&utm_campaign=contribution">![logo](https://user-images.githubusercontent.com/1778512/191041718-728d179e-07cb-4cb4-953a-6c294ee8c4db.png)</a>

## How to report Security Issues

Security is paramount at Elementor. If you discover a security vulnerability, we want to hear about it right away, and we appreciate your help in disclosing it to us in a coordinated and responsible manner. For this reason, we run community-driven [Managed Security Bug Bounty programs](https://elemn.to/gh-to-bounty-programs).

We leverage the collective expertise of our community, offering round-the-clock crowdsourced vulnerability detection. These programs provide a comprehensive overview of features and endpoints considered 'in scope,' reward specifics where relevant, and our complete terms and conditions.

### Please do not report security issues on GitHub

Join our [Managed Security Bug Bounty programs](https://elemn.to/gh-to-bounty-programs) instead and help us maintain Elementor, a secure software, responsibly.

**To learn more about our security efforts and how to contact us for security inquiries, please visit our [Trust Center](https://elemn.to/gh-to-trust-center).**
30 changes: 29 additions & 1 deletion .github/workflows/playwright.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ name: Playwright

on:
pull_request:
schedule:
- cron: '30 08 * * 0,1,2,3,4,5'
workflow_dispatch:
inputs:
reporter:
Expand Down Expand Up @@ -88,7 +90,11 @@ jobs:
- name: Install WordPress environment
run: |
npm run start-local-server
npm run test:setup:playwright
- name: Update wordpress to nightly build
if: ${{ github.event_name == 'schedule' }}
run: npx wp-env run cli wp core update https://wordpress.org/nightly-builds/wordpress-latest.zip
- name: Setup test data
run: npm run test:setup:playwright
- name: WordPress debug information
run: |
npx wp-env run cli wp core version
Expand Down Expand Up @@ -123,6 +129,28 @@ jobs:
steps:
- name: Test status
run: echo "Test status is - ${{ needs.Playwright.result }}"
- name: Checkout source code
if: ${{ needs.Playwright.result == 'failure' && github.event_name == 'schedule' }}
uses: actions/checkout@v4
- name: Send slack message
if: ${{ needs.Playwright.result == 'failure' && github.event_name == 'schedule' }}
uses: ./.github/workflows/post-to-slack
with:
SLACK_BOT_TOKEN: ${{ secrets.SLACK_TOKEN }}
SLACK_TAG_CHANNELS: ${{ secrets.TEST_AUTOMATION_RESULTS }}
PAYLOAD: |
{
"text": "Elementor Core: Playwright with WordPress nightly has failed: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}",
"blocks": [
{
"type": "section",
"text": {
"type": "mrkdwn",
"text": "Elementor Core: Playwright with WordPress nightly failed: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}"
}
}
]
}
- name: Check Playwright matrix status
if: ${{ needs.Playwright.result != 'success' && needs.Playwright.result != 'skipped' }}
run: exit 1
1 change: 1 addition & 0 deletions .grunt-config/webpack.js
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,7 @@ const entry = {
'admin-notifications': path.resolve( __dirname, '../modules/notifications/assets/js/admin.js' ),
'editor-notifications': path.resolve( __dirname, '../modules/notifications/assets/js/editor.js' ),
'ai-layout': path.resolve( __dirname, '../modules/ai/assets/js/editor/layout-module.js' ),
'ai-gutenberg': path.resolve( __dirname, '../modules/ai/assets/js/gutenberg/index.js' ),
'element-manager-admin': path.resolve( __dirname, '../modules/element-manager/assets/js/admin.js' ),
'media-hints': path.resolve( __dirname, '../assets/dev/js/admin/hints/media.js' ),
// Temporary solution for the AI App in the Admin.
Expand Down
1 change: 1 addition & 0 deletions app/assets/styles/app-imports.scss
Original file line number Diff line number Diff line change
Expand Up @@ -88,3 +88,4 @@
@import "../../modules/onboarding/assets/js/pages/site-logo";
@import "../../modules/onboarding/assets/js/pages/good-to-go";
@import "../../modules/onboarding/assets/js/pages/upload-and-install-pro";
@import "../../modules/onboarding/assets/js/pages/choose-features";
1 change: 1 addition & 0 deletions app/modules/import-export/module.php
Original file line number Diff line number Diff line change
Expand Up @@ -340,6 +340,7 @@ public function import_kit( string $path, array $settings, bool $split_to_chunks
$this->import = new Import( $path, $settings );
$this->import->register_default_runners();

remove_filter( 'elementor/document/save/data', [ Plugin::$instance->modules_manager->get_modules( 'content-sanitizer' ), 'sanitize_content' ] );
do_action( 'elementor/import-export/import-kit', $this->import );

if ( $split_to_chunks ) {
Expand Down
1 change: 1 addition & 0 deletions app/modules/import-export/processes/import.php
Original file line number Diff line number Diff line change
Expand Up @@ -303,6 +303,7 @@ public function run() {

$this->init_import_session();

remove_filter( 'elementor/document/save/data', [ Plugin::$instance->modules_manager->get_modules( 'content-sanitizer' ), 'sanitize_content' ] );
add_filter( 'elementor/document/save/data', [ $this, 'prevent_saving_elements_on_post_creation' ], 10, 2 );

// Set the Request's state as an Elementor upload request, in order to support unfiltered file uploads.
Expand Down
5 changes: 3 additions & 2 deletions app/modules/import-export/utils.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

use Elementor\Core\Utils\Str;
use Elementor\Modules\LandingPages\Module as Landing_Pages_Module;
use Elementor\Modules\System_Info\Reporters\Server;
use Elementor\Modules\ConversionCenter\Module as Conversion_Center_Module;
use Elementor\TemplateLibrary\Source_Local;
use Elementor\Utils as ElementorUtils;

Expand Down Expand Up @@ -80,7 +80,8 @@ public static function get_registered_cpt_names() {

unset(
$post_types[ Landing_Pages_Module::CPT ],
$post_types[ Source_Local::CPT ]
$post_types[ Source_Local::CPT ],
$post_types[ Conversion_Center_Module::CPT_CONTACT_PAGES ]
);

return array_keys( $post_types );
Expand Down
12 changes: 3 additions & 9 deletions app/modules/kit-library/module.php
Original file line number Diff line number Diff line change
Expand Up @@ -102,15 +102,9 @@ public function __construct() {
// Assigning this action here since the repository is being loaded by demand.
add_action( 'elementor/experiments/feature-state-change/container', [ Repository::class, 'clear_cache' ], 10, 0 );

if ( Plugin::$instance->experiments->is_feature_active( 'admin_menu_rearrangement' ) ) {
add_action( 'elementor/admin/menu_registered/elementor', function( MainMenu $menu ) {
$this->register_admin_menu( $menu );
} );
} else {
add_action( 'elementor/admin/menu/register', function( Admin_Menu_Manager $admin_menu ) {
$this->register_admin_menu_legacy( $admin_menu );
}, Source_Local::ADMIN_MENU_PRIORITY + 30 );
}
add_action( 'elementor/admin/menu/register', function( Admin_Menu_Manager $admin_menu ) {
$this->register_admin_menu_legacy( $admin_menu );
}, Source_Local::ADMIN_MENU_PRIORITY + 30 );

add_action( 'elementor/connect/apps/register', function ( ConnectModule $connect_module ) {
$connect_module->register_app( 'kit-library', Kit_Library::get_class_name() );
Expand Down
2 changes: 2 additions & 0 deletions app/modules/onboarding/assets/js/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import SiteName from './pages/site-name';
import SiteLogo from './pages/site-logo';
import GoodToGo from './pages/good-to-go';
import InstallPro from './pages/upload-and-install-pro';
import ChooseFeatures from './pages/choose-features';

export default function App() {
// Send an AJAX request to update the database option which makes sure the Onboarding process only runs once,
Expand Down Expand Up @@ -49,6 +50,7 @@ export default function App() {
<Router>
<Account default />
<HelloTheme path="hello" />
<ChooseFeatures path="chooseFeatures" />
<SiteName path="siteName" />
<SiteLogo path="siteLogo" />
<GoodToGo path="goodToGo" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ export default function GoProPopover( props ) {
// The buttonsConfig prop is an array of objects. To find the 'Upgrade Now' button, we need to iterate over the object.
const goProButton = props.buttonsConfig.find( ( button ) => 'go-pro' === button.id ),
getElProButton = {
text: __( 'Upgrade Now', 'elementor' ),
text: elementorAppConfig.onboarding.experiment ? __( 'Upgrade now', 'elementor' ) : __( 'Upgrade Now', 'elementor' ),
className: 'e-onboarding__go-pro-cta',
target: '_blank',
href: 'https://elementor.com/pro/?utm_source=onboarding-wizard&utm_campaign=gopro&utm_medium=wp-dash&utm_content=top-bar-dropdown&utm_term=' + elementorAppConfig.onboarding.onboardingVersion,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ export default function PageContentLayout( props ) {
<div className="e-onboarding__page-content-start">
<h1 className="e-onboarding__page-content-section-title">
{ props.title }
{ props.secondLineTitle && <><br />{ props.secondLineTitle }</> }
</h1>
<div className="e-onboarding__page-content-section-text">
{ props.children }
Expand All @@ -31,18 +32,21 @@ export default function PageContentLayout( props ) {
<img src={ props.image } alt="Information" />
</div>
</Grid>
<div className="e-onboarding__notice-container">
{ props.noticeState || state.proNotice
? printNotices()
: <div className="e-onboarding__notice-empty-spacer" /> }
</div>
{ props.noticeState &&
<div className="e-onboarding__notice-container">
{ props.noticeState || state.proNotice
? printNotices()
: <div className="e-onboarding__notice-empty-spacer" /> }
</div>
}
<FooterButtons actionButton={ props.actionButton } skipButton={ props.skipButton } />
</>
);
}

PageContentLayout.propTypes = {
title: PropTypes.string,
secondLineTitle: PropTypes.string,
children: PropTypes.any,
image: PropTypes.string,
actionButton: PropTypes.object,
Expand Down
17 changes: 17 additions & 0 deletions app/modules/onboarding/assets/js/components/message.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
export default function Message( { tier } ) {
/* Translators: %s: Plan name */
const translatedString = __( 'Based on the features you chose, we recommend the %s plan, or higher', 'elementor' );
const [ messageFirstPart, messageSecondPart ] = translatedString.split( '%s' );

return (
<>
{ messageFirstPart }
<strong>{ tier }</strong>
{ messageSecondPart }
</>
);
}

Message.propTypes = {
tier: PropTypes.string.isRequired,
};
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,14 @@ export default function ProgressBar() {
} );
}

progressBarItemsConfig.push(
{
if ( elementorAppConfig.onboarding.experiment ) {
progressBarItemsConfig.push( {
id: 'chooseFeatures',
title: __( 'Choose Features', 'elementor' ),
route: 'chooseFeatures',
} );
} else {
progressBarItemsConfig.push( {
id: 'siteName',
title: __( 'Site Name', 'elementor' ),
route: 'site-name',
Expand All @@ -34,7 +40,10 @@ export default function ProgressBar() {
id: 'siteLogo',
title: __( 'Site Logo', 'elementor' ),
route: 'site-logo',
},
} );
}

progressBarItemsConfig.push(
{
id: 'goodToGo',
title: __( 'Good to Go', 'elementor' ),
Expand Down
1 change: 1 addition & 0 deletions app/modules/onboarding/assets/js/context/context.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ export function ContextProvider( props ) {
steps: {
account: false,
hello: false,
chooseFeatures: false,
siteName: false,
siteLogo: false,
goodToGo: false,
Expand Down
34 changes: 25 additions & 9 deletions app/modules/onboarding/assets/js/pages/account.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ import PageContentLayout from '../components/layout/page-content-layout';
export default function Account() {
const { state, updateState, getStateObjectToUpdate } = useContext( OnboardingContext ),
[ noticeState, setNoticeState ] = useState( null ),
nextStep = getNextStep(),
navigate = useNavigate(),
pageId = 'account',
nextStep = state.isHelloThemeActivated ? 'siteName' : 'hello',
actionButtonRef = useRef(),
alreadyHaveAccountLinkRef = useRef();

Expand All @@ -26,15 +26,23 @@ export default function Account() {

if ( state.isLibraryConnected ) {
pageTexts = {
firstLine: __( 'To get the most out of Elementor, we\'ll help you take your first steps:', 'elementor' ),
listItems: [
__( 'Set your site\'s theme', 'elementor' ),
__( 'Give your site a name & logo', 'elementor' ),
__( 'Choose how to start creating', 'elementor' ),
],
firstLine: <>{ __( 'To get the most out of Elementor, we\'ll help you take your', 'elementor' ) } <br /> { __( 'first steps:', 'elementor' ) }</>,
listItems: elementorAppConfig.onboarding.experiment
? [
__( 'Set your site\'s theme', 'elementor' ),
__( 'Chose additional features', 'elementor' ),
__( 'Choose how to start creating', 'elementor' ),
] : [
__( 'Set your site\'s theme', 'elementor' ),
__( 'Give your site a name & logo', 'elementor' ),
__( 'Choose how to start creating', 'elementor' ),
],
};
} else {
pageTexts = {
pageTexts = elementorAppConfig.onboarding.experiment ? {
firstLine: __( 'Once you connect your Elementor account, you can choose from dozens of professional templates and manage your site with the My Elementor dashboard.', 'elementor' ),
listItems: [],
} : {
firstLine: __( 'To get the most out of Elementor, we’ll connect your account.', 'elementor' ) +
' ' + __( 'Then you can:', 'elementor' ),
listItems: [
Expand Down Expand Up @@ -115,6 +123,13 @@ export default function Account() {
navigate( 'onboarding/' + nextStep );
};

function getNextStep() {
if ( ! state.isHelloThemeActivated ) {
return 'hello';
}

return elementorAppConfig.onboarding.experiment ? 'chooseFeatures' : 'siteName';
}
const connectFailureCallback = () => {
elementorCommon.events.dispatchEvent( {
event: 'indication prompt',
Expand All @@ -140,7 +155,8 @@ export default function Account() {
<Layout pageId={ pageId } nextStep={ nextStep }>
<PageContentLayout
image={ elementorCommon.config.urls.assets + 'images/app/onboarding/Illustration_Account.svg' }
title={ __( 'You\'re here! Let\'s set things up.', 'elementor' ) }
title={ elementorAppConfig.onboarding.experiment ? __( 'You\'re here!', 'elementor' ) : __( 'You\'re here! Let\'s set things up.', 'elementor' ) }
secondLineTitle={ elementorAppConfig.onboarding.experiment ? __( ' Let\'s get connected.', 'elementor' ) : '' }
actionButton={ actionButton }
skipButton={ skipButton }
noticeState={ noticeState }
Expand Down
Loading

0 comments on commit 1f003ff

Please sign in to comment.