set_basename( false, __FILE__ ); } else { $register_freemius = true; if ( get_option('royal_elementor_addons_pro_activation_time') ) { if ( function_exists('is_plugin_active') ) { if ( is_plugin_active('wpr-addons-pro/wpr-addons-pro.php') || is_plugin_active('royal-elementor-addons-pro/wpr-addons-pro.php') ) { $register_freemius = false; } } } if ( $register_freemius ) { // Create a helper function for easy SDK access. function wpr_fs() { global $wpr_fs; if ( ! isset( $wpr_fs ) ) { // Include Freemius SDK. require_once dirname(__FILE__) . '/freemius/start.php'; $wpr_fs = fs_dynamic_init( array( 'id' => '8416', 'slug' => 'wpr-addons', 'premium_slug' => 'wpr-addons-pro', 'type' => 'plugin', 'public_key' => 'pk_a0b21b234a7c9581a555b9ee9f28a', 'is_premium' => false, 'has_premium_version' => true, 'has_paid_plans' => false, 'has_addons' => false, 'has_affiliation' => 'selected', 'menu' => array( 'slug' => 'wpr-addons', 'first-path' => 'admin.php?page=wpr-templates-kit', 'support' => false, 'affiliation' => true, 'pricing' => false, ), ) ); } return $wpr_fs; } // Init Freemius. wpr_fs(); // Signal that SDK was initiated. do_action( 'wpr_fs_loaded' ); wpr_fs()->add_filter( 'show_deactivation_subscription_cancellation', '__return_false' ); wpr_fs()->add_filter( 'deactivate_on_activation', '__return_false' ); function disable_contact_for_free_users( $is_visible, $menu_id ) { if ( 'contact' != $menu_id ) { return $is_visible; } return wpr_fs()->can_use_premium_code(); } wpr_fs()->add_filter( 'is_submenu_visible', 'disable_contact_for_free_users', 10, 2 ); } } /** * Load gettext translate for our text domain. * * @since 1.0.0 * * @return void */ function wpr_addons_load_plugin() { if ( ! did_action( 'elementor/loaded' ) ) { add_action( 'admin_notices', 'wpr_addons_fail_load' ); return; } $elementor_version_required = '2.0.0'; if ( ! version_compare( ELEMENTOR_VERSION, $elementor_version_required, '>=' ) ) { add_action( 'admin_notices', 'wpr_addons_fail_load_out_of_date' ); return; } require( WPR_ADDONS_PATH . 'plugin.php' ); } add_action( 'plugins_loaded', 'wpr_addons_load_plugin' ); /** * Show in WP Dashboard notice about the plugin is not activated. * * @since 1.0.0 * * @return void */ function wpr_addons_fail_load() { $screen = get_current_screen(); if ( isset( $screen->parent_file ) && 'plugins.php' === $screen->parent_file && 'update' === $screen->id ) { return; } $plugin = 'elementor/elementor.php'; if ( _is_elementor_installed() ) { if ( ! current_user_can( 'activate_plugins' ) ) { return; } $activation_url = wp_nonce_url( 'plugins.php?action=activate&plugin='. $plugin .'&plugin_status=all&paged=1&s', 'activate-plugin_'. $plugin ); $message = '
' . esc_html__( 'Royal Elementor Addons is not working because you need to activate the Elementor plugin.', 'wpr-addons' ) . '
'; $message .= '' . sprintf( '%s', $activation_url, esc_html__( 'Activate Elementor Now', 'wpr-addons' ) ) . '
'; } else { if ( ! current_user_can( 'install_plugins' ) ) { return; } $install_url = wp_nonce_url( self_admin_url( 'update.php?action=install-plugin&plugin=elementor' ), 'install-plugin_elementor' ); $message = '' . esc_html__( 'Royal Elementor Addons is not working because you need to install the Elemenor plugin', 'wpr-addons' ) . '
'; $message .= '' . sprintf( '%s', $install_url, esc_html__( 'Install Elementor Now', 'wpr-addons' ) ) . '
'; } echo ''. wp_kses_post($message) .'
' . esc_html__( 'Royal Elementor Addons is not working because you are using an old version of Elementor.', 'wpr-addons' ) . '
'; $message .= '' . sprintf( '%s', $upgrade_link, esc_html__( 'Update Elementor Now', 'wpr-addons' ) ) . '
'; echo '