Linux 软件免费装
Banner图

OnlineCompiler.io Code Runner: Online Compiler and Runnable Code Blocks

开发者 onlinecompiler
更新时间 2026年11月13日 17:58
PHP版本: 7.4 及以上
WordPress版本: 7.1
版权: GPLv2 or later
版权网址: 版权信息

标签

education programming python compiler code block

下载

0.1.0

详情介绍:

OnlineCompiler.io Code Runner adds an online compiler to WordPress. Put a Code runner block in a post or page (or the [onlinecompiler] shortcode in the classic editor), write the code, and readers get a code editor with a Run button right in the page. They can change the code and its input and run it again, with no account and nothing to install. Syntax highlighters only show code; this one runs it. The code runs on OnlineCompiler.io, a code execution service, in an isolated sandbox with no network access. Nothing runs on your WordPress server. Who it's for Features Supported languages Python, C, C++ (and C++20), Java, JavaScript (Node.js), TypeScript (Deno), C#, F#, Visual Basic, Go, Rust, PHP, Ruby, Kotlin, Swift, Dart, Scala, Groovy, Clojure, Haskell, OCaml, Elixir, Erlang, Racket, Common Lisp, Prolog, R, Julia, Octave, Fortran, COBOL, Pascal, Ada, D, Nim, Zig, Crystal, Perl, Lua, Bash, PowerShell, Objective-C, FreeBASIC, Assembly (NASM), SQL (SQLite) and DuckDB. Python includes NumPy, pandas, SciPy, scikit-learn and Matplotlib. The widget, its options and its JavaScript API are documented at onlinecompiler.io/docs/widget. The plugin's source code is on GitHub. Shortcode [onlinecompiler lang="python"]print("Hello")[/onlinecompiler] Attributes, all optional: For code full of < and & (C++ includes, HTML), the block is the safer choice: the classic editor can change such code when it is saved.

安装:

  1. Install and activate the plugin.
  2. Create a free account at onlinecompiler.io (sign in with Google), open the Widgets page of the dashboard and create a widget key. Set its allowed domain to your site's domain, so only your site can use it.
  3. In WordPress, go to Settings, OnlineCompiler.io and paste the widget key.
  4. Add a Code runner block to a post or page.

屏幕截图:

  • The Code runner block in the block editor, with the language, theme and height settings in the sidebar.

常见问题:

How do I add an online compiler to WordPress?

Install this plugin, paste your free OnlineCompiler.io widget key in Settings, OnlineCompiler.io, and add a Code runner block to any post or page. Write the starting code in the block and choose its language in the sidebar. Readers can then edit and run it in the page.

How do I let readers run Python code in a WordPress post?

Add a Code runner block and leave the language at Python (the default), or use [onlinecompiler lang="python"]print("Hello")[/onlinecompiler] in the classic editor. Readers press Run and see the output under the code.

Is it free?

The plugin is free. Running code uses your OnlineCompiler.io account, which has a free plan with no credit card; see pricing for its monthly runs and the paid plans.

Do readers need an account?

No. Readers edit and run the code without signing in. Only you, the site owner, need an OnlineCompiler.io account, for the widget key.

Does the code run on my server?

No. The code runs on OnlineCompiler.io, in a fresh sandbox for each run with no network access, and the sandbox is thrown away afterwards. Your server only serves the page.

Does it work with the classic editor?

Yes, with the [onlinecompiler] shortcode; its attributes are listed above. For code full of < and & (C++ includes, HTML), use the block: the classic editor can change such code when it saves.

Does it slow down my site?

The widget script loads only on pages that have a Code runner, and deferred, so it doesn't hold up the page. Each runner connects only when it scrolls into view; one showing a stored problem connects when the page loads.

What if the service can't be reached?

The code is in the page as text, so readers still see it. Only the Run button needs OnlineCompiler.io.

Can readers' code be checked against tests?

Readers can check their code against tests. Store a problem with tests in your OnlineCompiler.io account and put its id in the block's Problem setting: readers see the statement and starter code, and Judge checks their code against the problem's sample tests. Grading against hidden tests, with a recorded score, needs a session your own server creates for each student, which this plugin doesn't do; the widget documentation describes it, and tests written into the page with the widget's own markup.

Is the widget key secret?

No. Widget keys are made to sit in public pages: they can run code in the widget but can't call the REST API. Set the key's allowed domain to your site so other sites can't use it.

更新日志:

0.1.0