Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Undefined array key PHP Warning #721

Open
afragen opened this issue Jul 11, 2024 · 0 comments
Open

Undefined array key PHP Warning #721

afragen opened this issue Jul 11, 2024 · 0 comments

Comments

@afragen
Copy link

afragen commented Jul 11, 2024

🐞 bug report

Behavior:

  • What is the issue? (*)
    In testing a multisite I am getting the following PHP Warnings on wp-admin/network/plugins.php
PHP Warning:  Undefined array key "title" in /Users/afragen/Documents/github/git-updater/vendor/freemius/wordpress-sdk/templates/partials/network-activation.php on line 75

There are similar errors for other missing array keys.

  • What is the expected behavior?
    No PHP Warnings

Versions: (*)

  • Freemius SDK Version: 2.7.3
  • WordPress Version: 6.5.5
  • PHP Version: 8.3.8

Plugin / Theme: (*)

  • Name: Git Updater
  • Slug: git-updater
  • Freemius ID: 11525

Additional Information:

Environment

  • WordPress: 6.5.5
  • PHP: 8.3.8
  • Server: nginx/1.16.0
  • Database: mysqli (Server: 8.0.16 / Client: mysqlnd 8.3.8)
  • Browser: Safari 17.5
  • OS: macOS
  • Theme: Twenty Sixteen 3.2
  • MU Plugins: None activated
  • Plugins:
    • Core Rollback 1.3.5
    • Embed PDF Viewer 2.3.1
    • Git Updater - Bitbucket 2.0.3
    • Git Updater - Gist 2.0.3
    • Git Updater 12.4.0.6
    • Local Development 2.8.3
    • Query Monitor 3.16.3
    • Site Testing 0.4
    • Test Reports 1.1.0
    • User Switching 1.7.3
    • WordPress Beta Tester 3.5.6
    • WP-CLI: Force Auto-Updates 1.0.0
    • WP Debugging 2.11.24
  • Stack Traces:
[11-Jul-2024 21:00:16 UTC] PHP Warning:  Undefined array key "title" in /Users/afragen/Documents/github/git-updater/vendor/freemius/wordpress-sdk/templates/partials/network-activation.php on line 75
[11-Jul-2024 21:00:16 UTC] PHP Stack trace:
[11-Jul-2024 21:00:16 UTC] PHP   1. {main}() /Users/afragen/Local_Sites/mulitsite/app/public/wp-admin/network/plugins.php:0
[11-Jul-2024 21:00:16 UTC] PHP   2. require() /Users/afragen/Local_Sites/mulitsite/app/public/wp-admin/network/plugins.php:13
[11-Jul-2024 21:00:16 UTC] PHP   3. require_once() /Users/afragen/Local_Sites/mulitsite/app/public/wp-admin/plugins.php:812
[11-Jul-2024 21:00:16 UTC] PHP   4. do_action($hook_name = 'admin_footer', ...$arg = variadic('')) /Users/afragen/Local_Sites/mulitsite/app/public/wp-admin/admin-footer.php:78
[11-Jul-2024 21:00:16 UTC] PHP   5. WP_Hook->do_action($args = [0 => '']) /Users/afragen/Local_Sites/mulitsite/app/public/wp-includes/plugin.php:517
[11-Jul-2024 21:00:16 UTC] PHP   6. WP_Hook->apply_filters($value = '', $args = [0 => '']) /Users/afragen/Local_Sites/mulitsite/app/public/wp-includes/class-wp-hook.php:348
[11-Jul-2024 21:00:16 UTC] PHP   7. Freemius->_add_license_activation_dialog_box('') /Users/afragen/Local_Sites/mulitsite/app/public/wp-includes/class-wp-hook.php:324
[11-Jul-2024 21:00:16 UTC] PHP   8. fs_require_template($path = 'forms/license-activation.php', $params = ['id' => '11525']) /Users/afragen/Documents/github/git-updater/vendor/freemius/wordpress-sdk/includes/class-freemius.php:13249
[11-Jul-2024 21:00:16 UTC] PHP   9. require() /Users/afragen/Documents/github/git-updater/vendor/freemius/wordpress-sdk/includes/fs-core-functions.php:45
[11-Jul-2024 21:00:16 UTC] PHP  10. fs_get_template($path = 'partials/network-activation.php', $params = ['id' => '11525', 'sites' => [0 => [...]], 'require_license_key' => TRUE]) /Users/afragen/Documents/github/git-updater/vendor/freemius/wordpress-sdk/templates/forms/license-activation.php:106
[11-Jul-2024 21:00:16 UTC] PHP  11. require() /Users/afragen/Documents/github/git-updater/vendor/freemius/wordpress-sdk/includes/fs-core-functions.php:57

Note: (*) indicates required information. Without this information, your issue may be auto-closed.

You can find your Freemius SDK version at /freemius/start.php

You can find your Freemius product ID in the Freemius dashboard: SETTINGS -> INTEGRATION.

Do not modify the titles or questions. Simply add your responses to the ends of the questions.
Add more lines if needed.

Solution

Add the following lines before network-activation:line 75

<?php if ( ! isset($site[$prop] ) ) :?>
    <?php continue ?>
<?php endif ?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant