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

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

Related

Two wordpress sites using diiferent themes on the same database

I want to run 2 wordpress sites, one.site.com and two.site.com from the same database. Everything remains the same except for the theme.
one.site.com - Existing site
two.site.com - Should use one.site.com's database except for the
theme
Is there any way this can be done ?
Since theme details are stored in wp_options table is it possible for two.site.com to use it to display a different theme ? Say duplicating that table and making two.site.com use it ?
I appreciate any help.
EDIT:
Both the sites do not have any plugins.
The solution below did the job for me,
Install 2 WordPress sites on a single database.
Create new table in your database. Call it wp_options2 and copy everything from wp_options into this new table
In second install go to wp-config.php, and before if (!defined('ABSPATH')) add define( 'M7_OPTIONS_TABLE', 'wp_options2');
In second install go to wp-includes/wp-db.php on line 1009 and add code:
if (isset( $tables['options'] ) && defined('M7_OPTIONS_TABLE')) $tables['options'] = M7_OPTIONS_TABLE;
These codes should be added in public function tables function, before if (isset( $tables['users']) && defined('CUSTOM_USER_TABLE')))
I found this solution here, https://wordpress.stackexchange.com/questions/84313/how-to-run-two-wordpress-blogs-with-different-themes-and-with-single-database-an#answer-175494
Since we use the same database, links will be same on both the sites. I had a lot of images linked and I removed them using
.single a[href$=".jpg"] {
pointer-events: none;
cursor: default;
}
You can run two sites from a single database but not from the same set of database tables as the stored data includes the site's domain name.
There are two values in the options table: siteurl and home which are used. Using the same options table won't work, even if you update options forcefully for each php run.
So you would need to use two databases.
EDIT:
My advice is to replicate base and run both sites on different databases.
This could probably be accomplished by using wildcard subdomains (https://codex.wordpress.org/Configuring_Wildcard_Subdomains).
It may be a little hacky, but you'd have to test the condition of your subdomain (maybe in wp-config.php?) and set the theme in the database (http://www.inmotionhosting.com/support/edu/wordpress/change-theme-in-db).
The only problem I could see with this is that your functions.php can change WP functionality, so a Parent theme with two Child Themes is probably a good idea(https://codex.wordpress.org/Child_Themes).
There is a lot of jiggery hackery regarding this question, but I think there's a fairly simple solution. First, ensure that both of your 2 sites have these hardcoded in wp-config.php:
define('WP_HOME', 'https://example.com');
define('WP_SITEURL', 'https://example.com');
These will help each site "override" whatever the database setting is for the URLs.
Next, decide which site is the MASTER site where you are going to be publishing new blog posts, making edits to site data, and such. On that site, activate the theme you want to use.
Now, go to your SLAVE site (I'm using these terms loosely) and delete that theme via SFTP, and upload whichever other theme you want to use on that site. Then, hardcode it like this:
define('WP_DEFAULT_THEME', 'twentytwenty');
In this way, the SLAVE site tries to find the correct theme from wp_options that is activated on the MASTER site but you deleted it already, so it reverts to using the default theme as defined in wp-config.php
Going forward, do not mess with site settings/plugins/etc on the SLAVE site, and make any changes to the design of your SLAVE site using the theme files only (like a static theme). Obviously if you are using a bloated theme and page builder type of situation that need MySQL, this isn't going to work...
Note: you may need to visit /wp-admin/themes.php on your SLAVE site at least once, to "force" WordPress to load the hardcoded theme.
If anyone is interested, SlickStack supports this approach.
Duplicate of https://wordpress.stackexchange.com/q/65560/wp-multisite-load-content-from-site-x-on-site-y
One might argue that using WP multisite-network functionality and adding a couple of documented API calls to ones theme could be a cleaner solution than manually modifying the database schema and messing with how WP access it.

Remove a query string added to Wordpress URLs

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.

Magento Success Page Reverts to Default Theme

We recently added a new extension to our site that adds multiple serial codes to a product (http://www.modifymage.com/instructions/serial-codes). Everything works great except when you try to purchase one of the items. It gives you a success page that uses the default theme.
Everything appears to be setup correctly in terms of the backend. I’ve already contacted the creator but I doubt they’ll provide any support.
Also, when I view source it says its referencing the right theme but when “Inspect Element” it tells me its using the default theme.
Any ideas? I’m thinking its a template issue but the success page uses the custom theme’s CSS.
This is very unlikely to have anything to do with our extension. Our extension does not interact in any way with the front end themes.
In the Admin Panel, please first go to:
System > Configuration > General > Design
And check the settings under the Package and Themes sections. Please see this forum post for an example that presents itself exactly like the problem you are experiencing and how it was fixed:
http://www.magentocommerce.com/boards/viewthread/281457/
If that is all set up correctly, next try disabling the output of our extension and see if the problem goes away. You can do that here:
System > Configuration > Advanced > Disable Module Output
Disable Mmsmods_Serialcodes. If this doesn't fix the problem, make sure the design file template/checkout/success.phtml is located in your design theme folder.
I hope that helps. If you are still having problems, or if you have any additional questions or concerns, please notify our support department once again.

How to add scripts and styles for EXACT page in Wordpress admin panel

I am well aware of the WP hooks admin_print_scripts-$mypage, admin_print_styles-$mypage but they seem to trigger only for pages registered with $mypage = add_management_page( ... ), add_options_page(), etc. It's quite clear you won't be able to use these for sub-generated pages with totally different markup unless you keep the URL intact (pass data using POST).
As it's my first encounter, i came up with solution which is quite simple - conditions for $_GET['page'],$_GET['action'](for ex.) and $_SERVER['PHP_SELF'] then hook admin_print_scripts/styles with wp_enqueue_script/style () . It works just well but is it the way to go?
I am a little confused as to why you have any pages which are not registered using the WordPress functions. If the plugin/theme is complicated enough to need several distinct pages (not just one page with some tabs) then I suggest you add a standalone page using: http://codex.wordpress.org/Function_Reference/add_menu_page and then have several sub pages using: http://codex.wordpress.org/Function_Reference/add_submenu_page

Joomla Events Override

Is it possible for plugins to block System Events in Joomla? I'm currently using a url rewriting plugin and the onAfterRoute event does not seem to be called (which I need for another plugin)
Thanks
Plugins shouldn't be blocking the onAfterRoute event. However, plugins responding to that event must be published after they are installed.
Also, onAfterRoute is called after the URL is parsed and variables have been pushed into JRequest. Is this this point where you're wanting the plugin to be called, or does it need to come before onAfterRoute?
Does the other plugin (the one that uses onAfterRoute) work if you disable the URL rewriting plugin? If not, then that's not the problem.
If it does, then I suggest you look at the plugin and find the bit that targets onAfterRoute to see what it's doing. (Maybe post it here if it's not too involved.)

Categories