12 Simple PHP commands for WordPress administrators 2

12 Simple PHP commands for WordPress administrators

Get blog info

See WordPress version and number of posts

PHP

Example response:

Shell

[ Back to Top ]

List plugins

List files in Plugins directory

PHP

Example response:

Shell

[ Back to Top ]

Get theme directory in WordPress

WordPress comes with a number of useful functions you can use to get the current theme path or URL. You can run the following PHP code to list their values:

PHP

Example response:

Shell

ReferenceGet Theme Directory In WordPress – Paulund

[ Back to Top ]

Get file content

PHP

[ Back to Top ]

Estimate time to load page

PHP

[ Back to Top ]

Check file size

PHP

[ Back to Top ]

Check free space on your server

Very useful snippet to check the free space on your server

PHP

Example response:

Shell

[ Back to Top ]

Check file readability

PHP

[ Back to Top ]

Get the URL of the WP upload directory

PHP

Example response:

Shell

[ Back to Top ]

Rename files with garbled filename

The command ls -i shows the inode number of files

PHP

The command find -inum returns the filepath of a specific inode in the file system

PHP

With the parameter and the placeholder -exec {}, the command apply the second part to rename the specific inode file

PHP

[ Back to Top ]

Get database size

PHP

[ Back to Top ]

Get database stats

PHP

[ Back to Top ]

If you like this post, please share it with your Facebook and Twitter. You might also support me by donating via Ko-fi.

scroll to top