Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SEO Ultimate compatibility fix and a feature request #43

Open
Mackzwellz opened this issue Mar 29, 2018 · 1 comment
Open

SEO Ultimate compatibility fix and a feature request #43

Mackzwellz opened this issue Mar 29, 2018 · 1 comment
Labels
bug to confirm Reproduction of issue is pending

Comments

@Mackzwellz
Copy link

Mackzwellz commented Mar 29, 2018

In bj-lazy-load.php, there are these two lines:

$bjll_options = new BJLL_Options();
$bjll = new BJLL( $bjll_options );

By default, this plugin is incomatible with SEO Ultimate plugin, as stated here for example. The simple and easy fix is to delete the second line. As far as I can tell, plugin works with it disabled just fine, and incompatibility with another plugin is resolved.

I also have a feature to request to be added. This new string of code here should be applied in order to strip "http:" and "https:" from src URLs, because in certain cirumstances (site with Cloudflare Flexible SSL + HTTPS Rewrites and no own server SSL) <nosript> src and data-src URLs aren't replaced, and on image load page turns into mixed SSL.

// Strip protocol scheme from src and data-src
$replace = str_replace(['http:', 'https:'], '', $replace);

$content = str_replace( $search, $replace, $content );

I'd suggest making it a checkbox option, or let users even choose – strip both HTTP and HTTPS, replace HTTP with HTTPS or do nothing. Or maybe you could automate it somehow, idk. Either way, the best practice now is to always use HTTPS, but not everyone may be using it still obviously.

@jan-san
Copy link
Collaborator

jan-san commented Jul 10, 2019

The issue might be addressed by wrapping the definition of bj_lazy_load() in a if ( ! function_exists(...) ) block to prevent it from being loaded more than once.

There are dedicated plugins like Really Simple SSL that can help with rewriting URLs to https, this is not a feature related to lazy loading.

@jan-san jan-san added bug to confirm Reproduction of issue is pending labels Jul 10, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug to confirm Reproduction of issue is pending
Projects
None yet
Development

No branches or pull requests

2 participants