Initial commit: Atomaste website

This commit is contained in:
2025-12-10 12:17:30 -05:00
commit 0b9e5d1605
19260 changed files with 5206382 additions and 0 deletions

View File

@@ -0,0 +1,41 @@
Version 1.0.7 - 13-01-2025
- Improvement:
- Enhanced core loading mechanism to prevent potential plugin conflicts.
- Refactored codebase to adhere to core coding standards, improving overall readability and maintainability.
- Updated popup UI to prevent external overlapping issues, ensuring better user experience.
- New:
- Introduced internal filters to provide flexibility in customizing rating submission data.
Version 1.0.6 - 31-12-2024
- Improvement:
- Optimized performance by preventing unnecessary markup loading on screens where specific screen IDs are provided.
- Fix:
- Resolved console errors that occurred during popup dismissal, ensuring smoother user interaction.
Version 1.0.5 - 19-12-2024
- New:
- Introduced a configuration option to display pop-up on the dashboards of specific plugins.
- Improvement:
- Enhanced mobile responsiveness of the popup.
- Fix:
- Corrected popup positioning in RTL (Right-to-Left) layouts.
- Resolved overlap issues between the popup and other elements in Spectra.
Version 1.0.4 - 13-12-2024
- Improvement: Optimized file loading to prevent duplicate loads, enhancing performance.
Version 1.0.3 - 10-12-2024
- Fix: Fixed library update issue.
Version 1.0.2 - 09-12-2024
- Improvement: NPS popup will now be permanently dismissed when closed for the second time.
- Improvement: Added an option to customize the rate button text for plugins/themes.
- Fix: Resolved CSS conflicts with other plugins.
Version 1.0.1 - 20-11-2024
- New: Added filter to 'nps_survey_allowed_screens' to allow custom screens.
- New: Added filter to 'nps_survey_build_url' update build url for themes.
Version 1.0.0 - 23-09-2024
- New: Initial release.

View File

@@ -0,0 +1,507 @@
<?php
/**
* NPS Survey Script
* File to handle behaviour and content of NPS popup
*
* @package {{package}}
*/
/**
* Nps_Survey
*/
class Nps_Survey {
/**
* Instance
*
* @access private
* @var object Class Instance.
* @since 1.0.0
*/
private static $instance = null;
/**
* Constructor.
*
* @since 1.0.0
*/
public function __construct() {
add_action( 'rest_api_init', array( $this, 'register_route' ) );
}
/**
* Initiator
*
* @since 1.0.0
* @return object initialized object of class.
*/
public static function get_instance() {
if ( null === self::$instance ) {
self::$instance = new self();
}
return self::$instance;
}
/**
* Render NPS Survey.
*
* @param string $id ID of the root element, should start with nps-survey- .
* @param array<mixed> $vars Variables to be passed to the NPS.
* @since 1.0.0
* @return void
*/
public static function show_nps_notice( string $id, array $vars = [] ): void {
if ( ! isset( $vars['plugin_slug'] ) || ! is_string( $vars['plugin_slug'] ) ) {
return;
}
$plugin_slug = $vars['plugin_slug'];
$display_after = is_int( $vars['display_after'] ) ? $vars['display_after'] : 0;
if ( ! self::is_show_nps_survey_form( $plugin_slug, $display_after ) ) {
return;
}
$show_on_screen = ! empty( $vars['show_on_screens'] ) && is_array( $vars['show_on_screens'] ) ? $vars['show_on_screens'] : [ 'dashboard' ];
if ( ! function_exists( 'get_current_screen' ) ) {
require_once ABSPATH . '/wp-admin/includes/screen.php';
}
$current_screen = get_current_screen();
if ( $current_screen instanceof WP_Screen && ! in_array( $current_screen->id, $show_on_screen, true ) ) {
return;
}
// Loading script here to confirm if the screen is allowed or not.
self::editor_load_scripts( $show_on_screen );
?><div data-id="<?php echo esc_attr( $id ); ?>" class="nps-survey-root" data-vars="<?php echo esc_attr( strval( wp_json_encode( $vars ) ) ); ?>"></div>
<?php
}
/**
* Generate and return the Google fonts url.
*
* @since 1.0.2
* @return string
*/
public static function google_fonts_url() {
$font_families = array(
'Figtree:400,500,600,700',
);
$query_args = array(
'family' => rawurlencode( implode( '|', $font_families ) ),
'subset' => rawurlencode( 'latin,latin-ext' ),
);
return add_query_arg( $query_args, '//fonts.googleapis.com/css' );
}
/**
* Load script.
*
* @param array<string> $show_on_screens An array of screen IDs where the scripts should be loaded.
* @since 1.0.0
* @return void
*/
public static function editor_load_scripts( $show_on_screens ): void {
if ( ! is_admin() ) {
return;
}
$screen = get_current_screen();
$screen_id = $screen ? $screen->id : '';
if ( ! in_array( $screen_id, $show_on_screens, true ) ) {
return;
}
$handle = 'nps-survey-script';
$build_path = NPS_SURVEY_DIR . 'dist/';
$default_build_url = NPS_SURVEY_URL . 'dist/';
// Use a filter to allow $build_url to be modified externally.
$build_url = apply_filters( 'nps_survey_build_url', $default_build_url );
$script_asset_path = $build_path . 'main.asset.php';
$script_info = file_exists( $script_asset_path )
? include $script_asset_path
: array(
'dependencies' => array(),
'version' => NPS_SURVEY_VER,
);
$script_dep = array_merge( $script_info['dependencies'], array( 'jquery' ) );
wp_enqueue_script(
$handle,
$build_url . 'main.js',
$script_dep,
$script_info['version'],
true
);
$data = apply_filters(
'nps_survey_vars',
[
'ajaxurl' => esc_url( admin_url( 'admin-ajax.php' ) ),
'_ajax_nonce' => wp_create_nonce( 'nps-survey' ),
'rest_api_nonce' => current_user_can( 'manage_options' ) ? wp_create_nonce( 'wp_rest' ) : '',
]
);
// Add localize JS.
wp_localize_script(
'nps-survey-script',
'npsSurvey',
$data
);
wp_enqueue_style( 'nps-survey-style', $build_url . '/style-main.css', array(), NPS_SURVEY_VER );
wp_style_add_data( 'nps-survey-style', 'rtl', 'replace' );
wp_enqueue_style( 'nps-survey-google-fonts', self::google_fonts_url(), array(), 'all' );
}
/**
* Load all the required files in the importer.
*
* @since 1.0.0
* @return void
*/
public static function register_route(): void {
register_rest_route(
self::get_api_namespace(),
'/rating/',
array(
array(
'methods' => \WP_REST_Server::CREATABLE,
'callback' => array( self::class, 'submit_rating' ),
'permission_callback' => array( self::class, 'get_item_permissions_check' ),
'args' => array(),
),
)
);
register_rest_route(
self::get_api_namespace(),
'/dismiss-nps-survey/',
array(
array(
'methods' => \WP_REST_Server::CREATABLE,
'callback' => array( self::class, 'dismiss_nps_survey_panel' ),
'permission_callback' => array( self::class, 'get_item_permissions_check' ),
'args' => array(),
),
)
);
}
/**
* Get the API URL.
*
* @since 1.0.0
*
* @return string
*/
public static function get_api_domain() {
return trailingslashit( defined( 'NPS_SURVEY_REMOTE_URL' ) ? NPS_SURVEY_REMOTE_URL : apply_filters( 'nps_survey_api_domain', 'https://websitedemos.net/' ) );
}
/**
* Get api namespace
*
* @since 1.0.0
* @return string
*/
public static function get_api_namespace() {
return 'nps-survey/v1';
}
/**
* Get API headers
*
* @since 1.0.0
* @return array<string, string>
*/
public static function get_api_headers() {
return array(
'Content-Type' => 'application/json',
'Accept' => 'application/json',
);
}
/**
* Check whether a given request has permission to read notes.
*
* @param object $request WP_REST_Request Full details about the request.
* @return object|bool
*/
public static function get_item_permissions_check( $request ) {
if ( ! current_user_can( 'manage_options' ) ) {
return new \WP_Error(
'gt_rest_cannot_access',
__( 'Sorry, you are not allowed to do that.', 'astra-sites' ),
array( 'status' => rest_authorization_required_code() )
);
}
return true;
}
/**
* Submit Ratings.
*
* @param \WP_REST_Request $request Request object.
* @return void
* @phpstan-ignore-next-line
*/
public static function submit_rating( $request ) {
$nonce = $request->get_header( 'X-WP-Nonce' );
// Verify the nonce.
if ( ! wp_verify_nonce( sanitize_text_field( (string) $nonce ), 'wp_rest' ) ) {
wp_send_json_error(
array(
'data' => __( 'Nonce verification failed.', 'astra-sites' ),
'status' => false,
)
);
}
$current_user = wp_get_current_user();
/**
* Filter the post data.
* This can be used to modify the post data before sending it to the API.
*
* @param array<mixed> $post_data Post data.
* @return array<mixed>
*/
$post_data = apply_filters(
'nps_survey_post_data',
array(
'rating' => ! empty( $request['rating'] ) ? sanitize_text_field( strval( $request['rating'] ) ) : '',
'comment' => ! empty( $request['comment'] ) ? sanitize_text_field( strval( $request['comment'] ) ) : '',
'email' => $current_user->user_email,
'first_name' => $current_user->first_name ?? $current_user->display_name,
'last_name' => $current_user->last_name ?? '',
'source' => ! empty( $request['plugin_slug'] ) ? sanitize_text_field( strval( $request['plugin_slug'] ) ) : '',
'plugin_slug' => ! empty( $request['plugin_slug'] ) ? sanitize_text_field( strval( $request['plugin_slug'] ) ) : '',
)
);
/**
* Filter the API endpoint.
*
* @param string $api_endpoint API endpoint.
* @param array<mixed> $post_data Post data.
*
* @return string
*/
$api_endpoint = apply_filters(
'nps_survey_api_endpoint',
self::get_api_domain() . 'wp-json/starter-templates/v1/nps-survey/',
$post_data // Pass the post data to the filter, so that the endpoint can be modified based on the data.
);
$post_data_in_json = wp_json_encode( $post_data );
$request_args = array(
'body' => $post_data_in_json ? $post_data_in_json : '',
'headers' => self::get_api_headers(),
'timeout' => 60,
);
$response = wp_safe_remote_post( $api_endpoint, $request_args );
if ( is_wp_error( $response ) ) {
// There was an error in the request.
wp_send_json_error(
array(
'data' => 'Failed ' . $response->get_error_message(),
'status' => false,
)
);
}
$response_code = wp_remote_retrieve_response_code( $response );
if ( 200 === $response_code ) {
$nps_form_status = array(
'dismiss_count' => 0,
'dismiss_permanently' => true,
'dismiss_step' => '',
);
update_option( self::get_nps_id( strval( $request['plugin_slug'] ) ), $nps_form_status, false );
wp_send_json_success(
array(
'status' => true,
)
);
} else {
wp_send_json_error(
array(
'status' => false,
)
);
}
}
/**
* Dismiss NPS Survey.
*
* @param \WP_REST_Request $request Request object.
* @return void
* @phpstan-ignore-next-line
*/
public static function dismiss_nps_survey_panel( $request ) {
$nonce = $request->get_header( 'X-WP-Nonce' );
// Verify the nonce.
if ( ! wp_verify_nonce( sanitize_text_field( (string) $nonce ), 'wp_rest' ) ) {
wp_send_json_error(
array(
'data' => __( 'Nonce verification failed.', 'astra-sites' ),
'status' => false,
)
);
}
$nps_form_status = self::get_nps_survey_dismiss_status( strval( $request['plugin_slug'] ) );
// Add dismiss timespan.
$nps_form_status['dismiss_timespan'] = $request['dismiss_timespan'];
// Add dismiss date.
$nps_form_status['dismiss_time'] = time();
// Update dismiss count.
$nps_form_status['dismiss_count'] += 1;
$nps_form_status['dismiss_step'] = $request['current_step'];
// Dismiss Permanantly.
if ( $nps_form_status['dismiss_count'] >= 2 ) {
$nps_form_status['dismiss_permanently'] = true;
}
update_option( self::get_nps_id( strval( $request['plugin_slug'] ) ), $nps_form_status );
wp_send_json_success(
array(
'status' => true,
)
);
}
/**
* Get dismiss status of NPS Survey.
*
* @param string $plugin_slug slug of unique NPS Survey.
* @return array<string, mixed>
*/
public static function get_nps_survey_dismiss_status( string $plugin_slug ) {
$default_status = get_option(
self::get_nps_id( $plugin_slug ),
array(
'dismiss_count' => 0,
'dismiss_permanently' => false,
'dismiss_step' => '',
'dismiss_time' => '',
'dismiss_timespan' => null,
'first_render_time' => null,
)
);
if ( ! is_array( $default_status ) ) {
return array();
}
return array(
'dismiss_count' => ! empty( $default_status['dismiss_count'] ) ? $default_status['dismiss_count'] : 0,
'dismiss_permanently' => ! empty( $default_status['dismiss_permanently'] ) ? $default_status['dismiss_permanently'] : false,
'dismiss_step' => ! empty( $default_status['dismiss_step'] ) ? $default_status['dismiss_step'] : '',
'dismiss_time' => ! empty( $default_status['dismiss_time'] ) ? $default_status['dismiss_time'] : '',
'dismiss_timespan' => ! empty( $default_status['dismiss_timespan'] ) ? $default_status['dismiss_timespan'] : null,
'first_render_time' => ! empty( $default_status['first_render_time'] ) ? $default_status['first_render_time'] : null,
);
}
/**
* Show status of NPS Survey.
*
* @param string $plugin_slug slug of unique NPS Survey.
* @param int $display_after number of days after which NPS Survey should be displayed.
* @return bool
*/
public static function is_show_nps_survey_form( string $plugin_slug, int $display_after ) {
$current_time = time();
$status = self::get_nps_survey_dismiss_status( $plugin_slug );
if ( $status['dismiss_permanently'] ) {
return false;
}
$first_render_time = $status['first_render_time'];
if ( 0 !== $display_after ) {
if ( null === $first_render_time ) {
$status['first_render_time'] = $current_time;
update_option( self::get_nps_id( $plugin_slug ), $status );
$status = self::get_nps_survey_dismiss_status( $plugin_slug );
return false;
}
if ( $display_after + $first_render_time > $current_time ) {
return false;
}
}
// Retrieve the stored date time stamp from wp_options.
$stored_date_timestamp = $status['dismiss_time'];
$dismiss_timespan = $status['dismiss_timespan'];
if ( $stored_date_timestamp ) {
$current_time = time();
// time difference of current time and the time user dismissed the nps.
$time_difference = $current_time - $stored_date_timestamp;
// Check if two weeks have passed.
if ( $time_difference <= $dismiss_timespan ) {
return false;
}
}
return true;
}
/**
* Get NPS Dismiss Option Name.
*
* @param string $plugin_slug Plugin name.
* @return string
*/
public static function get_nps_id( $plugin_slug ) {
return 'nps-survey-' . $plugin_slug;
}
}
/**
* Kicking this off by calling 'get_instance()' method
*/
Nps_Survey::get_instance();

View File

@@ -0,0 +1 @@
<?php return array('dependencies' => array('react', 'wp-api-fetch', 'wp-element', 'wp-i18n'), 'version' => '098e9bb53b4690172575');

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,123 @@
.nps-survey-root .invisible {visibility: hidden
}.nps-survey-root .fixed {position: fixed
}.nps-survey-root .absolute {position: absolute
}.nps-survey-root .relative {position: relative
}.nps-survey-root .inset-0 {inset: 0px
}.nps-survey-root .bottom-2 {bottom: 0.5rem
}.nps-survey-root .right-2 {left: 0.5rem
}.nps-survey-root .right-3 {left: 0.75rem
}.nps-survey-root .top-3 {top: 0.75rem
}.nps-survey-root .isolate {isolation: isolate
}.nps-survey-root .z-\[9999999999\] {z-index: 9999999999
}.nps-survey-root .mx-0 {margin-right: 0px;margin-left: 0px
}.nps-survey-root .my-0 {margin-top: 0px;margin-bottom: 0px
}.nps-survey-root .mb-0 {margin-bottom: 0px
}.nps-survey-root .mt-1 {margin-top: 0.25rem
}.nps-survey-root .mt-2 {margin-top: 0.5rem
}.nps-survey-root .mt-3 {margin-top: 0.75rem
}.nps-survey-root .mt-5 {margin-top: 1.25rem
}.nps-survey-root .block {display: block
}.nps-survey-root .flex {display: flex
}.nps-survey-root .inline-flex {display: inline-flex
}.nps-survey-root .size-5 {width: 1.25rem;height: 1.25rem
}.nps-survey-root .size-6 {width: 1.5rem;height: 1.5rem
}.nps-survey-root .h-11 {height: 2.75rem
}.nps-survey-root .h-5 {height: 1.25rem
}.nps-survey-root .h-\[2\.625rem\] {height: 2.625rem
}.nps-survey-root .w-4 {width: 1rem
}.nps-survey-root .w-5 {width: 1.25rem
}.nps-survey-root .w-\[calc\(100\%-8px\)\] {width: calc(100% - 8px)
}.nps-survey-root .w-full {width: 100%
}.nps-survey-root .max-w-\[30rem\] {max-width: 30rem
}.nps-survey-root .flex-1 {flex: 1 1 0%
}@keyframes spin {to {transform: rotate(-360deg)
}
}.nps-survey-root .animate-spin {animation: spin 1s linear infinite
}.nps-survey-root .cursor-not-allowed {cursor: not-allowed
}.nps-survey-root .cursor-pointer {cursor: pointer
}.nps-survey-root .cursor-progress {cursor: progress
}.nps-survey-root .resize {resize: both
}.nps-survey-root .items-center {align-items: center
}.nps-survey-root .justify-start {justify-content: flex-start
}.nps-survey-root .justify-center {justify-content: center
}.nps-survey-root .justify-between {justify-content: space-between
}.nps-survey-root .gap-2 {gap: 0.5rem
}.nps-survey-root .rounded {border-radius: 0.25rem
}.nps-survey-root .rounded-lg {border-radius: 0.5rem
}.nps-survey-root .rounded-md {border-radius: 0.375rem
}.nps-survey-root .border {border-width: 1px
}.nps-survey-root .border-0 {border-width: 0px
}.nps-survey-root .border-solid {border-style: solid
}.nps-survey-root .border-none {border-style: none
}.nps-survey-root .border-border-tertiary {--tw-border-opacity: 1;border-color: rgb(216 223 233 / var(--tw-border-opacity))
}.nps-survey-root .border-button-disabled {--tw-border-opacity: 1;border-color: rgb(229 231 235 / var(--tw-border-opacity))
}.nps-survey-root .border-nps-button-background {--tw-border-opacity: 1;border-color: rgb(34 113 177 / var(--tw-border-opacity))
}.nps-survey-root .border-transparent {border-color: transparent
}.nps-survey-root .border-white {--tw-border-opacity: 1;border-color: rgb(255 255 255 / var(--tw-border-opacity))
}.nps-survey-root .border-zip-body-text {--tw-border-opacity: 1;border-color: rgb(var(--zip-body-text) / var(--tw-border-opacity))
}.nps-survey-root .bg-nps-button-background {--tw-bg-opacity: 1;background-color: rgb(34 113 177 / var(--tw-bg-opacity))
}.nps-survey-root .bg-transparent {background-color: transparent
}.nps-survey-root .bg-white {--tw-bg-opacity: 1;background-color: rgb(255 255 255 / var(--tw-bg-opacity))
}.nps-survey-root .p-4 {padding: 1rem
}.nps-survey-root .px-4 {padding-right: 1rem;padding-left: 1rem
}.nps-survey-root .px-5 {padding-right: 1.25rem;padding-left: 1.25rem
}.nps-survey-root .px-6 {padding-right: 1.5rem;padding-left: 1.5rem
}.nps-survey-root .py-1\.5 {padding-top: 0.375rem;padding-bottom: 0.375rem
}.nps-survey-root .py-2 {padding-top: 0.5rem;padding-bottom: 0.5rem
}.nps-survey-root .py-3 {padding-top: 0.75rem;padding-bottom: 0.75rem
}.nps-survey-root .pl-0 {padding-right: 0px
}.nps-survey-root .pl-3 {padding-right: 0.75rem
}.nps-survey-root .pl-4 {padding-right: 1rem
}.nps-survey-root .pl-5 {padding-right: 1.25rem
}.nps-survey-root .pl-6 {padding-right: 1.5rem
}.nps-survey-root .pr-3 {padding-left: 0.75rem
}.nps-survey-root .pr-4 {padding-left: 1rem
}.nps-survey-root .pr-5 {padding-left: 1.25rem
}.nps-survey-root .pr-6 {padding-left: 1.5rem
}.nps-survey-root .text-base {font-size: 1rem;line-height: 1.5rem
}.nps-survey-root .text-lg {font-size: 1.125rem;line-height: 1.75rem
}.nps-survey-root .text-sm {font-size: 0.875rem;line-height: 1.25rem
}.nps-survey-root .text-xs {font-size: 0.75rem;line-height: 1rem
}.nps-survey-root .font-bold {font-weight: 700
}.nps-survey-root .font-medium {font-weight: 500
}.nps-survey-root .font-normal {font-weight: 400
}.nps-survey-root .font-semibold {font-weight: 600
}.nps-survey-root .leading-5 {line-height: 1.25rem
}.nps-survey-root .leading-6 {line-height: 1.5rem
}.nps-survey-root .leading-7 {line-height: 1.75rem
}.nps-survey-root .text-border-secondary {--tw-text-opacity: 1;color: rgb(107 114 128 / var(--tw-text-opacity))
}.nps-survey-root .text-nps-button-background {--tw-text-opacity: 1;color: rgb(34 113 177 / var(--tw-text-opacity))
}.nps-survey-root .text-secondary-text {--tw-text-opacity: 1;color: rgb(156 163 175 / var(--tw-text-opacity))
}.nps-survey-root .text-white {--tw-text-opacity: 1;color: rgb(255 255 255 / var(--tw-text-opacity))
}.nps-survey-root .text-zip-app-heading {--tw-text-opacity: 1;color: rgb(var(--zip-app-heading) / var(--tw-text-opacity))
}.nps-survey-root .text-zip-app-inactive-icon {--tw-text-opacity: 1;color: rgb(var(--zip-app-inactive-icon) / var(--tw-text-opacity))
}.nps-survey-root .text-zip-body-text {--tw-text-opacity: 1;color: rgb(var(--zip-body-text) / var(--tw-text-opacity))
}.nps-survey-root .underline {text-decoration-line: underline
}.nps-survey-root .no-underline {text-decoration-line: none
}.nps-survey-root .opacity-25 {opacity: 0.25
}.nps-survey-root .opacity-50 {opacity: 0.5
}.nps-survey-root .opacity-70 {opacity: 0.7
}.nps-survey-root .opacity-75 {opacity: 0.75
}.nps-survey-root .shadow-lg {--tw-shadow: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);--tw-shadow-colored: 0 10px 15px -3px var(--tw-shadow-color), 0 4px 6px -4px var(--tw-shadow-color);box-shadow: var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow)
}.nps-survey-root .shadow-sm {--tw-shadow: 0px 1px 2px 0px rgba(0, 0, 0, 0.05);--tw-shadow-colored: 0px 1px 2px 0px var(--tw-shadow-color);box-shadow: var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow)
}.nps-survey-root .transition {transition-property: color, background-color, border-color, text-decoration-color, fill, stroke, opacity, box-shadow, transform, filter, -webkit-backdrop-filter;transition-property: color, background-color, border-color, text-decoration-color, fill, stroke, opacity, box-shadow, transform, filter, backdrop-filter;transition-property: color, background-color, border-color, text-decoration-color, fill, stroke, opacity, box-shadow, transform, filter, backdrop-filter, -webkit-backdrop-filter;transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);transition-duration: 150ms
}.nps-survey-root .transition-colors {transition-property: color, background-color, border-color, text-decoration-color, fill, stroke;transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);transition-duration: 150ms
}.nps-survey-root .duration-150 {transition-duration: 150ms
}.nps-survey-root .ease-in-out {transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1)
}.nps-survey-root {font-size: 1rem;line-height: 1.5rem
}.nps-survey-root * {box-sizing: border-box;font-family: Figtree, sans-serif
}.nps-survey-root .hover\:cursor-pointer:hover {cursor: pointer
}.nps-survey-root .hover\:bg-gray-50:hover {--tw-bg-opacity: 1;background-color: rgb(249 250 251 / var(--tw-bg-opacity))
}.nps-survey-root .focus\:z-10:focus {z-index: 10
}.nps-survey-root .focus\:ring-1:focus {--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow: var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow, 0 0 #0000)
}.nps-survey-root .focus\:ring-nps-button-background:focus {--tw-ring-opacity: 1;--tw-ring-color: rgb(34 113 177 / var(--tw-ring-opacity))
}.nps-survey-root .focus-visible\:outline:focus-visible {outline-style: solid
}.nps-survey-root .focus-visible\:outline-2:focus-visible {outline-width: 2px
}.nps-survey-root .focus-visible\:outline-offset-2:focus-visible {outline-offset: 2px
}@media (min-width: 512px) {.nps-survey-root .xs\:w-full {width: 100%
}
}@media (min-width: 640px) {.nps-survey-root .sm\:p-5 {padding: 1.25rem
}.nps-survey-root .sm\:text-sm {font-size: 0.875rem;line-height: 1.25rem
}.nps-survey-root .sm\:leading-6 {line-height: 1.5rem
}
}

View File

@@ -0,0 +1,123 @@
.nps-survey-root .invisible {visibility: hidden
}.nps-survey-root .fixed {position: fixed
}.nps-survey-root .absolute {position: absolute
}.nps-survey-root .relative {position: relative
}.nps-survey-root .inset-0 {inset: 0px
}.nps-survey-root .bottom-2 {bottom: 0.5rem
}.nps-survey-root .right-2 {right: 0.5rem
}.nps-survey-root .right-3 {right: 0.75rem
}.nps-survey-root .top-3 {top: 0.75rem
}.nps-survey-root .isolate {isolation: isolate
}.nps-survey-root .z-\[9999999999\] {z-index: 9999999999
}.nps-survey-root .mx-0 {margin-left: 0px;margin-right: 0px
}.nps-survey-root .my-0 {margin-top: 0px;margin-bottom: 0px
}.nps-survey-root .mb-0 {margin-bottom: 0px
}.nps-survey-root .mt-1 {margin-top: 0.25rem
}.nps-survey-root .mt-2 {margin-top: 0.5rem
}.nps-survey-root .mt-3 {margin-top: 0.75rem
}.nps-survey-root .mt-5 {margin-top: 1.25rem
}.nps-survey-root .block {display: block
}.nps-survey-root .flex {display: flex
}.nps-survey-root .inline-flex {display: inline-flex
}.nps-survey-root .size-5 {width: 1.25rem;height: 1.25rem
}.nps-survey-root .size-6 {width: 1.5rem;height: 1.5rem
}.nps-survey-root .h-11 {height: 2.75rem
}.nps-survey-root .h-5 {height: 1.25rem
}.nps-survey-root .h-\[2\.625rem\] {height: 2.625rem
}.nps-survey-root .w-4 {width: 1rem
}.nps-survey-root .w-5 {width: 1.25rem
}.nps-survey-root .w-\[calc\(100\%-8px\)\] {width: calc(100% - 8px)
}.nps-survey-root .w-full {width: 100%
}.nps-survey-root .max-w-\[30rem\] {max-width: 30rem
}.nps-survey-root .flex-1 {flex: 1 1 0%
}@keyframes spin {to {transform: rotate(360deg)
}
}.nps-survey-root .animate-spin {animation: spin 1s linear infinite
}.nps-survey-root .cursor-not-allowed {cursor: not-allowed
}.nps-survey-root .cursor-pointer {cursor: pointer
}.nps-survey-root .cursor-progress {cursor: progress
}.nps-survey-root .resize {resize: both
}.nps-survey-root .items-center {align-items: center
}.nps-survey-root .justify-start {justify-content: flex-start
}.nps-survey-root .justify-center {justify-content: center
}.nps-survey-root .justify-between {justify-content: space-between
}.nps-survey-root .gap-2 {gap: 0.5rem
}.nps-survey-root .rounded {border-radius: 0.25rem
}.nps-survey-root .rounded-lg {border-radius: 0.5rem
}.nps-survey-root .rounded-md {border-radius: 0.375rem
}.nps-survey-root .border {border-width: 1px
}.nps-survey-root .border-0 {border-width: 0px
}.nps-survey-root .border-solid {border-style: solid
}.nps-survey-root .border-none {border-style: none
}.nps-survey-root .border-border-tertiary {--tw-border-opacity: 1;border-color: rgb(216 223 233 / var(--tw-border-opacity))
}.nps-survey-root .border-button-disabled {--tw-border-opacity: 1;border-color: rgb(229 231 235 / var(--tw-border-opacity))
}.nps-survey-root .border-nps-button-background {--tw-border-opacity: 1;border-color: rgb(34 113 177 / var(--tw-border-opacity))
}.nps-survey-root .border-transparent {border-color: transparent
}.nps-survey-root .border-white {--tw-border-opacity: 1;border-color: rgb(255 255 255 / var(--tw-border-opacity))
}.nps-survey-root .border-zip-body-text {--tw-border-opacity: 1;border-color: rgb(var(--zip-body-text) / var(--tw-border-opacity))
}.nps-survey-root .bg-nps-button-background {--tw-bg-opacity: 1;background-color: rgb(34 113 177 / var(--tw-bg-opacity))
}.nps-survey-root .bg-transparent {background-color: transparent
}.nps-survey-root .bg-white {--tw-bg-opacity: 1;background-color: rgb(255 255 255 / var(--tw-bg-opacity))
}.nps-survey-root .p-4 {padding: 1rem
}.nps-survey-root .px-4 {padding-left: 1rem;padding-right: 1rem
}.nps-survey-root .px-5 {padding-left: 1.25rem;padding-right: 1.25rem
}.nps-survey-root .px-6 {padding-left: 1.5rem;padding-right: 1.5rem
}.nps-survey-root .py-1\.5 {padding-top: 0.375rem;padding-bottom: 0.375rem
}.nps-survey-root .py-2 {padding-top: 0.5rem;padding-bottom: 0.5rem
}.nps-survey-root .py-3 {padding-top: 0.75rem;padding-bottom: 0.75rem
}.nps-survey-root .pl-0 {padding-left: 0px
}.nps-survey-root .pl-3 {padding-left: 0.75rem
}.nps-survey-root .pl-4 {padding-left: 1rem
}.nps-survey-root .pl-5 {padding-left: 1.25rem
}.nps-survey-root .pl-6 {padding-left: 1.5rem
}.nps-survey-root .pr-3 {padding-right: 0.75rem
}.nps-survey-root .pr-4 {padding-right: 1rem
}.nps-survey-root .pr-5 {padding-right: 1.25rem
}.nps-survey-root .pr-6 {padding-right: 1.5rem
}.nps-survey-root .text-base {font-size: 1rem;line-height: 1.5rem
}.nps-survey-root .text-lg {font-size: 1.125rem;line-height: 1.75rem
}.nps-survey-root .text-sm {font-size: 0.875rem;line-height: 1.25rem
}.nps-survey-root .text-xs {font-size: 0.75rem;line-height: 1rem
}.nps-survey-root .font-bold {font-weight: 700
}.nps-survey-root .font-medium {font-weight: 500
}.nps-survey-root .font-normal {font-weight: 400
}.nps-survey-root .font-semibold {font-weight: 600
}.nps-survey-root .leading-5 {line-height: 1.25rem
}.nps-survey-root .leading-6 {line-height: 1.5rem
}.nps-survey-root .leading-7 {line-height: 1.75rem
}.nps-survey-root .text-border-secondary {--tw-text-opacity: 1;color: rgb(107 114 128 / var(--tw-text-opacity))
}.nps-survey-root .text-nps-button-background {--tw-text-opacity: 1;color: rgb(34 113 177 / var(--tw-text-opacity))
}.nps-survey-root .text-secondary-text {--tw-text-opacity: 1;color: rgb(156 163 175 / var(--tw-text-opacity))
}.nps-survey-root .text-white {--tw-text-opacity: 1;color: rgb(255 255 255 / var(--tw-text-opacity))
}.nps-survey-root .text-zip-app-heading {--tw-text-opacity: 1;color: rgb(var(--zip-app-heading) / var(--tw-text-opacity))
}.nps-survey-root .text-zip-app-inactive-icon {--tw-text-opacity: 1;color: rgb(var(--zip-app-inactive-icon) / var(--tw-text-opacity))
}.nps-survey-root .text-zip-body-text {--tw-text-opacity: 1;color: rgb(var(--zip-body-text) / var(--tw-text-opacity))
}.nps-survey-root .underline {text-decoration-line: underline
}.nps-survey-root .no-underline {text-decoration-line: none
}.nps-survey-root .opacity-25 {opacity: 0.25
}.nps-survey-root .opacity-50 {opacity: 0.5
}.nps-survey-root .opacity-70 {opacity: 0.7
}.nps-survey-root .opacity-75 {opacity: 0.75
}.nps-survey-root .shadow-lg {--tw-shadow: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);--tw-shadow-colored: 0 10px 15px -3px var(--tw-shadow-color), 0 4px 6px -4px var(--tw-shadow-color);box-shadow: var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow)
}.nps-survey-root .shadow-sm {--tw-shadow: 0px 1px 2px 0px rgba(0, 0, 0, 0.05);--tw-shadow-colored: 0px 1px 2px 0px var(--tw-shadow-color);box-shadow: var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow)
}.nps-survey-root .transition {transition-property: color, background-color, border-color, text-decoration-color, fill, stroke, opacity, box-shadow, transform, filter, -webkit-backdrop-filter;transition-property: color, background-color, border-color, text-decoration-color, fill, stroke, opacity, box-shadow, transform, filter, backdrop-filter;transition-property: color, background-color, border-color, text-decoration-color, fill, stroke, opacity, box-shadow, transform, filter, backdrop-filter, -webkit-backdrop-filter;transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);transition-duration: 150ms
}.nps-survey-root .transition-colors {transition-property: color, background-color, border-color, text-decoration-color, fill, stroke;transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);transition-duration: 150ms
}.nps-survey-root .duration-150 {transition-duration: 150ms
}.nps-survey-root .ease-in-out {transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1)
}.nps-survey-root {font-size: 1rem;line-height: 1.5rem
}.nps-survey-root * {box-sizing: border-box;font-family: Figtree, sans-serif
}.nps-survey-root .hover\:cursor-pointer:hover {cursor: pointer
}.nps-survey-root .hover\:bg-gray-50:hover {--tw-bg-opacity: 1;background-color: rgb(249 250 251 / var(--tw-bg-opacity))
}.nps-survey-root .focus\:z-10:focus {z-index: 10
}.nps-survey-root .focus\:ring-1:focus {--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow: var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow, 0 0 #0000)
}.nps-survey-root .focus\:ring-nps-button-background:focus {--tw-ring-opacity: 1;--tw-ring-color: rgb(34 113 177 / var(--tw-ring-opacity))
}.nps-survey-root .focus-visible\:outline:focus-visible {outline-style: solid
}.nps-survey-root .focus-visible\:outline-2:focus-visible {outline-width: 2px
}.nps-survey-root .focus-visible\:outline-offset-2:focus-visible {outline-offset: 2px
}@media (min-width: 512px) {.nps-survey-root .xs\:w-full {width: 100%
}
}@media (min-width: 640px) {.nps-survey-root .sm\:p-5 {padding: 1.25rem
}.nps-survey-root .sm\:text-sm {font-size: 0.875rem;line-height: 1.25rem
}.nps-survey-root .sm\:leading-6 {line-height: 1.5rem
}
}

View File

@@ -0,0 +1,100 @@
<?php
/**
* Plugin Loader.
*
* @package {{package}}
* @since {{since}}
*/
namespace NPS_Survey;
if ( ! class_exists( 'NPS_Survey_Plugin_Loader' ) ) {
/**
* Plugin_Loader
*
* @since X.X.X
*/
class NPS_Survey_Plugin_Loader {
/**
* Instance
*
* @access private
* @var object Class Instance.
* @since X.X.X
*/
private static $instance;
/**
* Constructor
*
* @since X.X.X
*/
public function __construct() {
spl_autoload_register( [ $this, 'autoload' ] );
add_action( 'wp_loaded', [ $this, 'load_files' ] );
}
/**
* Initiator
*
* @since X.X.X
* @return object initialized object of class.
*/
public static function get_instance() {
if ( null === self::$instance ) {
self::$instance = new self();
}
return self::$instance;
}
/**
* Autoload classes.
*
* @param string $class class name.
* @return void
*/
public function autoload( $class ): void {
if ( 0 !== strpos( $class, __NAMESPACE__ ) ) {
return;
}
$class_to_load = $class;
$filename = strtolower(
strval(
preg_replace(
[ '/^' . __NAMESPACE__ . '\\\/', '/([a-z])([A-Z])/', '/_/', '/\\\/' ],
[ '', '$1-$2', '-', DIRECTORY_SEPARATOR ],
$class_to_load
)
)
);
$file = NPS_SURVEY_DIR . $filename . '.php';
// if the file redable, include it.
if ( is_readable( $file ) ) {
require_once $file;
}
}
/**
* Load Files
*
* @since 1.0.0
*
* @return void
*/
public function load_files(): void {
require_once NPS_SURVEY_DIR . 'classes/nps-survey-script.php';
}
}
/**
* Kicking this off by calling 'get_instance()' method
*/
NPS_Survey_Plugin_Loader::get_instance();
}

View File

@@ -0,0 +1,26 @@
<?php
/**
* Plugin Name: NPS Survey
* Description: It is a nps survey library.
* Author: Brainstorm Force
* Version: 1.0.7
* License: GPL v2
* Text Domain: nps-survey
*
* @package {{package}}
*/
/**
* Set constants
* Check of plugin constant is already defined
*/
if ( defined( 'NPS_SURVEY_FILE' ) ) {
return;
}
define( 'NPS_SURVEY_FILE', __FILE__ );
define( 'NPS_SURVEY_BASE', plugin_basename( NPS_SURVEY_FILE ) );
define( 'NPS_SURVEY_DIR', plugin_dir_path( NPS_SURVEY_FILE ) );
define( 'NPS_SURVEY_URL', plugins_url( '/', NPS_SURVEY_FILE ) );
define( 'NPS_SURVEY_VER', '1.0.7' );
require_once 'nps-survey-plugin-loader.php';

View File

@@ -0,0 +1,3 @@
{
"nps-survey": "1.0.7"
}