leoloso
Forum Replies Created
-
Forum: Fixing WordPress
In reply to: Excel editing pluginYou can generate a .csv file, which has a very simple format, saving all column values separated by comma, and rows as a new line. Excel can open .csv files, and if the users chooses to, save as .xls
Forum: Fixing WordPress
In reply to: Help required for assigning users to groupsYou can try any of these:
https://www.ads-software.com/plugins/user-access-manager/
https://www.ads-software.com/plugins/groups/Forum: Fixing WordPress
In reply to: Post revision history suddenly limited to the last fiveYou can set up how many post revisions you want in file wp-config.php, like this:
define('WP_POST_REVISIONS', 20);
You can see if just adding that line already works. If not, you may need to troubleshoot… You can search for “WP_POST_REVISIONS” in your code, to see if anyone (WP core, theme or plugin) is setting up that value by default, and if so possibly fix it there.
Yes, quite likely there is a misconfiguration in Apache, for which you need to check on Digital Ocean. Check here: https://stackoverflow.com/questions/18422140/apache-is-downloading-php-files-instead-of-displaying-them#18457702
Forum: Fixing WordPress
In reply to: How can I block a functtion from happening?Is the function yours? If so, you can wrap with
if (function_exists('NAME_OF_YOUR_FUNCTION')) {
and then implement the same function (make sure this function is included first), doing nothing:function NAME_OF_YOUR_FUNCTION() {}
Forum: Fixing WordPress
In reply to: Some visitors can’t commentIt may be a problem with the Apache, that it doesn’t recognize the .php extension so it tries to download the file instead. Check here: https://stackoverflow.com/questions/18422140/apache-is-downloading-php-files-instead-of-displaying-them#18457702
Forum: Fixing WordPress
In reply to: WP-admin for multiple domains/sites under one secured site?You may want to use Let’s Encrypt SSL Certificates (https://letsencrypt.org/), they are free and easy to install, then you can access securely all your domains without relying on site5.com. If all the websites you mention are all hosted in the same server, Let’s Encrypt supports to register multiple domains in one single certificate, so that is not a problem either.
Forum: Reviews
In reply to: [Bulk Move] Just what I neededoh sorry for that, only now I see my message got cut.
the issue is that I moved around 580 posts from one category to another, and the response of the server was, after some 30 seconds, a blank page. The server was so busy working on it, that it kept happening for some time: I’d refresh the url in the browser, and all I got was a blank page back from the server. Only maybe 1 or 2 minutes after I could access the Dashboard, however all posts had been moved correctly.
I may suggest that you allow to move posts in batches of, say, 100 posts at a time?
Cheers,
LeoForum: Plugins
In reply to: [qTranslate X] adding a hook on function qtranxf_use_blockHi John, thanks for your response.
#1. Yes, I do have that option enabled, I do want the alternate content, what I don’t want is the message “For the sake of viewer convenience, the content is shown below in the alternative language.” so it’s basically that that I need to override
#2. I think that instead of wp_kses_data you can not filter it and just escape it (so we can input html, like <a href=”…”), since it’s the admin from the back-end who’s entering this value anyway, while wp_kses_data is more for user-input values.
#3: I think that filter will do. However be aware with your standardization of the filter name, that you’re still passing custom arguments from your plugin (eg: $q_config), so in that sense I’m not sure there’s such a need to standardize it
And yep, I do not need $altlanguagecontent at all. My implementation with the hook I proposes is the following:
add_filter('qtransxf_use_block_altlang', 'my_qtransxf_use_block_altlang', 10, 4); function my_qtransxf_use_block_altlang($message, $q_config, $lang, $alt_content) { return sprintf( '<p class="text-warning bg-warning">%s</p><hr/>%s', sprintf( __('Ops, it seems this content is not available in <strong>%s</strong>. <a href="%s">Would you like to help us translate it?</a>', 'greendrinks'), $q_config['language_name'][$lang], get_permalink(CONTACTUS_PAGE_ID) ), $alt_content ); }
Thanks!
thanks, I appreciate your compliments ??
Dear David, sorry for the late update, but here my website using your plug-in to filter media by media type:
https://www.mesym.com/resources/
I will soon release the website code as open source.
Cheers!
Forum: Plugins
In reply to: [qTranslate] conflict javascriptHi powerflash, thanks for your hack, but now it breaks things when qTranslate is not enabled:
I have enabled it only for Pages, disabled it for posts with the following code:
add_action('admin_head', 'gd_qtrans_disable', 1); function gd_qtrans_disable() { global $pagenow; if (in_array($pagenow, array('post-new.php', 'post.php'))) { $qtrans_disable = apply_filters('qtrans_disable', false); if ($qtrans_disable) { remove_action('admin_head', 'qtrans_adminHeader'); remove_filter('admin_footer', 'qtrans_modifyExcerpt'); remove_filter('the_editor', 'qtrans_modifyRichEditor'); } } } add_filter('qtrans_disable', 'qtrans_disable_post'); function qtrans_disable_post($disable) { if (get_post_type() == 'post') return true; return $disable; }
Is there any way around it, so it doesn’t break this?
Thanks!
Awesome, thanks for your great help ?? I’ll keep you updated if everything went alright
Cheers!
Awesome, thanks! ??
Dear David,
hahahaa thanks for your positive feedback! Much appreciated ??
Ok, I must admit that I lied to you. I am not actually calling 4 times function mla_get_shortcode_attachments, but only once. The strategy that I was describing, to fetch only the IDs, I’m actually implementing it not for your plugin, but website-wide, in such a way that I do not execute separate queries anymore for all different components or sections. You can check mesym.com’s homepage, it has so many different pieces of data (Events, Articles, Announcements, etc), each of these executes its own query. Same to retrieve the data for each author of each post. This is an issue in terms of performance, since I’m bringing in the same data again and again (eg: 1 same author’s from different posts).
So I’m re-implementing the whole website using a thorough MVC approach: backend to produce and print data, handlebars templates in the frontend to merge the data into html.
So this way, in the back-end, I first retrieve all IDs for all data I will later need, and then at the very very end, in only 1 single query I fetch all required data using get_posts, then also 1 single query for get_users, etc. This way, I execute many small queries where I fetch only the needed IDs, and at the end I bring everything but only once, so authors’ data is brought just once, even if they have many posts.
And I promise, this is gonna be incredibly fast (I have the website under development, but any page loads in less than 2 sec, compared to the 5+ sec it needs now).
So the need to fetch IDs I also have it for mla_get_shortcode_attachments, since that is the general website framework it operates under.
In any case, I promise my website code is gonna be extremely exciting: since the backend only produces data, but not HTML, I have been able to fully build using ajax, so absolutely every single page can be loaded in no time: I preload all handlebar templates and then in each request only get the DB data, and nothing else (no more html loaded at all. It will be like GMail: load all the scripts at the beginning, and then never leave that one first page). No need to call wp_head() or wp_footer() or anything other than just querying for the needed data.
About the code, sure I can show it to you, but then please wait 2 weeks for my new website to be finished and live. And I don’t mind sharing it. Actually, it will be so awesome (I promise!) that I’ll put it in Github ??
Btw, I must admit that I hacked your plugin already, adding the ‘fields’ attr, and it works perfectly. But I didn’t tell you, because I don’t have the latest version, I’m using version 1.43, and I’ve seen the code has changed. Even my WP is just 3.6. I’ll update to latest versions of WP and all different plugins possibly after going live, because of timing issues (yes, I know the best is to first migrate all this and then work on top of that, but I started development of my new website 3 months ago, so WP newer versions will released during this time… that’s why I wait until the end, so I’ll get the latest one).
Cheers!