All Collections
Code - Generate, edit, explain
Code - Generate, edit, explain

The core code creation feature of CodeWP - conversationally build plugins and snippets.

Updated over a week ago

CodeWP’s codegen features are created specifically for WordPress creators. They are designed to help you build WordPress snippets, plugins and themes faster and with less effort.

Our inspiration comes from painting a picture. Just as an artist envisions the final image and starts by creating a base, sketch, and structure, our platform allows users to begin with AI-generated code. The artist then progressively refines the painting by adding colors, shadows, and other details, enhancing its visual appeal with each step.

CodeWP is like painting a picture.

Similarly, our platform enables you to iteratively refine code through a conversational interface. You can add features, make adjustments, and eventually arrive at the final product, which may consist of multiple files in various programming languages.

​How it works

Everything is done in a conversational interface. To generate code, simply request it. You can do this by typing a command in the Code Editor, or by using the chatbox feature in the dashboard. CodeWP will recognize the intent of your request, and generate the code you need.

You’ll be able to see the generated code added to the editor in real time. If you realize that it’s not what you need, you can ask CodeWP to stop.

Sometimes, CodeWP will create placeholders, or stop the generation process. You can simply ask it to continue, or to fill in the placeholders.

At the end of the generation, CodeWP will also give a summary of the code it has generated. You can use this to make sure that it has understood your request correctly.

​Editing Code

Generation and Editing features go hand in hand (think back to the example of painting a picture). In many cases, a carefully crafted prompt will get you the code snippet you require in one go. However, you may need to make adjustments to the code to get it to work as intended. In such cases, you can use the Edit feature to make changes to the code.

Editing is simple. Simply ask CodeWP to revise, add, change, or remove specific code or features. It will make the necessary changes, and show you the updated code in real time.

Editing External Code

A unique feature of the CodeWP platform is the ability to edit code from external sources. You don’t need to generate it on the platform. You can simply copy and paste it into the Code Editor, and then use the Edit feature to make changes to it.

For example, say you find the perfect code on StackOverflow, but want to make it work for your specific use case. You can copy and paste it into the Code Editor, and then ask CodeWP to make the necessary changes. It’ll keep the general structure and functionality of the code, while changing the specific details to match your requirements.

Conversation Settings​

You can set conversational settings that apply to all code generations and edits during a session.

For example, turning off auto-classification means the AI will ask how you want to proceed after each submission, giving you the options to generate, edit, or explain code. This introduces some friction but can be helpful if auto-classification isn't working well.

Understanding Code

Developers, hobbyists, and non-techies alike use our tool. CodeWP is trained on WordPress - so you can think of it as a WordPress expert. It understands the WordPress ecosystem, and can explain code in simple terms.

You can ask CodeWP to explain any code snippet to you. It will give you a summary of the code, and explain the purpose of each line. This is useful if you’re not sure what a particular line of code does, or if you want to understand the code before you use it.

You can also ask CodeWP to review security, performance, and other aspects of your code. And, just like the editing feature, you can use this to review code from external sources as well.

​Multi File Support

WordPress code typically consists of multiple files. For example, a plugin may have a main plugin file, a readme file, and a license file. CodeWP supports multi-file code generation, and can generate code in multiple languages.

When using multiple files, CodeWP creates a package to hold them together. This package can be downloaded as a zip file, and used as a plugin or theme. You can edit various metadata fields for the package, such as the name, description, and version.

​Automatic Support

When generating code, if CodeWP detects that you need multiple files, it will automatically generate them for you. For example, if you want to create a form shortcode, it will generate the shortcode function, the form HTML, JS, and CSS for the form.

​Manual Support

You can also manually create a package of multiple files. To do this, simply create a new file, and then ask CodeWP to add it to the package. You can also ask CodeWP to remove files from the package, or to generate a new file.

Did this answer your question?