WPIntell

Source evidence

Plugin Update Suggestion – Improved Compatibility & Security

Scheduled Posts Issue Fixer · support · 2025-06-23T09:43:00+00:00

complaintsentiment
highseverity
0.98relevance
1replies
Evidence linked to opportunitycommercial context

Proof Health

Open evidence

Commercial opportunities need traceable source links before they are treated as build-worthy.

7 / 35 rows with source links

20.0% of this page's analysis has direct source links.

0 build-decision rows missing links

0 rows here require auditable proof before promotion.

28 rows with no attached evidence

0 rows have source counts but still need direct links.

Conversation

support
Halil Kaya unresolved
Dear plugin author, Thank you for this useful plugin. Unfortunately, the current version hasn’t been tested with WordPress 6.5+ and some parts may not function correctly under modern configurations. We’ve made a few important updates to ensure this plugin works reliably with the latest WordPress versions. Here’s a summary of what has been improved: <?php /** * Plugin Name: Scheduled Posts Issue Fixer * Plugin URI: https://github.com/optimisthub/scheduled-posts-issue-fixer * Description: Fixes missed schedule posts issue in WordPress. * Author: optimisthub * Author URI: https://optimisthub.com * Version: 1.0.11 * Requires at least: 5.0 * Tested up to: 6.5 * Requires PHP: 7.1 * License: GPLv2 */ if (!defined('ABSPATH')) { exit; // Exit if accessed directly } class ScheduledPostsIssueFixer { const CRON_NAME = 'scheduled_posts_issue_fixed'; const CRON_TIME = 'every_minute'; const SQL_ROW_LIMIT = 20; public function __construct() { add_filter('cron_schedules', [$this, 'addCronInterval']); register_activation_hook(__FILE__, [$this, 'registerCron']); register_deactivation_hook(__FILE__, [$this, 'deRegisterCron']); add_action(self::CRON_NAME, [$this, 'publishPosts']); } public function addCronInterval($schedules) { $schedules[self::CRON_TIME] = [ 'interval' => 60, 'display' => __('Every Minute') ]; return $schedules; } public function registerCron() { if (!wp_next_scheduled(self::CRON_NAME)) { wp_schedule_event(time(), self::CRON_TIME, self::CRON_NAME); } } public function deRegisterCron() { $timestamp = wp_next_scheduled(self::CRON_NAME); if ($timestamp) { wp_unschedule_event($timestamp, self::CRON_NAME); } } public function publishPosts() { $args = [ 'post_type' => 'any', 'post_status' => 'future', 'posts_per_page' => self::SQL_ROW_LIMIT, 'date_query' => [ [ 'before' => current_time('mysql', true), 'inclusive' => true, ], ], 'orderby' => 'date', 'order' => 'ASC', 'fields' => 'ids', 'no_found_rows' => true, 'cache_results' => false, ]; $query = new WP_Query($args); foreach ($query->posts as $postId) { if (current_user_can('edit_post', $postId)) { wp_publish_post($postId); } } wp_reset_postdata(); } } new ScheduledPostsIssueFixer(); ✅ What we changed in the code : Cron Interval Registered Properly The custom interval every_minute was being used, but not registered via cron_schedules. We’ve added a cron_schedules filter to define it correctly. Switched to WP_Query Instead of Raw SQL Instead of using $wpdb->get_col() with raw SQL, we now use a proper WP_Query with a date_query, improving both performance and security. Security Improvements Wrapped the code with if (!defined(‘ABSPATH’)) exit; to prevent direct access. Added current_user_can(‘edit_post’) to avoid unintended post publishing. Included wp_reset_postdata() for safety after custom queries. Tested with WP 6.5.x Marked as tested with WordPress 6.5, and verified working correctly in live production environments. The updated version works reliably and securely. It would be great if you could consider updating the official plugin repository accordingly so more users benefit from this. Thanks again for your work! Kind regards, ✅ Replaced raw SQL with WP_Query for safer, WordPress-native querying. ✅ Added current_user_can(‘edit_post’) for permission-based post publishing. ✅ Included defined(‘ABSPATH’) check to prevent direct file access. ✅ Minimized risks of SQL injection and XSS vulnerabilities. ✅ Ensured wp_reset_postdata() is called to keep system memory clean. ✅ Plugin tested with WordPress 6.5, and custom every_minute cron schedule properly registered.

Comments

1 shown
Halil Kaya 2025-06-23T09:48:00+00:00

✅ Replaced raw SQL with WP_Query for safer, WordPress-native querying. ✅ Added current_user_can(‘edit_post’) for permission-based post publishing. ✅ Included defined(‘ABSPATH’) check to prevent direct file access. ✅ Minimized risks of SQL injection and XSS vulnerabilities. ✅ Ensured wp_reset_postdata() is called to keep system memory clean. ✅ Plugin tested with WordPress 6.5, and custom every_minute cron schedule properly registered.