Forum Replies Created

Viewing 15 replies - 1 through 15 (of 22 total)
  • Thread Starter Fiech

    (@fiech)

    Hi Thomas,

    thanks for your answer. I definitely understand the need for developers to license their products in a way fair to both parties.

    The preview version works flawlessly, btw. Currently we are facing a discourse with a stock photographer and one problem might be, that without the preview version there are be certain pages (like the start page, widgets, sliders, but also category listings, etc.) where no sources are displayed on pictures.

    Best,
    Johannes

    Thread Starter Fiech

    (@fiech)

    Hi Thomas,

    thanks for the quick reply. I just submitted the form. Will this feature be restricted to a pro version in the future?

    Best,
    Johannes

    Thread Starter Fiech

    (@fiech)

    For what it’s worth: This shortcode is implemented as a plugin.

    Thread Starter Fiech

    (@fiech)

    Hi, here is the source code for the shortcode

    function fk_shortcode_twitch_embed($atts) {
    
      $content = (isset($atts['content'])) ? sanitize_text_field($atts['content']) : '';
      if (isset($atts['parent'])) {
        $parent = sanitize_text_field($atts['parent']);
      }
      else {
        $parse = parse_url(get_bloginfo('wpurl'));
        $parent = $parse['host'];
      }
      $width = (isset($atts['width'])) ? intval($atts['width']) : 400;
      $height = (isset($atts['height'])) ? intval($atts['height']) : 300;
      $afs = (isset($atts['allowfullscreen']) && $atts['allowfullscreen'] === 'true') ? 'true' : 'false';
    
      return sprintf('<iframe src="https://player.twitch.tv/?%s&parent=%s" width="%d" height="%d" allowfullscreen="%s"></iframe>', 
        $content,
        $parent,
        $width,
        $height,
        $afs);
    }
    add_shortcode('twitch', 'fk_shortcode_twitch_embed');

    It works like this: [twitch content="channel=<name>"]

    Thread Starter Fiech

    (@fiech)

    We use the classic editor and a custom theme based on the WP Jurist Theme.

    The twitch iframe is created by a custom shortcode that creates the iframe.

    Here is an excerpt surrounding the iframe if I do not have any custom provider straight from the source code:

    <article id="post-3588" class="post-3588 page type-page status-publish hentry">
    
    	<div class="entry-content post-content">
    		<iframe src="https://player.twitch.tv/?channel=[CHANNEL]&parent=[DOMAIN]" width="400" height="300" allowfullscreen="false"></iframe>
    			</div><!-- .entry-content -->
    	
    	<footer class="entry-meta">
    		<span class="create-date">
    			<i class="fal fa-calendar"></i> <span class="entry-date"> 2. Juni 2021</span>
    		</span>
    		<span class="edit-date">
    			<i class="fal fa-pen"></i> <span class="update-date">2. Juni 2021</span>
    		</span>
    		<span class="edit-link"><a class="post-edit-link" href="[EDIT_LINK]">Bearbeiten</a></span>	</footer><!-- .entry-meta -->
    
    	    
        <div class="post-divider"></div>
        
    </article>

    I don’t see any errors in the console save for two font download related ones.

    If you think it’ll help, I can send you the URL via a private message of your choice.

    Thread Starter Fiech

    (@fiech)

    Hmm… Either something’s wrong or I am stupid. I completely removed and reinstalled the plugin just to be sure. So right now I’m getting the following behaviour:

    If I just include my iframe and do not have a custom Twitch embed, I get no privacy cover whatsoever, just directly the iframe with the stream.

    If I then add a custom provider with this regexp

    /player\.twitch\.tv\/\?/

    I get the following: https://i.imgur.com/FHzFf7E.png

    If I then deactivate the provider via the checkbox and got this: https://i.imgur.com/WLE4LvP.png

    If I click either of the covers, the cover vanishes and underneath is just empty space.

    I am… confused… I don’t really know what’s going on here, why it is behaving like this… But then I also don’t understand, what the regexp has to catch and what not. I also do not understand, why it says “Hier kicken, um Inhalt von <iframe src= anzuzeigen”, respectively “<div class=”. I put some appropriate text in the custom provider and also added a logo and a privacy policy link. Neither one gets displayed…

    I have nothing in the Error Console when clicking the privacy cover, but I get a failed XHR request for the page (Error 404). I don’t know if this is in any way important.

    Also a fun fact: If I change the regexp to /https?:\/\/player\.twitch\.tv\/\?/ I get an error 404 page of my wordpress site as the “privacy overlay” ^^ Idk what’s going on there just found it funny…

    Thread Starter Fiech

    (@fiech)

    Thank you for the information. Then I’ll wait. Maybe you even could add twitch to the defaults?

    Thread Starter Fiech

    (@fiech)

    Hohum…

    No luck here… So I just checked the HTML code (without the provider):

    <iframe src="https://player.twitch.tv/?channel=<channel>&parent=<domain>" allowfullscreen="false" width="400" height="300">
    </iframe>

    Right now I create my iframe with a custom shortcode. Unfortunately I have not yet figured out how to prevent the & in the url of my shortcode return value from being converted to &amp;. The stream itself works without a hitch, but could this be a problem for Embed Privacy?

    Also: Does the checkbox to disable the provider work for you?

    Ty

    • This reply was modified 5 years ago by Fiech.
    • This reply was modified 5 years ago by Fiech.
    • This reply was modified 5 years ago by Fiech.
    • This reply was modified 5 years ago by Fiech.
    • This reply was modified 5 years ago by Fiech.
    Thread Starter Fiech

    (@fiech)

    I forgot to add, that the privacy cover is disappearing when you click it, but then its just blank space behind it, no player.

    Thread Starter Fiech

    (@fiech)

    Ah ok. Then I misunderstood some of the workings of the plugin.

    Thank you for the explanation!

    Thread Starter Fiech

    (@fiech)

    Hey, first thank you for your fast response!

    It’s definitely a progress. I can always go back and reemploy the additional queries for the next versions.

    But if I may take up one of my points from 3 weeks ago: I know that probably a lot of work’s gone into the current way the plugin is working, but how compatible is this with, say, multi-language blogs and does this pre-calculation of the overlays really bring such an improvement in speed (trading a text replacement for a database query)? In other words, is it worth the headache this approach seems to create?

    Also if one would like to use a provider’s open API to (server side) fetch additional meta data about the embedded media in the future, this would be harder to implement…

    Thread Starter Fiech

    (@fiech)

    Hi,

    Ok, so I am running the 1.3.3 version now and the issue has changed but unfortunately did not resolve fully.

    So I still got a blog where I had a embed_privacy_is_migrating=1 entry in its options table and only an Amazon-Kindle-Entry in the the posts table.

    I had to reemploy my two additional queries from above in the clear_embed_cache function (inc/class-embed-privacy.php).

    BUT: After de- and reenabling the plugin I did not have to navigate to the dashboard of every blog until it was working. So semi-success I guess (yay!).

    Maybe at least the is_migrating-key has to be deleted in the clear-cache-function?

    Thread Starter Fiech

    (@fiech)

    Oookkk… I think I now have a better understanding about the inner workings workings and what might be the problem…

    So first, I finally solved my problem with the “epi_embed”, it’s the entry in the column “post_type” in the <prefix>_posts table.

    And I think I found the problem: For some of the blogs, the migration did not complete. Instead of a embed_privacy_migrate_version option in the <blog_prefix>_options table, I only got a embed_privacy_is_migrating = 1 option.

    You may remember my enhancement proposal here.

    To fix this for our network, I had to add two more queries:

    $query3 = "DELETE FROM ".$wpdb->get_blog_prefix($site->blog_id)."options WHERE option_name LIKE 'embed_privacy_%'";
    				$wpdb->query( $query3 );
    				
    				$query4 = "DELETE from ".$wpdb->get_blog_prefix($site->blog_id)."posts WHERE post_type='epi_embed'";
    				$wpdb->query( $query4 );

    After that I disabled/enabled the plugin. Unfortunately, this did not directly create the entries in the posts-tables. Only after navigating to the dashboards of the sites, these were created. With ~300 subblogs I’d love an alternative (although over the next few days, I hope that most of the blog admins are logging in slowly creating the missing posts…

    This all leads me to the question, if the posts-approach for the overlays is really needed? Without knowing most of the code, couldn’t this lead to problems with multi-language sites? Is the DB lookup really that much quicker than to either create the overlay on the fly or save it temporarily somewhere else?

    Thread Starter Fiech

    (@fiech)

    I did find this similar sounding problem, but unfortunately, OP did not respond to my request to explain a bit further what they did to remedy this problem.

    Correction, I meant this similar sounding problem: https://ww.wp.xz.cn/support/topic/version-1-2-2-associated-types-pictures-and-texts-not-being-found/

    I have a similar problem. I think at least, because there is no screenshot of it not working, but for me, there is no logo and also no provider name on the privacy layer.

    Unfortunately I have the problem on a ~300 blogs big multisite installation, so I would much rather try to avoid having to go through all the blogs pages.

    When you write

    Removed all epi type posts. delete from … ‘epi_embed’;

    what exactly do you mean? I have no tables named *_epi_* … Any help would be appreciated.

Viewing 15 replies - 1 through 15 (of 22 total)