Freemius WordPress SDK
======================
Welcome to the official repository for the Freemius SDK! Adding the SDK to your WordPress plugin, theme, or add-ons, enables all the benefits that come with using the [Freemius platform](https://freemius.com) such as:
* [Software Licensing](https://freemius.com/wordpress/software-licensing/)
* [Secure Checkout](https://freemius.com/wordpress/checkout/)
* [Subscriptions](https://freemius.com/wordpress/recurring-payments-subscriptions/)
* [Automatic Updates](https://freemius.com/wordpress/automatic-software-updates/)
* [Seamless EU VAT](https://freemius.com/wordpress/collecting-eu-vat-europe/)
* [Cart Abandonment Recovery](https://freemius.com/wordpress/cart-abandonment-recovery/)
* [Affiliate Platform](https://freemius.com/wordpress/affiliate-platform/)
* [Analytics & Usage Tracking](https://freemius.com/wordpress/insights/)
* [User Dashboard](https://freemius.com/wordpress/user-dashboard/)
* [Monetization](https://freemius.com/wordpress/)
* [Analytics](https://freemius.com/wordpress/insights/)
* [More...](https://freemius.com/wordpress/features-comparison/)
Freemius truly empowers developers to create prosperous subscription-based businesses.
If you're new to Freemius then we recommend taking a look at our [Getting Started](https://freemius.com/help/documentation/getting-started/) guide first.
If you're a WordPress plugin or theme developer and are interested in monetizing with Freemius then you can [sign-up for a FREE account](https://dashboard.freemius.com/register/):
https://dashboard.freemius.com/register/
Once you have your account setup and are familiar with how it all works you're ready to begin [integrating Freemius](https://freemius.com/help/documentation/wordpress-sdk/integrating-freemius-sdk/) into your WordPress product
You can see some of the existing WordPress.org plugins & themes that are already utilizing the power of Freemius here:
* https://profiles.wordpress.org/freemius/#content-plugins
* https://includewp.com/freemius/#focus
## Code Documentation
You can find the SDK's documentation here:
https://freemius.com/help/documentation/wordpress-sdk/
## Integrating & Initializing the SDK
As part of the integration process, you'll need to [add the latest version](https://freemius.com/help/documentation/getting-started/#add_the_latest_wordpress_sdk_into_your_product) of the Freemius SDK into your WordPress project.
Then, when you've completed the [SDK integration form](https://freemius.com/help/documentation/getting-started/#fill_out_the_sdk_integration_form) a snippet of code is generated which you'll need to copy and paste into the top of your main plugin's PHP file, right after the plugin's header comment.
Note: For themes, this will be in the root `functions.php` file instead.
A typical SDK snippet will look similar to the following (your particular snippet may differ slightly depending on your integration):
```php
if ( ! function_exists( 'my_prefix_fs' ) ) {
// Create a helper function for easy SDK access.
function my_prefix_fs() {
global $my_prefix_fs;
if ( ! isset( $my_prefix_fs ) ) {
// Include Freemius SDK.
require_once dirname(__FILE__) . '/freemius/start.php';
$my_prefix_fs = fs_dynamic_init( array(
'id' => '1234',
'slug' => 'my-new-plugin',
'premium_slug' => 'my-new-plugin-premium',
'type' => 'plugin',
'public_key' => 'pk_bAEfta69seKymZzmf2xtqq8QXHz9y',
'is_premium' => true,
// If your plugin is a serviceware, set this option to false.
'has_premium_version' => true,
'has_paid_plans' => true,
'is_org_compliant' => true,
'menu' => array(
'slug' => 'my-new-plugin',
'parent' => array(
'slug' => 'options-general.php',
),
),
// Set the SDK to work in a sandbox mode (for development & testing).
// IMPORTANT: MAKE SURE TO REMOVE SECRET KEY BEFORE DEPLOYMENT.
'secret_key' => 'sk_ubb4yN3mzqGR2x8#P7r5&@*xC$utE',
) );
}
return $my_prefix_fs;
}
// Init Freemius.
my_prefix_fs();
// Signal that SDK was initiated.
do_action( 'my_prefix_fs_loaded' );
}
```
## Usage example
You can call anySDK methods by prefixing them with the shortcode function for your particular plugin/theme (specified when completing the SDK integration form in the Developer Dashboard):
```php
<?php my_prefix_fs()->get_upgrade_url(); ?>
```
Or when calling Freemius multiple times in a scope, it's recommended to use it with the global variable:
```php
<?php
global $my_prefix_fs;
$my_prefix_fs->get_account_url();
?>
```
There are many other SDK methods available that you can use to enhance the functionality of your WordPress product. Some of the more common use-cases are covered in the [Freemius SDK Gists](https://freemius.com/help/documentation/wordpress-sdk/gists/) documentation.
## Adding license based logic examples
Add marketing content to encourage your users to upgrade for your paid version:
```php
<?php
if ( my_prefix_fs()->is_not_paying() ) {
echo '<section><h1>' . esc_html__('Awesome Premium Features', 'my-plugin-slug') . '</h1>';
echo '<a href="' . my_prefix_fs()->get_upgrade_url() . '">' .
esc_html__('Upgrade Now!', 'my-plugin-slug') .
'</a>';
echo '</section>';
}
?>
```
Add logic which will only be available in your premium plugin version:
```php
<?php
// This "if" block will be auto removed from the Free version.
if ( my_prefix_fs()->is__premium_only() ) {
// ... premium only logic ...
}
?>
```
To add a function which will only be available in your premium plugin version, simply add __premium_only as the suffix of the function name. Just make sure that all lines that call that method directly or by hooks, are also wrapped in premium only logic:
```php
<?php
class My_Plugin {
function init() {
...
// This "if" block will be auto removed from the free version.
if ( my_prefix_fs()->is__premium_only() ) {
// Init premium version.
$this->admin_init__premium_only();
add_action( 'admin_init', array( &$this, 'admin_init_hook__premium_only' );
}
...
}
// This method will be only included in the premium version.
function admin_init__premium_only() {
...
}
// This method will be only included in the premium version.
function admin_init_hook__premium_only() {
...
}
}
?>
```
Add logic which will only be executed for customers in your 'professional' plan:
```php
<?php
if ( my_prefix_fs()->is_plan('professional', true) ) {
// .. logic related to Professional plan only ...
}
?>
```
Add logic which will only be executed for customers in your 'professional' plan or higher plans:
```php
<?php
if ( my_prefix_fs()->is_plan('professional') ) {
// ... logic related to Professional plan and higher plans ...
}
?>
```
Add logic which will only be available in your premium plugin version AND will only be executed for customers in your 'professional' plan (and higher plans):
```php
<?php
// This "if" block will be auto removed from the Free version.
if ( my_prefix_fs()->is_plan__premium_only('professional') ) {
// ... logic related to Professional plan and higher plans ...
}
?>
```
Add logic only for users in trial:
```php
<?php
if ( my_prefix_fs()->is_trial() ) {
// ... logic for users in tr
没有合适的资源?快使用搜索试试~ 我知道了~
【WordPress插件】2022年最新版完整功能demo+插件v3.20.102.zip
共502个文件
svg:259个
php:178个
mo:14个
1.该资源内容由用户上传,如若侵权请联系客服进行举报
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
版权申诉
0 下载量 35 浏览量
2022-04-01
07:29:54
上传
评论
收藏 1.89MB ZIP 举报
温馨提示
"【WordPress插件】2022年最新版完整功能demo+插件v3.20.102 Reactions WordPress Plugin 反应WordPress插件" ---------- 泰森云每天更新发布最新WordPress主题、HTML主题、WordPress插件、shopify主题、opencart主题、PHP项目源码、安卓项目源码、ios项目源码,更有超10000个资源可供选择,如有需要请站内联系。
资源推荐
资源详情
资源评论
收起资源包目录
【WordPress插件】2022年最新版完整功能demo+插件v3.20.102.zip (502个子文件)
dialog-boxes.css 13KB
add-ons.css 12KB
connect.css 10KB
public.css 8KB
admin.css 6KB
common.css 5KB
account.css 5KB
customizer.css 3KB
affiliation.css 2KB
debug.css 657B
plugins.css 514B
gdpr-optin-notice.css 323B
checkout.css 83B
license.html 11KB
admin.js 441KB
public.js 11KB
nojquery.ba-postmessage.js 5KB
postmessage.js 4KB
gutenberg.js 3KB
webpack.config.js 2KB
admin.premium.js 2KB
admin.menu.js 1KB
nojquery.ba-postmessage.min.js 1KB
css.js 1KB
package-lock.json 429KB
package.json 841B
package.json 813B
admin.js.map 1.54MB
public.js.map 52KB
gutenberg.js.map 10KB
admin.premium.js.map 8KB
admin.menu.js.map 6KB
css.js.map 5KB
README.md 11KB
freemius-ta.mo 91KB
freemius-ru_RU.mo 74KB
freemius-ja.mo 66KB
freemius-fr_FR.mo 62KB
freemius-es_ES.mo 61KB
freemius-he_IL.mo 61KB
freemius-it_IT.mo 60KB
freemius-nl_NL.mo 60KB
freemius-cs_CZ.mo 60KB
freemius-hu_HU.mo 59KB
freemius-da_DK.mo 58KB
freemius-en.mo 58KB
freemius-zh_CN.mo 55KB
da-reactions-it_IT.mo 27KB
class-freemius.php 957KB
fs-plugin-info-dialog.php 79KB
account.php 64KB
class-fs-plugin-updater.php 61KB
i18n.php 51KB
fs-core-functions.php 49KB
connect.php 44KB
Data.php 38KB
debug.php 35KB
license-activation.php 34KB
affiliation.php 29KB
GeneralSettings.php 26KB
class-fs-admin-menu-manager.php 26KB
VotesList.php 23KB
add-ons.php 23KB
addon.php 22KB
AdminPageImportVotes.php 21KB
FreemiusWordPress.php 21KB
class-fs-storage.php 20KB
site.php 20KB
form.php 20KB
Frontend.php 19KB
class-fs-api.php 19KB
start.php 19KB
BuddyPress.php 18KB
class-fs-logger.php 17KB
class-fs-admin-notice-manager.php 17KB
class-fs-options.php 17KB
class-fs-option-manager.php 15KB
fs-essential-functions.php 15KB
Admin.php 15KB
config.php 14KB
class-freemius-abstract.php 13KB
Ajax.php 13KB
billing.php 13KB
Main.php 13KB
optout.php 13KB
user-change.php 12KB
subscription-cancellation.php 11KB
GraphicSettings.php 11KB
ContentsByReactionWidget.php 11KB
checkout.php 11KB
class-fs-admin-notices.php 11KB
MetaBox.php 10KB
class-fs-key-value-storage.php 10KB
FileSystem.php 10KB
ButtonsSettings.php 9KB
class-fs-cache-manager.php 9KB
class-fs-plugin-license.php 8KB
premium-versions-upgrade-handler.php 8KB
data-debug-mode.php 8KB
DashboardWidget.php 8KB
共 502 条
- 1
- 2
- 3
- 4
- 5
- 6
资源评论
Lee达森
- 粉丝: 966
- 资源: 1万+
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
- 电赛数据集-数字5,6,7,8识别
- 基于Vue的长沙理工大学Java大作业设计源码
- matlab基于线性准则的考虑风力发电不确定性的分布鲁棒优化机组组合
- 基于C语言+stm32f4的modbus tcp上下位机通信项目+上位机由LabVIEW编写+源码+开发文档+视频教程(高分项目
- 基于Python的Struts2漏洞扫描器设计源码
- HTML+CSS制作的个人博客网页.zip
- 基于htmlde 爱心代码,但HTML网页源码.zip
- 51单片机实现LED流水灯
- 基于Python的obEspoir分布式游戏框架设计源码
- 基于python的机械设计实用计算器,可计算电动机,传动装置,V带轮,齿轮,轴,轴承的几何或者力,运动学参数数值+源码+开发文档
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功