<?php
/*
Plugin Name: Zoddak Resales Connector v1
 * Plugin URI: https://www.zoddak.com/
 * Description: 1º version for Zoddak's Resales, displays them professionally and responsively on your website.
 * Version: 1.0.0
 * Author: Zoddak
 * Author URI: https://www.zoddak.com/
 * License: GPL v2 or later
 * License URI: https://www.gnu.org/licenses/gpl-2.0.html
 * Text Domain: resales.v1
 * Domain Path: /languages
*/

if (!defined('ABSPATH')) {
    exit;
}
define('RS_WP_ENVIRONMENT_TYPE', 'production');
$site_url = get_site_url();

if (strpos($site_url, '.test') !== false || strpos($site_url, 'localhost') !== false || strpos($site_url, 'local') !== false) {
    define('RS_API_URL', 'http://zoddak-beta.test/api');
} else {
    define('RS_API_URL', 'https://app.zoddak.com/api');
}

define('ZODDAK_RESALES_PLUGIN_URL', plugin_dir_url(__FILE__));
define('ZODDAK_RESALES_PLUGIN_FILE', __FILE__);
define('ZODDAK_RESALES_PLUGIN_PATH', plugin_dir_path(__FILE__));
define('ZODDAK_RESALES_PLUGIN_BASENAME', plugin_basename(__FILE__));
define('RS_ZODDAK_STATS_TOKEN', 'e13da0ba-26ad-11f1-bd42-5f8437ec7ef4');
require_once plugin_dir_path(__FILE__) . 'helpers/functions-helper.php';
require_once plugin_dir_path(__FILE__) . 'includes/admin-menu.php';
require_once plugin_dir_path(__FILE__) . 'controllers/AdminController.php';
require_once plugin_dir_path(__FILE__) . 'controllers/ApiController.php';
require_once plugin_dir_path(__FILE__) . 'controllers/PropertiesController.php';
require_once plugin_dir_path(__FILE__) . 'controllers/RoutesController.php';
require_once plugin_dir_path(__FILE__) . 'src/Routing/Routes.php';
require_once plugin_dir_path(__FILE__) . 'src/Admin/Assets.php';
require_once plugin_dir_path(__FILE__) . 'src/Admin/Admin.php';
require_once plugin_dir_path(__FILE__) . 'src/Front/Assets.php';
require_once plugin_dir_path(__FILE__) . 'src/Front/StatsAjax.php';
require_once plugin_dir_path(__FILE__) . 'src/I18n/I18n.php';
require_once plugin_dir_path(__FILE__) . 'src/Integrations/ContactForm7.php';
RsI18n::init();
RsFrontAssets::init();
RsStatsAjax::init();
RsAdminAssets::init();
RsAdmin::init();
RsRoutes::init();
RsContactForm7::register();
register_activation_hook(__FILE__, function() {
    add_option('rs_zoddak_card_size', 'medium');
    add_option('rs_zoddak_page_width', '960px');
    add_option('rs_zoddak_property_layout', 'horizontal');
    add_option('rs_zoddak_card_bg_color', '#ffffff');
    add_option('rs_zoddak_border_rounded', '7px');
    add_option('rs_zoddak_type_property_btn_color', '#dddd0f');
    add_option('rs_zoddak_type_property_txt_color', '#ffffff');
    add_option('rs_zoddak_color_horizontal_line', '#c61c1c');
    add_option('rs_zoddak_current_page_color', '#110400');
});

function mpp_welcome_message() {
    echo "
        <div class='notice notice-success is-dismissible'>
            <p>¡New Developments está activo y funcionando!</p>
        </div>";
}
add_action('wp_head', function() {
    echo '<meta name="viewport" content="width=device-width, initial-scale=1">';
}, 1);