Skip to content

Commit

Permalink
Merge pull request #97 from pressidium/next
Browse files Browse the repository at this point in the history
1.7.0
  • Loading branch information
over-engineer authored Nov 18, 2024
2 parents 4dfbe2a + d1f9d35 commit 981cd64
Show file tree
Hide file tree
Showing 50 changed files with 172 additions and 96 deletions.
72 changes: 72 additions & 0 deletions includes/Migrator.php
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,73 @@ private function migrate_1_5_0(): void {
$this->settings['pressidium_options']['colors']['btn-floating-hover-icon'] = $btn_hover_icon;
}

/**
* Migrate settings coming from versions prior to 1.7.0.
*
* @SuppressWarnings(PHPMD.ExcessiveMethodLength)
*
* @return void
*/
private function migrate_1_7_0(): void {
$lang_codes_mapping = array(
'be' => 'bel',
'bg' => 'bg-BG',
'bn' => 'bn-BD',
'cs' => 'cs-CZ',
'da' => 'da-DK',
'en-ZA' => 'en-SA',
'gl' => 'gl-ES',
'gu' => 'gu-IN',
'he' => 'he-IL',
'hi' => 'hi-IN',
'hu' => 'hu-HU',
'id' => 'id-ID',
'is' => 'is-IS',
'it' => 'it-IT',
'ka' => 'ka-GE',
'kl' => 'kal',
'ko' => 'ko-KR',
'ky' => 'ky-KY',
'ln' => 'lin',
'lt' => 'lt-LT',
'mg' => 'mg-MG',
'mi' => 'mri',
'ml' => 'ml-IN',
'ms' => 'ms-MY',
'mt' => 'mlt',
'my' => 'my-MM',
'nl' => 'nl-NL',
'pa' => 'pa-IN',
'pl' => 'pl-PL',
'ro' => 'ro-RO',
'ru' => 'ru-RU',
'rw' => 'kin',
'sd' => 'sd-PK',
'sk' => 'sk-SK',
'sl' => 'sl-SI',
'sn' => 'sna',
'so' => 'so-SO',
'sr' => 'sr-RS',
'su' => 'su-ID',
'sv' => 'sv-SE',
'ta' => 'ta-IN',
'tk' => 'tuk',
'tr' => 'tr-TR',
'uz' => 'uz-UZ',
'xh' => 'xho',
'yo' => 'yor',
);

foreach ( $this->settings['languages'] as $lang => $lang_settings ) {
if ( ! array_key_exists( $lang, $lang_codes_mapping ) ) {
continue;
}

$this->settings['languages'][ $lang_codes_mapping[ $lang ] ] = $lang_settings;
unset( $this->settings['languages'][ $lang ] );
}
}

/**
* Migrate settings if necessary.
*
Expand Down Expand Up @@ -218,6 +285,11 @@ public function maybe_migrate(): array {
$this->migrate_1_5_0();
}

if ( version_compare( $this->settings['version'], '1.7.0', '<' ) ) {
// We are upgrading from a version prior to 1.7.0, so we need to migrate the settings
$this->migrate_1_7_0();
}

return $this->settings;
}

Expand Down
4 changes: 2 additions & 2 deletions pressidium-cookie-consent.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* Plugin Name: Pressidium Cookie Consent
* Plugin URI: https://github.com/pressidium/pressidium-cookie-consent/
* Description: Lightweight, user-friendly and customizable cookie consent banner to help you comply with the EU GDPR cookie law and CCPA regulations.
* Version: 1.6.0
* Version: 1.7.0
* Author: Pressidium
* Author URI: https://pressidium.com/
* Text Domain: pressidium-cookie-consent
Expand All @@ -27,7 +27,7 @@
*/
function setup_constants(): void {
if ( ! defined( 'Pressidium\WP\CookieConsent\VERSION' ) ) {
define( 'Pressidium\WP\CookieConsent\VERSION', '1.6.0' );
define( 'Pressidium\WP\CookieConsent\VERSION', '1.7.0' );
}

if ( ! defined( 'Pressidium\WP\CookieConsent\PLUGIN_DIR' ) ) {
Expand Down
8 changes: 6 additions & 2 deletions readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ Plugin URI: https://github.com/pressidium/pressidium-cookie-consent/
Contributors: pressidium, overengineer
Tags: cookie, consent, gdpr, ccpa, cookies
Requires at least: 6.0
Tested up to: 6.6
Tested up to: 6.7
Requires PHP: 7.4
Stable Tag: 1.6.0
Stable Tag: 1.7.0
License: GPLv2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html

Expand Down Expand Up @@ -173,6 +173,10 @@ If you have spotted any bugs, or would like to request additional features from

== Changelog ==

= 1.7.0: Nov 18, 2024 =

* Update language codes to be consistent with locale codes used in WordPress

= 1.6.0: Oct 21, 2024 =

* Add new color presets
Expand Down
90 changes: 45 additions & 45 deletions src/admin/components/Languages/icons.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,15 @@ export { default as arIcon } from './flags/language-ar.svg';
export { default as asIcon } from './flags/language-as.svg';
export { default as ayIcon } from './flags/language-ay.svg';
export { default as azIcon } from './flags/language-az.svg';
export { default as beIcon } from './flags/language-be.svg';
export { default as bgIcon } from './flags/language-bg.svg';
export { default as belIcon } from './flags/language-bel.svg';
export { default as bgBgIcon } from './flags/language-bg-bg.svg';
export { default as biIcon } from './flags/language-bi.svg';
export { default as bnIcon } from './flags/language-bn.svg';
export { default as bnBdIcon } from './flags/language-bn-bd.svg';
export { default as caIcon } from './flags/language-ca.svg';
export { default as coIcon } from './flags/language-co.svg';
export { default as csIcon } from './flags/language-cs.svg';
export { default as csCzIcon } from './flags/language-cs-cz.svg';
export { default as cyIcon } from './flags/language-cy.svg';
export { default as daIcon } from './flags/language-da.svg';
export { default as daDkIcon } from './flags/language-da-dk.svg';
export { default as deAtIcon } from './flags/language-de-at.svg';
export { default as deChIcon } from './flags/language-de-ch.svg';
export { default as deDeIcon } from './flags/language-de-de.svg';
Expand All @@ -26,7 +26,7 @@ export { default as enCaIcon } from './flags/language-en-ca.svg';
export { default as enGbIcon } from './flags/language-en-gb.svg';
export { default as enNzIcon } from './flags/language-en-nz.svg';
export { default as enUsIcon } from './flags/language-en-us.svg';
export { default as enZaIcon } from './flags/language-en-za.svg';
export { default as enSaIcon } from './flags/language-en-sa.svg';
export { default as enIcon } from './flags/language-en.svg';
export { default as esArIcon } from './flags/language-es-ar.svg';
export { default as esClIcon } from './flags/language-es-cl.svg';
Expand Down Expand Up @@ -54,89 +54,89 @@ export { default as frCaIcon } from './flags/language-fr-ca.svg';
export { default as frFrIcon } from './flags/language-fr-fr.svg';
export { default as frIcon } from './flags/language-fr.svg';
export { default as gaIcon } from './flags/language-ga.svg';
export { default as glIcon } from './flags/language-gl.svg';
export { default as glEsIcon } from './flags/language-gl-es.svg';
export { default as gnIcon } from './flags/language-gn.svg';
export { default as guIcon } from './flags/language-gu.svg';
export { default as haIcon } from './flags/language-ha.svg';
export { default as guInIcon } from './flags/language-gu-in.svg';
export { default as hauIcon } from './flags/language-hau.svg';
export { default as hawIcon } from './flags/language-haw.svg';
export { default as hawUsIcon } from './flags/language-haw-us.svg';
export { default as heIcon } from './flags/language-he.svg';
export { default as hiIcon } from './flags/language-hi.svg';
export { default as heIlIcon } from './flags/language-he-il.svg';
export { default as hiInIcon } from './flags/language-hi-in.svg';
export { default as hrIcon } from './flags/language-hr.svg';
export { default as huIcon } from './flags/language-hu.svg';
export { default as huHuIcon } from './flags/language-hu-hu.svg';
export { default as hyIcon } from './flags/language-hy.svg';
export { default as idIcon } from './flags/language-id.svg';
export { default as isIcon } from './flags/language-is.svg';
export { default as itIcon } from './flags/language-it.svg';
export { default as idIdIcon } from './flags/language-id-id.svg';
export { default as isIsIcon } from './flags/language-is-is.svg';
export { default as itItIcon } from './flags/language-it-it.svg';
export { default as jaIcon } from './flags/language-ja.svg';
export { default as kaIcon } from './flags/language-ka.svg';
export { default as kaGeIcon } from './flags/language-ka-ge.svg';
export { default as kalIcon } from './flags/language-kal.svg';
export { default as kinIcon } from './flags/language-kin.svg';
export { default as kkIcon } from './flags/language-kk.svg';
export { default as klIcon } from './flags/language-kl.svg';
export { default as kmIcon } from './flags/language-km.svg';
export { default as knIcon } from './flags/language-kn.svg';
export { default as koIcon } from './flags/language-ko.svg';
export { default as koKrIcon } from './flags/language-ko-kr.svg';
export { default as kuIcon } from './flags/language-ku.svg';
export { default as kyIcon } from './flags/language-ky.svg';
export { default as kyKyIcon } from './flags/language-ky-ky.svg';
export { default as laIcon } from './flags/language-la.svg';
export { default as lnIcon } from './flags/language-ln.svg';
export { default as linIcon } from './flags/language-lin.svg';
export { default as loIcon } from './flags/language-lo.svg';
export { default as ltIcon } from './flags/language-lt.svg';
export { default as ltLtIcon } from './flags/language-lt-lt.svg';
export { default as lvIcon } from './flags/language-lv.svg';
export { default as mgIcon } from './flags/language-mg.svg';
export { default as miIcon } from './flags/language-mi.svg';
export { default as mgMgIcon } from './flags/language-mg-mg.svg';
export { default as mriIcon } from './flags/language-mri.svg';
export { default as mkIcon } from './flags/language-mk.svg';
export { default as mlIcon } from './flags/language-ml.svg';
export { default as mlInIcon } from './flags/language-ml-in.svg';
export { default as mnIcon } from './flags/language-mn.svg';
export { default as mrIcon } from './flags/language-mr.svg';
export { default as msIcon } from './flags/language-ms.svg';
export { default as mtIcon } from './flags/language-mt.svg';
export { default as myIcon } from './flags/language-my.svg';
export { default as msMyIcon } from './flags/language-ms-my.svg';
export { default as mltIcon } from './flags/language-mlt.svg';
export { default as myMmIcon } from './flags/language-my-mm.svg';
export { default as naIcon } from './flags/language-na.svg';
export { default as nbNoIcon } from './flags/language-nb-no.svg';
export { default as neIcon } from './flags/language-ne.svg';
export { default as nlBeIcon } from './flags/language-nl-be.svg';
export { default as nlIcon } from './flags/language-nl.svg';
export { default as nlNlIcon } from './flags/language-nl-nl.svg';
export { default as noIcon } from './flags/language-no.svg';
export { default as paIcon } from './flags/language-pa.svg';
export { default as plIcon } from './flags/language-pl.svg';
export { default as paInIcon } from './flags/language-pa-in.svg';
export { default as plPlIcon } from './flags/language-pl-pl.svg';
export { default as psIcon } from './flags/language-ps.svg';
export { default as ptBrIcon } from './flags/language-pt-br.svg';
export { default as ptIcon } from './flags/language-pt.svg';
export { default as rnIcon } from './flags/language-rn.svg';
export { default as roIcon } from './flags/language-ro.svg';
export { default as ruIcon } from './flags/language-ru.svg';
export { default as rwIcon } from './flags/language-rw.svg';
export { default as sdIcon } from './flags/language-sd.svg';
export { default as roRoIcon } from './flags/language-ro-ro.svg';
export { default as ruRuIcon } from './flags/language-ru-ru.svg';
export { default as sdPkIcon } from './flags/language-sd-pk.svg';
export { default as sgIcon } from './flags/language-sg.svg';
export { default as siIcon } from './flags/language-si.svg';
export { default as skIcon } from './flags/language-sk.svg';
export { default as slIcon } from './flags/language-sl.svg';
export { default as skSkIcon } from './flags/language-sk-sk.svg';
export { default as slSiIcon } from './flags/language-sl-si.svg';
export { default as smIcon } from './flags/language-sm.svg';
export { default as snIcon } from './flags/language-sn.svg';
export { default as snaIcon } from './flags/language-sna.svg';
export { default as soIcon } from './flags/language-so.svg';
export { default as sqIcon } from './flags/language-sq.svg';
export { default as srIcon } from './flags/language-sr.svg';
export { default as srRsIcon } from './flags/language-sr-rs.svg';
export { default as ssIcon } from './flags/language-ss.svg';
export { default as stIcon } from './flags/language-st.svg';
export { default as suIcon } from './flags/language-su.svg';
export { default as svIcon } from './flags/language-sv.svg';
export { default as suIdIcon } from './flags/language-su-id.svg';
export { default as svSeIcon } from './flags/language-sv-se.svg';
export { default as swIcon } from './flags/language-sw.svg';
export { default as taInIcon } from './flags/language-ta-in.svg';
export { default as taLkIcon } from './flags/language-ta-lk.svg';
export { default as taIcon } from './flags/language-ta.svg';
export { default as teIcon } from './flags/language-te.svg';
export { default as tgIcon } from './flags/language-tg.svg';
export { default as thIcon } from './flags/language-th.svg';
export { default as tkIcon } from './flags/language-tk.svg';
export { default as tlIcon } from './flags/language-tl.svg';
export { default as tnIcon } from './flags/language-tn.svg';
export { default as toIcon } from './flags/language-to.svg';
export { default as trIcon } from './flags/language-tr.svg';
export { default as tukIcon } from './flags/language-tuk.svg';
export { default as ukIcon } from './flags/language-uk.svg';
export { default as urIcon } from './flags/language-ur.svg';
export { default as uzIcon } from './flags/language-uz.svg';
export { default as uzUzIcon } from './flags/language-uz-uz.svg';
export { default as viIcon } from './flags/language-vi.svg';
export { default as xhIcon } from './flags/language-xh.svg';
export { default as xhoIcon } from './flags/language-xho.svg';
export { default as yiIcon } from './flags/language-yi.svg';
export { default as yoIcon } from './flags/language-yo.svg';
export { default as yorIcon } from './flags/language-yor.svg';
export { default as zhIcon } from './flags/language-zh.svg';
export { default as zuIcon } from './flags/language-zu.svg';
Loading

0 comments on commit 981cd64

Please sign in to comment.