Skip to content
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
5 changes: 2 additions & 3 deletions .drone.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,16 +14,15 @@ steps:
depends_on:
- composer-install
- name: node-install
image: node:18
image: node:22
commands:
- npm install
- name: lint-assets
image: node:20
image: node:22
commands:
- npx eslint scripts/block.js
- npx eslint scripts/liveticker.js
- npx stylelint styles/block.css
- npx stylelint styles/liveticker.css
depends_on:
- node-install

24 changes: 17 additions & 7 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,25 +7,34 @@ jobs:
matrix:
include:
- php: '8.3'
wordpress: '6.4'
wordpress: '6.6'
- php: '8.2'
wordpress: '6.3'
wordpress: '6.4'
- php: '8.1'
wordpress: '6.1'
wordpress: '6.2'
- php: '8.0'
wordpress: '6.0'
- php: '7.4'
wordpress: '5.9'
- php: '5.6'
wordpress: '4.7'
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install SVN
run: |
if ! command -v svn > /dev/null; then
sudo apt-get update
sudo apt-get install -y subversion
fi
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
coverage: xdebug
tools: composer
- name: Setup DB
run: sudo /etc/init.d/mysql start
run: sudo sudo systemctl start mysql.service
- name: Setup WP
run: bash bin/install-wp-tests.sh wordpress root root localhost "${{ matrix.wordpress }}"
- name: Install
Expand All @@ -44,9 +53,9 @@ jobs:
php-version: '8.2'
tools: composer
- name: Setup Node
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version: '20'
node-version: '22'
- name: Install
run: |
composer install --no-interaction
Expand All @@ -65,7 +74,8 @@ jobs:
with:
fetch-depth: 0
- name: Analyze with SonarCloud
uses: sonarsource/sonarcloud-github-action@master
if: env.SONAR_TOKEN != ''
uses: sonarsource/sonarcloud-github-action@v3
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/wordpress-plugin-asset-update.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: '8.0'
php-version: '8.2'
tools: composer
- name: Install
run: composer install --no-interaction
Expand Down
23 changes: 23 additions & 0 deletions .github/workflows/wordpress-plugin-check.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
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: Package plugin
run: |
mkdir -p ./dist
tail -n +7 README.md > README.md.tmp && mv README.md.tmp README.md
rsync -rc --exclude-from=.distignore ./ ./dist/stklcode-liveticker --delete --delete-excluded

- name: Check WP plugin
uses: wordpress/plugin-check-action@v1
with:
build-dir: ./dist/stklcode-liveticker
2 changes: 1 addition & 1 deletion .github/workflows/wordpress-plugin-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
- 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
11 changes: 8 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@
* Contributors: Stefan Kalscheuer
* Tags: liveticker, feed, rss
* Requires at least: 4.7
* Tested up to: 6.4
* Tested up to: 6.7
* Requires PHP: 5.6
* Stable tag: 1.2.2
* Stable tag: 1.2.3
* License: GPLv2 or later
* License URI: http://www.gnu.org/licenses/gpl-2.0.html

Expand Down Expand Up @@ -80,7 +80,12 @@ caching time of 12 hours obviously makes no sense.

## Changelog

### 1.2.2 - 2023-03-02
### 1.2.3 - 2025-02-04

* Escape ticker ID in shortcode output
* Tested with WP 6.7

### 1.2.2 - 2024-03-02

* Update use of deprecated WP core functions
* Extend output sanitization
Expand Down
15 changes: 14 additions & 1 deletion bin/install-wp-tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,17 @@ download() {
curl -s "$1" > "$2";
elif [ `which wget` ]; then
wget -nv -O "$2" "$1"
else
echo "Error: Neither curl nor wget is installed."
exit 1
fi
}

# Check if svn is installed
check_svn_installed() {
if ! command -v svn > /dev/null; then
echo "Error: svn is not installed. Please install svn and try again."
exit 1
fi
}

Expand Down Expand Up @@ -64,6 +75,7 @@ install_wp() {
if [[ $WP_VERSION == 'nightly' || $WP_VERSION == 'trunk' ]]; then
mkdir -p $TMPDIR/wordpress-trunk
rm -rf $TMPDIR/wordpress-trunk/*
check_svn_installed
svn export --quiet https://core.svn.wordpress.org/trunk $TMPDIR/wordpress-trunk/wordpress
mv $TMPDIR/wordpress-trunk/wordpress/* $WP_CORE_DIR
else
Expand Down Expand Up @@ -92,7 +104,7 @@ install_wp() {
tar --strip-components=1 -zxmf $TMPDIR/wordpress.tar.gz -C $WP_CORE_DIR
fi

download https://raw.github.com/markoheijnen/wp-mysqli/master/db.php $WP_CORE_DIR/wp-content/db.php
download https://raw.githubusercontent.com/markoheijnen/wp-mysqli/master/db.php $WP_CORE_DIR/wp-content/db.php
}

install_test_suite() {
Expand All @@ -108,6 +120,7 @@ install_test_suite() {
# set up testing suite
mkdir -p $WP_TESTS_DIR
rm -rf $WP_TESTS_DIR/{includes,data}
check_svn_installed
svn export --quiet --ignore-externals https://develop.svn.wordpress.org/${WP_TESTS_TAG}/tests/phpunit/includes/ $WP_TESTS_DIR/includes
svn export --quiet --ignore-externals https://develop.svn.wordpress.org/${WP_TESTS_TAG}/tests/phpunit/data/ $WP_TESTS_DIR/data
fi
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "stklcode/stklcode-liveticker",
"version": "1.2.2",
"version": "1.2.3",
"description": "A simple Liveticker for Wordpress.",
"keywords": [
"wordpress",
Expand Down
8 changes: 4 additions & 4 deletions includes/class-scliveticker.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
*
* @var string OPTIONS
*/
const VERSION = '1.2.2';
const VERSION = '1.2.3';

/**
* Options tag.
Expand Down Expand Up @@ -208,7 +208,7 @@
$args = array(
'post_type' => 'scliveticker_tick',
'posts_per_page' => $limit,
'tax_query' => array(

Check warning on line 211 in includes/class-scliveticker.php

View workflow job for this annotation

GitHub Actions / check

WordPress.DB.SlowDBQuery.slow_db_query_tax_query

Detected usage of tax_query, possible slow query.

Check warning on line 211 in includes/class-scliveticker.php

View workflow job for this annotation

GitHub Actions / check

WordPress.DB.SlowDBQuery.slow_db_query_tax_query

Detected usage of tax_query, possible slow query.

Check warning on line 211 in includes/class-scliveticker.php

View workflow job for this annotation

GitHub Actions / check

WordPress.DB.SlowDBQuery.slow_db_query_tax_query

Detected usage of tax_query, possible slow query.
array(
'taxonomy' => 'scliveticker_ticker',
'field' => 'slug',
Expand All @@ -232,7 +232,7 @@
$output = '<div class="wp-block-scliveticker-ticker';
if ( 1 === self::$options['enable_ajax'] ) {
$output .= ' sclt-ajax" '
. 'data-sclt-ticker="' . $ticker . '" '
. 'data-sclt-ticker="' . esc_attr( $ticker ) . '" '
. 'data-sclt-limit="' . $limit . '" '
. 'data-sclt-last="' . $last;
}
Expand All @@ -242,9 +242,9 @@
if ( $show_feed ) {
$feed_link = get_post_type_archive_feed_link( 'scliveticker_tick' ) . '';
if ( false === strpos( $feed_link, '&' ) ) {
$feed_link .= '?scliveticker_ticker=' . $ticker;
$feed_link .= '?scliveticker_ticker=' . rawurlencode( $ticker );
} else {
$feed_link .= '&scliveticker_ticker=' . $ticker;
$feed_link .= '&scliveticker_ticker=' . rawurlencode( $ticker );
}
$output .= '<a href="' . esc_attr( $feed_link ) . '">Feed</a>';
}
Expand Down Expand Up @@ -335,7 +335,7 @@
$query_args = array(
'post_type' => 'scliveticker_tick',
'posts_per_page' => $limit,
'tax_query' => array(

Check warning on line 338 in includes/class-scliveticker.php

View workflow job for this annotation

GitHub Actions / check

WordPress.DB.SlowDBQuery.slow_db_query_tax_query

Detected usage of tax_query, possible slow query.

Check warning on line 338 in includes/class-scliveticker.php

View workflow job for this annotation

GitHub Actions / check

WordPress.DB.SlowDBQuery.slow_db_query_tax_query

Detected usage of tax_query, possible slow query.

Check warning on line 338 in includes/class-scliveticker.php

View workflow job for this annotation

GitHub Actions / check

WordPress.DB.SlowDBQuery.slow_db_query_tax_query

Detected usage of tax_query, possible slow query.
array(
'taxonomy' => 'scliveticker_ticker',
'field' => 'slug',
Expand Down
8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
{
"name": "stklcode-liveticker",
"version": "1.2.2",
"version": "1.2.3",
"description": "A simple Liveticker for Wordpress.",
"author": "Stefan Kalscheuer",
"license": "GPL-2.0+",
"devDependencies": {
"@wordpress/eslint-plugin": "^17",
"@wordpress/stylelint-config": "^21",
"@wordpress/eslint-plugin": "^22",
"@wordpress/stylelint-config": "^23",
"eslint": "^8",
"stylelint": "^14"
"stylelint": "^16"
}
}
2 changes: 1 addition & 1 deletion stklcode-liveticker.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
* @wordpress-plugin
* Plugin Name: Liveticker (by stklcode)
* Description: A simple Liveticker for WordPress.
* Version: 1.2.2
* Version: 1.2.3
* Author: Stefan Kalscheuer
* Author URI: https://www.stklcode.de
* Text Domain: stklcode-liveticker
Expand Down
Loading