Allows you to insert a list of the Wordpress plugins you are using into any post/page.
This is a simple community WordPress plugin aimed at giving credit where credit is due.
The plugin inserts an XHTML list into any post/page through a shortcode. If you’re into customization, you can specify a format argument and indicate the exact output you are after. There’s also an option to display inactive plugins as well.
Key features include…
Thanks to Matej Nastran‘s My plugins, from which Plugins list was initially derived.
Iconography is courtesy of the very talented Janki Rathod.
Please visit the Github page for the latest code development, planned enhancements and known issues
To get a list of the plugins that are installed and activated in your website, insert the following into any post or page:
<ul>[plugins_list]</ul>
You can customise the output specifying the format
argument and a number of pre-defined tags
. Here’s an example:
[plugins_list format="{{LinkedTitle}} ({{LinkedAuthor}}) - {{Description}}{{br/}}"]
The tags are as follows, all defined within double braces…
Title
– the plugin titlePluginURI
– the URL of the pluginAuthor
– the plugin authorAuthorURI
– the author’s URLVersion
– plugin version numberDescription
– the plugin descriptionRequiresWP
– the minimum required level of WordPressRequiresPHP
– the minimum required level of PHPLinkedTitle
– the title but automatically linked to the corresponding URLLinkedAuthor
– the author, linking to their profileActive
– shows ‘Active’ or ‘Inactive’, depending on the status of the pluginThe plugins list can be freely styled with css, just place any class or id attribute on the format
string, or on the elements surrounding it.
If you wish to put HTML in your format then you can. However, this can cause havoc in the Visual editor and even causes extra characters to be passed into the output (rogue paragraph tags, for instance). I therefore highly recommend that, if you wish to add HTML, use double braces instead of < and > around your HTML tags – this plugin will correct this before output but it means the visual editor doesn’t try and interpret the HTML.
For example…
<ul>[plugins_list format="{{li}}{{LinkedTitle}} - {{LinkedAuthor}}{{/li}}"]</ul>
The characters will be corrected upon output and you will get a lovely, bulleted, un-ordered list as output.
If you’re using the block editor and need to wrap HTML around the outside of the short code, please see the details further below on the best way to do this.
Active & Inactive Plugins
By default, only active plugins are shown, but by using the show_active
, show_inactive
and show_recent
parameters you can change this.
For example, this will show both active and inactive…
[plugins_list format="{{LinkedTitle}} ({{LinkedAuthor}}) - {{Description}}{{br/}}" show_inactive=true]
If you wanted to show just inactive, you’d put..
[plugins_list format="{{LinkedTitle}} ({{LinkedAuthor}}) - {{Description}}{{br/}}" show_inactive=true show_active=false]
If you wanted to show just plugins that are inactive but were recently active, you’d put…
[plugins_list format="{{LinkedTitle}} ({{LinkedAuthor}}) - {{Description}}{{br/}}" show_inactive=false show_active=false show_recent=true]
Link Targets & No Follow
By default links will be followed but you can make these “nofollow” by simply adding the parameter of nofollow=true
. For example…
[plugins_list format="{{LinkedTitle}} ({{LinkedAuthor}}) - {{Description}}{{br/}}" nofollow=true]
You can also specify the link target too. For example…
[plugins_list format="{{LinkedTitle}} ({{LinkedAuthor}}) - {{Description}}{{br/}}" target="_blank"]
Truncate the Description
Two parameters exist to truncate the description, so it doesn’t get too long unwieldy. You can specify a maximum number of words or a maximum number of characters using words
or chars
. Here’s an example of each…
[plugins_list format="{{LinkedTitle}} ({{LinkedAuthor}}) - {{Description}}{{br/}}" words=20] [plugins_list format="{{LinkedTitle}} ({{LinkedAuthor}}) - {{Description}}{{br/}}" chars=80]
You shouldn’t do this but if you specify both then the shortest one will be used.
By default, if a truncation occurs, ellipsis will be added to the end. However, you can change this by using the end
parameter and specifying your own ending. For example…
[plugins_list format="{{LinkedTitle}} ({{LinkedAuthor}}) - {{Description}}{{br/}}" chars=80 end=" [More]"]
Remove Emoji
If you want to remove emoji from the description, use the emoji
parameter to achieve this. By default this is true
but set to false
to have them removed. For example…
[plugins_list format="{{LinkedTitle}} ({{LinkedAuthor}}) - {{Description}}{{br/}}" emoji=false]
Sort by Author
Want so sort the output by author and not plugin name? Just use the parameter by_author
. For example…
[plugins_list format="{{LinkedTitle}} ({{LinkedAuthor}}) - {{Description}}{{br/}}" by_author=true]
Cache
By default your plugin list will be cached for 5 minutes, ensuring that performance is impacted as little as possible. Use the parameter cache
to change the number of minutes. Set this to false to switch off caching.
For example…
[plugins_list format="{{LinkedTitle}} ({{LinkedAuthor}}) - {{Description}}{{br/}}" cache=60]
This will cache for 1 hour. The following will switch the cache off…
[plugins_list format="{{LinkedTitle}} ({{LinkedAuthor}}) - {{Description}}{{br/}}" cache=false]<h3>Using with the block editor</h3>
You can insert shortcodes directly into the block editor without an issue and it will be automatically added to a shortcode block. However, if you need to wrap HTML around it then this will cause issues. The solution here is to add a shortcode block first and then add the whole line into that. The HTML then works just fine.
A shortcode also exists to allow you to display the number of plugins that you have. Simply add [plugins_number]
to your post or page and it will return the number of active plugins.
To display the number of active AND inactive plugins use…
[plugins_number inactive=true]
You can also display the number of inactive plugins by specifying…
[plugins_number inactive=true active=false]
As with the other shortcode results will be cached by default. To change the number of minutes simply use the cache
parameter. Set it to false
to switch off caching. For example…
[plugins_number inactive=true cache=120]
This will set the cache to 2 hours.
Plugins List can be found and installed via the Plugin menu within WordPress administration (Plugins -> Add New). Alternatively, it can be downloaded from WordPress.org and installed manually…
plugins-list
folder to your wp-content/plugins/
directory.Voila! It’s ready to go.
Using double braces (i.e. {{ and {{) for templates is pretty standard so something I wanted to move towards. However, I don’t want existing usage to break so I’m supporting both the old and new methods – however, I’m not documenting the old method so my hope is for people to move towards usage of double braces.
For your security, not all HTML tags are allowed – we’ve limited this to any that are for the purposed of text formatting (inc. bullet points) and tables.
The full list of allowed tags are: , , ,
<
blockquote>,
, , , , , , ,
<
div>, , ,
<
h1>,
<
h2>,
<
h3>,
<
h4>,
<
h5>,
<
h6>,
, , ,
<
ol>,
<
p>,
<
pre>, , , , , , , , , ,
<
table>, , , , and
<
ul>.
I use semantic versioning, with the first release being 1.0.
Active
that allows you to display whether the plugin is, well, active or notshow_recent
, which allows you to decide whether to show recently active pluginsuasort
instead of usort
to get around an issue with array keys. Thanks to dgw