Ajax没有运行php文件

I have created a PHP file which updates a value in a database.

I want to run this PHP file before the page that I call the file on loads. I have been using Ajax to do this but so far it hasn't been a success

<script type="text/javascript src="http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.js"></script>

<script>
$(document).ready(function() 
{
    $.ajax(
    {
        post: "GET",
        url: "/wp-content/custom-php/MapMetricsApiCall.php"
    }).success(function() 
    {
        alert('worked');
    }).error(function() 
    {
        alert('didnt work');
    });
});
</script>

<?php
    echo get_option('totalDay');
    echo "<br/>";
    echo get_option('totalWeek');
    echo "<br/>";
    echo get_option('totalMonth');
    echo "<br/>";
    echo get_option('totalAmount');
?>

when the page loads it hits the success function but it hasn't been successful. I'm not sure if it is because it hasn't loaded the URL correctly but the values aren't been updated. I also want it to update the values before the page loads not when it has loaded