Magento 2
Best practice for plugin naming conventions
Free Preview
👍 Name the plugin after what it does...
...
<type name="Magento\Sales\Api\OrderRepositoryInterface">
    <!--
    The plugin should be named in "human language". We all know what the plugin
    is doing if it is named "Add PO Number to Sales Order".

    The plugin name is the snake_case version of the plugin class. Locating the
    file within the "Plugin" directory deems it unnecessary to append a "Plugin"
    suffix to the class name.

    Prefixing the plugin name with vendorname_modulename also helps avoid naming
    collisions with other similarly named plugins.
    -->
    <plugin name="acme_ponumber_add_po_number_to_sales_order"
            type="Acme\PoNumber\Plugin\AddPoNumberToSalesOrder"/>
</type>
...
👎 ...not some meaningless or arbitrary name
...
<type name="Magento\Sales\Api\OrderRepositoryInterface">
    <!--
    What does this plugin do? We have no clue, until we inspect the contents
    of the "OrderRepositoryPlugin" class. This makes it hard to easily
    understand our codebase at a glance.

    While this plugin name works, it doesn't follow Magento's core snake_case
    naming conventions, making it hard to read. The "Plugin" suffix is also
    completely unneccessary, so save yourself some typing by not using it.
    -->
    <plugin name="Acme\PoNumber\Plugin\OrderRepositoryPlugin"
            type="Acme\PoNumber\Plugin\OrderRepositoryPlugin"/>
</type>
...
Want to learn more?

Visit M.academy to learn much more about Magento, Laravel, PHP, Javascript, & Docker.

M.academy logo