Compare commits
28 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| f0fb93cabf | |||
| c651a838bc | |||
| cf12fee0f9 | |||
| a67dde4e12 | |||
| a022b50cd2 | |||
| a209af3236 | |||
| 7309c76fe7 | |||
| 314075de0f | |||
| bbd7914efa | |||
| 52ebb5d023 | |||
| b46b119dcc | |||
| 0674332343 | |||
| 67dfe6be99 | |||
| 37bc033111 | |||
| e5ed21ca68 | |||
| e7b0cf15cc | |||
| 60a9d81e22 | |||
| b2bfbf9aa7 | |||
| 23a308edcb | |||
| 477edc291f | |||
| c958776e18 | |||
| 95edfc106c | |||
| d6848e6b90 | |||
| 6970e888f5 | |||
| 34de7cd2fc | |||
| a9438c733e | |||
| 6e6cd7bb1c | |||
| f5fdd59e05 |
@@ -382,7 +382,7 @@ jobs:
|
||||
content = open('CHANGELOG.md').read()
|
||||
old = '## [Unreleased]'
|
||||
new = f'## [Unreleased]\n\n## [{version}] --- {date}'
|
||||
content = content.replace(old, new, 1)
|
||||
content = content if ('## [' + version + ']') in content else content.replace(old, new, 1)
|
||||
open('CHANGELOG.md', 'w').write(content)
|
||||
" "$VERSION" "$DATE"
|
||||
git add CHANGELOG.md
|
||||
|
||||
@@ -131,10 +131,11 @@ jobs:
|
||||
test:
|
||||
name: Tests
|
||||
runs-on: ubuntu-latest
|
||||
needs: lint
|
||||
# Run only when lint succeeded; always() forces evaluation so a skipped
|
||||
# lint (e.g. template repos) skips this job cleanly instead of hanging.
|
||||
if: ${{ always() && needs.lint.result == 'success' }}
|
||||
# Independent job (no `needs: lint`): the Gitea Actions scheduler does not
|
||||
# offer the dependent 2nd job of a needs-chain to runners, so it stalls in
|
||||
# "waiting" and is reaped by ABANDONED_JOB_TIMEOUT. Guard template repos
|
||||
# directly (same condition lint uses) instead of gating on lint's result.
|
||||
if: ${{ !startsWith(github.event.repository.name, 'Template-') }}
|
||||
|
||||
steps:
|
||||
- name: Checkout
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
# FILE INFORMATION
|
||||
# DEFGROUP: MokoGitea.Workflow
|
||||
# INGROUP: mokocli.Automation
|
||||
# VERSION: 01.00.00
|
||||
# VERSION: 01.13.13
|
||||
# BRIEF: Auto-create feature branch when an issue is opened
|
||||
|
||||
name: "Universal: Issue Branch"
|
||||
|
||||
@@ -210,7 +210,7 @@ jobs:
|
||||
|
||||
- name: Check for merge conflict markers
|
||||
run: |
|
||||
CONFLICTS=$(grep -rn '<<<<<<< \|>>>>>>> \|^=======$' --include='*.php' --include='*.xml' --include='*.css' --include='*.js' --include='*.json' --include='*.md' --include='*.yml' --include='*.yaml' --include='*.ini' --include='*.txt' . 2>/dev/null | grep -v '.git/' || true)
|
||||
CONFLICTS=$(grep -rn '<<<<<<< \|>>>>>>> \|^=======$' --exclude-dir='.git' --exclude-dir='.mokogitea' --include='*.php' --include='*.xml' --include='*.css' --include='*.js' --include='*.json' --include='*.md' --include='*.yml' --include='*.yaml' --include='*.ini' --include='*.txt' . 2>/dev/null | grep -v '.git/' || true)
|
||||
if [ -n "$CONFLICTS" ]; then
|
||||
echo "::error::Merge conflict markers found in source files"
|
||||
echo "## Conflict Markers Found" >> $GITHUB_STEP_SUMMARY
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
# INGROUP: mokocli.Release
|
||||
# REPO: https://git.mokoconsulting.tech/MokoConsulting/Template-Generic
|
||||
# PATH: /.mokogitea/workflows/pre-release.yml
|
||||
# VERSION: 05.02.00
|
||||
# VERSION: 05.02.01
|
||||
# BRIEF: Auto pre-release on push to dev/alpha/beta/rc branches
|
||||
|
||||
name: "Universal: Pre-Release"
|
||||
@@ -162,7 +162,13 @@ jobs:
|
||||
git add -A
|
||||
git diff --cached --quiet || {
|
||||
git commit -m "chore(version): pre-release bump to ${VERSION} [skip ci]"
|
||||
git push origin HEAD 2>&1
|
||||
# Push the bump commit, but do NOT fail the release if the target branch
|
||||
# is protected and the release identity is not on the push allowlist.
|
||||
# The build proceeds from the in-tree bumped version regardless; if the
|
||||
# push is rejected, the next run simply re-bumps from the same base.
|
||||
if ! git push origin HEAD 2>&1; then
|
||||
echo "::warning::Version-bump commit could not be pushed (protected branch?). Building from in-tree version ${VERSION} anyway."
|
||||
fi
|
||||
}
|
||||
|
||||
# Auto-detect element via manifest_element.php
|
||||
|
||||
+1
-1
@@ -14,7 +14,7 @@
|
||||
DEFGROUP: Template-Joomla
|
||||
INGROUP: Template-Joomla.Documentation
|
||||
REPO: https://github.com/mokoconsulting-tech/Template-Joomla/
|
||||
VERSION: 01.13.00
|
||||
VERSION: 01.13.13
|
||||
PATH: ./CODE_OF_CONDUCT.md
|
||||
BRIEF: Community expectations and enforcement guidelines
|
||||
NOTE: Adapted with attribution from the Contributor Covenant v2.1
|
||||
|
||||
+1
-1
@@ -19,7 +19,7 @@
|
||||
DEFGROUP: mokoconsulting-tech.Template-Joomla
|
||||
INGROUP: MokoStandards.Governance
|
||||
REPO: https://github.com/mokoconsulting-tech/Template-Joomla
|
||||
VERSION: 01.13.00
|
||||
VERSION: 01.13.13
|
||||
PATH: /GOVERNANCE.md
|
||||
BRIEF: Project governance rules, roles, and decision process for Template-Joomla
|
||||
-->
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
# MokoSuiteCross
|
||||
|
||||
<!-- VERSION: 01.13.00 -->
|
||||
<!-- VERSION: 01.13.13 -->
|
||||
|
||||
Cross-posting Joomla content to social media, email marketing, and chat platforms for Joomla 6.
|
||||
|
||||
|
||||
+1
-1
@@ -23,7 +23,7 @@ DEFGROUP: Template-Joomla
|
||||
INGROUP: Template-Joomla.Documentation
|
||||
REPO: https://git.mokoconsulting.tech/MokoConsulting/Template-Joomla
|
||||
PATH: /SECURITY.md
|
||||
VERSION: 01.13.00
|
||||
VERSION: 01.13.13
|
||||
BRIEF: Security vulnerability reporting and handling policy
|
||||
-->
|
||||
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
; License: GPL-3.0-or-later
|
||||
|
||||
COM_MOKOSUITECROSS="MokoSuiteCross"
|
||||
COM_MOKOSUITECROSS_SHORT="Cross"
|
||||
COM_MOKOSUITECROSS_DESCRIPTION="Cross-posting Joomla content to social media, email marketing, and chat platforms"
|
||||
COM_MOKOSUITECROSS_SUBMENU_DASHBOARD="Dashboard"
|
||||
COM_MOKOSUITECROSS_SUBMENU_POSTS="Post Queue"
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<extension type="component" method="upgrade">
|
||||
<name>com_mokosuitecross</name>
|
||||
<version>01.13.00</version>
|
||||
<version>01.13.13</version>
|
||||
<creationDate>2026-05-28</creationDate>
|
||||
<author>Moko Consulting</author>
|
||||
<authorEmail>hello@mokoconsulting.tech</authorEmail>
|
||||
@@ -43,7 +43,7 @@
|
||||
</languages>
|
||||
|
||||
<administration>
|
||||
<menu img="class:share-alt">COM_MOKOSUITECROSS</menu>
|
||||
<menu img="class:share-alt">COM_MOKOSUITECROSS_SHORT</menu>
|
||||
<submenu>
|
||||
<menu link="option=com_mokosuitecross&view=dashboard">COM_MOKOSUITECROSS_SUBMENU_DASHBOARD</menu>
|
||||
<menu link="option=com_mokosuitecross&view=posts">COM_MOKOSUITECROSS_SUBMENU_POSTS</menu>
|
||||
|
||||
@@ -11,6 +11,7 @@
|
||||
|
||||
defined('_JEXEC') or die;
|
||||
|
||||
use Joomla\CMS\Factory;
|
||||
use Joomla\CMS\Installer\InstallerAdapter;
|
||||
|
||||
class Com_MokoSuiteCrossInstallerScript
|
||||
@@ -22,5 +23,77 @@ class Com_MokoSuiteCrossInstallerScript
|
||||
|
||||
public function postflight(string $type, InstallerAdapter $parent): void
|
||||
{
|
||||
if ($type !== 'install') {
|
||||
return;
|
||||
}
|
||||
|
||||
// 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 implying "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(
|
||||
'<strong>MokoSuiteCross did not install correctly.</strong> ' . $detail
|
||||
. ' — review the errors above, then reinstall.',
|
||||
'error'
|
||||
);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
// Success path: schema installed correctly.
|
||||
Factory::getApplication()->enqueueMessage(
|
||||
'<h4>MokoSuiteCross installed successfully!</h4>'
|
||||
. '<p>To enable automatic updates, enter your license key in the '
|
||||
. '<a href="index.php?option=com_config&view=component&component=com_mokosuitecross">component configuration</a>.</p>',
|
||||
'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_mokosuitecross/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 [];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
-- MokoSuiteCross — Uninstall
|
||||
-- MokoSuiteCross -- Uninstall
|
||||
DROP TABLE IF EXISTS `#__mokosuitecross_logs`;
|
||||
DROP TABLE IF EXISTS `#__mokosuitecross_analytics`;
|
||||
DROP TABLE IF EXISTS `#__mokosuitecross_category_rules`;
|
||||
DROP TABLE IF EXISTS `#__mokosuitecross_posts`;
|
||||
DROP TABLE IF EXISTS `#__mokosuitecross_templates`;
|
||||
DROP TABLE IF EXISTS `#__mokosuitecross_services`;
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
/* 01.13.01 — no schema changes */
|
||||
@@ -0,0 +1 @@
|
||||
/* 01.13.02 — no schema changes */
|
||||
@@ -0,0 +1 @@
|
||||
/* 01.13.03 — no schema changes */
|
||||
@@ -0,0 +1 @@
|
||||
/* 01.13.04 — no schema changes */
|
||||
@@ -0,0 +1 @@
|
||||
/* 01.13.06 — no schema changes */
|
||||
@@ -0,0 +1 @@
|
||||
/* 01.13.08 — no schema changes */
|
||||
@@ -0,0 +1 @@
|
||||
/* 01.13.09 — no schema changes */
|
||||
@@ -0,0 +1 @@
|
||||
/* 01.13.10 — no schema changes */
|
||||
@@ -0,0 +1 @@
|
||||
/* 01.13.11 — no schema changes */
|
||||
@@ -0,0 +1 @@
|
||||
/* 01.13.12 — no schema changes */
|
||||
@@ -0,0 +1 @@
|
||||
/* 01.13.13 — no schema changes */
|
||||
@@ -130,6 +130,10 @@ class PostsController extends AdminController
|
||||
{
|
||||
$this->checkToken();
|
||||
|
||||
if (!$this->app->getIdentity()->authorise('mokosuitecross.queue.manage', 'com_mokosuitecross')) {
|
||||
throw new \RuntimeException(Text::_('JLIB_APPLICATION_ERROR_ACCESS_FORBIDDEN'), 403);
|
||||
}
|
||||
|
||||
$db = Factory::getDbo();
|
||||
|
||||
$query = $db->getQuery(true)
|
||||
@@ -238,6 +242,10 @@ class PostsController extends AdminController
|
||||
{
|
||||
$this->checkToken();
|
||||
|
||||
if (!$this->app->getIdentity()->authorise('mokosuitecross.queue.manage', 'com_mokosuitecross')) {
|
||||
throw new \RuntimeException(Text::_('JLIB_APPLICATION_ERROR_ACCESS_FORBIDDEN'), 403);
|
||||
}
|
||||
|
||||
$db = Factory::getDbo();
|
||||
|
||||
$query = $db->getQuery(true)
|
||||
|
||||
@@ -19,13 +19,6 @@ class AnalyticsHelper
|
||||
{
|
||||
/**
|
||||
* Record or update engagement metrics for a post.
|
||||
*
|
||||
* @param int $postId The post ID
|
||||
* @param int $serviceId The service ID
|
||||
* @param string $serviceType The service type (e.g. twitter, facebook)
|
||||
* @param array $metrics Engagement metrics: impressions, engagements, clicks, shares, posted_at
|
||||
*
|
||||
* @return bool True on success
|
||||
*/
|
||||
public static function recordEngagement(int $postId, int $serviceId, string $serviceType, array $metrics): bool
|
||||
{
|
||||
@@ -51,7 +44,6 @@ class AnalyticsHelper
|
||||
? round(($engagements / $impressions) * 100, 2)
|
||||
: 0.00;
|
||||
|
||||
// Check if a row already exists for this post
|
||||
$query = $db->getQuery(true)
|
||||
->select($db->quoteName('id'))
|
||||
->from($db->quoteName('#__mokosuitecross_analytics'))
|
||||
@@ -96,12 +88,7 @@ class AnalyticsHelper
|
||||
}
|
||||
|
||||
/**
|
||||
* Get heatmap data as a 7x24 grid of average engagement rates.
|
||||
*
|
||||
* @param string $serviceType Optional service type filter
|
||||
* @param int $days Number of days to look back (0 = all time)
|
||||
*
|
||||
* @return array 7x24 grid: [ day_of_week => [ hour_of_day => avg_engagement_rate ] ]
|
||||
* Get heatmap data as a 7x24 grid derived from actual post success data.
|
||||
*/
|
||||
public static function getHeatmapData(string $serviceType = '', int $days = 90): array
|
||||
{
|
||||
@@ -109,30 +96,40 @@ class AnalyticsHelper
|
||||
|
||||
$query = $db->getQuery(true)
|
||||
->select([
|
||||
$db->quoteName('day_of_week'),
|
||||
$db->quoteName('hour_of_day'),
|
||||
'AVG(' . $db->quoteName('engagement_rate') . ') AS avg_rate',
|
||||
'DAYOFWEEK(' . $db->quoteName('p.posted_at') . ') - 1 AS day_of_week',
|
||||
'HOUR(' . $db->quoteName('p.posted_at') . ') AS hour_of_day',
|
||||
'COUNT(*) AS post_count',
|
||||
])
|
||||
->from($db->quoteName('#__mokosuitecross_analytics'))
|
||||
->group($db->quoteName('day_of_week'))
|
||||
->group($db->quoteName('hour_of_day'))
|
||||
->order($db->quoteName('day_of_week') . ' ASC')
|
||||
->order($db->quoteName('hour_of_day') . ' ASC');
|
||||
->from($db->quoteName('#__mokosuitecross_posts', 'p'))
|
||||
->join('INNER', $db->quoteName('#__mokosuitecross_services', 's')
|
||||
. ' ON ' . $db->quoteName('s.id') . ' = ' . $db->quoteName('p.service_id'))
|
||||
->where($db->quoteName('p.status') . ' = ' . $db->quote('posted'))
|
||||
->where($db->quoteName('p.posted_at') . ' IS NOT NULL')
|
||||
->group('day_of_week')
|
||||
->group('hour_of_day')
|
||||
->order('day_of_week ASC')
|
||||
->order('hour_of_day ASC');
|
||||
|
||||
if ($serviceType !== '') {
|
||||
$query->where($db->quoteName('service_type') . ' = ' . $db->quote($serviceType));
|
||||
$query->where($db->quoteName('s.service_type') . ' = ' . $db->quote($serviceType));
|
||||
}
|
||||
|
||||
if ($days > 0) {
|
||||
$cutoff = Factory::getDate('-' . $days . ' days')->toSql();
|
||||
$query->where($db->quoteName('posted_at') . ' >= ' . $db->quote($cutoff));
|
||||
$query->where($db->quoteName('p.posted_at') . ' >= ' . $db->quote($cutoff));
|
||||
}
|
||||
|
||||
$db->setQuery($query);
|
||||
$rows = $db->loadObjectList();
|
||||
|
||||
// Build 7x24 grid initialised to zero
|
||||
$maxCount = 1;
|
||||
|
||||
foreach ($rows as $row) {
|
||||
if ((int) $row->post_count > $maxCount) {
|
||||
$maxCount = (int) $row->post_count;
|
||||
}
|
||||
}
|
||||
|
||||
$grid = [];
|
||||
|
||||
for ($d = 0; $d < 7; $d++) {
|
||||
@@ -142,9 +139,10 @@ class AnalyticsHelper
|
||||
}
|
||||
|
||||
foreach ($rows as $row) {
|
||||
$count = (int) $row->post_count;
|
||||
$grid[(int) $row->day_of_week][(int) $row->hour_of_day] = [
|
||||
'avg_rate' => round((float) $row->avg_rate, 2),
|
||||
'post_count' => (int) $row->post_count,
|
||||
'avg_rate' => round(($count / $maxCount) * 100, 2),
|
||||
'post_count' => $count,
|
||||
];
|
||||
}
|
||||
|
||||
@@ -152,12 +150,7 @@ class AnalyticsHelper
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the best times to post ranked by average engagement rate.
|
||||
*
|
||||
* @param string $serviceType Optional service type filter
|
||||
* @param int $limit Number of results to return
|
||||
*
|
||||
* @return array List of [day_of_week, hour_of_day, avg_rate, post_count]
|
||||
* Get the best times to post ranked by post success frequency.
|
||||
*/
|
||||
public static function getBestTimes(string $serviceType = '', int $limit = 5): array
|
||||
{
|
||||
@@ -165,19 +158,22 @@ class AnalyticsHelper
|
||||
|
||||
$query = $db->getQuery(true)
|
||||
->select([
|
||||
$db->quoteName('day_of_week'),
|
||||
$db->quoteName('hour_of_day'),
|
||||
'AVG(' . $db->quoteName('engagement_rate') . ') AS avg_rate',
|
||||
'DAYOFWEEK(' . $db->quoteName('p.posted_at') . ') - 1 AS day_of_week',
|
||||
'HOUR(' . $db->quoteName('p.posted_at') . ') AS hour_of_day',
|
||||
'COUNT(*) AS post_count',
|
||||
])
|
||||
->from($db->quoteName('#__mokosuitecross_analytics'))
|
||||
->group($db->quoteName('day_of_week'))
|
||||
->group($db->quoteName('hour_of_day'))
|
||||
->from($db->quoteName('#__mokosuitecross_posts', 'p'))
|
||||
->join('INNER', $db->quoteName('#__mokosuitecross_services', 's')
|
||||
. ' ON ' . $db->quoteName('s.id') . ' = ' . $db->quoteName('p.service_id'))
|
||||
->where($db->quoteName('p.status') . ' = ' . $db->quote('posted'))
|
||||
->where($db->quoteName('p.posted_at') . ' IS NOT NULL')
|
||||
->group('day_of_week')
|
||||
->group('hour_of_day')
|
||||
->having('COUNT(*) >= 1')
|
||||
->order('avg_rate DESC');
|
||||
->order('post_count DESC');
|
||||
|
||||
if ($serviceType !== '') {
|
||||
$query->where($db->quoteName('service_type') . ' = ' . $db->quote($serviceType));
|
||||
$query->where($db->quoteName('s.service_type') . ' = ' . $db->quote($serviceType));
|
||||
}
|
||||
|
||||
$db->setQuery($query, 0, $limit);
|
||||
@@ -197,7 +193,7 @@ class AnalyticsHelper
|
||||
'day_name' => $dayNames[(int) $row['day_of_week']],
|
||||
'hour_of_day' => $hour,
|
||||
'hour_label' => $hour12 . ':00 ' . $ampm,
|
||||
'avg_rate' => round((float) $row['avg_rate'], 2),
|
||||
'avg_rate' => round((float) $row['post_count'], 2),
|
||||
'post_count' => (int) $row['post_count'],
|
||||
];
|
||||
}
|
||||
@@ -206,11 +202,7 @@ class AnalyticsHelper
|
||||
}
|
||||
|
||||
/**
|
||||
* Get engagement stats grouped by service type.
|
||||
*
|
||||
* @param int $days Number of days to look back (0 = all time)
|
||||
*
|
||||
* @return array List of [service_type, total_posts, avg_engagement_rate, total_impressions, total_engagements]
|
||||
* Get stats grouped by service type from actual post data.
|
||||
*/
|
||||
public static function getServiceBreakdown(int $days = 30): array
|
||||
{
|
||||
@@ -218,33 +210,39 @@ class AnalyticsHelper
|
||||
|
||||
$query = $db->getQuery(true)
|
||||
->select([
|
||||
$db->quoteName('service_type'),
|
||||
$db->quoteName('s.service_type'),
|
||||
'COUNT(*) AS total_posts',
|
||||
'AVG(' . $db->quoteName('engagement_rate') . ') AS avg_engagement_rate',
|
||||
'SUM(' . $db->quoteName('impressions') . ') AS total_impressions',
|
||||
'SUM(' . $db->quoteName('engagements') . ') AS total_engagements',
|
||||
'SUM(' . $db->quoteName('clicks') . ') AS total_clicks',
|
||||
'SUM(' . $db->quoteName('shares') . ') AS total_shares',
|
||||
'SUM(CASE WHEN ' . $db->quoteName('p.status') . ' = ' . $db->quote('posted') . ' THEN 1 ELSE 0 END) AS total_succeeded',
|
||||
'SUM(CASE WHEN ' . $db->quoteName('p.status') . ' IN ('
|
||||
. $db->quote('failed') . ',' . $db->quote('permanently_failed')
|
||||
. ') THEN 1 ELSE 0 END) AS total_failed',
|
||||
])
|
||||
->from($db->quoteName('#__mokosuitecross_analytics'))
|
||||
->group($db->quoteName('service_type'))
|
||||
->order('avg_engagement_rate DESC');
|
||||
->from($db->quoteName('#__mokosuitecross_posts', 'p'))
|
||||
->join('INNER', $db->quoteName('#__mokosuitecross_services', 's')
|
||||
. ' ON ' . $db->quoteName('s.id') . ' = ' . $db->quoteName('p.service_id'))
|
||||
->group($db->quoteName('s.service_type'))
|
||||
->order('total_posts DESC');
|
||||
|
||||
if ($days > 0) {
|
||||
$cutoff = Factory::getDate('-' . $days . ' days')->toSql();
|
||||
$query->where($db->quoteName('posted_at') . ' >= ' . $db->quote($cutoff));
|
||||
$query->where($db->quoteName('p.created') . ' >= ' . $db->quote($cutoff));
|
||||
}
|
||||
|
||||
$db->setQuery($query);
|
||||
$rows = $db->loadAssocList();
|
||||
|
||||
foreach ($rows as &$row) {
|
||||
$row['avg_engagement_rate'] = round((float) $row['avg_engagement_rate'], 2);
|
||||
$row['total_posts'] = (int) $row['total_posts'];
|
||||
$row['total_impressions'] = (int) $row['total_impressions'];
|
||||
$row['total_engagements'] = (int) $row['total_engagements'];
|
||||
$row['total_clicks'] = (int) $row['total_clicks'];
|
||||
$row['total_shares'] = (int) $row['total_shares'];
|
||||
$total = (int) $row['total_posts'];
|
||||
$succeeded = (int) $row['total_succeeded'];
|
||||
|
||||
$row['total_posts'] = $total;
|
||||
$row['total_succeeded'] = $succeeded;
|
||||
$row['total_failed'] = (int) $row['total_failed'];
|
||||
$row['avg_engagement_rate'] = $total > 0 ? round(($succeeded / $total) * 100, 2) : 0;
|
||||
$row['total_impressions'] = 0;
|
||||
$row['total_engagements'] = 0;
|
||||
$row['total_clicks'] = 0;
|
||||
$row['total_shares'] = 0;
|
||||
}
|
||||
|
||||
return $rows;
|
||||
|
||||
@@ -594,13 +594,26 @@ class CrossPostDispatcher
|
||||
return;
|
||||
}
|
||||
|
||||
// Load service plugins
|
||||
// Load service plugins using Joomla 5/6-compatible dispatcher pattern
|
||||
PluginHelper::importPlugin('mokosuitecross');
|
||||
$plugins = [];
|
||||
Factory::getApplication()->triggerEvent('onMokoSuiteCrossGetServices', [&$plugins]);
|
||||
$servicePlugins = [];
|
||||
$event = new \Joomla\Event\Event('onMokoSuiteCrossGetServices', [$servicePlugins]);
|
||||
|
||||
try {
|
||||
Factory::getApplication()->getDispatcher()->dispatch('onMokoSuiteCrossGetServices', $event);
|
||||
} catch (\Throwable $e) {
|
||||
// Dispatcher may not be available
|
||||
}
|
||||
|
||||
$idx = 1;
|
||||
|
||||
while (isset($event[$idx])) {
|
||||
$servicePlugins[] = $event[$idx];
|
||||
$idx++;
|
||||
}
|
||||
|
||||
$pluginMap = [];
|
||||
foreach ($plugins as $plugin) {
|
||||
foreach ($servicePlugins as $plugin) {
|
||||
$pluginMap[$plugin->getServiceType()] = $plugin;
|
||||
}
|
||||
|
||||
@@ -613,7 +626,7 @@ class CrossPostDispatcher
|
||||
continue;
|
||||
}
|
||||
|
||||
$credentials = json_decode($post->credentials, true) ?: [];
|
||||
$credentials = CredentialHelper::decrypt($post->credentials ?: '');
|
||||
|
||||
try {
|
||||
$result = $plugin->deletePost($post->platform_post_id, $credentials);
|
||||
|
||||
@@ -41,9 +41,8 @@ class MokoSuiteCrossHelper
|
||||
'services' => 'COM_MOKOSUITECROSS_SUBMENU_SERVICES',
|
||||
'templates' => 'COM_MOKOSUITECROSS_SUBMENU_TEMPLATES',
|
||||
'calendar' => 'COM_MOKOSUITECROSS_SUBMENU_CALENDAR',
|
||||
'logs' => 'COM_MOKOSUITECROSS_SUBMENU_LOGS',
|
||||
'calendar' => 'COM_MOKOSUITECROSS_SUBMENU_CALENDAR',
|
||||
'analytics' => 'COM_MOKOSUITECROSS_SUBMENU_ANALYTICS',
|
||||
'logs' => 'COM_MOKOSUITECROSS_SUBMENU_LOGS',
|
||||
];
|
||||
|
||||
// Joomla 5+ toolbar submenu
|
||||
|
||||
@@ -91,6 +91,16 @@ class QueueProcessor
|
||||
$db->setQuery($query);
|
||||
$retryPosts = $db->loadObjectList() ?: [];
|
||||
|
||||
// 3. Recover stale "posting" entries (stuck > 10 minutes)
|
||||
$staleQuery = $db->getQuery(true)
|
||||
->update($db->quoteName('#__mokosuitecross_posts'))
|
||||
->set($db->quoteName('status') . ' = ' . $db->quote('queued'))
|
||||
->set($db->quoteName('modified') . ' = ' . $db->quote($now))
|
||||
->where($db->quoteName('status') . ' = ' . $db->quote('posting'))
|
||||
->where($db->quoteName('modified') . ' < DATE_SUB(NOW(), INTERVAL 600 SECOND)');
|
||||
$db->setQuery($staleQuery);
|
||||
$db->execute();
|
||||
|
||||
$allPosts = array_merge($queuedPosts, $retryPosts);
|
||||
|
||||
foreach ($allPosts as $post) {
|
||||
|
||||
@@ -22,7 +22,7 @@ use Joomla\Component\MokoSuiteCross\Administrator\Helper\MokoSuiteCrossHelper;
|
||||
|
||||
class HtmlView extends BaseHtmlView
|
||||
{
|
||||
public $sidebar;
|
||||
|
||||
public $ajaxUrl;
|
||||
|
||||
public function display($tpl = null): void
|
||||
@@ -40,7 +40,6 @@ class HtmlView extends BaseHtmlView
|
||||
$this->addToolbar();
|
||||
|
||||
MokoSuiteCrossHelper::addSubmenu('calendar');
|
||||
$this->sidebar = \Joomla\CMS\HTML\Sidebar::render();
|
||||
|
||||
// Set document title
|
||||
Factory::getApplication()->getDocument()->setTitle(
|
||||
|
||||
@@ -26,7 +26,7 @@ class HtmlView extends BaseHtmlView
|
||||
protected $serviceBreakdown;
|
||||
protected $dailyTrend;
|
||||
protected $topArticles;
|
||||
public $sidebar;
|
||||
|
||||
public $period;
|
||||
|
||||
public function display($tpl = null): void
|
||||
@@ -58,7 +58,6 @@ class HtmlView extends BaseHtmlView
|
||||
$this->addToolbar();
|
||||
|
||||
MokoSuiteCrossHelper::addSubmenu('dashboard');
|
||||
$this->sidebar = \Joomla\CMS\HTML\Sidebar::render();
|
||||
|
||||
parent::display($tpl);
|
||||
}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<extension type="plugin" group="content" method="upgrade">
|
||||
<name>Content - MokoSuiteCross</name>
|
||||
<version>01.13.00</version>
|
||||
<version>01.13.13</version>
|
||||
<creationDate>2026-05-28</creationDate>
|
||||
<author>Moko Consulting</author>
|
||||
<authorEmail>hello@mokoconsulting.tech</authorEmail>
|
||||
|
||||
@@ -535,6 +535,19 @@ XML;
|
||||
continue;
|
||||
}
|
||||
|
||||
// Respect first-publish-only: skip if article was previously posted
|
||||
if ($params->get('post_on_first_publish_only', 0)) {
|
||||
$existsQuery = $db->getQuery(true)
|
||||
->select('COUNT(*)')
|
||||
->from($db->quoteName('#__mokosuitecross_posts'))
|
||||
->where($db->quoteName('article_id') . ' = ' . (int) $pk);
|
||||
$db->setQuery($existsQuery);
|
||||
|
||||
if ((int) $db->loadResult() > 0) {
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
$url = Uri::root() . 'index.php?option=com_content&view=article&id=' . $article->id;
|
||||
|
||||
if (!empty($article->catid)) {
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<extension type="plugin" group="mokosuitecross" method="upgrade">
|
||||
<name>MokoSuiteCross - ActivityPub (Fediverse)</name>
|
||||
<version>01.13.00</version>
|
||||
<version>01.13.13</version>
|
||||
<creationDate>2026-05-28</creationDate>
|
||||
<author>Moko Consulting</author>
|
||||
<authorEmail>hello@mokoconsulting.tech</authorEmail>
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<extension type="plugin" group="mokosuitecross" method="upgrade">
|
||||
<name>MokoSuiteCross - Google Blogger</name>
|
||||
<version>01.13.00</version>
|
||||
<version>01.13.13</version>
|
||||
<creationDate>2026-05-28</creationDate>
|
||||
<author>Moko Consulting</author>
|
||||
<authorEmail>hello@mokoconsulting.tech</authorEmail>
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<extension type="plugin" group="mokosuitecross" method="upgrade">
|
||||
<name>MokoSuiteCross - Bluesky</name>
|
||||
<version>01.13.00</version>
|
||||
<version>01.13.13</version>
|
||||
<creationDate>2026-05-28</creationDate>
|
||||
<author>Moko Consulting</author>
|
||||
<authorEmail>hello@mokoconsulting.tech</authorEmail>
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<extension type="plugin" group="mokosuitecross" method="upgrade">
|
||||
<name>MokoSuiteCross - Brevo (Sendinblue)</name>
|
||||
<version>01.13.00</version>
|
||||
<version>01.13.13</version>
|
||||
<creationDate>2026-05-28</creationDate>
|
||||
<author>Moko Consulting</author>
|
||||
<authorEmail>hello@mokoconsulting.tech</authorEmail>
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<extension type="plugin" group="mokosuitecross" method="upgrade">
|
||||
<name>MokoSuiteCross - Constant Contact</name>
|
||||
<version>01.13.00</version>
|
||||
<version>01.13.13</version>
|
||||
<creationDate>2026-05-28</creationDate>
|
||||
<author>Moko Consulting</author>
|
||||
<authorEmail>hello@mokoconsulting.tech</authorEmail>
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<extension type="plugin" group="mokosuitecross" method="upgrade">
|
||||
<name>MokoSuiteCross - ConvertKit</name>
|
||||
<version>01.13.00</version>
|
||||
<version>01.13.13</version>
|
||||
<creationDate>2026-05-28</creationDate>
|
||||
<author>Moko Consulting</author>
|
||||
<authorEmail>hello@mokoconsulting.tech</authorEmail>
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<extension type="plugin" group="mokosuitecross" method="upgrade">
|
||||
<name>MokoSuiteCross - Dev.to</name>
|
||||
<version>01.13.00</version>
|
||||
<version>01.13.13</version>
|
||||
<creationDate>2026-05-28</creationDate>
|
||||
<author>Moko Consulting</author>
|
||||
<authorEmail>hello@mokoconsulting.tech</authorEmail>
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<extension type="plugin" group="mokosuitecross" method="upgrade">
|
||||
<name>MokoSuiteCross - Discord</name>
|
||||
<version>01.13.00</version>
|
||||
<version>01.13.13</version>
|
||||
<creationDate>2026-05-28</creationDate>
|
||||
<author>Moko Consulting</author>
|
||||
<authorEmail>hello@mokoconsulting.tech</authorEmail>
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<extension type="plugin" group="mokosuitecross" method="upgrade">
|
||||
<name>MokoSuiteCross - Facebook / Meta</name>
|
||||
<version>01.13.00</version>
|
||||
<version>01.13.13</version>
|
||||
<creationDate>2026-05-28</creationDate>
|
||||
<author>Moko Consulting</author>
|
||||
<authorEmail>hello@mokoconsulting.tech</authorEmail>
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<extension type="plugin" group="mokosuitecross" method="upgrade">
|
||||
<name>MokoSuiteCross - Ghost</name>
|
||||
<version>01.13.00</version>
|
||||
<version>01.13.13</version>
|
||||
<creationDate>2026-05-28</creationDate>
|
||||
<author>Moko Consulting</author>
|
||||
<authorEmail>hello@mokoconsulting.tech</authorEmail>
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<extension type="plugin" group="mokosuitecross" method="upgrade">
|
||||
<name>MokoSuiteCross - Google Business Profile</name>
|
||||
<version>01.13.00</version>
|
||||
<version>01.13.13</version>
|
||||
<creationDate>2026-05-28</creationDate>
|
||||
<author>Moko Consulting</author>
|
||||
<authorEmail>hello@mokoconsulting.tech</authorEmail>
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<extension type="plugin" group="mokosuitecross" method="upgrade">
|
||||
<name>MokoSuiteCross - Google Chat</name>
|
||||
<version>01.13.00</version>
|
||||
<version>01.13.13</version>
|
||||
<creationDate>2026-05-28</creationDate>
|
||||
<author>Moko Consulting</author>
|
||||
<authorEmail>hello@mokoconsulting.tech</authorEmail>
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<extension type="plugin" group="mokosuitecross" method="upgrade">
|
||||
<name>MokoSuiteCross - Hashnode</name>
|
||||
<version>01.13.00</version>
|
||||
<version>01.13.13</version>
|
||||
<creationDate>2026-05-28</creationDate>
|
||||
<author>Moko Consulting</author>
|
||||
<authorEmail>hello@mokoconsulting.tech</authorEmail>
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<extension type="plugin" group="mokosuitecross" method="upgrade">
|
||||
<name>MokoSuiteCross - Instagram</name>
|
||||
<version>01.13.00</version>
|
||||
<version>01.13.13</version>
|
||||
<creationDate>2026-06-23</creationDate>
|
||||
<author>Moko Consulting</author>
|
||||
<authorEmail>hello@mokoconsulting.tech</authorEmail>
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<extension type="plugin" group="mokosuitecross" method="upgrade">
|
||||
<name>MokoSuiteCross - LinkedIn</name>
|
||||
<version>01.13.00</version>
|
||||
<version>01.13.13</version>
|
||||
<creationDate>2026-05-28</creationDate>
|
||||
<author>Moko Consulting</author>
|
||||
<authorEmail>hello@mokoconsulting.tech</authorEmail>
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<extension type="plugin" group="mokosuitecross" method="upgrade">
|
||||
<name>MokoSuiteCross - Mailchimp</name>
|
||||
<version>01.13.00</version>
|
||||
<version>01.13.13</version>
|
||||
<creationDate>2026-05-28</creationDate>
|
||||
<author>Moko Consulting</author>
|
||||
<authorEmail>hello@mokoconsulting.tech</authorEmail>
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<extension type="plugin" group="mokosuitecross" method="upgrade">
|
||||
<name>MokoSuiteCross - Mastodon</name>
|
||||
<version>01.13.00</version>
|
||||
<version>01.13.13</version>
|
||||
<creationDate>2026-05-28</creationDate>
|
||||
<author>Moko Consulting</author>
|
||||
<authorEmail>hello@mokoconsulting.tech</authorEmail>
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<extension type="plugin" group="mokosuitecross" method="upgrade">
|
||||
<name>MokoSuiteCross - Matrix / Element</name>
|
||||
<version>01.13.00</version>
|
||||
<version>01.13.13</version>
|
||||
<creationDate>2026-05-28</creationDate>
|
||||
<author>Moko Consulting</author>
|
||||
<authorEmail>hello@mokoconsulting.tech</authorEmail>
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<extension type="plugin" group="mokosuitecross" method="upgrade">
|
||||
<name>MokoSuiteCross - Medium</name>
|
||||
<version>01.13.00</version>
|
||||
<version>01.13.13</version>
|
||||
<creationDate>2026-05-28</creationDate>
|
||||
<author>Moko Consulting</author>
|
||||
<authorEmail>hello@mokoconsulting.tech</authorEmail>
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<extension type="plugin" group="mokosuitecross" method="upgrade">
|
||||
<name>MokoSuiteCross - MokoSuiteCalendar Events</name>
|
||||
<version>01.13.00</version>
|
||||
<version>01.13.13</version>
|
||||
<creationDate>2026-05-28</creationDate>
|
||||
<author>Moko Consulting</author>
|
||||
<authorEmail>hello@mokoconsulting.tech</authorEmail>
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<extension type="plugin" group="mokosuitecross" method="upgrade">
|
||||
<name>MokoSuiteCross - MokoSuiteGallery</name>
|
||||
<version>01.13.00</version>
|
||||
<version>01.13.13</version>
|
||||
<creationDate>2026-05-28</creationDate>
|
||||
<author>Moko Consulting</author>
|
||||
<authorEmail>hello@mokoconsulting.tech</authorEmail>
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<extension type="plugin" group="mokosuitecross" method="upgrade">
|
||||
<name>MokoSuiteCross - Nostr</name>
|
||||
<version>01.13.00</version>
|
||||
<version>01.13.13</version>
|
||||
<creationDate>2026-05-28</creationDate>
|
||||
<author>Moko Consulting</author>
|
||||
<authorEmail>hello@mokoconsulting.tech</authorEmail>
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<extension type="plugin" group="mokosuitecross" method="upgrade">
|
||||
<name>MokoSuiteCross - Ntfy Push Notifications</name>
|
||||
<version>01.13.00</version>
|
||||
<version>01.13.13</version>
|
||||
<creationDate>2026-05-28</creationDate>
|
||||
<author>Moko Consulting</author>
|
||||
<authorEmail>hello@mokoconsulting.tech</authorEmail>
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<extension type="plugin" group="mokosuitecross" method="upgrade">
|
||||
<name>MokoSuiteCross - Pinterest</name>
|
||||
<version>01.13.00</version>
|
||||
<version>01.13.13</version>
|
||||
<creationDate>2026-05-28</creationDate>
|
||||
<author>Moko Consulting</author>
|
||||
<authorEmail>hello@mokoconsulting.tech</authorEmail>
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<extension type="plugin" group="mokosuitecross" method="upgrade">
|
||||
<name>MokoSuiteCross - Reddit</name>
|
||||
<version>01.13.00</version>
|
||||
<version>01.13.13</version>
|
||||
<creationDate>2026-05-28</creationDate>
|
||||
<author>Moko Consulting</author>
|
||||
<authorEmail>hello@mokoconsulting.tech</authorEmail>
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<extension type="plugin" group="mokosuitecross" method="upgrade">
|
||||
<name>MokoSuiteCross - RSS Feed</name>
|
||||
<version>01.13.00</version>
|
||||
<version>01.13.13</version>
|
||||
<creationDate>2026-05-28</creationDate>
|
||||
<author>Moko Consulting</author>
|
||||
<authorEmail>hello@mokoconsulting.tech</authorEmail>
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<extension type="plugin" group="mokosuitecross" method="upgrade">
|
||||
<name>MokoSuiteCross - SendGrid</name>
|
||||
<version>01.13.00</version>
|
||||
<version>01.13.13</version>
|
||||
<creationDate>2026-05-28</creationDate>
|
||||
<author>Moko Consulting</author>
|
||||
<authorEmail>hello@mokoconsulting.tech</authorEmail>
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<extension type="plugin" group="mokosuitecross" method="upgrade">
|
||||
<name>MokoSuiteCross - Slack</name>
|
||||
<version>01.13.00</version>
|
||||
<version>01.13.13</version>
|
||||
<creationDate>2026-05-28</creationDate>
|
||||
<author>Moko Consulting</author>
|
||||
<authorEmail>hello@mokoconsulting.tech</authorEmail>
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<extension type="plugin" group="mokosuitecross" method="upgrade">
|
||||
<name>MokoSuiteCross - Microsoft Teams</name>
|
||||
<version>01.13.00</version>
|
||||
<version>01.13.13</version>
|
||||
<creationDate>2026-05-28</creationDate>
|
||||
<author>Moko Consulting</author>
|
||||
<authorEmail>hello@mokoconsulting.tech</authorEmail>
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<extension type="plugin" group="mokosuitecross" method="upgrade">
|
||||
<name>MokoSuiteCross - Telegram</name>
|
||||
<version>01.13.00</version>
|
||||
<version>01.13.13</version>
|
||||
<creationDate>2026-05-28</creationDate>
|
||||
<author>Moko Consulting</author>
|
||||
<authorEmail>hello@mokoconsulting.tech</authorEmail>
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<extension type="plugin" group="mokosuitecross" method="upgrade">
|
||||
<name>MokoSuiteCross - Threads (Meta)</name>
|
||||
<version>01.13.00</version>
|
||||
<version>01.13.13</version>
|
||||
<creationDate>2026-05-28</creationDate>
|
||||
<author>Moko Consulting</author>
|
||||
<authorEmail>hello@mokoconsulting.tech</authorEmail>
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<extension type="plugin" group="mokosuitecross" method="upgrade">
|
||||
<name>MokoSuiteCross - TikTok</name>
|
||||
<version>01.13.00</version>
|
||||
<version>01.13.13</version>
|
||||
<creationDate>2026-05-28</creationDate>
|
||||
<author>Moko Consulting</author>
|
||||
<authorEmail>hello@mokoconsulting.tech</authorEmail>
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<extension type="plugin" group="mokosuitecross" method="upgrade">
|
||||
<name>MokoSuiteCross - Tumblr</name>
|
||||
<version>01.13.00</version>
|
||||
<version>01.13.13</version>
|
||||
<creationDate>2026-05-28</creationDate>
|
||||
<author>Moko Consulting</author>
|
||||
<authorEmail>hello@mokoconsulting.tech</authorEmail>
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<extension type="plugin" group="mokosuitecross" method="upgrade">
|
||||
<name>MokoSuiteCross - X / Twitter</name>
|
||||
<version>01.13.00</version>
|
||||
<version>01.13.13</version>
|
||||
<creationDate>2026-05-28</creationDate>
|
||||
<author>Moko Consulting</author>
|
||||
<authorEmail>hello@mokoconsulting.tech</authorEmail>
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<extension type="plugin" group="mokosuitecross" method="upgrade">
|
||||
<name>MokoSuiteCross - Generic Webhook</name>
|
||||
<version>01.13.00</version>
|
||||
<version>01.13.13</version>
|
||||
<creationDate>2026-05-28</creationDate>
|
||||
<author>Moko Consulting</author>
|
||||
<authorEmail>hello@mokoconsulting.tech</authorEmail>
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<extension type="plugin" group="mokosuitecross" method="upgrade">
|
||||
<name>MokoSuiteCross - WhatsApp Business</name>
|
||||
<version>01.13.00</version>
|
||||
<version>01.13.13</version>
|
||||
<creationDate>2026-05-28</creationDate>
|
||||
<author>Moko Consulting</author>
|
||||
<authorEmail>hello@mokoconsulting.tech</authorEmail>
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<extension type="plugin" group="mokosuitecross" method="upgrade">
|
||||
<name>MokoSuiteCross - WordPress</name>
|
||||
<version>01.13.00</version>
|
||||
<version>01.13.13</version>
|
||||
<creationDate>2026-05-28</creationDate>
|
||||
<author>Moko Consulting</author>
|
||||
<authorEmail>hello@mokoconsulting.tech</authorEmail>
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<extension type="plugin" group="mokosuitecross" method="upgrade">
|
||||
<name>MokoSuiteCross - Youtube</name>
|
||||
<version>01.13.00</version>
|
||||
<version>01.13.13</version>
|
||||
<creationDate>2026-06-23</creationDate>
|
||||
<author>Moko Consulting</author>
|
||||
<authorEmail>hello@mokoconsulting.tech</authorEmail>
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<extension type="plugin" group="system" method="upgrade">
|
||||
<name>System - MokoSuiteCross</name>
|
||||
<version>01.13.00</version>
|
||||
<version>01.13.13</version>
|
||||
<creationDate>2026-05-28</creationDate>
|
||||
<author>Moko Consulting</author>
|
||||
<authorEmail>hello@mokoconsulting.tech</authorEmail>
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<extension type="plugin" group="system" method="upgrade">
|
||||
<name>System - MokoSuiteCross Events</name>
|
||||
<version>01.13.00</version>
|
||||
<version>01.13.13</version>
|
||||
<creationDate>2026-05-28</creationDate>
|
||||
<author>Moko Consulting</author>
|
||||
<authorEmail>hello@mokoconsulting.tech</authorEmail>
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<extension type="plugin" group="system" method="upgrade">
|
||||
<name>System - MokoSuiteCross Gallery</name>
|
||||
<version>01.13.00</version>
|
||||
<version>01.13.13</version>
|
||||
<creationDate>2026-05-28</creationDate>
|
||||
<author>Moko Consulting</author>
|
||||
<authorEmail>hello@mokoconsulting.tech</authorEmail>
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<extension type="plugin" group="task" method="upgrade">
|
||||
<name>Task - MokoSuiteCross Queue Processor</name>
|
||||
<version>01.13.00</version>
|
||||
<version>01.13.13</version>
|
||||
<creationDate>2026-05-28</creationDate>
|
||||
<author>Moko Consulting</author>
|
||||
<authorEmail>hello@mokoconsulting.tech</authorEmail>
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<extension type="plugin" group="webservices" method="upgrade">
|
||||
<name>Web Services - MokoSuiteCross</name>
|
||||
<version>01.13.00</version>
|
||||
<version>01.13.13</version>
|
||||
<creationDate>2026-05-28</creationDate>
|
||||
<author>Moko Consulting</author>
|
||||
<authorEmail>hello@mokoconsulting.tech</authorEmail>
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
<extension type="package" method="upgrade">
|
||||
<name>MokoSuiteCross</name>
|
||||
<packagename>mokosuitecross</packagename>
|
||||
<version>01.13.00</version>
|
||||
<version>01.13.13</version>
|
||||
<creationDate>2026-05-28</creationDate>
|
||||
<author>Moko Consulting</author>
|
||||
<authorEmail>hello@mokoconsulting.tech</authorEmail>
|
||||
@@ -76,6 +76,6 @@
|
||||
<blockChildUninstall>true</blockChildUninstall>
|
||||
|
||||
<updateservers>
|
||||
<server type="extension" name="MokoSuiteCross Updates">https://git.mokoconsulting.tech/MokoConsulting/MokoSuiteCross/updates.xml</server>
|
||||
<server type="extension" name="MokoSuiteCross Updates">https://git.mokoconsulting.tech/api/packages/MokoConsulting/generic/MokoSuiteCross/latest/updates.xml</server>
|
||||
</updateservers>
|
||||
</extension>
|
||||
|
||||
+92
-1
@@ -40,8 +40,8 @@ class Pkg_MokoSuiteCrossInstallerScript
|
||||
|
||||
public function postflight(string $type, InstallerAdapter $parent): void
|
||||
{
|
||||
// The download key must be restored regardless of the install outcome.
|
||||
$this->restoreDownloadKey();
|
||||
$this->warnMissingLicenseKey();
|
||||
|
||||
$db = Factory::getDbo();
|
||||
|
||||
@@ -76,6 +76,97 @@ class Pkg_MokoSuiteCrossInstallerScript
|
||||
|
||||
$this->detectPerfectPublisherPro($db);
|
||||
}
|
||||
|
||||
// Be smart: only run the success path (and show the licence notice, which
|
||||
// implies a completed install) when every child extension declared in the
|
||||
// package manifest actually registered. If any are missing, the package
|
||||
// did NOT install successfully — surface that instead of implying success.
|
||||
$missing = $this->missingChildExtensions($parent);
|
||||
|
||||
if ($missing !== [])
|
||||
{
|
||||
Factory::getApplication()->enqueueMessage(
|
||||
'<strong>MokoSuiteCross did not install completely.</strong> '
|
||||
. 'The following extension(s) failed to install: '
|
||||
. htmlspecialchars(implode(', ', $missing), ENT_QUOTES, 'UTF-8') . '. '
|
||||
. 'Resolve the errors shown above, then uninstall and reinstall the package.',
|
||||
'error'
|
||||
);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
$this->warnMissingLicenseKey();
|
||||
}
|
||||
|
||||
/**
|
||||
* Compare the child extensions the package manifest declares against what is
|
||||
* actually registered in #__extensions after the install/update. Returns the
|
||||
* label of each declared extension that is missing (i.e. failed to install);
|
||||
* an empty array means every child installed and the package succeeded.
|
||||
*
|
||||
* Fails open: any error returns [] so a query problem can never turn a good
|
||||
* install into a false "did not install completely" warning.
|
||||
*
|
||||
* @param InstallerAdapter $parent
|
||||
* @return string[]
|
||||
*/
|
||||
private function missingChildExtensions(InstallerAdapter $parent): array
|
||||
{
|
||||
$missing = [];
|
||||
|
||||
try
|
||||
{
|
||||
$manifest = $parent->getParent()->getManifest();
|
||||
|
||||
if (!$manifest || !isset($manifest->files) || !isset($manifest->files->file))
|
||||
{
|
||||
return [];
|
||||
}
|
||||
|
||||
$db = Factory::getDbo();
|
||||
|
||||
foreach ($manifest->files->file as $file)
|
||||
{
|
||||
$type = (string) $file['type'];
|
||||
$element = (string) $file['id'];
|
||||
$group = (string) $file['group'];
|
||||
|
||||
if ($element === '')
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
$query = $db->getQuery(true)
|
||||
->select('COUNT(*)')
|
||||
->from($db->quoteName('#__extensions'))
|
||||
->where($db->quoteName('element') . ' = ' . $db->quote($element));
|
||||
|
||||
if ($type !== '')
|
||||
{
|
||||
$query->where($db->quoteName('type') . ' = ' . $db->quote($type));
|
||||
}
|
||||
|
||||
// Plugins are only unique by element + folder (the manifest "group").
|
||||
if ($type === 'plugin' && $group !== '')
|
||||
{
|
||||
$query->where($db->quoteName('folder') . ' = ' . $db->quote($group));
|
||||
}
|
||||
|
||||
$db->setQuery($query);
|
||||
|
||||
if ((int) $db->loadResult() === 0)
|
||||
{
|
||||
$missing[] = $element . ($group !== '' ? ' (' . $group . ')' : '');
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (\Throwable $e)
|
||||
{
|
||||
return [];
|
||||
}
|
||||
|
||||
return $missing;
|
||||
}
|
||||
|
||||
private function detectPerfectPublisherPro($db): void
|
||||
|
||||
Reference in New Issue
Block a user