diff --git a/.mokogitea/workflows/issue-branch.yml b/.mokogitea/workflows/issue-branch.yml index f747342..c6824bc 100644 --- a/.mokogitea/workflows/issue-branch.yml +++ b/.mokogitea/workflows/issue-branch.yml @@ -5,7 +5,7 @@ # FILE INFORMATION # DEFGROUP: Gitea.Workflow # INGROUP: mokocli.Automation -# VERSION: 01.07.05 +# VERSION: 01.07.09 # BRIEF: Auto-create feature branch when an issue is opened name: "Universal: Issue Branch" diff --git a/CHANGELOG.md b/CHANGELOG.md index ca9b8cd..c0548e9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,7 +4,7 @@ All notable changes to MokoSuiteOpenGraph will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/). - + ## [Unreleased] diff --git a/CODE_OF_CONDUCT.md b/CODE_OF_CONDUCT.md index efc28f4..b9eb463 100644 --- a/CODE_OF_CONDUCT.md +++ b/CODE_OF_CONDUCT.md @@ -14,7 +14,7 @@ DEFGROUP: Template-Joomla INGROUP: Template-Joomla.Documentation REPO: https://github.com/mokoconsulting-tech/Template-Joomla/ - VERSION: 01.07.05 + VERSION: 01.07.09 PATH: ./CODE_OF_CONDUCT.md BRIEF: Community expectations and enforcement guidelines NOTE: Adapted with attribution from the Contributor Covenant v2.1 diff --git a/GOVERNANCE.md b/GOVERNANCE.md index 8c2169b..f554708 100644 --- a/GOVERNANCE.md +++ b/GOVERNANCE.md @@ -19,7 +19,7 @@ DEFGROUP: mokoconsulting-tech.Template-Joomla INGROUP: MokoStandards.Governance REPO: https://github.com/mokoconsulting-tech/Template-Joomla - VERSION: 01.07.05 + VERSION: 01.07.09 PATH: /GOVERNANCE.md BRIEF: Project governance rules, roles, and decision process for Template-Joomla --> diff --git a/README.md b/README.md index 7c7f84f..2bd7763 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # MokoSuiteOpenGraph - + Open Graph, Twitter Card, and social sharing meta tag management for Joomla 6 and higher. diff --git a/SECURITY.md b/SECURITY.md index 6b6da73..b152f79 100644 --- a/SECURITY.md +++ b/SECURITY.md @@ -23,7 +23,7 @@ DEFGROUP: Template-Joomla INGROUP: Template-Joomla.Documentation REPO: https://git.mokoconsulting.tech/MokoConsulting/Template-Joomla PATH: /SECURITY.md -VERSION: 01.07.05 +VERSION: 01.07.09 BRIEF: Security vulnerability reporting and handling policy --> diff --git a/source/packages/com_mokoog/language/en-GB/com_mokoog.sys.ini b/source/packages/com_mokoog/language/en-GB/com_mokoog.sys.ini index 0e382dd..49acd54 100644 --- a/source/packages/com_mokoog/language/en-GB/com_mokoog.sys.ini +++ b/source/packages/com_mokoog/language/en-GB/com_mokoog.sys.ini @@ -3,4 +3,5 @@ ; License: GPL-3.0-or-later COM_MOKOOG="MokoSuiteOpenGraph" +COM_MOKOOG_SHORT="OpenGraph" COM_MOKOOG_DESCRIPTION="Manage Open Graph and social sharing tags for all your content. View, edit, and batch-process OG metadata." diff --git a/source/packages/com_mokoog/mokoog.xml b/source/packages/com_mokoog/mokoog.xml index 3d98fd5..251df00 100644 --- a/source/packages/com_mokoog/mokoog.xml +++ b/source/packages/com_mokoog/mokoog.xml @@ -8,7 +8,7 @@ --> com_mokoog - 01.07.05 + 01.07.09 2026-05-23 Moko Consulting hello@mokoconsulting.tech @@ -71,7 +71,7 @@ access.xml config.xml - COM_MOKOOG + COM_MOKOOG_SHORT COM_MOKOOG_SUBMENU_DASHBOARD COM_MOKOOG_SUBMENU_TAGS diff --git a/source/packages/com_mokoog/script.php b/source/packages/com_mokoog/script.php index cf2cc39..75ba03a 100644 --- a/source/packages/com_mokoog/script.php +++ b/source/packages/com_mokoog/script.php @@ -1,119 +1,119 @@ - - * @copyright Copyright (C) 2026 Moko Consulting. All rights reserved. - * @license GNU General Public License version 3 or later; see LICENSE - */ - -defined('_JEXEC') or die; - -use Joomla\CMS\Factory; -use Joomla\CMS\Installer\InstallerAdapter; - -class Com_MokoOGInstallerScript -{ - /** - * Called after install. - * - * @param InstallerAdapter $parent Installer adapter - * - * @return void - */ - public function install(InstallerAdapter $parent): void - { - // Be smart: verify EVERY table the component's own install SQL declares is - // actually present. If any are missing the install did not complete — say - // so instead of showing "installed successfully". - $missing = $this->missingTables(); - - if ($missing !== []) { - $detail = count($missing) > 6 - ? count($missing) . ' expected database tables are missing' - : 'missing tables: ' . htmlspecialchars(implode(', ', $missing), ENT_QUOTES, 'UTF-8'); - - Factory::getApplication()->enqueueMessage( - 'MokoSuiteOpenGraph did not install correctly. ' . $detail - . ' — review the errors above, then reinstall.', - 'error' - ); - - return; - } - - Factory::getApplication()->enqueueMessage('

MokoSuiteOpenGraph installed successfully!

', 'info'); - } - - /** - * Called after update. - * - * @param InstallerAdapter $parent Installer adapter - * - * @return void - */ - public function update(InstallerAdapter $parent): void - { - // Same smart check on update: only report success if the schema is intact. - $missing = $this->missingTables(); - - if ($missing !== []) { - $detail = count($missing) > 6 - ? count($missing) . ' expected database tables are missing' - : 'missing tables: ' . htmlspecialchars(implode(', ', $missing), ENT_QUOTES, 'UTF-8'); - - Factory::getApplication()->enqueueMessage( - 'MokoSuiteOpenGraph did not update correctly. ' . $detail - . ' — review the errors above.', - 'error' - ); - - return; - } - - Factory::getApplication()->enqueueMessage('MokoSuiteOpenGraph updated successfully.', 'info'); - } - - /** - * Smart schema check: parse the component's own installed install SQL for every - * CREATE TABLE, then return the ones missing from the database. An empty array - * means the full schema installed. Fails open (returns []) if the SQL can't be - * read, so a good install is never flagged as failed. - * - * @return string[] Names (without the #__ prefix) of missing tables. - */ - private function missingTables(): array - { - try { - $sqlFile = JPATH_ADMINISTRATOR . '/components/com_mokoog/sql/install.mysql.sql'; - - if (!is_file($sqlFile)) { - return []; - } - - $sql = file_get_contents($sqlFile); - - if ($sql === false - || !preg_match_all('/CREATE\s+TABLE\s+(?:IF\s+NOT\s+EXISTS\s+)?[`"\']?(#__[A-Za-z0-9_]+)/i', $sql, $m)) { - return []; - } - - $db = Factory::getDbo(); - $prefix = strtolower($db->getPrefix()); - $have = array_map('strtolower', $db->getTableList()); - $missing = []; - - foreach (array_unique($m[1]) as $decl) { - $bare = substr($decl, 3); // strip "#__" - if (!in_array($prefix . strtolower($bare), $have, true)) { - $missing[] = $bare; - } - } - - return $missing; - } catch (\Throwable $e) { - return []; - } - } -} + + * @copyright Copyright (C) 2026 Moko Consulting. All rights reserved. + * @license GNU General Public License version 3 or later; see LICENSE + */ + +defined('_JEXEC') or die; + +use Joomla\CMS\Factory; +use Joomla\CMS\Installer\InstallerAdapter; + +class Com_MokoOGInstallerScript +{ + /** + * Called after install. + * + * @param InstallerAdapter $parent Installer adapter + * + * @return void + */ + public function install(InstallerAdapter $parent): void + { + // Be smart: verify EVERY table the component's own install SQL declares is + // actually present. If any are missing the install did not complete — say + // so instead of showing "installed successfully". + $missing = $this->missingTables(); + + if ($missing !== []) { + $detail = count($missing) > 6 + ? count($missing) . ' expected database tables are missing' + : 'missing tables: ' . htmlspecialchars(implode(', ', $missing), ENT_QUOTES, 'UTF-8'); + + Factory::getApplication()->enqueueMessage( + 'MokoSuiteOpenGraph did not install correctly. ' . $detail + . ' — review the errors above, then reinstall.', + 'error' + ); + + return; + } + + Factory::getApplication()->enqueueMessage('

MokoSuiteOpenGraph installed successfully!

', 'info'); + } + + /** + * Called after update. + * + * @param InstallerAdapter $parent Installer adapter + * + * @return void + */ + public function update(InstallerAdapter $parent): void + { + // Same smart check on update: only report success if the schema is intact. + $missing = $this->missingTables(); + + if ($missing !== []) { + $detail = count($missing) > 6 + ? count($missing) . ' expected database tables are missing' + : 'missing tables: ' . htmlspecialchars(implode(', ', $missing), ENT_QUOTES, 'UTF-8'); + + Factory::getApplication()->enqueueMessage( + 'MokoSuiteOpenGraph did not update correctly. ' . $detail + . ' — review the errors above.', + 'error' + ); + + return; + } + + Factory::getApplication()->enqueueMessage('MokoSuiteOpenGraph updated successfully.', 'info'); + } + + /** + * Smart schema check: parse the component's own installed install SQL for every + * CREATE TABLE, then return the ones missing from the database. An empty array + * means the full schema installed. Fails open (returns []) if the SQL can't be + * read, so a good install is never flagged as failed. + * + * @return string[] Names (without the #__ prefix) of missing tables. + */ + private function missingTables(): array + { + try { + $sqlFile = JPATH_ADMINISTRATOR . '/components/com_mokoog/sql/install.mysql.sql'; + + if (!is_file($sqlFile)) { + return []; + } + + $sql = file_get_contents($sqlFile); + + if ($sql === false + || !preg_match_all('/CREATE\s+TABLE\s+(?:IF\s+NOT\s+EXISTS\s+)?[`"\']?(#__[A-Za-z0-9_]+)/i', $sql, $m)) { + return []; + } + + $db = Factory::getDbo(); + $prefix = strtolower($db->getPrefix()); + $have = array_map('strtolower', $db->getTableList()); + $missing = []; + + foreach (array_unique($m[1]) as $decl) { + $bare = substr($decl, 3); // strip "#__" + if (!in_array($prefix . strtolower($bare), $have, true)) { + $missing[] = $bare; + } + } + + return $missing; + } catch (\Throwable $e) { + return []; + } + } +} diff --git a/source/packages/com_mokoog/sql/updates/mysql/01.07.07.sql b/source/packages/com_mokoog/sql/updates/mysql/01.07.07.sql new file mode 100644 index 0000000..8f086aa --- /dev/null +++ b/source/packages/com_mokoog/sql/updates/mysql/01.07.07.sql @@ -0,0 +1 @@ +/* 01.07.07 — no schema changes */ diff --git a/source/packages/com_mokoog/sql/updates/mysql/01.07.08.sql b/source/packages/com_mokoog/sql/updates/mysql/01.07.08.sql new file mode 100644 index 0000000..0921fce --- /dev/null +++ b/source/packages/com_mokoog/sql/updates/mysql/01.07.08.sql @@ -0,0 +1 @@ +/* 01.07.08 — no schema changes */ diff --git a/source/packages/com_mokoog/sql/updates/mysql/01.07.09.sql b/source/packages/com_mokoog/sql/updates/mysql/01.07.09.sql new file mode 100644 index 0000000..521edc5 --- /dev/null +++ b/source/packages/com_mokoog/sql/updates/mysql/01.07.09.sql @@ -0,0 +1 @@ +/* 01.07.09 — no schema changes */ diff --git a/source/packages/plg_content_mokoog/mokoog.xml b/source/packages/plg_content_mokoog/mokoog.xml index 4dfbffb..c8825d8 100644 --- a/source/packages/plg_content_mokoog/mokoog.xml +++ b/source/packages/plg_content_mokoog/mokoog.xml @@ -8,7 +8,7 @@ --> Content - MokoSuiteOpenGraph - 01.07.05 + 01.07.09 2026-05-23 Moko Consulting hello@mokoconsulting.tech diff --git a/source/packages/plg_system_mokoog/mokoog.xml b/source/packages/plg_system_mokoog/mokoog.xml index 0b97545..702b368 100644 --- a/source/packages/plg_system_mokoog/mokoog.xml +++ b/source/packages/plg_system_mokoog/mokoog.xml @@ -8,7 +8,7 @@ --> System - MokoSuiteOpenGraph - 01.07.05 + 01.07.09 2026-05-23 Moko Consulting hello@mokoconsulting.tech diff --git a/source/packages/plg_webservices_mokoog/mokoog.xml b/source/packages/plg_webservices_mokoog/mokoog.xml index 583ae34..0c6753b 100644 --- a/source/packages/plg_webservices_mokoog/mokoog.xml +++ b/source/packages/plg_webservices_mokoog/mokoog.xml @@ -8,7 +8,7 @@ --> Web Services - MokoSuiteOpenGraph - 01.07.05 + 01.07.09 2026-05-23 Moko Consulting hello@mokoconsulting.tech diff --git a/source/pkg_mokoog.xml b/source/pkg_mokoog.xml index 74359f0..d2dee47 100644 --- a/source/pkg_mokoog.xml +++ b/source/pkg_mokoog.xml @@ -8,7 +8,7 @@ Package - MokoSuiteOpenGraph mokoog - 01.07.05 + 01.07.09 2026-05-23 Moko Consulting hello@mokoconsulting.tech