goranpro
Forum Replies Created
-
I did some further testing. Maybe it has to do with the PHP version because if I move the site on the same server that runs on PHP 5.6.38 it works. But when i move the site to the server that runs on PHP 7.2.12 it is not working. I even tried to do some “echo” in the “mfrh_new_filename” filter and nothing is printed to the screen(on PHP 5.6 the string is prined near the image name by every image in Media Library).
- This reply was modified 6 years, 3 months ago by goranpro.
Hi,
this is a screenshot from my Media Library:
https://ibb.co/dtwjLVHi,
no, they are not locked (you cann see from the image).
I also tried to press the “Unlock All”. Still the same.
I also tried to manually lock an image and then unlock it (still no autorename option) by image.- This reply was modified 6 years, 3 months ago by goranpro.
Forum: Plugins
In reply to: [Media File Renamer: Rename for better SEO (AI-Powered)] Increase the speedOk, some more explanation….
I achieved this speed by:
1) Crating an index on “meta_value” column and then explicitely using it in SQL:
SELECT * FROM wp_postmeta USE INDEX (meta_value) WHERE….
2) And Removing the TRIM from SQL
= speed 0.0008 seconds…with index and without removing the TRIM speed: 1.8135 seconds.
So why is there a TRIM function in this SQL? …can I safely remove it?
Forum: Plugins
In reply to: [Media File Renamer: Rename for better SEO (AI-Powered)] Increase the speedHi,
I further debugged this and found out that if I remove the TRIM functions the SQL executes in 0.0008 seconds (compared to 10 seconds with TRIM)! Why is there a TRIM function in this SQL? …can I safely remove it?
- This reply was modified 6 years, 3 months ago by goranpro.
Hi,
sure you can but I think i found some erros in it.
First is that if I use the $old variable for seed (i was thinking that this is always the original file name but its not) the “Auto Rename” is still there. So I had to use the $new variable for seed and then the “Auto Rename” is gone from the Media Library after I run the bulk rename. (im still not sure what those variables hold)
And the second thing is that im not sure if the “dash” rule applies in general for Woocommerce or if it is unique for my setup of products…
Forum: Plugins
In reply to: [Media File Renamer: Rename for better SEO (AI-Powered)] Increase the speedHi,
did you maybe already had a time to look into this. This long processing times are killing me ??
Do you think I could just remove the “meta_key <> ‘_original_filename'” string from the update if my plan is to run only the bulk rename and only one time?
- This reply was modified 6 years, 3 months ago by goranpro.
Hi,
I made it realy simple taking the old filename and adding a hardcoded string to it. This is important to me because I want to be able to change this string to produce a different filename if needed. As I only need this for Woocommerce images that are formated in a way where the first part of the image name(seperated by dash) is a product/variable name, I only changed the second part of the filename.
add_filter( 'mfrh_new_filename', 'my_filter_filename', 10, 3 ); function my_filter_filename( $new, $old, $post ) { $dashCount = substr_count($old, "-"); if ($dashCount == 1){ $filenameArray = explode("-", $old); $firstPart = $filenameArray[0]; $hashSeed = $old."ABC"; //deterministic seed $randCharHash = substr(sha1($hashSeed),17,6); return $firstPart."-".$randCharHash; }else{ return $old; } }
Forum: Plugins
In reply to: [Media File Renamer: Rename for better SEO (AI-Powered)] Increase the speedHi,
I tried to debug this and found that the most problematic update that takes 10 seconds per image is:
UPDATE wp_postmeta SET meta_value = 'https://www.domain.com/de/wp-content/uploads/2018/06/10754-e5ac98-600x600.jpg' WHERE meta_key <> '_original_filename' AND (TRIM(meta_value) = 'https://www.domain.com/de/wp-content/uploads/2018/06/10754-0c3a60-600x600.jpg' OR TRIM(meta_value) = 'https://www.domain.com/de/wp-content/uploads/2018/06/10754-0c3a60-600x600.jpg' )
I wanted to know if the problem is the update or the select condition that is inside this update, so i wrote this update as select:
SELECT * FROM wp_postmeta WHERE meta_key <> '_original_filename' AND (TRIM(meta_value) = 'https://www.domain.com/de/wp-content/uploads/2018/06/10754-0c3a60-600x600.jpg' OR TRIM(meta_value) = 'https://www.domain.com/de/wp-content/uploads/2018/06/10754-0c3a60-600x600.jpg' )
The result is 10 seconds. So the problem is finding what to update, rather than updating.
Now i tried to remove the meta_key <> ‘_original_filename’ part. This made the select execute in 1 second (10x improvement). So i tried to write the select in a way where i moved this part into the HAVING at the end:
SELECT * FROM wp_postmeta WHERE (TRIM(meta_value) = 'https://www.domain.com/de/wp-content/uploads/2018/06/10754-0c3a60-600x600.jpg' OR TRIM(meta_value) = 'https://www.domain.com/de/wp-content/uploads/2018/06/10754-0c3a60-600x600.jpg' ) HAVING meta_key <> '_original_filename'
This code also executes in 1 second.
I dont know if this code is correct as all selects always return an empty recordset in my case and i dont know what this update is supposed to do. Can you please take a look?
- This reply was modified 6 years, 4 months ago by goranpro.
Forum: Plugins
In reply to: [WooCommerce] REST API get all productsThanks, could you please write the exact function that i should use? There are instructions on that link but im not skilled in this type od WP codding so im a bit lost.
Forum: Plugins
In reply to: [WordPress Popular Posts] Default Thumbnail Won’t UploadI have the same problem. Any news?
If you dont find a solution, could you make the plugin so that it takes the default thumbnail from the theme folder if its there, so that it wont be overriten when we update?Forum: Plugins
In reply to: [Theme My Login] Fix translation on action links and logout linkOk, i found the solution. I think its a BUG in code.
If anyone is interested, you can find it here:Forum: Plugins
In reply to: [Theme My Login] Fix translation on action links and logout linkHmm, any idea how to fix this? Im unable to translate.
Forum: Plugins
In reply to: [Theme My Login] Translating Theme My LoginI manually transtated and I have the same problem with “Register”, “Lost Password” not being translated.
Richpav, did you managed to solve the proglem?
I think that there should be clear instructions in FAQ about how to handle this with the most common cache plugins (WP Total/Cuper Cache). If there is somehow possible it would be best to disable the caching with DONOTCACHEPAGE like Donncha mentioned.
Im quite sure that there are a lot of people that are not aware of this problem and their client emails are not getting delivered. I use the plugin for purchase requests on one of our real estate stites (brunarice.org) and we lost a quite a bit in sales before one of our clients reported this(i took 1-2 months to realize this).