intarwebsdeveloper
Forum Replies Created
-
There is no access log at the exact time, but there is one a minute or less before it:
168.62.248.37 – – [25/May/2021:14:39:19 -0400] “GET /?nocache=2021-05-25T18:39:19.7636577Z HTTP/1.1” 301 0 “-” “azure-logic-apps/1.0 (workflow 5883055c00de484ca65e51bb8d9f50ea; version 08585868827675929780)”
The IP lookup for 168.62.248.37 says it’s Microsoft Azure.
@missveronicatv Yes, also searched all child theme php files. I also searched the database to see if it was used anywhere by a code snippets plugin. It is only being used by the UM plugin on the website.
- This reply was modified 2 years, 10 months ago by intarwebsdeveloper. Reason: wrong handle
Since the error trigged when the function remove_dir() was called in class-files.php on line 1199, there can only be so many different times this function is called. I searched all the plugin files and found the function in these files:
uninstall.php
class-admin.php
class-admin-theme-updater.php
2.0.24/functions.php
class-user.phpIt looks like remove_dir() happens when these things happen:
– when the plugin is uninstalled; removes entire ‘ultimatemember’ directory inside of ‘uploads’
– when the purge_temp() function is called; removes a ‘temp’ directory
– when the default UM templates are restored to theme directory
– when the UM version was updated to 2.0.24; removes a ‘temp’ directory`
– when a user is deleted; removes a ‘temp’ directory and removes the deleted user’s directory that’s inside the ‘ultimatemember’ directorySomething caused one of these files to call the remove_dir() function to attempt to delete the uploads/ultimatemember/ directory and failed. Then somehow the uploads/ultimatemember/ directory ended up empty. The only thing left inside uploads/ultimatemember/ was a ‘temp’ directory.
The error log makes it pretty obvious that Ultimate Member is the one deleting the user directories and files.
Hi @champsupertramp, the version of UM is at 2.1.20.
Why would something be attempting to delete/remove the entire ‘ultimatemember’ directory from the server?
Thanks
Forum: Plugins
In reply to: [Manage Notification E-mails] Version 1.7.1 not available?Looks like the download issue was on my end. I rebooted and I am able to download 1.7.1 now. Thanks!
Forum: Plugins
In reply to: [Force First and Last Name as Display Name] Latest version 1.2 has issuesForgot to mention exactly how the names are messed up – The Display names in 1.1 kept the spaces in between the names in the first and last name. e.g. First name = Bob, Last name = Schmob, in 1.1 Display name is Bob Schmob. In 1.2 Display name is BobSchmob, the space is gone.
- This reply was modified 3 years ago by intarwebsdeveloper. Reason: typo
@champsupertramp Thanks for pointing that out. I’ll get that corrected and see if that fixes the issue.
Here’s one email notification that checks the string length of the current fields meta value. If the updated field has more or less, then the notification should fire.
function csc_custom_email_notifications_company_desc( $notifications ){ $notifications['user_updated_company_desc'] = array( 'key' => 'user_updated_company_desc', 'title' => __( 'A Supplier has updated their Company Description','um-groups' ), 'subject' => 'A Supplier has updated their Company Description ', 'body' => '', 'description' => __('Sends an email if a Supplier has updated their Company Description','ultimate-member'), 'recipient' => 'admin', 'default_active' => true ); return $notifications; } add_filter( 'um_email_notifications', 'csc_custom_email_notifications_company_desc', 10, 1 );
add_action('um_after_user_updated','csc_notify_when_user_updates_company_desc',10, 3); function csc_notify_when_user_updates_company_desc( $meta_key,$user, $args ){ // logged in member $user_id = $user->ID; um_fetch_user( $user_id ); $recipient = 'admin@website.tld'; $profile_name = um_user('member_contact_2'); // viewed member profile $profilepage_id = um_profile_id(); um_fetch_user($profilepage_id); $stock_number_value = um_user('stock_no'); // check stock meta value, if has s, get users that match stock value and get these users' meta data if (stripos($stock_number_value, 's') !== false) { $args = array( 'meta_key' => 'stock_no', 'meta_value' => $stock_number_value, 'role' => 'um_supplier', ); $users = get_users( $args ); if ($users) { foreach ( $users as $user ) { $member_id = $user->ID; $member_name = $user->first_name; $company_info = $user->company_info; } } } $member_profile_url = home_url( '/' ).'user/'.$member_id.'/'; // if current meta key data has more or less string length, send email if( strlen($meta_key) < strlen($company_info) || strlen($meta_key) > strlen($company_info) ) { UM()->mail()->send( $recipient, 'user_updated_company_desc', array( 'plain_text' => 1, 'tags' => array( '{profile_name}', '{company_info}', '{member_name}', '{member_profile_url}', ), 'tags_replace' => array( $profile_name, $company_info, $member_name, $member_profile_url, ) ) ); } }
Then here’s another function that checks a different meta key value:
function um_custom_email_notifications_cnn_news( $notifications ){ $notifications['user_updated_cnn_news'] = array( 'key' => 'user_updated_cnn_news', 'title' => __( 'A User has updated News settings','um-groups' ), 'subject' => '', 'body' => '', 'description' => __('Sends an email if the News settings are updated','ultimate-member'), 'recipient' => 'admin', 'default_active' => true ); return $notifications; } add_filter( 'um_email_notifications', 'um_custom_email_notifications_cnn_news', 10, 1 );
add_action('um_after_user_updated','csc_notify_when_user_updates_cnn_news',10, 3); function csc_notify_when_user_updates_cnn_news( $metakey, $user ){ $user_id = $user->ID; um_fetch_user( $user_id ); $recipient = 'admin@website.tld'; // get meta keys $profile_name = um_user('member_contact_2'); $list_uncc_text = um_user('list_uncc_text'); if( $metakey != $list_uncc_text ) { // get first_name meta value of viewed profile $profilepage_id = um_profile_id(); um_fetch_user($profilepage_id); $stock_number_value = um_user('stock_no'); if (stripos($stock_number_value, 's') !== false) { $args = array( 'meta_key' => 'stock_no', 'meta_value' => $stock_number_value, 'role' => 'um_supplier', ); $users = get_users( $args ); if ($users) { foreach ( $users as $user ) { $member_id = $user->ID; $member_name = $user->first_name; } } } $member_profile_url = home_url( '/' ).'user/'.$member_id.'/'; UM()->mail()->send( $recipient, 'user_updated_cnn_news', array( 'plain_text' => 1, 'tags' => array( '{profile_name}', '{member_name}', ), 'tags_replace' => array( $profile_name, $member_name, ) ) ); } }
So when all this code is together. If I were to update only one of targeted meta keys in the profile, I get both email notifications for the meta keys even if I only updated one of them.
- This reply was modified 3 years, 1 month ago by intarwebsdeveloper.
Is the user page you are trying to access assigned to be the UM User page? This is assigned in the Ultimate Member – Settings page – https://pathwayequityresearch.com/wp-admin/admin.php?page=um_options
The sign in page and other Ultimate Member pages are assigned here. Did you set these up already?
I just checked that page and I can’t access it. It says “Sorry, but you do not have permission to view this content.” so it looks like the plugin is working now.
I think I was able to fix up your code snippet so it’s working a little better now. I added additional clauses, one for if ‘is_featured’ is set to 0 and another clause for newly registered members that have not made any changes to their profile yet. Then I made it so all the members appear alphabetically after the featured/pinned members. Here’s the updated code:
<?php add_filter('um_prepare_user_query_args', 'um_custom_prepare_user_query_args', 999999); function um_custom_prepare_user_query_args($args) { $args['meta_query'][ ] = array( 'relation' => 'OR', 'featured_clause' => array( 'key' => 'is_featured', 'value' => '1', 'compare' => '=' ), 'regular_clause' => array( 'key' => 'is_featured', 'value' => '0', 'compare' => '=' ), 'newb_clause' => array( 'key' => 'is_featured', 'compare' => 'NOT EXISTS' ) ); $args['orderby'] = array( 'newb_clause' => 'DESC', 'regular_clause' => 'DESC', 'featured_clause' => 'ASC', 'display_name' ); return $args; }?>
I understand about it not working with the custom table setting turned on. I hope it gets added as a feature soon.
I tried out the original code you posted that works with the normal usermeta table settings and I noticed a bug. While the code does change the sorting of the query, something unexpected happens if you change the value of ‘is_featured” meta key from 1 back to nothing or any value other than 1 – the member stops appearing in the search query. Changing the value back of ‘is_featured’ back to 1 doesn’t fix the issue and the member still doesn’t appear in the search query.
- This reply was modified 3 years, 1 month ago by intarwebsdeveloper.
- This reply was modified 3 years, 1 month ago by intarwebsdeveloper.
This code snippet worked for me. Thanks!
Thanks, I’ll try this out.
Hello @champsupertramp
I did try using the Admin filter and it’s not working the way I need it to. When I choose the City field, it makes me choose a City in order to add the filter. And then the Search will ony query that specific City, which is incorrect. I need the search to only query the City field and (an additional user meta field if possible) instead of searching all the user fields of the profile.
Thanks