Xtendify / Simple-Calendar

Add Google Calendar events to your WordPress site.
https://simplecalendar.io
GNU General Public License v2.0
46 stars 37 forks source link

Warning: Illegal string offset 'google' #262

Open explorier opened 7 years ago

explorier commented 7 years ago

Getting these errors when trying to connect API to my local development setup. I'm using a theme based on Sage 8.5.1 starter theme and using [Roots' Trellis] (https://github.com/roots/trellis) to set up dev/staging environments

( ! ) Warning: Illegal string offset 'google' in /srv/www/....com/current/web/app/plugins/google-calendar-events/includes/abstracts/admin-page.php on line 186 Call Stack

Time Memory Function Location

1 0.0007 421976 {main}( ) .../options.php:0 2 0.5394 44233400 update_option( ) .../options.php:219 3 0.5394 44233400 sanitize_option( ) .../option.php:270 4 0.5394 44233480 apply_filters( ) .../formatting.php:4292 5 0.5394 44233880 WP_Hook->apply_filters( ) .../plugin.php:203 6 0.5394 44235384 SimpleCalendar\Abstracts\Admin_Page->validate( ) .../class-wp-hook.php:300

( ! ) Notice: Array to string conversion in /srv/www/....com/current/web/app/plugins/google-calendar-events/includes/abstracts/admin-page.php on line 186 Call Stack

Time Memory Function Location

1 0.0007 421976 {main}( ) .../options.php:0 2 0.5394 44233400 update_option( ) .../options.php:219 3 0.5394 44233400 sanitize_option( ) .../option.php:270 4 0.5394 44233480 apply_filters( ) .../formatting.php:4292 5 0.5394 44233880 WP_Hook->apply_filters( ) .../plugin.php:203 6 0.5394 44235384 SimpleCalendar\Abstracts\Admin_Page->validate( ) .../class-wp-hook.php:300

( ! ) Warning: Cannot modify header information - headers already sent by (output started at /srv/www/.../current/web/app/plugins/google-calendar-events/includes/abstracts/admin-page.php:186) in /srv/www/.../current/web/wp/wp-includes/pluggable.php on line 1179 Call Stack

Time Memory Function Location

1 0.0007 421976 {main}( ) .../options.php:0 2 0.5420 44223608 wp_redirect( ) .../options.php:246 3 0.5421 44223760 header ( ) .../pluggable.php:1179

Server Environment (for local development environment) Web Server nginx/1.11.9 PHP Version 7.1.2-4+deb.sury.org~xenial+1 MySQL Version 5.5.5-10.0.29-MariaDB-0ubuntu0.16.04.1 Server Timezone UTC Display Errors Yes (1) Memory Limit 256M Upload Max Filesize 25M Post Max Size 25M Max Execution Time 120 Max Input Vars 1000 fsockopen Yes cURL 7.47.0, OpenSSL/1.0.2g SOAP No SUHOSIN No WP Remote POST Yes WP Remote GET Yes

However, it works fine with no errors in my staging environment. Here's the server info for the staging environment: Web Server nginx/1.11.9 PHP Version 7.1.3-1+deb.sury.org~yakkety+1 MySQL Version 5.5.5-10.0.29-MariaDB-0ubuntu0.16.10.1 Server Timezone UTC Display Errors - Memory Limit 256M Upload Max Filesize 25M Post Max Size 25M Max Execution Time 120 Max Input Vars 1000 fsockopen Yes cURL 7.50.1, OpenSSL/1.0.2g SOAP No SUHOSIN No WP Remote POST Yes WP Remote GET Yes

explorier commented 7 years ago

Ok, just realized it doesn't seem to be working in my staging environment either. The API key doesn't appear to be saving, although it displays the "Settings saved." notice and acts like it is successfully saving the API key.

I get this warning when I try to connect a Google calendar:

" Your Google Calendar events will not show up until you create and save a Google API key."

I am using another plugin to connect to the Google Maps API, could this be interfering?

nickyoung87 commented 7 years ago

@explorier This is because you are using PHP 7.1.x.

We have not had a chance to update things to work with the PHP updates to 7.1.x and the plugin will only work up until PHP 7.0.x. SO if you are able to downgrade PHP to that version then that will be how you can get the plugin working.