-
-
Notifications
You must be signed in to change notification settings - Fork 0
feat: Initial Implementation of Open Graph (OG) Plugin #1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
shahzan01
wants to merge
49
commits into
main
Choose a base branch
from
feature/seo-improvements
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 2 commits
Commits
Show all changes
49 commits
Select commit
Hold shift + click to select a range
77a6f18
initial commit for jacademyseo_opengraph plugin for joomla seo improv…
shahzan01 eb22627
feat : added manifest and language files for jacademyseo_opengraph pl…
shahzan01 ece1af5
fix : rename plugin to opengraph and update language files
shahzan01 905cca3
fix : file name changed to opengraph.php
shahzan01 085ff65
feat: added forms for article and category to opengraph plugin
shahzan01 8cb7864
feat : add og tag injection into html
shahzan01 ce47b06
fix : added docblocks and comments
shahzan01 7ba727c
feat : form improvements - custom fields mapping and manual override …
shahzan01 768a2bf
feat : created opengraph service interface and field type for opengra…
shahzan01 6b71fbf
feat: add opengraph field mapping and form changes
shahzan01 2fac558
fix : updated form and used the interface check to render form
shahzan01 4b65016
Segregate fields for opengraph into different form dropdowns
shahzan01 89149f9
fix : Separated the mapping form and conditionally combined them only…
shahzan01 b05a861
fix : forms now correclty save values in both category and article
shahzan01 b41f698
feat : added custom fields options to opengraph mappings and used gro…
shahzan01 a6e28cd
fix : made some changes to the form and made isSupported function mor…
shahzan01 fea4185
feat : implemented the OGInterface in com_menus
shahzan01 6d37b9b
feat: add custom fields filtering to opengraph field
shahzan01 7cfde55
feat : og tag injection into html
shahzan01 1f95b29
fix : used the component helper to get the article and category
shahzan01 19fe1f7
fix : get custom fields for the respective category in dropdown
shahzan01 cbbff6c
Chore: Apply PHP-CS-Fixer formatting across the codebase
shahzan01 419dfa7
Chore: Normalize line endings and fix code style via PHPCBF
shahzan01 928ad4b
feat : add string sanitization and truncate to the plugin
shahzan01 063adfa
fix : sorted language strings
shahzan01 8a9441b
feat : added the javascript to auto update the placeholder values in …
shahzan01 30689d6
feat : added script for OpenGraph placeholder in build folder
shahzan01 8f94056
removed the custom field logic from this branch
shahzan01 c215b7a
fix : fix some bugs and modified the plugins settings page
shahzan01 53b3576
chore : changed opengraph.xml to use JYES/JNO instead of JENABLED/JDI…
shahzan01 9db1b2c
feat : added global default option in the settings and refactored Ope…
shahzan01 ff3a891
feat : made the OpenGraph field more flexible , removed hardcoded com…
shahzan01 3e47961
feat : added support for multi article page view
shahzan01 e63a335
fix : run php-cs-fixer and sorted language strings
shahzan01 e2f0c94
Merge remote-tracking branch 'Academy2025_SEO/6.1-dev' into academy/2…
bembelimen 7e7aaea
fix : Check PHP code style fixes
shahzan01 775bc4b
Merge branch 'feature/seo-improvements' of https://github.com/joomla-…
shahzan01 0f8c467
fix : removed the phpstan error
shahzan01 64bf434
fix : many minor fixes and improvements for SEO plugin
shahzan01 a635837
fix : PHP-CS-Fixer applied
shahzan01 5b33522
fixed the function call to include the missing parameter.
shahzan01 27b2c30
fix : removed the hardcoded component name 'com_content' to make it d…
shahzan01 a8d5996
fix : made the OpenGraph plugin more generic to support other content…
shahzan01 10b1014
fix : added fallback for getModelName method if not exists in component
shahzan01 bdc382e
fix : changed $cmp to $component to avoid confusion and potential iss…
shahzan01 b721d72
fix : minor fixes and improvements
shahzan01 78a4e3b
fix : added getmodelname method to opengraph service interface and re…
shahzan01 1a98cc5
fix : add getModelName to MenusComponent
shahzan01 edd13bf
fix : Rename opengraph.php to Opengraph.php for consistency
shahzan01 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
14 changes: 14 additions & 0 deletions
14
plugins/system/jacademyseo_opengraph/jacademyseo_opengraph.php
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,14 @@ | ||
| <?php | ||
| defined('_JEXEC') or die; | ||
|
|
||
| use Joomla\CMS\Plugin\CMSPlugin; | ||
|
|
||
| class PlgContentOgmetadata extends CMSPlugin | ||
| { | ||
| protected $app; | ||
|
|
||
| public function onContentPrepare($context, &$article, &$params, $limitstart = 0) | ||
| { | ||
| // Logic will be added later. | ||
| } | ||
| } | ||
134 changes: 134 additions & 0 deletions
134
plugins/system/jacademyseo_opengraph/jacademyseo_opengraph.xml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,134 @@ | ||
| <?xml version="1.0" encoding="utf-8"?> | ||
| <extension type="plugin" group="system" method="upgrade" version="6.0"> | ||
| <name>PLG_SYSTEM_JACADEMYSEO_OPENGRAPH</name> | ||
shahzan01 marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| <author>JacademySEO Team</author> | ||
shahzan01 marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| <creationDate>2025-06</creationDate> | ||
| <copyright>(C) 2025 JacademySEO. All rights reserved.</copyright> | ||
shahzan01 marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| <license>GNU General Public License version 2 or later</license> | ||
| <authorEmail>[email protected]</authorEmail> | ||
shahzan01 marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| <authorUrl>https://jacademyseo.com</authorUrl> | ||
shahzan01 marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| <version>1.0.0</version> | ||
shahzan01 marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| <description>PLG_SYSTEM_JACADEMYSEO_OPENGRAPH_DESCRIPTION</description> | ||
|
|
||
| <namespace path="src">JacademySEO\Plugin\System\Jacademyseo_Opengraph</namespace> | ||
shahzan01 marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
| <files> | ||
| <folder plugin="jacademyseo_opengraph">src</folder> | ||
shahzan01 marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| <filename plugin="jacademyseo_opengraph">jacademyseo_opengraph.php</filename> | ||
shahzan01 marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| <filename>jacademyseo_opengraph.xml</filename> | ||
shahzan01 marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| </files> | ||
|
|
||
| <languages> | ||
| <language tag="en-GB">language/en-GB/plg_system_jacademyseo_opengraph.ini</language> | ||
shahzan01 marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| <language tag="en-GB">language/en-GB/plg_system_jacademyseo_opengraph.sys.ini</language> | ||
shahzan01 marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| </languages> | ||
|
|
||
| <config> | ||
| <fields name="params"> | ||
| <fieldset name="global_og_settings" label="Global OG Settings"> | ||
| <field | ||
| name="enable_og_generation" | ||
| type="radio" | ||
| class="btn-group btn-group-yesno" | ||
| default="1" | ||
| label="PLG_SYSTEM_JACADEMYSEO_OPENGRAPH_ENABLE_OG_GENERATION" | ||
| description="PLG_SYSTEM_JACADEMYSEO_OPENGRAPH_ENABLE_OG_GENERATION_DESC" | ||
| > | ||
| <option value="0">JNO</option> | ||
| <option value="1">JYES</option> | ||
| </field> | ||
|
|
||
| <field | ||
| name="global_og_title" | ||
| type="text" | ||
| label="PLG_SYSTEM_JACADEMYSEO_OPENGRAPH_GLOBAL_OG_TITLE" | ||
| description="PLG_SYSTEM_JACADEMYSEO_OPENGRAPH_GLOBAL_OG_TITLE_DESC" | ||
| size="50" | ||
| maxlength="255" | ||
| /> | ||
|
|
||
| <field | ||
| name="global_og_description" | ||
| type="textarea" | ||
| label="PLG_SYSTEM_JACADEMYSEO_OPENGRAPH_GLOBAL_OG_DESCRIPTION" | ||
| description="PLG_SYSTEM_JACADEMYSEO_OPENGRAPH_GLOBAL_OG_DESCRIPTION_DESC" | ||
| rows="3" | ||
| cols="50" | ||
| maxlength="300" | ||
| /> | ||
|
|
||
| <field | ||
| name="global_og_image" | ||
| type="media" | ||
| label="PLG_SYSTEM_JACADEMYSEO_OPENGRAPH_GLOBAL_OG_IMAGE" | ||
| description="PLG_SYSTEM_JACADEMYSEO_OPENGRAPH_GLOBAL_OG_IMAGE_DESC" | ||
| directory="images" | ||
| /> | ||
|
|
||
| <field | ||
| name="global_og_type" | ||
| type="list" | ||
| default="website" | ||
| label="PLG_SYSTEM_JACADEMYSEO_OPENGRAPH_GLOBAL_OG_TYPE" | ||
| description="PLG_SYSTEM_JACADEMYSEO_OPENGRAPH_GLOBAL_OG_TYPE_DESC" | ||
| > | ||
| <option value="website">website</option> | ||
shahzan01 marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| <option value="article">article</option> | ||
| <option value="blog">blog</option> | ||
| <option value="profile">profile</option> | ||
| <option value="video">video</option> | ||
| <option value="music">music</option> | ||
| <option value="book">book</option> | ||
| <option value="product">product</option> | ||
| <option value="event">event</option> | ||
| </field> | ||
| </fieldset> | ||
|
|
||
| <fieldset name="override_settings" label="Override Settings"> | ||
| <field | ||
| name="enable_article_override" | ||
| type="radio" | ||
| class="btn-group btn-group-yesno" | ||
| default="1" | ||
| label="PLG_SYSTEM_JACADEMYSEO_OPENGRAPH_ENABLE_ARTICLE_OVERRIDE" | ||
| description="PLG_SYSTEM_JACADEMYSEO_OPENGRAPH_ENABLE_ARTICLE_OVERRIDE_DESC" | ||
| > | ||
| <option value="0">JNO</option> | ||
| <option value="1">JYES</option> | ||
| </field> | ||
|
|
||
| <field | ||
| name="enable_category_override" | ||
| type="radio" | ||
| class="btn-group btn-group-yesno" | ||
| default="1" | ||
| label="PLG_SYSTEM_JACADEMYSEO_OPENGRAPH_ENABLE_CATEGORY_OVERRIDE" | ||
| description="PLG_SYSTEM_JACADEMYSEO_OPENGRAPH_ENABLE_CATEGORY_OVERRIDE_DESC" | ||
| > | ||
| <option value="0">JNO</option> | ||
| <option value="1">JYES</option> | ||
| </field> | ||
|
|
||
| <field | ||
| name="fallback_to_site_logo" | ||
| type="radio" | ||
| class="btn-group btn-group-yesno" | ||
| default="1" | ||
| label="PLG_SYSTEM_JACADEMYSEO_OPENGRAPH_FALLBACK_TO_SITE_LOGO" | ||
| description="PLG_SYSTEM_JACADEMYSEO_OPENGRAPH_FALLBACK_TO_SITE_LOGO_DESC" | ||
| > | ||
| <option value="0">JNO</option> | ||
| <option value="1">JYES</option> | ||
| </field> | ||
| </fieldset> | ||
|
|
||
|
|
||
| </fields> | ||
| </config> | ||
|
|
||
| <updateservers> | ||
shahzan01 marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| <server type="extension" priority="1" name="JacademySEO Open Graph Plugin Updates"> | ||
| <![CDATA[https://updates.jacademyseo.com/plg_system_jacademyseo_opengraph.xml]]> | ||
| </server> | ||
| </updateservers> | ||
| </extension> | ||
67 changes: 67 additions & 0 deletions
67
plugins/system/jacademyseo_opengraph/language/en-GB/plg_system_jacademyseo_opengraph.ini
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,67 @@ | ||
| ; JacademySEO Open Graph Plugin Language File | ||
| ; Copyright (C) 2025 JacademySEO. All rights reserved. | ||
| ; License GNU General Public License version 2 or later | ||
|
|
||
| ; Plugin Description | ||
| PLG_SYSTEM_JACADEMYSEO_OPENGRAPH_DESCRIPTION="JacademySEO Open Graph Plugin automatically generates Open Graph tags for improved social media sharing. Features hierarchical override system supporting global, category, and article-level metadata configuration." | ||
shahzan01 marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
| ; Global OG Settings | ||
| PLG_SYSTEM_JACADEMYSEO_OPENGRAPH_GLOBAL_OG_SETTINGS="Global Open Graph Settings" | ||
|
|
||
| PLG_SYSTEM_JACADEMYSEO_OPENGRAPH_ENABLE_OG_GENERATION="Enable OG Tag Generation" | ||
| PLG_SYSTEM_JACADEMYSEO_OPENGRAPH_ENABLE_OG_GENERATION_DESC="Enable automatic generation of Open Graph meta tags for improved social media sharing." | ||
|
|
||
| PLG_SYSTEM_JACADEMYSEO_OPENGRAPH_GLOBAL_OG_TITLE="Global OG Title" | ||
| PLG_SYSTEM_JACADEMYSEO_OPENGRAPH_GLOBAL_OG_TITLE_DESC="Default Open Graph title used as fallback when no article or category-specific title is available. Leave empty to use site name." | ||
|
|
||
| PLG_SYSTEM_JACADEMYSEO_OPENGRAPH_GLOBAL_OG_DESCRIPTION="Global OG Description" | ||
| PLG_SYSTEM_JACADEMYSEO_OPENGRAPH_GLOBAL_OG_DESCRIPTION_DESC="Default Open Graph description used as fallback when no article or category-specific description is available. Maximum 200 characters." | ||
|
|
||
| PLG_SYSTEM_JACADEMYSEO_OPENGRAPH_GLOBAL_OG_IMAGE="Global OG Image" | ||
| PLG_SYSTEM_JACADEMYSEO_OPENGRAPH_GLOBAL_OG_IMAGE_DESC="Default Open Graph image used as fallback when no article or category-specific image is available. Recommended size: 1200x630 pixels." | ||
|
|
||
| PLG_SYSTEM_JACADEMYSEO_OPENGRAPH_GLOBAL_OG_TYPE="Global OG Type" | ||
| PLG_SYSTEM_JACADEMYSEO_OPENGRAPH_GLOBAL_OG_TYPE_DESC="Default Open Graph type for your website. 'Website' is recommended for most sites." | ||
|
|
||
| ; Override Settings | ||
| PLG_SYSTEM_JACADEMYSEO_OVERRIDE_SETTINGS="Override Settings" | ||
|
|
||
| PLG_SYSTEM_JACADEMYSEO_OPENGRAPH_ENABLE_ARTICLE_OVERRIDE="Enable Article-Level Override" | ||
| PLG_SYSTEM_JACADEMYSEO_OPENGRAPH_ENABLE_ARTICLE_OVERRIDE_DESC="Allow articles to have custom Open Graph metadata via custom fields. When enabled, article OG fields will take priority over category and global settings." | ||
|
|
||
| PLG_SYSTEM_JACADEMYSEO_OPENGRAPH_ENABLE_CATEGORY_OVERRIDE="Enable Category-Level Override" | ||
| PLG_SYSTEM_JACADEMYSEO_OPENGRAPH_ENABLE_CATEGORY_OVERRIDE_DESC="Allow categories to have custom Open Graph metadata. When enabled, category OG settings will take priority over global settings but will be overridden by article-specific settings." | ||
|
|
||
| PLG_SYSTEM_JACADEMYSEO_OPENGRAPH_FALLBACK_TO_SITE_LOGO="Use Site Logo as Fallback" | ||
| PLG_SYSTEM_JACADEMYSEO_OPENGRAPH_FALLBACK_TO_SITE_LOGO_DESC="When no OG image is specified, use the site's logo as fallback image. If disabled, no image tag will be generated." | ||
|
|
||
| ; Custom Fields Labels (for reference) | ||
| PLG_SYSTEM_JACADEMYSEO_OPENGRAPH_FIELD_OG_TITLE="Open Graph Title" | ||
| PLG_SYSTEM_JACADEMYSEO_OPENGRAPH_FIELD_OG_TITLE_DESC="Custom title for Open Graph sharing. Leave empty to use article title." | ||
|
|
||
| PLG_SYSTEM_JACADEMYSEO_OPENGRAPH_FIELD_OG_DESCRIPTION="Open Graph Description" | ||
| PLG_SYSTEM_JACADEMYSEO_OPENGRAPH_FIELD_OG_DESCRIPTION_DESC="Custom description for Open Graph sharing. Leave empty to use article meta description or intro text." | ||
|
|
||
| PLG_SYSTEM_JACADEMYSEO_OPENGRAPH_FIELD_OG_IMAGE="Open Graph Image" | ||
| PLG_SYSTEM_JACADEMYSEO_OPENGRAPH_FIELD_OG_IMAGE_DESC="Custom image for Open Graph sharing. Leave empty to use article intro image or site logo." | ||
|
|
||
| ; Error Messages | ||
| PLG_SYSTEM_JACADEMYSEO_OPENGRAPH_ERROR_INVALID_CATEGORY="Invalid category specified for OG metadata" | ||
| PLG_SYSTEM_JACADEMYSEO_OPENGRAPH_ERROR_SAVE_FAILED="Failed to save OG metadata" | ||
| PLG_SYSTEM_JACADEMYSEO_OPENGRAPH_ERROR_DELETE_FAILED="Failed to delete OG metadata" | ||
| PLG_SYSTEM_JACADEMYSEO_OPENGRAPH_ERROR_FIELD_TOO_LONG="Field value exceeds maximum length" | ||
|
|
||
| ; Success Messages | ||
| PLG_SYSTEM_JACADEMYSEO_OPENGRAPH_SUCCESS_SAVED="OG metadata saved successfully" | ||
| PLG_SYSTEM_JACADEMYSEO_OPENGRAPH_SUCCESS_DELETED="OG metadata deleted successfully" | ||
|
|
||
| ; Information Messages | ||
| PLG_SYSTEM_JACADEMYSEO_OPENGRAPH_INFO_NO_ARTICLE="No article context available for OG tag generation" | ||
| PLG_SYSTEM_JACADEMYSEO_OPENGRAPH_INFO_USING_FALLBACK="Using fallback values for OG tag generation" | ||
| PLG_SYSTEM_JACADEMYSEO_OPENGRAPH_INFO_HIERARCHY_APPLIED="OG metadata hierarchy applied: %s level used" | ||
|
|
||
| ; Priority Levels | ||
| PLG_SYSTEM_JACADEMYSEO_OPENGRAPH_PRIORITY_ARTICLE="Article" | ||
| PLG_SYSTEM_JACADEMYSEO_OPENGRAPH_PRIORITY_CATEGORY="Category" | ||
| PLG_SYSTEM_JACADEMYSEO_OPENGRAPH_PRIORITY_GLOBAL="Global" | ||
| PLG_SYSTEM_JACADEMYSEO_OPENGRAPH_PRIORITY_AUTO="Auto-generated" | ||
16 changes: 16 additions & 0 deletions
16
plugins/system/jacademyseo_opengraph/language/en-GB/plg_system_jacademyseo_opengraph.sys.ini
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,16 @@ | ||
| ; JacademySEO Open Graph Plugin System Language File | ||
| ; Copyright (C) 2025 JacademySEO. All rights reserved. | ||
| ; License GNU General Public License version 2 or later | ||
|
|
||
| ; Plugin Name and Description for Extension Manager | ||
| PLG_SYSTEM_JACADEMYSEO_OPENGRAPH="System - JacademySEO Open Graph" | ||
shahzan01 marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| PLG_SYSTEM_JACADEMYSEO_OPENGRAPH_DESCRIPTION="Automatic Open Graph tag generation plugin for Joomla 6.x with hierarchical metadata override system. Improves social media sharing with intelligent fallback mechanisms." | ||
|
|
||
| ; Installation Messages | ||
| PLG_SYSTEM_JACADEMYSEO_OPENGRAPH_INSTALL_SUCCESS="JacademySEO Open Graph Plugin installed successfully!" | ||
| PLG_SYSTEM_JACADEMYSEO_OPENGRAPH_UPDATE_SUCCESS="JacademySEO Open Graph Plugin updated successfully!" | ||
| PLG_SYSTEM_JACADEMYSEO_OPENGRAPH_UNINSTALL_SUCCESS="JacademySEO Open Graph Plugin uninstalled successfully!" | ||
|
|
||
| ; Custom Fields Group | ||
| PLG_SYSTEM_JACADEMYSEO_OPENGRAPH_FIELDS_GROUP="Open Graph Metadata" | ||
| PLG_SYSTEM_JACADEMYSEO_OPENGRAPH_FIELDS_GROUP_DESC="Custom fields for Open Graph metadata configuration" | ||
Empty file.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.