mattwmc2001
Forum Replies Created
-
Forum: Plugins
In reply to: [Categories Images] Update breaks sitedebug log shows:
PHP Fatal error: Uncaught TypeError: Cannot access offset of type string on string in /home/mattwmc/public_html/wp-content/plugins/categories-images/categories-images.php:460
Stack trace:0 …/wp-includes/class-wp-hook.php(341): ZCategoriesImages->zInitRestApi(Object(WP_REST_Server))
1 …/wp-includes/class-wp-hook.php(365): WP_Hook->apply_filters(NULL, Array)
2 …/wp-includes/plugin.php(522): WP_Hook->do_action(Array)
3 …/wp-includes/rest-api.php(636): do_action(‘rest_api_init’, Object(WP_REST_Server))
4 …/wp-includes/rest-api.php(460): rest_get_server()
5 …/wp-includes/class-wp-hook.php(341): rest_api_loaded(Object(WP))
6 …/wp-includes/class-wp-hook.php(365): WP_Hook->apply_filters(”, Array)
7 …/wp-includes/plugin.php(570): WP_Hook->do_action(Array)
8 …/wp-includes/class-wp.php(418): do_action_ref_array(‘parse_request’, Array)
9 …/wp-includes/class-wp.php(821): WP->parse_request(”)
10 …/wp-includes/functions.php(1343): WP->main(”)
11 …/wp-blog-header.php(16): wp()
12 …/index.php(17): require(‘/home/mattwmc/p…’)
13 {main}
thrown in …/wp-content/plugins/categories-images/categories-images.php on line 460
- This reply was modified 5 months, 1 week ago by mattwmc2001.
Forum: Plugins
In reply to: [Categories Images] Update breaks siteI uploaded the previous version and it works.
Update #3. Here’s the fix, which clears the homepage and post caches for destkop and mobile. I put it in functions.php:
function my_cf_purge_url( $url ) {
$zone_id = 'YOUR_ZONE_ID';
$api_token = 'YOUR_CF_API_TOKEN';
$endpoint = "https://api.cloudflare.com/client/v4/zones/$zone_id/purge_cache";
$body = [
'files' => [ $url ], // Desktop key
// Append the mobile-key header so CF purges that variant too
'files' => [
[ 'url' => $url, 'headers' => [ 'CF-Device-Type' => 'mobile' ] ],
[ 'url' => $url, 'headers' => [ 'CF-Device-Type' => 'desktop' ] ],
],
];
wp_remote_post( $endpoint, [
'headers' => [
'Authorization' => "Bearer $api_token",
'Content-Type' => 'application/json',
],
'body' => wp_json_encode( $body ),
'timeout' => 10,
] );
}
/* Purge post URL + homepage whenever a post is (re)published */
add_action( 'save_post', function ( $post_id, $post, $update ) {
/* skip autosaves / revisions */
if ( defined( 'DOING_AUTOSAVE' ) && DOING_AUTOSAVE ) return;
if ( wp_is_post_revision( $post_id ) ) return;
$url = get_permalink( $post_id );
my_cf_purge_url( $url ); // purge the post
my_cf_purge_url( home_url( '/' ) ); // purge homepage
}, 10, 3 );Update #2: With it set to Cache by device type, the mobile version cache isn’t cleared on purge. Have to ‘purge everything.’
Also ALL posts aren’t purged on updates/edit. Have to manually purge each url. Ran into this with APO. Frustrating.
- This reply was modified 10 months ago by mattwmc2001.
Update: I found the fix. I created a Cache Rule: (http.request.full_uri wildcard “*”) –> Cache Key –> Cache by device type
Version 2.5.4
Forum: Plugins
In reply to: [ShareThis Reaction Buttons] Minify JS and deferI think the issue is the script comes from a third party (you) via the plugin and doesn’t come with defer or is minified. Just look at the url code and you see the script isn’t minified.
- This reply was modified 1 year, 7 months ago by mattwmc2001.
Cool. Thanks.
- This reply was modified 1 year, 8 months ago by mattwmc2001.
Update: When using the avatar widget, when checked, this isn’t working right for me: “Enable Gravatar – Do you want to use Gravatar instead of the default plugin profile photo (If the user did not upload a custom profile photo/avatar)?”
User has uploaded a photo but it’s using Gravatar. When unchecked, it still doesn’t use user uploaded image, it uses UM default image.
It’s also providing this link ‘/author/username/’ which is redirecting to the front page.
Update: /author/username/ redirect was caused by Rank Math. However, profile image still isn’t showing.
Update #2: It’s showing the admin profile image and link in the header avatar widget. I seem to be having a theme issue. When switching from GeneratePress to Astra it works but only through Astra’s Avatar widget. Choosing Widget then Avatar it doesn’t work.
Update #3: It’s a GeneratePress issue. You need to add code in functions.php to get it to show the right profile pic:
if ( is_user_logged_in() ) { $current_user = wp_get_current_user(); if ( ($current_user instanceof WP_User) ) { $account_link = ‘ADD ACCOUNT LINK HERE’; echo ‘<a href=”‘ . $account_link . ‘” class=avatar-account-button>’ . get_avatar( $current_user->ID, 32 ) . ‘</a>’; } }
See here: https://generatepress.com/forums/topic/add-an-user-icon-next-to-the-hamburger-menu/
- This reply was modified 1 year, 8 months ago by mattwmc2001.
- This reply was modified 1 year, 8 months ago by mattwmc2001.
- This reply was modified 1 year, 8 months ago by mattwmc2001.
- This reply was modified 1 year, 8 months ago by mattwmc2001.
- This reply was modified 1 year, 8 months ago by mattwmc2001.
- This reply was modified 1 year, 8 months ago by mattwmc2001.
- This reply was modified 1 year, 8 months ago by mattwmc2001.
Forum: Plugins
In reply to: [Da Reactions] Remove toggle feature?Nevermind, I found it in Grapphic Settings –> Select a template for reactions.
- This reply was modified 1 year, 9 months ago by mattwmc2001.
As I said in the first post, Disable Developer Tools is set to no. It still shows.
Cleared caching (Flying press) and (cloudflare). Script is still here.
<script id="devtools-detect-js" defer data-src="//cosmicbook.news/modules/wp-hide-security-enhancer/assets/js/devtools-detect.js?ver=6.5.3"></script>Note: Disable Developer Tools is set to ‘no’
Thanks.
- This reply was modified 2 years ago by mattwmc2001.
<picture> tags aren’t showing up in source code and no next-gen images are being converted. I contacted support
Forum: Themes and Templates
In reply to: [Astra] Customizer Banner Area Changes Not WorkingYeah, it’s the live preview (Customizer), that no changes happen. When saving (just tried it), the settings work. Thanks!
Yes that is what I mean, that is before the content, not before the title. I managed to use the ‘heading position after’ setting and used some custom css to get it how I want. Thanks.