• Introducing WebPros Cloud - a fully managed infrastructure platform purpose-built to simplify the deployment of WebPros products !  WebPros Cloud enables you to easily deliver WebPros solutions — without the complexity of managing the infrastructure.
    Join the pilot program today!
  • The Horde component is removed from Plesk Installer. We recommend switching to another webmail software supported in Plesk.
  • The BIND DNS server has already been deprecated and removed from Plesk for Windows.
    If a Plesk for Windows server is still using BIND, the upgrade to Plesk Obsidian 18.0.70 will be unavailable until the administrator switches the DNS server to Microsoft DNS. We strongly recommend transitioning to Microsoft DNS within the next 6 weeks, before the Plesk 18.0.70 release.

Resolved Get WP get_home_path() via CLI

gbotica

Regular Pleskian
Hi,

In Plesk 12.5, I could use:

Code:
plesk bin wp_instance --get-list

to get a list of all the "attached" WordPress sites in Plesk. However, the only useful thing returns in the Installation URL.

I thought I read that this was later enhanced to return the webroot of each WP instance as well. But now wp_instance appears to be gone in Onyx?

So, I ended up using:

Code:
SELECT dom.id, dom.name, h.www_root FROM domains dom LEFT JOIN DomainServices d ON (dom.id = d.dom_id AND d.type = 'web') LEFT JOIN hosting h ON h.dom_id = dom.id

To get a list of: site.domain | webroot path

However, it would be great to be able to get: site.domain | get_home_path() using the WP CLI?

Is there a way to do this with Plesk Onyx?

Thanks for your time.
 
Hello,

In Plesk Onyx you have an ability to retrieve short or full information about WordPress instances using --list or --info CLI commands correspondingly. For example:

plesk ext wp-toolkit --list
plesk ext wp-toolkit --info -instance-id 123
plesk ext wp-toolkit --info -domain-id 12 -path /httpdocs

Output of --list command conatins following data:
  • WordPress instance identity
  • Main domain (subscription) identity
  • Path to WordPress files, related to main domain root directory
  • Instance owner identity
  • Flag, is instance works properly (is alive)
  • WordPress site URL
  • Name of WordPress instance
  • Version of WordPress
  • Count of installed plug-ins (optional)
  • Count of installed themes (optional)
Output of --info command contains all available WordPress instance data, including configuration paramentes, plug-ins and themes details, etc.

Also, you can retrive data in JSON by using key '-format json'. See 'plesk ext wp-toolkit --help' for details.

This feature available since vesion 2.0.4 of WordPress Toolkit Plesk extension.
 
Thank you so much! I was not aware of how to access the WP Toolkit's CLI.

I have now found this documentation: WordPress Toolkit in Plesk

This is what i used to get all WP Toolkit instances site name and path:

Code:
plesk ext wp-toolkit --info -instance-id 1 -format json | jq --raw-output '.name, .full_path'

This will be useful when scripting, I can use:

Code:
plesk ext wp-toolkit --list -format json | jq '.[] .id'

To get a list of all Wp Toolkit instance iDs, then loop through the IDs, doing WP-CLI stuff, like this:

Code:
plesk ext wp-toolkit --wp-cli -instance-id 1 -- core verify-checksums
 
Back
Top