PHPackages                             digitoimistodude/dude-really-simple-ads - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. digitoimistodude/dude-really-simple-ads

ActiveWordpress-plugin

digitoimistodude/dude-really-simple-ads
=======================================

A simple way to manage, track and show ads

1.2.4(1y ago)1066[1 issues](https://github.com/digitoimistodude/dude-really-simple-ads/issues)GPL-3.0+PHPCI failing

Since Jan 28Pushed 1y ago1 watchersCompare

[ Source](https://github.com/digitoimistodude/dude-really-simple-ads)[ Packagist](https://packagist.org/packages/digitoimistodude/dude-really-simple-ads)[ Docs](https://github.com/digitoimistodude/dude-really-simple-ads)[ RSS](/packages/digitoimistodude-dude-really-simple-ads/feed)WikiDiscussions master Synced 2d ago

READMEChangelog (9)DependenciesVersions (11)Used By (0)

> **Note**This ad plugin is considered legacy. You should really consider using [air-ads](https://github.com/digitoimistodude/air-ads).

Really simple ads
=================

[](#really-simple-ads)

[![version_1.2.2](https://camo.githubusercontent.com/1983ea9881946f9b9642c0f4d10948e8f634d32d776767113af30cfda17b5821/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f56657273696f6e2d312e322e322d6f72616e67652e737667)](https://camo.githubusercontent.com/1983ea9881946f9b9642c0f4d10948e8f634d32d776767113af30cfda17b5821/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f56657273696f6e2d312e322e322d6f72616e67652e737667) [![Tested_up_to WordPress_5.6](https://camo.githubusercontent.com/7801bb2913f70f9dd9ae5dd6ff4f0a755f29270cc14858e0e1790810735f5dc5/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f5465737465645f75705f746f2d576f726450726573735f352e362d626c75652e7376673f7374796c653d666c61742d737175617265)](https://camo.githubusercontent.com/7801bb2913f70f9dd9ae5dd6ff4f0a755f29270cc14858e0e1790810735f5dc5/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f5465737465645f75705f746f2d576f726450726573735f352e362d626c75652e7376673f7374796c653d666c61742d737175617265) [![Compatible_with PHP_7.0](https://camo.githubusercontent.com/fefcba0e0b10c652702ceef9f9d45c90531e876c377e0529597b1fd0ef69baf3/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f436f6d70617469626c655f776974682d5048505f372e302d677265656e2e7376673f7374796c653d666c61742d737175617265)](https://camo.githubusercontent.com/fefcba0e0b10c652702ceef9f9d45c90531e876c377e0529597b1fd0ef69baf3/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f436f6d70617469626c655f776974682d5048505f372e302d677265656e2e7376673f7374796c653d666c61742d737175617265)

[Digitoimisto Dude Oy](https://www.dude.fi) is a Finnish boutique digital agency in the center of Jyväskylä.

Table of contents
-----------------

[](#table-of-contents)

- [Features](#features)
- [Usage](#usage)
    - [Register ad places](#register-ad-places)
    - [Get active ad](#get-active-ad)
    - [Adding a shortcode to embed ads into content](#adding-a-shortcode-to-embed-ads-into-content)
- [Hooks](#hooks)
    - [Set default ad and link](#set-default-ad-and-link)
    - [Disable UTM tags in ad target url](#disable-utm-tags-in-ad-target-url)
    - [Disable or change ad view throttle time](#disable-or-change-ad-view-throttle-time)
- [Changelog](#changelog)
- [Contributing](#contributing)
- [TODO](#todo)

Please note before using
------------------------

[](#please-note-before-using)

By using this code bases, you agree that the anything can change to a different direction without a warning.

Features
--------

[](#features)

Basic feature list includes

- Multiple ad places
- Campaigns containing multiple ads
- Sheculed ads with start and end time
- Sheculed campaigns with start and end time
- Simple view and click counter per ad *(JavaScript)*
- Ad view throttle prevention, so F5 will not bump up the display count *(JavaScript)*
- Private notes for ads and campaigns

Usage
-----

[](#usage)

### Register ad places

[](#register-ad-places)

Ad places are registered with `drsa_ad_placement_sizes` hook. You should pass nested array containing one array element per each ad place. See basic exmaple below.

```
add_filter( 'drsa_ad_placement_sizes', 'myprefix_register_ad_places' );
function myprefix_register_ad_places() {
    $spots = array(
        array(
            // title whichs shows when adding ads
            'name'      => __( 'Frontpage default' ),

            // unique identified for this placed, used to get ads
            'id'        => 'frontpage-default',

            // add size, uploaded image will be tested against these values
            'width'     => 480,
            'height'    => 480,

            // for having multiple ads in the same place, ads will be shown in the order of least shown to most shown
            'multiple'  => true,
        ),
    );

    return $spots;
}
```

### Get active ad

[](#get-active-ad)

Getting the active ad is fairly simple, just use `get_the_active_ad` function and pass the used ad place as a paremeter.

If there is active campaign for that ad place, a random active ad assigned to selected place will be returned. When there is no active campaign, active single ad for place is returned. Default ad and link will be returned if no active campaign or ad are found, if there is no default then return is false.

When there is ad, return is array containing the ad place name, image src, target address and click counter class. Simple usage example is below, but you can modify it according to your needs. Click counter class needs to be in the same element with the target href.

```
$ad = false;
if ( function_exists( 'get_the_active_ad' ) ) {
    $ad = get_the_active_ad( 'frontpage-default' );
}

if ( $ad ) {
    echo '';
}
```

*Always check the existance of function.*

### Adding a shortcode to embed ads into content

[](#adding-a-shortcode-to-embed-ads-into-content)

You can make your own shortcode to get ads everywhere you want, for example into the content of blog post. Below is simple example of shortcode usage.

```
add_shortcode( 'ad', 'myprefix_shortcode_show_ad' );
function myprefix_shortcode_show_ad( $atts ) {
    if ( ! function_exists( 'get_the_active_ad' ) ) {
        return; // plugin not active, bail
    }

    if ( empty( $atts ) ) {
        return; // no attributes to shortcode, bail
    }

    // no ad place defined, show error to user and bail if visitor
    if ( ! isset( $atts['place'] ) ) {
        if ( is_user_logged_in() && current_user_can( 'edit_others_posts' ) ) {
            return __( 'No ad place defined', 'textdomain' );
        } else {
            return;
        }
    }

    // get the ad
    $ad = get_the_active_ad( $atts['place'] );

    // no active ad, show error to user and bail if visitor
    if ( ! $ad ) {
        if ( is_user_logged_in() && current_user_can( 'edit_others_posts' ) ) {
            return __( 'No active ads or campaigns', 'textdomain' );
        } else {
            return;
        }
    }

    // return ad html
    return '';
}
```

Hooks
-----

[](#hooks)

Plugin contains a set of hooks for you to use and modify behavior of plugin.

### Set default ad and link

[](#set-default-ad-and-link)

If there is no active ads for the place, you can set default image and link for the ad place in question with two different hooks.

Use filter `drsa_default_ad/{place-id}` to set default ad image src. Use filter `drsa_default_ad_target/{place-id}` to set default ad address.

### Disable UTM tags in ad target url

[](#disable-utm-tags-in-ad-target-url)

By default [UTM](https://support.google.com/analytics/answer/1033863#parameters) tags are inserted automatically to the ad target address, use filter `drsa_use_utm` to disable it.

To disable globally, use `add_filter( 'drsa_use_utm', '__return_false' );`To disable by ad place, use `add_filter( 'drsa_use_utm\{place-id}', '__return_false' );`To disable by single ad, use `add_filter( 'drsa_use_utm\ad\{ad-id}', '__return_false' );`

### Disable or change ad view throttle time

[](#disable-or-change-ad-view-throttle-time)

If visitor reloads the page or visits in the same page again within 30 seconds after first visit, the new visit is not counted to ad views. If same ad is shown in multiple pages, each page has it's own throttle prevention. For exmaple if ad is in sidebar, reload within 30 seconds in frontpage does not count new view but visit in another page will.

This is simple prevention to ensure that view count is somewhat accurate.

Change the throttle time with filter `drsa_counter_cookie_timeout`, return thtrottle time in milliseconds. To disable the feature, return zero.

### End ads display at specific amount of views

[](#end-ads-display-at-specific-amount-of-views)

Set filter `drsa_end_ads_by_show_count` to true, to switch ad ending from date to view count.

### Allow alternative images for ads

[](#allow-alternative-images-for-ads)

Set filter `drsa_allow_alternative_image` to true, to allow alternative images for ads. This will ad a alternative image field in ad edit screen. Use `drsa_alternative_image_desctiption_text` filter, to change the description of the field. Default ''.

Changelog
---------

[](#changelog)

Changelog can be found from [releases page](https://github.com/digitoimistodude/dude-really-simple-ads/releases).

Contributing
------------

[](#contributing)

If you have ideas about the plugin or spot an issue, please let us know. Before contributing ideas or reporting an issue about "missing" features or things regarding to the nature of that matter, please read [Please note](#please-note-before-using) section. Thank you very much.

TODO
----

[](#todo)

\[ \] better inline commenting

###  Health Score

32

—

LowBetter than 72% of packages

Maintenance30

Infrequent updates — may be unmaintained

Popularity15

Limited adoption so far

Community12

Small or concentrated contributor base

Maturity59

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 92.3% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~153 days

Recently: every ~139 days

Total

9

Last Release

701d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/ac8f1091787825c059e30ad39ca1f58453f45c5ae0c585ba3be00904d045b8b2?d=identicon)[ronilaukkarinen](/maintainers/ronilaukkarinen)

---

Top Contributors

[![timiwahalahti](https://avatars.githubusercontent.com/u/415544?v=4)](https://github.com/timiwahalahti "timiwahalahti (72 commits)")[![EliasKau](https://avatars.githubusercontent.com/u/1349003?v=4)](https://github.com/EliasKau "EliasKau (3 commits)")[![lukanja](https://avatars.githubusercontent.com/u/83268110?v=4)](https://github.com/lukanja "lukanja (1 commits)")[![Niq1982](https://avatars.githubusercontent.com/u/16206361?v=4)](https://github.com/Niq1982 "Niq1982 (1 commits)")[![raikasdev](https://avatars.githubusercontent.com/u/29684625?v=4)](https://github.com/raikasdev "raikasdev (1 commits)")

---

Tags

adsdude-really-simple-adswordpress-pluginpluginwordpress

### Embed Badge

![Health badge](/badges/digitoimistodude-dude-really-simple-ads/health.svg)

```
[![Health](https://phpackages.com/badges/digitoimistodude-dude-really-simple-ads/health.svg)](https://phpackages.com/packages/digitoimistodude-dude-really-simple-ads)
```

###  Alternatives

[sybrew/the-seo-framework

An automated, advanced, accessible, unbranded and extremely fast SEO solution for any WordPress website.

47078.8k](/packages/sybrew-the-seo-framework)[afragen/git-updater

A plugin to automatically update GitHub, Bitbucket, GitLab, or Gitea hosted plugins, themes, and language packs.

3.3k1.6k](/packages/afragen-git-updater)[webdevstudios/cmb2-attached-posts

Custom field for CMB2 for creating post relationships.

13565.5k](/packages/webdevstudios-cmb2-attached-posts)[iceicetimmy/acf-post-type-selector

Post type selector for Advanced Custom Fields.

559.0k](/packages/iceicetimmy-acf-post-type-selector)[10up/debug-bar-elasticpress

Extends the Debug Bar plugin for usage with ElasticPress

2917.0k](/packages/10up-debug-bar-elasticpress)[alleyinteractive/pest-plugin-wordpress

WordPress Pest Integration

263.7k1](/packages/alleyinteractive-pest-plugin-wordpress)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
