@@ -365,15 +365,6 @@ class Freemius extends Freemius_Abstract {
365365 */
366366 private $_is_bundle_license_auto_activation_enabled = false;
367367
368- /**
369- * Developer-defined config overrides for checkout.
370- *
371- * @var array
372- */
373- protected $_checkout_config = [];
374-
375- /**
376-
377368 #region Uninstall Reasons IDs
378369
379370 const REASON_NO_LONGER_NEEDED = 1;
@@ -5190,9 +5181,6 @@ private function parse_settings( &$plugin_info ) {
51905181 ) );
51915182 }
51925183
5193- // Extracts, validate and save checkout-specific settings.
5194- $this->_checkout_config = $this->validate_checkout_config( $plugin_info );
5195-
51965184 $plugin = ( $this->_plugin instanceof FS_Plugin ) ?
51975185 $this->_plugin :
51985186 new FS_Plugin();
@@ -5334,88 +5322,6 @@ private function parse_settings( &$plugin_info ) {
53345322 );
53355323 }
53365324
5337- /**
5338- * Validates and filters developer-provided checkout config.
5339- *
5340- * @param array $config
5341- *
5342- * @return array
5343- */
5344- protected function validate_checkout_config($config)
5345- {
5346- $schema = array(
5347- // currency
5348- 'currency' => 'string',
5349- 'default_currency' => 'string',
5350- // cart
5351- 'always_show_renewals_amount' => 'bool',
5352- 'annual_discount' => 'bool',
5353- 'billing_cycle' => ['string', 'int'],
5354- 'bundle_discount' => 'float',
5355- 'maximize_discounts' => 'bool',
5356- 'multisite_discount' => ['bool', 'string'], // string expected to be "auto"
5357- 'show_inline_currency_selector' => 'bool',
5358- 'show_monthly' => 'bool',
5359- // appearance
5360- 'form_position' => 'string',
5361- 'is_bundle_collapsed' => 'bool',
5362- 'layout' => 'string',
5363- 'refund_policy_position' => 'string',
5364- 'show_refund_badge' => 'bool',
5365- 'show_reviews' => 'bool',
5366- 'show_upsells' => 'bool',
5367- 'title' => 'string',
5368- );
5369-
5370- $result = array();
5371-
5372- foreach ($schema as $key => $expected_type)
5373- {
5374- if (array_key_exists($key, $config))
5375- {
5376- $value = $config[$key];
5377- $types = is_array($expected_type) ? $expected_type : [$expected_type];
5378- $valid = false;
5379-
5380- foreach ($types as $type)
5381- {
5382- switch ($type)
5383- {
5384- case 'bool':
5385- if (is_bool($value))
5386- $valid = true;
5387- break;
5388- case 'string':
5389- if (is_string($value))
5390- $valid = true;
5391- break;
5392- case 'int':
5393- if (is_int($value))
5394- $valid = true;
5395- break;
5396- case 'float':
5397- if (is_float($value) || is_int($value))
5398- $valid = true;
5399- break;
5400- }
5401- }
5402-
5403- if ($valid)
5404- $result[$key] = $value;
5405- }
5406- }
5407-
5408- return $result;
5409- }
5410-
5411- /**
5412- * @return array
5413- */
5414- public function get_checkout_config()
5415- {
5416- return $this->_checkout_config;
5417- }
5418-
54195325 /**
54205326 * @param string[] $options
54215327 * @param string $key
0 commit comments