'Redirect URL', 'id' => 'adfoxly-redirect-slug', 'type' => 'text', 'class' => 'form-control', ) ); function __construct() { $this->settings = get_option( 'adfoxly_settings' ); if ( isset( $this->settings[ 'redirect-slug' ] ) && ! empty( $this->settings[ 'redirect-slug' ] ) ) { $this->meta_fields[ 0 ][ 'value' ] = $this->settings[ 'redirect-slug' ]; } } } class adfoxlySettingsStatistics { public $settings; public $meta_fields = array( array( 'label' => 'Ads statistics status', 'id' => 'adfoxly-statistics-status', 'type' => 'radio', 'class' => 'form-control', 'default' => 'enabled', 'options' => array( 'enabled' => 'Enabled', 'disabled' => 'Disabled' ), ), array( 'label' => 'Choose statistics', 'id' => 'adfoxly-statistics-type', 'type' => 'radio', 'class' => 'form-control', 'default' => 'internal', 'wrapper_id' => 'adfoxly-statistics-type-wrapper', 'options' => array( 'internal' => 'Internal', 'piwik' => 'Piwik/Matomo', ), ), array( 'label' => 'Google Analytics ID
(UA CODE)', 'id' => 'adfoxly-statistics-gaid-select', 'type' => 'radio', 'class' => 'form-control', 'wrapper_id' => 'adfoxly-statistics-gaid-wrapper', ), array( 'label' => 'Custom Analytics ID
(UA CODE)', 'id' => 'adfoxly-statistics-custom-gaid', 'type' => 'text', 'class' => 'form-control', 'wrapper_id' => 'adfoxly-statistics-custom-gaid-wrapper', ), array( 'label' => 'Saving banner view interval', 'id' => 'adfoxly-statistics-saving-view-interval', 'type' => 'number', 'class' => 'form-control', 'wrapper_id' => 'adfoxly-statistics-saving-view-interval-wrapper', ), ); function __construct() { $this->settings = get_option( 'adfoxly_settings' ); // $ga_obj = new Ga_track(); // $ua_id = $ga_obj->get_ga_implemented( get_site_url() ); if ( isset( $ua_id ) && ! empty( $ua_id[ 0 ] ) ) { foreach ( $ua_id[ 0 ] as $key => $value ) { $ga_ua_ids[ $value ] = $value; } } $ga_ua_ids[ 'other' ] = "Other"; if ( isset( $this->settings[ 'statistics-status' ] ) && ! empty( $this->settings[ 'statistics-status' ] ) ) { $this->meta_fields[ 0 ][ 'value' ] = $this->settings[ 'statistics-status' ]; } if ( isset( $this->settings[ 'statistics-type' ] ) && ! empty( $this->settings[ 'statistics-type' ] ) ) { $this->meta_fields[ 1 ][ 'value' ] = $this->settings[ 'statistics-type' ]; } if ( isset( $this->settings[ 'statistics-gaid-select' ] ) && ! empty( $this->settings[ 'statistics-gaid-select' ] ) ) { $this->meta_fields[ 2 ][ 'value' ] = $this->settings[ 'statistics-gaid-select' ]; } if ( isset( $ga_ua_ids ) && ! empty( $ga_ua_ids ) ) { $this->meta_fields[ 2 ][ 'options' ] = $ga_ua_ids; } if ( isset( $this->settings[ 'statistics-custom-gaid' ] ) && ! empty( $this->settings[ 'statistics-custom-gaid' ] ) ) { $this->meta_fields[ 3 ][ 'value' ] = $this->settings[ 'statistics-custom-gaid' ]; } if ( isset( $this->settings[ 'statistics-saving-view-interval' ] ) && ( ! empty( $this->settings[ 'statistics-saving-view-interval' ] ) ) ) { $this->meta_fields[ 4 ][ 'value' ] = $this->settings[ 'statistics-saving-view-interval' ]; } else { $this->meta_fields[ 4 ][ 'value' ] = '10'; } } } class adfoxlySettingsPixel { public $settings; public $meta_fields = array( array( 'label' => 'Pixel', 'id' => 'adfoxly-facebook-pixel-code', 'type' => 'textarea', 'class' => 'form-control' ) ); function __construct() { $this->settings = get_option( 'adfoxly_settings' ); if ( isset( $this->settings[ 'adfoxly-facebook-pixel-code' ] ) ) { $this->meta_fields[ 0 ][ 'value' ] = stripslashes( $this->settings[ 'adfoxly-facebook-pixel-code' ] ); } } } class adfoxlySettingsPrivacy { public $settings; public $meta_fields = array( array( 'label' => 'Heap', 'id' => 'adfoxly-privacy-heap', 'type' => 'radio', 'class' => 'form-control', 'default' => 'no', 'wrapper_id' => 'adfoxly-privacy-heap-wrapper', 'options' => array( 'no' => 'Do not send any data', 'yes' => 'Send some data like clicks, for better optimization.' ), ), array( 'label' => 'Hotjar', 'id' => 'adfoxly-privacy-hotjar', 'type' => 'radio', 'class' => 'form-control', 'default' => 'no', 'wrapper_id' => 'adfoxly-privacy-heap-wrapper', 'options' => array( 'no' => 'Do not send any data', 'yes' => 'Send some data like clicks, for better optimization.' ), ), array( 'label' => 'Google Analytics', 'id' => 'adfoxly-privacy-ga', 'type' => 'radio', 'class' => 'form-control', 'default' => 'no', 'wrapper_id' => 'adfoxly-privacy-ga-wrapper', 'options' => array( 'no' => 'Do not send any data', 'yes' => 'Send some data like clicks, for better optimization.' ), ), array( 'label' => 'Yandex Metrica', 'id' => 'adfoxly-privacy-yandex', 'type' => 'radio', 'class' => 'form-control', 'default' => 'no', 'wrapper_id' => 'adfoxly-privacy-yandex-wrapper', 'options' => array( 'no' => 'Do not send any data', 'yes' => 'Send some data like clicks, for better optimization.' ), ), array( 'label' => 'Sentry', 'id' => 'adfoxly-privacy-sentry', 'type' => 'radio', 'class' => 'form-control', 'default' => 'no', 'wrapper_id' => 'adfoxly-privacy-sentry-wrapper', 'options' => array( 'no' => 'Do not send any data', 'yes' => 'Send some data like clicks, for better optimization.' ), ), ); function __construct() { $this->settings = get_option( 'adfoxly_settings' ); if ( isset( $this->settings[ 'adfoxly-privacy-heap' ] ) ) { $this->meta_fields[ 0 ][ 'value' ] = stripslashes( $this->settings[ 'adfoxly-privacy-heap' ] ); } if ( isset( $this->settings[ 'adfoxly-privacy-hotjar' ] ) ) { $this->meta_fields[ 1 ][ 'value' ] = stripslashes( $this->settings[ 'adfoxly-privacy-hotjar' ] ); } if ( isset( $this->settings[ 'adfoxly-privacy-ga' ] ) ) { $this->meta_fields[ 2 ][ 'value' ] = stripslashes( $this->settings[ 'adfoxly-privacy-ga' ] ); } if ( isset( $this->settings[ 'adfoxly-privacy-yandex' ] ) ) { $this->meta_fields[ 3 ][ 'value' ] = stripslashes( $this->settings[ 'adfoxly-privacy-yandex' ] ); } if ( isset( $this->settings[ 'adfoxly-privacy-sentry' ] ) ) { $this->meta_fields[ 4 ][ 'value' ] = stripslashes( $this->settings[ 'adfoxly-privacy-sentry' ] ); } } }