Closed stanwarri closed 3 years ago
Thanks! Ray is disabled by default in production environments. Maybe your WordPress installation thinks it's running in production.
To manually enable ray, call ray()->enable()
.
@stanwarri I'm using Ray within WordPress on Valet as well, but did not need to create the ray.php
config file for it to work. What do you have in your ray.php file, and have you tried running it without?
Also, make sure you are calling the function after the plugins_loaded
hook is fired. Otherwise the function might not be available yet. But I guess you would have seen an error if that was the issue.
add_action( 'init', function() {
ray( 'test' );
});
Edit:
This issue might be related to: https://github.com/spatie/wordpress-ray/issues/22
@jeffreyvr Thanks for the update. However, I'm getting call to undefined function ray()
anywhere I call ray()
Here is my sample code
function woocommerce_app_init() {
require_once dirname( __FILE__ ) . '/includes/class-frontend.php';
}
add_action('plugins_loaded', 'woocommerce_app_init', 99);
Now anywhere I call ray()
in class-frontend.php
file throughs the undefined function error.
@stanwarri Just to be sure, can you run my example code that I posted earlier?
Also, are you on the latest version of the plugin (1.0.3)?
It's working now. I had to delete the ray.php
file I added to the root directory of the project.
Great product.
So I have a wordpress plugin I'm working on, and no matter where I can
ray()
on the project it doesn't show any on the desktop.Are there other requirement to get this working apart from adding ray.php config in the root of the project.
I'm on Mac and my website is serve using Valet