<?php defined( 'ABSPATH' ) or die( 'No script kiddies please!!' );
if ( !class_exists( 'EGPR_Activation' ) ) {

    class EGPR_Activation extends EGPR_Library{

        /**
         * Executes all the tasks on plugin activation
         * 
         * @since 1.0.0
         */
        function __construct() {
            register_activation_hook(EGPR_PATH . 'everest-google-places-reviews.php', array($this, 'egpr_activation'));
        }

         public function egpr_activation() {
            include_once( ABSPATH . 'wp-admin/includes/plugin.php' );
            if (is_plugin_active('everest-google-places-reviews-lite/everest-google-places-reviews-lite.php')) {
                wp_die(__('You need to deactivate Everest Google Places Reviews Lite Plugin in order to activate Everest Google Places Reviews premium plugin.Please deactivate free one.', EGPR_TD));
            }
            /*
            * Load Default Settings
            */
            if (!get_option('egp_reviews')) {
               $egpr_default_settings = $this->egpr_default_settings();
               update_option('egp_reviews', $egpr_default_settings);
            }

            $egpr_tab_animation_data = $this->egpr_tab_animation_data();
            update_option('egpr_tab_animation_data', $egpr_tab_animation_data);
        }
        
        public function egpr_default_settings() {
            $egpr_default_settings = array(
                 'nverified_api_key' => '',
                 'check_cache' => 'true',
                 'cache_period' => '24',
                'floating_review' => array(
                    'enable_floating_review' => 0,
                    'default_review' => '',
                    'layout'=> 'template1',
                    'position' => '',
                    'show_floating_review_on'=> 'all_pages',
                    'page_specific_display' => ''
                )
            );
            return $egpr_default_settings;
        }

         public function egpr_tab_animation_data() {
            $egpr_tab_animation_data = array(
                'fading_entrances' => array('fadeIn','fadeInLeft','fadeInRight','fadeInUp','fadeInDown'),
                'bouncing_entrances' => array('bounce','bounceInLeft','bounceInRight','bounceInUp','bounceInDown'),
                'flippers' => array('flip','flipInX','flipInY'),
                'lightspeed' => array('lightSpeedIn'),
                'sliding_entrances' => array('slideInUp','slideInDown','slideInLeft','slideInRight'),
                'zoom_entrances' => array('zoomIn','zoomInDown','zoomInLeft','zoomInRight','zoomInUp'),
                'attention_seekers' => array('flash','pulse'),
            );
            return $egpr_tab_animation_data;
        }


    }

    new EGPR_Activation();
}
