<?php

/**
 * Free Showcase Twitter
 */

namespace Simple_Giveaways;

if ( ! defined( 'ABSPATH' ) ) {
    return;
}

if ( ! class_exists( '\Simple_Giveaways\SG_WPForms_Dummy' ) ) {
    class SG_WPForms_Dummy extends GA_Integration {

        /**
         * Active Indicator
         *
         * @var boolean
         */
        public $active = false;

        /**
         * Integration Image
         *
         * @var string
         */
        public $image = '';

        /**
         * Integration Title
         *
         * @var string
         */
        public $title = '';

        /**
         * Integration Description
         *
         * @var string
         */
        public $desc = '';

        /**
         * Setting initial params
         */
        public function __construct() {

            $this->title       = __( 'WPForms', 'giveasap' );
            $this->settings_id = 'sg_wpforms';
            $this->image       = 'https://ps.w.org/wpforms-lite/assets/icon.svg';
            $this->desc        = __( 'Sign users to giveaway when submitting a WP Form.', 'giveasap' );
        }

        public function buttons( $integrations ) {
            echo '<a href="' . esc_url( giv_fs()->get_upgrade_url() ) . '" class="button button-primary">' . esc_html__( 'Upgrade to PRO', 'giveasap' ) . '</a>';
        }

        /**
         * Get Categories
         *
         * @return string[]
         */
        public function get_categories() {
            return [
                'forms',
                'contact'
            ];
        }

    }
}

add_filter( 'giveasap_integrations', '\Simple_Giveaways\sg_register_wpforms_integration' );

/**
 * Registering Twitter
 *
 * @return array
 */
function sg_register_wpforms_integration( $integrations ) {

    $integrations['sg_wpforms'] = '\Simple_Giveaways\SG_WPForms_Dummy';

    return $integrations;
}
