Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TX-15880: Exclude lang_code from urls of images uploaded to Wordpress #291

Merged
merged 2 commits into from
Oct 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ jobs:
MYSQL_ALLOW_EMPTY_PASSWORD: "yes"

env:
PLUGIN_VERSION: 1.3.45
PLUGIN_VERSION: 1.3.46
WP_PROJECT_TYPE: plugin
WP_VERSION: latest
WP_MULTISITE: 0
Expand Down
4 changes: 3 additions & 1 deletion includes/lib/transifex-live-integration-rewrite.php
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,9 @@ function reverse_hard_link( $lang, $link, $languages_map, $source_lang, $pattern
$parsed_url = parse_url($link);
$link_host = isset($parsed_url['host']) ? $parsed_url['host'] : '';
// change only wordpress non-admin links - not links reffering to other domains
if ( $link_host === $site_host && strpos($link, '/wp-admin') === false ) {
if ( $link_host === $site_host && strpos($link, '/wp-admin') === false
&& strpos($link, '/wp-content/uploads') === false
) {
/* Check if the path starts with the language code,
* otherwise prepend it. */
$parsed = parse_url( $link );
Expand Down
3 changes: 3 additions & 0 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,9 @@ Ex. $updated_content = apply_filters('tx_link', $original_content);
* It is also recommended to use [widgets](https://codex.wordpress.org/Widgets_API) in your theme instead of custom code, since this allows you to make your integration more future proof against incompatibilities with 3rd party modules.

== Changelog ==
= 1.3.46 =
Exclude wordpress uploaded images from subdirectories

= 1.3.45 =
Add support for custom post links hook

Expand Down
5 changes: 4 additions & 1 deletion readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Contributors: txmatthew, ThemeBoy, brooksx
Tags: transifex, localize, localization, multilingual, international, SEO
Requires at least: 3.5.2
Tested up to: 6.5.3
Stable tag: 1.3.45
Stable tag: 1.3.46
License: GPLv2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html

Expand Down Expand Up @@ -78,6 +78,9 @@ Ex. $updated_content = apply_filters('tx_link', $original_content);
It is also recommended to use [widgets](https://codex.wordpress.org/Widgets_API) in your theme instead of custom code, since this allows you to make your integration more future proof against incompatibilities with 3rd party modules.

== Changelog ==
= 1.3.46 =
Exclude wordpress uploaded images from subdirectories

= 1.3.45 =
Add support for custom post links hook

Expand Down
6 changes: 3 additions & 3 deletions transifex-live-integration.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@
*
* @link https://help.transifex.com/en/articles/6261241-wordpress
* @package TransifexLiveIntegration
* @version 1.3.45
* @version 1.3.46
*
* @wordpress-plugin
* Plugin Name: International SEO by Transifex
* Plugin URI: https://help.transifex.com/en/articles/6261241-wordpress
* Description: Translate your WordPress powered website using Transifex.
* Version: 1.3.45
* Version: 1.3.46
* License: GNU General Public License
* License URI: http://www.gnu.org/licenses/gpl-2.0.txt
* Text Domain: transifex-live-integration
Expand Down Expand Up @@ -75,7 +75,7 @@
}

define( 'LANG_PARAM', 'lang' );
$version = '1.3.45';
$version = '1.3.46';

require_once( dirname( __FILE__ ) . '/transifex-live-integration-main.php' );
Transifex_Live_Integration::do_plugin( is_admin(), $version );
Loading