Compare commits

...

37 Commits

Author SHA1 Message Date
gitea-actions[bot] 95edfc106c chore(version): pre-release bump to 01.13.04-dev [skip ci] 2026-06-29 16:28:24 +00:00
jmiller d6848e6b90 fix: resolve 10 critical/medium bugs from deep dive audit
Universal: Pre-Release / Build Pre-Release (${{ inputs.stability || github.ref_name }}) (push) Successful in 11s
- deleteFromPlatforms(): use CredentialHelper::decrypt() + Joomla 6
  dispatcher pattern instead of json_decode + deprecated triggerEvent (#226, #228)
- PostsController: add ACL checks on retryFailed/purgePosted (#224)
- QueueProcessor: recover stale posting entries stuck >10min (#235)
- onContentChangeState: respect post_on_first_publish_only (#238)
- Uninstall SQL: add analytics + category_rules table drops (#225)
- Dashboard/Calendar: remove deprecated Sidebar::render() (#250)
- AnalyticsHelper: rewrite AJAX endpoints to query posts table (#246)
- Submenu helper: remove duplicate calendar key (#248)
- CHANGELOG: remove 3 duplicate version headers (#240)

Authored-by: Moko Consulting

Claude-Session: https://claude.ai/code/session_014iwLv3vUVsSxP8LyZ6STTj
2026-06-29 11:27:48 -05:00
gitea-actions[bot] 423f2f4cce chore(version): pre-release bump to 01.12.06-dev [skip ci] 2026-06-29 11:40:17 +00:00
jmiller 32bff8e7be Merge pull request 'fix: calendar completeness — submenu entries and language strings' (#216) from fix/changelog-security-readme into dev
Universal: Auto Version Bump / Version Bump (push) Has been skipped
Universal: Pre-Release / Build Pre-Release (${{ inputs.stability || github.ref_name }}) (push) Successful in 14s
2026-06-29 11:40:02 +00:00
gitea-actions[bot] 08a898cd7e chore(version): pre-release bump to 01.08.59-dev [skip ci]
RC Revert / Rename rc/ back to dev/ (pull_request) Has been skipped
Branch Cleanup / Delete merged branch (pull_request) Successful in 2s
2026-06-29 06:39:45 -05:00
gitea-actions[bot] 7de7cea10e chore(version): pre-release bump to 01.12.05-dev [skip ci] 2026-06-29 11:39:00 +00:00
jmiller dff90a26cf Merge pull request 'feat: visual post calendar with drag-drop rescheduling' (#215) from feature/160-visual-calendar into dev
Universal: Auto Version Bump / Version Bump (push) Has been skipped
Universal: Pre-Release / Build Pre-Release (${{ inputs.stability || github.ref_name }}) (push) Successful in 18s
2026-06-29 11:38:39 +00:00
jmiller 0d49195f52 feat: add visual post calendar with drag-drop rescheduling (#160)
Universal: PR Check / Branch Policy (pull_request) Successful in 2s
Universal: PR Check / Validate PR (pull_request) Failing after 6s
Universal: PR Check / Secret Scan (pull_request) Successful in 7s
RC Revert / Rename rc/ back to dev/ (pull_request) Has been skipped
Branch Cleanup / Delete merged branch (pull_request) Failing after 2s
Universal: Auto Version Bump / Version Bump (push) Successful in 13s
Generic: Project CI / Lint & Validate (pull_request) Successful in 50s
Joomla: Metadata Validation / Validate Joomla Metadata (pull_request) Successful in 52s
Generic: Project CI / Tests (pull_request) Has been cancelled
Universal: PR Check / Build RC Package (pull_request) Has been cancelled
Universal: PR Check / Report Issues (pull_request) Has been cancelled
Authored-by: Moko Consulting
2026-06-29 06:37:56 -05:00
gitea-actions[bot] 9da83f1d40 chore(version): pre-release bump to 01.12.04-dev [skip ci] 2026-06-29 11:37:09 +00:00
jmiller 96261987de Merge pull request 'feat: best time to post analytics with engagement heatmap' (#214) from feature/165-best-time-analytics into dev
Universal: Auto Version Bump / Version Bump (push) Has been skipped
Universal: Pre-Release / Build Pre-Release (${{ inputs.stability || github.ref_name }}) (push) Successful in 15s
2026-06-29 11:36:44 +00:00
jmiller e702eb8d9e feat: add best time to post analytics with engagement heatmap (#165)
Universal: PR Check / Branch Policy (pull_request) Successful in 2s
Branch Cleanup / Delete merged branch (pull_request) Failing after 1s
RC Revert / Rename rc/ back to dev/ (pull_request) Has been skipped
Universal: PR Check / Validate PR (pull_request) Failing after 6s
Universal: PR Check / Secret Scan (pull_request) Successful in 6s
Generic: Project CI / Lint & Validate (pull_request) Successful in 20s
Universal: Auto Version Bump / Version Bump (push) Successful in 11s
Joomla: Metadata Validation / Validate Joomla Metadata (pull_request) Successful in 40s
Generic: Project CI / Tests (pull_request) Has been cancelled
Universal: PR Check / Build RC Package (pull_request) Has been cancelled
Universal: PR Check / Report Issues (pull_request) Has been cancelled
Authored-by: Moko Consulting
2026-06-29 06:36:07 -05:00
gitea-actions[bot] febaa856c5 chore(version): pre-release bump to 01.12.03-dev [skip ci] 2026-06-29 11:34:43 +00:00
jmiller acd8da441b Merge pull request 'feat: social image generator with GD text overlay' (#213) from feature/157-social-image-generator into dev
Universal: Auto Version Bump / Version Bump (push) Has been skipped
Universal: Pre-Release / Build Pre-Release (${{ inputs.stability || github.ref_name }}) (push) Successful in 16s
2026-06-29 11:34:18 +00:00
jmiller 437189830f feat: add social image generator with GD text overlay (#157)
Universal: PR Check / Branch Policy (pull_request) Successful in 3s
Universal: PR Check / Validate PR (pull_request) Failing after 7s
RC Revert / Rename rc/ back to dev/ (pull_request) Has been skipped
Branch Cleanup / Delete merged branch (pull_request) Failing after 3s
Universal: PR Check / Secret Scan (pull_request) Successful in 9s
Universal: Auto Version Bump / Version Bump (push) Successful in 18s
Generic: Project CI / Lint & Validate (pull_request) Successful in 27s
Joomla: Metadata Validation / Validate Joomla Metadata (pull_request) Successful in 43s
Generic: Project CI / Tests (pull_request) Has been cancelled
Universal: PR Check / Build RC Package (pull_request) Has been cancelled
Universal: PR Check / Report Issues (pull_request) Has been cancelled
Replace complex multi-platform compositing with simpler spec-compliant
implementation:
- SocialImageHelper: 1200x630 OG images with solid background, title
  overlay using TTF fonts (or GD fallback), and site name watermark
- SocialImageController: AJAX endpoint with CSRF + ACL checks
- Config: enabled toggle, bg/text color, font size, show site name
- Content plugin: Generate Social Image button in Share Content panel
- Saves to media/com_mokosuitecross/social/ with SHA-256 filename

Authored-by: Moko Consulting
2026-06-29 06:33:17 -05:00
jmiller 1aa58e1d8d feat: add social image generator with GD-based OG image compositing (#157)
Replace basic single-size OG image generation with full-featured
multi-platform social image compositing:

- Platform-specific canvas sizes: Facebook 1200x630, Twitter 1200x675,
  Instagram 1080x1080, Stories 1080x1920
- Vertical linear gradient fallback when no source image available
- Semi-transparent overlay with configurable color and opacity (0-100%)
- Logo placement in top-right corner, auto-scaled to 15% of canvas width
- TTF text rendering with word wrap and text shadow for readability
- GD bitmap font fallback when no TTF fonts are available
- Configurable text position: top, center, or bottom
- Output to images/mokosuitecross/{articleId}_{platform}.jpg
- Cache clearing per article via clearCache() method
- ImageController AJAX endpoint with platform parameter validation
- Full config fieldset: enabled toggle, overlay color/opacity,
  text color/position, gradient start/end, logo upload

Authored-by: Moko Consulting
2026-06-29 06:32:18 -05:00
gitea-actions[bot] 4810371bc0 chore(version): pre-release bump to 01.12.01-dev [skip ci] 2026-06-28 19:57:53 +00:00
jmiller 36c9867857 Merge pull request 'fix: sync main back to dev (CI templates, release commits)' (#212) from fix/sync-main-to-dev into dev
Universal: Auto Version Bump / Version Bump (push) Has been skipped
Universal: Pre-Release / Build Pre-Release (${{ inputs.stability || github.ref_name }}) (push) Successful in 15s
2026-06-28 19:57:36 +00:00
jmiller 657e5b2091 chore: sync issue-branch.yml from Template-Generic [skip ci]
RC Revert / Rename rc/ back to dev/ (pull_request) Has been skipped
Branch Cleanup / Delete merged branch (pull_request) Successful in 2s
2026-06-28 19:39:16 +00:00
gitea-actions[bot] eda0d222ed chore: promote changelog [Unreleased] → [01.12.00] 2026-06-28 19:37:02 +00:00
gitea-actions[bot] 1627841983 chore(release): build 01.12.00 [skip ci] 2026-06-28 19:36:58 +00:00
jmiller b8ebd8a5fd Merge pull request 'release: v01.11.01 -- Joomla 6 event fix + docs update' (#211) from release/v01.11.01 into main 2026-06-28 19:36:39 +00:00
jmiller 488f4df65a merge: resolve dev/main divergence for v01.11.01 release
Universal: PR Check / Branch Policy (pull_request) Successful in 2s
Joomla: Extension CI / Release Readiness Check (pull_request) Failing after 6s
Universal: PR Check / Secret Scan (pull_request) Successful in 8s
Universal: PR Check / Validate PR (pull_request) Failing after 7s
Generic: Repo Health / Site Health (pull_request) Has been skipped
Generic: Repo Health / Access control (pull_request) Successful in 3s
Universal: Build & Release / Promote to RC (pull_request) Has been skipped
RC Revert / Rename rc/ back to dev/ (pull_request) Has been skipped
Branch Cleanup / Delete merged branch (pull_request) Successful in 2s
Generic: Project CI / Lint & Validate (pull_request) Successful in 26s
Universal: Build & Release / Build & Release Pipeline (pull_request) Successful in 24s
Joomla: Metadata Validation / Validate Joomla Metadata (pull_request) Successful in 56s
Joomla: Extension CI / Lint & Validate (pull_request) Failing after 9m27s
Universal: Workflow Sync Trigger / Sync workflows to live repos (pull_request) Failing after 21m47s
Generic: Project CI / Tests (pull_request) Has been cancelled
Joomla: Extension CI / Tests (PHP 8.2) (pull_request) Has been cancelled
Joomla: Extension CI / Tests (PHP 8.3) (pull_request) Has been cancelled
Joomla: Extension CI / PHPStan Analysis (pull_request) Has been cancelled
Joomla: Extension CI / Build RC Pre-Release (pull_request) Has been cancelled
Universal: PR Check / Build RC Package (pull_request) Has been cancelled
Universal: PR Check / Report Issues (pull_request) Has been cancelled
Generic: Repo Health / Scripts governance (pull_request) Has been cancelled
Generic: Repo Health / Repository health (pull_request) Has been cancelled
Generic: Repo Health / Report: Scripts Governance (pull_request) Has been cancelled
Generic: Repo Health / Report: Repository Health (pull_request) Has been cancelled
Authored-by: Moko Consulting
2026-06-28 14:33:40 -05:00
gitea-actions[bot] 96f789dcec chore(version): pre-release bump to 01.11.03-dev [skip ci] 2026-06-28 19:27:29 +00:00
jmiller 97619eea0c Merge pull request 'docs: Joomla 6 event fix changelog, update version target' (#209) from fix/joomla6-docs into dev
Universal: Auto Version Bump / Version Bump (push) Has been skipped
Universal: Pre-Release / Build Pre-Release (${{ inputs.stability || github.ref_name }}) (push) Successful in 16s
2026-06-28 19:26:53 +00:00
jmiller c6ab0cc438 docs: add Joomla 6 event fix to changelog, update Joomla version target
Universal: PR Check / Branch Policy (pull_request) Successful in 1s
Universal: PR Check / Validate PR (pull_request) Failing after 6s
Universal: PR Check / Secret Scan (pull_request) Successful in 7s
Joomla: Metadata Validation / Validate Joomla Metadata (pull_request) Successful in 11s
RC Revert / Rename rc/ back to dev/ (pull_request) Has been skipped
Branch Cleanup / Delete merged branch (pull_request) Successful in 1s
Universal: Pre-Release / Build Pre-Release (${{ inputs.stability || github.ref_name }}) (push) Failing after 6s
Universal: PR Check / Build RC Package (pull_request) Has been cancelled
Universal: PR Check / Report Issues (pull_request) Has been cancelled
- Add content plugin AfterSaveEvent fix to CHANGELOG under Fixed
- Update README to reflect Joomla 6 target (not 5/6)
- Replace em-dashes with ASCII dashes in CHANGELOG

Authored-by: Moko Consulting
2026-06-28 14:25:10 -05:00
gitea-actions[bot] a54b621f9d chore: promote changelog [Unreleased] → [01.11.00] 2026-06-28 18:49:03 +00:00
gitea-actions[bot] 84513a81a5 chore(release): build 01.11.00 [skip ci] 2026-06-28 18:49:00 +00:00
jmiller fceb3d5bf5 Merge pull request 'fix: Joomla 6 event type compatibility (hotfix)' (#208) from fix/joomla6-event-hotfix into main 2026-06-28 18:48:24 +00:00
jmiller 18e84fbcfe fix: remove Joomla 5-only event type hints for Joomla 6 compatibility
Universal: PR Check / Branch Policy (pull_request) Failing after 2s
Joomla: Extension CI / Release Readiness Check (pull_request) Failing after 5s
Universal: PR Check / Validate PR (pull_request) Failing after 5s
Generic: Repo Health / Site Health (pull_request) Has been skipped
Universal: PR Check / Secret Scan (pull_request) Successful in 6s
Generic: Repo Health / Access control (pull_request) Successful in 1s
RC Revert / Rename rc/ back to dev/ (pull_request) Has been skipped
Branch Cleanup / Delete merged branch (pull_request) Failing after 2s
Generic: Project CI / Lint & Validate (pull_request) Successful in 19s
Universal: Pre-Release / Build Pre-Release (${{ inputs.stability || github.ref_name }}) (push) Failing after 5s
Universal: Build & Release / Promote to RC (pull_request) Has been skipped
Joomla: Metadata Validation / Validate Joomla Metadata (pull_request) Successful in 42s
Universal: Build & Release / Build & Release Pipeline (pull_request) Successful in 18s
Universal: Workflow Sync Trigger / Sync workflows to live repos (pull_request) Successful in 5m40s
Joomla: Extension CI / Lint & Validate (pull_request) Failing after 5m55s
Generic: Project CI / Tests (pull_request) Has been cancelled
Joomla: Extension CI / Tests (PHP 8.2) (pull_request) Has been cancelled
Joomla: Extension CI / Tests (PHP 8.3) (pull_request) Has been cancelled
Joomla: Extension CI / PHPStan Analysis (pull_request) Has been cancelled
Joomla: Extension CI / Build RC Pre-Release (pull_request) Has been cancelled
Universal: PR Check / Build RC Package (pull_request) Has been cancelled
Universal: PR Check / Report Issues (pull_request) Has been cancelled
Generic: Repo Health / Scripts governance (pull_request) Has been cancelled
Generic: Repo Health / Repository health (pull_request) Has been cancelled
Generic: Repo Health / Report: Scripts Governance (pull_request) Has been cancelled
Generic: Repo Health / Report: Repository Health (pull_request) Has been cancelled
Joomla 6 dispatches Model\AfterSaveEvent instead of Content\AfterSaveEvent.
Remove strict type hints on onContentAfterSave() and onContentChangeState()
to accept both Joomla 5 and 6 event objects.

Authored-by: Moko Consulting
2026-06-28 13:47:45 -05:00
gitea-actions[bot] c552a12a0e chore(version): pre-release bump to 01.11.02-dev [skip ci] 2026-06-28 18:47:14 +00:00
jmiller 133944620b Merge pull request 'fix: Joomla 6 event type compatibility in content plugin' (#207) from fix/joomla6-event-handlers into dev
Universal: Auto Version Bump / Version Bump (push) Has been skipped
Universal: Pre-Release / Build Pre-Release (${{ inputs.stability || github.ref_name }}) (push) Successful in 14s
2026-06-28 18:46:11 +00:00
gitea-actions[bot] ed5a143439 chore(version): pre-release bump to 01.11.01-dev [skip ci]
RC Revert / Rename rc/ back to dev/ (pull_request) Has been skipped
Branch Cleanup / Delete merged branch (pull_request) Successful in 2s
2026-06-28 18:45:54 +00:00
jmiller c1fa8c816e fix: use typed Joomla 6 event parameters, remove legacy fallbacks
Universal: Pre-Release / Build Pre-Release (${{ inputs.stability || github.ref_name }}) (push) Successful in 10s
Joomla 6 dispatches Model\AfterSaveEvent and Model\ContentChangeStateEvent
instead of Content\AfterSaveEvent and Content\ContentChangeStateEvent.
Remove specific type hints to accept both Joomla 5 and 6 event objects.

Authored-by: Moko Consulting
2026-06-28 13:45:17 -05:00
jmiller 1617452a3f chore: sync issue-branch.yml from Template-Generic [skip ci] 2026-06-28 18:35:50 +00:00
gitea-actions[bot] 313035cfa2 chore: promote changelog [Unreleased] → [01.11.00] 2026-06-28 18:35:24 +00:00
gitea-actions[bot] a72028a1ad chore(release): build 01.11.00 [skip ci] 2026-06-28 18:35:20 +00:00
jmiller 24a40a4117 release: v01.08.00 -- AI captions, social images, calendar, analytics 2026-06-28 18:33:18 +00:00
82 changed files with 922 additions and 376 deletions
+1 -1
View File
@@ -5,7 +5,7 @@
# FILE INFORMATION
# DEFGROUP: Gitea.Workflow
# INGROUP: mokocli.Automation
# VERSION: 01.08.61
# VERSION: 01.13.04
# BRIEF: Auto-create feature branch when an issue is opened
name: "Universal: Issue Branch"
+19 -28
View File
@@ -1,6 +1,20 @@
# Changelog
## [Unreleased]
### Fixed
- **deleteFromPlatforms()**: Use `CredentialHelper::decrypt()` instead of raw `json_decode` for encrypted credentials (#226)
- **deleteFromPlatforms()**: Use Joomla 5/6 `getDispatcher()->dispatch()` instead of deprecated `triggerEvent()` (#228)
- **PostsController**: Add ACL checks to `retryFailed()` and `purgePosted()` queue actions (#224)
- **QueueProcessor**: Recover stale `posting` entries stuck > 10 minutes back to `queued` (#235)
- **onContentChangeState**: Respect `post_on_first_publish_only` setting when state-toggling articles (#238)
- **Uninstall SQL**: Add missing `analytics` and `category_rules` table drops (#225)
- **Dashboard/Calendar views**: Remove deprecated `Sidebar::render()` calls (#250)
- **AnalyticsHelper**: Rewrite AJAX heatmap/best-times to query `#__mokosuitecross_posts` instead of empty `analytics` table (#246)
- **Submenu helper**: Remove duplicate `calendar` key in `addSubmenu()` (#248)
- **CHANGELOG**: Remove 3 duplicate version headers (#240)
## [01.12.00] --- 2026-06-28
### Added
- **Visual post calendar**: Monthly calendar grid view showing scheduled, queued, and posted cross-posts with status badges (#160)
- **Calendar navigation**: Month-by-month navigation with today highlighting (#160)
@@ -8,8 +22,9 @@
- **Analytics service filter**: Filter heatmap and stats by service type with configurable date range
- **Analytics service breakdown**: Per-service success rate, failure count, and average posts per day
- **Analytics AJAX endpoint**: JSON heatmap data for dynamic filtering without page reload
- **Social image generator**: Generate Open Graph images with article title overlay using PHP GD library (#157)
- **Social image config**: Background color, text color, overlay style, and site name override in component options (#157)
- **Social image generator**: Generate branded 1200x630 OG images with article title overlay using PHP GD (#157)
- **Social image config**: Background color, text color, font size, and site name branding options (#157)
- **Generate Social Image button**: One-click image generation in the Share Content panel (#157)
- **AI caption generation**: Generate platform-optimized cross-post captions from article content using Claude or OpenAI (#161)
- **AI provider config**: New "AI Caption Generation" fieldset in component options with provider, API key, model, and tone settings
- **AI Generate button**: One-click AI generation button in the Share Content panel that fills all caption fields
@@ -42,10 +57,9 @@
- **PHPUnit test suite**: Unit tests for models, helpers, and service plugins (#132)
### Fixed
- **Content plugin**: Remove Joomla 5 typed event hints -- Joomla 6 dispatches `Model\AfterSaveEvent` instead of `Content\AfterSaveEvent`, causing fatal TypeError on article save
- **PreviewController**: Add ACL check and parameterized query to prevent unauthorized article access (IDOR)
- Webservices plugin Joomla 6 compatibility `onBeforeApiRoute` receives `BeforeApiRouteEvent` object, extract router via `$event->getRouter()`
## [01.07.00] --- 2026-06-23
- Webservices plugin Joomla 6 compatibility -- `onBeforeApiRoute` receives `BeforeApiRouteEvent` object, extract router via `$event->getRouter()`
## [01.07.00] --- 2026-06-23
@@ -60,8 +74,6 @@
## [01.05.00] --- 2026-06-23
## [01.05.00] --- 2026-06-23
### Added
- **Instagram plugin**: Cross-post to Instagram via Meta Content Publishing API (2-step container flow)
- **YouTube plugin**: Cross-post to YouTube via Data API v3 channel bulletins
@@ -93,24 +105,3 @@
- **Bluesky**: Replaced md5() with hash('sha256', ...) for cache key
- **ServiceController**: Exception details no longer exposed to client
- **License warning**: Removed duplicate from system plugin -- install script already shows it with direct edit link
## [01.04.01] --- 2026-06-21
## [01.04.01] --- 2026-06-21
## [01.04.00] --- 2026-06-21
### Fixed
- **Package manifest**: Added missing `plg_system_mokosuitecross_events` and `plg_system_mokosuitecross_gallery` to `pkg_mokosuitecross.xml` — these system plugins were not installed with the package
- **Cleanup**: Removed old `src/` directory (pre-rename cruft with `mokojoomcross` files)
## [01.03.00] --- 2026-06-21
<!-- VERSION: 01.08.61 -->
All notable changes to MokoSuiteCross will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/).
+1 -1
View File
@@ -14,7 +14,7 @@
DEFGROUP: Template-Joomla
INGROUP: Template-Joomla.Documentation
REPO: https://github.com/mokoconsulting-tech/Template-Joomla/
VERSION: 01.01.00
VERSION: 01.13.04
PATH: ./CODE_OF_CONDUCT.md
BRIEF: Community expectations and enforcement guidelines
NOTE: Adapted with attribution from the Contributor Covenant v2.1
+1 -1
View File
@@ -19,7 +19,7 @@
DEFGROUP: mokoconsulting-tech.Template-Joomla
INGROUP: MokoStandards.Governance
REPO: https://github.com/mokoconsulting-tech/Template-Joomla
VERSION: 01.01.00
VERSION: 01.13.04
PATH: /GOVERNANCE.md
BRIEF: Project governance rules, roles, and decision process for Template-Joomla
-->
+2 -2
View File
@@ -1,8 +1,8 @@
# MokoSuiteCross
<!-- VERSION: 01.08.61 -->
<!-- VERSION: 01.13.04 -->
Cross-posting Joomla content to social media, email marketing, and chat platforms for Joomla 5/6.
Cross-posting Joomla content to social media, email marketing, and chat platforms for Joomla 6.
## Overview
+1 -1
View File
@@ -23,7 +23,7 @@ DEFGROUP: Template-Joomla
INGROUP: Template-Joomla.Documentation
REPO: https://git.mokoconsulting.tech/MokoConsulting/Template-Joomla
PATH: /SECURITY.md
VERSION: 01.01.00
VERSION: 01.13.04
BRIEF: Security vulnerability reporting and handling policy
-->
@@ -266,7 +266,7 @@
</field>
</fieldset>
<fieldset name="social_image" label="COM_MOKOSUITECROSS_CONFIG_SOCIAL_IMAGE">
<fieldset name="social_image" label="COM_MOKOSUITECROSS_CONFIG_SOCIAL_IMAGE">
<field
name="social_image_enabled"
type="radio"
@@ -572,38 +572,20 @@ COM_MOKOSUITECROSS_AI_GENERATED="AI captions generated successfully."
COM_MOKOSUITECROSS_AI_ERROR="AI generation failed: %s"
COM_MOKOSUITECROSS_AI_NOT_CONFIGURED="AI is not configured. Go to Options to set up a provider and API key."
; Analytics
COM_MOKOSUITECROSS_SUBMENU_ANALYTICS="Analytics"
COM_MOKOSUITECROSS_ANALYTICS_PERIOD="Time Period"
COM_MOKOSUITECROSS_ANALYTICS_SERVICE_FILTER="Service"
COM_MOKOSUITECROSS_ANALYTICS_ALL_SERVICES="All Services"
COM_MOKOSUITECROSS_ANALYTICS_BEST_TIMES="Best Times to Post"
COM_MOKOSUITECROSS_ANALYTICS_HEATMAP="Engagement Heatmap"
COM_MOKOSUITECROSS_ANALYTICS_HOURLY="Hourly Distribution"
COM_MOKOSUITECROSS_ANALYTICS_DAILY="Day of Week Distribution"
COM_MOKOSUITECROSS_ANALYTICS_NO_DATA="Not enough posting data to generate recommendations. Post at least 3 times per time slot over the selected period."
COM_MOKOSUITECROSS_ANALYTICS_POSTS_SUCCESS="%d of %d successful"
COM_MOKOSUITECROSS_ANALYTICS_DAY_SUN="Sun"
COM_MOKOSUITECROSS_ANALYTICS_DAY_MON="Mon"
COM_MOKOSUITECROSS_ANALYTICS_DAY_TUE="Tue"
COM_MOKOSUITECROSS_ANALYTICS_DAY_WED="Wed"
COM_MOKOSUITECROSS_ANALYTICS_DAY_THU="Thu"
COM_MOKOSUITECROSS_ANALYTICS_DAY_FRI="Fri"
COM_MOKOSUITECROSS_ANALYTICS_DAY_SAT="Sat"
COM_MOKOSUITECROSS_ANALYTICS_LEGEND_HIGH="High success rate"
COM_MOKOSUITECROSS_ANALYTICS_LEGEND_MEDIUM="Medium success rate"
COM_MOKOSUITECROSS_ANALYTICS_LEGEND_LOW="Low success rate"
COM_MOKOSUITECROSS_ANALYTICS_LEGEND_NONE="No data"
COM_MOKOSUITECROSS_PERIOD_180_DAYS="Last 180 days"
COM_MOKOSUITECROSS_PERIOD_365_DAYS="Last 365 days"
; Category Rules
COM_MOKOSUITECROSS_CONFIG_CATEGORY_RULES="Category Rules"
COM_MOKOSUITECROSS_CONFIG_CATEGORY_RULES_NOTE="Category Routing"
COM_MOKOSUITECROSS_CONFIG_CATEGORY_RULES_NOTE_DESC="Category routing rules let you map Joomla categories to specific cross-post services. When rules exist for a category, only those services receive posts. When no rules exist, all services are used (default behaviour). Rules are managed in the database table #__mokosuitecross_category_rules. A full admin UI will be added in a future release."
; Calendar View
COM_MOKOSUITECROSS_CALENDAR_PREV_MONTH="Previous"
COM_MOKOSUITECROSS_CALENDAR_NEXT_MONTH="Next"
; Post Calendar
COM_MOKOSUITECROSS_CALENDAR="Post Calendar"
COM_MOKOSUITECROSS_CALENDAR_DESC="Visual calendar of scheduled and posted content"
COM_MOKOSUITECROSS_SUBMENU_CALENDAR="Calendar"
COM_MOKOSUITECROSS_CALENDAR_TODAY="Today"
COM_MOKOSUITECROSS_SUBMENU_CALENDAR="Post Calendar"
COM_MOKOSUITECROSS_CALENDAR_MONTH="Month"
COM_MOKOSUITECROSS_CALENDAR_WEEK="Week"
COM_MOKOSUITECROSS_CALENDAR_LIST="List"
COM_MOKOSUITECROSS_CALENDAR_RESCHEDULE_SUCCESS="Post rescheduled successfully"
COM_MOKOSUITECROSS_CALENDAR_RESCHEDULE_ERROR="Failed to reschedule post"
COM_MOKOSUITECROSS_CALENDAR_CANNOT_RESCHEDULE="Only scheduled or queued posts can be rescheduled"
COM_MOKOSUITECROSS_CALENDAR_LOAD_ERROR="Failed to load calendar events"
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<extension type="component" method="upgrade">
<name>com_mokosuitecross</name>
<version>01.08.61</version>
<version>01.13.04</version>
<creationDate>2026-05-28</creationDate>
<author>Moko Consulting</author>
<authorEmail>hello@mokoconsulting.tech</authorEmail>
@@ -96,6 +96,27 @@ INSERT INTO `#__mokosuitecross_templates` (`service_type`, `title`, `template_bo
('instagram', 'Instagram Default', '{social}\n\n{hashtags}', 1, 21, NOW()),
('youtube', 'YouTube Default', '{social}\n\n{url}', 1, 22, NOW());
CREATE TABLE IF NOT EXISTS `#__mokosuitecross_analytics` (
`id` int unsigned NOT NULL AUTO_INCREMENT,
`post_id` int unsigned NOT NULL,
`service_id` int unsigned NOT NULL,
`service_type` varchar(50) NOT NULL DEFAULT '',
`posted_at` datetime DEFAULT NULL,
`day_of_week` tinyint unsigned NOT NULL DEFAULT 0,
`hour_of_day` tinyint unsigned NOT NULL DEFAULT 0,
`impressions` int unsigned NOT NULL DEFAULT 0,
`engagements` int unsigned NOT NULL DEFAULT 0,
`clicks` int unsigned NOT NULL DEFAULT 0,
`shares` int unsigned NOT NULL DEFAULT 0,
`engagement_rate` decimal(5,2) NOT NULL DEFAULT 0.00,
`created` datetime NOT NULL,
PRIMARY KEY (`id`),
KEY `idx_service_type` (`service_type`),
KEY `idx_day_hour` (`day_of_week`, `hour_of_day`),
KEY `idx_post` (`post_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
CREATE TABLE IF NOT EXISTS `#__mokosuitecross_category_rules` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`category_id` int(10) unsigned NOT NULL,
@@ -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`;
@@ -1 +1,23 @@
/* 01.08.54 — no schema changes */
-- MokoSuiteCross 01.08.54 -- Best time to post analytics
-- Copyright (C) 2026 Moko Consulting. All rights reserved.
-- SPDX-License-Identifier: GPL-3.0-or-later
CREATE TABLE IF NOT EXISTS `#__mokosuitecross_analytics` (
`id` int unsigned NOT NULL AUTO_INCREMENT,
`post_id` int unsigned NOT NULL,
`service_id` int unsigned NOT NULL,
`service_type` varchar(50) NOT NULL DEFAULT '',
`posted_at` datetime DEFAULT NULL,
`day_of_week` tinyint unsigned NOT NULL DEFAULT 0,
`hour_of_day` tinyint unsigned NOT NULL DEFAULT 0,
`impressions` int unsigned NOT NULL DEFAULT 0,
`engagements` int unsigned NOT NULL DEFAULT 0,
`clicks` int unsigned NOT NULL DEFAULT 0,
`shares` int unsigned NOT NULL DEFAULT 0,
`engagement_rate` decimal(5,2) NOT NULL DEFAULT 0.00,
`created` datetime NOT NULL,
PRIMARY KEY (`id`),
KEY `idx_service_type` (`service_type`),
KEY `idx_day_hour` (`day_of_week`, `hour_of_day`),
KEY `idx_post` (`post_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
@@ -0,0 +1 @@
/* 01.08.59 — no schema changes */
@@ -0,0 +1 @@
/* 01.11.00 — no schema changes */
@@ -0,0 +1 @@
/* 01.11.01 — no schema changes */
@@ -0,0 +1 @@
/* 01.11.02 — no schema changes */
@@ -0,0 +1 @@
/* 01.11.03 — no schema changes */
@@ -0,0 +1 @@
/* 01.12.00 — no schema changes */
@@ -0,0 +1 @@
/* 01.12.01 — no schema changes */
@@ -0,0 +1 @@
/* 01.12.03 — no schema changes */
@@ -0,0 +1 @@
/* 01.12.04 — no schema changes */
@@ -0,0 +1 @@
/* 01.12.05 — no schema changes */
@@ -0,0 +1 @@
/* 01.12.06 — no schema changes */
@@ -0,0 +1 @@
/* 01.13.04 — no schema changes */
@@ -14,11 +14,84 @@ namespace Joomla\Component\MokoSuiteCross\Administrator\Controller;
defined('_JEXEC') or die;
use Joomla\CMS\MVC\Controller\BaseController;
use Joomla\CMS\Session\Session;
use Joomla\Component\MokoSuiteCross\Administrator\Helper\AnalyticsHelper;
class AnalyticsController extends BaseController
{
public function display($cachable = false, $urlparams = []): static
/**
* Return heatmap grid data as JSON.
*
* Query params: service_type (string), days (int, default 90)
*/
public function heatmap(): void
{
return parent::display($cachable, $urlparams);
if (!Session::checkToken('get')) {
echo json_encode(['success' => false, 'error' => 'Invalid token']);
$this->app->close();
return;
}
$user = $this->app->getIdentity();
if (!$user->authorise('core.manage', 'com_mokosuitecross')) {
echo json_encode(['success' => false, 'error' => 'Permission denied']);
$this->app->close();
return;
}
$serviceType = $this->input->getCmd('service_type', '');
$days = $this->input->getInt('days', 90);
$grid = AnalyticsHelper::getHeatmapData($serviceType, $days);
$bestTimes = AnalyticsHelper::getBestTimes($serviceType, 3);
$this->app->setHeader('Content-Type', 'application/json; charset=utf-8');
echo json_encode([
'success' => true,
'grid' => $grid,
'best_times' => $bestTimes,
]);
$this->app->close();
}
/**
* Return the top posting times as JSON.
*
* Query params: service_type (string), limit (int, default 5)
*/
public function besttimes(): void
{
if (!Session::checkToken('get')) {
echo json_encode(['success' => false, 'error' => 'Invalid token']);
$this->app->close();
return;
}
$user = $this->app->getIdentity();
if (!$user->authorise('core.manage', 'com_mokosuitecross')) {
echo json_encode(['success' => false, 'error' => 'Permission denied']);
$this->app->close();
return;
}
$serviceType = $this->input->getCmd('service_type', '');
$limit = $this->input->getInt('limit', 5);
$bestTimes = AnalyticsHelper::getBestTimes($serviceType, $limit);
$serviceBreakdown = AnalyticsHelper::getServiceBreakdown();
$this->app->setHeader('Content-Type', 'application/json; charset=utf-8');
echo json_encode([
'success' => true,
'best_times' => $bestTimes,
'service_breakdown' => $serviceBreakdown,
]);
$this->app->close();
}
}
@@ -13,12 +13,256 @@ namespace Joomla\Component\MokoSuiteCross\Administrator\Controller;
defined('_JEXEC') or die;
use Joomla\CMS\Factory;
use Joomla\CMS\Language\Text;
use Joomla\CMS\MVC\Controller\BaseController;
use Joomla\CMS\Session\Session;
use Joomla\Component\MokoSuiteCross\Administrator\Table\PostTable;
/**
* Calendar controller -- provides AJAX endpoints for the visual post calendar.
*
* Endpoints:
* task=calendar.events -- GET JSON feed for FullCalendar (filtered by start/end)
* task=calendar.reschedule -- POST reschedule a post to a new date/time
*/
class CalendarController extends BaseController
{
public function display($cachable = false, $urlparams = []): static
/**
* Return posts as FullCalendar-compatible JSON events.
*
* Query params: start, end (ISO 8601 date range from FullCalendar).
*
* @return void
*/
public function events(): void
{
return parent::display($cachable, $urlparams);
$app = $this->app;
$db = Factory::getDbo();
// ACL check
if (!$app->getIdentity()->authorise('core.manage', 'com_mokosuitecross')) {
$this->sendJsonResponse(['error' => 'Forbidden'], 403);
return;
}
// FullCalendar sends start/end as ISO date strings
$start = $this->input->getString('start', '');
$end = $this->input->getString('end', '');
$query = $db->getQuery(true)
->select([
'p.' . $db->quoteName('id'),
'p.' . $db->quoteName('article_id'),
'p.' . $db->quoteName('service_id'),
'p.' . $db->quoteName('status'),
'p.' . $db->quoteName('scheduled_at'),
'p.' . $db->quoteName('posted_at'),
'p.' . $db->quoteName('created'),
'p.' . $db->quoteName('message'),
'a.' . $db->quoteName('title', 'article_title'),
's.' . $db->quoteName('title', 'service_title'),
's.' . $db->quoteName('service_type'),
])
->from($db->quoteName('#__mokosuitecross_posts', 'p'))
->leftJoin(
$db->quoteName('#__content', 'a')
. ' ON ' . $db->quoteName('a.id') . ' = ' . $db->quoteName('p.article_id')
)
->leftJoin(
$db->quoteName('#__mokosuitecross_services', 's')
. ' ON ' . $db->quoteName('s.id') . ' = ' . $db->quoteName('p.service_id')
)
->order($db->quoteName('p.created') . ' DESC');
// Filter by date range when provided
if ($start !== '') {
$dateExpr = 'COALESCE(p.scheduled_at, p.posted_at, p.created)';
$query->where($dateExpr . ' >= ' . $db->quote($start));
}
if ($end !== '') {
$dateExpr = 'COALESCE(p.scheduled_at, p.posted_at, p.created)';
$query->where($dateExpr . ' <= ' . $db->quote($end));
}
$db->setQuery($query);
$rows = $db->loadObjectList() ?: [];
// Map status to colour
$statusColors = [
'posted' => '#28a745',
'scheduled' => '#007bff',
'queued' => '#ffc107',
'failed' => '#dc3545',
'posting' => '#17a2b8',
];
$events = [];
foreach ($rows as $row) {
// Pick the best date for the calendar event
$eventDate = $row->scheduled_at ?: ($row->posted_at ?: $row->created);
// Skip rows with no usable date
if (empty($eventDate) || $eventDate === '0000-00-00 00:00:00') {
continue;
}
$title = ($row->article_title ?: 'Post #' . $row->id);
if ($row->service_title) {
$title .= ' - ' . $row->service_title;
}
$events[] = [
'id' => (int) $row->id,
'title' => $title,
'start' => $eventDate,
'color' => $statusColors[$row->status] ?? '#6c757d',
'url' => 'index.php?option=com_mokosuitecross&task=post.edit&id=' . (int) $row->id,
'extendedProps' => [
'status' => $row->status,
'service_type' => $row->service_type ?? '',
'article_id' => (int) $row->article_id,
'service_id' => (int) $row->service_id,
'message' => mb_substr($row->message ?? '', 0, 200),
],
];
}
$this->sendJsonResponse($events, 200);
}
/**
* Reschedule a post to a new date/time via drag-drop.
*
* POST params: post_id (int), new_date (ISO 8601 datetime string).
*
* @return void
*/
public function reschedule(): void
{
$app = $this->app;
// CSRF check
if (!Session::checkToken('post')) {
$this->sendJsonResponse(['error' => Text::_('JINVALID_TOKEN')], 403);
return;
}
// ACL check
if (!$app->getIdentity()->authorise('core.edit', 'com_mokosuitecross')) {
$this->sendJsonResponse(['error' => 'Forbidden'], 403);
return;
}
$postId = $this->input->getInt('post_id', 0);
$newDate = $this->input->getString('new_date', '');
if ($postId < 1 || $newDate === '') {
$this->sendJsonResponse(
['error' => Text::_('COM_MOKOSUITECROSS_CALENDAR_RESCHEDULE_ERROR')],
400
);
return;
}
// Validate the date format
try {
$dateObj = Factory::getDate($newDate);
} catch (\Exception $e) {
$this->sendJsonResponse(
['error' => Text::_('COM_MOKOSUITECROSS_CALENDAR_RESCHEDULE_ERROR')],
400
);
return;
}
// Load the post using Table bind/check/store pattern
$db = Factory::getDbo();
$table = new PostTable($db);
if (!$table->load($postId)) {
$this->sendJsonResponse(
['error' => Text::_('COM_MOKOSUITECROSS_CALENDAR_RESCHEDULE_ERROR')],
404
);
return;
}
// Only allow rescheduling of scheduled or queued posts
$allowedStatuses = ['scheduled', 'queued'];
if (!in_array($table->status, $allowedStatuses, true)) {
$this->sendJsonResponse(
['error' => Text::_('COM_MOKOSUITECROSS_CALENDAR_RESCHEDULE_ERROR')],
400
);
return;
}
// Update the post
$data = [
'scheduled_at' => $dateObj->toSql(),
'status' => 'scheduled',
'modified' => Factory::getDate()->toSql(),
];
if (!$table->bind($data) || !$table->check() || !$table->store()) {
$this->sendJsonResponse(
['error' => Text::_('COM_MOKOSUITECROSS_CALENDAR_RESCHEDULE_ERROR')],
500
);
return;
}
// Log the reschedule
$log = (object) [
'post_id' => $postId,
'service_id' => (int) $table->service_id,
'level' => 'info',
'message' => sprintf('Post rescheduled to %s via calendar drag-drop', $dateObj->toSql()),
'context' => '{}',
'created' => Factory::getDate()->toSql(),
];
$db->insertObject('#__mokosuitecross_logs', $log);
$this->sendJsonResponse(
[
'success' => true,
'message' => Text::_('COM_MOKOSUITECROSS_CALENDAR_RESCHEDULE_SUCCESS'),
],
200
);
}
/**
* Send a JSON response and close the application.
*
* @param array $data Response data
* @param int $httpCode HTTP status code
*
* @return void
*/
private function sendJsonResponse(array $data, int $httpCode): void
{
$app = $this->app;
$app->setHeader('Content-Type', 'application/json; charset=utf-8');
$app->setHeader('Status', (string) $httpCode);
echo json_encode($data, JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES);
$app->close();
}
}
@@ -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)
@@ -17,7 +17,6 @@ use Joomla\CMS\Component\ComponentHelper;
use Joomla\CMS\Factory;
use Joomla\CMS\MVC\Controller\BaseController;
use Joomla\CMS\Session\Session;
use Joomla\CMS\Uri\Uri;
use Joomla\Component\MokoSuiteCross\Administrator\Helper\SocialImageHelper;
class SocialImageController extends BaseController
@@ -33,7 +32,7 @@ class SocialImageController extends BaseController
$user = $this->app->getIdentity();
if (!$user->authorise('core.manage', 'com_mokosuitecross')) {
if (!$user->authorise('core.edit', 'com_mokosuitecross')) {
echo json_encode(['success' => false, 'error' => 'Permission denied']);
$this->app->close();
@@ -49,47 +48,40 @@ class SocialImageController extends BaseController
return;
}
$params = ComponentHelper::getParams('com_mokosuitecross');
if (!(int) $params->get('social_image_enabled', 0)) {
echo json_encode(['success' => false, 'error' => 'Social image generator is not enabled']);
$this->app->close();
return;
}
$db = Factory::getDbo();
$query = $db->getQuery(true)
->select($db->quoteName(['id', 'title', 'images']))
->select($db->quoteName('title'))
->from($db->quoteName('#__content'))
->where($db->quoteName('id') . ' = ' . $articleId);
$db->setQuery($query);
$article = $db->loadObject();
$title = $db->loadResult();
if (!$article) {
if (!$title) {
echo json_encode(['success' => false, 'error' => 'Article not found']);
$this->app->close();
return;
}
$params = ComponentHelper::getParams('com_mokosuitecross');
$siteName = $params->get('social_image_site_name', '') ?: Factory::getApplication()->get('sitename', '');
$siteName = $this->app->get('sitename', '');
$options = [
'bg_color' => $params->get('social_image_bg_color', '#1a1a2e'),
'text_color' => $params->get('social_image_text_color', '#ffffff'),
'overlay' => $params->get('social_image_overlay', 'dark'),
$config = [
'bg_color' => $params->get('social_image_bg_color', '#1a1a2e'),
'text_color' => $params->get('social_image_text_color', '#ffffff'),
'font_size' => $params->get('social_image_font_size', 48),
'show_site_name' => (bool) $params->get('social_image_show_site_name', 1),
];
$backgroundPath = null;
$images = json_decode($article->images ?? '{}', true);
if (!empty($images['image_intro'])) {
$backgroundPath = JPATH_ROOT . '/' . ltrim($images['image_intro'], '/');
} elseif (!empty($images['image_fulltext'])) {
$backgroundPath = JPATH_ROOT . '/' . ltrim($images['image_fulltext'], '/');
}
try {
$imagePath = SocialImageHelper::generate($article->title, $siteName, $backgroundPath, $options);
$imageUrl = str_replace(JPATH_ROOT, Uri::root(true), str_replace('\\', '/', $imagePath));
$result = ['success' => true, 'image_url' => $imageUrl, 'image_path' => $imagePath];
} catch (\Throwable $e) {
$result = ['success' => false, 'error' => $e->getMessage()];
}
$result = SocialImageHelper::generate($title, $siteName, $config);
$this->app->setHeader('Content-Type', 'application/json; charset=utf-8');
echo json_encode($result);
@@ -17,144 +17,234 @@ use Joomla\CMS\Factory;
class AnalyticsHelper
{
private static array $dayNames = ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday'];
/**
* Record or update engagement metrics for a post.
*/
public static function recordEngagement(int $postId, int $serviceId, string $serviceType, array $metrics): bool
{
$db = Factory::getDbo();
public static function getPostingHeatmap(string $serviceType = '', int $days = 90): array
$postedAt = $metrics['posted_at'] ?? null;
if ($postedAt) {
$timestamp = strtotime($postedAt);
$dayOfWeek = (int) date('w', $timestamp);
$hourOfDay = (int) date('G', $timestamp);
} else {
$dayOfWeek = 0;
$hourOfDay = 0;
}
$impressions = (int) ($metrics['impressions'] ?? 0);
$engagements = (int) ($metrics['engagements'] ?? 0);
$clicks = (int) ($metrics['clicks'] ?? 0);
$shares = (int) ($metrics['shares'] ?? 0);
$engagementRate = $impressions > 0
? round(($engagements / $impressions) * 100, 2)
: 0.00;
$query = $db->getQuery(true)
->select($db->quoteName('id'))
->from($db->quoteName('#__mokosuitecross_analytics'))
->where($db->quoteName('post_id') . ' = ' . $postId)
->where($db->quoteName('service_id') . ' = ' . $serviceId);
$db->setQuery($query);
$existingId = $db->loadResult();
if ($existingId) {
$query = $db->getQuery(true)
->update($db->quoteName('#__mokosuitecross_analytics'))
->set($db->quoteName('impressions') . ' = ' . $impressions)
->set($db->quoteName('engagements') . ' = ' . $engagements)
->set($db->quoteName('clicks') . ' = ' . $clicks)
->set($db->quoteName('shares') . ' = ' . $shares)
->set($db->quoteName('engagement_rate') . ' = ' . $engagementRate)
->where($db->quoteName('id') . ' = ' . (int) $existingId);
$db->setQuery($query);
$db->execute();
return true;
}
$record = (object) [
'post_id' => $postId,
'service_id' => $serviceId,
'service_type' => $serviceType,
'posted_at' => $postedAt,
'day_of_week' => $dayOfWeek,
'hour_of_day' => $hourOfDay,
'impressions' => $impressions,
'engagements' => $engagements,
'clicks' => $clicks,
'shares' => $shares,
'engagement_rate' => $engagementRate,
'created' => Factory::getDate()->toSql(),
];
$db->insertObject('#__mokosuitecross_analytics', $record);
return true;
}
/**
* Get heatmap data as a 7x24 grid derived from actual post success data.
*/
public static function getHeatmapData(string $serviceType = '', int $days = 90): array
{
$db = Factory::getDbo();
$query = $db->getQuery(true)
->select('DAYOFWEEK(' . $db->quoteName('p.posted_at') . ') - 1 AS dow')
->select('HOUR(' . $db->quoteName('p.posted_at') . ') AS hr')
->select('COUNT(*) AS cnt')
->select([
'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_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');
if ($days > 0) {
$since = Factory::getDate('now - ' . $days . ' days')->toSql();
$query->where($db->quoteName('p.posted_at') . ' >= ' . $db->quote($since));
}
->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->join('INNER', $db->quoteName('#__mokosuitecross_services', 's') . ' ON ' . $db->quoteName('s.id') . ' = ' . $db->quoteName('p.service_id'))
->where($db->quoteName('s.service_type') . ' = ' . $db->quote($serviceType));
$query->where($db->quoteName('s.service_type') . ' = ' . $db->quote($serviceType));
}
$query->group('dow, hr')
->order('dow ASC, hr ASC');
if ($days > 0) {
$cutoff = Factory::getDate('-' . $days . ' days')->toSql();
$query->where($db->quoteName('p.posted_at') . ' >= ' . $db->quote($cutoff));
}
$db->setQuery($query);
$rows = $db->loadObjectList();
$maxCount = 1;
foreach ($rows as $row) {
if ((int) $row->post_count > $maxCount) {
$maxCount = (int) $row->post_count;
}
}
$grid = [];
for ($d = 0; $d < 7; $d++) {
$grid[$d] = array_fill(0, 24, 0);
for ($h = 0; $h < 24; $h++) {
$grid[$d][$h] = ['avg_rate' => 0.00, 'post_count' => 0];
}
}
foreach ($rows as $row) {
$grid[(int) $row->dow][(int) $row->hr] = (int) $row->cnt;
$count = (int) $row->post_count;
$grid[(int) $row->day_of_week][(int) $row->hour_of_day] = [
'avg_rate' => round(($count / $maxCount) * 100, 2),
'post_count' => $count,
];
}
return $grid;
}
public static function getBestTimes(string $serviceType = '', int $days = 90, int $limit = 5): array
/**
* Get the best times to post ranked by post success frequency.
*/
public static function getBestTimes(string $serviceType = '', int $limit = 5): array
{
$grid = self::getPostingHeatmap($serviceType, $days);
$slots = [];
$db = Factory::getDbo();
foreach ($grid as $dow => $hours) {
foreach ($hours as $hour => $count) {
if ($count > 0) {
$slots[] = [
'day' => self::$dayNames[$dow],
'hour' => $hour,
'count' => $count,
'label' => self::$dayNames[$dow] . ' ' . self::formatHour($hour),
];
}
}
$query = $db->getQuery(true)
->select([
'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_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('post_count DESC');
if ($serviceType !== '') {
$query->where($db->quoteName('s.service_type') . ' = ' . $db->quote($serviceType));
}
usort($slots, static fn($a, $b) => $b['count'] <=> $a['count']);
$db->setQuery($query, 0, $limit);
$rows = $db->loadAssocList();
return \array_slice($slots, 0, $limit);
$dayNames = ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday'];
$results = [];
foreach ($rows as $row) {
$hour = (int) $row['hour_of_day'];
$ampm = $hour < 12 ? 'AM' : 'PM';
$hour12 = $hour % 12 ?: 12;
$results[] = [
'day_of_week' => (int) $row['day_of_week'],
'day_name' => $dayNames[(int) $row['day_of_week']],
'hour_of_day' => $hour,
'hour_label' => $hour12 . ':00 ' . $ampm,
'avg_rate' => round((float) $row['post_count'], 2),
'post_count' => (int) $row['post_count'],
];
}
return $results;
}
/**
* Get stats grouped by service type from actual post data.
*/
public static function getServiceBreakdown(int $days = 30): array
{
$db = Factory::getDbo();
$query = $db->getQuery(true)
->select($db->quoteName('s.service_type'))
->select($db->quoteName('s.title', 'service_title'))
->select('COUNT(*) AS total')
->select('SUM(CASE WHEN ' . $db->quoteName('p.status') . ' = ' . $db->quote('posted') . ' THEN 1 ELSE 0 END) AS success')
->select('SUM(CASE WHEN ' . $db->quoteName('p.status') . ' = ' . $db->quote('failed') . ' THEN 1 ELSE 0 END) AS failed')
->select([
$db->quoteName('s.service_type'),
'COUNT(*) AS total_posts',
'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_posts', 'p'))
->join('INNER', $db->quoteName('#__mokosuitecross_services', 's') . ' ON ' . $db->quoteName('s.id') . ' = ' . $db->quoteName('p.service_id'));
->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) {
$since = Factory::getDate('now - ' . $days . ' days')->toSql();
$query->where($db->quoteName('p.created') . ' >= ' . $db->quote($since));
$cutoff = Factory::getDate('-' . $days . ' days')->toSql();
$query->where($db->quoteName('p.created') . ' >= ' . $db->quote($cutoff));
}
$query->group($db->quoteName(['s.service_type', 's.title']))
->order('total DESC');
$db->setQuery($query);
$rows = $db->loadObjectList();
$rows = $db->loadAssocList();
$result = [];
foreach ($rows as &$row) {
$total = (int) $row['total_posts'];
$succeeded = (int) $row['total_succeeded'];
foreach ($rows as $row) {
$total = (int) $row->total;
$success = (int) $row->success;
$result[] = [
'service_type' => $row->service_type,
'service_title' => $row->service_title,
'total' => $total,
'success' => $success,
'failed' => (int) $row->failed,
'success_rate' => $total > 0 ? round(($success / $total) * 100, 1) : 0.0,
'avg_per_day' => $days > 0 ? round($total / $days, 1) : 0.0,
];
$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 $result;
}
public static function getServiceTypes(): array
{
$db = Factory::getDbo();
$query = $db->getQuery(true)
->select('DISTINCT ' . $db->quoteName('service_type'))
->from($db->quoteName('#__mokosuitecross_services'))
->where($db->quoteName('published') . ' = 1')
->order($db->quoteName('service_type') . ' ASC');
$db->setQuery($query);
return $db->loadColumn() ?: [];
}
private static function formatHour(int $hour): string
{
if ($hour === 0) {
return '12:00 AM';
}
if ($hour < 12) {
return $hour . ':00 AM';
}
if ($hour === 12) {
return '12:00 PM';
}
return ($hour - 12) . ':00 PM';
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);
@@ -40,9 +40,9 @@ class MokoSuiteCrossHelper
'posts' => 'COM_MOKOSUITECROSS_SUBMENU_POSTS',
'services' => 'COM_MOKOSUITECROSS_SUBMENU_SERVICES',
'templates' => 'COM_MOKOSUITECROSS_SUBMENU_TEMPLATES',
'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) {
@@ -14,52 +14,47 @@ namespace Joomla\Component\MokoSuiteCross\Administrator\View\Calendar;
defined('_JEXEC') or die;
use Joomla\CMS\Factory;
use Joomla\CMS\Language\Text;
use Joomla\CMS\MVC\View\HtmlView as BaseHtmlView;
use Joomla\CMS\Router\Route;
use Joomla\CMS\Toolbar\ToolbarHelper;
use Joomla\Component\MokoSuiteCross\Administrator\Helper\MokoSuiteCrossHelper;
class HtmlView extends BaseHtmlView
{
public int $year;
public int $month;
public array $events;
public $sidebar;
public $ajaxUrl;
public function display($tpl = null): void
{
$input = Factory::getApplication()->input;
// ACL check
$canDo = MokoSuiteCrossHelper::getActions();
$this->year = $input->getInt('year', (int) date('Y'));
$this->month = $input->getInt('month', (int) date('n'));
if ($this->month < 1 || $this->month > 12) {
$this->month = (int) date('n');
if (!$canDo->get('core.manage')) {
throw new \RuntimeException(Text::_('JERROR_ALERTNOAUTHOR'), 403);
}
if ($this->year < 2000 || $this->year > 2100) {
$this->year = (int) date('Y');
}
$model = $this->getModel();
$this->events = $model->getEvents($this->year, $this->month);
// Build AJAX URL for FullCalendar event source
$this->ajaxUrl = Route::_('index.php?option=com_mokosuitecross&task=calendar.events&format=json', false);
$this->addToolbar();
MokoSuiteCrossHelper::addSubmenu('calendar');
$this->sidebar = \Joomla\CMS\HTML\Sidebar::render();
// Set document title
Factory::getApplication()->getDocument()->setTitle(
Text::_('COM_MOKOSUITECROSS_CALENDAR') . ' - ' . Text::_('COM_MOKOSUITECROSS')
);
parent::display($tpl);
}
protected function addToolbar(): void
{
$canDo = MokoSuiteCrossHelper::getActions();
ToolbarHelper::title('MokoSuiteCross -- Post Calendar', 'calendar');
ToolbarHelper::back('JTOOLBAR_BACK', 'index.php?option=com_mokosuitecross&view=dashboard');
if ($canDo->get('core.admin')) {
ToolbarHelper::preferences('com_mokosuitecross');
}
ToolbarHelper::title(
Text::_('COM_MOKOSUITECROSS') . ' - ' . Text::_('COM_MOKOSUITECROSS_CALENDAR'),
'calendar'
);
ToolbarHelper::back('JTOOLBAR_BACK', Route::_('index.php?option=com_mokosuitecross&view=dashboard', false));
}
}
@@ -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);
}
@@ -12,118 +12,150 @@
defined('_JEXEC') or die;
use Joomla\CMS\Language\Text;
use Joomla\CMS\Router\Route;
use Joomla\CMS\Session\Session;
/** @var \Joomla\Component\MokoSuiteCross\Administrator\View\Calendar\HtmlView $this */
$year = $this->year;
$month = $this->month;
$events = $this->events;
$today = date('Y-m-d');
$prevMonth = $month - 1;
$prevYear = $year;
if ($prevMonth < 1) {
$prevMonth = 12;
$prevYear--;
}
$nextMonth = $month + 1;
$nextYear = $year;
if ($nextMonth > 12) {
$nextMonth = 1;
$nextYear++;
}
$monthName = date('F', mktime(0, 0, 0, $month, 1, $year));
$daysInMonth = (int) date('t', mktime(0, 0, 0, $month, 1, $year));
$firstWeekday = ((int) date('N', mktime(0, 0, 0, $month, 1, $year))) - 1;
$statusClass = static function (string $status): string {
return match ($status) {
'posted' => 'bg-success',
'failed' => 'bg-danger',
default => 'bg-warning text-dark',
};
};
$token = Session::getFormToken();
$ajaxUrl = $this->ajaxUrl;
?>
<div class="d-flex justify-content-between align-items-center mb-3">
<a href="<?php echo Route::_('index.php?option=com_mokosuitecross&view=calendar&year=' . $prevYear . '&month=' . $prevMonth); ?>"
class="btn btn-outline-secondary btn-sm">
<span class="icon-chevron-left" aria-hidden="true"></span>
<?php echo Text::_('COM_MOKOSUITECROSS_CALENDAR_PREV_MONTH'); ?>
</a>
<h3 class="mb-0"><?php echo htmlspecialchars($monthName . ' ' . $year); ?></h3>
<a href="<?php echo Route::_('index.php?option=com_mokosuitecross&view=calendar&year=' . $nextYear . '&month=' . $nextMonth); ?>"
class="btn btn-outline-secondary btn-sm">
<?php echo Text::_('COM_MOKOSUITECROSS_CALENDAR_NEXT_MONTH'); ?>
<span class="icon-chevron-right" aria-hidden="true"></span>
</a>
<style>
#mokosuitecross-calendar {
max-width: 1100px;
margin: 0 auto;
}
.fc .fc-toolbar-title {
font-size: 1.4em;
}
.mokosuitecross-calendar-legend {
display: flex;
gap: 1.5rem;
flex-wrap: wrap;
margin-bottom: 1rem;
}
.mokosuitecross-calendar-legend span {
display: inline-flex;
align-items: center;
gap: 0.35rem;
font-size: 0.875rem;
}
.mokosuitecross-calendar-legend .swatch {
display: inline-block;
width: 14px;
height: 14px;
border-radius: 3px;
}
</style>
<div class="mokosuitecross-calendar-legend">
<span><span class="swatch" style="background:#28a745;"></span> <?php echo Text::_('COM_MOKOSUITECROSS_STATUS_POSTED'); ?></span>
<span><span class="swatch" style="background:#007bff;"></span> <?php echo Text::_('COM_MOKOSUITECROSS_STATUS_SCHEDULED'); ?></span>
<span><span class="swatch" style="background:#ffc107;"></span> <?php echo Text::_('COM_MOKOSUITECROSS_STATUS_QUEUED'); ?></span>
<span><span class="swatch" style="background:#dc3545;"></span> <?php echo Text::_('COM_MOKOSUITECROSS_STATUS_FAILED'); ?></span>
</div>
<div class="table-responsive">
<table class="table table-bordered">
<thead class="table-light">
<tr>
<th style="width:14.28%"><?php echo Text::_('MON'); ?></th>
<th style="width:14.28%"><?php echo Text::_('TUE'); ?></th>
<th style="width:14.28%"><?php echo Text::_('WED'); ?></th>
<th style="width:14.28%"><?php echo Text::_('THU'); ?></th>
<th style="width:14.28%"><?php echo Text::_('FRI'); ?></th>
<th style="width:14.28%"><?php echo Text::_('SAT'); ?></th>
<th style="width:14.28%"><?php echo Text::_('SUN'); ?></th>
</tr>
</thead>
<tbody>
<?php
$day = 1;
$started = false;
<div id="mokosuitecross-calendar"></div>
while ($day <= $daysInMonth) : ?>
<tr>
<?php for ($col = 0; $col < 7; $col++) :
if (!$started && $col < $firstWeekday) : ?>
<td class="text-muted bg-light">&nbsp;</td>
<?php
continue;
endif;
<script src="https://cdn.jsdelivr.net/npm/fullcalendar@6.1.15/index.global.min.js" integrity="sha384-B1OFx8Gy9GjPu8UbUyXbGQpzll9ubAUQ9agInFJ8NnD7nYG1u/CLR+Sqr5yifl4q" crossorigin="anonymous"></script>
<script>
document.addEventListener('DOMContentLoaded', function() {
var calendarEl = document.getElementById('mokosuitecross-calendar');
var token = '<?php echo $token; ?>';
$started = true;
var calendar = new FullCalendar.Calendar(calendarEl, {
initialView: 'dayGridMonth',
headerToolbar: {
left: 'prev,next today',
center: 'title',
right: 'dayGridMonth,timeGridWeek,listWeek'
},
buttonText: {
today: '<?php echo Text::_('COM_MOKOSUITECROSS_CALENDAR_TODAY', true); ?>',
month: '<?php echo Text::_('COM_MOKOSUITECROSS_CALENDAR_MONTH', true); ?>',
week: '<?php echo Text::_('COM_MOKOSUITECROSS_CALENDAR_WEEK', true); ?>',
list: '<?php echo Text::_('COM_MOKOSUITECROSS_CALENDAR_LIST', true); ?>'
},
editable: true,
droppable: false,
navLinks: true,
dayMaxEvents: true,
eventSources: [{
url: '<?php echo $ajaxUrl; ?>',
method: 'GET',
failure: function() {
Joomla.renderMessages({
error: ['<?php echo Text::_('COM_MOKOSUITECROSS_CALENDAR_LOAD_ERROR', true); ?>']
});
}
}],
eventClick: function(info) {
info.jsEvent.preventDefault();
if (info.event.url) {
window.location.href = info.event.url;
}
},
eventDrop: function(info) {
var postId = info.event.id;
var status = info.event.extendedProps.status;
if ($day > $daysInMonth) : ?>
<td class="text-muted bg-light">&nbsp;</td>
<?php
continue;
endif;
// Only allow rescheduling of scheduled or queued posts
if (status !== 'scheduled' && status !== 'queued') {
info.revert();
Joomla.renderMessages({
warning: ['<?php echo Text::_('COM_MOKOSUITECROSS_CALENDAR_CANNOT_RESCHEDULE', true); ?>']
});
return;
}
$dateKey = sprintf('%04d-%02d-%02d', $year, $month, $day);
$isToday = ($dateKey === $today);
$cellClass = $isToday ? 'border border-primary border-2 bg-primary bg-opacity-10' : '';
$dayEvents = $events[$dateKey] ?? [];
?>
<td class="<?php echo $cellClass; ?>" style="vertical-align: top; min-height: 80px;">
<div class="fw-bold mb-1<?php echo $isToday ? ' text-primary' : ''; ?>">
<?php echo $day; ?>
<?php if ($isToday) : ?>
<small class="text-primary"><?php echo Text::_('COM_MOKOSUITECROSS_CALENDAR_TODAY'); ?></small>
<?php endif; ?>
</div>
<?php foreach ($dayEvents as $event) : ?>
<span class="badge <?php echo $statusClass($event->status); ?> mb-1 d-block text-truncate" style="max-width: 100%;"
title="<?php echo htmlspecialchars(ucfirst($event->service_type) . ': ' . $event->article_title . ' (' . $event->status . ')'); ?>">
<?php echo htmlspecialchars(ucfirst($event->service_type)); ?>:
<?php echo htmlspecialchars(mb_substr($event->article_title, 0, 20)); ?>
</span>
<?php endforeach; ?>
</td>
<?php
$day++;
endfor; ?>
</tr>
<?php endwhile; ?>
</tbody>
</table>
</div>
var newDate = info.event.start.toISOString();
var formData = new FormData();
formData.append('post_id', postId);
formData.append('new_date', newDate);
formData.append(token, '1');
fetch('index.php?option=com_mokosuitecross&task=calendar.reschedule&format=json', {
method: 'POST',
body: formData
})
.then(function(response) { return response.json(); })
.then(function(data) {
if (data.success) {
// Update the event colour to scheduled
info.event.setProp('color', '#007bff');
info.event.setExtendedProp('status', 'scheduled');
Joomla.renderMessages({
message: ['<?php echo Text::_('COM_MOKOSUITECROSS_CALENDAR_RESCHEDULE_SUCCESS', true); ?>']
});
} else {
info.revert();
Joomla.renderMessages({
error: [data.error || '<?php echo Text::_('COM_MOKOSUITECROSS_CALENDAR_RESCHEDULE_ERROR', true); ?>']
});
}
})
.catch(function() {
info.revert();
Joomla.renderMessages({
error: ['<?php echo Text::_('COM_MOKOSUITECROSS_CALENDAR_RESCHEDULE_ERROR', true); ?>']
});
});
},
eventDidMount: function(info) {
// Add tooltip with post details
var props = info.event.extendedProps;
var tip = info.event.title;
if (props.status) {
tip += ' [' + props.status + ']';
}
if (props.message) {
tip += '\n' + props.message;
}
info.el.setAttribute('title', tip);
}
});
calendar.render();
});
</script>
@@ -282,9 +282,9 @@ $queueProcessing = $componentParams->get('queue_processing', 'scheduler');
class="list-group-item list-group-item-action">
<?php echo Text::_('COM_MOKOSUITECROSS_SUBMENU_LOGS'); ?>
</a>
<a href="<?php echo Route::_('index.php?option=com_mokosuitecross&view=analytics'); ?>"
<a href="<?php echo Route::_('index.php?option=com_mokosuitecross&view=calendar'); ?>"
class="list-group-item list-group-item-action">
<?php echo Text::_('COM_MOKOSUITECROSS_SUBMENU_ANALYTICS'); ?>
<?php echo Text::_('COM_MOKOSUITECROSS_CALENDAR'); ?>
</a>
</div>
</div>
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<extension type="plugin" group="content" method="upgrade">
<name>Content - MokoSuiteCross</name>
<version>01.08.61</version>
<version>01.13.04</version>
<creationDate>2026-05-28</creationDate>
<author>Moko Consulting</author>
<authorEmail>hello@mokoconsulting.tech</authorEmail>
@@ -257,6 +257,53 @@ XML;
$form->load($aiXml);
$form->setFieldAttribute('mokosuitecross_ai_generate', 'description', $aiButtonHtml, 'attribs');
}
// Social Image Generator button (#157)
$siParams = ComponentHelper::getParams('com_mokosuitecross');
$siEnabled = (bool) $siParams->get('social_image_enabled', 0);
if ($siEnabled && $articleId > 0) {
$siToken = Session::getFormToken();
$siUrl = Uri::base() . 'index.php?option=com_mokosuitecross&task=socialimage.generate&format=raw&article_id=' . $articleId . '&' . $siToken . '=1';
$siButtonHtml = '<div class="mb-3">'
. '<button type="button" id="mokosuitecross-si-btn" class="btn btn-sm btn-outline-success" onclick="mokosuitecrossSiGenerate()">'
. '<span class="icon-image" aria-hidden="true"></span> '
. \Joomla\CMS\Language\Text::_('COM_MOKOSUITECROSS_SOCIAL_IMAGE_GENERATE')
. '</button>'
. '<span id="mokosuitecross-si-status" class="ms-2 small"></span>'
. '<div id="mokosuitecross-si-preview" class="mt-2" style="display:none;">'
. '<img id="mokosuitecross-si-thumb" src="" alt="Social image preview" style="max-width:300px;border:1px solid #ccc;border-radius:4px;" />'
. '</div>'
. '</div>'
. '<script>'
. 'function mokosuitecrossSiGenerate(){'
. 'var btn=document.getElementById("mokosuitecross-si-btn");'
. 'var st=document.getElementById("mokosuitecross-si-status");'
. 'var pv=document.getElementById("mokosuitecross-si-preview");'
. 'var img=document.getElementById("mokosuitecross-si-thumb");'
. 'btn.disabled=true;st.textContent="' . \Joomla\CMS\Language\Text::_('COM_MOKOSUITECROSS_SOCIAL_IMAGE_GENERATING', true) . '";'
. 'pv.style.display="none";'
. 'fetch("' . $siUrl . '")'
. '.then(function(r){return r.json();})'
. '.then(function(d){'
. 'btn.disabled=false;'
. 'if(!d.success){st.textContent=d.error||"Error";return;}'
. 'st.textContent="' . \Joomla\CMS\Language\Text::_('COM_MOKOSUITECROSS_SOCIAL_IMAGE_GENERATED', true) . '";'
. 'img.src="' . Uri::root() . '"+d.image_url+"?t="+Date.now();'
. 'pv.style.display="block";'
. '})'
. '.catch(function(){btn.disabled=false;st.textContent="Request failed";});'
. '}'
. '</script>';
$siXml = '<?xml version="1.0"?>
<form><fields name="attribs"><fieldset name="mokosuitecross_share">
<field name="mokosuitecross_si_generate" type="note"
label="" description="" />
</fieldset></fields></form>';
$form->load($siXml);
$form->setFieldAttribute('mokosuitecross_si_generate', 'description', $siButtonHtml, 'attribs');
}
// Cross-post history panel for existing articles
@@ -404,7 +451,7 @@ XML;
/**
* Dispatch cross-post when an article is saved and published.
*/
public function onContentAfterSave(\Joomla\CMS\Event\Content\AfterSaveEvent $event): void
public function onContentAfterSave($event): void
{
$context = $event->getContext();
@@ -441,7 +488,7 @@ XML;
/**
* Dispatch cross-post when article state changes to published.
*/
public function onContentChangeState(\Joomla\CMS\Event\Content\ContentChangeStateEvent $event): void
public function onContentChangeState($event): void
{
$context = $event->getContext();
@@ -488,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.08.61</version>
<version>01.13.04</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.08.61</version>
<version>01.13.04</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.08.61</version>
<version>01.13.04</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.08.61</version>
<version>01.13.04</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.08.61</version>
<version>01.13.04</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.08.61</version>
<version>01.13.04</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.08.61</version>
<version>01.13.04</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.08.61</version>
<version>01.13.04</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.08.61</version>
<version>01.13.04</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.08.61</version>
<version>01.13.04</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.08.61</version>
<version>01.13.04</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.08.61</version>
<version>01.13.04</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.08.61</version>
<version>01.13.04</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.08.61</version>
<version>01.13.04</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.08.61</version>
<version>01.13.04</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.08.61</version>
<version>01.13.04</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.08.61</version>
<version>01.13.04</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.08.61</version>
<version>01.13.04</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.08.61</version>
<version>01.13.04</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.08.61</version>
<version>01.13.04</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.08.61</version>
<version>01.13.04</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.08.61</version>
<version>01.13.04</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.08.61</version>
<version>01.13.04</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.08.61</version>
<version>01.13.04</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.08.61</version>
<version>01.13.04</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.08.61</version>
<version>01.13.04</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.08.61</version>
<version>01.13.04</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.08.61</version>
<version>01.13.04</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.08.61</version>
<version>01.13.04</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.08.61</version>
<version>01.13.04</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.08.61</version>
<version>01.13.04</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.08.61</version>
<version>01.13.04</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.08.61</version>
<version>01.13.04</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.08.61</version>
<version>01.13.04</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.08.61</version>
<version>01.13.04</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.08.61</version>
<version>01.13.04</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.08.61</version>
<version>01.13.04</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.08.61</version>
<version>01.13.04</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.08.61</version>
<version>01.13.04</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.08.61</version>
<version>01.13.04</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.08.61</version>
<version>01.13.04</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.08.61</version>
<version>01.13.04</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.08.61</version>
<version>01.13.04</version>
<creationDate>2026-05-28</creationDate>
<author>Moko Consulting</author>
<authorEmail>hello@mokoconsulting.tech</authorEmail>
+1 -1
View File
@@ -2,7 +2,7 @@
<extension type="package" method="upgrade">
<name>MokoSuiteCross</name>
<packagename>mokosuitecross</packagename>
<version>01.08.61</version>
<version>01.13.04</version>
<creationDate>2026-05-28</creationDate>
<author>Moko Consulting</author>
<authorEmail>hello@mokoconsulting.tech</authorEmail>