Forum Replies Created

Viewing 15 replies - 1 through 15 (of 21 total)
  • Plugin Author C. E.

    (@c-e-1)

    Well, that’s another problem. The code in the documentation

    CloudDeploy[APIFunction[{"x" -> "Integer"}, FactorInteger[#x] &], Permissions -> "Public"]

    should not trigger HTTP 500. It also should not show the login form, since it is public. This is a problem on the Wolfram Language side, not in the plugin. But that aside, it is also troubling that the HTTP request which the plugin obviously had to send to get the HTTP 500 response has not been registered in Core Control. This indicates that there is something strange going on with the requests. If I could reproduce it, I might be able to figure it out, but for now I don’t know how to reproduce it. Sorry. I will tell you if I think of something else that can be tested. Thank you for your help in debugging.

    • This reply was modified 8 years, 8 months ago by C. E..
    Plugin Author C. E.

    (@c-e-1)

    It sounds like you are having problems with the caching mechanism. That new requests are not being made for some reason. I just tried the caching mechanism, and it works for me though. i.e. if I set the expiration to 1, it will make a new request when I reload the page with the profile box on it.

    You could try the Wolfram Cloud shortcode, and see if that generates any HTTP requests. Note that it will only generate an HTTP request if image=”false” is specified, i.e. like in the second example in the documentation. This function does not use caching. If this function generates an HTTP request, then we know that the problem is in the caching for sure, because the mechanism by which it makes a request is the same as the StackExchange shortcode. If it doesn’t make a request – one request for each page reload – then there is something wrong with the mechanism by which it makes an HTTP request.

    Plugin Author C. E.

    (@c-e-1)

    Sorry for the delay, for some reason I was not notified of this post. So, when you tried this on your actual website you did not see any HTTP requests at all from Mathematica Toolbox, yet the shortcodes worked?

    One thing that I’ve noticed with this forum is that it (like WordPress) replaces “” with a stylized version. When you typed [mma_se_profile_box user_id=”731″ expiration=”1″], did you type it in yourself or did you copy it from here? It’s important that you wrote it yourself, otherwise it may not have any effect on the expiration of the cache at all at all.

    Plugin Author C. E.

    (@c-e-1)

    ok. Unfortunately, I cannot reproduce this problem on my local server. This makes it difficult to debug. What might be helpful is if you could install the following plugin: https://wordpress.org/plugins/core-control/

    After having installed it, go to the Tools -> Core Control page in the admin panel. Select “HTTP Access Logger Module” and press “Save Module Choices”. Then, at the top of the page right undernearth the title, there will be a link to “External HTTP Access Logger”. Go to that page and press “Enable HTTP Logging”. With HTTP logging enabled, visit the page that has the mma_se_profile_box or another SE shortcode in it. If you refresh the “External HTTP Access Logger” page in the admin panel, you should be able to see the requests to “api.stackexchange.com” in the list of requests. (One for each shortcode that’s had to make a request. Expiration of the cache matters here.) Click on one of them to show request details. What does it say? Things you could look at:

    • Result: Should be 200 OK
    • HTTP Transports: Might help debugging to know what this says. For me it’s WP_Http_Curl.
    • Response body (a button to the right of “Request details”): Does the body contain any error messages? If not, does it contain relevant data?
    • URL: If you copy the URL and open it in the browser, does it display relevant data? Or error messages? (Only useful if the request by WordPress did not work. If it does work, this should give the same response as “response body” in Core Control.)
    Plugin Author C. E.

    (@c-e-1)

    I use wp_remote_get to retrieve information from the Stack Exchange API, so if there were any problems that should also affect WordPress in general, not just this plugin.

    When trying things out, don’t forget to set a small expiration time. Use for example [mma_se_profile_box user_id=”731″ expiration=”1″]. Otherwise, you will have to wait for the cache to expire before you can notice any difference. When you change to a new expiration time, this will not be affected by previously cached values, so you will immediately prompt the plugin to make a new request to the Stack Exchange API.

    Please try this first, just to make sure the problem isn’t that the result of a bad request got cached.

    Plugin Author C. E.

    (@c-e-1)

    Sorry for the late reply, unfortunately the system did not notify me of the question. As I have stated in the documentation under Embedding CDFs > Possible issues, Google Chrome does not support the CDF player. You will have to use a different browser.

    Plugin Author C. E.

    (@c-e-1)

    I have reproduced the problem and concluded that it happens because of lines 118 to 120 in the current release of mathematica-toolbox/includes/Mathematica-WP-Toolbox-loader.php:

    remove_filter( 'the_content', 'wpautop' );
    		add_filter( 'the_content', 'wpautop' , 99);
    		add_filter( 'the_content', 'shortcode_unautop',100 );

    Specifically the first two lines, which change the priority of the wpautop filter. This is a commonly used trick to make sure that the wpautop filter does not affect text inside shortcodes, which in the case of Mathematica Toolbox is needed to prevent WordPress from messing with Wolfram Language code.

    Zotpress apparently rely on this filter to work inside shortcodes, that’s why it fails when it’s used in conjunction with Mathematica Toolbox. Since I need to use this trick I will not make any changes to the plugin, but if you want to you can remove the lines above, although it will probably also affect highlighting of Wolfram Language code.

    Perhaps Zotpress can do something about this. There is no need to rely on WordPress filters to format programmatically generated content they way they are.

    Plugin Author C. E.

    (@c-e-1)

    For someone like me who hasn’t used Zotpress before, what are the minimum steps, after installing the Zotpress plugin, to reproduce the problem?

    Plugin Author C. E.

    (@c-e-1)

    Great, I’m glad I could help 🙂

    Plugin Author C. E.

    (@c-e-1)

    1.0.4 is the update that is supposed to address this, did you try it?

    Plugin Author C. E.

    (@c-e-1)

    Now I see what’s going on. It’s not that the CDF is not working, it’s just that it’s hidden. Basically the CDF is placed within a container, and that container collapses to 0x0 pixels because of its surroundings. I will push an update to the repository later today where I make the container assert itself better. It will take a while because I first want to see if there is anything else I should include in the update, I don’t want to bother users with updates too often. There will also be some delay before you see in the admin panel that the update is available. Please get back to me when you have the update and tell me if it works.

    Plugin Author C. E.

    (@c-e-1)

    After upgrading to the latest version of the CDF player I actually find that your CDF works in both Safari and Firefox, as can be seen in this screenshot.. I’ve also double checked the HTML markup code that Mathematica Toolbox generates with the markup that’s used on Wolfram Demonstrations to embed CDFs and in all the important aspects the markups are identical.

    I’m just guessing wildly here but could it be a problem with permissions? Try Safari -> Preferences -> Security -> Plugins -> Wolfram Mathematica and see if your website appears in the list over websites where the plugin is allowed. Try the setting “Always allow” and see if that helps.

    Plugin Author C. E.

    (@c-e-1)

    Please do this for me as well: Try viewing your CDF that you included with Mathematica Toolbox in both Safari and Firefox and see how it goes, then try viewing CDFs on the Wolfram Demonstrations Project website in both Safari and Firefox, and report back to me where CDFs did work and in which browser.

    I’ve found that on my computer neither the Demonstrations Project nor Mathematica Toolbox CDFs work in Safari, but they all work in Firefox. That’s why this would be useful information. Formerly they all worked in both browsers.

    Plugin Author C. E.

    (@c-e-1)

    Is it still asking you to install the CDF or is it just blank?

    Plugin Author C. E.

    (@c-e-1)

    I have a strong feeling this has to be related to the server configuration, could you please install Health check and see if it warns you about something? I test the plugin using version 5.4.9 which is not too far off of what you are using. I would expect this error in PHP version < 5.3.3, but I don’t know what it means in versions newer than that.

Viewing 15 replies - 1 through 15 (of 21 total)