Say I have a text file or JSON file elsewhere on my domain, that have a simple value, like "yes" or "no". I would like to update a custom field in a database table in Wordpress (postmeta) with the value of that file.
Posts or pages will have a section on them (divi) that will display depending on that value. If it's "yes", then display, if "no", then don't display.
Is there an easy way to do this? From outside WP: This is the preferred way for me, however, can I even do this? How secure is WP?.. I mean.. is it even possible to do this? (injecting the value into a WP table)
From inside WP: I know how to do a simple SQL UPDATE, and I read a little bit on $wpdb. But how do I only make the change if the value is different? (after all, no need to do an update every time a page loads...)