WPGlobus – Multilingual Everything! - Version 2.2.16

Version Description

2019-10-02 - version 2.2.16 * Added: (Vendor/Yoast) Filters for SEO Title, Meta Desc on edit.php page.

Download this release

Release Info

Developer tivnet
Plugin Icon 128x128 WPGlobus – Multilingual Everything!
Version 2.2.16
Comparing to
See all releases

Code changes from version 2.2.15 to 2.2.16

data/wpglobus-product-info.json CHANGED
@@ -1 +1 @@
1
- {"multilingual-woocommerce-nets-netaxept":{"title":"{:en}Multilingual WooCommerce Nets Netaxept{:}{:ru}\u041c\u0443\u043b\u044c\u0442\u0438\u044f\u0437\u044b\u0447\u043d\u043e\u0441\u0442\u044c \u0434\u043b\u044f WooCommerce Nets Netaxept{:}","_api_new_version":"1.0.3","_api_tested_up_to":"4.9.8"},"wpglobus-menu-visibility":{"title":"WPGlobus Menu Visibility","_api_new_version":"1.2.0","_api_tested_up_to":"4.9.6"},"wpglobus-multi-currency":{"title":"{:en}WPGlobus Multi-Currency for WooCommerce{:}{:ru}WPGlobus - \u041c\u0443\u043b\u044c\u0442\u0438\u0432\u0430\u043b\u044e\u0442\u043d\u043e\u0441\u0442\u044c \u0434\u043b\u044f WooCommerce{:}","_api_new_version":"1.1.1","_api_tested_up_to":"4.9.4"},"wpglobus-language-widgets":{"title":"{:en}WPGlobus Language Widgets{:}{:ru}\u042f\u0437\u044b\u043a\u0438 WPGlobus \u0434\u043b\u044f \u0432\u0438\u0434\u0436\u0435\u0442\u043e\u0432{:}","_api_new_version":"1.1.0","_api_tested_up_to":"4.9.8"},"wpglobus-header-images":{"title":"{:en}WPGlobus Header Images{:}{:ru}WPGlobus Header Images{:}","_api_new_version":"2.0.0","_api_tested_up_to":"5.0.4"},"wpglobus-multilingual-notices":{"title":"{:en}WPGlobus Multilingual Notices{:}{:ru}WPGlobus - \u043c\u043d\u043e\u0433\u043e\u044f\u0437\u044b\u0447\u043d\u044b\u0435 \u0443\u0432\u0435\u0434\u043e\u043c\u043b\u0435\u043d\u0438\u044f{:}","_api_new_version":"1.0.0","_api_tested_up_to":"5.1"},"wpglobus-mobile-menu":{"title":"{:en}WPGlobus Mobile Menu{:}{:ru}WPGlobus Mobile Menu{:}","_api_new_version":"2.0.0","_api_tested_up_to":"5.2"},"wpglobus-for-bridge-theme":{"title":"{:en}WPGlobus for the \"Bridge\" theme{:}{:ru}WPGlobus \u0434\u043b\u044f \u0442\u0435\u043c\u044b Bridge{:}","_api_new_version":"2.2.0","_api_tested_up_to":"5.2"},"wpglobus-plus":{"title":"{:en}WPGlobus Plus multilingual extension{:}{:ru}WPGlobus \u041f\u043b\u044e\u0441{:}","_api_new_version":"1.1.57","_api_tested_up_to":"5.2"},"woocommerce-wpglobus":{"title":"{:en}WPGlobus for WooCommerce{:}{:ru}\u0420\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u0438\u0435 WooCommerce WPGlobus{:}","_api_new_version":"3.5.1","_api_tested_up_to":"5.2"}}
1
+ {"multilingual-woocommerce-nets-netaxept":{"title":"{:en}Multilingual WooCommerce Nets Netaxept{:}{:ru}\u041c\u0443\u043b\u044c\u0442\u0438\u044f\u0437\u044b\u0447\u043d\u043e\u0441\u0442\u044c \u0434\u043b\u044f WooCommerce Nets Netaxept{:}","_api_new_version":"1.0.3","_api_tested_up_to":"4.9.8"},"wpglobus-menu-visibility":{"title":"WPGlobus Menu Visibility","_api_new_version":"1.2.0","_api_tested_up_to":"4.9.6"},"wpglobus-multi-currency":{"title":"{:en}WPGlobus Multi-Currency for WooCommerce{:}{:ru}WPGlobus - \u041c\u0443\u043b\u044c\u0442\u0438\u0432\u0430\u043b\u044e\u0442\u043d\u043e\u0441\u0442\u044c \u0434\u043b\u044f WooCommerce{:}","_api_new_version":"1.1.1","_api_tested_up_to":"4.9.4"},"wpglobus-language-widgets":{"title":"{:en}WPGlobus Language Widgets{:}{:ru}\u042f\u0437\u044b\u043a\u0438 WPGlobus \u0434\u043b\u044f \u0432\u0438\u0434\u0436\u0435\u0442\u043e\u0432{:}","_api_new_version":"1.1.0","_api_tested_up_to":"4.9.8"},"wpglobus-header-images":{"title":"{:en}WPGlobus Header Images{:}{:ru}WPGlobus Header Images{:}","_api_new_version":"2.0.0","_api_tested_up_to":"5.0.4"},"wpglobus-multilingual-notices":{"title":"{:en}WPGlobus Multilingual Notices{:}{:ru}WPGlobus - \u043c\u043d\u043e\u0433\u043e\u044f\u0437\u044b\u0447\u043d\u044b\u0435 \u0443\u0432\u0435\u0434\u043e\u043c\u043b\u0435\u043d\u0438\u044f{:}","_api_new_version":"1.0.0","_api_tested_up_to":"5.1"},"wpglobus-mobile-menu":{"title":"{:en}WPGlobus Mobile Menu{:}{:ru}WPGlobus Mobile Menu{:}","_api_new_version":"2.0.0","_api_tested_up_to":"5.2"},"wpglobus-for-bridge-theme":{"title":"{:en}WPGlobus for the \"Bridge\" theme{:}{:ru}WPGlobus \u0434\u043b\u044f \u0442\u0435\u043c\u044b Bridge{:}","_api_new_version":"2.2.0","_api_tested_up_to":"5.2"},"woocommerce-wpglobus":{"title":"{:en}WPGlobus for WooCommerce{:}{:ru}\u0420\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u0438\u0435 WooCommerce WPGlobus{:}","_api_new_version":"3.5.1","_api_tested_up_to":"5.2"},"wpglobus-plus":{"title":"{:en}WPGlobus Plus multilingual extension{:}{:ru}WPGlobus \u041f\u043b\u044e\u0441{:}","_api_new_version":"1.1.59","_api_tested_up_to":"5.3"}}
includes/vendor/yoast-seo/class-wpglobus-yoastseo80.php CHANGED
@@ -39,6 +39,14 @@ class WPGlobus_YoastSEO {
39
  * @var string
40
  */
41
  protected static $version = '';
 
 
 
 
 
 
 
 
42
 
43
  /**
44
  * Static "controller"
@@ -49,8 +57,33 @@ class WPGlobus_YoastSEO {
49
 
50
  if ( is_admin() ) {
51
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
52
  /**
53
- * Don't start in admin @since 1.9.17
54
  */
55
  return;
56
 
@@ -351,6 +384,108 @@ class WPGlobus_YoastSEO {
351
  return 'tinymce';
352
  }
353
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
354
  /**
355
  * To translate Yoast columns
356
  * @see WPSEO_Meta_Columns::column_content
39
  * @var string
40
  */
41
  protected static $version = '';
42
+
43
+ /**
44
+ * Contains wpseo meta.
45
+ *
46
+ * @since 2.2.16
47
+ * @var null|array
48
+ */
49
+ protected static $wpseo_meta = null;
50
 
51
  /**
52
  * Static "controller"
57
 
58
  if ( is_admin() ) {
59
 
60
+ if ( WPGlobus_WP::is_pagenow( 'edit.php' ) ) {
61
+
62
+ /**
63
+ * To translate Yoast columns on `edit.php` page.
64
+ * @since 2.2.16
65
+ */
66
+
67
+ add_filter( 'wpseo_title', array(
68
+ __CLASS__,
69
+ 'filter__wpseo_title'
70
+ ), 5 );
71
+
72
+
73
+ add_filter( 'wpseo_metadesc', array(
74
+ __CLASS__,
75
+ 'filter__wpseo_metadesc'
76
+ ), 5 );
77
+
78
+ /**
79
+ * @W.I.P @since 2.2.16 with 'wpseo-focuskw'. There is no filter.
80
+ * @see case 'wpseo-focuskw': in wordpress-seo\admin\class-meta-columns.php
81
+ */
82
+
83
+ }
84
+
85
  /**
86
+ * Don't run further in admin @since 1.9.17
87
  */
88
  return;
89
 
384
  return 'tinymce';
385
  }
386
 
387
+ /**
388
+ * Filter wpseo meta description.
389
+ *
390
+ * @see wordpress-seo\admin\class-meta-columns.php
391
+ * @scope admin
392
+ * @since 2.2.16
393
+ *
394
+ * @param string $metadesc_val Value in default language.
395
+ *
396
+ * @return string
397
+ */
398
+ public static function filter__wpseo_metadesc( $metadesc_val ) {
399
+
400
+ if ( empty($metadesc_val) ) {
401
+ return $metadesc_val;
402
+ }
403
+
404
+ if ( WPGlobus::Config()->language == WPGlobus::Config()->default_language ) {
405
+ return $metadesc_val;
406
+ }
407
+
408
+ return self::get_meta( '_yoast_wpseo_metadesc', $metadesc_val );
409
+ }
410
+
411
+ /**
412
+ * To translate Yoast `column-wpseo-title`.
413
+ *
414
+ * @see wordpress-seo\admin\class-meta-columns.php
415
+ * @scope admin
416
+ * @since 2.2.16
417
+ *
418
+ * @param string $title
419
+ *
420
+ * @return string
421
+ */
422
+ public static function filter__wpseo_title( $title ) {
423
+ return WPGlobus_Core::extract_text( $title, WPGlobus::Config()->language );
424
+ }
425
+
426
+ /**
427
+ * Get meta for extra language.
428
+ *
429
+ * @scope admin
430
+ * @since 2.2.16
431
+ */
432
+ protected static function get_meta( $meta_key, $meta_value = '' ) {
433
+
434
+ if ( is_null(self::$wpseo_meta) ) {
435
+ self::set_wpseo_meta();
436
+ }
437
+
438
+ if ( empty( self::$wpseo_meta[ $meta_key ] ) ) {
439
+ return '';
440
+ }
441
+
442
+ $_return_value = '';
443
+ foreach( self::$wpseo_meta[ $meta_key ] as $_meta_value ) {
444
+ if ( false !== strpos( $_meta_value, $meta_value ) ) {
445
+ $_return_value = WPGlobus_Core::text_filter( $_meta_value, WPGlobus::Config()->language, WPGlobus::RETURN_EMPTY );
446
+ break;
447
+ }
448
+ }
449
+
450
+ return $_return_value;
451
+ }
452
+
453
+ /**
454
+ * Set `_yoast_wpseo_metadesc`, `_yoast_wpseo_focuskw` meta.
455
+ *
456
+ * @scope admin
457
+ * @since 2.2.16
458
+ */
459
+ protected static function set_wpseo_meta() {
460
+
461
+ /** @global wpdb $wpdb */
462
+ global $wpdb;
463
+
464
+ $post_type = 'post';
465
+ if ( ! empty( $_GET['post_type'] ) ) {
466
+ $post_type = sanitize_text_field( $_GET['post_type'] ); // phpcs:ignore WordPress.CSRF.NonceVerification
467
+ }
468
+
469
+ $query = $wpdb->prepare(
470
+ "SELECT p.ID, p.post_type, pm.meta_key, pm.meta_value FROM {$wpdb->prefix}posts AS p JOIN {$wpdb->prefix}postmeta AS pm ON p.ID = pm.post_id WHERE p.post_type = %s AND (pm.meta_key = %s OR pm.meta_key = %s)",
471
+ $post_type,
472
+ '_yoast_wpseo_metadesc',
473
+ '_yoast_wpseo_focuskw'
474
+ );
475
+
476
+ $metas = $wpdb->get_results( $query, ARRAY_A );
477
+
478
+ if ( ! empty( $metas ) ) {
479
+ foreach( $metas as $_meta ) {
480
+ if ( ! isset( self::$wpseo_meta[ $_meta['meta_key'] ] ) ) {
481
+ self::$wpseo_meta[ $_meta['meta_key'] ] = array();
482
+ }
483
+ self::$wpseo_meta[ $_meta['meta_key'] ][] = $_meta['meta_value'];
484
+ }
485
+ }
486
+
487
+ }
488
+
489
  /**
490
  * To translate Yoast columns
491
  * @see WPSEO_Meta_Columns::column_content
languages/wpglobus.pot CHANGED
@@ -1,8 +1,8 @@
1
- # Copyright (C) 2019 WPGlobus 2.2.15
2
- # This file is distributed under the same license as the WPGlobus 2.2.15 package.
3
  msgid ""
4
  msgstr ""
5
- "Project-Id-Version: WPGlobus 2.2.15\n"
6
  "MIME-Version: 1.0\n"
7
  "Content-Type: text/plain; charset=UTF-8\n"
8
  "Content-Transfer-Encoding: 8bit\n"
1
+ # Copyright (C) 2019 WPGlobus 2.2.16
2
+ # This file is distributed under the same license as the WPGlobus 2.2.16 package.
3
  msgid ""
4
  msgstr ""
5
+ "Project-Id-Version: WPGlobus 2.2.16\n"
6
  "MIME-Version: 1.0\n"
7
  "Content-Type: text/plain; charset=UTF-8\n"
8
  "Content-Transfer-Encoding: 8bit\n"
readme.txt CHANGED
@@ -3,7 +3,7 @@ Contributors: tivnetinc, alexgff, tivnet
3
  Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=SLF8M4YNZHNQN
4
  Tags: WPGlobus, localization, multilanguage, multilingual, translate
5
  Requires at least: 4.9
6
- Tested up to: 5.2
7
  Requires PHP: 5.6
8
  Stable tag: trunk
9
  License: GPL-3.0-or-later
@@ -218,7 +218,12 @@ WPGlobus Version 2 supports WordPress 5.x, with Gutenberg.
218
 
219
  == Changelog ==
220
 
221
- = 2.2.14 =
 
 
 
 
 
222
 
223
  * Fixed: (Builders/Gutenberg) TypeError `Cannot read property 'PluginSidebarMoreMenuItem' of undefined`.
224
 
3
  Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=SLF8M4YNZHNQN
4
  Tags: WPGlobus, localization, multilanguage, multilingual, translate
5
  Requires at least: 4.9
6
+ Tested up to: 5.3
7
  Requires PHP: 5.6
8
  Stable tag: trunk
9
  License: GPL-3.0-or-later
218
 
219
  == Changelog ==
220
 
221
+ = 2.2.16 =
222
+
223
+ 2019-10-02 - version 2.2.16
224
+ * Added: (Vendor/Yoast) Filters for `SEO Title`, `Meta Desc` on `edit.php` page.
225
+
226
+ = 2.2.15 =
227
 
228
  * Fixed: (Builders/Gutenberg) TypeError `Cannot read property 'PluginSidebarMoreMenuItem' of undefined`.
229
 
wpglobus.php CHANGED
@@ -15,7 +15,7 @@
15
  * Description: A WordPress Globalization / Multilingual Plugin. Posts, pages, menus, widgets and even custom fields - in multiple languages!
16
  * Text Domain: wpglobus
17
  * Domain Path: /languages/
18
- * Version: 2.2.15
19
  * Author: WPGlobus
20
  * Author URI: https://wpglobus.com/
21
  * Network: false
@@ -42,7 +42,7 @@ if ( ! defined( 'ABSPATH' ) ) {
42
  exit;
43
  }
44
 
45
- define( 'WPGLOBUS_VERSION', '2.2.15' );
46
  define( 'WPGLOBUS_PLUGIN_BASENAME', plugin_basename( __FILE__ ) );
47
  define( 'WPGLOBUS_AJAX', 'wpglobus-ajax' );
48
 
15
  * Description: A WordPress Globalization / Multilingual Plugin. Posts, pages, menus, widgets and even custom fields - in multiple languages!
16
  * Text Domain: wpglobus
17
  * Domain Path: /languages/
18
+ * Version: 2.2.16
19
  * Author: WPGlobus
20
  * Author URI: https://wpglobus.com/
21
  * Network: false
42
  exit;
43
  }
44
 
45
+ define( 'WPGLOBUS_VERSION', '2.2.16' );
46
  define( 'WPGLOBUS_PLUGIN_BASENAME', plugin_basename( __FILE__ ) );
47
  define( 'WPGLOBUS_AJAX', 'wpglobus-ajax' );
48