professor99
Forum Replies Created
-
Have already noted the ability to add shortcodes in posts from WPUF could be a problem for some and a bonus for others.
Perhaps an option to dissallow or allow some shortcodes via an inclusion list would be good.
It can be easily done by filtering the content just before it is submitted by wpuf_add_post.php:submit_post() and wpuf_edit_post:submit_post()
The current version of Frontend will be updated as is already happening here.
What is being considered is splitting the custom fields from this as the new PRO version makes this extremely configurable and easy to do but does this in a totally different way.
What we are finding is that most users just want a frontend replacement for the standard wordpress backend post creator and editor that is easy to use and configure. The dashboard and the user profile are quite good as they are. The ability to customize things to no end for these users just complicates things.
However some users want to customize everything. The PRO version addresses this.
Wasn’t aware of user-submitted-posts before this but it looks interesting. WPUF includes a few more options and the dashboard and user profile although there’s pros and cons for both depending on your application.
Both can done by editing the wpuf_add_post.php and wpuf_edit_post.php files appropriately
Note if you alter the code as above some things wont work properly for non-logged in users particularly in the official released version. The development version fixes a lot of these problems.
Newer frontend versions now being worked on include a Captcha for non logged in users.
As it stands this plugin only makes about 70 queries but that is not a ‘big’ value and is about 6ms worth of query time. That can be further reduced by about 50 queries if option data is cached as I show here.
The other queries are due to other plugins.
Try just ‘pdf’.
If this doesn’t work look at the plupload documentation
Don’t know whats going on here. I’m running WordPress 3.4.2 (where ‘Add Media’ button is titled ‘Upload/Insert’) and never had a problem with this in the official version or my development version.
Could it be a problem with WordPress 3.5.1 and your installation?
It should be displayed and work for admin by default.
Oh my gawd!!
Yes it’s TimeBusters Inc leaping into action!
With our powerful eXtrA-Ray technology we have managed to peel back the core of WordPress and WPUF to reveal the time machinations and have found this!
blank post 64 queries, pagetime= 0.282 seconds
dashboard 118 queries, pagetime= 0.358 seconds
add post 113 queries, pagetime= 0.320 second
edit post 122 queries, pagetime= 0.354 secondsOh no looks like were missing milliseconds here. Thief!!!Thief!!!
Ummmmm…Looks like there’s too many options and our thief has been taking his time picking thru them.
Time to lay a trap….
$wpuf_prepared_fields = ''; /** * Get the value of a settings field * * @param string $option option field name * @return mixed */ function wpuf_get_option( $option ) { global $wpuf_prepared_fields; if ( !empty( $wpuf_prepared_fields ) ) { $prepared_fields = $wpuf_prepared_fields; } else { $fields = wpuf_settings_fields(); $prepared_fields = array(); //prepare the array with the field as key //and set the section name on each field foreach ($fields as $section => $field) { foreach ($field as $fld) { $prepared_fields[$fld['name']] = $fld; $prepared_fields[$fld['name']]['section'] = $section; } } $wpuf_prepared_fields = $prepared_fields; } ......……Gotcha!!!
blank 54 queries(3.5ms), pagetime= 0.246 seconds
dashboard 72 queries(18.3ms), pagetime= 0.308 seconds
add post 54 queries(4.6ms), pagetime= 0.245 seconds
edit post 63 queries(5.5ms), pagetime= 0.257 secondsAhhh another case sucessfully solved by TimeBusters Inc.
Here at Timebusters we believe that time is money and at our special rate of $1000 per millisecond we believe we are a bargain. So we are sure you will find our total invoice for $50000 for your 50ms saving more than value for money.
PS James Gleick’s book ‘Faster: The Acceleration of Just About Everything’. It taken me 3 years to rid so far and I aint finished yet.
Just found a very similar problem with delete on the dashboard which hung if Relevenssi is activated.
Looked into this further and found that 100’s of copies of the deleted post were being created.
On tracing the code found that the Relevanssi function relevanssi_edit was being called continously via an action hook ‘save_post’ which is called from the wordpress wp_insert_post function (Used to move deleted articles to trash). This calls relevanssi_publish() which then calls relevanssi_index_doc().
The problem here is that the default action of relevanssi_index_doc is that it uses the global $post variable by default rather than the $indexpost passed to it if $post is defined. $post is the ID of the post in the loop. In this case this is the page with the dashboard shortcode. Further on in this function any shortcodes in the content of the post identified by the global $post (dashboard in this case) are expanded together with the original query (delete in this case) which then adds the article to trash again and then calls relevanssi and the process repeats ad-infinitum to the server breaks.
Turning the expansion of shortcodes off as Codynew does fixes this. Note I didn’t notice this with ‘edit’ as I had excluded these from the search via Relevanssi’s exclude option but this seems to not apply to deletes.
Obviously a Relevanssi code fix is preferable so other contents generated by shortcodes would be searchable. On further investigating the Relevanssi code I found a reference to a function relevanssi_insert_edit() called from the wp_insert_post action which strangely is always executed after the ‘save_post’ action in both the two wordpress functions it is called: wp_insert_post() and wp_publish_post(). relevanssi_insert_edit() than calls relevanssi_publish() which as mentioned above calls relevanssi_index_doc(). However a parameter of both these functions $bypassglobalpost is set to ‘true’ which disables the use of the global $post.
The description of the relevanssi_insert_edit() function is particularly interesting
// added by lumpysimon
// when we’re using wp_insert_post to update a post,
// we don’t want to use the global $post objectHmmmm. Why call these functions together when they mostly do the same thing? I hasten a guess that relevanssi_insert_edit() is the fix for our problem but they forgot to disable the old ‘save_post’ hook.
So what happens if I comment out the corresponding line in the relenvanssi file init.php as follows:
//add_action(‘save_post’, ‘relevanssi_edit’, 99, 1);
Presto!!! All fixed.
Haven’t noticed this. Also I note in another post you mentioned that it now works. Could you be getting local time and server time mixed up?.
Thanks gpspake for your input. Between you, me , and Tareq (and other contributors to this forum) WP User Frontend is undergoing huge development at this time.
Tareq and yourself are making huge gains in the “Multiple Forms” department.
Your work on custom taxonomies, expanding on Tareq’s work, looks promising as is your work on custom post types.
Also noticed your work on Adding Images and have contributed some thoughts. I’m unaware of the image bug you mention so I will look into that.
As to myself I’m about to release a new development version which adds the capability to add and edit ‘private’ posts (viewable to only logged in users) and to change the post status.
Both Tareq and me have been looking at allowing unlogged in users to add posts (with Captcha) and have progressed quite far in this area.
One of my concerns is that with the wealth of options now being added WP User Frontend is becoming overly complex for the basic user and we may need to split it into two to support effectively both user bases. One model could be having a basic version with standard fields that emulates the WordPress backend and an advanced version that has custom fields and multiple forms. Have mentioned the possibility of using a plugin model to extend Frontend for those who want more (and allowing others to contribute more effectively without affecting the Frontend base). Of course the many actions and filters already implemented in Frontend make this vastly simpler.
Your Thoughts?
The Professor
To gouffy41,
I’ve looked into the javascript code and the problems you were having when Charge for posting is active are unrelated to this bug. You may have your payment options incorrectly set resulting in an error and no return from the submit.
Have you tried this in the official version of Frontend? If it doesn’t work in the official version create a separate post heading as I have no experience with this area. Also grab Firefox Firebug logs as mentioned in previous posts which may identify what is wrong.
Probably your theme’s CSS or another plugin’s CSS overrided Frontend’s CSS. Try using Firefox with Firebug installed to see what is happening with the styling in the affected fields.
The new development version has tightened up the CSS a bit to lessen this but this is a two edged sword as it detracts from the theme.
Forum: Plugins
In reply to: [Relevanssi - A Better Search] Indexing shortcode content problemsHad a somewhat similar problem in that search matches were being returned for posts/pages that didn’t contain the search item. Found that the $post global variable was being changed by do_shortcode($contents) in indexing.php and the solution was to save and restore the $post variable before and after the do_shortcode function (exactly as Mikko Saari did above). Was about to report this separately before I discovered this post. The problem exists in both versions 3.1.3 and 3.1.4 and may be a problem in earlier versions.
Basically if you have pages that include excerpts for other posts such as archive and category lists this could be a big problem.
Note generally these are pages you should be excluding from your search as the content is in the original post though this may not be an option for main pages and the like which may contain actual content.
Cheers
TheProfessorWhy don’t you simply create a button that links to the page with the shortcode on it?