Plugin Directory

Changeset 3335314


Ignore:
Timestamp:
07/28/2025 11:00:01 AM (7 months ago)
Author:
mohammedashfaque
Message:

New changes

Location:
flash-popup-builder/trunk
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • flash-popup-builder/trunk/admin/assets/css/style.css

    r3310775 r3335314  
     1
     2@font-face {
     3    font-family: 'Segoe UI Bold';
     4    src: url('../font/Segoe_UI_Bold.ttf') format('truetype');
     5    font-style: normal;
     6    font-stretch: normal;
     7    font-display: swap;
     8}
     9@font-face {
     10    font-family: 'Segoe UI';
     11    src: url('../font/Segoe_UI.ttf') format('truetype');
     12    font-style: normal;
     13    font-stretch: normal;
     14    font-display: swap;
     15}
     16@font-face {
     17    font-family: 'Segoe UI Semibold';
     18    src: url('../font/Segoe_UI_Semibold.ttf') format('truetype');
     19}
    120.template-wrapper {
    221  margin-top: 3%;
     
    528547  justify-content: space-between;
    529548  padding: 10px 20px;
     549      gap: 50px;
    530550}
    531551
     
    538558  flex-grow: 1;
    539559  justify-content: flex-start;
     560      gap: 20px;
     561      border: unset;
    540562}
    541563
     
    550572  border: none;
    551573  padding: 10px 15px;
     574  background: transparent;
    552575}
    553576
     
    628651  cursor: not-allowed;
    629652}
     653
     654
     655/* new css */
     656.flash-popup-builder-nav{
     657  background: #F2F2F2;
     658  box-shadow: 0px 3px 6px #00000047;
     659}
     660.flash-popup-builder-nav .nav-tabs .nav-link{
     661  border-radius: 0;
     662}
     663#fpbt-block-tab{
     664  width: 100%;
     665    margin-top: 3%;
     666}
     667#fpbt-block-tab .search-wrapper-box{
     668  background: #F2F2F2 0% 0% no-repeat padding-box;
     669  box-shadow: 0px 0px 6px #00000047;
     670  padding: 5px;
     671  /* position: fixed; */
     672  position: sticky;
     673  top: 0;
     674}
     675#search-box{
     676     position: relative;
     677    display: flex;
     678    align-items: center;
     679    width: fit-content;
     680    padding: 0px !important;
     681    box-shadow: 0px 3px 6px #00000047;
     682    background-color:transparent;
     683}
     684#search-button{
     685
     686  padding-left: 12px !important;
     687  background: transparent;
     688  border: none;
     689  position: relative;
     690    border-left: 1px solid #fcb103;
     691}
     692#api-response-list{
     693  padding: 5px;
     694  padding: 5px;
     695  height: 700px;
     696  overflow-y: scroll;
     697}
     698::-webkit-scrollbar {
     699  width: 2px; /* vertical scrollbar */
     700  height: 2px; /* horizontal scrollbar */
     701}
     702
     703::-webkit-scrollbar-thumb {
     704  background-color: #999;
     705  border-radius: 1px;
     706}
     707
     708::-webkit-scrollbar-track {
     709  background: transparent;
     710}
     711#fpbt-block-tab .search-container{
     712      width: 100%;
     713    background: #000;
     714  padding: 9px 5px !important;
     715        box-shadow: 0px 3px 6px #00000047;
     716}
     717#fpbt-block-tab input{
     718width: 100%;
     719    border: none;
     720    color: #EEC910;
     721       font-size: 14px;
     722    padding-left: 10px !important;
     723}
     724#fpbt-block-tab input::placeholder{
     725      color: #EEC910;
     726}
     727 
     728#fpbt-block-tab .list-group-item{
     729    margin: 0;
     730    background: transparent;
     731    border: none;
     732    font: 16px / 20px Segoe UI;
     733    border-radius: 0 !important;
     734    cursor: pointer;
     735}
     736#fpbt-block-tab .list-group-item.active{
     737  background:#EBB503;
     738  box-shadow: 0px 3px 6px #00000047;
     739  color: #000 !important;
     740}
     741.card-img-wrap{
     742    height: 266px;
     743    box-shadow: 0px 0px 6px #00000080;
     744    border-radius: 0px;
     745    position: relative;
     746    top: -20px;
     747    left: -20px;
     748}
     749#product-cards .card-img-wrap img{
     750      height: 100%;
     751    width: 100%;
     752    object-fit: cover;
     753    object-position: top;
     754    border-radius: 4px;
     755}
     756#product-cards .card{
     757    background: #FFFFFF;
     758    box-shadow: 0px 3px 6px #00000029;
     759    border-radius: 4px;
     760    padding: 0;
     761    border: none;
     762    width: 85%;
     763    margin: 0 auto;
     764}
     765.pro-price{
     766    background: #000000;
     767    font: 30px / 35px Segoe UI Bold;
     768    letter-spacing: 0px;
     769    color: #EEC910;
     770    border-radius: 6px;
     771    margin-top: 0 !important;
     772    padding: 10px;
     773        height: min-content;
     774}
     775
     776#product-cards{
     777  padding-top: 20px;
     778  gap: 40px 0;
     779  height: 780px;
     780  overflow-y: scroll;
     781      margin: 0 20px;
     782}
     783
     784#product-cards .card-title{
     785    font: 18px / 25px Segoe UI Semibold;
     786}
     787.card-content-wrap{
     788    padding: 0 10px 10px 10px;
     789}
     790.eye-btn{
     791    box-shadow: 0px 0px 6px #00000047;
     792    border-radius: 6px !important;
     793    padding: 4px 20px !important;
     794    font-size: 24px !important;
     795
     796}
     797.demoo-btn{
     798    background: #EBB503 !important;
     799    font: 20px / 31px Segoe UI Bold !important;
     800    letter-spacing: 0px;
     801    width: 100%;
     802    /* padding: 5px 90px !important; */
     803    display: flex!important;
     804    justify-content: center;
     805}
     806#load-more{
     807    /* display: block !important; */
     808    display: block;
     809    background: #050B20 !important;
     810    font: 18px / 26px Segoe UI !important;
     811    padding: 9px 30px !important;
     812    text-transform: capitalize !important;
     813    border: none !important;
     814    border-radius: 0;
     815}
     816#load-more:hover{
     817    background: #EBB503 !important;
     818}
     819.btn:focus{
     820outline:unset;
     821}
     822.btn:hover{
     823  background:#000 !important;
     824  color:#fff !important;
     825}
     826
     827/* new add */
     828button#load-more {
     829  font: normal normal 600 16px / 30px Outfit;
     830  letter-spacing: 0px;
     831  color: #FFFFFF;
     832  text-transform: uppercase;
     833  background: #5E2CED;
     834  margin: 20px auto;
     835}
     836
     837
     838
     839
     840@media screen and (max-width:1024px) {
     841  .pro-price{
     842    font: 20px / 36px Segoe UI Bold;
     843  }
     844
     845}
     846
     847@media screen and (max-width:767px) {
     848  #product-cards{
     849    margin:unset
     850  }
     851}
  • flash-popup-builder/trunk/admin/prebuilt-templates.php

    r3310775 r3335314  
    11<?php
    2 if ( ! defined( 'ABSPATH' ) ) exit;
     2if (!defined('ABSPATH'))
     3    exit;
    34
    45function flash_popup_builder_custom_templates()
     
    1314            'content' => "Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s",
    1415            'heading' => 'Get 15% Off',
    15             'title'   => 'Limited Time Offer',
     16            'title' => 'Limited Time Offer',
    1617            'title_color' => '#FFFFFF',
    1718            'title_size' => 16,
     
    114115            'btn_text_size' => 16,
    115116            'display_location' => '',
    116         ) 
     117        )
    117118    );
    118119
    119120    foreach ($default_templates as $key => $template) {
    120121        $existing_template = get_posts(array(
    121             'post_type'       => 'popup_template',
    122             'posts_per_page'  => 1,
     122            'post_type' => 'popup_template',
     123            'posts_per_page' => 1,
    123124            // phpcs:ignore WordPress.DB.SlowDBQuery.slow_db_query_meta_query
    124             'meta_query'      => array(
     125            'meta_query' => array(
    125126                array(
    126                     'key'     => 'coupon-code',
    127                     'value'   => $template['coupon-code'],
     127                    'key' => 'coupon-code',
     128                    'value' => $template['coupon-code'],
    128129                    'compare' => '='
    129130                )
    130131            )
    131132        ));
    132        
     133
    133134
    134135        if (empty($existing_template)) {
    135136            $post_data = array(
    136                 'post_title'   => sanitize_text_field($template['title']),
     137                'post_title' => sanitize_text_field($template['title']),
    137138                'post_content' => sanitize_textarea_field($template['content']),
    138                 'post_status'  => 'publish',
    139                 'post_type'    => 'popup_template',
     139                'post_status' => 'publish',
     140                'post_type' => 'popup_template',
    140141            );
    141142
     
    157158
    158159
    159 add_action( 'admin_menu', function() {
    160     remove_meta_box( 'meta[16][key]', 'popup_template', 'advanced' );
    161 } );
     160add_action('admin_menu', function () {
     161    remove_meta_box('meta[16][key]', 'popup_template', 'advanced');
     162});
    162163
    163164
     
    177178        wp_verify_nonce(sanitize_text_field(wp_unslash($_POST['popup_template_nonce'])), 'update_popup_template_nonce')
    178179    )
    179    
    180     if (isset($_POST['display_popup_template'])) {
    181         $template_key = sanitize_text_field(wp_unslash($_POST['display_popup_template'] ) );
    182        
    183         update_option('flash_popup_builder_global_template', $template_key);
    184        
    185         add_action('admin_notices', function () use ($template_key) {
    186             echo '<div class="notice notice-success is-dismissible">
     180
     181        if (isset($_POST['display_popup_template'])) {
     182            $template_key = sanitize_text_field(wp_unslash($_POST['display_popup_template']));
     183
     184            update_option('flash_popup_builder_global_template', $template_key);
     185
     186            add_action('admin_notices', function () use ($template_key) {
     187                echo '<div class="notice notice-success is-dismissible">
    187188                <p>Popup template "' . esc_html($template_key) . '" has been applied to all pages.</p>
    188189            </div>';
    189         });
    190     }
     190            });
     191        }
    191192});
    192193
    193194
    194195//new add'
    195 function update_popup_template() {
     196function update_popup_template()
     197{
    196198    if (!isset($_POST['security']) || !wp_verify_nonce(sanitize_text_field(wp_unslash($_POST['security'])), 'update_popup_template_nonce')) {
    197199        wp_send_json_error(['message' => 'Security check failed.']);
    198200    }
    199201
    200     if (isset($_POST['display_popup_template'])) { 
     202    if (isset($_POST['display_popup_template'])) {
    201203        $template_key = sanitize_text_field(wp_unslash($_POST['display_popup_template']));
    202204
     
    223225
    224226
    225                
     227
    226228function flash_popup_builder_admin_page()
    227229{
    228    
     230
    229231    require FlashPopupBuilder_PATH . 'admin/functions.php';
    230232
    231 ?>
    232 
    233 <div class="flash-popup-builder-nav">
    234   <div class="d-flex align-items-center justify-content-between mb-3">
    235       <!-- Dummy Logo -->
    236       <?php // phpcs:ignore PluginCheck.CodeAnalysis.ImageFunctions.NonEnqueuedImage ?>
    237       <img src="<?php echo esc_url(FlashPopupBuilder_URL . 'admin/assets/images/logo.png'); ?>" alt="Logo" class="me-2" style="height: 40px;">
    238 
    239       <!-- Tabs -->
    240       <ul class="nav nav-tabs flex-grow-1" id="popupTabs" role="tablist">
    241           <li class="nav-item" role="presentation">
    242               <button class="nav-link active" id="tab-general" data-bs-toggle="tab" data-bs-target="#general" type="button" role="tab" aria-controls="general" aria-selected="true">Popup Templates</button>
    243           </li>
    244       </ul>
    245   </div>
    246 </div>
    247 
    248 
    249 <div class="tab-content mt-3" id="popupTabsContent">
    250     <div class="tab-pane fade show active" id="general" role="tabpanel" aria-labelledby="tab-general">
    251     <div class="content-wrapper">
    252 
    253 <div class="filter-bar-container">
    254     <div class="filter-column">
    255 
    256         <div class="search-container">
    257             <input placeholder="Search for Popup Template" type="search" class="search">
    258             <div class="search-icon">
    259                 <i class="fa-solid fa-magnifying-glass"></i>
     233    ?>
     234
     235
     236    <div class="flash-popup-builder-nav">
     237        <div class="d-flex align-items-center justify-content-between mb-3">
     238            <!-- Dummy Logo -->
     239            <?php // phpcs:ignore PluginCheck.CodeAnalysis.ImageFunctions.NonEnqueuedImage ?>
     240            <img src="<?php echo esc_url(FlashPopupBuilder_URL . 'admin/assets/images/logo.png'); ?>" alt="Logo"
     241                class="me-2" style="height: 40px;">
     242
     243            <!-- Tabs -->
     244            <ul class="nav nav-tabs flex-grow-1" id="popupTabs" role="tablist">
     245                <li class="nav-item" role="presentation">
     246                    <button class="nav-link active" id="tab-general" data-bs-toggle="tab" data-bs-target="#general"
     247                        type="button" role="tab" aria-controls="general" aria-selected="false">Popup Templates</button>
     248                </li>
     249
     250                <li class="nav-item" role="presentation">
     251                    <button class="nav-link" id="tab-templates" data-bs-toggle="tab" data-bs-target="#templates"
     252                        type="button" role="tab" aria-controls="templates" aria-selected="true">Caliber Themes</button>
     253                </li>
     254            </ul>
     255        </div>
     256    </div>
     257
     258
     259    <div class="tab-content mt-3" id="popupTabsContent">
     260
     261        <div class="tab-pane fade show active" id="general" role="tabpanel" aria-labelledby="tab-general">
     262            <div class="content-wrapper">
     263
     264                <div class="filter-bar-container">
     265                    <div class="filter-column">
     266
     267                        <div class="search-container">
     268                            <input placeholder="Search for Popup Template" type="search" class="search">
     269                            <div class="search-icon">
     270                                <i class="fa-solid fa-magnifying-glass"></i>
     271                            </div>
     272                        </div>
     273                        <span class="template-category active">General</span>
     274
     275                        <?php $is_premium_user = get_option('popup_is_premium', false); ?>
     276                        <span class="template-category <?php echo !$is_premium_user ? 'locked-category' : ''; ?>">
     277                            New Year Slide
     278                            <?php if (!$is_premium_user): ?>
     279                                <i class="fa fa-crown text-warning"></i>
     280                            <?php endif; ?>
     281                        </span>
     282
     283                        <span class="template-category <?php echo !$is_premium_user ? 'locked-category' : ''; ?>">
     284                            Flash Deals
     285                            <?php if (!$is_premium_user): ?>
     286                                <i class="fa fa-crown text-warning"></i>
     287                            <?php endif; ?>
     288                        </span>
     289
     290                        <span class="template-category <?php echo !$is_premium_user ? 'locked-category' : ''; ?>">
     291                            Christmas Deals
     292                            <?php if (!$is_premium_user): ?>
     293                                <i class="fa fa-crown text-warning"></i>
     294                            <?php endif; ?>
     295                        </span>
     296
     297                        <span class="template-category <?php echo !$is_premium_user ? 'locked-category' : ''; ?>">
     298                            Valentines Day
     299                            <?php if (!$is_premium_user): ?>
     300                                <i class="fa fa-crown text-warning"></i>
     301                            <?php endif; ?>
     302                        </span>
     303
     304                        <span class="template-category <?php echo !$is_premium_user ? 'locked-category' : ''; ?>">
     305                            Black Friday
     306                            <?php if (!$is_premium_user): ?>
     307                                <i class="fa fa-crown text-warning"></i>
     308                            <?php endif; ?>
     309                        </span>
     310
     311                        <span class="template-category <?php echo !$is_premium_user ? 'locked-category' : ''; ?>">
     312                            Halloween Discount
     313                            <?php if (!$is_premium_user): ?>
     314                                <i class="fa fa-crown text-warning"></i>
     315                            <?php endif; ?>
     316                        </span>
     317
     318                    </div>
     319                </div>
     320
     321                <div class="template-wrapper">
     322
     323                    <?php
     324
     325                    $active_template_key = get_option('flash_popup_builder_global_template', '');
     326
     327                    $edit_nonce = wp_create_nonce('add_popup_template_nonce');
     328
     329                    ?>
     330
     331                    <div id="popup-template1" class="popup-template">
     332                        <?php
     333                        $active_class1 = ($active_template_key === $editing_templates[0]['meta']['coupon-code']) ? 'active-template' : '';
     334                        ?>
     335                        <img class="<?php echo esc_attr($active_class1); ?>"
     336                            src="<?php echo esc_url(FlashPopupBuilder_URL . 'admin/assets/images/template-1-img.png'); ?>"
     337                            alt="">
     338
     339                        <div class="btns-container">
     340                            <form method="GET" action="<?php echo esc_url(admin_url('post.php')); ?>">
     341                                <input type="hidden" name="post"
     342                                    value="<?php echo esc_attr($editing_templates[0]['id']); ?>">
     343                                <input type="hidden" name="action" value="edit">
     344                                <button type="submit" class="button-primary edit-btn">Edit Template</button>
     345                            </form>
     346
     347                        </div>
     348                    </div>
     349
     350                    <div id="popup-template2" class="popup-template">
     351                        <?php
     352                        $active_class2 = ($active_template_key === $editing_templates[1]['meta']['coupon-code']) ? 'active-template' : '';
     353                        ?>
     354                        <img class="<?php echo esc_attr($active_class2); ?>"
     355                            src="<?php echo esc_url(FlashPopupBuilder_URL . 'admin/assets/images/template-2-img.png'); ?>"
     356                            alt="">
     357
     358                        <div class="btns-container ">
     359                            <form method="GET" action="<?php echo esc_url(admin_url('post.php')); ?>">
     360                                <input type="hidden" name="post"
     361                                    value="<?php echo esc_attr($editing_templates[1]['id']); ?>">
     362                                <input type="hidden" name="action" value="edit">
     363                                <button type="submit" class="button-primary edit-btn">Edit Template</button>
     364                            </form>
     365                        </div>
     366                    </div>
     367
     368                    <div id="popup-template3" class="popup-template">
     369                        <?php
     370                        $active_class3 = ($active_template_key === $editing_templates[2]['meta']['coupon-code']) ? 'active-template' : '';
     371                        ?>
     372                        <img class="<?php echo esc_attr($active_class3); ?>"
     373                            src="<?php echo esc_url(FlashPopupBuilder_URL . 'admin/assets/images/template-3-img.png'); ?>"
     374                            alt="">
     375                        <div class="btns-container ">
     376                            <form method="GET" action="<?php echo esc_url(admin_url('post.php')); ?>">
     377                                <input type="hidden" name="post"
     378                                    value="<?php echo esc_attr($editing_templates[2]['id']); ?>">
     379                                <input type="hidden" name="action" value="edit">
     380                                <button type="submit" class="button-primary edit-btn">Edit Template</button>
     381                            </form>
     382                        </div>
     383                    </div>
     384
     385                    <div id="popup-template4" class="popup-template">
     386                        <?php
     387                        $active_class4 = ($active_template_key === $editing_templates[3]['meta']['coupon-code']) ? 'active-template' : '';
     388                        ?>
     389                        <img class="<?php echo esc_attr($active_class4); ?>"
     390                            src="<?php echo esc_url(FlashPopupBuilder_URL . 'admin/assets/images/template-4-img.png'); ?>"
     391                            alt="">
     392                        <div class="btns-container">
     393                            <form method="GET" action="<?php echo esc_url(admin_url('post.php')); ?>">
     394                                <input type="hidden" name="post"
     395                                    value="<?php echo esc_attr($editing_templates[3]['id']); ?>">
     396                                <input type="hidden" name="action" value="edit">
     397                                <button type="submit" class="button-primary edit-btn">Edit Template</button>
     398                            </form>
     399                        </div>
     400                    </div>
     401
     402                    <div id="popup-template5" class="popup-template">
     403                        <?php
     404                        $active_class5 = ($active_template_key === $editing_templates[4]['meta']['coupon-code']) ? 'active-template' : '';
     405                        ?>
     406                        <img class="<?php echo esc_attr($active_class5); ?>"
     407                            src="<?php echo esc_url(FlashPopupBuilder_URL . 'admin/assets/images/template-5-img.png'); ?>"
     408                            alt="">
     409                        <div class="btns-container">
     410                            <form method="GET" action="<?php echo esc_url(admin_url('post.php')); ?>">
     411                                <input type="hidden" name="post"
     412                                    value="<?php echo esc_attr($editing_templates[4]['id']); ?>">
     413                                <input type="hidden" name="action" value="edit">
     414                                <button type="submit" class="button-primary edit-btn">Edit Template</button>
     415                            </form>
     416                        </div>
     417                    </div>
     418
     419                </div>
     420
    260421            </div>
    261422        </div>
    262         <span class="template-category active">General</span>
    263 
    264         <?php $is_premium_user = get_option('popup_is_premium', false); ?>
    265         <span class="template-category <?php echo !$is_premium_user ? 'locked-category' : ''; ?>">
    266             New Year Slide
    267             <?php if (!$is_premium_user): ?>
    268                 <i class="fa fa-crown text-warning"></i>
    269             <?php endif; ?>
    270         </span>
    271        
    272         <span class="template-category <?php echo !$is_premium_user ? 'locked-category' : ''; ?>">
    273             Flash Deals
    274             <?php if (!$is_premium_user): ?>
    275                 <i class="fa fa-crown text-warning"></i>
    276             <?php endif; ?>
    277         </span>
    278        
    279         <span class="template-category <?php echo !$is_premium_user ? 'locked-category' : ''; ?>">
    280             Christmas Deals
    281             <?php if (!$is_premium_user): ?>
    282                 <i class="fa fa-crown text-warning"></i>
    283             <?php endif; ?>
    284         </span>
    285        
    286         <span class="template-category <?php echo !$is_premium_user ? 'locked-category' : ''; ?>">
    287             Valentines Day
    288             <?php if (!$is_premium_user): ?>
    289                 <i class="fa fa-crown text-warning"></i>
    290             <?php endif; ?>
    291         </span>
    292        
    293         <span class="template-category <?php echo !$is_premium_user ? 'locked-category' : ''; ?>">
    294             Black Friday
    295             <?php if (!$is_premium_user): ?>
    296                 <i class="fa fa-crown text-warning"></i>
    297             <?php endif; ?>
    298         </span>
    299        
    300         <span class="template-category <?php echo !$is_premium_user ? 'locked-category' : ''; ?>">
    301             Halloween Discount
    302             <?php if (!$is_premium_user): ?>
    303                 <i class="fa fa-crown text-warning"></i>
    304             <?php endif; ?>
    305         </span>
    306        
     423
     424
     425        <!-- caliber theme -->
     426
     427        <div class="tab-pane fade" id="templates" role="tabpanel" aria-labelledby="tab-templates">
     428            <?php include(FlashPopupBuilder_PATH . 'admin/templates-tab-content.php'); ?>
     429        </div>
     430
     431
     432        <!-- end -->
    307433    </div>
    308 </div>
    309 
    310 <div class="template-wrapper">
    311 
    312 <?php
    313 
    314     $active_template_key = get_option('flash_popup_builder_global_template', '');
    315 
    316     $edit_nonce = wp_create_nonce('add_popup_template_nonce');
     434
     435
     436    <?php
     437
     438}
    317439
    318440?>
    319 
    320 <div id="popup-template1" class="popup-template">
    321     <?php
    322         $active_class1 = ($active_template_key === $editing_templates[0]['meta']['coupon-code']) ? 'active-template' : '';
    323     ?>
    324     <img class="<?php echo esc_attr($active_class1); ?>" src="<?php echo esc_url(FlashPopupBuilder_URL . 'admin/assets/images/template-1-img.png'); ?>" alt="">
    325 
    326     <div class="btns-container">
    327         <form method="GET" action="<?php echo esc_url(admin_url('post.php')); ?>">
    328             <input type="hidden" name="post" value="<?php echo esc_attr($editing_templates[0]['id']); ?>">
    329             <input type="hidden" name="action" value="edit">
    330             <button type="submit" class="button-primary edit-btn">Edit Template</button>
    331         </form>
    332 
    333     </div>
    334 </div>
    335 
    336 <div id="popup-template2" class="popup-template">
    337     <?php
    338         $active_class2 = ($active_template_key === $editing_templates[1]['meta']['coupon-code']) ? 'active-template' : '';
    339     ?>
    340     <img class="<?php echo esc_attr($active_class2); ?>" src="<?php echo esc_url(FlashPopupBuilder_URL . 'admin/assets/images/template-2-img.png'); ?>" alt="">
    341 
    342     <div class="btns-container ">
    343         <form method="GET" action="<?php echo esc_url(admin_url('post.php')); ?>">
    344             <input type="hidden" name="post" value="<?php echo esc_attr($editing_templates[1]['id']); ?>">
    345             <input type="hidden" name="action" value="edit">
    346             <button type="submit" class="button-primary edit-btn">Edit Template</button>
    347         </form>
    348     </div>
    349 </div>
    350 
    351 <div id="popup-template3" class="popup-template">
    352     <?php
    353         $active_class3 = ($active_template_key === $editing_templates[2]['meta']['coupon-code']) ? 'active-template' : '';
    354     ?>
    355     <img class="<?php echo esc_attr($active_class3); ?>" src="<?php echo esc_url( FlashPopupBuilder_URL . 'admin/assets/images/template-3-img.png'); ?>" alt="">
    356     <div class="btns-container ">
    357         <form method="GET" action="<?php echo esc_url(admin_url('post.php')); ?>">
    358             <input type="hidden" name="post" value="<?php echo esc_attr($editing_templates[2]['id']); ?>">
    359             <input type="hidden" name="action" value="edit">
    360             <button type="submit" class="button-primary edit-btn">Edit Template</button>
    361         </form>
    362     </div>
    363 </div>
    364 
    365 <div id="popup-template4" class="popup-template">
    366     <?php
    367         $active_class4 = ($active_template_key === $editing_templates[3]['meta']['coupon-code']) ? 'active-template' : '';
    368     ?>
    369     <img class="<?php echo esc_attr($active_class4); ?>" src="<?php echo esc_url( FlashPopupBuilder_URL . 'admin/assets/images/template-4-img.png'); ?>" alt="">
    370     <div class="btns-container">
    371         <form method="GET" action="<?php echo esc_url(admin_url('post.php')); ?>">
    372             <input type="hidden" name="post" value="<?php echo esc_attr($editing_templates[3]['id']); ?>">
    373             <input type="hidden" name="action" value="edit">
    374             <button type="submit" class="button-primary edit-btn">Edit Template</button>
    375         </form>
    376     </div>
    377 </div>
    378 
    379 <div id="popup-template5" class="popup-template">
    380     <?php
    381         $active_class5 = ($active_template_key === $editing_templates[4]['meta']['coupon-code']) ? 'active-template' : '';
    382     ?>
    383     <img class="<?php echo esc_attr($active_class5); ?>" src="<?php echo esc_url( FlashPopupBuilder_URL . 'admin/assets/images/template-5-img.png' ); ?>" alt="">
    384     <div class="btns-container">
    385         <form method="GET" action="<?php echo esc_url(admin_url('post.php')); ?>">
    386             <input type="hidden" name="post" value="<?php echo esc_attr($editing_templates[4]['id']); ?>">
    387             <input type="hidden" name="action" value="edit">
    388             <button type="submit" class="button-primary edit-btn">Edit Template</button>
    389         </form>
    390     </div>
    391 </div>
    392 
    393 </div>
    394 
    395 </div>
    396     </div>
    397 
    398 </div>
    399            
    400                
    401 <?php
    402 
    403 }
    404 
    405 ?>
  • flash-popup-builder/trunk/flash-popup-builder.php

    r3310775 r3335314  
    44 * Plugin URI:       
    55 * Description:       A simple popup builder plugin with pre-built templates.
    6  * Version:           1.0.1
     6 * Version:           1.0.2
    77 * Requires at least: 5.2
    88 * Requires PHP:      7.2
     
    2121define('FlashPopupBuilder_URL', plugin_dir_url(FlashPopupBuilder_FILE));
    2222define('FlashPopupBuilder_PATH', plugin_dir_path(FlashPopupBuilder_FILE));
    23 define('FlashPopupBuilder_VERSION', '1.0.0');
     23define('FlashPopupBuilder_VERSION', '1.0.2');
     24
     25
     26define( 'FlashPopupBuilder_SHOPIFY_LICENCE_ENDPOINT', 'https://license.themescaliber.com/api/public/' );
    2427
    2528
     
    3033    $current_page = isset($_GET['page']) ? sanitize_text_field(wp_unslash($_GET['page'])) : '';
    3134    // Load only on these pages
    32     if (
    33         in_array($current_page, ['flash-popup-builder', 'flash-popup-builder-active']) ||
    34         ($screen && $screen->post_type === 'popup_template')
    35     ) {
     35    if (in_array($current_page, ['flash-popup-builder', 'flash-popup-builder-active']) || ($screen && $screen->post_type === 'popup_template')) {
    3636        $style_version = filemtime(FlashPopupBuilder_PATH . 'admin/assets/css/style.css');
    3737        wp_enqueue_style('flash-popup-builder-styles', FlashPopupBuilder_URL . 'admin/assets/css/style.css', array(), $style_version);
     
    157157
    158158
    159 function flash_popup_builder_edit_template_enqueue_scripts()
     159function flash_popup_builder_edit_template_enqueue_scripts($hook)
    160160{
    161161    wp_enqueue_script('jquery');
     
    167167        'security' => wp_create_nonce('update_popup_template_nonce'),
    168168    ));
     169
     170    // new add
     171
     172    if ($hook !== 'toplevel_page_flash-popup-builder') {
     173        return;
     174    }
     175
     176    wp_enqueue_script(
     177        'flash-popup-templates-tab',
     178        FlashPopupBuilder_URL . 'admin/assets/js/templates-tab.js',
     179        array('jquery'),
     180        FlashPopupBuilder_VERSION,
     181        true
     182    );
     183    wp_localize_script(
     184        'flash-popup-templates-tab',
     185        'flashPopupBuilderVars',
     186        array(
     187            'apiEndpoint' => esc_url(plugin_dir_url(__FILE__)) . 'admin/fetch-api.php',
     188        )
     189    );
     190    //end
    169191}
    170192add_action('admin_enqueue_scripts', 'flash_popup_builder_edit_template_enqueue_scripts');
  • flash-popup-builder/trunk/readme.txt

    r3310777 r3335314  
    55Tested up to: 6.8
    66Requires PHP: 7.2
    7 Stable tag: 1.0.1
     7Stable tag: 1.0.2
    88License: GPL-2.0+
    99License URI: http://www.gnu.org/licenses/gpl-2.0.html
     
    8484== Changelog ==
    8585
     86= 1.0.2 - 24-07-2025 =
     87* Updated Templates tab in the dashboard.
     88
    8689= 1.0.1 - 27-05-2025 =
    8790* Initial Release.
Note: See TracChangeset for help on using the changeset viewer.