hookpress icon indicating copy to clipboard operation
hookpress copied to clipboard

Errors on hook creation

Open redpupmedia opened this issue 10 years ago • 4 comments

Hello. On creation of a new hook, two errors are generated. (wp 4.4.1, php 5.4.45)


This is the first: Deprecated: Function split() is deprecated in /home/devredpupmedia/public_html/client/brand/wp-content/plugins/hookpress/services.php on line 60

I was able to resolve it by editing line 60 in /services.php as follows:

'fields'=>explode(',',$_POST['fields']),

Also edited line 49 in the same file with the same edit.


The second: Strict Standards: Only variables should be passed by reference in /home/devredpupmedia/public_html/client/brand/wp-content/plugins/hookpress/hookpress.php on line 68 edit_post

I was able to resolve it by editing line 68 in /hookpress.php as follows:

$tmp = array_keys($webhooks);  
return end($tmp);

I'm not polished in PHP so I'm asking if these changes are acceptable for use in the plugin. Thanks

redpupmedia avatar Jan 21 '16 16:01 redpupmedia

Thank you; yes I think they look right. And I assume hooks have been working well for you again once these changes were in place?

I'm curious — did you recently add HookPress and run into these issues or did you upgrade the PHP on your server or something?

mitcho avatar Jan 21 '16 19:01 mitcho

Wonderful.

Yes, hooks worked after these edits (tested hooks on zapier.com with success).

Recently installed HookPress, I did not test on other PHP versions. Found it via Zapier instructions for WordPress. Works great! We are planning to add some custom fields but the rest is perfect.

redpupmedia avatar Jan 21 '16 19:01 redpupmedia

Ok thank you. If you are familiar with GitHub, please submit a Pull Request with these changes so you will be credited with the commit. Otherwise I can make the changes. Then I will bundle and submit to wordpress.org.

mitcho avatar Jan 21 '16 19:01 mitcho

Thanks - this is all you. I'm not on GitHub enough to not screw it up :)

redpupmedia avatar Jan 21 '16 19:01 redpupmedia