<?php
/**
 *
 * @package productive-forms
 */

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

// Plugin global variables
define( 'PRODUCTIVE_FORMS_PLUGIN_PATH', plugin_dir_path( __FILE__ ) );
define( 'PRODUCTIVE_FORMS_PLUGIN_URI', plugin_dir_url( __FILE__ ) );

define( 'PRODUCTIVE_FORMS_SITE_HOME_URL', home_url() );

define( 'PRODUCTIVE_FORMS_DATABASE_NAME', 'productive_forms' );

define( 'PRODUCTIVE_FORMS_ADMIN_OVERVIEW_REQUEST_URI', 'productive_options_overview' );
define( 'PRODUCTIVE_FORMS_ADMIN_PAGE_REQUEST_URI', 'productive_forms_options_submenu' );

define( 'PRODUCTIVE_FORMS_OPTION_VERSION_KEY', 'productive_forms_current_db_version' );
define( 'PRODUCTIVE_FORMS_OPTION_VERSION_KEY_PRO', 'productive_forms_current_db_version_pro' );
define( 'PRODUCTIVE_FORMS_OPTION_EXTRAS_KEY', 'productive_forms_extras_version' );
define( 'PRODUCTIVE_FORMS_OPTION_EXTRAS_LAST_UPDATE_TIME', 'productive_forms_extras_last_update_time' );

// Confirmation Message Codes
define( 'PRODUCTIVE_FORMS_SUCCESS_CODE_GENERIC', 1 );
define( 'PRODUCTIVE_FORMS_ERROR_CODE_GENERIC', 1000 );
define( 'PRODUCTIVE_FORMS_ERROR_CODE_SAVE_TO_DB', 10 );
define( 'PRODUCTIVE_FORMS_ERROR_CODE_SEND_EMAIL', 20 );
define( 'PRODUCTIVE_FORMS_ERROR_CODE_INVALID_RECAPTCHA', 30 );

define("PRODUCTIVE_FORMS_APL_NAME", 'apl_productive_forms');

define( 'PRODUCTIVE_FORMS_CONTACT_US_PAGE_SLUG', 'contact-us' );
define( 'PRODUCTIVE_FORMS_CONTACT_US_PAGE_DEFAULT_SLUG_VALUE', 'productive_forms_contact_us_slug_default' );
define( 'PRODUCTIVE_FORMS_CONTACT_US_PAGE_QUERY_PARAM', 'productive-forms-contact-us-p' );

define( 'PRODUCTIVE_FORMS_IS_REWRITE_RULE_FLUSHED_KEY', 'productive_forms_is_rewrite_rule_flushed' );

function productive_forms_get_wpdb_prefix() {
    global $wpdb;
    return $wpdb->prefix;
}
