Plugin Directory

Changeset 2922465


Ignore:
Timestamp:
06/06/2023 04:14:56 PM (3 years ago)
Author:
termageddon
Message:

[1.3.3] Presto Player Integration

Location:
termageddon-usercentrics
Files:
7 edited
19 copied

Legend:

Unmodified
Added
Removed
  • termageddon-usercentrics/tags/1.3.3/README.txt

    r2891339 r2922465  
    44Tags: termageddon, cookie, consent, embed
    55Requires at least: 3.0.1
    6 Tested up to: 6.2
    7 Stable tag: 1.3.2
     6Tested up to: 6.2.2
     7Stable tag: 1.3.3
    88License: GPLv2 or later
    99License URI: http://www.gnu.org/licenses/gpl-2.0.html
     
    2626
    2727== Changelog ==
     28
     29= 1.3.3 =
     30
     31-   [ADD] Added integration to improve support with Presto Player.
    2832
    2933= 1.3.2 =
  • termageddon-usercentrics/tags/1.3.3/admin/class-termageddon-usercentrics-admin.php

    r2890756 r2922465  
    220220
    221221
     222    /** Build the default arguments for the current section
     223     *
     224     * @param mixed $tab The tab you are setting up; For use with identifying current tab and hiding/showing the tab.
     225     * @return string[]
     226     */
     227    public function add_new_subsection( string $section, array $options=[]) {
     228
     229        $name = (isset($options['name']) ? $options['name'] : false);
     230        $description = (isset($options['description']) ? $options['description'] : false);
     231        $indent = (isset($options['indent']) ? $options['indent'] === true : false);
     232        $slim = (isset($options['slim']) ? $options['slim'] === true : false);
     233
     234        add_settings_field(
     235            'termageddon_usercentrics_end-section-'.Termageddon_Usercentrics::generate_random_string(5),
     236            '   </th></tr></tbody></table>
     237            </div>
     238            <div class="tu-toggle-section">
     239                <span class="tu-section-title">' . esc_html__( $name , 'termageddon-usercentrics') . ':</span>
     240                '.(empty($description) ? '' : '<p>' . esc_html__( $description, 'termageddon-usercentrics' ) . '</p>').'
     241            </div>
     242            <div class="'.($indent ? 'tu-toggle-section' : 'tu-settings-section').($slim ? ' slim-section' : '').'">
     243                <table class="form-table" role="presentation">
     244                    <tbody>
     245                        <tr style="display: none">
     246                            <th scope="row">',
     247            function() {}, // function which prints the field.
     248            'termageddon-usercentrics', // page slug.
     249            $section, // section ID.
     250            array()
     251        );
     252    }
     253
     254
     255    public static function mark_as_beta() {
     256        return ' <span class="tu-label-warning">BETA</span>';
     257    }
     258
     259
    222260    /**
    223261     * Buildout all settings sections in prep for registering the settings.
     
    338376            'termageddon_usercentrics_settings', // settings group name.
    339377            'termageddon_usercentrics_disable_logged_in', // option name.
     378            '' // sanitization function.
     379        );
     380
     381        // BREAK SECTION FOR GEOLOCATION SETTINGS
     382        $this->add_new_subsection('termageddon_usercentrics_section_settings', [
     383            'name' => 'Integrations',
     384            'description' => 'We love to partner with other plugin developers to improve support with their plugins. If you encounter an issue, please contact our support to let us know.',
     385        ]);
     386       
     387        // Disable Login.
     388        add_settings_field(
     389            'termageddon_usercentrics_integration_presto_player',
     390            __( 'Presto Player', 'termageddon-usercentrics' ).$this->mark_as_beta(),
     391            array( &$this, 'presto_player_support' ), // function which prints the field.
     392            'termageddon-usercentrics', // page slug.
     393            'termageddon_usercentrics_section_settings', // section ID.
     394            array(
     395                'label_for' => 'termageddon_usercentrics_integration_presto_player',
     396            )
     397        );
     398
     399        register_setting(
     400            'termageddon_usercentrics_settings', // settings group name.
     401            'termageddon_usercentrics_integration_presto_player', // option name.
    340402            '' // sanitization function.
    341403        );
     
    454516        );
    455517
    456         // Enable Geolocation AJAX Mode.
    457         add_settings_field(
    458             'termageddon_usercentrics_location_spacer',
    459             '   </th></tr></tbody></table>
    460             </div>
    461             <div class="tu-toggle-section">
    462                 <span class="tu-section-title">' . esc_html__( 'Geo-Location Settings' ) . ':</span>
    463                 <p>' . esc_html__( 'If you are experiencing issues or unexpected behavior, toggle the "Enable Location Logging" option. Please contact our support if you have any questions.', 'termageddon-usercentrics' ) . '</p>
    464             </div>
    465             <div class="tu-settings-section">
    466                 <table class="form-table" role="presentation">
    467                     <tbody>
    468                         <tr style="display: none">
    469                             <th scope="row">',
    470             function() {}, // function which prints the field.
    471             'termageddon-usercentrics', // page slug.
    472             'termageddon_usercentrics_section_geolocation', // section ID.
    473             array()
    474         );
     518        // BREAK SECTION FOR GEOLOCATION SETTINGS
     519        $this->add_new_subsection('termageddon_usercentrics_section_geolocation', [
     520            'name' => 'Geo-Location Settings',
     521            'description' => 'If you are experiencing issues or unexpected behavior, toggle the "Enable Location Logging" option. Please contact our support if you have any questions.',
     522        ]);
    475523
    476524        // Enable Geolocation Debug Mode.
     
    654702        self::generate_checkbox( 'admin', 'disable', $args );
    655703    }
     704   
     705    /**
     706     * The HTML field for the admin disable checkbox.
     707     *
     708     * @param array $args The arguments provided by the add_settings_field() method.
     709     * @return void
     710     */
     711    public function presto_player_support( array $args ) {
     712        $args['label'] = 'enabled';
     713        self::generate_checkbox( 'presto_player', 'integration', $args );
     714    }
    656715
    657716    /**
  • termageddon-usercentrics/tags/1.3.3/admin/css/termageddon-usercentrics-admin.css

    r2834137 r2922465  
    4949.tu-section-hidden {
    5050    display: none;
     51}
     52.tu-label-warning {
     53    background-color: orange;
     54    color: white;
     55    padding: 3px 5px;
     56    border-radius: 5px;
     57    font-size: 60%;
    5158}
    5259/**
  • termageddon-usercentrics/tags/1.3.3/admin/css/termageddon-usercentrics-admin.min.css

    r2834137 r2922465  
    1 textarea.termageddon-embed-code{width:100%;height:250px}.tu-section-settings,.tu-toggle-section{margin-top:2rem}.tu-toggle-section .tu-section-title{font-size:125%;font-weight:800}.tu-toggle-section .tu-section-title-helper{padding:1rem;color:#6c6c6c;font-style:italic}.tu-toggle-section input[readonly]{opacity:50%;pointer-events:none}.tu-toggle-section .form-table{margin-left:2rem}.tu-toggle-section .form-table td,.tu-toggle-section .form-table th{padding:.5rem 0}.tu-toggle-section.slim-section .form-table th{width:125px}.tu-settings-section .form-table th{width:300px}.tu-section-hidden{display:none}input[type=checkbox].wppd-ui-toggle{-webkit-appearance:none;-moz-appearance:none;appearance:none;-webkit-tap-highlight-color:transparent;width:auto;height:auto;vertical-align:middle;position:relative;border:0;outline:0;cursor:pointer;margin:0 4px;background:0 0;box-shadow:none}input[type=checkbox].wppd-ui-toggle:focus{box-shadow:none}input[type=checkbox].wppd-ui-toggle:after{content:"";font-size:6px;font-weight:400;line-height:18px;text-indent:-14px;color:#fff;width:36px;height:18px;display:inline-block;background-color:#a7aaad;border-radius:72px;box-shadow:0 0 12px rgb(0 0 0 / 15%) inset}input[type=checkbox].wppd-ui-toggle:before{content:"";width:14px;height:14px;display:block;position:absolute;top:2px;left:2px;margin:0;border-radius:50%;background-color:#fff}input[type=checkbox].wppd-ui-toggle:checked:before{left:20px;margin:0;background-color:#fff}input[type=checkbox].wppd-ui-toggle,input[type=checkbox].wppd-ui-toggle:after,input[type=checkbox].wppd-ui-toggle:before,input[type=checkbox].wppd-ui-toggle:checked:after,input[type=checkbox].wppd-ui-toggle:checked:before{transition:ease .15s}input[type=checkbox].wppd-ui-toggle:checked:after{content:"ON";background-color:#2271b1}input[type=checkbox].wppd-ui-toggle.label-hidden:after{width:48px}input[type=checkbox].wppd-ui-toggle.label-hidden:checked:before{left:32px}input[type=checkbox].wppd-ui-toggle.label-hidden:checked:after{content:"HIDDEN"}input[type=checkbox].wppd-ui-toggle.label-enabled:after{font-size:8px;width:60px;content:"DISABLED";text-indent:15px}input[type=checkbox].wppd-ui-toggle.label-enabled:checked:before{left:44px}input[type=checkbox].wppd-ui-toggle.label-enabled:checked:after{background-color:#1ed14b;content:"ENABLED";text-indent:-14px}
     1textarea.termageddon-embed-code{width:100%;height:250px}.tu-section-settings,.tu-toggle-section{margin-top:2rem}.tu-toggle-section .tu-section-title{font-size:125%;font-weight:800}.tu-toggle-section .tu-section-title-helper{padding:1rem;color:#6c6c6c;font-style:italic}.tu-toggle-section input[readonly]{opacity:50%;pointer-events:none}.tu-toggle-section .form-table{margin-left:2rem}.tu-toggle-section .form-table td,.tu-toggle-section .form-table th{padding:.5rem 0}.tu-toggle-section.slim-section .form-table th{width:125px}.tu-settings-section .form-table th{width:300px}.tu-section-hidden{display:none}.tu-label-warning{background-color:orange;color:#fff;padding:3px 5px;border-radius:5px;font-size:60%}input[type=checkbox].wppd-ui-toggle{-webkit-appearance:none;-moz-appearance:none;appearance:none;-webkit-tap-highlight-color:transparent;width:auto;height:auto;vertical-align:middle;position:relative;border:0;outline:0;cursor:pointer;margin:0 4px;background:0 0;box-shadow:none}input[type=checkbox].wppd-ui-toggle:focus{box-shadow:none}input[type=checkbox].wppd-ui-toggle:after{content:"";font-size:6px;font-weight:400;line-height:18px;text-indent:-14px;color:#fff;width:36px;height:18px;display:inline-block;background-color:#a7aaad;border-radius:72px;box-shadow:0 0 12px rgb(0 0 0 / 15%) inset}input[type=checkbox].wppd-ui-toggle:before{content:"";width:14px;height:14px;display:block;position:absolute;top:2px;left:2px;margin:0;border-radius:50%;background-color:#fff}input[type=checkbox].wppd-ui-toggle:checked:before{left:20px;margin:0;background-color:#fff}input[type=checkbox].wppd-ui-toggle,input[type=checkbox].wppd-ui-toggle:after,input[type=checkbox].wppd-ui-toggle:before,input[type=checkbox].wppd-ui-toggle:checked:after,input[type=checkbox].wppd-ui-toggle:checked:before{transition:ease .15s}input[type=checkbox].wppd-ui-toggle:checked:after{content:"ON";background-color:#2271b1}input[type=checkbox].wppd-ui-toggle.label-hidden:after{width:48px}input[type=checkbox].wppd-ui-toggle.label-hidden:checked:before{left:32px}input[type=checkbox].wppd-ui-toggle.label-hidden:checked:after{content:"HIDDEN"}input[type=checkbox].wppd-ui-toggle.label-enabled:after{font-size:8px;width:60px;content:"DISABLED";text-indent:15px}input[type=checkbox].wppd-ui-toggle.label-enabled:checked:before{left:44px}input[type=checkbox].wppd-ui-toggle.label-enabled:checked:after{background-color:#1ed14b;content:"ENABLED";text-indent:-14px}
  • termageddon-usercentrics/tags/1.3.3/includes/class-termageddon-usercentrics.php

    r2890756 r2922465  
    312312        return $execution_time;
    313313    }
     314   
     315   
     316    /**
     317     * Generate a random string with specified paramaters
     318     *
     319     * @param int $length The length of string to generate.
     320     * @param array $options The various options to pass in. 'type' is a valid option.
     321     * @return string $randomString - The randomized string
     322     */
     323    public static function generate_random_string(int $length=10, array $options=[]) {
     324        $type = (isset($options['type']) ? $options['type'] : null);
     325        switch (strtolower($type)) {
     326            case 'letters':
     327                $characters = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ';
     328                break;
     329            case 'numbers':
     330                $characters = '0123456789';
     331                break;
     332            default:
     333                $characters = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ';
     334                break;
     335        }
     336
     337        //Generate String
     338        $charactersLength = strlen($characters);
     339        $randomString     = '';
     340        for ($i = 0; $i < $length; $i++) {
     341            $randomString .= $characters[rand(0, $charactersLength - 1)];
     342        }
     343
     344        return $randomString;
     345
     346    }
     347
    314348
    315349
     
    827861        $show_in_virginia   = get_option( 'termageddon_usercentrics_show_in_virginia', false ) ? true : false;
    828862        return ( $show_in_eu || $show_in_uk || $show_in_canada || $show_in_california || $show_in_virginia );
     863    }
     864   
     865    /** Identifies if any geoip location is enabled.
     866     *
     867     * @return bool
     868     */
     869    public static function is_integration_enabled( string $int ) {
     870        return get_option( 'termageddon_usercentrics_integration_'.$int, false ) ? true : false;
    829871    }
    830872
  • termageddon-usercentrics/tags/1.3.3/public/class-termageddon-usercentrics-public.php

    r2890756 r2922465  
    195195          </script>';
    196196        }
     197       
     198        // Presto Player Integration Javascript.
     199        if ( Termageddon_Usercentrics::is_integration_enabled('presto_player') ) {
     200            $script .= '<script type="application/javascript" id="uc-integration-presto-player">
     201    function uc_integration_setup(iID,service) {
     202        uc.blockElements({[iID] : \'figure.presto-block-video.presto-provider-\'+service});
     203        uc.reloadOnOptIn(iID);
     204        uc.reloadOnOptOut(iID);
     205    }
     206    uc_integration_setup("BJz7qNsdj-7","youtube"); // Youtube
     207    uc_integration_setup("HyEX5Nidi-m","vimeo"); // Vimeo
     208</script>';
     209        }
    197210
    198211        // Output to HTML HEAD.
  • termageddon-usercentrics/tags/1.3.3/termageddon-usercentrics.php

    r2890756 r2922465  
    1515 * Plugin Name:       Termageddon + Usercentrics
    1616 * Description:       Easily integrate the Usercentrics consent solution into your website while controlling visibility for logged in users and admins.
    17  * Version:           1.3.2
     17 * Version:           1.3.3
    1818 * Author:            Termageddon
    1919 * Author URI:        https://termageddon.com
     
    3434 * Rename this for your plugin and update it as you release new versions.
    3535 */
    36 define( 'TERMAGEDDON_COOKIE_VERSION', '1.3.2' );
     36define( 'TERMAGEDDON_COOKIE_VERSION', '1.3.3' );
    3737
    3838define( 'TERMAGEDDON_COOKIE_PLUGIN_PATH', dirname( __FILE__ ) );// No trailing slash.
  • termageddon-usercentrics/trunk/README.txt

    r2891339 r2922465  
    44Tags: termageddon, cookie, consent, embed
    55Requires at least: 3.0.1
    6 Tested up to: 6.2
    7 Stable tag: 1.3.2
     6Tested up to: 6.2.2
     7Stable tag: 1.3.3
    88License: GPLv2 or later
    99License URI: http://www.gnu.org/licenses/gpl-2.0.html
     
    2626
    2727== Changelog ==
     28
     29= 1.3.3 =
     30
     31-   [ADD] Added integration to improve support with Presto Player.
    2832
    2933= 1.3.2 =
  • termageddon-usercentrics/trunk/admin/class-termageddon-usercentrics-admin.php

    r2890756 r2922465  
    220220
    221221
     222    /** Build the default arguments for the current section
     223     *
     224     * @param mixed $tab The tab you are setting up; For use with identifying current tab and hiding/showing the tab.
     225     * @return string[]
     226     */
     227    public function add_new_subsection( string $section, array $options=[]) {
     228
     229        $name = (isset($options['name']) ? $options['name'] : false);
     230        $description = (isset($options['description']) ? $options['description'] : false);
     231        $indent = (isset($options['indent']) ? $options['indent'] === true : false);
     232        $slim = (isset($options['slim']) ? $options['slim'] === true : false);
     233
     234        add_settings_field(
     235            'termageddon_usercentrics_end-section-'.Termageddon_Usercentrics::generate_random_string(5),
     236            '   </th></tr></tbody></table>
     237            </div>
     238            <div class="tu-toggle-section">
     239                <span class="tu-section-title">' . esc_html__( $name , 'termageddon-usercentrics') . ':</span>
     240                '.(empty($description) ? '' : '<p>' . esc_html__( $description, 'termageddon-usercentrics' ) . '</p>').'
     241            </div>
     242            <div class="'.($indent ? 'tu-toggle-section' : 'tu-settings-section').($slim ? ' slim-section' : '').'">
     243                <table class="form-table" role="presentation">
     244                    <tbody>
     245                        <tr style="display: none">
     246                            <th scope="row">',
     247            function() {}, // function which prints the field.
     248            'termageddon-usercentrics', // page slug.
     249            $section, // section ID.
     250            array()
     251        );
     252    }
     253
     254
     255    public static function mark_as_beta() {
     256        return ' <span class="tu-label-warning">BETA</span>';
     257    }
     258
     259
    222260    /**
    223261     * Buildout all settings sections in prep for registering the settings.
     
    338376            'termageddon_usercentrics_settings', // settings group name.
    339377            'termageddon_usercentrics_disable_logged_in', // option name.
     378            '' // sanitization function.
     379        );
     380
     381        // BREAK SECTION FOR GEOLOCATION SETTINGS
     382        $this->add_new_subsection('termageddon_usercentrics_section_settings', [
     383            'name' => 'Integrations',
     384            'description' => 'We love to partner with other plugin developers to improve support with their plugins. If you encounter an issue, please contact our support to let us know.',
     385        ]);
     386       
     387        // Disable Login.
     388        add_settings_field(
     389            'termageddon_usercentrics_integration_presto_player',
     390            __( 'Presto Player', 'termageddon-usercentrics' ).$this->mark_as_beta(),
     391            array( &$this, 'presto_player_support' ), // function which prints the field.
     392            'termageddon-usercentrics', // page slug.
     393            'termageddon_usercentrics_section_settings', // section ID.
     394            array(
     395                'label_for' => 'termageddon_usercentrics_integration_presto_player',
     396            )
     397        );
     398
     399        register_setting(
     400            'termageddon_usercentrics_settings', // settings group name.
     401            'termageddon_usercentrics_integration_presto_player', // option name.
    340402            '' // sanitization function.
    341403        );
     
    454516        );
    455517
    456         // Enable Geolocation AJAX Mode.
    457         add_settings_field(
    458             'termageddon_usercentrics_location_spacer',
    459             '   </th></tr></tbody></table>
    460             </div>
    461             <div class="tu-toggle-section">
    462                 <span class="tu-section-title">' . esc_html__( 'Geo-Location Settings' ) . ':</span>
    463                 <p>' . esc_html__( 'If you are experiencing issues or unexpected behavior, toggle the "Enable Location Logging" option. Please contact our support if you have any questions.', 'termageddon-usercentrics' ) . '</p>
    464             </div>
    465             <div class="tu-settings-section">
    466                 <table class="form-table" role="presentation">
    467                     <tbody>
    468                         <tr style="display: none">
    469                             <th scope="row">',
    470             function() {}, // function which prints the field.
    471             'termageddon-usercentrics', // page slug.
    472             'termageddon_usercentrics_section_geolocation', // section ID.
    473             array()
    474         );
     518        // BREAK SECTION FOR GEOLOCATION SETTINGS
     519        $this->add_new_subsection('termageddon_usercentrics_section_geolocation', [
     520            'name' => 'Geo-Location Settings',
     521            'description' => 'If you are experiencing issues or unexpected behavior, toggle the "Enable Location Logging" option. Please contact our support if you have any questions.',
     522        ]);
    475523
    476524        // Enable Geolocation Debug Mode.
     
    654702        self::generate_checkbox( 'admin', 'disable', $args );
    655703    }
     704   
     705    /**
     706     * The HTML field for the admin disable checkbox.
     707     *
     708     * @param array $args The arguments provided by the add_settings_field() method.
     709     * @return void
     710     */
     711    public function presto_player_support( array $args ) {
     712        $args['label'] = 'enabled';
     713        self::generate_checkbox( 'presto_player', 'integration', $args );
     714    }
    656715
    657716    /**
  • termageddon-usercentrics/trunk/admin/css/termageddon-usercentrics-admin.css

    r2834137 r2922465  
    4949.tu-section-hidden {
    5050    display: none;
     51}
     52.tu-label-warning {
     53    background-color: orange;
     54    color: white;
     55    padding: 3px 5px;
     56    border-radius: 5px;
     57    font-size: 60%;
    5158}
    5259/**
  • termageddon-usercentrics/trunk/admin/css/termageddon-usercentrics-admin.min.css

    r2834137 r2922465  
    1 textarea.termageddon-embed-code{width:100%;height:250px}.tu-section-settings,.tu-toggle-section{margin-top:2rem}.tu-toggle-section .tu-section-title{font-size:125%;font-weight:800}.tu-toggle-section .tu-section-title-helper{padding:1rem;color:#6c6c6c;font-style:italic}.tu-toggle-section input[readonly]{opacity:50%;pointer-events:none}.tu-toggle-section .form-table{margin-left:2rem}.tu-toggle-section .form-table td,.tu-toggle-section .form-table th{padding:.5rem 0}.tu-toggle-section.slim-section .form-table th{width:125px}.tu-settings-section .form-table th{width:300px}.tu-section-hidden{display:none}input[type=checkbox].wppd-ui-toggle{-webkit-appearance:none;-moz-appearance:none;appearance:none;-webkit-tap-highlight-color:transparent;width:auto;height:auto;vertical-align:middle;position:relative;border:0;outline:0;cursor:pointer;margin:0 4px;background:0 0;box-shadow:none}input[type=checkbox].wppd-ui-toggle:focus{box-shadow:none}input[type=checkbox].wppd-ui-toggle:after{content:"";font-size:6px;font-weight:400;line-height:18px;text-indent:-14px;color:#fff;width:36px;height:18px;display:inline-block;background-color:#a7aaad;border-radius:72px;box-shadow:0 0 12px rgb(0 0 0 / 15%) inset}input[type=checkbox].wppd-ui-toggle:before{content:"";width:14px;height:14px;display:block;position:absolute;top:2px;left:2px;margin:0;border-radius:50%;background-color:#fff}input[type=checkbox].wppd-ui-toggle:checked:before{left:20px;margin:0;background-color:#fff}input[type=checkbox].wppd-ui-toggle,input[type=checkbox].wppd-ui-toggle:after,input[type=checkbox].wppd-ui-toggle:before,input[type=checkbox].wppd-ui-toggle:checked:after,input[type=checkbox].wppd-ui-toggle:checked:before{transition:ease .15s}input[type=checkbox].wppd-ui-toggle:checked:after{content:"ON";background-color:#2271b1}input[type=checkbox].wppd-ui-toggle.label-hidden:after{width:48px}input[type=checkbox].wppd-ui-toggle.label-hidden:checked:before{left:32px}input[type=checkbox].wppd-ui-toggle.label-hidden:checked:after{content:"HIDDEN"}input[type=checkbox].wppd-ui-toggle.label-enabled:after{font-size:8px;width:60px;content:"DISABLED";text-indent:15px}input[type=checkbox].wppd-ui-toggle.label-enabled:checked:before{left:44px}input[type=checkbox].wppd-ui-toggle.label-enabled:checked:after{background-color:#1ed14b;content:"ENABLED";text-indent:-14px}
     1textarea.termageddon-embed-code{width:100%;height:250px}.tu-section-settings,.tu-toggle-section{margin-top:2rem}.tu-toggle-section .tu-section-title{font-size:125%;font-weight:800}.tu-toggle-section .tu-section-title-helper{padding:1rem;color:#6c6c6c;font-style:italic}.tu-toggle-section input[readonly]{opacity:50%;pointer-events:none}.tu-toggle-section .form-table{margin-left:2rem}.tu-toggle-section .form-table td,.tu-toggle-section .form-table th{padding:.5rem 0}.tu-toggle-section.slim-section .form-table th{width:125px}.tu-settings-section .form-table th{width:300px}.tu-section-hidden{display:none}.tu-label-warning{background-color:orange;color:#fff;padding:3px 5px;border-radius:5px;font-size:60%}input[type=checkbox].wppd-ui-toggle{-webkit-appearance:none;-moz-appearance:none;appearance:none;-webkit-tap-highlight-color:transparent;width:auto;height:auto;vertical-align:middle;position:relative;border:0;outline:0;cursor:pointer;margin:0 4px;background:0 0;box-shadow:none}input[type=checkbox].wppd-ui-toggle:focus{box-shadow:none}input[type=checkbox].wppd-ui-toggle:after{content:"";font-size:6px;font-weight:400;line-height:18px;text-indent:-14px;color:#fff;width:36px;height:18px;display:inline-block;background-color:#a7aaad;border-radius:72px;box-shadow:0 0 12px rgb(0 0 0 / 15%) inset}input[type=checkbox].wppd-ui-toggle:before{content:"";width:14px;height:14px;display:block;position:absolute;top:2px;left:2px;margin:0;border-radius:50%;background-color:#fff}input[type=checkbox].wppd-ui-toggle:checked:before{left:20px;margin:0;background-color:#fff}input[type=checkbox].wppd-ui-toggle,input[type=checkbox].wppd-ui-toggle:after,input[type=checkbox].wppd-ui-toggle:before,input[type=checkbox].wppd-ui-toggle:checked:after,input[type=checkbox].wppd-ui-toggle:checked:before{transition:ease .15s}input[type=checkbox].wppd-ui-toggle:checked:after{content:"ON";background-color:#2271b1}input[type=checkbox].wppd-ui-toggle.label-hidden:after{width:48px}input[type=checkbox].wppd-ui-toggle.label-hidden:checked:before{left:32px}input[type=checkbox].wppd-ui-toggle.label-hidden:checked:after{content:"HIDDEN"}input[type=checkbox].wppd-ui-toggle.label-enabled:after{font-size:8px;width:60px;content:"DISABLED";text-indent:15px}input[type=checkbox].wppd-ui-toggle.label-enabled:checked:before{left:44px}input[type=checkbox].wppd-ui-toggle.label-enabled:checked:after{background-color:#1ed14b;content:"ENABLED";text-indent:-14px}
  • termageddon-usercentrics/trunk/includes/class-termageddon-usercentrics.php

    r2890756 r2922465  
    312312        return $execution_time;
    313313    }
     314   
     315   
     316    /**
     317     * Generate a random string with specified paramaters
     318     *
     319     * @param int $length The length of string to generate.
     320     * @param array $options The various options to pass in. 'type' is a valid option.
     321     * @return string $randomString - The randomized string
     322     */
     323    public static function generate_random_string(int $length=10, array $options=[]) {
     324        $type = (isset($options['type']) ? $options['type'] : null);
     325        switch (strtolower($type)) {
     326            case 'letters':
     327                $characters = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ';
     328                break;
     329            case 'numbers':
     330                $characters = '0123456789';
     331                break;
     332            default:
     333                $characters = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ';
     334                break;
     335        }
     336
     337        //Generate String
     338        $charactersLength = strlen($characters);
     339        $randomString     = '';
     340        for ($i = 0; $i < $length; $i++) {
     341            $randomString .= $characters[rand(0, $charactersLength - 1)];
     342        }
     343
     344        return $randomString;
     345
     346    }
     347
    314348
    315349
     
    827861        $show_in_virginia   = get_option( 'termageddon_usercentrics_show_in_virginia', false ) ? true : false;
    828862        return ( $show_in_eu || $show_in_uk || $show_in_canada || $show_in_california || $show_in_virginia );
     863    }
     864   
     865    /** Identifies if any geoip location is enabled.
     866     *
     867     * @return bool
     868     */
     869    public static function is_integration_enabled( string $int ) {
     870        return get_option( 'termageddon_usercentrics_integration_'.$int, false ) ? true : false;
    829871    }
    830872
  • termageddon-usercentrics/trunk/public/class-termageddon-usercentrics-public.php

    r2890756 r2922465  
    195195          </script>';
    196196        }
     197       
     198        // Presto Player Integration Javascript.
     199        if ( Termageddon_Usercentrics::is_integration_enabled('presto_player') ) {
     200            $script .= '<script type="application/javascript" id="uc-integration-presto-player">
     201    function uc_integration_setup(iID,service) {
     202        uc.blockElements({[iID] : \'figure.presto-block-video.presto-provider-\'+service});
     203        uc.reloadOnOptIn(iID);
     204        uc.reloadOnOptOut(iID);
     205    }
     206    uc_integration_setup("BJz7qNsdj-7","youtube"); // Youtube
     207    uc_integration_setup("HyEX5Nidi-m","vimeo"); // Vimeo
     208</script>';
     209        }
    197210
    198211        // Output to HTML HEAD.
  • termageddon-usercentrics/trunk/termageddon-usercentrics.php

    r2890756 r2922465  
    1515 * Plugin Name:       Termageddon + Usercentrics
    1616 * Description:       Easily integrate the Usercentrics consent solution into your website while controlling visibility for logged in users and admins.
    17  * Version:           1.3.2
     17 * Version:           1.3.3
    1818 * Author:            Termageddon
    1919 * Author URI:        https://termageddon.com
     
    3434 * Rename this for your plugin and update it as you release new versions.
    3535 */
    36 define( 'TERMAGEDDON_COOKIE_VERSION', '1.3.2' );
     36define( 'TERMAGEDDON_COOKIE_VERSION', '1.3.3' );
    3737
    3838define( 'TERMAGEDDON_COOKIE_PLUGIN_PATH', dirname( __FILE__ ) );// No trailing slash.
Note: See TracChangeset for help on using the changeset viewer.