Plugin Directory

Changeset 2847175


Ignore:
Timestamp:
01/12/2023 06:56:35 AM (3 years ago)
Author:
ce21com
Message:

Fixed wp_remote_get and wp_remote_post issue and fixed design issue

Location:
ce21-suite
Files:
137 added
7 edited

Legend:

Unmodified
Added
Removed
  • ce21-suite/trunk/README.txt

    r2843982 r2847175  
    55Requires at least: 4.0
    66Tested up to: 6.1
    7 Stable tag: 2.1.1
     7Stable tag: 2.1.2
    88Requires PHP: 5.4
    99License: GPLv2 or later
  • ce21-suite/trunk/admin/class-single-sign-on-ce21-admin.php

    r2843982 r2847175  
    7777        if($hook == 'toplevel_page_single_sign_on_ce21') {
    7878           
    79             wp_enqueue_style( 'DT_bootstrap', plugin_dir_url( __FILE__ ) . 'css/new_bootstrap.css', array(), $this->version, 'all' );
    80             wp_enqueue_style( 'bootstrap', plugin_dir_url( __FILE__ ) . 'css/dataTables.bootstrap.min.css', array(), $this->version, 'all' );
     79            wp_enqueue_style( 'bootstrap-5.2', SINGLE_SIGN_ON_CE21__PLUGIN_URL .'admin/datatable-bootstrap/bootstrap-5.2.min.css', array(), $this->version, 'all' );
     80            wp_enqueue_style( 'dataTables.bootstrap5', SINGLE_SIGN_ON_CE21__PLUGIN_URL .'admin/datatable-bootstrap/dataTables.bootstrap5.min.css', array(), $this->version, 'all' );
    8181
    8282        }
     
    8686        }
    8787        if ( isset( $_GET['page'] ) && $_GET['page'] == 'calendar' ) {
    88             wp_enqueue_style( 'DT_bootstrap', plugin_dir_url( __FILE__ ) . 'css/new_bootstrap.css', array(), $this->version, 'all' );
    89             wp_enqueue_style( 'bootstrap', plugin_dir_url( __FILE__ ) . 'css/dataTables.bootstrap.min.css', array(), $this->version, 'all' );
     88            wp_enqueue_style( 'DT_bootstrap', 'https://cdn.jsdelivr.net/npm/bootstrap@5.2.3/dist/css/bootstrap.min.css', array(), $this->version, 'all' );
     89            wp_enqueue_style( 'bootstrap', 'https://cdn.datatables.net/1.13.1/css/dataTables.bootstrap5.min.css', array(), $this->version, 'all' );
    9090            wp_enqueue_style( 'jquery.datetimepicker.min.css', plugin_dir_url( __FILE__ ) . 'css/jquery.datetimepicker.min.css', array(), $this->version, 'all' );
    9191        }
     
    119119
    120120        if($hook == 'toplevel_page_single_sign_on_ce21') {
    121             wp_enqueue_script( 'bootstrap.min.js', plugin_dir_url( __FILE__ ) . 'js/bootstrap.min.js', array( 'jquery' ), $this->version, false );         
    122             wp_enqueue_script( 'jquery.dataTables.js', plugin_dir_url( __FILE__ ) . 'js/jquery.dataTables.min.js', array( 'jquery' ), $this->version, false );
    123             wp_enqueue_script( 'DT_bootstrap.js', plugin_dir_url( __FILE__ ) . 'js/dataTables.bootstrap.min.js', array( 'jquery' ), $this->version, false );
    124 
     121            wp_enqueue_script( 'bootstrap.min.js', SINGLE_SIGN_ON_CE21__PLUGIN_URL .'admin/datatable-bootstrap/bootstrap.bundle.min.js', array( 'jquery' ), $this->version, false );
     122            wp_enqueue_script( 'jquery.dataTables.min.js', SINGLE_SIGN_ON_CE21__PLUGIN_URL .'admin/datatable-bootstrap/jquery.dataTables.min.js', array( 'jquery' ), $this->version, false );
     123            wp_enqueue_script( 'dataTables-bootstrap5.js', SINGLE_SIGN_ON_CE21__PLUGIN_URL .'admin/datatable-bootstrap/dataTables.bootstrap5.min.js', array( 'jquery' ), $this->version, false );
    125124            wp_enqueue_script( 'custome-dev.js', plugin_dir_url( __FILE__ ) . 'js/custome-dev.js', array( 'jquery' ), $this->version, false );
    126125           
     
    130129        }
    131130        if ( isset( $_GET['page'] ) && $_GET['page'] == 'calendar' ) {
    132             wp_enqueue_script( 'bootstrap.min.js', plugin_dir_url( __FILE__ ) . 'js/bootstrap.min.js', array( 'jquery' ), $this->version, false );
    133             wp_enqueue_script( 'jquery.dataTables.js', plugin_dir_url( __FILE__ ) . 'js/jquery.dataTables.min.js', array( 'jquery' ), $this->version, false );
    134             wp_enqueue_script( 'DT_bootstrap.js', plugin_dir_url( __FILE__ ) . 'js/dataTables.bootstrap.min.js', array( 'jquery' ), $this->version, false );
     131            wp_enqueue_script( 'bootstrap.min.js', SINGLE_SIGN_ON_CE21__PLUGIN_URL .'admin/datatable-bootstrap/bootstrap.bundle.min.js', array( 'jquery' ), $this->version, false );
     132            wp_enqueue_script( 'jquery.dataTables.min.js', SINGLE_SIGN_ON_CE21__PLUGIN_URL .'admin/datatable-bootstrap/jquery.dataTables.min.js', array( 'jquery' ), $this->version, false );
     133            wp_enqueue_script( 'dataTables-bootstrap5.js', SINGLE_SIGN_ON_CE21__PLUGIN_URL .'admin/datatable-bootstrap/dataTables.bootstrap5.min.js', array( 'jquery' ), $this->version, false );
    135134            wp_enqueue_script( 'jquery.datetimepicker.full.min.js', plugin_dir_url( __FILE__ ) . 'js/jquery.datetimepicker.full.min.js', array( 'jquery' ), $this->version, false );
    136135            wp_enqueue_script( 'ce21-single-sign-on-calendar.js', plugin_dir_url( __FILE__ ) . 'js/ce21-single-sign-on-calendar.js', array( 'jquery' ), $this->version, false );
  • ce21-suite/trunk/admin/css/single-sign-on-ce21-admin.css

    r2843982 r2847175  
    178178    }
    179179}
     180
     181.membership_plans_list .accordion-item{
     182    border-color: #ddd !important;
     183    margin-bottom: 20px;
     184    background-color: #fff;
     185    border: 1px solid transparent;
     186    border-radius: 4px !important;
     187    box-shadow: 0 1px 1px rgb(0 0 0 / 5%);
     188}
     189
     190.membership_plans_list .accordion-item .member-palan-listing-title-ce21{
     191    color: #333;
     192    background-color: #f5f5f5;
     193    border-color: #ddd;
     194    padding: 10px 15px;
     195    border-bottom: 1px solid transparent;
     196    border-top-left-radius: 3px;
     197    border-top-right-radius: 3px;
     198}
     199
     200.membership_plans_list .accordion-body{
     201    border-top-color: #ddd !important;
     202}
     203
     204.membership_plans_list .accordion-button{
     205padding: 0 !important;
     206background-color: transparent !important;
     207text-decoration: none;
     208position: relative;
     209padding-left: 18px !important;
     210cursor: pointer;
     211}
     212
     213.membership_plans_list .accordion-button:hover{
     214    background-color: transparent !important;
     215    color: #212529 !important;
     216    }
     217
     218.membership_plans_list .accordion-button:not(.collapsed)::after{
     219    content: "-";
     220    background-image: none !important;
     221    transform: translateY(-50%);
     222}
     223
     224.membership_plans_list .accordion-button::after{
     225    content: "+";
     226    background-image: none !important;
     227    position: absolute;
     228    left: 0;
     229    font-size: 20px;
     230    top: 50%;
     231    transform: translateY(-50%);
     232    line-height: 17px;
     233}
     234
     235.membership_plans_list .accordion-button:not(.collapsed){
     236    color: #212529 !important;
     237}
  • ce21-suite/trunk/includes/ce21-functions.php

    r2843982 r2847175  
    248248    $response = wp_remote_post($get_error_log_api_url_ce21, $args);
    249249
    250     $newResponse = json_decode($response);
     250    $newResponse = json_decode($response['body']);
    251251    if($newResponse->isSuccess){
    252252        $sesionHelper = new session_helper_ce21($newResponse->data->tenantId);
     
    484484
    485485        //print_r($res);
    486         $res = json_decode($res);
     486        $res = json_decode($res['body']);
    487487
    488488        if(!empty( $res )){
     
    938938        );
    939939        $res = wp_remote_get($url, $args);
    940         $res = json_decode($res);
     940        $res = json_decode($res['body']);
    941941    }
    942942    $eventDays = [];
  • ce21-suite/trunk/includes/class-single-sign-on-ce21.php

    r2843982 r2847175  
    294294            }
    295295           
    296             $data    = json_decode($result, true);
     296            $data    = json_decode($result['body'], true);
    297297            $message = "";
    298298            $messageClassName = "";
     
    312312                $authorizeURI_ce21 = get_option( 'authorizeURI_ce21' );
    313313                $get_Memberships_APi_URL_ce21 = $authorizeURI_ce21.'/WPAuthorize/Membership/List?includeHiddenGroup=true';
    314                 $result = wp_remote_get($authorizeURI_ce21);
     314                $result = wp_remote_get($get_Memberships_APi_URL_ce21);
    315315                if (is_wp_error($result)) {
    316316                    throw new Exception($result['body'], 1);
    317317                }
    318                 $Memberships_Data = json_decode($result, true);
     318                $Memberships_Data = json_decode($result['body'], true);
    319319                $values = "";
    320320
     
    378378                throw new Exception($result['body'], 1);
    379379            }
    380             $Memberships_Data = json_decode($result, true);
     380            $Memberships_Data = json_decode($result['body'], true);
    381381            $values = "";
    382382            $message  = "";
     
    491491
    492492            <div class="membership_plans_list">
    493                 <div class="panel panel-default">
    494                     <div class="panel-heading member-palan-listing-title-ce21">
    495                         <h4 class="panel-title">
    496                             <a class="accordion-toggle" data-toggle="collapse" data-parent="#accordion" href="#collapseOne">
    497                               <span class="glyphicon glyphicon-minus"></span>
    498                               Groups List
    499                             </a>
    500                         </h4>
    501                         <div class="member-synchronize-ce21-form">
    502                             <form name="synchronize-member_ce21"  method="post">
    503                                 <input type="submit" name="get_member_plans" id="get_member_plans" class="button button-primary" value="Synchronize" >
    504                             </form>
     493                <div class="accordion" id="accordionExample">
     494                    <div class="accordion-item">
     495                        <div class="member-palan-listing-title-ce21">
     496                            <h4 class="panel-title accordion-header" id="headingOne">
     497                                <a class="accordion-toggle accordion-button " data-bs-toggle="collapse" data-bs-target="#collapseOne" aria-expanded="true" aria-controls="collapseOne">
     498                                <span class="glyphicon glyphicon-minus"></span>
     499                                Groups List
     500                                </a>
     501                            </h4>
     502                            <div class="member-synchronize-ce21-form">
     503                                <form name="synchronize-member_ce21"  method="post">
     504                                    <input type="submit" name="get_member_plans" id="get_member_plans" class="button button-primary" value="Synchronize" >
     505                                </form>
     506                            </div>
    505507                        </div>
    506                     </div>
    507                     <div id="collapseOne" class="panel-collapse collapse in">
    508                         <div class="panel-body">
    509                             <table id="member_plans_listing_ce21" cellpadding="0" cellspacing="0" border="0" class="table table-striped table-bordered" >
    510                                 <?php
    511                                 try {
    512 
    513                                     global $wpdb;
    514                                     $table_name_ce21 = $wpdb->prefix . 'membership_types_ce21';
    515                                     $membership_plans_data_ce21 = $wpdb->get_results("SELECT * FROM ".$table_name_ce21." ORDER BY id ASC");
    516 
    517                                     if ($wpdb->last_error) {
    518                                         throw new Exception($wpdb->last_error, 1);
     508                        <div id="collapseOne" class="accordion-collapse collapse show" aria-labelledby="headingOne" data-bs-parent="#accordionExample">
     509                            <div class="accordion-body">
     510                                <table id="member_plans_listing_ce21" cellpadding="0" cellspacing="0" border="0" class="table table-striped table-bordered" >
     511                                    <?php
     512                                    try {
     513
     514                                        global $wpdb;
     515                                        $table_name_ce21 = $wpdb->prefix . 'membership_types_ce21';
     516                                        $membership_plans_data_ce21 = $wpdb->get_results("SELECT * FROM ".$table_name_ce21." ORDER BY id ASC");
     517
     518                                        if ($wpdb->last_error) {
     519                                            throw new Exception($wpdb->last_error, 1);
     520                                        }
     521                                    } catch (Exception $e) {
     522                                        $errorMsg = ' Error on line '.$e->getLine().' in '.$e->getFile() . ' : <b>'.$e->getMessage().'</b>';           
     523                                        ce21_error_log_api($errorMsg);
    519524                                    }
    520                                 } catch (Exception $e) {
    521                                     $errorMsg = ' Error on line '.$e->getLine().' in '.$e->getFile() . ' : <b>'.$e->getMessage().'</b>';           
    522                                     ce21_error_log_api($errorMsg);
    523                                 }
    524                                 ?>
    525                                 <thead>
    526                                     <tr>
    527                                         <th align="center" scope="col">Membership Name</th>
    528                                     </tr>
    529                                 </thead>
    530                                 <tbody>
    531                                     <?php
    532                                     if( ! empty($membership_plans_data_ce21)) {
    533                                         foreach ($membership_plans_data_ce21 as $data_ce21) {
    534                                         ?>
    535                                             <tr> <td align="" ><?php echo esc_html($data_ce21->membershipName); ?></td> </tr>
    536                                         <?php
    537                                         }
    538                                     } else { ?>                                     
    539                                         <tr> <td align="" ><?php echo "No records found." ?></td> </tr>
    540                                     <?php  } ?>
    541                                 </tbody>
    542                             </table>
     525                                    ?>
     526                                    <thead>
     527                                        <tr>
     528                                            <th align="center" scope="col">Membership Name</th>
     529                                        </tr>
     530                                    </thead>
     531                                    <tbody>
     532                                        <?php
     533                                        if( ! empty($membership_plans_data_ce21)) {
     534                                            foreach ($membership_plans_data_ce21 as $data_ce21) {
     535                                            ?>
     536                                                <tr> <td align="" ><?php echo esc_html($data_ce21->membershipName); ?></td> </tr>
     537                                            <?php
     538                                            }
     539                                        } else { ?>                                     
     540                                            <tr> <td align="" ><?php echo "No records found." ?></td> </tr>
     541                                        <?php  } ?>
     542                                    </tbody>
     543                                </table>
     544                            </div>
    543545                        </div>
    544                     </div>
     546                    </div>
    545547                </div>
    546548            </div>
     
    555557    public function get_ce21_single_sign_on_api_settings_page()
    556558    {
    557         include( plugin_dir_path( __FILE__ ) . 'admin/partials/ce21-single-sign-on-api-settings.php');
     559        include( SINGLE_SIGN_ON_CE21__PLUGIN_DIR . 'admin/partials/ce21-single-sign-on-api-settings.php');
    558560    }
    559561
     
    563565    public function get_ce21_single_sign_on_program_list_settings_page()
    564566    {
    565         include( plugin_dir_path( __FILE__ ) . 'programs/ce21-programs-settings-page.php');
     567        include( SINGLE_SIGN_ON_CE21__PLUGIN_DIR . 'programs/ce21-programs-settings-page.php');
    566568    }
    567569
     
    571573    public function get_ce21_single_sign_on_calendar_event_list_page()
    572574    {
    573         include( plugin_dir_path( __FILE__ ) . 'admin/partials/ce21-single-sign-on-calendar-event-list.php');
     575        include( SINGLE_SIGN_ON_CE21__PLUGIN_DIR . 'admin/partials/ce21-single-sign-on-calendar-event-list.php');
    574576    }
    575577    /*
     
    578580    public function get_ce21_single_sign_on_membership_page()
    579581    {
    580         include( plugin_dir_path( __FILE__ ) . 'membership/ce21-membership-page.php');
     582        include( SINGLE_SIGN_ON_CE21__PLUGIN_DIR . 'membership/ce21-membership-page.php');
    581583    }
    582584}
  • ce21-suite/trunk/includes/single-sign-on-ce21-api-helper.php

    r2843982 r2847175  
    5050            else
    5151            {
    52                 $response_obj = json_decode($response);
     52                $response_obj = json_decode($response['body']);
    5353
    5454                $expiry_date = date("Y-m-d H:i:s", strtotime("+$response_obj->expires_in sec"));
  • ce21-suite/trunk/single-sign-on-ce21.php

    r2843982 r2847175  
    1010 *
    1111 * @link              https://www.ce21.com
    12  * @since             2.1.1
    1312 * @package           Single_Sign_On_Ce21
    1413 *
     
    1716 * Plugin URI:        https://www.ce21.com
    1817 * Description:       CE21 Suite.
    19  * Version:           2.1.1
     18 * Version:           2.1.2
    2019 * Author:            CE21
    2120 * Author URI:        https://www.ce21.com
Note: See TracChangeset for help on using the changeset viewer.