10 Commits

Author SHA1 Message Date
7beb0037f6 prepare release of v1.3.1 (#33) 2025-08-16 11:06:34 +02:00
502abb10af remove explicit call to load_plugin_textdomain (#34)
Loading the textdomain explicitly is not required for plugins hosted
on w.org since WordPress 4.6. Remove the call from our init routine.
2025-08-16 10:58:59 +02:00
f27d90eb8f make uninstall hook more robust against unexpected return values 2025-08-13 12:08:06 +02:00
9d39d149fb fix comment for $widget_present 2025-08-13 12:07:12 +02:00
78c17bdbbf define a custom ID base for WP_Widget initialization 2025-08-13 11:50:11 +02:00
d1ba1d0eb4 use empty array for wp_enqueue_style() dependencies
At some point a negative check using `is_array($deps)` adds a fallback
to an empty array which is actually our desired behavior as we do not
have any dependencies. Use an empty array explicitly to comply with
the method contract to explicitly declare "no dependencies".
2025-08-13 11:49:17 +02:00
5bd7989070 ci: update actions 2025-08-13 11:36:46 +02:00
121051b7d0 use add_action() instead of add_filter() for rest_api_init (#32)
The `rest_api_init` hook is an action hook and should be used as such.
Replace `add_filter()` with `add_action()` to register our init method.
2025-08-13 11:09:17 +02:00
10c37189b7 update dev-dependencies 2025-08-13 10:55:38 +02:00
6d034b4ea3 ci: add PHP 8.4 and WordPress 6.8 to test matrix 2025-04-19 13:56:38 +02:00
11 changed files with 39 additions and 26 deletions

View File

@@ -6,6 +6,8 @@ jobs:
strategy:
matrix:
include:
- php: '8.4'
wordpress: '6.8'
- php: '8.3'
wordpress: '6.6'
- php: '8.2'
@@ -18,7 +20,7 @@ jobs:
wordpress: '5.9'
steps:
- name: Checkout
uses: actions/checkout@v4
uses: actions/checkout@v5
- name: Install SVN
run: |
if ! command -v svn > /dev/null; then
@@ -44,7 +46,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
uses: actions/checkout@v5
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
@@ -68,12 +70,12 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
uses: actions/checkout@v5
with:
fetch-depth: 0
- name: Analyze with SonarCloud
if: env.SONAR_TOKEN != ''
uses: sonarsource/sonarcloud-github-action@v3
uses: sonarsource/sonarqube-scan-action@v5
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}

View File

@@ -9,7 +9,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
uses: actions/checkout@v5
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:

View File

@@ -9,7 +9,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
uses: actions/checkout@v5
- name: Package plugin
run: |

View File

@@ -10,7 +10,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
uses: actions/checkout@v5
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:

View File

@@ -9,9 +9,9 @@
* Contributors: stklcode
* Tags: liveticker, feed, rss
* Requires at least: 5.0
* Tested up to: 6.7
* Tested up to: 6.8
* Requires PHP: 7.2
* Stable tag: 1.3.0
* Stable tag: 1.3.1
* License: GPLv2 or later
* License URI: https://www.gnu.org/licenses/gpl-2.0.html
@@ -80,6 +80,13 @@ caching time of 12 hours obviously makes no sense.
## Changelog
### 1.3.1 - 2025-08-16
* Textdomain is no longer loaded explicitly
* Internal filter and action hooks consolidated
* Minor internal code fixes
* Tested with WP 6.8
### 1.3.0 - 2025-03-10
* Requires at least PHP 7.2 and WordPress 5.0

View File

@@ -1,6 +1,6 @@
{
"name": "stklcode/stklcode-liveticker",
"version": "1.3.0",
"version": "1.3.1",
"description": "A simple Liveticker for Wordpress.",
"keywords": [
"wordpress",
@@ -21,12 +21,12 @@
"composer/installers": "~v2.3.0"
},
"require-dev": {
"dealerdirect/phpcodesniffer-composer-installer": "^v1.0",
"dealerdirect/phpcodesniffer-composer-installer": "^v1.1",
"matthiasmullie/minify": "^1.3",
"phpcompatibility/phpcompatibility-wp": "^2.1",
"slowprog/composer-copy-file": "~0.3",
"squizlabs/php_codesniffer": "^3.11",
"wp-coding-standards/wpcs": "^3.1",
"squizlabs/php_codesniffer": "^3.13",
"wp-coding-standards/wpcs": "^3.2",
"yoast/wp-test-utils": "^1.2"
},
"scripts": {

View File

@@ -26,7 +26,7 @@ class SCLiveticker {
*
* @var string OPTIONS
*/
const VERSION = '1.3.0';
const VERSION = '1.3.1';
/**
* Options tag.
@@ -53,7 +53,7 @@ class SCLiveticker {
/**
* Marker if widget is present.
*
* @var boolean $shortcode_present
* @var boolean $widget_present
*/
protected static $widget_present = false;
@@ -72,7 +72,7 @@ class SCLiveticker {
self::update_options();
// Add filter for REST API queries.
add_filter( 'rest_api_init', array( 'SCLiveticker\\Api', 'init' ) );
add_action( 'rest_api_init', array( 'SCLiveticker\\Api', 'init' ) );
add_filter( 'rest_scliveticker_tick_query', array( 'SCLiveticker\\Api', 'tick_query_filter' ), 10, 2 );
// Skip on AJAX if not enabled.
@@ -80,9 +80,6 @@ class SCLiveticker {
return;
}
// Load Textdomain.
load_plugin_textdomain( 'stklcode-liveticker' );
// Allow shortcodes in widgets.
add_filter( 'widget_text', 'do_shortcode' );
@@ -288,7 +285,7 @@ class SCLiveticker {
wp_enqueue_style(
'sclt-css',
SCLIVETICKER_BASE . 'styles/liveticker.min.css',
'',
array(),
self::VERSION
);
}

View File

@@ -9,6 +9,7 @@
namespace SCLiveticker;
use WP_Post;
use WP_Query;
// Exit if accessed directly.
@@ -53,7 +54,11 @@ class System extends SCLiveticker {
// Delete all ticks.
$ticks = new WP_Query( array( 'post_type' => 'scliveticker_tick' ) );
foreach ( $ticks->get_posts() as $tick ) {
if ( $tick instanceof WP_Post ) {
wp_delete_post( $tick->ID, true );
} else {
wp_delete_post( $tick, true );
}
}
// Temporarily register taxonomy to delete it.
@@ -66,9 +71,11 @@ class System extends SCLiveticker {
'hide_empty' => false,
)
);
if ( ! is_wp_error( $tickers ) ) {
foreach ( $tickers as $ticker ) {
wp_delete_term( $ticker->term_id, 'scliveticker_ticker' );
}
}
// Unregister taxonomy again.
unregister_taxonomy( 'scliveticker_ticker' );

View File

@@ -25,7 +25,7 @@ class Widget extends WP_Widget {
* SCLiveticker_Widget constructor.
*/
public function __construct() {
parent::__construct( false, 'Liveticker' );
parent::__construct( 'scliveticker', 'Liveticker' );
}
/**

View File

@@ -1,6 +1,6 @@
{
"name": "stklcode-liveticker",
"version": "1.3.0",
"version": "1.3.1",
"description": "A simple Liveticker for Wordpress.",
"author": "Stefan Kalscheuer",
"license": "GPL-2.0+",

View File

@@ -9,7 +9,7 @@
* @wordpress-plugin
* Plugin Name: Liveticker (by stklcode)
* Description: A simple Liveticker for WordPress.
* Version: 1.3.0
* Version: 1.3.1
* Author: Stefan Kalscheuer
* Author URI: https://www.stklcode.de
* Text Domain: stklcode-liveticker