Images not working

Closed

Import WP Pro Updated 5 months ago 41 Replies

Jean asked 8 months ago on May 31, 2024 at 9:25 pm

Hi I am using for Custom Posts Pro version your pluggin and looks it works fine for the fields however for the images it doesnt work. It just work for the featured image but not for the rest of images.

I am using in a essential real estate wordpress pluggin and the property listings have multiple images. But your program cannot insert the image url links…

Any idea what I can do???

J

James replied Support Agent

8 months ago on June 1, 2024 at 7:41 am

Hi Jean,

What have you tried so far to import the rest of the images? 

What i would recommend is creating an example listing, with all the fields populated that you would like to import, then using the custom field view via the "find custom fields" button on the template tab of the importer you are using, select the previously created listing, and look through the custom fields for the one that matches the rest of images.

Then you need to create a custom field of type attachment, and select the return type that matches the value found in the custom field viewer.

If you need help with this, can you attach a screenshot of the custom field view results.

Thanks
James

JL

Jean replied privately

8 months ago on June 1, 2024 at 2:05 pm

JL

Jean replied privately

8 months ago on June 1, 2024 at 2:44 pm

J

James replied privately Support Agent

8 months ago on June 1, 2024 at 8:24 pm

JL

Jean replied privately

8 months ago on June 1, 2024 at 10:11 pm

J

James replied Support Agent

8 months ago on June 1, 2024 at 10:20 pm

In your previous reply, the post id: 472 , was this the example record or a record where you had tried to import? as it has some iwp_ meta fields, can you share the example property that you created in the wp-admin that has a gallery populated without any import?

Are you also able to share the plugin that  you use for the properties, this way i can see what all the data is needed to populate the gallery

JL

Jean replied privately

8 months ago on June 1, 2024 at 10:31 pm

JL

Jean replied

8 months ago on June 2, 2024 at 12:20 am

I found the issue. the uploaded images generate an id .... 

so the :

custom_fields.real_estate_property_images  gives the list of the images IDs :  156|42|41|40|37

and not the image URLs...

little disapointed with the essential real estate plugin and how handles information...

I am trying to check how I can solve this

 

 

 

 

 

JL

Jean replied

8 months ago on June 2, 2024 at 2:30 pm

Proble is quite comple because a preuploading of the images is necessary. I would need to generate a unique id for the images and those be uploaded in parallel to the gallery.

If you have any eperience or idea regarding handling of pictures would be appreciated.

my goal is to use the property images stored in google drive

 

J

James replied privately Support Agent

8 months ago on June 3, 2024 at 8:44 pm

JL

Jean replied privately

8 months ago on June 4, 2024 at 3:04 pm

JL

Jean replied

7 months ago on June 16, 2024 at 2:49 am

Hi James,

So I have the following situation.

I want to host the pictures exterally and display them in wordpress so after trying different options everything is linked to the built in wordpress media library in order to make work sliders carrousels etc...etc...

I found a solution with a pluggin called EXMAGE that works wonderfully : 

https://wordpress.org/plugins/exmage-wp-image-links/

the problem now is that I cannot make your app to insert the images links and return the ids as this app do not download and host images internally but makes those links manageable and visible in media library to insert them in any WP contentt.

 

 

 

 

 

 

J

James replied Support Agent

7 months ago on June 16, 2024 at 8:52 pm

Hi Jean,

I have not heard/worked with this plugin before, it suggests that you need to not treat it as an attachment field, and instead as a custom field, but will require some custom code to work.

However i am currently not able to look into this further until i am back in the office after the 24th of june.

James

 

JL

Jean replied

7 months ago on June 17, 2024 at 1:56 pm

Hi James , Thank you for your response. You got it, its exactly what you are saying. The media from the URL shouldn't be dowloaded but instead inserted through the EXMAGE plugin that allows to manipulate externally hosted images on the WordPress site media library. I need the ID of the EXMAGE plugin externally hosted images url link to be returned in order to insert it on the property posts and be displayed on the sites galleries and slideshows. If you can help me with this I will wait for you to return back the 24th. Thank you so much. On Sun, Jun 16, 2024, 15:52 Import WP Helpdesk < support@helpdesk.importwp.com> wrote: >
J

James replied Support Agent

7 months ago on June 22, 2024 at 9:43 pm

Hi Jean,

I have created a custom method that you can use for the custom field "real_estate_property_images" , by switching the custom field type from attachment to text, and adding the custom function to your website

function iwp_eximage($input = '', $input_del = ',', $output_del = '|')
{
    if (!class_exists('\EXMAGE_WP_IMAGE_LINKS')) {
        return '';
    }

    if (is_null(iwp()->importer)) {
        return $input;
    }

    $data = explode($input_del, $input);
    $data = array_values(array_map('trim', $data));

    if (empty($data)) {
        return;
    }

    $output = [];
    foreach ($data as $url) {
        if (empty($url)) {
            continue;
        }

        $image_data = \EXMAGE_WP_IMAGE_LINKS::add_image($url, $image_id);

        if (isset($image_data['id']) && intval($image_data['id']) > 0 && !in_array($image_data['id'], $output)) {
            $output[] = $image_data['id'];
        }
    }

    return implode($output_del, $output);
}

I have added this function as a custom plugin which is attached, and you can use it for example if your previous custom field value was:

{8},{8},{8}

 Then when you switch the custom field type to text, you would change it to (screenshot attached showing before a the top, and after at the bottom): 

[iwp_eximage("{8},{8},{8}", ",", "|")]

James

J

James replied Support Agent

6 months ago on July 16, 2024 at 8:00 pm

Hello Jean

This ticket is being marked as closed due to inactivity.

If this is not the case, please reply to this ticket to re-open it.

James

JL

Jean replied privately

6 months ago on August 5, 2024 at 1:56 am

J

James replied Support Agent

6 months ago on August 5, 2024 at 8:04 pm

Hi Jean,

The | were used due to your original message showing that the fave_property_images meta was saved with joining | (https://helpdesk.importwp.com/ticket/130431f4-82a9-433d-9b2e-254221722cd5/#reply-2627).

I have updated and attached the custom plugin, please remove the old custom field you have setup in your importer, and overwrite and activate this plugin.

A new option should be added to the custom field dropdown list, labelled "Fave - Property Images", select this option and set the value to the list of images you want to import.

Once imported this will create a new meta value for each image using the EXMAGE plugin.

James

J

James replied Support Agent

6 months ago on August 5, 2024 at 8:09 pm

I forgot to mention this plugin requires the latest ImportWP v2.14.1 and ImportWP Pro v2.11.0

JL

Jean replied privately

6 months ago on August 6, 2024 at 12:43 am

J

James replied Support Agent

6 months ago on August 6, 2024 at 8:32 am

Dont use the iwp_eximage method, just use {18} as the value, this function is built into the previously attached plugin and not needed.

JL

Jean replied privately

6 months ago on August 6, 2024 at 1:58 pm

JL

Jean replied privately

6 months ago on August 6, 2024 at 2:10 pm

J

James replied Support Agent

6 months ago on August 6, 2024 at 2:21 pm

I have just tested on a fresh install with the custom plugin, eximage plugin, and importer plugins and the attachments were linked to from the media gallery instead of being imported.

Screenshots attached shown the importer setup, list of plugns, and media gallery after importing an image from placehold.it e.g. https://placehold.co/100x101.png

If this is not working for you can you please share a temporary login to your website so i can see your setup.

Can you also please export and attach your importer settings to this ticket by going to Tools > Import WP > Settings / Tools > Import / Export and select and export your importer as a JSON file.

 

JL

Jean replied privately

6 months ago on August 6, 2024 at 2:52 pm

J

James replied Support Agent

6 months ago on August 6, 2024 at 2:54 pm

When testing with a single image it did take some time, it is using the built in eximage functions to processes this, i am guessing that the plugin does fetch the image/attachment to get the information about it, and then it is removed.

Glad its now working

JL

Jean replied privately

6 months ago on August 6, 2024 at 5:43 pm

J

James replied Support Agent

5 months ago on August 10, 2024 at 9:24 pm

Hi Jean,

I am always happy to help, I have updated the plugin and attached, not sure what was your issue.

A new field has been added called "FAVE - Thumbnail ID", and the first image will be set to the featured image of the post type.

James

JL

Jean replied privately

5 months ago on August 28, 2024 at 4:52 am

J

James replied Support Agent

5 months ago on August 29, 2024 at 12:20 pm

Sorry jean,  i am not familier with the EXMAGE plugin, and the best way i found to work with it was how it currently is, not sure about the background process if it is using it or not.

James

JL

Jean replied privately

5 months ago on August 30, 2024 at 2:24 pm

JL

Jean replied privately

5 months ago on August 31, 2024 at 3:00 pm

J

James replied Support Agent

5 months ago on September 2, 2024 at 8:36 pm

I have modified the existing custom to use the new plugin instead of the eximage code, if you re-run the old importer with the same custom fields it should work. this is untested code as i am unable to use that github plugin due to it relying on getimagesize to fetch the width and height of a remote image.

James

JL

Jean replied privately

5 months ago on September 3, 2024 at 4:38 pm

JL

Jean replied privately

5 months ago on September 3, 2024 at 5:11 pm

JL

Jean replied privately

5 months ago on September 3, 2024 at 5:18 pm

J

James replied Support Agent

5 months ago on September 3, 2024 at 6:34 pm

The previously updated plugin is using the new plugin you have linked to, i can install it but it does not work for me as the function that fetches the image data does not work.

JL

Jean replied

5 months ago on September 3, 2024 at 10:03 pm

I don't understand very well what you are meaning. But its possible to test manually the plugin from the media menu. after activating the plugin it appears as the attached imaged and you can insert the files.

JL

Jean replied

5 months ago on September 3, 2024 at 10:27 pm

the importer is working its uploading the images from the new plugin, but for some reason its still taking a lot of time.

the fetching error comes with the coma ,  if you use a line break the import is done successfuly in less than 5 seconds. please see attachments

J

James replied Support Agent

5 months ago on September 4, 2024 at 8:10 pm

OK, thanks for confirming that the importer is working with the new external-media-without-import plugin.

James

JL

Jean replied privately

5 months ago on September 5, 2024 at 3:02 am