Sameer
Forum Replies Created
-
Forum: Plugins
In reply to: [Multisite Language Switcher] Child Posts are also linked with translationHi there,
I have found a solution and sharing it here, it might save someone else time.
Add the following to your functions.php
add_action( 'msls_main_save', 'my_msls_main_save', 1000, 2 ); function my_msls_main_save($object_id, $class){ $forbidden_post_types = array('array of post type(child) that you want to exclude'); if (in_array( get_post_type( $object_id ),$forbidden_post_types)) { return; } $blogs = MslsBlogCollection::instance(); $language = $blogs->get_current_blog()->get_language(); $msla = new MslsLanguageArray( my_get_input_array( $object_id ) ); $options = new $class( $object_id ); $temp = $options->get_arr(); if ( 0 != $msla->get_val( $language ) ) { $options->save( $msla->get_arr( $language ) ); } else { $options->delete(); } foreach ( $blogs->get() as $blog ) { switch_to_blog( $blog->userblog_id ); $language = $blog->get_language(); $larr_id = $msla->get_val( $language ); if ( 0 != $larr_id ) { $options = new $class( $larr_id ); $options->save( $msla->get_arr( $language ) ); } elseif ( isset( $temp[ $language ] ) ) { $options = new $class( $temp[ $language ] ); $options->delete(); } restore_current_blog(); } } my_get_input_array( $object_id ) { $arr = array(); $current_blog = MslsBlogCollection::instance()->get_current_blog(); if ( ! is_null( $current_blog ) ) { $arr[ $current_blog->get_language() ] = (int) $object_id; } $input_post = filter_input_array( INPUT_POST ); if ( is_array( $input_post ) ) { foreach ( $input_post as $key => $value ) { if ( false !== strpos( $key, 'msls_input_' ) && ! empty( $value ) ) { $arr[ substr( $key, 11 ) ] = (int) $value; } } } return $arr; }
Hope this will help
I have another plugin that requires to execute every minute regardless of blog traffic so it is configured to use external CRON scheduler.
As far as I understood Newsletter plugin utilized WordPress internal CRON scheduler which dependent on blog traffic?
The problem is if I disable the WordPress internal CRON by adding following in the config file
define('DISABLE_WP_CRON', true);
My plugin start working fine, but Newsletter plugin will stop working normally.
Now will you guide me if i want to shift Newsletter plugin to use external CRON scheduler
Forum: Plugins
In reply to: [Fast Secure Contact Form] Conditional notification recipientsHi,
Thanks for quick response. yes this is what exactly i am looking for.
However, I have following concern due to my custom requirement:1) It seems I cannot add comma (,) in select text e.g
Here you cannot add comma,[email protected];[email protected]
Is it possible to do so?
2) Is it possible to render this field as radio button instead of drop down? and also change its order among other fields?Thanks & regards
Forum: Plugins
In reply to: [Easy Image Gallery] Cannot read property 'frames' of undefinedHi there,
First of all i would like to say thanks for this excellent plugin, which indeed saved my several hours of development.Regarding to above problem, it seems if a post type does not include editor, then media file support does not available that’s causing error. Although, this plug-in working fine if editor is enable for that post type.
To solve this i have added following code in easy-image-gallery/metabox.php
function my_load_wp_media_files() { wp_enqueue_media(); } add_action( 'admin_enqueue_scripts', 'my_load_wp_media_files' );
That solved my problem, there must be better way to do this, just want to share with you guys
Thanks
Forum: Plugins
In reply to: [Easy Image Gallery] Cannot read property 'frames' of undefinedi am having the same problem, any solution please?
Further investigations shows the following findings
1. When emails/preview.php accessed via iframe by emails/new.php it creates a nounce along with the URL as follows
nounce created:33007|-1|1|asFegDFLNkF2BSupecI2LJORmkUGECCHRitIUMysMqn
, but on emails/preview.php verification failed and showed the following nounce
nounce verified:33007|-1|1|One can easily notice that the token part of nounce is missing. To sum up we can say ‘wp_verify_nonce()’ method has failed to get $token by calling wp_get_session_token() function in emails/preview.php.
Everything is working fine except the preview, event this is working on local server. We are keep digging the issue and hopefully we will track and share the information here.
We are not using any specific security plugin. We are using latest version of newsletter plug-in and WordPress in multi-site environment.
We will share the problem once we find the solution.
With debugging, We came to know its a function “check_admin_referer” in the script “emails/preview.php” is causing this error.
Further digging into code shows that “check_admin_referer” is calling “wp_verify_nonce” function that return false. In nutshell WordPress nounce is not verifying on live server.
Any idea ?
There is one additional information about live enviroment, we are running the WordPress CMS in SSL instead of https://. Did it cause that error?
We have deleted the extra records although we are unable to track the real culprit. We will keep an eye open and if there is any track of the problem found we will love to share here.
Thanks
Yes it, same site_id and following is the meta value
a:16:{s:22:”hide_advanced_settings”;b:1;s:16:”show_extra_icons”;b:0;s:11:”custom_menu”;N;s:18:”first_install_time”;i:1418230439;s:21:”display_survey_notice”;b:1;s:17:”plugin_db_version”;i:140;s:24:”security_logging_enabled”;b:0;s:17:”menu_config_scope”;s:6:”global”;s:13:”plugin_access”;s:11:”super_admin”;s:15:”allowed_user_id”;N;s:28:”plugins_page_allowed_user_id”;N;s:27:”show_deprecated_hide_button”;N;s:37:”dashboard_hiding_confirmation_enabled”;b:1;s:21:”submenu_icons_enabled”;s:9:”if_custom”;s:16:”ui_colour_scheme”;s:7:”classic”;s:23:”show_plugin_menu_notice”;b:0;}
right now, we are stuck, did not able to figure out what causing this problem.
We have using latest wordpress version with WP Supercache
Forum: Plugins
In reply to: [WP-Polls] How to prevent loading Javascript on every pageIt works, thank you.
Forum: Plugins
In reply to: [WP-Polls] How to prevent loading Javascript on every pageThanks for your reply.
Sorry for late reply, but don’t you think this will overwrite whenever a new version available for this plug-in.Thanks
Forum: Plugins
In reply to: [Cronjob Scheduler] Error when activating Cronjob SchedulerHi everyone
In order to solve the follow these steps:
1) Open file your-plugin-directory/cronjob-scheduler/cronjob-scheduler.php
2) Remove line number 295 i.e.$uniqid = array_keys($_POST['delete'])[0];
and paste following code
$uniqid = array_keys($_POST['delete']); if(isset($uniqid) && is_array($uniqid)){ $uniqid = $uniqid[0]; }
Remove line number 328 i.e.
$uniqid = array_keys($params)[0];
and paste following code
$uniqid = array_keys($params); if(isset($uniqid) && is_array($uniqid)){ $uniqid = $uniqid[0]; }
I hope it will help you guys.
ThanksForum: Plugins
In reply to: [Multisite Language Switcher] All relation seems resetHi Thanks for you help
I have write a piece of code which will sync the language linking if someone fall into the same problem
public function adjust_language_linking($source_lang='ar',$target_lang='us',$third_lang='fr_FR',$type="term",$limit=80){ global $wpdb; $blog_ids = array("us" => array('blog_id'=>1,'title'=>'English'), "ar" =>array('blog_id'=>2,'title'=>'Arabic'), "fr_FR"=>array('blog_id'=>3,'title'=>'French')); $search_type = array('post'=>'msls_','term'=>'msls_term_'); $target_blog_id = $blog_ids[$target_lang]["blog_id"]; $source_blog_id = $blog_ids[$source_lang]["blog_id"]; switch_to_blog( $source_blog_id ); $Sql = " SELECT * FROM ".$wpdb->prefix."options O WHERE 1 AND O.<code>option_name</code> LIKE '".$search_type[$type]."%' ORDER BY O.<code>option_id</code> ASC LIMIT 0,$limit "; $posts = $wpdb->get_results($Sql, ARRAY_A ); $counter = 0; $insert_query = array(); foreach ( (array) $posts as $post ) { $counter++; $source_id = $post["option_name"]; $source_id = str_replace($search_type[$type], '', $source_id); $options_value = unserialize($post["option_value"]); $insert = array(); if(is_numeric($source_id)){ echo $counter. "## Source [".$blog_ids[$source_lang]["title"]."] ID:".$source_id." Target [".$blog_ids[$target_lang]["title"]."] ID: ".@$options_value[$target_lang]." Third [".$blog_ids[$third_lang]["title"]."] ID:".@$options_value[$third_lang]."<br>"; if(isset($options_value[$target_lang]) && !empty($options_value[$target_lang])){ $insert["option_name"] = "msls_term_".$options_value[$target_lang]; $insert["option_value"][$source_lang] = $source_id; if(isset($options_value[$third_lang]) && !empty($options_value[$third_lang])){ $insert["option_value"][$third_lang] = $options_value[$third_lang]; } $insert_query[] = "('".$insert["option_name"]."','".serialize($insert["option_value"])."','no')"; } } } if(!empty($insert_query)){ switch_to_blog( $target_blog_id ); $Main_Query = "INSERT IGNORE INTO ".$wpdb->prefix."options (option_name,option_value,autoload) VALUES ".implode(',', $insert_query); } echo "<br><br><br>".$Main_Query; restore_current_blog(); }
May be it can help someone
Once again thanks.