Git Product home page Git Product logo

wordpress-ray's Introduction

Debug WordPress apps with ease

Latest Version on Packagist GitHub Tests Action Status Total Downloads

This package can be installed in a WordPress application to send messages to the Ray app.

Documentation

You can find the full documentation on our documentation site.

Changelog

Please see CHANGELOG for more information on what has changed recently.

Contributing

Please see CONTRIBUTING for details.

Security Vulnerabilities

Please review our security policy on how to report security vulnerabilities.

Release instructions for maintainers

  • update spatie/ray in composer.json with the highest version number of the package
  • update readme.txt and wp-ray with the new release number
  • create a new release, it will automatically be pushed to the WordPress SVN

Credits

License

The MIT License (MIT). Please see License File for more information.

wordpress-ray's People

Contributors

adrianmrn avatar brugman avatar freekmurze avatar jeffreyvr avatar jefvdv avatar joeri-abbo avatar mamaduka avatar slaffik avatar szepeviktor avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

wordpress-ray's Issues

Fatal error: Return value

I have a weird error. Just installed Ray to debug an issue. But didn't expect that the debugger needs debugging. ๐Ÿ˜

ray('test'); // After that, this error comes in WP All Export:
// Fatal error: Uncaught Error: Spatie\WordPressRay\Spatie\Ray\Payloads\Payload::getOrigin(): Return value must be of type Spatie\WordPressRay\Spatie\Ray\Origin\Origin, Spatie\Ray\Origin\Origin returned

Installed is WordPress 6.1.1 and PHP 8.0 โ€“ tested with PHP 8.1 too.

I tried to debug the code inside an action called pmxe_after_export within the functions.php โ€“ which I was debugging multiple times in the past and deinstalled Ray afterwards.

Uncaught Error: Call to undefined function Spatie\WordPressRay\app() when using it with Sage 10

Describe the bug

I'm using Sage 10 to develop a WordPress theme: https://docs.roots.io/sage/10.x/installation/

After I install and activate the Ray plugin, I get this error:

Fatal error: Uncaught Error: Call to undefined function Spatie\WordPressRay\app() in /Users/eripanci/Documents/project-sage/dev/public/app/plugins/spatie-ray/vendor/autoload.php:110 Stack trace: #0 /Users/eripanci/Documents/project-sage/dev/public/app/themes/project-sage/vendor/laravel/framework/src/Illuminate/Foundation/helpers.php(592): app() #1 /Users/eripanci/Documents/project-sage/dev/public/app/themes/galia-sage/config/assets.php(37): public_path('manifest.json') #2 /Users/eripanci/Documents/project-sage/dev/public/app/themes/galia-sage/vendor/laravel/framework/src/Illuminate/Foundation/Bootstrap/LoadConfiguration.php(72): require('/Users/eripanci...') #3 /Users/eripanci/Documents/project-sage/dev/public/app/themes/galia-sage/vendor/roots/acorn/src/Roots/Acorn/Bootstrap/LoadConfiguration.php(36): Illuminate\Foundation\Bootstrap\LoadConfiguration->loadConfigurationFiles(Object(Roots\Acorn\Application), Object(Illuminate\Config\Repository)) #4 /Users/eripanci/Documents/project-sage/dev/public/app/themes/galia-sage/vendor/laravel/framework/src/Illuminate/Foundation/Application.php(237): Roots\Acorn\Bootstrap\LoadConfiguration->bootstrap(Object(Roots\Acorn\Application)) #5 /Users/eripanci/Documents/project-sage/dev/public/app/themes/galia-sage/vendor/roots/acorn/src/Roots/Acorn/Bootloader.php(208): Illuminate\Foundation\Application->bootstrapWith(Array) #6 /Users/eripanci/Documents/project-sage/dev/public/app/themes/galia-sage/vendor/roots/acorn/src/Roots/Acorn/Bootloader.php(181): Roots\Acorn\Bootloader->app() #7 /Users/eripanci/Documents/project-sage/dev/public/cms/wp-includes/class-wp-hook.php(303): Roots\Acorn\Bootloader->__invoke('') #8 /Users/eripanci/Documents/project-sage/dev/public/cms/wp-includes/class-wp-hook.php(327): WP_Hook->apply_filters(NULL, Array) #9 /Users/eripanci/Documents/project-sage/dev/public/cms/wp-includes/plugin.php(470): WP_Hook->do_action(Array) #10 /Users/eripanci/Documents/project-sage/dev/public/cms/wp-settings.php(556): do_action('after_setup_the...') #11 /Users/eripanci/Documents/project-sage/dev/public/wp-config.php(15): require_once('/Users/eripanci...') #12 /Users/eripanci/Documents/project-sage/dev/public/cms/wp-load.php(55): require_once('/Users/eripanci...') #13 /Users/eripanci/Documents/project-sage/dev/public/cms/wp-admin/admin.php(34): require_once('/Users/eripanci...') #14 /Users/eripanci/Documents/project-sage/dev/public/cms/wp-admin/index.php(10): require_once('/Users/eripanci...') #15 /Users/eripanci/.composer/vendor/laravel/valet/server.php(235): require('/Users/eripanci...') #16 {main} thrown in /Users/eripanci/Documents/project-sage/dev/public/app/plugins/spatie-ray/vendor/autoload.php on line 110

It may have to do with the Sage own "app" function: https://github.com/roots/acorn/blob/main/src/Roots/helpers.php#L75

Versions
Ray plugin: 1.5.1
Wordpress: 5.8.3
Sage: 10.0.0-beta.2

To Reproduce
Steps to reproduce the behavior:

Create a new theme using Sage command line and install the Ray plugin.

Unable to make Ray work on windows 10 machine

I have a windows 10 machine where I run my local development using Laragon.

Steps I followed.

  • Installed and activated Ray plugin (1.0.2) in my existing local WordPress project.
  • Added ray('My first ray call'); inside functions.php
  • Downloaded and installed Ray (Ray Setup 1.3.0.exe) [Free Trial]
  • Visited the website

I am unable to see anything inside the Ray app.
Am I missing any step?

This is what I read in the doc so I opened an issue instead of a question.

PHP 8.1 deprecation notice

  1. Switch to PHP 8.1.
  2. Install WordPress 5.9.
  3. Activate the latest available Spatie Ray WordPress plugin (1.5.1).

Note the record in the error log:

Deprecated: Return type of Spatie\WordPressRay\Ramsey\Uuid\Uuid::jsonSerialize() should either be compatible with JsonSerializable::jsonSerialize(): mixed, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in ...\wp-content\plugins\spatie-ray\vendor\ramsey\uuid\src\Uuid.php on line 159

Missing new label() method

WordPress Ray throws an error when attempting to use the (newly introduced) label method.

Uncaught BadMethodCallException: Method label does not exist. in /web/app/mu-plugins/spatie-ray/vendor/spatie/macroable/src/Macroable.php:53

Error in 1.7.4

After the update to 1.7.4 when trying to ray() an array or object I get a fatal error.

Fatal error: Uncaught Error: syntax error, unexpected token ")"
in /var/www/html/wp-content/plugins/spatie-ray/vendor/symfony/var-dumper/Dumper/AbstractDumper.php on line 74

Call stack:

Automattic\J\A\j\PHP_Autoloader::load_class()
wp-content/plugins/spatie-ray/vendor/symfony/var-dumper/Dumper/CliDumper.php:22
require()
wp-content/plugins/spatie-ray/vendor/jetpack-autoloader/class-php-autoloader.php:90
Automattic\J\A\j\PHP_Autoloader::load_class()
wp-content/plugins/spatie-ray/vendor/symfony/var-dumper/Dumper/HtmlDumper.php:22
require()
wp-content/plugins/spatie-ray/vendor/jetpack-autoloader/class-php-autoloader.php:90
Automattic\J\A\j\PHP_Autoloader::load_class()
wp-content/plugins/spatie-ray/vendor/spatie/ray/src/ArgumentConverter.php:30
Spatie\Ray\ArgumentConverter::convertToPrimitive()
wp-content/plugins/spatie-ray/vendor/spatie/ray/src/PayloadFactory.php:62
Spatie\Ray\PayloadFactory::getPayload()
wp-content/plugins/spatie-ray/vendor/spatie/ray/src/PayloadFactory.php:38
Spatie\Ray\PayloadFactory::Spatie\Ray\{closure}()
array_map()
wp-content/plugins/spatie-ray/vendor/spatie/ray/src/PayloadFactory.php:39
Spatie\Ray\PayloadFactory::getPayloads()
wp-content/plugins/spatie-ray/vendor/spatie/ray/src/PayloadFactory.php:22
Spatie\Ray\PayloadFactory::createForValues()
wp-content/plugins/spatie-ray/vendor/spatie/ray/src/Ray.php:693
Spatie\Ray\Ray::send()
wp-content/plugins/spatie-ray/vendor/spatie/ray/src/helpers.php:51
ray()
wp-content/themes/obnova-webshop/functions.php:84
include()
wp-settings.php:585
require_once()
wp-config.php:133
require_once()
wp-load.php:50
require_once()
wp-blog-header.php:13
require()
index.php:17

Doesn't work on Docker, Windows 10

I'm running WordPress on Docker Desktop (Version 3.0.4)
Plugin installed (Version 1.1.1)
Added "define( 'WP_ENVIRONMENT_TYPE', 'local' );" in wp-config.php
In plugin, ray("hello"); and also error_log("Hello");
"Hello" in debug.log
Nothing in Ray.

Tried adding in docker-compose:
extra_hosts:
- "host.docker.internal:host-gateway"

Still nothing.

Docker compose file for reference:

version: '3'
services:
database:
image: mysql:5.7
command:
- "--character-set-server=utf8"
- "--collation-server=utf8_unicode_ci"
ports:
- "3308:3306" # ()
restart: on-failure:5
environment:
MYSQL_USER: wordpress
MYSQL_DATABASE: wordpress
MYSQL_PASSWORD: wordpress
MYSQL_ROOT_PASSWORD: wordpress
wordpress:
depends_on:
- database
image: wordpress:latest
ports:
- "8001:80" # (
)
restart: on-failure:5
volumes:
- ./public:/var/www/html
environment:
WORDPRESS_DB_HOST: database:3306
WORDPRESS_DB_PASSWORD: wordpress
extra_hosts:
- "host.docker.internal:host-gateway"
phpmyadmin:
depends_on:
- database
image: phpmyadmin/phpmyadmin
ports:
- 8081:80 # (*)
restart: on-failure:5
environment:
PMA_HOST: database

Any ideas?

Thank you!

PHP Fatal error: Uncaught OutOfBoundsException: Package "spatie/ray" is not installed

PHP error:

[13-Jan-2021 11:20:34 UTC] PHP Fatal error:  Uncaught OutOfBoundsException: Package "spatie/ray" is not installed in C:\OpenServer\domains\wordpress\wp-content\plugins\custom-plugin\vendor\composer\InstalledVersions.php:186
Stack trace:
#0 C:\OpenServer\domains\wordpress\wp-content\plugins\wordpress-ray\vendor\spatie\ray\src\Ray.php(351): Composer\InstalledVersions::getVersion()
#1 C:\OpenServer\domains\wordpress\wp-content\plugins\wordpress-ray\src\Ray.php(104): Spatie\WordPressRay\Spatie\Ray\Ray->sendRequest()
#2 C:\OpenServer\domains\wordpress\wp-content\plugins\wordpress-ray\vendor\spatie\ray\src\Ray.php(320): Spatie\WordPressRay\Ray->sendRequest()
#3 C:\OpenServer\domains\wordpress\wp-content\plugins\wordpress-ray\vendor\spatie\ray\src\helpers.php(34): Spatie\WordPressRay\Spatie\Ray\Ray->send()
#4 C:\OpenServer\domains\wordpress\wp-content\plugins\custom-plugin\src\CustomPlugin.php(279): ray()
#5 C:\OpenServer\domains\wordpress\wp-content\plugins\custom-plugin\src\CustomPlugin.php(219): CustomPlugin\CustomPlugin->includes_m in C:\OpenServer\domains\wordpress\wp-content\plugins\custom-plugin\vendor\composer\InstalledVersions.php on line 186

Steps:

  1. Download the repo as a zip.
  2. Upload the zip to WordPress as a plugin.
  3. Activate the plugin.
  4. Put the ray($this); call inside some other plugin, that uses composer for its dependencies as well.
  5. Reload the WordPress page - get the fatal error.

I tried to run composer install inside the wordpress-ray directory as well, just in case. Imposter and dumpautoload successfully run, nothing's changed.

Using WordPress 5.6, PHP 7.4, Composer v2, wordpress-ray master branch as of now.

Installing on Wordpress

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

mu-plugin does not take precedence over global

source: https://myray.app/docs/php/vanilla-php/installation

To use framework specific functionality, such as viewing queries in Laravel, or displaying mails in WordPress, you should still install the relevant package or library.

If a framework specific package is detected, it will be used instead of the global Ray.

Is this still working in the case of WordPress?

My global installation is working, and my mu-plugin installation is working, tested on their own.

When both are active, running this in a custom plugin:

ray()->clearScreen();
ray('hello');
ray()->showHooks(); // WP only function
ray()->stopShowingHooks(); // WP only function

results in:

Fatal error:  Uncaught BadMethodCallException: Method showHooks does not exist. in phar://C:/Users/Tim/AppData/Roaming/Composer/vendor/spatie/global-ray/ray-phars/ray_php_8.0.phar/vendor/spatie/macroable/src/Macroable.php:42
Stack trace:
#0 C:\webdev\wptest3\public_html\wp-content\plugins\test\test.php(20): GlobalRay\Spatie\Ray\Ray->__call('showHooks', Array)
#1 C:\webdev\wptest3\public_html\wp-settings.php(517): include_once('C:\\webdev\\wptes...')
#2 C:\webdev\wptest3\public_html\wp-config.php(78): require_once('C:\\webdev\\wptes...')
#3 C:\webdev\wptest3\public_html\wp-load.php(50): require_once('C:\\webdev\\wptes...')
#4 C:\webdev\wptest3\public_html\wp-admin\admin.php(34): require_once('C:\\webdev\\wptes...')
#5 C:\webdev\wptest3\public_html\wp-admin\plugins.php(10): require_once('C:\\webdev\\wptes...')
#6 {main}
thrown in phar://C:/Users/Tim/AppData/Roaming/Composer/vendor/spatie/global-ray/ray-phars/ray_php_8.0.phar/vendor/spatie/macroable/src/Macroable.php on line 42

If I disable the global install:

; auto_prepend_file = C:\Users\Tim\AppData\Roaming\Composer\vendor\spatie\global-ray\src\scripts\global-ray-loader.php

Then it works.

PHP 8.1 deprecation notice on v1.5.4

I'm seeing a PHP deprecation notice on the latest plugin version after updating PHP to 8.1.

  • PHP: 8.1
  • WordPress: 6.1.1
  • WordPress Ray Plugin: 1.5.4

When the plugin is active this deprecation notice show up on every page load:

Deprecated: Return type of Spatie\WordPressRay\Ramsey\Uuid\Uuid::jsonSerialize() should either be compatible with JsonSerializable::jsonSerialize(): mixed, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in ..plugins/spatie-ray/vendor/ramsey/uuid/src/Uuid.php on line 159

An these ones only when there is a call to the ray() function:

Deprecated: Return type of Spatie\WordPressRay\Symfony\Component\VarDumper\Cloner\Data::offsetExists($key) should either be compatible with ArrayAccess::offsetExists(mixed $offset): bool, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in ..plugins/spatie-ray/vendor/symfony/var-dumper/Cloner/Data.php on line 133

Deprecated: Return type of Spatie\WordPressRay\Symfony\Component\VarDumper\Cloner\Data::offsetGet($key) should either be compatible with ArrayAccess::offsetGet(mixed $offset): mixed, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in ..plugins/spatie-ray/vendor/symfony/var-dumper/Cloner/Data.php on line 137

Deprecated: Return type of Spatie\WordPressRay\Symfony\Component\VarDumper\Cloner\Data::offsetSet($key, $value) should either be compatible with ArrayAccess::offsetSet(mixed $offset, mixed $value): void, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in ..plugins/spatie-ray/vendor/symfony/var-dumper/Cloner/Data.php on line 141

Deprecated: Return type of Spatie\WordPressRay\Symfony\Component\VarDumper\Cloner\Data::count() should either be compatible with Countable::count(): int, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in ..plugins/spatie-ray/vendor/symfony/var-dumper/Cloner/Data.php on line 101

Deprecated: Return type of Spatie\WordPressRay\Symfony\Component\VarDumper\Cloner\Data::getIterator() should either be compatible with IteratorAggregate::getIterator(): Traversable, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in ..plugins/spatie-ray/vendor/symfony/var-dumper/Cloner/Data.php on line 108

Symfony\Component\VarDumper\Caster\DateCaster not found

Hey there! Loving the Ray so far ๐Ÿ˜

Was trying to print an object and came across this error.

Fatal error: Uncaught Error: Class 'Symfony\Component\VarDumper\Caster\DateCaster' not found
in /public_html/content/plugins/spatie-ray/vendor/symfony/var-dumper/Cloner/AbstractCloner.php on line 348

Using the WordPress plugin btw.

Conflict with other plugins using jean85/pretty-package-versions

Describe the bug
An OutOfBoundsException exception get throws while loading my WordPress plugin which has Sentry SDK which in turns has jean85/pretty-package-versions as dependency.

Versions
Ray plugin version 1.3.2

PHP version: 7.4

To Reproduce
Steps to reproduce the behavior:

  1. Create a dummy plugin with composer dependency of composer require sentry/sdk
  2. Make sure the dummy plugin initialize Sentry upon plugins_loaded action hook
add_action('plugins_loaded', function() {
    Sentry\init(...)
});
  1. Install and activate Ray's plugin
  2. Activate the dummy plugin
  3. You should see a OutOfBoundsException when Sentry trying to check the installed SDK version.

Expected behavior
When a plugin has jean85/pretty-package-versions it should not conflict with Ray's plugin and cause an exception

Screenshots
The screenshot is from Ray app which helped me debug the problem (well done)
image

Desktop (please complete the following information):

  • OS: macOS Big Sur 11.5.1
  • Version: 1.17.0

Additional context
I guess this could happen with any other app, not just WordPress CMS

Folding results with the little arrow doesn't work on Windows app

2021-01-21_16-46-40

I'm sure that this is not a problem with wordpress-ray, but with the Electron app. But I didn't know where to file bugs for that.

Using the latest 1.7.0 version of Ray for Windows 10 I can't fold the code. Don't know if the problem was there in earlier versions as well.

When I click, nothing happens. CTRL + click does nothing either.

Let me know if you need anything else, or want me to post this somewhere else.

Thanks.

platform_check.php triggers error on php 7.3. Requirement in composer.json says 7.3

After running composer install in the plugin folder, the error goes away, but the file platform_check.php didn't change.

I read that that is an composer v2 feature. So I downloaded composer v2 and ran the release instructions https://github.com/spatie/wordpress-ray#release-instructions-for-maintainers which again did not change platform_check.php (which I think would / should change, right?)

https://github.com/spatie/wordpress-ray/blob/master/vendor/composer/platform_check.php
https://github.com/spatie/wordpress-ray/blob/master/composer.json#L21

For now just reporting this, because I have an release of a project to do, but will come back at this at this next week if it's not fixed by then.

Kind regards,

Jaime

Fatal error on DateCaster::castDateTime

After installing the latest version of the WP plugin, started getting this fatal error:

Fatal error: Uncaught TypeError: Argument 3 passed to Symfony\Component\VarDumper\Caster\DateCaster::castDateTime() must be an instance of Symfony\Component\VarDumper\Cloner\Stub, instance of Spatie\WordPressRay\Symfony\Component\VarDumper\Cloner\Stub given, called in /Users/luismartins/Sites/project/wp-content/plugins/spatie-ray/vendor/symfony/var-dumper/Cloner/AbstractCloner.php on line 303 and defined in /Users/luismartins/Sites/project/wp-content/themes/project/vendor/symfony/var-dumper/Caster/DateCaster.php on line 27

Fatal error when installing on PHP 7.4

The current stable version 1.5.6 raises a fatal error when activating the plugin. This can be observed using a clean install of WP using PHP 7.4 which the plugin declares support for.

Fatal error:  Composer detected issues in your platform: Your Composer dependencies require a PHP version ">= 8.0.0". You are running 7.4.30. in /s2-hissingfinger/wordpress/wp-content/plugins/spatie-ray/vendor/composer/platform_check.php on line 24

You can see this in action here: https://tastewp.org/plugins/spatie-ray/

image


As an aside, I would suggest not raising the minimum required version of PHP to 8.0 as many sites still run on 7.4 โ€“ the majority of WP sites actually! See https://wordpress.org/about/stats/
Whether or not they should is another question ๐Ÿ˜„ Of course PHP 7 is EOL now, but dropping support for it this quickly is rather aggressive for a dev tool IMHO.

Whenever the required version of PHP is changed though, it's important to update this in the readme.txt for the PHP version constraints to work as expected.

The plugin breaks WP CLI

Hello there,

I have had an issue with this plugin for a long time. When the plugin is enabled, WP CLI is entirely broken.

The error:

Fatal error: During class fetch: Uncaught ParseError: syntax error, unexpected '|', expecting variable (T_VARIABLE) in /srv/www/hezarfen/public_html/wp-content/plugins/spatie-ray/vendor/spatie/macroable/src/Macroable.php:14
Stack trace:
#0 [internal function]: Automattic\Jetpack\Autoloader\jp3123785b021cae6cb6ff0533904b8273\al2_12_0\PHP_Autoloader::load_class()
#1 /srv/www/hezarfen/public_html/wp-content/plugins/spatie-ray/vendor/spatie/ray/src/Ray.php(60): spl_autoload_call()
#2 /srv/www/hezarfen/public_html/wp-content/plugins/hezarfen-pro-for-woocommerce/vendor/jetpack-autoloader/class-php-autoloader.php(90): require('/srv/www/hezarf...')
#3 [internal function]: Automattic\Jetpack\Autoloader\jp3123785b021cae6cb6ff0533904b8273\al2_12_0\PHP_Autoloader::load_class()
#4 /srv/www/hezarfen/public_html/wp-content/plugins/spatie-ray/src/Ray.php(12): spl_autoload_call()
#5 /srv/www/hezarfen/public_html/wp-content/plugins/hezarfen-pro-for-woocommerce/vendor/jetpack-autoloader/class-php-autoloader.php(90): require('/srv/www/hezarf in /srv/www/hezarfen/public_html/wp-content/plugins/spatie-ray/vendor/spatie/ray/src/Ray.php on line 60

Reproducing steps:

  1. Install a fresh WP
  2. Install&Activate the WordPress Ray plugin
  3. See WP CLI doesn't work and you get the fatal error.

Version:1.7.5

PHP 8.1 deprecation notice

Identical to this: #49

But it doesn't seem like a release was made? I tried pulling down latest master branch and its already up to date on my system

Unable to use in wordpress +docker container

Hi all,
I'm trying to use ray with wordpress running inside a docker-compose.yml file.

I've followed the documentation installed the wordpress plugin and tried also with spatie/ray package on my wordpress theme, but I'm unable to connect to application.

I tested a retested this a lot of times but with no success.

  • I've the last version of plugin and the ray application
  • I've define('WP_ENVIRONMENT_TYPE', 'local'); inside wp-config.php

I don't know if I'm missing something on my configuration, also I don't know were I should put the ray.php config file.

I did some debug on spatie/ray but the config folder is always null or empty, the documentation are not good for this.

version: '3.4'
services:
  php:
    container_name: "wordpress"
    build:
      context: .
      dockerfile: 'Dockerfile'
      target: php
    user: "1001"
    expose:
        - "23517"
    extra_hosts: # <-- does no harm
        - "host.docker.internal:host-gateway" # <-- does no harm
    volumes:
      - static_files:/app/public/static:rw
      - ./theme:/app/public/static/wp-content/themes/theme
  nginx:
    image: nginx:stable
    user: "1001"
    depends_on:
      - php
    environment:
      PHP_SERVER_HOST: php
    ports:
      - "8888:8080"
    expose:
        - "23517"
    extra_hosts: # <-- does no harm
        - "host.docker.internal:host-gateway" # <-- does no harm
    volumes:
      - static_files:/app/public/static:rw
      - ./theme:/app/public/static/wp-content/themes/theme
volumes:
  static_files: {}

Warning from "jetpack-autoloader"

Dear Spatie.

I have this warning on the commandline with WP-CLI:

Warning: Trying to access array offset on value of type int in /Users/xyz/local/iab-members-production/app/public/wp-content/plugins/spatie-ray/vendor/jetpack-autoloader/class-path-processor.php on line 132

I'm in the middle of moving, but wanted to already open this ticket.
ray-wordpress version: 1.7.5
wp version: 6.3.2
php version: 8.0.22

There is a new version of the autoloader but I ran composer update in the plugins folder and it didn't help.

So it's probaly an upstream issue. But I am leaving this here as a reminder that "if it's an upstream issues" then the autoloader needs to be updated.

Kind regads and I'll be back next week after I've finished moving :)

using the ray()->link() or ray()->url() methods throws fatal error

Describe the bug
using the ray()->link() or ray()->url() methods throws fatal error

Fatal error: Uncaught Error: Class "Illuminate\Support\Str" not found in /Volumes/Omega/Local/omegastaging/app/public/wp-content/plugins/spatie-ray/vendor/spatie/ray/src/Ray.php:538 Stack trace: #0 /Volumes/Omega/Local/omegastaging/app/public/wp-content/plugins/spatie-ray/vendor/spatie/ray/src/Ray.php(553): Spatie\Ray\Ray->url('https://atsg.om...', '') #1 /Volumes/Omega/Dropbox/Omega Benefits/github/omega-system/includes/class-omega-static.php(134): Spatie\Ray\Ray->link('https://atsg.om...') #2 /Volumes/Omega/Local/omegastaging/app/public/wp-includes/class-wp-hook.php(326): OmegaBenefits\System\Omega_Static->OmegaBenefits\System\{closure}(83) #3 /Volumes/Omega/Local/omegastaging/app/public/wp-includes/class-wp-hook.php(348): WP_Hook->apply_filters('', Array) #4 /Volumes/Omega/Local/omegastaging/app/public/wp-includes/plugin.php(517): WP_Hook->do_action(Array) #5 /Volumes/Omega/Local/omegastaging/app/public/wp-content/plugins/simply-static/src/class-ss-plugin.php(192): do_action('ss_before_stati...', 83, 'export') #6 /Volumes/Omega/Dropbox/Omega Benefits/github/omega-system/includes/class-omega-static.php(577): Simply_Static\Plugin->run_static_export() #7 /Volumes/Omega/Local/omegastaging/app/public/wp-includes/class-wp-hook.php(324): OmegaBenefits\System\Omega_Static->single_static_export('') #8 /Volumes/Omega/Local/omegastaging/app/public/wp-includes/class-wp-hook.php(348): WP_Hook->apply_filters('', Array) #9 /Volumes/Omega/Local/omegastaging/app/public/wp-includes/plugin.php(517): WP_Hook->do_action(Array) #10 /Volumes/Omega/Local/omegastaging/app/public/wp-admin/admin.php(419): do_action('admin_action_om...') #11 /Volumes/Omega/Local/omegastaging/app/public/wp-admin/edit.php(10): require_once('/Volumes/Omega/...') #12 {main} thrown in /Volumes/Omega/Local/omegastaging/app/public/wp-content/plugins/spatie-ray/vendor/spatie/ray/src/Ray.php on line 538

Versions
2.8.0 desktop Mac
Wordpress Ray plugin 1.7.5
Wordpress version 6.5.3

PHP version:
8.2.10

Desktop (local wordpress dev)

  • OS: MacOS
  • Version 14.5

Tinkerwell: cannot declare class error

Using Tinkerwell (latest version, Version 2.11.0) while Ray is active, results in the following error (when executing code in Tinkerwell):

Fatal error: Cannot declare class Spatie\WordPressRay\Symfony\Component\Console\Output\Output, because the name is already in use in /Users/jeffreyvanrossum/Documents/Sites/wordpress/wp-content/plugins/wordpress-ray/vendor/symfony/console/Output/Output.php on line 30

So far I noticed when I uncomment the following bits from autoload_static.php, the error goes away and Ray appears to be working.

'Symfony\\Component\\Console\\' =>
        array (
            0 => __DIR__ . '/..' . '/symfony/console',
        ),

Then the following error is introduced:

Fatal error: Cannot declare class Spatie\WordPressRay\Symfony\Component\VarDumper\Dumper\AbstractDumper, because the name is already in use in /Users/jeffreyvanrossum/Documents/Sites/wordpress/wp-content/plugins/wordpress-ray/vendor/symfony/var-dumper/Dumper/AbstractDumper.php on line 22

So when I uncomment this out as well, it is "resolved".

'Symfony\\Component\\VarDumper\\' => 
        array (
            0 => __DIR__ . '/..' . '/symfony/var-dumper',
        ),

So I wonder if these classes are loaded twice somehow?

I'm not sure why this happens. I did notice this issue on the imposter-plugin repo:
typisttech/imposter-plugin#170

I tested this with the (at this time) current master branch of this repo, with no other active plugins.

Edit:

When I remove the imposter-plugin package, and then install the dependencies with composer, the issue is resolved. Not really a solution since all the namespace prefixes are lost, but it does indicate the issue is caused by the imposter-plugin.

Edit 2:

We can determine if Tinkerwell is used, but I would understand that is not desirable.

$_SERVER['SCRIPT_NAME']; // would return tinkerwell

Wordpress Plugin version 1.0.2 not working as expected

the github version (1.0.0) works fine. but then the plugin release on wordpress plugin repo (v1.0.2), I try to update it to 1.0.2, then the plugin not working. does not show anything on ray app.

Then i try to downgrade it again to version 1.0.0, it works again. so i think the bugs is exist on version 1.0.2

Cannot declare trait because name is already in use

When installing the Ray WordPress plugin, we get the following errors when it has been activated.

Fatal error: Cannot declare trait Spatie\WordPressRay\Spatie\Macroable\Macroable, because the name is already in use in /path/site/web/app/plugins/wordpress-ray/vendor/spatie/macroable/src/Macroable.php on line 10

Fatal error: Cannot declare interface Spatie\WordPressRay\Psr\Container\ContainerExceptionInterface, because the name is already in use in /path/site/web/app/plugins/wordpress-ray/vendor/psr/container/src/ContainerExceptionInterface.php on line 11

I've tried to rule out as much as I can and I believe it is conflicting with our theme (as I've tested it works fine on a standard install of WP and the 2021 theme).

Our theme is built on a WordPress MVC framework called Lumberjack (https://docs.lumberjack.rareloop.com/). On a fresh install of this theme I can replicate the errors above.

Lumberjack uses thespatie/macroable package (added via composer) to allow for extension of the framework classes. It seems like this is causing a conflict with the macroable dependency within the plugin.


I setup a fresh install of Lumberjack (as per these install instructions). I removed everything the framework does until I got a blank white page. I slowly started adding in parts of Lumberjack and the first time it errors is with our Router:

<?php

use Spatie\Macroable\Macroable;

class Router implements Routable
{
    use VerbShortcutsTrait, Macroable;

When I remove the Macroable trait and namespace from this file, the error goes.


Now, I'll be honest. I don't actually know why PHP is giving this error considering the spatie macroable namespace we use is different than the one included in the plugin (namespace Spatie\WordPressRay\Spatie\Macroable\Macroable;). Any insights here would be fab.

I'm happy to provide the bare-bones theme if that is useful but my theory is that this issue occurs when a site already brings in a dependency (via composer) that the plugin uses too (e.g. macroable) - so while is occurs in our Lumberjack theme, it is not exclusive to it.

Note that we are able to use the standard PHP ray library via composer - it's just this plugin that causes the issue.

File and line number in output

Hello,

I love Ray and I don't know what I would do without it at this point. My whole team uses it now. Anyways with the latest version of the plugin, and the latest version of the app on my mac the file and line number no longer show in the output. Now every output just shows autoload.php:105 from the vendor directory of the plugin.

Can you please take a look? Thank you!

PHP Version Requirements

In the plugin file, the requirement is for a minimum PHP version of 7.3.

https://github.com/spatie/wordpress-ray/blob/master/wp-ray.php#L11

Changes overnight, in 2c5bb66 have introduced a minimum PHP version of 8.0 https://github.com/spatie/wordpress-ray/blob/master/vendor/composer/platform_check.php#L7

This had the unfortunate side effect of crashing one of my websites when it was pushed to the WordPress.org plugin repository and the plugin auto-updated overnight.

I realise work is ongoing to add support for PHP8.1, and I'm not at all against the minimum PHP version being raised to 8.0. But parity between these two versions (the plugin minimum, and the minimum for Composer) should be maintained.

E_WARNING: is_dir(): open_basedir restriction in effect

Similar to spatie/ray#73

The error I'm getting:

E_WARNING: is_dir(): open_basedir restriction in effect. File(/) is not within the allowed path(s): (/home/user/webapps/application:/var/lib/php/session:/tmp:/dev/urandom)

File /home/user/webapps/application/htdocs/wp-content/plugins/spatie-ray/vendor/spatie/ray/src/Settings/SettingsFactory.php line 37
File /home/user/webapps/application/htdocs/wp-content/plugins/spatie-ray/vendor/spatie/ray/src/Settings/SettingsFactory.php line 37 in is_dir args
File /home/user/webapps/application/htdocs/wp-content/plugins/spatie-ray/vendor/spatie/ray/src/Settings/SettingsFactory.php line 29 in Spatie\WordPressRay\Spatie\Ray\Settings\SettingsFactory::searchConfigFilesOnDisk args
File /home/user/webapps/application/htdocs/wp-content/plugins/spatie-ray/vendor/spatie/ray/src/Settings/SettingsFactory.php line 19 in Spatie\WordPressRay\Spatie\Ray\Settings\SettingsFactory::searchConfigFiles args
File /home/user/webapps/application/htdocs/wp-content/plugins/spatie-ray/vendor/spatie/ray/src/Settings/SettingsFactory.php line 10 in Spatie\WordPressRay\Spatie\Ray\Settings\SettingsFactory::getSettingsFromConfigFile args
File /home/user/webapps/application/htdocs/wp-content/plugins/spatie-ray/vendor/spatie/ray/src/helpers.php line 43 in Spatie\WordPressRay\Spatie\Ray\Settings\SettingsFactory::createFromConfigFile args
File /home/user/webapps/application/htdocs/wp-content/plugins/spatie-ray/vendor/spatie/ray/src/helpers.php line 47 in Spatie\WordPressRay\ray args 

The allowed path is /home/user/webapps/application, I think that should be enough for ray instead of /?

WordPress.org and plugin releases

I see that you made a release 1.0.1:
image

But WordPress.org is not aware of it and still allows everyone to download 1.0.0 by default:
image

That's because in your trunk/readme.txt you still point to the 1.0 which automatically instructs WP.org to zip and distribute the tags/1.0.0.

To make the 1.0.1 release go live and instruct WP.org to use tags/1.0.1 as the source of the zip you need to update in trunk/readme.txt the Stable tag: 1.0 to Stable tag: 1.0.1. Just creating a new directory inside SVN tags/ is not enough
And you will need to do this step for each and every release.

Basically, your trunk/* can always be the same as the latest tag you want to release. And for each release, you need to manually increment the Stable tag: X.X.X value inside the readme.txt.
You can leave in trunk/ only one readme.txt file and remove all the rest (and still update it and increment the Stable tag for each release), but I find it easier to just copy the release-prepared code to both tags/X.X.X and trunk/.

Here is the interface I used to identify this issue: https://plugins.trac.wordpress.org/browser/spatie-ray/

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.