Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: integrations not loading properly #1486

Merged

Conversation

sapayth
Copy link
Member

@sapayth sapayth commented Oct 7, 2024

fixes #1487

ACF, Dokan, WC Vendors, WCFM integrations wasn't loading properly with WPUF.

need to test all the integrations. some video references on how the integration works:
Dokan
ACF
WC Vendors
WC Marketplace/ WCFM [related PR]

Summary by CodeRabbit

Summary by CodeRabbit

  • New Features

    • Introduced a new Integrations class to manage various integrations dynamically based on available plugins.
    • Added support for integrations with Dokan, WC Vendors, WCMp, and ACF.
    • Improved form submission process with structured validation for form fields.
    • Enhanced form rendering logic with better JavaScript initialization and improved form structure.
  • Improvements

    • Enhanced the WP_User_Frontend class to include an instance of the new Integrations class for better integration management.
    • Simplified logic in the dokan_is_seller_dashboard method for improved clarity.
    • Minor formatting adjustments in the template files for consistency.

Copy link

coderabbitai bot commented Oct 7, 2024

Walkthrough

The changes introduce a new class Integrations in the WeDevs\Wpuf namespace, which acts as an installer for various integrations based on the presence of specific external classes. The Integrations class contains a public property $container to hold instances of integration classes. Additionally, the WP_User_Frontend class in wpuf.php is updated to include an instance of the Integrations class in its $container array, facilitating the management of these integrations. Other modifications enhance form handling and validation processes.

Changes

File Change Summary
includes/Integrations.php - Added class Integrations
- Added public property $container = []
- Added constructor method __construct()
- Added magic method __get($prop)
wpuf.php - Added $this->container['integrations'] = new WeDevs\Wpuf\Integrations(); in the instantiate method
includes/Ajax/Frontend_Form_Ajax.php - Added private property $form_fields
- Modified submit_post method to utilize $form_fields for validation
- Updated wpuf_get_post_user for guest user handling
includes/Frontend.php - Simplified logic in dokan_is_seller_dashboard method
includes/Frontend_Render_Form.php - Added JavaScript block in render_form method to initialize global arrays and updated form structure
templates/dokan/new-post.php - Minor formatting change for $access variable alignment

Assessment against linked issues

Objective Addressed Explanation
Integrations should load seamlessly within WPUF (related to Dokan, ACF, WC Vendors, WCFM) (#1487)

Possibly related PRs

  • fix: AllowDynamicProperty warning #1466: The changes in wpuf.php regarding the $container property and the instantiation of the Integrations class are directly related to the modifications made in the main PR.
  • fix: error on WC post template #1468: The modifications in includes/Ajax/Frontend_Form_Ajax.php may relate to the overall integration management, as both PRs involve handling form submissions and integrations within the WPUF plugin.
  • enhance: subscription design followups #1471: The enhancements in the includes/Frontend.php file may connect to the main PR's focus on integrations, as both involve improving user interactions and functionality within the frontend context.
  • enhance: move newsletter subscription to weMail #1472: The changes in includes/Admin/views/support.php may relate to the integration management, as both PRs aim to enhance user experience and functionality within the WPUF plugin.

Suggested labels

bug, needs: developer feedback

🐇 In the garden of code, I hop with glee,
Integrations sprout, as bright as can be!
With classes and containers, we dance and play,
New features are blooming, hip-hip-hooray!
So let’s merge these changes, let the magic unfold,
A world of integrations, a sight to behold! 🌼


Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🧹 Outside diff range and nitpick comments (3)
includes/Integrations.php (2)

11-18: LGTM: Property declaration is clear and well-documented.

The $container property is appropriately named and initialized. The docblock provides clear information about its purpose.

Consider making the $container property protected and providing a getter method for better encapsulation:

-    public $container = [];
+    protected $container = [];
+
+    public function get_container() {
+        return $this->container;
+    }

This change would allow you to maintain control over how the container is accessed and modified externally.


20-36: LGTM: Constructor logic is sound, but could be more extensible.

The constructor effectively initializes various integrations based on the presence of specific classes. The use of class_exists() checks is appropriate for conditional loading.

Consider refactoring the constructor to improve extensibility and maintainability:

  1. Create a protected method to handle integration registration:
protected function register_integration($class_name, $integration_class, $key) {
    if (class_exists($class_name)) {
        $this->container[$key] = new $integration_class();
    }
}
  1. Update the constructor to use this method:
public function __construct() {
    $this->register_integration('WeDevs_Dokan', Integrations\WPUF_Dokan_Integration::class, 'dokan');
    $this->register_integration('WC_Vendors', Integrations\WPUF_WC_Vendors_Integration::class, 'wc_vendors');
    $this->register_integration('WCMp', Integrations\WPUF_WCMp_Integration::class, 'wcmp');
    $this->register_integration('ACF', Integrations\WPUF_ACF_Compatibility::class, 'acf');
}

This refactoring would make it easier to add or modify integrations in the future and improve the overall maintainability of the class.

wpuf.php (1)

176-176: LGTM! Consider optimizing integration loading.

The addition of the Integrations class to the container is a good step towards fixing the integration loading issues mentioned in the PR objectives. This change will allow for centralized management of various plugin integrations.

However, to optimize performance, consider the following suggestions:

  1. Implement lazy loading for integrations, only instantiating them when needed.
  2. Add conditional checks to ensure that the required plugins for each integration are active before loading them.

Would you like me to provide an example of how to implement these optimizations?

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

📥 Commits

Files that changed from the base of the PR and between 9466787 and 233fe4f.

📒 Files selected for processing (2)
  • includes/Integrations.php (1 hunks)
  • wpuf.php (1 hunks)
🧰 Additional context used
🔇 Additional comments (2)
includes/Integrations.php (1)

1-10: LGTM: Class structure and namespace are well-defined.

The Integrations class is properly namespaced and follows PSR-1 naming conventions. The docblock provides a concise description of the class purpose.

wpuf.php (1)

Line range hint 1-476: Summary of changes and potential impact

The addition of the Integrations class to the plugin's container is a positive step towards addressing the integration loading issues mentioned in the PR objectives. This change lays the groundwork for a more centralized and potentially more efficient management of various plugin integrations (ACF, Dokan, WC Vendors, WCFM).

Key points:

  1. The change is minimal but strategically important.
  2. It doesn't directly solve the loading issues but provides the necessary infrastructure.
  3. The effectiveness of this change will depend on how the Integrations class is implemented and utilized throughout the plugin.

Next steps:

  1. Implement the Integrations class to handle the loading of various integrations.
  2. Update other parts of the plugin to use this new Integrations instance where appropriate.
  3. Consider optimizing the integration loading process as suggested in previous comments.

Overall, this change is a step in the right direction for improving the plugin's integration management.

wpuf.php Show resolved Hide resolved
Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🧹 Outside diff range and nitpick comments (2)
includes/Integrations.php (2)

5-10: Replace WPUF_SINCE placeholder with the actual version number.

The @since tag in the class docblock contains a placeholder WPUF_SINCE. To maintain accurate documentation, please replace this with the actual version number in which this class was introduced.


38-53: LGTM: Magic method implementation is correct. Consider adding type hints.

The __get magic method is well-implemented and documented. It correctly handles access to the integration instances stored in the $container array.

As a minor improvement, consider adding type hints to the method signature and return type:

public function __get(string $prop): ?object

This would provide better clarity about the expected input and output types.

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

📥 Commits

Files that changed from the base of the PR and between 233fe4f and 11d13f1.

📒 Files selected for processing (1)
  • includes/Integrations.php (1 hunks)
🧰 Additional context used
🔇 Additional comments (2)
includes/Integrations.php (2)

11-18: LGTM: Property declaration is well-documented and appropriate.

The $container property is correctly declared as a public array and is well-documented. Its purpose of holding various class instances is clearly explained in the docblock.


1-54: Overall assessment: Good implementation with room for improvement

The Integrations class provides a solid foundation for managing various plugin integrations. The main points for improvement are:

  1. Refactoring the constructor for better maintainability and flexibility.
  2. Adding type hints to method signatures for improved code clarity.
  3. Replacing the WPUF_SINCE placeholder with the actual version number in the class docblock.

These changes will enhance the code's readability, maintainability, and robustness. Great job on implementing this integration management system!

Comment on lines 20 to 36
public function __construct() {
if ( class_exists( 'WeDevs_Dokan' ) ) {
$this->container['dokan'] = new Integrations\WPUF_Dokan_Integration();
}

if ( class_exists( 'WC_Vendors' ) ) {
$this->container['wc_vendors'] = new Integrations\WPUF_WC_Vendors_Integration();
}

if ( class_exists( 'WCMp' ) ) {
$this->container['wcmp'] = new Integrations\WPUF_WCMp_Integration();
}

if ( class_exists( 'ACF' ) ) {
$this->container['acf'] = new Integrations\WPUF_ACF_Compatibility();
}
}
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛠️ Refactor suggestion

Consider refactoring for improved maintainability and flexibility.

While the constructor logic is functional, there are opportunities for improvement:

  1. Consider using an array or configuration file to define the mappings between external classes and their corresponding integration classes. This would make it easier to add or modify integrations in the future.

  2. The integration class names are currently hardcoded. Consider using a naming convention or configuration that allows for more dynamic loading of integration classes.

  3. You might want to add error handling or logging for cases where an integration class fails to initialize.

Here's a potential refactor:

private $integrations = [
    'WeDevs_Dokan' => 'WPUF_Dokan_Integration',
    'WC_Vendors' => 'WPUF_WC_Vendors_Integration',
    'WCMp' => 'WPUF_WCMp_Integration',
    'ACF' => 'WPUF_ACF_Compatibility',
];

public function __construct() {
    foreach ($this->integrations as $externalClass => $integrationClass) {
        if (class_exists($externalClass)) {
            $fullClassName = __NAMESPACE__ . '\\Integrations\\' . $integrationClass;
            try {
                $this->container[strtolower($externalClass)] = new $fullClassName();
            } catch (\Exception $e) {
                // Log the error or handle it appropriately
            }
        }
    }
}

This approach would make it easier to add new integrations in the future and provides better error handling.

@Rat01047 Rat01047 self-assigned this Oct 8, 2024
@Rat01047

This comment was marked as resolved.

@Rat01047

This comment was marked as resolved.

@sapayth
Copy link
Member Author

sapayth commented Oct 8, 2024

Issue-1: From Dokan-Dashboard --> Post Form Submission/creation is not working ---> After Submission the Page just reloads and post is not created

Additional-info:

  • No Debug log error
  • No Console error
  • Post not created
  • No email log

Video for reference: https://www.awesomescreenshot.com/video/32320868?key=98325190342fb46116fc9ead4d875dbd

fixed. please have a look now

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

🧹 Outside diff range and nitpick comments (6)
includes/Ajax/Frontend_Form_Ajax.php (6)

22-25: Provide a descriptive comment for $form_fields property

The docblock for the $form_fields property currently only specifies the type as @var array. Consider adding a brief description to explain what this property holds, enhancing code readability and maintainability.

Apply this diff to add a description:

 /**
+ * Holds the fields of the form for validation and processing.
  * @var array
  */
 private $form_fields;

Line range hint 57-98: Refactor content restriction validation to reduce code duplication

The current implementation of content restriction validation for 'character' and 'word' counts with 'min' and 'max' conditions contains duplicated code blocks. Refactoring can improve maintainability and readability.

Consider refactoring the validation logic into a single function or using a mapping approach. Here's an example of how you might simplify the code:

foreach ( $this->form_fields as $single_field ) {
    // Continue if no content restriction
    if ( empty( $single_field['content_restriction'] ) ) {
        continue;
    }

    $restricted_num  = $single_field['content_restriction'];
    $restriction_to  = ! empty( $single_field['restriction_to'] ) ? $single_field['restriction_to'] : 'min';
    $restriction_type = ! empty( $single_field['restriction_type'] ) ? $single_field['restriction_type'] : 'word';
    $current_data    = ! empty( $_POST[ $single_field['name'] ] ) ? wp_unslash( $_POST[ $single_field['name'] ] ) : '';
    $label           = ! empty( $single_field['label'] ) ? $single_field['label'] : '';

    // Sanitize data based on field type
    if ( 'word' === $restriction_type ) {
        $current_data_length = str_word_count( wp_strip_all_tags( $current_data ) );
        $type_label = 'word';
    } else {
        $current_data_length = strlen( wp_strip_all_tags( $current_data ) );
        $type_label = 'character';
    }

    if ( $current_data_length > 0 ) {
        if ( 'min' === $restriction_to && $current_data_length < $restricted_num ) {
            wpuf()->ajax->send_error(
                sprintf(
                    __( 'Minimum %d %s is required for %s', 'wp-user-frontend' ),
                    $restricted_num,
                    $type_label,
                    $label
                )
            );
        } elseif ( 'max' === $restriction_to && $current_data_length > $restricted_num ) {
            wpuf()->ajax->send_error(
                sprintf(
                    __( 'Maximum %d %s is allowed for %s', 'wp-user-frontend' ),
                    $restricted_num,
                    $type_label,
                    $label
                )
            );
        }
    }
}

Line range hint 970-987: Use wpuf()->ajax->send_error() for consistent error handling

In the wpuf_get_post_user() method, when validating the guest email, the error response is sent using echo json_encode() followed by die();. For consistency and better error handling, consider using wpuf()->ajax->send_error().

Apply this diff to fix the error handling:

 if ( ! is_email( $guest_email ) ) {
-    echo json_encode(
-        [
-            'success' => false,
-            'error'   => __( 'Invalid email address.', 'wp-user-frontend' ),
-        ]
-    );
-    die();
+    wpuf()->ajax->send_error( __( 'Invalid email address.', 'wp-user-frontend' ) );
 }

Line range hint 725-727: Correct typographical error in confirmation message

The message "We have sent you an confirmation email." contains a typographical error. It should read "We have sent you a confirmation email."

Apply this diff to correct the message in both occurrences:

 $response['message'] = __( 'Thank you for posting on our site. We have sent you a confirmation email. Please check your inbox!', 'wp-user-frontend' );

Also applies to: 745-747


Line range hint 1240-1251: Fix variable assignment in custom field placeholder handling

In the prepare_mail_body() method, the assignment [ $search, $replace ] = $matches; is incorrect. The preg_match_all function returns an array where $matches[0] contains the full matches and $matches[1] contains the captured groups. Assigning them correctly ensures placeholders are properly replaced.

Apply this diff to fix the variable assignment:

 preg_match_all( '/{custom_([\w-]*)\b}/', $content, $matches );
-[ $search, $replace ] = $matches;
+$search  = $matches[0];
+$replace = $matches[1];

Line range hint 1252-1278: Simplify custom field value concatenation logic

The current logic for concatenating custom field values is complex and might result in redundant commas and values. Consider simplifying the logic to handle multiple values more efficiently.

Here is a refactored version:

foreach ( $replace as $index => $meta_key ) {
    $value = get_post_meta( $post_id, $meta_key, false );

    if ( is_array( $value ) && count( $value ) > 0 ) {
        $meta_values = [];

        foreach ( $value as $val ) {
            if ( is_array( $val ) ) {
                $val = implode( '; ', $val );
            }

            if ( get_post_mime_type( (int) $val ) ) {
                $meta_values[] = wp_get_attachment_url( $val );
            } else {
                $meta_values[] = $val;
            }
        }

        $original_value = implode( ', ', $meta_values );
    } else {
        $original_value = '';
    }

    $content = str_replace( $search[ $index ], $original_value, $content );
}
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

📥 Commits

Files that changed from the base of the PR and between 11d13f1 and 34a867d.

📒 Files selected for processing (4)
  • includes/Ajax/Frontend_Form_Ajax.php (1 hunks)
  • includes/Frontend.php (1 hunks)
  • includes/Frontend_Render_Form.php (0 hunks)
  • templates/dokan/new-post.php (1 hunks)
💤 Files with no reviewable changes (1)
  • includes/Frontend_Render_Form.php
✅ Files skipped from review due to trivial changes (1)
  • templates/dokan/new-post.php
🧰 Additional context used
🔇 Additional comments (1)
includes/Frontend.php (1)

183-183: LGTM, but verify the impact of this change.

The simplification of the dokan_is_seller_dashboard method looks good as it removes an unnecessary check on the 'posts' query variable. This change aligns with the PR objective of fixing integration loading issues, as it may allow the Dokan integration to load in more scenarios.

However, please verify that this change doesn't introduce any unintended side effects, such as unnecessarily loading Dokan-related scripts and styles on non-dashboard pages.

To ensure this change doesn't have unintended consequences, please run the following verification:

✅ Verification successful

Change Verified

The removal of the && ! empty( $GLOBALS['wp']->query_vars['posts'] ) condition in the dokan_is_seller_dashboard method is isolated to the includes/Frontend.php file. No other usages of this condition were found in the codebase, and the change does not impact other parts of the application. Therefore, the modification does not introduce unintended side effects and can be safely approved.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Check for any other usages of the removed condition

# Search for any other instances where the 'posts' query variable is checked in relation to Dokan
rg --type php "dokan.*GLOBALS\['wp'\]->query_vars\['posts'\]"

# Search for any other methods or functions that might be affected by this change
rg --type php "function.*dokan_is_seller_dashboard"

Length of output: 290

@Rat01047

This comment was marked as resolved.

@sapayth
Copy link
Member Author

sapayth commented Oct 10, 2024

related PR for WCFM

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

📥 Commits

Files that changed from the base of the PR and between 34a867d and 6d4cd83.

📒 Files selected for processing (1)
  • includes/Integrations.php (1 hunks)
🧰 Additional context used
🔇 Additional comments (4)
includes/Integrations.php (4)

1-25: LGTM: Class structure and properties are well-defined.

The Integrations class is properly namespaced and structured. The $container property is well-documented, and the $integrations property uses a clear mapping structure for external classes to their corresponding integration classes.


27-38: LGTM: Constructor implementation is robust and follows best practices.

The constructor efficiently initializes integration instances based on the presence of external classes. It includes proper error handling and logging for failed initializations. The use of __NAMESPACE__ ensures correct class resolution.


40-55: LGTM: Magic getter method is well-implemented.

The __get method provides a convenient and safe way to access integration instances. It correctly handles both existing and non-existing properties, returning null for the latter.


1-56: LGTM: Overall class design is modular and maintainable.

The Integrations class effectively manages multiple integrations using a configuration array. Its design is flexible, allowing for easy addition of new integrations. The class follows the Single Responsibility Principle and provides a clean interface for accessing integrations.

Comment on lines +1 to +56
<?php

namespace WeDevs\Wpuf;

/**
* The integration class to handle all integrations with our plugin
*
* @since WPUF_SINCE
*/
class Integrations {
/**
* Holds various class instances
*
* @since WPUF_SINCE
*
* @var array
*/
public $container = [];

private $integrations = [
'WeDevs_Dokan' => 'WPUF_Dokan_Integration',
'WC_Vendors' => 'WPUF_WC_Vendors_Integration',
'WCMp' => 'WPUF_WCMp_Integration',
'ACF' => 'WPUF_ACF_Compatibility',
];

public function __construct() {
foreach ( $this->integrations as $external_class => $integration_class ) {
if ( class_exists( $external_class ) ) {
$full_class_name = __NAMESPACE__ . '\\Integrations\\' . $integration_class;
try {
$this->container[ strtolower( $external_class ) ] = new $full_class_name();
} catch ( \Exception $e ) {
\WP_User_Frontend::log( 'integration', print_r( $external_class . ' integration failed', true ) );
}
}
}
}

/**
* Magic getter to bypass referencing objects
*
* @since WPUF_SINCE
*
* @param string $prop
*
* @return null|object Class Instance
*/
public function __get( $prop ) {
if ( array_key_exists( $prop, $this->container ) ) {
return $this->container[ $prop ];
}

return null;
}
}
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛠️ Refactor suggestion

Consider adding methods for enhanced flexibility and utility.

While the current implementation is solid, consider the following enhancements:

  1. Add methods to dynamically add or remove integrations at runtime.
  2. Implement a method to check if a specific integration is available.

These additions would further improve the flexibility and utility of the Integrations class.

Here's a potential implementation:

public function addIntegration($externalClass, $integrationClass) {
    $this->integrations[$externalClass] = $integrationClass;
    // Attempt to initialize the new integration if the external class exists
    if (class_exists($externalClass)) {
        $fullClassName = __NAMESPACE__ . '\\Integrations\\' . $integrationClass;
        try {
            $this->container[strtolower($externalClass)] = new $fullClassName();
        } catch (\Exception $e) {
            \WP_User_Frontend::log('integration', print_r($externalClass . ' integration failed', true));
        }
    }
}

public function removeIntegration($externalClass) {
    unset($this->integrations[$externalClass]);
    unset($this->container[strtolower($externalClass)]);
}

public function hasIntegration($externalClass) {
    return isset($this->container[strtolower($externalClass)]);
}

@Rat01047 Rat01047 added QA Approved This PR is approved by the QA team Ready to Merge This PR is now ready to be merged and removed QA In Progress labels Oct 10, 2024
@Rat01047
Copy link

@sapayth bhai,
LGTM --> Working as expected 🟢

@sapayth sapayth merged commit f3c4f5c into weDevsOfficial:develop Oct 10, 2024
1 check failed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
QA Approved This PR is approved by the QA team Ready to Merge This PR is now ready to be merged
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Bug] Integrations Not Loading Properly for WPUF
2 participants