• Resolved yourapiexpert

    (@yourapiexpert)


    I have the WP-JSON plugin enabled and there is a conflict between that and this plugin.

    In particularly this plugin injects unwanted Javascript in to the page as follows:

    <script>
    		jQuery(document).ready(function(){
    			jQuery('#dd_b7df4841526e59684bb19fdfd4eb8549').on('change', function() {
    			  jQuery('#amount_b7df4841526e59684bb19fdfd4eb8549').val(this.value);
    			});
    		});
    		</script>
    		{"id":202,"date":"2017-01-24T11:30:59","date_gmt":"2017-01-24T11:30:59","guid":{"rendered":"http:\/\/www.yourapiexpert.com\/?p=202"},"modified":"2017-01-26T04:53:21","modified_gmt":"2017-01-26T04:53:21","slug":"how-to-design-a-good-.......
    

    This causes any JSON parser to fail due to the unwanted information. When I disable this Paypal plugin the JSON works and parses properly.

    Please do let me know if there is any further information I can supply. I am on the latest WordPress and the latest version of this Paypal plugin.

    • This topic was modified 9 years, 2 months ago by yourapiexpert.
Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author Scott Paterson

    (@scottpaterson)

    Hi @yourapiexpert,

    This part is from this plugin:

    <script>
    jQuery(document).ready(function() {		jQuery('#dd_b7df4841526e59684bb19fdfd4eb8549').on('change', function() {		  jQuery('#amount_b7df4841526e59684bb19fdfd4eb8549').val(this.value);
    });
    });
    </script>

    However the JSON below that is not from this plugin.

    That JavaScript is located right beside each button, and should not cause any problems at all with other elements or plugins on your site.

    Thread Starter yourapiexpert

    (@yourapiexpert)

    Yes indeed you are correct.

    I was alluding to the fact that by some mysterious way that javascript from the Paypal plugin is appearing in the other plugin’s feed.

    The plugin in question is https://ww.wp.xz.cn/plugins/json-rest-api/ which does not load any pages or elements other than the JSON data asked for.

    Unfortunately I can’t profess to know how to begin debugging this but I thought I would ask as when I disable the Paypal plugin the JSON plugin works just fine.

    If it’s not a bug or its normal operation for it to do that I will have to leave it disabled which would be a shame.

    Thanks so much for looking in to it.

    Plugin Author Scott Paterson

    (@scottpaterson)

    @yourapiexpert – Yeah, that bit of code is normal and it is necessary for the dropdown menu to work correctly.

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘Plugins breaks WP-JSON’ is closed to new replies.