• Hi, Pleskians! We are running a UX testing of our upcoming product intended for server management and monitoring.
    We would like to invite you to have a call with us and have some fun checking our prototype. The agenda is pretty simple - we bring new design and some scenarios that you need to walk through and succeed. We will be watching and taking insights for further development of the design.
    If you would like to participate, please use this link to book a meeting. We will sent the link to the clickable prototype at the meeting.
  • Our UX team believes in the in the power of direct feedback and would like to invite you to participate in interviews, tests, and surveys.
    To stay in the loop and never miss an opportunity to share your thoughts, please subscribe to our UX research program. If you were previously part of the Plesk UX research program, please re-subscribe to continue receiving our invitations.
  • The Horde webmail has been deprecated. Its complete removal is scheduled for April 2025. For details and recommended actions, see the Feature and Deprecation Plan.

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