Skip to content

Commit

Permalink
Merge branch 'main' into feature/TMZ-276-remote
Browse files Browse the repository at this point in the history
  • Loading branch information
nicoladj77 authored Jan 22, 2025
2 parents ca8f8d1 + e8df0d3 commit d82f618
Show file tree
Hide file tree
Showing 53 changed files with 590 additions and 139 deletions.
8 changes: 7 additions & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ name: Build

on:
workflow_dispatch:
pull_request:
paths-ignore:
- '**.md'
- '**.txt'
Expand All @@ -20,6 +19,13 @@ on:
branches:
- 'main'
- '3.*'
paths-ignore:
- '**.md'
- '**.txt'
- '.github/config.json'
- 'bin/**'
- '.gitignore'
- 'docs/**'

jobs:
build-plugin:
Expand Down
5 changes: 4 additions & 1 deletion .github/workflows/css-file-check.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
name: Check CSS Size Limit

on:
pull_request:
push:
branches:
- 'main'
- '3.*'
types: ['opened', 'edited', 'reopened', 'synchronize']
paths-ignore:
- '**.md'
Expand Down
5 changes: 4 additions & 1 deletion .github/workflows/lighthouse.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
name: Lighthouse

on:
pull_request:
push:
branches:
- 'main'
- '3.*'
paths-ignore:
- '**.md'
- '**.txt'
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/phpunit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ jobs:
strategy:
fail-fast: false
matrix:
wordpress_versions: ['nightly', 'latest', '6.5', '6.4', '6.3']
wordpress_versions: ['nightly', 'latest', '6.6', '6.5']
php_versions: ['7.4', '8.0']
name: PHPUnit - WordPress ${{ matrix.wordpress_versions }} - PHP version ${{ matrix.php_versions }}
env:
Expand Down
11 changes: 7 additions & 4 deletions .github/workflows/playwright.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
name: Playwright

on:
pull_request:
push:
branches:
- 'main'
- '3.*'
paths-ignore:
- '**.md'
- '**.txt'
Expand Down Expand Up @@ -156,20 +159,20 @@ jobs:
if: ${{ needs.Playwright.result == 'failure' }}
uses: actions/checkout@v4
- name: Send slack message
if: ${{ needs.Playwright.result == 'failure' && github.event_name == 'schedule' }}
if: ${{ needs.Playwright.result == 'failure' && github.event_name != 'workflow_dispatch'}}
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 }}",
"text": "Elementor Core: Playwright - ${{github.event_name}} 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 }}"
"text": "Elementor Core: Playwright - ${{github.event_name}} failed: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}"
}
}
]
Expand Down
5 changes: 4 additions & 1 deletion .github/workflows/plugin-upgrade-test.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
name: Upgrade Elementor test

on:
pull_request:
push:
branches:
- 'main'
- '3.*'
paths-ignore:
- '**.md'
- '**.txt'
Expand Down
2 changes: 1 addition & 1 deletion .grunt-config/sass.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ const sass = {
{
expand: true,
cwd: 'modules/styleguide/assets/scss',
src: '*.scss',
src: 'editor.scss',
dest: 'assets/css/modules/styleguide',
ext: '.css',
},
Expand Down
24 changes: 18 additions & 6 deletions .grunt-config/webpack.packages.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,18 @@ const usingLocalRepo = process.env.ELEMENTOR_PACKAGES_USE_LOCAL;

const packages = usingLocalRepo ? getLocalRepoPackagesEntries() : getNodeModulesPackagesEntries();

const REGEXES = {
// @elementor/ui/SvgIcon. Used inside @elementor/icons
elementorPathImports: /^@elementor\/(ui|icons)\/(.+)$/,

// @elementor/editor
// We want to bundle `@elementor/design-tokens` inside the UI package since it's an internal thing.
elementorPackages: /^@elementor\/(?!design-tokens)(.+)$/,

// @wordpress/components
wordpressPackages: /^@wordpress\/(.+)$/,
};

const common = {
name: 'packages',
entry: Object.fromEntries(
Expand Down Expand Up @@ -37,19 +49,19 @@ const common = {
new GenerateWordPressAssetFileWebpackPlugin( {
handle: ( entryName ) => `elementor-v2-${entryName}`,
map: [
{ request: /^@elementor\/(ui|icons)(\/.+)?$/, handle: 'elementor-v2-$1' },
{ request: /^@elementor\/(.+)$/, handle: 'elementor-v2-$1' },
{ request: /^@wordpress\/(.+)$/, handle: 'wp-$1' },
{ request: REGEXES.elementorPathImports, handle: 'elementor-v2-$1' },
{ request: REGEXES.elementorPackages, handle: 'elementor-v2-$1' },
{ request: REGEXES.wordpressPackages, handle: 'wp-$1' },
{ request: 'react', handle: 'react' },
{ request: 'react-dom', handle: 'react-dom' },
]
} ),
new ExternalizeWordPressAssetsWebpackPlugin( {
global: ( entryName ) => [ 'elementorV2', entryName ],
map: [
{ request: /^@elementor\/(ui|icons)\/(.+)$/, global: [ 'elementorV2', '$1', '$2' ] },
{ request: /^@elementor\/(.+)$/, global: [ 'elementorV2', '$1' ] },
{ request: /^@wordpress\/(.+)$/, global: [ 'wp', '$1' ] },
{ request: REGEXES.elementorPathImports, global: [ 'elementorV2', '$1', '$2' ] },
{ request: REGEXES.elementorPackages, global: [ 'elementorV2', '$1' ] },
{ request: REGEXES.wordpressPackages, global: [ 'wp', '$1' ] },
{ request: 'react', global: 'React' },
{ request: 'react-dom', global: 'ReactDOM' },
]
Expand Down
8 changes: 4 additions & 4 deletions app/modules/kit-library/data/repository.php
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ public function find( $id, $options = [] ) {
$manifest = $this->api->get_manifest( $id );

if ( is_wp_error( $manifest ) ) {
throw new WP_Error_Exception( $manifest );
throw new WP_Error_Exception( esc_html( $manifest ) );
}
}

Expand Down Expand Up @@ -128,7 +128,7 @@ public function get_download_link( $id ) {
$response = $this->api->download_link( $id );

if ( is_wp_error( $response ) ) {
throw new WP_Error_Exception( $response );
throw new WP_Error_Exception( esc_html( $response ) );
}

return [ 'download_link' => $response->download_link ];
Expand Down Expand Up @@ -204,7 +204,7 @@ private function get_kits_data( $force_api_request = false ) {
$data = $this->api->get_all( $args );

if ( is_wp_error( $data ) ) {
throw new WP_Error_Exception( $data );
throw new WP_Error_Exception( esc_html( $data ) );
}

set_transient( static::KITS_CACHE_KEY, $data, static::KITS_CACHE_TTL_HOURS * HOUR_IN_SECONDS );
Expand All @@ -225,7 +225,7 @@ private function get_taxonomies_data( $force_api_request = false ) {
$data = $this->api->get_taxonomies();

if ( is_wp_error( $data ) ) {
throw new WP_Error_Exception( $data );
throw new WP_Error_Exception( esc_html( $data ) );
}

set_transient( static::KITS_TAXONOMIES_CACHE_KEY, $data, static::KITS_TAXONOMIES_CACHE_TTL_HOURS * HOUR_IN_SECONDS );
Expand Down
4 changes: 2 additions & 2 deletions app/modules/onboarding/module.php
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,7 @@ private function maybe_update_site_logo() {
private function maybe_upload_logo_image() {
$error_message = esc_html__( 'There was a problem uploading your file.', 'elementor' );

$file = Utils::get_super_global_value( $_FILES, 'fileToUpload' );
$file = Utils::get_super_global_value( $_FILES, 'fileToUpload' ); // phpcs:ignore WordPress.Security.NonceVerification.Missing

// phpcs:ignore WordPress.Security.NonceVerification.Missing
if ( ! is_array( $file ) || empty( $file['type'] ) ) {
Expand Down Expand Up @@ -342,7 +342,7 @@ private function upload_and_install_pro() {

$error_message = esc_html__( 'There was a problem uploading your file.', 'elementor' );

$file = Utils::get_super_global_value( $_FILES, 'fileToUpload' ) ?? [];
$file = Utils::get_super_global_value( $_FILES, 'fileToUpload' ) ?? []; // phpcs:ignore WordPress.Security.NonceVerification.Missing

// phpcs:ignore WordPress.Security.NonceVerification.Missing
if ( ! is_array( $file ) || empty( $file['type'] ) ) {
Expand Down
4 changes: 2 additions & 2 deletions assets/dev/scss/frontend/widgets/text-editor.scss
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
&:not(.elementor-drop-cap-view-default) {

.elementor-drop-cap {
margin-top: 8px;
margin-block-start: 8px;

&-letter {
width: 1em;
Expand All @@ -36,7 +36,7 @@
}

.elementor-drop-cap {
float: $start;
float: inline-start;
text-align: center;
line-height: 1;
font-size: 50px;
Expand Down
22 changes: 22 additions & 0 deletions changelog.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,27 @@
== Changelog ==

= 3.27.0 - 2025-01-20 =

* New: Introducing local loading of Google Fonts to improve performance and enhance user privacy ([#4544](https://github.com/elementor/elementor/issues/4544), [#19966](https://github.com/elementor/elementor/issues/19966), [#23932](https://github.com/elementor/elementor/issues/23932), [#21716](https://github.com/elementor/elementor/issues/21716))
* New: Introducing advanced layout customization for Grid Container with column and row span controls for precise grid-based designs ([#25256](https://github.com/elementor/elementor/issues/25256))
* New: Added the option to animate with AI motion effects for creating AI-generated animations
* Tweak: Add 'YouTube shorts' support in the video widget ([#24220](https://github.com/elementor/elementor/issues/24220), [#20330](https://github.com/elementor/elementor/issues/20330))
* Tweak: Added Safari browser compatibility for the 'Fit to Size' option in the Icon Widget ([#27679](https://github.com/elementor/elementor/issues/27679))
* Tweak: Moved style loading to the head instead of the footer to improve CLS
* Tweak: Enabled conditional loading of `Swiper.js` based on widget dependencies to reduce unnecessary assets and improve page load times
* Tweak: Removed the `elementor-widget-container` div from the Spacer Widget as part of the Optimized Markup experiment to improve HTML structure
* Tweak: Improved keyboard accessibility for the nested container presets area
* Tweak: Added accessible and descriptive names to the icon link in the Icon Box widget
* Tweak: Optimize background video CSS by merging `elementor-html5-video` and `elementor-background-video-hosted` into a single class
* Tweak: Added the ability to disable the Element Cache
* Tweak: Removed animation class when no animations are set in Icon and Icon Widget widgets
* Tweak: Added support for captions on YouTube videos
* Tweak: Removed the limitation restricting heading hover color styling to links only
* Tweak: Removed `aspect-ratio` workaround for unsupported Safari browsers
* Fix: Switching between images in a lightbox on responsive mode displayed a tall blue rectangle ([#12830](https://github.com/elementor/elementor/issues/12830))
* Fix: Image editing tools with AI are not working when launched in WooCommerce
* Fix: Improved HTML markup validity by removing the `type` attribute from `<script>` tags

= 3.26.5 - 2025-01-15 =

* Fix: Background Slideshow option not working for columns
Expand Down
2 changes: 1 addition & 1 deletion data/v2/base/controller.php
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,7 @@ public function get_permission_callback( $request ) {
}

if ( $result instanceof \WP_Error ) {
throw new WP_Error_Exception( $result );
throw new WP_Error_Exception( esc_html( $result ) );
}

return $result;
Expand Down
7 changes: 3 additions & 4 deletions elementor.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,9 @@
* Plugin Name: Elementor
* Description: The Elementor Website Builder has it all: drag and drop page builder, pixel perfect design, mobile responsive editing, and more. Get started now!
* Plugin URI: https://elementor.com/?utm_source=wp-plugins&utm_campaign=plugin-uri&utm_medium=wp-dash
* Author: Elementor.com
* Version: 3.28.0
* Author: Elementor.com
* Author URI: https://elementor.com/?utm_source=wp-plugins&utm_campaign=author-uri&utm_medium=wp-dash
*
* Text Domain: elementor
*
* @package Elementor
Expand Down Expand Up @@ -52,7 +51,7 @@

if ( ! version_compare( PHP_VERSION, '7.4', '>=' ) ) {
add_action( 'admin_notices', 'elementor_fail_php_version' );
} elseif ( ! version_compare( get_bloginfo( 'version' ), '6.3', '>=' ) ) {
} elseif ( ! version_compare( get_bloginfo( 'version' ), '6.5', '>=' ) ) {
add_action( 'admin_notices', 'elementor_fail_wp_version' );
} else {
require ELEMENTOR_PATH . 'includes/plugin.php';
Expand Down Expand Up @@ -98,7 +97,7 @@ function elementor_fail_wp_version() {
sprintf(
/* translators: %s: WordPress version. */
esc_html__( 'Update to version %s and get back to creating!', 'elementor' ),
'6.3'
'6.5'
),
esc_html__( 'Show me how', 'elementor' )
);
Expand Down
1 change: 1 addition & 0 deletions includes/autoloader.php
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,7 @@ private static function init_classes_map() {
'TemplateLibrary\Source_Base' => 'includes/template-library/sources/base.php',
'TemplateLibrary\Source_Local' => 'includes/template-library/sources/local.php',
'TemplateLibrary\Source_Remote' => 'includes/template-library/sources/remote.php',
'TemplateLibrary\Source_Cloud' => 'includes/template-library/sources/cloud.php',
'Tools' => 'includes/settings/tools.php',
'Container\Container' => 'includes/container/container.php',
'Tracker' => 'includes/tracker.php',
Expand Down
2 changes: 1 addition & 1 deletion includes/editor-templates/templates.php
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,7 @@ class="elementor-template-library-template-action elementor-button go-pro"
<div class="elementor-template-library-blank-title">{{{ title }}}</div>
<div class="elementor-template-library-blank-message">{{{ description }}}</div>
<form id="elementor-template-library-save-template-form">
<input type="hidden" name="post_id" value="<?php echo get_the_ID(); ?>">
<input type="hidden" name="post_id" value="<?php echo esc_attr( get_the_ID() ); ?>">
<input id="elementor-template-library-save-template-name" name="title" placeholder="<?php echo esc_attr__( 'Enter Template Name', 'elementor' ); ?>" required>
<button id="elementor-template-library-save-template-submit" class="elementor-button e-primary">
<span class="elementor-state-icon">
Expand Down
4 changes: 3 additions & 1 deletion includes/settings/settings.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
namespace Elementor;

use Elementor\Core\Admin\Menu\Admin_Menu_Manager;
use Elementor\Core\Settings\Manager as SettingsManager;
use Elementor\Core\Files\Fonts\Google_Font;
use Elementor\Includes\Settings\AdminMenuItems\Admin_Menu_Item;
use Elementor\Includes\Settings\AdminMenuItems\Get_Help_Menu_Item;
use Elementor\Includes\Settings\AdminMenuItems\Getting_Started_Menu_Item;
Expand Down Expand Up @@ -564,5 +564,7 @@ public function __construct() {
add_action( "add_option_{$option_name}", $clear_cache_callback );
add_action( "update_option_{$option_name}", $clear_cache_callback );
}

add_action( 'update_option_elementor_font_display', [ Google_Font::class, 'clear_cache' ] );
}
}
4 changes: 3 additions & 1 deletion includes/template-library/sources/cloud.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,9 @@ public function get_title(): string {

public function register_data() {}

public function get_items( $args = [] ) {}
public function get_items( $args = [] ) {
return [];
}

public function get_item( $template_id ) {}

Expand Down
4 changes: 2 additions & 2 deletions includes/utils.php
Original file line number Diff line number Diff line change
Expand Up @@ -839,7 +839,7 @@ public static function get_super_global_value( $super_global, $key ) {
return null;
}

if ( $_FILES === $super_global ) {
if ( $_FILES === $super_global ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing
return isset( $super_global[ $key ]['name'] ) ?
self::sanitize_file_name( $super_global[ $key ] ) :
self::sanitize_multi_upload( $super_global[ $key ] );
Expand Down Expand Up @@ -906,7 +906,7 @@ public static function safe_throw( string $message ) {
return;
}

throw new \Exception( $message );
throw new \Exception( esc_html( $message ) );
}

public static function has_invalid_post_permissions( $post ): bool {
Expand Down
3 changes: 1 addition & 2 deletions includes/widgets/text-editor.php
Original file line number Diff line number Diff line change
Expand Up @@ -451,8 +451,7 @@ protected function register_controls() {
],
],
'selectors' => [
'body:not(.rtl) {{WRAPPER}} .elementor-drop-cap' => 'margin-right: {{SIZE}}{{UNIT}};',
'body.rtl {{WRAPPER}} .elementor-drop-cap' => 'margin-left: {{SIZE}}{{UNIT}};',
'{{WRAPPER}} .elementor-drop-cap' => 'margin-inline-end: {{SIZE}}{{UNIT}};',
],
]
);
Expand Down
5 changes: 3 additions & 2 deletions modules/admin-bar/module.php
Original file line number Diff line number Diff line change
Expand Up @@ -66,11 +66,12 @@ public function enqueue_scripts() {
);

// This is a core script of WordPress, it is not required to pass the 'ver' argument.
wp_enqueue_script( // phpcs:ignore WordPress.WP.EnqueuedResourceParameters
// We should add dependencies to make sure that 'elementor-admin-bar' is loaded before 'admin-bar'.
wp_enqueue_script(
'admin-bar',
null,
[ 'elementor-admin-bar' ],
false,
false, // phpcs:ignore WordPress.WP.EnqueuedResourceParameters
true
);

Expand Down
Loading

0 comments on commit d82f618

Please sign in to comment.