Git Product home page Git Product logo

wp-cli-size's Introduction

petenelson/wp-cli-size

Build Status

Quick links: Installing | Usage | Contributing

Installing

Installing this package requires WP-CLI v0.23.0 or greater. Update to the latest stable release with wp cli update.

Once you've done so, you can install this package with wp package install petenelson/wp-cli-size

Usage

Some examples, use wp help size for full options

Database size: wp size database

+-------------------+------+---------+
| Name              | Size | Bytes   |
+-------------------+------+---------+
| wordpress_default | 2 MB | 1703936 |
+-------------------+------+---------+

Table sizes: wp size tables

+-----------------------+-------+---------+------+
| Name                  | Size  | Bytes   | Rows |
+-----------------------+-------+---------+------+
| wp_commentmeta        | 48 KB | 49152   | 0    |
| wp_comments           | 96 KB | 98304   | 1    |
| wp_links              | 32 KB | 32768   | 0    |
| wp_options            | 1 MB  | 1114112 | 152  |
| wp_postmeta           | 48 KB | 49152   | 36   |
| wp_posts              | 80 KB | 81920   | 10   |
| wp_term_relationships | 32 KB | 32768   | 1    |
| wp_term_taxonomy      | 48 KB | 49152   | 1    |
| wp_termmeta           | 48 KB | 49152   | 0    |
| wp_terms              | 48 KB | 49152   | 1    |
| wp_usermeta           | 48 KB | 49152   | 21   |
| wp_users              | 48 KB | 49152   | 1    |
+-----------------------+-------+---------+------+

CSV format: wp size tables --format=csv

Name,Size,Bytes,Rows
wp_commentmeta,"48 KB",49152,0
wp_comments,"96 KB",98304,1
wp_links,"32 KB",32768,0
wp_options,"1 MB",1114112,152
wp_postmeta,"48 KB",49152,36
wp_posts,"80 KB",81920,10
wp_term_relationships,"32 KB",32768,1
wp_term_taxonomy,"48 KB",49152,1
wp_termmeta,"48 KB",49152,0
wp_terms,"48 KB",49152,1
wp_usermeta,"48 KB",49152,21
wp_users,"48 KB",49152,1

Contributing

Code and ideas are more than welcome.

Please open an issue with questions and feedback. Pull requests are expected to include test coverage.

wp-cli-size's People

Contributors

danielbachhuber avatar petenelson avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

wp-cli-size's Issues

Suggested usage syntax

To preface this, I won't be offended if you choose to ignore my suggestions :) I'm opening this issue just to provide my feedback on how I'd write the command, and you have complete freedom to ignore me.

With that out of the way, my initial thought on this package is that the syntax would be better suited as:

wp db size [<tables>....] [--network] [--all-with-prefix] [--format=<format>]

This would bring it closer in-line to wp search-replace, and you could make use of the WP_CLI\Utils\wp_get_table_names() helper API.

With this being said, it might also be cool to introduce wp size media which would give you the size of the uploads directory. As such, the package could become more generically known as wp size

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.