multiple record insert creating many duplicate records

For running in WP cron, you’ll define your function, and then hook the function to the cron’s name. Example: function cron_function() { … } add_action( ‘cron_hook’, ‘cron_function’ ); if ( ! wp_next_scheduled( ‘cron_hook’ ) ) { wp_schedule_event( time(), ‘one_minute’, ‘cron_hook’ ); } See WordPress developer resource for more info:

WPDB query suddenly not working

You should only interact with the DB via WP, not directly. It’s not a big deal in your case because you just want to see a value, but you’ll be more aligned with the best practices if you go in trying to solve a problem with $wpdb as a last resort. In your case, you … Read more

How can I update a value of a field depending on outside source?

you can read your file using standard PHP: $value = json_decode( file_get_contents( ‘path/to/your/file.json’ ) ); Then you can use WordPress function to update post meta: update_post_meta( $post_id, $meta_name, $value, $prev_value ); $post_id = ID of the post you want to update $meta_name = name of the meta field you want to update $value = new … Read more