diff --git a/CHANGES.md b/CHANGES.md
index 2ff901154..adb8ae75c 100644
--- a/CHANGES.md
+++ b/CHANGES.md
@@ -1,5 +1,8 @@
#### [unreleased]
+#### 11.1.3 / 2022-10-04
+* replace Freemius SDK with Appsero SDK
+
#### 11.1.2 / 2022-09-27
* deprecate `gu_maybe_auto_update` cron event
diff --git a/composer.json b/composer.json
index 13f5d1d35..c101b031d 100644
--- a/composer.json
+++ b/composer.json
@@ -34,7 +34,7 @@
"afragen/wordpress-plugin-readme-parser": "dev-master",
"afragen/singleton": "dev-master",
"afragen/wp-dependency-installer": "^4",
- "freemius/wordpress-sdk": "^2.4"
+ "appsero/client": "^1.2"
},
"autoload": {
"psr-4": {
diff --git a/composer.lock b/composer.lock
index 158e014e6..b3d02db37 100644
--- a/composer.lock
+++ b/composer.lock
@@ -4,7 +4,7 @@
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
"This file is @generated automatically"
],
- "content-hash": "ae0775cbb1fab6c2a6d3c051a2654a58",
+ "content-hash": "0c353a5ed9872e4880723b3b16e22a69",
"packages": [
{
"name": "afragen/singleton",
@@ -202,6 +202,52 @@
},
"time": "2022-07-25T15:44:19+00:00"
},
+ {
+ "name": "appsero/client",
+ "version": "v1.2.1",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/Appsero/client.git",
+ "reference": "d110c537f4ca92ac7f3398eee67cc6bdf506a4fb"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/Appsero/client/zipball/d110c537f4ca92ac7f3398eee67cc6bdf506a4fb",
+ "reference": "d110c537f4ca92ac7f3398eee67cc6bdf506a4fb",
+ "shasum": ""
+ },
+ "require": {
+ "php": ">=5.3"
+ },
+ "type": "library",
+ "autoload": {
+ "psr-4": {
+ "Appsero\\": "src/"
+ }
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "authors": [
+ {
+ "name": "Tareq Hasan",
+ "email": "tareq@appsero.com"
+ }
+ ],
+ "description": "Appsero Client",
+ "keywords": [
+ "analytics",
+ "plugin",
+ "theme",
+ "wordpress"
+ ],
+ "support": {
+ "issues": "https://github.com/Appsero/client/issues",
+ "source": "https://github.com/Appsero/client/tree/v1.2.1"
+ },
+ "time": "2022-06-30T12:01:38+00:00"
+ },
{
"name": "erusev/parsedown",
"version": "1.7.4",
@@ -251,45 +297,6 @@
"source": "https://github.com/erusev/parsedown/tree/1.7.x"
},
"time": "2019-12-30T22:54:17+00:00"
- },
- {
- "name": "freemius/wordpress-sdk",
- "version": "2.4.5",
- "source": {
- "type": "git",
- "url": "https://github.com/Freemius/wordpress-sdk.git",
- "reference": "d4aa83b1e74f3269affcbfe0d2b75ceae35ba864"
- },
- "dist": {
- "type": "zip",
- "url": "https://api.github.com/repos/Freemius/wordpress-sdk/zipball/d4aa83b1e74f3269affcbfe0d2b75ceae35ba864",
- "reference": "d4aa83b1e74f3269affcbfe0d2b75ceae35ba864",
- "shasum": ""
- },
- "require": {
- "php": ">=5.2"
- },
- "type": "library",
- "notification-url": "https://packagist.org/downloads/",
- "license": [
- "GPL-3.0-only"
- ],
- "description": "Freemius WordPress SDK",
- "homepage": "https://freemius.com",
- "keywords": [
- "freemius",
- "plugin",
- "sdk",
- "theme",
- "wordpress",
- "wordpress-plugin",
- "wordpress-theme"
- ],
- "support": {
- "issues": "https://github.com/Freemius/wordpress-sdk/issues",
- "source": "https://github.com/Freemius/wordpress-sdk/tree/2.4.5"
- },
- "time": "2022-07-31T06:50:47+00:00"
}
],
"packages-dev": [],
diff --git a/git-updater.php b/git-updater.php
index 99aa02db6..ed3581b44 100644
--- a/git-updater.php
+++ b/git-updater.php
@@ -12,7 +12,7 @@
* Plugin Name: Git Updater
* Plugin URI: https://git-updater.com
* Description: A plugin to automatically update GitHub hosted plugins, themes, and language packs. Additional API plugins available for Bitbucket, GitLab, Gitea, and Gist.
- * Version: 11.1.2
+ * Version: 11.1.3
* Author: Andy Fragen
* License: MIT
* Domain Path: /languages
@@ -50,11 +50,11 @@
register_activation_hook( __FILE__, [ new Bootstrap( __FILE__ ), 'rename_on_activation' ] );
( new Zipfile_API() )->load_hooks();
+( new GU_Appsero( __FILE__ ) )->init();
add_action(
'plugins_loaded',
- function() {
- ( new GU_Freemius() )->init();
+ function () {
( new Bootstrap( __FILE__ ) )->run();
}
);
diff --git a/src/Git_Updater/GU_Appsero.php b/src/Git_Updater/GU_Appsero.php
new file mode 100644
index 000000000..9880c27c3
--- /dev/null
+++ b/src/Git_Updater/GU_Appsero.php
@@ -0,0 +1,84 @@
+plugin_file = $file;
+ }
+
+ /**
+ * Let's get going.
+ *
+ * @return void
+ */
+ public function init() {
+ $this->appsero_init_tracker_git_updater();
+ }
+
+ /**
+ * Initialize the plugin tracker.
+ *
+ * @return void
+ */
+ public function appsero_init_tracker_git_updater() {
+ global $gu_license;
+
+ $client = new \Appsero\Client( 'fcd3d5c3-e40c-4484-9530-037955cef71f', 'Git Updater', $this->plugin_file );
+
+ // Activate insights.
+ $client->insights()
+ ->hide_notice()
+ ->add_plugin_data()
+ ->init();
+ $client->insights()->optin();
+
+ $gu_license = $client->license();
+
+ // Active license page and checker
+ // $parent = is_multisite() ? 'settings.php' : 'options-general.php';
+ // $args = array(
+ // 'type' => 'submenu',
+ // 'menu_title' => 'Git Updater License',
+ // 'page_title' => 'Git Updater License Settings',
+ // 'menu_slug' => 'git-updater-license',
+ // 'parent_slug' => $parent,
+ // );
+ // $client->license()->add_settings_page( $args );
+
+ // Active automatic updater.
+ // $client->updater();
+ }
+}
diff --git a/src/Git_Updater/GU_Freemius.php b/src/Git_Updater/GU_Freemius.php
deleted file mode 100644
index d3ce78775..000000000
--- a/src/Git_Updater/GU_Freemius.php
+++ /dev/null
@@ -1,86 +0,0 @@
- '8311',
- 'slug' => 'git-updater',
- 'type' => 'plugin',
- 'public_key' => 'pk_3576c57a06f23b313b049a78cc886',
- 'is_premium' => false,
- 'has_addons' => false,
- 'has_paid_plans' => false,
- 'is_org_compliant' => false,
- 'menu' => [
- 'first-path' => 'plugins.php',
- 'account' => false,
- 'contact' => false,
- 'support' => false,
- ],
- ]
- );
- }
-
- return $gu_fs;
- }
-
- // Init Freemius.
- gu_fs();
- // Signal that SDK was initiated.
- do_action( 'gu_fs_loaded' );
- }
- gu_fs()->add_filter( 'plugin_icon', [ $this, 'add_icon' ] );
- }
-
- /**
- * Add custom plugin icon to update notice.
- *
- * @return string
- */
- public function add_icon() {
- return dirname( __DIR__, 2 ) . '/assets/icon.svg';
- }
-}
diff --git a/vendor/appsero/client/.gitignore b/vendor/appsero/client/.gitignore
new file mode 100644
index 000000000..dc02deea9
--- /dev/null
+++ b/vendor/appsero/client/.gitignore
@@ -0,0 +1,16 @@
+/node_modules
+/public/hot
+/public/storage
+/storage/*.key
+/vendor
+/.idea
+/.vscode
+/nbproject
+/.vagrant
+Homestead.json
+Homestead.yaml
+npm-debug.log
+yarn-error.log
+.env
+.phpunit.result.cache
+.DS_Store
diff --git a/vendor/appsero/client/composer.json b/vendor/appsero/client/composer.json
new file mode 100644
index 000000000..cf88cedbc
--- /dev/null
+++ b/vendor/appsero/client/composer.json
@@ -0,0 +1,21 @@
+{
+ "name": "appsero/client",
+ "description": "Appsero Client",
+ "keywords": ["analytics", "wordpress", "plugin", "theme"],
+ "type": "library",
+ "license": "MIT",
+ "authors": [
+ {
+ "name": "Tareq Hasan",
+ "email": "tareq@appsero.com"
+ }
+ ],
+ "autoload": {
+ "psr-4": {
+ "Appsero\\": "src/"
+ }
+ },
+ "require": {
+ "php": ">=5.3"
+ }
+}
diff --git a/vendor/appsero/client/readme.md b/vendor/appsero/client/readme.md
new file mode 100644
index 000000000..7157c5bda
--- /dev/null
+++ b/vendor/appsero/client/readme.md
@@ -0,0 +1,266 @@
+# Appsero - Client
+
+- [Installation](#installation)
+- [Insights](#insights)
+- [Dynamic Usage](#dynamic-usage)
+
+
+## Installation
+
+You can install AppSero Client in two ways, via composer and manually.
+
+### 1. Composer Installation
+
+Add dependency in your project (theme/plugin):
+
+```
+composer require appsero/client
+```
+
+Now add `autoload.php` in your file if you haven't done already.
+
+```php
+require __DIR__ . '/vendor/autoload.php';
+```
+
+### 2. Manual Installation
+
+Clone the repository in your project.
+
+```
+cd /path/to/your/project/folder
+git clone https://github.com/AppSero/client.git appsero
+```
+
+Now include the dependencies in your plugin/theme.
+
+```php
+require __DIR__ . '/appsero/src/Client.php';
+```
+
+## Insights
+
+AppSero can be used in both themes and plugins.
+
+The `Appsero\Client` class has *three* parameters:
+
+```php
+$client = new Appsero\Client( $hash, $name, $file );
+```
+
+- **hash** (*string*, *required*) - The unique identifier for a plugin or theme.
+- **name** (*string*, *required*) - The name of the plugin or theme.
+- **file** (*string*, *required*) - The **main file** path of the plugin. For theme, path to `functions.php`
+
+### Usage Example
+
+Please refer to the **installation** step before start using the class.
+
+You can obtain the **hash** for your plugin for the [Appsero Dashboard](https://dashboard.appsero.com). The 3rd parameter **must** have to be the main file of the plugin.
+
+```php
+/**
+ * Initialize the tracker
+ *
+ * @return void
+ */
+function appsero_init_tracker_appsero_test() {
+
+ if ( ! class_exists( 'Appsero\Client' ) ) {
+ require_once __DIR__ . '/appsero/src/Client.php';
+ }
+
+ $client = new Appsero\Client( 'a4a8da5b-b419-4656-98e9-4a42e9044891', 'Akismet', __FILE__ );
+
+ // Active insights
+ $client->insights()->init();
+
+ // Active automatic updater
+ $client->updater();
+
+ // Active license page and checker
+ $args = array(
+ 'type' => 'options',
+ 'menu_title' => 'Akismet',
+ 'page_title' => 'Akismet License Settings',
+ 'menu_slug' => 'akismet_settings',
+ );
+ $client->license()->add_settings_page( $args );
+}
+
+appsero_init_tracker_appsero_test();
+```
+
+Make sure you call this function directly, never use any action hook to call this function.
+
+> For plugins example code that needs to be used on your main plugin file.
+> For themes example code that needs to be used on your themes `functions.php` file.
+
+## More Usage
+
+```php
+$client = new Appsero\Client( 'a4a8da5b-b419-4656-98e9-4a42e9044892', 'Twenty Twelve', __FILE__ );
+```
+
+#### 1. Hiding the notice
+
+Sometimes you wouldn't want to show the notice, or want to customize the notice message. You can do that as well.
+
+```php
+$client->insights()
+ ->hide_notice()
+ ->init();
+```
+
+#### 2. Customizing the notice message
+
+```php
+$client->insights()
+ ->notice( 'My Custom Notice Message' )
+ ->init();
+```
+
+#### 3. Adding extra data
+
+You can add extra metadata from your theme or plugin. In that case, the **keys** has to be whitelisted from the Appsero dashboard.
+`add_extra` method also support callback as parameter, If you need database call then callback is best for you.
+
+```php
+$metadata = array(
+ 'key' => 'value',
+ 'another' => 'another_value'
+);
+$client->insights()
+ ->add_extra( $metadata )
+ ->init();
+```
+
+Or if you want to run a query then pass callback, we will call the function when it is necessary.
+
+```php
+$metadata = function () {
+ $total_posts = wp_count_posts();
+
+ return array(
+ 'total_posts' => $total_posts,
+ 'another' => 'another_value'
+ );
+};
+$client->insights()
+ ->add_extra( $metadata )
+ ->init();
+```
+
+#### 4. Set textdomain
+
+You may set your own textdomain to translate text.
+
+```php
+$client->set_textdomain( 'your-project-textdomain' );
+```
+
+
+
+
+#### 5. Get Plugin Data
+If you want to get the most used plugins with your plugin or theme, send the active plugins' data to Appsero.
+```php
+$client->insights()
+ ->add_plugin_data()
+ ->init();
+```
+---
+
+#### 6. Set Notice Message
+Change opt-in message text
+```php
+$client->insights()
+ ->notice("Your custom notice text")
+ ->init();
+```
+---
+
+### Check License Validity
+
+Check your plugin/theme is using with valid license or not, First create a global variable of `License` object then use it anywhere in your code.
+If you are using it outside of same function make sure you global the variable before using the condition.
+
+```php
+$client = new Appsero\Client( 'a4a8da5b-b419-4656-98e9-4a42e9044892', 'Twenty Twelve', __FILE__ );
+
+$args = array(
+ 'type' => 'submenu',
+ 'menu_title' => 'Twenty Twelve License',
+ 'page_title' => 'Twenty Twelve License Settings',
+ 'menu_slug' => 'twenty_twelve_settings',
+ 'parent_slug' => 'themes.php',
+);
+
+global $twenty_twelve_license;
+$twenty_twelve_license = $client->license();
+$twenty_twelve_license->add_settings_page( $args );
+
+if ( $twenty_twelve_license->is_valid() ) {
+ // Your special code here
+}
+
+Or check by pricing plan title
+
+if ( $twenty_twelve_license->is_valid_by( 'title', 'Business' ) ) {
+ // Your special code here
+}
+
+// Set custom options key for storing the license info
+$twenty_twelve_license->set_option_key( 'my_plugin_license' );
+```
+
+### Use your own license form
+
+You can easily manage license by creating a form using HTTP request. Call `license_form_submit` method from License object.
+
+```php
+global $twenty_twelve_license; // License object
+$twenty_twelve_license->license_form_submit([
+ '_nonce' => wp_create_nonce( 'Twenty Twelve' ), // create a nonce with name
+ '_action' => 'active', // active, deactive
+ 'license_key' => 'random-license-key', // no need to provide if you want to deactive
+]);
+if ( ! $twenty_twelve_license->error ) {
+ // license activated
+ $twenty_twelve_license->success; // Success message is here
+} else {
+ $twenty_twelve_license->error; // has error message here
+}
+```
+
+### Set Custom Deactivation Reasons
+
+First set your deactivation reasons in Appsero dashboard then map them in your plugin/theme using filter hook.
+
+- **id** is the deactivation slug
+- **text** is the deactivation title
+- **placeholder** will show on textarea field
+- **icon** You can set SVG icon with 23x23 size
+
+```php
+add_filter( 'appsero_custom_deactivation_reasons', function () {
+ return [
+ [
+ 'id' => 'looks-buggy',
+ 'text' => 'Looks buggy',
+ 'placeholder' => 'Can you please tell which feature looks buggy?',
+ 'icon' => '',
+ ],
+ [
+ 'id' => 'bad-ui',
+ 'text' => 'Bad UI',
+ 'placeholder' => 'Could you tell us a bit more?',
+ 'icon' => '',
+ ],
+ ];
+} );
+```
+
+## Credits
+
+Created and maintained by [Appsero](https://appsero.com).
diff --git a/vendor/appsero/client/src/Client.php b/vendor/appsero/client/src/Client.php
new file mode 100644
index 000000000..f51b1e7ea
--- /dev/null
+++ b/vendor/appsero/client/src/Client.php
@@ -0,0 +1,280 @@
+hash = $hash;
+ $this->name = $name;
+ $this->file = $file;
+
+ $this->set_basename_and_slug();
+ }
+
+ /**
+ * Initialize insights class
+ *
+ * @return Appsero\Insights
+ */
+ public function insights() {
+
+ if ( ! class_exists( __NAMESPACE__ . '\Insights') ) {
+ require_once __DIR__ . '/Insights.php';
+ }
+
+ // if already instantiated, return the cached one
+ if ( $this->insights ) {
+ return $this->insights;
+ }
+
+ $this->insights = new Insights( $this );
+
+ return $this->insights;
+ }
+
+ /**
+ * Initialize plugin/theme updater
+ *
+ * @return Appsero\Updater
+ */
+ public function updater() {
+
+ if ( ! class_exists( __NAMESPACE__ . '\Updater') ) {
+ require_once __DIR__ . '/Updater.php';
+ }
+
+ // if already instantiated, return the cached one
+ if ( $this->updater ) {
+ return $this->updater;
+ }
+
+ $this->updater = new Updater( $this );
+
+ return $this->updater;
+ }
+
+ /**
+ * Initialize license checker
+ *
+ * @return Appsero\License
+ */
+ public function license() {
+
+ if ( ! class_exists( __NAMESPACE__ . '\License') ) {
+ require_once __DIR__ . '/License.php';
+ }
+
+ // if already instantiated, return the cached one
+ if ( $this->license ) {
+ return $this->license;
+ }
+
+ $this->license = new License( $this );
+
+ return $this->license;
+ }
+
+ /**
+ * API Endpoint
+ *
+ * @return string
+ */
+ public function endpoint() {
+ $endpoint = apply_filters( 'appsero_endpoint', 'https://api.appsero.com' );
+
+ return trailingslashit( $endpoint );
+ }
+
+ /**
+ * Set project basename, slug and version
+ *
+ * @return void
+ */
+ protected function set_basename_and_slug() {
+
+ if ( strpos( $this->file, WP_CONTENT_DIR . '/themes/' ) === false ) {
+ $this->basename = plugin_basename( $this->file );
+
+ list( $this->slug, $mainfile) = explode( '/', $this->basename );
+
+ require_once ABSPATH . 'wp-admin/includes/plugin.php';
+
+ $plugin_data = get_plugin_data( $this->file );
+
+ $this->project_version = $plugin_data['Version'];
+ $this->type = 'plugin';
+ } else {
+ $this->basename = str_replace( WP_CONTENT_DIR . '/themes/', '', $this->file );
+
+ list( $this->slug, $mainfile) = explode( '/', $this->basename );
+
+ $theme = wp_get_theme( $this->slug );
+
+ $this->project_version = $theme->version;
+ $this->type = 'theme';
+ }
+
+ $this->textdomain = $this->slug;
+ }
+
+ /**
+ * Send request to remote endpoint
+ *
+ * @param array $params
+ * @param string $route
+ *
+ * @return array|WP_Error Array of results including HTTP headers or WP_Error if the request failed.
+ */
+ public function send_request( $params, $route, $blocking = false ) {
+ $url = $this->endpoint() . $route;
+
+ $headers = array(
+ 'user-agent' => 'Appsero/' . md5( esc_url( home_url() ) ) . ';',
+ 'Accept' => 'application/json',
+ );
+
+ $response = wp_remote_post( $url, array(
+ 'method' => 'POST',
+ 'timeout' => 30,
+ 'redirection' => 5,
+ 'httpversion' => '1.0',
+ 'blocking' => $blocking,
+ 'headers' => $headers,
+ 'body' => array_merge( $params, array( 'client' => $this->version ) ),
+ 'cookies' => array()
+ ) );
+
+ return $response;
+ }
+
+ /**
+ * Check if the current server is localhost
+ *
+ * @return boolean
+ */
+ public function is_local_server() {
+ $is_local = in_array( $_SERVER['REMOTE_ADDR'], array( '127.0.0.1', '::1' ) );
+
+ return apply_filters( 'appsero_is_local', $is_local );
+ }
+
+ /**
+ * Translate function _e()
+ */
+ public function _etrans( $text ) {
+ call_user_func( '_e', $text, $this->textdomain );
+ }
+
+ /**
+ * Translate function __()
+ */
+ public function __trans( $text ) {
+ return call_user_func( '__', $text, $this->textdomain );
+ }
+
+ /**
+ * Set project textdomain
+ */
+ public function set_textdomain( $textdomain ) {
+ $this->textdomain = $textdomain;
+ }
+}
diff --git a/vendor/appsero/client/src/Insights.php b/vendor/appsero/client/src/Insights.php
new file mode 100644
index 000000000..13184596e
--- /dev/null
+++ b/vendor/appsero/client/src/Insights.php
@@ -0,0 +1,1184 @@
+client = $client;
+ }
+ }
+
+ /**
+ * Don't show the notice
+ *
+ * @return \self
+ */
+ public function hide_notice() {
+ $this->show_notice = false;
+
+ return $this;
+ }
+
+ /**
+ * Add plugin data if needed
+ *
+ * @return \self
+ */
+ public function add_plugin_data() {
+ $this->plugin_data = true;
+
+ return $this;
+ }
+
+ /**
+ * Add extra data if needed
+ *
+ * @param array $data
+ *
+ * @return \self
+ */
+ public function add_extra( $data = array() ) {
+ $this->extra_data = $data;
+
+ return $this;
+ }
+
+ /**
+ * Set custom notice text
+ *
+ * @param string $text
+ *
+ * @return \self
+ */
+ public function notice($text='' ) {
+ $this->notice = $text;
+
+ return $this;
+ }
+
+ /**
+ * Initialize insights
+ *
+ * @return void
+ */
+ public function init() {
+ if ( $this->client->type == 'plugin' ) {
+ $this->init_plugin();
+ } else if ( $this->client->type == 'theme' ) {
+ $this->init_theme();
+ }
+ }
+
+ /**
+ * Initialize theme hooks
+ *
+ * @return void
+ */
+ public function init_theme() {
+ $this->init_common();
+
+ add_action( 'switch_theme', array( $this, 'deactivation_cleanup' ) );
+ add_action( 'switch_theme', array( $this, 'theme_deactivated' ), 12, 3 );
+ }
+
+ /**
+ * Initialize plugin hooks
+ *
+ * @return void
+ */
+ public function init_plugin() {
+ // plugin deactivate popup
+ if ( ! $this->is_local_server() ) {
+ add_filter( 'plugin_action_links_' . $this->client->basename, array( $this, 'plugin_action_links' ) );
+ add_action( 'admin_footer', array( $this, 'deactivate_scripts' ) );
+ }
+
+ $this->init_common();
+
+ register_activation_hook( $this->client->file, array( $this, 'activate_plugin' ) );
+ register_deactivation_hook( $this->client->file, array( $this, 'deactivation_cleanup' ) );
+ }
+
+ /**
+ * Initialize common hooks
+ *
+ * @return void
+ */
+ protected function init_common() {
+
+ if ( $this->show_notice ) {
+ // tracking notice
+ add_action( 'admin_notices', array( $this, 'admin_notice' ) );
+ }
+
+ add_action( 'admin_init', array( $this, 'handle_optin_optout' ) );
+
+ // uninstall reason
+ add_action( 'wp_ajax_' . $this->client->slug . '_submit-uninstall-reason', array( $this, 'uninstall_reason_submission' ) );
+
+ // cron events
+ add_filter( 'cron_schedules', array( $this, 'add_weekly_schedule' ) );
+ add_action( $this->client->slug . '_tracker_send_event', array( $this, 'send_tracking_data' ) );
+ // add_action( 'admin_init', array( $this, 'send_tracking_data' ) ); // test
+ }
+
+ /**
+ * Send tracking data to AppSero server
+ *
+ * @param boolean $override
+ *
+ * @return void
+ */
+ public function send_tracking_data( $override = false ) {
+ if ( ! $this->tracking_allowed() && ! $override ) {
+ return;
+ }
+
+ // Send a maximum of once per week
+ $last_send = $this->get_last_send();
+
+ if ( $last_send && $last_send > strtotime( '-1 week' ) ) {
+ return;
+ }
+
+ $tracking_data = $this->get_tracking_data();
+
+ $response = $this->client->send_request( $tracking_data, 'track' );
+
+ update_option( $this->client->slug . '_tracking_last_send', time() );
+ }
+
+ /**
+ * Get the tracking data points
+ *
+ * @return array
+ */
+ protected function get_tracking_data() {
+ $all_plugins = $this->get_all_plugins();
+
+ $users = get_users( array(
+ 'role' => 'administrator',
+ 'orderby' => 'ID',
+ 'order' => 'ASC',
+ 'number' => 1,
+ 'paged' => 1,
+ ) );
+
+ $admin_user = ( is_array( $users ) && ! empty( $users ) ) ? $users[0] : false;
+ $first_name = $last_name = '';
+
+ if ( $admin_user ) {
+ $first_name = $admin_user->first_name ? $admin_user->first_name : $admin_user->display_name;
+ $last_name = $admin_user->last_name;
+ }
+
+ $data = array(
+ 'url' => esc_url( home_url() ),
+ 'site' => $this->get_site_name(),
+ 'admin_email' => get_option( 'admin_email' ),
+ 'first_name' => $first_name,
+ 'last_name' => $last_name,
+ 'hash' => $this->client->hash,
+ 'server' => $this->get_server_info(),
+ 'wp' => $this->get_wp_info(),
+ 'users' => $this->get_user_counts(),
+ 'active_plugins' => count( $all_plugins['active_plugins'] ),
+ 'inactive_plugins' => count( $all_plugins['inactive_plugins'] ),
+ 'ip_address' => $this->get_user_ip_address(),
+ 'project_version' => $this->client->project_version,
+ 'tracking_skipped' => false,
+ 'is_local' => $this->is_local_server(),
+ );
+
+ // Add Plugins
+ if ($this->plugin_data) {
+
+ $plugins_data = array();
+
+ foreach ($all_plugins['active_plugins'] as $slug => $plugin) {
+ $slug = strstr($slug, '/', true);
+ if (! $slug) {
+ continue;
+ }
+
+ $plugins_data[ $slug ] = array(
+ 'name' => isset($plugin['name']) ? $plugin['name'] : '',
+ 'version' => isset($plugin['version']) ? $plugin['version'] : '',
+ );
+ }
+
+ if (array_key_exists($this->client->slug, $plugins_data)) {
+ unset($plugins_data[$this->client->slug]);
+ }
+
+ $data['plugins'] = $plugins_data;
+ }
+
+ // Add metadata
+ if ( $extra = $this->get_extra_data() ) {
+ $data['extra'] = $extra;
+ }
+
+ // Check this has previously skipped tracking
+ $skipped = get_option( $this->client->slug . '_tracking_skipped' );
+
+ if ( $skipped === 'yes' ) {
+ delete_option( $this->client->slug . '_tracking_skipped' );
+
+ $data['tracking_skipped'] = true;
+ }
+
+ return apply_filters( $this->client->slug . '_tracker_data', $data );
+ }
+
+ /**
+ * If a child class wants to send extra data
+ *
+ * @return mixed
+ */
+ protected function get_extra_data() {
+ if ( is_callable( $this->extra_data ) ) {
+ return call_user_func( $this->extra_data );
+ }
+
+ if ( is_array( $this->extra_data ) ) {
+ return $this->extra_data;
+ }
+
+ return array();
+ }
+
+ /**
+ * Explain the user which data we collect
+ *
+ * @return array
+ */
+ protected function data_we_collect() {
+ $data = array(
+ 'Server environment details (php, mysql, server, WordPress versions)',
+ 'Number of users in your site',
+ 'Site language',
+ 'Number of active and inactive plugins',
+ 'Site name and URL',
+ 'Your name and email address',
+ );
+
+ if ($this->plugin_data) {
+ array_splice($data, 4, 0, ["active plugins' name"]);
+ }
+
+ return $data;
+ }
+
+ /**
+ * Check if the user has opted into tracking
+ *
+ * @return bool
+ */
+ public function tracking_allowed() {
+ $allow_tracking = get_option( $this->client->slug . '_allow_tracking', 'no' );
+
+ return $allow_tracking == 'yes';
+ }
+
+ /**
+ * Get the last time a tracking was sent
+ *
+ * @return false|string
+ */
+ private function get_last_send() {
+ return get_option( $this->client->slug . '_tracking_last_send', false );
+ }
+
+ /**
+ * Check if the notice has been dismissed or enabled
+ *
+ * @return boolean
+ */
+ public function notice_dismissed() {
+ $hide_notice = get_option( $this->client->slug . '_tracking_notice', null );
+
+ if ( 'hide' == $hide_notice ) {
+ return true;
+ }
+
+ return false;
+ }
+
+ /**
+ * Check if the current server is localhost
+ *
+ * @return boolean
+ */
+ private function is_local_server() {
+
+ $host = isset( $_SERVER['HTTP_HOST'] ) ? $_SERVER['HTTP_HOST'] : 'localhost';
+ $ip = isset( $_SERVER['SERVER_ADDR'] ) ? $_SERVER['SERVER_ADDR'] : '127.0.0.1';
+ $is_local = false;
+
+ if( in_array( $ip,array( '127.0.0.1', '::1' ) )
+ || ! strpos( $host, '.' )
+ || in_array( strrchr( $host, '.' ), array( '.test', '.testing', '.local', '.localhost', '.localdomain' ) )
+ ) {
+ $is_local = true;
+ }
+
+ return apply_filters( 'appsero_is_local', $is_local );
+ }
+
+ /**
+ * Schedule the event weekly
+ *
+ * @return void
+ */
+ private function schedule_event() {
+ $hook_name = $this->client->slug . '_tracker_send_event';
+
+ if ( ! wp_next_scheduled( $hook_name ) ) {
+ wp_schedule_event( time(), 'weekly', $hook_name );
+ }
+ }
+
+ /**
+ * Clear any scheduled hook
+ *
+ * @return void
+ */
+ private function clear_schedule_event() {
+ wp_clear_scheduled_hook( $this->client->slug . '_tracker_send_event' );
+ }
+
+ /**
+ * Display the admin notice to users that have not opted-in or out
+ *
+ * @return void
+ */
+ public function admin_notice() {
+
+ if ( $this->notice_dismissed() ) {
+ return;
+ }
+
+ if ( $this->tracking_allowed() ) {
+ return;
+ }
+
+ if ( ! current_user_can( 'manage_options' ) ) {
+ return;
+ }
+
+ // don't show tracking if a local server
+ if ( $this->is_local_server() ) {
+ return;
+ }
+
+ $optin_url = add_query_arg( $this->client->slug . '_tracker_optin', 'true' );
+ $optout_url = add_query_arg( $this->client->slug . '_tracker_optout', 'true' );
+
+ if ( empty( $this->notice ) ) {
+ $notice = sprintf( $this->client->__trans( 'Want to help make %1$s even more awesome? Allow %1$s to collect non-sensitive diagnostic data and usage information.' ), $this->client->name );
+ } else {
+ $notice = $this->notice;
+ }
+
+ $policy_url = 'https://' . 'appsero.com/privacy-policy/';
+
+ $notice .= ' (' . $this->client->__trans( 'what we collect' ) . ')';
+ $notice .= '
' . implode( ', ', $this->data_we_collect() ) . '. No sensitive data is tracked. ';
+ $notice .= 'We are using Appsero to collect your data. Learn more about how Appsero collects and handle your data.
+ client->__trans( 'We share your data with Appsero to troubleshoot problems & make product improvements. Learn more about how Appsero handles your data.'),
+ esc_url( 'https://appsero.com/' ),
+ esc_url( 'https://appsero.com/privacy-policy' )
+ );
+ ?>
+
+ client->__trans( 'Activate %s by your license key to get professional support and automatic update from your WordPress dashboard.' ), $this->client->name ); ?>
+
+ error = $this->client->__trans( 'The license key field is required.' );
+
+ return;
+ }
+
+ $license_key = sanitize_text_field( $form['license_key'] );
+ $response = $this->activate( $license_key );
+
+ if ( ! $response['success'] ) {
+ $this->error = $response['error'] ? $response['error'] : $this->client->__trans( 'Unknown error occurred.' );
+
+ return;
+ }
+
+ $data = array(
+ 'key' => $license_key,
+ 'status' => 'activate',
+ 'remaining' => $response['remaining'],
+ 'activation_limit' => $response['activation_limit'],
+ 'expiry_days' => $response['expiry_days'],
+ 'title' => $response['title'],
+ 'source_id' => $response['source_identifier'],
+ 'recurring' => $response['recurring'],
+ );
+
+ update_option( $this->option_key, $data, false );
+
+ $this->success = $this->client->__trans( 'License activated successfully.' );
+ }
+
+ /**
+ * Deactive client license
+ */
+ private function deactive_client_license( $form ) {
+ $license = $this->get_license();
+
+ if ( empty( $license['key'] ) ) {
+ $this->error = $this->client->__trans( 'License key not found.' );
+
+ return;
+ }
+
+ $response = $this->deactivate( $license['key'] );
+
+ $data = array(
+ 'key' => '',
+ 'status' => 'deactivate',
+ );
+
+ update_option( $this->option_key, $data, false );
+
+ if ( ! $response['success'] ) {
+ $this->error = $response['error'] ? $response['error'] : $this->client->__trans( 'Unknown error occurred.' );
+
+ return;
+ }
+
+ $this->success = $this->client->__trans( 'License deactivated successfully.' );
+ }
+
+ /**
+ * Refresh Client License
+ */
+ private function refresh_client_license( $form = null ) {
+ $license = $this->get_license();
+
+ if( !$license || ! isset( $license['key'] ) || empty( $license['key'] ) ) {
+ $this->error = $this->client->__trans( "License key not found" );
+ return;
+ }
+
+ $this->check_license_status();
+
+ $this->success = $this->client->__trans( 'License refreshed successfully.' );
+ }
+
+ /**
+ * Add license menu page
+ */
+ private function create_menu_page() {
+ call_user_func(
+ 'add_' . 'menu' . '_page',
+ $this->menu_args['page_title'],
+ $this->menu_args['menu_title'],
+ $this->menu_args['capability'],
+ $this->menu_args['menu_slug'],
+ array( $this, 'menu_output' ),
+ $this->menu_args['icon_url'],
+ $this->menu_args['position']
+ );
+ }
+
+ /**
+ * Add submenu page
+ */
+ private function create_submenu_page() {
+ call_user_func(
+ 'add_' . 'submenu' . '_page',
+ $this->menu_args['parent_slug'],
+ $this->menu_args['page_title'],
+ $this->menu_args['menu_title'],
+ $this->menu_args['capability'],
+ $this->menu_args['menu_slug'],
+ array( $this, 'menu_output' ),
+ $this->menu_args['position']
+ );
+ }
+
+ /**
+ * Add submenu page
+ */
+ private function create_options_page() {
+ call_user_func(
+ 'add_' . 'options' . '_page',
+ $this->menu_args['page_title'],
+ $this->menu_args['menu_title'],
+ $this->menu_args['capability'],
+ $this->menu_args['menu_slug'],
+ array( $this, 'menu_output' ),
+ $this->menu_args['position']
+ );
+ }
+
+ /**
+ * Schedule daily sicense checker event
+ */
+ public function schedule_cron_event() {
+ if ( ! wp_next_scheduled( $this->schedule_hook ) ) {
+ wp_schedule_event( time(), 'daily', $this->schedule_hook );
+
+ wp_schedule_single_event( time() + 20, $this->schedule_hook );
+ }
+ }
+
+ /**
+ * Clear any scheduled hook
+ */
+ public function clear_scheduler() {
+ wp_clear_scheduled_hook( $this->schedule_hook );
+ }
+
+ /**
+ * Enable/Disable schedule
+ */
+ private function run_schedule() {
+ switch ( $this->client->type ) {
+ case 'plugin':
+ register_activation_hook( $this->client->file, array( $this, 'schedule_cron_event' ) );
+ register_deactivation_hook( $this->client->file, array( $this, 'clear_scheduler' ) );
+ break;
+
+ case 'theme':
+ add_action( 'after_switch_theme', array( $this, 'schedule_cron_event' ) );
+ add_action( 'switch_theme', array( $this, 'clear_scheduler' ) );
+ break;
+ }
+ }
+
+ /**
+ * Form action URL
+ */
+ private function form_action_url() {
+ $url = add_query_arg(
+ $_GET,
+ admin_url( basename( $_SERVER['SCRIPT_NAME'] ) )
+ );
+
+ echo apply_filters( 'appsero_client_license_form_action', $url );
+ }
+
+ /**
+ * Get input license key
+ *
+ * @param $action
+ *
+ * @return $license
+ */
+ private function get_input_license_value( $action, $license ) {
+ if ( 'active' == $action ) {
+ return isset( $license['key'] ) ? $license['key'] : '';
+ }
+
+ if ( 'deactive' == $action ) {
+ $key_length = strlen( $license['key'] );
+
+ return str_pad(
+ substr( $license['key'], 0, $key_length / 2 ), $key_length, '*'
+ );
+ }
+
+ return '';
+ }
+}
diff --git a/vendor/appsero/client/src/Updater.php b/vendor/appsero/client/src/Updater.php
new file mode 100644
index 000000000..33b1cef33
--- /dev/null
+++ b/vendor/appsero/client/src/Updater.php
@@ -0,0 +1,258 @@
+client = $client;
+ $this->cache_key = 'appsero_' . md5( $this->client->slug ) . '_version_info';
+
+ // Run hooks.
+ if ( $this->client->type == 'plugin' ) {
+ $this->run_plugin_hooks();
+ } elseif ( $this->client->type == 'theme' ) {
+ $this->run_theme_hooks();
+ }
+ }
+
+ /**
+ * Set up WordPress filter to hooks to get update.
+ *
+ * @return void
+ */
+ public function run_plugin_hooks() {
+ add_filter( 'pre_set_site_transient_update_plugins', array( $this, 'check_plugin_update' ) );
+ add_filter( 'plugins_api', array( $this, 'plugins_api_filter' ), 10, 3 );
+ }
+
+ /**
+ * Set up WordPress filter to hooks to get update.
+ *
+ * @return void
+ */
+ public function run_theme_hooks() {
+ add_filter( 'pre_set_site_transient_update_themes', array( $this, 'check_theme_update' ) );
+ }
+
+ /**
+ * Check for Update for this specific project
+ */
+ public function check_plugin_update( $transient_data ) {
+ global $pagenow;
+
+ if ( ! is_object( $transient_data ) ) {
+ $transient_data = new \stdClass;
+ }
+
+ if ( 'plugins.php' == $pagenow && is_multisite() ) {
+ return $transient_data;
+ }
+
+ if ( ! empty( $transient_data->response ) && ! empty( $transient_data->response[ $this->client->basename ] ) ) {
+ return $transient_data;
+ }
+
+ $version_info = $this->get_version_info();
+
+ if ( false !== $version_info && is_object( $version_info ) && isset( $version_info->new_version ) ) {
+
+ unset( $version_info->sections );
+
+ // If new version available then set to `response`
+ if ( version_compare( $this->client->project_version, $version_info->new_version, '<' ) ) {
+ $transient_data->response[ $this->client->basename ] = $version_info;
+ } else {
+ // If new version is not available then set to `no_update`
+ $transient_data->no_update[ $this->client->basename ] = $version_info;
+ }
+
+ $transient_data->last_checked = time();
+ $transient_data->checked[ $this->client->basename ] = $this->client->project_version;
+ }
+
+ return $transient_data;
+ }
+
+ /**
+ * Get version info from database
+ *
+ * @return Object or Boolean
+ */
+ private function get_cached_version_info() {
+ global $pagenow;
+
+ // If updater page then fetch from API now
+ if ( 'update-core.php' == $pagenow ) {
+ return false; // Force to fetch data
+ }
+
+ $value = get_transient( $this->cache_key );
+
+ if( ! $value && ! isset( $value->name ) ) {
+ return false; // Cache is expired
+ }
+
+ // We need to turn the icons into an array
+ if ( isset( $value->icons ) ) {
+ $value->icons = (array) $value->icons;
+ }
+
+ // We need to turn the banners into an array
+ if ( isset( $value->banners ) ) {
+ $value->banners = (array) $value->banners;
+ }
+
+ if ( isset( $value->sections ) ) {
+ $value->sections = (array) $value->sections;
+ }
+
+ return $value;
+ }
+
+ /**
+ * Set version info to database
+ */
+ private function set_cached_version_info( $value ) {
+ if ( ! $value ) {
+ return;
+ }
+
+ set_transient( $this->cache_key, $value, 3 * HOUR_IN_SECONDS );
+ }
+
+ /**
+ * Get plugin info from Appsero
+ */
+ private function get_project_latest_version() {
+
+ $license = $this->client->license()->get_license();
+
+ $params = array(
+ 'version' => $this->client->project_version,
+ 'name' => $this->client->name,
+ 'slug' => $this->client->slug,
+ 'basename' => $this->client->basename,
+ 'license_key' => ! empty( $license ) && isset( $license['key'] ) ? $license['key'] : '',
+ );
+
+ $route = 'update/' . $this->client->hash . '/check';
+
+ $response = $this->client->send_request( $params, $route, true );
+
+ if ( is_wp_error( $response ) ) {
+ return false;
+ }
+
+ $response = json_decode( wp_remote_retrieve_body( $response ) );
+
+ if ( ! isset( $response->slug ) ) {
+ return false;
+ }
+
+ if ( isset( $response->icons ) ) {
+ $response->icons = (array) $response->icons;
+ }
+
+ if ( isset( $response->banners ) ) {
+ $response->banners = (array) $response->banners;
+ }
+
+ if ( isset( $response->sections ) ) {
+ $response->sections = (array) $response->sections;
+ }
+
+ return $response;
+ }
+
+ /**
+ * Updates information on the "View version x.x details" page with custom data.
+ *
+ * @param mixed $data
+ * @param string $action
+ * @param object $args
+ *
+ * @return object $data
+ */
+ public function plugins_api_filter( $data, $action = '', $args = null ) {
+
+ if ( $action != 'plugin_information' ) {
+ return $data;
+ }
+
+ if ( ! isset( $args->slug ) || ( $args->slug != $this->client->slug ) ) {
+ return $data;
+ }
+
+ return $this->get_version_info();
+ }
+
+ /**
+ * Check theme upate
+ */
+ public function check_theme_update( $transient_data ) {
+ global $pagenow;
+
+ if ( ! is_object( $transient_data ) ) {
+ $transient_data = new \stdClass;
+ }
+
+ if ( 'themes.php' == $pagenow && is_multisite() ) {
+ return $transient_data;
+ }
+
+ if ( ! empty( $transient_data->response ) && ! empty( $transient_data->response[ $this->client->slug ] ) ) {
+ return $transient_data;
+ }
+
+ $version_info = $this->get_version_info();
+
+ if ( false !== $version_info && is_object( $version_info ) && isset( $version_info->new_version ) ) {
+
+ // If new version available then set to `response`
+ if ( version_compare( $this->client->project_version, $version_info->new_version, '<' ) ) {
+ $transient_data->response[ $this->client->slug ] = (array) $version_info;
+ } else {
+ // If new version is not available then set to `no_update`
+ $transient_data->no_update[ $this->client->slug ] = (array) $version_info;
+ }
+
+ $transient_data->last_checked = time();
+ $transient_data->checked[ $this->client->slug ] = $this->client->project_version;
+ }
+
+ return $transient_data;
+ }
+
+ /**
+ * Get version information
+ */
+ private function get_version_info() {
+ $version_info = $this->get_cached_version_info();
+
+ if ( false === $version_info ) {
+ $version_info = $this->get_project_latest_version();
+ $this->set_cached_version_info( $version_info );
+ }
+
+ return $version_info;
+ }
+
+}
diff --git a/vendor/composer/autoload_psr4.php b/vendor/composer/autoload_psr4.php
index db80e7a8d..7068f667c 100644
--- a/vendor/composer/autoload_psr4.php
+++ b/vendor/composer/autoload_psr4.php
@@ -7,4 +7,5 @@
return array(
'Fragen\\Git_Updater\\' => array($baseDir . '/src/Git_Updater'),
+ 'Appsero\\' => array($vendorDir . '/appsero/client/src'),
);
diff --git a/vendor/composer/autoload_static.php b/vendor/composer/autoload_static.php
index 458bbc2b4..28777dc7b 100644
--- a/vendor/composer/autoload_static.php
+++ b/vendor/composer/autoload_static.php
@@ -15,6 +15,10 @@ class ComposerStaticInita27e6a3df8c435e2b136f961f0442be2
array (
'Fragen\\Git_Updater\\' => 19,
),
+ 'A' =>
+ array (
+ 'Appsero\\' => 8,
+ ),
);
public static $prefixDirsPsr4 = array (
@@ -22,6 +26,10 @@ class ComposerStaticInita27e6a3df8c435e2b136f961f0442be2
array (
0 => __DIR__ . '/../..' . '/src/Git_Updater',
),
+ 'Appsero\\' =>
+ array (
+ 0 => __DIR__ . '/..' . '/appsero/client/src',
+ ),
);
public static $prefixesPsr0 = array (
diff --git a/vendor/composer/installed.json b/vendor/composer/installed.json
index f9f2d807e..886ebf66b 100644
--- a/vendor/composer/installed.json
+++ b/vendor/composer/installed.json
@@ -208,6 +208,55 @@
},
"install-path": "../afragen/wp-dismiss-notice"
},
+ {
+ "name": "appsero/client",
+ "version": "v1.2.1",
+ "version_normalized": "1.2.1.0",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/Appsero/client.git",
+ "reference": "d110c537f4ca92ac7f3398eee67cc6bdf506a4fb"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/Appsero/client/zipball/d110c537f4ca92ac7f3398eee67cc6bdf506a4fb",
+ "reference": "d110c537f4ca92ac7f3398eee67cc6bdf506a4fb",
+ "shasum": ""
+ },
+ "require": {
+ "php": ">=5.3"
+ },
+ "time": "2022-06-30T12:01:38+00:00",
+ "type": "library",
+ "installation-source": "dist",
+ "autoload": {
+ "psr-4": {
+ "Appsero\\": "src/"
+ }
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "authors": [
+ {
+ "name": "Tareq Hasan",
+ "email": "tareq@appsero.com"
+ }
+ ],
+ "description": "Appsero Client",
+ "keywords": [
+ "analytics",
+ "plugin",
+ "theme",
+ "wordpress"
+ ],
+ "support": {
+ "issues": "https://github.com/Appsero/client/issues",
+ "source": "https://github.com/Appsero/client/tree/v1.2.1"
+ },
+ "install-path": "../appsero/client"
+ },
{
"name": "erusev/parsedown",
"version": "1.7.4",
@@ -260,48 +309,6 @@
"source": "https://github.com/erusev/parsedown/tree/1.7.x"
},
"install-path": "../erusev/parsedown"
- },
- {
- "name": "freemius/wordpress-sdk",
- "version": "2.4.5",
- "version_normalized": "2.4.5.0",
- "source": {
- "type": "git",
- "url": "https://github.com/Freemius/wordpress-sdk.git",
- "reference": "d4aa83b1e74f3269affcbfe0d2b75ceae35ba864"
- },
- "dist": {
- "type": "zip",
- "url": "https://api.github.com/repos/Freemius/wordpress-sdk/zipball/d4aa83b1e74f3269affcbfe0d2b75ceae35ba864",
- "reference": "d4aa83b1e74f3269affcbfe0d2b75ceae35ba864",
- "shasum": ""
- },
- "require": {
- "php": ">=5.2"
- },
- "time": "2022-07-31T06:50:47+00:00",
- "type": "library",
- "installation-source": "dist",
- "notification-url": "https://packagist.org/downloads/",
- "license": [
- "GPL-3.0-only"
- ],
- "description": "Freemius WordPress SDK",
- "homepage": "https://freemius.com",
- "keywords": [
- "freemius",
- "plugin",
- "sdk",
- "theme",
- "wordpress",
- "wordpress-plugin",
- "wordpress-theme"
- ],
- "support": {
- "issues": "https://github.com/Freemius/wordpress-sdk/issues",
- "source": "https://github.com/Freemius/wordpress-sdk/tree/2.4.5"
- },
- "install-path": "../freemius/wordpress-sdk"
}
],
"dev": false,
diff --git a/vendor/composer/installed.php b/vendor/composer/installed.php
index 7db1accac..d2d32de9c 100644
--- a/vendor/composer/installed.php
+++ b/vendor/composer/installed.php
@@ -3,7 +3,7 @@
'name' => 'afragen/git-updater',
'pretty_version' => 'dev-master',
'version' => 'dev-master',
- 'reference' => '68696207fdac567de6911c8107edb0ab0e9ed8ee',
+ 'reference' => '08b10a1c5f91e410b0339e2ff6f15f472e79fc38',
'type' => 'wordpress-plugin',
'install_path' => __DIR__ . '/../../',
'aliases' => array(),
@@ -13,7 +13,7 @@
'afragen/git-updater' => array(
'pretty_version' => 'dev-master',
'version' => 'dev-master',
- 'reference' => '68696207fdac567de6911c8107edb0ab0e9ed8ee',
+ 'reference' => '08b10a1c5f91e410b0339e2ff6f15f472e79fc38',
'type' => 'wordpress-plugin',
'install_path' => __DIR__ . '/../../',
'aliases' => array(),
@@ -59,6 +59,15 @@
'aliases' => array(),
'dev_requirement' => false,
),
+ 'appsero/client' => array(
+ 'pretty_version' => 'v1.2.1',
+ 'version' => '1.2.1.0',
+ 'reference' => 'd110c537f4ca92ac7f3398eee67cc6bdf506a4fb',
+ 'type' => 'library',
+ 'install_path' => __DIR__ . '/../appsero/client',
+ 'aliases' => array(),
+ 'dev_requirement' => false,
+ ),
'erusev/parsedown' => array(
'pretty_version' => '1.7.4',
'version' => '1.7.4.0',
@@ -68,14 +77,5 @@
'aliases' => array(),
'dev_requirement' => false,
),
- 'freemius/wordpress-sdk' => array(
- 'pretty_version' => '2.4.5',
- 'version' => '2.4.5.0',
- 'reference' => 'd4aa83b1e74f3269affcbfe0d2b75ceae35ba864',
- 'type' => 'library',
- 'install_path' => __DIR__ . '/../freemius/wordpress-sdk',
- 'aliases' => array(),
- 'dev_requirement' => false,
- ),
),
);
diff --git a/vendor/freemius/wordpress-sdk/LICENSE.txt b/vendor/freemius/wordpress-sdk/LICENSE.txt
deleted file mode 100755
index 30ace6a87..000000000
--- a/vendor/freemius/wordpress-sdk/LICENSE.txt
+++ /dev/null
@@ -1,674 +0,0 @@
- GNU GENERAL PUBLIC LICENSE
- Version 3, 29 June 2007
-
- Copyright (C) 2007 Free Software Foundation, Inc.
- Everyone is permitted to copy and distribute verbatim copies
- of this license document, but changing it is not allowed.
-
- Preamble
-
- The GNU General Public License is a free, copyleft license for
-software and other kinds of works.
-
- The licenses for most software and other practical works are designed
-to take away your freedom to share and change the works. By contrast,
-the GNU General Public License is intended to guarantee your freedom to
-share and change all versions of a program--to make sure it remains free
-software for all its users. We, the Free Software Foundation, use the
-GNU General Public License for most of our software; it applies also to
-any other work released this way by its authors. You can apply it to
-your programs, too.
-
- When we speak of free software, we are referring to freedom, not
-price. Our General Public Licenses are designed to make sure that you
-have the freedom to distribute copies of free software (and charge for
-them if you wish), that you receive source code or can get it if you
-want it, that you can change the software or use pieces of it in new
-free programs, and that you know you can do these things.
-
- To protect your rights, we need to prevent others from denying you
-these rights or asking you to surrender the rights. Therefore, you have
-certain responsibilities if you distribute copies of the software, or if
-you modify it: responsibilities to respect the freedom of others.
-
- For example, if you distribute copies of such a program, whether
-gratis or for a fee, you must pass on to the recipients the same
-freedoms that you received. You must make sure that they, too, receive
-or can get the source code. And you must show them these terms so they
-know their rights.
-
- Developers that use the GNU GPL protect your rights with two steps:
-(1) assert copyright on the software, and (2) offer you this License
-giving you legal permission to copy, distribute and/or modify it.
-
- For the developers' and authors' protection, the GPL clearly explains
-that there is no warranty for this free software. For both users' and
-authors' sake, the GPL requires that modified versions be marked as
-changed, so that their problems will not be attributed erroneously to
-authors of previous versions.
-
- Some devices are designed to deny users access to install or run
-modified versions of the software inside them, although the manufacturer
-can do so. This is fundamentally incompatible with the aim of
-protecting users' freedom to change the software. The systematic
-pattern of such abuse occurs in the area of products for individuals to
-use, which is precisely where it is most unacceptable. Therefore, we
-have designed this version of the GPL to prohibit the practice for those
-products. If such problems arise substantially in other domains, we
-stand ready to extend this provision to those domains in future versions
-of the GPL, as needed to protect the freedom of users.
-
- Finally, every program is threatened constantly by software patents.
-States should not allow patents to restrict development and use of
-software on general-purpose computers, but in those that do, we wish to
-avoid the special danger that patents applied to a free program could
-make it effectively proprietary. To prevent this, the GPL assures that
-patents cannot be used to render the program non-free.
-
- The precise terms and conditions for copying, distribution and
-modification follow.
-
- TERMS AND CONDITIONS
-
- 0. Definitions.
-
- "This License" refers to version 3 of the GNU General Public License.
-
- "Copyright" also means copyright-like laws that apply to other kinds of
-works, such as semiconductor masks.
-
- "The Program" refers to any copyrightable work licensed under this
-License. Each licensee is addressed as "you". "Licensees" and
-"recipients" may be individuals or organizations.
-
- To "modify" a work means to copy from or adapt all or part of the work
-in a fashion requiring copyright permission, other than the making of an
-exact copy. The resulting work is called a "modified version" of the
-earlier work or a work "based on" the earlier work.
-
- A "covered work" means either the unmodified Program or a work based
-on the Program.
-
- To "propagate" a work means to do anything with it that, without
-permission, would make you directly or secondarily liable for
-infringement under applicable copyright law, except executing it on a
-computer or modifying a private copy. Propagation includes copying,
-distribution (with or without modification), making available to the
-public, and in some countries other activities as well.
-
- To "convey" a work means any kind of propagation that enables other
-parties to make or receive copies. Mere interaction with a user through
-a computer network, with no transfer of a copy, is not conveying.
-
- An interactive user interface displays "Appropriate Legal Notices"
-to the extent that it includes a convenient and prominently visible
-feature that (1) displays an appropriate copyright notice, and (2)
-tells the user that there is no warranty for the work (except to the
-extent that warranties are provided), that licensees may convey the
-work under this License, and how to view a copy of this License. If
-the interface presents a list of user commands or options, such as a
-menu, a prominent item in the list meets this criterion.
-
- 1. Source Code.
-
- The "source code" for a work means the preferred form of the work
-for making modifications to it. "Object code" means any non-source
-form of a work.
-
- A "Standard Interface" means an interface that either is an official
-standard defined by a recognized standards body, or, in the case of
-interfaces specified for a particular programming language, one that
-is widely used among developers working in that language.
-
- The "System Libraries" of an executable work include anything, other
-than the work as a whole, that (a) is included in the normal form of
-packaging a Major Component, but which is not part of that Major
-Component, and (b) serves only to enable use of the work with that
-Major Component, or to implement a Standard Interface for which an
-implementation is available to the public in source code form. A
-"Major Component", in this context, means a major essential component
-(kernel, window system, and so on) of the specific operating system
-(if any) on which the executable work runs, or a compiler used to
-produce the work, or an object code interpreter used to run it.
-
- The "Corresponding Source" for a work in object code form means all
-the source code needed to generate, install, and (for an executable
-work) run the object code and to modify the work, including scripts to
-control those activities. However, it does not include the work's
-System Libraries, or general-purpose tools or generally available free
-programs which are used unmodified in performing those activities but
-which are not part of the work. For example, Corresponding Source
-includes interface definition files associated with source files for
-the work, and the source code for shared libraries and dynamically
-linked subprograms that the work is specifically designed to require,
-such as by intimate data communication or control flow between those
-subprograms and other parts of the work.
-
- The Corresponding Source need not include anything that users
-can regenerate automatically from other parts of the Corresponding
-Source.
-
- The Corresponding Source for a work in source code form is that
-same work.
-
- 2. Basic Permissions.
-
- All rights granted under this License are granted for the term of
-copyright on the Program, and are irrevocable provided the stated
-conditions are met. This License explicitly affirms your unlimited
-permission to run the unmodified Program. The output from running a
-covered work is covered by this License only if the output, given its
-content, constitutes a covered work. This License acknowledges your
-rights of fair use or other equivalent, as provided by copyright law.
-
- You may make, run and propagate covered works that you do not
-convey, without conditions so long as your license otherwise remains
-in force. You may convey covered works to others for the sole purpose
-of having them make modifications exclusively for you, or provide you
-with facilities for running those works, provided that you comply with
-the terms of this License in conveying all material for which you do
-not control copyright. Those thus making or running the covered works
-for you must do so exclusively on your behalf, under your direction
-and control, on terms that prohibit them from making any copies of
-your copyrighted material outside their relationship with you.
-
- Conveying under any other circumstances is permitted solely under
-the conditions stated below. Sublicensing is not allowed; section 10
-makes it unnecessary.
-
- 3. Protecting Users' Legal Rights From Anti-Circumvention Law.
-
- No covered work shall be deemed part of an effective technological
-measure under any applicable law fulfilling obligations under article
-11 of the WIPO copyright treaty adopted on 20 December 1996, or
-similar laws prohibiting or restricting circumvention of such
-measures.
-
- When you convey a covered work, you waive any legal power to forbid
-circumvention of technological measures to the extent such circumvention
-is effected by exercising rights under this License with respect to
-the covered work, and you disclaim any intention to limit operation or
-modification of the work as a means of enforcing, against the work's
-users, your or third parties' legal rights to forbid circumvention of
-technological measures.
-
- 4. Conveying Verbatim Copies.
-
- You may convey verbatim copies of the Program's source code as you
-receive it, in any medium, provided that you conspicuously and
-appropriately publish on each copy an appropriate copyright notice;
-keep intact all notices stating that this License and any
-non-permissive terms added in accord with section 7 apply to the code;
-keep intact all notices of the absence of any warranty; and give all
-recipients a copy of this License along with the Program.
-
- You may charge any price or no price for each copy that you convey,
-and you may offer support or warranty protection for a fee.
-
- 5. Conveying Modified Source Versions.
-
- You may convey a work based on the Program, or the modifications to
-produce it from the Program, in the form of source code under the
-terms of section 4, provided that you also meet all of these conditions:
-
- a) The work must carry prominent notices stating that you modified
- it, and giving a relevant date.
-
- b) The work must carry prominent notices stating that it is
- released under this License and any conditions added under section
- 7. This requirement modifies the requirement in section 4 to
- "keep intact all notices".
-
- c) You must license the entire work, as a whole, under this
- License to anyone who comes into possession of a copy. This
- License will therefore apply, along with any applicable section 7
- additional terms, to the whole of the work, and all its parts,
- regardless of how they are packaged. This License gives no
- permission to license the work in any other way, but it does not
- invalidate such permission if you have separately received it.
-
- d) If the work has interactive user interfaces, each must display
- Appropriate Legal Notices; however, if the Program has interactive
- interfaces that do not display Appropriate Legal Notices, your
- work need not make them do so.
-
- A compilation of a covered work with other separate and independent
-works, which are not by their nature extensions of the covered work,
-and which are not combined with it such as to form a larger program,
-in or on a volume of a storage or distribution medium, is called an
-"aggregate" if the compilation and its resulting copyright are not
-used to limit the access or legal rights of the compilation's users
-beyond what the individual works permit. Inclusion of a covered work
-in an aggregate does not cause this License to apply to the other
-parts of the aggregate.
-
- 6. Conveying Non-Source Forms.
-
- You may convey a covered work in object code form under the terms
-of sections 4 and 5, provided that you also convey the
-machine-readable Corresponding Source under the terms of this License,
-in one of these ways:
-
- a) Convey the object code in, or embodied in, a physical product
- (including a physical distribution medium), accompanied by the
- Corresponding Source fixed on a durable physical medium
- customarily used for software interchange.
-
- b) Convey the object code in, or embodied in, a physical product
- (including a physical distribution medium), accompanied by a
- written offer, valid for at least three years and valid for as
- long as you offer spare parts or customer support for that product
- model, to give anyone who possesses the object code either (1) a
- copy of the Corresponding Source for all the software in the
- product that is covered by this License, on a durable physical
- medium customarily used for software interchange, for a price no
- more than your reasonable cost of physically performing this
- conveying of source, or (2) access to copy the
- Corresponding Source from a network server at no charge.
-
- c) Convey individual copies of the object code with a copy of the
- written offer to provide the Corresponding Source. This
- alternative is allowed only occasionally and noncommercially, and
- only if you received the object code with such an offer, in accord
- with subsection 6b.
-
- d) Convey the object code by offering access from a designated
- place (gratis or for a charge), and offer equivalent access to the
- Corresponding Source in the same way through the same place at no
- further charge. You need not require recipients to copy the
- Corresponding Source along with the object code. If the place to
- copy the object code is a network server, the Corresponding Source
- may be on a different server (operated by you or a third party)
- that supports equivalent copying facilities, provided you maintain
- clear directions next to the object code saying where to find the
- Corresponding Source. Regardless of what server hosts the
- Corresponding Source, you remain obligated to ensure that it is
- available for as long as needed to satisfy these requirements.
-
- e) Convey the object code using peer-to-peer transmission, provided
- you inform other peers where the object code and Corresponding
- Source of the work are being offered to the general public at no
- charge under subsection 6d.
-
- A separable portion of the object code, whose source code is excluded
-from the Corresponding Source as a System Library, need not be
-included in conveying the object code work.
-
- A "User Product" is either (1) a "consumer product", which means any
-tangible personal property which is normally used for personal, family,
-or household purposes, or (2) anything designed or sold for incorporation
-into a dwelling. In determining whether a product is a consumer product,
-doubtful cases shall be resolved in favor of coverage. For a particular
-product received by a particular user, "normally used" refers to a
-typical or common use of that class of product, regardless of the status
-of the particular user or of the way in which the particular user
-actually uses, or expects or is expected to use, the product. A product
-is a consumer product regardless of whether the product has substantial
-commercial, industrial or non-consumer uses, unless such uses represent
-the only significant mode of use of the product.
-
- "Installation Information" for a User Product means any methods,
-procedures, authorization keys, or other information required to install
-and execute modified versions of a covered work in that User Product from
-a modified version of its Corresponding Source. The information must
-suffice to ensure that the continued functioning of the modified object
-code is in no case prevented or interfered with solely because
-modification has been made.
-
- If you convey an object code work under this section in, or with, or
-specifically for use in, a User Product, and the conveying occurs as
-part of a transaction in which the right of possession and use of the
-User Product is transferred to the recipient in perpetuity or for a
-fixed term (regardless of how the transaction is characterized), the
-Corresponding Source conveyed under this section must be accompanied
-by the Installation Information. But this requirement does not apply
-if neither you nor any third party retains the ability to install
-modified object code on the User Product (for example, the work has
-been installed in ROM).
-
- The requirement to provide Installation Information does not include a
-requirement to continue to provide support service, warranty, or updates
-for a work that has been modified or installed by the recipient, or for
-the User Product in which it has been modified or installed. Access to a
-network may be denied when the modification itself materially and
-adversely affects the operation of the network or violates the rules and
-protocols for communication across the network.
-
- Corresponding Source conveyed, and Installation Information provided,
-in accord with this section must be in a format that is publicly
-documented (and with an implementation available to the public in
-source code form), and must require no special password or key for
-unpacking, reading or copying.
-
- 7. Additional Terms.
-
- "Additional permissions" are terms that supplement the terms of this
-License by making exceptions from one or more of its conditions.
-Additional permissions that are applicable to the entire Program shall
-be treated as though they were included in this License, to the extent
-that they are valid under applicable law. If additional permissions
-apply only to part of the Program, that part may be used separately
-under those permissions, but the entire Program remains governed by
-this License without regard to the additional permissions.
-
- When you convey a copy of a covered work, you may at your option
-remove any additional permissions from that copy, or from any part of
-it. (Additional permissions may be written to require their own
-removal in certain cases when you modify the work.) You may place
-additional permissions on material, added by you to a covered work,
-for which you have or can give appropriate copyright permission.
-
- Notwithstanding any other provision of this License, for material you
-add to a covered work, you may (if authorized by the copyright holders of
-that material) supplement the terms of this License with terms:
-
- a) Disclaiming warranty or limiting liability differently from the
- terms of sections 15 and 16 of this License; or
-
- b) Requiring preservation of specified reasonable legal notices or
- author attributions in that material or in the Appropriate Legal
- Notices displayed by works containing it; or
-
- c) Prohibiting misrepresentation of the origin of that material, or
- requiring that modified versions of such material be marked in
- reasonable ways as different from the original version; or
-
- d) Limiting the use for publicity purposes of names of licensors or
- authors of the material; or
-
- e) Declining to grant rights under trademark law for use of some
- trade names, trademarks, or service marks; or
-
- f) Requiring indemnification of licensors and authors of that
- material by anyone who conveys the material (or modified versions of
- it) with contractual assumptions of liability to the recipient, for
- any liability that these contractual assumptions directly impose on
- those licensors and authors.
-
- All other non-permissive additional terms are considered "further
-restrictions" within the meaning of section 10. If the Program as you
-received it, or any part of it, contains a notice stating that it is
-governed by this License along with a term that is a further
-restriction, you may remove that term. If a license document contains
-a further restriction but permits relicensing or conveying under this
-License, you may add to a covered work material governed by the terms
-of that license document, provided that the further restriction does
-not survive such relicensing or conveying.
-
- If you add terms to a covered work in accord with this section, you
-must place, in the relevant source files, a statement of the
-additional terms that apply to those files, or a notice indicating
-where to find the applicable terms.
-
- Additional terms, permissive or non-permissive, may be stated in the
-form of a separately written license, or stated as exceptions;
-the above requirements apply either way.
-
- 8. Termination.
-
- You may not propagate or modify a covered work except as expressly
-provided under this License. Any attempt otherwise to propagate or
-modify it is void, and will automatically terminate your rights under
-this License (including any patent licenses granted under the third
-paragraph of section 11).
-
- However, if you cease all violation of this License, then your
-license from a particular copyright holder is reinstated (a)
-provisionally, unless and until the copyright holder explicitly and
-finally terminates your license, and (b) permanently, if the copyright
-holder fails to notify you of the violation by some reasonable means
-prior to 60 days after the cessation.
-
- Moreover, your license from a particular copyright holder is
-reinstated permanently if the copyright holder notifies you of the
-violation by some reasonable means, this is the first time you have
-received notice of violation of this License (for any work) from that
-copyright holder, and you cure the violation prior to 30 days after
-your receipt of the notice.
-
- Termination of your rights under this section does not terminate the
-licenses of parties who have received copies or rights from you under
-this License. If your rights have been terminated and not permanently
-reinstated, you do not qualify to receive new licenses for the same
-material under section 10.
-
- 9. Acceptance Not Required for Having Copies.
-
- You are not required to accept this License in order to receive or
-run a copy of the Program. Ancillary propagation of a covered work
-occurring solely as a consequence of using peer-to-peer transmission
-to receive a copy likewise does not require acceptance. However,
-nothing other than this License grants you permission to propagate or
-modify any covered work. These actions infringe copyright if you do
-not accept this License. Therefore, by modifying or propagating a
-covered work, you indicate your acceptance of this License to do so.
-
- 10. Automatic Licensing of Downstream Recipients.
-
- Each time you convey a covered work, the recipient automatically
-receives a license from the original licensors, to run, modify and
-propagate that work, subject to this License. You are not responsible
-for enforcing compliance by third parties with this License.
-
- An "entity transaction" is a transaction transferring control of an
-organization, or substantially all assets of one, or subdividing an
-organization, or merging organizations. If propagation of a covered
-work results from an entity transaction, each party to that
-transaction who receives a copy of the work also receives whatever
-licenses to the work the party's predecessor in interest had or could
-give under the previous paragraph, plus a right to possession of the
-Corresponding Source of the work from the predecessor in interest, if
-the predecessor has it or can get it with reasonable efforts.
-
- You may not impose any further restrictions on the exercise of the
-rights granted or affirmed under this License. For example, you may
-not impose a license fee, royalty, or other charge for exercise of
-rights granted under this License, and you may not initiate litigation
-(including a cross-claim or counterclaim in a lawsuit) alleging that
-any patent claim is infringed by making, using, selling, offering for
-sale, or importing the Program or any portion of it.
-
- 11. Patents.
-
- A "contributor" is a copyright holder who authorizes use under this
-License of the Program or a work on which the Program is based. The
-work thus licensed is called the contributor's "contributor version".
-
- A contributor's "essential patent claims" are all patent claims
-owned or controlled by the contributor, whether already acquired or
-hereafter acquired, that would be infringed by some manner, permitted
-by this License, of making, using, or selling its contributor version,
-but do not include claims that would be infringed only as a
-consequence of further modification of the contributor version. For
-purposes of this definition, "control" includes the right to grant
-patent sublicenses in a manner consistent with the requirements of
-this License.
-
- Each contributor grants you a non-exclusive, worldwide, royalty-free
-patent license under the contributor's essential patent claims, to
-make, use, sell, offer for sale, import and otherwise run, modify and
-propagate the contents of its contributor version.
-
- In the following three paragraphs, a "patent license" is any express
-agreement or commitment, however denominated, not to enforce a patent
-(such as an express permission to practice a patent or covenant not to
-sue for patent infringement). To "grant" such a patent license to a
-party means to make such an agreement or commitment not to enforce a
-patent against the party.
-
- If you convey a covered work, knowingly relying on a patent license,
-and the Corresponding Source of the work is not available for anyone
-to copy, free of charge and under the terms of this License, through a
-publicly available network server or other readily accessible means,
-then you must either (1) cause the Corresponding Source to be so
-available, or (2) arrange to deprive yourself of the benefit of the
-patent license for this particular work, or (3) arrange, in a manner
-consistent with the requirements of this License, to extend the patent
-license to downstream recipients. "Knowingly relying" means you have
-actual knowledge that, but for the patent license, your conveying the
-covered work in a country, or your recipient's use of the covered work
-in a country, would infringe one or more identifiable patents in that
-country that you have reason to believe are valid.
-
- If, pursuant to or in connection with a single transaction or
-arrangement, you convey, or propagate by procuring conveyance of, a
-covered work, and grant a patent license to some of the parties
-receiving the covered work authorizing them to use, propagate, modify
-or convey a specific copy of the covered work, then the patent license
-you grant is automatically extended to all recipients of the covered
-work and works based on it.
-
- A patent license is "discriminatory" if it does not include within
-the scope of its coverage, prohibits the exercise of, or is
-conditioned on the non-exercise of one or more of the rights that are
-specifically granted under this License. You may not convey a covered
-work if you are a party to an arrangement with a third party that is
-in the business of distributing software, under which you make payment
-to the third party based on the extent of your activity of conveying
-the work, and under which the third party grants, to any of the
-parties who would receive the covered work from you, a discriminatory
-patent license (a) in connection with copies of the covered work
-conveyed by you (or copies made from those copies), or (b) primarily
-for and in connection with specific products or compilations that
-contain the covered work, unless you entered into that arrangement,
-or that patent license was granted, prior to 28 March 2007.
-
- Nothing in this License shall be construed as excluding or limiting
-any implied license or other defenses to infringement that may
-otherwise be available to you under applicable patent law.
-
- 12. No Surrender of Others' Freedom.
-
- If conditions are imposed on you (whether by court order, agreement or
-otherwise) that contradict the conditions of this License, they do not
-excuse you from the conditions of this License. If you cannot convey a
-covered work so as to satisfy simultaneously your obligations under this
-License and any other pertinent obligations, then as a consequence you may
-not convey it at all. For example, if you agree to terms that obligate you
-to collect a royalty for further conveying from those to whom you convey
-the Program, the only way you could satisfy both those terms and this
-License would be to refrain entirely from conveying the Program.
-
- 13. Use with the GNU Affero General Public License.
-
- Notwithstanding any other provision of this License, you have
-permission to link or combine any covered work with a work licensed
-under version 3 of the GNU Affero General Public License into a single
-combined work, and to convey the resulting work. The terms of this
-License will continue to apply to the part which is the covered work,
-but the special requirements of the GNU Affero General Public License,
-section 13, concerning interaction through a network will apply to the
-combination as such.
-
- 14. Revised Versions of this License.
-
- The Free Software Foundation may publish revised and/or new versions of
-the GNU General Public License from time to time. Such new versions will
-be similar in spirit to the present version, but may differ in detail to
-address new problems or concerns.
-
- Each version is given a distinguishing version number. If the
-Program specifies that a certain numbered version of the GNU General
-Public License "or any later version" applies to it, you have the
-option of following the terms and conditions either of that numbered
-version or of any later version published by the Free Software
-Foundation. If the Program does not specify a version number of the
-GNU General Public License, you may choose any version ever published
-by the Free Software Foundation.
-
- If the Program specifies that a proxy can decide which future
-versions of the GNU General Public License can be used, that proxy's
-public statement of acceptance of a version permanently authorizes you
-to choose that version for the Program.
-
- Later license versions may give you additional or different
-permissions. However, no additional obligations are imposed on any
-author or copyright holder as a result of your choosing to follow a
-later version.
-
- 15. Disclaimer of Warranty.
-
- THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
-APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
-HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
-OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
-THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
-PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
-IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
-ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
-
- 16. Limitation of Liability.
-
- IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
-WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
-THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
-GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
-USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
-DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
-PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
-EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
-SUCH DAMAGES.
-
- 17. Interpretation of Sections 15 and 16.
-
- If the disclaimer of warranty and limitation of liability provided
-above cannot be given local legal effect according to their terms,
-reviewing courts shall apply local law that most closely approximates
-an absolute waiver of all civil liability in connection with the
-Program, unless a warranty or assumption of liability accompanies a
-copy of the Program in return for a fee.
-
- END OF TERMS AND CONDITIONS
-
- How to Apply These Terms to Your New Programs
-
- If you develop a new program, and you want it to be of the greatest
-possible use to the public, the best way to achieve this is to make it
-free software which everyone can redistribute and change under these terms.
-
- To do so, attach the following notices to the program. It is safest
-to attach them to the start of each source file to most effectively
-state the exclusion of warranty; and each file should have at least
-the "copyright" line and a pointer to where the full notice is found.
-
- {one line to give the program's name and a brief idea of what it does.}
- Copyright (C) {year} {name of author}
-
- This program is free software: you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation, either version 3 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program. If not, see .
-
-Also add information on how to contact you by electronic and paper mail.
-
- If the program does terminal interaction, make it output a short
-notice like this when it starts in an interactive mode:
-
- {project} Copyright (C) {year} {fullname}
- This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
- This is free software, and you are welcome to redistribute it
- under certain conditions; type `show c' for details.
-
-The hypothetical commands `show w' and `show c' should show the appropriate
-parts of the General Public License. Of course, your program's commands
-might be different; for a GUI interface, you would use an "about box".
-
- You should also get your employer (if you work as a programmer) or school,
-if any, to sign a "copyright disclaimer" for the program, if necessary.
-For more information on this, and how to apply and follow the GNU GPL, see
-.
-
- The GNU General Public License does not permit incorporating your program
-into proprietary programs. If your program is a subroutine library, you
-may consider it more useful to permit linking proprietary applications with
-the library. If this is what you want to do, use the GNU Lesser General
-Public License instead of this License. But first, please read
-.
\ No newline at end of file
diff --git a/vendor/freemius/wordpress-sdk/README.md b/vendor/freemius/wordpress-sdk/README.md
deleted file mode 100644
index 8260aff18..000000000
--- a/vendor/freemius/wordpress-sdk/README.md
+++ /dev/null
@@ -1,282 +0,0 @@
-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
-get_upgrade_url(); ?>
-```
-
-Or when calling Freemius multiple times in a scope, it's recommended to use it with the global variable:
-
-```php
-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
-is_not_paying() ) {
- echo '
';
- echo '' .
- esc_html__('Upgrade Now!', 'my-plugin-slug') .
- '';
- echo '';
- }
-?>
-```
-
-Add logic which will only be available in your premium plugin version:
-
-```php
-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
-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
-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
-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
-is_plan__premium_only('professional') ) {
- // ... logic related to Professional plan and higher plans ...
- }
-?>
-```
-
-Add logic only for users in trial:
-
-```php
-is_trial() ) {
- // ... logic for users in trial ...
- }
-?>
-```
-
-Add logic for specified paid plan:
-
-```php
-is__premium_only() ) {
- if ( my_prefix_fs()->is_plan( 'professional', true ) ) {
-
- // ... logic related to Professional plan only ...
-
- } else if ( my_prefix_fs()->is_plan( 'business' ) ) {
-
- // ... logic related to Business plan and higher plans ...
-
- }
- }
-?>
-```
-
-## Excluding files and folders from the free plugin version
-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.
-
-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.
-2. Add `@fs_premium_only` a special meta tag to the plugin's main PHP file header. Example:
-```php
-
-```
-In the example plugin header above, the file `/lib/functions.php` and the directory `/premium-files/` will be removed from the free plugin version.
-
-# WordPress.org Compliance
-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:
-> 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.
-
-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.
-
-## Deployment
-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*.
-The plugin/theme will automatically be scanned and processed by a custom-developed *PHP Processor* which will auto-generate two versions of your plugin:
-
-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.
-2. **Free version**: The code stripped from all your paid features (based on the logic added wrapped in `{ method }__premium_only()`).
-
-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.
-
-## License
-Copyright (c) Freemius®, Inc.
-
-Licensed under the GNU general public license (version 3).
diff --git a/vendor/freemius/wordpress-sdk/assets/css/admin/account.css b/vendor/freemius/wordpress-sdk/assets/css/admin/account.css
deleted file mode 100644
index 5582a0a88..000000000
--- a/vendor/freemius/wordpress-sdk/assets/css/admin/account.css
+++ /dev/null
@@ -1 +0,0 @@
-label.fs-tag,span.fs-tag{background:#ffba00;color:#fff;display:inline-block;border-radius:3px;padding:5px;font-size:11px;line-height:11px;vertical-align:baseline}label.fs-tag.fs-warn,span.fs-tag.fs-warn{background:#ffba00}label.fs-tag.fs-info,span.fs-tag.fs-info{background:#00a0d2}label.fs-tag.fs-success,span.fs-tag.fs-success{background:#46b450}label.fs-tag.fs-error,span.fs-tag.fs-error{background:#dc3232}.fs-notice[data-id="license_not_whitelabeled"].success,.fs-notice[data-id="license_whitelabeled"].success{color:inherit;border-left-color:#00a0d2}.fs-notice[data-id="license_not_whitelabeled"].success label.fs-plugin-title,.fs-notice[data-id="license_whitelabeled"].success label.fs-plugin-title{display:none}#fs_account .postbox,#fs_account .widefat{max-width:800px}#fs_account h3{font-size:1.3em;padding:12px 15px;margin:0 0 12px 0;line-height:1.4;border-bottom:1px solid #F1F1F1}#fs_account h3 .dashicons{width:26px;height:26px;font-size:1.3em}#fs_account i.dashicons{font-size:1.2em;height:1.2em;width:1.2em}#fs_account .dashicons{vertical-align:middle}#fs_account .fs-header-actions{position:absolute;top:17px;right:15px;font-size:0.9em}#fs_account .fs-header-actions ul{margin:0}#fs_account .fs-header-actions li{float:left}#fs_account .fs-header-actions li form{display:inline-block}#fs_account .fs-header-actions li a{text-decoration:none}#fs_account_details .button-group{float:right}.rtl #fs_account .fs-header-actions{left:15px;right:auto}.fs-key-value-table{width:100%}.fs-key-value-table form{display:inline-block}.fs-key-value-table tr td:first-child{text-align:right}.fs-key-value-table tr td:first-child nobr{font-weight:bold}.fs-key-value-table tr td:first-child form{display:block}.fs-key-value-table tr td.fs-right{text-align:right}.fs-key-value-table tr.fs-odd{background:#ebebeb}.fs-key-value-table td,.fs-key-value-table th{padding:10px}.fs-key-value-table code{line-height:28px}.fs-key-value-table var,.fs-key-value-table code,.fs-key-value-table input[type="text"]{color:#0073AA;font-size:16px;background:none}.fs-key-value-table input[type="text"]{width:100%;font-weight:bold}.fs-field-beta_program label{margin-left:7px}label.fs-tag{background:#ffba00;color:#fff;display:inline-block;border-radius:3px;padding:5px;font-size:11px;line-height:11px;vertical-align:baseline}label.fs-tag.fs-warn{background:#ffba00}label.fs-tag.fs-success{background:#46b450}label.fs-tag.fs-error{background:#dc3232}#fs_sites .fs-scrollable-table .fs-table-body{max-height:200px;overflow:auto;border:1px solid #e5e5e5}#fs_sites .fs-scrollable-table .fs-table-body>table.widefat{border:none !important}#fs_sites .fs-scrollable-table .fs-main-column{width:100%}#fs_sites .fs-scrollable-table .fs-site-details td:first-of-type{text-align:right;color:grey;width:1px}#fs_sites .fs-scrollable-table .fs-site-details td:last-of-type{text-align:right}#fs_sites .fs-scrollable-table .fs-install-details table tr td{width:1px;white-space:nowrap}#fs_sites .fs-scrollable-table .fs-install-details table tr td:last-of-type{width:auto}#fs_addons h3{border:none;margin-bottom:0;padding:4px 5px}#fs_addons td{vertical-align:middle}#fs_addons thead{white-space:nowrap}#fs_addons td:first-child,#fs_addons th:first-child{text-align:left;font-weight:bold}#fs_addons td:last-child,#fs_addons th:last-child{text-align:right}#fs_addons th{font-weight:bold}#fs_billing_address{width:100%}#fs_billing_address tr td{width:50%;padding:5px}#fs_billing_address tr:first-of-type td{padding-top:0}#fs_billing_address span{font-weight:bold}#fs_billing_address input,#fs_billing_address select{display:block;width:100%;margin-top:5px}#fs_billing_address input::-moz-placeholder,#fs_billing_address select::-moz-placeholder{color:transparent;opacity:1}#fs_billing_address input:-ms-input-placeholder,#fs_billing_address select:-ms-input-placeholder{color:transparent}#fs_billing_address input::-webkit-input-placeholder,#fs_billing_address select::-webkit-input-placeholder{color:transparent}#fs_billing_address input.fs-read-mode,#fs_billing_address select.fs-read-mode{border-color:transparent;color:#777;border-bottom:1px dashed #ccc;padding-left:0;background:none}#fs_billing_address.fs-read-mode td span{display:none}#fs_billing_address.fs-read-mode input,#fs_billing_address.fs-read-mode select{border-color:transparent;color:#777;border-bottom:1px dashed #ccc;padding-left:0;background:none}#fs_billing_address.fs-read-mode input::-moz-placeholder,#fs_billing_address.fs-read-mode select::-moz-placeholder{color:#ccc;opacity:1}#fs_billing_address.fs-read-mode input:-ms-input-placeholder,#fs_billing_address.fs-read-mode select:-ms-input-placeholder{color:#ccc}#fs_billing_address.fs-read-mode input::-webkit-input-placeholder,#fs_billing_address.fs-read-mode select::-webkit-input-placeholder{color:#ccc}#fs_billing_address button{display:block;width:100%}
diff --git a/vendor/freemius/wordpress-sdk/assets/css/admin/add-ons.css b/vendor/freemius/wordpress-sdk/assets/css/admin/add-ons.css
deleted file mode 100644
index d2391c6f4..000000000
--- a/vendor/freemius/wordpress-sdk/assets/css/admin/add-ons.css
+++ /dev/null
@@ -1,2 +0,0 @@
-.fs-badge{position:absolute;top:10px;right:0;background:#71ae00;color:white;text-transform:uppercase;padding:5px 10px;-moz-border-radius:3px 0 0 3px;-webkit-border-radius:3px 0 0 3px;border-radius:3px 0 0 3px;font-weight:bold;border-right:0;-moz-box-shadow:0 2px 1px -1px rgba(0,0,0,0.3);-webkit-box-shadow:0 2px 1px -1px rgba(0,0,0,0.3);box-shadow:0 2px 1px -1px rgba(0,0,0,0.3)}#fs_addons .fs-cards-list{list-style:none}#fs_addons .fs-cards-list .fs-card{float:left;height:152px;width:310px;padding:0;margin:0 0 30px 30px;font-size:14px;list-style:none;border:1px solid #ddd;cursor:pointer;position:relative}#fs_addons .fs-cards-list .fs-card .fs-overlay{position:absolute;left:0;right:0;bottom:0;top:0;z-index:9}#fs_addons .fs-cards-list .fs-card .fs-inner{background-color:#fff;overflow:hidden;height:100%;position:relative}#fs_addons .fs-cards-list .fs-card .fs-inner>ul{-moz-transition:all,0.15s;-o-transition:all,0.15s;-ms-transition:all,0.15s;-webkit-transition:all,0.15s;transition:all,0.15s;left:0;right:0;top:0;position:absolute}#fs_addons .fs-cards-list .fs-card .fs-inner>ul>li{list-style:none;line-height:18px;padding:0 15px;width:100%;display:block;-moz-box-sizing:border-box;-webkit-box-sizing:border-box;box-sizing:border-box}#fs_addons .fs-cards-list .fs-card .fs-inner .fs-card-banner{padding:0;margin:0;line-height:0;display:block;height:100px;background-repeat:repeat-x;background-size:100% 100%;-moz-transition:all,0.15s;-o-transition:all,0.15s;-ms-transition:all,0.15s;-webkit-transition:all,0.15s;transition:all,0.15s}#fs_addons .fs-cards-list .fs-card .fs-inner .fs-card-banner .fs-badge.fs-installed-addon-badge{font-size:1.02em;line-height:1.3em}#fs_addons .fs-cards-list .fs-card .fs-inner .fs-title{margin:10px 0 0 0;height:18px;overflow:hidden;color:#000;white-space:nowrap;text-overflow:ellipsis;font-weight:bold}#fs_addons .fs-cards-list .fs-card .fs-inner .fs-offer{font-size:0.9em}#fs_addons .fs-cards-list .fs-card .fs-inner .fs-description{background-color:#f9f9f9;padding:10px 15px 100px 15px;border-top:1px solid #eee;margin:0 0 10px 0;color:#777}#fs_addons .fs-cards-list .fs-card .fs-inner .fs-tag{position:absolute;top:10px;right:0px;background:greenyellow;display:block;padding:2px 10px;-moz-box-shadow:1px 1px 1px rgba(0,0,0,0.3);-webkit-box-shadow:1px 1px 1px rgba(0,0,0,0.3);box-shadow:1px 1px 1px rgba(0,0,0,0.3);text-transform:uppercase;font-size:0.9em;font-weight:bold}#fs_addons .fs-cards-list .fs-card .fs-inner .fs-cta .button,#fs_addons .fs-cards-list .fs-card .fs-inner .fs-cta .button-group{position:absolute;top:112px;right:10px}@media screen and (min-width: 960px){#fs_addons .fs-cards-list .fs-card:hover .fs-overlay{border:2px solid #29abe1;margin-left:-1px;margin-top:-1px}#fs_addons .fs-cards-list .fs-card:hover .fs-inner ul{top:-100px}#fs_addons .fs-cards-list .fs-card:hover .fs-inner .fs-title,#fs_addons .fs-cards-list .fs-card:hover .fs-inner .fs-offer{color:#29abe1}}
-#TB_window,#TB_window iframe{width:821px !important}#plugin-information .fyi{width:266px !important}#plugin-information #section-holder{margin-right:299px}#plugin-information #section-description h2,#plugin-information #section-description h3,#plugin-information #section-description p,#plugin-information #section-description b,#plugin-information #section-description i,#plugin-information #section-description blockquote,#plugin-information #section-description li,#plugin-information #section-description ul,#plugin-information #section-description ol{clear:none}#plugin-information #section-description iframe{max-width:100%}#plugin-information #section-description .fs-selling-points{padding-bottom:10px;border-bottom:1px solid #ddd}#plugin-information #section-description .fs-selling-points ul{margin:0}#plugin-information #section-description .fs-selling-points ul li{padding:0;list-style:none outside none}#plugin-information #section-description .fs-selling-points ul li i.dashicons{color:#71ae00;font-size:3em;vertical-align:middle;line-height:30px;float:left;margin:0 0 0 -15px}#plugin-information #section-description .fs-selling-points ul li h3{margin:1em 30px !important}#plugin-information #section-description .fs-screenshots:after{content:"";display:table;clear:both}#plugin-information #section-description .fs-screenshots ul{list-style:none;margin:0}#plugin-information #section-description .fs-screenshots ul li{width:225px;height:225px;float:left;margin-bottom:20px;-moz-box-sizing:content-box;-webkit-box-sizing:content-box;box-sizing:content-box}#plugin-information #section-description .fs-screenshots ul li a{display:block;width:100%;height:100%;border:1px solid;-moz-box-shadow:1px 1px 1px rgba(0,0,0,0.2);-webkit-box-shadow:1px 1px 1px rgba(0,0,0,0.2);box-shadow:1px 1px 1px rgba(0,0,0,0.2);background-size:cover}#plugin-information #section-description .fs-screenshots ul li.odd{margin-right:20px}#plugin-information .plugin-information-pricing{margin:-16px;border-bottom:1px solid #ddd}#plugin-information .plugin-information-pricing .fs-plan h3{margin-top:0;padding:20px;font-size:16px}#plugin-information .plugin-information-pricing .fs-plan .nav-tab-wrapper{border-bottom:1px solid #ddd}#plugin-information .plugin-information-pricing .fs-plan .nav-tab-wrapper .nav-tab{cursor:pointer;position:relative;padding:0 10px;font-size:0.9em}#plugin-information .plugin-information-pricing .fs-plan .nav-tab-wrapper .nav-tab label{text-transform:uppercase;color:green;background:greenyellow;position:absolute;left:-1px;right:-1px;bottom:100%;border:1px solid darkgreen;padding:2px;text-align:center;font-size:0.9em;line-height:1em}#plugin-information .plugin-information-pricing .fs-plan .nav-tab-wrapper .nav-tab.nav-tab-active{cursor:default;background:#fffeec;border-bottom-color:#fffeec}#plugin-information .plugin-information-pricing .fs-plan.fs-single-cycle h3{background:#fffeec;margin:0;padding-bottom:0;color:#0073aa}#plugin-information .plugin-information-pricing .fs-plan.fs-single-cycle .nav-tab-wrapper,#plugin-information .plugin-information-pricing .fs-plan.fs-single-cycle .fs-billing-frequency{display:none}#plugin-information .plugin-information-pricing .fs-plan .fs-pricing-body{background:#fffeec;padding:20px}#plugin-information .plugin-information-pricing .fs-plan .button{width:100%;text-align:center;font-weight:bold;text-transform:uppercase;font-size:1.1em}#plugin-information .plugin-information-pricing .fs-plan label{white-space:nowrap}#plugin-information .plugin-information-pricing .fs-plan var{font-style:normal}#plugin-information .plugin-information-pricing .fs-plan .fs-billing-frequency,#plugin-information .plugin-information-pricing .fs-plan .fs-annual-discount{text-align:center;display:block;font-weight:bold;margin-bottom:10px;text-transform:uppercase;background:#F3F3F3;padding:2px;border:1px solid #ccc}#plugin-information .plugin-information-pricing .fs-plan .fs-annual-discount{text-transform:none;color:green;background:greenyellow}#plugin-information .plugin-information-pricing .fs-plan ul.fs-trial-terms{font-size:0.9em}#plugin-information .plugin-information-pricing .fs-plan ul.fs-trial-terms i{float:left;margin:0 0 0 -15px}#plugin-information .plugin-information-pricing .fs-plan ul.fs-trial-terms li{margin:10px 0 0 0}#plugin-information #section-features .fs-features{margin:-20px -26px}#plugin-information #section-features table{width:100%;border-spacing:0;border-collapse:separate}#plugin-information #section-features table thead th{padding:10px 0}#plugin-information #section-features table thead .fs-price{color:#71ae00;font-weight:normal;display:block;text-align:center}#plugin-information #section-features table tbody td{border-top:1px solid #ccc;padding:10px 0;text-align:center;width:100px;color:#71ae00}#plugin-information #section-features table tbody td:first-child{text-align:left;width:auto;color:inherit;padding-left:26px}#plugin-information #section-features table tbody tr.fs-odd td{background:#fefefe}#plugin-information #section-features .dashicons-yes{width:30px;height:30px;font-size:30px}#fs_addons .fs-cards-list .fs-card .fs-inner .fs-dropdown .button-group .button,#plugin-information .fs-dropdown .button-group .button{position:relative;width:auto;top:0;right:0}#fs_addons .fs-cards-list .fs-card .fs-inner .fs-dropdown .button-group .button:focus,#plugin-information .fs-dropdown .button-group .button:focus{z-index:10}#fs_addons .fs-cards-list .fs-card .fs-inner .fs-dropdown .button-group .fs-dropdown-arrow,#plugin-information .fs-dropdown .button-group .fs-dropdown-arrow{border-top:6px solid white;border-right:4px solid transparent;border-left:4px solid transparent;top:12px;position:relative}#fs_addons .fs-cards-list .fs-card .fs-inner .fs-dropdown.active:not(.up) .button:not(.fs-dropdown-arrow-button),#plugin-information .fs-dropdown.active:not(.up) .button:not(.fs-dropdown-arrow-button){border-bottom-left-radius:0}#fs_addons .fs-cards-list .fs-card .fs-inner .fs-dropdown.active:not(.up) .fs-dropdown-arrow-button,#plugin-information .fs-dropdown.active:not(.up) .fs-dropdown-arrow-button{border-bottom-right-radius:0}#fs_addons .fs-cards-list .fs-card .fs-inner .fs-dropdown.active.up .button:not(.fs-dropdown-arrow-button),#plugin-information .fs-dropdown.active.up .button:not(.fs-dropdown-arrow-button){border-top-left-radius:0}#fs_addons .fs-cards-list .fs-card .fs-inner .fs-dropdown.active.up .fs-dropdown-arrow-button,#plugin-information .fs-dropdown.active.up .fs-dropdown-arrow-button{border-top-right-radius:0}#fs_addons .fs-cards-list .fs-card .fs-inner .fs-dropdown .fs-dropdown-list,#plugin-information .fs-dropdown .fs-dropdown-list{position:absolute;right:-1px;top:100%;margin-left:auto;padding:3px 0;border:1px solid #bfbfbf;background-color:#fff;z-index:1;width:230px;text-align:left;-moz-box-shadow:0px 2px 4px -1px rgba(0,0,0,0.2),0px 4px 5px 0px rgba(0,0,0,0.14),0px 1px 10px 0px rgba(0,0,0,0.12);-webkit-box-shadow:0px 2px 4px -1px rgba(0,0,0,0.2),0px 4px 5px 0px rgba(0,0,0,0.14),0px 1px 10px 0px rgba(0,0,0,0.12);box-shadow:0px 2px 4px -1px rgba(0,0,0,0.2),0px 4px 5px 0px rgba(0,0,0,0.14),0px 1px 10px 0px rgba(0,0,0,0.12)}#fs_addons .fs-cards-list .fs-card .fs-inner .fs-dropdown .fs-dropdown-list li,#plugin-information .fs-dropdown .fs-dropdown-list li{margin:0}#fs_addons .fs-cards-list .fs-card .fs-inner .fs-dropdown .fs-dropdown-list li a,#plugin-information .fs-dropdown .fs-dropdown-list li a{display:block;padding:5px 10px;text-decoration:none;text-shadow:none}#fs_addons .fs-cards-list .fs-card .fs-inner .fs-dropdown .fs-dropdown-list li:hover,#plugin-information .fs-dropdown .fs-dropdown-list li:hover{background-color:#0074a3;color:#fff}#fs_addons .fs-cards-list .fs-card .fs-inner .fs-dropdown .fs-dropdown-list li:hover a,#plugin-information .fs-dropdown .fs-dropdown-list li:hover a{color:#fff}#fs_addons .fs-cards-list .fs-card .fs-inner .fs-dropdown:not(.up) .fs-dropdown-list,#plugin-information .fs-dropdown:not(.up) .fs-dropdown-list{-moz-border-radius:3px 0 3px 3px;-webkit-border-radius:3px 0 3px 3px;border-radius:3px 0 3px 3px}#fs_addons .fs-cards-list .fs-card .fs-inner .fs-dropdown.up .fs-dropdown-list,#plugin-information .fs-dropdown.up .fs-dropdown-list{-moz-border-radius:3px 3px 0 3px;-webkit-border-radius:3px 3px 0 3px;border-radius:3px 3px 0 3px}#plugin-information .fs-dropdown .button-group{width:100%}#plugin-information .fs-dropdown .button-group .button{float:none;font-size:14px;font-weight:normal;text-transform:none}#plugin-information .fs-dropdown .fs-dropdown-list{margin-top:1px}#plugin-information .fs-dropdown.up .fs-dropdown-list{top:auto;bottom:100%;margin-bottom:2px}#plugin-information.wp-core-ui .fs-pricing-body .fs-dropdown .button-group{text-align:center;display:table}#plugin-information.wp-core-ui .fs-pricing-body .fs-dropdown .button-group .button{display:table-cell}#plugin-information.wp-core-ui .fs-pricing-body .fs-dropdown .button-group .button:not(.fs-dropdown-arrow-button){left:1px;width:100%}#plugin-information-footer>.button,#plugin-information-footer .fs-dropdown{position:relative;top:3px}#plugin-information-footer>.button.left,#plugin-information-footer .fs-dropdown.left{float:left}#plugin-information-footer>.right,#plugin-information-footer .fs-dropdown{float:right}@media screen and (max-width: 961px){#fs_addons .fs-cards-list .fs-card{height:265px}}
diff --git a/vendor/freemius/wordpress-sdk/assets/css/admin/affiliation.css b/vendor/freemius/wordpress-sdk/assets/css/admin/affiliation.css
deleted file mode 100644
index 003ca3735..000000000
--- a/vendor/freemius/wordpress-sdk/assets/css/admin/affiliation.css
+++ /dev/null
@@ -1 +0,0 @@
-@charset "UTF-8";#fs_affiliation_content_wrapper #messages{margin-top:25px}#fs_affiliation_content_wrapper h3{font-size:24px;padding:0;margin-left:0}#fs_affiliation_content_wrapper ul li{-moz-box-sizing:border-box;-webkit-box-sizing:border-box;box-sizing:border-box;list-style-type:none}#fs_affiliation_content_wrapper ul li:before{content:'✓';margin-right:10px;font-weight:bold}#fs_affiliation_content_wrapper p:not(.description),#fs_affiliation_content_wrapper li,#fs_affiliation_content_wrapper label{font-size:16px !important;line-height:26px !important}#fs_affiliation_content_wrapper .button{margin-top:20px;margin-bottom:7px;line-height:35px;height:40px;font-size:16px}#fs_affiliation_content_wrapper .button#cancel_button{margin-right:5px}#fs_affiliation_content_wrapper form .input-container{margin-bottom:15px}#fs_affiliation_content_wrapper form .input-container .input-label{font-weight:bold;display:block;width:100%}#fs_affiliation_content_wrapper form .input-container.input-container-text label,#fs_affiliation_content_wrapper form .input-container.input-container-text input,#fs_affiliation_content_wrapper form .input-container.input-container-text textarea{display:block}#fs_affiliation_content_wrapper form .input-container #add_domain,#fs_affiliation_content_wrapper form .input-container .remove-domain{text-decoration:none;display:inline-block;margin-top:3px}#fs_affiliation_content_wrapper form .input-container #add_domain:focus,#fs_affiliation_content_wrapper form .input-container .remove-domain:focus{box-shadow:none}#fs_affiliation_content_wrapper form .input-container #add_domain.disabled,#fs_affiliation_content_wrapper form .input-container .remove-domain.disabled{color:#aaa;cursor:default}#fs_affiliation_content_wrapper form #extra_domains_container .description{margin-top:0;position:relative;top:-4px}#fs_affiliation_content_wrapper form #extra_domains_container .extra-domain-input-container{margin-bottom:15px}#fs_affiliation_content_wrapper form #extra_domains_container .extra-domain-input-container .domain{display:inline-block;margin-right:5px}#fs_affiliation_content_wrapper form #extra_domains_container .extra-domain-input-container .domain:last-of-type{margin-bottom:0}
diff --git a/vendor/freemius/wordpress-sdk/assets/css/admin/checkout.css b/vendor/freemius/wordpress-sdk/assets/css/admin/checkout.css
deleted file mode 100644
index 56515d274..000000000
--- a/vendor/freemius/wordpress-sdk/assets/css/admin/checkout.css
+++ /dev/null
@@ -1 +0,0 @@
-@media screen and (max-width: 782px){#wpbody-content{padding-bottom:0 !important}}
diff --git a/vendor/freemius/wordpress-sdk/assets/css/admin/common.css b/vendor/freemius/wordpress-sdk/assets/css/admin/common.css
deleted file mode 100644
index d96aa2f7f..000000000
--- a/vendor/freemius/wordpress-sdk/assets/css/admin/common.css
+++ /dev/null
@@ -1,2 +0,0 @@
-.fs-badge{position:absolute;top:10px;right:0;background:#71ae00;color:white;text-transform:uppercase;padding:5px 10px;-moz-border-radius:3px 0 0 3px;-webkit-border-radius:3px 0 0 3px;border-radius:3px 0 0 3px;font-weight:bold;border-right:0;-moz-box-shadow:0 2px 1px -1px rgba(0,0,0,0.3);-webkit-box-shadow:0 2px 1px -1px rgba(0,0,0,0.3);box-shadow:0 2px 1px -1px rgba(0,0,0,0.3)}.theme-browser .theme .fs-premium-theme-badge-container{position:absolute;right:0;top:0}.theme-browser .theme .fs-premium-theme-badge-container .fs-badge{position:relative;top:0;margin-top:10px;text-align:center}.theme-browser .theme .fs-premium-theme-badge-container .fs-badge.fs-premium-theme-badge{font-size:1.1em}.theme-browser .theme .fs-premium-theme-badge-container .fs-badge.fs-beta-theme-badge{background:#00a0d2}.fs-switch{position:relative;display:inline-block;color:#ccc;text-shadow:0 1px 1px rgba(255,255,255,0.8);height:18px;padding:6px 6px 5px 6px;border:1px solid #ccc;border:1px solid rgba(0,0,0,0.2);background:#ececec;box-shadow:0 0 4px rgba(0,0,0,0.1),inset 0 1px 3px 0 rgba(0,0,0,0.1);cursor:pointer}.fs-switch span{display:inline-block;width:35px;text-transform:uppercase}.fs-switch .fs-toggle{position:absolute;top:1px;width:37px;height:25px;border:1px solid #ccc;border:1px solid rgba(0,0,0,0.3);border-radius:4px;background:#fff;background-color:#fff;background-image:-webkit-gradient(linear, left top, left bottom, color-stop(0, #ececec), color-stop(1, #fff));background-image:-webkit-linear-gradient(top, #ececec, #fff);background-image:-moz-linear-gradient(top, #ececec, #fff);background-image:-ms-linear-gradient(top, #ececec, #fff);background-image:-o-linear-gradient(top, #ececec, #fff);background-image:linear-gradient(top, bottom, #ececec, #fff);box-shadow:inset 0 1px 0 0 rgba(255,255,255,0.5);z-index:999;-moz-transition:0.4s cubic-bezier(0.54, 1.6, 0.5, 1);-o-transition:0.4s cubic-bezier(0.54, 1.6, 0.5, 1);-ms-transition:0.4s cubic-bezier(0.54, 1.6, 0.5, 1);-webkit-transition:0.4s cubic-bezier(0.54, 1.6, 0.5, 1);transition:0.4s cubic-bezier(0.54, 1.6, 0.5, 1)}.fs-switch.fs-off .fs-toggle{left:2%}.fs-switch.fs-on .fs-toggle{left:54%}.fs-switch.fs-round{top:8px;padding:4px 25px;-moz-border-radius:24px;-webkit-border-radius:24px;border-radius:24px}.fs-switch.fs-round .fs-toggle{top:0;width:24px;height:24px;-moz-border-radius:24px;-webkit-border-radius:24px;border-radius:24px}.fs-switch.fs-round.fs-off .fs-toggle{left:-1px}.fs-switch.fs-round.fs-on{background:#0085ba}.fs-switch.fs-round.fs-on .fs-toggle{left:25px}.fs-switch.fs-small.fs-round{padding:1px 19px}.fs-switch.fs-small.fs-round .fs-toggle{top:0;width:18px;height:18px;-moz-border-radius:18px;-webkit-border-radius:18px;border-radius:18px}.fs-switch.fs-small.fs-round.fs-on .fs-toggle{left:19px}.fs-switch-feedback{margin-left:10px}.fs-switch-feedback.success{color:#71ae00}.rtl .fs-switch-feedback{margin-left:0;margin-right:10px}#fs_frame{line-height:0;font-size:0}.fs-full-size-wrapper{margin:40px 0 -65px -20px}@media (max-width: 600px){.fs-full-size-wrapper{margin:0 0 -65px -10px}}
-.fs-notice{position:relative}.fs-notice.fs-has-title{margin-bottom:30px !important}.fs-notice.success{color:green}.fs-notice.promotion{border-color:#00a0d2 !important;background-color:#f2fcff !important}.fs-notice .fs-notice-body{margin:.5em 0;padding:2px}.fs-notice .fs-close{cursor:pointer;color:#aaa;float:right}.fs-notice .fs-close:hover{color:#666}.fs-notice .fs-close>*{margin-top:7px;display:inline-block}.fs-notice label.fs-plugin-title{background:rgba(0,0,0,0.3);color:#fff;padding:2px 10px;position:absolute;top:100%;bottom:auto;right:auto;-moz-border-radius:0 0 3px 3px;-webkit-border-radius:0 0 3px 3px;border-radius:0 0 3px 3px;left:10px;font-size:12px;font-weight:bold;cursor:auto}div.fs-notice.updated,div.fs-notice.success,div.fs-notice.promotion{display:block !important}.rtl .fs-notice .fs-close{float:left}.fs-secure-notice{position:fixed;top:32px;left:160px;right:0;background:#ebfdeb;padding:10px 20px;color:green;z-index:9999;-moz-box-shadow:0 2px 2px rgba(6,113,6,0.3);-webkit-box-shadow:0 2px 2px rgba(6,113,6,0.3);box-shadow:0 2px 2px rgba(6,113,6,0.3);opacity:0.95;filter:alpha(opacity=95)}.fs-secure-notice:hover{opacity:1;filter:alpha(opacity=100)}.fs-secure-notice a.fs-security-proof{color:green;text-decoration:none}@media screen and (max-width: 960px){.fs-secure-notice{left:36px}}@media screen and (max-width: 600px){.fs-secure-notice{display:none}}@media screen and (max-width: 1250px){#fs_promo_tab{display:none}}@media screen and (max-width: 782px){.fs-secure-notice{left:0;top:46px;text-align:center}}span.fs-submenu-item.fs-sub:before{content:'\21B3';padding:0 5px}.rtl span.fs-submenu-item.fs-sub:before{content:'\21B2'}.fs-submenu-item.pricing.upgrade-mode{color:greenyellow}.fs-submenu-item.pricing.trial-mode{color:#83e2ff}#adminmenu .update-plugins.fs-trial{background-color:#00b9eb}.fs-ajax-spinner{border:0;width:20px;height:20px;margin-right:5px;vertical-align:sub;display:inline-block;background:url("/wp-admin/images/wpspin_light-2x.gif");background-size:contain;margin-bottom:-2px}.wrap.fs-section h2{text-align:left}.plugins p.fs-upgrade-notice{border:0;background-color:#d54e21;padding:10px;color:#f9f9f9;margin-top:10px}
diff --git a/vendor/freemius/wordpress-sdk/assets/css/admin/connect.css b/vendor/freemius/wordpress-sdk/assets/css/admin/connect.css
deleted file mode 100755
index dff7c49cf..000000000
--- a/vendor/freemius/wordpress-sdk/assets/css/admin/connect.css
+++ /dev/null
@@ -1 +0,0 @@
-#fs_connect{width:480px;-moz-box-shadow:0px 1px 2px rgba(0,0,0,0.3);-webkit-box-shadow:0px 1px 2px rgba(0,0,0,0.3);box-shadow:0px 1px 2px rgba(0,0,0,0.3);margin:20px 0}@media screen and (max-width: 479px){#fs_connect{-moz-box-shadow:none;-webkit-box-shadow:none;box-shadow:none;width:auto;margin:0 0 0 -10px}}#fs_connect .fs-content{background:#fff;padding:15px 20px}#fs_connect .fs-content .fs-error{background:snow;color:#d3135a;border:1px solid #d3135a;-moz-box-shadow:0 1px 1px 0 rgba(0,0,0,0.1);-webkit-box-shadow:0 1px 1px 0 rgba(0,0,0,0.1);box-shadow:0 1px 1px 0 rgba(0,0,0,0.1);text-align:center;padding:5px;margin-bottom:10px}#fs_connect .fs-content p{margin:0;padding:0;font-size:1.2em}#fs_connect .fs-license-key-container{position:relative;width:280px;margin:10px auto 0 auto}#fs_connect .fs-license-key-container input{width:100%}#fs_connect .fs-license-key-container .dashicons{position:absolute;top:5px;right:5px}#fs_connect.require-license-key .fs-sites-list-container td{cursor:pointer}#fs_connect #delegate_to_site_admins{margin-right:15px;float:right;height:26px;vertical-align:middle;line-height:37px;font-weight:bold;border-bottom:1px dashed;text-decoration:none}#fs_connect #delegate_to_site_admins.rtl{margin-left:15px;margin-right:0}#fs_connect .fs-actions{padding:10px 20px;background:#C0C7CA}#fs_connect .fs-actions .button{padding:0 10px 1px;line-height:35px;height:37px;font-size:16px;margin-bottom:0}#fs_connect .fs-actions .button .dashicons{font-size:37px;margin-left:-8px;margin-right:12px}#fs_connect .fs-actions .button.button-primary{padding-right:15px;padding-left:15px}#fs_connect .fs-actions .button.button-primary:after{content:' \279C'}#fs_connect .fs-actions .button.button-primary.fs-loading:after{content:''}#fs_connect .fs-actions .button.button-secondary{float:right}#fs_connect.fs-anonymous-disabled .fs-actions .button.button-primary{width:100%}#fs_connect .fs-permissions{padding:10px 20px;background:#FEFEFE;-moz-transition:background 0.5s ease;-o-transition:background 0.5s ease;-ms-transition:background 0.5s ease;-webkit-transition:background 0.5s ease;transition:background 0.5s ease}#fs_connect .fs-permissions .fs-license-sync-disclaimer{text-align:center;margin-top:0}#fs_connect .fs-permissions>.fs-trigger{font-size:0.9em;text-decoration:none;text-align:center;display:block}#fs_connect .fs-permissions ul{height:0;overflow:hidden;margin:0}#fs_connect .fs-permissions ul li{margin-bottom:12px}#fs_connect .fs-permissions ul li:last-child{margin-bottom:0}#fs_connect .fs-permissions ul li>i.dashicons{float:left;font-size:40px;width:40px;height:40px}#fs_connect .fs-permissions ul li .fs-switch{float:right}#fs_connect .fs-permissions ul li .fs-permission-description{margin-left:55px}#fs_connect .fs-permissions ul li .fs-permission-description span{font-weight:bold;text-transform:uppercase;color:#23282d}#fs_connect .fs-permissions ul li .fs-permission-description p{margin:2px 0 0 0}#fs_connect .fs-permissions.fs-open{background:#fff}#fs_connect .fs-permissions.fs-open ul{overflow:initial;height:auto;margin:20px 20px 10px 20px}@media screen and (max-width: 479px){#fs_connect .fs-permissions{background:#fff}#fs_connect .fs-permissions .fs-trigger{display:none}#fs_connect .fs-permissions ul{height:auto;margin:20px}}#fs_connect .fs-freemium-licensing{padding:8px;background:#777;color:#fff}#fs_connect .fs-freemium-licensing p{text-align:center;display:block;margin:0;padding:0}#fs_connect .fs-freemium-licensing a{color:#C2EEFF;text-decoration:underline}#fs_connect .fs-visual{padding:12px;line-height:0;background:#fafafa;height:80px;position:relative}#fs_connect .fs-visual .fs-site-icon{position:absolute;left:20px;top:10px}#fs_connect .fs-visual .fs-connect-logo{position:absolute;right:20px;top:10px}#fs_connect .fs-visual .fs-plugin-icon{position:absolute;top:10px;left:50%;margin-left:-40px}#fs_connect .fs-visual .fs-plugin-icon,#fs_connect .fs-visual .fs-site-icon,#fs_connect .fs-visual img,#fs_connect .fs-visual object{width:80px;height:80px}#fs_connect .fs-visual .dashicons-wordpress{font-size:64px;background:#01749a;color:#fff;width:64px;height:64px;padding:8px}#fs_connect .fs-visual .dashicons-plus{position:absolute;top:50%;font-size:30px;margin-top:-10px;color:#bbb}#fs_connect .fs-visual .dashicons-plus.fs-first{left:28%}#fs_connect .fs-visual .dashicons-plus.fs-second{left:65%}#fs_connect .fs-visual .fs-plugin-icon,#fs_connect .fs-visual .fs-connect-logo,#fs_connect .fs-visual .fs-site-icon{border:1px solid #ccc;padding:1px;background:#fff}#fs_connect .fs-terms{text-align:center;font-size:0.85em;padding:5px;background:rgba(0,0,0,0.05)}#fs_connect .fs-terms,#fs_connect .fs-terms a{color:#999}#fs_connect .fs-terms a{text-decoration:none}.fs-multisite-options-container{margin-top:10px;border:1px solid #ccc;padding:5px}.fs-multisite-options-container a{text-decoration:none}.fs-multisite-options-container a:focus{box-shadow:none}.fs-multisite-options-container a.selected{font-weight:bold}.fs-multisite-options-container.fs-apply-on-all-sites{border:0 none;padding:0}.fs-multisite-options-container.fs-apply-on-all-sites .fs-all-sites-options{border-spacing:0}.fs-multisite-options-container.fs-apply-on-all-sites .fs-all-sites-options td:not(:first-child){display:none}.fs-multisite-options-container .fs-sites-list-container{display:none;overflow:auto}.fs-multisite-options-container .fs-sites-list-container table td{border-top:1px solid #ccc;padding:4px 2px}.fs-tooltip-trigger{position:relative}.fs-tooltip-trigger:not(a){cursor:help}.fs-tooltip-trigger .fs-tooltip{opacity:0;visibility:hidden;-moz-transition:opacity 0.3s ease-in-out;-o-transition:opacity 0.3s ease-in-out;-ms-transition:opacity 0.3s ease-in-out;-webkit-transition:opacity 0.3s ease-in-out;transition:opacity 0.3s ease-in-out;position:absolute;background:rgba(0,0,0,0.8);color:#fff !important;font-family:'arial', serif;font-size:12px;padding:10px;z-index:999999;bottom:100%;margin-bottom:5px;left:-17px;right:0;-moz-border-radius:5px;-webkit-border-radius:5px;border-radius:5px;-moz-box-shadow:1px 1px 1px rgba(0,0,0,0.2);-webkit-box-shadow:1px 1px 1px rgba(0,0,0,0.2);box-shadow:1px 1px 1px rgba(0,0,0,0.2);line-height:1.3em;font-weight:bold;text-align:left;text-transform:none !important}.rtl .fs-tooltip-trigger .fs-tooltip{text-align:right;left:auto;right:-17px}.fs-tooltip-trigger .fs-tooltip::after{content:' ';display:block;width:0;height:0;border-style:solid;border-width:5px 5px 0 5px;border-color:rgba(0,0,0,0.8) transparent transparent transparent;position:absolute;top:100%;left:21px}.rtl .fs-tooltip-trigger .fs-tooltip::after{right:21px;left:auto}.fs-tooltip-trigger:hover .fs-tooltip{visibility:visible;opacity:1}#fs_marketing_optin{display:none;margin-top:10px;border:1px solid #ccc;padding:10px;line-height:1.5em}#fs_marketing_optin .fs-message{display:block;margin-bottom:5px;font-size:1.05em;font-weight:600}#fs_marketing_optin.error{border:1px solid #d3135a;background:#fee}#fs_marketing_optin.error .fs-message{color:#d3135a}#fs_marketing_optin .fs-input-container{margin-top:5px}#fs_marketing_optin .fs-input-container label{margin-top:5px;display:block}#fs_marketing_optin .fs-input-container label input{float:left;margin:1px 0 0 0}#fs_marketing_optin .fs-input-container label:first-child{display:block;margin-bottom:2px}#fs_marketing_optin .fs-input-label{display:block;margin-left:20px}#fs_marketing_optin .fs-input-label .underlined{text-decoration:underline}.rtl #fs_marketing_optin .fs-input-container label input{float:right}.rtl #fs_marketing_optin .fs-input-label{margin-left:0;margin-right:20px}.rtl #fs_connect .fs-actions{padding:10px 20px;background:#C0C7CA}.rtl #fs_connect .fs-actions .button .dashicons{font-size:37px;margin-left:-8px;margin-right:12px}.rtl #fs_connect .fs-actions .button.button-primary:after{content:' \000bb'}.rtl #fs_connect .fs-actions .button.button-primary.fs-loading:after{content:''}.rtl #fs_connect .fs-actions .button.button-secondary{float:left}.rtl #fs_connect .fs-permissions ul li .fs-permission-description{margin-right:55px;margin-left:0}.rtl #fs_connect .fs-permissions ul li .fs-switch{float:left}.rtl #fs_connect .fs-permissions ul li i.dashicons{float:right}.rtl #fs_connect .fs-visual .fs-site-icon{right:20px;left:auto}.rtl #fs_connect .fs-visual .fs-connect-logo{right:auto;left:20px}#fs_theme_connect_wrapper{position:fixed;top:0;height:100%;width:100%;z-index:99990;background:rgba(0,0,0,0.75);text-align:center;overflow-y:auto}#fs_theme_connect_wrapper:before{content:"";display:inline-block;vertical-align:middle;height:100%}#fs_theme_connect_wrapper>button.close{color:white;cursor:pointer;height:40px;width:40px;position:absolute;right:0;border:0;background-color:transparent;top:32px}#fs_theme_connect_wrapper #fs_connect{top:0;text-align:left;display:inline-block;vertical-align:middle;margin-top:52px;margin-bottom:20px}#fs_theme_connect_wrapper #fs_connect .fs-terms{background:rgba(140,140,140,0.64)}#fs_theme_connect_wrapper #fs_connect .fs-terms,#fs_theme_connect_wrapper #fs_connect .fs-terms a{color:#c5c5c5}.wp-pointer-content #fs_connect{margin:0;-moz-box-shadow:none;-webkit-box-shadow:none;box-shadow:none}.fs-opt-in-pointer .wp-pointer-content{padding:0}.fs-opt-in-pointer.wp-pointer-top .wp-pointer-arrow{border-bottom-color:#dfdfdf}.fs-opt-in-pointer.wp-pointer-top .wp-pointer-arrow-inner{border-bottom-color:#fafafa}.fs-opt-in-pointer.wp-pointer-bottom .wp-pointer-arrow{border-top-color:#dfdfdf}.fs-opt-in-pointer.wp-pointer-bottom .wp-pointer-arrow-inner{border-top-color:#fafafa}.fs-opt-in-pointer.wp-pointer-left .wp-pointer-arrow{border-right-color:#dfdfdf}.fs-opt-in-pointer.wp-pointer-left .wp-pointer-arrow-inner{border-right-color:#fafafa}.fs-opt-in-pointer.wp-pointer-right .wp-pointer-arrow{border-left-color:#dfdfdf}.fs-opt-in-pointer.wp-pointer-right .wp-pointer-arrow-inner{border-left-color:#fafafa}#license_issues_link{display:block;text-align:center;font-size:0.9em;margin-top:10px}
diff --git a/vendor/freemius/wordpress-sdk/assets/css/admin/debug.css b/vendor/freemius/wordpress-sdk/assets/css/admin/debug.css
deleted file mode 100644
index 4b30d843c..000000000
--- a/vendor/freemius/wordpress-sdk/assets/css/admin/debug.css
+++ /dev/null
@@ -1 +0,0 @@
-.fs-switch-label{font-size:20px;line-height:31px;margin:0 5px}#fs_log_book table{font-family:Consolas,Monaco,monospace;font-size:12px}#fs_log_book table th{color:#ccc}#fs_log_book table tr{background:#232525}#fs_log_book table tr.alternate{background:#2b2b2b}#fs_log_book table tr td.fs-col--logger{color:#5a7435}#fs_log_book table tr td.fs-col--type{color:#ffc861}#fs_log_book table tr td.fs-col--function{color:#a7b7b1;font-weight:bold}#fs_log_book table tr td.fs-col--message,#fs_log_book table tr td.fs-col--message a{color:#9a73ac !important}#fs_log_book table tr td.fs-col--file{color:#d07922}#fs_log_book table tr td.fs-col--timestamp{color:#6596be}
diff --git a/vendor/freemius/wordpress-sdk/assets/css/admin/dialog-boxes.css b/vendor/freemius/wordpress-sdk/assets/css/admin/dialog-boxes.css
deleted file mode 100644
index 434f346aa..000000000
--- a/vendor/freemius/wordpress-sdk/assets/css/admin/dialog-boxes.css
+++ /dev/null
@@ -1,2 +0,0 @@
-.fs-modal{position:fixed;overflow:auto;height:100%;width:100%;top:0;z-index:100000;display:none;background:rgba(0,0,0,0.6)}.fs-modal .dashicons{vertical-align:middle}.fs-modal .fs-modal-dialog{background:transparent;position:absolute;left:50%;margin-left:-298px;padding-bottom:30px;top:-100%;z-index:100001;width:596px}@media (max-width: 650px){.fs-modal .fs-modal-dialog{margin-left:-50%;box-sizing:border-box;padding-left:10px;padding-right:10px;width:100%}.fs-modal .fs-modal-dialog .fs-modal-panel>h3>strong{font-size:1.3em}}.fs-modal.active{display:block}.fs-modal.active:before{display:block}.fs-modal.active .fs-modal-dialog{top:10%}.fs-modal.fs-success .fs-modal-header{border-bottom-color:#46b450}.fs-modal.fs-success .fs-modal-body{background-color:#f7fff7}.fs-modal.fs-warn .fs-modal-header{border-bottom-color:#ffb900}.fs-modal.fs-warn .fs-modal-body{background-color:#fff8e5}.fs-modal.fs-error .fs-modal-header{border-bottom-color:#dc3232}.fs-modal.fs-error .fs-modal-body{background-color:#ffeaea}.fs-modal .fs-modal-body,.fs-modal .fs-modal-footer{border:0;background:#fefefe;padding:20px}.fs-modal .fs-modal-header{border-bottom:#eeeeee solid 1px;background:#fbfbfb;padding:15px 20px;position:relative;margin-bottom:-10px}.fs-modal .fs-modal-header h4{margin:0;padding:0;text-transform:uppercase;font-size:1.2em;font-weight:bold;color:#cacaca;text-shadow:1px 1px 1px #fff;letter-spacing:0.6px;-webkit-font-smoothing:antialiased}.fs-modal .fs-modal-header .fs-close{position:absolute;right:10px;top:12px;cursor:pointer;color:#bbb;-moz-border-radius:20px;-webkit-border-radius:20px;border-radius:20px;padding:3px;-moz-transition:all 0.2s ease-in-out;-o-transition:all 0.2s ease-in-out;-ms-transition:all 0.2s ease-in-out;-webkit-transition:all 0.2s ease-in-out;transition:all 0.2s ease-in-out}.fs-modal .fs-modal-header .fs-close:hover{color:#fff;background:#aaa}.fs-modal .fs-modal-header .fs-close .dashicons,.fs-modal .fs-modal-header .fs-close:hover .dashicons{text-decoration:none}.fs-modal .fs-modal-body{border-bottom:0}.fs-modal .fs-modal-body p{font-size:14px}.fs-modal .fs-modal-body h2{font-size:20px;line-height:1.5em}.fs-modal .fs-modal-body>div{margin-top:10px}.fs-modal .fs-modal-body>div h2{font-weight:bold;font-size:20px;margin-top:0}.fs-modal .fs-modal-footer{border-top:#eeeeee solid 1px;text-align:right}.fs-modal .fs-modal-footer>.button{margin:0 7px}.fs-modal .fs-modal-footer>.button:first-child{margin:0}.fs-modal .fs-modal-panel>.notice.inline{margin:0;display:none}.fs-modal .fs-modal-panel:not(.active){display:none}.rtl .fs-modal .fs-modal-header .fs-close{right:auto;left:20px}body.has-fs-modal{overflow:hidden}.fs-modal.fs-modal-deactivation-feedback .reason-input,.fs-modal.fs-modal-deactivation-feedback .internal-message{margin:3px 0 3px 22px}.fs-modal.fs-modal-deactivation-feedback .reason-input input,.fs-modal.fs-modal-deactivation-feedback .reason-input textarea,.fs-modal.fs-modal-deactivation-feedback .internal-message input,.fs-modal.fs-modal-deactivation-feedback .internal-message textarea{width:100%}.fs-modal.fs-modal-deactivation-feedback li.reason.has-internal-message .internal-message{border:1px solid #ccc;padding:7px;display:none}@media (max-width: 650px){.fs-modal.fs-modal-deactivation-feedback li.reason li.reason{margin-bottom:10px}.fs-modal.fs-modal-deactivation-feedback li.reason li.reason .reason-input,.fs-modal.fs-modal-deactivation-feedback li.reason li.reason .internal-message{margin-left:29px}.fs-modal.fs-modal-deactivation-feedback li.reason li.reason label{display:table}.fs-modal.fs-modal-deactivation-feedback li.reason li.reason label>span{display:table-cell;font-size:1.3em}}.fs-modal.fs-modal-deactivation-feedback .anonymous-feedback-label{float:left}.fs-modal.fs-modal-deactivation-feedback .fs-modal-panel{margin-top:0 !important}.fs-modal.fs-modal-deactivation-feedback .fs-modal-panel h3{margin-top:0;line-height:1.5em}#the-list .deactivate>.fs-slug{display:none}.fs-modal.fs-modal-subscription-cancellation .fs-price-increase-warning{color:red;font-weight:bold;padding:0 25px;margin-bottom:0}.fs-modal.fs-modal-subscription-cancellation ul.subscription-actions label input{float:left;top:5px;position:relative}.rtl .fs-modal.fs-modal-subscription-cancellation ul.subscription-actions label input{float:right}.fs-modal.fs-modal-subscription-cancellation ul.subscription-actions label span{display:block;margin-left:24px}.rtl .fs-modal.fs-modal-subscription-cancellation ul.subscription-actions label span{margin-left:0;margin-right:24px}.fs-modal.fs-modal-license-activation .fs-modal-body input.fs-license-key{width:100%}.fs-license-options-container table,.fs-license-options-container table select,.fs-license-options-container table .fs-available-license-key{width:100%}.fs-license-options-container table td:first-child{width:1%}.fs-license-options-container table .fs-other-license-key-container label{position:relative;top:6px;float:left;margin-right:5px}.fs-license-options-container table .fs-other-license-key-container div{overflow:hidden;width:auto;height:30px;display:block;top:2px;position:relative}.fs-license-options-container table .fs-other-license-key-container div input{margin:0}.fs-sites-list-container td{cursor:pointer}.fs-modal.fs-modal-user-change .fs-modal-body input#fs_other_email_address{width:100%}.fs-user-change-options-container table{width:100%;border-collapse:collapse}.fs-user-change-options-container table tr{display:block;margin-bottom:2px}.fs-user-change-options-container table .fs-email-address-container td{display:inline-block}.fs-user-change-options-container table .fs-email-address-container input[type="radio"]{margin-bottom:0;margin-top:0}.fs-user-change-options-container table .fs-other-email-address-container{width:100%}.fs-user-change-options-container table .fs-other-email-address-container>div{display:table;width:100%}.fs-user-change-options-container table .fs-other-email-address-container>div label,.fs-user-change-options-container table .fs-other-email-address-container>div>div{display:table-cell}.fs-user-change-options-container table .fs-other-email-address-container>div label{width:1%;padding-left:3px;padding-right:3px}.fs-user-change-options-container table .fs-other-email-address-container>div>div{width:auto}.fs-user-change-options-container table .fs-other-email-address-container>div>div input{width:100%}.fs-modal.fs-modal-developer-license-debug-mode .fs-modal-body input.fs-license-or-user-key{width:100%}.fs-multisite-options-container{margin-top:10px;border:1px solid #ccc;padding:5px}.fs-multisite-options-container a{text-decoration:none}.fs-multisite-options-container a:focus{box-shadow:none}.fs-multisite-options-container a.selected{font-weight:bold}.fs-multisite-options-container.fs-apply-on-all-sites{border:0 none;padding:0}.fs-multisite-options-container.fs-apply-on-all-sites .fs-all-sites-options{border-spacing:0}.fs-multisite-options-container.fs-apply-on-all-sites .fs-all-sites-options td:not(:first-child){display:none}.fs-multisite-options-container .fs-sites-list-container{display:none;overflow:auto}.fs-multisite-options-container .fs-sites-list-container table td{border-top:1px solid #ccc;padding:4px 2px}.fs-modal.fs-modal-license-key-resend .email-address-container{overflow:hidden;padding-right:2px}.fs-modal.fs-modal-license-key-resend.fs-freemium input.email-address{width:300px}.fs-modal.fs-modal-license-key-resend.fs-freemium label{display:block;margin-bottom:10px}.fs-modal.fs-modal-license-key-resend.fs-premium input.email-address{width:100%}.fs-modal.fs-modal-license-key-resend.fs-premium .button-container{float:right;margin-left:7px}@media (max-width: 650px){.fs-modal.fs-modal-license-key-resend.fs-premium .button-container{margin-top:2px}}
-.rtl .fs-modal.fs-modal-license-key-resend .fs-modal-body .input-container>.email-address-container{padding-left:2px;padding-right:0}.rtl .fs-modal.fs-modal-license-key-resend .fs-modal-body .button-container{float:left;margin-right:7px;margin-left:0}a.show-license-resend-modal{margin-top:4px;display:inline-block}.fs-ajax-loader{position:relative;width:170px;height:20px;margin:auto}.fs-ajax-loader .fs-ajax-loader-bar{position:absolute;top:0;background-color:#0074a3;width:20px;height:20px;-webkit-animation-name:bounce_ajaxLoader;-moz-animation-name:bounce_ajaxLoader;-ms-animation-name:bounce_ajaxLoader;-o-animation-name:bounce_ajaxLoader;animation-name:bounce_ajaxLoader;-webkit-animation-duration:1.5s;-moz-animation-duration:1.5s;-ms-animation-duration:1.5s;-o-animation-duration:1.5s;animation-duration:1.5s;animation-iteration-count:infinite;-o-animation-iteration-count:infinite;-ms-animation-iteration-count:infinite;-webkit-animation-iteration-count:infinite;-moz-animation-iteration-count:infinite;-webkit-animation-direction:normal;-moz-animation-direction:normal;-ms-animation-direction:normal;-o-animation-direction:normal;animation-direction:normal;-moz-transform:0.3;-o-transform:0.3;-ms-transform:0.3;-webkit-transform:0.3;transform:0.3}.fs-ajax-loader .fs-ajax-loader-bar-1{left:0px;animation-delay:0.6s;-o-animation-delay:0.6s;-ms-animation-delay:0.6s;-webkit-animation-delay:0.6s;-moz-animation-delay:0.6s}.fs-ajax-loader .fs-ajax-loader-bar-2{left:19px;animation-delay:0.75s;-o-animation-delay:0.75s;-ms-animation-delay:0.75s;-webkit-animation-delay:0.75s;-moz-animation-delay:0.75s}.fs-ajax-loader .fs-ajax-loader-bar-3{left:38px;animation-delay:0.9s;-o-animation-delay:0.9s;-ms-animation-delay:0.9s;-webkit-animation-delay:0.9s;-moz-animation-delay:0.9s}.fs-ajax-loader .fs-ajax-loader-bar-4{left:57px;animation-delay:1.05s;-o-animation-delay:1.05s;-ms-animation-delay:1.05s;-webkit-animation-delay:1.05s;-moz-animation-delay:1.05s}.fs-ajax-loader .fs-ajax-loader-bar-5{left:76px;animation-delay:1.2s;-o-animation-delay:1.2s;-ms-animation-delay:1.2s;-webkit-animation-delay:1.2s;-moz-animation-delay:1.2s}.fs-ajax-loader .fs-ajax-loader-bar-6{left:95px;animation-delay:1.35s;-o-animation-delay:1.35s;-ms-animation-delay:1.35s;-webkit-animation-delay:1.35s;-moz-animation-delay:1.35s}.fs-ajax-loader .fs-ajax-loader-bar-7{left:114px;animation-delay:1.5s;-o-animation-delay:1.5s;-ms-animation-delay:1.5s;-webkit-animation-delay:1.5s;-moz-animation-delay:1.5s}.fs-ajax-loader .fs-ajax-loader-bar-8{left:133px;animation-delay:1.65s;-o-animation-delay:1.65s;-ms-animation-delay:1.65s;-webkit-animation-delay:1.65s;-moz-animation-delay:1.65s}@-moz-keyframes bounce_ajaxLoader{0%{-moz-transform:scale(1);-o-transform:scale(1);-ms-transform:scale(1);-webkit-transform:scale(1);transform:scale(1);background-color:#0074a3}100%{-moz-transform:scale(0.3);-o-transform:scale(0.3);-ms-transform:scale(0.3);-webkit-transform:scale(0.3);transform:scale(0.3);background-color:#fff}}@-ms-keyframes bounce_ajaxLoader{0%{-moz-transform:scale(1);-o-transform:scale(1);-ms-transform:scale(1);-webkit-transform:scale(1);transform:scale(1);background-color:#0074a3}100%{-moz-transform:scale(0.3);-o-transform:scale(0.3);-ms-transform:scale(0.3);-webkit-transform:scale(0.3);transform:scale(0.3);background-color:#fff}}@-o-keyframes bounce_ajaxLoader{0%{-moz-transform:scale(1);-o-transform:scale(1);-ms-transform:scale(1);-webkit-transform:scale(1);transform:scale(1);background-color:#0074a3}100%{-moz-transform:scale(0.3);-o-transform:scale(0.3);-ms-transform:scale(0.3);-webkit-transform:scale(0.3);transform:scale(0.3);background-color:#fff}}@-webkit-keyframes bounce_ajaxLoader{0%{-moz-transform:scale(1);-o-transform:scale(1);-ms-transform:scale(1);-webkit-transform:scale(1);transform:scale(1);background-color:#0074a3}100%{-moz-transform:scale(0.3);-o-transform:scale(0.3);-ms-transform:scale(0.3);-webkit-transform:scale(0.3);transform:scale(0.3);background-color:#fff}}@keyframes bounce_ajaxLoader{0%{-moz-transform:scale(1);-o-transform:scale(1);-ms-transform:scale(1);-webkit-transform:scale(1);transform:scale(1);background-color:#0074a3}100%{-moz-transform:scale(0.3);-o-transform:scale(0.3);-ms-transform:scale(0.3);-webkit-transform:scale(0.3);transform:scale(0.3);background-color:#fff}}.fs-modal-auto-install #request-filesystem-credentials-form h2,.fs-modal-auto-install #request-filesystem-credentials-form .request-filesystem-credentials-action-buttons{display:none}.fs-modal-auto-install #request-filesystem-credentials-form input[type=password],.fs-modal-auto-install #request-filesystem-credentials-form input[type=email],.fs-modal-auto-install #request-filesystem-credentials-form input[type=text]{-webkit-appearance:none;padding:10px 10px 5px 10px;width:300px;max-width:100%}.fs-modal-auto-install #request-filesystem-credentials-form>div,.fs-modal-auto-install #request-filesystem-credentials-form label,.fs-modal-auto-install #request-filesystem-credentials-form fieldset{width:300px;max-width:100%;margin:0 auto;display:block}.button-primary.warn{box-shadow:0 1px 0 #d2593c;text-shadow:0 -1px 1px #d2593c,1px 0 1px #d2593c,0 1px 1px #d2593c,-1px 0 1px #d2593c;background:#f56a48;border-color:#ec6544 #d2593c #d2593c}.button-primary.warn:hover{background:#fd6d4a;border-color:#d2593c}.button-primary.warn:focus{box-shadow:0 1px 0 #dd6041,0 0 2px 1px #e4a796}.button-primary.warn:active{background:#dd6041;border-color:#d2593c;box-shadow:inset 0 2px 0 #d2593c}.button-primary.warn.disabled{color:#f5b3a1 !important;background:#e76444 !important;border-color:#d85e40 !important;text-shadow:0 -1px 0 rgba(0,0,0,0.1) !important}
diff --git a/vendor/freemius/wordpress-sdk/assets/css/admin/gdpr-optin-notice.css b/vendor/freemius/wordpress-sdk/assets/css/admin/gdpr-optin-notice.css
deleted file mode 100644
index 0da5146f6..000000000
--- a/vendor/freemius/wordpress-sdk/assets/css/admin/gdpr-optin-notice.css
+++ /dev/null
@@ -1 +0,0 @@
-.fs-notice[data-id^="gdpr_optin_actions"] .underlined{text-decoration:underline}.fs-notice[data-id^="gdpr_optin_actions"] ul .button,.fs-notice[data-id^="gdpr_optin_actions"] ul .action-description{vertical-align:middle}.fs-notice[data-id^="gdpr_optin_actions"] ul .action-description{display:inline-block;margin-left:3px}
diff --git a/vendor/freemius/wordpress-sdk/assets/css/admin/index.php b/vendor/freemius/wordpress-sdk/assets/css/admin/index.php
deleted file mode 100644
index 0316c6a61..000000000
--- a/vendor/freemius/wordpress-sdk/assets/css/admin/index.php
+++ /dev/null
@@ -1,3 +0,0 @@
- 0) {
- $window.on('scroll', function () {
- for (var i = 0; i < iframes.length; i++) {
- FS.PostMessage.postScroll(iframes[i]);
- }
- });
- }
- },
- init_child : function ()
- {
- this.init(_parent_subdomain);
-
- _is_child = true;
-
- // Post height of a child right after window is loaded.
- $(window).bind('load', function () {
- FS.PostMessage.postHeight();
-
- // Post message that window was loaded.
- FS.PostMessage.post('loaded');
- });
- },
- hasParent : function ()
- {
- return _hasParent;
- },
- postHeight : function (diff, wrapper) {
- diff = diff || 0;
- wrapper = wrapper || '#wrap_section';
- this.post('height', {
- height: diff + $(wrapper).outerHeight(true)
- });
- },
- postScroll : function (iframe) {
- this.post('scroll', {
- top: $window.scrollTop(),
- height: ($window.height() - parseFloat($html.css('paddingTop')) - parseFloat($html.css('marginTop')))
- }, iframe);
- },
- post : function (type, data, iframe)
- {
- console.debug('PostMessage.post', type);
-
- if (iframe)
- {
- // Post to iframe.
- _postman.postMessage(JSON.stringify({
- type: type,
- data: data
- }), iframe.src, iframe.contentWindow);
- }
- else {
- // Post to parent.
- _postman.postMessage(JSON.stringify({
- type: type,
- data: data
- }), _parent_url, window.parent);
- }
- },
- receive: function (type, callback)
- {
- console.debug('PostMessage.receive', type);
-
- if (undef === _callbacks[type])
- _callbacks[type] = [];
-
- _callbacks[type].push(callback);
- },
- receiveOnce: function (type, callback)
- {
- if (this.is_set(type))
- return;
-
- this.receive(type, callback);
- },
- // Check if any callbacks assigned to a specified message type.
- is_set: function (type)
- {
- return (undef != _callbacks[type]);
- },
- parent_url: function ()
- {
- return _parent_url;
- },
- parent_subdomain: function ()
- {
- return _parent_subdomain;
- }
- };
- }();
-})(jQuery);
\ No newline at end of file
diff --git a/vendor/freemius/wordpress-sdk/config.php b/vendor/freemius/wordpress-sdk/config.php
deleted file mode 100644
index f51eb4087..000000000
--- a/vendor/freemius/wordpress-sdk/config.php
+++ /dev/null
@@ -1,391 +0,0 @@
-is_registered() && $fs->is_tracking_allowed()`
- *
- * @since 1.0.1
- * @return bool
- */
- abstract function is_registered();
-
- /**
- * Check if the user skipped connecting the account with Freemius.
- *
- * @since 1.0.7
- *
- * @return bool
- */
- abstract function is_anonymous();
-
- /**
- * Check if the user currently in activation mode.
- *
- * @since 1.0.7
- *
- * @return bool
- */
- abstract function is_activation_mode();
-
- #endregion
-
- #----------------------------------------------------------------------------------
- #region Usage Tracking
- #----------------------------------------------------------------------------------
-
- /**
- * Returns TRUE if the user opted-in and didn't disconnect (opt-out).
- *
- * @author Leo Fajardo (@leorw)
- * @since 1.2.1.5
- *
- * @return bool
- */
- abstract function is_tracking_allowed();
-
- /**
- * Returns TRUE if the user never opted-in or manually opted-out.
- *
- * @author Vova Feldman (@svovaf)
- * @since 1.2.1.5
- *
- * @return bool
- */
- function is_tracking_prohibited() {
- return ! $this->is_registered() || ! $this->is_tracking_allowed();
- }
-
- /**
- * Opt-out from usage tracking.
- *
- * Note: This will not delete the account information but will stop all tracking.
- *
- * Returns:
- * 1. FALSE - If the user never opted-in.
- * 2. TRUE - If successfully opted-out.
- * 3. object - API Result on failure.
- *
- * @author Leo Fajardo (@leorw)
- * @since 1.2.1.5
- *
- * @return bool|object
- */
- abstract function stop_tracking();
-
- /**
- * Opt-in back into usage tracking.
- *
- * Note: This will only work if the user opted-in previously.
- *
- * Returns:
- * 1. FALSE - If the user never opted-in.
- * 2. TRUE - If successfully opted-in back to usage tracking.
- * 3. object - API result on failure.
- *
- * @author Leo Fajardo (@leorw)
- * @since 1.2.1.5
- *
- * @return bool|object
- */
- abstract function allow_tracking();
-
- #endregion
-
- #----------------------------------------------------------------------------------
- #region Module Type
- #----------------------------------------------------------------------------------
-
- /**
- * Checks if the plugin's type is "plugin". The other type is "theme".
- *
- * @author Leo Fajardo (@leorw)
- * @since 1.2.2
- *
- * @return bool
- */
- abstract function is_plugin();
-
- /**
- * Checks if the module type is "theme". The other type is "plugin".
- *
- * @author Leo Fajardo (@leorw)
- * @since 1.2.2
- *
- * @return bool
- */
- function is_theme() {
- return ( ! $this->is_plugin() );
- }
-
- #endregion
-
- #----------------------------------------------------------------------------------
- #region Permissions
- #----------------------------------------------------------------------------------
-
- /**
- * Check if plugin must be WordPress.org compliant.
- *
- * @since 1.0.7
- *
- * @return bool
- */
- abstract function is_org_repo_compliant();
-
- /**
- * Check if plugin is allowed to install executable files.
- *
- * @author Vova Feldman (@svovaf)
- * @since 1.0.5
- *
- * @return bool
- */
- function is_allowed_to_install() {
- return ( $this->is_premium() || ! $this->is_org_repo_compliant() );
- }
-
- #endregion
-
- /**
- * Check if user in trial or in free plan (not paying).
- *
- * @author Vova Feldman (@svovaf)
- * @since 1.0.4
- *
- * @return bool
- */
- function is_not_paying() {
- return ( $this->is_trial() || $this->is_free_plan() );
- }
-
- /**
- * Check if the user has an activated and valid paid license on current plugin's install.
- *
- * @since 1.0.9
- *
- * @return bool
- */
- abstract function is_paying();
-
- /**
- * Check if the user is paying or in trial.
- *
- * @since 1.0.9
- *
- * @return bool
- */
- function is_paying_or_trial() {
- return ( $this->is_paying() || $this->is_trial() );
- }
-
- /**
- * Check if user in a trial or have feature enabled license.
- *
- * @author Vova Feldman (@svovaf)
- * @since 1.1.7
- *
- * @return bool
- */
- abstract function can_use_premium_code();
-
- #----------------------------------------------------------------------------------
- #region Premium Only
- #----------------------------------------------------------------------------------
-
- /**
- * All logic wrapped in methods with "__premium_only()" suffix will be only
- * included in the premium code.
- *
- * Example:
- * if ( freemius()->is__premium_only() ) {
- * ...
- * }
- */
-
- /**
- * Returns true when running premium plugin code.
- *
- * @since 1.0.9
- *
- * @return bool
- */
- function is__premium_only() {
- return $this->is_premium();
- }
-
- /**
- * Check if the user has an activated and valid paid license on current plugin's install.
- *
- * @since 1.0.9
- *
- * @return bool
- *
- */
- function is_paying__premium_only() {
- return ( $this->is__premium_only() && $this->is_paying() );
- }
-
- /**
- * All code wrapped in this statement will be only included in the premium code.
- *
- * @since 1.0.9
- *
- * @param string $plan Plan name.
- * @param bool $exact If true, looks for exact plan. If false, also check "higher" plans.
- *
- * @return bool
- */
- function is_plan__premium_only( $plan, $exact = false ) {
- return ( $this->is_premium() && $this->is_plan( $plan, $exact ) );
- }
-
- /**
- * Check if plan matches active license' plan or active trial license' plan.
- *
- * All code wrapped in this statement will be only included in the premium code.
- *
- * @since 1.0.9
- *
- * @param string $plan Plan name.
- * @param bool $exact If true, looks for exact plan. If false, also check "higher" plans.
- *
- * @return bool
- */
- function is_plan_or_trial__premium_only( $plan, $exact = false ) {
- return ( $this->is_premium() && $this->is_plan_or_trial( $plan, $exact ) );
- }
-
- /**
- * Check if the user is paying or in trial.
- *
- * All code wrapped in this statement will be only included in the premium code.
- *
- * @since 1.0.9
- *
- * @return bool
- */
- function is_paying_or_trial__premium_only() {
- return $this->is_premium() && $this->is_paying_or_trial();
- }
-
- /**
- * Check if the user has an activated and valid paid license on current plugin's install.
- *
- * @since 1.0.4
- *
- * @return bool
- *
- * @deprecated Method name is confusing since it's not clear from the name the code will be removed.
- * @using Alias to is_paying__premium_only()
- */
- function is_paying__fs__() {
- return $this->is_paying__premium_only();
- }
-
- /**
- * Check if user in a trial or have feature enabled license.
- *
- * All code wrapped in this statement will be only included in the premium code.
- *
- * @author Vova Feldman (@svovaf)
- * @since 1.1.9
- *
- * @return bool
- */
- function can_use_premium_code__premium_only() {
- return $this->is_premium() && $this->can_use_premium_code();
- }
-
- #endregion
-
- #----------------------------------------------------------------------------------
- #region Trial
- #----------------------------------------------------------------------------------
-
- /**
- * Check if the user in a trial.
- *
- * @since 1.0.3
- *
- * @return bool
- */
- abstract function is_trial();
-
- /**
- * Check if trial already utilized.
- *
- * @since 1.0.9
- *
- * @return bool
- */
- abstract function is_trial_utilized();
-
- #endregion
-
- #----------------------------------------------------------------------------------
- #region Plans
- #----------------------------------------------------------------------------------
-
- /**
- * Check if the user is on the free plan of the product.
- *
- * @since 1.0.4
- *
- * @return bool
- */
- abstract function is_free_plan();
-
- /**
- * @since 1.0.2
- *
- * @param string $plan Plan name.
- * @param bool $exact If true, looks for exact plan. If false, also check "higher" plans.
- *
- * @return bool
- */
- abstract function is_plan( $plan, $exact = false );
-
- /**
- * Check if plan based on trial. If not in trial mode, should return false.
- *
- * @since 1.0.9
- *
- * @param string $plan Plan name.
- * @param bool $exact If true, looks for exact plan. If false, also check "higher" plans.
- *
- * @return bool
- */
- abstract function is_trial_plan( $plan, $exact = false );
-
- /**
- * Check if plan matches active license' plan or active trial license' plan.
- *
- * @since 1.0.9
- *
- * @param string $plan Plan name.
- * @param bool $exact If true, looks for exact plan. If false, also check "higher" plans.
- *
- * @return bool
- */
- function is_plan_or_trial( $plan, $exact = false ) {
- return $this->is_plan( $plan, $exact ) ||
- $this->is_trial_plan( $plan, $exact );
- }
-
- /**
- * Check if plugin has any paid plans.
- *
- * @author Vova Feldman (@svovaf)
- * @since 1.0.7
- *
- * @return bool
- */
- abstract function has_paid_plan();
-
- /**
- * Check if plugin has any free plan, or is it premium only.
- *
- * Note: If no plans configured, assume plugin is free.
- *
- * @author Vova Feldman (@svovaf)
- * @since 1.0.7
- *
- * @return bool
- */
- abstract function has_free_plan();
-
- /**
- * Check if plugin is premium only (no free plans).
- *
- * NOTE: is__premium_only() is very different method, don't get confused.
- *
- * @author Vova Feldman (@svovaf)
- * @since 1.1.9
- *
- * @return bool
- */
- abstract function is_only_premium();
-
- /**
- * Check if module has a premium code version.
- *
- * Serviceware module might be freemium without any
- * premium code version, where the paid features
- * are all part of the service.
- *
- * @author Vova Feldman (@svovaf)
- * @since 1.2.1.6
- *
- * @return bool
- */
- abstract function has_premium_version();
-
- /**
- * Check if module has any release on Freemius,
- * or all plugin's code is on WordPress.org (Serviceware).
- *
- * @return bool
- */
- function has_release_on_freemius() {
- return ! $this->is_org_repo_compliant() ||
- $this->has_premium_version();
- }
-
- /**
- * Checks if it's a freemium plugin.
- *
- * @author Vova Feldman (@svovaf)
- * @since 1.1.9
- *
- * @return bool
- */
- function is_freemium() {
- return $this->has_paid_plan() &&
- $this->has_free_plan();
- }
-
- /**
- * Check if module has only one plan.
- *
- * @author Vova Feldman (@svovaf)
- * @since 1.2.1.7
- *
- * @return bool
- */
- abstract function is_single_plan();
-
- #endregion
-
- /**
- * Check if running payments in sandbox mode.
- *
- * @since 1.0.4
- *
- * @return bool
- */
- abstract function is_payments_sandbox();
-
- /**
- * Check if running test vs. live plugin.
- *
- * @since 1.0.5
- *
- * @return bool
- */
- abstract function is_live();
-
- /**
- * Check if running premium plugin code.
- *
- * @since 1.0.5
- *
- * @return bool
- */
- abstract function is_premium();
-
- /**
- * Get upgrade URL.
- *
- * @author Vova Feldman (@svovaf)
- * @since 1.0.2
- *
- * @param string $period Billing cycle.
- *
- * @return string
- */
- abstract function get_upgrade_url( $period = WP_FS__PERIOD_ANNUALLY );
-
- /**
- * Check if Freemius was first added in a plugin update.
- *
- * @author Vova Feldman (@svovaf)
- * @since 1.1.5
- *
- * @return bool
- */
- function is_plugin_update() {
- return ! $this->is_plugin_new_install();
- }
-
- /**
- * Check if Freemius was part of the plugin when the user installed it first.
- *
- * @author Vova Feldman (@svovaf)
- * @since 1.1.5
- *
- * @return bool
- */
- abstract function is_plugin_new_install();
-
- #----------------------------------------------------------------------------------
- #region Marketing
- #----------------------------------------------------------------------------------
-
- /**
- * Check if current user purchased any other plugins before.
- *
- * @author Vova Feldman (@svovaf)
- * @since 1.0.9
- *
- * @return bool
- */
- abstract function has_purchased_before();
-
- /**
- * Check if current user classified as an agency.
- *
- * @author Vova Feldman (@svovaf)
- * @since 1.0.9
- *
- * @return bool
- */
- abstract function is_agency();
-
- /**
- * Check if current user classified as a developer.
- *
- * @author Vova Feldman (@svovaf)
- * @since 1.0.9
- *
- * @return bool
- */
- abstract function is_developer();
-
- /**
- * Check if current user classified as a business.
- *
- * @author Vova Feldman (@svovaf)
- * @since 1.0.9
- *
- * @return bool
- */
- abstract function is_business();
-
- #endregion
- }
\ No newline at end of file
diff --git a/vendor/freemius/wordpress-sdk/includes/class-freemius.php b/vendor/freemius/wordpress-sdk/includes/class-freemius.php
deleted file mode 100755
index eee651409..000000000
--- a/vendor/freemius/wordpress-sdk/includes/class-freemius.php
+++ /dev/null
@@ -1,25387 +0,0 @@
-store_id_slug_type_path_map( $module_id, $slug );
- }
-
- $this->_module_id = $module_id;
- $this->_slug = $this->get_slug();
- $this->_module_type = $this->get_module_type();
-
- $this->_blog_id = is_multisite() ? get_current_blog_id() : null;
-
- $this->_storage = FS_Storage::instance( $this->_module_type, $this->_slug );
-
- $this->_cache = FS_Cache_Manager::get_manager( WP_FS___OPTION_PREFIX . "cache_{$module_id}" );
-
- $this->_logger = FS_Logger::get_logger( WP_FS__SLUG . '_' . $this->get_unique_affix(), WP_FS__DEBUG_SDK, WP_FS__ECHO_DEBUG_SDK );
-
- $this->_plugin_main_file_path = $this->_find_caller_plugin_file( $is_init );
- $this->_plugin_dir_path = plugin_dir_path( $this->_plugin_main_file_path );
- $this->_plugin_basename = $this->get_plugin_basename();
- $this->_free_plugin_basename = str_replace( '-premium/', '/', $this->_plugin_basename );
-
- $this->_is_multisite_integrated = (
- defined( "WP_FS__PRODUCT_{$module_id}_MULTISITE" ) &&
- ( true === constant( "WP_FS__PRODUCT_{$module_id}_MULTISITE" ) )
- );
-
- $this->_is_network_active = (
- is_multisite() &&
- $this->_is_multisite_integrated &&
- // Themes are always network activated, but the ACTUAL activation is per site.
- $this->is_plugin() &&
- (
- is_plugin_active_for_network( $this->_plugin_basename ) ||
- // Plugin network level activation or uninstall.
- ( fs_is_network_admin() && is_plugin_inactive( $this->_plugin_basename ) )
- )
- );
-
- $this->_storage->set_network_active(
- $this->_is_network_active,
- $this->is_delegated_connection()
- );
-
- if ( ! isset( $this->_storage->is_network_activated ) ) {
- $this->_storage->is_network_activated = $this->_is_network_active;
- }
-
- if ( $this->_storage->is_network_activated != $this->_is_network_active ) {
- // Update last activation level.
- $this->_storage->is_network_activated = $this->_is_network_active;
-
- $this->maybe_adjust_storage();
- }
-
- #region Migration
-
- if ( is_multisite() ) {
- /**
- * If the install_timestamp exists on the site level but doesn't exist on the
- * network level storage, it means that we need to process the storage with migration.
- *
- * The code in this `if` scope will only be executed once and only for the first site that will execute it because once we migrate the storage data, install_timestamp will be already set in the network level storage.
- *
- * @author Vova Feldman (@svovaf)
- * @since 2.0.0
- */
- if ( false === $this->_storage->get( 'install_timestamp', false, true ) &&
- false !== $this->_storage->get( 'install_timestamp', false, false )
- ) {
- // Initiate storage migration.
- $this->_storage->migrate_to_network();
-
- // Migrate module cache to network level storage.
- $this->_cache->migrate_to_network();
- }
- }
-
- #endregion
-
- $base_name_split = explode( '/', $this->_plugin_basename );
- $this->_plugin_dir_name = $base_name_split[0];
-
- if ( $this->_logger->is_on() ) {
- $this->_logger->info( 'plugin_main_file_path = ' . $this->_plugin_main_file_path );
- $this->_logger->info( 'plugin_dir_path = ' . $this->_plugin_dir_path );
- $this->_logger->info( 'plugin_basename = ' . $this->_plugin_basename );
- $this->_logger->info( 'free_plugin_basename = ' . $this->_free_plugin_basename );
- $this->_logger->info( 'plugin_dir_name = ' . $this->_plugin_dir_name );
- }
-
- // Remember link between file to slug.
- $this->store_file_slug_map();
-
- // Store plugin's initial install timestamp.
- if ( ! isset( $this->_storage->install_timestamp ) ) {
- $this->_storage->install_timestamp = WP_FS__SCRIPT_START_TIME;
- }
-
- if ( ! is_object( $this->_plugin ) ) {
- $this->_plugin = FS_Plugin_Manager::instance( $this->_module_id )->get();
- }
-
- $this->_admin_notices = FS_Admin_Notices::instance(
- $this->_slug . ( $this->is_theme() ? ':theme' : '' ),
- /**
- * Ensure that the admin notice will always have a title by using the stored plugin title if available and
- * retrieving the title via the "get_plugin_name" method if there is no stored plugin title available.
- *
- * @author Leo Fajardo (@leorw)
- * @since 1.2.2
- */
- ( is_object( $this->_plugin ) ? $this->_plugin->title : $this->get_plugin_name() ),
- $this->get_unique_affix()
- );
-
- if ( 'true' === fs_request_get( 'fs_clear_api_cache' ) ||
- fs_request_is_action( 'restart_freemius' )
- ) {
- FS_Api::clear_cache();
- $this->_cache->clear();
- }
-
- $this->register_constructor_hooks();
-
- /**
- * Starting from version 2.0.0, `FS_Site` entities no longer have the `plan` property and have `plan_id`
- * instead. This should be called before calling `_load_account()`, otherwise, `$this->_site` will not be
- * loaded in `_load_account` for versions of SDK starting from 2.0.0.
- *
- * @author Leo Fajardo (@leorw)
- */
- self::migrate_install_plan_to_plan_id( $this->_storage );
-
- $this->_load_account();
-
- $this->_version_updates_handler();
- }
-
- /**
- * @author Leo Fajardo (@leorw)
- * @since 2.3.0
- */
- private function maybe_adjust_storage() {
- $install_timestamp = null;
- $prev_is_premium = null;
-
- $options_to_update = array();
-
- $is_network_admin = fs_is_network_admin();
-
- $network_install_timestamp = $this->_storage->get( 'install_timestamp', null, true );
-
- if ( ! $is_network_admin ) {
- if ( is_null( $network_install_timestamp ) ) {
- // Plugin was not network-activated before.
- return;
- }
-
- if ( is_null( $this->_storage->get( 'install_timestamp', null, false ) ) ) {
- // Set the `install_timestamp` only if it's not yet set.
- $install_timestamp = $network_install_timestamp;
- }
-
- $prev_is_premium = $this->_storage->get( 'prev_is_premium', null, true );
- } else {
- $current_wp_user = self::_get_current_wp_user();
- $current_fs_user = self::_get_user_by_email( $current_wp_user->user_email );
- $network_user_info = array();
-
- $skips_count = 0;
-
- $sites = self::get_sites();
- $sites_count = count( $sites );
-
- $blog_id_2_install_map = array();
-
- $is_first_non_ignored_blog = true;
-
- foreach ( $sites as $site ) {
- $blog_id = self::get_site_blog_id( $site );
-
- $blog_install_timestamp = $this->_storage->get( 'install_timestamp', null, $blog_id );
-
- if ( is_null( $blog_install_timestamp ) ) {
- // Plugin has not been installed on this blog.
- continue;
- }
-
- $is_earlier_install = (
- ! is_null( $install_timestamp ) &&
- $blog_install_timestamp < $install_timestamp
- );
-
- $install = $this->get_install_by_blog_id( $blog_id );
-
- $update_network_user_info = false;
-
- if ( ! is_object( $install ) ) {
- if ( ! $this->_storage->get( 'is_anonymous', false, $blog_id ) ) {
- // The opt-in decision (whether to skip or opt in) is yet to be made.
- continue;
- }
-
- $skips_count ++;
- } else {
- $blog_id_2_install_map[ $blog_id ] = $install;
-
- if ( empty( $network_user_info ) ) {
- // Set the network user info for the 1st time. Choose any user information whether or not it is for the current WP user.
- $update_network_user_info = true;
- }
-
- if ( ! $update_network_user_info &&
- is_object( $current_fs_user ) &&
- $network_user_info['user_id'] != $current_fs_user->id &&
- $install->user_id == $current_fs_user->id
- ) {
- // If an install that is owned by the current WP user is found, use its user information instead.
- $update_network_user_info = true;
- }
-
- if ( ! $update_network_user_info &&
- $is_earlier_install &&
- ( ! is_object( $current_fs_user ) || $current_fs_user->id == $install->user_id )
- ) {
- // Update to the earliest install info if there's no install found so far that is owned by the current WP user; OR only if the found install is owned by the current WP user.
- $update_network_user_info = true;
- }
- }
-
- if ( $update_network_user_info ) {
- $network_user_info = array(
- 'user_id' => $install->user_id,
- 'blog_id' => $blog_id
- );
- }
-
- $site_prev_is_premium = $this->_storage->get( 'prev_is_premium', null, $blog_id );
-
- if ( $is_first_non_ignored_blog ) {
- $prev_is_premium = $site_prev_is_premium;
-
- if ( is_null( $network_install_timestamp ) ) {
- $install_timestamp = $blog_install_timestamp;
- }
-
- $is_first_non_ignored_blog = false;
-
- continue;
- }
-
- if ( ! is_null( $prev_is_premium ) && $prev_is_premium !== $site_prev_is_premium ) {
- // If a different `$site_prev_is_premium` value is found, do not include the option in the collection of options to update.
- $prev_is_premium = null;
- }
-
- if ( $is_earlier_install ) {
- // If an earlier install timestamp is found.
- $install_timestamp = $blog_install_timestamp;
- }
- }
-
- $installs_count = count( $blog_id_2_install_map );
-
- if ( $sites_count === ( $installs_count + $skips_count ) ) {
- if ( ! empty( $network_user_info ) ) {
- $options_to_update['network_user_id'] = $network_user_info['user_id'];
- $options_to_update['network_install_blog_id'] = $network_user_info['blog_id'];
-
- foreach ( $blog_id_2_install_map as $blog_id => $install ) {
- if ( $install->user_id == $network_user_info['user_id'] ) {
- continue;
- }
-
- $this->_storage->store( 'is_delegated_connection', true, $blog_id );
- }
- }
-
- if ( $sites_count === $skips_count ) {
- /**
- * Assume network-level skipping as the intended action if all actions identified were only
- * skipping of the connection (i.e., no opt-ins and delegated connections so far).
- */
- $options_to_update['is_anonymous_ms'] = true;
- } else if ( $sites_count === $installs_count ) {
- /**
- * Assume network-level opt-in as the intended action if all actions identified were only opt-ins
- * (i.e., no delegation and skipping of the connections so far).
- */
- $options_to_update['is_network_connected'] = true;
- }
- }
- }
-
- if ( ! is_null( $install_timestamp ) ) {
- $options_to_update['install_timestamp'] = $install_timestamp;
- }
-
- if ( ! is_null( $prev_is_premium ) ) {
- $options_to_update['prev_is_premium'] = $prev_is_premium;
- }
-
- if ( ! empty( $options_to_update ) ) {
- $this->adjust_storage( $options_to_update, $is_network_admin );
- }
- }
-
- /**
- * @author Leo Fajardo (@leorw)
- * @since 2.3.0
- *
- * @param array $options
- * @param bool $is_network_admin
- */
- private function adjust_storage( $options, $is_network_admin ) {
- foreach ( $options as $name => $value ) {
- $this->_storage->store( $name, $value, $is_network_admin ? true : null );
- }
- }
-
- /**
- * Checks whether this module has a settings menu.
- *
- * @author Leo Fajardo (@leorw)
- * @since 1.2.2
- *
- * @return bool
- */
- function has_settings_menu() {
- return ( $this->_is_network_active && fs_is_network_admin() ) ?
- $this->_menu->has_network_menu() :
- $this->_menu->has_menu();
- }
-
- /**
- * If `true` the opt-in should be shown as a modal dialog box on the themes.php page. WordPress.org themes guidelines prohibit from redirecting the user from the themes.php page after activating a theme.
- *
- * @author Vova Feldman (@svovaf)
- * @since 2.4.5
- *
- * @return bool
- */
- function show_opt_in_on_themes_page() {
- if ( ! $this->is_free_wp_org_theme() ) {
- return false;
- }
-
- if ( ! $this->has_settings_menu() ) {
- return true;
- }
-
- return $this->show_settings_with_tabs();
- }
-
- /**
- * If `true` the opt-in should be shown on the product's main setting page.
- *
- * @author Vova Feldman (@svovaf)
- * @since 2.4.5
- *
- * @return bool
- *
- * @uses show_opt_in_on_themes_page();
- */
- function show_opt_in_on_setting_page() {
- return ! $this->show_opt_in_on_themes_page();
- }
-
- /**
- * If `true` the settings should be shown using tabs.
- *
- * @author Vova Feldman (@svovaf)
- * @since 2.4.5
- *
- * @return bool
- */
- function show_settings_with_tabs() {
- return ( self::NAVIGATION_TABS === $this->_navigation );
- }
-
- /**
- * Check if the context module is free wp.org theme.
- *
- * This method is helpful because:
- * 1. wp.org themes are limited to a single submenu item,
- * and sub-submenu items are most likely not allowed (never verified).
- * 2. wp.org themes are not allowed to redirect the user
- * after the theme activation, therefore, the agreed UX
- * is showing the opt-in as a modal dialog box after
- * activation (approved by @otto42, @emiluzelac, @greenshady, @grapplerulrich).
- *
- * @author Vova Feldman (@svovaf)
- * @since 1.2.2.7
- *
- * @return bool
- */
- function is_free_wp_org_theme() {
- return (
- $this->is_theme() &&
- $this->is_org_repo_compliant() &&
- ! $this->is_premium()
- );
- }
-
- /**
- * Checks whether this a submenu item is visible.
- *
- * @author Vova Feldman (@svovaf)
- * @since 1.2.2.6
- * @since 1.2.2.7 Even if the menu item was specified to be hidden, when it is the context page, then show the submenu item so the user will have the right context page.
- *
- * @param string $slug
- * @param bool $is_tabs_visibility_check This is used to decide if the associated tab should be shown or hidden.
- *
- * @return bool
- */
- function is_submenu_item_visible( $slug, $is_tabs_visibility_check = false ) {
- if ( $this->is_admin_page( $slug ) ) {
- /**
- * It is the current context page, so show the submenu item
- * so the user will have the right context page, even if it
- * was set to hidden.
- */
- return true;
- }
-
- if ( ! $this->has_settings_menu() ) {
- // No menu settings at all.
- return false;
- }
-
- if (
- ! $is_tabs_visibility_check &&
- $this->is_org_repo_compliant() &&
- $this->show_settings_with_tabs()
- ) {
- /**
- * wp.org themes are limited to a single submenu item, and
- * sub-submenu items are most likely not allowed (never verified).
- */
- return false;
- }
-
- return $this->_menu->is_submenu_item_visible( $slug );
- }
-
- /**
- * Check if a Freemius page should be accessible via the UI.
- *
- * @author Vova Feldman (@svovaf)
- * @since 1.2.2.7
- *
- * @param string $slug
- *
- * @return bool
- */
- function is_page_visible( $slug ) {
- if ( $this->is_admin_page( $slug ) ) {
- return true;
- }
-
- return $this->_menu->is_submenu_item_visible( $slug, true, true );
- }
-
- /**
- * @author Vova Feldman (@svovaf)
- * @since 1.0.9
- */
- private function _version_updates_handler() {
- if ( ! isset( $this->_storage->sdk_version ) || $this->_storage->sdk_version != $this->version ) {
- // Freemius version upgrade mode.
- $this->_storage->sdk_last_version = $this->_storage->sdk_version;
- $this->_storage->sdk_version = $this->version;
-
- if ( empty( $this->_storage->sdk_last_version ) ||
- version_compare( $this->_storage->sdk_last_version, $this->version, '<' )
- ) {
- $this->_storage->sdk_upgrade_mode = true;
- $this->_storage->sdk_downgrade_mode = false;
- } else {
- $this->_storage->sdk_downgrade_mode = true;
- $this->_storage->sdk_upgrade_mode = false;
-
- }
-
- $this->do_action( 'sdk_version_update', $this->_storage->sdk_last_version, $this->version );
- }
-
- $plugin_version = $this->get_plugin_version();
- if ( ! isset( $this->_storage->plugin_version ) || $this->_storage->plugin_version != $plugin_version ) {
- // Plugin version upgrade mode.
- $this->_storage->plugin_last_version = $this->_storage->plugin_version;
- $this->_storage->plugin_version = $plugin_version;
-
- if ( empty( $this->_storage->plugin_last_version ) ||
- version_compare( $this->_storage->plugin_last_version, $plugin_version, '<' )
- ) {
- $this->_storage->plugin_upgrade_mode = true;
- $this->_storage->plugin_downgrade_mode = false;
- } else {
- $this->_storage->plugin_downgrade_mode = true;
- $this->_storage->plugin_upgrade_mode = false;
- }
-
- if ( ! empty( $this->_storage->plugin_last_version ) ) {
- // Different version of the plugin was installed before, therefore it's an update.
- $this->_storage->is_plugin_new_install = false;
- }
-
- $this->do_action( 'plugin_version_update', $this->_storage->plugin_last_version, $plugin_version );
- }
- }
-
- #--------------------------------------------------------------------------------
- #region Data Migration on SDK Update
- #--------------------------------------------------------------------------------
-
- /**
- * @author Vova Feldman (@svovaf)
- * @since 1.1.5
- *
- * @param string $sdk_prev_version
- * @param string $sdk_version
- */
- function _sdk_version_update( $sdk_prev_version, $sdk_version ) {
- /**
- * @since 1.1.7.3 Fixed unwanted connectivity test cleanup.
- */
- if ( empty( $sdk_prev_version ) ) {
- return;
- }
-
- if ( version_compare( $sdk_prev_version, '2.1.0', '<' ) &&
- version_compare( $sdk_version, '2.1.0', '>=' )
- ) {
- $this->_storage->handle_gdpr_admin_notice = true;
- }
-
- if ( version_compare( $sdk_prev_version, '2.0.0', '<' ) &&
- version_compare( $sdk_version, '2.0.0', '>=' )
- ) {
- $this->migrate_to_subscriptions_collection();
-
- $this->consolidate_licenses();
-
- // Clear trial_plan since it's now loaded from the plans collection when needed.
- $this->_storage->remove( 'trial_plan', true, false );
- }
-
- if ( version_compare( $sdk_prev_version, '1.2.3', '<' ) &&
- version_compare( $sdk_version, '1.2.3', '>=' )
- ) {
- /**
- * Starting from version 1.2.3, paths are stored as relative instead of absolute and some of them can be
- * invalid.
- *
- * @author Leo Fajardo (@leorw)
- */
- $this->remove_invalid_paths();
- }
-
- if ( version_compare( $sdk_prev_version, '1.1.5', '<' ) &&
- version_compare( $sdk_version, '1.1.5', '>=' )
- ) {
- // On version 1.1.5 merged connectivity and is_on data.
- if ( isset( $this->_storage->connectivity_test ) ) {
- if ( ! isset( $this->_storage->is_on ) ) {
- unset( $this->_storage->connectivity_test );
- } else {
- $connectivity_data = $this->_storage->connectivity_test;
- $connectivity_data['is_active'] = $this->_storage->is_on['is_active'];
- $connectivity_data['timestamp'] = $this->_storage->is_on['timestamp'];
-
- // Override.
- $this->_storage->connectivity_test = $connectivity_data;
-
- // Remove previous structure.
- unset( $this->_storage->is_on );
- }
-
- }
- }
-
- if (
- version_compare( $sdk_prev_version, '2.2.1', '<' ) &&
- version_compare( $sdk_version, '2.2.1', '>=' )
- ) {
- /**
- * Clear the file cache without storing the previous path since it could be a wrong path. For example,
- * in the versions of the SDK lower than 2.2.1, it's possible for the path of an add-on to be the same
- * as the parent plugin's when the add-on was auto-installed since the relevant method names were not
- * skipped in the logic that determines the right path in the `get_caller_main_file_and_type` method
- * (e.g. `try_activate_plugin`). Since it was an auto-installation, the caller was the parent plugin
- * and so its path was used. In case the stored path is wrong, clearing the cache will resolve issues
- * related to data mix-up between plugins (e.g. titles and versions of an add-on and its parent plugin).
- *
- * @author Leo Fajardo (@leorw)
- * @since 2.2.1
- */
- $this->clear_module_main_file_cache( false );
- }
- }
-
- /**
- * @author Leo Fajardo (@leorw)
- * @since 2.0.0
- *
- * @param \FS_Storage $storage
- * @param bool|int|null $blog_id
- */
- private static function migrate_install_plan_to_plan_id( FS_Storage $storage, $blog_id = null ) {
- if ( empty( $storage->sdk_version ) ) {
- // New installation of the plugin, no need to upgrade.
- return;
- }
-
- if ( ! version_compare( $storage->sdk_version, '2.0.0', '<' ) ) {
- // Previous version is >= 2.0.0, so no need to migrate.
- return;
- }
-
- // Alias.
- $module_type = $storage->get_module_type();
- $module_slug = $storage->get_module_slug();
-
- $installs = self::get_all_sites( $module_type, $blog_id );
- $install = isset( $installs[ $module_slug ] ) ? $installs[ $module_slug ] : null;
-
- if ( ! is_object( $install ) ) {
- return;
- }
-
- if ( isset( $install->plan ) && is_object( $install->plan ) ) {
- if ( isset( $install->plan->id ) && ! empty( $install->plan->id ) ) {
- $install->plan_id = self::_decrypt( $install->plan->id );
- }
-
- unset( $install->plan );
-
- $installs[ $module_slug ] = clone $install;
-
- self::set_account_option_by_module(
- $module_type,
- 'sites',
- $installs,
- true,
- $blog_id
- );
- }
- }
-
- /**
- * @author Leo Fajardo (@leorw)
- * @since 2.0.0
- */
- private function migrate_to_subscriptions_collection() {
- if ( ! is_object( $this->_site ) ) {
- return;
- }
-
- if ( isset( $this->_storage->subscription ) && is_object( $this->_storage->subscription ) ) {
- $this->_storage->subscriptions = array( fs_get_entity( $this->_storage->subscription, FS_Subscription::get_class_name() ) );
- }
- }
-
- /**
- * @author Leo Fajardo (@leorw)
- * @since 2.0.0
- */
- private function consolidate_licenses() {
- $plugin_licenses = self::get_account_option( 'licenses', WP_FS__MODULE_TYPE_PLUGIN );
- if ( isset( $plugin_licenses[ $this->_slug ] ) ) {
- $plugin_licenses = $plugin_licenses[ $this->_slug ];
- } else {
- $plugin_licenses = array();
- }
-
- $theme_licenses = self::get_account_option( 'licenses', WP_FS__MODULE_TYPE_THEME );
- if ( isset( $theme_licenses[ $this->_slug ] ) ) {
- $theme_licenses = $theme_licenses[ $this->_slug ];
- } else {
- $theme_licenses = array();
- }
-
- if ( empty( $plugin_licenses ) && empty( $theme_licenses ) ) {
- return;
- }
-
- $all_licenses = array();
- $user_id_license_ids_map = array();
-
- foreach ( $plugin_licenses as $user_id => $user_licenses ) {
- if ( is_array( $user_licenses ) ) {
- if ( ! isset( $user_license_ids[ $user_id ] ) ) {
- $user_id_license_ids_map[ $user_id ] = array();
- }
-
- foreach ( $user_licenses as $user_license ) {
- $all_licenses[] = $user_license;
- $user_id_license_ids_map[ $user_id ][] = $user_license->id;
- }
- }
- }
-
- foreach ( $theme_licenses as $user_id => $user_licenses ) {
- if ( is_array( $user_licenses ) ) {
- if ( ! isset( $user_license_ids[ $user_id ] ) ) {
- $user_id_license_ids_map[ $user_id ] = array();
- }
-
- foreach ( $user_licenses as $user_license ) {
- $all_licenses[] = $user_license;
- $user_id_license_ids_map[ $user_id ][] = $user_license->id;
- }
- }
- }
-
- self::store_user_id_license_ids_map(
- $user_id_license_ids_map,
- $this->_module_id
- );
-
- $this->_store_licenses( true, $this->_module_id, $all_licenses );
- }
-
- /**
- * Remove invalid paths.
- *
- * @author Leo Fajardo (@leorw)
- * @since 1.2.3
- */
- private function remove_invalid_paths() {
- // Remove invalid path that is still associated with the current slug if there's any.
- $file_slug_map = self::$_accounts->get_option( 'file_slug_map', array() );
- foreach ( $file_slug_map as $plugin_basename => $slug ) {
- if ( $slug === $this->_slug &&
- $plugin_basename !== $this->_plugin_basename &&
- ! file_exists( $this->get_absolute_path( $plugin_basename ) )
- ) {
- unset( $file_slug_map[ $plugin_basename ] );
- self::$_accounts->set_option( 'file_slug_map', $file_slug_map, true );
-
- break;
- }
- }
- }
-
- /**
- * @author Vova Feldman (@svovaf)
- * @since 1.2.2.7
- *
- * @param string $plugin_prev_version
- * @param string $plugin_version
- */
- function _after_version_update( $plugin_prev_version, $plugin_version ) {
- if ( $this->is_theme() ) {
- // Expire the cache of the previous tabs since the theme may
- // have setting updates.
- $this->_cache->expire( 'tabs' );
- $this->_cache->expire( 'tabs_stylesheets' );
- }
- }
-
- /**
- * A special migration logic for the $_accounts, executed for all the plugins in the system:
- * - Moves some data to the network level storage.
- * - If the plugin's connection was skipped for all sites, set the plugin as if it was network skipped.
- * - If the plugin's connection was ignored for all sites, don't do anything in terms of the network connection.
- * - If the plugin was connected to all sites by the same super-admin, set the plugin as if was network opted-in for all sites.
- * - If there's at least one site that was connected by a super-admin, find the "main super-admin" (the one that installed the majority of the plugin installs) and set the plugin as if was network activated with the main super-admin, set all the sites that were skipped or opted-in with a different user to delegated mode. Then, prompt the currently logged super-admin to choose what to do with the ignored sites.
- * - If there are any sites in the network which the connection decision was not yet taken for, set this plugin into network activation mode so a super-admin can choose what to do with the rest of the sites.
- *
- * @author Vova Feldman (@svovaf)
- * @since 2.0.0
- */
- private static function migrate_accounts_to_network() {
- $sites = self::get_sites();
- $sites_count = count( $sites );
- $connection_status = array();
- $plugin_slugs = array();
- foreach ( $sites as $site ) {
- $blog_id = self::get_site_blog_id( $site );
-
- self::$_accounts->migrate_to_network( $blog_id );
-
- /**
- * Build a list of all Freemius powered plugins slugs.
- */
- $id_slug_type_path_map = self::$_accounts->get_option( 'id_slug_type_path_map', array(), $blog_id );
- foreach ( $id_slug_type_path_map as $module_id => $data ) {
- if ( WP_FS__MODULE_TYPE_PLUGIN === $data['type'] ) {
- $plugin_slugs[ $data['slug'] ] = true;
- }
- }
-
- $installs = self::get_account_option( 'sites', WP_FS__MODULE_TYPE_PLUGIN, $blog_id );
-
- if ( is_array( $installs ) ) {
- foreach ( $installs as $slug => $install ) {
- if ( ! isset( $connection_status[ $slug ] ) ) {
- $connection_status[ $slug ] = array();
- }
-
- if ( is_object( $install ) &&
- FS_Site::is_valid_id( $install->id ) &&
- FS_User::is_valid_id( $install->user_id )
- ) {
- $connection_status[ $slug ][ $blog_id ] = $install->user_id;
- }
- }
- }
- }
-
- foreach ( $plugin_slugs as $slug => $true ) {
- if ( ! isset( $connection_status[ $slug ] ) ) {
- $connection_status[ $slug ] = array();
- }
-
- foreach ( $sites as $site ) {
- $blog_id = self::get_site_blog_id( $site );
-
- if ( isset( $connection_status[ $slug ][ $blog_id ] ) ) {
- continue;
- }
-
- $storage = FS_Storage::instance( WP_FS__MODULE_TYPE_PLUGIN, $slug );
-
- $is_anonymous = $storage->get( 'is_anonymous', null, $blog_id );
-
- if ( ! is_null( $is_anonymous ) ) {
- // Since 1.1.3 is_anonymous is an array.
- if ( is_array( $is_anonymous ) && isset( $is_anonymous['is'] ) ) {
- $is_anonymous = $is_anonymous['is'];
- }
-
- if ( is_bool( $is_anonymous ) && true === $is_anonymous ) {
- $connection_status[ $slug ][ $blog_id ] = 'skipped';
- }
- }
-
- if ( ! isset( $connection_status[ $slug ][ $blog_id ] ) ) {
- $connection_status[ $slug ][ $blog_id ] = 'ignored';
- }
- }
- }
-
- $super_admins = array();
-
- foreach ( $connection_status as $slug => $blogs_status ) {
- $skips = 0;
- $ignores = 0;
- $connections = 0;
- $opted_in_users = array();
- $opted_in_super_admins = array();
-
- $storage = FS_Storage::instance( WP_FS__MODULE_TYPE_PLUGIN, $slug );
-
- foreach ( $blogs_status as $blog_id => $status_or_user_id ) {
- if ( 'skipped' === $status_or_user_id ) {
- $skips ++;
- } else if ( 'ignored' === $status_or_user_id ) {
- $ignores ++;
- } else if ( FS_User::is_valid_id( $status_or_user_id ) ) {
- $connections ++;
-
- if ( ! isset( $opted_in_users[ $status_or_user_id ] ) ) {
- $opted_in_users[ $status_or_user_id ] = array();
- }
-
- $opted_in_users[ $status_or_user_id ][] = $blog_id;
-
- if ( isset( $super_admins[ $status_or_user_id ] ) ||
- self::is_super_admin( $status_or_user_id )
- ) {
- // Cache super-admin data.
- $super_admins[ $status_or_user_id ] = true;
-
- // Remember opted-in super-admins for the plugin.
- $opted_in_super_admins[ $status_or_user_id ] = true;
- }
- }
- }
-
- $main_super_admin_user_id = null;
- $all_migrated = false;
- if ( $sites_count == $skips ) {
- // All sites were skipped -> network skip by copying the anonymous mode from any of the sites.
- $storage->is_anonymous_ms = $storage->is_anonymous;
-
- $all_migrated = true;
- } else if ( $sites_count == $ignores ) {
- // Don't do anything, still in activation mode.
-
- $all_migrated = true;
- } else if ( 0 < count( $opted_in_super_admins ) ) {
- // Find the super-admin with the majority of installs.
- $max_installs_by_super_admin = 0;
- foreach ( $opted_in_super_admins as $user_id => $true ) {
- $installs_count = count( $opted_in_users[ $user_id ] );
-
- if ( $installs_count > $max_installs_by_super_admin ) {
- $max_installs_by_super_admin = $installs_count;
- $main_super_admin_user_id = $user_id;
- }
- }
-
- if ( $sites_count == $connections && 1 == count( $opted_in_super_admins ) ) {
- // Super-admin opted-in for all sites in the network.
- $storage->is_network_connected = true;
-
- $all_migrated = true;
- }
-
- // Store network user.
- $storage->network_user_id = $main_super_admin_user_id;
-
- $storage->network_install_blog_id = ( $sites_count == $connections ) ?
- // Since all sites are opted-in, associating with the main site.
- get_current_blog_id() :
- // Associating with the 1st found opted-in site.
- $opted_in_users[ $main_super_admin_user_id ][0];
-
- /**
- * Make sure we migrate the plan ID of the network install, otherwise, if after the migration
- * the 1st page that will be loaded is the network level WP Admin and $storage->network_install_blog_id
- * is different than the main site of the network, the $this->_site will not be set since the plan_id
- * will be empty.
- */
- $storage->migrate_to_network();
- self::migrate_install_plan_to_plan_id( $storage, $storage->network_install_blog_id );
- } else {
- // At least one opt-in. All the opt-in were created by a non-super-admin.
- if ( 0 == $ignores ) {
- // All sites were opted-in or skipped, all by non-super-admin. So delegate all.
- $storage->store( 'is_delegated_connection', true, true );
-
- $all_migrated = true;
- }
- }
-
- if ( ! $all_migrated ) {
- /**
- * Delegate all sites that were:
- * 1) Opted-in by a user that is NOT the main-super-admin.
- * 2) Skipped and non of the sites was opted-in by a super-admin. If any site was opted-in by a super-admin, there will be a main-super-admin, and we consider the skip as if it was done by that user.
- */
- foreach ( $blogs_status as $blog_id => $status_or_user_id ) {
- if ( $status_or_user_id == $main_super_admin_user_id ) {
- continue;
- }
-
- if ( FS_User::is_valid_id( $status_or_user_id ) ||
- ( 'skipped' === $status_or_user_id && is_null( $main_super_admin_user_id ) )
- ) {
- $storage->store( 'is_delegated_connection', true, $blog_id );
- }
- }
- }
-
-
- if ( ( $connections + $skips > 0 ) ) {
- if ( $ignores > 0 ) {
- /**
- * If admin already opted-in or skipped in any of the network sites, and also
- * have sites which the connection decision was not yet taken, set this plugin
- * into network activation mode so the super-admin can choose what to do with
- * the rest of the sites.
- */
- self::set_network_upgrade_mode( $storage );
- }
- }
- }
- }
-
- /**
- * Set a module into network upgrade mode.
- *
- * @author Vova Feldman (@svovaf)
- * @since 2.0.0
- *
- * @param \FS_Storage $storage
- *
- * @return bool
- */
- private static function set_network_upgrade_mode( FS_Storage $storage ) {
- return $storage->is_network_activation = true;
- }
-
- /**
- * Will return true after upgrading to the SDK with the network level integration,
- * when the super-admin involvement is required regarding the rest of the sites.
- *
- * @author Vova Feldman (@svovaf)
- * @since 2.0.0
- *
- * @return bool
- */
- function is_network_upgrade_mode() {
- return $this->_storage->get( 'is_network_activation' );
- }
-
- /**
- * Clear flag after the upgrade mode completion.
- *
- * @author Vova Feldman (@svovaf)
- * @since 2.0.0
- *
- * @return bool True if network activation was on and now completed.
- */
- private function network_upgrade_mode_completed() {
- if ( fs_is_network_admin() && $this->is_network_upgrade_mode() ) {
- $this->_storage->remove( 'is_network_activation' );
-
- return true;
- }
-
- return false;
- }
-
- #endregion
-
- /**
- * This action is connected to the 'plugins_loaded' hook and helps to determine
- * if this is a new plugin installation or a plugin update.
- *
- * There are 3 different use-cases:
- * 1) New plugin installation right with Freemius:
- * 1.1 _activate_plugin_event_hook() will be executed first
- * 1.2 Since $this->_storage->is_plugin_new_install is not set,
- * and $this->_storage->plugin_last_version is not set,
- * $this->_storage->is_plugin_new_install will be set to TRUE.
- * 1.3 When _plugins_loaded() will be executed, $this->_storage->is_plugin_new_install will
- * be already set to TRUE.
- *
- * 2) Plugin update, didn't have Freemius before, and now have the SDK:
- * 2.1 _activate_plugin_event_hook() will not be executed, because
- * the activation hook do NOT fires on updates since WP 3.1.
- * 2.2 When _plugins_loaded() will be executed, $this->_storage->is_plugin_new_install will
- * be empty, therefore, it will be set to FALSE.
- *
- * 3) Plugin update, had Freemius in prev version as well:
- * 3.1 _version_updates_handler() will be executed 1st, since FS was installed
- * before, $this->_storage->plugin_last_version will NOT be empty,
- * therefore, $this->_storage->is_plugin_new_install will be set to FALSE.
- * 3.2 When _plugins_loaded() will be executed, $this->_storage->is_plugin_new_install is
- * already set, therefore, it will not be modified.
- *
- * Use-case #3 is backward compatible, #3.1 will be executed since 1.0.9.
- *
- * NOTE:
- * The only fallback of this mechanism is if an admin updates a plugin based on use-case #2,
- * and then, the next immediate PageView is the plugin's main settings page, it will not
- * show the opt-in right away. The reason it will happen is because Freemius execution
- * will be turned off till the plugin is fully loaded at least once
- * (till $this->_storage->was_plugin_loaded is TRUE).
- *
- * @author Vova Feldman (@svovaf)
- * @since 1.1.9
- *
- */
- function _plugins_loaded() {
- // Update flag that plugin was loaded with Freemius at least once.
- $this->_storage->was_plugin_loaded = true;
-
- /**
- * Bug fix - only set to false when it's a plugin, due to the
- * execution sequence of the theme hooks and our methods, if
- * this will be set for themes, Freemius will always assume
- * it's a theme update.
- *
- * @author Vova Feldman (@svovaf)
- * @since 1.2.2.2
- */
- if ( $this->is_plugin() &&
- ! isset( $this->_storage->is_plugin_new_install )
- ) {
- $this->_storage->is_plugin_new_install = (
- ! is_plugin_active( $this->_plugin_basename ) &&
- empty( $this->_storage->plugin_last_version )
- );
- }
- }
-
- /**
- * Add special parameter to WP admin AJAX calls so when we
- * process AJAX calls we can identify its source properly.
- *
- * @author Leo Fajardo (@leorw)
- * @since 2.0.0
- */
- static function _enrich_ajax_url() {
- $admin_param = is_network_admin() ?
- '_fs_network_admin' :
- '_fs_blog_admin';
- ?>
-
-
-
- _logger->entrance();
-
- if ( is_admin() ) {
- add_action( 'admin_init', array( &$this, '_hook_action_links_and_register_account_hooks' ) );
-
- if ( $this->is_plugin() ) {
- if ( self::is_plugin_install_page() && true !== fs_request_get_bool( 'fs_allow_updater_and_dialog' ) ) {
- /**
- * Unless the `fs_allow_updater_and_dialog` URL param exists and its value is `true`, make
- * Freemius-related updates unavailable on the "Add Plugins" admin page (/plugin-install.php)
- * so that they won't interfere with the .org plugins' functionalities on that page (e.g.
- * updating of a .org plugin).
- */
- add_filter( 'site_transient_update_plugins', array( 'Freemius', '_remove_fs_updates_from_plugin_install_page' ), 10, 2 );
- } else if ( self::is_plugins_page() || self::is_updates_page() ) {
- /**
- * On the "Plugins" and "Updates" admin pages, if there are premium or non–org-compliant plugins, modify their details dialog URLs (add a Freemius-specific param) so that the SDK can determine if the plugin information dialog should show information from Freemius.
- *
- * @author Leo Fajardo (@leorw)
- * @since 2.2.3
- */
- add_action( 'admin_footer', array( 'Freemius', '_prepend_fs_allow_updater_and_dialog_flag_url_param' ) );
- }
-
- $plugin_dir = dirname( $this->_plugin_dir_path ) . '/';
-
- /**
- * @since 1.2.2
- *
- * Hook to both free and premium version activations to support
- * auto deactivation on the other version activation.
- */
- register_activation_hook(
- $plugin_dir . $this->_free_plugin_basename,
- array( &$this, '_activate_plugin_event_hook' )
- );
-
- register_activation_hook(
- $plugin_dir . $this->premium_plugin_basename(),
- array( &$this, '_activate_plugin_event_hook' )
- );
- } else {
- add_action( 'after_switch_theme', array( &$this, '_activate_theme_event_hook' ), 10, 2 );
-
- add_action( 'admin_footer', array( &$this, '_style_premium_theme' ) );
- }
-
- /**
- * Part of the mechanism to identify new plugin install vs. plugin update.
- *
- * @author Vova Feldman (@svovaf)
- * @since 1.1.9
- */
- if ( empty( $this->_storage->was_plugin_loaded ) ) {
- /**
- * During the plugin activation (not theme), 'plugins_loaded' will be already executed
- * when the logic gets here since the activation logic first add the activate plugins,
- * then triggers 'plugins_loaded', and only then include the code of the plugin that
- * is activated. Which means that _plugins_loaded() will NOT be executed during the
- * plugin activation, and that IS intentional.
- *
- * @author Vova Feldman (@svovaf)
- */
- if ( $this->is_plugin() &&
- $this->is_activation_mode( false ) &&
- 0 == did_action( 'plugins_loaded' )
- ) {
- add_action( 'plugins_loaded', array( &$this, '_plugins_loaded' ) );
- } else {
- // If was activated before, then it was already loaded before.
- $this->_plugins_loaded();
- }
- }
-
- if ( ! self::is_ajax() ) {
- if ( ! $this->is_addon() ) {
- add_action( 'init', array( &$this, '_add_default_submenu_items' ), WP_FS__LOWEST_PRIORITY );
- }
- }
-
- if ( $this->_storage->handle_gdpr_admin_notice ) {
- add_action( 'init', array( &$this, '_maybe_show_gdpr_admin_notice' ) );
- }
-
- add_action( 'init', array( &$this, '_maybe_add_gdpr_optin_ajax_handler') );
- add_action( 'init', array( &$this, '_maybe_add_pricing_ajax_handler' ) );
- }
-
- if ( $this->is_plugin() ) {
- if ( $this->_is_network_active ) {
- add_action( 'wpmu_new_blog', array( $this, '_after_new_blog_callback' ), 10, 6 );
- }
-
- register_deactivation_hook( $this->_plugin_main_file_path, array( &$this, '_deactivate_plugin_hook' ) );
- }
-
- if ( is_multisite() ) {
- add_action( 'deactivate_blog', array( &$this, '_after_site_deactivated_callback' ) );
- add_action( 'archive_blog', array( &$this, '_after_site_deactivated_callback' ) );
- add_action( 'make_spam_blog', array( &$this, '_after_site_deactivated_callback' ) );
- add_action( 'deleted_blog', array( &$this, '_after_site_deleted_callback' ), 10, 2 );
-
- add_action( 'activate_blog', array( &$this, '_after_site_reactivated_callback' ) );
- add_action( 'unarchive_blog', array( &$this, '_after_site_reactivated_callback' ) );
- add_action( 'make_ham_blog', array( &$this, '_after_site_reactivated_callback' ) );
- }
-
- if ( $this->is_theme() &&
- self::is_customizer() &&
- $this->apply_filters( 'show_customizer_upsell', true )
- ) {
- // Register customizer upsell.
- add_action( 'customize_register', array( &$this, '_customizer_register' ) );
- }
-
- add_action( 'admin_init', array( &$this, '_redirect_on_clicked_menu_link' ), WP_FS__LOWEST_PRIORITY );
-
- if ( $this->is_theme() && ! $this->is_migration() ) {
- add_action( 'admin_init', array( &$this, '_add_tracking_links' ) );
- }
-
- add_action( 'admin_init', array( &$this, '_add_license_activation' ) );
- add_action( 'admin_init', array( &$this, '_add_premium_version_upgrade_selection' ) );
- add_action( 'admin_init', array( &$this, '_add_beta_mode_update_handler' ) );
- add_action( 'admin_init', array( &$this, '_add_user_change_option' ) );
-
- $this->add_ajax_action( 'update_billing', array( &$this, '_update_billing_ajax_action' ) );
- $this->add_ajax_action( 'start_trial', array( &$this, '_start_trial_ajax_action' ) );
- $this->add_ajax_action( 'set_data_debug_mode', array( &$this, '_set_data_debug_mode' ) );
- $this->add_ajax_action( 'toggle_whitelabel_mode', array( &$this, '_toggle_whitelabel_mode_ajax_handler' ) );
-
- if ( $this->_is_network_active && fs_is_network_admin() ) {
- $this->add_ajax_action( 'network_activate', array( &$this, '_network_activate_ajax_action' ) );
- }
-
- $this->add_ajax_action( 'install_premium_version', array(
- &$this,
- '_install_premium_version_ajax_action'
- ) );
-
- $this->add_ajax_action( 'submit_affiliate_application', array( &$this, '_submit_affiliate_application' ) );
-
- $this->add_action( 'after_plans_sync', array( &$this, '_check_for_trial_plans' ) );
-
- $this->add_action( 'sdk_version_update', array( &$this, '_sdk_version_update' ), WP_FS__DEFAULT_PRIORITY, 2 );
-
- $this->add_action(
- 'plugin_version_update',
- array( &$this, '_after_version_update' ),
- WP_FS__DEFAULT_PRIORITY,
- 2
- );
- $this->add_filter( 'after_code_type_change', array( &$this, '_after_code_type_change' ) );
-
- add_action( 'admin_init', array( &$this, '_add_trial_notice' ) );
- add_action( 'admin_init', array( &$this, '_add_affiliate_program_notice' ) );
- add_action( 'admin_enqueue_scripts', array( &$this, '_enqueue_common_css' ) );
-
- /**
- * Handle request to reset anonymous mode for `get_reconnect_url()`.
- *
- * @author Vova Feldman (@svovaf)
- * @since 1.2.1.5
- */
- if ( fs_request_is_action( 'reset_anonymous_mode' ) &&
- $this->get_unique_affix() === fs_request_get( 'fs_unique_affix' )
- ) {
- add_action( 'admin_init', array( &$this, 'connect_again' ) );
- }
- }
-
- /**
- * Register the required hooks right after the settings parse is completed.
- *
- * @author Vova Feldman (@svovaf)
- * @since 2.3.1
- */
- private function register_after_settings_parse_hooks() {
- if ( is_admin() &&
- $this->is_theme() &&
- $this->is_premium() &&
- ! $this->has_active_valid_license()
- ) {
- $this->add_ajax_action(
- 'delete_theme_update_data',
- array( &$this, '_delete_theme_update_data_action' )
- );
- }
-
- if ( $this->show_settings_with_tabs() ) {
- /**
- * Include the required hooks to capture the theme settings' page tabs
- * and cache them.
- *
- * @author Vova Feldman (@svovaf)
- * @since 1.2.2.7
- */
- if ( ! $this->_cache->has_valid( 'tabs' ) ) {
- add_action( 'admin_footer', array( &$this, '_tabs_capture' ) );
- // Add license activation AJAX callback.
- $this->add_ajax_action( 'store_tabs', array( &$this, '_store_tabs_ajax_action' ) );
-
- add_action( 'admin_enqueue_scripts', array( &$this, '_store_tabs_styles' ), 9999999 );
- }
-
- add_action(
- 'admin_footer',
- array( &$this, '_add_freemius_tabs' ),
- /**
- * The tabs JS code must be executed after the tabs capture logic (_tabs_capture()).
- * That's why the priority is 11 while the tabs capture logic is added
- * with priority 10.
- *
- * @author Vova Feldman (@svovaf)
- */
- 11
- );
- }
-
- if ( ! self::is_ajax() ) {
- if ( ! $this->is_addon() || $this->is_only_premium() ) {
- add_action(
- ( $this->_is_network_active && fs_is_network_admin() ? 'network_' : '' ) . 'admin_menu',
- array( &$this, '_prepare_admin_menu' ),
- WP_FS__LOWEST_PRIORITY
- );
- }
- }
- }
-
- /**
- * Makes Freemius-related updates unavailable on the "Add Plugins" admin page (/plugin-install.php) so that
- * they won't interfere with the .org plugins' functionalities on that page (e.g. updating of a .org plugin).
- *
- * @author Leo Fajardo (@leorw)
- * @since 2.2.3
- *
- * @param object $updates
- * @param string|null $transient
- *
- * @return object
- */
- static function _remove_fs_updates_from_plugin_install_page( $updates, $transient = null ) {
- if ( is_object( $updates ) && isset( $updates->response ) ) {
- foreach ( $updates->response as $file => $plugin ) {
- if ( isset( $plugin->package ) && false !== strpos( $plugin->package, 'api.freemius' ) ) {
- unset( $updates->response[ $file ] );
- }
- }
- }
-
- return $updates;
- }
-
- /**
- * Prepends the `fs_allow_updater_and_dialog` param to the plugin information URLs to tell the SDK to handle
- * the information that is shown on the plugin details dialog that is shown when the relevant link is clicked.
- *
- * @author Leo Fajardo (@leorw)
- * @since 2.2.3
- *
- * @return string
- */
- static function _prepend_fs_allow_updater_and_dialog_flag_url_param() {
- $slug_basename_map = array();
- foreach ( self::$_instances as $instance ) {
- if ( ! $instance->is_plugin() ) {
- continue;
- }
-
- $slug_basename_map[ $instance->get_slug() ] = $instance->premium_plugin_basename();
- }
- ?>
-
- is_beta() ) {
- $has_any_beta_version = true;
- break;
- }
- }
-
- if ( $has_any_beta_version ) {
- fs_enqueue_local_style( 'fs_plugins', '/admin/plugins.css' );
- }
- }
-
- /**
- * @author Leo Fajardo (@leorw)
- * @since 2.3.0
- */
- static function _maybe_add_beta_label_to_plugins_and_handle_confirmation() {
- $beta_data = array();
-
- foreach ( self::$_instances as $instance ) {
- if ( ! $instance->is_premium() ) {
- continue;
- }
-
- /**
- * If there's an available beta version update, a confirmation message will be shown when the
- * "Update now" link on the "Plugins" or "Themes" page is clicked.
- */
- $has_beta_update = $instance->has_beta_update();
-
- $is_beta = (
- // The "Beta" label is added separately for themes.
- $instance->is_plugin() &&
- $instance->is_beta()
- );
-
- if ( ! $is_beta && ! $has_beta_update ) {
- continue;
- }
-
- $beta_data[ $instance->get_plugin_basename() ] = array( 'is_installed_version_beta' => $is_beta );
-
- if ( ! $has_beta_update ) {
- continue;
- }
-
- $beta_data[ $instance->get_plugin_basename() ]['beta_version_update_confirmation_message'] = sprintf(
- '%s %s',
- sprintf(
- fs_esc_attr_inline(
- 'An update to a Beta version will replace your installed version of %s with the latest Beta release - use with caution, and not on production sites. You have been warned.',
- 'beta-version-update-caution',
- $instance->get_slug()
- ),
- $instance->get_plugin_title()
- ),
- fs_esc_attr_inline( 'Would you like to proceed with the update?', 'update-confirmation', $instance->get_slug() )
- );
- }
-
- if ( empty( $beta_data ) ) {
- return;
- }
- ?>
-
- _free_plugin_basename ] );
- unset( $uninstallable_plugins[ $this->premium_plugin_basename() ] );
-
- update_option( 'uninstall_plugins', $uninstallable_plugins );
- }
-
- /**
- * @since 1.2.0 Invalidate module's main file cache, otherwise, FS_Plugin_Updater will not fetch updates.
- *
- * @param bool $store_prev_path
- */
- private function clear_module_main_file_cache( $store_prev_path = true ) {
- if ( ! isset( $this->_storage->plugin_main_file ) ||
- empty( $this->_storage->plugin_main_file->path )
- ) {
- return;
- }
-
- if ( ! $store_prev_path ) {
- /**
- * Storing the previous path is not needed when clearing the cache after an SDK version update since
- * the main purpose of the cache clearing in that event is to correct a wrong plugin main file path
- * which causes data mix-up between plugins (e.g. titles and versions of an add-on and its parent plugin).
- *
- * @author Leo Fajardo (@leorw)
- * @since 2.2.1
- */
- unset( $this->_storage->plugin_main_file->path );
- } else {
- $plugin_main_file = clone $this->_storage->plugin_main_file;
-
- // Store cached path (2nd layer cache).
- $plugin_main_file->prev_path = $plugin_main_file->path;
-
- // Clear cached path.
- unset( $plugin_main_file->path );
-
- $this->_storage->plugin_main_file = $plugin_main_file;
- }
-
- /**
- * Clear global cached path.
- *
- * @author Leo Fajardo (@leorw)
- * @since 1.2.2
- */
- $id_slug_type_path_map = self::$_accounts->get_option( 'id_slug_type_path_map' );
- unset( $id_slug_type_path_map[ $this->_module_id ]['path'] );
- self::$_accounts->set_option( 'id_slug_type_path_map', $id_slug_type_path_map, true );
- }
-
- /**
- * @author Leo Fajardo (@leorw)
- * @since 2.0.0
- */
- function _hook_action_links_and_register_account_hooks() {
- if ( $this->is_migration() ) {
- return;
- }
-
- $this->_add_tracking_links();
-
- if ( self::is_plugins_page() && $this->is_plugin() ) {
- $this->hook_plugin_action_links();
- }
-
- $this->_register_account_hooks();
- }
-
- /**
- * @author Vova Feldman (@svovaf)
- * @since 1.0.9
- */
- private function _register_account_hooks() {
- if ( ! is_admin() ) {
- return;
- }
-
- /**
- * Always show the deactivation feedback form since we added
- * automatic free version deactivation upon premium code activation.
- *
- * @since 1.2.1.6
- */
- $this->add_ajax_action(
- 'submit_uninstall_reason',
- array( &$this, '_submit_uninstall_reason_action' )
- );
-
- $this->add_ajax_action(
- 'cancel_subscription_or_trial',
- array( &$this, 'cancel_subscription_or_trial_ajax_action' )
- );
-
- if ( ! $this->is_addon() || $this->is_parent_plugin_installed() ) {
- if ( ( $this->is_plugin() && self::is_plugins_page() ) ||
- ( $this->is_theme() && self::is_themes_page() )
- ) {
- add_action( 'admin_footer', array( &$this, '_add_deactivation_feedback_dialog_box' ) );
- }
- }
- }
-
- /**
- * Leverage backtrace to find caller plugin file path.
- *
- * @author Vova Feldman (@svovaf)
- * @since 1.0.6
- *
- * @param bool $is_init Is initiation sequence.
- *
- * @return string
- */
- private function _find_caller_plugin_file( $is_init = false ) {
- // Try to load the cached value of the file path.
- if ( isset( $this->_storage->plugin_main_file ) ) {
- $plugin_main_file = $this->_storage->plugin_main_file;
- if ( ! empty( $plugin_main_file->path ) ) {
- $absolute_path = $this->get_absolute_path( $plugin_main_file->path );
- if ( file_exists( $absolute_path ) ) {
- return $absolute_path;
- }
- }
- }
-
- /**
- * @since 1.2.1
- *
- * `clear_module_main_file_cache()` is clearing the plugin's cached path on
- * deactivation. Therefore, if any plugin/theme was initiating `Freemius`
- * with that plugin's slug, it was overriding the empty plugin path with a wrong path.
- *
- * So, we've added a special mechanism with a 2nd layer of cache that uses `prev_path`
- * when the class instantiator isn't the module.
- */
- if ( ! $is_init ) {
- // Fetch prev path cache.
- if ( isset( $this->_storage->plugin_main_file ) &&
- ! empty( $this->_storage->plugin_main_file->prev_path )
- ) {
- $absolute_path = $this->get_absolute_path( $this->_storage->plugin_main_file->prev_path );
- if ( file_exists( $absolute_path ) ) {
- return $absolute_path;
- }
- }
-
- wp_die(
- $this->get_text_inline( 'Freemius SDK couldn\'t find the plugin\'s main file. Please contact sdk@freemius.com with the current error.', 'failed-finding-main-path' ) .
- " Module: {$this->_slug}; SDK: " . WP_FS__SDK_VERSION . ";",
- $this->get_text_inline( 'Error', 'error' ),
- array( 'back_link' => true )
- );
- }
-
- /**
- * @since 1.2.1
- *
- * Only the original instantiator that calls dynamic_init can modify the module's path.
- */
- // Find caller module.
- $id_slug_type_path_map = self::$_accounts->get_option( 'id_slug_type_path_map', array() );
- $this->_storage->plugin_main_file = (object) array(
- 'path' => $id_slug_type_path_map[ $this->_module_id ]['path'],
- );
-
- return $this->get_absolute_path( $id_slug_type_path_map[ $this->_module_id ]['path'] );
- }
-
- /**
- * @author Leo Fajardo (@leorw)
- * @since 1.2.3
- *
- * @param string $path
- *
- * @return string
- */
- private function get_relative_path( $path ) {
- $module_root_dir = $this->get_module_root_dir_path();
- if ( 0 === strpos( $path, $module_root_dir ) ) {
- $path = substr( $path, strlen( $module_root_dir ) );
- }
-
- return $path;
- }
-
- /**
- * @author Leo Fajardo (@leorw)
- * @since 1.2.3
- *
- * @param string $path
- * @param string|bool $module_type
- *
- * @return string
- */
- private function get_absolute_path( $path, $module_type = false ) {
- $module_root_dir = $this->get_module_root_dir_path( $module_type );
- if ( 0 !== strpos( $path, $module_root_dir ) ) {
- $path = fs_normalize_path( $module_root_dir . $path );
- }
-
- return $path;
- }
-
- /**
- * @author Leo Fajardo (@leorw)
- * @since 1.2.3
- *
- * @param string|bool $module_type
- *
- * @return string
- */
- private function get_module_root_dir_path( $module_type = false ) {
- $is_plugin = empty( $module_type ) ?
- $this->is_plugin() :
- ( WP_FS__MODULE_TYPE_PLUGIN === $module_type );
-
- return fs_normalize_path( trailingslashit( $is_plugin ?
- WP_PLUGIN_DIR :
- get_theme_root( get_stylesheet() ) ) );
- }
-
- /**
- * @author Leo Fajardo (@leorw)
- *
- * @param number $module_id
- * @param string $slug
- *
- * @since 1.2.2
- */
- private function store_id_slug_type_path_map( $module_id, $slug ) {
- $id_slug_type_path_map = self::$_accounts->get_option( 'id_slug_type_path_map', array() );
-
- $store_option = false;
-
- if ( ! isset( $id_slug_type_path_map[ $module_id ] ) ) {
- $id_slug_type_path_map[ $module_id ] = array(
- 'slug' => $slug
- );
-
- $store_option = true;
- } else if (
- isset( $id_slug_type_path_map[ $module_id ]['slug'] ) &&
- $slug !== $id_slug_type_path_map[ $module_id ]['slug']
- ) {
- $id_slug_type_path_map[ $module_id ]['slug'] = $slug;
- $store_option = true;
- }
-
- if ( empty( $id_slug_type_path_map[ $module_id ]['path'] ) ||
- /**
- * This verification is for cases when suddenly the same module
- * is installed but with a different folder name.
- *
- * @author Vova Feldman (@svovaf)
- * @since 1.2.3
- */
- ! file_exists( $this->get_absolute_path(
- $id_slug_type_path_map[ $module_id ]['path'],
- $id_slug_type_path_map[ $module_id ]['type']
- ) )
- ) {
- $caller_main_file_and_type = $this->get_caller_main_file_and_type();
-
- $id_slug_type_path_map[ $module_id ]['type'] = $caller_main_file_and_type->module_type;
- $id_slug_type_path_map[ $module_id ]['path'] = $caller_main_file_and_type->path;
-
- $store_option = true;
- }
-
- if ( $store_option ) {
- self::$_accounts->set_option( 'id_slug_type_path_map', $id_slug_type_path_map, true );
- }
- }
-
- /**
- * Identifies the caller type: plugin or theme.
- *
- * @author Leo Fajardo (@leorw)
- * @since 1.2.2
- *
- * @author Vova Feldman (@svovaf)
- * @since 1.2.2.3 Find the earliest module in the call stack that calls to the SDK. This fix is for cases when
- * add-ons are relying on loading the SDK from the parent module, and also allows themes including the
- * SDK an internal file instead of directly from functions.php.
- * @since 1.2.1.7 Knows how to handle cases when an add-on includes the parent module logic.
- */
- private function get_caller_main_file_and_type() {
- self::require_plugin_essentials();
-
- $all_plugins = fs_get_plugins( true );
- $all_plugins_paths = array();
-
- // Get active plugin's main files real full names (might be symlinks).
- foreach ( $all_plugins as $relative_path => $data ) {
- if ( false === strpos( fs_normalize_path( $relative_path ), '/' ) ) {
- /**
- * Ignore plugins that don't have a folder (e.g. Hello Dolly) since they
- * can't really include the SDK.
- *
- * @author Vova Feldman
- * @since 1.2.1.7
- */
- continue;
- }
-
- $all_plugins_paths[] = fs_normalize_path( realpath( WP_PLUGIN_DIR . '/' . $relative_path ) );
- }
-
- $caller_file_candidate = false;
- $caller_map = array();
- $module_type = WP_FS__MODULE_TYPE_PLUGIN;
- $themes_dir = fs_normalize_path( get_theme_root( get_stylesheet() ) );
- $plugin_dir_to_skip = false;
-
- for ( $i = 1, $bt = debug_backtrace(), $len = count( $bt ); $i < $len; $i ++ ) {
- if ( empty( $bt[ $i ]['file'] ) ) {
- continue;
- }
-
- if ( $i > 1 && ! empty( $bt[ $i - 1 ]['file'] ) && $bt[ $i ]['file'] === $bt[ $i - 1 ]['file'] ) {
- // If file same as the prev file in the stack, skip it.
- continue;
- }
-
- if ( ! empty( $bt[ $i ]['function'] ) && in_array( $bt[ $i ]['function'], array(
- 'do_action',
- 'apply_filter',
- // The string split is stupid, but otherwise, theme check
- // throws info notices.
- 'requir' . 'e_once',
- 'requir' . 'e',
- 'includ' . 'e_once',
- 'includ' . 'e',
- 'install_and_activate_plugin',
- 'try_activate_plugin',
- 'activate_plugin'
- ) )
- ) {
- if ( 'activate_plugin' === $bt[ $i ]['function'] ) {
- /**
- * Store the directory of the activator plugin so that any other file that starts with it
- * cannot be mistakenly chosen as a candidate caller file.
- *
- * @author Leo Fajardo
- *
- * @since 2.3.0
- */
- $caller_file_path = fs_normalize_path( $bt[ $i ]['file'] );
-
- foreach ( $all_plugins_paths as $plugin_path ) {
- $plugin_dir = fs_normalize_path( dirname( $plugin_path ) . '/' );
- if ( false !== strpos( $caller_file_path, $plugin_dir ) ) {
- $plugin_dir_to_skip = $plugin_dir;
-
- break;
- }
- }
- }
-
- // Ignore call stack hooks and files inclusion.
- continue;
- }
-
- $caller_file_path = fs_normalize_path( $bt[ $i ]['file'] );
-
- if ( ! empty( $plugin_dir_to_skip ) ) {
- /**
- * Skip if it's an activator plugin file to avoid mistakenly choosing it as a candidate caller file.
- *
- * @author Leo Fajardo
- *
- * @since 2.3.0
- */
- if ( 0 === strpos( $caller_file_path, $plugin_dir_to_skip ) ) {
- continue;
- }
- }
-
- if ( 'functions.php' === basename( $caller_file_path ) ) {
- /**
- * 1. Assumes that theme's starting execution file is functions.php.
- * 2. This complex logic fixes symlink issues (e.g. with Vargant).
- *
- * @author Vova Feldman (@svovaf)
- * @since 1.2.2.5
- */
-
- if ( $caller_file_path == fs_normalize_path( realpath( trailingslashit( $themes_dir ) . basename( dirname( $caller_file_path ) ) . '/' . basename( $caller_file_path ) ) ) ) {
- $module_type = WP_FS__MODULE_TYPE_THEME;
-
- /**
- * Relative path of the theme, e.g.:
- * `my-theme/functions.php`
- *
- * @author Leo Fajardo (@leorw)
- */
- $caller_file_candidate = basename( dirname( $caller_file_path ) ) .
- '/' .
- basename( $caller_file_path );
-
- continue;
- }
- }
-
- $caller_file_hash = md5( $caller_file_path );
-
- if ( ! isset( $caller_map[ $caller_file_hash ] ) ) {
- foreach ( $all_plugins_paths as $plugin_path ) {
- if ( empty( $plugin_path ) ) {
- continue;
- }
-
- if ( false !== strpos( $caller_file_path, fs_normalize_path( dirname( $plugin_path ) . '/' ) ) ) {
- $caller_map[ $caller_file_hash ] = fs_normalize_path( $plugin_path );
- break;
- }
- }
- }
-
- if ( isset( $caller_map[ $caller_file_hash ] ) ) {
- $module_type = WP_FS__MODULE_TYPE_PLUGIN;
- $caller_file_candidate = plugin_basename( $caller_map[ $caller_file_hash ] );
- }
- }
-
- return (object) array(
- 'module_type' => $module_type,
- 'path' => $caller_file_candidate
- );
- }
-
- #----------------------------------------------------------------------------------
- #region Deactivation Feedback Form
- #----------------------------------------------------------------------------------
-
- /**
- * Displays a confirmation and feedback dialog box when the user clicks on the "Deactivate" link on the plugins
- * page.
- *
- * @author Vova Feldman (@svovaf)
- * @author Leo Fajardo (@leorw)
- *
- * @since 1.1.2
- */
- function _add_deactivation_feedback_dialog_box() {
- $subscription_cancellation_dialog_box_template_params = $this->apply_filters( 'show_deactivation_subscription_cancellation', true ) ?
- $this->_get_subscription_cancellation_dialog_box_template_params() :
- array();
-
- /**
- * @since 2.3.0 Developers can optionally hide the deactivation feedback form using the 'show_deactivation_feedback_form' filter.
- */
- $show_deactivation_feedback_form = true;
- if ( $this->has_filter( 'show_deactivation_feedback_form' ) ) {
- $show_deactivation_feedback_form = $this->apply_filters( 'show_deactivation_feedback_form', true );
- } else if ( $this->is_addon() ) {
- /**
- * If the add-on's 'show_deactivation_feedback_form' is not set, try to inherit the value from the parent.
- */
- $show_deactivation_feedback_form = $this->get_parent_instance()->apply_filters( 'show_deactivation_feedback_form', true );
- }
-
- $uninstall_confirmation_message = $this->apply_filters( 'uninstall_confirmation_message', '' );
-
- if (
- empty( $subscription_cancellation_dialog_box_template_params ) &&
- ! $show_deactivation_feedback_form &&
- empty( $uninstall_confirmation_message )
- ) {
- return;
- }
-
- $vars = array( 'id' => $this->_module_id );
-
- if ( $show_deactivation_feedback_form ) {
- /* Check the type of user:
- * 1. Long-term (long-term)
- * 2. Non-registered and non-anonymous short-term (non-registered-and-non-anonymous-short-term).
- * 3. Short-term (short-term)
- */
- $is_long_term_user = true;
-
- // Check if the site is at least 2 days old.
- $time_installed = $this->_storage->install_timestamp;
-
- // Difference in seconds.
- $date_diff = time() - $time_installed;
-
- // Convert seconds to days.
- $date_diff_days = floor( $date_diff / ( 60 * 60 * 24 ) );
-
- if ( $date_diff_days < 2 ) {
- $is_long_term_user = false;
- }
-
- $is_long_term_user = $this->apply_filters( 'is_long_term_user', $is_long_term_user );
-
- if ( $is_long_term_user ) {
- $user_type = 'long-term';
- } else {
- if ( ! $this->is_registered() && ! $this->is_anonymous() ) {
- $user_type = 'non-registered-and-non-anonymous-short-term';
- } else {
- $user_type = 'short-term';
- }
- }
-
- $uninstall_reasons = $this->_get_uninstall_reasons( $user_type );
-
- $vars['reasons'] = $uninstall_reasons;
- }
-
- $vars['subscription_cancellation_dialog_box_template_params'] = &$subscription_cancellation_dialog_box_template_params;
- $vars['show_deactivation_feedback_form'] = $show_deactivation_feedback_form;
- $vars['uninstall_confirmation_message'] = $uninstall_confirmation_message;
-
- /**
- * Load the HTML template for the deactivation feedback dialog box.
- *
- * @todo Deactivation form core functions should be loaded only once! Otherwise, when there are multiple Freemius powered plugins the same code is loaded multiple times. The only thing that should be loaded differently is the various deactivation reasons object based on the state of the plugin.
- */
- fs_require_template( 'forms/deactivation/form.php', $vars );
- }
-
- /**
- * @author Leo Fajardo (@leorw)
- * @since 1.1.2
- *
- * @param string $user_type
- *
- * @return array The uninstall reasons for the specified user type.
- */
- function _get_uninstall_reasons( $user_type = 'long-term' ) {
- $module_type = $this->_module_type;
-
- $internal_message_template_var = array(
- 'id' => $this->_module_id
- );
-
- $plan = $this->get_plan();
-
- if ( $this->is_registered() && is_object( $plan ) && $plan->has_technical_support() ) {
- $contact_support_template = fs_get_template( 'forms/deactivation/contact.php', $internal_message_template_var );
- } else {
- $contact_support_template = '';
- }
-
- $reason_found_better_plugin = array(
- 'id' => self::REASON_FOUND_A_BETTER_PLUGIN,
- 'text' => sprintf( $this->get_text_inline( 'I found a better %s', 'reason-found-a-better-plugin' ), $module_type ),
- 'input_type' => 'textfield',
- 'input_placeholder' => sprintf( $this->get_text_inline( "What's the %s's name?", 'placeholder-plugin-name' ), $module_type ),
- );
-
- $reason_temporary_deactivation = array(
- 'id' => self::REASON_TEMPORARY_DEACTIVATION,
- 'text' => sprintf(
- $this->get_text_inline( "It's a temporary %s. I'm just debugging an issue.", 'reason-temporary-x' ),
- strtolower( $this->is_plugin() ?
- $this->get_text_inline( 'Deactivation', 'deactivation' ) :
- $this->get_text_inline( 'Theme Switch', 'theme-switch' )
- )
- ),
- 'input_type' => '',
- 'input_placeholder' => ''
- );
-
- $reason_other = array(
- 'id' => self::REASON_OTHER,
- 'text' => $this->get_text_inline( 'Other', 'reason-other' ),
- 'input_type' => 'textfield',
- 'input_placeholder' => ''
- );
-
- $long_term_user_reasons = array(
- array(
- 'id' => self::REASON_NO_LONGER_NEEDED,
- 'text' => sprintf( $this->get_text_inline( 'I no longer need the %s', 'reason-no-longer-needed' ), $module_type ),
- 'input_type' => '',
- 'input_placeholder' => ''
- ),
- $reason_found_better_plugin,
- array(
- 'id' => self::REASON_NEEDED_FOR_A_SHORT_PERIOD,
- 'text' => sprintf( $this->get_text_inline( 'I only needed the %s for a short period', 'reason-needed-for-a-short-period' ), $module_type ),
- 'input_type' => '',
- 'input_placeholder' => ''
- ),
- array(
- 'id' => self::REASON_BROKE_MY_SITE,
- 'text' => sprintf( $this->get_text_inline( 'The %s broke my site', 'reason-broke-my-site' ), $module_type ),
- 'input_type' => '',
- 'input_placeholder' => '',
- 'internal_message' => $contact_support_template
- ),
- array(
- 'id' => self::REASON_SUDDENLY_STOPPED_WORKING,
- 'text' => sprintf( $this->get_text_inline( 'The %s suddenly stopped working', 'reason-suddenly-stopped-working' ), $module_type ),
- 'input_type' => '',
- 'input_placeholder' => '',
- 'internal_message' => $contact_support_template
- )
- );
-
- if ( $this->is_paying() ) {
- $long_term_user_reasons[] = array(
- 'id' => self::REASON_CANT_PAY_ANYMORE,
- 'text' => $this->get_text_inline( "I can't pay for it anymore", 'reason-cant-pay-anymore' ),
- 'input_type' => 'textfield',
- 'input_placeholder' => $this->get_text_inline( 'What price would you feel comfortable paying?', 'placeholder-comfortable-price' )
- );
- }
-
- $reason_dont_share_info = array(
- 'id' => self::REASON_DONT_LIKE_TO_SHARE_MY_INFORMATION,
- 'text' => $this->get_text_inline( "I don't like to share my information with you", 'reason-dont-like-to-share-my-information' ),
- 'input_type' => '',
- 'input_placeholder' => ''
- );
-
- /**
- * If the current user has selected the "don't share data" reason in the deactivation feedback modal, inform the
- * user by showing additional message that he doesn't have to share data and can just choose to skip the opt-in
- * (the Skip button is included in the message to show). This message will only be shown if anonymous mode is
- * enabled and the user's account is currently not in pending activation state (similar to the way the Skip
- * button in the opt-in form is shown/hidden).
- */
- if ( $this->is_enable_anonymous() && ! $this->is_pending_activation() ) {
- $reason_dont_share_info['internal_message'] = fs_get_template( 'forms/deactivation/retry-skip.php', $internal_message_template_var );
- }
-
- $uninstall_reasons = array(
- 'long-term' => $long_term_user_reasons,
- 'non-registered-and-non-anonymous-short-term' => array(
- array(
- 'id' => self::REASON_DIDNT_WORK,
- 'text' => sprintf( $this->get_text_inline( "The %s didn't work", 'reason-didnt-work' ), $module_type ),
- 'input_type' => '',
- 'input_placeholder' => ''
- ),
- $reason_dont_share_info,
- $reason_found_better_plugin
- ),
- 'short-term' => array(
- array(
- 'id' => self::REASON_COULDNT_MAKE_IT_WORK,
- 'text' => $this->get_text_inline( "I couldn't understand how to make it work", 'reason-couldnt-make-it-work' ),
- 'input_type' => '',
- 'input_placeholder' => '',
- 'internal_message' => $contact_support_template
- ),
- $reason_found_better_plugin,
- array(
- 'id' => self::REASON_GREAT_BUT_NEED_SPECIFIC_FEATURE,
- 'text' => sprintf( $this->get_text_inline( "The %s is great, but I need specific feature that you don't support", 'reason-great-but-need-specific-feature' ), $module_type ),
- 'input_type' => 'textarea',
- 'input_placeholder' => $this->get_text_inline( 'What feature?', 'placeholder-feature' )
- ),
- array(
- 'id' => self::REASON_NOT_WORKING,
- 'text' => sprintf( $this->get_text_inline( 'The %s is not working', 'reason-not-working' ), $module_type ),
- 'input_type' => 'textarea',
- 'input_placeholder' => $this->get_text_inline( "Kindly share what didn't work so we can fix it for future users...", 'placeholder-share-what-didnt-work' )
- ),
- array(
- 'id' => self::REASON_NOT_WHAT_I_WAS_LOOKING_FOR,
- 'text' => $this->get_text_inline( "It's not what I was looking for", 'reason-not-what-i-was-looking-for' ),
- 'input_type' => 'textarea',
- 'input_placeholder' => $this->get_text_inline( "What you've been looking for?", 'placeholder-what-youve-been-looking-for' )
- ),
- array(
- 'id' => self::REASON_DIDNT_WORK_AS_EXPECTED,
- 'text' => sprintf( $this->get_text_inline( "The %s didn't work as expected", 'reason-didnt-work-as-expected' ), $module_type ),
- 'input_type' => 'textarea',
- 'input_placeholder' => $this->get_text_inline( 'What did you expect?', 'placeholder-what-did-you-expect' )
- )
- )
- );
-
- // Randomize the reasons for the current user type.
- shuffle( $uninstall_reasons[ $user_type ] );
-
- // Keep the following reasons as the last items in the list.
- $uninstall_reasons[ $user_type ][] = $reason_temporary_deactivation;
- $uninstall_reasons[ $user_type ][] = $reason_other;
-
- $uninstall_reasons = $this->apply_filters( 'uninstall_reasons', $uninstall_reasons );
-
- return $uninstall_reasons[ $user_type ];
- }
-
- /**
- * Called after the user has submitted his reason for deactivating the plugin.
- *
- * @author Leo Fajardo (@leorw)
- * @since 1.1.2
- */
- function _submit_uninstall_reason_action() {
- $this->_logger->entrance();
-
- $this->check_ajax_referer( 'submit_uninstall_reason' );
-
- $reason_id = fs_request_get( 'reason_id' );
-
- // Check if the given reason ID is an unsigned integer.
- if ( ! ctype_digit( $reason_id ) ) {
- exit;
- }
-
- $reason_info = trim( fs_request_get( 'reason_info', '' ) );
- if ( ! empty( $reason_info ) ) {
- $reason_info = substr( $reason_info, 0, 128 );
- }
-
- $reason = (object) array(
- 'id' => $reason_id,
- 'info' => $reason_info,
- 'is_anonymous' => fs_request_get_bool( 'is_anonymous' )
- );
-
- $this->_storage->store( 'uninstall_reason', $reason );
-
- /**
- * If the module type is "theme", trigger the uninstall event here (on theme deactivation) since themes do
- * not support uninstall hook.
- *
- * @author Leo Fajardo (@leorw)
- * @since 1.2.2
- */
- if ( $this->is_theme() ) {
- if ( $this->is_premium() && ! $this->has_active_valid_license() ) {
- FS_Plugin_Updater::instance( $this )->delete_update_data();
- }
-
- $this->_uninstall_plugin_event( false );
- $this->remove_sdk_reference();
- }
-
- // Print '1' for successful operation.
- echo 1;
- exit;
- }
-
- /**
- * @author Leo Fajardo (@leorw)
- * @since 2.1.4
- */
- function cancel_subscription_or_trial_ajax_action() {
- $this->_logger->entrance();
-
- $this->check_ajax_referer( 'cancel_subscription_or_trial' );
-
- $result = $this->cancel_subscription_or_trial( fs_request_get( 'plugin_id', $this->get_id() ), false );
-
- if ( $this->is_api_error( $result ) ) {
- $this->shoot_ajax_failure( $result->error->message );
- }
-
- $this->shoot_ajax_success();
- }
-
- /**
- * @author Leo Fajardo (@leorw)
- * @since 2.1.4
- *
- * @param number $plugin_id
- *
- * @return object
- */
- private function cancel_subscription_or_trial( $plugin_id ) {
- $fs = null;
- if ( $plugin_id == $this->get_id() ) {
- $fs = $this;
- } else if ( $this->is_addon_activated( $plugin_id ) ) {
- $fs = self::get_instance_by_id( $plugin_id );
- }
-
- $result = null;
-
- if ( ! is_null( $fs ) ) {
- $result = $fs->is_paid_trial() ?
- $fs->_cancel_trial() :
- $fs->_downgrade_site();
- }
-
- return $result;
- }
-
- /**
- * @author Leo Fajardo (@leorw)
- * @since 2.0.2
- */
- function _delete_theme_update_data_action() {
- FS_Plugin_Updater::instance( $this )->delete_update_data();
- }
-
- #endregion
-
- #----------------------------------------------------------------------------------
- #region Instance
- #----------------------------------------------------------------------------------
-
- /**
- * Main singleton instance.
- *
- * @author Vova Feldman (@svovaf)
- * @since 1.0.0
- *
- * @param number $module_id
- * @param string|bool $slug
- * @param bool $is_init Is initiation sequence.
- *
- * @return Freemius|false
- */
- static function instance( $module_id, $slug = false, $is_init = false ) {
- if ( empty( $module_id ) ) {
- return false;
- }
-
- /**
- * Load the essential static data prior to initiating FS_Plugin_Manager since there's an essential MS network migration logic that needs to be executed prior to the initiation.
- */
- self::_load_required_static();
-
- if ( ! is_numeric( $module_id ) ) {
- if ( ! $is_init && true === $slug ) {
- $is_init = true;
- }
-
- $slug = $module_id;
-
- $module = FS_Plugin_Manager::instance( $slug )->get();
-
- if ( is_object( $module ) ) {
- $module_id = $module->id;
- }
- }
-
- $key = 'm_' . $module_id;
-
- if ( ! isset( self::$_instances[ $key ] ) ) {
- self::$_instances[ $key ] = new Freemius( $module_id, $slug, $is_init );
- }
-
- return self::$_instances[ $key ];
- }
-
- /**
- * @author Vova Feldman (@svovaf)
- * @since 1.0.6
- *
- * @param number $addon_id
- *
- * @return bool
- */
- private static function has_instance( $addon_id ) {
- return isset( self::$_instances[ 'm_' . $addon_id ] );
- }
-
- /**
- * @author Leo Fajardo (@leorw)
- * @since 1.2.2
- *
- * @param string|number $id_or_slug
- * @param string $module_type
- *
- * @return number|false
- */
- private static function get_module_id( $id_or_slug, $module_type = WP_FS__MODULE_TYPE_PLUGIN ) {
- if ( is_numeric( $id_or_slug ) ) {
- return $id_or_slug;
- }
-
- foreach ( self::$_instances as $instance ) {
- // Also check the module type since there can be a plugin and a theme with the same slug.
- if ( ( $module_type === $instance->get_module_type() ) && ( $id_or_slug === $instance->get_slug() ) ) {
- return $instance->get_id();
- }
- }
-
- return false;
- }
-
- /**
- * @author Vova Feldman (@svovaf)
- * @since 1.0.6
- *
- * @param number $id
- *
- * @return false|Freemius
- */
- static function get_instance_by_id( $id ) {
- return isset ( self::$_instances[ 'm_' . $id ] ) ?
- self::$_instances[ 'm_' . $id ] :
- false;
- }
-
- /**
- *
- * @author Vova Feldman (@svovaf)
- * @since 1.0.1
- *
- * @param string $plugin_file
- * @param string $module_type
- *
- * @return false|Freemius
- */
- static function get_instance_by_file( $plugin_file, $module_type = WP_FS__MODULE_TYPE_PLUGIN ) {
- $slug = self::find_slug_by_basename( $plugin_file );
-
- return ( false !== $slug ) ?
- self::instance( self::get_module_id( $slug, $module_type ) ) :
- false;
- }
-
- /**
- * @author Vova Feldman (@svovaf)
- * @since 1.0.6
- *
- * @return false|Freemius
- */
- function get_parent_instance() {
- return self::get_instance_by_id( $this->_plugin->parent_plugin_id );
- }
-
- /**
- * @author Vova Feldman (@svovaf)
- * @since 1.0.6
- *
- * @param string|number $id_or_slug
- *
- * @return false|Freemius
- */
- function get_addon_instance( $id_or_slug ) {
- $addon_id = self::get_module_id( $id_or_slug );
-
- return self::instance( $addon_id );
- }
-
- #endregion ------------------------------------------------------------------
-
- /**
- * @author Vova Feldman (@svovaf)
- * @since 1.0.6
- *
- * @return bool
- */
- function is_parent_plugin_installed() {
- $is_active = self::has_instance( $this->_plugin->parent_plugin_id );
-
- if ( $is_active ) {
- return true;
- }
-
- /**
- * Parent module might be a theme. If that's the case, the add-on's FS
- * instance will be loaded prior to the theme's FS instance, therefore,
- * we need to check if it's active with a "look ahead".
- *
- * @author Vova Feldman
- * @since 1.2.2.3
- */
- global $fs_active_plugins;
- if ( is_object( $fs_active_plugins ) && is_array( $fs_active_plugins->plugins ) ) {
- $active_theme = wp_get_theme();
-
- foreach ( $fs_active_plugins->plugins as $sdk => $module ) {
- if ( WP_FS__MODULE_TYPE_THEME === $module->type ) {
- if ( $module->plugin_path == $active_theme->get_stylesheet() ) {
- // Parent module is a theme and it's currently active.
- return true;
- }
- }
- }
- }
-
- return false;
- }
-
- /**
- * Check if add-on parent plugin in activation mode.
- *
- * @author Vova Feldman (@svovaf)
- * @since 1.0.7
- *
- * @return bool
- */
- function is_parent_in_activation() {
- $parent_fs = $this->get_parent_instance();
- if ( ! is_object( $parent_fs ) ) {
- return false;
- }
-
- return ( $parent_fs->is_activation_mode() );
- }
-
- /**
- * Is plugin in activation mode.
- *
- * @author Vova Feldman (@svovaf)
- * @since 1.0.7
- *
- * @param bool $and_on
- *
- * @return bool
- */
- function is_activation_mode( $and_on = true ) {
- return fs_is_network_admin() ?
- $this->is_network_activation_mode( $and_on ) :
- $this->is_site_activation_mode( $and_on );
- }
-
- /**
- * Is plugin in activation mode.
- *
- * @author Vova Feldman (@svovaf)
- * @since 1.0.7
- *
- * @param bool $and_on
- *
- * @return bool
- */
- function is_site_activation_mode( $and_on = true ) {
- return (
- ( $this->is_on() || ! $and_on ) &&
- (
- ( $this->is_premium() && true === $this->_storage->require_license_activation ) ||
- (
- ( ! $this->is_registered() ||
- ( $this->is_only_premium() && ! $this->has_features_enabled_license() ) ) &&
- ( ! $this->is_enable_anonymous() ||
- ( ! $this->is_anonymous() && ! $this->is_pending_activation() ) )
- )
- )
- );
- }
-
- /**
- * Checks if the SDK in network activation mode.
- *
- * @author Leo Fajardo (@leorw)
- * @since 2.0.0
- *
- * @param bool $and_on
- *
- * @return bool
- */
- private function is_network_activation_mode( $and_on = true ) {
- if ( ! $this->_is_network_active ) {
- // Not network activated.
- return false;
- }
-
- if ( $this->is_network_upgrade_mode() ) {
- // Special flag to enforce network activation mode to decide what to do with the sites that are not yet opted-in nor skipped.
- return true;
- }
-
- if ( ! $this->is_site_activation_mode( $and_on ) ) {
- // Whether the context is single site or the network, if the plugin is no longer in activation mode then it is not in network activation mode as well.
- return false;
- }
-
- if ( $this->is_network_delegated_connection() ) {
- // Super-admin delegated the connection to the site admins -> not activation mode.
- return false;
- }
-
- if ( $this->is_network_anonymous() && true !== $this->_storage->require_license_activation ) {
- // Super-admin skipped the connection network wide -> not activation mode.
- return false;
- }
-
- if ( $this->is_network_registered() ) {
- // Super-admin connected at least one site -> not activation mode.
- return false;
- }
-
- return true;
- }
-
- /**
- * Check if current page is the opt-in/pending-activation page.
- *
- * @author Vova Feldman (@svovaf)
- * @since 1.2.1.7
- *
- * @return bool
- */
- function is_activation_page() {
- if ( $this->_menu->is_activation_page( $this->show_opt_in_on_themes_page() ) ) {
- return true;
- }
-
- if ( ! $this->is_activation_mode() ) {
- return false;
- }
-
- // Check if current page is matching the activation page.
- return $this->is_matching_url( $this->get_activation_url() );
- }
-
- /**
- * Check if URL path's are matching and that all querystring
- * arguments of the $sub_url exist in the $url with the same values.
- *
- * WARNING:
- * 1. This method doesn't check if the sub/domain are matching.
- * 2. Ignore case sensitivity.
- *
- * @author Vova Feldman (@svovaf)
- * @since 1.2.1.7
- *
- * @param string $sub_url
- * @param string $url If argument is not set, check if the sub_url matching the current's page URL.
- *
- * @return bool
- */
- private function is_matching_url( $sub_url, $url = '' ) {
- if ( empty( $url ) ) {
- $url = $_SERVER['REQUEST_URI'];
- }
-
- $url = strtolower( $url );
- $sub_url = strtolower( $sub_url );
-
- if ( parse_url( $sub_url, PHP_URL_PATH ) !== parse_url( $url, PHP_URL_PATH ) ) {
- // Different path - DO NOT OVERRIDE PAGE.
- return false;
- }
-
- $url_params = array();
- parse_str( parse_url( $url, PHP_URL_QUERY ), $url_params );
-
- $sub_url_params = array();
- parse_str( parse_url( $sub_url, PHP_URL_QUERY ), $sub_url_params );
-
- foreach ( $sub_url_params as $key => $val ) {
- if ( ! isset( $url_params[ $key ] ) || $val != $url_params[ $key ] ) {
- // Not matching query string - DO NOT OVERRIDE PAGE.
- return false;
- }
- }
-
- return true;
- }
-
- /**
- * Get the basenames of all active plugins for specific blog. Including network activated plugins.
- *
- * @author Vova Feldman (@svovaf)
- * @since 2.0.0
- *
- * @param int $blog_id
- *
- * @return string[]
- */
- private static function get_active_plugins_basenames( $blog_id = 0 ) {
- if ( is_multisite() && $blog_id > 0 ) {
- $active_basenames = get_blog_option( $blog_id, 'active_plugins' );
- } else {
- $active_basenames = get_option( 'active_plugins' );
- }
-
- if ( ! is_array( $active_basenames ) ) {
- $active_basenames = array();
- }
-
- if ( is_multisite() ) {
- $network_active_basenames = get_site_option( 'active_sitewide_plugins' );
-
- if ( is_array( $network_active_basenames ) && ! empty( $network_active_basenames ) ) {
- $active_basenames = array_merge( $active_basenames, array_keys( $network_active_basenames ) );
- }
- }
-
- return $active_basenames;
- }
-
- /**
- * @author Leo Fajardo (@leorw)
- * @since 2.3.0
- *
- * @param int $blog_id
- *
- * @return array
- */
- static function get_active_plugins_directories_map( $blog_id = 0 ) {
- $active_basenames = self::get_active_plugins_basenames( $blog_id );
-
- $map = array();
-
- foreach ( $active_basenames as $active_basename ) {
- $active_basename = fs_normalize_path( $active_basename );
-
- if ( false === strpos( $active_basename, '/' ) ) {
- continue;
- }
-
- $map[ dirname( $active_basename ) ] = true;
- }
-
- return $map;
- }
-
- /**
- * Get collection of all active plugins. Including network activated plugins.
- *
- * @author Vova Feldman (@svovaf)
- * @since 1.0.9
- *
- * @param int $blog_id Since 2.0.0
- *
- * @return array[string]array
- */
- private static function get_active_plugins( $blog_id = 0 ) {
- self::require_plugin_essentials();
-
- $active_plugin = array();
- $all_plugins = fs_get_plugins();
- $active_plugins_basenames = self::get_active_plugins_basenames( $blog_id );
-
- foreach ( $active_plugins_basenames as $plugin_basename ) {
- $active_plugin[ $plugin_basename ] = $all_plugins[ $plugin_basename ];
- }
-
- return $active_plugin;
- }
-
- /**
- * Get collection of all site active plugins for a specified blog.
- *
- * @author Vova Feldman (@svovaf)
- * @since 2.0.0
- *
- * @param int $blog_id
- *
- * @return array[string]array
- */
- private static function get_site_active_plugins( $blog_id = 0 ) {
- $active_basenames = ( is_multisite() && $blog_id > 0 ) ?
- get_blog_option( $blog_id, 'active_plugins' ) :
- get_option( 'active_plugins' );
-
- $active = array();
-
- if ( ! is_array( $active_basenames ) ) {
- return $active;
- }
-
- foreach ( $active_basenames as $basename ) {
- $active[ $basename ] = array(
- 'is_active' => true,
- 'Version' => '1.0', // Dummy version.
- 'slug' => self::get_plugin_slug( $basename ),
- );
- }
-
- return $active;
- }
-
- /**
- * Get collection of all plugins with their activation status for a specified blog.
- *
- * @author Vova Feldman (@svovaf)
- * @since 1.1.8
- *
- * @param int $blog_id Since 2.0.0
- *
- * @return array Key is the plugin file path and the value is an array of the plugin data.
- */
- private static function get_all_plugins( $blog_id = 0 ) {
- self::require_plugin_essentials();
-
- $all_plugins = fs_get_plugins();
-
- $active_plugins_basenames = self::get_active_plugins_basenames( $blog_id );
-
- foreach ( $all_plugins as $basename => &$data ) {
- // By default set to inactive (next foreach update the active plugins).
- $data['is_active'] = false;
- // Enrich with plugin slug.
- $data['slug'] = self::get_plugin_slug( $basename );
- }
-
- // Flag active plugins.
- foreach ( $active_plugins_basenames as $basename ) {
- if ( isset( $all_plugins[ $basename ] ) ) {
- $all_plugins[ $basename ]['is_active'] = true;
- }
- }
-
- return $all_plugins;
- }
-
- /**
- * Get collection of all plugins and if they are network level activated.
- *
- * @author Vova Feldman (@svovaf)
- * @since 2.0.0
- *
- * @return array Key is the plugin basename and the value is an array of the plugin data.
- */
- private static function get_network_plugins() {
- self::require_plugin_essentials();
-
- $all_plugins = fs_get_plugins();
-
- $network_active_basenames = is_multisite() ?
- get_site_option( 'active_sitewide_plugins' ) :
- array();
-
- foreach ( $all_plugins as $basename => &$data ) {
- // By default set to inactive (next foreach update the active plugins).
- $data['is_active'] = false;
- // Enrich with plugin slug.
- $data['slug'] = self::get_plugin_slug( $basename );
- }
-
- // Flag active plugins.
- foreach ( $network_active_basenames as $basename ) {
- if ( isset( $all_plugins[ $basename ] ) ) {
- $all_plugins[ $basename ]['is_active'] = true;
- }
- }
-
- return $all_plugins;
- }
-
- /**
- * Cached result of get_site_transient( 'update_plugins' )
- *
- * @author Vova Feldman (@svovaf)
- * @since 1.1.8
- *
- * @var object
- */
- private static $_plugins_info;
-
- /**
- * Helper function to get specified plugin's slug.
- *
- * @author Vova Feldman (@svovaf)
- * @since 1.1.8
- *
- * @param $basename
- *
- * @return string
- */
- private static function get_plugin_slug( $basename ) {
- if ( ! isset( self::$_plugins_info ) ) {
- self::$_plugins_info = get_site_transient( 'update_plugins' );
- }
-
- $slug = '';
-
- if ( is_object( self::$_plugins_info ) ) {
- if ( isset( self::$_plugins_info->no_update ) &&
- isset( self::$_plugins_info->no_update[ $basename ] ) &&
- ! empty( self::$_plugins_info->no_update[ $basename ]->slug )
- ) {
- $slug = self::$_plugins_info->no_update[ $basename ]->slug;
- } else if ( isset( self::$_plugins_info->response ) &&
- isset( self::$_plugins_info->response[ $basename ] ) &&
- ! empty( self::$_plugins_info->response[ $basename ]->slug )
- ) {
- $slug = self::$_plugins_info->response[ $basename ]->slug;
- }
- }
-
- if ( empty( $slug ) ) {
- // Try to find slug from FS data.
- $slug = self::find_slug_by_basename( $basename );
- }
-
- if ( empty( $slug ) ) {
- // Fallback to plugin's folder name.
- $slug = dirname( $basename );
- }
-
- return $slug;
- }
-
- private static $_statics_loaded = false;
-
- /**
- * Load static resources.
- *
- * @author Vova Feldman (@svovaf)
- * @since 1.0.1
- */
- private static function _load_required_static() {
- if ( self::$_statics_loaded ) {
- return;
- }
-
- self::$_static_logger = FS_Logger::get_logger( WP_FS__SLUG, WP_FS__DEBUG_SDK, WP_FS__ECHO_DEBUG_SDK );
-
- self::$_static_logger->entrance();
-
- self::$_accounts = FS_Options::instance( WP_FS__ACCOUNTS_OPTION_NAME, true );
-
- if ( is_multisite() ) {
- $has_skipped_migration = (
- // 'id_slug_type_path_map' - was never stored on older versions, therefore, not exists on the site level.
- null === self::$_accounts->get_option( 'id_slug_type_path_map', null, false ) &&
- // 'file_slug_map' stored on the site level, so it was running an SDK version before it was integrated with MS-network.
- null !== self::$_accounts->get_option( 'file_slug_map', null, false )
- );
-
- /**
- * If the file_slug_map exists on the site level but doesn't exist on the
- * network level storage, it means that we need to process the storage with migration.
- *
- * The code in this `if` scope will only be executed once and only for the first site that will execute it because once we migrate the storage data, file_slug_map will be already set in the network level storage.
- *
- * @author Vova Feldman (@svovaf)
- * @since 2.0.0
- */
- if (
- ( $has_skipped_migration && true !== self::$_accounts->get_option( 'ms_migration_complete', false, true ) ) ||
- ( null === self::$_accounts->get_option( 'file_slug_map', null, true ) &&
- null !== self::$_accounts->get_option( 'file_slug_map', null, false ) )
- ) {
- self::migrate_options_to_network();
- }
- }
-
- self::$_global_admin_notices = FS_Admin_Notices::instance( 'global' );
-
- if ( ! WP_FS__DEMO_MODE ) {
- add_action( ( fs_is_network_admin() ? 'network_' : '' ) . 'admin_menu', array(
- 'Freemius',
- '_add_debug_section'
- ) );
- }
-
- add_action( "wp_ajax_fs_toggle_debug_mode", array( 'Freemius', '_toggle_debug_mode' ) );
-
- self::add_ajax_action_static( 'get_debug_log', array( 'Freemius', '_get_debug_log' ) );
-
- self::add_ajax_action_static( 'get_db_option', array( 'Freemius', '_get_db_option' ) );
-
- self::add_ajax_action_static( 'set_db_option', array( 'Freemius', '_set_db_option' ) );
-
- if ( 0 == did_action( 'plugins_loaded' ) ) {
- add_action( 'plugins_loaded', array( 'Freemius', '_load_textdomain' ), 1 );
- }
-
- add_action( 'admin_footer', array( 'Freemius', '_enrich_ajax_url' ) );
- add_action( 'admin_footer', array( 'Freemius', '_open_support_forum_in_new_page' ) );
-
- if ( self::is_plugins_page() || self::is_themes_page() ) {
- add_action( 'admin_print_footer_scripts', array( 'Freemius', '_maybe_add_beta_label_styles' ), 9 );
-
- /**
- * Specifically use this hook so that the JS event handlers will work properly on the "Themes"
- * page.
- *
- * @author Leo Fajardo (@leorw)
- * @since 2.3.0
- */
- add_action( 'admin_footer-' . self::get_current_page(), array( 'Freemius', '_maybe_add_beta_label_to_plugins_and_handle_confirmation') );
- }
-
- self::$_statics_loaded = true;
- }
-
- /**
- * @author Leo Fajardo (@leorw)
- *
- * @since 2.1.3
- */
- private static function migrate_options_to_network() {
- self::migrate_accounts_to_network();
-
- // Migrate API options from site level to network level.
- $api_network_options = FS_Option_Manager::get_manager( WP_FS__OPTIONS_OPTION_NAME, true, true );
- $api_network_options->migrate_to_network();
-
- // Migrate API cache to network level storage.
- FS_Cache_Manager::get_manager( WP_FS__API_CACHE_OPTION_NAME )->migrate_to_network();
-
- self::$_accounts->set_option( 'ms_migration_complete', true, true );
- }
-
- #----------------------------------------------------------------------------------
- #region Localization
- #----------------------------------------------------------------------------------
-
- /**
- * Load framework's text domain.
- *
- * @author Vova Feldman (@svovaf)
- * @since 1.2.1
- */
- static function _load_textdomain() {
- if ( ! is_admin() ) {
- return;
- }
-
- global $fs_active_plugins;
-
- // Works both for plugins and themes.
- load_plugin_textdomain(
- 'freemius',
- false,
- $fs_active_plugins->newest->sdk_path . '/languages/'
- );
- }
-
- #endregion
-
- #----------------------------------------------------------------------------------
- #region Debugging
- #----------------------------------------------------------------------------------
-
- /**
- * @author Vova Feldman (@svovaf)
- * @since 1.0.8
- */
- static function _add_debug_section() {
- if ( ! is_super_admin() ) {
- // Add debug page only for super-admins.
- return;
- }
-
- self::$_static_logger->entrance();
-
- $title = sprintf( '%s [v.%s]', fs_text_inline( 'Freemius Debug' ), WP_FS__SDK_VERSION );
-
- if ( WP_FS__DEV_MODE ) {
- // Add top-level debug menu item.
- $hook = FS_Admin_Menu_Manager::add_page(
- $title,
- $title,
- 'manage_options',
- 'freemius',
- array( 'Freemius', '_debug_page_render' )
- );
- } else {
- // Add hidden debug page.
- $hook = FS_Admin_Menu_Manager::add_subpage(
- null,
- $title,
- $title,
- 'manage_options',
- 'freemius',
- array( 'Freemius', '_debug_page_render' )
- );
- }
-
- if ( ! empty( $hook ) ) {
- add_action( "load-$hook", array( 'Freemius', '_debug_page_actions' ) );
- }
- }
-
- /**
- * @author Vova Feldman (@svovaf)
- * @since 1.1.7.3
- */
- static function _toggle_debug_mode() {
- check_admin_referer( 'fs_toggle_debug_mode' );
-
- if ( ! is_super_admin() ) {
- return;
- }
-
- $is_on = fs_request_get( 'is_on', false, 'post' );
-
- if ( fs_request_is_post() && in_array( $is_on, array( 0, 1 ) ) ) {
- update_option( 'fs_debug_mode', $is_on );
-
- // Turn on/off storage logging.
- FS_Logger::_set_storage_logging( ( 1 == $is_on ) );
- }
-
- exit;
- }
-
- /**
- * @author Vova Feldman (@svovaf)
- * @since 1.2.1.6
- */
- static function _get_debug_log() {
- check_admin_referer( 'fs_get_debug_log' );
-
- if ( ! is_super_admin() ) {
- return;
- }
-
- $limit = min( ! empty( $_POST['limit'] ) ? absint( $_POST['limit'] ) : 200, 200 );
- $offset = min( ! empty( $_POST['offset'] ) ? absint( $_POST['offset'] ) : 200, 200 );
-
- $logs = FS_Logger::load_db_logs(
- fs_request_get( 'filters', false, 'post' ),
- $limit,
- $offset
- );
-
- self::shoot_ajax_success( $logs );
- }
-
- /**
- * @author Vova Feldman (@svovaf)
- * @since 1.2.1.7
- */
- static function _get_db_option() {
- check_admin_referer( 'fs_get_db_option' );
-
- $option_name = fs_request_get( 'option_name' );
-
- if ( ! is_super_admin() ||
- ! fs_starts_with( $option_name, 'fs_' )
- ) {
- self::shoot_ajax_failure();
- }
-
- $value = get_option( $option_name );
-
- $result = array(
- 'name' => $option_name,
- );
-
- if ( false !== $value ) {
- if ( ! is_string( $value ) ) {
- $value = json_encode( $value );
- }
-
- $result['value'] = $value;
- }
-
- self::shoot_ajax_success( $result );
- }
-
- /**
- * @author Vova Feldman (@svovaf)
- * @since 1.2.1.7
- */
- static function _set_db_option() {
- check_admin_referer( 'fs_set_db_option' );
-
- $option_name = fs_request_get( 'option_name' );
-
- if ( ! is_super_admin() ||
- ! fs_starts_with( $option_name, 'fs_' )
- ) {
- self::shoot_ajax_failure();
- }
-
- $option_value = fs_request_get( 'option_value' );
-
- if ( ! empty( $option_value ) ) {
- update_option( $option_name, $option_value );
- }
-
- self::shoot_ajax_success();
- }
-
- /**
- * @author Vova Feldman (@svovaf)
- * @since 1.0.8
- */
- static function _debug_page_actions() {
- self::_clean_admin_content_section();
-
- if ( fs_request_is_action( 'restart_freemius' ) ) {
- check_admin_referer( 'restart_freemius' );
-
- if ( ! is_multisite() ) {
- // Clear accounts data.
- self::$_accounts->clear( null, true );
- } else {
- $sites = self::get_sites();
- foreach ( $sites as $site ) {
- $blog_id = self::get_site_blog_id( $site );
- self::$_accounts->clear( $blog_id, true );
- }
-
- // Clear network level storage.
- self::$_accounts->clear( true, true );
- }
-
- // Clear SDK reference cache.
- delete_option( 'fs_active_plugins' );
- } else if ( fs_request_is_action( 'clear_updates_data' ) ) {
- check_admin_referer( 'clear_updates_data' );
-
- if ( ! is_multisite() ) {
- set_site_transient( 'update_plugins', null );
- set_site_transient( 'update_themes', null );
- } else {
- $current_blog_id = get_current_blog_id();
-
- $sites = self::get_sites();
- foreach ( $sites as $site ) {
- switch_to_blog( self::get_site_blog_id( $site ) );
-
- set_site_transient( 'update_plugins', null );
- set_site_transient( 'update_themes', null );
- }
-
- switch_to_blog( $current_blog_id );
- }
- } else if ( fs_request_is_action( 'simulate_trial' ) ) {
- check_admin_referer( 'simulate_trial' );
-
- $fs = freemius( fs_request_get( 'module_id' ) );
-
- // Update SDK install to at least 24 hours before.
- $fs->_storage->install_timestamp = ( time() - WP_FS__TIME_24_HOURS_IN_SEC );
- // Unset the trial shown timestamp.
- unset( $fs->_storage->trial_promotion_shown );
- } else if ( fs_request_is_action( 'simulate_network_upgrade' ) ) {
- check_admin_referer( 'simulate_network_upgrade' );
-
- $fs = freemius( fs_request_get( 'module_id' ) );
-
- self::set_network_upgrade_mode( $fs->_storage );
- } else if ( fs_request_is_action( 'delete_install' ) ) {
- check_admin_referer( 'delete_install' );
-
- self::_delete_site_by_slug(
- fs_request_get( 'slug' ),
- fs_request_get( 'module_type' ),
- true,
- fs_request_get( 'blog_id', null )
- );
- } else if ( fs_request_is_action( 'delete_user' ) ) {
- check_admin_referer( 'delete_user' );
-
- self::delete_user( fs_request_get( 'user_id' ) );
- } else if ( fs_request_is_action( 'download_logs' ) ) {
- check_admin_referer( 'download_logs' );
-
- $download_url = FS_Logger::download_db_logs(
- fs_request_get( 'filters', false, 'post' )
- );
-
- if ( false === $download_url ) {
- wp_die( 'Oops... there was an error while generating the logs download file. Please try again and if it doesn\'t work contact support@freemius.com.' );
- }
-
- fs_redirect( $download_url );
- } else if ( fs_request_is_action( 'migrate_options_to_network' ) ) {
- check_admin_referer( 'migrate_options_to_network' );
-
- self::migrate_options_to_network();
- }
- }
-
- /**
- * @author Vova Feldman (@svovaf)
- * @since 1.0.8
- */
- static function _debug_page_render() {
- self::$_static_logger->entrance();
-
- if ( ! is_multisite() ) {
- $all_plugins_installs = self::get_all_sites( WP_FS__MODULE_TYPE_PLUGIN );
- $all_themes_installs = self::get_all_sites( WP_FS__MODULE_TYPE_THEME );
- } else {
- $sites = self::get_sites();
-
- $all_plugins_installs = array();
- $all_themes_installs = array();
-
- foreach ( $sites as $site ) {
- $blog_id = self::get_site_blog_id( $site );
-
- $plugins_installs = self::get_all_sites( WP_FS__MODULE_TYPE_PLUGIN, $blog_id );
-
- foreach ( $plugins_installs as $slug => $install ) {
- if ( ! isset( $all_plugins_installs[ $slug ] ) ) {
- $all_plugins_installs[ $slug ] = array();
- }
-
- $install->blog_id = $blog_id;
-
- $all_plugins_installs[ $slug ][] = $install;
- }
-
- $themes_installs = self::get_all_sites( WP_FS__MODULE_TYPE_THEME, $blog_id );
-
- foreach ( $themes_installs as $slug => $install ) {
- if ( ! isset( $all_themes_installs[ $slug ] ) ) {
- $all_themes_installs[ $slug ] = array();
- }
-
- $install->blog_id = $blog_id;
-
- $all_themes_installs[ $slug ][] = $install;
- }
- }
- }
-
- $licenses_by_module_type = self::get_all_licenses_by_module_type();
-
- $vars = array(
- 'plugin_sites' => $all_plugins_installs,
- 'theme_sites' => $all_themes_installs,
- 'users' => self::get_all_users(),
- 'addons' => self::get_all_addons(),
- 'account_addons' => self::get_all_account_addons(),
- 'plugin_licenses' => $licenses_by_module_type[ WP_FS__MODULE_TYPE_PLUGIN ],
- 'theme_licenses' => $licenses_by_module_type[ WP_FS__MODULE_TYPE_THEME ]
- );
-
- fs_enqueue_local_style( 'fs_debug', '/admin/debug.css' );
- fs_require_once_template( 'debug.php', $vars );
- }
-
- #endregion
-
- #----------------------------------------------------------------------------------
- #region Connectivity Issues
- #----------------------------------------------------------------------------------
-
- /**
- * Check if Freemius should be turned on for the current plugin install.
- *
- * Note:
- * $this->_is_on is updated in has_api_connectivity()
- *
- * @author Vova Feldman (@svovaf)
- * @since 1.0.9
- *
- * @return bool
- */
- function is_on() {
- self::$_static_logger->entrance();
-
- if ( isset( $this->_is_on ) ) {
- return $this->_is_on;
- }
-
- // If already installed or pending then sure it's on :)
- if ( $this->is_registered() || $this->is_pending_activation() ) {
- $this->_is_on = true;
-
- return true;
- }
-
- return false;
- }
-
- /**
- * @author Vova Feldman (@svovaf)
- * @since 1.1.7.3
- *
- * @param bool $flush_if_no_connectivity
- *
- * @return bool
- */
- private function should_run_connectivity_test( $flush_if_no_connectivity = false ) {
- if ( ! isset( $this->_storage->connectivity_test ) ) {
- // Connectivity test was never executed, or cache was cleared.
- return true;
- }
-
- if ( WP_FS__PING_API_ON_IP_OR_HOST_CHANGES ) {
- if ( WP_FS__IS_HTTP_REQUEST ) {
- if ( $_SERVER['HTTP_HOST'] != $this->_storage->connectivity_test['host'] ) {
- // Domain changed.
- return true;
- }
-
- if ( WP_FS__REMOTE_ADDR != $this->_storage->connectivity_test['server_ip'] ) {
- // Server IP changed.
- return true;
- }
- }
- }
-
- if ( $this->_storage->connectivity_test['is_connected'] &&
- $this->_storage->connectivity_test['is_active']
- ) {
- // API connected and Freemius is active - no need to run connectivity check.
- return false;
- }
-
- if ( $flush_if_no_connectivity ) {
- /**
- * If explicitly asked to flush when no connectivity - do it only
- * if at least 10 sec passed from the last API connectivity test.
- */
- return ( isset( $this->_storage->connectivity_test['timestamp'] ) &&
- ( WP_FS__SCRIPT_START_TIME - $this->_storage->connectivity_test['timestamp'] ) > 10 );
- }
-
- /**
- * @since 1.1.7 Don't check for connectivity on plugin downgrade.
- */
- $version = $this->get_plugin_version();
- if ( version_compare( $version, $this->_storage->connectivity_test['version'], '>' ) ) {
- // If it's a plugin version upgrade and Freemius is off or no connectivity, run connectivity test.
- return true;
- }
-
- return false;
- }
-
- /**
- * @author Vova Feldman (@svovaf)
- * @since 1.1.7.4
- *
- * @param int|null $blog_id Since 2.0.0.
- * @param bool $is_gdpr_test Since 2.0.2. Perform only the GDPR test.
- *
- * @return object|false
- */
- private function ping( $blog_id = null, $is_gdpr_test = false ) {
- if ( WP_FS__SIMULATE_NO_API_CONNECTIVITY ) {
- return false;
- }
-
- $version = $this->get_plugin_version();
-
- $is_update = $this->apply_filters( 'is_plugin_update', $this->is_plugin_update() );
-
- return $this->get_api_plugin_scope()->ping(
- $this->get_anonymous_id( $blog_id ),
- array(
- 'is_update' => json_encode( $is_update ),
- 'version' => $version,
- 'sdk' => $this->version,
- 'is_admin' => json_encode( is_admin() ),
- 'is_ajax' => json_encode( self::is_ajax() ),
- 'is_cron' => json_encode( self::is_cron() ),
- 'is_gdpr_test' => $is_gdpr_test,
- 'is_http' => json_encode( WP_FS__IS_HTTP_REQUEST ),
- )
- );
- }
-
- /**
- * Check if there's any connectivity issue to Freemius API.
- *
- * @author Vova Feldman (@svovaf)
- * @since 1.0.9
- *
- * @param bool $flush_if_no_connectivity
- *
- * @return bool
- */
- function has_api_connectivity( $flush_if_no_connectivity = false ) {
- $this->_logger->entrance();
-
- if ( isset( $this->_has_api_connection ) && ( $this->_has_api_connection || ! $flush_if_no_connectivity ) ) {
- return $this->_has_api_connection;
- }
-
- if ( WP_FS__SIMULATE_NO_API_CONNECTIVITY &&
- isset( $this->_storage->connectivity_test ) &&
- true === $this->_storage->connectivity_test['is_connected']
- ) {
- unset( $this->_storage->connectivity_test );
- }
-
- if ( ! $this->should_run_connectivity_test( $flush_if_no_connectivity ) ) {
- $this->_has_api_connection = $this->_storage->connectivity_test['is_connected'];
- /**
- * @since 1.1.6 During dev mode, if there's connectivity - turn Freemius on regardless the configuration.
- *
- * @since 1.2.1.5 If the user running the premium version then ignore the 'is_active' flag and turn Freemius on to enable license key activation.
- */
- $this->_is_on = $this->_storage->connectivity_test['is_active'] ||
- $this->is_premium() ||
- ( WP_FS__DEV_MODE && $this->_has_api_connection && ! WP_FS__SIMULATE_FREEMIUS_OFF );
-
- return $this->_has_api_connection;
- }
-
- $pong = $this->ping();
- $is_connected = $this->get_api_plugin_scope()->is_valid_ping( $pong );
-
- if ( ! $is_connected ) {
- // API failure.
- $this->_add_connectivity_issue_message( $pong );
- }
-
- if ( $is_connected ) {
- FS_GDPR_Manager::instance()->store_is_required( $pong->is_gdpr_required );
- }
-
- $this->store_connectivity_info( $pong, $is_connected );
-
- return $this->_has_api_connection;
- }
-
- /**
- * @author Vova Feldman (@svovaf)
- * @since 1.1.7.4
- *
- * @param object $pong
- * @param bool $is_connected
- */
- private function store_connectivity_info( $pong, $is_connected ) {
- $this->_logger->entrance();
-
- $version = $this->get_plugin_version();
-
- if ( ! $is_connected || WP_FS__SIMULATE_FREEMIUS_OFF ) {
- $is_active = false;
- } else {
- $is_active = ( isset( $pong->is_active ) && true == $pong->is_active );
- }
-
- $is_active = $this->apply_filters(
- 'is_on',
- $is_active,
- $this->is_plugin_update(),
- $version
- );
-
- $this->_storage->connectivity_test = array(
- 'is_connected' => $is_connected,
- 'host' => $_SERVER['HTTP_HOST'],
- 'server_ip' => WP_FS__REMOTE_ADDR,
- 'is_active' => $is_active,
- 'timestamp' => WP_FS__SCRIPT_START_TIME,
- // Last version with connectivity attempt.
- 'version' => $version,
- );
-
- $this->_has_api_connection = $is_connected;
- $this->_is_on = $is_active || ( WP_FS__DEV_MODE && $is_connected && ! WP_FS__SIMULATE_FREEMIUS_OFF );
- }
-
- /**
- * Force turning Freemius on.
- *
- * @author Vova Feldman (@svovaf)
- * @since 1.1.8.1
- *
- * @return bool TRUE if successfully turned on.
- */
- private function turn_on() {
- $this->_logger->entrance();
-
- if ( $this->is_on() || ! isset( $this->_storage->connectivity_test['is_active'] ) ) {
- return false;
- }
-
- $updated_connectivity = $this->_storage->connectivity_test;
- $updated_connectivity['is_active'] = true;
- $updated_connectivity['timestamp'] = WP_FS__SCRIPT_START_TIME;
- $this->_storage->connectivity_test = $updated_connectivity;
-
- $this->_is_on = true;
-
- return true;
- }
-
- /**
- * Anonymous and unique site identifier (Hash).
- *
- * @author Vova Feldman (@svovaf)
- * @since 1.1.0
- *
- * @param null|int $blog_id Since 2.0.0
- *
- * @return string
- */
- function get_anonymous_id( $blog_id = null ) {
- $unique_id = self::$_accounts->get_option( 'unique_id', null, $blog_id );
-
- if ( empty( $unique_id ) || ! is_string( $unique_id ) ) {
- $key = fs_strip_url_protocol( get_site_url( $blog_id ) );
-
- $secure_auth = defined( 'SECURE_AUTH_KEY' ) ? SECURE_AUTH_KEY : '';
- if ( empty( $secure_auth ) ||
- false !== strpos( $secure_auth, ' ' ) ||
- 'put your unique phrase here' === $secure_auth
- ) {
- // Protect against default auth key.
- $secure_auth = md5( microtime() );
- }
-
- /**
- * Base the unique identifier on the WP secure authentication key. Which
- * turns the key into a secret anonymous identifier. This will help us
- * to avoid duplicate installs generation on the backend upon opt-in.
- *
- * @author Vova Feldman (@svovaf)
- * @since 1.2.3
- */
- $unique_id = md5( $key . $secure_auth );
-
- self::$_accounts->set_option( 'unique_id', $unique_id, true, $blog_id );
- }
-
- $this->_logger->departure( $unique_id );
-
- return $unique_id;
- }
-
- /**
- * @author Vova Feldman (@svovaf)
- * @since 1.1.7.4
- *
- * @return \WP_User
- */
- static function _get_current_wp_user() {
- self::require_pluggable_essentials();
- self::wp_cookie_constants();
-
- return wp_get_current_user();
- }
-
- /**
- * Define cookie constants which are required by Freemius::_get_current_wp_user() since
- * it uses wp_get_current_user() which needs the cookie constants set. When a plugin
- * is network activated the cookie constants are only configured after the network
- * plugins activation, therefore, if we don't define those constants WP will throw
- * PHP warnings/notices.
- *
- * @author Vova Feldman (@svovaf)
- * @since 2.1.1
- */
- private static function wp_cookie_constants() {
- if ( defined( 'LOGGED_IN_COOKIE' ) &&
- ( defined( 'AUTH_COOKIE' ) || defined( 'SECURE_AUTH_COOKIE' ) )
- ) {
- return;
- }
-
- /**
- * Used to guarantee unique hash cookies
- *
- * @since 1.5.0
- */
- if ( ! defined( 'COOKIEHASH' ) ) {
- $siteurl = get_site_option( 'siteurl' );
- if ( $siteurl ) {
- define( 'COOKIEHASH', md5( $siteurl ) );
- } else {
- define( 'COOKIEHASH', '' );
- }
- }
-
- if ( ! defined( 'LOGGED_IN_COOKIE' ) ) {
- define( 'LOGGED_IN_COOKIE', 'wordpress_logged_in_' . COOKIEHASH );
- }
-
- /**
- * @since 2.5.0
- */
- if ( ! defined( 'AUTH_COOKIE' ) ) {
- define( 'AUTH_COOKIE', 'wordpress_' . COOKIEHASH );
- }
-
- /**
- * @since 2.6.0
- */
- if ( ! defined( 'SECURE_AUTH_COOKIE' ) ) {
- define( 'SECURE_AUTH_COOKIE', 'wordpress_sec_' . COOKIEHASH );
- }
- }
-
- /**
- * @author Vova Feldman (@svovaf)
- * @since 2.1.0
- *
- * @return int
- */
- static function get_current_wp_user_id() {
- $wp_user = self::_get_current_wp_user();
-
- return $wp_user->ID;
- }
-
- /**
- * @author Vova Feldman (@svovaf)
- * @since 1.2.1.7
- *
- * @param string $email
- *
- * @return bool
- */
- static function is_valid_email( $email ) {
- if ( false === filter_var( $email, FILTER_VALIDATE_EMAIL ) ) {
- return false;
- }
-
- $parts = explode( '@', $email );
-
- if ( 2 !== count( $parts ) || empty( $parts[1] ) ) {
- return false;
- }
-
- $blacklist = array(
- 'admin.',
- 'webmaster.',
- 'localhost.',
- 'dev.',
- 'development.',
- 'test.',
- 'stage.',
- 'staging.',
- );
-
- // Make sure domain is not one of the blacklisted.
- foreach ( $blacklist as $invalid ) {
- if ( 0 === strpos( $parts[1], $invalid ) ) {
- return false;
- }
- }
-
- // Get the UTF encoded domain name.
- $domain = idn_to_ascii( $parts[1] ) . '.';
-
- return ( checkdnsrr( $domain, 'MX' ) || checkdnsrr( $domain, 'A' ) );
- }
-
- /**
- * Generate API connectivity issue message.
- *
- * @author Vova Feldman (@svovaf)
- * @since 1.0.9
- *
- * @param mixed $api_result
- * @param bool $is_first_failure
- */
- function _add_connectivity_issue_message( $api_result, $is_first_failure = true ) {
- if ( ! $this->is_premium() && $this->_enable_anonymous ) {
- // Don't add message if it's the free version and can run anonymously.
- return;
- }
-
- if ( ! function_exists( 'wp_nonce_url' ) ) {
- require_once ABSPATH . 'wp-includes/functions.php';
- }
-
- $current_user = self::_get_current_wp_user();
-// $admin_email = get_option( 'admin_email' );
- $admin_email = $current_user->user_email;
-
- // Aliases.
- $deactivate_plugin_title = $this->esc_html_inline( 'That\'s exhausting, please deactivate', 'deactivate-plugin-title' );
- $deactivate_plugin_desc = $this->esc_html_inline( 'We feel your frustration and sincerely apologize for the inconvenience. Hope to see you again in the future.', 'deactivate-plugin-desc' );
- $install_previous_title = $this->esc_html_inline( 'Let\'s try your previous version', 'install-previous-title' );
- $install_previous_desc = $this->esc_html_inline( 'Uninstall this version and install the previous one.', 'install-previous-desc' );
- $fix_issue_title = $this->esc_html_inline( 'Yes - I\'m giving you a chance to fix it', 'fix-issue-title' );
- $fix_issue_desc = $this->esc_html_inline( 'We will do our best to whitelist your server and resolve this issue ASAP. You will get a follow-up email to %s once we have an update.', 'fix-issue-desc' );
- /* translators: %s: product title (e.g. "Awesome Plugin" requires an access to...) */
- $x_requires_access_to_api = $this->esc_html_inline( '%s requires an access to our API.', 'x-requires-access-to-api' );
- $sysadmin_title = $this->esc_html_inline( 'I\'m a system administrator', 'sysadmin-title' );
- $happy_to_resolve_issue_asap = $this->esc_html_inline( 'We are sure it\'s an issue on our side and more than happy to resolve it for you ASAP if you give us a chance.', 'happy-to-resolve-issue-asap' );
-
- $message = false;
- if ( is_object( $api_result ) &&
- isset( $api_result->error ) &&
- isset( $api_result->error->code )
- ) {
- switch ( $api_result->error->code ) {
- case 'curl_missing':
- $missing_methods = '';
- if ( is_array( $api_result->missing_methods ) &&
- ! empty( $api_result->missing_methods )
- ) {
- foreach ( $api_result->missing_methods as $m ) {
- if ( 'curl_version' === $m ) {
- continue;
- }
-
- if ( ! empty( $missing_methods ) ) {
- $missing_methods .= ', ';
- }
-
- $missing_methods .= sprintf( '%s', $m );
- }
-
- if ( ! empty( $missing_methods ) ) {
- $missing_methods = sprintf(
- '
%s %s',
- $this->esc_html_inline( 'Disabled method(s):', 'curl-disabled-methods' ),
- $missing_methods
- );
- }
- }
-
- $message = sprintf(
- $x_requires_access_to_api . ' ' .
- $this->esc_html_inline( 'We use PHP cURL library for the API calls, which is a very common library and usually installed and activated out of the box. Unfortunately, cURL is not activated (or disabled) on your server.', 'curl-missing-message' ) . ' ' .
- $missing_methods .
- ' %s',
- '' . $this->get_plugin_name() . '',
- sprintf(
- '
%s
%s
%s
',
- sprintf(
- '%s%s',
- $this->get_text_inline( 'I don\'t know what is cURL or how to install it, help me!', 'curl-missing-no-clue-title' ),
- ' - ' . sprintf(
- $this->get_text_inline( 'We\'ll make sure to contact your hosting company and resolve the issue. You will get a follow-up email to %s once we have an update.', 'curl-missing-no-clue-desc' ),
- '' . $admin_email . ''
- )
- ),
- sprintf(
- '%s - %s',
- $sysadmin_title,
- esc_html( sprintf( $this->get_text_inline( 'Great, please install cURL and enable it in your php.ini file. In addition, search for the \'disable_functions\' directive in your php.ini file and remove any disabled methods starting with \'curl_\'. To make sure it was successfully activated, use \'phpinfo()\'. Once activated, deactivate the %s and reactivate it back again.', 'curl-missing-sysadmin-desc' ), $this->get_module_label( true ) ) )
- ),
- sprintf(
- '%s - %s',
- wp_nonce_url( 'plugins.php?action=deactivate&plugin=' . $this->_plugin_basename . '&plugin_status=all&paged=1&s=', 'deactivate-plugin_' . $this->_plugin_basename ),
- $deactivate_plugin_title,
- $deactivate_plugin_desc
- )
- )
- );
- break;
- case 'cloudflare_ddos_protection':
- $message = sprintf(
- $x_requires_access_to_api . ' ' .
- $this->esc_html_inline( 'From unknown reason, CloudFlare, the firewall we use, blocks the connection.', 'cloudflare-blocks-connection-message' ) . ' ' .
- $happy_to_resolve_issue_asap .
- ' %s',
- '' . $this->get_plugin_name() . '',
- sprintf(
- '
' . '' . fs_text_inline( 'Warning', 'warning', $api->slug ) . ': ' . fs_text_inline( 'This plugin has not been tested with your current version of WordPress.', 'not-tested-warning', $api->slug ) . '
' . '' . fs_text_inline( 'Warning', 'warning', $api->slug ) . ': ' . fs_text_inline( 'This plugin has not been marked as compatible with your version of WordPress.', 'not-compatible-warning', $api->slug ) . '
apply_filters( 'pending_activation_message', sprintf(
- /* translators: %s: name (e.g. Thanks John!) */
- fs_text_inline( 'Thanks %s!', 'thanks-x', $slug ) . ' ' .
- fs_text_inline( 'You should receive an activation email for %s to your mailbox at %s. Please make sure you click the activation button in that email to %s.', 'pending-activation-message', $slug ),
- $first_name,
- '' . $fs->get_plugin_name() . '',
- '' . $current_user->user_email . '',
- fs_text_inline( 'complete the install', 'complete-the-install', $slug )
- ) );
- } else if ( $require_license_key ) {
- $button_label = $is_network_upgrade_mode ?
- fs_text_inline( 'Activate License', 'agree-activate-license', $slug ) :
- fs_text_inline( 'Agree & Activate License', 'agree-activate-license', $slug );
-
- $message = $fs->apply_filters(
- 'connect-message_on-premium',
- sprintf( fs_text_inline( 'Welcome to %s! To get started, please enter your license key:', 'thanks-for-purchasing', $slug ), '' . $fs->get_plugin_name() . '' ),
- $first_name,
- $fs->get_plugin_name()
- );
- } else {
- $filter = 'connect_message';
- $default_optin_message = $is_gdpr_required ?
- fs_text_inline( 'Never miss an important update - opt in to our security & feature updates notifications, educational content, offers, and non-sensitive diagnostic tracking with %4$s.', 'connect-message', $slug) :
- fs_text_inline( 'Never miss an important update - opt in to our security and feature updates notifications, and non-sensitive diagnostic tracking with %4$s.', 'connect-message', $slug);
-
- if ( $fs->is_plugin_update() ) {
- // If Freemius was added on a plugin update, set different
- // opt-in message.
- $default_optin_message = $is_gdpr_required ?
- fs_text_inline( 'Never miss an important update - opt in to our security & feature updates notifications, educational content, offers, and non-sensitive diagnostic tracking with %4$s. If you skip this, that\'s okay! %1$s will still work just fine.', 'connect-message_on-update', $slug ) :
- fs_text_inline( 'Never miss an important update - opt in to our security & feature updates notifications, and non-sensitive diagnostic tracking with %4$s. If you skip this, that\'s okay! %1$s will still work just fine.', 'connect-message_on-update', $slug );
-
- // If user customized the opt-in message on update, use
- // that message. Otherwise, fallback to regular opt-in
- // custom message if exist.
- if ( $fs->has_filter( 'connect_message_on_update' ) ) {
- $filter = 'connect_message_on_update';
- }
- }
-
- $message = $fs->apply_filters(
- $filter,
- ($is_network_upgrade_mode ?
- '' :
- /* translators: %s: name (e.g. Hey John,) */
- $hey_x_text . ' '
- ) .
- sprintf(
- esc_html( $default_optin_message ),
- '' . esc_html( $fs->get_plugin_name() ) . '',
- '' . $current_user->user_login . '',
- '' . $site_url . '',
- $freemius_link
- ),
- $first_name,
- $fs->get_plugin_name(),
- $current_user->user_login,
- '' . $site_url . '',
- $freemius_link,
- $is_gdpr_required
- );
- }
-
- if ( $is_network_upgrade_mode ) {
- $network_integration_text = esc_html( fs_text_inline( 'We\'re excited to introduce the Freemius network-level integration.', 'connect_message_network_upgrade', $slug ) );
-
- if ($is_premium_code){
- $message = $network_integration_text . ' ' . sprintf( fs_text_inline( 'During the update process we detected %d site(s) that are still pending license activation.', 'connect_message_network_upgrade-premium', $slug ), count( $sites ) );
-
- $message .= '
' . sprintf( fs_text_inline( 'If you\'d like to use the %s on those sites, please enter your license key below and click the activation button.', 'connect_message_network_upgrade-premium-activate-license', $slug ), $is_premium_only ? $fs->get_module_label( true ) : sprintf(
- /* translators: %s: module type (plugin, theme, or add-on) */
- fs_text_inline( "%s's paid features", 'x-paid-features', $slug ),
- $fs->get_module_label( true )
- ) );
-
- /* translators: %s: module type (plugin, theme, or add-on) */
- $message .= ' ' . sprintf( fs_text_inline( 'Alternatively, you can skip it for now and activate the license later, in your %s\'s network-level Account page.', 'connect_message_network_upgrade-premium-skip-license', $slug ), $fs->get_module_label( true ) );
- }else {
- $message = $network_integration_text . ' ' . sprintf( fs_text_inline( 'During the update process we detected %s site(s) in the network that are still pending your attention.', 'connect_message_network_upgrade-free', $slug ), count( $sites ) ) . '
-
-
diff --git a/vendor/freemius/wordpress-sdk/templates/debug/api-calls.php b/vendor/freemius/wordpress-sdk/templates/debug/api-calls.php
deleted file mode 100644
index ea4e823b5..000000000
--- a/vendor/freemius/wordpress-sdk/templates/debug/api-calls.php
+++ /dev/null
@@ -1,155 +0,0 @@
- 0,
- 'POST' => 0,
- 'PUT' => 0,
- 'DELETE' => 0
- );
-
- $show_body = false;
- foreach ( $logger as $log ) {
- $counters[ $log['method'] ] ++;
-
- if ( ! is_null( $log['body'] ) ) {
- $show_body = true;
- }
- }
-
- $pretty_print = $show_body && defined( 'JSON_PRETTY_PRINT' ) && version_compare( phpversion(), '5.3', '>=' );
-
- /**
- * This template is used for debugging, therefore, when possible
- * we'd like to prettify the output of a JSON encoded variable.
- * This will only be executed when $pretty_print is `true`, and
- * the var is `true` only for PHP 5.3 and higher. Due to the
- * limitations of the current Theme Check, it throws an error
- * that using the "options" parameter (the 2nd param) is not
- * supported in PHP 5.2 and lower. Thus, we added this alias
- * variable to work around that false-positive.
- *
- * @author Vova Feldman (@svovaf)
- * @since 1.2.2.7
- */
- $encode = 'json_encode';
-
- $root_path_len = strlen( ABSPATH );
-
- $ms_text = fs_text_x_inline( 'ms', 'milliseconds' );
-?>
-
-
-
- {$ownership_change_option_html}
-HTML;
-
- /**
- * Handle the ownership change option if not an add-on or if no license yet is activated for the
- * parent product in case of an add-on.
- *
- * @author Leo Fajardo (@leorw)
- * @since 2.3.2
- */
- $is_user_change_supported = ( ! $fs->is_addon() || ! $fs->get_parent_instance()->has_active_valid_license() );
-
- fs_enqueue_local_style( 'fs_dialog_boxes', '/admin/dialog-boxes.css' );
-?>
-
\ No newline at end of file
diff --git a/vendor/freemius/wordpress-sdk/templates/forms/optout.php b/vendor/freemius/wordpress-sdk/templates/forms/optout.php
deleted file mode 100644
index 4867a8a73..000000000
--- a/vendor/freemius/wordpress-sdk/templates/forms/optout.php
+++ /dev/null
@@ -1,336 +0,0 @@
-get_slug();
-
- $action = $fs->is_tracking_allowed() ?
- 'stop_tracking' :
- 'allow_tracking';
-
- $reconnect_url = $fs->get_activation_url( array(
- 'nonce' => wp_create_nonce( $fs->get_unique_affix() . '_reconnect' ),
- 'fs_action' => ( $fs->get_unique_affix() . '_reconnect' ),
- ) );
-
- $plugin_title = "{$fs->get_plugin()->title}";
- $opt_out_text = fs_text_x_inline( 'Opt Out', 'verb', 'opt-out', $slug );
- $opt_in_text = fs_text_x_inline( 'Opt In', 'verb', 'opt-in', $slug );
-
- if ( $fs->is_premium() ) {
- $opt_in_message_appreciation = fs_text_inline( 'Connectivity to the licensing engine was successfully re-established. Automatic security & feature updates are now available through the WP Admin Dashboard.', 'premium-opt-in-message-appreciation', $slug );
-
- $opt_out_message_subtitle = sprintf( fs_text_inline( 'Warning: Opting out will block automatic updates', 'premium-opt-out-message-appreciation', $slug ), $fs->get_module_type() );
- $opt_out_message_usage_tracking = sprintf( fs_text_inline( 'Ongoing connectivity with the licensing engine is essential for receiving automatic security & feature updates of the paid product. To receive these updates, data like your license key, %1$s version, and WordPress version, is periodically sent to the server to check for updates. By opting out, you understand that your site won\'t receive automatic updates for %2$s from within the WP Admin Dashboard. This can put your site at risk, and we highly recommend to keep this connection active. If you do choose to opt-out, you\'ll need to check for %1$s updates and install them manually.', 'premium-opt-out-message-usage-tracking', $slug ), $fs->get_module_type(), $plugin_title );
-
- $primary_cta_label = fs_text_inline( 'I\'d like to keep automatic updates', 'premium-opt-out-cancel', $slug );
- } else {
- $opt_in_message_appreciation = sprintf( fs_text_inline( 'We appreciate your help in making the %s better by letting us track some usage data.', 'opt-in-message-appreciation', $slug ), $fs->get_module_type() );
-
- $opt_out_message_subtitle = $opt_in_message_appreciation;
- $opt_out_message_usage_tracking = sprintf( fs_text_inline( "Usage tracking is done in the name of making %s better. Making a better user experience, prioritizing new features, and more good things. We'd really appreciate if you'll reconsider letting us continue with the tracking.", 'opt-out-message-usage-tracking', $slug ), $plugin_title );
- $primary_cta_label = fs_text_inline( 'On second thought - I want to continue helping', 'opt-out-cancel', $slug );
- }
-
- $opt_out_message_clicking_opt_out = sprintf(
- fs_text_inline( 'By clicking "Opt Out", we will no longer be sending any data from %s to %s.', 'opt-out-message-clicking-opt-out', $slug ),
- $plugin_title,
- sprintf(
- '%s',
- 'https://freemius.com',
- 'freemius.com'
- )
- );
-
- $admin_notice_params = array(
- 'id' => '',
- 'slug' => $fs->get_id(),
- 'type' => 'success',
- 'sticky' => false,
- 'plugin' => $fs->get_plugin()->title,
- 'message' => $opt_in_message_appreciation
- );
-
- $admin_notice_html = fs_get_template( 'admin-notice.php', $admin_notice_params );
-
- $modal_content_html = "
-
-HTML;
- }
-
- $message_above_input_field = fs_esc_html_inline( "Enter the email address you've used for the upgrade below and we will resend you the license key.", 'ask-for-upgrade-email-address', $slug );
- $modal_content_html = <<< HTML
-
-
{$message_above_input_field}
-
- {$form_html}
-
-HTML;
-
- fs_enqueue_local_style( 'fs_dialog_boxes', '/admin/dialog-boxes.css' );
-?>
-
diff --git a/vendor/freemius/wordpress-sdk/templates/forms/subscription-cancellation.php b/vendor/freemius/wordpress-sdk/templates/forms/subscription-cancellation.php
deleted file mode 100644
index 2a1d59110..000000000
--- a/vendor/freemius/wordpress-sdk/templates/forms/subscription-cancellation.php
+++ /dev/null
@@ -1,277 +0,0 @@
-get_slug();
-
-/**
- * @var FS_Plugin_License $license
- */
-$license = $VARS['license'];
-
-$has_trial = $VARS['has_trial'];
-
-$subscription_cancellation_context = $has_trial ?
- fs_text_inline( 'trial', 'trial', $slug ) :
- fs_text_inline( 'subscription', 'subscription', $slug );
-
-$plan = $fs->get_plan();
-$module_label = $fs->get_module_label( true );
-
-if ( $VARS['is_license_deactivation'] ) {
- $subscription_cancellation_text = '';
-} else {
- $subscription_cancellation_text = sprintf(
- fs_text_inline(
- "Deactivating or uninstalling the %s will automatically disable the license, which you'll be able to use on another site.",
- 'deactivation-or-uninstall-message',
- $slug
- ),
- $module_label
- ) . ' ';
-}
-
- $subscription_cancellation_text .= sprintf(
- fs_text_inline(
- 'In case you are NOT planning on using this %s on this site (or any other site) - would you like to cancel the %s as well?',
- 'cancel-subscription-message',
- $slug
- ),
- ( $VARS['is_license_deactivation'] ? fs_text_inline( 'license', 'license', $slug ) : $module_label ),
- $subscription_cancellation_context
-);
-
-$cancel_subscription_action_label = sprintf(
- fs_esc_html_inline(
- "Cancel %s - I no longer need any security & feature updates, nor support for %s because I'm not planning to use the %s on this, or any other site.",
- 'cancel-x',
- $slug
- ),
- esc_html( $subscription_cancellation_context ),
- sprintf( '%s', esc_html( $fs->get_plugin_title() ) ),
- esc_html( $module_label )
-);
-
-$keep_subscription_active_action_label = esc_html( sprintf(
- fs_text_inline(
- "Don't cancel %s - I'm still interested in getting security & feature updates, as well as be able to contact support.",
- 'dont-cancel-x',
- $slug
- ),
- $subscription_cancellation_context
-) );
-
-$subscription_cancellation_text = esc_html( $subscription_cancellation_text );
-
-$subscription_cancellation_html = <<< HTML
-
{$subscription_cancellation_text}
-
-
-
-
-
-
-
-
-HTML;
-
-$downgrading_plan_text = fs_text_inline( 'Downgrading your plan', 'downgrading-plan', $slug );
-$cancelling_subscription_text = fs_text_inline( 'Cancelling the subscription', 'cancelling-subscription', $slug );
-/* translators: %1$s: Either 'Downgrading your plan' or 'Cancelling the subscription' */
-$downgrade_x_confirm_text = fs_text_inline( '%1$s will immediately stop all future recurring payments and your %2$s plan license will expire in %3$s.', 'downgrade-x-confirm', $slug );
-$prices_increase_text = fs_text_inline( 'Please note that we will not be able to grandfather outdated pricing for renewals/new subscriptions after a cancellation. If you choose to renew the subscription manually in the future, after a price increase, which typically occurs once a year, you will be charged the updated price.', 'pricing-increase-warning', $slug );
-$after_downgrade_non_blocking_text = fs_text_inline( 'You can still enjoy all %s features but you will not have access to %s security & feature updates, nor support.', 'after-downgrade-non-blocking', $slug );
-$after_downgrade_blocking_text = fs_text_inline( 'Once your license expires you can still use the Free version but you will NOT have access to the %s features.', 'after-downgrade-blocking', $slug );
-$after_downgrade_blocking_text_premium_only = fs_text_inline( 'Once your license expires you will no longer be able to use the %s, unless you activate it again with a valid premium license.', 'after-downgrade-blocking-premium-only', $slug );
-
-$subscription_cancellation_confirmation_message = $has_trial ?
- fs_text_inline( 'Cancelling the trial will immediately block access to all premium features. Are you sure?', 'cancel-trial-confirm', $slug ) :
- sprintf(
- '%s %s %s %s',
- sprintf(
- $downgrade_x_confirm_text,
- ($fs->is_only_premium() ? $cancelling_subscription_text : $downgrading_plan_text ),
- $plan->title,
- human_time_diff( time(), strtotime( $license->expiration ) )
- ),
- (
- $license->is_block_features ?
- (
- $fs->is_only_premium() ?
- sprintf( $after_downgrade_blocking_text_premium_only, $module_label ) :
- sprintf( $after_downgrade_blocking_text, $plan->title )
- ) :
- sprintf( $after_downgrade_non_blocking_text, $plan->title, $fs->get_module_label( true ) )
- ),
- $prices_increase_text,
- fs_esc_attr_inline( 'Are you sure you want to proceed?', 'proceed-confirmation', $slug )
- );
-
-fs_enqueue_local_style( 'fs_dialog_boxes', '/admin/dialog-boxes.css' );
-?>
-
\ No newline at end of file
diff --git a/vendor/freemius/wordpress-sdk/templates/forms/trial-start.php b/vendor/freemius/wordpress-sdk/templates/forms/trial-start.php
deleted file mode 100644
index b66e72724..000000000
--- a/vendor/freemius/wordpress-sdk/templates/forms/trial-start.php
+++ /dev/null
@@ -1,181 +0,0 @@
-get_slug();
-
- $message_header = sprintf(
- /* translators: %1$s: Number of trial days; %2$s: Plan name; */
- fs_text_inline( 'You are 1-click away from starting your %1$s-day free trial of the %2$s plan.', 'start-trial-prompt-header', $slug ),
- '',
- ''
- );
- $message_content = sprintf(
- /* translators: %s: Link to freemius.com */
- fs_text_inline( 'For compliance with the WordPress.org guidelines, before we start the trial we ask that you opt in with your user and non-sensitive site information, allowing the %s to periodically send data to %s to check for version updates and to validate your trial.', 'start-trial-prompt-message', $slug ),
- $fs->get_module_type(),
- sprintf(
- '%s',
- 'https://freemius.com',
- 'freemius.com'
- )
- );
-
- $modal_content_html = <<< HTML
-