Skip to content
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

minor updates for v1.8.x #296

Merged
merged 6 commits into from
Nov 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
1 change: 1 addition & 0 deletions .distignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
/.wordpress-org
/bin
/coverage
/dist
/node_modules
/tests
/vendor
Expand Down
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
/.stylelintrc.json export-ignore
/composer.json export-ignore
/composer-php5.json export-ignore
/dist export-ignore
/package.json export-ignore
/package-lock.json export-ignore
/composer.lock export-ignore
Expand Down
10 changes: 5 additions & 5 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,9 @@ jobs:
php-version: ${{matrix.php}}
tools: composer
- name: Setup Node
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version: '16'
node-version: '22'
- name: Setup DB
uses: shogo82148/actions-setup-mysql@v1
with:
Expand All @@ -61,12 +61,12 @@ jobs:
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: '8.0'
php-version: '8.2'
tools: composer
- name: Setup Node
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version: '18'
node-version: '22'
- name: Install
run: |
composer install --no-interaction
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/wordpress-plugin-asset-update.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: 7.4
php-version: 8.2
tools: composer
- name: Install
run: composer install --no-interaction
Expand Down
31 changes: 31 additions & 0 deletions .github/workflows/wordpress-plugin-check.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: Plugin check
on:
push:
branches: [ 'stable', 'release/*' ]
pull_request:
branches: [ 'stable' ]
jobs:
check:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: '8.2'
tools: composer

- name: Build
run: composer install --no-interaction

- name: Package plugin
run: |
mkdir -p ./dist
rsync -rc --exclude-from=.distignore ./ ./dist/statify --delete --delete-excluded

- name: Check WP plugin
uses: wordpress/plugin-check-action@v1
with:
build-dir: ./dist/statify
4 changes: 2 additions & 2 deletions .github/workflows/wordpress-plugin-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: 7.4
php-version: 8.2
tools: composer
- name: Install
run: composer install --no-interaction
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
.nyc_output
composer.lock
coverage
dist/
css/*.min.css
js/*.min.js
js/*.min.js.map
Expand Down
8 changes: 4 additions & 4 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,14 @@
"npm-asset/chartist-plugin-tooltips-updated": "0.1.4"
},
"require-dev": {
"dealerdirect/phpcodesniffer-composer-installer": "^0.7",
"dealerdirect/phpcodesniffer-composer-installer": "^1.0",
"matthiasmullie/minify": "^1.3",
"slowprog/composer-copy-file": "^0.3",
"squizlabs/php_codesniffer": "^3.7",
"squizlabs/php_codesniffer": "^3.10",
"phpcompatibility/phpcompatibility-wp": "^2.1",
"wp-coding-standards/wpcs": "^2.3",
"wp-coding-standards/wpcs": "^3.1",
"phpunit/phpunit": "^5|^7|^9",
"yoast/phpunit-polyfills": "^1.0"
"yoast/phpunit-polyfills": "^1.1"
},
"repositories": [
{
Expand Down
4 changes: 2 additions & 2 deletions inc/class-statify-dashboard.php
Original file line number Diff line number Diff line change
Expand Up @@ -143,8 +143,8 @@ public static function add_js() {
'statify_chart_js',
'statify_translations',
array(
'pageview' => strip_tags( esc_html__( 'Pageview', 'statify' ) ),
'pageviews' => strip_tags( esc_html__( 'Pageviews', 'statify' ) ),
'pageview' => wp_strip_all_tags( __( 'Pageview', 'statify' ) ),
'pageviews' => wp_strip_all_tags( __( 'Pageviews', 'statify' ) ),
)
);
}
Expand Down
2 changes: 1 addition & 1 deletion inc/class-statify-frontend.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,11 @@
return false;
}

if ( isset( $_REQUEST['statify_target'] ) ) {

Check warning on line 41 in inc/class-statify-frontend.php

View workflow job for this annotation

GitHub Actions / check

WordPress.Security.NonceVerification.Recommended

Processing form data without nonce verification.

Check warning on line 41 in inc/class-statify-frontend.php

View workflow job for this annotation

GitHub Actions / check

WordPress.Security.NonceVerification.Recommended

Processing form data without nonce verification.
$target = filter_var( wp_unslash( $_REQUEST['statify_target'] ), FILTER_SANITIZE_URL );

Check warning on line 42 in inc/class-statify-frontend.php

View workflow job for this annotation

GitHub Actions / check

WordPress.Security.NonceVerification.Recommended

Processing form data without nonce verification.

Check warning on line 42 in inc/class-statify-frontend.php

View workflow job for this annotation

GitHub Actions / check

WordPress.Security.NonceVerification.Recommended

Processing form data without nonce verification.
}
if ( isset( $_REQUEST['statify_referrer'] ) ) {

Check warning on line 44 in inc/class-statify-frontend.php

View workflow job for this annotation

GitHub Actions / check

WordPress.Security.NonceVerification.Recommended

Processing form data without nonce verification.

Check warning on line 44 in inc/class-statify-frontend.php

View workflow job for this annotation

GitHub Actions / check

WordPress.Security.NonceVerification.Recommended

Processing form data without nonce verification.
$referrer = filter_var( wp_unslash( $_REQUEST['statify_referrer'] ), FILTER_SANITIZE_URL );

Check warning on line 45 in inc/class-statify-frontend.php

View workflow job for this annotation

GitHub Actions / check

WordPress.Security.NonceVerification.Recommended

Processing form data without nonce verification.

Check warning on line 45 in inc/class-statify-frontend.php

View workflow job for this annotation

GitHub Actions / check

WordPress.Security.NonceVerification.Recommended

Processing form data without nonce verification.
}
} else {
if ( isset( $_SERVER['REQUEST_URI'] ) ) {
Expand Down Expand Up @@ -103,7 +103,7 @@
$data['target'] = esc_url_raw( $data['target'] );

// Insert.
$wpdb->insert( $wpdb->statify, $data );

Check warning on line 106 in inc/class-statify-frontend.php

View workflow job for this annotation

GitHub Actions / check

WordPress.DB.DirectDatabaseQuery.DirectQuery

Use of a direct database call is discouraged.

Check warning on line 106 in inc/class-statify-frontend.php

View workflow job for this annotation

GitHub Actions / check

WordPress.DB.DirectDatabaseQuery.DirectQuery

Use of a direct database call is discouraged.

/**
* Fires after a visit was stored in the database
Expand Down Expand Up @@ -313,7 +313,7 @@

if ( false === $disallowed_keys ) {
// WordPress < 5.5 uses the old key.
$disallowed_keys = get_option( 'blacklist_keys' );
$disallowed_keys = get_option( 'blacklist_keys' ); // phpcs:ignore WordPress.WP.DeprecatedParameterValues.Found
}

$disallowed_keys = trim( $disallowed_keys );
Expand Down
1 change: 0 additions & 1 deletion inc/class-statify-settings.php
Original file line number Diff line number Diff line change
Expand Up @@ -375,5 +375,4 @@ public static function create_settings_page() {

<?php
}

}
Loading
Loading