| 1 |
<?php |
| 2 |
/** |
| 3 |
* Declare constants |
| 4 |
* |
| 5 |
* @package lasso constants |
| 6 |
*/ |
| 7 |
|
| 8 |
namespace LassoLite\Admin; |
| 9 |
|
| 10 |
use LassoLite\Classes\Enum; |
| 11 |
|
| 12 |
// ? wp-includes/default-constants.php |
| 13 |
if ( ! defined( 'SECURE_AUTH_COOKIE' ) ) { |
| 14 |
if ( ! function_exists( 'wp_cookie_constants' ) ) { |
| 15 |
require_once ABSPATH . 'wp-includes/default-constants.php'; |
| 16 |
} |
| 17 |
|
| 18 |
wp_cookie_constants(); |
| 19 |
} |
| 20 |
|
| 21 |
if ( ! defined( 'SENTRY_LITE_DSN' ) ) { |
| 22 |
define( 'SENTRY_LITE_DSN', 'https://6416a56005214ca4966296529ef86479@o51581.ingest.sentry.io/6568051' ); |
| 23 |
} |
| 24 |
|
| 25 |
class Constant { |
| 26 |
const SENTRY_DSN = SENTRY_LITE_DSN; |
| 27 |
const DEFAULT_THUMBNAIL = SIMPLE_URLS_URL . '/admin/assets/images/lasso-no-thumbnail.jpg'; |
| 28 |
const LASSO_URL = 'https://getlasso.co'; |
| 29 |
const LASSO_SUPPORT_URL = 'https://support.getlasso.co/'; |
| 30 |
const LASSO_UPGRADE_URL = 'https://getlasso.co/upgrade/?utm_campaign=lite-upgrade&utm_source=lasso-lite&utm_medium=wordpress'; |
| 31 |
const SITE_ID_KEY = 'site_id'; |
| 32 |
|
| 33 |
const LASSO_PLUS_SIGNUP_URL = 'https://app.getlasso.co/signup/plus?utm_campaign=lite-upgrade&utm_source=lasso-lite&utm_medium=wordpress'; |
| 34 |
const LASSO_AFFILIATE_PLUS_URL = 'https://app.getlasso.co/plus/'; |
| 35 |
const LASSO_ANALYTICS_URL = 'https://app.getlasso.co/analytics/'; |
| 36 |
|
| 37 |
const DEFAULT_SETTINGS = array( |
| 38 |
// ? display |
| 39 |
'theme_name' => Enum::THEME_CACTUS, |
| 40 |
'display_color_main' => 'black', |
| 41 |
'display_color_title' => 'black', |
| 42 |
'display_color_background' => 'white', |
| 43 |
'display_color_button' => '#22BAA0', |
| 44 |
'display_color_secondary_button' => '#22BAA0', |
| 45 |
'display_color_button_text' => 'white', |
| 46 |
'display_color_pros' => '#22BAA0', |
| 47 |
'display_color_cons' => '#E06470', |
| 48 |
'primary_button_text' => 'Buy Now', |
| 49 |
'secondary_button_text' => 'Our Review', |
| 50 |
'lasso_affiliate_URL' => 'https://getlasso.co/', |
| 51 |
'disclosure_text' => 'We earn a commission if you make a purchase, at no additional cost to you.', |
| 52 |
'show_price' => true, |
| 53 |
'show_disclosure' => true, |
| 54 |
'enable_brag_mode' => true, |
| 55 |
'badge_text' => '', |
| 56 |
|
| 57 |
// ? amazon |
| 58 |
'auto_monetize_amazon' => true, |
| 59 |
'amazon_access_key_id' => '', |
| 60 |
'amazon_secret_key' => '', |
| 61 |
'amazon_creators_credential_id' => '', |
| 62 |
'amazon_creators_secret' => '', |
| 63 |
'amazon_creators_version' => '', |
| 64 |
'amazon_creators_partner_tag' => '', |
| 65 |
'amazon_tracking_id' => '', |
| 66 |
'amazon_default_tracking_country' => 'us', |
| 67 |
'amazon_pricing_daily' => true, |
| 68 |
'auto_upgrade_eligible_links' => true, |
| 69 |
|
| 70 |
// ? general |
| 71 |
'license_serial' => '', |
| 72 |
'general_disable_amazon_notifications' => false, |
| 73 |
'general_disable_tooltip' => false, |
| 74 |
'general_disable_notification' => false, |
| 75 |
'general_enable_new_ui' => true, |
| 76 |
'check_duplicate_link' => false, |
| 77 |
'performance_event_tracking' => true, |
| 78 |
|
| 79 |
// ? url detail |
| 80 |
'enable_nofollow' => true, |
| 81 |
'open_new_tab' => true, |
| 82 |
'enable_sponsored' => true, |
| 83 |
|
| 84 |
Enum::SUPPORT_ENABLED => false, |
| 85 |
Enum::IS_SUBSCRIBE => false, |
| 86 |
Enum::EMAIL_SUPPORT => '', |
| 87 |
Enum::CUSTOMER_FLOW_ENABLED => false, |
| 88 |
); |
| 89 |
|
| 90 |
const LASSO_INTERCOM_APP_ID = 'az01idfr'; |
| 91 |
const JWT_SECRET_KEY = '6KpRcC60EgicHWhyEIqj'; |
| 92 |
const LASSO_LINK = 'https://lasso.link'; |
| 93 |
const SSL_VERIFY = true; |
| 94 |
const TIME_OUT = 30; |
| 95 |
|
| 96 |
const LASSO_AMAZON_PRODUCTS_DB = 'lasso_lite_amazon_products'; |
| 97 |
const LASSO_POST_TYPE = 'surl'; |
| 98 |
const LASSO_BRAND = 'Lasso'; |
| 99 |
const LASSO_AMAZON_PRODUCT_TYPE = 'Amazon Product'; |
| 100 |
const LASSO_CATEGORY = 'lasso-lite-cat'; |
| 101 |
const LASSO_PRO_POST_TYPE = 'lasso-urls'; |
| 102 |
|
| 103 |
const LASSO_OPTION_REVIEW_ALLOW = 'review_allow_notification'; |
| 104 |
const LASSO_OPTION_REVIEW_SNOOZE = 'review_snooze'; |
| 105 |
const LASSO_OPTION_REVIEW_LINK_COUNT = 'review_link_count'; |
| 106 |
const LASSO_OPTION_AMAZON_CREDENTIALS_NOTICE_DISMISSED = 'dismiss_amazon_credentials_update_notice'; |
| 107 |
/** Second dismiss; banner hides only when both dismiss flags are set. */ |
| 108 |
const LASSO_OPTION_AMAZON_CREDENTIALS_NOTICE_DISMISSED_FINAL = 'dismiss_amazon_credentials_update_notice_final'; |
| 109 |
const LASSO_OPTION_AMAZON_CREDENTIALS_UPDATED = 'updated_amazon_credentials_notice'; |
| 110 |
const LASSO_OPTION_AMAZON_CREATORS_VERIFIED_SIGNATURE = 'amazon_creators_verified_signature'; |
| 111 |
const LASSO_OPTION_DISMISS_PERFORMANCE_NOTICE = 'dismiss_performance_notice'; |
| 112 |
const LASSO_LITE_NONCE = 'simple-urls-nonce'; |
| 113 |
const LASSO_OPTION_AFFILIATE_PROMOTIONS = 'affiliate_promotions'; |
| 114 |
const LASSO_OPTION_DISMISS_PROMOTIONS = 'dismiss_aff_promotions_notice'; |
| 115 |
const LASSO_OPTION_IS_CONNECTED_AFFILIATE = 'is_connected_aff'; |
| 116 |
const LASSO_CHECKOUT_URL_DEFAULT = 'https://getlasso.co/upgrade/?utm_campaign=lite-upgrade&utm_source=lasso-lite&utm_medium=wordpress'; |
| 117 |
|
| 118 |
/** Option keys (not merged into lassolite_settings) for realtime click queue + secrets. */ |
| 119 |
const OPTION_REALTIME_CHANNEL_ID = 'lasso_lite_realtime_channel_id'; |
| 120 |
const OPTION_REALTIME_INGEST_SECRET = 'lasso_lite_realtime_ingest_secret'; |
| 121 |
const OPTION_REALTIME_CLICK_QUEUE = 'lasso_lite_realtime_click_queue'; |
| 122 |
|
| 123 |
const LASSO_HUB_URL = 'https://app.getlasso.co'; |
| 124 |
const LASSO_ACCOUNT_EMAIL = 'lasso_account_email'; |
| 125 |
const LASSO_ACCOUNT_API_KEY = 'lasso_account_api_key'; |
| 126 |
const LASSO_ACCOUNT_USER_ID = 'lasso_account_user_id'; |
| 127 |
|
| 128 |
const BLOCK_CUSTOMIZE = array( |
| 129 |
'single' => array( |
| 130 |
'type' => 'single', |
| 131 |
'name' => 'Single Product Displays', |
| 132 |
'attributes' => array( |
| 133 |
array( |
| 134 |
'name' => 'Product title', |
| 135 |
'attr' => 'title', |
| 136 |
'desc' => 'Override the product title.<br/>Hide the product title by <code>hide</code> value.', |
| 137 |
), |
| 138 |
array( |
| 139 |
'name' => 'Title url', |
| 140 |
'attr' => 'title_url', |
| 141 |
'desc' => 'Customize the title link destination. Leave blank for the default.<br/>Example: https://getlasso.co', |
| 142 |
), |
| 143 |
array( |
| 144 |
'name' => 'Title tag', |
| 145 |
'attr' => 'title_type', |
| 146 |
'desc' => 'Set the title tag. Common values are: <i>H1, H2, H3, H4</i>', |
| 147 |
), |
| 148 |
array( |
| 149 |
'name' => 'Product description', |
| 150 |
'attr' => 'description', |
| 151 |
'desc' => 'Override the product description<br/>Hide the product description by <code>hide</code> value.', |
| 152 |
), |
| 153 |
array( |
| 154 |
'name' => 'Badge', |
| 155 |
'attr' => 'badge', |
| 156 |
'desc' => 'Override the display badge.<br/>Hide the badge by <code>hide</code> value.', |
| 157 |
), |
| 158 |
array( |
| 159 |
'name' => 'Brag', |
| 160 |
'attr' => 'brag', |
| 161 |
'desc' => 'Promote Lasso on your display and <a href="https://getlasso.co/affiliate-program/" rel="nofollow noopener noreferrer" target="_blank">earn money</a> by <code>true</code> value.', |
| 162 |
), |
| 163 |
array( |
| 164 |
'name' => 'Show/Hide the price', |
| 165 |
'attr' => 'price', |
| 166 |
), |
| 167 |
array( |
| 168 |
'name' => 'First button url', |
| 169 |
'attr' => 'primary_url', |
| 170 |
'desc' => 'Override the first button url.<br/>Example: https://getlasso.co', |
| 171 |
), |
| 172 |
array( |
| 173 |
'name' => 'First button text', |
| 174 |
'attr' => 'primary_text', |
| 175 |
'desc' => 'Override the first button text.', |
| 176 |
), |
| 177 |
array( |
| 178 |
'name' => 'Image url', |
| 179 |
'attr' => 'image_url', |
| 180 |
'desc' => 'Override the image url.<br/>Example: https://getlasso.co/lasso.png', |
| 181 |
), |
| 182 |
array( |
| 183 |
'name' => 'Anchor id', |
| 184 |
'attr' => 'anchor_id', |
| 185 |
'desc' => 'Override the anchor id.<br/>Example: the-anchor-link-id', |
| 186 |
), |
| 187 |
), |
| 188 |
), |
| 189 |
'all_attributes' => array( |
| 190 |
'title', |
| 191 |
'title_url', |
| 192 |
'title_type', |
| 193 |
'description', |
| 194 |
'badge', |
| 195 |
'price', |
| 196 |
'field', |
| 197 |
'rating', |
| 198 |
'theme', |
| 199 |
'primary_url', |
| 200 |
'primary_text', |
| 201 |
'secondary_url', |
| 202 |
'secondary_text', |
| 203 |
'image_url', |
| 204 |
'disclosure_text', |
| 205 |
'button_type', |
| 206 |
'columns', |
| 207 |
'limit', |
| 208 |
'bullets', |
| 209 |
'compact', |
| 210 |
'brag', |
| 211 |
'anchor_id', |
| 212 |
), |
| 213 |
'toogle_attributes' => array( |
| 214 |
'price', |
| 215 |
'field', |
| 216 |
'rating', |
| 217 |
), |
| 218 |
'notice' => 'For a detailed list of all customization options, visit our <a href="https://support.getlasso.co/en/articles/4575092-shortcode-reference-guide" target="_blank">Shortcode Reference Guide</a>.', |
| 219 |
); |
| 220 |
} |
| 221 |
|
| 222 |
// Path for vanity JS served by the plugin and its source file location |
| 223 |
if ( ! defined( 'LASSO_SNIPPET_VANITY_PATH_LITE' ) ) { |
| 224 |
define( 'LASSO_SNIPPET_VANITY_PATH_LITE', '/js/snippet.min.js' ); |
| 225 |
} |
| 226 |
if ( ! defined( 'LASSO_CONNECT_SNIPPET_FILE_LITE' ) ) { |
| 227 |
define( 'LASSO_CONNECT_SNIPPET_FILE_LITE', SIMPLE_URLS_PLUGIN_PATH . '/admin/assets/js/connect-snippet.min.js' ); |
| 228 |
} |
| 229 |
|