How to run code when the “Copy source content” option is checked

How to run code when the “Copy source content” option is checked

How to run code when the “Copy source content” option is checked
In this tutorial we are going to show how to run your code snippet when the option Copy source content is selected in the translation metabox.

Table of Contents

The translation metaboxFilter the code and run your snippet
The translation metabox
A translation metabox lets you to define some settings related to the post translations that are available in another language sub site.
When you edit a post you will find the translation metabox right under your content. There will be one metabox for every language site connected through MultilingualPress.
In each metabox it is possible to quickly set some options that affect the post content and configuration in the related language sub site. This way the user can set all the needed options directly in one page.
The option “Copy source content” lets you copy the entire content of the post to the related translation post.
For further information please refer to: https://multilingualpress.org/docs/getting-started-with-multilingualpress-3/
Filter the code and run your snippet
If you need to run some code only when that option is checked, you can use the multilingualpress.sync_post_meta_keys filter.
Here below we provide an example of such implementation.
add_filter(‘multilingualpress.sync_post_meta_keys’, function($keysToSync, $context, $request) {

$multilingualpress = $request->bodyValue(
‘multilingualpress’,
INPUT_POST,
FILTER_DEFAULT,
FILTER_FORCE_ARRAY
);

$remoteSiteId = $context->remoteSiteId();
$translation = $multilingualpress[“site-{$remoteSiteId}”] ?? ”;

if(!empty($translation) && $translation[‘remote-content-copy’] === ‘1’) {
// Copy source content checked in metabox
}

return $keysToSync;
}, 10, 3);
So, here we see that by using the multilingualpress.sync_post_meta_keys filter hook, you can grab from the context the translation metaboxes, and then loop through them.
While looping you can check the status of the related remote-content-copy array key. That value is set accordingly with the Copy source content option.
Finally replace the comment “Copy source content checked in metabox” with your code snippet. This will run when the status is 1.

MultilingualPress 2 to 3 Migration Tool

MultilingualPress 2 to 3 Migration Tool

MultilingualPress 2 to 3 Migration Tool
This tool provides you a fast and easy solution to migrate your WordPress Multisite content from MultilingualPress version 2 (MLP 2) to version 3 (MLP 3).
Please note: This is an alpha version and will be improved after some testing. Please do not use this on a live system.
You can help us to improve the tool by sending us possible problems you discover via support@multilingualpress.org or on Github.
If you prefer to manually migrate from MLP 2 to MLP 3, you can follow this tutorial.
The following documentation shows the essential steps to install and use the MultilingualPress 2 to 3 Migration Tool

Table of Contents

Requirements for MultilingualPress 2 to 3 Migration ToolSetting the environmentExecuting the migration
1. Requirements for MultilingualPress 2 to 3 Migration Tool
In order to perform a migration of your Multisite Network from MLP 2 to the new Version MLP 3, you need:

An installed version of WordPress Multisite with WordPress 4.8 or above.
An installed and activated version of MLP 2.
WP-CLI has to be installed in order to execute the MLP 2 to MLP 3 migration tool via WP-CLI command line. If you need help, follow this tutorial for WP-CLI installation.

Please note: Before proceeding, we strongly recommend a full backup including all the files and the database of your Multisite Network.
2. Setting the environment

Go to: My Sites → Network Admin → Plugins and Update MLP 2 to the latest version (2.11.3 or above) if needed.
Select the Menu Plugins via Network Admin WordPress Backend
Download and Install the latest version of MLP 3 (3.2.0 or above). If you need help, see this tutorial.
Please note: Don’t activate the MLP 3 Plugin yet.

Download the MultilingualPress 2 to 3 Migration Tool on Github. The latest version of the migration tool can be downloaded from this link: here you find the list of the available releases. Select the latest one (in the example the 0.1.0 is available, but this could be not the latest anymore, so be careful in selecting the latest one) and download the related zip package as specified in the following picture

An example of the link to use in order to download the package
Install the MultilingualPress 2 to 3 Migration Tool on WordPress:

Go to My Sites → Network Admin → Plugins and press the button Add New.
Select Upload Plugin and upload the Plugin zip file from your computer.
Press Install Now.
After installation completed, click Network Activate to activate the plugin across your Multisite environment.

Go to: My Sites → Network Admin → Plugins and Network Deactivate MLP 2.
Network Deactivate MLP 2
Network Activate MLP 3.

 
3. Executing the migration

Run the tool via the command line of your system (Windows: cmd.exe; Mac: Terminal) by entering the following instruction:
wp mlp2to3 all

The above command will perform all the needed action to achieve the migration from MLP 2 to MLP 3. A process bar will be visible during migration.
You can also execute only a specific task:
Refer to the online help to see which tasks are available by using the command:
wp mlp2to3 –help

When the migration is completed: Check that the site is working properly and no errors occur.
Please note: In case of an error, contact our Support.

If the previous step was successful: Uninstall MLP2 by going to My Sites → Network Admin → Plugins and Delete.
Network Deactivate and Delete the Migration Plugin.

How to set up the automatic language redirection

How to set up the automatic language redirection

How to set up the automatic language redirection
This tutorial is part of our MultilingualPress 2 documentation. In case you are using the newer version 3, please switch to MultilingualPress 3.
If you have a multilingual website, it is extremely important that your users get to the language they understand the most. The feature automatic language redirection in MultilingualPress is taking care of that. In the following text you can find information about how the automatic language redirection works and how you set it.

Table of Contents

How does the automatic language redirection work in multilingual websites?Browser settings for the languageMultilingualPress priorities for languagesHow to find out language of browser setting and MultilingualPress prioritiesHow to set the automatic language redirection in MultilingualPress
1. How does the automatic language redirection work in multilingual websites?
1.1. Browser settings for the language
Users can add their preferred languages in the settings of each browser so that multilingual websites can take them into account. So the user adds which languages he speaks and also indicates his preferred order.
The following screenshot shows the corresponding setting in firefox.
Firefox language setting
1.2. MultilingualPress priorities for languages
Additionally to the browser settings there is a MultilingualPress setting for the automatic language redirection. And we offer the possibility to point to the qualitiy of your translations by assigning priorities for each language.
To set the automatic language redirection, go to Network Administration → Settings → Language Manager. There you can see all languages being available in MultilingualPress by default. The column rightmost lists priority, where you can add numbers on a scale from 1 to 10 for each of your translations. The language with the translation of highest quality gets the 10. Attention: the worse the translation, the lower the priority.
Language Manager
1.3. How to find out language of browser setting and MultilingualPress priorities
MultilingualPress multiplies each browser setting with the priorities being indicated in the language administration and the rule for the language selection is: The higher value wins. Experts call this Language Negotiation. 
In case the language with the highest level complies with the current language, there is no language redirection. The user is redirected neither to another language in case he or she goes to another language through a link generated from MultilingualPress  (e.g. in the language widget, in quicklinks or in the menue).
You can find a very detailed description about the language redirection in this article.
2. How to set the automatic language redirection in MultilingualPress
Requirement: For the automatic language redirection you need to have created at least two sites in your multisite. Then you need to assign a language in the MultilingualPress Tab. Did that? Great. Morover, you need to link the sites with each other.
Automatic language redirection

Go to Network Administration and then to Settings → MultilingualPress. Then set a hook at HTTP Redirect.
HTTP Redirect – Redirect visitors according to browser language settings.
Go to Sites → All Sites and edit a website.
Click at the tab MultilingualPress and set a hook at Enable automatic redirection.
Enable automatic redirection
You need to do these steps for all websites that are linked to each other. In Sites → All Sites there should be a hook in the column Redirect for sites with activated language redirection.
Activated language redirection

Where can I find the MultilingualPress Support?

Where can I find the MultilingualPress Support?

Where can I find the MultilingualPress Support?
This tutorial is part of our MultilingualPress 2 documentation. In case you are using the newer version 3, please switch to MultilingualPress 3.
You need help for MultilingualPress, have questions, want to report bugs or suggest new features? We’re happy to help and look forward, if you help us to improve our product.
We have two possibilities to contact our support, depending on whether you use the free version of MultilingualPress or you bought our Premium Support.

Table of Contents

Individual MultilingualPress Premium SupportSupport for the MultilingualPress Free Version on wordpress.org
1. Individual MultilingualPress Premium Support
If you bought MultilingualPress Premium, you can use our personal Premium Support. The development team is there for you with advice and practical support and glad to help you with problems.
The Premium Support can be found under multilingualpress.org/support. Once you’re logged into your account, you can submit a support ticket.
If you have no account, please purchase a MultilingualPress license.
Please understand that we can not afford a free premium support.
For questions before purchasing, please use our contact form.

 
2. Support for the MultilingualPress Free Version on wordpress.org
If you use the free version of MultilingualPress, visit our forum at wordpress.org and specify your support request there please. Our general support takes place usually on Tuesdays and Thursdays for 2 hours.

What is hreflang – SEO for multilingual Websites

What is hreflang – SEO for multilingual Websites

What is hreflang – SEO for multilingual Websites
In this tutorial we explain the link attribute rel=”alternate” hreflang=”x”. Moreover we focus on the relationship of hreflang, SEO and multilingual websites. Last but not least we show how to implement it with MultilingualPress.

Table of Contents

What is hreflang?Which impacts does hreflang have on SEO?How do I have to implement hreflang?How do I set up hreflang with MLP?How can I test whether hreflang is implemented correctly?
What is hreflang?
The link attribute rel=”alternate” hreflang=”x” is inserted into the website’s head. Due to that search engines understand they shall show the users’ preferred language. Moreover they learn that the website content is available in several languages.
Example:

The example displays that the current content is also available in the language version en-US on the page https://inpsyde.com/en/.
Which impacts does hreflang have on SEO?
On the one hand the link attribute tells a search engine that a website’s content is available in several languages. Thanks to that, the search engine can display the user’s preferred language. On the other hand the attribute prevents a punishment due to duplicate content, for example when there is the same content for several languages/regions.
Example:
Company A has a multilingual website with contents for Germany, Switzerland and France. The contents of the Swisse and German website are partly identic. As both languages are quite similar, there would be a duplicate content problem without hreflang. But with the link attribute the search engine recognizes that it’s content for different regions.
How do I have to implement hreflang?
In case you have a number of language versions of one URL, each version needs to have a rel=”alternate” hreflang=”x” link both for itself and the other language versions.
Example:
When you offer content in German, English, and French, the German version needs to have a rel=”alternate” hreflang=”x” link attribute for itself additional to the links for the English and French language versions. The English and French versions need to refer to the French, English, and German language versions as well.
How do I set up hreflang with MLP?
You need to connect the different languages for each website. As soon as you defined the translation relationships, MultilingualPress inserts the link attribute into the sites automatically.
Example of our own website https://multilingualpress.de:
hreflang attribute for language or region URL
How can I test whether hreflang is implemented correctly?
The website sistrix.com offers a hreflang validator.
Moreover the Google documentation offers further information.

How to move from MarketPress to MultilingualPress.org

How to move from MarketPress to MultilingualPress.org

How to move from MarketPress to MultilingualPress.org
This tutorial is part of our MultilingualPress 2 documentation. In case you are using the newer version 3, please switch to MultilingualPress 3.
As of January 13th 2017, we only offer MultilingualPress Premium Support on our own platforms multilingualpress.org for english support and multilingualpress.de for german support. If you have questions please contact us via our contact form or directly at support@multilingualpress.org.

You own a MultilingualPress Premium Support licence from MarketPress? For the renewal of your license, you will receive a 30$ voucher via the MarketPress renewal newsletter. With this you can purchase MultilingualPress Premium Support on multilingualpress.org.

 
Thank you very much and welcome to your new MultilingualPress community!

 
Your  MultilingualPress  Team – proudly Powered by Inpsyde

WordPress Multisite database tables explained

WordPress Multisite database tables explained

WordPress Multisite database tables explained
Working with a WordPress Multisite requires a little bit more knowledge about WordPress and experience as WordPress admin than working with a single site. When you try to fix problems with your WordPress Multisite network, it is sometimes helpful to know how the database of a multisite is structured and what the differences between a Single Site database and a WordPress Multisite database are.
So let’s take a look to which database tables do we have in a single site and which we have in a multisite. We will briefly explain each of the multisite specific tables. If you need an explanation of single site tables, please read the post Database Description in the WordPress Codex.
Hint: Starting from a single site WordPress installation it is possible to switch to a WordPress Multisite through a procedure as described in the WordPress codex.

Table of Contents

WordPress single site database tablesWordPress Multisite database tablesNew tablesUpdated tablesSite Specific Tables
1. WordPress single site database tables
In a single site WordPress installation the database tables used are:

wp_commentmeta
wp_comments
wp_links
wp_options
wp_postmeta
wp_posts
wp_terms
wp_termmeta
wp_term_relationships
wp_term_taxonomy
wp_usermeta
wp_users

After we proceed with the Multisite install procedure, some of these tables are updated and other new tables are added. The remaining ones are not changed but they start to refer to the main site, while for other sites (not the main) specific ones are created.
2. WordPress Multisite database tables
So here the new situation after a Multisite install:

wp_blogs → NEW
wp_blogs_versions → NEW
wp_commentmeta → refers to main site
wp_comments → refers to main site
wp_links → refers to main site
wp_options → refers to main site
wp_postmeta → refers to main site
wp_posts → refers to main site
wp_registration_log → NEW
wp_signups → NEW
wp_site → NEW
wp_sitemeta → NEW
wp_terms → refers to main site
wp_termmeta → refers to main site
wp_term_relationships → refers to main site
wp_term_taxonomy → refers to main site
wp_usermeta  → UPDATED
wp_users  → UPDATED
SITE SPECIFIC TABLES → NEW, refers to other site(s) except the main one

2.1. New tables

wp_blogs: each site created is stored in that table
wp_blogs_versions: this table keeps track of the datadase version status for each site
wp_registration_log: in this table is stored the admin user created when a new site is created
wp_signups: in this table are stored the users that have registered for a site via the login registration process.
wp_site: in this table is stored the sites address
wp_sitemeta: here are tracked various site informations

2.2. Updated tables

wp_users: the list of all users of all the sites is maintained in this table
wp_usermeta: here are stored the meta data of users for all the sites

2.3. Site Specific Tables
The data of the main site is stored in existing unnumbered tables, while the data of additional sites is stored in new numbered tables.
So for the main site we have these dedicated tables:

wp_commentmeta
wp_comments
wp_links
wp_options
wp_postmeta
wp_posts
wp_terms
wp_termmeta
wp_term_relationships
wp_term_taxonomy

While, for example, when a new site is created, the site-specific tables, similar to the single site install, are created. Each set of tables for a site is created with the site ID (blog_id) as part of the table name. These are the tables that would be created for site with ID 2 :

wp_2_commentmeta
wp_2_comments
wp_2_links
wp_2_options
wp_2_postmeta
wp_2_posts
wp_2_terms
wp_2_termmeta
wp_2_term_relationships
wp_2_term_taxonomy

References:
https://codex.wordpress.org/Database_Description
https://deliciousbrains.com/wordpress-multisite-database-tour/
https://rudrastyh.com/wordpress-multisite/database-tutorial.html

WordPress multisite compatible plugins – the definitive list

WordPress multisite compatible plugins – the definitive list

WordPress multisite compatible plugins – the definitive list
Are you currently building a WordPress multisite network? Do you already have one and are looking for plugins to equip your network with additional features? Then it’s inevitable that you will deal with the question of WordPress multisite compatible plugins. That’s because  you cannot use all plugins within a multisite.
Now we will explain how you can tell whether a WordPress plugin is compatible with the multisite feature or not. Moreover, we provide a long list of plugins that we update regularly.

Table of Contents

How do I know whether a plugin is compatible with WordPress multisite?List of WordPress multisite compatible plugins
1. How do I know whether a plugin is compatible with WordPress multisite?
Generally, the plugin description mentions compatibility with WordPress multisite if it is compatible. For free plugins, you can find this description at wordpress.org. Nevertheless, you can divide a plugin’s compatibility with WordPress multisite into three categories:

a) non-compatible – The plugin delivers an error message during installation or activation in a WordPress multisite. You definitely cannot use these plugins in a multisite. For many of these plugins, there is nothing in the plugin description about multisite compatibility.
b) passively compatible – You can use the plugin in the multisite without causing errors but the plugin author didn’t specifically develop the plugin as a multisite plugin. You can use these plugins in the multisite, but you should exercise caution if the plugin author does not specifically indicate multisite compatibility in the description.
c) actively compatible – These plugins are always referred to as multisite compatible in the description. These are a safe option for you.

If you are not sure, it’s best to contact the plugin author.
2. List of WordPress multisite compatible plugins
To spare you a long search, we have compiled several plugins here that are known to be WordPress multisite compatible along with a brief description and a link to the plugin.

Plugin NameURL and Description

Akismethttps://de.wordpress.org/plugins/akismet/
Protects against spam comments.

Antispam Beehttps://de.wordpress.org/plugins/antispam-bee/
Protects against spam comments, GDPR compliant alternative for Akismet

BackWPuphttps://backwpup.de
Backup-plugin with restore functionality and multisite features. Multisite backup possible.

Broken Link Checkerhttps://wordpress.org/plugins/broken-link-checker/
Finds incorrect links on your website. Passive multiste compatible.

Contact Form 7https://wordpress.org/plugins/contact-form-7/
The most popular plugin to create contact forms.

GDPR Cookie Consenthttps://wordpress.org/plugins/cookie-law-info/
Formerly “Cookie Law Info”. Displays a cookie information. Passive multisite compatible.

Imagifyhttps://wordpress.org/plugins/imagify/
Lossless picture optimization to improve the performance of your website.

Jetpackhttps://wordpress.org/plugins/jetpack/
A plugin made by Automattic, the provider of WordPress with many modules like site statistics, marketing and security features.

MailChimp for WordPresshttps://wordpress.org/plugins/mailchimp-for-wp/
Connects your website with your Mailchimp account and provides forms with which you can collect newsletter subscriptions.

Monster Insightshttps://wordpress.org/plugins/google-analytics-for-wordpress/
Integrates Google Analytics into your website, ecommerce tracking in its pro version.

MultilingualPresshttps://multilingualpress.de
Our plugin for performant multilingual websites based on WordPress multisite.

NextGen Galleryhttps://de.wordpress.org/plugins/nextgen-gallery/
The most popular plugin to create galleries.

Optimushttps://de.wordpress.org/plugins/optimus/
A plugin to optimize pictures, like Imagify.

Redirectionhttps://de.wordpress.org/plugins/redirection/
Setup 301 redirections in the WordPress backend. Capable to implement all regular expressions.

Search & Replacehttps://de.wordpress.org/plugins/search-and-replace/
Enables to search and replace character strings in the database. Database backup and database restore inclusively.

SEOPresshttps://wordpress.org/plugins/wp-seopress/
A powerfull SEO plugin which helps you optimize your site.

Stream https://de.wordpress.org/plugins/stream/
Monitoring of user activities in WordPress multisite.

User Switchinghttps://de.wordpress.org/plugins/user-switching/
Allows the simple switching of the admin into the profile of another website user.

W3 Total Cachehttps://de.wordpress.org/plugins/w3-total-cache/
Caching plugin for WordPress. Improves the website performance and therefore the SEO and the user experience.

WooCommercehttps://woocommerce.com/
THE ecommerce solution for WordPress. Many free and fee-based extensions available.

Wordfence Securityhttps://de.wordpress.org/plugins/wordfence/
Security checks and measures for your website like firewall, scans of data, prevention of brute force attacs.

Yoast SEOhttps://de.wordpress.org/plugins/wordpress-seo/
The most famous search engine optimization plugin for WordPress helps you increase traffic to your site.

NEW! MultilingualPress Yoast SEO Sync available for free on Github – This is a simple add-on for the MultilingualPress 3 plugin to synchronize the post metadata of the Yoast SEO plugin between translated posts.

WordPress Multisite Pros and Cons

WordPress Multisite Pros and Cons

WordPress Multisite Pros and Cons
When you need to build a network of related sites, to choose whether rely on different single site WordPress installations, or on a WordPress Multisite installation, is not a trivial issue. In fact there are many aspects you need to consider.
Here follow several pros and cons of using a WordPress Multisite installation to build your site network.

Table of Contents

The Pros of a WordPress MultisiteThe Cons of a WordPress Multisite
1. The Pros of a WordPress Multisite

Manage all sites from the same dashboard, through a single Super Admin user.
The site administrator cannot install or change plugins and themes, only the Super Admin can do this. This lets you more control and avoids conflicts, keeping control centralized.
You need to install themes and plugins only once and then you can activate them across the entire network. Also you execute the upgrade process only once.
Store all sites data in a single backup, no need to backup each site.
Since every WordPress installation takes a considerable amount of resources on the server, using a Multisite installation you don’t spend so much resources (and money) and the optimization process can be less painful.
You can properly configure and maintain multilanguages versions of the same site through a multisite structure and multi languages plugins.

2. The Cons of a WordPress Multisite

Not all plugins work on multisite. Usually most plugins are basically created for single site and this can lead to conflicts.
Individual site administrators cannot install/uninstall plugin and themes, this limits site administrators power.
A hacker attack or just a downtime on your server will affect all the sites.
A data breach will involve all the data of all the sites.
Big traffic on one site may affect the speed of all the other sites of the network, for bandwith reason but also because all sites share the same database.
Not all hosting plans support multisite.
If you need to keep users on separated sites, Multisite can lead to security risk, due also to eventual leaks in plugins/themes.
If a theme or a plugin is updated, it is updated for all sites of the network that use it. Change versions between sites could be complicated.
If the number of sites increases, to manage it within a multisite installation could be critical.
There could be some reasons that make you want to change a multisite installation into different single sites installations: for example if one site becomes too big, or just the number of sites increases too much making the whole system slow. To switch from multisite installation back to single site is hard to achieve.
In case of testing new plugins/themes features, for a single site administrator is difficult to work because he cannot activate/deactivate or install/delete it since this can be done only through the Super Admin user.
All sites share the same user profiles. You cannot create for example the same user two times for two different sites on the network. Besides logged in users are logged in for all sites.

Further reading about WordPress Multisite Pros and Cons:
wpexplorer.com – Pros and Cons of WordPress Multisite – How to Install Multisite With Local Xampp
Quora – Are there any disadvantages to using WordPress Multisite?
narga.net – WordPress Multisite vs Multiple WordPress Installations
wpmudev.org – Multisite Pros & Cons

MultilingualPress-Yoast-SEO-Sync

MultilingualPress-Yoast-SEO-Sync

MultilingualPress-Yoast-SEO-Sync

Table of Contents

What is MultilingualPress-Yoast-Seo-Sync for?Requirements for MultilingualPress-Yoast-SEO-SyncHow to Install MultilingualPress-Yoast-SEO-Sync?Download the addon from GithubInstall the addon on WordPressHow to use MultilingualPress-Yoast-SEO-Sync Addon?
1. What is MultilingualPress-Yoast-Seo-Sync for?
MultilingualPress-Yoast-Seo-Sync helps you to manage the metadata of the Yoast SEO plugin for translated posts or sites in your MultilingualPress 3 network. The addon provides additional Yoast tabs for every translation in the editor and enables you to set up the data in one place. No more switching between different translations of content!
2. Requirements for MultilingualPress-Yoast-SEO-Sync

An installed version of WordPress multisite with WordPress 4.8 +
PHP-Version 7 +
MultilingualPress 3 +
Yoast SEO

3. How to Install MultilingualPress-Yoast-SEO-Sync?
3.1. Download the addon from Github

Go to: https://github.com/inpsyde/MultilingualPress-Yoast-SEO-Sync
Go to releases
Click the Releases Tab on the Addons Github page
Select the latest release and download the current Version as a zipped file

Select the latest version of the addon and download the Zip file
3.2. Install the addon on WordPress

Make sure you have installed MultilingualPress 3. If you need help, follow this tutorial
Go toMy Sites → Network Admin → Plugins
Select the Menu Plugins via Network Admin WordPress
Press the Add New button and select Upload Plugin
Select the addon zip file from your computer and press the Install Now button
Upload the Addons Zip file to your WordPress installation
Activate the addon across all sites of your multisite network by pressing the Activate button

4. How to use MultilingualPress-Yoast-SEO-Sync Addon?
The Addon provides an additional Yoast SEO tab for every translation type you see in your editor. When you set up metadata for a site or post, you are now able to do this in one place without switching between different translations.
The Addon provides an additional Yoast SEO tab for translation in your editor