WPIntell

Source evidence

Badly formulated SQL command in cron job

NextScripts: Social Networks Auto-Poster · support · 2024-06-24T07:56:00+00:00

complaintsentiment
mediumseverity
0.92relevance
5replies
Evidence linked to opportunitycommercial context

Proof Health

Open evidence

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

7 / 36 rows with source links

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

0 build-decision rows missing links

0 rows here require auditable proof before promotion.

29 rows with no attached evidence

0 rows have source counts but still need direct links.

Conversation

support
Tim Reeves unresolved
[24-Jun-2024 02:30:35] WARNING: [pool blog.biblische-reisen.de] child 510994 said into stderr: “PHP message: WordPress database error You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near ”b3wp_nxs_log’ WHERE flt = ‘cron’ AND id NOT IN ( [24-Jun-2024 02:30:35] WARNING: [pool blog.biblische-reisen.de] child 510994 said into stderr: ” SELECT id FROM…’ at line 1 for query DELETE FROM ‘b3wp_nxs_log’ WHERE flt = ‘cron’ AND id NOT IN ( [24-Jun-2024 02:30:35] WARNING: [pool blog.biblische-reisen.de] child 510994 said into stderr: ” SELECT id FROM ( [24-Jun-2024 02:30:35] WARNING: [pool blog.biblische-reisen.de] child 510994 said into stderr: ” SELECT id FROM ‘b3wp_nxs_log’ ORDER BY id DESC LIMIT 360 [24-Jun-2024 02:30:35] WARNING: [pool blog.biblische-reisen.de] child 510994 said into stderr: ” ) foo [24-Jun-2024 02:30:35] WARNING: [pool blog.biblische-reisen.de] child 510994 said into stderr: ” ) made by do_action_ref_array(‘nxs_hourly_event’), WP_Hook->do_action, WP_Hook->apply_filters, nxs_do_this_hourly, W3TC\DbCache_Wpdb New->query, W3TC\DbCache_WpdbInjection_QueryCaching->query, W3TC\_CallUnderlying->query, W3TC\DbCache_WpdbNew->query, W3TC\DbCache_WpdbInjection->query, W3TC\DbCache_WpdbNew->default_query” Yup, I’m getting the same. I have the solution, in the file nxs_functions_engine.php in the line 151, it’s the problem: $ttr = "FROM ". $wpdb->prefix . "nxs_query WHERE timetorun<'".date_i18n('Y-m-d H:i:s')."'"; $quPostsCnt = $wpdb->get_var($wpdb->prepare("SELECT COUNT(id) %s", $ttr));* change the code to this: $ttr = $wpdb->prefix . "nxs_query WHERE timetorun < %s"; $current_time = date_i18n('Y-m-d H:i:s'); $query = $wpdb->prepare("SELECT COUNT(id) FROM $ttr", $current_time); $quPostsCnt = $wpdb->get_var($query); If you have problems with the query/timeline and log/history, the problems are other queries, cheers! This reply was modified 1 year, 11 months ago by lacavernamx . Thanks @lacavernamx – I’ve applied your fix, can tell you tomorrow if all is good. Sadly I’m still seeing similr (not identical) entries in my log. I’ve condensed the old and new entries to make them a bit easier to read: OLD: WHERE flt = ‘cron’ AND id NOT IN ( SELECT id FROM…’ at line 1 for query DELETE FROM ‘b3wp_nxs_log’ WHERE flt = ‘cron’ AND id NOT IN ( SELECT id FROM ( SELECT id FROM ‘b3wp_nxs_log’ ORDER BY id DESC LIMIT 360 ) foo ) made by do_action_ref_array(‘nxs_hourly_event’), WP_Hook->do_action, WP_Hook->apply_filters, nxs_do_this_hourly, W3TC\DbCache_WpdbNew->query, W3TC\DbCache_WpdbInjection_QueryCaching->query, W3TC_CallUnderlying->query, W3TC\DbCache_WpdbNew->query, W3TC\DbCache_WpdbInjection->query, W3TC\DbCache_WpdbNew->default_query NEW: SELECT id FROM ( S…’ at line 1 for query DELETE FROM ‘b3wp_nxs_log’ WHERE id <= ( SELECT id FROM ( SELECT id FROM ‘b3wp_nxs_log’ ORDER BY id DESC LIMIT 1 OFFSET 150 ) foo ) made by do_action_ref_array(‘nxs_hourly_event’), WP_Hook->do_action, WP_Hook->apply_filters, nxs_do_this_hourly, W3TC\DbCache_WpdbNew->query, W3TC\DbCache_WpdbInjection_QueryCaching->query, W3TC_CallUnderlying->query, W3TC\DbCache_WpdbNew->query, W3TC\DbCache_WpdbInjection->query, W3TC\DbCache_WpdbNew->default_query I’ve decided to deactivate the plugin, the site is hardly active in the respect covered anyway. In fact I mentioned that I still had to make changes so that the log/history and the query/timeline could be seen, the code I passed only activates the autopost, the errors you show must be due to the log and the query. My plugin is working. This reply was modified 1 year, 11 months ago by lacavernamx . This reply was modified 1 year, 11 months ago by lacavernamx .

Comments

5 shown
DFC005 2024-06-25T00:44:00+00:00

Yup, I’m getting the same.

lacavernamx 2024-06-28T19:19:00+00:00

I have the solution, in the file nxs_functions_engine.php in the line 151, it’s the problem: $ttr = "FROM ". $wpdb->prefix . "nxs_query WHERE timetorun<'".date_i18n('Y-m-d H:i:s')."'"; $quPostsCnt = $wpdb->get_var($wpdb->prepare("SELECT COUNT(id) %s", $ttr));* change the code to this: $ttr = $wpdb->prefix . "nxs_query WHERE timetorun < %s"; $current_time = date_i18n('Y-m-d H:i:s'); $query = $wpdb->prepare("SELECT COUNT(id) FROM $ttr", $current_time); $quPostsCnt = $wpdb->get_var($query); If you have problems with the query/timeline and log/history, the problems are other queries, cheers! This reply was modified 1 year, 11 months ago by lacavernamx .

Tim Reeves 2024-06-29T09:01:00+00:00

Thanks @lacavernamx – I’ve applied your fix, can tell you tomorrow if all is good.

Tim Reeves 2024-06-30T04:47:00+00:00

Sadly I’m still seeing similr (not identical) entries in my log. I’ve condensed the old and new entries to make them a bit easier to read: OLD: WHERE flt = ‘cron’ AND id NOT IN ( SELECT id FROM…’ at line 1 for query DELETE FROM ‘b3wp_nxs_log’ WHERE flt = ‘cron’ AND id NOT IN ( SELECT id FROM ( SELECT id FROM ‘b3wp_nxs_log’ ORDER BY id DESC LIMIT 360 ) foo ) made by do_action_ref_array(‘nxs_hourly_event’), WP_Hook->do_action, WP_Hook->apply_filters, nxs_do_this_hourly, W3TC\DbCache_WpdbNew->query, W3TC\DbCache_WpdbInjection_QueryCaching->query, W3TC_CallUnderlying->query, W3TC\DbCache_WpdbNew->query, W3TC\DbCache_WpdbInjection->query, W3TC\DbCache_WpdbNew->default_query NEW: SELECT id FROM ( S…’ at line 1 for query DELETE FROM ‘b3wp_nxs_log’ WHERE id <= ( SELECT id FROM ( SELECT id FROM ‘b3wp_nxs_log’ ORDER BY id DESC LIMIT 1 OFFSET 150 ) foo ) made by do_action_ref_array(‘nxs_hourly_event’), WP_Hook->do_action, WP_Hook->apply_filters, nxs_do_this_hourly, W3TC\DbCache_WpdbNew->query, W3TC\DbCache_WpdbInjection_QueryCaching->query, W3TC_CallUnderlying->query, W3TC\DbCache_WpdbNew->query, W3TC\DbCache_WpdbInjection->query, W3TC\DbCache_WpdbNew->default_query I’ve decided to deactivate the plugin, the site is hardly active in the respect covered anyway.

lacavernamx 2024-06-30T04:56:00+00:00

In fact I mentioned that I still had to make changes so that the log/history and the query/timeline could be seen, the code I passed only activates the autopost, the errors you show must be due to the log and the query. My plugin is working. This reply was modified 1 year, 11 months ago by lacavernamx . This reply was modified 1 year, 11 months ago by lacavernamx .