Changeset 3452972
- Timestamp:
- 02/03/2026 02:45:02 PM (5 weeks ago)
- Location:
- dynamic-inspector-for-elementor
- Files:
-
- 4 edited
-
tags/1.0.0/core/plugin.php (modified) (2 diffs)
-
tags/1.0.0/dynamic-inspector-for-elementor.php (modified) (3 diffs)
-
trunk/core/plugin.php (modified) (2 diffs)
-
trunk/dynamic-inspector-for-elementor.php (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
dynamic-inspector-for-elementor/tags/1.0.0/core/plugin.php
r3452953 r3452972 45 45 */ 46 46 private function init() { 47 // Check if Elementor is loaded48 if ( ! did_action( 'elementor/loaded' ) ) {49 add_action( 'admin_notices', [ $this, 'elementor_missing_notice' ] );50 return;51 }52 53 47 $this->notices = new \DynamicInspectorForElementor\AdminPages\Notices(); 54 48 … … 174 168 return $this->frontend_inspector_manager; 175 169 } 176 177 /**178 * @return void179 */180 public function elementor_missing_notice() {181 $message = sprintf(182 /* translators: 1: Plugin name 2: Elementor */183 esc_html__( '"%1$s" requires "%2$s" to be installed and activated.', 'dynamic-inspector-for-elementor' ),184 '<strong>' . esc_html__( 'Dynamic Inspector for Elementor', 'dynamic-inspector-for-elementor' ) . '</strong>',185 '<strong>' . esc_html__( 'Elementor', 'dynamic-inspector-for-elementor' ) . '</strong>'186 );187 188 printf( '<div class="notice notice-warning is-dismissible"><p>%1$s</p></div>', wp_kses_post( $message ) );189 }190 170 } -
dynamic-inspector-for-elementor/tags/1.0.0/dynamic-inspector-for-elementor.php
r3452953 r3452972 45 45 define( 'DIFE_URL', plugin_dir_url( __FILE__ ) ); 46 46 define( 'DIFE_PLUGIN_BASE', plugin_basename( __FILE__ ) ); 47 define( 'DIFE_PRODUCT_NAME', 'Dynamic Inspector for Elementor' ); 48 49 // Required versions 50 define( 'DIFE_MINIMUM_ELEMENTOR_VERSION', '3.25.0' ); 51 define( 'DIFE_MINIMUM_ELEMENTOR_PRO_VERSION', '3.25.0' ); 47 52 48 53 /** … … 52 57 */ 53 58 function dife_load_plugin() { 59 // Check if Elementor is loaded 60 if ( ! did_action( 'elementor/loaded' ) ) { 61 add_action( 'admin_notices', 'dife_fail_load' ); 62 return; 63 } 64 65 // Check Elementor version 66 if ( defined( 'ELEMENTOR_VERSION' ) && version_compare( ELEMENTOR_VERSION, DIFE_MINIMUM_ELEMENTOR_VERSION, '<' ) ) { 67 add_action( 'admin_notices', 'dife_admin_notice_minimum_elementor_version' ); 68 return; 69 } 70 71 // Check Elementor Pro version (only if Pro is active) 72 if ( defined( 'ELEMENTOR_PRO_VERSION' ) && version_compare( ELEMENTOR_PRO_VERSION, DIFE_MINIMUM_ELEMENTOR_PRO_VERSION, '<' ) ) { 73 add_action( 'admin_notices', 'dife_admin_notice_minimum_elementor_pro_version' ); 74 return; 75 } 76 54 77 // Simple autoloader for plugin classes 55 78 spl_autoload_register( … … 91 114 echo '<div class="error"><p>' . wp_kses_post( $msg ) . '</p></div>'; 92 115 } 116 117 /** 118 * @return void 119 */ 120 function dife_admin_notice_minimum_elementor_version() { 121 /* translators: %1$s: product name, %2$s: minimum Elementor version */ 122 $msg = sprintf( esc_html__( '%1$s requires Elementor version %2$s or greater.', 'dynamic-inspector-for-elementor' ), DIFE_PRODUCT_NAME, DIFE_MINIMUM_ELEMENTOR_VERSION ); 123 echo '<div class="notice notice-error"><p>' . esc_html( $msg ) . '</p></div>'; 124 } 125 126 /** 127 * @return void 128 */ 129 function dife_admin_notice_minimum_elementor_pro_version() { 130 /* translators: %1$s: product name, %2$s: minimum Elementor Pro version */ 131 $msg = sprintf( esc_html__( 'If you want to use Elementor Pro with %1$s, it requires version %2$s or greater.', 'dynamic-inspector-for-elementor' ), DIFE_PRODUCT_NAME, DIFE_MINIMUM_ELEMENTOR_PRO_VERSION ); 132 echo '<div class="notice notice-error"><p>' . esc_html( $msg ) . '</p></div>'; 133 } -
dynamic-inspector-for-elementor/trunk/core/plugin.php
r3452953 r3452972 45 45 */ 46 46 private function init() { 47 // Check if Elementor is loaded48 if ( ! did_action( 'elementor/loaded' ) ) {49 add_action( 'admin_notices', [ $this, 'elementor_missing_notice' ] );50 return;51 }52 53 47 $this->notices = new \DynamicInspectorForElementor\AdminPages\Notices(); 54 48 … … 174 168 return $this->frontend_inspector_manager; 175 169 } 176 177 /**178 * @return void179 */180 public function elementor_missing_notice() {181 $message = sprintf(182 /* translators: 1: Plugin name 2: Elementor */183 esc_html__( '"%1$s" requires "%2$s" to be installed and activated.', 'dynamic-inspector-for-elementor' ),184 '<strong>' . esc_html__( 'Dynamic Inspector for Elementor', 'dynamic-inspector-for-elementor' ) . '</strong>',185 '<strong>' . esc_html__( 'Elementor', 'dynamic-inspector-for-elementor' ) . '</strong>'186 );187 188 printf( '<div class="notice notice-warning is-dismissible"><p>%1$s</p></div>', wp_kses_post( $message ) );189 }190 170 } -
dynamic-inspector-for-elementor/trunk/dynamic-inspector-for-elementor.php
r3452953 r3452972 45 45 define( 'DIFE_URL', plugin_dir_url( __FILE__ ) ); 46 46 define( 'DIFE_PLUGIN_BASE', plugin_basename( __FILE__ ) ); 47 define( 'DIFE_PRODUCT_NAME', 'Dynamic Inspector for Elementor' ); 48 49 // Required versions 50 define( 'DIFE_MINIMUM_ELEMENTOR_VERSION', '3.25.0' ); 51 define( 'DIFE_MINIMUM_ELEMENTOR_PRO_VERSION', '3.25.0' ); 47 52 48 53 /** … … 52 57 */ 53 58 function dife_load_plugin() { 59 // Check if Elementor is loaded 60 if ( ! did_action( 'elementor/loaded' ) ) { 61 add_action( 'admin_notices', 'dife_fail_load' ); 62 return; 63 } 64 65 // Check Elementor version 66 if ( defined( 'ELEMENTOR_VERSION' ) && version_compare( ELEMENTOR_VERSION, DIFE_MINIMUM_ELEMENTOR_VERSION, '<' ) ) { 67 add_action( 'admin_notices', 'dife_admin_notice_minimum_elementor_version' ); 68 return; 69 } 70 71 // Check Elementor Pro version (only if Pro is active) 72 if ( defined( 'ELEMENTOR_PRO_VERSION' ) && version_compare( ELEMENTOR_PRO_VERSION, DIFE_MINIMUM_ELEMENTOR_PRO_VERSION, '<' ) ) { 73 add_action( 'admin_notices', 'dife_admin_notice_minimum_elementor_pro_version' ); 74 return; 75 } 76 54 77 // Simple autoloader for plugin classes 55 78 spl_autoload_register( … … 91 114 echo '<div class="error"><p>' . wp_kses_post( $msg ) . '</p></div>'; 92 115 } 116 117 /** 118 * @return void 119 */ 120 function dife_admin_notice_minimum_elementor_version() { 121 /* translators: %1$s: product name, %2$s: minimum Elementor version */ 122 $msg = sprintf( esc_html__( '%1$s requires Elementor version %2$s or greater.', 'dynamic-inspector-for-elementor' ), DIFE_PRODUCT_NAME, DIFE_MINIMUM_ELEMENTOR_VERSION ); 123 echo '<div class="notice notice-error"><p>' . esc_html( $msg ) . '</p></div>'; 124 } 125 126 /** 127 * @return void 128 */ 129 function dife_admin_notice_minimum_elementor_pro_version() { 130 /* translators: %1$s: product name, %2$s: minimum Elementor Pro version */ 131 $msg = sprintf( esc_html__( 'If you want to use Elementor Pro with %1$s, it requires version %2$s or greater.', 'dynamic-inspector-for-elementor' ), DIFE_PRODUCT_NAME, DIFE_MINIMUM_ELEMENTOR_PRO_VERSION ); 132 echo '<div class="notice notice-error"><p>' . esc_html( $msg ) . '</p></div>'; 133 }
Note: See TracChangeset
for help on using the changeset viewer.