Setting WordPress option values as constants

Pretty straightforward, would the below code have any issues with security or performance? I believe constants are slightly faster than using variables but I am sure the benefit would be negligible:

$payment    = get_option('swd_billing_payment');
define('SWD_OWNER_CURRENCY', isset($payment['swd_owner_currency']) ? $payment['swd_owner_currency'] : '');
define('SWD_OWNER_CURRENCY_SYMBOL', isset($payment['swd_owner_currency_symbol']) ? $payment['swd_owner_currency_symbol'] : '');
define('SWD_OWNER_BANK', isset($payment['swd_owner_bank']) ? $payment['swd_owner_bank'] : '');
define('SWD_OWNER_ACCOUNT_NAME', isset($payment['swd_owner_account_name']) ? $payment['swd_owner_account_name'] : '');

There would end up being around 30 constants defined for the various settings in the database.

Related posts

Leave a Reply