<?php

namespace Sipago\WooCommerce\SipagoCheckout\Helpers;

class WordpressPluginVersion
{
    protected function includeWordpressPluginFunctions()
    {
        if (!function_exists('get_plugin_data')) {
            require_once ABSPATH.'wp-admin/includes/plugin.php';
        }
    }

    public function get()
    {
        $this->includeWordpressPluginFunctions();
        $pluginData = get_plugin_data(__DIR__.'/../../sipago-rest.php');

        return $pluginData['Version'];
    }
}
