WP Manifestindependent plugin directory
manifest / forms / odoo-wp-plugin

Contact Form 7 to Odoo connector WP Registry grade B-. Medium-severity findings · 3 findingsWP RegistryMedium-severity findings · 3 findingsOpen the reportB- #8 in Forms

Odoo WordPress Plugin

★ 10stars
429release downloads
≈30active sites
0.1.8latest · 1 year ago

Install

Download odoo-wp-plugin.zip From the 0.1.8 release on GitHub, Nov 10, 2024

Upload it under Plugins → Add New Plugin → Upload Plugin, then activate.

Install straight from GitHub with WP-CLI:

wp plugin install https://github.com/jack-dane/odoo-wp-plugin/releases/download/0.1.8/odoo-wp-plugin.zip
No built-in updater. New versions won't appear under Dashboard → Updates. Install new releases yourself, or let Git Updater track the repository.

Odoo Contact Form 7 Connector

Integrate your WordPress Contact 7 Forms to Odoo. You can easily set up the integration yourself to create contacts or leads when a form has been submitted.

Motivation

Due to Odoo not providing a rest API it is not so easy to implement this feature without needing to create a bespoke plugin for each website/form.

This plugin provides admins an interface in which they can create dynamic connections to different Odoo instances without needing to code anything.

Installation

You can download the latest version of the plugin via the releases page.

Install from source code

Due to some difficulties with XML-RPC support, composer is needed.

  1. First you need to clone the repository.
  2. Install the dependencies of the repository using composer. This can be done simply by calling composer install when composer is complete.
  3. Zip the plugin and upload to your wordpress site.

This plugin can be tested within a docker environment.

How to use the Wordpress plugin

  1. Create an API Key in your Odoo instance.
  2. Create an Contact 7 Form, unless one has already been created.
  3. Once the WordPress plugin has been installed you will be able to see a new menu item down the side. Now create a connection with the following from Odoo: the Odoo URL, the Odoo database name, the email of your Odoo user and the newly created API Key.
  4. Create an Odoo form with the newly created connection and the contact 7 form. Also add the Odoo model that has been created the, eg for creating a contact in Odoo use "res.partner".
  5. Now map the Contact 7 Form fields to what values they will fill within Odoo using the Odoo Form Mapping. You can also set constant values that the form should fill in within Odoo.
  6. Submit the form and you should see the new object created in your odoo instance.

The UI has changed since this video was release but the concept is still the same

Video Tutorial

Examples

See examples for examples of supported Odoo field types and how to use them.

Security

  • API keys are encrypted in the system using Sodium symmetric key encryption.
  • Encryption keys can be refreshed if you think it has been leaked. Warning - Refreshing an encryption key will remove all the Odoo connection, form and form mapping data.

Requirements

  • PHP 8.1 or greater
  • Ideally Odoo 14 or greater as versions before 14 don't support API keys. A password should work instead of an API key but is ill-advised.

Troubleshooting

  • There is a test button for each connection row. Press this to make a test connection to check authentication before assuming the connection details are correct.
  • Errors that have caused a form to not submit to Odoo will be shown in the "Odoo Submit Errors" tab.

Contributing

  • Run runE2ETests.sh before making a pull request.
  • Assume that this will be run on a Linux machine and has docker installed.

Try with Docker

You can easily try the plugin within docker, first install the composer dependencies and then use the command docker compose up. You will have a newly wordpress instance running on port 8080. You just need to install the plugin from the install page along with Contact Form 7.

Releases

12 releases. Each count is every asset in that release; expand a row for the breakdown.

Tag
Published
Assets
Downloads
0.1.8 latest
Nov 10, 2024 1 year ago
odoo-wp-plugin.zip
158
Aug 25, 2024 2 years ago
odoo-wp-plugin.zip
42
Jul 7, 2024 2 years ago
odoo-wp-plugin.zip
34
Jun 23, 2024 2 years ago
odoo-wp-plugin.zip
12
Jun 15, 2024 2 years ago
odoo-wp-plugin.zip
6
May 22, 2024 2 years ago
odoo-wp-plugin.zip
31
Apr 10, 2024 2 years ago
odoo-wp-plugin.zip
27
Dec 30, 2023 2 years ago
odoo-wp-plugin.zip
41
Dec 21, 2023 2 years ago
odoo-wp-plugin.zip
10
Oct 26, 2023 3 years ago
odoo-wp-plugin.zip
24
Oct 4, 2023 3 years ago
odoo-wp-plugin.zip
13
Sep 10, 2023 3 years ago
odoo-wp-plugin.zip
31

Active-site estimate ≈30 comes from the median of recent superseded releases. Method.

B- grade

Security

Contact Form 7 to Odoo connector 0.1.8 · audited by WP Registry

Medium-severity findings.

2 medium 1 low
Audited release
0.1.8
Findings
3
Worst severity
medium
Content hash
efb88b18ddaa096e6e448be8…

Findings

  • medium Unescaped Odoo error log in admin table (stored XSS via anonymous form submissions reflected in Odoo faults)

    xss_stored

    OdooConnCustomTableDeletableDisplay::column_default() returns raw column values, and the Odoo Errors list table has no escaping column method for error_message. Error rows are inserted by cf7hook.php log_error() from OdooConnException messages, which carry the Odoo XML-RPC faultString produced while processing values posted by anonymous Contact Form 7 visitors. Odoo validation faults commonly quote the offending value, so a visitor can submit markup that is stored and later executed in an administrator's wp-admin session. Exploitability depends on the mapped Odoo field types producing a reflecting fault, hence medium rather than high.

    admin/table_display.php:108-111

    Recommendation

    Escape all list-table output (return esc_html( $item[ $column_name ] )) and escape contact_7_title in column_contact_7_title(); optionally sanitize fault strings before storing.

  • medium Bulk delete of connections/forms/mappings/errors executes on GET without nonce (CSRF)

    csrf

    OdooConnPageRouter::display_table() calls $this->table_display->check_bulk_action(), which deletes every id in $_REQUEST['element'] when current_action() is 'delete_bulk'. The nonce check in OdooConnPageRouterCreate::verify_nonce() only runs for POST requests, and the errors router has no nonce check at all, so a GET link sent to a logged-in administrator deletes Odoo connections, form definitions or field mappings, breaking the CF7->Odoo pipeline.

    admin/table_display.php:55-68

    Recommendation

    Call check_admin_referer('bulk-' . $this->_args['plural']) inside check_bulk_action() before deleting, and only process deletions on POST.

  • low Encryption key for stored Odoo API keys written to web-accessible plugin directory

    information_disclosure

    OdooConnEncryptionFileHandler writes the libsodium secretbox key to wp-content/plugins/odoo-wp-plugin/odoo_conn.key with no .htaccess/index protection, so on typical servers anyone can download it. Combined with any database read (backup leak, SQLi elsewhere) the encrypted Odoo API keys can be decrypted.

    encryption.php:9-37

    Recommendation

    Derive the key from wp_salt()/a wp-config constant or store it outside the webroot; at minimum deny web access to the key file.

WP Registry hashes the installable build and reports on that exact bytes-for-bytes copy. Embargoed findings are withheld until they are disclosed, so a clean verdict means nothing public is outstanding. WP Manifest does not audit code itself.