=== YoApy Social Poster ===
Contributors: yoapy
Tags: social media, facebook, instagram, youtube, tiktok
Requires at least: 5.0
Tested up to: 6.9
Stable tag: 1.7.8
License: GPLv2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html

Schedule and publish posts to Facebook, Instagram, YouTube, and TikTok directly from your WordPress dashboard.

== Description ==

Schedule and publish posts to Facebook, Instagram, YouTube, and TikTok directly from your WordPress dashboard.

Features:
* Schedule posts to multiple social networks
* Support for image posts, video posts, stories, and YouTube Live schedules
* Easy-to-use interface integrated with WordPress
* Automatic caption generation from post content
* Support for all major social networks: Facebook, Instagram, YouTube, and TikTok

== External Services ==

This plugin relies on the YoApy API to function.

*   **Service:** YoApy API
*   **URL:** https://api.yoapy.com
*   **Purpose:** To authenticate your social media accounts and publish posts on your behalf.
*   **Data Sent:** When you connect an account, we send the authorization code to obtain an access token. When you publish a post, we send the post content (text, media URLs) and the target social account IDs.
*   **Terms of Service:** [YoApy Terms](https://yoapy.com/terms)
*   **Privacy Policy:** [YoApy Privacy Policy](https://yoapy.com/privacy)

== Installation ==

1. Upload the plugin files to the `/wp-content/plugins/yoapy-social-poster` directory, or install the plugin through the WordPress plugins screen directly.
2. Activate the plugin through the 'Plugins' screen in WordPress
3. Use the Settings->YoApy screen to configure the plugin
4. Create your API keys at https://yoapy.com
5. Enter your API keys in the plugin settings
6. Start scheduling posts!

== Frequently Asked Questions ==

= Do I need API keys to use this plugin? =

Yes, you need to create API keys at https://yoapy.com to use this plugin.

= Which social networks are supported? =

The plugin supports Facebook, Instagram, YouTube, and TikTok.

= Can I schedule posts in advance? =

Yes, you can schedule posts to be published at any future date and time.

== Screenshots ==

1. Planner interface for scheduling posts
2. Post metabox for auto-publishing
3. Settings page for API configuration
4. Logs page for tracking post status

== Changelog ==

= 1.7.8 =
* Fixed Facebook permalink showing as relative URL instead of full link
* Normalized all social network permalinks to include full domain
* Fix applies to new and existing task results

= 1.7.7 =
* Reduced task polling interval from 5s to 30s for better performance
* Improved task result parsing with robust permalink extraction from API response
* Added support for composite network keys (e.g. facebook:handle)
* Better error message extraction from failed tasks
* Added handling for complete_with_error API status
* Removed excessive console.error logging from task list rendering

= 1.7.6 =
* Added connection_id support for API calls (numeric connection IDs bypass name resolution)
* Improved post creation with direct connection targeting

= 1.7.5 =
* Fixed preview not displaying images and videos (CSS conflict with hidden class)
* Fixed video from media library showing as broken image in preview
* Improved preview UI/UX to match real social network interfaces
* Preview action buttons now use icons only (no translated text breaking layout)
* Media picker now auto-detects video vs image and routes to correct field

= 1.7.4 =
* Fixed all unescaped variable outputs using esc_attr() and esc_html()
* Added ABSPATH guard to debug-test.php to prevent direct file access
* Removed extraneous screenshot files from plugin trunk directory
* Addressed all WordPress.org plugin review feedback

= 1.7.3 =
* Maintenance release for WordPress.org repository compliance
* Removed disallowed files and assets
* Added license information to plugin header
* Updated external service disclosures
* Refactored inline JavaScript to external files

= 1.6.72 =
* Fixed issue with renderTaskList function not being properly exposed to global scope
* Enhanced JavaScript module initialization to ensure proper function exposure
* Fixed 'renderTaskList is undefined' error in console
* Improved global object initialization reliability

= 1.6.71 =
* Fixed issue with preview images not loading properly
* Enhanced task list rendering with improved DOM element detection
* Added more robust error handling for media preview loading
* Improved retry mechanisms for task list display
* Fixed issues with video playback in preview area
* Enhanced array validation for task data

= 1.6.70 =
* Fixed issue with tasks and logs not appearing in the task list
* Enhanced JavaScript task handling with improved array validation
* Added comprehensive logging for task creation, processing, and deletion
* Improved AJAX response handling with better error management
* Fixed renderTaskList function exposure and global scope issues
* Enhanced DOM element detection and retry mechanisms

= 1.6.69 =
* Fixed issue with renderTaskList function not being properly exposed to global scope
* Added delay mechanism to ensure proper script loading order
* Removed premature function existence check that prevented initial task loading

= 1.6.68 =
* Fixed issue with task list containers not being found in DOM
* Added retry mechanism with document ready state checking
* Improved DOM element detection with fallback selectors
* Fixed JavaScript error in network restrictions initialization

= 1.6.67 =
* Fixed issue with YoApyPlanner object not being properly initialized
* Improved task list rendering reliability

= 1.6.66 =
* Fixed issue with task list not rendering properly in some cases
* Improved DOM element checking in renderTaskList function

= 1.6.65 =
* Fixed JavaScript error preventing task list from rendering
* Improved consistency in task list rendering checks

= 1.6.64 =
* Fixed issue with tasks not appearing in the task list
* Fixed task status not updating correctly after processing
* Improved automatic post creation workflow

= 1.6.63 =
* Fixed issues with posts not appearing in tasks list
* Improved post publishing workflow and error handling
* Enhanced debugging and logging for troubleshooting
* Fixed task creation issues for various post types

= 1.6.62 =
* Fixed issues with task scheduling and display in the planner
* Fixed issues with log display and filtering
* Improved AJAX communication between frontend and backend
* Enhanced task list updates and real-time status tracking

= 1.6.59 =
* Minor adjustments and improvements based on user feedback

= 1.6.58 =
* Fixed critical JavaScript scope issue where YoApyPlanner functions were not properly exposed to global scope
* Ensured consistent use of window.YoApyPlanner throughout all JavaScript modules
* Resolved task list not updating automatically after create/delete operations

= 1.6.57 =
* Fixed bug in planner-modal.js that caused modal to not close properly

= 1.6.56 =
* Fixed critical syntax error in planner-core.js that prevented renderTaskList function definition
* Corrected JavaScript syntax structure in core module to ensure proper execution
* Resolved function definition scope issues preventing task list updates
* Enhanced JavaScript module reliability and execution flow

= 1.6.55 =
* Resolved conflicts between planner-modal.js and planner-ui.js modal implementations
* Fixed YoApyPlanner object redefinition issues across multiple JavaScript modules
* Improved task list real-time updates for both creation and deletion operations
* Enhanced JavaScript module initialization and function exposure consistency

= 1.6.54 =
* Added comprehensive error handling and debugging logs to planner-core.js
* Enhanced renderTaskList function definition with try/catch blocks
* Improved YoApyPlanner object initialization reliability
* Enhanced JavaScript module loading error detection

= 1.6.53 =
* Added debugging logs to diagnose persistent renderTaskList issue
* Enhanced YoApyPlanner object initialization verification
* Improved task list update reliability with detailed logging
* Enhanced JavaScript module loading diagnostics

= 1.6.52 =
* Fixed persistent YoApyPlanner.renderTaskList function not available error
* Added wait mechanism for YoApyPlanner object initialization
* Improved reliability of task list updates after publishing
* Enhanced JavaScript module loading synchronization

= 1.6.51 =
* Fixed YoApyPlanner.renderTaskList function not available error
* Ensured proper exposure of YoApyPlanner object to global scope
* Improved reliability of task list updates after publishing
* Enhanced JavaScript module loading and initialization

= 1.6.50 =
* Fixed $ is not a function error in planner-form.js
* Restored proper jQuery wrapper for form handling
* Ensured jQuery compatibility with WordPress environment
* Improved form submission and validation reliability

= 1.6.49 =
* Fixed initNetworkFields is not defined error
* Moved initNetworkFields function to global scope
* Ensured proper function exposure for external script calls
* Improved network field initialization reliability

= 1.6.48 =
* Fixed YoApyPlanner.renderTaskList function not available error
* Added global renderTaskList function to YoApyPlanner object
* Enabled real-time task list updates without page reload
* Improved task list rendering consistency across all modules

= 1.6.47 =
* Fixed YoApyPlanner.api is not a function error
* Improved delete button hover style - red text on white background
* Enhanced AJAX error handling and logging
* Removed duplicate modal initialization conflicts

= 1.6.46 =
* Fixed task not being deleted after confirming in modal
* Improved AJAX response handling for delete operations
* Added better error logging for debugging delete issues
* Enhanced task list refresh after deletion

= 1.6.45 =
* Fixed delete modal not responding to button clicks
* Resolved conflicts between multiple modal initialization systems
* Improved modal visibility and event handling
* Enhanced CSS transitions for smoother modal appearance

= 1.6.44 =
* Fixed delete button hover style to maintain text visibility
* Improved visual feedback for delete and post actions
* Enhanced modal button handling to prevent freezing
* Added better error handling and user feedback

= 1.6.43 =
* Fixed delete modal completely with centralized modal system
* Improved real-time task list updates after saving tasks
* Enhanced modal event handling to prevent conflicts
* Added dedicated modal management system

= 1.6.42 =
* Fixed delete modal buttons not working and modal not closing
* Completely resolved duplicate media picker modal issue
* Improved real-time task list updates with retry mechanism
* Enhanced error handling and user feedback

= 1.6.41 =
* Fixed real-time task list updates after saving and deleting tasks
* Fixed duplicate media picker modal issue
* Improved AJAX response handling with better error management
* Enhanced task list rendering to ensure consistency
* Fixed undefined variables in delete modal

= 1.6.40 =
* Fixed real-time task list updates after saving and deleting tasks
* Fixed duplicate media picker modal issue
* Improved AJAX response handling with fallback mechanisms
* Enhanced task list rendering to ensure consistency

= 1.6.39 =
* Fixed real-time task list updates after saving and deleting tasks
* Improved AJAX response handling for better user experience
* Enhanced task list rendering to ensure consistency

= 1.6.38 =
* Fixed JavaScript errors with YoApyPlanner.api and YoApyPlanner.toast functions
* Improved error handling for planner delete and save operations
* Enhanced compatibility with WordPress 6.9

= 1.6.37 =
* Fixed network restrictions in metabox to match planner functionality
* Fixed double media picker issue in post creation
* Improved planner delete functionality
* Updated WordPress compatibility to 6.9

= 1.6.36 =
* Added network restrictions based on post type (YouTube/TikTok require video)
* Improved UI/UX for select elements in metabox sidebar
* Fixed TikTok creator info section removal

= 1.6.35 =
* Added CSS constraints to prevent metabox select elements from overflowing
* Improved UI consistency between metabox and planner

= 1.6.34 =
* Removed separate TikTok creator info functionality
* Simplified account information display for all networks

= 1.6.33 =
* Removed TikTok Creator Info section from metabox template
* Cleaned up associated JavaScript code

= 1.6.32 =
* Updated AJAX handler to use single endpoint for fetching all account information
* Improved avatar loading for all social networks

= 1.6.31 =
* Added methods to fetch profile information for all networks (Facebook, Instagram, YouTube)
* Updated AJAX handler to properly fetch avatar URLs for all networks

= 1.6.30 =
* Enhanced AJAX handler to properly handle TikTok creator info with avatar URLs
* Fixed profile image loading issues

= 1.6.29.1 =
* Hotfix for missing YOAPSOPO_PLUGIN_FILE constant

= 1.6.29 =
* Restored missing constants that were accidentally removed
* Deployed hotfix to WordPress SVN

= 1.6.28 =
* Removed debug labels from planner template
* Updated avatar display to include img elements for displaying actual profile images
* Enhanced JavaScript to fetch and display actual avatar images
* Fixed metabox template to properly receive $has_keys variable

= 1.6.27 =
* Implemented account information display in planner page
* Fixed JavaScript initialization issues
* Added debugging features

= 1.6.26 =
* Fixed JavaScript error handling
* Improved account section visibility for all networks
* Enhanced error messaging for AJAX failures

= 1.6.25 =
* Fixed critical TikTok account information display issues
* Improved error handling and debugging

= 1.6.24 =
* Enhanced TikTok Direct Post API compliance
* Improved creator information retrieval and display

= 1.6.23 =
* Implemented TikTok creator info display functionality
* Added proper error handling and logging
* Prepared localization strings

= 1.6.22 =
* Fixed metabox.php file corruption issue
* Restored proper HTML structure

= 1.6.21 =
* Implemented TikTok Direct Post API integration
* Added creator information retrieval functionality

= 1.6.20 =
* Fixed metabox template and admin functionality
* Improved error handling

= 1.6.19 =
* Enhanced error handling and debugging capabilities
* Improved plugin stability

= 1.6.18 =
* Fixed critical file corruption issues
* Restored plugin functionality

= 1.6.17 =
* Enhanced TikTok API integration
* Improved error handling

= 1.6.16 =
* Fixed TikTok posting requirements
* Improved media handling

= 1.6.15 =
* Enhanced social media posting capabilities
* Improved user interface

= 1.6.14 =
* Fixed media selection issues
* Improved post scheduling

= 1.6.13 =
* Enhanced compatibility with latest WordPress versions
* Improved performance

= 1.6.12 =
* Fixed various bugs and issues
* Improved stability

= 1.6.11 =
* Enhanced social network integration
* Improved user experience

= 1.6.10 =
* Initial release
* Basic social media posting functionality

== Upgrade Notice ==

= 1.6.72 =
Fixed issue with renderTaskList function not being properly exposed to global scope. Enhanced JavaScript module initialization to ensure proper function exposure. Fixed 'renderTaskList is undefined' error in console.

= 1.6.71 =
Fixed issue with preview images not loading properly. Enhanced task list rendering with improved DOM element detection. Added more robust error handling for media preview loading. Improved retry mechanisms for task list display.

= 1.6.70 =
Fixed issue with tasks and logs not appearing in the task list. Enhanced JavaScript task handling with improved array validation. Added comprehensive logging for task creation, processing, and deletion. Improved AJAX response handling with better error management.

= 1.6.43 =
Fixed delete modal completely with centralized modal system. Improved real-time task list updates after saving tasks. Enhanced modal event handling to prevent conflicts. Added dedicated modal management system.

= 1.6.42 =
Fixed delete modal buttons not working and modal not closing. Completely resolved duplicate media picker modal issue. Improved real-time task list updates with retry mechanism. Enhanced error handling and user feedback.

= 1.6.41 =
Fixed real-time task list updates after saving and deleting tasks. Fixed duplicate media picker modal issue. Improved AJAX response handling with better error management. Fixed undefined variables in delete modal.

= 1.6.40 =
Fixed real-time task list updates after saving and deleting tasks. Fixed duplicate media picker modal issue. Improved AJAX response handling with fallback mechanisms.

= 1.6.39 =
Fixed real-time task list updates after saving and deleting tasks. Improved AJAX response handling for better user experience.

= 1.6.38 =
Fixed JavaScript errors with YoApyPlanner.api and YoApyPlanner.toast functions. Improved error handling for planner delete and save operations.

= 1.6.37 =
Fixed network restrictions in metabox to match planner functionality. Fixed double media picker issue in post creation.= 1.6.74 =
* Fixed issue with tasks not appearing in task list by improving task saving and processing logic
* Enhanced task status handling to ensure proper task state updates
* Improved task list refresh functionality for better user experience
* Fixed potential race condition in task processing

= 1.6.73 =
= 1.6.74 =
Fixed issue with tasks not appearing in task list by improving task saving and processing logic. Enhanced task status handling to ensure proper task state updates. Improved task list refresh functionality for better user experience. Fixed potential race condition in task processing.

= 1.6.73 =
= 1.6.75 =
* Fixed issue with renderTaskList function not being available when planner-tasks.js loads
* Ensured renderTaskList function is immediately available before jQuery wrapper initialization
* Improved task list rendering reliability with better initialization sequence

= 1.6.74 =
= 1.6.76 =
* Fixed infinite retry loop when task list containers are not immediately found in DOM
* Improved element detection to handle CSS-hidden elements (like desktop table on mobile view)
* Increased retry attempts and delay to allow more time for DOM elements to load
* Enhanced error logging for better debugging of task list rendering issues

= 1.6.75 =
= 1.6.77 =
* Fixed renderTaskList function availability issue with improved initialization sequence
* Implemented robust jQuery dependency checking to ensure function works properly when jQuery is not immediately available
* Added self-assigning function approach to prevent timing issues between script loading
* Enhanced error handling and debugging for task list rendering

= 1.6.76 =
= 1.6.78 =
* Fixed TikTok API error display issue - now suppresses 'Failed to fetch creator info from API' error messages when TikTok is selected in post interface
* Implemented silent failure handling for TikTok creator info fetching, consistent with other social platforms (Facebook, Instagram, YouTube)
* Improved error handling for TikTok platform integration

= 1.6.77 =


= 1.7.2 =
* Reduced log verbosity for cleaner user experience
* Optimized task result polling to prevent excessive logging
* Improved logging to show only essential information: request sent and final result
* Removed redundant res_get_task_result logs from polling loop
* Enhanced task status change logging for final states only
* Streamlined create_post_json and get_task_result logging
* Cleaned up task completion and error logging for better clarity
= 1.7.1 =
* Refactored post new metabox for improved user experience
* Updated metabox to display all imported accounts with checkboxes
* Added ajax_parse_post_content method to class-admin.php for content parsing
* Implemented JavaScript to fetch content from Gutenberg/Classic editor
* Added AJAX handler integration when accounts are selected
* Enhanced post creation workflow and content synchronization
= 1.7.0 =
* Major release with significant improvements and new features
* Enhanced TikTok API integration with improved error handling
* Improved task scheduling and real-time status updates
* Better JavaScript initialization and function availability
* Fixed various UI and performance issues
* Enhanced compatibility with latest WordPress versions

= 1.6.78 =
