Skip to content

Commit

Permalink
feature: make advanced slides compatible to the new advertisement pol…
Browse files Browse the repository at this point in the history
…icy (#183)
  • Loading branch information
MSzturc committed Feb 15, 2023
1 parent bafff2f commit 13434de
Showing 1 changed file with 51 additions and 47 deletions.
98 changes: 51 additions & 47 deletions src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -241,53 +241,6 @@ export default class AdvancedSlidesPlugin extends Plugin {
el.createEl("h2", { text: "Parameters invalid: " + e.message });
}
});


const prevDate = this.settings.motm;
const parts = prevDate.split(/[- :]/);
const currentdate = new Date()
const cur_month = currentdate.toISOString().split(/[- :]/)[1];

if (!parts || (parts.length < 2) || parts[1] !== cur_month) {

this.settings.motm = currentdate.toISOString();
await this.saveData(this.settings);

const mod = new Modal(app);
mod.containerEl.addClass('releaseNotes');
mod.titleEl.createEl('h2', { text: 'Letter from Advanced Slides Development' });

const html = `Dear Advanced Slides user,<br><br>
every beginning is difficult. As a leading user of Advanced Slides, you know how handy it was when you found wide documentation as well as help from the developers on the Obsidian forum or discord to get started with Advanced Slides.<br><br>
With over <b>240.000</b> downloads and over <b>40.000</b> users using Advanced Slides every day, Advanced Slides is on of the top 10 plugins for Obsidian.
<br><br>
However, with the growing number of users, the expenses for support also increase.<br>
On average we get <b>50-60</b> support requests via twitter, github, discord, forum or private message every week.
We invest <b>3-5</b> hours every week to answer these requests.<br> We do that in our free time.<br><br>
It is hard to keep pace and provide new users the same quality in their onboarding that you had before.
This is where you come into play.
A sponsorship of you allows the developers of Advanced Slides to spend more time on community work to give new users the same user experience you had when you started your Advanced Slides journey.
<br><br>
<a href="https://github.com/sponsors/MSzturc">Become a Sponsor</a>
<br><br>
`;

const div = mod.contentEl.createEl('div');
div.innerHTML = html;

mod.open();
}
// eslint-disable-next-line no-empty
} catch (err) { }
}
Expand Down Expand Up @@ -370,6 +323,57 @@ export default class AdvancedSlidesPlugin extends Plugin {
url.pathname = this.fixedEncodeURIComponent(this.target.path);

this.openUrl(url);
this.showMotm();
}

async showMotm() {

const prevDate = this.settings.motm;
const parts = prevDate.split(/[- :]/);
const currentdate = new Date()
const cur_month = currentdate.toISOString().split(/[- :]/)[1];

if (!parts || (parts.length < 2) || parts[1] !== cur_month) {

this.settings.motm = currentdate.toISOString();
await this.saveData(this.settings);

const mod = new Modal(app);
mod.containerEl.addClass('releaseNotes');
mod.titleEl.createEl('h2', { text: 'Letter from Advanced Slides Development' });

const html = `Dear Advanced Slides user,<br><br>
every beginning is difficult. As a leading user of Advanced Slides, you know how handy it was when you found wide documentation as well as help from the developers on the Obsidian forum or discord to get started with Advanced Slides.<br><br>
With over <b>240.000</b> downloads and over <b>40.000</b> users using Advanced Slides every day, Advanced Slides is on of the top 10 plugins for Obsidian.
<br><br>
However, with the growing number of users, the expenses for support also increase.<br>
On average we get <b>50-60</b> support requests via twitter, github, discord, forum or private message every week.
We invest <b>3-5</b> hours every week to answer these requests.<br> We do that in our free time.<br><br>
It is hard to keep pace and provide new users the same quality in their onboarding that you had before.
This is where you come into play.
A sponsorship of you allows the developers of Advanced Slides to spend more time on community work to give new users the same user experience you had when you started your Advanced Slides journey.
<br><br>
<a href="https://github.com/sponsors/MSzturc">Become a Sponsor</a>
<br><br>
`;

const div = mod.contentEl.createEl('div');
div.innerHTML = html;

mod.open();
}

}

private fixedEncodeURIComponent(str: string) {
Expand Down

3 comments on commit 13434de

@claremacrae
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

By the way, you've got over 400,000 downloads now.

May I know how you were able to work out the 40,000 users per day number please? That sounds like a really useful thing to be able to figure out for my own plugin.
Many thanks.

@MSzturc
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ohh thx, yeah maybe i should update this number. The user number is an approximation.

Currently 12.000 - 15.000 unique users visit the Advanced Slides Documentation per day. (I use google analytics to track how which part's of the documentation was read by the user base)
I've read a statistic that on average 40% of the Desktop users are using adblockers (which removes them from tracking as well). I would guess that the target group of Advanced Slides is more tech affine, so this statistic does not fit them perfectly but it was enough for me for this approximation.
Another assumption i've made is that only every 3rd user is opening the documentation, but here i could be wrong

By the same assumption model as before it should be around 50-60k users.. Which could be a bit high since the installation base of 1.19 is 140k users...

Hope that helps ;-)

@claremacrae
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wow that's interesting. Thank you very much indeed.

Please sign in to comment.