kitchin
Forum Replies Created
-
And it makes running with
WP_DEBUG
on difficult, or in the case of AJAX, sometimes broken.- This reply was modified 3 years, 6 months ago by kitchin.
Plugins should not generate warnings. Filling up
error_log
makes it hard to debug a site as a whole. Warnings are there for a reason and I have not seen a case where they were not easy to resolve.Forum: Plugins
In reply to: [WooCommerce PayPal Checkout Payment Gateway] Update on Venmo?Further clarification: Venmo is available, along with ApplePay, etc., it seems via the Braintree plugin https://www.ads-software.com/plugins/woo-payment-gateway/
Braintree is yet another PayPal company. It is a payment gateway, with an application process of course, like signing up for a traditional credit card gateway. In other words, not like Paypal. The fees are per-transcation, etc. The reason for such a process is that merchant fraud has been a big problem for credit card banks, more so than customer fraud, over the last decades. As I understand it.
Note that Google Pay is going through a tough evolution due to this is-it-a-bank or is-it-not ambiguity. Banks are heavily regulated for good reason, and you want your sales to reach your bank account in some way which is safe and legal. (Crypto currency is another matter.) Google Pay wants to go all-mobile from what I’ve read, due to better authentication, and is making that change confusing by keeping the same name for the service.
Note, WPTouch Pro has a feature called “jQuery Enhanced.” That may explain the delay in fixing jQuery in the free version.
Agreed, but it’s worse. Even with the bridge script in code, WPTouch cannot do some things, like change menu icons. For now, that feature will work via the official WP plugin “Enable jQuery Migrate Helper” from https://www.ads-software.com/plugins/enable-jquery-migrate-helper/
WPTouch needs to fix this pronto. For now, try the official WP plugin “Enable jQuery Migrate Helper” from https://www.ads-software.com/plugins/enable-jquery-migrate-helper/
This thread is not resolved.
No updates on Github in 13 days.
For debugging I guess the first thing I would do is investigate the calls to
check_ajax_referer( 'wp_rest', 'wps_nonce' )
. They’re all in one file in the plugin, and WP core has a hook:
do_action( 'check_ajax_referer', $action, $result );
Difficult to debug. Wp-statistics does not meaningfully honor
SCRIPT_DEBUG
. As far as I can tell, so js is all minimized, andwp-statistics/assets/dev/javascript/meta-box.js
is already compiled intowp-statistics/assets/js/admin.min.js
when you download the plugin. For example moddingmeta-box.js
to show more info on your error probably won’t work, like this:distrib:
/** * Show Error Connection if Meta Box is Empty */ wps_js.error_meta_box_data = function (text) { return wps_js._('rest_connect'); };
mod:
wps_js.error_meta_box_data = function (text) { return wps_js._('rest_connect: ' + text); };
Here ‘text’ is
xhr.responseText
fromjquery.ajax()
; and ‘rest_connect’ is the error you’re seeing, ‘Problem Connect to WordPress REST API‘.Wp-statistics is also one of those plugins *full* of cruft from
composer
, like redistributables full of testing code. For another kind of cruft, the plugin has two js functions for ajax calls in its files: its ownajaxQ()
, which calls a jquery plugin functionajaxq()
. Neither file is even used because their code ends up inadmin.min.js
before you get the plugin. Just whole trees of cruft.It’s not the only plugin that does this, and it presents two problems: 1. security surface, and 2. having to search through the bloat to fix things and verify files. I thought the whole purpose of
composer
was to control code, not to give up and invite the wilderness inside your house. But of course it’s easier to use it that way.Breaking Javascript is serious and I think you should release a new version to fix 13.0.4 sooner than “one week,” if the reports in other threads are correct. When JS throws an error it stops active elements on all Dashboard and other pages that your plugin loads its scripts into. Typically plugins that break Javascript cause elements on Post/Page editing screens to fail. I realize this is a free plugin, but it needs to be fixed right away.
A common cause lately has been WordPress core going to more recent version of jQuery.
We had this error on one part of one chart only, and fixed it by setting memory higher. It was probably a different problem, but here is what happened: https://www.ads-software.com/support/topic/pages-top-page-trends-not-working/#post-13755604
We had an issue with the “Year” tab on this chart resulting in “An error occurred while connecting to REST API.”
We traced it down to memory exhaustion, with
error_log
message:
Allowed memory size of 41943040 bytes exhausted.
It was generated by a process in another plugin needing memory, by the way. But it only affected the “Year” tab here.We raised
php_memory_limit
in PHP, and settingWP_MEMORY_LIMIT
inwp-confing.php
can also work. Depends on your system, other plugins, and code in this plugin.See also: Dashboard / Tools / Site Health.
Maybe this, from a Google search: “If you received an error, it means the WordPress Rest API is disabled. You can enable it by activating your permalinks in WordPress. Visit Settings ? Permalinks within WordPress and without making any changes click Save changes. This causes WordPress to flush its rewrite rules, and can often resolve issues like this.”
But the REST API is platform dependent, and also it could be an authentication bug in the plugin.
What version? That code was removed Nov 15, 2017.