David
Forum Replies Created
-
Forum: Plugins
In reply to: [HandL UTM Grabber / Tracker] Error with HandL UTM Grabber Version 2.7.27The WordPress – Site Health Status, now loads as expected. Thanks again.
Forum: Plugins
In reply to: [HandL UTM Grabber / Tracker] Error with HandL UTM Grabber Version 2.7.27Will do, thank you very much!
Forum: Plugins
In reply to: [Route ? Shipping Protection] Fatal Error after 2.2.15 updateCrashed my site as well.
Forum: Plugins
In reply to: [SVG Support] Still getting fatal PHP error with 2.5.3It seems to be resolved for me as well. Thanks!
Forum: Plugins
In reply to: [SVG Support] Still getting fatal PHP error with 2.5.3@dwaynepivac Glad it helped you out.
Also, I want to add that PHP 7.4 as of a couple days ago, has been retired. So being compatible with PHP 8.+ would probably be a very good thing.
https://www.php.net/supported-versions.phpForum: Plugins
In reply to: [SVG Support] Still getting fatal PHP error with 2.5.3The error still exists in latest SVG Support v2.5.4.
PHP Notice: Trying to access array offset on value of type null in /var/www/example.com/wp-content/plugins/svg-support/functions/mime-types.php on line 22
Notice: Trying to access array offset on value of type null in /var/www/example.com/wp-content/plugins/svg-support/functions/mime-types.php on line 22While casting this value $allowed_roles_array = (array) $bodhi_svgs_options[‘restrict’]; to an array works. The problem is you’re attempting to fix an item in a global variable that is null (e.g. $bodhi_svgs_options).
So, I’m guessing you would want to verify your global is actually an array or just check for a $user->ID like @mabioneto did right after your global or both.
global $bodhi_svgs_options; if ( 0 === $user->ID || ! is_array( $bodhi_svgs_options ) ) { return $mimes; }
Forum: Plugins
In reply to: [SVG Support] Still getting fatal PHP error with 2.5.3To Simplify where the error is occurring (line 28):
PHP Warning: array_intersect(): Expected parameter 1 to be an array, null given in /var/www/example.com/example_prod/wp-content/plugins/svg-support/functions/mime-types.php on line 28However, the problem is really with line 22.
When running WP-CLI, the variable $bodhi_svgs_options[‘restrict’] is null. And line 28’s array_intersect() parameter 1 is then null, which is throwing the error.For me I changed line 22 to actually check and set $allowed_roles_array properly.
Fix:
$allowed_roles_array = ( is_array( $bodhi_svgs_options ) && ! empty( $bodhi_svgs_options['restrict'] ) ) ? $bodhi_svgs_options['restrict'] : array();
Additionally:
I commented out line 19 since its no longer doing anything.
e.g.
// $allowed_roles_array = array();
After implementing the above code, I verified “SVG Support” doesn’t throw errors in WP-CLI and I verified as an admin that I was able to upload an SVG.
Hope this helps.
@wfphil
No I would not expect free support for a custom plugin. However, it would be nice if Wordfence in future considerations would expose specific methods for devs to build extensions/plugins for WP-CLI to access. Something like how UpdraftPlus in their __construct expose methods with add_action().e.g.
https://github.com/wp-plugins/updraftplus/blob/master/class-updraftplus.phpForum: Plugins
In reply to: [Redis Object Cache] Redis Object Cache 2.1.4 error@tillkruess Much appreciated!
Forum: Plugins
In reply to: [Redis Object Cache] Redis Object Cache 2.1.4 errorYou change it on line 284 of this file:
wp-content/plugins/redis-cache/includes/class-plugin.phpBasically, you will need to audit any other code in your theme’s functions.php or any plugins (which is probably easier to disable one by one). You’ll need to look for a PHP method called getCookie() and you can probably do a search for “getCookie(” without the quotes, to find the code that is conflicting with the new Ninja Forms code. Once you remove the conflicting method, Ninja Forms should load again. Hopefully you understand coding, otherwise this will be pretty tough.
A second option which is only a temporary fix and I personally would not recommend doing, would be to alter Ninja Forms code directly. This isn’t a good idea because it will get overwritten on an update.
Ninja Forms File:
<YOUR-SITE>/wp-content/plugins/ninja-forms/assets/js/min/front-end-deps.jsOn line 176 you will see:
const getCookie = (cname) => {This can be altered and by changing ‘const’ to ‘var’ which should not break or conflict with anything else:
var getCookie = (cname) => {You could probably use ‘let’ instead of ‘var’ but I know ‘var’ works.
Again, you’re better off finding the conflicting code and not altering Ninja Forms directly!
Hope that helps you out.
- This reply was modified 2 years, 9 months ago by David.
So, it is conflicting with an old plugin named “Cookie Params” which uses a very similar “getCookie” method. Guessing the “getCookie” method was pulled and slightly modified from a Stack Overflow answer (maybe: https://stackoverflow.com/q/10730362/1681478) for your plugin and the “Cookie Params” plugin. We are no longer using this plugin and are removing it from our sites.
My suggestion would be to rename the method to exist in the Ninja Forms namespace, something like nfGetCookie() to avoid any future conflicts. Especially, since it looks like the method was derived from Stack Overflow.
Forum: Plugins
In reply to: [Contact Form 7] Contact Form 7 5.4 upgrade missing folderMy problem was the same as @samferguson.
I’ve migrated this site a couple times and it had the settings of an old media uploads server path. Going into: “Settings” > “Media”: “Store uploads in this folder” was incorrect. Once changed to the correct current file path, the error went away.
Running PHP 7.4.
Forum: Plugins
In reply to: [BBQ Firewall – Fast & Powerful Firewall Security] Site Health Status issues.Gotcha. Yeah, that makes this pretty useless then. At that point it would need some kind of check to see if the site itself was running a cron or site health.