PATH:
home
/
letacommog
/
lenazen
/
wp-content
/
plugins
/
fusion-builder
/
inc
/
lib
/
inc
<?php /** * Helper methods. * * @package Fusion-Library * @since 1.0.0 */ // Do not allow directly accessing this file. if ( ! defined( 'ABSPATH' ) ) { exit( 'Direct script access denied.' ); } /** * Includes static helper methods. */ final class Fusion_Helper { /** * Converts a PHP version to 3-part. * * @static * @access public * @param string $ver The verion number. * @return string */ public static function normalize_version( $ver ) { if ( ! is_string( $ver ) ) { return $ver; } $ver_parts = explode( '.', $ver ); $count = count( $ver_parts ); // Keep only the 1st 3 parts if longer. if ( 3 < $count ) { return absint( $ver_parts[0] ) . '.' . absint( $ver_parts[1] ) . '.' . absint( $ver_parts[2] ); } // If a single digit, then append '.0.0'. if ( 1 === $count ) { return absint( $ver_parts[0] ) . '.0.0'; } // If 2 digits, append '.0'. if ( 2 === $count ) { return absint( $ver_parts[0] ) . '.' . absint( $ver_parts[1] ) . '.0'; } return $ver; } /** * Instantiates the WordPress filesystem. * * @static * @access public * @return object WP_Filesystem */ public static function init_filesystem() { $credentials = array(); if ( ! defined( 'FS_METHOD' ) ) { define( 'FS_METHOD', 'direct' ); } $method = defined( 'FS_METHOD' ) ? FS_METHOD : false; if ( 'ftpext' === $method ) { // If defined, set it to that, Else, set to NULL. $credentials['hostname'] = defined( 'FTP_HOST' ) ? preg_replace( '|\w+://|', '', FTP_HOST ) : null; $credentials['username'] = defined( 'FTP_USER' ) ? FTP_USER : null; $credentials['password'] = defined( 'FTP_PASS' ) ? FTP_PASS : null; // Set FTP port. if ( strpos( $credentials['hostname'], ':' ) && null !== $credentials['hostname'] ) { list( $credentials['hostname'], $credentials['port'] ) = explode( ':', $credentials['hostname'], 2 ); if ( ! is_numeric( $credentials['port'] ) ) { unset( $credentials['port'] ); } } else { unset( $credentials['port'] ); } // Set connection type. if ( ( defined( 'FTP_SSL' ) && FTP_SSL ) && 'ftpext' === $method ) { $credentials['connection_type'] = 'ftps'; } elseif ( ! array_filter( $credentials ) ) { $credentials['connection_type'] = null; } else { $credentials['connection_type'] = 'ftp'; } } // The Wordpress filesystem. global $wp_filesystem; if ( empty( $wp_filesystem ) ) { require_once wp_normalize_path( ABSPATH . '/wp-admin/includes/file.php' ); WP_Filesystem( $credentials ); } return $wp_filesystem; } /** * Auto calculate accent color, based on provided background color. * * @since 1.5.2 * @param string $color color base value. * @return string */ public static function fusion_auto_calculate_accent_color( $color ) { $color_obj = Fusion_Color::new_color( $color ); // Not black. if ( 0 < $color_obj->lightness ) { if ( 25 > $color_obj->lightness ) { // Colors with very little lightness. return $color_obj->getNew( 'lightness', $color_obj->lightness * 4 )->toCSS( 'rgba' ); } else if ( 50 > $color_obj->lightness ) { return $color_obj->getNew( 'lightness', $color_obj->lightness * 2 )->toCSS( 'rgba' ); } else if ( 50 <= $color_obj->lightness ) { return $color_obj->getNew( 'lightness', $color_obj->lightness / 2 )->toCSS( 'rgba' ); } } else { // // Black. return $color_obj->getNew( 'lightness', 70 )->toCSS( 'rgba' ); } } }
[+]
..
[-] fusion-icon.php
[edit]
[-] class-fusion-fusionredux.php
[edit]
[-] class-fusion-featured-image.php
[edit]
[-] class-fusion-dynamic-js-file.php
[edit]
[-] class-fusion-settings.php
[edit]
[-] class-fusion-updater.php
[edit]
[-] class-fusion-images.php
[edit]
[-] class-fusion-dynamic-css.php
[edit]
[-] class-fusion-sanitize.php
[edit]
[-] class-fusion-scripts.php
[edit]
[-] wc-functions.php
[edit]
[-] class-fusion-dynamic-css-helpers.php
[edit]
[-] class-fusion-dynamic-css-inline.php
[edit]
[-] class-fusion-patcher-apply-patch.php
[edit]
[+]
importer
[-] class-fusion-helper.php
[edit]
[-] class-fusion-color.php
[edit]
[+]
redux
[-] class-fusion-library-autoloader.php
[edit]
[-] class-fusion-envato-api.php
[edit]
[-] class-fusion-patcher-admin-notices.php
[edit]
[-] class-fusion-data.php
[edit]
[-] class-fusion-dynamic-js.php
[edit]
[-] class-fusion-patcher.php
[edit]
[-] class-fusion-patcher-admin-screen.php
[edit]
[-] class-fusion-dynamic-js-compiler.php
[edit]
[-] class-fusion-patcher-filesystem.php
[edit]
[-] class-fusion-patcher-client.php
[edit]
[-] class-fusion-filesystem.php
[edit]
[-] functions.php
[edit]
[-] class-fusion-admin-notice.php
[edit]
[-] class-fusion-privacy.php
[edit]
[-] class-fusion-dynamic-css-file.php
[edit]
[-] class-fusion-dynamic-js-separate.php
[edit]
[-] class-fusion-patcher-cache.php
[edit]
[-] class-fusion.php
[edit]
[-] class-fusion-multilingual.php
[edit]
[-] class-fusion-cache.php
[edit]
[+]
templates
[-] class-fusion-product-registration.php
[edit]
[-] class-fusion-options.php
[edit]
[-] class-fusion-patcher-checker.php
[edit]