vocab = array(); global $wp_filesystem; if ( ! is_a( $wp_filesystem, 'WP_Filesystem_Base') ){ require_once ABSPATH . 'wp-admin/includes/file.php'; $creds = request_filesystem_credentials( site_url() ); wp_filesystem($creds); } $contx = $wp_filesystem->get_contents($path); if($contx !== false) { $jsx = json_decode($contx, true); if($jsx !== false) { $this->vocab = $jsx; } } } public function data(): mixed { return $this->vocab; } }