Quiz And Survey Master (Formerly Quiz Master Next) - Version 5.0.2

Version Description

(May 7, 2017) = * Closed Bug: Social sharing text not updating when user changes the text (Issue #541)

Download this release

Release Info

Developer fpcorso
Plugin Icon 128x128 Quiz And Survey Master (Formerly Quiz Master Next)
Version 5.0.2
Comparing to
See all releases

Code changes from version 5.0.1 to 5.0.2

mlw_quizmaster2.php CHANGED
@@ -2,7 +2,7 @@
2
  /**
3
  * Plugin Name: Quiz And Survey Master
4
  * Description: Easily and quickly add quizzes and surveys to your website.
5
- * Version: 5.0.1
6
  * Author: Frank Corso
7
  * Author URI: http://www.quizandsurveymaster.com/
8
  * Plugin URI: http://www.quizandsurveymaster.com/
@@ -10,7 +10,7 @@
10
  * Domain Path: /languages
11
  *
12
  * @author Frank Corso
13
- * @version 5.0.1
14
  */
15
  if ( ! defined( 'ABSPATH' ) ) exit;
16
 
@@ -30,7 +30,7 @@ class MLWQuizMasterNext {
30
  * @var string
31
  * @since 4.0.0
32
  */
33
- public $version = '5.0.1';
34
 
35
  /**
36
  * QMN Alert Manager Object
2
  /**
3
  * Plugin Name: Quiz And Survey Master
4
  * Description: Easily and quickly add quizzes and surveys to your website.
5
+ * Version: 5.0.2
6
  * Author: Frank Corso
7
  * Author URI: http://www.quizandsurveymaster.com/
8
  * Plugin URI: http://www.quizandsurveymaster.com/
10
  * Domain Path: /languages
11
  *
12
  * @author Frank Corso
13
+ * @version 5.0.2
14
  */
15
  if ( ! defined( 'ABSPATH' ) ) exit;
16
 
30
  * @var string
31
  * @since 4.0.0
32
  */
33
+ public $version = '5.0.2';
34
 
35
  /**
36
  * QMN Alert Manager Object
php/about-page.php CHANGED
@@ -70,9 +70,9 @@ function mlw_generate_about_page() {
70
  </div>
71
  <div class="qsm-tab-content tab-2" style="display: none;">
72
  <h2>Changelog</h2>
73
- <?php QSM_Changelog_Generator::get_changelog_list( 'fpcorso/quiz_master_next', 19 ); ?>
74
-
75
  <?php QSM_Changelog_Generator::get_changelog_list( 'fpcorso/quiz_master_next', 26 ); ?>
 
76
  </div>
77
  <div class="qsm-tab-content tab-3" style="display:none;">
78
  <h2>GitHub Contributors</h2>
70
  </div>
71
  <div class="qsm-tab-content tab-2" style="display: none;">
72
  <h2>Changelog</h2>
73
+ <?php QSM_Changelog_Generator::get_changelog_list( 'fpcorso/quiz_master_next', 33 ); ?>
 
74
  <?php QSM_Changelog_Generator::get_changelog_list( 'fpcorso/quiz_master_next', 26 ); ?>
75
+ <?php QSM_Changelog_Generator::get_changelog_list( 'fpcorso/quiz_master_next', 19 ); ?>
76
  </div>
77
  <div class="qsm-tab-content tab-3" style="display:none;">
78
  <h2>GitHub Contributors</h2>
php/class-qmn-tracking.php CHANGED
@@ -87,7 +87,7 @@ class QMNTracking {
87
  * @return void
88
  */
89
  private function send_data() {
90
- $response = wp_remote_post( 'http://quizandsurveymaster.com/?usage_track=confirmation', array(
91
  'method' => 'POST',
92
  'timeout' => 45,
93
  'redirection' => 5,
87
  * @return void
88
  */
89
  private function send_data() {
90
+ $response = wp_remote_post( 'https://data.quizandsurveymaster.com/?usage_track=confirmation', array(
91
  'method' => 'POST',
92
  'timeout' => 45,
93
  'redirection' => 5,
php/help-page.php CHANGED
@@ -7,19 +7,17 @@ if ( ! defined( 'ABSPATH' ) ) exit;
7
  * @return void
8
  * @since 4.4.0
9
  */
10
- function mlw_generate_help_page()
11
- {
12
- if ( !current_user_can('moderate_comments') )
13
- {
14
  return;
15
  }
16
 
17
- wp_enqueue_style( 'qmn_admin_style', plugins_url( '../css/qsm-admin.css' , __FILE__ ) );
18
 
19
  ///Creates the widgets
20
- add_meta_box("wpss_mrts", __('Need Help?', 'quiz-master-next'), "qmn_documentation_meta_box_content", "meta_box_help");
21
- add_meta_box("wpss_mrts", __('Support', 'quiz-master-next'), "qmn_support_meta_box_content", "meta_box_support");
22
- add_meta_box("wpss_mrts", __('System Info', 'quiz-master-next'), "qmn_system_meta_box_content", "meta_box_sys_info");
23
  ?>
24
  <div class="wrap">
25
  <h2><?php _e('Help Page', 'quiz-master-next'); ?></h2>
@@ -49,16 +47,12 @@ function mlw_generate_help_page()
49
  * @return void
50
  * @since 4.4.0
51
  */
52
- function qmn_documentation_meta_box_content()
53
- {
54
  ?>
55
  <p><?php _e('Need help with the plugin? Try any of the following:', 'quiz-master-next'); ?></p>
56
  <ul>
57
- <li>To report a bug, issue, or make a feature request, please create an issue in our <a href="https://github.com/fpcorso/quiz_master_next/issues">Github Issue Tracker</a></li>
58
  <li>For assistance in using the plugin, read our <a href="http://quizandsurveymaster.com/documentation/?utm_source=qsm-help-page&utm_medium=plugin&utm_campaign=qsm_plugin&utm_content=documentation" target="_blank">documentation</a> or view videos in our <a href="http://quizandsurveymaster.com/online-academy/?utm_source=qsm-help-page&utm_medium=plugin&utm_campaign=qsm_plugin&utm_content=online_academy" target="_blank">online academy</a></li>
59
- <li>For support, fill out the form in the Support widget to send us an email</li>
60
- <li>For support, fill out the form on our <a href="http://quizandsurveymaster.com/contact-us/?utm_source=qsm-help-page&utm_medium=plugin&utm_campaign=qsm_plugin&utm_content=contact_us" target="_blank">Contact Us Page</a></li>
61
- <li>For support, create a topic in the <a href="https://wordpress.org/support/plugin/quiz-master-next">WordPress Support Forums</a></li>
62
  </ul>
63
  <?php
64
  }
@@ -69,8 +63,7 @@ function qmn_documentation_meta_box_content()
69
  * @return void
70
  * @since 4.4.0
71
  */
72
- function qmn_support_meta_box_content()
73
- {
74
  $quiz_master_email_message = "";
75
  $mlw_quiz_version = get_option('mlw_quiz_master_version');
76
  if ( isset( $_POST["support_email"] ) && wp_verify_nonce( $_POST['send_support_ticket_nonce'], 'send_support_ticket') )
@@ -84,7 +77,7 @@ function qmn_support_meta_box_content()
84
  $quiz_master_email_message = "Invalid email address";
85
  } else {
86
  $current_user = wp_get_current_user();
87
- $mlw_site_info = qmn_get_system_info();
88
  $mlw_message = "$user_message<br> Version: $mlw_quiz_version<br> Quiz URL Provided: $user_quiz_url<br> User ".$current_user->display_name." from ".$current_user->user_email."<br> Wordpress Info: $mlw_site_info";
89
  $response = wp_remote_post( "http://quizandsurveymaster.com/contact-us/", array(
90
  'method' => 'POST',
@@ -175,95 +168,93 @@ function qmn_support_meta_box_content()
175
  * @return void
176
  * @since 4.4.0
177
  */
178
- function qmn_system_meta_box_content()
179
- {
180
- echo qmn_get_system_info();
181
  }
182
 
183
  /**
184
  * This function gets the content that is in the system info
185
  *
186
- * @return return $qmn_sys_info This variable contains all of the system info from the admins server.
187
  * @since 4.4.0
188
  */
189
- function qmn_get_system_info()
190
- {
191
  global $wpdb;
192
  global $mlwQuizMasterNext;
193
 
194
- $qmn_sys_info = "";
195
 
196
  $theme_data = wp_get_theme();
197
  $theme = $theme_data->Name . ' ' . $theme_data->Version;
198
 
199
- $qmn_sys_info .= "<h3>Site Information</h3><br />";
200
- $qmn_sys_info .= "Site URL: ".site_url()."<br />";
201
- $qmn_sys_info .= "Home URL: ".home_url()."<br />";
202
- $qmn_sys_info .= "Multisite: ".( is_multisite() ? 'Yes' : 'No' )."<br />";
203
 
204
- $qmn_sys_info .= "<h3>WordPress Information</h3><br />";
205
- $qmn_sys_info .= "Version: ".get_bloginfo( 'version' )."<br />";
206
- $qmn_sys_info .= "Language: ".( defined( 'WPLANG' ) && WPLANG ? WPLANG : 'en_US' )."<br />";
207
- $qmn_sys_info .= "Active Theme: ".$theme."<br />";
208
- $qmn_sys_info .= "Debug Mode: ".( defined( 'WP_DEBUG' ) ? WP_DEBUG ? 'Enabled' : 'Disabled' : 'Not set' )."<br />";
209
- $qmn_sys_info .= "Memory Limit: ".WP_MEMORY_LIMIT."<br />";
210
 
211
- $qmn_sys_info .= "<h3>Plugins Information</h3><br />";
212
- $qmn_plugin_mu = get_mu_plugins();
213
- if( count( $qmn_plugin_mu > 0 ) ) {
214
- $qmn_sys_info .= "<h4>Must Use</h4><br />";
215
- foreach( $qmn_plugin_mu as $plugin => $plugin_data ) {
216
- $qmn_sys_info .= $plugin_data['Name'] . ': ' . $plugin_data['Version'] . "<br />";
217
  }
218
  }
219
- $qmn_sys_info .= "<h4>Active</h4><br />";
220
  $plugins = get_plugins();
221
  $active_plugins = get_option( 'active_plugins', array() );
222
  foreach( $plugins as $plugin_path => $plugin ) {
223
  if( !in_array( $plugin_path, $active_plugins ) )
224
  continue;
225
- $qmn_sys_info .= $plugin['Name'] . ': ' . $plugin['Version'] . "<br />";
226
  }
227
- $qmn_sys_info .= "<h4>Inactive</h4><br />";
228
  foreach( $plugins as $plugin_path => $plugin ) {
229
  if( in_array( $plugin_path, $active_plugins ) )
230
  continue;
231
- $qmn_sys_info .= $plugin['Name'] . ': ' . $plugin['Version'] . "<br />";
232
  }
233
 
234
- $qmn_sys_info .= "<h3>Server Information</h3><br />";
235
- $qmn_sys_info .= "PHP : ".PHP_VERSION."<br />";
236
- $qmn_sys_info .= "MySQL : ".$wpdb->db_version()."<br />";
237
- $qmn_sys_info .= "Webserver : ".$_SERVER['SERVER_SOFTWARE']."<br />";
238
 
239
  $mlw_stat_total_quiz = $wpdb->get_var( "SELECT COUNT(*) FROM ".$wpdb->prefix."mlw_quizzes LIMIT 1" );
240
  $mlw_stat_total_active_quiz = $wpdb->get_var( "SELECT COUNT(*) FROM ".$wpdb->prefix."mlw_quizzes WHERE deleted=0 LIMIT 1" );
241
  $mlw_stat_total_questions = $wpdb->get_var( "SELECT COUNT(*) FROM ".$wpdb->prefix."mlw_questions LIMIT 1" );
242
  $mlw_stat_total_active_questions = $wpdb->get_var( "SELECT COUNT(*) FROM ".$wpdb->prefix."mlw_questions WHERE deleted=0 LIMIT 1" );
243
- $qmn_total_results = $wpdb->get_var( "SELECT COUNT(*) FROM ".$wpdb->prefix."mlw_results LIMIT 1" );
244
- $qmn_total_active_results = $wpdb->get_var( "SELECT COUNT(*) FROM ".$wpdb->prefix."mlw_results WHERE deleted=0 LIMIT 1" );
245
 
246
- $qmn_sys_info .= "<h3>QMN Information</h3><br />";
247
- $qmn_sys_info .= "Initial Version : ".get_option('qmn_original_version')."<br />";
248
- $qmn_sys_info .= "Current Version : ".$mlwQuizMasterNext->version."<br />";
249
- $qmn_sys_info .= "Total Quizzes : ".$mlw_stat_total_quiz."<br />";
250
- $qmn_sys_info .= "Total Active Quizzes : ".$mlw_stat_total_active_quiz."<br />";
251
- $qmn_sys_info .= "Total Questions : ".$mlw_stat_total_questions."<br />";
252
- $qmn_sys_info .= "Total Active Questions : ".$mlw_stat_total_active_questions."<br />";
253
- $qmn_sys_info .= "Total Results : ".$qmn_total_results."<br />";
254
- $qmn_sys_info .= "Total Active Results : ".$qmn_total_active_results."<br />";
255
 
256
- $qmn_sys_info .= "<h3>QMN Recent Logs</h3><br />";
257
  $recent_errors = $mlwQuizMasterNext->log_manager->get_logs();
258
  if ( $recent_errors ) {
259
  foreach( $recent_errors as $error ) {
260
- $qmn_sys_info .= "Log created at ". $error->post_date . " : " . $error->post_title . " - " . $error->post_content . "<br />";
261
  }
262
  } else {
263
- $qmn_sys_info .= "No recent logs<br />";
264
  }
265
 
266
- return $qmn_sys_info;
267
  }
268
 
269
  ?>
7
  * @return void
8
  * @since 4.4.0
9
  */
10
+ function mlw_generate_help_page() {
11
+ if ( !current_user_can('moderate_comments') ) {
 
 
12
  return;
13
  }
14
 
15
+ wp_enqueue_style( 'qsm_admin_style', plugins_url( '../css/qsm-admin.css' , __FILE__ ) );
16
 
17
  ///Creates the widgets
18
+ add_meta_box("wpss_mrts", __('Need Help?', 'quiz-master-next'), "qsm_documentation_meta_box_content", "meta_box_help");
19
+ add_meta_box("wpss_mrts", __('Support', 'quiz-master-next'), "qsm_support_meta_box_content", "meta_box_support");
20
+ add_meta_box("wpss_mrts", __('System Info', 'quiz-master-next'), "qsm_system_meta_box_content", "meta_box_sys_info");
21
  ?>
22
  <div class="wrap">
23
  <h2><?php _e('Help Page', 'quiz-master-next'); ?></h2>
47
  * @return void
48
  * @since 4.4.0
49
  */
50
+ function qsm_documentation_meta_box_content() {
 
51
  ?>
52
  <p><?php _e('Need help with the plugin? Try any of the following:', 'quiz-master-next'); ?></p>
53
  <ul>
 
54
  <li>For assistance in using the plugin, read our <a href="http://quizandsurveymaster.com/documentation/?utm_source=qsm-help-page&utm_medium=plugin&utm_campaign=qsm_plugin&utm_content=documentation" target="_blank">documentation</a> or view videos in our <a href="http://quizandsurveymaster.com/online-academy/?utm_source=qsm-help-page&utm_medium=plugin&utm_campaign=qsm_plugin&utm_content=online_academy" target="_blank">online academy</a></li>
55
+ <li>For support, fill out the form in the Support widget to send us an email or fill out the form on our <a href="http://quizandsurveymaster.com/contact-us/?utm_source=qsm-help-page&utm_medium=plugin&utm_campaign=qsm_plugin&utm_content=contact_us" target="_blank">Contact Us Page</a></li>
 
 
56
  </ul>
57
  <?php
58
  }
63
  * @return void
64
  * @since 4.4.0
65
  */
66
+ function qsm_support_meta_box_content() {
 
67
  $quiz_master_email_message = "";
68
  $mlw_quiz_version = get_option('mlw_quiz_master_version');
69
  if ( isset( $_POST["support_email"] ) && wp_verify_nonce( $_POST['send_support_ticket_nonce'], 'send_support_ticket') )
77
  $quiz_master_email_message = "Invalid email address";
78
  } else {
79
  $current_user = wp_get_current_user();
80
+ $mlw_site_info = qsm_get_system_info();
81
  $mlw_message = "$user_message<br> Version: $mlw_quiz_version<br> Quiz URL Provided: $user_quiz_url<br> User ".$current_user->display_name." from ".$current_user->user_email."<br> Wordpress Info: $mlw_site_info";
82
  $response = wp_remote_post( "http://quizandsurveymaster.com/contact-us/", array(
83
  'method' => 'POST',
168
  * @return void
169
  * @since 4.4.0
170
  */
171
+ function qsm_system_meta_box_content() {
172
+ echo qsm_get_system_info();
 
173
  }
174
 
175
  /**
176
  * This function gets the content that is in the system info
177
  *
178
+ * @return return string This contains all of the system info from the admins server.
179
  * @since 4.4.0
180
  */
181
+ function qsm_get_system_info() {
 
182
  global $wpdb;
183
  global $mlwQuizMasterNext;
184
 
185
+ $sys_info = "";
186
 
187
  $theme_data = wp_get_theme();
188
  $theme = $theme_data->Name . ' ' . $theme_data->Version;
189
 
190
+ $sys_info .= "<h3>Site Information</h3><br />";
191
+ $sys_info .= "Site URL: ".site_url()."<br />";
192
+ $sys_info .= "Home URL: ".home_url()."<br />";
193
+ $sys_info .= "Multisite: ".( is_multisite() ? 'Yes' : 'No' )."<br />";
194
 
195
+ $sys_info .= "<h3>WordPress Information</h3><br />";
196
+ $sys_info .= "Version: ".get_bloginfo( 'version' )."<br />";
197
+ $sys_info .= "Language: ".( defined( 'WPLANG' ) && WPLANG ? WPLANG : 'en_US' )."<br />";
198
+ $sys_info .= "Active Theme: ".$theme."<br />";
199
+ $sys_info .= "Debug Mode: ".( defined( 'WP_DEBUG' ) ? WP_DEBUG ? 'Enabled' : 'Disabled' : 'Not set' )."<br />";
200
+ $sys_info .= "Memory Limit: ".WP_MEMORY_LIMIT."<br />";
201
 
202
+ $sys_info .= "<h3>Plugins Information</h3><br />";
203
+ $plugin_mu = get_mu_plugins();
204
+ if( count( $plugin_mu > 0 ) ) {
205
+ $sys_info .= "<h4>Must Use</h4><br />";
206
+ foreach( $plugin_mu as $plugin => $plugin_data ) {
207
+ $sys_info .= $plugin_data['Name'] . ': ' . $plugin_data['Version'] . "<br />";
208
  }
209
  }
210
+ $sys_info .= "<h4>Active</h4><br />";
211
  $plugins = get_plugins();
212
  $active_plugins = get_option( 'active_plugins', array() );
213
  foreach( $plugins as $plugin_path => $plugin ) {
214
  if( !in_array( $plugin_path, $active_plugins ) )
215
  continue;
216
+ $sys_info .= $plugin['Name'] . ': ' . $plugin['Version'] . "<br />";
217
  }
218
+ $sys_info .= "<h4>Inactive</h4><br />";
219
  foreach( $plugins as $plugin_path => $plugin ) {
220
  if( in_array( $plugin_path, $active_plugins ) )
221
  continue;
222
+ $sys_info .= $plugin['Name'] . ': ' . $plugin['Version'] . "<br />";
223
  }
224
 
225
+ $sys_info .= "<h3>Server Information</h3><br />";
226
+ $sys_info .= "PHP : ".PHP_VERSION."<br />";
227
+ $sys_info .= "MySQL : ".$wpdb->db_version()."<br />";
228
+ $sys_info .= "Webserver : ".$_SERVER['SERVER_SOFTWARE']."<br />";
229
 
230
  $mlw_stat_total_quiz = $wpdb->get_var( "SELECT COUNT(*) FROM ".$wpdb->prefix."mlw_quizzes LIMIT 1" );
231
  $mlw_stat_total_active_quiz = $wpdb->get_var( "SELECT COUNT(*) FROM ".$wpdb->prefix."mlw_quizzes WHERE deleted=0 LIMIT 1" );
232
  $mlw_stat_total_questions = $wpdb->get_var( "SELECT COUNT(*) FROM ".$wpdb->prefix."mlw_questions LIMIT 1" );
233
  $mlw_stat_total_active_questions = $wpdb->get_var( "SELECT COUNT(*) FROM ".$wpdb->prefix."mlw_questions WHERE deleted=0 LIMIT 1" );
234
+ $total_results = $wpdb->get_var( "SELECT COUNT(*) FROM ".$wpdb->prefix."mlw_results LIMIT 1" );
235
+ $total_active_results = $wpdb->get_var( "SELECT COUNT(*) FROM ".$wpdb->prefix."mlw_results WHERE deleted=0 LIMIT 1" );
236
 
237
+ $sys_info .= "<h3>QSM Information</h3><br />";
238
+ $sys_info .= "Initial Version : ".get_option('qmn_original_version')."<br />";
239
+ $sys_info .= "Current Version : ".$mlwQuizMasterNext->version."<br />";
240
+ $sys_info .= "Total Quizzes : ".$mlw_stat_total_quiz."<br />";
241
+ $sys_info .= "Total Active Quizzes : ".$mlw_stat_total_active_quiz."<br />";
242
+ $sys_info .= "Total Questions : ".$mlw_stat_total_questions."<br />";
243
+ $sys_info .= "Total Active Questions : ".$mlw_stat_total_active_questions."<br />";
244
+ $sys_info .= "Total Results : ".$total_results."<br />";
245
+ $sys_info .= "Total Active Results : ".$total_active_results."<br />";
246
 
247
+ $sys_info .= "<h3>QSM Recent Logs</h3><br />";
248
  $recent_errors = $mlwQuizMasterNext->log_manager->get_logs();
249
  if ( $recent_errors ) {
250
  foreach( $recent_errors as $error ) {
251
+ $sys_info .= "Log created at ". $error->post_date . " : " . $error->post_title . " - " . $error->post_content . "<br />";
252
  }
253
  } else {
254
+ $sys_info .= "No recent logs<br />";
255
  }
256
 
257
+ return $sys_info;
258
  }
259
 
260
  ?>
php/question-types.php CHANGED
@@ -40,7 +40,7 @@ function qmn_multiple_choice_display($id, $question, $answers)
40
  if ($answer[0] != "")
41
  {
42
  $question_display .= "<div class='qmn_mc_answer_wrap' id='question".$id."-".esc_attr($answer[0])."'>";
43
- $question_display .= "<input type='radio' class='qmn_quiz_radio' name='question".$id."' id='question".$id."_".$mlw_answer_total."' value='".esc_attr($answer[0])."' /> <label for='question".$id."_".$mlw_answer_total."'>".htmlspecialchars_decode($answer[0], ENT_QUOTES)."</label>";
44
  $question_display .= "</div>";
45
  }
46
  }
40
  if ($answer[0] != "")
41
  {
42
  $question_display .= "<div class='qmn_mc_answer_wrap' id='question".$id."-".esc_attr($answer[0])."'>";
43
+ $question_display .= "<input type='radio' class='qmn_quiz_radio' name='question".$id."' id='question".$id."_".$mlw_answer_total."' value='".htmlentities(esc_attr($answer[0]))."' /> <label for='question".$id."_".$mlw_answer_total."'>".htmlspecialchars_decode($answer[0], ENT_QUOTES)."</label>";
44
  $question_display .= "</div>";
45
  }
46
  }
php/template-variables.php CHANGED
@@ -55,78 +55,52 @@ add_filter('mlw_qmn_template_variable_results_page', 'mlw_qmn_variable_timer',10
55
  add_filter('mlw_qmn_template_variable_results_page', 'mlw_qmn_variable_timer_minutes',10,2);
56
  add_filter('mlw_qmn_template_variable_results_page', 'mlw_qmn_variable_date',10,2);
57
  add_filter('mlw_qmn_template_variable_results_page', 'mlw_qmn_variable_date_taken',10,2);
58
- add_filter('mlw_qmn_template_variable_results_page', 'qmn_variable_facebook_share',10,2);
59
- add_filter('mlw_qmn_template_variable_results_page', 'qmn_variable_twitter_share',10,2);
60
 
61
  add_filter('mlw_qmn_template_variable_quiz_page', 'mlw_qmn_variable_quiz_name',10,2);
62
  add_filter('mlw_qmn_template_variable_quiz_page', 'mlw_qmn_variable_date',10,2);
63
  add_filter('mlw_qmn_template_variable_quiz_page', 'mlw_qmn_variable_current_user',10,2);
64
 
65
- function qmn_variable_facebook_share($content, $mlw_quiz_array)
66
- {
67
- while (strpos($content, '%FACEBOOK_SHARE%') !== false)
68
- {
 
69
  wp_enqueue_script( 'qmn_quiz_social_share', plugins_url( '../js/qmn_social_share.js' , __FILE__ ) );
70
  $settings = (array) get_option( 'qmn-settings' );
71
  $facebook_app_id = '483815031724529';
72
- if (isset($settings['facebook_app_id']))
73
- {
74
  $facebook_app_id = esc_js( $settings['facebook_app_id'] );
75
  }
76
 
77
- global $wpdb;
78
- $qmn_quiz_options = $wpdb->get_row($wpdb->prepare('SELECT social_media_text FROM '.$wpdb->prefix.'mlw_quizzes WHERE quiz_id=%d AND deleted=0', $mlw_quiz_array['quiz_id']));
79
-
80
- //Load Social Media Text
81
- $qmn_social_media_text = "";
82
- if (is_serialized($qmn_quiz_options->social_media_text) && is_array(@unserialize($qmn_quiz_options->social_media_text)))
83
- {
84
- $qmn_social_media_text = @unserialize($qmn_quiz_options->social_media_text);
85
- }
86
- else
87
- {
88
- $qmn_social_media_text = array(
89
- 'twitter' => $qmn_quiz_options->social_media_text,
90
- 'facebook' => $qmn_quiz_options->social_media_text
91
- );
92
- }
93
 
94
- $qmn_social_media_text["facebook"] = apply_filters( 'mlw_qmn_template_variable_results_page', $qmn_social_media_text["facebook"], $mlw_quiz_array);
95
- $social_display = "<a class=\"mlw_qmn_quiz_link\" onclick=\"qmnSocialShare('facebook', '".esc_js($qmn_social_media_text["facebook"])."', '".esc_js($mlw_quiz_array["quiz_name"])."', '$facebook_app_id');\">Facebook</a>";
96
  $content = str_replace( "%FACEBOOK_SHARE%" , $social_display, $content);
97
  }
98
  return $content;
99
  }
100
 
101
- function qmn_variable_twitter_share($content, $mlw_quiz_array)
102
- {
103
- while (strpos($content, '%TWITTER_SHARE%') !== false)
104
- {
 
105
  wp_enqueue_script( 'qmn_quiz_social_share', plugins_url( '../js/qmn_social_share.js' , __FILE__ ) );
106
 
107
- global $wpdb;
108
- $qmn_quiz_options = $wpdb->get_row($wpdb->prepare('SELECT social_media_text FROM '.$wpdb->prefix.'mlw_quizzes WHERE quiz_id=%d AND deleted=0', $mlw_quiz_array['quiz_id']));
109
-
110
- //Load Social Media Text
111
- $qmn_social_media_text = "";
112
- if (is_serialized($qmn_quiz_options->social_media_text) && is_array(@unserialize($qmn_quiz_options->social_media_text)))
113
- {
114
- $qmn_social_media_text = @unserialize($qmn_quiz_options->social_media_text);
115
- }
116
- else
117
- {
118
- $qmn_social_media_text = array(
119
- 'twitter' => $qmn_quiz_options->social_media_text,
120
- 'facebook' => $qmn_quiz_options->social_media_text
121
- );
122
- }
123
 
124
- $qmn_social_media_text["twitter"] = apply_filters( 'mlw_qmn_template_variable_results_page', $qmn_social_media_text["twitter"], $mlw_quiz_array);
125
- $social_display = "<a class=\"mlw_qmn_quiz_link\" onclick=\"qmnSocialShare('twitter', '".esc_js($qmn_social_media_text["twitter"])."', '".esc_js($mlw_quiz_array["quiz_name"])."');\">Twitter</a>";
126
  $content = str_replace( "%TWITTER_SHARE%" , $social_display, $content);
127
  }
128
  return $content;
129
  }
 
130
  function mlw_qmn_variable_point_score($content, $mlw_quiz_array)
131
  {
132
  $content = str_replace( "%POINT_SCORE%" , $mlw_quiz_array["total_points"], $content);
55
  add_filter('mlw_qmn_template_variable_results_page', 'mlw_qmn_variable_timer_minutes',10,2);
56
  add_filter('mlw_qmn_template_variable_results_page', 'mlw_qmn_variable_date',10,2);
57
  add_filter('mlw_qmn_template_variable_results_page', 'mlw_qmn_variable_date_taken',10,2);
58
+ add_filter('mlw_qmn_template_variable_results_page', 'qsm_variable_facebook_share',10,2);
59
+ add_filter('mlw_qmn_template_variable_results_page', 'qsm_variable_twitter_share',10,2);
60
 
61
  add_filter('mlw_qmn_template_variable_quiz_page', 'mlw_qmn_variable_quiz_name',10,2);
62
  add_filter('mlw_qmn_template_variable_quiz_page', 'mlw_qmn_variable_date',10,2);
63
  add_filter('mlw_qmn_template_variable_quiz_page', 'mlw_qmn_variable_current_user',10,2);
64
 
65
+ /**
66
+ * Adds Facebook sharing link using the %FACEBOOK_SHARE% variable
67
+ */
68
+ function qsm_variable_facebook_share( $content, $mlw_quiz_array ) {
69
+ while ( false !== strpos($content, '%FACEBOOK_SHARE%') ) {
70
  wp_enqueue_script( 'qmn_quiz_social_share', plugins_url( '../js/qmn_social_share.js' , __FILE__ ) );
71
  $settings = (array) get_option( 'qmn-settings' );
72
  $facebook_app_id = '483815031724529';
73
+ if ( isset( $settings['facebook_app_id'] ) ) {
 
74
  $facebook_app_id = esc_js( $settings['facebook_app_id'] );
75
  }
76
 
77
+ global $mlwQuizMasterNext;
78
+ $sharing = $mlwQuizMasterNext->pluginHelper->get_section_setting( 'quiz_text', 'facebook_sharing_text', '' );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
79
 
80
+ $sharing = apply_filters( 'mlw_qmn_template_variable_results_page', $sharing, $mlw_quiz_array);
81
+ $social_display = "<a class=\"mlw_qmn_quiz_link\" onclick=\"qmnSocialShare('facebook', '".esc_js( $sharing )."', '".esc_js($mlw_quiz_array["quiz_name"])."', '$facebook_app_id');\">Facebook</a>";
82
  $content = str_replace( "%FACEBOOK_SHARE%" , $social_display, $content);
83
  }
84
  return $content;
85
  }
86
 
87
+ /**
88
+ * Adds Twitter sharing link using the %TWITTER_SHARE% variable
89
+ */
90
+ function qsm_variable_twitter_share( $content, $mlw_quiz_array ) {
91
+ while ( false !== strpos($content, '%TWITTER_SHARE%') ) {
92
  wp_enqueue_script( 'qmn_quiz_social_share', plugins_url( '../js/qmn_social_share.js' , __FILE__ ) );
93
 
94
+ global $mlwQuizMasterNext;
95
+ $sharing = $mlwQuizMasterNext->pluginHelper->get_section_setting( 'quiz_text', 'twitter_sharing_text', '' );
96
+ $sharing = apply_filters( 'mlw_qmn_template_variable_results_page', $sharing, $mlw_quiz_array);
 
 
 
 
 
 
 
 
 
 
 
 
 
97
 
98
+ $social_display = "<a class=\"mlw_qmn_quiz_link\" onclick=\"qmnSocialShare('twitter', '".esc_js( $sharing )."', '".esc_js($mlw_quiz_array["quiz_name"])."');\">Twitter</a>";
 
99
  $content = str_replace( "%TWITTER_SHARE%" , $social_display, $content);
100
  }
101
  return $content;
102
  }
103
+
104
  function mlw_qmn_variable_point_score($content, $mlw_quiz_array)
105
  {
106
  $content = str_replace( "%POINT_SCORE%" , $mlw_quiz_array["total_points"], $content);
readme.txt CHANGED
@@ -4,7 +4,7 @@ Donate link: http://mylocalwebstop.com/downloads/donation-service-payment/
4
  Tags: quiz, survey, lead, test, score, exam, questionnaire, answer, question, points
5
  Requires at least: 4.6
6
  Tested up to: 4.7
7
- Stable tag: 5.0.1
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
@@ -108,6 +108,9 @@ This is usually a theme conflict. You can [checkout out our common conflict solu
108
 
109
  == Changelog ==
110
 
 
 
 
111
  = 5.0.1 (March 27, 2017) =
112
  * Closed Bug: The setting to hide contact fields from logged-in users is hiding fields from visitors too ([Issue #535](https://github.com/fpcorso/quiz_master_next/issues/535))
113
 
4
  Tags: quiz, survey, lead, test, score, exam, questionnaire, answer, question, points
5
  Requires at least: 4.6
6
  Tested up to: 4.7
7
+ Stable tag: 5.0.2
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
108
 
109
  == Changelog ==
110
 
111
+ = 5.0.2 (May 7, 2017) =
112
+ * Closed Bug: Social sharing text not updating when user changes the text ([Issue #541](https://github.com/fpcorso/quiz_master_next/issues/541))
113
+
114
  = 5.0.1 (March 27, 2017) =
115
  * Closed Bug: The setting to hide contact fields from logged-in users is hiding fields from visitors too ([Issue #535](https://github.com/fpcorso/quiz_master_next/issues/535))
116