Embedding of social media URLs not working

Posted in: Newspaper
Post count: 14

I am currently running Newspaper Theme 7.7.1 on WordPress 4.7.3 (as of this writing) on a server running PHP 7.1. I have disabled all plugins. I have disabled my child theme. Switching to 2016 theme solves the problem instantly.

I am having trouble with embedding URLs displaying their content instead of their post content. You can view an example below. I have checked and confirmed that the original posts are still present and are visible. I have checked to make sure the embeds are not linked and that they are on a separate line. I have tested adding the URLs to embed in the visual editor as well as the text editor.

https://dev.masvalesaber.com/la-inesperada-realidad-detras-del-dia-de-los-enamorados/

Multiple Instagram URLs are displayed instead of the post images. This is also occurring (with less frequency) with other social media networks.

The problem is intermittent as you can see that some Instagram posts are loading above and below the URLs that are being displayed.

If I edit the post and save the post, the URLs will appear. However, if I create a new post and embed the same Instagram post, the Instagram post and not the URL may appear.

It almost appears to get worse over time (degrade in some way) where more and more links start reverting to URLs and not the posts.

I have turned on debugging and I am not receiving any error messages or notices of any sort.

Something that may also be related. Social Media Embeds are defaulting to strange languages on some posts. I had to write a small script (which I disabled for testing the above problem when I deactivated my child theme) to re-write the language select on embeds.

Any help would be appreciated.

Post count: 20688

Hi,

If it is an intermittent problem, meaning that sometimes they work and in some situations does not, it could be a plugin that is causing this. You can try disabling all your plugins, except the ones bundled with the theme and check to see if the issue persists. Also please install the Visual composer plugin as it is an essential and required in the proper functionality of the theme – https://forum.tagdiv.com/how-to-update-visual-composer-plugin/
More useful information about WordPress embeds here – https://codex.wordpress.org/Embeds

Thanks

Post count: 14

Hi Simion,

Your response is extremely frustrating because it show you did not spend the time to read what I have done so far to test this problem.

I have disabled all plugins to test this problem. It does not matter what plugins are activated or deactivated because the problem is the theme.

When the Newspaper theme is activated, the links do not work. The intermittent issue is only some links do not work. However, when I switch to the 2016 theme, the links instantly begin working. When I switch back to the Newspaper theme, the links no longer work. Clearly a theme issue.

Please explain how Visual Composer is essential and required for the proper functionality to display a single post. Because it isn’t AFAIK. It is important for displaying modules/blocks and very useful for pages, however, it is not used on posts AFAIK.

I should also note that I have read about WordPress embeds in depth and have tried all of their embed strategies and the problem still persists. I have also posted to Stack Exchange to get help but the problem is the theme, not WordPress.

Thank you

Post count: 14

As per your request (although I still do not know what benefit it provides) I have re-activated Visual Composer 5.1. I should also note that this problem existed prior to the latest update with version 4.10.

Post count: 14

Here is the system status from the theme page:

Server software Apache/2.4.25 (Unix) OpenSSL/1.0.2g
PHP Version 7.0.17
post_max_size 50M
max_execution_time 600
max_input_vars 5000
WP version 4.7.3
WP multisite enabled No
WP Language es_ES
WP Memory Limit 512 MB/request
Theme version 7.7.1
Theme database version 7.7.1
Visual Composer 5.1

From what I can tell, my system meets all of the required specs and I am running the most recent versions of WordPress, Newspaper Theme, and Visual Composer.

All required plugins are installed and activated (Visual Composer). No other optional plugins are active.

Again, problem is instantly solved by changing to the 2016 theme and instantly resumes if I change back to the Newspaper theme.

It doesn’t appear to matter how I embed the social media post. If I use the embed shortcode or if I just drop in the URL as per the WordPress Embed codex.

This is kind of a big problem for us as the site relies heavily on social media posts.

If I had to guess, the Newspaper theme is running a filter or action on the embeds. I believe this is true based on what I have read in other posts in the forum. My guess is, something in that filter or action is timing out on some social media posts or is failing to recognize the formatting of some URLs and not others (less likely.)

So my questions are.

1) Does the Newspaper theme run a filter or action on embeds or in any way interact with embedded media?

2) If so, where is that code located in the theme?

3) Do you recognize that this is a theme issue and not a plugin / social media issue (since the problem only occurs with the theme activated)?

Thank you for your help.

Post count: 20688

Hi,

I have made some tests using some of the links from your pages – https://www.screencast.com/t/uipxGGdlf1Zhttps://www.screencast.com/t/TK5L5zaHa and inserted them in a new post and older posts, but failed to recreate this problem you are having. The suggestion to disable the plugins was to double check that that plugins are not causing this, since the links seem to work and display properly on my end.
Visual composer has no effect on this that is true, but I saw that you do not have it activated and I simply suggested that you activate it. You can choose to not use this plugin if you wish.
After a search on the internet it seems that other people are having this issue with some of the embeds – https://wordpress.org/support/topic/youtube-embed-not-working-anymore-after-451-update/ and it could be a hosting issue.
Please send us an email at contact@tagdiv.com and provide admin login information, so we can take a look and try to give you a solution for this. Also paste a link to this topic for identification purposes.

Thank you for understanding!

Post count: 14

Hello,

I understand that you receive a lot of support requests and you probably skim read most postings, however, I have tried very hard to do my due diligence in troubleshooting this problem. I am sending the login credentials for the website.

1) As per my post on March 23 “However, if I create a new post and embed the same Instagram post, the Instagram post and not the URL may appear.” I would expect that your test would display the social media posts. Because if I use the same social media post in a new WordPress post, it displays.

2) You wrote on March 27 “The suggestion to disable the plugins was to double check that that plugins are not causing this, since the links seem to work and display properly on my end.“.

I had already wrote on March 23 “I have disabled all plugins.“. I had also disabled Visual Composer to test for a conflict there.

As you stated on March 27, Visual Composer has no effect on the post page, so your statement on March 24 “ Also please install the Visual composer plugin as it is an essential and required in the proper functionality of the theme” implies the problem might be related to Visual Composer. If that was not your intent, then your statement is completely irrelevant to the problem because as you stated, it has no effect on the post page.

Again, this is a dev version of the website for testing. We are using Visual Composer on the live website but we cannot easily isolate the problem with plugins activated.

3) You state on March 27 “After a search on the internet it seems that other people are having this issue with some of the embeds – https://wordpress.org/support/topic/youtube-embed-not-working-anymore-after-451-update/ and it could be a hosting issue.

However, I stated on March 23 “Switching to 2016 theme solves the problem instantly.

How is this a WordPress update issue or a hosting issue if the problem is solved by changing from the Newspaper theme to the 2016 theme? And then the problem re-occurs when switching back to the Newspaper theme? Also, did you read the thread YOU linked? It is for a near isolated incident with WordPress 4.5.1 that was resolved with WordPress 4.5.2. How was that supposed to be beneficial to my scenario considering embed work perfectly fine with the default theme activated?

So, let me restate.
Server software Apache/2.4.25 (Unix) OpenSSL/1.0.2g
PHP Version 7.0.17
post_max_size 50M
max_execution_time 600
max_input_vars 5000
WP version 4.7.3
WP multisite enabled No
WP Language es_ES
WP Memory Limit 512 MB/request
Theme Newspaper
Theme version 7.7.1
Theme database version 7.7.1
Visual Composer 5.1

All required plugins (Visual Composer) are currently active. NO other plugins are active. Three themes are installed. Newspaper, Newspaper Child, and 2016. Newspaper (not Newspaper Child) is the current active theme.

With this setup, some social media embed are not embedding.

Switching to 2016 theme and reloading the same page, all social media embed work properly.

Switching back to Newspaper theme, same social media embeds are not working again. Those same social media embeds will work properly if reposted in a new post.

This information combined with all of the other information provided above should clearly explain the problem. I have completely isolated the problem down to the Newspaper theme. It is possible that the Newspaper theme could have a conflict with the hosting environment, however, I have posted my environment information above and I believe that it meets or exceeds all recommendations. Like I also stated above, I am not receiving any errors or noticies alerting me to any problems.

If you have any questions or suggestions that have not already be answered or attempted, please let me know. I would like to get this resolved as soon as possible as it does impact our readership.

Thank you,

Post count: 7909

Replied via email!

Post count: 14

Keeping track of tests on this forum thread in case anyone else encounters embed issues.

1) Tried downgrading the dev site from 7.0 to 5.6 and 5.5. Problem still exists after downgrade.

2) Upon suggestion that the problem may go away if demo content is reinstalled, we reinstalled the demo content and settings on PHP 7.0 with no success. We then downgraded to 5.6 and 5.5 and reinstalled the demo content and settings and the problem still exists.

3) We have installed a fresh WordPress website with a clean install of Newspaper theme. Added posts with embeds and all embeds are currently displaying. This is expected as new posts on the live website also embed all social media posts correctly. We expect that the social media embeds may start to fail within the next day or two.

4) We still don’t know what may be causing this problem or if embedded posts or the_content are filtered via a filter or action or in any way that could cause this issue.

Post count: 9544

We’re not having the issue on our sites.

Post count: 14

I could be wrong but I don’t think we started to have problems until February 2017. So I am not sure if there was anything in the last couple of updates that could be conflicting with our hosting environment in some strange way that could be causing the problem. However, the problem only occurs with the Newspaper theme.

Post count: 14

Problem appears to be solved by changing this line in the theme:
/includes/wp_booster/td_wp_booster_functions.php
LINE 2115

$content_width is set to 640. Changing this to any other value or commenting out this line solves the problem. Not sure how this global variable is used by the theme.

Added this to the child theme functions.php file to solve the problem.


if (!isset($content_width)) {
$content_width = 650;
}

Post count: 68

Hello friends

I’m having exactly the same problem as triowebdev.

As we posted a lot of content, I just realized now that the old posts were all without the embedded Instagram.

All instagram links embedded in old posts no longer appear, showing only the link as our friend triowebdev reported here on the forum. If you update the post, without needing to change anything else, it returns to show, but there are thousands of publications, it would be unfeasible to do this one by one.

We have already disabled all plugins, but the only thing that resolves is to disable Newspaper (my version is 8.2). When you enable the theme, the problem reappears automatically.

Note: Most recent posts are normal.

Any idea what might be causing this conflict and a solution to this?

Post count: 22421

Hello,

Are you using a plugin to embed the Instagram content? Please provide an example so we can inspect the site.

Thank you!

Post count: 14

The problem doesn’t require a plugin. It happens when you embed the instagram url directly into the content editor.

Post count: 20688

Hi,

According to Instagram, for WordPress the URL can simply be pasted in the post content text editor, and it should display properly
https://www.instagram.com/developer/embedding/
https://www.screencast.com/t/CPZja861gMOM
https://www.screencast.com/t/inF8miUL
The URL must not be hyperlinked and should be placed on a line by itself. If that is how they were made, there should be no problem.

Thanks

Post count: 68

Hello guys,

The problem occurs exactly as the triowebdev explained above and in all his reports in this post. We’re referring to WordPress’s native feature of embedding social networking links directly into the text editor of the post to import photo, text or any content posted on these social networks, in my case the problem affects embedded Instagram links.

Follow the print: https://www.screencast.com/t/ywz0Pj13lt

When I saw the triowebdev report, which was great at finding the cause of the problem, I decided to test its hint and tried something similar on line 2174 of the file:

…/includes/wp_booster/td_wp_booster_functions.php

Default: $ content_width = 696;
To: $ content_width = 690;

After changing the parameter from 696 to at least 690, all old instagram posts will automatically reappear on the site.

I saw then that this theme file was changed in one of the updates earlier this year. Before this parameter was 640, and it must have been from there that the problem that we are suffering presented itself.

While this has worked, I fear that this change might break some of the other function of the theme, so I would like your support to see if this is the best way to work out the solution and ask for an effective fix to this issue in the next updates.

Many thanks, friends!

Post count: 20688

Hi,

That is unusual to say the least. If it is a solution that works for you, make the modification and leave it like that. Maybe make it in a child theme like triowebdev mentions, so you will not have to make it again after each theme update.

Thanks

Post count: 68

Hello Simion C.

Yes, it works for me, but I believe one repair might be good for the whole Newspaper community.

I see other sites that also use the Newspaper theme, having the same problem. Maybe your managers have not noticed it, as I have been slow to realize, or even do not care for broken embeds, but the problem affects others, this is fact.

Although I do not know what adjustment was made to make this change from “$ content_width = 640;” to “$ content_width = 696;” in recent updates, but I think it would be wise to evaluate to adjust for value 690 in the next updates, further break Instagram’s old inserts in the posts editor. It would be a good solution for everyone.

Thank you!

Viewing 19 posts - 1 through 19 (of 19 total)
The forum ‘Newspaper’ is closed to new topics and replies.