Skip to content
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
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Changelog

## 1.5.0
* Feat: Add `More Plugins` options page.
* Fix: Added missing translations for existing languages.

## 1.4.3
* Tested up to WP 7.0.

Expand Down
5 changes: 4 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@
"email": "badasswpdev@gmail.com"
}
],
"require": {
"badasswp/pluginate": "^1.0"
},
"require-dev": {
"phpunit/phpunit": "^9.6",
"mockery/mockery": "^1.6",
Expand All @@ -40,4 +43,4 @@
"analyse": "vendor/bin/phpstan analyse --memory-limit=2048M",
"coverage": "XDEBUG_MODE=coverage vendor/bin/phpunit --coverage-cobertura cobertura.xml && coveralls --repo-token=lo7lxZfU7gVcSJwU7oXEx6qPZW8F9p7wt --file=cobertura.xml"
}
}
}
59 changes: 59 additions & 0 deletions inc/Services/Admin.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,27 @@
use SqlToCpt\Abstracts\Service;
use SqlToCpt\Interfaces\Kernel;

use Pluginate\Admin as Pluginate;

class Admin extends Service implements Kernel {
/**
* Pluginate instance.
*
* @since 1.5.0
*
* @var Pluginate
*/
public Pluginate $pluginate;

/**
* Admin constructor.
*
* @since 1.5.0
*/
public function __construct() {
$this->pluginate = new Pluginate( 'sql-to-cpt' );
}

/**
* Bind to WP.
*
Expand All @@ -23,6 +43,7 @@ class Admin extends Service implements Kernel {
*/
public function register(): void {
add_action( 'admin_menu', [ $this, 'register_admin_menu' ] );
add_action( 'admin_init', [ $this->pluginate, 'init' ] );
}

/**
Expand All @@ -44,6 +65,15 @@ public function register_admin_menu(): void {
'dashicons-database',
90
);

add_submenu_page(
'sql-to-cpt',
__( 'More Plugins', 'sql-to-cpt' ),
__( 'More Plugins', 'sql-to-cpt' ),
'manage_options',
sprintf( '%s-more-plugins', 'sql-to-cpt' ),
[ $this, 'register_more_plugins' ]
);
}

/**
Expand All @@ -69,4 +99,33 @@ public function register_admin_page(): void {
]
);
}

/**
* Register More Plugins.
*
* This controls the display of the
* "More Plugins" submenu page.
*
* @since 1.5.0
*
* @return void
*/
public function register_more_plugins(): void {
// phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
vprintf(
'<section class="wrap">
<h1>%s</h1>
<p>%s</p>
%s
</section>',
array_map(
'__',
[
'More Plugins',
'Check out some other amazing plugin of ours...',
$this->pluginate->get_more_plugins(),
]
)
);
}
}
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
{
"translation-revision-date": "2024-08-29 02:16+0100",
"translation-revision-date": "2024-10-06 00:17+0100",
"generator": "WP-CLI/2.6.0",
"source": "dist/app.js",
"domain": "messages",
"locale_data": {
"messages": {
"": {
"domain": "messages",
"lang": "ar\\n",
"plural-forms": "nplurals=2; plural=(n != 1);"
"lang": "ar",
"plural-forms": "nplurals=6; plural=(n==0 ? 0 : n==1 ? 1 : n==2 ? 2 : n%100>=3 && n%100<=10 ? 3 : n%100>=11 && n%100<=99 ? 4 : 5);"
},
"SQL to CPT": [
"SQL إلى CPT"
Expand All @@ -23,16 +22,25 @@
"استخدام SQL"
],
"Table": [
"جدول"
"الجدول"
],
"Columns": [
"اعمدة"
"الأعمدة"
],
"Importing SQL...": [
"جاري استيراد SQL..."
"جارٍ استيراد SQL..."
],
"Import Completed!": [
"اكتمل الاستيراد!"
],
"Upload SQL File": [
"رفع ملف SQL"
],
"Select CPT": [
"اختر CPT"
],
"Purge CPT": [
"حذف CPT"
]
}
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,18 +1,15 @@
{
"translation-revision-date": "2024-10-06 03:27+0100",
"translation-revision-date": "2026-06-22 20:30+0000",
"generator": "WP-CLI/2.6.0",
"source": "dist/app.js",
"domain": "messages",
"locale_data": {
"messages": {
"": {
"domain": "messages",
"lang": "da_DK\\n",
"plural-forms": "nplurals=2; plural=(n != 1);"
"plural-forms": "Plural-Forms: nplurals=2; plural=(n != 1);",
"lang": "da_DK"
},
"SQL to CPT": [
"SQL til CPT"
],
"Import SQL File": [
"Importer SQL-fil"
],
Expand All @@ -33,7 +30,16 @@
],
"Import Completed!": [
"Import fuldført!"
],
"Upload SQL File": [
"Upload SQL-fil"
],
"Select CPT": [
"Vælg CPT"
],
"Purge CPT": [
"Rens CPT"
]
}
}
}
}
Original file line number Diff line number Diff line change
@@ -1,26 +1,23 @@
{
"translation-revision-date": "2024-08-29 02:16+0100",
"translation-revision-date": "2026-06-22 20:30+0000",
"generator": "WP-CLI/2.6.0",
"source": "dist/app.js",
"domain": "messages",
"locale_data": {
"messages": {
"": {
"domain": "messages",
"lang": "de_DE\\n",
"plural-forms": "nplurals=2; plural=(n != 1);"
"plural-forms": "Plural-Forms: nplurals=2; plural=(n != 1);",
"lang": "de_DE"
},
"SQL to CPT": [
"SQL zu CPT"
],
"Import SQL File": [
"SQL-Datei importieren"
],
"Select SQL File": [
"SQL-Datei auswählen"
],
"Use SQL": [
"Verwenden von SQL"
"SQL verwenden"
],
"Table": [
"Tabelle"
Expand All @@ -32,7 +29,16 @@
"SQL wird importiert..."
],
"Import Completed!": [
"Import wurde abgeschlossen!"
"Import abgeschlossen!"
],
"Upload SQL File": [
"SQL-Datei hochladen"
],
"Select CPT": [
"CPT auswählen"
],
"Purge CPT": [
"CPT bereinigen"
]
}
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,23 +1,20 @@
{
"translation-revision-date": "2024-08-29 02:16+0100",
"translation-revision-date": "2026-06-22 20:30+0000",
"generator": "WP-CLI/2.6.0",
"source": "dist/app.js",
"domain": "messages",
"locale_data": {
"messages": {
"": {
"domain": "messages",
"lang": "es_ES\\n",
"plural-forms": "nplurals=2; plural=(n != 1);"
"plural-forms": "Plural-Forms: nplurals=2; plural=(n != 1);",
"lang": "es_ES"
},
"SQL to CPT": [
"De SQL a CPT"
],
"Import SQL File": [
"Importar archivo SQL"
],
"Select SQL File": [
"Seleccione Archivo SQL"
"Seleccionar archivo SQL"
],
"Use SQL": [
"Usar SQL"
Expand All @@ -29,10 +26,19 @@
"Columnas"
],
"Importing SQL...": [
"Importación de SQL..."
"Importando SQL..."
],
"Import Completed!": [
"Importación completada!"
"¡Importación completada!"
],
"Upload SQL File": [
"Subir archivo SQL"
],
"Select CPT": [
"Seleccionar CPT"
],
"Purge CPT": [
"Purgar CPT"
]
}
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,38 +1,41 @@
{
"translation-revision-date": "2024-08-29 02:16+0100",
"translation-revision-date": "2026-06-22 20:30+0000",
"generator": "WP-CLI/2.6.0",
"source": "dist/app.js",
"domain": "messages",
"locale_data": {
"messages": {
"": {
"domain": "messages",
"lang": "fr_FR\\n",
"plural-forms": "nplurals=2; plural=(n != 1);"
"plural-forms": "Plural-Forms: nplurals=2; plural=(n > 1);",
"lang": "fr_FR"
},
"SQL to CPT": [
"SQL vers CPT"
],
"Import SQL File": [
"Importer un fichier SQL"
],
"Select SQL File": [
"Sélectionnez Fichier SQL"
"Sélectionner un fichier SQL"
],
"Use SQL": [
"Utiliser SQL"
],
"Table": [
"Tableau"
],
"Columns": [
"Colonnes"
],
"Importing SQL...": [
"Importer SQL..."
"Importation SQL en cours..."
],
"Import Completed!": [
"Importation terminée avec succès !"
"Importation terminée !"
],
"Upload SQL File": [
"Téléverser un fichier SQL"
],
"Select CPT": [
"Sélectionner un CPT"
],
"Purge CPT": [
"Purger le CPT"
]
}
}
Expand Down
Loading
Loading