PluginProbe ʕ •ᴥ•ʔ
Royal Addons for Elementor – Addons and Templates Kit for Elementor / 1.7.1064
Royal Addons for Elementor – Addons and Templates Kit for Elementor v1.7.1064
1.7.1064 1.7.1063 1.7.1062 1.7.1061 1.7.1060 1.7.1059 1.7.1058 trunk 1.0.0 1.1.0 1.2 1.3 1.3.1 1.3.2 1.3.21 1.3.22 1.3.23 1.3.24 1.3.25 1.3.26 1.3.27 1.3.28 1.3.29 1.3.30 1.3.31 1.3.32 1.3.33 1.3.34 1.3.35 1.3.36 1.3.37 1.3.38 1.3.39 1.3.40 1.3.41 1.3.42 1.3.43 1.3.44 1.3.45 1.3.46 1.3.47 1.3.48 1.3.49 1.3.50 1.3.51 1.3.52 1.3.53 1.3.54 1.3.55 1.3.56 1.3.57 1.3.58 1.3.59 1.3.60 1.3.61 1.3.62 1.3.63 1.3.64 1.3.65 1.3.66 1.3.67 1.3.68 1.3.69 1.3.70 1.3.71 1.3.72 1.3.73 1.3.74 1.3.75 1.3.76 1.3.77 1.3.78 1.3.79 1.3.80 1.3.81 1.3.82 1.3.83 1.3.84 1.3.85 1.3.86 1.3.87 1.3.88 1.3.89 1.3.90 1.3.91 1.3.92 1.3.93 1.3.94 1.3.95 1.3.96 1.3.97 1.3.971 1.3.972 1.3.973 1.3.974 1.3.975 1.3.976 1.3.977 1.3.978 1.3.979 1.3.980 1.3.981 1.3.982 1.3.983 1.3.984 1.3.985 1.3.986 1.3.987 1.7.1 1.7.1001 1.7.1002 1.7.1003 1.7.1004 1.7.1005 1.7.1006 1.7.1007 1.7.1008 1.7.1009 1.7.1010 1.7.1011 1.7.1012 1.7.1013 1.7.1014 1.7.1015 1.7.1016 1.7.1017 1.7.1018 1.7.1019 1.7.1020 1.7.1021 1.7.1022 1.7.1023 1.7.1024 1.7.1025 1.7.1026 1.7.1027 1.7.1028 1.7.1029 1.7.1030 1.7.1031 1.7.1032 1.7.1033 1.7.1034 1.7.1035 1.7.1036 1.7.1037 1.7.1038 1.7.1039 1.7.1040 1.7.1041 1.7.1042 1.7.1043 1.7.1044 1.7.1045 1.7.1046 1.7.1047 1.7.1048 1.7.1049 1.7.1050 1.7.1051 1.7.1052 1.7.1053 1.7.1054 1.7.1055 1.7.1056 1.7.1057
royal-elementor-addons / freemius / README.md
royal-elementor-addons / freemius Last commit date
assets 5 days ago includes 5 days ago languages 5 days ago templates 5 days ago LICENSE.txt 5 days ago README.md 5 days ago composer.json 5 days ago config.php 5 days ago index.php 5 days ago require.php 5 days ago start.php 5 days ago
README.md
287 lines
1 Freemius WordPress SDK
2 ======================
3
4 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 [](https://freemius.comFreemius platform](https://freemius.com](https://freemius.com) such as:
5
6 * [](https://freemius.com/wordpress/software-licensing/Software Licensing](https://freemius.com/wordpress/software-licensing/](https://freemius.com/wordpress/software-licensing/)
7 * [](https://freemius.com/wordpress/checkout/Secure Checkout](https://freemius.com/wordpress/checkout/](https://freemius.com/wordpress/checkout/)
8 * [](https://freemius.com/wordpress/recurring-payments-subscriptions/Subscriptions](https://freemius.com/wordpress/recurring-payments-subscriptions/](https://freemius.com/wordpress/recurring-payments-subscriptions/)
9 * [](https://freemius.com/wordpress/automatic-software-updates/Automatic Updates](https://freemius.com/wordpress/automatic-software-updates/](https://freemius.com/wordpress/automatic-software-updates/)
10 * [](https://freemius.com/wordpress/collecting-eu-vat-europe/Seamless EU VAT](https://freemius.com/wordpress/collecting-eu-vat-europe/](https://freemius.com/wordpress/collecting-eu-vat-europe/)
11 * [](https://freemius.com/wordpress/cart-abandonment-recovery/Cart Abandonment Recovery](https://freemius.com/wordpress/cart-abandonment-recovery/](https://freemius.com/wordpress/cart-abandonment-recovery/)
12 * [](https://freemius.com/wordpress/affiliate-platform/Affiliate Platform](https://freemius.com/wordpress/affiliate-platform/](https://freemius.com/wordpress/affiliate-platform/)
13 * [](https://freemius.com/wordpress/insights/Analytics & Usage Tracking](https://freemius.com/wordpress/insights/](https://freemius.com/wordpress/insights/)
14 * [](https://freemius.com/wordpress/user-dashboard/User Dashboard](https://freemius.com/wordpress/user-dashboard/](https://freemius.com/wordpress/user-dashboard/)
15
16 * [](https://freemius.com/wordpress/Monetization](https://freemius.com/wordpress/](https://freemius.com/wordpress/)
17 * [](https://freemius.com/wordpress/insights/Analytics](https://freemius.com/wordpress/insights/](https://freemius.com/wordpress/insights/)
18 * [](https://freemius.com/wordpress/features-comparison/More...](https://freemius.com/wordpress/features-comparison/](https://freemius.com/wordpress/features-comparison/)
19
20 Freemius truly empowers developers to create prosperous subscription-based businesses.
21
22 If you're new to Freemius then we recommend taking a look at our [](https://freemius.com/help/documentation/getting-started/Getting Started](https://freemius.com/help/documentation/getting-started/](https://freemius.com/help/documentation/getting-started/) guide first.
23
24 If you're a WordPress plugin or theme developer and are interested in monetizing with Freemius then you can [](https://dashboard.freemius.com/register/sign-up for a FREE account](https://dashboard.freemius.com/register/](https://dashboard.freemius.com/register/):
25
26 https://dashboard.freemius.com/register/
27
28 Once you have your account setup and are familiar with how it all works you're ready to begin [](https://freemius.com/help/documentation/wordpress-sdk/integrating-freemius-sdk/integrating Freemius](https://freemius.com/help/documentation/wordpress-sdk/integrating-freemius-sdk/](https://freemius.com/help/documentation/wordpress-sdk/integrating-freemius-sdk/) into your WordPress product
29
30 You can see some of the existing WordPress.org plugins & themes that are already utilizing the power of Freemius here:
31
32 * https://profiles.wordpress.org/freemius/#content-plugins
33 * https://includewp.com/freemius/#focus
34
35 ## Code Documentation
36
37 You can find the SDK's documentation here:
38 https://freemius.com/help/documentation/wordpress-sdk/
39
40 ## Integrating & Initializing the SDK
41
42 As part of the integration process, you'll need to [](https://freemius.com/help/documentation/getting-started/#add_the_latest_wordpress_sdk_into_your_productadd the latest version](https://freemius.com/help/documentation/getting-started/#add_the_latest_wordpress_sdk_into_your_product](https://freemius.com/help/documentation/getting-started/#add_the_latest_wordpress_sdk_into_your_product) of the Freemius SDK into your WordPress project.
43
44 Then, when you've completed the [](https://freemius.com/help/documentation/getting-started/#fill_out_the_sdk_integration_formSDK integration form](https://freemius.com/help/documentation/getting-started/#fill_out_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.
45
46 Note: For themes, this will be in the root `functions.php` file instead.
47
48 A typical SDK snippet will look similar to the following (your particular snippet may differ slightly depending on your integration):
49
50 ```php
51 if ( ! function_exists( 'my_prefix_fs' ) ) {
52 // Create a helper function for easy SDK access.
53 function my_prefix_fs() {
54 global $my_prefix_fs;
55
56 if ( ! isset( $my_prefix_fs ) ) {
57 // Include Freemius SDK.
58 require_once dirname(__FILE__) . '/freemius/start.php';
59
60 $my_prefix_fs = fs_dynamic_init( array(
61 'id' => '1234',
62 'slug' => 'my-new-plugin',
63 'premium_slug' => 'my-new-plugin-premium',
64 'type' => 'plugin',
65 'public_key' => 'pk_bAEfta69seKymZzmf2xtqq8QXHz9y',
66 'is_premium' => true,
67 // If your plugin is a serviceware, set this option to false.
68 'has_premium_version' => true,
69 'has_paid_plans' => true,
70 'is_org_compliant' => true,
71 'menu' => array(
72 'slug' => 'my-new-plugin',
73 'parent' => array(
74 'slug' => 'options-general.php',
75 ),
76 ),
77 // Set the SDK to work in a sandbox mode (for development & testing).
78 // IMPORTANT: MAKE SURE TO REMOVE SECRET KEY BEFORE DEPLOYMENT.
79 'secret_key' => 'sk_ubb4yN3mzqGR2x8#P7r5&@*xC$utE',
80 ) );
81 }
82
83 return $my_prefix_fs;
84 }
85
86 // Init Freemius.
87 my_prefix_fs();
88 // Signal that SDK was initiated.
89 do_action( 'my_prefix_fs_loaded' );
90 }
91
92 ```
93
94 ## Usage example
95
96 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):
97
98 ```php
99 <?php my_prefix_fs()->get_upgrade_url(); ?>
100 ```
101
102 Or when calling Freemius multiple times in a scope, it's recommended to use it with the global variable:
103
104 ```php
105 <?php
106 global $my_prefix_fs;
107 $my_prefix_fs->get_account_url();
108 ?>
109 ```
110
111 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.
112
113 ## Adding license based logic examples
114
115 Add marketing content to encourage your users to upgrade for your paid version:
116
117 ```php
118 <?php
119 if ( my_prefix_fs()->is_not_paying() ) {
120 echo '<section><h1>' . esc_html__('Awesome Premium Features', 'my-plugin-slug') . '</h1>';
121 echo '<a href="' . my_prefix_fs()->get_upgrade_url() . '">' .
122 esc_html__('Upgrade Now!', 'my-plugin-slug') .
123 '</a>';
124 echo '</section>';
125 }
126 ?>
127 ```
128
129 Add logic which will only be available in your premium plugin version:
130
131 ```php
132 <?php
133 // This "if" block will be auto removed from the Free version.
134 if ( my_prefix_fs()->is__premium_only() ) {
135
136 // ... premium only logic ...
137
138 }
139 ?>
140 ```
141
142 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:
143
144 ```php
145 <?php
146 class My_Plugin {
147 function init() {
148 ...
149
150 // This "if" block will be auto removed from the free version.
151 if ( my_prefix_fs()->is__premium_only() ) {
152 // Init premium version.
153 $this->admin_init__premium_only();
154
155 add_action( 'admin_init', array( &$this, 'admin_init_hook__premium_only' );
156 }
157
158 ...
159 }
160
161 // This method will be only included in the premium version.
162 function admin_init__premium_only() {
163 ...
164 }
165
166 // This method will be only included in the premium version.
167 function admin_init_hook__premium_only() {
168 ...
169 }
170 }
171 ?>
172 ```
173
174 Add logic which will only be executed for customers in your 'professional' plan:
175
176 ```php
177 <?php
178 if ( my_prefix_fs()->is_plan('professional', true) ) {
179 // .. logic related to Professional plan only ...
180 }
181 ?>
182 ```
183
184 Add logic which will only be executed for customers in your 'professional' plan or higher plans:
185
186 ```php
187 <?php
188 if ( my_prefix_fs()->is_plan('professional') ) {
189 // ... logic related to Professional plan and higher plans ...
190 }
191 ?>
192 ```
193
194 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):
195
196 ```php
197 <?php
198 // This "if" block will be auto removed from the Free version.
199 if ( my_prefix_fs()->is_plan__premium_only('professional') ) {
200 // ... logic related to Professional plan and higher plans ...
201 }
202 ?>
203 ```
204
205 Add logic only for users in trial:
206
207 ```php
208 <?php
209 if ( my_prefix_fs()->is_trial() ) {
210 // ... logic for users in trial ...
211 }
212 ?>
213 ```
214
215 Add logic for specified paid plan:
216
217 ```php
218 <?php
219 // This "if" block will be auto removed from the Free version.
220 if ( my_prefix_fs()->is__premium_only() ) {
221 if ( my_prefix_fs()->is_plan( 'professional', true ) ) {
222
223 // ... logic related to Professional plan only ...
224
225 } else if ( my_prefix_fs()->is_plan( 'business' ) ) {
226
227 // ... logic related to Business plan and higher plans ...
228
229 }
230 }
231 ?>
232 ```
233
234 ## Excluding files and folders from the free plugin version
235 There are [two ways](https://freemius.com/help/documentation/wordpress-sdk/software-licensing/#excluding_files_and_folders_from_the_free_plugin_version) to exclude files from your free version.
236
237 1. Add `__premium_only` just before the file extension. For example, functions__premium_only.php will be only included in the premium plugin version. This works for all types of files, not only PHP.
238 2. Add `@fs_premium_only` a special meta tag to the plugin's main PHP file header. Example:
239 ```php
240 <?php
241 /**
242 * Plugin Name: My Very Awesome Plugin
243 * Plugin URI: http://my-awesome-plugin.com
244 * Description: Create and manage Awesomeness right in WordPress.
245 * Version: 1.0.0
246 * Author: Awesomattic
247 * Author URI: http://my-awesome-plugin.com/me/
248 * License: GPLv2
249 * Text Domain: myplugin
250 * Domain Path: /langs
251 *
252 * @fs_premium_only /lib/functions.php, /premium-files/
253 */
254
255 if ( ! defined( 'ABSPATH' ) ) {
256 exit;
257 }
258
259 // ... my code ...
260 ?>
261 ```
262 In the example plugin header above, the file `/lib/functions.php` and the directory `/premium-files/` will be removed from the free plugin version.
263
264 # WordPress.org Compliance
265 Based on [WordPress.org Guidelines](https://wordpress.org/plugins/about/guidelines/) you are not allowed to submit a plugin that has premium code in it:
266 > All code hosted by WordPress.org servers must be free and fully-functional. If you want to sell advanced features for a plugin (such as a "pro" version), then you must sell and serve that code from your own site, we will not host it on our servers.
267
268 Therefore, if you want to deploy your free plugin's version to WordPress.org, make sure you wrap all your premium code with `if ( my_prefix_fs()->{{ method }}__premium_only() )` or use [some of the other methods](https://freemius.com/help/documentation/wordpress-sdk/software-licensing/) provided by the SDK to exclude premium features & files from the free version.
269
270 ## Deployment
271 Zip your Freemius product’s root folder and [upload it in the Deployment section](https://freemius.com/help/documentation/selling-with-freemius/deployment/) in the *Freemius Developer's Dashboard*.
272 The plugin/theme will automatically be scanned and processed by a custom-developed *PHP Processor* which will auto-generate two versions of your plugin:
273
274 1. **Premium version**: Identical to your uploaded version, including all code (except your `secret_key`). Will be enabled for download ONLY for your paying or in trial customers.
275 2. **Free version**: The code stripped from all your paid features (based on the logic added wrapped in `{ method }__premium_only()`).
276
277 The free version is the one that you should give your users to download. Therefore, download the free generated version and upload to your site. Or, if your plugin was WordPress.org compliant and you made sure to exclude all your premium code with the different provided techniques, you can deploy the downloaded free version to the .org repo.
278
279 ## License
280 Copyright (c) Freemius®, Inc.
281
282 Licensed under the GNU general public license (version 3).
283
284 ## Contributing
285
286 Please see our [contributing guide](CONTRIBUTING.md).
287