66 lines
3.0 KiB
PHP
66 lines
3.0 KiB
PHP
<?php
|
|
|
|
$currentDir = dirname(__FILE__);
|
|
|
|
define('_SQ_NAME_', 'squirrly');
|
|
define('_SQ_NAMESPACE_', 'SQ');
|
|
define('_SQ_DB_', 'QSS');
|
|
define('_SQ_PLUGIN_NAME_', 'squirrly-seo'); //THIS LINE WILL BE CHANGED WITH THE USER SETTINGS
|
|
|
|
$scheme = (((isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == "on") || (defined('FORCE_SSL_ADMIN') && FORCE_SSL_ADMIN)) ? 'https:' : 'http:'); //CHECK IF SCURE
|
|
defined('SQ_URI') || define('SQ_URI', 'wp500');
|
|
defined('_SQ_DASH_URL_') || define('_SQ_DASH_URL_', 'https://my.squirrly.co/');
|
|
defined('_SQ_API_URL_') || define('_SQ_API_URL_', $scheme . '//api.squirrly.co/sq/');
|
|
defined('_SQ_APIKR_URL_') || define('_SQ_APIKR_URL_', $scheme . '//kr.squirrly.co/sq/');
|
|
defined('_SQ_APIV2_URL_') || define('_SQ_APIV2_URL_', $scheme . '//api.squirrly.co/v2/');
|
|
define('_SQ_SITE_HOST_', @parse_url(home_url(), PHP_URL_HOST));
|
|
|
|
define('_SQ_SUPPORT_EMAIL_', 'support@squirrly.co');
|
|
defined('_SQ_STATIC_API_URL_') || define('_SQ_STATIC_API_URL_', '//storage.googleapis.com/squirrly/');
|
|
defined('_SQ_SUPPORT_EMAIL_URL_') || define('_SQ_SUPPORT_EMAIL_URL_', 'http://plugin.squirrly.co/contact/');
|
|
defined('_SQ_SUPPORT_FACEBOOK_URL_') || define('_SQ_SUPPORT_FACEBOOK_URL_', 'https://www.facebook.com/Squirrly.co');
|
|
defined('_SQ_HOWTO_URL_') || define('_SQ_HOWTO_URL_', 'https://howto.squirrly.co/wordpress-seo/');
|
|
defined('_SQ_SUPPORT_URL_') || define('_SQ_SUPPORT_URL_', _SQ_SUPPORT_FACEBOOK_URL_);
|
|
|
|
/* Directories */
|
|
define('_SQ_ROOT_DIR_', realpath(dirname($currentDir)) . '/');
|
|
define('_SQ_CLASSES_DIR_', _SQ_ROOT_DIR_ . 'classes/');
|
|
define('_SQ_CONTROLLER_DIR_', _SQ_ROOT_DIR_ . 'controllers/');
|
|
define('_SQ_MODEL_DIR_', _SQ_ROOT_DIR_ . 'models/');
|
|
define('_SQ_SERVICE_DIR_', _SQ_MODEL_DIR_ . 'services/');
|
|
define('_SQ_TRANSLATIONS_DIR_', _SQ_ROOT_DIR_ . 'translations/');
|
|
define('_SQ_CORE_DIR_', _SQ_ROOT_DIR_ . 'core/');
|
|
define('_SQ_THEME_DIR_', _SQ_ROOT_DIR_ . 'view/');
|
|
define('_SQ_ASSETS_DIR_', _SQ_THEME_DIR_ . 'assets/');
|
|
|
|
/* URLS */
|
|
define('_SQ_URL_', rtrim(plugins_url('', $currentDir), '/') . '/');
|
|
define('_SQ_THEME_URL_', _SQ_URL_ . 'view/');
|
|
define('_SQ_ASSETS_URL_', _SQ_THEME_URL_ . 'assets/');
|
|
define('_SQ_ASSETS_RELATIVE_URL_', ltrim(parse_url(_SQ_ASSETS_URL_, PHP_URL_PATH), '/'));
|
|
|
|
|
|
$upload_dir = array();
|
|
$upload_dir['baseurl'] = WP_CONTENT_URL . '/uploads';
|
|
$upload_dir['basedir'] = WP_CONTENT_DIR . '/uploads';
|
|
|
|
$upload_path = '';
|
|
if (is_dir($upload_dir['basedir'])) {
|
|
$upload_path = $upload_dir['basedir'] . '/' . _SQ_NAME_ . '/';
|
|
}
|
|
|
|
if ($upload_path <> '') {
|
|
if (!is_dir($upload_path)) {
|
|
wp_mkdir_p($upload_path);
|
|
}
|
|
|
|
if (is_dir($upload_path) && function_exists('wp_is_writable') && wp_is_writable($upload_path)) {
|
|
defined('_SQ_CACHE_DIR_') || define('_SQ_CACHE_DIR_', realpath($upload_path) . '/');
|
|
defined('_SQ_CACHE_URL_') || define('_SQ_CACHE_URL_', $upload_dir['baseurl'] . '/' . _SQ_NAME_ . '/');
|
|
}
|
|
}
|
|
|
|
defined('_SQ_CACHE_DIR_') || define('_SQ_CACHE_DIR_', _SQ_ROOT_DIR_ . '/cache/');
|
|
defined('_SQ_CACHE_URL_') || define('_SQ_CACHE_URL_', _SQ_URL_ . '/cache/');
|
|
|