Plugin Directory

Changeset 2144933


Ignore:
Timestamp:
08/24/2019 06:49:11 PM (7 years ago)
Author:
2plus2is4
Message:
  • CSS classes changed
  • HTML structure changed
Location:
simple-youtube-gdpr
Files:
219 added
11 edited

Legend:

Unmodified
Added
Removed
  • simple-youtube-gdpr/trunk/README.txt

    r2143715 r2144933  
    1 ===  WordPress YouTube and Vimeo videos security Plugin (GDPR) ===
     1===  WordPress YouTube, Vimeo and more elements security Plugin (GDPR) ===
    22Contributors: 2plus2is4
    33Donate link: https://money.yandex.ru/to/41001417963743
    4 Tags: iframe, YouTube, GDPR, Vimeo, thumbnails, Consent, Compliance
     4Tags: iframe, YouTube, GDPR, Vimeo, Flickr, Issuu, thumbnails, Consent, Compliance
    55Requires at least: 5.0.1
    66Tested up to: 5.2.2
    7 Stable tag: 0.7
     7Stable tag: 0.8
    88Requires PHP: 5.2.4
    99License: GPLv2 or later
    1010License URI: http://www.gnu.org/licenses/gpl-2.0.html
    1111
    12 Integrate YouTube and Vimeo videos securely!
     12Integrate YouTube elements securely!
    1313
    1414== Description ==
    1515
    16 Simple YouTube GDPR automatically detects and blocks Iframes from YouTube and Vimeo. Only with a click by the visitor the content is loaded.
     16WordPress YouTube security Plugin automatically detects and blocks Iframes from YouTube. Only with a click by the visitor the content is loaded.
    1717
    18 Simple YouTube GDPR automatically saves YouTube and Vimeo thumbnails locally without the visitor's IP address being transmitted to the video platform.
     18Plugin automatically saves YouTube thumbnails locally without the visitor's IP address being transmitted to the video platform.
    1919
    2020![Plays Vimeo Video](https://alexeyvolkov.com/images/syg.gif)
     
    2424*   Google gets NO cookies
    2525*   No content changes required
    26 *   Allows you to keep YouTube videos under GDPR law
     26*   Allows you to keep YouTube, Vimeo [premium] and more elements under GDPR law
    2727
    2828== Want more? ==
    29 If you enjoy this plugin and you want your other content to be safe, consider purchasing the [premium version](https://checkout.freemius.com/mode/dialog/plugin/4426/plan/7118/).
     29If you enjoy blocking YouTube videos and you want your other content (Vimeo, Flickr, Issuu) to be safe, consider purchasing the [premium version](https://checkout.freemius.com/mode/dialog/plugin/4426/plan/7118/).
    3030
    3131= Premium features =
     32* All free features
    3233* Integrate Vimeo videos securely!
     34* Integrate Issuu content securely!
     35* Integrate Flickr photos securely!
    3336
    3437== Installation ==
     
    5356This is an only image plugin can get from YouTube.
    5457
    55 = Do I need to have the YouTube API? =
     58= Do I need to have any API? =
    5659
    5760No.
     
    6063
    6164Yes. Class:
    62 * `syg__box` - main wrapping `<div>` (`syg__box-%SERVICE%` where `%SERVICE%` can be youtube or vimeo)
     65* `syg__box` - main wrapping `<div>` (`syg__box-%SERVICE%` where `%SERVICE%` can be youtube, vimeo, issuu, flickr)
    6366* `syg__box__img` - the thumbnail
    6467* `syg__box__text__btn` - thumbnail play button
    65 * `syg__box-youtube-iframe` - video `<iframe>` (where `%SERVICE%` can be youtube or vimeo)
     68* `syg__box-youtube-iframe` - video `<iframe>` (where `%SERVICE%` can be youtube, vimeo, issuu)
    6669
    6770= What are standard width and height of iframe? =
     
    7881== Screenshots ==
    7982
    80 Integrate YouTube and Vimeo videos securely!
     83Integrate YouTube, Vimeo and more elements securely!
    8184
    82851. YouTube video is replaced with a static preview image and a play button.
    8386
    8487== Changelog ==
     88
     89= 0.8 =
     90
     91* CSS classes changed
    8592
    8693= 0.7 =
     
    95102== Upgrade Notice ==
    96103
     104= 0.8 =
     105* HTML structure changed
     106
    97107= 0.7 =
    98108* No content on the page bug is fixed.
  • simple-youtube-gdpr/trunk/languages/simple-youtube-gdpr-de_DE.po

    r2143715 r2144933  
    22msgstr ""
    33"Project-Id-Version: Simple YouTube GDPR\n"
    4 "POT-Creation-Date: 2019-08-22 15:02+0300\n"
    5 "PO-Revision-Date: 2019-08-22 15:03+0300\n"
     4"POT-Creation-Date: 2019-08-24 21:35+0300\n"
     5"PO-Revision-Date: 2019-08-24 21:37+0300\n"
    66"Last-Translator: \n"
    77"Language-Team: \n"
     
    2222"X-Poedit-SearchPathExcluded-0: *.js\n"
    2323
    24 #: public/class-simple-youtube-gdpr-public.php:221
     24#: public/class-simple-youtube-gdpr-public.php:284
    2525msgid "Click to Play Video"
    2626msgstr "Anklicken um abzuspielen"
    2727
    28 #: public/class-simple-youtube-gdpr-public.php:222
     28#: public/class-simple-youtube-gdpr-public.php:285
    2929msgid "YouTube Video Thumbnail"
    3030msgstr "YouTube Video Miniaturansicht"
    3131
    32 #: public/class-simple-youtube-gdpr-public.php:225
     32#: public/class-simple-youtube-gdpr-public.php:288
    3333msgid "By loading the video, you agree to YouTube's privacy policy."
    3434msgstr ""
     
    3636"YouTube zu."
    3737
    38 #: public/class-simple-youtube-gdpr-public.php:227
     38#: public/class-simple-youtube-gdpr-public.php:290
    3939#, fuzzy
    4040#| msgid "https://policies.google.com/privacy?hl=en&amp;gl=en"
     
    4242msgstr "https://policies.google.com/privacy?hl=de"
    4343
    44 #: public/class-simple-youtube-gdpr-public.php:228
    45 #: public/class-simple-youtube-gdpr-public.php:257
    46 msgid "Learn more"
    47 msgstr "Google-Datenschutzerklärung"
     44#: public/class-simple-youtube-gdpr-public.php:291
     45#: public/class-simple-youtube-gdpr-public.php:319
     46#: public/class-simple-youtube-gdpr-public.php:371
     47msgid "Read policy"
     48msgstr "Richtlinie lesen"
    4849
    49 #: public/class-simple-youtube-gdpr-public.php:231
    50 #: public/class-simple-youtube-gdpr-public.php:260
    51 msgid "Load video"
    52 msgstr "Video laden"
     50#: public/class-simple-youtube-gdpr-public.php:294
     51#: public/class-simple-youtube-gdpr-public.php:322
     52msgid "Play video"
     53msgstr "Video abspielen"
    5354
    54 #: public/class-simple-youtube-gdpr-public.php:254
    55 #, fuzzy
    56 #| msgid "By loading the video, you agree to YouTube's privacy policy."
     55#: public/class-simple-youtube-gdpr-public.php:316
    5756msgid "By loading the video, you agree to Vimeo's privacy policy."
    5857msgstr ""
    59 "Durch das Laden des Videos stimmst du den Datenschutzbestimmungen von "
    60 "YouTube zu."
     58"Durch das Laden des Videos stimmen Sie den Datenschutzbestimmungen von "
     59"Vimeo zu."
    6160
    62 #: public/class-simple-youtube-gdpr-public.php:256
     61#: public/class-simple-youtube-gdpr-public.php:318
     62msgid "https://vimeo.com/privacy"
     63msgstr "https://vimeo.com/privacy"
     64
     65#: public/class-simple-youtube-gdpr-public.php:368
     66msgid "By loading the issuu element, you agree to its privacy policy."
     67msgstr ""
     68"Durch das Laden des issuu-Elements stimmen Sie dessen "
     69"Datenschutzbestimmungen zu."
     70
     71#: public/class-simple-youtube-gdpr-public.php:370
    6372#, fuzzy
    6473#| msgid "https://policies.google.com/privacy?hl=en&amp;gl=en"
    65 msgid "https://vimeo.com/privacy"
     74msgid "https://issuu.com/legal/privacy"
    6675msgstr "https://policies.google.com/privacy?hl=de"
     76
     77#: public/class-simple-youtube-gdpr-public.php:374
     78msgid "Show element"
     79msgstr "Element anzeigen"
    6780
    6881#: simple-youtube-gdpr.php:101
     
    7083msgstr "Klicken Sie hier, um Ihren Plan zu aktualisieren"
    7184
    72 #: simple-youtube-gdpr.php:101
    73 msgid "Get Vimeo Blocker!"
    74 msgstr "Holen Sie sich Vimeo Blocker!"
     85#: simple-youtube-gdpr.php:102
     86msgid "Block Vimeo and more!"
     87msgstr "Block Vimeo und mehr!"
     88
     89#: simple-youtube-gdpr.php:114
     90msgid "Payment in RUB - Russian Rubles"
     91msgstr "Zahlung in RUB - Russische Rubel"
     92
     93#: simple-youtube-gdpr.php:115
     94msgid "Donate"
     95msgstr "Spenden"
    7596
    7697#. Plugin Name of the plugin/theme
    7798msgid "Simple YouTube GDPR"
    78 msgstr "Simple YouTube GDPR"
     99msgstr "WordPress YouTube, Vimeo und mehr Elemente Security Plugin (GDPR)"
    79100
    80101#. Plugin URI of the plugin/theme
     
    94115msgstr "https://alexeyvolkov.com/"
    95116
     117#~ msgid "Learn more"
     118#~ msgstr "Google-Datenschutzerklärung"
     119
     120#~ msgid "Get Vimeo Blocker!"
     121#~ msgstr "Holen Sie sich Vimeo Blocker!"
     122
    96123#~ msgid ""
    97124#~ "Replaces all YouTube video iframes with a local image and loads a no "
  • simple-youtube-gdpr/trunk/languages/simple-youtube-gdpr-fr_FR.po

    r2143715 r2144933  
    22msgstr ""
    33"Project-Id-Version: Simple YouTube GDPR\n"
    4 "POT-Creation-Date: 2019-08-22 15:09+0300\n"
    5 "PO-Revision-Date: 2019-08-22 15:09+0300\n"
     4"POT-Creation-Date: 2019-08-24 21:32+0300\n"
     5"PO-Revision-Date: 2019-08-24 21:34+0300\n"
    66"Last-Translator: \n"
    77"Language-Team: \n"
     
    2222"X-Poedit-SearchPathExcluded-0: *.js\n"
    2323
    24 #: public/class-simple-youtube-gdpr-public.php:221
     24#: public/class-simple-youtube-gdpr-public.php:284
    2525msgid "Click to Play Video"
    2626msgstr "Cliquez pour lire la vidéo"
    2727
    28 #: public/class-simple-youtube-gdpr-public.php:222
     28#: public/class-simple-youtube-gdpr-public.php:285
    2929msgid "YouTube Video Thumbnail"
    3030msgstr "Vignette de la vidéo YouTube"
    3131
    32 #: public/class-simple-youtube-gdpr-public.php:225
     32#: public/class-simple-youtube-gdpr-public.php:288
    3333msgid "By loading the video, you agree to YouTube's privacy policy."
    3434msgstr ""
     
    3636"YouTube."
    3737
    38 #: public/class-simple-youtube-gdpr-public.php:227
     38#: public/class-simple-youtube-gdpr-public.php:290
    3939msgid "https://policies.google.com/privacy?hl=en"
    4040msgstr "https://policies.google.com/privacy?hl=fr"
    4141
    42 #: public/class-simple-youtube-gdpr-public.php:228
    43 #: public/class-simple-youtube-gdpr-public.php:257
    44 msgid "Learn more"
    45 msgstr "Apprendre encore plus"
     42#: public/class-simple-youtube-gdpr-public.php:291
     43#: public/class-simple-youtube-gdpr-public.php:319
     44#: public/class-simple-youtube-gdpr-public.php:371
     45msgid "Read policy"
     46msgstr "Lire la politique"
    4647
    47 #: public/class-simple-youtube-gdpr-public.php:231
    48 #: public/class-simple-youtube-gdpr-public.php:260
    49 msgid "Load video"
    50 msgstr "Charger la vidéo"
     48#: public/class-simple-youtube-gdpr-public.php:294
     49#: public/class-simple-youtube-gdpr-public.php:322
     50msgid "Play video"
     51msgstr "Lire la vidéo"
    5152
    52 #: public/class-simple-youtube-gdpr-public.php:254
     53#: public/class-simple-youtube-gdpr-public.php:316
    5354msgid "By loading the video, you agree to Vimeo's privacy policy."
    5455msgstr ""
     
    5657"Vimeo."
    5758
    58 #: public/class-simple-youtube-gdpr-public.php:256
     59#: public/class-simple-youtube-gdpr-public.php:318
    5960msgid "https://vimeo.com/privacy"
    6061msgstr "https://vimeo.com/privacy"
     62
     63#: public/class-simple-youtube-gdpr-public.php:368
     64msgid "By loading the issuu element, you agree to its privacy policy."
     65msgstr ""
     66"En chargeant l'élément issuu, vous acceptez sa politique de "
     67"confidentialité."
     68
     69#: public/class-simple-youtube-gdpr-public.php:370
     70msgid "https://issuu.com/legal/privacy"
     71msgstr "https://issuu.com/legal/privacy"
     72
     73#: public/class-simple-youtube-gdpr-public.php:374
     74msgid "Show element"
     75msgstr "Afficher l'élément"
    6176
    6277#: simple-youtube-gdpr.php:101
     
    6580
    6681#: simple-youtube-gdpr.php:101
    67 msgid "Get Vimeo Blocker!"
    68 msgstr "Obtenez Vimeo Blocker!"
     82msgid "Block Vimeo and more!"
     83msgstr "Bloquer Vimeo et plus!"
     84
     85#: simple-youtube-gdpr.php:113
     86msgid "Payment in RUB - Russian Rubles"
     87msgstr "Paiement en roubles russes"
     88
     89#: simple-youtube-gdpr.php:113
     90msgid "Donate"
     91msgstr "Faire un don"
    6992
    7093#. Plugin Name of the plugin/theme
    7194msgid "Simple YouTube GDPR"
    72 msgstr "Plugin de sécurité de vidéos WordPress YouTube et Vimeo (GDPR)"
     95msgstr ""
     96"WordPress YouTube, Vimeo et plusieurs autres plugin de sécurité (GDPR)"
    7397
    7498#. Plugin URI of the plugin/theme
     
    87111msgid "https://alexeyvolkov.com/"
    88112msgstr "https://alexeyvolkov.com/"
     113
     114#~ msgid "Learn more"
     115#~ msgstr "Apprendre encore plus"
     116
     117#~ msgid "Get Vimeo Blocker!"
     118#~ msgstr "Obtenez Vimeo Blocker!"
  • simple-youtube-gdpr/trunk/languages/simple-youtube-gdpr-ru_RU.po

    r2143715 r2144933  
    22msgstr ""
    33"Project-Id-Version: Simple YouTube GDPR\n"
    4 "POT-Creation-Date: 2019-08-22 15:03+0300\n"
    5 "PO-Revision-Date: 2019-08-22 15:05+0300\n"
     4"POT-Creation-Date: 2019-08-24 21:37+0300\n"
     5"PO-Revision-Date: 2019-08-24 21:40+0300\n"
    66"Last-Translator: \n"
    77"Language-Team: \n"
     
    2323"X-Poedit-SearchPathExcluded-0: *.js\n"
    2424
    25 #: public/class-simple-youtube-gdpr-public.php:221
     25#: public/class-simple-youtube-gdpr-public.php:284
    2626msgid "Click to Play Video"
    2727msgstr "Нажмите для запуска видео"
    2828
    29 #: public/class-simple-youtube-gdpr-public.php:222
     29#: public/class-simple-youtube-gdpr-public.php:285
    3030msgid "YouTube Video Thumbnail"
    3131msgstr "Миниатюра YouTube видео"
    3232
    33 #: public/class-simple-youtube-gdpr-public.php:225
     33#: public/class-simple-youtube-gdpr-public.php:288
    3434msgid "By loading the video, you agree to YouTube's privacy policy."
    3535msgstr ""
    3636"Загружая видео, вы соглашаетесь с политикой конфиденциальности YouTube."
    3737
    38 #: public/class-simple-youtube-gdpr-public.php:227
     38#: public/class-simple-youtube-gdpr-public.php:290
    3939#, fuzzy
    4040#| msgid "https://policies.google.com/privacy?hl=en&amp;gl=en"
     
    4242msgstr "https://policies.google.com/privacy?hl=ru"
    4343
    44 #: public/class-simple-youtube-gdpr-public.php:228
    45 #: public/class-simple-youtube-gdpr-public.php:257
    46 msgid "Learn more"
    47 msgstr "Политика конфиденциальности Google"
     44#: public/class-simple-youtube-gdpr-public.php:291
     45#: public/class-simple-youtube-gdpr-public.php:319
     46#: public/class-simple-youtube-gdpr-public.php:371
     47msgid "Read policy"
     48msgstr "Прочитать политику конфиденциальности"
    4849
    49 #: public/class-simple-youtube-gdpr-public.php:231
    50 #: public/class-simple-youtube-gdpr-public.php:260
    51 msgid "Load video"
     50#: public/class-simple-youtube-gdpr-public.php:294
     51#: public/class-simple-youtube-gdpr-public.php:322
     52#, fuzzy
     53#| msgid "Load video"
     54msgid "Play video"
    5255msgstr "Запустить видео"
    5356
    54 #: public/class-simple-youtube-gdpr-public.php:254
    55 #, fuzzy
    56 #| msgid "By loading the video, you agree to YouTube's privacy policy."
     57#: public/class-simple-youtube-gdpr-public.php:316
    5758msgid "By loading the video, you agree to Vimeo's privacy policy."
    5859msgstr ""
    59 "Загружая видео, вы соглашаетесь с политикой конфиденциальности YouTube."
     60"Загружая видео, вы соглашаетесь с политикой конфиденциальности Vimeo."
    6061
    61 #: public/class-simple-youtube-gdpr-public.php:256
     62#: public/class-simple-youtube-gdpr-public.php:318
    6263#, fuzzy
    6364#| msgid "https://policies.google.com/privacy?hl=en&amp;gl=en"
     
    6566msgstr "https://policies.google.com/privacy?hl=ru"
    6667
     68#: public/class-simple-youtube-gdpr-public.php:368
     69msgid "By loading the issuu element, you agree to its privacy policy."
     70msgstr ""
     71"Загружая элемент Issue, вы соглашаетесь с его политикой конфиденциальности."
     72
     73#: public/class-simple-youtube-gdpr-public.php:370
     74msgid "https://issuu.com/legal/privacy"
     75msgstr "https://issuu.com/legal/privacy"
     76
     77#: public/class-simple-youtube-gdpr-public.php:374
     78msgid "Show element"
     79msgstr "Показать элемент"
     80
    6781#: simple-youtube-gdpr.php:101
    6882msgid "Click to Upgrade your plan"
    69 msgstr "Нажмите, чтобы обновить план"
     83msgstr "Обновить план"
    7084
    71 #: simple-youtube-gdpr.php:101
    72 msgid "Get Vimeo Blocker!"
    73 msgstr "Vimeo блокировщик!"
     85#: simple-youtube-gdpr.php:102
     86msgid "Block Vimeo and more!"
     87msgstr "Блокировать Vimeo и прочее!"
     88
     89#: simple-youtube-gdpr.php:114
     90msgid "Payment in RUB - Russian Rubles"
     91msgstr "Платёж через Яндекс.Деньги"
     92
     93#: simple-youtube-gdpr.php:115
     94msgid "Donate"
     95msgstr "Пожертвовать"
    7496
    7597#. Plugin Name of the plugin/theme
    7698msgid "Simple YouTube GDPR"
    77 msgstr "Блокировщик YouTube видео"
     99msgstr "WordPress плагин для блокировки YouTube, Vimeo и других элементов"
    78100
    79101#. Plugin URI of the plugin/theme
     
    93115msgstr "https://alexeyvolkov.com/"
    94116
     117#~ msgid "Learn more"
     118#~ msgstr "Политика конфиденциальности Google"
     119
     120#~ msgid "Get Vimeo Blocker!"
     121#~ msgstr "Vimeo блокировщик!"
     122
    95123#~ msgid ""
    96124#~ "Replaces all YouTube video iframes with a local image and loads a no "
  • simple-youtube-gdpr/trunk/public/class-simple-youtube-gdpr-public.php

    r2143715 r2144933  
    147147                continue;
    148148            }
    149             foreach ( $figure->find( 'iframe' ) as $iframe ) {
     149           
     150            if ( $figure->find( 'iframe' )[0] ) {
     151                $iframe = $figure->find( 'iframe' )[0];
    150152                if ( '' === trim( $iframe->src ) ) {
    151153                    // if empty -> next item
     
    157159                    $imgDiv = str_get_html( $imgHTML );
    158160                    // from raw HTML to Node Object
    159                     $iframe = $imgDiv->find( 'div.syg__box' )[0];
     161                    $imgDiv = $imgDiv->find( 'div.syg__box' )[0];
    160162                    // Find the only one(first) div.syg__box
    161163                } catch ( Exception $e ) {
    162164                    continue;
    163165                }
     166                //              // Replace <figure> with <img>
     167               
     168                if ( $figure->find( 'div.wp-block-embed__wrapper' )[0] ) {
     169                    $imgDiv->class .= ' ' . $figure->find( 'div.wp-block-embed__wrapper' )[0]->class;
     170                    $figure->find( 'div.wp-block-embed__wrapper' )[0]->outertext = $imgDiv->outertext;
     171                }
     172           
    164173            }
    165             // Replace <figure> with <img>
    166             if ( !$iframe->class ) {
    167                 // if no class -> create
    168                 $iframe->class = '';
    169             }
    170             $iframe->class = $iframe->class . ' ' . $figure->class;
    171             // syg__box wp-block-embed-youtube
    172             $figure->outertext = $iframe->outertext;
     174       
    173175        }
    174176        // is__premium_only
     
    183185     * @return bool|string
    184186     */
    185     private function getThumbnail( $iframeHTML, $type = 'youtube' )
    186     {
    187         $iframeHTML = str_get_html( $iframeHTML );
    188         $iframe = $iframeHTML->find( 'iframe' )[0];
    189         // Find the only one(first) iframe
     187    private function getThumbnail( $contentHTML, $type = 'youtube' )
     188    {
     189        $contentHTML = str_get_html( $contentHTML );
     190       
     191        if ( $contentHTML->find( 'iframe' ) && $contentHTML->find( 'iframe' )[0] ) {
     192            $iframe = $contentHTML->find( 'iframe' )[0];
     193            // Find the only one(first) iframe
     194        }
     195       
    190196        $upload_dir = wp_upload_dir();
    191197        // wp_upload_dir()[baseurl] => http://example.com/content/uploads
     
    200206                    $this->save_local_thumbnail( $youtube_id );
    201207                }
    202                 $youtube_lazyload = '<div class="syg__box syg__box-youtube">' . '<img src="' . $upload_dir['baseurl'] . '/simple-youtube-gdpr-thumbnails/' . md5( $youtube_id ) . '.jpg" title="' . esc_html( __( 'Click to Play Video', 'simple-youtube-gdpr' ) ) . '" class="syg__box__img" id="' . $youtube_id . '" alt="' . esc_html( __( 'YouTube Video Thumbnail', 'simple-youtube-gdpr' ) ) . '" decoding="async" referrerpolicy="no-referrer">' . '<div class="syg__box__text">' . '<p> ' . esc_html( __( 'By loading the video, you agree to YouTube\'s privacy policy.', 'simple-youtube-gdpr' ) ) . '<br > ' . '<a href = "' . esc_html( __( 'https://policies.google.com/privacy?hl=en', 'simple-youtube-gdpr' ) ) . '" target="_blank" rel="noopener" > ' . esc_html( __( 'Learn more', 'simple-youtube-gdpr' ) ) . '</a > ' . '</p > ' . '<p ><a class="syg__box__text__btn" role = "button" > ' . esc_html( __( 'Load video', 'simple-youtube-gdpr' ) ) . '</a ></p > ' . '</div > ' . '</div > ';
     208                $youtube_lazyload = '<div class="syg__box syg__box-youtube">' . '<img src="' . $upload_dir['baseurl'] . '/simple-youtube-gdpr-thumbnails/' . md5( $youtube_id ) . '.jpg" title="' . esc_html( __( 'Click to Play Video', 'simple-youtube-gdpr' ) ) . '" class="syg__box__img" id="' . $youtube_id . '" alt="' . esc_html( __( 'YouTube Video Thumbnail', 'simple-youtube-gdpr' ) ) . '" decoding="async" referrerpolicy="no-referrer">' . '<div class="syg__box__text">' . '<p> ' . esc_html( __( 'By loading the video, you agree to YouTube\'s privacy policy.', 'simple-youtube-gdpr' ) ) . '<br > ' . '<a href = "' . esc_html( __( 'https://policies.google.com/privacy?hl=en', 'simple-youtube-gdpr' ) ) . '" target="_blank" rel="noopener" > ' . esc_html( __( 'Read policy', 'simple-youtube-gdpr' ) ) . '</a > ' . '</p > ' . '<p ><a class="syg__box__text__btn" role = "button" > ' . esc_html( __( 'Play video', 'simple-youtube-gdpr' ) ) . '</a ></p > ' . '</div > ' . '</div > ';
    203209                // .syg__box
    204210                return $youtube_lazyload;
     
    206212            case 'vimeo':
    207213                break;
     214            case 'flickr':
     215                break;
     216            case 'issuu':
     217                break;
    208218        }
    209219        return false;
     
    221231        switch ( $type ) {
    222232            case 'vimeo':
     233                break;
     234            case 'flickr':
    223235                break;
    224236            default:
     
    252264     * @return bool
    253265     */
    254     private function isThumbnailExists( $video_id )
    255     {
    256         $youtube_id = esc_html( $video_id );
     266    private function isThumbnailExists( $content_id, $type = 'video' )
     267    {
     268        $content_id = esc_html( $content_id );
    257269        $upload_dir = wp_upload_dir();
    258         return file_exists( $upload_dir['basedir'] . '/simple-youtube-gdpr-thumbnails/' . md5( $video_id ) . '.jpg' );
     270        switch ( $type ) {
     271            case 'video':
     272                return file_exists( $upload_dir['basedir'] . '/simple-youtube-gdpr-thumbnails/' . md5( $content_id ) . '.jpg' );
     273                break;
     274            case 'flickr':
     275                return file_exists( $upload_dir['basedir'] . '/simple-youtube-gdpr-thumbnails/' . $content_id );
     276                break;
     277        }
    259278    }
    260279   
     
    272291        switch ( $type ) {
    273292            case 'vimeo':
     293                break;
     294            case 'flickr':
    274295                break;
    275296            default:
     
    289310        $upload_dir['path'] = $upload_dir['basedir'] . '/simple-youtube-gdpr-thumbnails/';
    290311        // Set upload folder
    291         $image_name = md5( $video_id ) . '.jpg';
    292         // Make it MD5 -> so all (_!@#$%^)(*&) symbols are sanitized
     312        switch ( $type ) {
     313            case 'flickr':
     314                break;
     315            default:
     316                $image_name = md5( $video_id ) . '.jpg';
     317                // Make it MD5 -> so all (_!@#$%^)(*&) symbols are sanitized
     318                break;
     319        }
    293320        $unique_file_name = wp_unique_filename( $upload_dir['path'], $image_name );
    294321        // Generate unique name
  • simple-youtube-gdpr/trunk/public/css/simple-youtube-gdpr-public.css

    r2143715 r2144933  
    44    overflow: hidden;
    55    max-width: 100%;
     6    min-width: 20em;
     7    height: auto;
     8    min-height: 12em;
     9    background-color: #eaeaea;
     10}
     11
     12.syg__box::before, .syg__box::after {
     13    display: none;
     14    padding: 0 !important;
    615}
    716
     
    2029    -webkit-filter: brightness(75%);
    2130    filter: brightness(75%);
     31}
     32
     33.syg__box-flickr:hover .syg__box__img {
     34    -webkit-filter: brightness(100%);
     35    filter: brightness(100%);
    2236}
    2337
  • simple-youtube-gdpr/trunk/public/js/simple-youtube-gdpr-public.js

    r2143715 r2144933  
    2121
    2222        for (var i = 0; i < videos.length; i++) {// loop in all videos boxes
    23 
    24 
    2523            // Get Play Button
    2624            var syg__box__text__btn = videos[i].getElementsByClassName('syg__box__text__btn')[0];
     
    2826            if (typeof (syg__box__text__btn) === 'undefined' || syg__box__text__btn === null || !syg__box__text__btn) {
    2927                console.warn('No YouTube Play Button found');
    30                 return;
     28                console.debug(videos[i]);
     29                continue;
    3130            }
    3231            // Put click events on Play buttons
     
    4342                var videoImage = videoContainer__local.getElementsByClassName('syg__box__img')[0];
    4443                // if we don't have video image -> return
    45                 if (typeof (videoImage) === 'undefined' || videoImage === null || !videoImage) {
    46                     console.warn('No YouTube Image found');
    47                     return;
    48                 }
    49                 // Change - Replace
    50                 if (videoContainer__local.classList.contains('syg__box-youtube')) {
    51                     videoContainer__local.replaceChild(getYouTubeIFrame(videoImage), videoImage);
     44                if (typeof (videoImage) != 'undefined' && videoImage != null && videoImage) {
     45                    // Change - Replace
     46                    if (videoContainer__local.classList.contains('syg__box-youtube')) {
     47                        videoContainer__local.classList.remove('syg__box');
     48                        videoContainer__local.replaceChild(getYouTubeIFrame(videoImage), videoImage);
     49                    }
     50                   
     51/* Premium Code Stripped by Freemius */
     52
    5253                }
    5354               
     
    5556
    5657                // Remove
    57                 videoContainer__local.removeChild(syg__box__text);
     58                if (videoContainer__local.getElementsByClassName('syg__box__text') && videoContainer__local.getElementsByClassName('syg__box__text')[0] && syg__box__text) {
     59                    videoContainer__local.removeChild(syg__box__text);
     60                }
    5861            });
    5962        }// for youtube
  • simple-youtube-gdpr/trunk/simple-youtube-gdpr.php

    r2143715 r2144933  
    1717 * Plugin URI:        https://alexeyvolkov.com/blog/simple-youtube-gdpr
    1818 * Description:       Integrate YouTube and Vimeo videos securely!
    19  * Version:           0.7
     19 * Version:           0.8
    2020 * Author:            Alexey Volkov
    2121 * Author URI:        https://alexeyvolkov.com/
     
    9191    function add_action_links( $links )
    9292    {
    93         $mylinks = array( '<a href="' . syg_fs()->get_upgrade_url() . '" title="' . esc_html( __( 'Click to Upgrade your plan' ) ) . '"><strong style="display: inline;">' . esc_html( __( 'Get Vimeo Blocker!', 'simple-youtube-gdpr' ) ) . '</strong></a>' );
     93        $mylinks = array( '<a href="' . syg_fs()->get_upgrade_url() . '" title="' . esc_html( __( 'Click to Upgrade your plan', 'simple-youtube-gdpr' ) ) . '"><strong style="display: inline;">' . esc_html( __( 'Block Vimeo and more!', 'simple-youtube-gdpr' ) ) . '</strong></a>' );
    9494        return array_merge( $mylinks, $links );
    9595    }
     
    106106        if ( strpos( $file, 'simple-youtube-gdpr.php' ) !== false ) {
    107107            $new_links = array(
    108                 'donate' => '<a href="https://money.yandex.ru/to/41001417963743" target="_blank" title="Payment in RUB - Russian Rubles">&hearts; Donate</a>',
     108                'donate' => '<a href="https://money.yandex.ru/to/41001417963743" target="_blank" title="' . esc_html( __( 'Payment in RUB - Russian Rubles', 'simple-youtube-gdpr' ) ) . '">&hearts; ' . esc_html( __( 'Donate', 'simple-youtube-gdpr' ) ) . '</a>',
    109109            );
    110110            $links = array_merge( $links, $new_links );
     
    119119     * Rename this for your plugin and update it as you release new versions.
    120120     */
    121     define( 'SIMPLE_YOUTUBE_GDPR_VERSION', '0.7' );
     121    define( 'SIMPLE_YOUTUBE_GDPR_VERSION', '0.8' );
    122122    /**
    123123     * The code that runs during plugin activation.
Note: See TracChangeset for help on using the changeset viewer.