Skip to content

Commit ff7650f

Browse files
committed
Initial commit
0 parents  commit ff7650f

File tree

1,582 files changed

+224227
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

1,582 files changed

+224227
-0
lines changed

.github/workflows/release.yml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
name: Releases
2+
3+
on:
4+
push:
5+
tags:
6+
- '*'
7+
8+
jobs:
9+
10+
build:
11+
runs-on: ubuntu-latest
12+
permissions:
13+
contents: write
14+
steps:
15+
- uses: actions/checkout@v3
16+
17+
- name: Bump version number
18+
run: sed -i "s/REF/$GITHUB_REF_NAME/g" demo.php && zip -r demo-plugin.zip .
19+
- uses: ncipollo/release-action@v1
20+
with:
21+
artifacts: "demo-plugin.zip"

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
.DS_Store

demo.php

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
<?php
2+
/*
3+
Plugin Name: Demo
4+
Plugin URI: http://anystack.sh
5+
Description: Example plugin
6+
Author: Philo Hermans
7+
Version: REF
8+
Author URI: https://anystack.sh
9+
*/
10+
11+
require 'wp-guard/src/WpGuard.php';
12+
13+
$guard = new Anystack\WpGuard\V001\WpGuard(
14+
__FILE__,
15+
[
16+
'api_key' => '<API KEY>',
17+
'product_id' => '<PRODUCT ID>',
18+
'product_name' => 'Demo',
19+
'license' => [
20+
'require_email' => true,
21+
],
22+
'updater' => [
23+
'enabled' => true,
24+
]
25+
]
26+
);
27+
28+
$guard->validCallback(function() {
29+
add_action( 'admin_notices', 'daily_revenue' );
30+
});
31+
32+
function daily_revenue() {
33+
echo '<p>Your revenue for today is $123.45</p>';
34+
}

updater-info.json

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"requires":"5.0",
3+
"tested":"4.8",
4+
"upgrade_notice":"Here's why you should upgrade...",
5+
"author":"Anystack",
6+
"author_homepage":"https://anystack.sh",
7+
"sections":{
8+
"description":"My description here",
9+
"installation":"(Recommended) Installation instructions."
10+
}
11+
}

wp-guard/.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
/vendor
2+
.DS_Store
3+
.idea

wp-guard/README.md

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
<img src="https://anystack.sh/img/emblem.svg" width="50" height="50"
2+
alt="Anystack" >
3+
4+
# Secure your WordPress plugins with license keys
5+
6+
Add license and add auto-update support your commercial WordPress plugins in just a matter of minutes with Anystack's plug-and-play licensing package.
7+
8+
* **License activation tracking**.
9+
* Secure auto updates for users with a **valid license**.
10+
* **Plug & Play** integration, it only takes a few lines of code.
11+
* Easy **to customize** via config.
12+
13+
You will need to register an API key at [Anystack](https://anystack.sh) to use this package.
14+
Anystack will help you make an online living selling your software by setting yourself free from billing and logistics so you can focus on building software.
15+
16+
17+
## Usage
18+
To get started, you will need to install this package via Composer:
19+
20+
```shell
21+
composer require anystack-sh/wp-guard
22+
```
23+
24+
Continue to the [installation guide](http://anystack.sh/docs/integrations/wordpress).

wp-guard/pages/activate.php

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
<?php
2+
if (! defined('ABSPATH')) {
3+
exit; // Exit if accessed directly.
4+
}
5+
?>
6+
<div class="wrap">
7+
8+
<h1>Activate <?php echo $this->getConfig('plugin_name'); ?></h1>
9+
<p>To get started with <?php echo $this->getConfig('plugin_name'); ?>, please activate using your license information.</p>
10+
11+
<form method="post" action="<?php echo admin_url('admin-post.php'); ?>">
12+
<table class="form-table" role="presentation">
13+
<tbody>
14+
<?php if ($this->getConfig('license.require_email')) { ?>
15+
<tr>
16+
<th>
17+
<label for="license-email">
18+
Your email
19+
</label>
20+
</th>
21+
<td>
22+
<input type="email" name="email" id="license-email" class="regular-text code" placeholder="[email protected]">
23+
</td>
24+
</tr>
25+
<?php } ?>
26+
<tr>
27+
<th>
28+
<label for="license-key">License key</label>
29+
</th>
30+
<td>
31+
<input type="text" name="license-key" id="license-key" class="regular-text code" placeholder="06C1915F-905B-42A7-8BA4-350F6B2C70DA">
32+
</td>
33+
</tr>
34+
</tbody>
35+
</table>
36+
37+
<input type="hidden" name="action" value="<?php echo sprintf('activate_license_%s', $this->config['basename']); ?>">
38+
<?php wp_nonce_field(sprintf('activate_%s_nonce', $this->config['basename']), sprintf('activate_%s_nonce', $this->config['basename'])); ?>
39+
40+
<p>
41+
<input type="submit" class="button button-primary" value="Activate License">
42+
</p>
43+
</form>
44+
</div>
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
[*]
2+
charset=utf-8
3+
end_of_line=lf
4+
insert_final_newline=false
5+
indent_style=tab
6+
tab_width=4
7+
8+
[{phpunit.xml.dist,*.jhm,*.xslt,*.xul,*.rng,*.xsl,*.xsd,*.ant,*.tld,*.fxml,*.jrxml,*.xml,*.jnlp,*.wsdl}]
9+
indent_style=space
10+
indent_size=4
11+
12+
[*.svg]
13+
indent_style=space
14+
indent_size=4
15+
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
# Created by .ignore support plugin (hsz.mobi)
2+
### JetBrains template
3+
# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio, WebStorm and Rider
4+
# Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839
5+
6+
# The entire IDEA/PhpStorm directory
7+
.idea/
8+
9+
# CMake
10+
cmake-build-*/
11+
12+
# Mongo Explorer plugin
13+
.idea/**/mongoSettings.xml
14+
15+
# File-based project format
16+
*.iws
17+
18+
# IntelliJ
19+
out/
20+
21+
# mpeltonen/sbt-idea plugin
22+
.idea_modules/
23+
24+
# JIRA plugin
25+
atlassian-ide-plugin.xml
26+
27+
# Cursive Clojure plugin
28+
.idea/replstate.xml
29+
30+
# Crashlytics plugin (for Android Studio and IntelliJ)
31+
com_crashlytics_export_strings.xml
32+
crashlytics.properties
33+
crashlytics-build.properties
34+
fabric.properties
35+
36+
# Editor-based Rest Client
37+
.idea/httpRequests
38+
39+
# Android studio 3.1+ serialized cache file
40+
.idea/caches/build_file_checksums.ser
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
<?php
2+
3+
namespace YahnisElsts\PluginUpdateChecker\v5;
4+
5+
if ( !class_exists(PucFactory::class, false) ):
6+
7+
class PucFactory extends \YahnisElsts\PluginUpdateChecker\v5p0\PucFactory {
8+
}
9+
10+
endif;

0 commit comments

Comments
 (0)