permalinks()->getBase( 'buy_page' ) ) . '/' ) !== false ) ) { return false; } if ( ( strpos( $_SERVER['REQUEST_URI'], 'surecart/webhooks' ) !== false ) ) { return false; } if ( ( strpos( $_SERVER['REQUEST_URI'], 'surecart/redirect' ) !== false ) ) { return false; } if ( ( strpos( $_SERVER['REQUEST_URI'], '/' . untrailingslashit( \SureCart::settings()->permalinks()->getBase( 'product_page' ) ) . '/' ) !== false ) ) { return false; } return $guess; }, 9999999999 ); register_uninstall_hook( SURECART_PLUGIN_FILE, 'surecart_uninstall' ); /** * Uninstall. * * @return void */ function surecart_uninstall() { if ( (bool) get_option( 'sc_uninstall', false ) ) { \SureCart::activation()->uninstall(); } } // redirect to an admin page that they can't access instead of homepage. // Otherwise the homepage if they cannot access admin. add_filter( 'surecart.middleware.user.can.redirect_url', function ( $url ) { if ( current_user_can( 'read' ) ) { return get_admin_url() . 'admin.php?page=sc-denied'; } return $url; } );