Skip to content
David Kittell
David Kittell

Application & System: Development / Integration / Orchestration

  • Services
    • Application Development
    • Online Application Integration
  • Code
  • Online Tools
  • Tech Support
David Kittell

Application & System: Development / Integration / Orchestration

WordPress – List All Plugins

Posted on September 22, 2015September 23, 2015 By David Kittell

Place the following code on a file ex. ListAllPlugins.php and then navigate to http://yourdomain.com/ListAllPlugins.php

<?PHP
require($_SERVER['DOCUMENT_ROOT'] . "/wp-load.php");
require($_SERVER['DOCUMENT_ROOT'] . "/wp-admin/includes/plugin.php");

function PrintPluginList($option)
	{
		$all_plugins = get_plugins();

		if ($option == 1)
			{
				print_r(array_values($all_plugins));
			}
		else
			{
				echo json_encode($all_plugins);
			}
	}

PrintPluginList($_GET['op']);
?>

This is a PowerShell script to automate some of the information

.\GetWordPressPlugins.ps1 http://yourdomain.com/
$url = ($args[0] + "/ListAllPlugins.php?op=1")

$site = (Invoke-WebRequest -Uri $url)
$splitsite = $site -split "`n"

$Array = @()

foreach($line in $splitsite)
    {
        if ($line -match "\[Name\]")
            {
                $Name = ($line -split "=>")[1]
                $Name = $Name.Trim()
            }
        if ($line -match "\[Version\]")
            {
                $Version = ($line -split "=>")[1]
                $Version = $version.Trim()
                         
                   $Array +=(, ($Name + "|" + $Version + "|" + $PluginURI))
            }
        if ($line -match "\[PluginURI\]")
            {
                $PluginURI = ($line -split "=>")[1]
                $PluginURI = $PluginURI.Trim()               
               if ([string]::IsNullOrEmpty($PluginURI))
               {
               $PluginURI = "n/a"    
               }
            }
       
    }
$Array
All information on this site is shared with the intention to help. Before any source code or program is ran on a production (non-development) system it is suggested you test it and fully understand what it is doing not just what it appears it is doing. I accept no responsibility for any damage you may do with this code.

Related

Code PHP PowerShell WordPress

Post navigation

Previous post
Next post

Related Posts

Bytes To MegaBytes

Posted on December 14, 2013October 26, 2015

Function BytesToMegabytes(ByVal Bytes As String) As String Dim SetBytes As String SetBytes = "" If Bytes >= 1073741824 Then SetBytes = Format(Bytes / 1024 / 1024 / 1024, "#0.00") _ & " GB" ElseIf Bytes >= 1048576 Then SetBytes = Format(Bytes / 1024 / 1024, "#0.00") & " MB" ElseIf…

Read More

PowerShell – Compare Windows Server Host Files

Posted on February 10, 2020

If you maintain more than one Windows server sometimes you need a quick way to determine the host file differences on each server, the code below will help. function Read-HostFile() { [CmdletBinding()] Param( [Parameter(Mandatory = $True)] [String] $Computer, [boolean] $ListComputerName = $true ) $Pattern = ‘^(?<IP>\d{1,3}(\.\d{1,3}){3})\s+(?<Host>.+)$’ $File = "\\$Computer\c$\Windows\System32\Drivers\etc\hosts" $Entries…

Read More

MySQL – Get Max Length of Column

Posted on October 29, 2015October 29, 2015

Similar to Max Length of Data In Column – MSSQL this query will do the same for MySQL Replace host (column) along with hosts (table) with what you’d like to check SELECT host ,LENGTH(host) AS mlen FROM hosts ORDER BY mlen DESC All information on this site is shared with…

Read More

Code

Top Posts & Pages

  • PowerShell - Rename Pictures to Image Taken
  • Front Page
  • C# - Start/Stop/Restart Services
  • MacPorts / HomeBrew - Rip CD tracks from terminal
  • PowerShell - Show File Extensions

Recent Posts

  • Javascript – Digital Clock with Style
  • BASH – Web Ping Log
  • BASH – Picture / Video File Name Manipulation
  • Mac OSX Terminal – Create SSH Key
  • Bash – Rename Picture

Top Posts

  • PowerShell - Rename Pictures to Image Taken
  • C# - Start/Stop/Restart Services
  • MacPorts / HomeBrew - Rip CD tracks from terminal
  • PowerShell - Show File Extensions
  • SQLite - Auto-Increment / Auto Generate GUID
©2025 David Kittell | WordPress Theme by SuperbThemes