Skip to content

Commit

Permalink
Version 2.6.0
Browse files Browse the repository at this point in the history
  • Loading branch information
lloc committed Nov 27, 2023
1 parent 3b9cfa9 commit 667ae89
Show file tree
Hide file tree
Showing 10 changed files with 87 additions and 63 deletions.
7 changes: 7 additions & 0 deletions Changelog.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
## 2.6.0

* WordPress 6.4 tested
* Set PHP 7.4 as minimum requirement
* Set WordPress 5.6 as minimum requirement
* Blavatar fix

## 2.5.11

* CodeSniffer installed for compatibility check with PHP 8.1
Expand Down
4 changes: 2 additions & 2 deletions MultisiteLanguageSwitcher.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
* @wordpress-plugin
*
* Plugin Name: Multisite Language Switcher
* Version: 2.5.11
* Version: 2.6.0
* Plugin URI: http://msls.co/
* Description: A simple but powerful plugin that will help you to manage the relations of your contents in a multilingual multisite-installation.
* Author: Dennis Ploetner
Expand Down Expand Up @@ -40,7 +40,7 @@
* @author Dennis Ploetner <[email protected]>
*/
if ( ! defined( 'MSLS_PLUGIN_VERSION' ) ) {
define( 'MSLS_PLUGIN_VERSION', '2.5.11' );
define( 'MSLS_PLUGIN_VERSION', '2.6.0' );
define( 'MSLS_PLUGIN_PATH', plugin_basename( __FILE__ ) );
define( 'MSLS_PLUGIN__FILE__', __FILE__ );

Expand Down
2 changes: 1 addition & 1 deletion build/translations.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"license": "GPL-2.0-or-later",
"homepage": "http://msls.co",
"require": {
"php": ">=7.1.0",
"php": ">=7.4",
"composer/installers": "~1.12.0"
},
"require-dev": {
Expand Down
30 changes: 15 additions & 15 deletions css/flags.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,39 +31,39 @@
'cs_CZ' => 'flag-icon-cz',
'cy' => 'flag-icon-gb-ls',
'da_DK' => 'flag-icon-dk',
'de_DE_formal' => 'flag-icon-de',
'de_CH' => 'flag-icon-ch',
'de_AT' => 'flag-icon-at',
'de_CH_informal' => 'flag-icon-ch',
'de_DE_formal' => 'flag-icon-de',
'de_AT' => 'flag-icon-at',
'de_DE' => 'flag-icon-de',
'dzo' => 'flag-icon-bt',
'el' => 'flag-icon-gr',
'en_CA' => 'flag-icon-ca',
'en_GB' => 'flag-icon-gb',
'en_AU' => 'flag-icon-au',
'en_NZ' => 'flag-icon-nz',
'en_CA' => 'flag-icon-ca',
'en_ZA' => 'flag-icon-za',
'en_NZ' => 'flag-icon-nz',
'en_GB' => 'flag-icon-gb',
'eo' => 'flag-icon-eu',
'es_AR' => 'flag-icon-ar',
'es_ES' => 'flag-icon-es',
'es_VE' => 'flag-icon-ve',
'es_MX' => 'flag-icon-mx',
'es_EC' => 'flag-icon-ec',
'es_CO' => 'flag-icon-co',
'es_PE' => 'flag-icon-pe',
'es_EC' => 'flag-icon-ec',
'es_DO' => 'flag-icon-do',
'es_CL' => 'flag-icon-cl',
'es_PE' => 'flag-icon-pe',
'es_UY' => 'flag-icon-uy',
'es_CL' => 'flag-icon-cl',
'es_PR' => 'flag-icon-pr',
'es_CR' => 'flag-icon-cr',
'es_MX' => 'flag-icon-mx',
'es_GT' => 'flag-icon-gt',
'es_AR' => 'flag-icon-ar',
'es_CR' => 'flag-icon-cr',
'et' => 'flag-icon-ee',
'eu' => 'flag-icon-es',
'fa_IR' => 'flag-icon-ir',
'fa_AF' => 'flag-icon-af',
'fi' => 'flag-icon-fi',
'fr_FR' => 'flag-icon-fr',
'fr_CA' => 'flag-icon-ca',
'fr_FR' => 'flag-icon-fr',
'fr_BE' => 'flag-icon-be',
'fur' => 'flag-icon-it',
'gd' => 'flag-icon-gb-sct',
Expand Down Expand Up @@ -97,18 +97,18 @@
'my_MM' => 'flag-icon-mm',
'nb_NO' => 'flag-icon-no',
'ne_NP' => 'flag-icon-np',
'nl_NL' => 'flag-icon-nl',
'nl_BE' => 'flag-icon-be',
'nl_NL_formal' => 'flag-icon-nl',
'nl_NL' => 'flag-icon-nl',
'nn_NO' => 'flag-icon-no',
'oci' => 'flag-icon-es-ca',
'pa_IN' => 'flag-icon-in',
'pl_PL' => 'flag-icon-pl',
'ps' => 'flag-icon-af',
'pt_PT' => 'flag-icon-pt',
'pt_AO' => 'flag-icon-ao',
'pt_PT_ao90' => 'flag-icon-90',
'pt_PT' => 'flag-icon-pt',
'pt_BR' => 'flag-icon-br',
'pt_AO' => 'flag-icon-ao',
'ro_RO' => 'flag-icon-ro',
'ru_RU' => 'flag-icon-ru',
'sah' => 'flag-icon-ru',
Expand Down
30 changes: 15 additions & 15 deletions flags/flags.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,39 +31,39 @@
'cs_CZ' => 'cz.png',
'cy' => 'wales.png',
'da_DK' => 'dk.png',
'de_DE_formal' => 'de.png',
'de_CH' => 'ch.png',
'de_AT' => 'at.png',
'de_CH_informal' => 'ch.png',
'de_DE_formal' => 'de.png',
'de_AT' => 'at.png',
'de_DE' => 'de.png',
'dzo' => 'bt.png',
'el' => 'gr.png',
'en_CA' => 'ca.png',
'en_GB' => 'gb.png',
'en_AU' => 'au.png',
'en_NZ' => 'nz.png',
'en_CA' => 'ca.png',
'en_ZA' => 'za.png',
'en_NZ' => 'nz.png',
'en_GB' => 'gb.png',
'eo' => 'europeanunion.png',
'es_AR' => 'ar.png',
'es_ES' => 'es.png',
'es_VE' => 've.png',
'es_MX' => 'mx.png',
'es_EC' => 'ec.png',
'es_CO' => 'co.png',
'es_PE' => 'pe.png',
'es_EC' => 'ec.png',
'es_DO' => 'do.png',
'es_CL' => 'cl.png',
'es_PE' => 'pe.png',
'es_UY' => 'uy.png',
'es_CL' => 'cl.png',
'es_PR' => 'pr.png',
'es_CR' => 'cr.png',
'es_MX' => 'mx.png',
'es_GT' => 'gt.png',
'es_AR' => 'ar.png',
'es_CR' => 'cr.png',
'et' => 'ee.png',
'eu' => 'es.png',
'fa_IR' => 'ir.png',
'fa_AF' => 'af.png',
'fi' => 'fi.png',
'fr_FR' => 'fr.png',
'fr_CA' => 'ca.png',
'fr_FR' => 'fr.png',
'fr_BE' => 'be.png',
'fur' => 'it.png',
'gd' => 'scotland.png',
Expand Down Expand Up @@ -97,18 +97,18 @@
'my_MM' => 'mm.png',
'nb_NO' => 'no.png',
'ne_NP' => 'np.png',
'nl_NL' => 'nl.png',
'nl_BE' => 'be.png',
'nl_NL_formal' => 'nl.png',
'nl_NL' => 'nl.png',
'nn_NO' => 'no.png',
'oci' => 'catalonia.png',
'pa_IN' => 'in.png',
'pl_PL' => 'pl.png',
'ps' => 'af.png',
'pt_PT' => 'pt.png',
'pt_AO' => 'ao.png',
'pt_PT_ao90' => '90.png',
'pt_PT' => 'pt.png',
'pt_BR' => 'br.png',
'pt_AO' => 'ao.png',
'ro_RO' => 'ro.png',
'ru_RU' => 'ru.png',
'sah' => 'ru.png',
Expand Down
25 changes: 10 additions & 15 deletions includes/MslsOptionsQuery.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,43 +23,37 @@ class MslsOptionsQuery extends MslsOptions {
/**
* Factory method
*
* @codeCoverageIgnore
*
* @param int $id This parameter is unused here
*
* @return MslsOptionsQuery
* @return MslsOptionsQuery|null
*/
public static function create( $id = 0 ) {
$query = null;

if ( is_day() ) {
return new MslsOptionsQueryDay(
$query = new MslsOptionsQueryDay(
get_query_var( 'year' ),
get_query_var( 'monthnum' ),
get_query_var( 'day' )
);
}
elseif ( is_month() ) {
return new MslsOptionsQueryMonth(
$query = new MslsOptionsQueryMonth(
get_query_var( 'year' ),
get_query_var( 'monthnum' )
);
}
elseif ( is_year() ) {
return new MslsOptionsQueryYear(
get_query_var( 'year' )
);
$query = new MslsOptionsQueryYear( get_query_var( 'year' ) );
}
elseif ( is_author() ) {
return new MslsOptionsQueryAuthor(
get_queried_object_id()
);
$query = new MslsOptionsQueryAuthor( get_queried_object_id() );
}
elseif ( is_post_type_archive() ) {
return new MslsOptionsQueryPostType(
get_query_var( 'post_type' )
);
$query = new MslsOptionsQueryPostType( get_query_var( 'post_type' ) );
}

return null;
return $query;
}

/**
Expand All @@ -75,6 +69,7 @@ public function get_postlink( $language ) {
return apply_filters( 'check_url', $link, $this );
}
}

return '';
}

Expand Down
8 changes: 4 additions & 4 deletions readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@
Contributors: realloc, lucatume
Donate link: https://www.greenpeace.org/international/
Tags: multilingual, multisite, language, switcher, localization
Requires at least: 4.5.0
Tested up to: 6.3
Requires PHP: 7.1
Stable tag: 2.5.11
Requires at least: 5.3
Tested up to: 6.4
Requires PHP: 7.4
Stable tag: 2.6.0
License: GPLv2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html

Expand Down
15 changes: 13 additions & 2 deletions tests/test-mslscustomcolumntaxonomy.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,25 @@

class WP_Test_MslsCustomColumnTaxonomy extends Msls_UnitTestCase {

function test_th() {
public function test_th(): void {
$options = \Mockery::mock( MslsOptions::class );

$collection = \Mockery::mock( MslsBlogCollection::class );
$collection->shouldReceive( 'get' )->once()->andReturn( [] );
$collection->shouldReceive( 'get' )->andReturn( [] )->once();

$obj = new MslsCustomColumnTaxonomy( $options, $collection );

$this->assertEmpty( $obj->th( [] ) );
}

public function test_column_default(): void {
$options = \Mockery::mock( MslsOptions::class );

$collection = \Mockery::mock( MslsBlogCollection::class );

( new MslsCustomColumnTaxonomy( $options, $collection ) )->column_default( '', 'test', 0 );

$this->expectOutputString( '' );
}

}
27 changes: 19 additions & 8 deletions tests/test-mslsoptionsquery.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,18 +11,29 @@
*/
class WP_Test_MslsOptionsQuery extends Msls_UnitTestCase {

function get_test() {
public function test_create(): void {
Functions\expect( 'is_day' )->once()->andReturn( false );
Functions\expect( 'is_month' )->once()->andReturn( false );
Functions\expect( 'is_year' )->once()->andReturn( false );
Functions\expect( 'is_author' )->once()->andReturn( false );
Functions\expect( 'is_post_type_archive' )->once()->andReturn( false );

$this->assertNull( MslsOptionsQuery::create() );
}

public function test_current_get_postlink(): void {
$home_url = 'https://example.org/';

Functions\expect( 'get_option' )->once()->andReturn( [ 'de_DE' => 42 ] );
Functions\expect( 'home_url' )->once()->andReturn( $home_url );

return new MslsOptionsQuery();
$this->assertEquals( $home_url, ( new MslsOptionsQuery() )->get_postlink( 'de_DE' ) );
}

function test_get_current_link_method() {
Functions\expect( 'home_url' )->once()->andReturn( 'https://example.org/queried-object' );

$obj = $this->get_test();
public function test_non_existent_get_postlink(): void {
Functions\expect( 'get_option' )->once()->andReturn( [ 'de_DE' => 42 ] );

$this->assertEquals( 'https://example.org/queried-object', $obj->get_current_link() );
$this->assertEquals( '', ( new MslsOptionsQuery() )->get_postlink( 'fr_FR' ) );
}

}
}

0 comments on commit 667ae89

Please sign in to comment.