Won’t Work. Got Error Message about php file.
-
This is my second time to activate independent-analytics and get this error message:
Warning: file_put_contents(/home/public/wp-content … /iawp-click-config.php): Failed to open stream: Permission denied in /home/public/wp-content/plugins/independent-analytics/IAWP/Click-Tracking/Config_File_Manager.php on line 38
Here’s what that php file says (lines 36-39):
$contents = "<?php exit; ?>\n"; $contents .= \json_encode($data); \file_put_contents(self::config_file_path(), $contents); }Please. How can I fix it?
-
Hi there,
Thanks for getting in touch. I’m sorry to hear about this issue.
When you say the plugin isn’t working, what part, in particular, is not working for you? Is it unable to track visitors?
The PHP warning here is something we can address, but as a warning and not an error, it won’t affect the plugin’s ability to run and record stats.
Thanks for your quick reply.
So, a few minutes ago, I activated the plugin again. It did NOT splash the warning message on the homepage of my site, so I thought maybe it’s working. But I logged-in to my site, and my admin menu shows Analytics, etc., but when I click on any of those menu items, it just shows Error and Warning messages. I see NO evidence of any tracking of visitors or any other functionality. Here are the messages:
BladeOne Error [Compiling]:
Unable to save the file [/home/public/wp-content/plugins/independent-analytics/temp/template-cache/partials.sidebar_0c7f6c44b747c7b0871d8a1f0780e9bf1d5a9131.bladec]. Check the compile folder is defined and has the right permissionWarning: include(/home/public/wp-content/plugins/independent-analytics/temp/template-cache/partials.sidebar_0c7f6c44b747c7b0871d8a1f0780e9bf1d5a9131.bladec): Failed to open stream: No such file or directory in
Warning: include(/home/public/wp-content/plugins/independent-analytics/temp/template-cache/notices.notice_846398510e28eeff0e6d97276d335b2bf9316ce1.bladec): Failed to open stream: No such file or directory in /home/public/wp-content/plugins/independent-analytics/vendor/eftec/bladeone/lib/BladeOne.php on line 1501
Warning: include(): Failed opening ‘/home/public/wp-content/plugins/independent-analytics/temp/template-cache/notices.notice_846398510e28eeff0e6d97276d335b2bf9316ce1.bladec’ for inclusion (include_path=’.:/usr/local/php/8.1.33-nfsn3/lib/:/usr/local/php/lib/’) in /home/public/wp-content/plugins/independent-analytics/vendor/eftec/bladeone/lib/BladeOne.php on line 1501Last year, I had a different stats plugin, and it worked without trouble from the get-go, but it kept pestering me to let it make modifications to my database, which I was NOT going to do. So, I deleted that plugin.
So, yours is the first I’ve tried since then. Nothing but trouble so far. Is there any hope of an easy fix?
Thanks for the additional info.
If you update to the latest version of Independent Analytics, that should resolve the issue you are seeing in the Analytics menu. The error message that says “BladeOne Error [Compiling]:” is referencing code that has since been removed from the plugin.
Let’s start with that and see how it goes.
Hi. Thanks again.
So, by PuTTy I told it to update: wp plugin update independent-analytics
And it said, as I expected, plugin is already updated.
In my site’s dashboard, Plugins page, it says: Version 2.13.5 | By Independent
QUESTION: Is that truly the latest version?
Also, ALL the error messages and warnings are still there.
QUESTION: What next, please?
I’m sorry. I got this mixed up with a different error message. If you have a server configuration that makes the plugin directory unwritable, you can save the files created by IA to a different directory instead. We have simple instructions on how to do that here: https://independentwp.com/knowledgebase/developer/pantheon-compatibility-fix-bladeone-error/
Thanks for the ongoing help.
“simple instructions”. On the page you linked, there are two fixes suggested. 1) The first is a “filter,” BUT it does NOT say WHERE I would put those lines of code. WHERE?
2) The second is some code to put in the wp-config.php file. It does not say WHERE to put it in that file. Years ago, probably on my previous site, I was urged to put a line of code in a config file at the end or just before the end of the file contents. So, I have a smidge of experience with this. But I ask you so I can get it right the first time, WHERE in the config file?
Normally, only developers would have this configuration for their file permissions, so we didn’t include a lot of detail in our tutorial.
There should be a comment in the wp-config.php file that says this:
/* That's all, stop editing! Happy publishing. */You can add the the code right above that comment.
Thanks again. So, I added the code to my wp-config.php file. Got new error messages:
Fatal error: Uncaught Exception: The temp directory set with the iawp_temp_directory_path filter is missing or is not writable: /code/wp-content/uploads/iawp in /home/public/wp-content/plugins/independent-analytics/iawp-bootstrap.php:93 Stack trace: #0 /home/public/wp-content/plugins/independent-analytics/iawp-bootstrap.php(167): IAWPSCOPED\iawp_temp_path_to(‘template-cache’) #1 /home/public/wp-content/plugins/independent-analytics/IAWP/Admin_Page/Admin_Page.php(43): IAWPSCOPED\iawp_render(‘partials.sideba…’, Array) #2 /home/public/wp-content/plugins/independent-analytics/IAWP/Independent_Analytics.php(256): IAWP\Admin_Page\Admin_Page->render() #3 /home/public/wp-includes/class-wp-hook.php(341): IAWP\Independent_Analytics->IAWP\{closure}(”) #4 /home/public/wp-includes/class-wp-hook.php(365): WP_Hook->apply_filters(”, Array) #5 /home/public/wp-includes/plugin.php(522): WP_Hook->do_action(Array) #6 /home/public/wp-admin/admin.php(264): do_action(‘toplevel_page_i…’) #7 {main} thrown in
/home/public/wp-content/plugins/independent-analytics/iawp-bootstrap.php on line 93
There has been a critical error on this website. Please check your site admin email inbox for instructions. If you continue to have problems, please try the support forums.
Those are the messages. By the way, my site is made with WPZOOM, capable of displaying my own videos. The site has worked well from inception (2020) till today, and still works fine despite the “fatal” and “critical error” message. It seems to be only Analytics that doesn’t work.
I’ll try one, maybe two, more “fixes.” I noticed you didn’t mention where to put the “filter” code, the first of the two suggested fixes. So, I did only the second of the two suggested fixes.
What’s next?
You can use the filter or the wp-config.php code. Only one is needed, so that’s why I recommended the wp-config.php option.
The code snippet from our tutorial is an example. You need to change the path to point to the correct location on your server. In the path
/code/wp-content/uploads/iawp, the/code/part is a placeholder that you need to change. If you connect to your site via FTP, you can find the full path to thewp-contentfolder that way.I’m sorry if this seems overly technical, but the site you’re running has a configuration that normally only a developer would use because they want to push all of their changes from a staging site. Most sites keep the /plugins/ folder writeable because that is required to update the plugins.
Thanks.
And thanks for telling me I have to replace “code” with my own appropriate folder name.
Again, please, WHERE (in which file) do I put the “filter”?
The filter is an alternative option if you find that easier, but you don’t need both. You only need to add the code we discussed to the wp-config.php file.
TOTAL FAIL.
I tried again. Tried all I know to try. Despite your fuzzy help, I think I got the path correct, the coding right.
TOTAL FAIL.
wp plugin DELETE independent-analytics.
DONE.
You must be logged in to reply to this topic.