Skip to content

About

fetch tweeter feed for wordpress

Resources

Stars

1 star

Watchers

0 watching

Forks

Latest commit

 

History

65 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Twitter Feed - Nitter Hybrid Cache Plugin

IMPORTANT NOTICE: This project is no longer maintained and has reached a dead end.

The methods used by this plugin to fetch tweets (both from public Nitter instances and the official Twitter Syndication API) have become unreliable and are consistently blocked by advanced bot-detection systems. After extensive efforts to bypass these restrictions, it has become clear that a stable, unauthenticated method for fetching tweets is no longer viable with this approach.

As a result, this plugin is not functional and should not be used.

Thank you to everyone who followed the project's development.


A WordPress plugin that was designed to fetch and display Twitter feeds using public, unauthenticated methods without requiring the X.com API. This plugin no longer works.

Features

  • (DEPRECATED) Nitter Integration: Previously fetched tweets from public Nitter instances and the official Twitter Syndication API.
  • Hybrid Caching Strategy:
    • WordPress transients for fast access
    • Database storage for persistent caching
    • Configurable cache expiration
  • Scheduled Updates: WordPress cron scheduling (hourly, 6-hourly, or daily)
  • Admin Settings Panel: Easy configuration via WordPress admin
  • Manual Refresh: Fetch tweets immediately from the admin panel
  • Responsive Design: Mobile-friendly tweet display
  • Error Handling: Graceful fallbacks and comprehensive logging
  • Shortcode Support: Easy integration with [twitter-feed] shortcode

Installation

  1. Upload the plugin folder to /wp-content/plugins/
  2. Activate the plugin from the WordPress admin panel
  3. Go to Settings → Twitter Feed to configure

Configuration

Basic Settings

  1. Twitter Username: Enter the Twitter account username (without @)
  2. Number of Tweets: Choose how many tweets to display (1-100)
  3. Cache Refresh Frequency: Select update interval (hourly, 6-hourly, or daily)
  4. Nitter Instance URL (optional): Use a custom Nitter instance if needed

Default Nitter Instance

The plugin uses https://xcancel.com by default (a stable Nitter fork). If that instance is unavailable in your environment, you can configure an alternative Nitter-compatible instance in the plugin settings (the plugin will also try a small set of built-in fallbacks automatically).

Usage

Shortcode

Display tweets on any page or post using the shortcode:

[twitter-feed]

Advanced Shortcode Options

[twitter-feed username="twitter" count="10" cache_refresh="6hours"]

Parameters:

  • username (string): Twitter username to display tweets from
  • count (integer): Number of tweets to show (1-100, default: 10)
  • cache_refresh (string): Cache expiration - hourly, 6hours, or daily

How It Works

Data Flow

  1. Fetch: Plugin fetches tweets from Nitter via RSS feed (no API key required)
  2. Store: Tweets are saved to the database with metadata
  3. Cache: Tweets are cached in WordPress transients for fast access
  4. Display: Shortcode retrieves cached or database tweets for display

Cron Scheduling

  • Automated cron events run according to configured frequency
  • Fetches fresh tweets and updates the cache
  • Falls back to cached tweets if Nitter fetch fails
  • Comprehensive error logging for troubleshooting

Error Handling

  • Nitter Unavailable: Falls back to cached tweets
  • Network Issues: Logs errors and preserves last known tweets
  • Invalid Configuration: Admin notices alert users to missing settings
  • Error Log: Recent errors visible in admin panel

Database

The plugin creates a custom table wp_twitter_feed_tweets with the following fields:

  • id: Unique record ID
  • tweet_id: Twitter tweet ID
  • username: Twitter username
  • text: Tweet text content
  • link: Link to the tweet
  • timestamp: Unix timestamp of tweet
  • pub_date: Publication date
  • description: Full tweet description
  • media: JSON array of media URLs
  • created_at: When record was created
  • updated_at: When record was last updated

Caching

Transients (WordPress Cache)

  • Speed: Instant access to cached tweets
  • Duration: Configurable (1, 6, or 24 hours)
  • Fallback: Automatically expires and refreshes

Database Storage

  • Persistence: Tweets retained even if transient cache clears
  • Backup: Provides fallback if scheduled fetches fail
  • Searchable: Can be queried for extended functionality

Troubleshooting

No tweets display

  1. Verify the Twitter username is correct in settings
  2. Check that the Nitter instance is accessible
  3. Click "Fetch Tweets Now" to trigger manual refresh
  4. Check the Recent Errors section for details

Debugging Custom Nitter URL

If you set a custom Nitter URL but it seems to be ignored:

  1. Enable WP_DEBUG in wp-config.php:

    define('WP_DEBUG', true);
    define('WP_DEBUG_LOG', true);
  2. Check the Debug Info box (appears in admin when WP_DEBUG is enabled):

    • Verify "Is Custom URL Set?" shows "YES"
    • Verify your URL is listed first with [PRIMARY] marker
    • Check "Custom URL Option Value" shows your URL
  3. Test Manual Fetch:

    • Click "Fetch Tweets Now"
    • Check the success message for "Instance Used"
    • Open browser console (F12) and look for [Twitter Feed] logs
  4. Review debug.log:

    • Located at wp-content/debug.log
    • Search for [Twitter Feed] entries
    • Look for "Custom Nitter URL configured" and "Trying instance" logs

Note: If you see your custom URL in error messages, it means the plugin IS trying it first (as designed), but it's failing. The plugin will automatically try fallback instances if the primary fails.

For detailed debugging guide, see CUSTOM_URL_DEBUG_GUIDE.md and QUICK_DEBUG_REFERENCE.md.

Plugin not activating

  • Ensure WordPress version supports the required PHP version (7.4+)
  • Check error logs for database table creation issues
  • Verify file permissions in the plugin directory

Cron not executing

  • WordPress cron relies on site traffic; if traffic is low, consider using a real cron
  • To use real cron, add to wp-config.php:
    define('DISABLE_WP_CRON', true);
    Then add a real cron job to your server:
    * * * * * curl https://yoursite.com/wp-cron.php?doing_wp_cron >/dev/null 2>&1

Requirements

  • WordPress 5.0+
  • PHP 7.4+
  • cURL or WordPress HTTP functions enabled
  • Outbound HTTPS connections allowed

Privacy

  • This plugin does not store any user data
  • Tweets are fetched from public Nitter instances
  • No tracking or analytics are included
  • All data is stored locally in your WordPress database

License

GPL v2 or later

Support

For issues and feature requests, please visit the plugin repository.

Changelog

Version 1.0.0

  • Initial release
  • Nitter RSS feed integration
  • WordPress cron scheduling
  • Hybrid caching system
  • Admin settings panel
  • Tweet shortcode
  • Error handling and logging

About

fetch tweeter feed for wordpress

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages