Poll, Survey, Quiz, Slideshow, Form, Story & Landing Page - Version 19.4.0

Version Description

  • stability fixes
    • added deactivate screen
Download this release

Release Info

Developer kucaahbe
Plugin Icon 128x128 Poll, Survey, Quiz, Slideshow, Form, Story & Landing Page
Version 19.4.0
Comparing to
See all releases

Code changes from version 19.3.5 to 19.4.0

admin/deactivate-feedback.php ADDED
@@ -0,0 +1,21 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ // block direct access to plugin PHP files:
3
+ defined( 'ABSPATH' ) or die();
4
+
5
+ add_action('admin_footer', 'add_deactivate_feedback_form');
6
+
7
+ function add_deactivate_feedback_form() {
8
+ $current_screen = get_current_screen();
9
+
10
+ if ( 'plugins' !== $current_screen->id && 'plugins-network' !== $current_screen->id ) {
11
+ return;
12
+ }
13
+
14
+ if(opinionstage_user_access_token() == null){
15
+ return;
16
+ }
17
+
18
+ include 'views/deactivate-feedback-form.php';
19
+ }
20
+
21
+ ?>
admin/init.php CHANGED
@@ -7,4 +7,5 @@ require( plugin_dir_path( __FILE__ ).'opinionstage-disconnect.php' );
7
  require( plugin_dir_path( __FILE__ ).'opinionstage-content-login-callback.php' );
8
  require( plugin_dir_path( __FILE__ ).'menu-page.php' );
9
  require( plugin_dir_path( __FILE__ ).'content-popup.php' );
 
10
  ?>
7
  require( plugin_dir_path( __FILE__ ).'opinionstage-content-login-callback.php' );
8
  require( plugin_dir_path( __FILE__ ).'menu-page.php' );
9
  require( plugin_dir_path( __FILE__ ).'content-popup.php' );
10
+ require( plugin_dir_path( __FILE__ ).'deactivate-feedback.php' );
11
  ?>
admin/views/deactivate-feedback-form.php ADDED
@@ -0,0 +1,169 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <style type="text/css">
2
+ .os-feedback-modal-wrapper {
3
+ position: fixed;
4
+ top: 0;
5
+ width: 100vw;
6
+ height: 100vh;
7
+ z-index: 9999;
8
+ background: rgba(0,0,0,0.5);
9
+ }
10
+ .os-modal-inner {
11
+ background: #fff;
12
+ width: 500px;
13
+ margin: auto;
14
+ margin-top: calc( (100vh - 393px) / 2 );
15
+ padding: 20px;
16
+ position: relative;
17
+ }
18
+ .os-modal-content {
19
+ margin-top: 25px;
20
+ margin-bottom: 45px;
21
+ }
22
+ h3.os-modal-heading {
23
+ margin: 0px;
24
+ text-transform: uppercase;
25
+ font-weight: 700;
26
+ letter-spacing: 1px;
27
+ }
28
+ .os-form-field input[type=radio]{
29
+ margin-right: 10px;
30
+ margin-top: 1px;
31
+ }
32
+ span.os-close-button {
33
+ position: absolute;
34
+ top: -10px;
35
+ right: -10px;
36
+ background: #f1f1f1;
37
+ border-radius: 20px;
38
+ cursor: pointer;
39
+ }
40
+ .os-skip-deactivate {
41
+ float: right;
42
+ }
43
+ .os-form-field {
44
+ margin-bottom: 10px;
45
+ }
46
+ .os-other-reason, .os-other-plugin{
47
+ display: block;
48
+ margin-left: 30px;
49
+ margin-top: 5px;
50
+ width: 75%;
51
+ line-height: 22px;
52
+ }
53
+ .os-modal-inner span.alert-error {
54
+ color: #f00;
55
+ font-weight: 600;
56
+ }
57
+ </style>
58
+ <script type="text/javascript">
59
+ // OS Modal JS here
60
+ jQuery(document).ready(function($){
61
+
62
+ // elements
63
+ var elemModal = $('.os-feedback-modal-wrapper');
64
+ var elemOpen = $('.plugins [data-slug="social-polls-by-opinionstage"] .deactivate');
65
+ var elemClose = $('.os-close-button');
66
+ var elemSkip = $('.os-skip-deactivate');
67
+ var elemSend = $('.os-send-deactivate');
68
+ var elemValue = $('.os-feedback-modal-wrapper input[type=radio]');
69
+
70
+ // handlers
71
+ $(elemOpen).click(function(){
72
+ elemModal.fadeIn();
73
+ return false;
74
+ });
75
+
76
+ $(elemClose).click(function(){
77
+ elemModal.fadeOut();
78
+ });
79
+
80
+ $(elemSend).click(function(){
81
+
82
+ if( jQuery('input[name=reason]:checked', $(elemModal)).length > 0 ){
83
+ elemModal.fadeOut();
84
+
85
+ var reason = jQuery('input[name=reason]:checked', $(elemModal)).val();
86
+ if(reason == 'I found a better plugin.'){
87
+ reason = 'Found better plugin: ' + $('.os-other-plugin').val();
88
+ }else if(reason == 'Other:'){
89
+ reason = 'Other: ' + $('.os-other-reason').val();
90
+ }
91
+
92
+ $.ajax({
93
+ url: '<?php echo OPINIONSTAGE_DEACTIVATE_FEEDBACK_API ?>',
94
+ headers: {
95
+ 'Accept':'application/vnd.api+json',
96
+ 'Content-Type':'application/vnd.api+json',
97
+ 'OSWP-Plugin-Version':'<?php echo OPINIONSTAGE_WIDGET_VERSION ?>',
98
+ 'OSWP-Client-Token': '<?php echo opinionstage_user_access_token() ?>'
99
+ },
100
+ method: 'POST',
101
+ dataType: 'json',
102
+ data: JSON.stringify({ data: {type: 'disconnect', attributes: { reason: reason }} }),
103
+ success: function(data){
104
+ window.location = elemOpen.find('a').attr('href');
105
+ },
106
+ error: function(){
107
+ window.location = elemOpen.find('a').attr('href');
108
+ }
109
+ });
110
+ }else{
111
+ // show error.
112
+ $('span.alert-error').html('Please select one of the options.');
113
+ }
114
+
115
+ });
116
+
117
+ $(elemSkip).click(function(){
118
+ elemModal.fadeOut();
119
+ window.location = elemOpen.find('a').attr('href');
120
+ });
121
+
122
+ $(elemValue).click(function(){
123
+ $('span.alert-error').html('');
124
+ $('input[type=text]', $(elemModal)).hide();
125
+ $(this).parent().find('input[type=text]').show();
126
+ });
127
+
128
+ });
129
+ </script>
130
+
131
+ <div class="os-feedback-modal-wrapper" style="display: none;">
132
+ <div class="os-modal-inner">
133
+ <h3 class="os-modal-heading">Quick Feedback</h3>
134
+ <div class="os-modal-content">
135
+ <span class="alert-error"></span>
136
+
137
+ <p><strong>If you have a moment, please share why you're deactivating?</strong></p>
138
+ <div class="os-form-field">
139
+ <input type="radio" name="reason" value="It is a temporary deactivation." id="label1">
140
+ <label for="label1">It is a temporary deactivation.</label>
141
+ </div>
142
+ <div class="os-form-field">
143
+ <input type="radio" name="reason" value="I couldn't get the plugin to work." id="label2">
144
+ <label for="label2">I couldn't get the plugin to work.</label>
145
+ </div>
146
+ <div class="os-form-field">
147
+ <input type="radio" name="reason" value="The plugin broke my website layout." id="label3">
148
+ <label for="label3">The plugin broke my website layout.</label>
149
+ </div>
150
+ <div class="os-form-field">
151
+ <input type="radio" name="reason" value="I found a better plugin." id="label4">
152
+ <label for="label4">I found a better plugin.</label>
153
+ <input type="text" name="other_plugin" class="os-other-plugin" placeholder="Please share the plugin name" style="display: none;">
154
+ </div>
155
+ <div class="os-form-field">
156
+ <input type="radio" name="reason" value="I no longer need this plugin." id="label5">
157
+ <label for="label5">I no longer need this plugin.</label>
158
+ </div>
159
+ <div class="os-form-field">
160
+ <input type="radio" name="reason" value="Other:" id="label6">
161
+ <label for="label6">Other:</label>
162
+ <input type="text" name="other_reason" class="os-other-reason" placeholder="Please share your reason here" style="display: none;">
163
+ </div>
164
+ </div>
165
+ <span class="os-close-button"><span class="dashicons dashicons-dismiss"></span></span>
166
+ <button class="os-send-deactivate button button-primary">Send & Deactivate</button>
167
+ <button class="os-skip-deactivate button">Skip & Deactivate</button>
168
+ </div>
169
+ </div>
includes/opinionstage-article-placement-functions.php CHANGED
@@ -10,6 +10,9 @@ defined( 'ABSPATH' ) or die();
10
  // Adds the article placement shortcode to each post
11
  static function the_content($content) {
12
  global $post;
 
 
 
13
  $type = $post->post_type;
14
  if (is_front_page() && is_home()) {
15
  return $content;
10
  // Adds the article placement shortcode to each post
11
  static function the_content($content) {
12
  global $post;
13
+ if( !(isset($post) && is_object($post)) ){
14
+ return $content;
15
+ }
16
  $type = $post->post_type;
17
  if (is_front_page() && is_home()) {
18
  return $content;
opinionstage-polls.php → plugin.php RENAMED
@@ -3,7 +3,7 @@
3
  Plugin Name: Poll, Survey, Quiz, Slideshow, Form & Story Article
4
  Plugin URI: https://www.opinionstage.com
5
  Description: Add a highly engaging poll, survey, quiz or contact form builder to your site. You can add the poll, survey, quiz or form to any post/page or to the sidebar.
6
- Version: 19.3.5
7
  Author: OpinionStage.com
8
  Author URI: https://www.opinionstage.com
9
  Text Domain: social-polls-by-opinionstage
@@ -24,7 +24,7 @@ if ( defined('WP_DEBUG') && true === WP_DEBUG ) {
24
  }
25
  }
26
 
27
- define('OPINIONSTAGE_WIDGET_VERSION', '19.3.5');
28
 
29
  define('OPINIONSTAGE_TEXT_DOMAIN', 'social-polls-by-opinionstage');
30
 
@@ -34,6 +34,7 @@ define('OPINIONSTAGE_API_PATH', OPINIONSTAGE_SERVER_BASE.'/api/v1');
34
  define('OPINIONSTAGE_CONTENT_POPUP_CLIENT_WIDGETS_API', OPINIONSTAGE_SERVER_BASE.'/api/wp/v1/my/widgets');
35
  define('OPINIONSTAGE_CONTENT_POPUP_SHARED_WIDGETS_API', OPINIONSTAGE_SERVER_BASE.'/api/wp/v1/shared_widgets');
36
  define('OPINIONSTAGE_CONTENT_POPUP_CLIENT_WIDGETS_API_RECENT_UPDATE', OPINIONSTAGE_SERVER_BASE.'/api/wp/v1/my/widgets/recent-update');
 
37
 
38
  define('OPINIONSTAGE_WIDGET_API_KEY', 'wp35e8');
39
  define('OPINIONSTAGE_UTM_SOURCE', 'wordpress');
@@ -55,17 +56,22 @@ require_once( plugin_dir_path( __FILE__ ).'includes/opinionstage-functions.php'
55
  if (opinionstage_check_plugin_available('opinionstage_popup')) {
56
  add_action('admin_notices', 'opinionstage_other_plugin_installed_warning');
57
  } else {
58
- require_once( plugin_dir_path( __FILE__ ).'includes/opinionstage-utility-functions.php' );
59
- require_once( plugin_dir_path( __FILE__ ).'includes/opinionstage-article-placement-functions.php' );
60
- require_once( plugin_dir_path( __FILE__ ).'includes/opinionstage-sidebar-widget.php' );
61
 
62
- if ( is_admin() ) {
63
- require( plugin_dir_path( __FILE__ ).'admin/init.php' );
64
- } else {
65
- require( plugin_dir_path( __FILE__ ).'public/init.php' );
66
- }
 
 
 
 
 
 
 
67
 
68
- add_action('widgets_init', 'opinionstage_init_widget');
69
- add_action('plugins_loaded', 'opinionstage_init');
 
70
  }
71
  ?>
3
  Plugin Name: Poll, Survey, Quiz, Slideshow, Form & Story Article
4
  Plugin URI: https://www.opinionstage.com
5
  Description: Add a highly engaging poll, survey, quiz or contact form builder to your site. You can add the poll, survey, quiz or form to any post/page or to the sidebar.
6
+ Version: 19.4.0
7
  Author: OpinionStage.com
8
  Author URI: https://www.opinionstage.com
9
  Text Domain: social-polls-by-opinionstage
24
  }
25
  }
26
 
27
+ define('OPINIONSTAGE_WIDGET_VERSION', '19.4.0');
28
 
29
  define('OPINIONSTAGE_TEXT_DOMAIN', 'social-polls-by-opinionstage');
30
 
34
  define('OPINIONSTAGE_CONTENT_POPUP_CLIENT_WIDGETS_API', OPINIONSTAGE_SERVER_BASE.'/api/wp/v1/my/widgets');
35
  define('OPINIONSTAGE_CONTENT_POPUP_SHARED_WIDGETS_API', OPINIONSTAGE_SERVER_BASE.'/api/wp/v1/shared_widgets');
36
  define('OPINIONSTAGE_CONTENT_POPUP_CLIENT_WIDGETS_API_RECENT_UPDATE', OPINIONSTAGE_SERVER_BASE.'/api/wp/v1/my/widgets/recent-update');
37
+ define('OPINIONSTAGE_DEACTIVATE_FEEDBACK_API', OPINIONSTAGE_SERVER_BASE.'/api/wp/v1/events');
38
 
39
  define('OPINIONSTAGE_WIDGET_API_KEY', 'wp35e8');
40
  define('OPINIONSTAGE_UTM_SOURCE', 'wordpress');
56
  if (opinionstage_check_plugin_available('opinionstage_popup')) {
57
  add_action('admin_notices', 'opinionstage_other_plugin_installed_warning');
58
  } else {
 
 
 
59
 
60
+ if( (function_exists('wp_doing_ajax') && wp_doing_ajax()) || (defined('DOING_AJAX')) ){
61
+ // AJAX running, don't include anything.
62
+ }else{
63
+ require_once( plugin_dir_path( __FILE__ ).'includes/opinionstage-utility-functions.php' );
64
+ require_once( plugin_dir_path( __FILE__ ).'includes/opinionstage-article-placement-functions.php' );
65
+ require_once( plugin_dir_path( __FILE__ ).'includes/opinionstage-sidebar-widget.php' );
66
+
67
+ if ( is_admin() ) {
68
+ require( plugin_dir_path( __FILE__ ).'admin/init.php' );
69
+ } else {
70
+ require( plugin_dir_path( __FILE__ ).'public/init.php' );
71
+ }
72
 
73
+ add_action('widgets_init', 'opinionstage_init_widget');
74
+ add_action('plugins_loaded', 'opinionstage_init');
75
+ }
76
  }
77
  ?>
readme.txt CHANGED
@@ -4,7 +4,7 @@ Donate link: https://www.opinionstage.com
4
  Tags: poll, quiz, survey, form, slideshow, story, article
5
  Requires at least: 2.8
6
  Tested up to: 4.9
7
- Stable tag: 19.3.5
8
 
9
  Easily add polls, surveys, quizzes, slideshows, forms & story article to your website. 
10
 
@@ -169,6 +169,9 @@ Yes, all content created with Opinion Stage is fully responsive, and designed to
169
  N/A
170
 
171
  == Changelog ==
 
 
 
172
  = 19.3.5 =
173
  * more updates to readme.txt file
174
  = 19.3.4 =
4
  Tags: poll, quiz, survey, form, slideshow, story, article
5
  Requires at least: 2.8
6
  Tested up to: 4.9
7
+ Stable tag: 19.4.0
8
 
9
  Easily add polls, surveys, quizzes, slideshows, forms & story article to your website. 
10
 
169
  N/A
170
 
171
  == Changelog ==
172
+ = 19.4.0 =
173
+ * stability fixes
174
+ * added deactivate screen
175
  = 19.3.5 =
176
  * more updates to readme.txt file
177
  = 19.3.4 =