I created plugin folder 'my-plugin' with file name my-plugin.php with content below. When I`m trying to turn on plugin I get the error:
"Parse error: syntax error, unexpected end of file in (...)\wp-content\plugins\my-plugin\my-plugin.php on line 83".
This is last empty line in this file. Where is the problem?
<?php
/**
 * @package my_plugin
 * @version 1.0
 */
/*
Plugin Name: My plugin
Plugin URI: http://wordpress.org/extend/plugins/#
Description: This is an example plugin
Author: Your Name
Version: 1.0
Author URI: https://yourwebsite.com/
*/
/**
 * Register a shortcode
 *
 * @param array $atts Array of shortcode attributes
 */
function kinsta_get_posts_cb( $atts ){
    // safely extract custom arguments and set default values
    extract( shortcode_atts(
            array(
                'numberposts'       => 3,
                'post_type'         => 'post',
                'book_category'     => 'fantasy',
                'year_published'    => 1900,
                'price_min'         => 0,
                'price_max'         => 50
            ),
            $atts,
            'kinsta_get_posts'
        ) );
    // define the array of query arguments
    $args = array(
        'numberposts'   => $numberposts,
        'post_type'     => $post_type,
        'tax_query'     => array(
            array(
                'taxonomy'  => 'book_category',
                'field'     => 'slug',
                'terms'     => $book_category,
            )
        ),
        'meta_query'    => array(
            'relation'      => 'AND',
            'year_clause'   => array(
                'key'       => 'year_published',
                'value'     => $year_published,
                'type'      => 'numeric',
                'compare'   => '>',
            ),
            'price_clause'  => array(
                'key'       => 'price',
                'value'     => array( $price_min, $price_max ),
                'type'      => 'numeric',
                'compare'   => 'BETWEEN',
            )
        ),
        'orderby' => array( 'price_clause' => 'ASC' )
    );
    $custom_posts = get_posts( $args );
    if( ! empty( $custom_posts ) ){
        $output = '<ul>';
        foreach ( $custom_posts as $p ){
            $output .= '<li><a href="'
            . get_permalink( $p->ID ) . '">'
            . $p->post_title . '</a> ('
            . get_post_meta( $p->ID, 'year_published', true )
            . ') - Price: ' . get_post_meta( $p->ID, 'price', true ) . '</li>';
        }
        $output .= '</ul>';
    }
return $output ?? '<strong>Sorry. No posts matching your criteria!</strong>';
 
    