farnely
Forum Replies Created
-
Forum: Fixing WordPress
In reply to: Content Security Policy IssuesOddly, I had tried adding the hashes from devtools but they didn’t work. I wondered if perhaps a mixture of hashes and nonces wouldn’t work. I’ve tried it again today and now it works!! I must have made a mistake somewhere in my pasting.
So relieved :-). Many thanks!
Forum: Fixing WordPress
In reply to: Speculation Rules Script & GooglebotThe entries in my robots file relating to Google have remained (rightly or wrongly) unchanged for years but now, since WP 6.8 was released in April, Google has got the idea that (taking the first item in the list) the URL https://my-site/wp-*.php exists when it doesn’t, hence the 404s. The only place wp-*.php appears is in the speculation rules script that loads since WP 6.8.
Excluding those paths in robots would be a request to not crawl any of those locations. In other words, “don’t crawl my site”.
Forum: Plugins
In reply to: [iQ Block Country] PHP Deprecated V1.2.26Any chance of an update please?
Forum: Plugins
In reply to: [iQ Block Country] PHP Deprecated V1.2.26Yes it’s 157.15.90.216. According to https://www.iplocation.net/ip-lookup, it’s in India.
Forum: Plugins
In reply to: [iQ Block Country] PHP DeprecatePHP Deprecated: htmlspecialchars(): Passing null to parameter #1 ($string) of type string is deprecated in /wp-content/plugins/iq-block-country/libs/blockcountry-checks.php on line 19
Forum: Fixing WordPress
In reply to: Question about template_redirect hookI use a third party plugin for custom posts and fields so I don’t know what hook is used.
I’m of the opinion, however, that the custom post type must be registered by the time the template_redirect hook runs because if I change the post status to publish, a 404 is not returned and the content template loads. I think that when the post status is private, the post is considered non-existent for a logged out user and logically you can’t fetch the post type for a non-existent post.
Working with private posts in wordpress is cumbersome!
Forum: Fixing WordPress
In reply to: Question about template_redirect hook@threadi
Thanks for your suggestions. Am using paths, private browser produced same result and is_user_logged_in() returns correct status on 404 page.Have been trying out a few more things and managed to solve it by updating my template_redirect hook to redirect if is_404(), user not logged in and the requested post exists. Narrowing it down any further (to specific custom post types, for example) returns the unwanted 404 again.
This is as close as I can get to what I was trying to achieve so am closing thread.
Forum: Plugins
In reply to: [Weather Atlas Widget] Undefined Variable Error (Version 3.0)@quantum-leap
This isn’t the first time the developer/s have released a version containing basic coding errors and I doubt it will be the last. I got fed up of waiting for them to acknowledge the issue when I reported it let alone put it right and have now removed the plugin from my site. But thanks to you for sharing the solution.Forum: Plugins
In reply to: [Weather Atlas Widget] Latest Release (V2.0.1)That’s good news
I’m closing this ticket now; if anyone else continues to have any issues, please open a fresh ticket.
Forum: Plugins
In reply to: [Weather Atlas Widget] Latest Release (V2.0.1)So, I’ve checked the content of the options field and mine looks like this:-
a:1:{s:12:"_multiwidget";i:1;}I’m not displaying mine as a widget, I’ve just put the shortcode in the editor in WP Admin.
It occurred to me that there might be an incomplete div tag somewhere so I had a look at your PHP files. One thing struck me: on most of them your HTML is preceded by a closing PHP tag and then you PHP echo values within your HTML. For example, like this:-
<label for="text_color"><?php _e( 'Text Color', 'weather-atlas' ); ?></label>In the file weather-atlas.php, however, you echo your HTML within your PHP. For example, like this:-
echo "<div class='weather_demo_wrapper'>";
echo do_shortcode( '[shortcode-weather-atlas selected_widget_id=' . $widget_id . ']' );
echo "</div>";
Personally, I like a consistent approach but it’s not my plugin and it shouldn’t affect the output. What is probably more of a problem though is that the opening PHP tag on Line 49 is incomplete; it reads
<?instead of<?php.Might I suggest you scrutinise your code thoroughly in case there are other instances of incomplete PHP tags and you might find a “<” or “>” is missing somewhere too.
Forum: Plugins
In reply to: [Weather Atlas Widget] Latest Release (V2.0.1)Thanks for altering the SQL queries. My settings page is still OK now since I de-activated and re-activated other plugins & theme. Don’t know why that would make a difference. I’ve not had a problem with the shortcode output not showing.
Forum: Plugins
In reply to: [Weather Atlas Widget] Latest Release (V2.0.1)This piece of code which appears in at least 3 of the plugin’s files (eg: line 52 in weather-atlas/admin/weather-atlas.php) doesn’t use a WP wordpress function:-
$widget_options = $wpdb->get_results( "SELECT * FROM {$wpdb->options} WHERE option_name LIKE 'weather_atlas_widget_%'" );Forum: Plugins
In reply to: [Weather Atlas Widget] Latest Release (V2.0.1)So, I took a backup, deactivated all plugins (except yours) & my theme, installed & activated default 2023 theme; no change in Settings. When I re-installed my backup, however, the Settings page is now fine!
What I would like clarification on though please is why you’re not using $wpdb->prepare for the SQL query that fetches the content for the Settings page.
Thanks.
totally agree – got a few other issues too (see separate ticket)
Forum: Developing with WordPress
In reply to: Authenticate FilterOK thank you; I’ll reconsider my approach.