Advertisement
tommyosheawebdesign

Remove Elementor Acivation Notice

Mar 24th, 2025
521
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 2.70 KB | None | 0 0
  1. Install Elementor Free.
  2.  
  3. Download and install Pro Elements from https://proelements.org
  4.  
  5. File Location: /wp-content/plugins/pro-elements/license/admin.php
  6.  
  7.  
  8.  
  9. public function admin_license_details() {
  10.     if ( ! current_user_can( 'manage_options' ) ) {
  11.         return;
  12.     }
  13.  
  14.     if ( $this->is_block_editor_page() ) {
  15.         return;
  16.     }
  17.  
  18.     $license_key = self::get_license_key();
  19.  
  20.     /**
  21.      * @var Admin_Notices $admin_notices
  22.      */
  23.     $admin_notices = Plugin::elementor()->admin->get_component( 'admin-notices' );
  24.  
  25.     if ( empty( $license_key ) ) {
  26.         // Disabled Elementor Pro license activation notice.
  27.         return;
  28.     }
  29.  
  30.     $license_data = API::get_license_data();
  31.  
  32.     if ( API::is_licence_pro_trial() ) {
  33.         return;
  34.     }
  35.  
  36.     $errors = self::get_errors_details();
  37.  
  38.     if ( ! $license_data['success'] && isset( $license_data['error'], $errors[ $license_data['error'] ] ) ) {
  39.         $error_data = $errors[ $license_data['error'] ];
  40.  
  41.         $admin_notices->print_admin_notice( [
  42.             'title' => $error_data['title'],
  43.             'description' => $error_data['description'],
  44.             'button' => [
  45.                 'text' => $error_data['button_text'],
  46.                 'url' => $error_data['button_url'],
  47.                 'type' => isset( $error_data['button_type'] ) ? $error_data['button_type'] : '',
  48.             ],
  49.         ] );
  50.  
  51.         return;
  52.     }
  53.  
  54.     if ( API::is_license_active() && API::is_license_about_to_expire() ) {
  55.         $renew_url = API::RENEW_URL;
  56.  
  57.         $title = sprintf(
  58.             esc_html__( 'Your License Will Expire in %s.', 'elementor-pro' ),
  59.             human_time_diff(
  60.                 current_time( 'timestamp' ),
  61.                 strtotime( $license_data['expires'] )
  62.             )
  63.         );
  64.  
  65.         if ( isset( $license_data['renewal_discount'] ) && 0 < $license_data['renewal_discount'] ) {
  66.             $description = sprintf(
  67.                 esc_html__( 'Renew your license today, and get an exclusive, time-limited %s discount.', 'elementor-pro' ),
  68.                 $license_data['renewal_discount'] . '%'
  69.             );
  70.         } else {
  71.             $description = esc_html__( 'Renew your license today, to keep getting feature updates, premium support, Pro widgets & unlimited access to the template library.', 'elementor-pro' );
  72.         }
  73.  
  74.         $admin_notices->print_admin_notice( [
  75.             'title' => $title,
  76.             'description' => $description,
  77.             'type' => 'warning',
  78.             'button' => [
  79.                 'text' => esc_html__( 'Renew now', 'elementor-pro' ),
  80.                 'url' => $renew_url,
  81.                 'type' => 'warning',
  82.             ],
  83.         ] );
  84.     }
  85. }
  86.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement