diff --git a/.svn/entries b/.svn/entries deleted file mode 100644 index 48082f7..0000000 --- a/.svn/entries +++ /dev/null @@ -1 +0,0 @@ -12 diff --git a/.svn/format b/.svn/format deleted file mode 100644 index 48082f7..0000000 --- a/.svn/format +++ /dev/null @@ -1 +0,0 @@ -12 diff --git a/.svn/pristine/01/01536ce7e0a21d913935bb08abced20daa158d47.svn-base b/.svn/pristine/01/01536ce7e0a21d913935bb08abced20daa158d47.svn-base deleted file mode 100644 index 1800925..0000000 --- a/.svn/pristine/01/01536ce7e0a21d913935bb08abced20daa158d47.svn-base +++ /dev/null @@ -1,334 +0,0 @@ -product = $product; - $this->setup_hooks(); - - return $this; - } - - /** - * Setup endpoints. - */ - private function setup_hooks() { - add_action( $this->product->get_key() . '_recommend_products', array( $this, 'render_products_box' ), 10, 4 ); - add_action( 'admin_head', array( $this, 'enqueue' ) ); - } - - /** - * Check if we should load the module for this product. - * - * @param Product $product Product data. - * - * @return bool Should we load the module? - */ - public function can_load( $product ) { - return true; - } - - /** - * Render products box content. - * - * @param array $plugins_list - list of useful plugins (in slug => nicename format). - * @param array $themes_list - list of useful themes (in slug => nicename format). - * @param array $strings - list of translated strings. - * @param array $preferences - list of preferences. - */ - public function render_products_box( $plugins_list, $themes_list, $strings, $preferences = array() ) { - - if ( empty( $plugins_list ) && empty( $themes_list ) ) { - return; - } - - if ( ! empty( $plugins_list ) && ! current_user_can( 'install_plugins' ) ) { - return; - } - - if ( ! empty( $themes_list ) && ! current_user_can( 'install_themes' ) ) { - return; - } - - add_thickbox(); - - if ( ! empty( $themes_list ) ) { - $list = $this->get_themes( $themes_list, $preferences ); - - if ( has_action( $this->product->get_key() . '_recommend_products_theme_template' ) ) { - do_action( $this->product->get_key() . '_recommend_products_theme_template', $list, $strings, $preferences ); - } else { - echo '
Hey, it\'s great to see you have {product} active for a few days now. How is everything going? If you can spare a few moments to rate it on WordPress.org it would help us a lot (and boost my motivation). Cheers!
~ {developer}, developer of {product}
- map $upstream_http_x_wp_cf_super_cache_active $wp_cf_super_cache_active { - default 'no-cache, no-store, must-revalidate, max-age=0'; - '1' 'objects['cache_controller']->get_cache_control_value(); ?>'; - } -- - - -
- more_clear_headers 'Pragma'; - more_clear_headers 'Expires'; - more_clear_headers 'Cache-Control'; - add_header Cache-Control $wp_cf_super_cache_active; -- - - - - - 0 ): ?> - -
- -- - - - - -
%s
%s', - ( ( 'valid' === $status ) ? sprintf( '', esc_attr( $value ), esc_attr( $this->product->get_key() ) ) : '' ), - ( ( 'valid' === $status ) ? 'themeisle-sdk-text-input-valid' : '' ), - esc_attr( $this->product->get_key() ), - esc_attr( ( ( 'valid' === $status ) ? $this->product->get_key() . '_mask' : $this->product->get_key() ) ), - esc_attr( ( ( 'valid' === $status ) ? ( str_repeat( '*', 30 ) . substr( $value, - 5 ) ) : $value ) ), - esc_attr( ( 'valid' === $status ? 'themeisle-sdk-license-deactivate-cta' : 'themeisle-sdk-license-activate-cta' ) ), - esc_attr( 'valid' === $status ? $valid_string : $invalid_string ), - esc_attr( $this->product->get_key() ), - esc_attr( 'valid' === $status ? $deactivate_string : $activate_string ), - sprintf( wp_kses_data( $license_message ), '' . esc_attr( $this->get_distributor_name() ) . ' ', esc_attr( $this->product->get_type() ) ), - wp_kses_data( empty( $error_message ) ? '' : sprintf( '%s
', ( $error_message ) ) ) - ) . wp_nonce_field( $this->product->get_key() . 'nonce', $this->product->get_key() . 'nonce_field', false, false );//phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped - - } - - /** - * Return the license status. - * - * @param bool $check_expiration Should check if license is valid, but expired. - * - * @return string The License status. - */ - public function get_license_status( $check_expiration = false ) { - - $license_data = get_option( $this->product->get_key() . '_license_data', '' ); - - if ( '' === $license_data ) { - return get_option( $this->product->get_key() . '_license_status', 'not_active' ); - } - $status = isset( $license_data->license ) ? $license_data->license : get_option( $this->product->get_key() . '_license_status', 'not_active' ); - if ( false === $check_expiration ) { - return $status; - } - - return ( 'valid' === $status && isset( $license_data->is_expired ) && 'yes' === $license_data->is_expired ) ? 'active_expired' : $status; - } - - /** - * Check status. - * - * @param string $product_file Product basefile. - * - * @return string Status license. - */ - public static function status( $product_file ) { - $product = Product::get( $product_file ); - if ( ! $product->requires_license() ) { - return self::STATUS_VALID; - } - $license_data = self::get_license_data( $product->get_key() ); - - $status = isset( $license_data->license ) ? $license_data->license : self::STATUS_NOT_ACTIVE; - - return ( 'valid' === $status && isset( $license_data->is_expired ) && 'yes' === $license_data->is_expired ) ? 'active_expired' : $status; - } - - /** - * Product license data. - * - * @param string $key Product key. - * - * @return false|mixed|null - */ - private static function get_license_data( $key ) { - $license_data = get_option( $key . '_license_data', '' ); - - return isset( $license_data->license ) ? $license_data : false; - } - - /** - * Get license hash. - * - * @param string $key Product key. - * - * @return bool|string - */ - public static function create_license_hash( $key ) { - $data = self::get_license_data( $key ); - - if ( ! $data ) { - return false; - } - - return isset( $data->key ) ? wp_hash( $data->key ) : false; - } - - /** - * Check if license is valid. - * - * @param string $product_file Product basefile. - * - * @return bool Is valid? - */ - public static function is_valid( $product_file ) { - return self::status( $product_file ) === self::STATUS_VALID; - } - - /** - * Get product plan. - * - * @param string $product_file Product file. - * - * @return int Plan id. - */ - public static function plan( $product_file ) { - $product = Product::get( $product_file ); - $data = self::get_license_data( $product->get_key() ); - - return isset( $data->price_id ) ? (int) $data->price_id : - 1; - } - - /** - * Get product license key. - * - * @param string $product_file Product file. - * - * @return string - */ - public static function key( $product_file ) { - $product = Product::get( $product_file ); - - return $product->get_license(); - } - - /** - * Return the last error message. - * - * @return mixed Error message. - */ - public function get_error() { - return get_transient( $this->product->get_key() . 'act_err' ); - } - - /** - * Get remote api url. - * - * @return string Remote api url. - */ - public function get_api_url() { - if ( $this->is_from_partner( $this->product ) ) { - return 'https://themeisle.com'; - } - - return $this->product->get_store_url(); - } - - /** - * Get remote api url. - * - * @return string Remote api url. - */ - public function get_distributor_name() { - if ( $this->is_from_partner( $this->product ) ) { - return 'Themeisle'; - } - - return $this->product->get_store_name(); - } - - /** - * License price id. - * - * @return int License plan. - */ - public function get_plan() { - return self::plan( $this->product->get_basefile() ); - } - - /** - * Show the admin notice regarding the license status. - * - * @return bool Should we show the notice ? - */ - public function show_notice() { - if ( ! is_admin() ) { - return false; - } - - if ( apply_filters( $this->product->get_key() . '_hide_license_notices', false ) ) { - return false; - } - - $status = $this->get_license_status( true ); - $no_activations_string = apply_filters( $this->product->get_key() . '_lc_no_activations_string', 'No more activations left for %s. You need to upgrade your plan in order to use %s on more websites. If you need assistance, please get in touch with %s staff.' ); - $no_valid_string = apply_filters( $this->product->get_key() . '_lc_no_valid_string', 'In order to benefit from updates and support for %s, please add your license code from your purchase history and validate it here. ' ); - $expired_license_string = apply_filters( $this->product->get_key() . '_lc_expired_string', 'Your %s\'s License Key has expired. In order to continue receiving support and software updates you must renew your license key.' ); - // No activations left for this license. - if ( 'valid' != $status && $this->check_activation() ) { - ?> -- product->get_name() ), - esc_attr( $this->product->get_name() ), - '' . esc_attr( $this->get_distributor_name() ) . '' - ); - ?> - -
-- product->get_name() . ' ' . $this->product->get_type() ), esc_url( $this->get_api_url() . '?license=' . $this->license_key ) ); ?> -
-- product->get_name() . ' ' . $this->product->get_type() ), esc_url( $this->get_api_url() ), esc_url( admin_url( 'options-general.php' ) . '#' . $this->product->get_key() . '_license' ) ); ?> -
-%s has been successfully activated using %s license !', esc_attr( $this->product->get_name() ), esc_attr( str_repeat( '*', 20 ) . substr( $this->license_local, - 10 ) ) ); ?>
-', $this->product->get_version(), '
' ),
- sprintf( '%sCurrent website:%s %s %s %s', '', '', '', get_site_url(), '
' ),
- sprintf( '%sUsage time:%s %s %s%s', '', '', '', ( time() - $this->product->get_install_time() ), 's
' ),
- sprintf( '%s Uninstall reason %s %s Selected reason from the above survey %s ', '', '', '', '' ),
- ],
- ],
- $disclosure_new_labels
- );
-
- $info_disclosure_content = '' . wp_kses_post( $disclosure_labels['title'] ) . '
'; - echo( sprintf( - '%s requires a newer version of %s. Please %supdate%s %s %s to the latest version.', - '' . esc_attr( $product->get_friendly_name() ) . '', - '' . esc_attr( $requirement->get_friendly_name() ) . '', - '', - '', - '' . esc_attr( $requirement->get_friendly_name() ) . '', - esc_attr( $requirement->is_theme() ? 'theme' : 'plugin' ) - ) ); - echo '
- Themeisle Black Friday Sale is Live! - Enjoy Maximum Savings on . - Learn more - -
-- -