Plugin Directory

Changeset 3370080


Ignore:
Timestamp:
09/30/2025 03:45:56 AM (5 months ago)
Author:
sided
Message:

Use embed v2 script in place of V1

Location:
sided/trunk
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • sided/trunk/env.php

    r3029321 r3370080  
    44define('SIDED_AWS_S3_BASE_URL', 'https://cdn.sided.co');
    55define('SIDED_AUTH_STATUS_TRANSIENT_NAME', 'sided_authentication_status5');
     6define('SIDED_EMBED_V2_BASE_URL', 'https://embed-v2.sided.co');
  • sided/trunk/partials/functions.php

    r3368163 r3370080  
    88
    99    $sided_initiate_script = get_option('sided_sided_initiate_script');
     10    // if ($sided_initiate_script == 'true') {
     11    //     wp_enqueue_script(
     12    //         'Sided embed script',
     13    //         sprintf('%s/embed-assets/load.min.js', SIDED_AWS_S3_BASE_URL),
     14    //         [],
     15    //         sprintf('%s_9.3.5', $wp_version)
     16    //     );
     17
     18    //     add_filter( 'script_loader_tag', function ( $tag, $handle ) {
     19    //         if ( 'Sided embed script' !== $handle ) {
     20    //             return $tag;
     21    //         }
     22    //         //return str_replace( ' src', ' defer src', $tag ); // defer the script
     23    //         return str_replace( ' src', ' async src', $tag ); // OR async the script
     24    //         //return str_replace( ' src', ' async defer src', $tag ); // OR do both!
     25    //     }, 10, 2 );
     26    // }
     27
    1028    if ($sided_initiate_script == 'true') {
    1129        wp_enqueue_script(
    12             'Sided embed script',
    13             sprintf('%s/embed-assets/load.min.js', SIDED_AWS_S3_BASE_URL),
     30            'sided-v2-embed',
     31            sprintf('%s/assets/index.js', SIDED_EMBED_V2_BASE_URL),
    1432            [],
    15             sprintf('%s_9.3.5', $wp_version)
     33            null, // No version needed
    1634        );
    1735
    1836        add_filter( 'script_loader_tag', function ( $tag, $handle ) {
    19             if ( 'Sided embed script' !== $handle ) {
    20                 return $tag;
    21             }
    22             //return str_replace( ' src', ' defer src', $tag ); // defer the script
    23             return str_replace( ' src', ' async src', $tag ); // OR async the script
    24             //return str_replace( ' src', ' async defer src', $tag ); // OR do both!
     37            if ('sided-v2-embed' === $handle) {
     38                // Remove id="sided-v2-embed-js" from the script tag
     39                $tag = preg_replace('/\s+id=["\'].*?-js["\']/', '', $tag);
     40                // Replace with type="module"
     41                return str_replace('<script ', '<script type="module" ', $tag);
     42            }
     43            return $tag;
    2544        }, 10, 2 );
    2645    }
  • sided/trunk/readme.txt

    r3369836 r3370080  
    55Requires at least: 4.7
    66Tested up to: 6.5.3
    7 Stable tag: 1.4.7
     7Stable tag: 1.4.8
    88Requires PHP: 7.0
    99License: GPLv2 or later
  • sided/trunk/sided.php

    r3369836 r3370080  
    44* Plugin URI: https://sided.co/
    55* Description: It is a wordpress plugin to embed sided polls in your Wordpress website.
    6 * Version: 1.4.7
     6* Version: 1.4.8
    77* Author: Sided
    88**/
    99
    10 define( 'SIDED_VERSION', '1.4.7' );
     10define( 'SIDED_VERSION', '1.4.8' );
    1111define( 'SIDED_PLUGIN', __FILE__ );
    1212define( 'SIDED_PLUGIN_DIR', untrailingslashit( dirname( SIDED_PLUGIN ) ) );
Note: See TracChangeset for help on using the changeset viewer.