feedback2code

[ Install guide ]

Feedback widget for WordPress themes

For agencies that keep a client's theme in GitHub: enqueue the widget in functions.php, and change requests for templates and styles arrive as pull requests.

Updated

Before you start

  1. Sign in with GitHub and install the feedback2code GitHub App. Choose the repository that holds the code of the site.
  2. Open the repository in the dashboard, go to Configure and add the domains the widget may run on.
  3. Copy the snippet from Embed Widget. It contains your widget ID.

Add the widget

functions.php
add_action( 'wp_enqueue_scripts', function () {
    wp_enqueue_script(
        'feedback2code',
        'https://www.feedback2code.dev/widget/YOUR_WIDGET_ID',
        array(),
        null,
        array(
            'strategy'  => 'async',
            'in_footer' => true,
        )
    );
} );

Replace YOUR_WIDGET_ID with the ID from your dashboard. The strategy argument needs WordPress 6.3 or newer. On older versions, pass true as the last argument to load the script in the footer.

What the agent can change

The agent changes what is in the repository: theme templates, CSS, JavaScript, block patterns and plugin code. Posts, pages and settings live in the WordPress database and are outside its reach.

Every change arrives as a pull request. Nothing is merged or deployed until you do it, so your usual review and deployment stay as they are.

Good to know

  • This setup fits custom themes and plugins under version control. A site built only in the admin area has no repository for the agent to work on.
  • Requests about content, such as “change the opening hours”, are for the editor, not for the agent. Requests about layout and behaviour are a good fit.
  • With a Content-Security-Policy, allow https://www.feedback2code.dev in script-src and frame-src.
  • How a merged pull request reaches the server depends on your deployment. The agent stops at the pull request.

Test it

  1. Deploy the change and open the site on an authorized domain.
  2. Click the button at the bottom right and send one small, concrete request.
  3. Open your dashboard. The submission starts as coding and turns to awaiting review once the pull request is open.

What a submission contains and how the plans differ is described on the page about the website feedback widget.

Other setups

Questions and answers

Is there a WordPress plugin?

No. The widget is loaded with wp_enqueue_script from your theme or a small custom plugin.

Can the agent edit my posts and pages?

No. It only sees the Git repository. Content stored in the database stays in the hands of your editors.

Does it work with block themes?

Yes. Template files, theme.json and patterns of a block theme are files in the repository like any others.

[ Try it ]

Feedback in. Pull request out.

Connect a repository, paste one script tag and send your first feedback.

Free plan · No credit card · GitHub login