8 votes

COOKIE_DOMAIN setting confusion

I have been struggling with using the multisite domains of native 4.x wordpress. Despite finding references, saying these lines corrected the error, neither of these setting worked: //define('...
Wayne Brian Pearsall's user avatar
7 votes
Accepted

Deregister WordPress jquery on specific page

Hook to wp_enqueue_scripts. It will do the trick. Modified code is- if (!function_exists('modify_jquery')) { function modify_jquery() { if (is_page(array('page 1', 'page 2'))) { ...
CodeMascot's user avatar
  • 4,527
5 votes
Accepted

What is the problem if I use CDN in my WordPress parent theme(built using bootstrap)?

Your theme should not depends on any external link library. There is no guarantee when that library can be taken down. That's the reason all of your theme assets should be package with theme, to ...
daniyalahmad's user avatar
4 votes

Change the URL of an image from wp_get_attachment_image_src

Just to clarify for anyone might stumble upon this in the future, as of 4.3.0 a filter to alter the image src does exist: wp_get_attachment_image_src function alterImageSRC($image, $attachment_id, $...
eyal_123's user avatar
  • 101
3 votes
Accepted

Add Font Awesome Embed CDN Script To WordPress

The full snippet would be this: wp_enqueue_script( 'prefix-font-awesome', 'https://use.fontawesome.com/##########.js' );
cjbj's user avatar
  • 14.5k
2 votes

What is the problem if I use CDN in my WordPress parent theme(built using bootstrap)?

As daniyalahmad said, it is better not to include links to external assets in your theme. A good example of this recently. I use a theme from MyThemeShop and they linked to external html5shim. Google ...
Brian Jackson's user avatar
2 votes

How to replace regular jquery calls with CDN calls from Google?

Two things to keep in mind about this answer: Never do this in a plugin or theme for release. WordPress plugins rely on the correct version of jQuery being provided, that's why I'm not using jQuery 3 ...
JPollock's user avatar
  • 1,248
2 votes

How to replace regular jquery calls with CDN calls from Google?

For Wordpress 4.5.0 + : wp_add_inline_script() # function jquery_enqueue_with_fallback() { wp_deregister_script( 'jquery' ); wp_register_script( 'jquery' , '//ajax.googleapis.com/ajax/libs/...
l2aelba's user avatar
  • 857
2 votes
Accepted

Storing WordPress Media Library Uploaded files onto a separate domain

You should not remove the media from you server. Media is part of yout content and it makes no sense to have your content split over several servers. (from technical practical POV your idea will ...
Mark Kaplun's user avatar
  • 23.4k
1 vote
Accepted

Request initiator chain contains old CDN

It’s possible the script is coming from the database. If you have access to WP CLI, you can use the db search command to search for occurrences in the database, and then the search-replace command to ...
Caleb's user avatar
  • 1,773
1 vote

Is there a way to ensure local fonts load from CDN when CDN is enabled?

I will post my findings here as they will likely be useful to anyone else facing a similar situation. I had considered whether the issue was with the CDN redirection implemented on the site (a plug-in)...
omega33's user avatar
  • 354
1 vote

Warnings even when the WP_DEBUG set to false

Thanks all of you for your response the issue got resolved. The problem was with cached copy of this link https://vreqenz-stream.de/shop/ . I had WP Rocket for caching and apparently it is not doing ...
veetrag's user avatar
  • 11
1 vote

Host images only on CDN

I've never heard of a CDN that replaces your servers storage completely, only mirroring. However, I know (as I've done this on multiple installs) you can offload your current and future media ...
David Sword's user avatar
  • 3,327
1 vote

How should we improve the website speed?

There are few elements to getting fast website, and I have run some tests with your website: Loading time is 3-4 seconds on average, which is slow, but not too slow. Some of that can will improve ...
Milan Petrovic's user avatar
1 vote
Accepted

How to set up the REST API to refer to media on a CDN

I ran into the same issue today. Thank you for the question! I am implementing a ReactJS-App in a theme. So I enqueue my scripts and styles with the help of the corresponding Wordpress hooks. I ...
Niels's user avatar
  • 126
1 vote

Change Image URL to a CDN

Since the major adoption of Responsive Images and the addition of new srcset attribute to the <img> element. WordPress has to evolve too. WordPress 4.4 added the responsive images feature. If ...
Den Isahac's user avatar
1 vote

how optimize CDN without using plugins

Here is one // Defer parsing of JavaScript files. function any_page_first_defer_javascripts ( $url ) { if ( FALSE === strpos( $url, '.js' ) ) { return $url; } return "$url' async='...
Schon Garcia's user avatar
1 vote

how optimize CDN without using plugins

You get 94% / 87% so what seem to be the problem? The only thing i can thing of is the 7.0s load time which is ok but a bit long.. I have also checked your website on Google PageSpeed Insights and ...
Nate's user avatar
  • 186
1 vote
Accepted

Missing dns-prefetch link when using "nested" wp_register_style

Since WP 4.6 prefetch dependencies are only generated when styles are enqueued, not when they are only registered. Since you are only enqueueing Font Awesome, that is the only prefetch link you get. ...
cjbj's user avatar
  • 14.5k
1 vote

All my cdn links are automatically set to relative(ie //: instead of http://). why?

When you are on HTTP and your browser requests an external script using hardcoded HTTPS, it safe. When you do otherwise, it's not safe. So, the best practice is not to hardcode the protocol in your ...
Max Yudin's user avatar
  • 6,287
1 vote

How do you load js and style resources from CDN with local fallback using wp_enqueue_scripts?

Since 4.5 there is a function that lets you append inline js to an enqueued js file, it is called wp_add_inline_script. Now, this function does not let you add any js code that has a </script> ...
Larzan's user avatar
  • 493

Only top scored, non community-wiki answers of a minimum length are eligible