froger-me / wp-remote-users-sync

Synchronise users across WordPress websites
GNU General Public License v3.0
71 stars 34 forks source link

Add settings page check to add_meta_boxes #69

Closed foloed closed 1 year ago

foloed commented 1 year ago

We had an issue where add_settings_meta_boxes is being called on every edit page on the website.

This resulted in slow queries due to our massive user meta table on pages this shouldn't be called on.

Modified the add_meta_boxes action to accept the post_type argument, and checks against the classes settings_page_id.

froger-me commented 1 year ago

Hi, Thanks for the pull request. Please correct the code to respect WordPress coding standards and the rest of the format everywhere in the code base.

public function add_settings_meta_boxes( $post_type ) {

        if ( $post_type !== self::$settings_page_id ) {

            return;
        }

I will merge whenever I have time. Looking at how many messages I receive regarding updates, I hope you can see I currently don't have the bandwidth to give any timeline as to when it will be added to the official WP repo. However, I am grateful for the contribution and would like to address it ASAP.

froger-me commented 1 year ago

Manually merged offline to avoid back-and-forth with formatting (1 space missing after if statement and before parenthesis)