Including Google Map within a wordpress plugin

Problem 1

neither I see the function initMap in the footer.

This is because of the action here:

add_action('wp-footer', [$this, 'init_google_map']);

There is no wp-footer hook. You probably intended to use wp_footer: https://developer.wordpress.org/reference/hooks/wp_footer/

Though keep in mind this isn’t guaranteed to be in a footer, just at the end of the HTML document before the closing body tag.

That shouldn’t matter though because that’s not how you’re supposed to print inline javascript in WordPress, or expose variables to JS.

Instead:

Problem 2

That’s not how shortcodes work! Shortcodes should never output directly:

Note that the function called by the shortcode should never produce an output of any kind. Shortcode functions should return the text that is to be used to replace the shortcode. Producing the output directly will lead to unexpected results. This is similar to the way filter functions should behave, in that they should not produce unexpected side effects from the call since you cannot control when and where they are called from.

https://developer.wordpress.org/reference/functions/add_shortcode/

Here a shortcode is registered:

        if(!is_admin()){
        add_shortcode( 'sight-form-shortcode', array( $this, 'sighting_form_shortcode_function') );
        //add_shortcode( 'anothershortcode', array( $this, 'another_shortcode_function') );
        }

The is_admin check is unnecessary ( and potentially problematic ), so remove that, but the real mistake is this:

//includes the html/php code of the sighting form shortcode
public function sighting_form_shortcode_function() {
        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/partials/sighting-form-public-display.php';
}

A shortcodes callback returns a string, it’s not supposed to output directly! Using echo or printing directly breaks the order of output and can cause syntax errors in REST API endpoints, shortcodes that appear in the wrong place, etc

That code is equivalent to this:

//includes the html/php code of the sighting form shortcode
public function sighting_form_shortcode_function() {
        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/partials/sighting-form-public-display.php';
        return ""; // this shortcode has no output
}

We can enforce the correct behaviour by type hinting that the function returns a string, and using output buffers, e.g. with this function signature it’s impossible to use the callback incorrectly as it would generate a PHP error:

//includes the html/php code of the sighting form shortcode
public function sighting_form_shortcode_function() : string {

techhipbettruvabetnorabahisbahis forumutaraftarium24eduedueduseduedueduseduseduseduedus