Title: WP Utility Script Runner
Author: Bytes.co
Published: <strong>19 ສິງຫາ 2017</strong>
Last modified: 22 ຕຸລາ 2018

---

ຄົ້ນຫາປລັກອິນ

![](https://ps.w.org/wp-utility-script-runner/assets/banner-772x250.jpg?rev=1960906)

ປລັກອິນນີ້ **ຍັງບໍ່ທັນໄດ້ຮັບການທົດສອບກັບ WordPress 3 ເວີຊັນຫຼັກຫຼ້າສຸດ**. ມັນອາດຈະ
ບໍ່ໄດ້ຮັບການເບິ່ງແຍງ ຫຼື ສະໜັບສະໜູນອີກຕໍ່ໄປ ແລະ ອາດມີບັນຫາການເຮັດວຽກຮ່ວມກັນເມື່ອ
ໃຊ້ກັບ WordPress ເວີຊັນທີ່ໃໝ່ກວ່າ.

![](https://ps.w.org/wp-utility-script-runner/assets/icon-256x256.jpg?rev=1960906)

# WP Utility Script Runner

 ໂດຍ [Bytes.co](https://profiles.wordpress.org/burlingtonbytes/)

[ດາວໂຫຼດ](https://downloads.wordpress.org/plugin/wp-utility-script-runner.zip)

 * [ລາຍລອຽດ](https://lo.wordpress.org/plugins/wp-utility-script-runner/#description)
 * [ການຣີວິວ](https://lo.wordpress.org/plugins/wp-utility-script-runner/#reviews)
 *  [ການຕິດຕັ້ງ](https://lo.wordpress.org/plugins/wp-utility-script-runner/#installation)
 * [ການພັດທະນາ](https://lo.wordpress.org/plugins/wp-utility-script-runner/#developers)

 [ການຊ່ວຍເຫຼືອ](https://wordpress.org/support/plugin/wp-utility-script-runner/)

## ຄຳອະທິບາຍ

Sometimes, you run into a situation where you just need to manually run a script.
The actual logic might be as simple as generating a csv from a query, or changing
a user’s settings, or even just running a single line of SQL. WordPress makes this
difficult.

There are many hacky solutions to the problem, but most of them lack security or
are too difficult for anyone but a developer to run or just take too long to build.
That’s where we come in.

WP Utility Script Runner lets you start with a simple 17 line template, add in your
custom code, save to the server, and in minutes you have a secure, fully featured
utility, that you can safely run from the WordPress dashboard.

But that’s not all! With a few extra lines of code, your utility can:

 * Accept user input
 * Accept file input
 * Run at a future date and time
 * Run on a recurring schedule
 * Run large tasks by breaking them up into several smaller tasks, and saving state.
 * Create reports and other output files

## ພາບໜ້າຈໍ

 * [[
 * The simplest version of a utility only has 17 lines of required code.
 * [[
 * Utilities can be enabled and disabled from the manage tab
 * [[
 * Scripts are tucked away behind accordions, to prevent accidentally running them.
 * [[
 * Output is presented in real-time, without refreshing the page

## ການຕິດຕັ້ງ

 1. Upload the plugin files to the `/wp-content/plugins/plugin-name` directory, or 
    install the plugin through the WordPress plugins screen directly.
 2. Activate the plugin through the ‘Plugins’ screen in WordPress
 3. Use the Settings->Utility Scripts screen to manage and run utility scripts

## ຄຳຖາມທີ່ພົບເລື້ອຍ

  Why would I ever need to run a script on-demand, rather than on page load?

There are many times running on page load is not the best option:

 * You may want to ensure that a task only happens once, when many people may be
   visiting the page
 * You may need to capture some form of output from the script, without showing 
   it to all users
 * You may have multiple team members working on the site, and not want to harm 
   their workflow with your debugging output
 * You may need to be able to have non-developers run the script periodically, for
   tasks like report generation

There are too many other use cases to count. If you don’t see a use case, you probably
don’t need this tool, and that’s ok.

  Why not just write some custom PHP and tuck it in a subfolder?

There are many caveats to taking this approach, but mostly it just leaves you writing
a lot of (probably insecure) code.

To build a custom script properly, you need to:

 * Handle security on your own.
 * Either duplicate or side-load any WordPress functions you need
 * Build an interface and form handler
 * Handle downloads
 * Handle cron
 * Get around PHP_MAX_EXECUTION_TIME

That can be a massive amount of code, for a script that could be as simple as a 
single SQL query.

  Why not WP-CLI?

We love WP-CLI, but sometimes the command line is just not the right tool for the
job. Often you can’t get WP-CLI on shared hosts, and users who may need to use the
utilities may not be comfortable with the command line. But stay tuned, WP-CLI integration
is on our roadmap.

  Why not (Insert Solution Here)?

The most common answer is feature completion and ease of access. A utility script
can contain as little as 17 lines of overhead, before you are free and clear to 
write whatever you need. We dare you to find a lighter-weight, more feature-complete
option. We wrote WP Utility Script Runner because there wasn’t one.

  Is it possible to get down to under 17 lines of boilerplate?

Technically? Yes. But you’ll be sacrificing a lot of features. You can write your
utility in “legacy mode”, where it can be written as simply as:

> <?php
>  // Utility Name: My Legacy Utility // Description: An example of a legacy
> utility echo “Hello World”; // your custom code goes here

You will not get native handling for inputs, files, state, downloads, or error output,
but it is pretty darn short.

  Why aren’t there any useful utilities bundled in?

Most of the time, we find that Utility Scripts are very custom to the specific site
and hosting environment. We have plans to build a library of useful scripts, but
for now, we just included a couple examples to help you get started writing your
own.

  Your plugin is bad, and You should feel bad!

While that’s not exactly a question, we do take bug reports and reviews very seriously.
In addition, you can always contact us directly with your thoughts, at support@burlingtonbytes.
com.

## ການຣີວິວ

![](https://secure.gravatar.com/avatar/d7eb3d6485017e2f78f8ab63a6e86ef7ca9a709b99633a258820014d97c66f71?
s=60&d=retro&r=g)

### 󠀁[Great utility for scripting WP](https://wordpress.org/support/topic/great-utility-for-scripting-wp/)󠁿

 [François Nonnenmacher](https://profiles.wordpress.org/ubiquitic/) 17 ພຶດສະພາ 2019

I can’t believe this plugin has not been reviewed before. It’s a great little utility,
and the example scripts are perfect to start writing your own. Thank you for this!

 [ ອ່ານການຣີວິວທັງໝົດ 1 ລາຍການ ](https://wordpress.org/support/plugin/wp-utility-script-runner/reviews/)

## ຜູ້ຮ່ວມພັດທະນາ ແລະ ຜູ້ພັດທະນາ

“WP Utility Script Runner” ແມ່ນຊອຟແວໂອເພັນຊອດ (Open Source). ບຸກຄົນຕໍ່ໄປນີ້ໄດ້ມີ
ສ່ວນຮ່ວມໃນການພັດທະນາປລັກອິນນີ້.

ຜູ້ຮ່ວມພັດທະນາ

 *   [ Bytes.co ](https://profiles.wordpress.org/burlingtonbytes/)
 *   [ gschoppe ](https://profiles.wordpress.org/gschoppe/)

[ແປ “WP Utility Script Runner” ເປັນພາສາຂອງເຈົ້າ.](https://translate.wordpress.org/projects/wp-plugins/wp-utility-script-runner)

### ສົນໃຈຮ່ວມພັດທະນາບໍ່?

[ເບິ່ງລະຫັດ](https://plugins.trac.wordpress.org/browser/wp-utility-script-runner/),
ກວດເບິ່ງ [ຄັງເກັບ SVN](https://plugins.svn.wordpress.org/wp-utility-script-runner/),
ຫຼື ຕິດຕາມ [ບັນທຶກການພັດທະນາ](https://plugins.trac.wordpress.org/log/wp-utility-script-runner/)
ຜ່ານ [RSS](https://plugins.trac.wordpress.org/log/wp-utility-script-runner/?limit=100&mode=stop_on_copy&format=rss).

## ບັນທຶກການປ່ຽນແປງ

#### 08/29/2018 – 1.1.0

 * Bugfix for form fields with hyphens in name improperly serializing

#### 11/16/2017 – 1.0.1

 * Bugfix for sample Comment2Post utility

#### 08/19/2017 – 1.0.0

 * Initial Release!

## ຂໍ້ມູນກຳກັບ (Meta)

 *  ເວີຊັນ **1.1.0**
 *  ອັບເດດຫຼ້າສຸດເມື່ອ **7 ປີ ທີ່ຜ່ານມາ** ທີ່ຜ່ານມາ
 *  ການຕິດຕັ້ງທີ່ໃຊ້ງານຢູ່ **90+**
 *  ເວີຊັນ WordPress ** 4.6 ຫຼື ສູງກວ່າ **
 *  ທົດສອບເຖິງເວີຊັນ **5.0.25**
 *  ພາສາ
 * [English (US)](https://wordpress.org/plugins/wp-utility-script-runner/)
 * ແທັກ
 * [cron](https://lo.wordpress.org/plugins/tags/cron/)[developers](https://lo.wordpress.org/plugins/tags/developers/)
   [task](https://lo.wordpress.org/plugins/tags/task/)[utilities](https://lo.wordpress.org/plugins/tags/utilities/)
 *  [ມຸມມອງຂັ້ນສູງ](https://lo.wordpress.org/plugins/wp-utility-script-runner/advanced/)

## ການໃຫ້ຄະແນນ

 5 ຈາກທັງໝົດ 5 ດາວ.

 *  [  ການວິຈານ 5 ດາວ ຈຳນວນ 1 ລາຍການ     ](https://wordpress.org/support/plugin/wp-utility-script-runner/reviews/?filter=5)
 *  [  ການວິຈານ 4 ດາວ ຈຳນວນ 0 ລາຍການ     ](https://wordpress.org/support/plugin/wp-utility-script-runner/reviews/?filter=4)
 *  [  ການວິຈານ 3 ດາວ ຈຳນວນ 0 ລາຍການ     ](https://wordpress.org/support/plugin/wp-utility-script-runner/reviews/?filter=3)
 *  [  ການວິຈານ 2 ດາວ ຈຳນວນ 0 ລາຍການ     ](https://wordpress.org/support/plugin/wp-utility-script-runner/reviews/?filter=2)
 *  [  ການວິຈານ 1 ດາວ ຈຳນວນ 0 ລາຍການ     ](https://wordpress.org/support/plugin/wp-utility-script-runner/reviews/?filter=1)

[Your review](https://wordpress.org/support/plugin/wp-utility-script-runner/reviews/#new-post)

[ເບິ່ງ ຄຳຄິດເຫັນ ທັງໝົດ](https://wordpress.org/support/plugin/wp-utility-script-runner/reviews/)

## ຜູ້ຮ່ວມພັດທະນາ

 *   [ Bytes.co ](https://profiles.wordpress.org/burlingtonbytes/)
 *   [ gschoppe ](https://profiles.wordpress.org/gschoppe/)

## ການຊ່ວຍເຫຼືອ

ມີຄຳຖາມ ຫຼື ຕ້ອງການຄວາມຊ່ວຍເຫຼືອບໍ່?

 [ເບິ່ງຟໍຣັມການຊ່ວຍເຫຼືອ](https://wordpress.org/support/plugin/wp-utility-script-runner/)