Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
41 commits
Select commit Hold shift + click to select a range
387bfb6
updated phpcs workflow file
akshayurankar48 Sep 17, 2025
b6d8e8a
updated phpcs workflow file 2
akshayurankar48 Sep 17, 2025
6a32388
updated phpcs workflow file 3
akshayurankar48 Sep 17, 2025
fda2669
updated composer
akshayurankar48 Sep 17, 2025
ef69317
updated phpcs workflow file 4
akshayurankar48 Sep 17, 2025
a2de718
updated phpcs workflow file 5
akshayurankar48 Sep 17, 2025
0729e26
updated phpcs workflow file 6
akshayurankar48 Sep 17, 2025
7a9f543
updated phpcs workflow file 7
akshayurankar48 Sep 17, 2025
0564926
updated phpcbf
akshayurankar48 Sep 17, 2025
d4c7c0c
updated github workflow 7
akshayurankar48 Sep 17, 2025
bd2d3e6
updated github workflow 8
akshayurankar48 Sep 17, 2025
b745623
updated workflow file 8
akshayurankar48 Sep 17, 2025
ef45ec4
updated workflow file 9
akshayurankar48 Sep 17, 2025
dc17527
updated workflow file 10
akshayurankar48 Sep 17, 2025
8d0366c
updated github workflow files 11
akshayurankar48 Sep 17, 2025
f95ed52
updated github workflow files 12
akshayurankar48 Sep 17, 2025
cbf9fba
updated github workflow files 13
akshayurankar48 Sep 17, 2025
15ce032
updated github workflow files 14
akshayurankar48 Sep 17, 2025
d50aa88
updated github workflow files 15
akshayurankar48 Sep 17, 2025
61f25f8
updated github workflow files 16
akshayurankar48 Sep 17, 2025
567176b
updated github workflow files 17
akshayurankar48 Sep 17, 2025
2da8217
updated github workflow files 18
akshayurankar48 Sep 17, 2025
277748d
updated github workflow files 19
akshayurankar48 Sep 17, 2025
78c82f4
updated github workflow files 20
akshayurankar48 Sep 17, 2025
341cf9a
Updated github workflow files 21
ShubhamGupta05 Sep 17, 2025
992225c
updated github workflow files 21
akshayurankar48 Sep 17, 2025
3f4f6ce
updated github workflow files 22
akshayurankar48 Sep 17, 2025
00a10dc
updated github workflow files 23
akshayurankar48 Sep 17, 2025
f653eec
updated github workflow files 24
akshayurankar48 Sep 17, 2025
cfc56a5
updated github workflow files 25
akshayurankar48 Sep 17, 2025
5d96bdb
Updated file to test
ShubhamGupta05 Sep 17, 2025
1d1fada
updated github workflow files 26
akshayurankar48 Sep 17, 2025
d5efb5a
updated github workflow files 27
akshayurankar48 Sep 17, 2025
479811f
updated github workflow files 26
akshayurankar48 Sep 17, 2025
a800f57
updated file
ShubhamGupta05 Sep 17, 2025
c515b68
remove /
ShubhamGupta05 Sep 17, 2025
a70f7dc
skip private repo
ShubhamGupta05 Sep 17, 2025
433b602
fix composer
ShubhamGupta05 Sep 17, 2025
aca450f
Merge branch 'release-candidate' of https://github.com/brainstormforc…
akshayurankar48 Oct 15, 2025
46667a2
updated PHP Version
akshayurankar48 Oct 15, 2025
4261f11
updated PHP Version 2
akshayurankar48 Oct 15, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
49 changes: 25 additions & 24 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,47 +1,48 @@
name: CI

name: Code Analysis
on: pull_request

concurrency:
group: ${{ github.workflow }}-${{ github.event_name == 'pull_request' && github.head_ref || github.sha }}
cancel-in-progress: true

jobs:
CI:
analysis:
runs-on: ubuntu-latest

strategy:
matrix:
node: [ 14.15 ]
php: ['7.4']

node: [ 18.15.0 ]
php: ['8.1', '8.2']
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
coverage: none
tools: composer
tools: composer, cs2pr

- name: Install composer dependencies
run: composer config github-oauth.github.com ${{ secrets.PRIVATE_ACCESS_TOKEN }} && composer install --prefer-dist --no-suggest --no-progress

- name: PHPCS check
if: always()
uses: chekalsky/phpcs-action@v1
with:
phpcs_bin_path: './vendor/bin/phpcs'

- name: Use desired version of NodeJS
uses: actions/setup-node@v3
- name: Run PHPCS with annotations
run: vendor/bin/phpcs -q --report=checkstyle | cs2pr

- name: Setup NodeJS
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node }}
cache: 'npm'
node-version: ${{ matrix.node }}
cache: 'npm'

- name: npm install
- name: Install NPM dependencies
run: npm ci

- name: Build project
run: npm run build

- name: Lint JS
run: npm run lint:js

- name: Build project
run: npm run build

- name: Lint CSS
run: npm run lint:css
11 changes: 5 additions & 6 deletions admin/class-hfe-addons-actions.php
Original file line number Diff line number Diff line change
Expand Up @@ -114,11 +114,10 @@ public function hfe_flush_permalink_notice() {
wp_send_json_error( 'Unauthorized user' );

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What: Code indentation and formatting changes are made, which may affect readability for consistent style across the codebase.

Why: While these changes help with aesthetics, it's important to set a coding standard for format consistency that all contributors should follow without mixing coding styles.

How: Ensure that code follows PSR-2 standards or your defined project standards consistently throughout the file.

}

$permalink_structure = get_option('permalink_structure');

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What: The error message sent with wp_send_json_error() is currently a static string. Consider adding more context or information about the actual error to the message.

Why: Providing a more descriptive error message can help with troubleshooting and improving user experience during authorization failures.

How: You can modify the line to include user ID or request details for additional context: wp_send_json_error( 'Unauthorized user: ' . get_current_user_id() );.

$permalink_structure = get_option( 'permalink_structure' );
// Check if the permalink structure is not empty.
if ( '' !== $permalink_structure )
{
update_option('permalink_structure', $permalink_structure);
if ( '' !== $permalink_structure ) {
update_option( 'permalink_structure', $permalink_structure );
flush_rewrite_rules();
// Update the option to true.
update_user_meta( get_current_user_id(), 'hfe_permalink_notice_option', 'notice-dismissed' );
Expand Down Expand Up @@ -316,7 +315,7 @@ public static function bulk_deactivate_unused_widgets() {
// Compare slugs from widget_list to keys in $used_widgets
foreach ( self::$widget_list as $slug => $value ) {
if ( ! isset( $used_widgets[ $value['slug'] ] ) ) {
if( $slug === 'Scroll_To_Top' || $slug === 'Reading_Progress_Bar' ){
if ( $slug === 'Scroll_To_Top' || $slug === 'Reading_Progress_Bar' ) {
continue;
}
$unused_widgets[] = $slug;
Expand All @@ -329,7 +328,7 @@ public static function bulk_deactivate_unused_widgets() {
foreach ( self::$widget_list as $slug => $value ) {
if ( in_array( $slug, $unused_widgets ) ) {
$widgets[ $slug ] = 'disabled';
$deactivated[] = $slug;
$deactivated[] = $slug;
}
}

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What: The logic checking in the foreach loop can potentially be optimized by reducing unnecessary calls or checks on $slug. If there are performance concerns with the current data set size, consider refactoring.

Why: Improving efficiency, especially in loops, can have a positive impact on performance, especially if this function is called frequently.

How: Consider using a more streamlined approach, such as caching results if the self::$widget_list is not changing often, or restructuring the data to allow quicker access while iterating.

Expand Down
34 changes: 17 additions & 17 deletions admin/class-hfe-admin.php
Original file line number Diff line number Diff line change
Expand Up @@ -120,24 +120,24 @@ private function __construct() {
add_action( 'elementor/editor/before_enqueue_scripts', [ $this, 'enqueue_permalink_clear_notice_js' ] );
add_action( 'elementor/editor/before_enqueue_styles', [ $this, 'enqueue_permalink_clear_notice_css' ] );
// Hook into Elementor's editor styles
add_action('elementor/editor/before_enqueue_scripts', [$this, 'enqueue_editor_scripts']);
add_action( 'elementor/editor/before_enqueue_scripts', [ $this, 'enqueue_editor_scripts' ] );
if ( 'yes' === get_option( 'uae_analytics_optin', false ) ) {
add_action('shutdown', [ $this, 'maybe_run_hfe_widgets_usage_check' ] );
add_action( 'shutdown', [ $this, 'maybe_run_hfe_widgets_usage_check' ] );
}
}

/**
* Enqueuing Promotion widget scripts.
*/
public function enqueue_editor_scripts() {
wp_enqueue_script(
'uae-pro-promotion',
HFE_URL . 'build/promotion-widget.js',
[ 'jquery', 'wp-element', 'wp-dom-ready' ],
HFE_VER,
true
);
}
wp_enqueue_script(
'uae-pro-promotion',
HFE_URL . 'build/promotion-widget.js',
[ 'jquery', 'wp-element', 'wp-dom-ready' ],
HFE_VER,
true
);
}

/**
* Check the page on which Widget check need to be run.
Expand All @@ -147,7 +147,7 @@ public function maybe_run_hfe_widgets_usage_check() {
if (
is_admin() &&
isset( $_GET['page'] ) &&
( 'uaepro' === $_GET['page'] || 'hfe' === $_GET['page'])
( 'uaepro' === $_GET['page'] || 'hfe' === $_GET['page'] )
) {
$this->hfe_check_widgets_data_usage();
}
Expand Down Expand Up @@ -184,7 +184,7 @@ public function enqueue_permalink_clear_notice_css() {
return;
}

if(isset(self::$elementor_instance)){
if ( isset( self::$elementor_instance ) ) {
$current_post_type = get_post_type( self::$elementor_instance->editor->get_post_id() );

if ( $current_post_type !== 'elementor-hf' ) {
Expand All @@ -211,7 +211,7 @@ public function enqueue_permalink_clear_notice_js() {
return;
}

if(isset(self::$elementor_instance)){
if ( isset( self::$elementor_instance ) ) {
$current_post_type = get_post_type( self::$elementor_instance->editor->get_post_id() );

if ( $current_post_type !== 'elementor-hf' ) {
Expand Down Expand Up @@ -247,14 +247,14 @@ public function print_permalink_clear_notice() {
return;
}

if(isset(self::$elementor_instance)){
if ( isset( self::$elementor_instance ) ) {
$current_post_type = get_post_type( self::$elementor_instance->editor->get_post_id() );

if ( $current_post_type !== 'elementor-hf' ) {
return;
}
}
?>
?>
<div class="uae-permalink-clear-notice" id="uae-permalink-clear-notice">
<header>
<i class="eicon-warning"></i>
Expand All @@ -266,15 +266,15 @@ public function print_permalink_clear_notice() {
<?php echo esc_html__( 'Try clearing your cache or resetting permalinks (Settings > Permalinks > Save Changes).', 'header-footer-elementor' ); ?>
<a href="<?php echo esc_url( 'https://ultimateelementor.com/docs/elementor-header-footer-template-not-loading-or-stuck-on-loading/' ); ?>" target="_blank"><?php echo esc_html_e( 'Learn More', 'header-footer-elementor' ); ?></a>
<br>
<?php if(!is_multisite()){ ?>
<?php if ( ! is_multisite() ) { ?>
<button class="uae-permalink-flush-btn" type="button">
<span class="uae-btn-main-text"><?php echo esc_html__( 'Flush Permalink', 'header-footer-elementor' ); ?></span>
<span class="uae-notice-loader"></span>
</button>
<?php } ?>
</div>
</div>
<?php
<?php
}
}

Expand Down
5 changes: 4 additions & 1 deletion build/promotion-widget.asset.php
Original file line number Diff line number Diff line change
@@ -1 +1,4 @@
<?php return array('dependencies' => array('wp-dom-ready', 'wp-element'), 'version' => '6c05e450e9d92239760e');
<?php return [
'dependencies' => [ 'wp-dom-ready', 'wp-element' ],
'version' => '6c05e450e9d92239760e',
];
Loading
Loading