Title: Plugin Conflict &#8211; WP Remote Users Sync
Last modified: October 23, 2024

---

# Plugin Conflict – WP Remote Users Sync

 *  Resolved [jdp2002](https://wordpress.org/support/users/jdp2002/)
 * (@jdp2002)
 * [1 year, 7 months ago](https://wordpress.org/support/topic/plugin-conflict-wp-remote-users-sync/)
 * Critical error for that plugin when both are active
 * [23-Oct-2024 12:58:11 UTC] PHP Warning: Attempt to read property “ID” on null
   in /home/_/public\_html/wp-content/plugins/post-expirator/src/Modules/Workflows/
   Controllers/ManualPostTrigger.php on line 291
   [23-Oct-2024 12:58:11 UTC] PHP 
   Fatal error: Uncaught TypeError: PublishPress\Future\Modules\Workflows\Models\
   PostModel::load(): Argument #1 ($id) must be of type int, null given, called 
   in /home/
   /public\_html/wp-content/plugins/post-expirator/src/Modules/Workflows/
   Controllers/ManualPostTrigger.php on line 291 and defined in /home/**\***/public\
   _html/wp-content/plugins/post-expirator/src/Modules/Workflows/Models/PostModel.
   php:21
   Stack trace: 0 /home/**\***/public\_html/wp-content/plugins/post-expirator/
   src/Modules/Workflows/Controllers/ManualPostTrigger.php(291): PublishPress\Future\
   Modules\Workflows\Models\PostModel->load() 1 /home/**\***/public\_html/wp-includes/
   class-wp-hook.php(324): PublishPress\Future\Modules\Workflows\Controllers\ManualPostTrigger-
   >registerClassicEditorMetabox() 2 /home/**\***/public\_html/wp-includes/class-
   wp-hook.php(348): WP\_Hook->apply\_filters() 3 /home/**\***/public\_html/wp-includes/
   plugin.php(517): WP\_Hook->do\_action() 4 /home/**\***/public\_html/wp-content/
   plugins/wp-remote-users-sync/inc/class-wprus-settings.php(472): do\_action() 
   5 /home/**\***/public\_html/wp-includes/class-wp-hook.php(324): Wprus\_Settings-
   >plugin\_main\_page() 6 /home/**\***/public\_html/wp-includes/class-wp-hook.php(
   348): WP\_Hook->apply\_filters() 7 /home/**\***/public\_html/wp-includes/plugin.
   php(517): WP\_Hook->do\_action() 8 /home/**\***/public\_html/wp-admin/admin.php(
   259): do\_action() 9 /home//public\_html/wp-admin/options-general.php(10): require\
   _once(‘/home/…’) 10 {main}
 * thrown in /home/**_\*_**/public_html/wp-content/plugins/post-expirator/src/Modules/
   Workflows/Models/PostModel.php on line 21
    -  This topic was modified 1 year, 7 months ago by [jdp2002](https://wordpress.org/support/users/jdp2002/).

Viewing 3 replies - 1 through 3 (of 3 total)

 *  Thread Starter [jdp2002](https://wordpress.org/support/users/jdp2002/)
 * (@jdp2002)
 * [1 year, 7 months ago](https://wordpress.org/support/topic/plugin-conflict-wp-remote-users-sync/#post-18091121)
 *     ```wp-block-code
       <?phpnamespace PublishPress\Future\Modules\Workflows\Controllers;use PublishPress\Future\Core\HookableInterface;use PublishPress\Future\Framework\InitializableInterface;use PublishPress\Future\Core\HooksAbstract as CoreHooksAbstract;use PublishPress\Future\Modules\Workflows\Models\WorkflowsModel;use PublishPress\Future\Core\HooksAbstract as FutureCoreHooksAbstract;use PublishPress\Future\Core\Plugin;use PublishPress\Future\Modules\Workflows\HooksAbstract;use PublishPress\Future\Modules\Workflows\Models\PostModel;use PublishPress\Future\Modules\Workflows\Models\PostTypesModel;use PublishPress\Future\Modules\Workflows\Module;class ManualPostTrigger implements InitializableInterface{    /**     * @var HookableInterface     */    private $hooks;    /**     * @var boolean     */    private $isBlockEditor = false;    public function __construct(HookableInterface $hooks)    {        $this->hooks = $hooks;    }    public function initialize()    {        // Quick Edit        $this->hooks->addAction(            FutureCoreHooksAbstract::ACTION_QUICK_EDIT_CUSTOM_BOX,            [$this, 'registerQuickEditCustomBox'],            10,            2        );        $this->hooks->addAction(            FutureCoreHooksAbstract::ACTION_SAVE_POST,            [$this, 'processQuickEditUpdate']        );        $this->hooks->addAction(            FutureCoreHooksAbstract::ACTION_ADMIN_PRINT_SCRIPTS_EDIT,            [$this, 'enqueueQuickEditScripts']        );        // Block Editor        $this->hooks->addAction(            CoreHooksAbstract::ACTION_ENQUEUE_BLOCK_EDITOR_ASSETS,            [$this, 'enqueueBlockEditorScripts']        );        $this->hooks->addAction(            CoreHooksAbstract::ACTION_REST_API_INIT,            [$this, 'registerRestField']        );        // Classic Editor        $this->hooks->addAction(            FutureCoreHooksAbstract::ACTION_ADD_META_BOXES,            [$this, 'registerClassicEditorMetabox'],            10,            2        );        $this->hooks->addAction(            FutureCoreHooksAbstract::ACTION_SAVE_POST,            [$this, 'processMetaboxUpdate']        );        $this->hooks->addAction(            FutureCoreHooksAbstract::ACTION_ADMIN_ENQUEUE_SCRIPTS,            [$this, 'enqueueScripts']        );    }    public function registerQuickEditCustomBox($columnName, $postType)    {        if ($columnName !== 'expirationdate' || Module::POST_TYPE_WORKFLOW === $postType) {            return;        }        // Check there are workflows with the manual post trigger        $workflowsModel = new WorkflowsModel();        $workflows = $workflowsModel->getPublishedWorkflowsWithManualTrigger($postType);        if (empty($workflows)) {            return;        }        require_once __DIR__ . "/../Views/manual-trigger-quick-edit.html.php";    }    public function processQuickEditUpdate($postId)    {        // phpcs:disable WordPress.Security.NonceVerification.Recommended, WordPress.Security.NonceVerification.Missing        // Don't run if this is an auto save        if (defined('DOING_AUTOSAVE') && DOING_AUTOSAVE) {            return;        }        // Don't update data if the function is called for saving revision.        $postType = get_post_type((int)$postId);        if ($postType === 'revision') {            return;        }        // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized        $view = $_POST['future_workflow_view'] ?? '';        if (empty($view) || $view !== 'quick-edit') {            return;        }        // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized        $manuallyEnabledWorkflows = $_POST['future_workflow_manual_trigger'] ?? [];        $manuallyEnabledWorkflows = array_map('intval', $manuallyEnabledWorkflows);        $postModel = new PostModel();        $postModel->load($postId);        $postModel->setManuallyEnabledWorkflows($manuallyEnabledWorkflows);        $this->triggerManuallyEnabledWorkflow($postId, $manuallyEnabledWorkflows);        // phpcs:enable    }    private function triggerManuallyEnabledWorkflow($postId, $manuallyEnabledWorkflows)    {        // Trigger the action to trigger those workflows        foreach ($manuallyEnabledWorkflows as $workflowId) {            $this->hooks->doAction(HooksAbstract::ACTION_MANUALLY_TRIGGERED_WORKFLOW, (int)$postId, (int)$workflowId);        }    }    public function enqueueQuickEditScripts()    {        // Only enqueue scripts if we are in the post list table        if (get_current_screen()->base !== 'edit') {            return;        }        wp_enqueue_style("wp-components");        wp_enqueue_script("wp-components");        wp_enqueue_script("wp-plugins");        wp_enqueue_script("wp-element");        wp_enqueue_script("wp-data");        wp_enqueue_script(            "future_workflow_manual_selection_script_quick_edit",            Plugin::getScriptUrl('workflowManualSelectionQuickEdit'),            [                "wp-plugins",                "wp-components",                "wp-element",                "wp-data",            ],            PUBLISHPRESS_FUTURE_VERSION,            true        );        wp_localize_script(            "future_workflow_manual_selection_script_quick_edit",            "futureWorkflowManualSelection",            [                "nonce" => wp_create_nonce("wp_rest"),                "apiUrl" => rest_url("publishpress-future/v1"),            ]        );    }    public function enqueueBlockEditorScripts()    {        global $post;        if (! $post || is_null($post->ID)) {            error_log('Post is null or ID is not set, cannot enqueue block editor scripts.');            return;        }        $this->isBlockEditor = true;        $postModel = new PostModel();        $postModel->load($post->ID);        $workflowsWithManualTrigger = $postModel->getValidWorkflowsWithManualTrigger($post->ID);        if (empty($workflowsWithManualTrigger)) {            return;        }        wp_enqueue_style("wp-components");        wp_enqueue_script("wp-components");        wp_enqueue_script("wp-plugins");        wp_enqueue_script("wp-element");        wp_enqueue_script("wp-data");        wp_enqueue_script(            "future_workflow_manual_selection_script_block_editor",            Plugin::getScriptUrl('workflowManualSelectionBlockEditor'),            [                "wp-plugins",                "wp-components",                "wp-element",                "wp-data",            ],            PUBLISHPRESS_FUTURE_VERSION,            true        );        wp_localize_script(            "future_workflow_manual_selection_script_block_editor",            "futureWorkflowManualSelection",            [                "nonce" => wp_create_nonce("wp_rest"),                "apiUrl" => rest_url("publishpress-future/v1"),                "postId" => $post->ID,            ]        );    }    public function registerRestField()    {        $postTypesModel = new PostTypesModel();        $postTypes = $postTypesModel->getPostTypes();        foreach ($postTypes as $postType) {            register_rest_field(                $postType->name,                'publishpress_future_workflow_manual_trigger',                [                    'get_callback' => function ($post) {                        $post = get_post();                        if (! $post || is_null($post->ID)) {                            return [                                'enabledWorkflows' => []                            ];                        }                        $postModel = new PostModel();                        $postModel->load($post->ID);                        $enabledWorkflows = $postModel->getManuallyEnabledWorkflows();                        return [                            'enabledWorkflows' => $enabledWorkflows,                        ];                    },                    'update_callback' => function ($manualTriggerAttributes, $post) {                        $postModel = new PostModel();                        $postModel->load($post->ID);                        $manuallyEnabledWorkflows = $manualTriggerAttributes['enabledWorkflows'] ?? [];                        $manuallyEnabledWorkflows = array_map('intval', $manuallyEnabledWorkflows);                        $postModel->setManuallyEnabledWorkflows($manuallyEnabledWorkflows);                        $this->triggerManuallyEnabledWorkflow($post->ID, $manuallyEnabledWorkflows);                        return true;                    },                    'schema' => [                        'description' => 'Workflow Manual Trigger',                        'type' => 'object',                    ]                ]            );        }    }    public function registerClassicEditorMetabox($postType, $post)    {        if ($this->isBlockEditor || !isset($post) || !is_object($post) || is_null($post->ID)) {            error_log('Post is null or ID is not set, cannot load workflows.');            return;        }        $postModel = new PostModel();        $postModel->load($post->ID);        $workflows = $postModel->getValidWorkflowsWithManualTrigger($post->ID);        if (empty($workflows)) {            return;        }                add_meta_box(            'future_workflow_manual_trigger',            __('Action Workflows', 'post-expirator'),            [$this, 'renderClassicEditorMetabox'],            $postType,            'side',            'default',            [$post]        );    }    public function renderClassicEditorMetabox($post)    {        require_once __DIR__ . "/../Views/manual-trigger-classic-editor.html.php";    }    public function processMetaboxUpdate($postId)    {        // phpcs:disable WordPress.Security.NonceVerification.Missing        // Don't run if this is an auto save        if (defined('DOING_AUTOSAVE') && DOING_AUTOSAVE) {            return;        }        // Don't update data if the function is called for saving revision.        $postType = get_post_type((int)$postId);        if ($postType === 'revision') {            return;        }        // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized        $view = $_POST['future_workflow_view'] ?? '';        if (empty($view) || $view !== 'classic-editor') {            return;        }        // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized        $manuallyEnabledWorkflows = $_POST['future_workflow_manual_trigger'] ?? [];        $manuallyEnabledWorkflows = array_map('intval', $manuallyEnabledWorkflows);        $postModel = new PostModel();        $postModel->load($postId);        $postModel->setManuallyEnabledWorkflows($manuallyEnabledWorkflows);        $this->triggerManuallyEnabledWorkflow($postId, $manuallyEnabledWorkflows);        // phpcs:enable    }    public function enqueueScripts()    {        // Only enqueue scripts if we are in the post edit screen        if (get_current_screen()->id !== 'post') {            return;        }        wp_enqueue_style("wp-components");        wp_enqueue_script("wp-components");        wp_enqueue_script("wp-plugins");        wp_enqueue_script("wp-element");        wp_enqueue_script("wp-data");        wp_enqueue_script(            "future_workflow_manual_selection_script",            Plugin::getScriptUrl('workflowManualSelectionClassicEditor'),            [                "wp-plugins",                "wp-components",                "wp-element",                "wp-data",            ],            PUBLISHPRESS_FUTURE_VERSION,            true        );        $post = get_post();        wp_localize_script(            "future_workflow_manual_selection_script",            "futureWorkflowManualSelection",            [                "nonce" => wp_create_nonce("wp_rest"),                "apiUrl" => rest_url("publishpress-future/v1"),                "postId" => $post->ID,            ]        );    }}
       ```
   
 * Resolved file: /post-expirator/src/Modules/Workflows/Controllers/ManualPostTrigger.
   php
 *  Plugin Author [Steve Burge](https://wordpress.org/support/users/stevejburge/)
 * (@stevejburge)
 * [1 year, 7 months ago](https://wordpress.org/support/topic/plugin-conflict-wp-remote-users-sync/#post-18091123)
 * OK, thanks for the reporting that [@jdp2002](https://wordpress.org/support/users/jdp2002/).
   We do see that issue on the settings screen for WP Remote Users Sync. We’ll release
   version 4.0.4 with a fix.
 *  Plugin Support [Riza Maulana Ardiyanto](https://wordpress.org/support/users/rizaardiyanto/)
 * (@rizaardiyanto)
 * [1 year, 7 months ago](https://wordpress.org/support/topic/plugin-conflict-wp-remote-users-sync/#post-18094198)
 * [@jdp2002](https://wordpress.org/support/users/jdp2002/) 4.0.4 just released.
   Let me know if the issue persists on that version.

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘Plugin Conflict – WP Remote Users Sync’ is closed to new replies.

 * ![](https://ps.w.org/post-expirator/assets/icon-256x256.png?rev=3118683)
 * [Schedule Post Changes With PublishPress Future: Unpublish, Delete, Change Status, Trash, Change Categories](https://wordpress.org/plugins/post-expirator/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/post-expirator/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/post-expirator/)
 * [Active Topics](https://wordpress.org/support/plugin/post-expirator/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/post-expirator/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/post-expirator/reviews/)

 * 4 replies
 * 3 participants
 * Last reply from: [Riza Maulana Ardiyanto](https://wordpress.org/support/users/rizaardiyanto/)
 * Last activity: [1 year, 7 months ago](https://wordpress.org/support/topic/plugin-conflict-wp-remote-users-sync/#post-18094198)
 * Status: resolved