', '', '', '' ); ?>
', '' ); ?>
is_block_editor() ) { return true; } if ( function_exists( 'is_gutenberg_page' ) && is_gutenberg_page() ) { return true; } return false; } public function admin_license_details() { if ( ! current_user_can( 'manage_options' ) ) { return; } if ( $this->is_block_editor_page() ) { return; } $renew_url = API::RENEW_URL; $license_key = self::get_license_key(); /** * @var Admin_Notices $admin_notices */ $admin_notices = Plugin::elementor()->admin->get_component( 'admin-notices' ); if ( empty( $license_key ) ) { $admin_notices->print_admin_notice( [ 'title' => esc_html__( 'Welcome to Elementor Pro!', 'elementor-pro' ), 'description' => $this->get_activate_message(), 'button' => [ 'text' => '' . esc_html__( 'Connect & Activate', 'elementor-pro' ), 'url' => $this->get_connect_url( [ 'utm_source' => 'wp-notification-banner', 'utm_medium' => 'wp-dash', 'utm_campaign' => 'connect-and-activate-license', ] ), ], ] ); return; } $license_data = API::get_license_data(); // When the license with pro trial, the messages here are not relevant, pro trial messages will be shown instead. if ( API::is_licence_pro_trial() ) { return; } $errors = self::get_errors_details(); if ( ! $license_data['success'] && isset( $license_data['error'], $errors[ $license_data['error'] ] ) ) { $error_data = $errors[ $license_data['error'] ]; $admin_notices->print_admin_notice( [ 'title' => $error_data['title'], 'description' => $error_data['description'], 'button' => [ 'text' => $error_data['button_text'], 'url' => $error_data['button_url'], 'type' => isset( $error_data['button_type'] ) ? $error_data['button_type'] : '', ], ] ); return; } if ( API::is_license_active() && API::is_license_about_to_expire() ) { $title = sprintf( /* translators: %s: Days to expire. */ esc_html__( 'Your License Will Expire in %s.', 'elementor-pro' ), human_time_diff( current_time( 'timestamp' ), strtotime( $license_data['expires'] ) ) ); if ( isset( $license_data['renewal_discount'] ) && 0 < $license_data['renewal_discount'] ) { $description = sprintf( /* translators: %s: Discount percent. */ esc_html__( 'Renew your license today, and get an exclusive, time-limited %s discount.', 'elementor-pro' ), $license_data['renewal_discount'] . '%' ); } else { $description = esc_html__( 'Renew your license today, to keep getting feature updates, premium support, Pro widgets & unlimited access to the template library.', 'elementor-pro' ); } $admin_notices->print_admin_notice( [ 'title' => $title, 'description' => $description, 'type' => 'warning', 'button' => [ 'text' => esc_html__( 'Renew now', 'elementor-pro' ), 'url' => $renew_url, 'type' => 'warning', ], ] ); } } public function filter_library_get_templates_args( $body_args ) { $license_key = self::get_license_key(); if ( ! empty( $license_key ) ) { $body_args['license'] = $license_key; $body_args['url'] = home_url(); } return $body_args; } public function handle_tracker_actions() { // Show tracker notice after 24 hours from Pro installed time. $is_need_to_show = ( $this->get_installed_time() < strtotime( '-24 hours' ) ); $is_dismiss_notice = ( '1' === get_option( 'elementor_tracker_notice' ) ); $is_dismiss_pro_notice = ( '1' === get_option( 'elementor_pro_tracker_notice' ) ); if ( $is_need_to_show && $is_dismiss_notice && ! $is_dismiss_pro_notice ) { delete_option( 'elementor_tracker_notice' ); } if ( ! isset( $_GET['elementor_tracker'] ) ) { return; } if ( 'opt_out' === $_GET['elementor_tracker'] ) { update_option( 'elementor_pro_tracker_notice', '1' ); } } public function get_installed_time() { $installed_time = get_option( '_elementor_pro_installed_time' ); if ( ! $installed_time ) { $installed_time = time(); update_option( '_elementor_pro_installed_time', $installed_time ); } return $installed_time; } public function plugin_action_links( $links ) { $license_key = self::get_license_key(); if ( empty( $license_key ) ) { $links['active_license'] = sprintf( '%s', self::get_connect_url([ 'utm_source' => 'wp-plugins', 'utm_medium' => 'wp-dash', 'utm_campaign' => 'connect-and-activate-license', ]), __( 'Connect & Activate', 'elementor-pro' ) ); } if ( API::is_license_expired() ) { $links['renew_license'] = sprintf( '%s', 'https://go.elementor.com/wp-plugins-renew/', __( 'Renew Now', 'elementor-pro' ) ); } return $links; } public function plugin_auto_update_setting_html( $html, $plugin_file ) { $license_data = API::get_license_data(); if ( ELEMENTOR_PRO_PLUGIN_BASE === $plugin_file && ! $license_data['success'] ) { return '' . esc_html__( '(unavailable)', 'elementor-pro' ) . ''; } return $html; } private function handle_dashboard_admin_widget() { add_action( 'elementor/admin/dashboard_overview_widget/after_version', function() { /* translators: %s: Elementor Pro version. */ $label = sprintf( esc_html__( 'Elementor Pro v%s', 'elementor-pro' ), ELEMENTOR_PRO_VERSION ); echo ''; Utils::print_unescaped_internal_string( $label ); echo ''; } ); add_filter( 'elementor/admin/dashboard_overview_widget/footer_actions', function( $additions_actions ) { unset( $additions_actions['go-pro'] ); // Keep Visible to administrator role or for the Pro license owner, remove for non-owner lower-level user types. if ( ! current_user_can( 'manage_options' ) && isset( $additions_actions['find_an_expert'] ) ) { unset( $additions_actions['find_an_expert'] ); } if ( current_user_can( 'manage_options' ) && API::is_license_expired() ) { // Using 'go-pro' key to style the 'renew' button as the 'go-pro' button $additions_actions['go-pro'] = [ 'title' => esc_html__( 'Renew Now', 'elementor-pro' ), 'link' => 'https://go.elementor.com/overview-widget-renew/', ]; } return $additions_actions; }, 550 ); } public function add_finder_item( array $categories ) { $categories['settings']['items']['license'] = [ 'title' => esc_html__( 'License', 'elementor-pro' ), 'url' => self::get_url(), ]; return $categories; } private function render_manually_activation_widget( $license_key ) { ?>