Skip to content

Conversation

@fl0om
Copy link

@fl0om fl0om commented Jan 27, 2026

This PR adds WP-CLI support for updating FeedWordPress feeds, providing a modern alternative to the existing ?update_feedwordpress=1 URL parameter method.

Changes:

  • Added wp-cli-command.php with wp feedwordpress update command
  • Integrated WP-CLI command loading in feedwordpress.php

Usage:

# Update all feeds (equivalent to ?update_feedwordpres=1)
wp feedwordpress update

# Update specific feed
wp feedwordpress update http://example.com/feed

# Alternative syntax
wp feedwordpress update --url=http://example.com/feed

The WP-CLI command calls the same $feedwordpress->update($uri) method as the URL parameter, ensuring identical behavior with a cleaner, more maintainable interface for cron jobs and scheduled tasks.

Daniel added 3 commits January 14, 2026 11:52
When feedwordpress_diagnostics_output option doesn't exist in the database,
get_option() returns false instead of the default array() value, causing a
PHP Warning when attempting to iterate over $output in foreach().

This issue affected installations without saved diagnostic settings. The admin
interface already handled this case correctly with an is_array() check
(diagostics-page.php:190-193), but the diagnostic() method did not.

Cast to array() ensures $output is always iterable, preventing the warning.
Adds wp-cli-command.php with 'wp feedwordpress update' command to provide a modern alternative to the ?update_feedwordpress=1 URL parameter method. The WP-CLI command accepts optional feed URL as argument, updating all feeds if not specified.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant