diff --git a/public/js/RollbarWordpressSettings.js b/public/js/RollbarWordpressSettings.js index 37d2972e..cbdd6ab2 100644 --- a/public/js/RollbarWordpressSettings.js +++ b/public/js/RollbarWordpressSettings.js @@ -97,7 +97,7 @@ }, logThroughPhp = function(config) { jQuery.post( - "/index.php?rest_route=/rollbar/v1/test-php-logging", + RollbarWordpress.rest_root + "/test-php-logging", config, function(response) { diff --git a/src/Settings.php b/src/Settings.php index ce0336c5..c59da807 100644 --- a/src/Settings.php +++ b/src/Settings.php @@ -49,6 +49,7 @@ public static function init() { 'RollbarWordpress', array( 'plugin_url' => \plugin_dir_url(__FILE__) . "../", + 'rest_root' => esc_url_raw( rest_url( 'rollbar/v1' ) ), ) );