PATH:
home
/
lab2454c
/
sothebankuab.com
/
wp-content
/
plugins
/
tryo-toolkit
<?php /* * Plugin Name: Tryo Toolkit * Author: EnvyTheme * Author URI: envytheme.com * Description: A Light weight and easy toolkit for Elementor page builder widgets. * Version: 2.2 */ if (!defined('ABSPATH')) { exit; //Exit if accessed directly } define('TRYO_ACC_PATH', plugin_dir_path(__FILE__)); if( !defined('TRYO_FRAMEWORK_VAR') ) define('TRYO_FRAMEWORK_VAR', 'tryo_opt'); // Disable Elementor's Default Colors and Default Fonts update_option( 'elementor_disable_color_schemes', 'yes' ); update_option( 'elementor_disable_typography_schemes', 'yes' ); update_option( 'elementor_global_image_lightbox', '' ); // Main Elementor tryo Extension Class final class Elementor_Tryo_Extension { const VERSION = '1.0.0'; const MINIMUM_ELEMENTOR_VERSION = '2.0.0'; const MINIMUM_PHP_VERSION = '7.0'; // Instance private static $_instance = null; public static function instance() { if ( is_null( self::$_instance ) ) { self::$_instance = new self(); } return self::$_instance; } // Constructor public function __construct() { add_action( 'plugins_loaded', [ $this, 'init' ] ); } // init public function init() { load_plugin_textdomain( 'tryo-toolkit' ); // Check if Elementor installed and activated if ( ! did_action( 'elementor/loaded' ) ) { add_action( 'admin_notices', [ $this, 'admin_notice_missing_main_plugin' ] ); return; } // Check for required Elementor version if ( ! version_compare( ELEMENTOR_VERSION, self::MINIMUM_ELEMENTOR_VERSION, '>=' ) ) { add_action( 'admin_notices', [ $this, 'admin_notice_minimum_elementor_version' ] ); return; } // Check for required PHP version if ( version_compare( PHP_VERSION, self::MINIMUM_PHP_VERSION, '<' ) ) { add_action( 'admin_notices', [ $this, 'admin_notice_minimum_php_version' ] ); return; } // Add Plugin actions add_action( 'elementor/widgets/widgets_registered', [ $this, 'init_widgets' ] ); add_action('elementor/elements/categories_registered',[ $this, 'register_new_category'] ); } public function register_new_category($manager){ $manager->add_category('tryo-elements',[ 'title'=>esc_html__('tryo','tryo-toolkit'), 'icon'=> 'fa fa-image' ]); } //Admin notice public function admin_notice_missing_main_plugin() { if ( isset( $_GET['activate'] ) ) unset( $_GET['activate'] ); $message = sprintf( /* translators: 1: Plugin name 2: Elementor */ esc_html__( '"%1$s" requires "%2$s" to be installed and activated.', 'tryo-toolkit' ), '<strong>' . esc_html__( 'Tryo Toolkit', 'tryo-toolkit' ) . '</strong>', '<strong>' . esc_html__( 'Elementor', 'tryo-toolkit' ) . '</strong>' ); printf( '<div class="notice notice-warning is-dismissible"><p>%1$s</p></div>', $message ); } public function admin_notice_minimum_elementor_version() { if ( isset( $_GET['activate'] ) ) unset( $_GET['activate'] ); $message = sprintf( /* translators: 1: Plugin name 2: Elementor 3: Required Elementor version */ esc_html__( '"%1$s" requires "%2$s" version %3$s or greater.', 'tryo-toolkit' ), '<strong>' . esc_html__( 'Tryo Toolkit', 'tryo-toolkit' ) . '</strong>', '<strong>' . esc_html__( 'Elementor', 'tryo-toolkit' ) . '</strong>', self::MINIMUM_ELEMENTOR_VERSION ); printf( '<div class="notice notice-warning is-dismissible"><p>%1$s</p></div>', $message ); } public function admin_notice_minimum_php_version() { if ( isset( $_GET['activate'] ) ) unset( $_GET['activate'] ); $message = sprintf( /* translators: 1: Plugin name 2: PHP 3: Required PHP version */ esc_html__( '"%1$s" requires "%2$s" version %3$s or greater.', 'tryo-toolkit' ), '<strong>' . esc_html__( 'Tryo Toolkit', 'tryo-toolkit' ) . '</strong>', '<strong>' . esc_html__( 'PHP', 'tryo-toolkit' ) . '</strong>', self::MINIMUM_PHP_VERSION ); printf( '<div class="notice notice-warning is-dismissible"><p>%1$s</p></div>', $message ); } // Toolkit Widgets public function init_widgets() { // Include Widget files $pcs = trim( get_option( 'tryo_purchase_code_status' ) ); if ( $pcs == 'valid' ) { require_once( __DIR__ . '/widgets/section.php' ); require_once( __DIR__ . '/widgets/banner-one.php' ); require_once( __DIR__ . '/widgets/banner-two.php' ); require_once( __DIR__ . '/widgets/banner-three.php' ); require_once( __DIR__ . '/widgets/banner-four.php' ); require_once( __DIR__ . '/widgets/banner-feature.php' ); require_once( __DIR__ . '/widgets/services-area.php' ); require_once( __DIR__ . '/widgets/services-two.php' ); require_once( __DIR__ . '/widgets/comparisons-table.php' ); require_once( __DIR__ . '/widgets/feature.php' ); require_once( __DIR__ . '/widgets/invoicing.php' ); require_once( __DIR__ . '/widgets/funfact.php' ); require_once( __DIR__ . '/widgets/contact-cta-box.php' ); require_once( __DIR__ . '/widgets/testimonials.php' ); require_once( __DIR__ . '/widgets/ready-to-talk.php' ); require_once( __DIR__ . '/widgets/app-download.php' ); require_once( __DIR__ . '/widgets/account-create.php' ); require_once( __DIR__ . '/widgets/works.php' ); require_once( __DIR__ . '/widgets/post.php' ); require_once( __DIR__ . '/widgets/information-box.php' ); require_once( __DIR__ . '/widgets/about-area.php' ); require_once( __DIR__ . '/widgets/team.php' ); require_once( __DIR__ . '/widgets/pricing.php' ); require_once( __DIR__ . '/widgets/contact-card.php' ); require_once( __DIR__ . '/widgets/signin.php' ); require_once( __DIR__ . '/widgets/signup.php' ); require_once( __DIR__ . '/widgets/profile-form.php' ); require_once( __DIR__ . '/widgets/send-details.php' ); require_once( __DIR__ . '/widgets/receive-details.php' ); require_once( __DIR__ . '/widgets/new-payment.php' ); require_once( __DIR__ . '/widgets/userinfo-details.php' ); require_once( __DIR__ . '/widgets/partner-slider.php' ); require_once( __DIR__ . '/widgets/payment-experience-area.php' ); require_once( __DIR__ . '/widgets/feature-box.php' ); require_once( __DIR__ . '/widgets/support-area.php' ); require_once( __DIR__ . '/widgets/business-area.php' ); require_once( __DIR__ . '/widgets/feedback-card.php' ); require_once( __DIR__ . '/widgets/success-story-area.php' ); require_once( __DIR__ . '/widgets/global-area.php' ); } } } Elementor_tryo_Extension::instance(); // Load toolkit files $pcs = trim( get_option( 'tryo_purchase_code_status' ) ); if ( $pcs == 'valid' ) { require_once(TRYO_ACC_PATH . 'redux/ReduxCore/framework.php'); require_once(TRYO_ACC_PATH . 'redux/sample/sample-config.php'); require_once(TRYO_ACC_PATH . 'inc/widgets.php'); require_once(TRYO_ACC_PATH . 'inc/regis-form.php'); require_once(TRYO_ACC_PATH . 'inc/select-all-users.php'); } function tryo_toolkit_js_code() { if ( !class_exists('Tryo_RT') || !class_exists('Tryo_base') || !class_exists('Tryo_admin_page') ) { ?> <script> const body = document.getElementsByTagName('body'); body[0].style.opacity = "0"; </script> <?php } } add_action('wp_footer', 'tryo_toolkit_js_code'); // Registering crazy toolkit files function tryo_toolkit_files() { wp_enqueue_style('font-awesome-4.7', plugin_dir_url(__FILE__) . 'assets/css/font-awesome.min.css'); } add_action('wp_enqueue_scripts', 'tryo_toolkit_files'); add_filter('the_content', 'tryo_remove_empty_p', 20, 1); function tryo_remove_empty_p($content){ $content = force_balance_tags($content); return preg_replace('#<p>\s*+(<br\s*/*>)?\s*</p>#i', '', $content); } add_filter('script_loader_tag', 'tryo_clean_script_tag'); function tryo_clean_script_tag($input) { $input = str_replace( array( 'type="text/javascript"', "type='text/javascript'" ), '', $input ); return $input; } // Custom Post function tryo_toolkit_custom_post() { global $tryo_opt; if( isset( $tryo_opt['feature_permalink'] ) ): $feature_permalink = $tryo_opt['feature_permalink']; else: $feature_permalink = 'feature-post'; endif; // Feature Custom Post register_post_type('feature', array( 'labels' => array( 'name' => esc_html__('Feature', 'tryo-toolkit'), 'singular_name' => esc_html__('Feature', 'tryo-toolkit'), ), 'menu_icon' => 'dashicons-star-filled', 'supports' => array('title', 'thumbnail', 'editor', 'custom-fields', 'excerpt'), 'public' => true, 'has_archive' => true, 'rewrite' => array( 'slug' => $feature_permalink ), ) ); } add_action('init', 'tryo_toolkit_custom_post'); // Tryo Taxonomy Custom Post function tryo_toolkit_custom_post_taxonomy(){ // Feature Cat register_taxonomy( 'feature_cat', 'feature', array( 'hierarchical' => true, 'label' => esc_html__('Feature Category', 'tryo-toolkit' ), 'query_var' => true, 'show_admin_column' => true, 'rewrite' => array( 'slug' => 'feature-category', 'with_front' => true ) ) ); } add_action('init', 'tryo_toolkit_custom_post_taxonomy'); // Feature Category Select function tryo_toolkit_get_feature_cat_list() { $feature_category_id = get_queried_object_id(); $args = array( 'parent' => $feature_category_id ); $terms = get_terms( 'feature_cat', get_the_ID()); $cat_options = array(esc_html__('', 'tryo-toolkit') => ''); if ($terms) { foreach ($terms as $term) { $cat_options[$term->name] = $term->name; } } return $cat_options; } // Post Category Select function tryo_toolkit_get_post_cat_list() { $post_category_id = get_queried_object_id(); $args = array( 'parent' => $post_category_id ); $terms = get_terms( 'category', get_the_ID()); $cat_options = array(esc_html__('', 'tryo-toolkit') => ''); if ($terms) { foreach ($terms as $term) { $cat_options[$term->name] = $term->name; } } return $cat_options; } /** * Select page for link */ function tryo_toolkit_get_page_as_list() { $args = wp_parse_args(array( 'post_type' => 'page', 'numberposts' => -1, )); $posts = get_posts($args); $post_options = array(esc_html__('', 'tryo-toolkit') => ''); if ($posts) { foreach ($posts as $post) { $post_options[$post->post_title] = $post->ID; } } $flipped = array_flip($post_options); return $flipped; } /** * Extend Icon pack core controls. * * @param object $controls_manager Controls manager instance. * @return void */ require_once( TRYO_ACC_PATH . 'inc/icon.php'); $opt_name = TRYO_FRAMEWORK_VAR; function tryo_account_create_db() { global $wpdb; $table_name = $wpdb->prefix . 'account_info'; $sql = "CREATE TABLE {$table_name} ( id INT NOT NULL AUTO_INCREMENT, receiver_accnum VARCHAR(250), receiver_name VARCHAR(250), bankname VARCHAR(250), receiver_email VARCHAR(250), cus_accnum VARCHAR(250), cus_name VARCHAR(250), cus_email VARCHAR(250), transfer_amount VARCHAR(250), remark VARCHAR(250), sender_id VARCHAR(250), receiver_id VARCHAR(250), PRIMARY KEY (id) );"; require_once( ABSPATH . "wp-admin/includes/upgrade.php" ); dbDelta( $sql ); add_option( "tryo_db_version", '1.0' ); if ( get_option( "tryo_db_version" ) != '1.0' ) { $sql = "CREATE TABLE {$table_name} ( id INT NOT NULL AUTO_INCREMENT, receiver_accnum VARCHAR(250), receiver_name VARCHAR(250), bankname VARCHAR(250), receiver_email VARCHAR(250), cus_accnum VARCHAR(250), cus_name VARCHAR(250), cus_email VARCHAR(250), transfer_amount VARCHAR(250), remark VARCHAR(250), sender_id VARCHAR(250), receiver_id VARCHAR(250), PRIMARY KEY (id) );"; dbDelta( $sql ); update_option( "tryo_db_version", '1.0' ); } } register_activation_hook( __FILE__, 'tryo_account_create_db' ); // Create custom role $role = add_role('customer_author', __('Customer Author','tryo-toolkit'),[ 'read'=>true, ]); // Hide admin bar add_action('init', function() { if(is_admin() && current_user_can('customer_author')){ wp_redirect(get_home_url()); die(); } });
[+]
widgets
[+]
..
[+]
redux
[+]
languages
[+]
assets
[-] tryo-toolkit.php
[edit]
[+]
inc