-
Notifications
You must be signed in to change notification settings - Fork 60
EPS-1645: Use Common workflow file for PHPCS and fix reported issues #1353
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: release-candidate
Are you sure you want to change the base?
Changes from all commits
387bfb6
b6d8e8a
6a32388
fda2669
ef69317
a2de718
0729e26
7a9f543
0564926
d4c7c0c
bd2d3e6
b745623
ef45ec4
dc17527
8d0366c
f95ed52
cbf9fba
15ce032
d50aa88
61f25f8
567176b
2da8217
277748d
78c82f4
341cf9a
992225c
3f4f6ce
00a10dc
f653eec
cfc56a5
5d96bdb
1d1fada
d5efb5a
479811f
a800f57
c515b68
a70f7dc
433b602
aca450f
46667a2
4261f11
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
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 |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -114,11 +114,10 @@ public function hfe_flush_permalink_notice() { | |
wp_send_json_error( 'Unauthorized user' ); | ||
} | ||
|
||
$permalink_structure = get_option('permalink_structure'); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. What: The error message sent with 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: |
||
$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' ); | ||
|
@@ -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; | ||
|
@@ -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; | ||
} | ||
} | ||
|
||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. What: The logic checking in the 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 |
||
|
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', | ||
]; |
There was a problem hiding this comment.
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.