{"id":149185,"date":"2021-10-28T03:14:36","date_gmt":"2021-10-28T03:14:36","guid":{"rendered":"https:\/\/wordpress.org\/plugins\/replace-third-party-asset-source\/"},"modified":"2022-11-02T02:27:42","modified_gmt":"2022-11-02T02:27:42","slug":"replace-third-party-asset-source","status":"publish","type":"plugin","link":"https:\/\/szl.wordpress.org\/plugins\/replace-third-party-asset-source\/","author":18325953,"comment_status":"closed","ping_status":"closed","template":"","meta":{"_crdt_document":"","version":"1.3.1","stable_tag":"1.3.1","tested":"6.1.10","requires":"5.0.1","requires_php":"5.6","requires_plugins":"","header_name":"Replace Asset Source","header_author":"Jenn Lee","header_description":"Replace third party asset source with your own desired source. Main purpose is to help wordpress users to change the slow third party scripts or styles which using by some plugins but slow load speed in their own country. Not design for auto local host asset file, but sure you can use for it too.","assets_banners_color":"76c7d0","last_updated":"2022-11-02 02:27:42","external_support_url":"","external_repository_url":"","donate_link":"","header_plugin_uri":"","header_author_uri":"https:\/\/jenn.support","rating":5,"author_block_rating":0,"active_installs":40,"downloads":2309,"num_ratings":3,"support_threads":0,"support_threads_resolved":0,"author_block_count":0,"sections":["description","installation","faq","changelog"],"tags":{"1.0.1":{"tag":"1.0.1","author":"leej3nn20","date":"2021-10-28 03:14:25"},"1.0.2":{"tag":"1.0.2","author":"leej3nn20","date":"2021-11-12 01:55:08"},"1.1.0":{"tag":"1.1.0","author":"leej3nn20","date":"2022-01-26 14:41:26"},"1.2.0":{"tag":"1.2.0","author":"leej3nn20","date":"2022-03-17 16:55:20"},"1.3.0":{"tag":"1.3.0","author":"leej3nn20","date":"2022-05-25 01:25:18"},"1.3.1":{"tag":"1.3.1","author":"leej3nn20","date":"2022-11-02 02:27:42"}},"upgrade_notice":[],"ratings":{"1":0,"2":0,"3":0,"4":0,"5":3},"assets_icons":{"icon-128x128.png":{"filename":"icon-128x128.png","revision":2621142,"resolution":"128x128","location":"assets","locale":""},"icon-256x256.png":{"filename":"icon-256x256.png","revision":2621142,"resolution":"256x256","location":"assets","locale":""}},"assets_banners":{"banner-772x250.png":{"filename":"banner-772x250.png","revision":2628378,"resolution":"772x250","location":"assets","locale":""}},"assets_blueprints":{},"all_blocks":[],"tagged_versions":["1.0.1","1.0.2","1.1.0","1.2.0","1.3.0","1.3.1"],"block_files":[],"assets_screenshots":{"screenshot-1.png":{"filename":"screenshot-1.png","revision":2621142,"resolution":"1","location":"assets","locale":""},"screenshot-2.png":{"filename":"screenshot-2.png","revision":2621142,"resolution":"2","location":"assets","locale":""},"screenshot-3.png":{"filename":"screenshot-3.png","revision":2621142,"resolution":"3","location":"assets","locale":""},"screenshot-4.png":{"filename":"screenshot-4.png","revision":2621142,"resolution":"4","location":"assets","locale":""}},"screenshots":{"1":"Setting page.","2":"Inspect and get the target url you wish to replace.","3":"Setup a replacement.","4":"After replacement, inspect again to check if it's working."},"jetpack_post_was_ever_published":false},"plugin_section":[],"plugin_tags":[8856,205037,205038,1216,1976],"plugin_category":[],"plugin_contributors":[204603],"plugin_business_model":[],"class_list":["post-149185","plugin","type-plugin","status-publish","hentry","plugin_tags-asset","plugin_tags-replace-css","plugin_tags-replace-javascript","plugin_tags-script","plugin_tags-style","plugin_contributors-leej3nn20","plugin_committers-leej3nn20"],"banners":{"banner":"https:\/\/ps.w.org\/replace-third-party-asset-source\/assets\/banner-772x250.png?rev=2628378","banner_2x":false,"banner_rtl":false,"banner_2x_rtl":false},"icons":{"svg":false,"icon":"https:\/\/ps.w.org\/replace-third-party-asset-source\/assets\/icon-128x128.png?rev=2621142","icon_2x":"https:\/\/ps.w.org\/replace-third-party-asset-source\/assets\/icon-256x256.png?rev=2621142","generated":false},"screenshots":[{"src":"https:\/\/ps.w.org\/replace-third-party-asset-source\/assets\/screenshot-1.png?rev=2621142","caption":"Setting page."},{"src":"https:\/\/ps.w.org\/replace-third-party-asset-source\/assets\/screenshot-2.png?rev=2621142","caption":"Inspect and get the target url you wish to replace."},{"src":"https:\/\/ps.w.org\/replace-third-party-asset-source\/assets\/screenshot-3.png?rev=2621142","caption":"Setup a replacement."},{"src":"https:\/\/ps.w.org\/replace-third-party-asset-source\/assets\/screenshot-4.png?rev=2621142","caption":"After replacement, inspect again to check if it's working."}],"raw_content":"<!--section=description-->\n<p>Replace any plugin or theme asset source with your own desired source. Main purpose is to help WordPress users to change the slow third party scripts or styles which using by some plugins but slow load speed in certain countries.<\/p>\n\n<p>Usually, you could use some coding skills to find the original enqueue method from the target plugin, then dequeue it, and enqueue your own version of asset file. But you need to take care and follow the same way how the original plugin enqueued and the dependency plus version. Otherwise, you might encounter some unexpected issues.<\/p>\n\n<p>With the help of this plugin, you can easily replace the asset source file without coding skills.<\/p>\n\n<p>This plugin is not meant to auto local host the third party asset file, but you could use for it too. Upload your own local version of asset file in a better and secured folder (maybe from your theme folder), get the public accessible url, use it on the plugin setting page. Just try it out and have fun.<\/p>\n\n<h4>How It Works<\/h4>\n\n<p>Once a new replacement set, this plugin will do a match on all queued asset styles and scripts source. If found the matching source, it will replaces target source URL with your replacement URL.<\/p>\n\n<p>This plugin is not going to dequeue the target asset and enqueue your replacement asset. Issue might be happened if the new enqueue not follow the original plugin or theme like missing dependency or version incorrect etc.<\/p>\n\n<p>If the target asset url not using the standard WordPress enqueue script method by the developer, the replacement will not works.<\/p>\n\n<h4>Use Case<\/h4>\n\n<p>There is a block in Malaysia since end of September 2021, which not allowed all local ISP network to access <strong>maxcdn.bootstrapcdn.com<\/strong>.<\/p>\n\n<p>If there is a plugin in your site using the asset file hosted on <strong>maxcdn.bootstrapcdn.com<\/strong>, the visitor from Malaysia will encounter super slow loading issue.<\/p>\n\n<p>With the help of this plugin, you can easily replace this asset file url to maybe <strong>cdnjs.cloudflare.com<\/strong> without disturbing the functionality of the original plugin.<\/p>\n\n<p><strong>Tutorial for this use case:<\/strong><\/p>\n\n<p><a href=\"https:\/\/itchycode.com\/use-replace-asset-source-wordpress-plugin-to-solve-maxcdn-bootstrapcdn-mcmc-blocked-issue-in-malaysia\/\">Solve maxcdn bootstrapcdn problem in Malaysia<\/a><\/p>\n\n<!--section=installation-->\n<p>From within WordPress<\/p>\n\n<ol>\n<li>Visit <strong>Plugins &gt; Add New<\/strong><\/li>\n<li>Search for <strong>Replace Asset Source<\/strong><\/li>\n<li>Click the <strong>Install Now<\/strong> button to install the plugin<\/li>\n<li>Click the <strong>Activate<\/strong> button to activate the plugin<\/li>\n<li>The setting page will be found at <strong>Settings &gt; Replace Asset Source<\/strong><\/li>\n<li>Follow the instructions in the setting page.<\/li>\n<\/ol>\n\n<p>Manually<\/p>\n\n<ol>\n<li>Upload <code>replace-third-party-asset-source.php<\/code> to the <code>\/wp-content\/plugins\/<\/code> directory<\/li>\n<li><strong>Activate<\/strong> the plugin through the 'Plugins' menu in WordPress<\/li>\n<li>The setting page will be found at <strong>Settings &gt; Replace Asset Source<\/strong><\/li>\n<li>Follow the instructions in the setting page.<\/li>\n<\/ol>\n\n<!--section=faq-->\n<dl>\n<dt id='how%20to%20find%20the%20target%20asset%20url%20in%20my%20wordpress%20site%3F'><h3>How to find the Target Asset URL in my WordPress site?<\/h3><\/dt>\n<dd><p>You need to inspect your website HTML elements to get the correct url. Do not put in the parameters. (Remove all values after <code>?<\/code> included the question mark)<\/p><\/dd>\n<dt id='will%20this%20plugin%20slow%20down%20my%20site%3F'><h3>Will this plugin slow down my site?<\/h3><\/dt>\n<dd><p>No, there is no additional css or js loading in frontend. In backend, just some tiny css and js loaded in this plugin's setting page.<\/p><\/dd>\n<dt id='can%20the%20replacement%20of%20asset%20url%20taking%20effect%20on%20wordpress%20backend%28wp-admin%29%20too%3F'><h3>Can the replacement of asset url taking effect on WordPress Backend(wp-admin) too?<\/h3><\/dt>\n<dd><p>Yes, the replacement will be taking effect in wp-admin area too.<\/p><\/dd>\n<dt id='why%20my%20target%20asset%20not%20being%20replaced%20successfully%3F'><h3>Why my target asset not being replaced successfully?<\/h3><\/dt>\n<dd><p>Double check if your cache system cleared. Sometimes it could be the target asset directly written and harcoded in the plugin or theme without using standard WordPress enqueue way.<\/p><\/dd>\n<dt id='what%20if%20i%20encounter%20difficulty%20when%20using%20this%20plugin%20and%20need%20help%3F'><h3>What if I encounter difficulty when using this plugin and need help?<\/h3><\/dt>\n<dd><p>Welcome to open a <a href=\"https:\/\/wordpress.org\/support\/plugin\/replace-third-party-asset-source\/\">support topic<\/a>. Or you could shoot me an email at me@jenn.support.<\/p><\/dd>\n\n<\/dl>\n\n<!--section=changelog-->\n<h4>1.3.1 2022-09-14<\/h4>\n\n<ul>\n<li>Fix: Trailing comma error in lower PHP version.<\/li>\n<\/ul>\n\n<h4>[1.3.0] 2022-03-21<\/h4>\n\n<ul>\n<li>Enhance matching target asset logic<\/li>\n<li>Tested and working in Oxygen Builder<\/li>\n<li>Change: Filter <code>rtpas_matched_styles<\/code> replaced by <code>rtpas_enqueue_matched_styles<\/code><\/li>\n<li>Change: Filter <code>rtpas_matched_scripts<\/code> replaced by <code>rtpas_enqueue_matched_scripts<\/code><\/li>\n<li>New: Filter <code>rtpas_matched_replacement<\/code><\/li>\n<li>New: Filter <code>rtpas_loader_matched_style<\/code><\/li>\n<li>New: Filter <code>rtpas_loader_matched_script<\/code><\/li>\n<li>Example of filter usage will be published in <a href=\"itchycode.com\">my technical sharing blog<\/a><\/li>\n<li>Code refactoring<\/li>\n<\/ul>\n\n<h4>[1.2.0] 2022-03-18<\/h4>\n\n<ul>\n<li>Enhance matching target asset logic<\/li>\n<\/ul>\n\n<h4>[1.1.0] 2021-11-15<\/h4>\n\n<ul>\n<li>Provide filters for developer to dynamically adjust replacement list<\/li>\n<li>Added <code>rtpas_matched_styles<\/code> to filter matched styles<\/li>\n<li>Added <code>rtpas_matched_scripts<\/code> to filter matched scripts<\/li>\n<li>Fixed undefined offset error<\/li>\n<\/ul>\n\n<h4>[1.0.2] 2021-11-07<\/h4>\n\n<ul>\n<li>Enhance to support replacement if the target source only registered but not queue<\/li>\n<\/ul>\n\n<h4>[1.0.1] 2021-10-28<\/h4>\n\n<ul>\n<li>Initial release.<\/li>\n<\/ul>","raw_excerpt":"Replace plugins or themes asset source with your own desired source. Not design for auto local host asset file. But you can use for it too.","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/szl.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin\/149185","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/szl.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin"}],"about":[{"href":"https:\/\/szl.wordpress.org\/plugins\/wp-json\/wp\/v2\/types\/plugin"}],"replies":[{"embeddable":true,"href":"https:\/\/szl.wordpress.org\/plugins\/wp-json\/wp\/v2\/comments?post=149185"}],"author":[{"embeddable":true,"href":"https:\/\/szl.wordpress.org\/plugins\/wp-json\/wporg\/v1\/users\/leej3nn20"}],"wp:attachment":[{"href":"https:\/\/szl.wordpress.org\/plugins\/wp-json\/wp\/v2\/media?parent=149185"}],"wp:term":[{"taxonomy":"plugin_section","embeddable":true,"href":"https:\/\/szl.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_section?post=149185"},{"taxonomy":"plugin_tags","embeddable":true,"href":"https:\/\/szl.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_tags?post=149185"},{"taxonomy":"plugin_category","embeddable":true,"href":"https:\/\/szl.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_category?post=149185"},{"taxonomy":"plugin_contributors","embeddable":true,"href":"https:\/\/szl.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_contributors?post=149185"},{"taxonomy":"plugin_business_model","embeddable":true,"href":"https:\/\/szl.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_business_model?post=149185"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}