• Resolved cbruno33

    (@cbruno33)


    Hello!

    I can no longer edit any page that contains the JSON Content Importer plugin after updating to WP 4.4. It was working perfectly before updating to 4.4. I’using the plugin version 1.2.11

    Error when trying edit page:

    Something went wrong fetching URL with JSON-data: A valid URL was not provided.error: get of json-data failed – plugin aborted: check url of json-feed
    problems with JSON-structure: check basenode-param
    please open ticket at ww.wp.xz.cn

    Here’s an example of the shortcode used in my pages:

    [jsoncontentimporter url="[insert_php]echo do_shortcode('[global_variable variable_name="UNITJSONURL1"]');[/insert_php]" numberofdisplayeditems="5" urlgettimeout="500" basenode="property_unit"]
    <h2><b>{unit_name}</b> ~ {unit_brief_desc}</h2>
    [/jsoncontentimporter]

    Note that I’m using the insert_PHP plugin to access the JSON URL, which is defined in a global variable (using a global variables plugin). Both of these plugins are compatible with 4.4. To confirm this, a created a test page that uses insert_PHP shortcode to access the JSON URL (defined as a global variable).

    [insert_php]echo do_shortcode('[global_variable variable_name="UNITJSONURL1"]');[/insert_php]

    And the page displays the json url as expected:
    http://casabrava.net/art-test4/

    Thanks for the help. I previously donated because I love this plugin and will plan on making another contribution for your help with this.

    Cheers,
    Bruno

    https://ww.wp.xz.cn/plugins/json-content-importer/

Viewing 11 replies - 1 through 11 (of 11 total)
  • Plugin Author berkux

    (@berkux)

    Hi Bruno,

    I’ll check.
    Bernhard

    Plugin Author berkux

    (@berkux)

    1. Assuming the URL is created as you like, then URL would be
    http://casabrava.net/art-test4/
    But this is not a JSON-feed?

    2. I found the plugin for “insert_PHP”. But what plugin you use for “global_variable”?

    3. I don’t know why you did it this may. I guess this was to have da dynamic URL in the shortcode. This is one feature of the PRO-plugin:
    http://json-content-importer.com/documentation/simple-example-of-wordpress-shortcode/

    4. Are you able to edit the plugin code. To to this go to edit-plugin and select class-json-content-importer.php
    Wordpress shows you the sourcecode. Go to line 59 and insert
    echo “url: “. $url; exit;
    This will show you what URL the JSON-Plugin gets from the two other plugins…

    Thread Starter cbruno33

    (@cbruno33)

    Hi Bernhard,

    Thanks for looking at this. To answer your questions:

    1. The art-test4 page is just to show how the insert_php shortcode is successfully used to access the global variable containing the json url and display it on the page. The json file in this case is correctly displaying: http://casabrava.net/json/U1002.txt

    2. The custom global variables plugin is here:
    https://ww.wp.xz.cn/plugins/wp-global-variable/

    3. We use the global variables plugin to reference the json URL because when cloning a site, I want to avoid going into each page/module containing json importer code and manually updating the json URL everywhere it exists throughout the site. By referencing the global variable, I only need to change the json URL in a single place. This was working perfectly before.

    4. I edited the code and confirmed that the json importer is getting the correct URL. The site itself is working just fine. The problem is that when trying to edit the page in WP, I receive the error. See this screencast: http://www.screencast.com/t/wTVoPP5JJ9r

    Thanks again for the help. In light of #3, would a different solution in Pro work better for us?

    Thanks again,
    Bruno

    Thread Starter cbruno33

    (@cbruno33)

    Also, I’m not sure I fully understand the dynamic URL feature of Pro or whether or not it handles #3 above. My sites typically use 5 unique Jsons, each of which are used multiple times throughout the site, so I’d like to reference the URLs in a single file.

    For example:
    [jsoncontentimporter url=”[JsonURL2]” numberofdisplayeditems=”5″ urlgettimeout=”500″ basenode=”property_unit”] <h2><b>{unit_name}</b> ~ {unit_brief_desc}</h2> [/jsoncontentimporter]

    then in some file in some location, define the variables:
    JsonURL1 = http://mysite.net/json/U1002.json;
    JsonURL2 = http://mysite.net/json/U1089.json;
    JsonURL3 = http://mysite.net/json/U1088.json;

    If the Pro version does this already, or if you can enhance it to do this, then I’ll definitely purchase it.

    Thanks again,
    Bruno

    Plugin Author berkux

    (@berkux)

    Maybe the reason are linefeeds in
    [jsoncontentimporter url=”…” numberofdisplayeditems=”5″ urlgettimeout=”500″ basenode=”property_unit”]

    Is there a line break after the url-param? If so my WordPress gives me the error you see. Why is that? I don’t know yet, as this is a WordPress-Standard…

    Plus: Is your WordPress-Texteditor set to “Text”? Not Visual…

    Plugin Author berkux

    (@berkux)

    Screencast: Stange – when trying to edit a wordpress page the shortcode should not be executed.

    Does this happen with deactivated plugin too?

    The PRO-version does not solve this strange problem.
    But it would make things easy, I think. With the PRO-verison you can store a template (URL, basenote, HTML…) and insert it on a page by [jsoncontentimporter id=”1″], where 1 is the number of the template…

    Thread Starter cbruno33

    (@cbruno33)

    Hi Bernhard,

    Thanks for the reply. I’m using text mode. When I deactivate the plugin, I’m able to get into edit mode just fine! But let’s forget about the ‘edit mode’ issue. When I create a new page and use the same shordcode, I AM able to get into WP edit mode.

    However, the shortcode that uses insert_php and global variable no longer works as it used to. Here’s a screen screencast that may help:

    http://www.screencast.com/t/ybTAP5PyzZ

    I love the template function of Pro, but I don’t think it solves my problem.

    For example: Let’s say I use 5 unique json URLS throughout 20 templates in a site. I then clone the site and need to update the 5 unique json URLs. Won’t I still nee to update 20 templates with the new URLs? With the URL global variable solution, I only need to update each unique URL once.

    Let me know if you think Pro still solves my problem.

    Thanks again,
    Bruno

    Plugin Author berkux

    (@berkux)

    Hi Bruno,

    if the way with global_variable and insert_php works, you’re fine. The pro-version solves this in amother way, but at the end the result is the same: Changing the datasource at one place. If you also want to change the template for html-output this also can be done in both ways.

    I installed the two plugins and my plugin on a WordPress 4.4 installation. And this still works.
    Can you try the code without the Divi-Builder?

    BTW: How did you record the screencast? This looks good…

    Thanks
    Bernhard

    Thread Starter cbruno33

    (@cbruno33)

    Hi Bernhard,

    Thanks for the reply. We’ll try it again without the divi builder. We’ll also try using Pro instead and will follow-up if we run into issues trying to figure it out. To avoid future compatibility issues, I’d really rather use only your plugin for this.

    For the screencast, I use Snagit by Techsmith: https://www.techsmith.com/snagit.html

    I’ve used it for years and don’t know what I’d do without it 🙂

    Thanks again and happy holidays!
    Bruno

    Thread Starter cbruno33

    (@cbruno33)

    Hi Bernhard,

    I sent you a message via your plugin web page regarding purchase of the pro version. Just making sure you received that message.

    Cheers,
    Bruno

    Plugin Author berkux

    (@berkux)

    Hi Bruno,

    I got it. See your mail…

    Cheers
    Bernhard

Viewing 11 replies - 1 through 11 (of 11 total)

The topic ‘Critical error editing page containing plugin’ is closed to new replies.