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

Version Description

  • updated signup functional
    • internal code improvements
Download this release

Release Info

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

Code changes from version 19.7.2 to 19.7.3

admin/init.php CHANGED
@@ -9,7 +9,6 @@ defined( 'ABSPATH' ) || die(); // block direct access to plugin PHP files.
9
 
10
  require plugin_dir_path( __FILE__ ) . 'opinionstage-login-callback.php';
11
  require plugin_dir_path( __FILE__ ) . 'opinionstage-disconnect.php';
12
- require plugin_dir_path( __FILE__ ) . 'opinionstage-content-login-callback.php';
13
  require plugin_dir_path( __FILE__ ) . 'menu-page.php';
14
  require plugin_dir_path( __FILE__ ) . 'admin-page-loader.php';
15
  require plugin_dir_path( __FILE__ ) . 'message-handler.php';
9
 
10
  require plugin_dir_path( __FILE__ ) . 'opinionstage-login-callback.php';
11
  require plugin_dir_path( __FILE__ ) . 'opinionstage-disconnect.php';
 
12
  require plugin_dir_path( __FILE__ ) . 'menu-page.php';
13
  require plugin_dir_path( __FILE__ ) . 'admin-page-loader.php';
14
  require plugin_dir_path( __FILE__ ) . 'message-handler.php';
admin/opinionstage-content-login-callback.php DELETED
@@ -1,58 +0,0 @@
1
- <?php
2
- // block direct access to plugin PHP files:
3
- defined( 'ABSPATH' ) or die();
4
-
5
- require_once OPINIONSTAGE_PLUGIN_DIR . 'includes/logging.php';
6
-
7
- add_action( 'admin_menu', 'opinionstage_register_login_content_callback_page' );
8
- add_action( 'admin_init', 'opinionstage_login_content_callback', 1 );
9
-
10
- // adds page for post-login redirect and setup in form of invisible menu page,
11
- // and url: http://wp-host.com/wp-admin/admin.php?page=OPINIONSTAGE_LOGIN_CALLBACK_SLUG
12
- function opinionstage_register_login_content_callback_page() {
13
- if (function_exists('add_menu_page')) {
14
- add_submenu_page(
15
- null,
16
- '',
17
- '',
18
- 'edit_posts',
19
- OPINIONSTAGE_CONTENT_LOGIN_CALLBACK_SLUG
20
- );
21
- }
22
- }
23
-
24
- // performs redirect to content page with opened modal, after user logged in
25
- function opinionstage_login_content_callback() {
26
-
27
- // Make sure user is logged in and have edit posts cap
28
-
29
- if ( OPINIONSTAGE_CONTENT_LOGIN_CALLBACK_SLUG == filter_input( INPUT_GET, 'page' ) && is_user_logged_in() && current_user_can('edit_posts') ) {
30
- $success = sanitize_text_field($_GET['success']);
31
- $uid = sanitize_text_field($_GET['uid']);
32
- $token = sanitize_text_field($_GET['token']);
33
- $email = sanitize_email($_GET['email']);
34
- $fly_id = intval($_GET['fly_id']);
35
- $article_placement_id = intval($_GET['article_placement_id']);
36
- $sidebar_placement_id = intval($_GET['sidebar_placement_id']);
37
- $redirect_url = urldecode($_GET['return_path']);
38
-
39
- delete_option(OPINIONSTAGE_OPTIONS_KEY);
40
-
41
- opinionstage_parse_client_data(
42
- compact(
43
- 'success',
44
- 'uid',
45
- 'token',
46
- 'email',
47
- 'fly_id',
48
- 'article_placement_id',
49
- 'sidebar_placement_id'
50
- )
51
- );
52
-
53
- opinionstage_error_log( 'user logged in, redirect to ' . $redirect_url );
54
- if ( wp_redirect( $redirect_url, 302 ) ) {
55
- exit;
56
- }
57
- }
58
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
admin/opinionstage-login-callback.php CHANGED
@@ -2,60 +2,74 @@
2
  // block direct access to plugin PHP files:
3
  defined( 'ABSPATH' ) or die();
4
 
5
- require_once OPINIONSTAGE_PLUGIN_DIR . 'includes/logging.php';
6
-
7
  add_action( 'admin_menu', 'opinionstage_register_login_callback_page' );
8
- add_action( 'admin_init', 'opinionstage_login_callback', 1 );
9
 
10
  // adds page for post-login redirect and setup in form of invisible menu page,
11
  // and url: http://wp-host.com/wp-admin/admin.php?page=OPINIONSTAGE_LOGIN_CALLBACK_SLUG
12
  function opinionstage_register_login_callback_page() {
13
- if (function_exists('add_menu_page')) {
14
- add_submenu_page(
15
- null,
16
- '',
17
- '',
18
- 'edit_posts',
19
- OPINIONSTAGE_LOGIN_CALLBACK_SLUG
20
- );
21
- }
22
  }
23
 
24
  // performs redirect to plugin settings page, after user logged in
25
- function opinionstage_login_callback() {
26
-
27
- // Make sure user is logged in and have edit posts cap
28
- if (is_user_logged_in() && current_user_can('edit_posts')) {
29
-
30
- if ( OPINIONSTAGE_LOGIN_CALLBACK_SLUG == filter_input( INPUT_GET, 'page' ) ) {
31
- $success = sanitize_text_field($_GET['success']);
32
- $uid = sanitize_text_field($_GET['uid']);
33
- $token = sanitize_text_field($_GET['token']);
34
- $email = sanitize_email($_GET['email']);
35
- $fly_id = intval($_GET['fly_id']);
36
- $article_placement_id = intval($_GET['article_placement_id']);
37
- $sidebar_placement_id = intval($_GET['sidebar_placement_id']);
38
-
39
- opinionstage_uninstall();
40
- opinionstage_parse_client_data(
41
- compact(
42
- 'success',
43
- 'uid',
44
- 'token',
45
- 'email',
46
- 'fly_id',
47
- 'article_placement_id',
48
- 'sidebar_placement_id'
49
- )
50
- );
51
-
52
-
53
- $redirect_url = get_admin_url(null, '', 'admin').'admin.php?page='.OPINIONSTAGE_MENU_SLUG;
54
-
55
- opinionstage_error_log( 'user logged in, redirect to ' . $redirect_url );
56
- if ( wp_redirect( $redirect_url, 302 ) ) {
57
- exit;
58
- }
59
  }
60
  }
61
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2
  // block direct access to plugin PHP files:
3
  defined( 'ABSPATH' ) or die();
4
 
 
 
5
  add_action( 'admin_menu', 'opinionstage_register_login_callback_page' );
6
+ add_action( 'admin_init', 'opinionstage_login_and_redirect_to_settings_page');
7
 
8
  // adds page for post-login redirect and setup in form of invisible menu page,
9
  // and url: http://wp-host.com/wp-admin/admin.php?page=OPINIONSTAGE_LOGIN_CALLBACK_SLUG
10
  function opinionstage_register_login_callback_page() {
11
+ add_submenu_page(
12
+ null,
13
+ '',
14
+ '',
15
+ 'edit_posts',
16
+ OPINIONSTAGE_LOGIN_CALLBACK_SLUG
17
+ );
 
 
18
  }
19
 
20
  // performs redirect to plugin settings page, after user logged in
21
+ function opinionstage_login_and_redirect_to_settings_page() {
22
+
23
+ if ( is_user_logged_in()
24
+ && current_user_can('edit_posts')
25
+ && OPINIONSTAGE_LOGIN_CALLBACK_SLUG == filter_input( INPUT_GET, 'page' ) ) {
26
+
27
+ $uid = sanitize_text_field($_GET['opinionstage_uid']);
28
+ $token = sanitize_text_field($_GET['opinionstage_token']);
29
+ $email = sanitize_email($_GET['opinionstage_email']);
30
+ $fly_id = intval($_GET['opinionstage_fly_id']);
31
+ $article_placement_id = intval($_GET['opinionstage_article_placement_id']);
32
+ $sidebar_placement_id = intval($_GET['opinionstage_sidebar_placement_id']);
33
+
34
+ opinionstage_uninstall();
35
+ opinionstage_validate_and_save_client_data(
36
+ compact(
37
+ 'uid',
38
+ 'token',
39
+ 'email',
40
+ 'fly_id',
41
+ 'article_placement_id',
42
+ 'sidebar_placement_id'
43
+ )
44
+ );
45
+
46
+ if ( wp_redirect( menu_page_url(OPINIONSTAGE_MENU_SLUG, false), 302 ) ) {
47
+ exit;
 
 
 
 
 
 
 
48
  }
49
  }
50
  }
51
+
52
+ function opinionstage_validate_and_save_client_data( $raw ) {
53
+
54
+ $os_options = array(
55
+ 'uid' => $raw['uid'],
56
+ 'email' => $raw['email'],
57
+ 'fly_id' => $raw['fly_id'],
58
+ 'article_placement_id' => $raw['article_placement_id'],
59
+ 'sidebar_placement_id' => $raw['sidebar_placement_id'],
60
+ 'version' => OPINIONSTAGE_WIDGET_VERSION,
61
+ 'fly_out_active' => 'false',
62
+ 'article_placement_active' => 'false',
63
+ 'sidebar_placement_active' => 'false',
64
+ 'token' => $raw['token'],
65
+ );
66
+
67
+
68
+ $valid = preg_match( '/^[0-9]+$/', $raw['fly_id'] )
69
+ && preg_match( '/^[0-9]+$/', $raw['article_placement_id'] )
70
+ && preg_match( '/^[0-9]+$/', $raw['sidebar_placement_id'] );
71
+
72
+ if ( $valid ) {
73
+ update_option( OPINIONSTAGE_OPTIONS_KEY, $os_options );
74
+ }
75
+ }
assets/gutenberg/build/index.asset.php CHANGED
@@ -1 +1 @@
1
- <?php return array('dependencies' => array('wp-blocks', 'wp-element', 'wp-i18n', 'wp-polyfill'), 'version' => 'e1bc37656dbfdfb12e6349112666c9df');
1
+ <?php return array('dependencies' => array('wp-blocks', 'wp-element', 'wp-i18n', 'wp-polyfill'), 'version' => '1e645334cbee233c81a82c81a9ce0809');
assets/gutenberg/build/index.js CHANGED
@@ -1 +1 @@
1
- !function(e){var t={};function o(r){if(t[r])return t[r].exports;var i=t[r]={i:r,l:!1,exports:{}};return e[r].call(i.exports,i,i.exports,o),i.l=!0,i.exports}o.m=e,o.c=t,o.d=function(e,t,r){o.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},o.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},o.t=function(e,t){if(1&t&&(e=o(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(o.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var i in e)o.d(r,i,function(t){return e[t]}.bind(null,i));return r},o.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return o.d(t,"a",t),t},o.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},o.p="",o(o.s=4)}([function(e,t){!function(){e.exports=this.wp.element}()},function(e,t){!function(){e.exports=this.wp.i18n}()},function(e,t){!function(){e.exports=this.wp.blocks}()},function(e,t,o){},function(e,t,o){"use strict";o.r(t);var r=o(2),i=o(1),n=o(0),a=(o(3),{widgetType:{type:"string",source:"attribute",attribute:"data-type",selector:"div[data-type]"},embedUrl:{source:"attribute",attribute:"data-test-url",selector:"div[data-test-url]"},lockEmbed:{source:"attribute",attribute:"data-lock-embed",selector:"div[data-lock-embed]"},buttonText:{source:"attribute",attribute:"data-button-text",selector:"div[data-button-text]"},insertItemImage:{source:"attribute",attribute:"data-image-url",selector:"div[data-image-url]"},insertItemOsTitle:{source:"attribute",attribute:"data-title-url",selector:"div[data-title-url]"},insertItemOsView:{source:"attribute",attribute:"data-view-url",selector:"div[data-view-url]"},insertItemOsEdit:{source:"attribute",attribute:"data-edit-url",selector:"div[data-edit-url]"},insertItemOsStatistics:{source:"attribute",attribute:"data-statistics-url",selector:"div[data-statistics-url]"}}),s="opinion-stage",c={html:!1};function l(e){var t=e.name,o=e.className,a=e.attributes,s=e.setAttributes,c=e.clientId,l=(a.widgetType,a.embedUrl),p=(a.lockEmbed,a.buttonText),b=a.insertItemImage,d=a.insertItemOsTitle,m=a.insertItemOsView,g=a.insertItemOsEdit,O=a.insertItemOsStatistics;if("false"===OPINIONSTAGE_GUTENBERG_DATA.userLoggedIn)return Object(n.createElement)("div",{className:o},Object(n.createElement)("div",{class:"os-widget-wrapper components-placeholder"},Object(n.createElement)("p",{class:"components-heading"},Object(n.createElement)("img",{src:OPINIONSTAGE_GUTENBERG_DATA.brandLogoUrl,alt:""})),Object(n.createElement)("p",{class:"components-heading"},"Please connect WordPress to Opinion Stage to start adding widgets"),Object(n.createElement)("a",{href:OPINIONSTAGE_GUTENBERG_DATA.loginPageUrl,class:"components-button is-button is-default is-block is-primary"},"Connect")));var y=function(e){switch(e){case"opinion-stage/block-os-poll":return"poll";case"opinion-stage/block-os-survey":return"survey";case"opinion-stage/block-os-trivia":return"trivia";case"opinion-stage/block-os-personality":return"personality";case"opinion-stage/block-os-form":return"form";default:console.warn("unknown block name:",e)}}(t),_=function(e){switch(e){case"poll":return Object(i.__)("Poll");case"survey":return Object(i.__)("Survey");case"trivia":return Object(i.__)("Trivia Quiz");case"personality":return Object(i.__)("Personality Quiz");case"form":return Object(i.__)("Form")}}(y),v=function(e){var t=function(e){switch(e){case"poll":return"poll";case"survey":return"survey";case"trivia":return"trivia";case"personality":return"personality";case"form":return"form"}}(e.type),o={widgetType:t,lockEmbed:!0,buttonText:"Change",embedUrl:e.landingPageUrl.replace(/^https?:\/\/[^/]+\//,"/"),insertItemImage:e.imageUrl,insertItemOsTitle:e.title,insertItemOsView:e.landingPageUrl,insertItemOsEdit:e.editUrl,insertItemOsStatistics:e.statsUrl};if(t===y)s(o);else{var i=Object(r.createBlock)(function(e){switch(e){case"poll":return"opinion-stage/block-os-poll";case"survey":return"opinion-stage/block-os-survey";case"trivia":return"opinion-stage/block-os-trivia";case"personality":return"opinion-stage/block-os-personality";case"form":return"opinion-stage/block-os-form";default:console.warn("unknown block widget type:",e)}}(t));i.attributes=o,wp.data.dispatch("core/block-editor").replaceBlock(c,i)}},f=function(e){OpinionStage.contentPopup.open({preselectWidgetType:u(y),onWidgetSelect:v})},E="".concat(OPINIONSTAGE_GUTENBERG_DATA.createNewWidgetUrl,"&w_type=").concat(function(e){switch(e){case"poll":return"poll";case"survey":return"survey";case"trivia":return"quiz";case"personality":return"outcome";case"form":return"contact_form"}}(y)),j=Object(n.createElement)("div",{class:"os-widget-wrapper components-placeholder"},Object(n.createElement)("p",{class:"components-heading"},Object(n.createElement)("img",{src:OPINIONSTAGE_GUTENBERG_DATA.brandLogoUrl,alt:""})),Object(n.createElement)("button",{class:"components-button is-button is-default is-block is-primary",onClick:f},"Select a ",_),Object(n.createElement)("a",{href:E,target:"_blank",class:"components-button is-button is-default is-block is-primary"},"Create a new ",_));return l&&""!==l?"Change"===p&&(j=Object(n.createElement)("div",{class:"os-widget-wrapper components-placeholder"},Object(n.createElement)("p",{class:"components-heading"},Object(n.createElement)("img",{src:OPINIONSTAGE_GUTENBERG_DATA.brandLogoUrl,alt:""})),Object(n.createElement)("div",{class:"components-preview__block"},Object(n.createElement)("div",{class:"components-preview__leftBlockImage"},Object(n.createElement)("img",{src:b,alt:d,class:"image"}),Object(n.createElement)("div",{class:"overlay"},Object(n.createElement)("div",{class:"text"},Object(n.createElement)("a",{href:m,target:"_blank"}," View "),Object(n.createElement)("a",{href:g,target:"_blank"}," Edit "),Object(n.createElement)("a",{href:O,target:"_blank"}," Statistics "),Object(n.createElement)("input",{type:"button",value:p,class:"components-button is-button is-default is-large left-align",onClick:f})))),Object(n.createElement)("div",{class:"components-preview__rightBlockContent"},Object(n.createElement)("div",{class:"components-placeholder__label"},_,": ",d))))):s({buttonText:"Embed"}),Object(n.createElement)("div",{className:o},j)}function u(e){switch(e){case"poll":return OpinionStage.contentPopup.WIDGET_POLL;case"survey":return OpinionStage.contentPopup.WIDGET_SURVEY;case"trivia":return OpinionStage.contentPopup.WIDGET_TRIVIA_QUIZ;case"personality":return OpinionStage.contentPopup.WIDGET_PERSONALITY_QUIZ;case"form":return OpinionStage.contentPopup.WIDGET_FORM}}function p(e){var t=e.attributes,o=t.widgetType,r=t.embedUrl,i=t.lockEmbed,a=t.buttonText,s=t.insertItemImage,c=t.insertItemOsTitle,l=t.insertItemOsView,u=t.insertItemOsEdit,p=t.insertItemOsStatistics;return Object(n.createElement)("div",{class:b(o),"data-type":o,"data-image-url":s,"data-title-url":c,"data-view-url":l,"data-statistics-url":p,"data-edit-url":u,"data-test-url":r,"data-lock-embed":i,"data-button-text":a},'[os-widget path="',r,'"]',Object(n.createElement)("span",null))}function b(e){if(!e)return null;switch(e){case"poll":return"os-poll-wrapper";case"survey":return"os-survey-wrapper";case"trivia":return"os-trivia-wrapper";case"personality":return"os-personality-wrapper";case"form":return"os-form-wrapper";default:console.warn("unknown widget type:",e)}}Object(r.registerBlockType)("opinion-stage/block-os-poll",{title:Object(i.__)("Poll","social-polls-by-opinionstage"),icon:"chart-bar",description:Object(i.__)("Embed an Opinion Stage Poll","social-polls-by-opinionstage"),category:s,keywords:[Object(i.__)("poll","social-polls-by-opinionstage"),Object(i.__)("social poll","social-polls-by-opinionstage")],supports:c,attributes:a,edit:l,save:p}),Object(r.registerBlockType)("opinion-stage/block-os-survey",{title:Object(i.__)("Survey"),icon:"list-view",description:Object(i.__)("Embed an Opinion Stage Survey","social-polls-by-opinionstage"),category:s,keywords:[Object(i.__)("survey","social-polls-by-opinionstage")],supports:c,attributes:a,edit:l,save:p}),Object(r.registerBlockType)("opinion-stage/block-os-trivia",{title:Object(i.__)("Trivia Quiz"),icon:"yes",description:Object(i.__)("Embed an Opinion Stage Trivia Quiz","social-polls-by-opinionstage"),category:s,keywords:[Object(i.__)("quiz","social-polls-by-opinionstage"),Object(i.__)("trivia","social-polls-by-opinionstage")],supports:c,attributes:a,edit:l,save:p}),Object(r.registerBlockType)("opinion-stage/block-os-personality",{title:Object(i.__)("Personality Quiz"),icon:"smiley",description:Object(i.__)("Embed an Opinion Stage Personality Quiz","social-polls-by-opinionstage"),category:s,keywords:[Object(i.__)("personality","social-polls-by-opinionstage"),Object(i.__)("quiz","social-polls-by-opinionstage"),Object(i.__)("outcome","social-polls-by-opinionstage")],supports:c,attributes:a,edit:l,save:p}),Object(r.registerBlockType)("opinion-stage/block-os-form",{title:Object(i.__)("Form"),icon:"editor-justify",description:Object(i.__)("Embed an Opinion Stage Form","social-polls-by-opinionstage"),category:s,keywords:[Object(i.__)("form","social-polls-by-opinionstage"),Object(i.__)("contact form","social-polls-by-opinionstage")],supports:c,attributes:a,edit:l,save:p})}]);
1
+ !function(e){var t={};function r(o){if(t[o])return t[o].exports;var i=t[o]={i:o,l:!1,exports:{}};return e[o].call(i.exports,i,i.exports,r),i.l=!0,i.exports}r.m=e,r.c=t,r.d=function(e,t,o){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:o})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var o=Object.create(null);if(r.r(o),Object.defineProperty(o,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var i in e)r.d(o,i,function(t){return e[t]}.bind(null,i));return o},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s=4)}([function(e,t){!function(){e.exports=this.wp.element}()},function(e,t){!function(){e.exports=this.wp.i18n}()},function(e,t){!function(){e.exports=this.wp.blocks}()},function(e,t,r){},function(e,t,r){"use strict";r.r(t);var o=r(2),i=r(1),n=r(0),a=(r(3),{widgetType:{type:"string",source:"attribute",attribute:"data-type",selector:"div[data-type]"},embedUrl:{source:"attribute",attribute:"data-test-url",selector:"div[data-test-url]"},lockEmbed:{source:"attribute",attribute:"data-lock-embed",selector:"div[data-lock-embed]"},buttonText:{source:"attribute",attribute:"data-button-text",selector:"div[data-button-text]"},insertItemImage:{source:"attribute",attribute:"data-image-url",selector:"div[data-image-url]"},insertItemOsTitle:{source:"attribute",attribute:"data-title-url",selector:"div[data-title-url]"},insertItemOsView:{source:"attribute",attribute:"data-view-url",selector:"div[data-view-url]"},insertItemOsEdit:{source:"attribute",attribute:"data-edit-url",selector:"div[data-edit-url]"},insertItemOsStatistics:{source:"attribute",attribute:"data-statistics-url",selector:"div[data-statistics-url]"}}),s="opinion-stage",c={html:!1};function l(e){var t=e.name,r=e.className,a=e.attributes,s=e.setAttributes,c=e.clientId,l=(a.widgetType,a.embedUrl),p=(a.lockEmbed,a.buttonText),b=a.insertItemImage,d=a.insertItemOsTitle,m=a.insertItemOsView,g=a.insertItemOsEdit,O=a.insertItemOsStatistics;if("false"===OPINIONSTAGE_GUTENBERG_DATA.userLoggedIn)return Object(n.createElement)("div",{className:r},Object(n.createElement)("div",{class:"os-widget-wrapper components-placeholder"},Object(n.createElement)("p",{class:"components-heading"},Object(n.createElement)("img",{src:OPINIONSTAGE_GUTENBERG_DATA.brandLogoUrl,alt:""})),Object(n.createElement)("p",{class:"components-heading"},"Please connect WordPress to Opinion Stage to start adding widgets"),Object(n.createElement)("a",{href:OPINIONSTAGE_GUTENBERG_DATA.loginPageUrl,class:"components-button is-button is-default is-block is-primary"},"Connect")));var y=function(e){switch(e){case"opinion-stage/block-os-poll":return"poll";case"opinion-stage/block-os-survey":return"survey";case"opinion-stage/block-os-trivia":return"trivia";case"opinion-stage/block-os-personality":return"personality";case"opinion-stage/block-os-form":return"form";default:console.warn("unknown block name:",e)}}(t),v=function(e){switch(e){case"poll":return Object(i.__)("Poll");case"survey":return Object(i.__)("Survey");case"trivia":return Object(i.__)("Trivia Quiz");case"personality":return Object(i.__)("Personality Quiz");case"form":return Object(i.__)("Form")}}(y),_=function(e){var t=function(e){switch(e){case"poll":return"poll";case"survey":return"survey";case"trivia":return"trivia";case"personality":return"personality";case"form":return"form"}}(e.type),r={widgetType:t,lockEmbed:!0,buttonText:"Change",embedUrl:e.landingPageUrl.replace(/^https?:\/\/[^/]+\//,"/"),insertItemImage:e.imageUrl,insertItemOsTitle:e.title,insertItemOsView:e.landingPageUrl,insertItemOsEdit:e.editUrl,insertItemOsStatistics:e.statsUrl};if(t===y)s(r);else{var i=Object(o.createBlock)(function(e){switch(e){case"poll":return"opinion-stage/block-os-poll";case"survey":return"opinion-stage/block-os-survey";case"trivia":return"opinion-stage/block-os-trivia";case"personality":return"opinion-stage/block-os-personality";case"form":return"opinion-stage/block-os-form";default:console.warn("unknown block widget type:",e)}}(t));i.attributes=r,wp.data.dispatch("core/block-editor").replaceBlock(c,i)}},f=function(e){OpinionStage.contentPopup.open({preselectWidgetType:u(y),onWidgetSelect:_})},E="".concat(OPINIONSTAGE_GUTENBERG_DATA.createNewWidgetUrl,"&w_type=").concat(function(e){switch(e){case"poll":return"poll";case"survey":return"survey";case"trivia":return"quiz";case"personality":return"outcome";case"form":return"contact_form"}}(y)),j=Object(n.createElement)("div",{class:"os-widget-wrapper components-placeholder"},Object(n.createElement)("p",{class:"components-heading"},Object(n.createElement)("img",{src:OPINIONSTAGE_GUTENBERG_DATA.brandLogoUrl,alt:""})),Object(n.createElement)("button",{class:"components-button is-button is-default is-block is-primary",onClick:f},"Select a ",v),Object(n.createElement)("a",{href:E,target:"_blank",class:"components-button is-button is-default is-block is-primary"},"Create a new ",v));return l&&""!==l?"Change"===p&&(j=Object(n.createElement)("div",{class:"os-widget-wrapper components-placeholder"},Object(n.createElement)("p",{class:"components-heading"},Object(n.createElement)("img",{src:OPINIONSTAGE_GUTENBERG_DATA.brandLogoUrl,alt:""})),Object(n.createElement)("div",{class:"components-preview__block"},Object(n.createElement)("div",{class:"components-preview__leftBlockImage"},Object(n.createElement)("img",{src:b,alt:d,class:"image"}),Object(n.createElement)("div",{class:"overlay"},Object(n.createElement)("div",{class:"text"},Object(n.createElement)("a",{href:m,target:"_blank"}," View "),Object(n.createElement)("a",{href:g,target:"_blank"}," Edit "),Object(n.createElement)("a",{href:O,target:"_blank"}," Statistics "),Object(n.createElement)("input",{type:"button",value:p,class:"components-button is-button is-default is-large left-align",onClick:f})))),Object(n.createElement)("div",{class:"components-preview__rightBlockContent"},Object(n.createElement)("div",{class:"components-placeholder__label"},v,": ",d))))):s({buttonText:"Embed"}),Object(n.createElement)("div",{className:r},j)}function u(e){switch(e){case"poll":return OpinionStage.contentPopup.WIDGET_POLL;case"survey":return OpinionStage.contentPopup.WIDGET_SURVEY;case"trivia":return OpinionStage.contentPopup.WIDGET_TRIVIA_QUIZ;case"personality":return OpinionStage.contentPopup.WIDGET_PERSONALITY_QUIZ;case"form":return OpinionStage.contentPopup.WIDGET_FORM}}function p(e){var t=e.attributes,r=t.widgetType,o=t.embedUrl,i=t.lockEmbed,a=t.buttonText,s=t.insertItemImage,c=t.insertItemOsTitle,l=t.insertItemOsView,u=t.insertItemOsEdit,p=t.insertItemOsStatistics;return Object(n.createElement)("div",{class:b(r),"data-type":r,"data-image-url":s,"data-title-url":c,"data-view-url":l,"data-statistics-url":p,"data-edit-url":u,"data-test-url":o,"data-lock-embed":i,"data-button-text":a},'[os-widget path="',o,'"]',Object(n.createElement)("span",null))}function b(e){if(!e)return null;switch(e){case"poll":return"os-poll-wrapper";case"survey":return"os-survey-wrapper";case"trivia":return"os-trivia-wrapper";case"personality":return"os-personality-wrapper";case"form":return"os-form-wrapper";default:console.warn("unknown widget type:",e)}}Object(o.registerBlockType)("opinion-stage/block-os-poll",{title:"Poll",icon:"chart-bar",description:Object(i.__)("Embed an Opinion Stage Poll","social-polls-by-opinionstage"),category:s,keywords:[Object(i.__)("poll","social-polls-by-opinionstage"),Object(i.__)("social poll","social-polls-by-opinionstage")],supports:c,attributes:a,edit:l,save:p}),Object(o.registerBlockType)("opinion-stage/block-os-survey",{title:"Survey",icon:"list-view",description:Object(i.__)("Embed an Opinion Stage Survey","social-polls-by-opinionstage"),category:s,keywords:[Object(i.__)("survey","social-polls-by-opinionstage")],supports:c,attributes:a,edit:l,save:p}),Object(o.registerBlockType)("opinion-stage/block-os-trivia",{title:"Trivia Quiz",icon:"yes",description:Object(i.__)("Embed an Opinion Stage Trivia Quiz","social-polls-by-opinionstage"),category:s,keywords:[Object(i.__)("quiz","social-polls-by-opinionstage"),Object(i.__)("trivia","social-polls-by-opinionstage")],supports:c,attributes:a,edit:l,save:p}),Object(o.registerBlockType)("opinion-stage/block-os-personality",{title:"Personality Quiz",icon:"smiley",description:Object(i.__)("Embed an Opinion Stage Personality Quiz","social-polls-by-opinionstage"),category:s,keywords:[Object(i.__)("personality","social-polls-by-opinionstage"),Object(i.__)("quiz","social-polls-by-opinionstage"),Object(i.__)("outcome","social-polls-by-opinionstage")],supports:c,attributes:a,edit:l,save:p}),Object(o.registerBlockType)("opinion-stage/block-os-form",{title:"Form",icon:"editor-justify",description:Object(i.__)("Embed an Opinion Stage Form","social-polls-by-opinionstage"),category:s,keywords:[Object(i.__)("form","social-polls-by-opinionstage"),Object(i.__)("contact form","social-polls-by-opinionstage")],supports:c,attributes:a,edit:l,save:p})}]);
assets/gutenberg/src/index.js CHANGED
@@ -6,7 +6,7 @@ import save from './save'
6
  import { attributes, category, supports } from './configuration'
7
 
8
  registerBlockType('opinion-stage/block-os-poll', {
9
- title: __( 'Poll', 'social-polls-by-opinionstage' ),
10
  icon: 'chart-bar',
11
  description: __('Embed an Opinion Stage Poll', 'social-polls-by-opinionstage'),
12
  category,
@@ -23,7 +23,7 @@ registerBlockType('opinion-stage/block-os-poll', {
23
  })
24
 
25
  registerBlockType('opinion-stage/block-os-survey', {
26
- title: __( 'Survey' ),
27
  icon: 'list-view',
28
  description: __('Embed an Opinion Stage Survey', 'social-polls-by-opinionstage'),
29
  category,
@@ -39,7 +39,7 @@ registerBlockType('opinion-stage/block-os-survey', {
39
  })
40
 
41
  registerBlockType('opinion-stage/block-os-trivia', {
42
- title: __( 'Trivia Quiz' ),
43
  icon: 'yes',
44
  description: __('Embed an Opinion Stage Trivia Quiz', 'social-polls-by-opinionstage'),
45
  category,
@@ -56,7 +56,7 @@ registerBlockType('opinion-stage/block-os-trivia', {
56
  })
57
 
58
  registerBlockType('opinion-stage/block-os-personality', {
59
- title: __( 'Personality Quiz' ),
60
  icon: 'smiley',
61
  description: __('Embed an Opinion Stage Personality Quiz', 'social-polls-by-opinionstage'),
62
  category,
@@ -74,7 +74,7 @@ registerBlockType('opinion-stage/block-os-personality', {
74
  })
75
 
76
  registerBlockType('opinion-stage/block-os-form', {
77
- title: __( 'Form' ),
78
  icon: 'editor-justify',
79
  description: __('Embed an Opinion Stage Form', 'social-polls-by-opinionstage'),
80
  category,
6
  import { attributes, category, supports } from './configuration'
7
 
8
  registerBlockType('opinion-stage/block-os-poll', {
9
+ title: 'Poll',
10
  icon: 'chart-bar',
11
  description: __('Embed an Opinion Stage Poll', 'social-polls-by-opinionstage'),
12
  category,
23
  })
24
 
25
  registerBlockType('opinion-stage/block-os-survey', {
26
+ title: 'Survey',
27
  icon: 'list-view',
28
  description: __('Embed an Opinion Stage Survey', 'social-polls-by-opinionstage'),
29
  category,
39
  })
40
 
41
  registerBlockType('opinion-stage/block-os-trivia', {
42
+ title: 'Trivia Quiz',
43
  icon: 'yes',
44
  description: __('Embed an Opinion Stage Trivia Quiz', 'social-polls-by-opinionstage'),
45
  category,
56
  })
57
 
58
  registerBlockType('opinion-stage/block-os-personality', {
59
+ title: 'Personality Quiz',
60
  icon: 'smiley',
61
  description: __('Embed an Opinion Stage Personality Quiz', 'social-polls-by-opinionstage'),
62
  category,
74
  })
75
 
76
  registerBlockType('opinion-stage/block-os-form', {
77
+ title: 'Form',
78
  icon: 'editor-justify',
79
  description: __('Embed an Opinion Stage Form', 'social-polls-by-opinionstage'),
80
  category,
includes/gutenberg.php CHANGED
@@ -54,18 +54,6 @@ function opinionstage_register_gutenberg_assets() {
54
  false
55
  );
56
 
57
- /* phpcs:disable Squiz.PHP.CommentedOutCode.Found
58
- // @kucaahbe: we don't need non-editor style, but if we do,
59
- // here is how it should be like:
60
- $style_css = 'assets/gutenberg/build/style-index.css';
61
- wp_register_style(
62
- 'opinionstage-gutenberg-block',
63
- opinionstage_gutenberg_asset_url( $style_css ),
64
- array(),
65
- filemtime( OPINIONSTAGE_PLUGIN_DIR . $style_css ),
66
- false
67
- );
68
- phpcs:enable */
69
 
70
  register_block_type(
71
  'opinion-stage/block-os-poll',
@@ -123,7 +111,7 @@ function opinionstage_register_gutenberg_categories( $categories, $post ) {
123
  array(
124
  array(
125
  'slug' => 'opinion-stage',
126
- 'title' => __( 'Interactive Content by OpinionStage', 'opinion-stage' ),
127
  ),
128
  )
129
  );
54
  false
55
  );
56
 
 
 
 
 
 
 
 
 
 
 
 
 
57
 
58
  register_block_type(
59
  'opinion-stage/block-os-poll',
111
  array(
112
  array(
113
  'slug' => 'opinion-stage',
114
+ 'title' => __( 'Poll, Survey, Quiz & Form By Opinion Stage', 'opinion-stage' ),
115
  ),
116
  )
117
  );
includes/opinionstage-utility-functions.php CHANGED
@@ -150,36 +150,6 @@ function opinionstage_create_slideshow_link( $css_class, $title = 'CREATE NEW' )
150
  * Generates a to the callback page used to connect the plugin to the Opinion Stage account
151
  */
152
  function opinionstage_callback_url() {
153
- return get_admin_url( '', '', 'admin' ) . 'admin.php?page=' . OPINIONSTAGE_LOGIN_CALLBACK_SLUG;
154
  }
155
 
156
- /**
157
- * Take the received data and parse it
158
- *
159
- * Returns the newly updated widgets parameters.
160
- */
161
- function opinionstage_parse_client_data( $raw_data ) {
162
- $os_options = array(
163
- 'uid' => $raw_data['uid'],
164
- 'email' => $raw_data['email'],
165
- 'fly_id' => $raw_data['fly_id'],
166
- 'article_placement_id' => $raw_data['article_placement_id'],
167
- 'sidebar_placement_id' => $raw_data['sidebar_placement_id'],
168
- 'version' => OPINIONSTAGE_WIDGET_VERSION,
169
- 'fly_out_active' => 'false',
170
- 'article_placement_active' => 'false',
171
- 'sidebar_placement_active' => 'false',
172
- 'token' => $raw_data['token'],
173
- );
174
- $valid_ids = preg_match( '/^[0-9]+$/', $raw_data['fly_id'] ) && preg_match( '/^[0-9]+$/', $raw_data['article_placement_id'] ) && preg_match( '/^[0-9]+$/', $raw_data['sidebar_placement_id'] );
175
- if ( $valid_ids ) {
176
- update_option( OPINIONSTAGE_OPTIONS_KEY, $os_options );
177
- }
178
- }
179
-
180
- function opinionstage_custom_content_popup_callback_url() {
181
- $protocol = ( ( ! empty( $_SERVER['HTTPS'] ) && $_SERVER['HTTPS'] !== 'off' ) || $_SERVER['SERVER_PORT'] === 443 ) ? 'https://' : 'http://';
182
- $url = $protocol . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'];
183
- $adminUrlForOs = admin_url( 'admin.php?page="' . OPINIONSTAGE_CONTENT_LOGIN_CALLBACK_SLUG . '"&return_path=', $protocol );
184
- return $adminUrlForOs . urlencode( $url );
185
- }
150
  * Generates a to the callback page used to connect the plugin to the Opinion Stage account
151
  */
152
  function opinionstage_callback_url() {
153
+ return menu_page_url(OPINIONSTAGE_LOGIN_CALLBACK_SLUG, false);
154
  }
155
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
opinionstage-polls.php CHANGED
@@ -3,7 +3,7 @@
3
  Plugin Name: Poll, Survey, Form & Quiz Maker by OpinionStage (Deprecated)
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.7.2
7
  Author: OpinionStage.com
8
  Author URI: https://www.opinionstage.com
9
  Text Domain: social-polls-by-opinionstage
3
  Plugin Name: Poll, Survey, Form & Quiz Maker by OpinionStage (Deprecated)
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.7.3
7
  Author: OpinionStage.com
8
  Author URI: https://www.opinionstage.com
9
  Text Domain: social-polls-by-opinionstage
plugin.php CHANGED
@@ -8,7 +8,7 @@
8
  * Plugin Name: Poll, Survey, Form & Quiz Maker by OpinionStage
9
  * Plugin URI: https://www.opinionstage.com
10
  * 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.
11
- * Version: 19.7.2
12
  * Author: OpinionStage.com
13
  * Author URI: https://www.opinionstage.com
14
  * Text Domain: social-polls-by-opinionstage
@@ -34,13 +34,13 @@ if ( defined( 'WP_DEBUG' ) && true === WP_DEBUG ) {
34
  }
35
  }
36
 
37
- define( 'OPINIONSTAGE_WIDGET_VERSION', '19.7.2' );
38
 
39
  define( 'OPINIONSTAGE_TEXT_DOMAIN', 'social-polls-by-opinionstage' );
40
 
41
  define( 'OPINIONSTAGE_SERVER_BASE', isset( $opinionstage_settings['server_base'] ) ? $opinionstage_settings['server_base'] : 'https://www.opinionstage.com' );
42
- define( 'OPINIONSTAGE_LOGIN_PATH', OPINIONSTAGE_SERVER_BASE . '/integrations/wordpress/new' );
43
  define( 'OPINIONSTAGE_API_PATH', OPINIONSTAGE_SERVER_BASE . '/api/v1' );
 
44
  define( 'OPINIONSTAGE_CONTENT_POPUP_CLIENT_WIDGETS_API', OPINIONSTAGE_SERVER_BASE . '/api/wp/v1/my/widgets' );
45
  define( 'OPINIONSTAGE_CONTENT_POPUP_SHARED_WIDGETS_API', OPINIONSTAGE_SERVER_BASE . '/api/wp/v1/shared_widgets' );
46
  define( 'OPINIONSTAGE_CONTENT_POPUP_CLIENT_WIDGETS_API_RECENT_UPDATE', OPINIONSTAGE_SERVER_BASE . '/api/wp/v1/my/widgets/recent-update' );
8
  * Plugin Name: Poll, Survey, Form & Quiz Maker by OpinionStage
9
  * Plugin URI: https://www.opinionstage.com
10
  * 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.
11
+ * Version: 19.7.3
12
  * Author: OpinionStage.com
13
  * Author URI: https://www.opinionstage.com
14
  * Text Domain: social-polls-by-opinionstage
34
  }
35
  }
36
 
37
+ define( 'OPINIONSTAGE_WIDGET_VERSION', '19.7.3' );
38
 
39
  define( 'OPINIONSTAGE_TEXT_DOMAIN', 'social-polls-by-opinionstage' );
40
 
41
  define( 'OPINIONSTAGE_SERVER_BASE', isset( $opinionstage_settings['server_base'] ) ? $opinionstage_settings['server_base'] : 'https://www.opinionstage.com' );
 
42
  define( 'OPINIONSTAGE_API_PATH', OPINIONSTAGE_SERVER_BASE . '/api/v1' );
43
+ define( 'OPINIONSTAGE_LOGIN_PATH', OPINIONSTAGE_SERVER_BASE . '/api/wp/v1/auth/new' );
44
  define( 'OPINIONSTAGE_CONTENT_POPUP_CLIENT_WIDGETS_API', OPINIONSTAGE_SERVER_BASE . '/api/wp/v1/my/widgets' );
45
  define( 'OPINIONSTAGE_CONTENT_POPUP_SHARED_WIDGETS_API', OPINIONSTAGE_SERVER_BASE . '/api/wp/v1/shared_widgets' );
46
  define( 'OPINIONSTAGE_CONTENT_POPUP_CLIENT_WIDGETS_API_RECENT_UPDATE', OPINIONSTAGE_SERVER_BASE . '/api/wp/v1/my/widgets/recent-update' );
readme.txt CHANGED
@@ -4,7 +4,7 @@ Donate link: https://www.opinionstage.com
4
  Tags: poll, quiz, survey, poll plugin, quiz plugin, survey plugin
5
  Requires at least: 2.8
6
  Tested up to: 5.5
7
- Stable tag: 19.7.2
8
  Requires PHP: 5.2
9
 
10
  Add a Poll, Survey, or Quiz to your Wordpress site. Create a poll, quiz, or survey from scratch or based on templates.
@@ -138,6 +138,9 @@ Opinion Stage makes it easy for you to comply with the GDPR regulation. For more
138
  N/A
139
 
140
  == Changelog ==
 
 
 
141
  = 19.7.2 =
142
  * signup callback - higher priority added
143
  = 19.7.1 =
4
  Tags: poll, quiz, survey, poll plugin, quiz plugin, survey plugin
5
  Requires at least: 2.8
6
  Tested up to: 5.5
7
+ Stable tag: 19.7.3
8
  Requires PHP: 5.2
9
 
10
  Add a Poll, Survey, or Quiz to your Wordpress site. Create a poll, quiz, or survey from scratch or based on templates.
138
  N/A
139
 
140
  == Changelog ==
141
+ = 19.7.3 =
142
+ * updated signup functional
143
+ * internal code improvements
144
  = 19.7.2 =
145
  * signup callback - higher priority added
146
  = 19.7.1 =