is_elementor_pro_installed_or_active(); $elementor_pro_status = $this->get_elementor_pro_status(); foreach ($tables as $key => $table) { if (preg_match('/e_submissions_actions_log$/', $table->Name) || (false !== strpos($table->Name, '_e_') && $this->has_plugin_in_list('kd-submissions', $table->plugin_status))) { if ($is_elementor_pro_installed_or_active && !$this->has_plugin_in_list('elementor-pro', $table->plugin_status)) { $tables[$key]->plugin_status[] = array( 'plugin' => 'elementor-pro', 'status' => $elementor_pro_status, ); } } } return $tables; } /** * Checks plugin status array and checks if selected plugin is already in the list. * * @param string $plugin * @param array $plugin_status * [ * [ * [plugin] => woocommerce * [status] => Array * ( * [installed] => (bool) * [active] => (bool) * ) * @return bool */ private function has_plugin_in_list($plugin, $plugin_status) { foreach ($plugin_status as $plugin_info) { if ($plugin === $plugin_info['plugin']) return true; } return false; } /** * Checks if Elementor Pro is installed or active. This is needed to check if KD Submissions tables should be marked as Elementor tables. * * @return boolean */ private function is_elementor_pro_installed_or_active() { $status = $this->get_elementor_pro_status(); return $status['installed'] || $status['active']; } /** * Get Elementor Pro status * * @return array */ private function get_elementor_pro_status() { return WP_Optimize_Database_Information::instance()->get_plugin_status('elementor-pro'); } /** * Returns singleton instance * * @return WPO_KD_Submissions_Compatibility */ public static function instance() { static $_instance = null; if (null === $_instance) { $_instance = new self(); } return $_instance; } } endif;