I have made other plugins for Joomla 4 but I am still a novice. The past two days I have been searching for a solution, it's becoming quite frustrating. I have brought back my code in the php file to just to show me anything, in this case 'Hello There'. I have searched reporting, the log just shows it loads the plugin and nothing... The plugin does install correctly, uninstalls too, the shortcode is simple {climate} and all the files are in place, Joomla also finds the plugin because I have tested it even on a clean install of Joomla 4. Just the onContentPrepare doesnt do anything at all which is weird.. Can anyone help me?? :

 * @version    1.0.0
 * @package    myclimatetable (plugin)
 * @author     AN
 * @copyright  Copyright (c) 2023 AN
 * @license    GNU/GPL license: https://www.gnu.org/copyleft/gpl.html

// No direct access
defined('_JEXEC') or die;

class PlgContentClimateTable extends JPlugin 
    public function onContentPrepare($context, &$article, &$params, $limitstart) 
        $article->text = preg_replace('/{climate}/', 'Hello there', $article->text);
        return true;

My manifest file is okay, I think.

<?xml version="1.0" encoding="utf-8"?>
<extension version="4.0" type="plugin" group="content" method="upgrade">
    <creationDate>September 2023</creationDate>
    <copyright>Copyright (C) 2023 Harper Douglas Max</copyright>
    <license>NU/GPL license: https://www.gnu.org/copyleft/gpl.html</license>
    <description>A plugin that allows climate tables to be inserted from WMO</description>

    <!-- Files and folders included in the plugin -->
        <filename plugin="myclimatetable">myclimatetable.php</filename>
    <languages folder="language">
        <language tag="en-GB">en-GB/en-GB.plg_content_myclimatetable.sys.ini</language>
        <language tag="en-GB">en-GB/en-GB.plg_content_myclimatetable.ini</language>
        <language tag="nl-NL">nl-NL/nl-NL.plg_content_myclimatetable.sys.ini</language>
        <language tag="nl-NL">nl-NL/nl-NL.plg_content_myclimatetable.ini</language>

1 Answer 1


Per documentation, the class name should be in format plg<PluginGroup><PluginName> (casing doesn't matter for J3 and older style plugins). The name of your plugin is myclimatetable, as defined by plugin attribute in the XML file. Therefore, the class name should be PlgContentMyClimateTable, not PlgContentClimateTable.

  • Thank you so much! What a silly oversight!
    – EJBJane
    Sep 18, 2023 at 16:42

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.