=== Diretsa ===
Contributors: edzai
Tags: ads, advertising, monetization, publishers, south africa
Requires at least: 6.3
Tested up to: 7.1
Requires PHP: 7.4
Stable tag: 1.1.0
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Sell ad space on your site through Diretsa, South Africa's media marketplace. Verify your site, place ads with a block, and see your earnings.

== Description ==

[Diretsa](https://diretsa.com) connects South African publishers with advertisers, and with the AI buying agents that book media through AdCP, the open standard for buying ads. You set your prices and keep 70% of media revenue. Advertisers prepay, and you are paid monthly.

This plugin:

* adds Diretsa's verification tag to your home page and asks Diretsa to check it, so you do not need to edit your theme;
* places your Diretsa ad placements with the "Diretsa ad" block, the "Diretsa ad" widget or a shortcode such as `[diretsa_ad id="..."]`;
* shows your last 30 days' impressions, clicks and earnings, and your next payout, on the WordPress dashboard.

Prices, placements, ad rules (review each ad, block categories or competitors) and bank details are managed in Diretsa Media Control at diretsa.com. You need a free Diretsa publisher account to use this plugin.

= What the connection key can do =

The key you paste is made for this one site. It can read the site's placements, ask Diretsa to check verification, and read the site's earnings. It cannot book ads, move money, change prices or see other sites. You can revoke it at any time in Media Control.

== External services ==

This plugin connects to two services run by Diretsa (Aha Core (Pty) Ltd, South Africa). Both are needed for it to work.

**1. The Diretsa API (https://api.diretsa.com)**, used to connect the site, check verification and show earnings.

* What is sent: your connection key, your site's address (in the request's User-Agent header) and, when you choose Check verification, a request for Diretsa to load your home page and look for its verification tag.
* When: when you choose Connect, Refresh or Check verification under Settings → Diretsa; when the WordPress dashboard shows the Diretsa earnings box (at most once an hour); and twice a day in the background to keep your placements current while the plugin is connected.
* Nothing about your visitors is sent to the API.

**2. Diretsa's ad server (https://serve.diretsa.com)**, which fills your ad placements with the ads booked for them.

* What is sent: when a visitor views a page with a Diretsa ad, their browser loads the ad server's script and asks it for the ad. As with any web request, this includes the visitor's IP address, browser user agent and the page address. The ad server shortens IP addresses before storing anything and sets no cookie that follows visitors across sites.
* When: only on pages where you have placed a Diretsa ad block, widget or shortcode, and only while the plugin is connected.

Diretsa terms of service: https://diretsa.com/terms
Diretsa privacy notice: https://diretsa.com/privacy

== Installation ==

1. Install the plugin from Plugins → Add New (search for "Diretsa"), or upload it, and activate it.
2. In Diretsa Media Control (https://diretsa.com/publisher/sites), open your site and choose Connect WordPress. Copy the connection key.
3. In WordPress, go to Settings → Diretsa, paste the key and choose Connect.
4. Choose Check verification. Once your site is verified, add placements in Media Control, choose Refresh, and place them with the block, the widget or the shortcode.

== Frequently Asked Questions ==

= Do I need a Diretsa account? =

Yes. Sign up as a publisher at https://diretsa.com. Signing up and listing your site are free; Diretsa keeps 30% of what advertisers pay for your space.

= Verification fails =

Caching plugins can serve an old copy of your home page without the tag. Clear the cache, then choose Check verification again.

= An ad space stays empty =

Ads show only while a booking is running for that placement. Placements that are not on sale say why under Settings → Diretsa.

= Can I choose which ads appear? =

Yes. In Media Control you can review each ad before it runs, and block ad categories or competing brands.

= What happens when I deactivate or delete the plugin? =

Ads stop showing straight away. Deleting the plugin also removes its settings and connection key from your site. Revoke the key in Media Control as well.

== Screenshots ==

1. Settings → Diretsa: connection, verification and your placements with their shortcodes.

== Changelog ==

= 1.1.0 =
* Ad slots are built by the plugin from the zone numbers Diretsa sends, and the ad server's script is loaded with wp_enqueue_script.
* Requires WordPress 6.3 or later.
* Tested with WordPress 7.1.

= 1.0.0 =
* First release: connect, verify, place ads, see earnings.

== Upgrade Notice ==

= 1.1.0 =
Builds ad slots locally and loads the ad server's script the standard WordPress way. Requires WordPress 6.3.
