Can I use widgets & shortcode if I need to return an array?

I think that your proposed solution, or plan of attack, is far more complicated than it needs to be. You can use a static variable to manage this. Proof of concept:

function shortcode_with_static_data($atts,$content) {
  static $ids;
  $ids[] = time();
  var_dump($ids); // you should return a string not dump data in a real shortcode
}
add_shortcode('scwsc','shortcode_with_static_data');

You would need to create your own shortcode, similar to the above, and use it as a wrapper around the add data shortcode or related functions. Without seeing the plugin code I can’t really say exactly what that would look like.

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)