Remove a query string added to Wordpress URLs - php

I have to work with a Wordpress installation that wasn't mine, and I need to work out some things to optimize performance.
Among other things, I've found that almost every single URL, specially for static files, is appended with a query string, and it's always the same:
https://www.example.com/wp-content/uploads/2013/06/gfi-150x42.png?e1e0dc
https://www.example.com/wp-content/uploads/2013/06/healthline-150x42.png?e1e0dc
And so on.
Does anybody know a plugin that can be causing this? I have the following installed, and i can't find the one causing it or if it's something else:
Advanced Custom Fields
Akismet
Category Post Widget
Contact Form 7
Envato WordPress Toolkit
Forms: 3rd-Party Integration
Google XML Sitemaps
LayerSlider WP
Ready! Backup
Ready! Backup PRO
Redirection
Remove query strings from static resources
Special Recent Posts FREE Edition
Twoot ToolKit
W3 Total Cache
Wickett Twitter Widget
WordPress-to-Lead for Salesforce CRM
WordPress HTTPS
WordPress SEO
WP-PageNavi

You can remove query strings from theme resources (css and javascript files) with this in your theme's functions.php file:
// Remove Query Strings from enqueue scripts
add_filter( 'style_loader_src', 'remove_query_string' );
add_filter( 'script_loader_src', 'remove_query_string' );
function remove_query_string( $url )
{
return remove_query_arg( 'ver', $url );
}
As for query strings from plugins, I assume that will be a similar fix in each plugin.

Appending a version number as a URL query string is a common cache-busting solution.
It looks like W3 Total Cache may be the culprit here. Their website says that one of the features is:
Browser caching using cache-control, future expire headers and entity tags (ETag) with "cache-busting"
According to the author of the plugin, you can disable this feature:
Uncheck the "Prevent caching of objects after settings change" option on the browser cache settings tab.

Related

removing all things Google Map (api) to meet GDPR-Compliance

running the theme Jobify: https://astoundify.com/products/jobify/
this includes some google-maps that means it fetches the maps from google-Api. This may cause some GDPR issues for lots of user in the world.
solution: we tried to find a solution that takes away the google-assets from the page - completly!!
now - we can come up with one - which is not verified yet:
Just in case anybody is interested in an answer i guess that we can do this like so:
To remove Google Maps from the Jobify theme completely, we can try this steps and follow these ones: Go to the WordPress dashboard and navigate to the "Appearance" section.
Click on "Editor" to access the theme files.
Open the "functions.php" file.
Locate the code that initializes the Google Maps API. It should look something like this:
php
Copy code
function jobify_google_maps_api() {
wp_register_script( 'google-maps', '//maps.googleapis.com/maps/api/js?key=YOUR_API_KEY', array(), null, false );
wp_enqueue_script( 'google-maps' );
}
add_action( 'wp_enqueue_scripts', 'jobify_google_maps_api' );
Comment out or delete this code to disable the Google Maps API.
Save the changes to the file.
This should remove Google Maps from the Jobify theme completely.
However, keep in mind that removing this functionality may affect other parts of the theme, so we may need to make additional changes or modifications to ensure the theme still works as intended.
Well i want to share this just in case anybody is interested in an answer i guess that we can do this like so:
note: This change will be undone when the theme updates
To make this happen in a way that will not go away on update you can create a child theme or a custom plugin and use
remove_action('wp_enqueue_scripts', 'jobify_google_maps_api' );
to prevent the map from loading
btw: see also: https://wordpress.stackexchange.com/questions/219049/remove-extra-google-maps-script

WordPress: Too many taxonomies slow down the site

I have a WordPress site with 30,000+ terms for Australian cities/states. Wordpress loads fine with fewer terms but 30,000 terms make it load forever.
I've disabled all the plugins and using the WP-2015 template. Is there a way to add such a huge number of custom terms and make the site work normally?
I have the exact same issue. It turns out the problem is the WordPress is very slow if you have many terms and the taxonomy is set to be hierarchical. Without this option the admin and frontend pages load fine.
It's an old issue from way back which I don't think WordPress can fix with their current database structure.
As a partial fix I improvise by making the taxonomy non hierarchical and set the parent/child relations as taxonomy meta. It only works in the front end where you have full control over the queries.
Is site slow at all places or just a set of pages? If so, which pages?
We have way more terms than you do and we have no problems. I assume that at certain places select queries take too long.
You can install plugin called Query Monitor which can show you what takes long, what triggers it and lots of other useful information which can help you locate and fix the problem
It's old question. The issue is (as #razvan said) for hierarchical because (mainly for administration pages), WordPress create a <select> tag for the selection of the taxonomy. But using non hierarchic taxonomies (like tags) works perfectly.

Is there ability to deploy a wordpress page/pages inside of another engine site

Apprecaite any help on my question.
Lets pretend, I have a internet shop driven on joomla or some another engine. Can i make a part of it on wordpress, for example, the page for every item in the shop? Dont take a look to the oddness of situation :) just want to know is there ability to cross engines. Also, if you can, please recommend manuals.
Have a nice day!
Yes, you can as exhibited in this WordPress Codex page but you will not be able to take advantage of the WordPress URL routing scheme, WordPress themes, plugins or widgets -- not directly -- you'll have to write custom code to use them.
<?php
/* Short and sweet */
define('WP_USE_THEMES', false);
require('./wp-blog-header.php');
?>
You will just have access to the WordPress functions with which you will be able to fetch posts from the DB and then you will be able to write custom PHP code to display those posts.
Obviously displaying plugins or widgets will also become your responsibility -- you'll have to call functions which either render all plugins or fetch a list of plugins/widgets and decide what to do with them.

Wordpress Development

I have one project of blog site to be developed in wordpress. I have no experience how wordpress works, I read Codex documentation, But didn't find the answer of my questions,
So Project Requirements are ,
1: Post Movie with Thumbnails,Links to Download or Streaming Websites,Genre(Taxonomy),Youtube Movie Trail,
2: User can Like,rate,comment,Add to watch list,Share with friends
3: I have database of more than 3000 Records, I don't want to insert it to the wp_posts Table for some reasons.
4: How to add javascript to Widgets,or Plugin (Maybe it's a stupid Question)
My problem is I don't know what is the write way to do it. There are Two Major things in WP
1: Plugin
2: Widgets
How can i use them in my project ? From Where Should I start First, I have done with the theme Development, And Some Basic Concepts of wordpress Like, Action,Filters. I can create this project easily with the PHP and JS . Don't suggest me any premade wordpress plugin or Widgets, I want to code it myself
What do you mean add javascript to widgets or plugins? You can include javascript by adding it to the Theme of the page.
Most of your development should be on a Theme. A Theme is essentially a collection of different page templates, styling and functions that will be used. Theme can also handle taxonomy and meta data.
Since you have a DB already what you could do is make a page template called "movie" that pulls an ID/Slug and retrieves it from the database to get the relevant information.
Helpful Links:
Taxonomy - http://codex.wordpress.org/Taxonomies
Queuing Scripts - http://codex.wordpress.org/Function_Reference/wp_enqueue_script
WPDB (Database Class) - http://codex.wordpress.org/Class_Reference/wpdb
I think there might be already some themes ready with the functionalities you want. Did you do a search for stock themes? I've come across a few for video/movies displaying with ratings, social sharing, etc. So your development work would reduce significantly.

Upgrade Wordpress Widget to use the Widget API

Hopefully someone can help me out with this. I am upgrading a widget from the (really) old method of get_option/update_option to store/retrieve widget options to use the newer Widget API. The goal is to be able to use multiple instances of the widget, which I have successfully done, but now I'm running into a problem.
The plugin I'm working with is currently being used on somewhere between 500 and 1000 sites, most of which have some of the plugin widgets enabled. If I commit the widget upgrades to the next release of our plugin, all sites will lose the option values and placement of existing widgets. Does anyone know of a way around this?
Looks like WordPress will take care of it for you - new widgets store a _multiwidget key in the settings array, if it's not there, wp_convert_widget_settings() gets on the case.

Categories