24 Commits

Author SHA1 Message Date
Kevin Bataille
ba43d70a56 Reuse --author flag for update_meta command
- Use existing --author flag instead of --author-filter
- Consistent with export command
- Cleaner CLI interface

Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
2026-02-17 00:11:18 +01:00
Kevin Bataille
66ea25002a Add author filter to update_meta command
- Add --author-filter option to filter posts by author name
- Resolve author names to IDs via WordPress API
- Support partial matching for author names
- Works with other filters (category, limit, post-ids)
- Fix argparse conflict with existing --author flag

Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
2026-02-17 00:10:20 +01:00
Kevin Bataille
93ea5794f0 Add direct WordPress meta description updater
- Add update_meta command to fetch, generate, and update meta on WordPress
- Require --site parameter to specify target website
- Support filtering by post IDs (--post-ids)
- Support filtering by category names (--category) or IDs (--category-id)
- Support limit parameter to batch process posts
- Skip existing good quality meta descriptions by default
- Add --force flag to regenerate all meta descriptions
- Include dry-run mode to preview changes
- Save update results to CSV for review
- Rate limited API calls (0.5s delay between requests)

Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
2026-02-17 00:04:54 +01:00
Kevin Bataille
ba8e39b5d8 Add AI-powered meta description generation
- Add meta_description command to generate SEO-optimized meta descriptions
- Use AI to generate compelling, length-optimized descriptions (120-160 chars)
- Support --only-missing flag for posts without meta descriptions
- Support --only-poor flag to improve low-quality meta descriptions
- Include quality validation scoring (0-100)
- Add call-to-action detection and optimization
- Generate detailed CSV reports with validation metrics
- Add comprehensive documentation (META_DESCRIPTION_GUIDE.md)

Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
2026-02-16 23:54:35 +01:00
Kevin Bataille
84f8fc6db5 Add post migration and author filter features
- Add migrate command to transfer posts between websites
- Support CSV-based and filtered migration modes
- Preserve original post dates (with --ignore-original-date option)
- Auto-create categories and tags on destination site
- Add author filtering to export (--author and --author-id flags)
- Include author_name column in exported CSV
- Add comprehensive documentation (MIGRATION_GUIDE.md, AUTHOR_FILTER_GUIDE.md)

Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
2026-02-16 23:50:24 +01:00
Kevin Bataille
06d660f9c8 Add confidence breakdown display
- Shows High/Medium/Low count breakdown
- Helps verify all matching posts will be processed
- Example output:
  Filtered to 328 proposals (confidence >= Medium)
    Breakdown: High=293, Medium=35, Low=0

Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
2026-02-16 18:21:16 +01:00
Kevin Bataille
54168a1c00 Add strict confidence filtering option
### New Feature:
- --strict flag for exact confidence matching
- Default: Medium = Medium + High (or better)
- Strict: Medium = Medium only (exact match)

### Usage:
./seo category_apply -s mistergeek.net -c Medium      # Medium or better
./seo category_apply -s mistergeek.net -c Medium --strict  # Medium only

### Example Output:
# Default (or better):
Filtered to 328 proposals (confidence >= Medium)

# Strict mode:
Filtered to 156 proposals (confidence = Medium, strict mode)

### Benefits:
- More precise control over which posts to update
- Can process confidence levels separately
- Better for batch processing in stages

Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
2026-02-16 17:13:06 +01:00
Kevin Bataille
b265125656 Fix category_apply - Filter by site and show article titles
- Filter proposals by current_site (only applies to selected site)
- Show article title for each post
- Show current and proposed categories
- Better error logging

Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
2026-02-16 16:36:51 +01:00
Kevin Bataille
fa700cba98 Fix category lookup - handle French characters and existing categories better
### Fixes:
- Improved get_or_create_category() with multiple lookup strategies
- Handle French characters in category names (Jeu vidéo, Téléchargement)
- Better handling of 'term_exists' 400 error from WordPress
- Fetch existing category details when creation fails

### Lookup Order:
1. Exact name match (case-insensitive)
2. Slug match
3. Normalized slug (handles French characters)
4. Partial name match

### Benefits:
- No more errors for existing categories
- Handles accented characters properly
- Better caching of existing categories
- More robust category creation

Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
2026-02-16 16:33:01 +01:00
Kevin Bataille
00f0cce03e Fix method name - load_posts instead of load_csv
Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
2026-02-16 16:10:02 +01:00
Kevin Bataille
65eb83f76c Fix naming conflict - fetch_existing vs fetch_existing_categories
Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
2026-02-16 16:09:06 +01:00
Kevin Bataille
6a574bf07c Add existing category fetching to category_propose
New Feature:
- Fetch existing categories from WordPress sites before AI proposals
- AI now prefers existing categories to avoid duplicates
- Shows existing categories in AI prompt for better suggestions
- Tracks whether proposed categories are existing or new

### Changes:
- fetch_existing_categories() method - Gets categories from all sites
- Updated AI prompt includes existing categories list
- New CSV column: is_existing_category (Yes/No)
- Statistics showing existing vs new categories

### Benefits:
- Reduces category duplication
- Maintains consistency across posts
- AI makes smarter category suggestions
- Users can see which are existing vs new categories

### AI Prompt Enhancement:
EXISTING CATEGORIES (PREFER THESE TO AVOID DUPLICATES):

mistergeek.net:
  - VPN
  - Software
  - Gaming
  ...

webscroll.fr:
  - Torrenting
  - File-Sharing
  ...

IMPORTANT: Use existing categories when possible...

### Output:
Category Statistics:
  Using existing categories: 145 posts
  Proposing new categories: 12 posts

Usage:
./seo category_propose  # Now fetches existing categories automatically

Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
2026-02-16 15:58:51 +01:00
Kevin Bataille
b5c586e7ad Refactor category_propose to align with editorial strategy
Major refactoring of category proposal system:

### Changes:
- Integrated editorial strategy into category proposals
- Added site migration recommendations to category proposals
- AI now considers editorial lines when suggesting categories
- Automatic detection of posts that should migrate between sites

### New Features:
- Editorial line definitions for each site
- Topic-based site matching algorithm
- Migration recommendations alongside category proposals
- Dual output: category_proposals_*.csv + migration_recommendations_*.csv

### Editorial Lines:
mistergeek.net: VPN, Software, Gaming, SEO, Tech (high-value)
webscroll.fr: Torrenting, File-Sharing, Tracker Guides (niche)
hellogeek.net: Experimental, Low-Traffic, Off-Brand (catch-all)

### Output Files:
1. category_proposals_*.csv - Categories + site recommendations
2. migration_recommendations_*.csv - Posts to migrate between sites

### CSV Columns Added:
- recommended_site - Best site for the post
- should_migrate - Yes/No flag
- migration_reason - Why migration is recommended
- current_site - Original site for comparison

### Benefits:
- Categories aligned with site strategy
- Automatic migration detection
- Smarter AI prompts with editorial context
- Unified category + migration workflow

Usage:
./seo category_propose
# Generates both category and migration files

Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
2026-02-16 15:43:26 +01:00
Kevin Bataille
c980edf047 Add comprehensive editorial strategy documentation
Documentation:
- EDITORIAL_STRATEGY_GUIDE.md - Complete guide

Covers:
- How to determine editorial lines for each site
- How to migrate articles between sites
- Optimal category count per site (5-10 recommended)
- Complete workflow with examples
- Migration decision matrix
- Best practices (DO/DON'T)
- Monitoring results after migrations

Key Recommendations:
- mistergeek.net: 8-12 categories (tech focus)
- webscroll.fr: 5-8 categories (torrenting niche)
- hellogeek.net: 3-5 categories (catch-all)
- Migrate high-traffic posts to appropriate sites
- Always use 301 redirects when migrating
- Monitor traffic for 2-4 weeks after changes

Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
2026-02-16 15:32:12 +01:00
Kevin Bataille
86c9bb3a74 Add editorial strategy analyzer - Determine editorial lines and recommend migrations
New Features:
- Analyze editorial lines for each site based on actual content
- Recommend post migrations between sites
- Suggest optimal category structure per site
- Best practices for category count (5-10 per site)

New Command:
- seo editorial_strategy - Analyze and generate migration report

New Module:
- src/seo/editorial_strategy.py - Editorial strategy analyzer
  - EditorialStrategyAnalyzer: Main analyzer class
  - Analyzes content distribution per site
  - Determines editorial focus automatically
  - Recommends post migrations based on topics
  - Suggests optimal category structure

Analysis Includes:
- Category distribution per site
- Topic analysis (VPN, Software, Gaming, Torrenting, etc.)
- Traffic distribution
- Content gaps identification
- Overlapping content detection
- Migration recommendations with priority

Category Recommendations:
- mistergeek.net: 8-12 categories (tech focus)
- webscroll.fr: 5-8 categories (torrenting niche)
- hellogeek.net: 3-5 categories (catch-all)

Output:
- Comprehensive markdown report
- Migration recommendations table
- Category structure recommendations
- Action plan

Usage:
./seo editorial_strategy                    # Analyze latest export
./seo editorial_strategy posts.csv          # Analyze specific CSV
# Generates: output/editorial_strategy_*.md

Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
2026-02-16 15:31:29 +01:00
Kevin Bataille
3c4b72c0ea Add category management - Create and update WordPress categories from AI
New Features:
- Create WordPress categories based on AI proposals
- Bulk assign posts to categories
- Confidence-based filtering (High/Medium/Low)
- Manual category creation
- Dry run mode for safe preview

New Commands:
- seo category_apply - Apply AI proposals to WordPress
- seo category_create - Create new category manually

New Modules:
- src/seo/category_manager.py - WordPress category management
  - WordPressCategoryManager: Create/get categories
  - CategoryAssignmentProcessor: Process AI proposals

Features:
- Automatic category creation if doesn't exist
- Bulk category assignment
- Confidence threshold filtering
- Append mode (doesn't replace existing categories)
- Comprehensive error handling
- Detailed statistics and logging

Usage:
./seo category_propose                    # Get AI proposals
./seo category_apply -s mistergeek.net    # Apply to site
./seo category_apply -s site -c High      # High confidence only
./seo category_create -s site "New Cat"   # Create category
./seo category_apply --dry-run            # Preview changes

Documentation:
- CATEGORY_MANAGEMENT_GUIDE.md - Complete guide

Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
2026-02-16 15:25:33 +01:00
Kevin Bataille
c8fb141cdd Refactor to single integrated package - Remove scripts folder
Major refactoring to create a unified, self-contained Python package:

### Architecture Changes:
- Removed scripts/ directory completely
- All functionality now in src/seo/ package
- Single entry point: ./seo (imports from src/seo/cli)
- No external dependencies on scripts folder

### New Package Structure:
src/seo/
├── __init__.py          - Package exports (SEOApp, PostExporter, etc.)
├── cli.py               - Command-line interface
├── app.py               - Main application class
├── config.py            - Configuration management
├── exporter.py          - Post export functionality (self-contained)
├── analyzer.py          - Enhanced analyzer with selective fields
├── category_proposer.py - AI category proposals (self-contained)
├── seo_checker.py       - Placeholder for future implementation
├── categories.py        - Placeholder for future implementation
├── approval.py          - Placeholder for future implementation
└── recategorizer.py     - Placeholder for future implementation

### Features:
- All modules are self-contained (no scripts dependencies)
- EnhancedPostAnalyzer with selective field analysis
- CategoryProposer for AI-powered category suggestions
- Support for in-place CSV updates with backups
- Clean, integrated codebase

### CLI Commands:
- seo export - Export posts from WordPress
- seo analyze - Analyze with AI (supports -f fields, -u update)
- seo category_propose - Propose categories
- seo status - Show output files
- seo help - Show help

### Usage Examples:
./seo export
./seo analyze -f title categories
./seo analyze -u -f meta_description
./seo category_propose
./seo status

### Benefits:
- Single source of truth
- Easier to maintain and extend
- Proper Python package structure
- Can be installed with pip install -e .
- Clean imports throughout
- No path resolution issues

Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
2026-02-16 15:20:11 +01:00
Kevin Bataille
95092a591f Add lock files to .gitignore
Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
2026-02-16 15:13:33 +01:00
Kevin Bataille
8196e73a8e Fix import paths in src/seo modules and restore scripts directory
- Fixed relative path calculation for scripts directory
- Used Path(__file__).parents[2] for correct path resolution
- Added check to prevent duplicate path additions
- Restored scripts directory from git index

Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
2026-02-16 15:13:09 +01:00
Kevin Bataille
1744d8e7db Add enhanced analysis with selective field analysis and category proposer
New Features:
- Selective field analysis: Choose which fields to analyze (title, meta_description, categories, site)
- In-place CSV updates: Update input CSV with new columns (automatic backup created)
- Category proposer: Dedicated command for AI-powered category suggestions

New Commands:
- seo analyze -f title categories: Analyze specific fields only
- seo analyze -u: Update input CSV with recommendations
- seo category_propose: Propose categories based on content

New Scripts:
- enhanced_analyzer.py: Enhanced AI analyzer with selective analysis
- category_proposer.py: Dedicated category proposal tool

CLI Options:
- --fields, -f: Specify fields to analyze
- --update, -u: Update input CSV (creates backup)
- --output, -o: Custom output file path

Output Columns:
- proposed_title, title_reason (for title analysis)
- proposed_meta_description, meta_reason (for meta analysis)
- proposed_category, category_reason (for category analysis)
- proposed_site, site_reason (for site analysis)
- ai_confidence, ai_priority (common to all)

Documentation:
- ENHANCED_ANALYSIS_GUIDE.md: Complete guide with examples

Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
2026-02-16 14:57:42 +01:00
Kevin Bataille
9d0a2c77eb Add ARCHITECTURE.md documenting the integrated package structure
Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
2026-02-16 14:51:07 +01:00
Kevin Bataille
d1b8e2c292 Refactor into integrated Python package structure
Architecture Changes:
- Created src/seo/ package with modular architecture
- Main application class (SEOApp) with Rails-inspired API
- Separated concerns into distinct modules:
  - app.py: Main application orchestrator
  - cli.py: Command-line interface
  - config.py: Configuration management
  - exporter.py: Post export functionality
  - analyzer.py: AI analysis
  - recategorizer.py: Recategorization
  - seo_checker.py: SEO quality checking
  - categories.py: Category management
  - approval.py: User approval system

New Features:
- Proper Python package structure (src layout)
- setup.py and setup.cfg for installation
- Can be installed with: pip install -e .
- Entry point: seo = seo.cli:main
- Cleaner imports and dependencies

Benefits:
- Better code organization
- Easier to maintain and extend
- Follows Python best practices
- Proper package isolation
- Can be imported as library
- Testable components
- Clear separation of concerns

Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
2026-02-16 14:37:11 +01:00
Kevin Bataille
8c7cd24685 Refactor SEO automation into unified CLI application
Major refactoring to create a clean, integrated CLI application:

### New Features:
- Unified CLI executable (./seo) with simple command structure
- All commands accept optional CSV file arguments
- Auto-detection of latest files when no arguments provided
- Simplified output directory structure (output/ instead of output/reports/)
- Cleaner export filename format (all_posts_YYYY-MM-DD.csv)

### Commands:
- export: Export all posts from WordPress sites
- analyze [csv]: Analyze posts with AI (optional CSV input)
- recategorize [csv]: Recategorize posts with AI
- seo_check: Check SEO quality
- categories: Manage categories across sites
- approve [files]: Review and approve recommendations
- full_pipeline: Run complete workflow
- analytics, gaps, opportunities, report, status

### Changes:
- Moved all scripts to scripts/ directory
- Created config.yaml for configuration
- Updated all scripts to use output/ directory
- Deprecated old seo-cli.py in favor of new ./seo
- Added AGENTS.md and CHANGELOG.md documentation
- Consolidated README.md with updated usage

### Technical:
- Added PyYAML dependency
- Removed hardcoded configuration values
- All scripts now properly integrated
- Better error handling and user feedback

Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
2026-02-16 14:24:44 +01:00
Kevin Bataille
3b51952336 Initial commit: Clean SEO analysis system 2026-02-16 05:25:16 +04:00