Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/dev' into fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Glomberg committed Apr 21, 2024
2 parents 8fab390 + b2d87ed commit 5e2e7d0
Show file tree
Hide file tree
Showing 51 changed files with 3,326 additions and 3,092 deletions.
35 changes: 35 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
module.exports = {
env: {
browser: true,
es2021: true,
},
extends: 'google',
ignorePatterns: [
'js/src/lib/*.js',
'js/src/react/*.js',
'js/src/spbc-admin.js',
'js/src/spbc-common.js',
'js/src/spbc-cookie.js',
'js/src/spbc-dashboard-widget.js',
'js/src/spbc-modal.js',
'js/src/spbc-scanner-plugin.js',
'js/src/spbc-settings.js',
'js/src/spbc-settings_tab--backups.js',
'js/src/spbc-settings_tab--scanner.js',
'js/src/spbc-settings_tab--security_log.js',
'js/src/spbc-settings_tab--settings_general.js',
'js/src/spbc-settings_tab--summary.js',
],
overrides: [],
parserOptions: {
ecmaVersion: 'latest',
},
rules: {
'indent': ['error', 4],
'max-len': ['error', {'code': 120}],
'prefer-const': 'off',
},
globals: {

},
};
49 changes: 49 additions & 0 deletions .github/workflows/eslint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
# .github/workflows/eslint.yml

name: ESLint # name of the action (displayed in the github interface)

on: # event list
push: # on push to each of these branches
branches:
- dev
- fix
- master
pull_request:
branches:
- dev
- master

env: # environment variables (available in any part of the action)
NODE_VERSION: 16

jobs: # list of things to do
linting:
name: ESLint # job name (unique id)
runs-on: ubuntu-latest # on which machine to run
steps: # list of steps
- name: Install NodeJS
uses: actions/setup-node@v2
with:
node-version: ${{ env.NODE_VERSION }}

- name: Code Checkout
uses: actions/checkout@v2

- name: Install Dependencies
run: npm i

- name: Code Linting
run: npm run eslint

- name: Telegram notify
if: failure()
uses: appleboy/telegram-action@master
with:
to: ${{ secrets.TELEGRAM_PLUGINS_TO }}
token: ${{ secrets.TELEGRAM_REVIEWER_TOKEN }}
message: |
Hi, <strong>${{ github.actor }}</strong>! Your commit for <strong>${{ github.repository }}</strong>
contains 💯 the best solution but it have to be fixed!
<a href="${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}">Auto-Tests <strong>ESLint</strong></a> build failed ⛔!
format: html
disable_web_page_preview: true
8 changes: 4 additions & 4 deletions inc/spbc-settings.php
Original file line number Diff line number Diff line change
Expand Up @@ -2173,8 +2173,8 @@ function spbc_field_traffic_control_logs__prepare_data(&$table)

foreach ($table->rows as $row) {
$ip = IP::reduceIPv6($row->ip_entry);
$allow_layout = '<a href="#" onclick="return spbc_tc__allow_ip(\'' . esc_attr($ip) . '\')" class="spbcGreen">' . esc_html__('Allow', 'security-malware-firewall') . '</a>';
$ban_layout = '<a href="#" onclick="return spbc_tc__ban_ip(\'' . esc_attr($ip) . '\')" class="spbc---red">' . esc_html__('Ban', 'security-malware-firewall') . '</a>';
$allow_layout = '<a href="#" onclick="return spbcTcAllowIp(\'' . esc_attr($ip) . '\')" class="spbcGreen">' . esc_html__('Allow', 'security-malware-firewall') . '</a>';
$ban_layout = '<a href="#" onclick="return spbcTcBanIp(\'' . esc_attr($ip) . '\')" class="spbc---red">' . esc_html__('Ban', 'security-malware-firewall') . '</a>';
$ip = "<a href='https://cleantalk.org/blacklists/{$row->ip_entry}' target='_blank'>" . esc_html($ip) . '</a>'
. '<br>'
. $allow_layout . ' | ' . $ban_layout;
Expand Down Expand Up @@ -3344,7 +3344,7 @@ function spbc_list_table__get_args_by_type($table_type)
),
'show_links' => array(
'name' => 'Show links',
'handler' => 'spbc_scanner__switch_table(this, "links");'
'handler' => 'spbcScannerSwitchTable(this, "links");'
),
),
'order_by' => array('spam_active' => 'desc'),
Expand Down Expand Up @@ -3752,7 +3752,7 @@ function spbc_list_table__get_args_by_type($table_type)
),
'show_links' => array(
'name' => 'Show links',
'handler' => 'spbc_scanner__switch_table(this, "links");'
'handler' => 'spbcScannerSwitchTable(this, "links");'
),
),
'order_by' => array('spam_active' => 'desc'),
Expand Down
2 changes: 1 addition & 1 deletion js/spbc-admin.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 5e2e7d0

Please sign in to comment.