Website will not load

Avatar
  • Answered
When I go to my website (www.coachpintar.com) I am getting the following error. It happened after I tried to activate a new plugin.

Fatal error: Cannot redeclare GetChildren() (previously declared in /home/coachp8/public_html/wp-content/plugins/amazon-product-in-a-post-plugin/inc/aws_signed_request.php:56) in /home/coachp8/public_html/wp-content/plugins/app-store-assistant/includes/app-store-amazon_functions.php on line 799
Avatar
JacobIMH
Hello, and thanks for posting your question. The reason you're seeing this error on your website is due to the PHP error reporting settings currently used on your account. The PHP error itself that you are encountering seems to be getting caused by two of your WordPress plugins trying to declare the same function name of GetChildren(). In this case, it looks like the Amazon Product in a Post Plugin first used this function name. Then the App Store Assistant plugin tried to redeclare it as well, which is what the error is telling you. I went ahead and fixed this for you, and also submitted a support request to the plugin developer, so hopefully this will be fixed for others going forward. I took a look through both files:
/amazon-product-in-a-post-plugin/inc/aws_signed_request.php
/app-store-assistant/includes/app-store-amazon_functions.php
It seems that the App Store Assistant plugin is using the exact same functions word for word already used by Amazon Product in a Post Plugin. So because they seem to be expecting the exact same functionality I was able to fix this for you by adding this code to the app-store-assistant/includes/app-store-amazon_functions.php script:
730 if(!function_exists('GetChildren')){
731 function GetChildren ($vals, &$i, $type){
...
800 }
801 }
I then encountered another error: Fatal error: Cannot redeclare aws_hash_hmac() (previously declared in /home/coachp8/public_html/wp-content/plugins/amazon-product-in-a-post-plugin/inc/aws_signed_request.php:7) in /home/coachp8/public_html/wp-content/plugins/app-store-assistant/includes/app-store-amazon_functions.php on line 827 So to fix it:
803 if(!function_exists('aws_hash_hmac')){
804 function aws_hash_hmac($algo, $data, $key, $raw_output=False){
...
828 }
829 }
Then another error... Fatal error: Cannot redeclare aws_signed_request() (previously declared in /home/coachp8/public_html/wp-content/plugins/amazon-product-in-a-post-plugin/inc/aws_signed_request.php:558) in /home/coachp8/public_html/wp-content/plugins/app-store-assistant/includes/app-store-amazon_functions.php on line 974 Another fix:
832 if(!function_exists('aws_signed_request')){
833 function aws_signed_request($region, $params, $public_key, $private_key){
...
975 }
976 }
Your website should be back up and running now. I left a copy of the original plugin file at /plugins/app-store-assistant/includes/app-store-amazon_functions.php-BAK if for some reason you run into any other problems. Please let us know if you had any further questions at all. - Jacob