Plugin Directory

Changeset 3303568


Ignore:
Timestamp:
05/30/2025 12:15:40 PM (9 months ago)
Author:
khorshidlab
Message:

Plugin Version 1.0.1

Location:
arvancloud-cdn
Files:
106 added
52 edited
1 copied

Legend:

Unmodified
Added
Removed
  • arvancloud-cdn/tags/1.0.1/README.txt

    r3256709 r3303568  
    33Tags: CDN, arvancloud
    44Requires at least: 4.0
    5 Tested up to: 6.1
     5Tested up to: 6.8
    66Requires PHP: 7.2
    7 Stable tag: 0.9.18
     7Stable tag: 1.0.1
    88License: GPLv3 or later
    99License URI: http://www.gnu.org/licenses/gpl-3.0.html
     
    5656
    5757== Changelog ==
     58= 1.0.1 – 2025-05-30
     59* Introduce new user interface
     60* Some minor improvements
     61
    5862= 0.9.18 - 2025-03-16 =
    5963* fix: Reload DDoS settings page after changing mode
  • arvancloud-cdn/tags/1.0.1/admin/assets/css/admin-rtl.css

    r2752685 r3303568  
    77         url('../fonts/yekan-bakh-regular.woff') format('woff'),  /* FF3.6+, IE9, Chrome6+, Saf5.1+*/
    88         url('../fonts/yekan-bakh-regular.ttf') format('truetype');
     9}
     10
     11@font-face {
     12    font-family: 'yekan-bakh';
     13    font-style: normal;
     14    font-weight: 500;
     15    src: url('../fonts/yekan-bakh-medium.eot');
     16    src: url('../fonts/yekan-bakh-medium.eot?#iefix') format('embedded-opentype'),  /* IE6-8 */
     17         url('../fonts/yekan-bakh-medium.woff') format('woff'),  /* FF3.6+, IE9, Chrome6+, Saf5.1+*/
     18         url('../fonts/yekan-bakh-medium.ttf') format('truetype');
    919}
    1020
  • arvancloud-cdn/tags/1.0.1/admin/assets/css/wp-arvancloud-cdn-admin.css

    r2752685 r3303568  
    524524
    525525.arvan-card {
    526     max-width: 1232px;
     526    max-width: 960px;
    527527    width: calc(100% - 48px);
    528528    background: #fff;
    529529    background-color: #fff;
    530     box-shadow: 0 2px 5px rgb(0 0 0 / 5%);
    531     border-radius: 5px;
     530    border-radius: 16px;
    532531    padding: 24px;
    533     margin-bottom: 20px;
     532    margin: auto auto 20px;
    534533}
    535534
  • arvancloud-cdn/tags/1.0.1/admin/assets/js/wp-arvancloud-cdn-admin.js

    r3256709 r3303568  
    44  $(document).ready(function() {
    55
    6     $('.cdn-option input[type=checkbox], .cdn-option input[type=radio]').on('click', function(e) {
     6    $('.cdn-option-new input[type=checkbox], .cdn-option-new input[type=radio], .cdn-option-new .checkbox').on('click', function(e) {
    77      e.preventDefault()
    88      showModalLoader()
     9
    910      var form_type = $('form.arvancloud-options-form').attr('data-type');
    1011      if (form_type == 'acceleration') {
     
    1213          name: $(this).attr('name'),
    1314          status: $(this).is(":checked"),
    14           label: $(this).parent().parent().find('h3').html(),
     15          label: $(this).data('label'),
    1516          js: $('#js_optimization').is(":checked"),
    1617          css: $('#css_optimization').is(":checked"),
     18          png: $('#png_optimization').is(":checked"),
     19          jpeg: $('#jpeg_optimization').is(":checked"),
     20          gif: $('#gif_optimization').is(":checked"),
    1721        };
     22
    1823      } else if (form_type == 'ddos_protection') {
    1924        var ele = $('input[name="ddos_protection_mode"]:checked');
     
    2126          name:   $(ele).attr('name'),
    2227          value:  $(ele).val(),
    23           label:  $('form.arvancloud-options-form').parent().find('h2').html(),
     28          label:  $(this).parent().parent().parent().find('h2').html(),
    2429        };
    2530      } else if (form_type == 'cache_status') {
     
    3439          name:       $(this).attr('name'),
    3540          status:     $(this).is(":checked"),
    36           label:      $(this).parent().parent().find('h3').html(),
     41          label:      $(this).parent().parent().parent().find('h2').html(),
    3742          form_type:  form_type,
    3843        };
  • arvancloud-cdn/tags/1.0.1/admin/class-setup-admin.php

    r2777664 r3303568  
    55use WP_Arvan\CDN\Cache\Page_Rules;
    66use WP_Arvan\CDN\Domain_Info;
     7//use WP_Arvan\Security\DDoS_Protection;
     8
    79use WP_Arvan\Helper;
    810/**
     
    7072
    7173        wp_enqueue_style( $this->plugin_name, plugin_dir_url( __FILE__ ) . 'assets/css/wp-arvancloud-cdn-admin.css', array(), $this->version, 'all' );
    72 
    73         if ( is_rtl() ) {
     74        wp_enqueue_style( 'components', plugin_dir_url( ACCDN_PLUGIN_ABSOLUTE ) . 'assets/css/main.css', array($this->plugin_name), $this->version, 'all' );
     75
     76        //if ( is_rtl() ) {
    7477            wp_enqueue_style( $this->plugin_name . '-rtl', plugin_dir_url( __FILE__ ) . 'assets/css/admin-rtl.css', array(), $this->version, 'all' );
    75         }
     78        //}
    7679        wp_enqueue_style( 'toastrjs', plugin_dir_url( __FILE__ ) . 'assets/css/toastr.css', array(), $this->version, 'all' );
    7780        wp_enqueue_style( 'select2-css', plugin_dir_url( __FILE__ ) . 'assets/css/select2.min.css', array(), '4.1.0', 'all' );
     
    100103        if ( isset($_GET['page']) && substr( sanitize_text_field($_GET['page']), 0, 14 ) === ACCDN_SLUG) {
    101104            wp_enqueue_script( 'ar-cdn', plugin_dir_url( __FILE__ ) . 'assets/js/wp-arvancloud-cdn-admin.js', array( 'jquery', 'toastrjs' ), $this->version, false );
     105            wp_enqueue_script( 'cdn-admin', dirname(plugin_dir_url( __FILE__ )) . '/assets/js/cdn-admin.js', array( 'jquery', 'toastrjs' ), $this->version, false );
    102106            wp_enqueue_script( 'toastrjs', plugin_dir_url( __FILE__ ) . 'assets/js/toastr.js', array( 'jquery' ), '2.1.3', false );
    103    
     107
    104108            wp_enqueue_script('chartjs', plugin_dir_url( __FILE__ ) . 'assets/js/chart.min.js');
     109            wp_enqueue_script('chartjs-geo', plugin_dir_url( __FILE__ ) . 'assets/js/chartjs-chart-geo.min.js');
    105110            wp_enqueue_script('arvan-reports', plugin_dir_url( __FILE__ ) . 'assets/js/reports.js');
    106             wp_enqueue_script('arvan-firewall', plugin_dir_url( __FILE__ ) . 'assets/js/firewall.js');
    107    
     111
    108112            wp_enqueue_script('select2', plugin_dir_url( __FILE__ ) . 'assets/js/select2.min.js', array( 'jquery' ), '4.1.0', false );
    109113            wp_localize_script(
     
    122126                ],
    123127            );
    124             wp_localize_script(
    125                 'arvan-firewall',
    126                 'ar_cdn_ajax_object',
    127                 [
    128                     'ajax_url'  => admin_url( 'admin-ajax.php' ),
    129                     'security'  => wp_create_nonce( 'ar-cdn-options-nonce' ),
    130                     'is_rtl'=> is_rtl(),
    131                     'strings'     => [
    132                         'wait'  => __('Please Wait', 'arvancloud-cdn'),
    133                         'sent'  => __('Request sent.', 'arvancloud-cdn'),
    134                         'updated' => __('Updated', 'arvancloud-cdn'),
    135                         'failed' => __('Update failed', 'arvancloud-cdn'),
    136                         'and'   => __('+ AND', 'arvancloud-cdn'),
    137                     ],
    138                     'rule_options' => [
    139                         'ip.src' => [
    140                             ''  => '',
    141                             '==' => __('Equal', 'arvancloud-cdn'),
    142                             '!=' => __('Not equal', 'arvancloud-cdn'),
    143                             'in' => __('Is in a set of:', 'arvancloud-cdn'),
    144                         ],
    145                         'ip.geoip.country' => [
    146                             ''  => '',
    147                             '==' => __('Equal', 'arvancloud-cdn'),
    148                             '!=' => __('Not equal', 'arvancloud-cdn'),
    149                             'in' => __('Is in a set of:', 'arvancloud-cdn'),
    150                         ],
    151                         'http.request.uri.path' => [
    152                             ''  => '',
    153                             '==' => __('Equal', 'arvancloud-cdn'),
    154                             '!=' => __('Not equal', 'arvancloud-cdn'),
    155                             'contains' => __('Contains:', 'arvancloud-cdn'),
    156                             'matches' => __('Matches regex', 'arvancloud-cdn'),
    157                             'in' => __('Is in a set of:', 'arvancloud-cdn'),
    158                             'starts_with' => __('Starts with', 'arvancloud-cdn'),
    159                             'ends_with' => __('Ends with', 'arvancloud-cdn'),
    160                         ],
    161                         'http.host' => [
    162                             ''  => '',
    163                             '==' => __('Equal', 'arvancloud-cdn'),
    164                             '!=' => __('Not equal', 'arvancloud-cdn'),
    165                             'contains' => __('Contains:', 'arvancloud-cdn'),
    166                             'matches' => __('Matches regex', 'arvancloud-cdn'),
    167                             'in' => __('Is in a set of:', 'arvancloud-cdn'),
    168                             'starts_with' => __('Starts with', 'arvancloud-cdn'),
    169                             'ends_with' => __('Ends with', 'arvancloud-cdn'),
    170                         ],
    171                     ],
    172                     'rule_filter_type' => [
    173                         '' => '',
    174                         'ip.src' => __('IP Source Address', 'arvancloud-cdn'),
    175                         'ip.geoip.country' => __('Country', 'arvancloud-cdn'),
    176                         'http.request.uri.path' => __('URI Path', 'arvancloud-cdn'),
    177                         'http.host' => __('Hostname', 'arvancloud-cdn'),
    178                     ],
    179                     'rule_labels' => [
    180                         __('Parameter', 'arvancloud-cdn'),
    181                         __('Operator', 'arvancloud-cdn'),
    182                         __('Value', 'arvancloud-cdn'),
    183                     ],
    184                     'list_of_countries' => Helper::all_countries(),
    185                 ],
    186             );
    187128        }
    188129    }
     
    197138    public function setup_admin_menu() {
    198139
    199         add_menu_page( 
    200             __( ACCDN_NAME, 'arvancloud-cdn' ), 
    201             __( ACCDN_NAME, 'arvancloud-cdn'), 
    202             'manage_options', 
    203             ACCDN_SLUG, 
     140        add_menu_page(
     141            __( ACCDN_NAME, 'arvancloud-cdn' ),
     142            __( ACCDN_NAME, 'arvancloud-cdn'),
     143            'manage_options',
     144            ACCDN_SLUG,
    204145            __CLASS__ . '::settings_page',
    205146            ACCDN_PLUGIN_ROOT_URL . 'admin/assets/img/arvancloud-logo.svg'
     
    227168            );
    228169
    229             add_submenu_page(
    230                 ACCDN_SLUG,
    231                 __( 'DDoS Protection', 'arvancloud-cdn' ),
    232                 __( 'DDoS Protection', 'arvancloud-cdn' ),
    233                 'manage_options',
    234                 ACCDN_SLUG . '-ddos_protection',
    235                 __CLASS__ . '::ddos_protection_page',
    236             );
    237 
    238170
    239171            add_submenu_page(
     
    246178            );
    247179
    248             add_submenu_page(
    249                 ACCDN_SLUG,
    250                 __( 'Firewall', 'arvancloud-cdn' ),
    251                 __( 'Firewall', 'arvancloud-cdn' ),
    252                 'manage_options',
    253                 ACCDN_SLUG . '-firewall',
    254                 __CLASS__ . '::firewall_settings_page',
    255             );
    256 
    257             add_submenu_page(
    258                 ACCDN_SLUG,
    259                 __( 'Cache Level', 'arvancloud-cdn' ),
    260                 __( 'Caching Settings', 'arvancloud-cdn' ),
    261                 'manage_options',
    262                 ACCDN_SLUG . '-caching',
    263                 __CLASS__ . '::caching_settings_page',
    264             );
    265 
    266180
    267181            add_submenu_page(
     
    276190            add_submenu_page(
    277191                ACCDN_SLUG,
    278                 __( 'Status Analysis', 'arvancloud-cdn' ),
    279                 __( 'Status Analysis', 'arvancloud-cdn' ),
     192                __( 'Analytics', 'arvancloud-cdn' ),
     193                __( 'Analytics', 'arvancloud-cdn' ),
    280194                'manage_options',
    281                 ACCDN_SLUG . '-status-reports',
    282                 __CLASS__ . '::reports_status_page',
     195                ACCDN_SLUG . '-analytics',
     196                __CLASS__ . '::analytics',
    283197            );
    284198
    285199        }
    286 
     200        add_submenu_page(
     201            ACCDN_SLUG,
     202            __( 'CDN Plans', 'arvancloud-cdn' ),
     203            __( 'CDN Plans', 'arvancloud-cdn' ),
     204            'manage_options',
     205            ACCDN_SLUG.'-plans',
     206            __CLASS__ . '::plans_page',
     207        );
     208
     209        add_submenu_page(
     210            ACCDN_SLUG,
     211            __( 'Troubleshoots', 'arvancloud-cdn' ),
     212            __( 'Troubleshoots', 'arvancloud-cdn' ),
     213            'manage_options',
     214            ACCDN_SLUG.'-troubleshoots',
     215            __CLASS__ . '::troubleshoots',
     216        );
    287217
    288218        add_submenu_page(
     
    294224            __CLASS__ . '::about_us_page'
    295225        );
     226
     227        // add_submenu_page(
     228        //     ACCDN_SLUG,
     229        //     __( 'Compontents', 'arvancloud-cdn' ),
     230        //     __( 'Compontents', 'arvancloud-cdn' ),
     231        //     'manage_options',
     232        //     ACCDN_SLUG . '-components',
     233        //     __CLASS__ . '::components'
     234        // );
    296235    }
    297236
     
    347286    }
    348287
    349     public static function reports_status_page() {
    350         require_once( 'views/reports/reports_status.php' );
    351     }
    352 
    353     public static function ddos_protection_page() {
    354         require_once( 'views/security/ddos_protection.php' );
     288    public static function analytics() {
     289        require_once( 'views/reports/analytics.php' );
    355290    }
    356291
     
    363298    }
    364299
    365     public static function firewall_settings_page() {
    366         require_once( 'views/security/firewall_settings.php' );
    367     }
    368 
    369     public static function caching_settings_page() {
    370         require_once( 'views/cache/caching_settings.php' );
    371     }
    372    
     300    public static function components() {
     301        require_once( ACCDN_PLUGIN_ROOT .'/components/components.php' );
     302    }
     303    public static function plans_page() {
     304        require_once( 'views/plans.php' );
     305    }
     306    public static function troubleshoots() {
     307        require_once( 'views/troubleshoots.php' );
     308    }
     309
    373310    /**
    374311     * about_us_page
     
    412349     */
    413350    public static function plugin_status() {
    414        
     351
    415352        $credentials_status = get_option( 'arvan-cloud-cdn-status' );
    416353        switch ($credentials_status) {
     
    433370
    434371        return wp_kses_post($status);
    435                
     372
    436373    }
    437374
    438375    public static function cdn_plan_level() {
    439        
     376
    440377        $cdn_level = Domain_Info::$plan_level;
    441378        switch ($cdn_level) {
  • arvancloud-cdn/tags/1.0.1/admin/helper.php

    r2845955 r3303568  
    2424     */
    2525    public static function get_site_domain( $subdomain_check = true ) {
    26 
    2726        $pieces = parse_url(home_url());
    2827
     
    4443    }
    4544
    46     public static function size_convertor( $size=0 ) {
     45    public static function size_convertor( $size=0,$translate=true ) {
    4746        if($size < 1024) {
    48             return "{$size} " . esc_html__( 'Bytes', 'arvancloud-cdn' );
     47            return "{$size} " . ($translate?esc_html__( 'Bytes', 'arvancloud-cdn' ):'Bytes');
    4948        } else if ( $size < 1048576 ) {
    5049            $size_kb = round($size/1024);
    51             return "{$size_kb} " . esc_html__( 'Kilobyte', 'arvancloud-cdn' );
     50            return "{$size_kb} " . ($translate?esc_html__( 'Kilobyte', 'arvancloud-cdn' ):'KB');
    5251        } else if ( $size < 1073741824 ) {
    5352            $size_mb = round($size/1048576, 1);
    54             return "{$size_mb} " . esc_html__( 'Megabyte', 'arvancloud-cdn' );
     53            return "{$size_mb} " . ($translate?esc_html__( 'Megabyte', 'arvancloud-cdn' ):'MB');
    5554        } else {
    5655            $size_gb = round($size/1048576/1024, 1);
    57             return "{$size_gb} " . esc_html__( 'Gigabyte', 'arvancloud-cdn' );
     56            return "{$size_gb} " . ($translate?esc_html__( 'Gigabyte', 'arvancloud-cdn' ):'GB');
    5857        }
    5958    }
     
    7877
    7978        $countries = wp_remote_get( $country_endpoint );
    80        
     79
    8180        if (is_wp_error($countries) || !isset($countries['body']) || wp_remote_retrieve_response_code($countries) !== 200) {
    8281            return false;
     
    132131    }
    133132
     133       
     134    public static function set_firewall_settings(){
     135       
     136        $dm_info = Domain_Info::get_domain_info();
     137        if($dm_info['plan_level']>2){
     138            $waf_enable = Request_Arvan::patch('/waf/settings',json_encode(['mode'=>'protect']));
     139           
     140            if($waf_enable->status_code==200){
     141                $disable = [40002,41001,40026,41018,41029,41032,41033,41035,42069,51001,51033,51037,51039,90025];
     142                $pak_enable = Request_Arvan::patch('/waf/packages/default',json_encode(['is_enabled'=>true, 'disabled_rules'=>$disable]));
     143               
     144                if($pak_enable->status_code==200){
     145                    $disable = [920220,920240,920272,920274,942421];
     146                    $pak_enable = Request_Arvan::patch('/waf/packages/crs',json_encode(['is_enabled'=>true, 'disabled_rules'=>$disable]));
     147                }
     148               
     149                if($pak_enable->status_code==200){
     150                    $disable = [];
     151                    $pak_enable = Request_Arvan::patch('/waf/packages/comodo',json_encode(['is_enabled'=>true, 'disabled_rules'=>$disable]));
     152                }
     153               
     154                if($pak_enable->status_code != 200)
     155                    Helper::show_admin_notice('Unable connect to active packages');
     156            }else
     157                Helper::show_admin_notice('Unable connect to arvan server');
     158        }
     159    }
    134160}
  • arvancloud-cdn/tags/1.0.1/admin/inc/API/HTTP/class-request-arvan.php

    r2845955 r3303568  
    8282    public static function post(string $endpoint = 'domains/', string $data, string $api_key = null)
    8383    {
    84 
    8584        $headers = self::get_headers($api_key);
    8685        $response = \Requests::post( self::$arvan_cloud . $endpoint, $headers, $data );
  • arvancloud-cdn/tags/1.0.1/admin/inc/CDN/class-acceleration.php

    r2777664 r3303568  
    3232        // request is correct
    3333        $item = array_map( 'sanitize_text_field', $_GET['option_item'] );
    34 
     34        if($item['name']=='resize_images'){
     35            $data = array(
     36                "status"   => $item['status']?'on':'off',
     37                //"height_by"=> 'height',
     38                //"width_by" => 'width',
     39            );
     40            $response = Request_Arvan::patch('/image-resize', json_encode($data));
     41        }else{
    3542        // should send request to arvancloud
    3643       
     
    3845        $js_status  = ($item['js'] == 'true');
    3946        $css_status = ($item['css'] == 'true');
     47        $png_status = ($item['png'] == 'true');
     48        $jpeg_status = ($item['jpeg'] == 'true');
     49        $gif_status = ($item['gif'] == 'true');
    4050        $data = array(
    4151            "status"=> "on",
     
    4454        if ($js_status) array_push( $data['extensions'], 'js' );
    4555        if ($css_status) array_push( $data['extensions'], 'css' );
     56        if ($png_status) array_push( $data['extensions'], 'png' );
     57        if ($jpeg_status) array_push( $data['extensions'], 'jpeg' );
     58        if ($gif_status) array_push( $data['extensions'], 'gif' );
    4659
    4760        $response = Request_Arvan::patch($endpoint, json_encode($data));
     61        }
    4862        $http_code = $response->status_code;
    4963
     
    6478            'js_optimization',
    6579            'css_optimization',
     80            'png_optimization',
     81            'jpeg_optimization',
     82            'gif_optimization',
     83            'resize_images'
    6684        ];
    6785
     
    7997        return Request_Arvan::get("domains/$domain/acceleration");
    8098    }
     99
     100    public static function get_img_options() {
     101        $domain = Helper::get_site_domain();
     102
     103        return Request_Arvan::get("domains/$domain/image-resize");
     104    }
    81105}
  • arvancloud-cdn/tags/1.0.1/admin/inc/CDN/class-cdn-options.php

    r2788597 r3303568  
    3232
    3333        if ( sanitize_text_field($_GET['option_item']['name']) == 'setup_recommended_rules' ) {
    34             if ( $_GET['option_item']['status'] == 'true' ) {
    35                 Page_Rules::setup_recommended_rules();
     34
     35            /*if ( $_GET['option_item']['status'] == 'true' ) {
     36                Page_Rules::setup_recommended_rules();
    3637            } else {
    3738                Page_Rules::update_recommended_rules(false);
    38             }
    39 
     39            }*/
     40            self::setup_wordpress_optimum_settings();
    4041            wp_send_json_success();
    4142            wp_die();
     
    5354
    5455        // should send request to arvancloud
    55        
    56         $endpoint = '/caching';
    57         $data = array($item[ 'name' ] => ($item['status'] == 'true') ? 1 : 0);
    58         $response = Request_Arvan::patch($endpoint, json_encode($data));
     56        if($item['name'] == 'ddos_protection_mode')
     57        {
     58            $endpoint = '/ddos/settings';
     59            $data = array('protection_mode' => ($item['status'] == 'true') ? 'javascript' : 'off');
     60            $response = Request_Arvan::patch($endpoint, json_encode($data));
     61        }else if($item['name'] == 'cache_status')
     62        {
     63
     64            $endpoint = '/caching';
     65            $data = array('cache_status' => ($item['status'] == 'true') ? 'query_string' : 'off');
     66            $response = Request_Arvan::patch($endpoint, json_encode($data));
     67        }else{
     68            $endpoint = '/caching';
     69            $data = array($item[ 'name' ] => ($item['status'] == 'true') ? 1 : 0);
     70            $response = Request_Arvan::patch($endpoint, json_encode($data));
     71        }
     72
     73
    5974        $http_code = $response->status_code;
    6075
     
    85100            'cache_args',
    86101            'cache_arg',
    87             'setup_recommended_rules'
     102            'setup_recommended_rules',
     103            'ddos_protection_mode'
    88104        ];
    89105
     
    101117        return Request_Arvan::get("domains/$domain/caching");
    102118    }
     119
     120    public static function setup_wordpress_optimum_settings(){
     121
     122        self::wp_optimum_set_waf_rules();
     123        self::wp_optimum_set_global_rules();
     124        self::wp_optimum_set_acceleration_rules();
     125        self::wp_optimum_set_firewall_rules();
     126        self::wp_optimum_set_page_rules();
     127    }
     128
     129    private static function wp_optimum_set_global_rules(){
     130        /*
     131         * Set caching data
     132         */
     133
     134        $endpoint = '/caching';
     135        $data = array(
     136            'cache_status' => 'query_string',
     137            'cache_developer_mode'=>false,
     138            'cache_page_200'=>'30d',
     139            'cache_page_any'=>'0s',
     140            'cache_browser'=>'5h',
     141        );
     142        Request_Arvan::patch($endpoint, json_encode($data));
     143
     144        $endpoint = '/ddos/settings';
     145        $data = array(
     146            "protection_mode"=> "cookie",
     147        );
     148
     149        $response = Request_Arvan::patch($endpoint, json_encode($data));
     150
     151    }
     152
     153
     154    private static function wp_optimum_set_acceleration_rules(){
     155        $endpoint   = '/acceleration';
     156
     157        $data = array(
     158            "status"=> "on",
     159            "extensions"=> []
     160        );
     161        array_push( $data['extensions'], 'js', 'css' );
     162
     163        if(Domain_Info::$plan_level > 1)
     164        {
     165            array_push( $data['extensions'], 'gif', 'jpeg', 'png' );
     166        }
     167        /*
     168         * acceleration for professional account should be implemented
     169         */
     170        $response = Request_Arvan::patch($endpoint, json_encode($data));
     171
     172    }
     173
     174    private static function wp_optimum_set_page_rules(){
     175
     176        $acceleration = [
     177            'status' => 'off',
     178            'extensions' => []
     179        ];
     180
     181
     182        $data = [
     183            'seq'=>'5',
     184            'cache_status' => 'off',
     185            'cache_browser'=>'0s',
     186            'cache_page_any'=>'0s',
     187            'cache_page_200'=>'0s',
     188            'cache_ignore_sc'=>false,
     189            'cache_args'=>false,
     190            'acceleration' => $acceleration,
     191            'image_resize'=> [
     192                'status'=>'off'
     193            ],
     194        ];
     195
     196        if(Page_Rules::is_rule_exist('/wp-admin/*')){
     197            Page_Rules::remove_rule('/wp-admin/*');
     198        }
     199        Page_Rules::add_rule('/wp-admin/*', 'off', $data);
     200
     201        if ( in_array( 'woocommerce/woocommerce.php', apply_filters( 'active_plugins', get_option( 'active_plugins' ) ) ) ) {
     202
     203            if(Page_Rules::is_rule_exist('/cart')){
     204                Page_Rules::remove_rule('/cart');
     205            }
     206            Page_Rules::add_rule('/cart', 'off', $data);
     207
     208            if(Page_Rules::is_rule_exist('/checkout')){
     209                Page_Rules::remove_rule('/checkout');
     210            }
     211            Page_Rules::add_rule('/checkout', 'off', $data);
     212
     213            if(Page_Rules::is_rule_exist('/my-account')){
     214                Page_Rules::remove_rule('/my-account');
     215            }
     216            Page_Rules::add_rule('/my-account', 'off', $data);
     217        }
     218
     219        /*
     220         * wp upload folder based on acceleration settings
     221         */
     222
     223        $acceleration = Acceleration::get_options();
     224
     225        $data = [
     226            'seq'=>'5',
     227            'cache_status' => 'off',
     228            'cache_browser'=>'0s',
     229            'cache_page_any'=>'0s',
     230            'cache_page_200'=>'0s',
     231            'cache_ignore_sc'=>false,
     232            'cache_args'=>false,
     233            'acceleration' => $acceleration,
     234            'image_resize'=> [
     235                'status'=>'off'
     236            ],
     237        ];
     238
     239        if(Page_Rules::is_rule_exist('/wp-content/uploads/*')){
     240            Page_Rules::remove_rule('/wp-content/uploads/*');
     241        }
     242        Page_Rules::add_rule('/wp-content/uploads/*', 'off', $data);
     243
     244    }
     245
     246    private static function wp_optimum_set_firewall_rules(){
     247        $data = array(
     248            'action'        => 'deny',
     249            'name'          => 'xmlrpcphp Blocking',
     250            'filter_expr'   => "((http.request.uri.path contains \"/xmlrpc.php**\"))",
     251            'is_enabled'    => true,
     252        );
     253
     254        $endpoint = 'domains/' . Helper::get_site_domain() . '/firewall/rules';
     255
     256        $response = Request_Arvan::post( $endpoint, json_encode( $data));
     257    }
     258
     259    public function wp_optimum_set_waf_rules(){
     260       
     261        $dm_info = Domain_Info::get_domain_info();
     262        if($dm_info['plan_level']>2){
     263            $waf_enable = Request_Arvan::patch('/waf/settings',json_encode(['mode'=>'protect']));
     264           
     265            if($waf_enable->status_code==200){
     266                $disable = [40002,41001,40026,41018,41029,41032,41033,41035,42069,51001,51033,51037,51039,90025];
     267                $pak_enable = Request_Arvan::patch('/waf/packages/default',json_encode(['is_enabled'=>true, 'disabled_rules'=>$disable]));
     268               
     269                if($pak_enable->status_code==200){
     270                    $disable = [920220,920240,920272,920274,942421];
     271                    $pak_enable = Request_Arvan::patch('/waf/packages/crs',json_encode(['is_enabled'=>true, 'disabled_rules'=>$disable]));
     272                }
     273               
     274                if($pak_enable->status_code==200){
     275                    $disable = [];
     276                    $pak_enable = Request_Arvan::patch('/waf/packages/comodo',json_encode(['is_enabled'=>true, 'disabled_rules'=>$disable]));
     277                }
     278               
     279                if($pak_enable->status_code != 200)
     280                    Helper::show_admin_notice('Unable connect to active packages');
     281            }else
     282                Helper::show_admin_notice('Unable connect to arvan server');
     283        }
     284    }
    103285}
  • arvancloud-cdn/tags/1.0.1/admin/inc/CDN/class-domain-auto-add.php

    r2943546 r3303568  
    3838
    3939        $this->cdn_domain_list = [];
    40 
    4140    }
    4241
  • arvancloud-cdn/tags/1.0.1/admin/inc/CDN/class-reports.php

    r2943546 r3303568  
    142142        $this->labels = $this->format_chart_label();
    143143        $this->datasets = $this->format_chart_datasets();
     144        $this->lists    = isset($report['lists'])?$report['lists']:[];
    144145
    145146        self::$_instance = $this;
     
    326327    private function set_report_data($endpoint, $charts)
    327328    {
    328         if ($endpoint == 'traffics' && $this->report_type != 'requests') {
     329        if (in_array($endpoint,['traffics','traffics/map','dns-geo']) && $this->report_type != 'requests') {
    329330            return $charts['requests'];
    330331        } else if ($endpoint == 'traffics') {
  • arvancloud-cdn/tags/1.0.1/admin/views/acceleration.php

    r2752685 r3303568  
    11<?php
     2use WP_Arvan\CDN\Domain_Info;
    23use WP_Arvan\CDN\Acceleration;
    34
    45$options = Acceleration::get_options();
    5 if(!$options || !isset($options['status'])) {
    6     wp_safe_redirect( esc_url( admin_url( '/admin.php?page=arvancloud-cdn' ) ) );
     6$ioption = Acceleration::get_img_options();
     7if (!$options || !isset($options['status'])) {
     8    wp_safe_redirect(esc_url(admin_url('/admin.php?page=arvancloud-cdn')));
    79}
    8 
    9 $js_optimization    = false;
    10 $css_optimization   = false;
     10$level = Domain_Info::get_domain_info()['plan_level'];
     11$js_optimization = false;
     12$css_optimization = false;
     13$png_optimization = false;
     14$jpeg_optimization = false;
     15$gif_optimization = false;
    1116if ($options['status'] == true && isset($options['extensions'])) {
    12     $js_optimization    = in_array('js', $options['extensions']);
    13     $css_optimization   = in_array('css', $options['extensions']);
     17    $js_optimization = in_array('js', $options['extensions']);
     18    $css_optimization = in_array('css', $options['extensions']);
     19    $png_optimization = in_array('png', $options['extensions']);
     20    $jpeg_optimization = in_array('jpeg', $options['extensions']);
     21    $gif_optimization = in_array('gif', $options['extensions']);
    1422}
    1523?>
    16 
    17 
    1824<div class="wrap ar-wrap">
    19     <h1><?php esc_html_e('Web Acceleration', 'arvancloud-cdn'); ?></h1>
    20     <?php require_once( ACCDN_PLUGIN_ROOT . 'admin/views/components/header.php' ) ?>
     25    <?php require_once(ACCDN_PLUGIN_ROOT . 'admin/views/components/header.php') ?>
    2126    <br>
    22    
    2327    <div class="arvan-wrapper">
    2428        <div class="arvan-card">
    25             <h2><?php esc_html_e('Web Acceleration', 'arvancloud-cdn'); ?></h2>
    26             <p><?php echo esc_html__( 'When this feature is enabled, ArvanCloud\'s edge servers will be shown the latest cache version of your site to the users if your website or web server goes down.', 'arvancloud-cdn' ) ?></p>
    27             <form class="arvancloud-options-form arvancloud-acceleration-options" method="post" action="<?php echo esc_url( admin_url( '/admin.php?page=arvancloud-cdn' )); ?>" data-type="acceleration">
    28                 <div class="cdn-option">
    29                     <div class="input-container">
    30                         <input type="checkbox" id="js_optimization" name="js_optimization" <?php echo $js_optimization ? 'checked' : ''; ?>/>
    31                         <label for="js_optimization">Toggle</label>
    32                     </div>
    33                     <div class="detail-container">
    34                         <h3><?php esc_html_e('JavaScript Optimization', 'arvancloud-cdn'); ?></h3>
    35                         <p><?php esc_html_e('With enabling this feature the size of files will decrease by linearizing, summarizing, and removing comments.', 'arvancloud-cdn'); ?></p>
    36                     </div>
     29            <form class="arvancloud-options-form arvancloud-acceleration-options" method="post"
     30                  action="<?php echo esc_url(admin_url('/admin.php?page=arvancloud-cdn')); ?>" data-type="acceleration">
     31                <div class="ar-acceleration">
     32                    <h1 class="mb-8 acceleration-title"><?php esc_html_e('Web Acceleration', 'arvancloud-cdn'); ?></h1>
     33                    <p class="font-14 font-weight-medium"><?php echo esc_html__('When this feature is enabled, ArvanCloud\'s edge servers will be shown the latest cache version of your site to the users if your website or web server goes down.', 'arvancloud-cdn') ?></p>
     34                    <article class="cdn-option-new ar-card p-24 mb-24">
     35                        <h2 class="mb-8"><?php esc_html_e('CSS and JavaScript Optimization', 'arvancloud-cdn'); ?></h2>
     36                        <p class="font-14 font-weight-medium mb-16"><?php esc_html_e('With enabling this feature the size of files will decrease by linearizing, summarizing, and removing comments.', 'arvancloud-cdn'); ?></p>
     37                        <div>
     38                            <div class="custom-switch custom-switch--large me-24">
     39                                <input data-label="<?php esc_html_e('CSS Optimization', 'arvancloud-cdn'); ?>"
     40                                       class="custom-switch-input" type="checkbox" id="css_optimization"
     41                                       name="css_optimization" <?php echo ($css_optimization == true) ? 'checked' : ''; ?>>
     42                                <label class="custom-switch-label" for="css_optimization">CSS</label>
     43                            </div>
     44                            <div class="custom-switch custom-switch--large">
     45                                <input data-label="<?php esc_html_e('Javascript Optimization', 'arvancloud-cdn'); ?>"
     46                                       class="custom-switch-input" type="checkbox" id="js_optimization"
     47                                       name="js_optimization" <?php echo ($js_optimization == true) ? 'checked' : ''; ?>>
     48                                <label class="custom-switch-label" for="js_optimization">JavaScript</label>
     49                            </div>
     50                        </div>
     51                    </article>
     52                    <article class="cdn-option-new ar-card p-24 mb-24">
     53                        <h2 class="mb-8"><?php esc_html_e('Image Compression', 'arvancloud-cdn'); ?></h2>
     54                        <p class="font-14 font-weight-medium mb-16"><?php esc_html_e('When enabled, converting images to Webp reduces file size and speeds up loading', 'arvancloud-cdn'); ?> </p>
     55                        <div>
     56                            <div class="custom-switch custom-switch--large me-24">
     57                                <input data-label="<?php esc_html_e('JPG Optimization', 'arvancloud-cdn'); ?>" class="custom-switch-input"  type="checkbox" id="jpeg_optimization" name="jpeg_optimization" <?php echo ($jpeg_optimization == true) ? 'checked' : ''; ?>>
     58                                <label class="custom-switch-label" for="jpeg_optimization">JPG</label>
     59                            </div>
     60                            <div class="custom-switch custom-switch--large me-24">
     61                                <input data-label="<?php esc_html_e('PNG Optimization', 'arvancloud-cdn'); ?>" class="custom-switch-input" type="checkbox" id="png_optimization" name="png_optimization" <?php echo ($png_optimization == true) ? 'checked' : ''; ?>>
     62                                <label class="custom-switch-label" for="png_optimization">PNG</label>
     63                            </div>
     64                            <div class="custom-switch custom-switch--large">
     65                                <input data-label="<?php esc_html_e('GIF Optimization', 'arvancloud-cdn'); ?>" class="custom-switch-input"  type="checkbox" id="gif_optimization" name="gif_optimization" <?php echo ($gif_optimization == true) ? 'checked' : ''; ?>>
     66                                <label class="custom-switch-label" for="gif_optimization">GIF</label>
     67                            </div>
     68                        </div>
     69                    </article>
     70                    <article class="ar-card p-24 mb-24">
     71                        <div class="display-flex align-items-start">
     72                            <div class="flex-grow-1 me-16 mb-16">
     73                                <div class="cdn-option-new custom-switch custom-switch--large mb-8">
     74                                    <input class="custom-switch-input" <?php echo $level==1?' disabled="disabled"':''; echo $ioption['status']=='on'?'checked="checked"':'' ?> type="checkbox" name="resize_images" id="custom-checkbox-17">
     75                                    <label class="custom-switch-label" for="custom-checkbox-17"><h2 class="m-0"><?php esc_html_e('Image Resizing', 'arvancloud-cdn'); ?></h2></label>
     76                                </div>
     77                                <p class="font-14 font-weight-medium m-0"><?php esc_html_e('The CDN server displays the images according to the dimensions requested by the user and removes the extra load from your main server. When enabled, add the desired dimensions in the end of the file address. Example:', 'arvancloud-cdn'); ?></p>
     78                            </div>
     79                            <a class="btn btn--enterprise btn--medium" href="https://panel.arvancloud.ir/cdn/<?php echo \WP_Arvan\Helper::get_site_domain() ?>/plans"><?php esc_html_e('Upgrade Plan', 'arvancloud-cdn'); ?></a>
     80                        </div>
     81                        <p class="m-0 dir-ltr ar-example-msg"><?php echo \WP_Arvan\Helper::get_site_domain(); ?>/imagename.jpg?width=100&height=50</p>
     82                        <p class="display-flex align-items-start"><?php esc_html_e('This feature is active in professional and higher packages.', 'arvancloud-cdn'); ?></p>
     83                    </article>
     84                    <div id="lock-modal"></div>
     85                    <div id="loading-circle"></div>
    3786                </div>
    38                 <div class="cdn-option">
    39                     <div class="input-container">
    40                         <input type="checkbox" id="css_optimization" name="css_optimization" <?php echo $css_optimization ? 'checked' : ''; ?>/>
    41                         <label for="css_optimization">Toggle</label>
    42                     </div>
    43                     <div class="detail-container">
    44                         <h3><?php esc_html_e('CSS Optimization', 'arvancloud-cdn'); ?></h3>
    45                         <p><?php esc_html_e('With enabling this feature the size of files will decrease by linearizing, summarizing, and removing comments.', 'arvancloud-cdn'); ?></p>
    46                     </div>
    47                 </div>
    48 
    49 
    50                 <div id="lock-modal"></div>
    51                 <div id="loading-circle"></div>
    5287            </form>
    5388        </div>
    5489    </div>
    55    
    56  
    5790    <br>
    58     <?php require_once( ACCDN_PLUGIN_ROOT . 'admin/views/components/footer.php' ); ?>
     91    <?php require_once(ACCDN_PLUGIN_ROOT . 'admin/views/components/footer.php'); ?>
    5992</div>
  • arvancloud-cdn/tags/1.0.1/admin/views/components/footer.php

    r2850501 r3303568  
    22use WP_Arvan\Helper;
    33?>
    4 <div class="acs-footer">
    5     <div class="acs-footer-links">       
    6         <ul>
    7             <li><a href="https://panel.arvancloud.ir/cdn/<?php echo Helper::get_site_domain(); ?>/plans" target="_blank" rel="noopener noreferrer"><?php echo esc_html_e( 'CDN Plans', 'arvancloud-cdn' ) ?> <span class="dashicons dashicons-external"></span></a></li>
    8             <li><a href="https://forum.arvancloud.ir/c/cdn/47" target="_blank" rel="noopener noreferrer"><?php echo esc_html_e( 'Support', 'arvancloud-cdn' ) ?> <span class="dashicons dashicons-external"></span></a></li>
    9             <li><a href="mailto:[email protected]" target="_blank" rel="noopener noreferrer"><?php echo esc_html_e( 'Email Us', 'arvancloud-cdn' ) ?> <span class="dashicons dashicons-email"></span></a></li>
    10         </ul>
    11     </div>
    12     <div class="acs-footer-social">
    13         <div class="footer__social-icons">
    14             <?php
    15             if ( get_locale() == 'fa_IR' ) {
    16                 echo wp_kses_post('<a class="footer__social-icons__link footer__social-icons--telegram" href="https://t.me/arvancloud" target="_blank" rel="noopener noreferrer">
    17                     <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 34.59 29.03"><g><g><path d="M34.05,2.17,26.35,27.4a1.4,1.4,0,0,1-2.21.85L12.93,19.87,12.32,26a.56.56,0,0,1-1.08.12L8.3,17.57,1.47,15.35a1.4,1.4,0,0,1-.08-2.63L32.17.6A1.4,1.4,0,0,1,34.05,2.17Z" style="fill:none;stroke:#7ce8dd;stroke-linecap:round;stroke-linejoin:round;stroke-width:1.00622773842599px"></path><polyline points="8.3 17.57 27.96 5.6 12.93 19.87" style="fill:none;stroke:#7ce8dd;stroke-linecap:round;stroke-linejoin:round;stroke-width:1.00622773842599px"></polyline><line x1="16.49" y1="22.53" x2="12.07" y2="26.37" style="fill:none;stroke:#7ce8dd;stroke-linecap:round;stroke-linejoin:round;stroke-width:1.00622773842599px"></line></g></g></svg>                   
    18                     </a>');
    19             }
    20             ?>
    21            
    22             <a class="footer__social-icons__link footer__social-icons--linkedin" href="<?php echo esc_url(get_locale() == 'fa_IR' ? 'https://www.linkedin.com/company/arvancloud-fa' : 'https://www.linkedin.com/company/arvancloud') ?>" target="_blank" rel="noopener noreferrer">
    23                 <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 29.41 29.85"><g><g><rect x="0.97" y="10.18" width="6.53" height="19.16" style="fill:none;stroke:#7ce8dd;stroke-linecap:round;stroke-linejoin:round;stroke-width:1.00622773842599px"></rect><path d="M28.9,16.17V29.34H22.38V17.53a2.43,2.43,0,0,0-1.2-2.13A3.09,3.09,0,0,0,19.6,15a2.79,2.79,0,0,0-1.29.34,3.62,3.62,0,0,0-1.91,3.26V29.34H9.87V10.18H16.4v2.05A8,8,0,0,1,21.09,10a11.27,11.27,0,0,1,3,.28h0l.24.07a8,8,0,0,1,.78.25l.23.1.22.09.24.13a5.64,5.64,0,0,1,.7.46l0,0A6,6,0,0,1,28.9,16.17Z" style="fill:none;stroke:#7ce8dd;stroke-linecap:round;stroke-linejoin:round;stroke-width:1.00622773842599px"></path><circle cx="4.42" cy="4.42" r="3.92" style="fill:none;stroke:#7ce8dd;stroke-linecap:round;stroke-linejoin:round;stroke-width:1.00622773842599px"></circle></g></g></svg>                   
    24             </a>
    25             <a class="footer__social-icons__link footer__social-icons--twitter" href="<?php echo esc_url(get_locale() == 'fa_IR' ? 'https://twitter.com/ArvanCloud_fa' : 'https://twitter.com/ArvanCloud') ?>" target="_blank" rel="noopener noreferrer">
    26                 <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 34.72 28.86"><g><g><path d="M8.81,23.82a7.45,7.45,0,0,1-2.72,1.94,10.49,10.49,0,0,1-2.5.83A5.9,5.9,0,0,1,1,26.78c11.19,4.6,28.58-.61,28.66-19.15,0,0,3.68-2.07,4.59-4.68L31.68,4,33.45.66a8.5,8.5,0,0,1-5.59,2.22C26.17-.95,15-1,16.67,9.31,8.32,10.31,1.35,2.5,1.35,2.5S-.49,7.78,3.87,11c0,0-.42,1.13-3.37,0,0,0,.92,5.9,6,5.9,0,0,.41,2.74-3.3,1.91A7.67,7.67,0,0,0,9.54,22a7.23,7.23,0,0,1-.17.8A3.68,3.68,0,0,1,8.81,23.82Z" style="fill:none;stroke:#7ce8dd;stroke-linecap:round;stroke-linejoin:round;stroke-width:1.00622773842599px"></path></g></g></svg>                   
    27             </a>
    28             <a class="footer__social-icons__link footer__social-icons--instagram" href="<?php echo esc_url(get_locale() == 'fa_IR' ? 'https://instagram.com/arvancloud_fa' : 'https://www.instagram.com/arvancloud') ?>" target="_blank" rel="noopener noreferrer">
    29                 <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 29.2 29.34"><g><g><rect x="0.5" y="0.5" width="28.19" height="28.34" rx="8.18" ry="8.18" style="fill:none;stroke:#7ce8dd;stroke-linecap:round;stroke-linejoin:round;stroke-width:1.00622773842599px"></rect><circle cx="14.6" cy="14.67" r="6.8" style="fill:none;stroke:#7ce8dd;stroke-linecap:round;stroke-linejoin:round;stroke-width:1.00622773842599px"></circle><circle cx="22.61" cy="6.65" r="1.22" style="fill:none;stroke:#7ce8dd;stroke-linecap:round;stroke-linejoin:round;stroke-width:1.00622773842599px"></circle></g></g></svg>                   
    30             </a>
    31             <a class="footer__social-icons__link footer__social-icons--github" href="https://github.com/arvancloud" target="_blank" rel="noopener noreferrer">
    32                 <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 139.04 160.41"><path d="M93.75,102.76c29.9-.11,57.07-38.71,33.1-72.61,2-5.25,2.25-19-1.75-26.75-8.25-2.75-28.25,9.75-28.25,9.75-13.75-7.5-38.24-4.42-47,.25,0,0-20-12.5-28.25-9.75-4,7.75-3.75,21.5-1.75,26.75C-4.11,64.3,23.06,102.9,53,103a1.35,1.35,0,0,1,1.18,2c-1.85,3-3.51,8-4.76,13.82a54.86,54.86,0,0,1-8,1,17.75,17.75,0,0,1-15.18-7.11c-3.17-4.24-6-9.14-9.91-11.37C10.8,98.22,6.22,98.2,3.64,100a1.55,1.55,0,0,0,.21,2.63c13.51,7.09,14.17,19.06,22.5,25.25,5.14,3.81,16.93,4.56,21,4.71-.71,8.84-.41,17.94,1.48,24.79l49-.25c4.32-15.7.36-43.19-5.28-52.35A1.35,1.35,0,0,1,93.75,102.76Z" style="fill:none;stroke:#8ccece;stroke-miterlimit:10;stroke-width:6px"></path></svg>                   
    33             </a>
     4<div class="arvan-wrapper">
     5    <div class="arvan-footer arvan-wrapper-card">
     6        <div class="ar-footer-row">
     7            <div class="ar-footer-col">
     8                <a class="ar-footer-link me-24" href="mailto:[email protected]">
     9                    <svg class="me-8" width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
     10                        <path d="M2.66668 2.66669H13.3333C14.0667 2.66669 14.6667 3.26669 14.6667 4.00002V12C14.6667 12.7334 14.0667 13.3334 13.3333 13.3334H2.66668C1.93334 13.3334 1.33334 12.7334 1.33334 12V4.00002C1.33334 3.26669 1.93334 2.66669 2.66668 2.66669Z" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round"/>
     11                        <path d="M14.6667 4L8.00001 8.66667L1.33334 4" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round"/>
     12                    </svg>
     13                    <?php echo esc_html_e( 'Email Us', 'arvancloud-cdn' ) ?>
     14                </a>
     15                <a class="ar-footer-link me-24" href="https://forum.arvancloud.ir/c/cdn/47" target="_blank">
     16                    <svg class="me-8" width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
     17                        <path d="M10.0333 3.33335C10.6845 3.4604 11.2829 3.77886 11.752 4.24798C12.2211 4.7171 12.5396 5.31553 12.6666 5.96669M10.0333 0.666687C11.3862 0.816978 12.6477 1.4228 13.6108 2.38469C14.5739 3.34658 15.1813 4.60736 15.3333 5.96002M14.6666 11.28V13.28C14.6674 13.4657 14.6294 13.6495 14.555 13.8196C14.4806 13.9897 14.3715 14.1424 14.2347 14.2679C14.0979 14.3934 13.9364 14.489 13.7605 14.5485C13.5846 14.608 13.3982 14.6301 13.2133 14.6134C11.1619 14.3904 9.19131 13.6895 7.45998 12.5667C5.84919 11.5431 4.48353 10.1775 3.45998 8.56669C2.33329 6.82749 1.63214 4.84735 1.41331 2.78669C1.39665 2.60233 1.41856 2.41653 1.47764 2.2411C1.53673 2.06568 1.63169 1.90448 1.75649 1.76777C1.88128 1.63106 2.03318 1.52183 2.2025 1.44704C2.37183 1.37224 2.55487 1.33353 2.73998 1.33335H4.73998C5.06351 1.33017 5.37717 1.44474 5.62248 1.65571C5.8678 1.86668 6.02803 2.15965 6.07331 2.48002C6.15772 3.12006 6.31428 3.74851 6.53998 4.35335C6.62967 4.59197 6.64908 4.8513 6.59591 5.10061C6.54274 5.34992 6.41922 5.57876 6.23998 5.76002L5.39331 6.60669C6.34235 8.27572 7.72428 9.65765 9.39331 10.6067L10.24 9.76002C10.4212 9.58078 10.6501 9.45725 10.8994 9.40408C11.1487 9.35091 11.408 9.37032 11.6466 9.46002C12.2515 9.68572 12.8799 9.84227 13.52 9.92669C13.8438 9.97237 14.1396 10.1355 14.351 10.385C14.5624 10.6345 14.6748 10.9531 14.6666 11.28Z" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round"/>
     18                    </svg>
     19                    <?php echo esc_html_e( 'Support', 'arvancloud-cdn' ) ?>
     20                </a>
     21                <a class="ar-footer-link me-24" href="https://panel.arvancloud.ir/cdn/<?php echo Helper::get_site_domain(); ?>/plans" target="_blank">
     22                    <svg class="me-8" width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
     23                        <path d="M12 8.66667V12.6667C12 13.0203 11.8595 13.3594 11.6095 13.6095C11.3594 13.8595 11.0203 14 10.6667 14H3.33333C2.97971 14 2.64057 13.8595 2.39052 13.6095C2.14048 13.3594 2 13.0203 2 12.6667V5.33333C2 4.97971 2.14048 4.64057 2.39052 4.39052C2.64057 4.14048 2.97971 4 3.33333 4H7.33333" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round"/>
     24                        <path d="M10 2H14V6" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round"/>
     25                        <path d="M6.66669 9.33333L14 2" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round"/>
     26                    </svg>
     27                    <?php echo esc_html_e( 'CDN Plans', 'arvancloud-cdn' ) ?>
     28                </a>
     29            </div>
     30            <div class="ar-footer-col">
     31                <a
     32                    class="ar-footer-social me-8"
     33                    href="<?php echo esc_url(get_locale() == 'fa_IR' ? 'https://twitter.com/ArvanCloud_fa' : 'https://twitter.com/ArvanCloud') ?>"
     34                    target="_blank">
     35                        <svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
     36                            <path d="M15.3333 1.99999C14.6949 2.45031 13.988 2.79473 13.24 3.01999C12.8385 2.55833 12.3048 2.23112 11.7113 2.08261C11.1178 1.9341 10.493 1.97145 9.92135 2.18963C9.34974 2.4078 8.85892 2.79626 8.51528 3.30247C8.17164 3.80868 7.99176 4.40821 7.99996 5.01999V5.68666C6.82838 5.71704 5.66748 5.4572 4.62063 4.93029C3.57379 4.40338 2.6735 3.62575 1.99996 2.66666C1.99996 2.66666 -0.666707 8.66666 5.33329 11.3333C3.96031 12.2653 2.32473 12.7326 0.666626 12.6667C6.66663 16 14 12.6667 14 4.99999C13.9993 4.81429 13.9815 4.62905 13.9466 4.44666C14.627 3.77565 15.1072 2.92847 15.3333 1.99999V1.99999Z" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round"/>
     37                        </svg>
     38                </a>
     39                <a
     40                    class="ar-footer-social me-8"
     41                    href="https://github.com/arvancloud"
     42                    target="_blank">
     43                        <svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
     44                            <path d="M6.00004 12.6667C2.66671 13.6667 2.66671 11 1.33337 10.6667M10.6667 14.6667V12.0867C10.6917 11.7688 10.6488 11.4492 10.5407 11.1492C10.4327 10.8492 10.262 10.5756 10.04 10.3467C12.1334 10.1133 14.3334 9.32 14.3334 5.68C14.3332 4.74922 13.9752 3.85413 13.3334 3.18C13.6373 2.36567 13.6158 1.46557 13.2734 0.666666C13.2734 0.666666 12.4867 0.433332 10.6667 1.65333C9.13871 1.23921 7.52804 1.23921 6.00004 1.65333C4.18004 0.433332 3.39337 0.666666 3.39337 0.666666C3.05096 1.46557 3.02947 2.36567 3.33337 3.18C2.68679 3.85913 2.32839 4.76231 2.33337 5.7C2.33337 9.31333 4.53337 10.1067 6.62671 10.3667C6.40737 10.5933 6.23822 10.8636 6.13025 11.1599C6.02228 11.4563 5.97791 11.772 6.00004 12.0867V14.6667" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round"/>
     45                        </svg>
     46                </a>
     47                <a
     48                    class="ar-footer-social me-8"
     49                    href="<?php echo esc_url(get_locale() == 'fa_IR' ? 'https://instagram.com/arvancloud_fa' : 'https://www.instagram.com/arvancloud') ?>"
     50                    target="_blank">
     51                        <svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
     52                            <path d="M11.3334 1.33331H4.66671C2.82576 1.33331 1.33337 2.8257 1.33337 4.66665V11.3333C1.33337 13.1743 2.82576 14.6666 4.66671 14.6666H11.3334C13.1743 14.6666 14.6667 13.1743 14.6667 11.3333V4.66665C14.6667 2.8257 13.1743 1.33331 11.3334 1.33331Z" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round"/>
     53                            <path d="M10.6667 7.58002C10.7489 8.13485 10.6542 8.7015 10.3958 9.19936C10.1375 9.69723 9.72877 10.101 9.22776 10.3531C8.72675 10.6053 8.15897 10.6931 7.6052 10.604C7.05143 10.5149 6.53985 10.2534 6.14323 9.85679C5.74662 9.46018 5.48516 8.9486 5.39605 8.39483C5.30694 7.84105 5.39472 7.27328 5.64689 6.77227C5.89907 6.27125 6.3028 5.86251 6.80066 5.60418C7.29853 5.34585 7.86518 5.25108 8.42001 5.33335C8.98596 5.41727 9.50991 5.68099 9.91447 6.08556C10.319 6.49012 10.5828 7.01407 10.6667 7.58002Z" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round"/>
     54                            <path d="M11.6666 4.33331H11.6733" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round"/>
     55                        </svg>
     56                </a>
     57                <a
     58                    class="ar-footer-social me-8"
     59                    href="<?php echo esc_url(get_locale() == 'fa_IR' ? 'https://www.linkedin.com/company/arvancloud-fa' : 'https://www.linkedin.com/company/arvancloud') ?>"
     60                    target="_blank">
     61                        <svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
     62                            <path d="M10.6666 5.33331C11.7275 5.33331 12.7449 5.75474 13.4951 6.50489C14.2452 7.25503 14.6666 8.27245 14.6666 9.33331V14H12V9.33331C12 8.97969 11.8595 8.64055 11.6094 8.3905C11.3594 8.14046 11.0202 7.99998 10.6666 7.99998C10.313 7.99998 9.97387 8.14046 9.72382 8.3905C9.47377 8.64055 9.33329 8.97969 9.33329 9.33331V14H6.66663V9.33331C6.66663 8.27245 7.08805 7.25503 7.8382 6.50489C8.58834 5.75474 9.60576 5.33331 10.6666 5.33331V5.33331Z" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round"/>
     63                            <path d="M4.00004 6H1.33337V14H4.00004V6Z" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round"/>
     64                            <path d="M2.66671 3.99998C3.40309 3.99998 4.00004 3.40303 4.00004 2.66665C4.00004 1.93027 3.40309 1.33331 2.66671 1.33331C1.93033 1.33331 1.33337 1.93027 1.33337 2.66665C1.33337 3.40303 1.93033 3.99998 2.66671 3.99998Z" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round"/>
     65                        </svg>
     66                </a>
     67                <a
     68                    class="ar-footer-social me-8"
     69                    href="https://t.me/arvancloud"
     70                    target="_blank">
     71                        <svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
     72                            <path d="M14.6667 1.33331L7.33337 8.66665" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round"/>
     73                            <path d="M14.6667 1.33331L10 14.6666L7.33337 8.66665L1.33337 5.99998L14.6667 1.33331Z" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round"/>
     74                        </svg>
     75                </a>
     76            </div>
    3477        </div>
    3578    </div>
    3679</div>
     80
     81<script type="text/javascript">
     82    jQuery('#wpcontent').addClass('background-gray-200');
     83</script>
  • arvancloud-cdn/tags/1.0.1/admin/views/components/header.php

    r2850501 r3303568  
    33use WP_Arvan\Helper;
    44?>
    5 <hr />
    6 <div class="arvan-head">
     5
     6<div class="arvan-head display-none">
    77    <div class="arvan-status">
    88
     
    4747    </div>
    4848</div>
    49 
    50 <hr />
  • arvancloud-cdn/tags/1.0.1/admin/views/options-display.php

    r2943546 r3303568  
    22use WP_Arvan\CDN\CDN_Options;
    33use WP_Arvan\CDN\Cache\Page_Rules;
     4//use WP_Arvan\Security\DDoS_Protection;
    45
    56$automatic_cleaning = get_option( 'arvan-cloud-cdn-automatic-cleaning' );
     
    1314
    1415$setup_recommended_rules = Page_Rules::is_recommended_rule_enabled();
     16
     17/*$ddos = new DDoS_Protection;
     18$ddos_status = $ddos->get_status();
     19
     20$cache_setting = \WP_Arvan\CDN\Cache\Caching_Settings::get_options();
     21$cache_status = $cache_setting['cache_status'];*/
     22
    1523?>
    1624
    1725
    1826<div class="wrap ar-wrap">
    19     <h1><?php echo esc_html_e( 'CDN Options', 'arvancloud-cdn' ) ?></h1>
    2027    <?php require_once( ACCDN_PLUGIN_ROOT . 'admin/views/components/header.php' ) ?>
    2128    <br>
     
    2330        <div class="arvan-card">
    2431            <form class="arvancloud-options-form arvancloud-cdn-options-form" method="post" action="<?php echo esc_url( admin_url( '/admin.php?page=arvancloud-cdn' )); ?>" data-type="cdn_options">
    25                 <div class="cdn-option">
    26                     <div class="input-container">
    27                         <a class="purge-arvan-cache" href="<?php echo esc_url('admin.php?page=' . ACCDN_SLUG . '&purge_arvan_cache=1' . '&_wpnonce=' . esc_attr( $nonce_purge_cache )); ?>"><?php echo esc_html_e('Purge Cache', 'arvancloud-cdn'); ?></a>
     32                <div class="ar-dashboard">
     33                <article class="cdn-option-new ar-card action-card">
     34                    <div class="action-card__content">
     35                        <h2 class="action-card__title"><?php esc_html_e( 'Optimum settings for WordPress', 'arvancloud-cdn' ) ?></h2>
     36                        <p class="action-card__desc"><?php echo esc_html_e( 'By clicking on the opposite button, the optimal settings for WordPress will be automatically applied to you.', 'arvancloud-cdn' ) ?></p>
    2837                    </div>
    29                     <div class="detail-container">
    30                         <h3><?php echo esc_html_e('Purge Cache', 'arvancloud-cdn'); ?></h3>
    31                         <p><?php echo esc_html_e('This will help you to get the full version of the new data from your web server by clearing the cache data from Arvan servers.', 'arvancloud-cdn'); ?></p>
     38                    <div class="action-card__action">
     39                        <button type="button" class="btn btn--primary btn--medium px-24 checkbox" name="setup_recommended_rules" id="setup_recommended_rules"><?php  esc_html_e( 'Apply settings', 'arvancloud-cdn' ) ?></button>
    3240                    </div>
     41                </article>
     42                <article class="cdn-option-new ar-card action-card">
     43                    <div class="action-card__content">
     44                        <h2 class="action-card__title"><?php  esc_html_e( 'DDoS Protection', 'arvancloud-cdn' ) ?></h2>
     45                        <p class="action-card__desc"><?php  esc_html_e( 'All ArvanCloud servers automatically prevent DDoS attacks in the network layer. This work is done with the help and combination of several different methods to prevent the arrival of manipulated and multiple packets from the same source.You can also prevent higher layer attacks by activating this service.', 'arvancloud-cdn' ) ?>
     46
     47                        </p>
     48                        <p class="desc-with-dot"><?php  esc_html_e( 'To apply more advanced settings, you can refer to Arvan cloud\'s panel.', 'arvancloud-cdn' ) ?></p>
     49                    </div>
     50                    <div class="action-card__action">
     51                        <div class="custom-switch custom-switch--large mb-16">
     52                            <input class="custom-switch-input" type="checkbox" id="ddos_protection_mode" name="ddos_protection_mode" <?php echo $ddos_status ? 'checked' : ''; ?>>
     53                            <label class="custom-switch-label" for="ddos_protection_mode">
     54                                <span class="active-label"><?php  esc_html_e( 'Enable', 'arvancloud-cdn' ) ?></span>
     55                                <span class="inactive-label"><?php  esc_html_e( 'Disable', 'arvancloud-cdn' ) ?></span>
     56                            </label>
     57                        </div>
     58                        <a class="btn btn--outline-primary btn--medium" href="https://panel.arvancloud.ir/cdn/<?php echo \WP_Arvan\Helper::get_site_domain() ?>/ddos" target="_blank"><?php  esc_html_e( 'Panel', 'arvancloud-cdn' ) ?></a>
     59                    </div>
     60                </article>
     61                <article class="cdn-option-new ar-card action-card">
     62                    <div class="action-card__content">
     63                        <h2 class="action-card__title"><?php  esc_html_e( 'Caching Settings', 'arvancloud-cdn' ) ?></h2>
     64                        <p class="action-card__desc">
     65                            <?php  esc_html_e( 'By selecting the cache level, you can determine what content will be cached from your website in Arvan cloud', 'arvancloud-cdn' ) ?>
     66                        </p>
     67                    </div>
     68                    <div class="action-card__action">
     69                        <div class="custom-switch custom-switch--large">
     70                            <input class="custom-switch-input" type="checkbox" id="cache_status" name="cache_status" <?php echo $cache_status == 'off' ? '' : 'checked'; ?>>
     71                            <label class="custom-switch-label" for="cache_status">
     72                                <span class="active-label"><?php  esc_html_e( 'Enable', 'arvancloud-cdn' ) ?></span>
     73                                <span class="inactive-label"><?php  esc_html_e( 'Disable', 'arvancloud-cdn' ) ?></span>
     74                            </label>
     75                        </div>
     76                    </div>
     77                </article>
     78                <article class="ar-card action-card">
     79                    <div class="action-card__content">
     80                        <h2 class="action-card__title"><?php esc_html_e('Purge Cache', 'arvancloud-cdn'); ?></h2>
     81                        <p class="action-card__desc">
     82                            <?php esc_html_e('Purging cached files, forces ArvanCloud to fetch a fresh version of those files from your origin server.', 'arvancloud-cdn'); ?>
     83                        </p>
     84                        <p class="desc-with-dot">
     85                            <?php esc_html_e('Clean everything', 'arvancloud-cdn') ?>: <span class="font-weight-medium"><?php esc_html_e('No content will be cached on Arvan\'s side. Requests are sent directly to the main servers.', 'arvancloud-cdn') ?></span>
     86                        </p>
     87                        <p class="desc-with-dot"><span class="font-weight-medium"><?php echo esc_html_e('Clear everything', 'arvancloud-cdn'); ?>: </span>
     88                            <?php esc_html_e('All cached content on ArvanCloud\'s edge servers will be deleted. Requests are sent directly to the main servers', 'arvancloud-cdn'); ?>
     89                        </p>
     90                    </div>
     91                    <div class="action-card__action">
     92                        <button class="btn btn--outline-red btn--medium ar-modal-toggle" data-modal="modal-one" onclick="return false;"><?php echo esc_html_e('Clean Everything', 'arvancloud-cdn'); ?></button>
     93                    </div>
     94                </article>
     95
     96                <div class="ar-modal" id="modal-one">
     97                    <header class="ar-modal__header">
     98                        <div class="ar-modal__title"><?php esc_html_e('Purge all?', 'arvancloud-cdn') ?></div>
     99                        <button class="ar-modal__close" data-action="close">
     100                            <svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
     101                                <path d="M16 8L8 16M16 16L8 8" stroke="#647E9A" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
     102                            </svg>
     103                        </button>
     104                    </header>
     105                    <div class="ar-modal__content">
     106                        <div class="ar-mddal__icon">
     107                            <svg width="32" height="28" viewBox="0 0 32 28" fill="none" xmlns="http://www.w3.org/2000/svg">
     108                                <path d="M13.7195 3.14718L2.42621 22.0005C2.19336 22.4037 2.07016 22.8609 2.06886 23.3265C2.06755 23.7922 2.18819 24.25 2.41877 24.6546C2.64936 25.0591 2.98184 25.3962 3.38315 25.6323C3.78446 25.8685 4.24061 25.9954 4.70621 26.0005H27.2929C27.7585 25.9954 28.2146 25.8685 28.6159 25.6323C29.0172 25.3962 29.3497 25.0591 29.5803 24.6546C29.8109 24.25 29.9315 23.7922 29.9302 23.3265C29.9289 22.8609 29.8057 22.4037 29.5729 22.0005L18.2795 3.14718C18.0418 2.75533 17.7072 2.43134 17.3078 2.2065C16.9084 1.98165 16.4579 1.86353 15.9995 1.86353C15.5412 1.86353 15.0906 1.98165 14.6913 2.2065C14.2919 2.43134 13.9572 2.75533 13.7195 3.14718V3.14718Z" stroke="#EE5353" stroke-width="3" stroke-linecap="round" stroke-linejoin="round"/>
     109                                <path d="M16 10V15.3333" stroke="#EE5353" stroke-width="3" stroke-linecap="round" stroke-linejoin="round"/>
     110                                <path d="M16 20.6667H16.0133" stroke="#EE5353" stroke-width="3" stroke-linecap="round" stroke-linejoin="round"/>
     111                            </svg>
     112                        </div>
     113                        <h2 class="mb-8"><?php esc_html_e('Are You Sure You Want To Purge All Files?', 'arvancloud-cdn') ?></h2>
     114                        <p class="font-12 font-weight-medium m-0 text-align-center">
     115                            <?php esc_html_e('Purging cache may slow down your website temporarily.', 'arvancloud-cdn') ?>
     116                        </p>
     117                    </div>
     118                    <footer class="ar-modal__footer">
     119                        <button class="btn btn--outline-gray btn--medium me-16" data-action="close"><?php esc_html_e('Cancel', 'arvancloud-cdn'); ?></button>
     120                        <a class="btn btn--red btn--medium" href="<?php echo esc_url('admin.php?page=' . ACCDN_SLUG . '&purge_arvan_cache=1' . '&_wpnonce=' . esc_attr( $nonce_purge_cache )); ?>"><?php esc_html_e('Delete', 'arvancloud-cdn'); ?></a>
     121
     122                    </footer>
    33123                </div>
    34                 <div class="cdn-option">
    35                     <div class="input-container">
    36                         <input type="checkbox" id="setup_recommended_rules" name="setup_recommended_rules" <?php echo $setup_recommended_rules ? 'checked' : ''; ?>/>
    37                         <label for="setup_recommended_rules">Toggle</label>
     124                <article class="cdn-option-new ar-card action-card">
     125                    <div class="action-card__content">
     126                        <h2 class="action-card__title"><?php esc_html_e('Development Mode', 'arvancloud-cdn'); ?></h2>
     127                        <p class="action-card__desc ">
     128                            <?php esc_html_e('Activating Development Mode will temporarily stop caching so that developers can work easier. Web optimization will also be disabled.', 'arvancloud-cdn'); ?>
     129                        </p>
    38130                    </div>
    39                     <div class="detail-container">
    40                         <h3><?php esc_html_e('Add WordPress Recomanded Page Rules', 'arvancloud-cdn'); ?></h3>
    41                         <p><?php esc_html_e('After activating of this feature, The cache in /wp-admin/* and /wp-login/* is ignored.', 'arvancloud-cdn'); ?></p>
     131                    <div class="action-card__action">
     132                        <div class="custom-switch custom-switch--large">
     133                            <input class="custom-switch-input" type="checkbox" id="cache_developer_mode" name="cache_developer_mode" <?php echo $development_mode ? 'checked' : ''; ?>>
     134                            <label class="custom-switch-label" for="cache_developer_mode">
     135                                <span class="active-label"><?php  esc_html_e( 'Enable', 'arvancloud-cdn' ) ?></span>
     136                                <span class="inactive-label"><?php  esc_html_e( 'Disable', 'arvancloud-cdn' ) ?></span>
     137                            </label>
     138                        </div>
    42139                    </div>
    43                 </div>
    44                 <div class="cdn-option">
    45                     <div class="input-container">
    46                         <input type="checkbox" id="cache_consistent_uptime" name="cache_consistent_uptime" <?php echo $cache_consistent_uptime ? 'checked' : ''; ?>/>
    47                         <label for="cache_consistent_uptime">Toggle</label>
     140                </article>
     141                <article class="cdn-option-new ar-card action-card">
     142                    <div class="action-card__content">
     143                        <h2 class="action-card__title"><?php esc_html_e('Always Online', 'arvancloud-cdn'); ?></h2>
     144                        <p class="action-card__desc">
     145                            <?php esc_html_e('After activating of this feature, in case of website or webserver tome out, the last saved version in arvancloud will be shown to the user. Arvancloud can only show the main page or dynamic pages if it has the permission to cache.', 'arvancloud-cdn'); ?>
     146                        </p>
    48147                    </div>
    49                     <div class="detail-container">
    50                         <h3><?php echo esc_html_e('Always Online', 'arvancloud-cdn'); ?></h3>
    51                         <p><?php echo esc_html_e('After activating of this feature, in case of website or webserver time out, the last saved version in arvancloud will be shown to the user. Arvancloud can only show the main page or dynamic pages if it has the permission to cache.', 'arvancloud-cdn'); ?></p>
     148                    <div class="action-card__action">
     149                        <div class="custom-switch custom-switch--large">
     150                            <input class="custom-switch-input" type="checkbox" id="cache_consistent_uptime" name="cache_consistent_uptime" <?php echo $cache_consistent_uptime ? 'checked' : ''; ?>>
     151                            <label class="custom-switch-label" for="cache_consistent_uptime">
     152                                <span class="active-label"><?php  esc_html_e( 'Enable', 'arvancloud-cdn' ) ?></span>
     153                                <span class="inactive-label"><?php  esc_html_e( 'Disable', 'arvancloud-cdn' ) ?></span>
     154                            </label>
     155                        </div>
    52156                    </div>
    53                 </div>
    54                 <div class="cdn-option">
    55                     <div class="input-container">
    56                         <input type="checkbox" id="cache_developer_mode" name="cache_developer_mode" <?php echo $development_mode ? 'checked' : ''; ?>/>
    57                         <label for="cache_developer_mode">Toggle</label>
    58                     </div>
    59                     <div class="detail-container">
    60                         <h3><?php echo esc_html_e('Development Mode', 'arvancloud-cdn'); ?></h3>
    61                         <p><?php echo esc_html_e('Activating Development Mode will temporarily stop caching so that developers can work easier. Web optimization will also be disabled.', 'arvancloud-cdn'); ?></p>
    62                     </div>
    63                 </div>
    64                 <div class="cdn-option">
    65                     <div class="input-container">
    66                         <input type="checkbox" id="automatic_cleaning" name="automatic_cleaning" <?php echo $automatic_cleaning ? 'checked' : ''; ?>/>
    67                         <label for="automatic_cleaning">Toggle</label>
    68                     </div>
    69                     <div class="detail-container">
    70                         <h3><?php echo esc_html_e('Automatic cleaning', 'arvancloud-cdn'); ?></h3>
    71                         <p><?php echo esc_html_e('Automatically clear cache when a post or page or custom post type is edited or created or deleted.', 'arvancloud-cdn'); ?></p>
    72                     </div>
    73                 </div>
     157                </article>
     158
    74159
    75160                <div id="lock-modal"></div>
    76161                <div id="loading-circle"></div>
     162                </div>
    77163            </form>
    78164        </div>
  • arvancloud-cdn/tags/1.0.1/admin/views/reports/reports.php

    r2761065 r3303568  
    127127                    <div class="report-with-labels">
    128128                        <div class="report">
    129                             <canvas id="<?php echo $report->chart_ID;; ?>"></canvas>
     129                            <canvas id="<?php echo $report->chart_ID; ?>"></canvas>
    130130                        </div>
    131131                        <div class="report-labels">
  • arvancloud-cdn/tags/1.0.1/admin/views/security/https_settings.php

    r2761065 r3303568  
    11<?php
     2namespace WP_Arvan;
    23use WP_Arvan\Security\HTTPS_Settings;
    34use WP_Arvan\CDN\Domain_Info;
     5use WP_Arvan\API\HTTP\Request_Arvan;
    46
    5 $HTTPS = new HTTPS_Settings(true);
    6 
    7 
     7$domain  = helper::get_site_domain();
     8$HTTPS   = new HTTPS_Settings(true);
    89$is_DNS_Cloud_enabled = Domain_Info::$DNS_Cloud;
    9 
     10$fcolor  = $HTTPS->data['ssl_status']?'green':'red';
     11$balance = Request_Arvan::get("domains/$domain/load-balancers/settings");
     12$rcolor  = $balance['protocol']=='https'?'green':'red';
    1013
    1114$HSTS_duration = [
     
    1922    '24mo'    => sprintf( __('%s Month', 'arvancloud-cdn'), 24),
    2023];
    21 
    2224?>
    2325
    24 
    2526<div class="wrap ar-wrap">
    26     <h1><?php esc_html_e('HTTPS Settings', 'arvancloud-cdn'); ?></h1>
    27     <?php
    28     if ( !$is_DNS_Cloud_enabled )
     27    <?php
     28    if ( !$is_DNS_Cloud_enabled  )
    2929        echo wp_kses_post('<div class="notice notice-error is-dismissible"><p>'. esc_html__( 'HTTP Protocol will only be activated for the records with an enabled cloud icon. ', 'arvancloud-cdn' ) .'</p></div>');
    3030    ?>
    3131    <?php require_once( ACCDN_PLUGIN_ROOT . 'admin/views/components/header.php' ) ?>
    3232    <br>
    33    
     33
    3434    <div class="arvan-wrapper">
    35         <div class="arvan-card">
    36             <h2><?php esc_html_e('HTTPS Settings', 'arvancloud-cdn'); ?></h2>
    3735            <form class="arvancloud-options-form arvancloud-acceleration-options" method="post" action="<?php echo esc_url( admin_url( '/admin.php?page=arvancloud-cdn' )); ?>" data-type="https">
    3836
    39            
    4037
    41                 <div class="cdn-option" id="HTTPS">
    42                     <div class="input-container">
    43                         <input  id="ssl_status" type="checkbox" name="ssl_status" <?php echo $HTTPS->is_HTTPS ? 'checked' : ''; ?>/>
    44                         <label for="ssl_status">Toggle</label>
     38        <div class="arvan-wrapper-card">
     39            <div class="ar-https-visual">
     40                <div>
     41                    <img class="mb-8" src="<?php echo ACCDN_PLUGIN_ROOT_URL . 'assets/images/browser.png'; ?>" alt="browser">
     42                    <div class="https-visual__text">Browser</div>
     43                </div>
     44                <div class="display-flex">
     45                    <span>
     46                        <img src="<?php echo ACCDN_PLUGIN_ROOT_URL . 'assets/images/direction-'.$fcolor.'.svg'; ?>" alt="">
     47                    </span>
     48                    <span class="https-visual__text mx-40 color-<?php echo $fcolor; ?>-500 font-14"><?php echo $HTTPS->data['ssl_status']?'HTTPS':'HTTP'; ?></span>
     49                    <span>
     50                        <img src="<?php echo ACCDN_PLUGIN_ROOT_URL . 'assets/images/direction-'.$fcolor.'.svg'; ?>" alt="">
     51                    </span>
     52                </div>
     53                <div>
     54                    <img class="mb-8" src="<?php echo ACCDN_PLUGIN_ROOT_URL . 'assets/images/arvan-logo.svg'; ?>" alt="arvan logo">
     55                    <div class="https-visual__text font-weight-bold color-green-500">ArvanCloud</div>
     56                </div>
     57                <div class="display-flex">
     58                    <span>
     59                        <img src="<?php echo ACCDN_PLUGIN_ROOT_URL . 'assets/images/direction-'.$rcolor.'.svg'; ?>" alt="">
     60                    </span>
     61                    <span class="https-visual__text mx-40 color-green-500 font-14"><?php echo strtoupper($balance['protocol']) ; ?></span>
     62                    <span>
     63                        <img src="<?php echo ACCDN_PLUGIN_ROOT_URL . 'assets/images/direction-'.$rcolor.'.svg'; ?>" alt="">
     64                    </span>
     65                </div>
     66                <div>
     67                    <img class="mb-8" src="<?php echo ACCDN_PLUGIN_ROOT_URL . 'assets/images/server.png'; ?>" alt="">
     68                    <div class="https-visual__text">Servers</div>
     69                </div>
     70            </div>
     71        </div>
     72
     73        <div class="arvan-wrapper-card">
     74            <div class="ar-https">
     75                <div class="custom-switch custom-switch--large mb-8 cdn-option-new">
     76                    <input class="custom-switch-input cdn-option" type="checkbox" id="HTTPS_Rewrite" name="ssl_status" <?php echo $HTTPS->is_HTTPS ? 'checked="checked"' : ''; ?>>
     77                    <label class="custom-switch-label" for="HTTPS_Rewrite">
     78                        <h1 class="m-0"><?php esc_html_e('Activate HTTPS', 'arvancloud-cdn') ?></h1>
     79                    </label>
     80                </div>
     81                <p class="mb-24 font-14 font-weight-medium"><?php esc_html_e('SSL/TLS secure protocol will be activated for your domain To enable HTTPS on the domain, you need to replace your name servers with ArvanCloud NSs and enable the cloud icon for the domain.', 'arvancloud-cdn') ?></p>
     82                <article class="ar-card p-24">
     83                    <header class="display-flex align-items-start mb-24">
     84                        <div class="me-16 flex-grow-1">
     85                            <h2 class="mb-8"><?php esc_html_e('Certificates', 'arvancloud-cdn') ?></h2>
     86                            <p class="font-14 font-weight-medium m-0"><?php esc_html_e('To activate HTTPS, you need to have an active certificate.', 'arvancloud-cdn') ?> </p>
     87                        </div>
     88                        <a class="btn btn--outline-primary btn--medium certificate-button" href="https://panel.arvancloud.ir/cdn/<?php echo Helper::get_site_domain(); ?>/https" target="_blank"><?php esc_html_e('Private Certificate', 'arvancloud-cdn') ?></a>
     89                    </header>
     90                    <div class="certificate-table">
     91                        <div class="certificate-table__row header-row">
     92                            <div class="certificate-table__col type-col"><?php esc_html_e('Type', 'arvancloud-cdn') ?></div>
     93                            <div class="certificate-table__col domain-col"><?php esc_html_e('Subdomains', 'arvancloud-cdn') ?></div>
     94                            <div class="certificate-table__col status-col"><?php esc_html_e('Status', 'arvancloud-cdn') ?></span></div>
     95                            <div class="certificate-table__col duration-col"><?php esc_html_e('Validity Duration', 'arvancloud-cdn') ?> </div>
     96                        </div>
     97                        <?php
     98                        if(!empty($HTTPS->data['certificates'])){
     99                            foreach($HTTPS->data['certificates'] as $cert){
     100
     101                                $date = strtotime(substr($cert['expiry_date'],0,10))-time();
     102                                $days = floor($date / 86400);
     103                        ?>
     104                        <div class="ar-card ar-accordion certificate-accordion">
     105                            <div class="certificate-table__row certificate-row">
     106                                    <div class="certificate-table__col type-col">
     107                                        <div class="custom-checkbox">
     108                                        <input class="custom-checkbox-input" <?php echo $cert['active']?'checked="checked"':''; ?> type="checkbox" id="custom-checkbox-18">
     109                                        <label class="custom-checkbox-label" for="custom-checkbox-18"><?php esc_html_e('ArvanCloud Certificate', 'arvancloud-cdn') ?></label>
     110                                    </div>
     111                                </div>
     112                                <div class="certificate-table__col domain-col"><?php echo implode(', ',$cert['domain_names']); ?></div>
     113                                <div class="certificate-table__col status-col"><span class="ar-status ar-status--success"><?php echo $cert['active']?__('Valid', 'arvancloud-cdn'):__('Invalid', 'arvancloud-cdn'); ?></span></div>
     114                                <div class="certificate-table__col duration-col"><?php echo $days; ?> <?php esc_html_e('day', 'arvancloud-cdn') ?></div>
     115                                <div class="certificate-table__arrow ar-accordion__toggle"></div>
     116                            </div>
     117                            <div class="ar-accordion__content certificate-accordion__content">
     118                                <div class="certificate-accordion__content-box">
     119                                    <p class="mb-8 font-14 color-gray-900">
     120                                        <span class="font-weight-bold me-4"><?php esc_html_e('Issued by:', 'arvancloud-cdn') ?> </span>
     121                                        <span><?php echo $cert['issuer']; ?></span>
     122                                    </p>
     123                                    <p class="m-0 font-14 color-gray-900">
     124                                        <span class="font-weight-bold me-4"><?php esc_html_e('Valid until date:', 'arvancloud-cdn') ?> </span>
     125                                        <span><bdi><?php echo str_replace(['T','Z'],' ',$cert['expiry_date']); ?></bdi></span>
     126                                    </p>
     127                                </div>
     128                            </div>
     129                        </div>
     130                        <?php
     131                            }
     132                        }
     133                        ?>
    45134                    </div>
    46                     <div class="detail-container">
    47                         <h3><?php esc_html_e('Activate HTTPS', 'arvancloud-cdn'); ?></h3>
    48                         <p><?php _e('SSL/TLS secure protocol will be activated for your domain <br> <strong>To enable HTTPS on the domain, you need to replace your name servers with ArvanCloud NSs and enable the cloud icon for the domain.</strong>', 'arvancloud-cdn'); ?></p>
    49                     </div>
    50                 </div>
     135                </article>
     136            </div>
     137        </div>
    51138
    52 
    53 
    54                 <div class="cdn-option <?php echo !$HTTPS->is_HTTPS ? 'disabled' : ''; ?>" id="HTTPS_Default">
    55                     <div class="input-container">
    56                         <input  id="https_redirect" type="checkbox" name="https_redirect" <?php echo $HTTPS->is_HTTPS_Default ? 'checked' : ''; ?>/>
    57                         <label for="https_redirect">Toggle</label>
    58                     </div>
    59                     <div class="detail-container">
    60                         <h3><?php esc_html_e('Set HTTPS as Default', 'arvancloud-cdn'); ?></h3>
    61                         <p><?php esc_html_e('All HTTP requests will automatically be redirected to HTTPS.', 'arvancloud-cdn'); ?></p>
    62                     </div>
    63                 </div>
    64 
    65 
    66                 <div class="cdn-option <?php echo !$HTTPS->is_HTTPS ? 'disabled' : ''; ?>" id="HTTPS_Rewrite">
    67                     <div class="input-container">
    68                         <input  id="replace_http" type="checkbox" name="replace_http" <?php echo $HTTPS->is_HTTPS_Rewrite ? 'checked' : ''; ?>/>
    69                         <label for="replace_http">Toggle</label>
    70                     </div>
    71                     <div class="detail-container">
    72                         <h3><?php esc_html_e('Rewrite Files Based on HTTPS', 'arvancloud-cdn'); ?></h3>
    73                         <p><?php esc_html_e('Resource files and website links will be converted to HTTPS. This will prevent mixed content error.', 'arvancloud-cdn'); ?></p>
    74                     </div>
    75                 </div>
    76 
    77 
    78                 <div class="cdn-option <?php echo !$HTTPS->is_HTTPS_Default ? 'disabled' : ''; ?>" id="HSTS">
    79                     <div class="input-container">
    80                         <a class="edit-settings"><?php esc_html_e('Edit Settings', 'arvancloud-cdn'); ?></a>
    81                     </div>
    82                     <div class="detail-container">
    83                         <h3><?php esc_html_e('HSTS Protocol', 'arvancloud-cdn'); ?></h3>
    84                         <p><?php esc_html_e('HSTS protocol improves the security of request transmission and prevents MITM attacks.', 'arvancloud-cdn'); ?></p>
    85                     </div>
    86                 </div>
    87 
    88 
    89                 <div id="lock-modal"></div>
    90                 <div id="loading-circle"></div>
    91139            </form>
    92         </div>
    93140    </div>
    94141
    95     <div id="side-modal" class="side-modal-HSTS">
    96         <div class="side-modal-wrapper">
    97             <div class="side-modal-heading">
    98                 <h3><?php esc_html_e('HSTS Settings', 'arvancloud-cdn'); ?></h3>
    99                 <button class="close">
    100                     <svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg" class="v1:ar-icon v1:ar-icon-times"><g stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"><path d="M12 4L4 12"></path> <path d="M4 4L12 12"></path></g></svg>
    101                 </button>
    102             </div>
    103             <form>
    104                 <div class="ar-bg-blue-gray">
    105                     <p><?php esc_html_e('HSTS or Security Transport Strict Http will improve the security of requests\' transmission from HTTP to HTTPS and prevents MITM attacks.', 'arvancloud-cdn'); ?></p>
    106                     <p><?php esc_html_e('Attention: Visitors\' browsers will cache these settings. Please consider purging by cache expiration when applying HSTS settings.', 'arvancloud-cdn'); ?></p>
    107                     <hr>
    108                     <div class="ar-simple-checkbox ar-agreement">
    109                         <input id="ar-https-agreement" type="checkbox" role="checkbox" value="I Understand and Accept the Rules.">
    110                         <label for="ar-https-agreement" ><?php _e('I Understand and Accept the Rules.', 'arvancloud-cdn') ?></label>
    111                     </div>
    112                 </div>
    113                 <br>
    114                 <div class="ar-checkbox-wrapper disabled">
    115                     <div class="ar-checkbox">
    116                         <input id="hsts_status" type="checkbox" name="hsts_status" <?php echo $HTTPS->is_HSTS ? 'checked' : ''; ?>>
    117                         <label for="hsts_status">Toggle</label>
    118                     </div>
    119                     <span class="ar-label"><?php _e('Enable HSTS Protocol', 'arvancloud-cdn') ?></span>
    120                 </div>
    121                
    122                 <div class="ar-dropdown-wrapper disabled">
    123                     <span class="ar-label"><?php _e('What is the duration in which the browser is required to show the HTTPS version of the website?', 'arvancloud-cdn') ?></span>
    124                     <select class="ar-dropdown" name="hsts_max_age">
    125                         <?php
    126                         foreach ($HSTS_duration as $key => $title) {
    127                             $selected = $HTTPS->hsts_max_age == $key ? 'selected' : '';
    128                             echo '<option value="'. $key .'"'. $selected .'>' . $title .'</option>';
    129                         }
    130                         ?>
    131                     </select>
    132                 </div>
    133 
    134                 <br>
    135                 <hr>
    136                 <br>
    137                 <br>
    138 
    139                 <div class="ar-checkbox-wrapper disabled">
    140                     <div class="ar-checkbox">
    141                         <input id="hsts_subdomain" type="checkbox" name="hsts_subdomain" <?php echo $HTTPS->is_HSTS_subdomain ? 'checked' : ''; ?>>
    142                         <label for="hsts_subdomain">Toggle</label>
    143                     </div>
    144                     <span class="ar-label"><?php _e('Use HSTS for all Subdomains', 'arvancloud-cdn') ?></span>
    145                 </div>
    146                 <div class="ar-checkbox-wrapper disabled">
    147                     <div class="ar-checkbox">
    148                         <input id="hsts_preload" type="checkbox" name="hsts_preload" <?php echo $HTTPS->is_HSTS_preload ? 'checked' : ''; ?>>
    149                         <label for="hsts_preload">Toggle</label>
    150                     </div>
    151                     <span class="ar-label"><?php _e('Prepare the Domain for the Search Engines', 'arvancloud-cdn') ?></span>
    152                 </div>
    153 
    154                 <div class="ar-submit-bottons-modal">
    155                     <button class="ar-cancel-modal"><?php esc_html_e('Cancel', 'arvancloud-cdn'); ?></button>
    156                     <button class="ar-submit-modal disabled"><?php esc_html_e('Save', 'arvancloud-cdn'); ?></button>
    157                 </div>
    158             </form>
    159         </div>
    160     </div>
    161    
    162  
    163142    <br>
    164143    <?php require_once( ACCDN_PLUGIN_ROOT . 'admin/views/components/footer.php' ); ?>
  • arvancloud-cdn/tags/1.0.1/admin/views/settings-display.php

    r3243413 r3303568  
    11<?php
    2 
    3 $credentials_status = get_option( 'arvan-cloud-cdn-status' );
     2$credentials_status = get_option('arvan-cloud-cdn-status');
    43?>
    5 
    6 
    74<div class="wrap ar-wrap">
    8     <h1><?php echo esc_html_e( 'CDN General Settings', 'arvancloud-cdn' ) ?></h1>
    9     <?php require_once( ACCDN_PLUGIN_ROOT . 'admin/views/components/header.php' ) ?>
    10     <h3><?php echo esc_html_e( 'Configure CDN API', 'arvancloud-cdn' ) ?></h3>
    11     <form class="arvancloud-cdn-config-form" method="post" action="<?php echo esc_url(admin_url( '/admin.php?page=arvancloud-cdn' )); ?>">
    12         <section class="ar-cdn-container">
    13             <div class="ar-cdn-box">
    14                 <label for="accdn-api-key">API Key</label>
    15                 <input type="text" name="accdn-api-key" value="" autocomplete="off"  placeholder="<?php echo !empty($credentials_status) ? esc_html_e( "-- not shown --", 'arvancloud-cdn' ) : 'apikey 8e19****-****-****-****-****2e67dfab' ?> ">
     5    <form class="arvancloud-cdn-config-form" method="post"
     6          action="<?php echo esc_url(admin_url('/admin.php?page=arvancloud-cdn')); ?>">
     7        <div class="arvan-card">
     8            <div class="ar-auth">
     9                <?php require_once(ACCDN_PLUGIN_ROOT . 'admin/views/components/header.php') ?>
     10                <article class="ar-card p-24">
     11                    <h2 class="mb-8"><?php esc_html_e('CDN API Key', 'arvancloud-cdn') ?></h2>
     12                    <p class="font-14 font-weight-medium mb-8"><?php
     13                        esc_html_e('To get the access key, it is necessary to create a new access key by referring to the settings and adding a new machine users and enter it in the section below.', 'arvancloud-cdn')
     14                    ?></p>
     15                    <a class="link-with-icon icon-end mb-16" href="" target="_blank"><?php esc_html_e('Login to the panel', 'arvancloud-cdn') ?></a>
     16                    <p class="mb-8 color-gray-900 font-weight-medium"><?php esc_html_e('Access key', 'arvancloud-cdn') ?></p>
     17                    <div class="auth-field-group">
     18                        <input class="auth-input form-text-input dir-ltr" value="" autocomplete="off"
     19                               name="accdn-api-key" type="text"
     20                               placeholder="<?php echo !empty($credentials_status) ? esc_html_e("-- not shown --", 'arvancloud-cdn') : 'Apikey ********-****-****-****-************' ?>">
     21                        <button class="btn btn--primary btn--medium ms-16" name="config_arvancloud_api_key"
     22                                value="1"><?php echo esc_html_e("Save", 'arvancloud-cdn') ?></button>
     23                    </div>
     24                </article>
    1625            </div>
    17             <div class="ar-cdn-box">
    18                 <a class="get-api-key" href="https://panel.arvancloud.ir/profile/machine-user/" target="_blank" rel="noopener noreferrer"><?php echo esc_html_e('Get API Key', 'arvancloud-cdn'); ?></a>
    19             </div>
    20             <p><button type="submit" class="button button-primary" name="config_arvancloud_api_key" value="1"><?php echo esc_html_e( "Save", 'arvancloud-cdn' ) ?></button></p>
    21         </section>
     26        </div>
    2227    </form>
    2328    <br>
    24 
    2529    <br>
    2630    <br>
    27     <?php require_once( ACCDN_PLUGIN_ROOT . 'admin/views/components/footer.php' ); ?>
     31    <?php require_once(ACCDN_PLUGIN_ROOT . 'admin/views/components/footer.php'); ?>
    2832</div>
  • arvancloud-cdn/tags/1.0.1/includes/class-setup.php

    r2788597 r3303568  
    66use WP_Arvan\CDN\Purge_Cache;
    77use WP_Arvan\CDN\Acceleration;
    8 use WP_Arvan\CDN\Cache\Caching_Settings;
    98use WP_Arvan\CDN\Cache\Page_Rules;
    109use WP_Arvan\CDN\Auto_Add_Domain;
    11 use WP_Arvan\Security\DDoS_Protection;
    1210use WP_Arvan\Security\HTTPS_Settings;
    13 use WP_Arvan\Security\Firewall;
    1411
    1512/**
     
    126123        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/inc/CDN/class-reports.php';
    127124        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/inc/CDN/class-acceleration.php';
    128         require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/inc/CDN/Cache/class-caching-settings.php';
    129125        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/inc/CDN/Cache/class-page-rules.php';
    130         require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/inc/Security/class-ddos_protection.php';
    131126        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/inc/Security/class-https-settings.php';
    132         require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/inc/Security/class-firewall.php';
    133127
    134128        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/inc/CDN/class-domain-auto-add.php';
     
    167161        $cdn_options    = new CDN_Options();
    168162        $acceleration   = new Acceleration();
    169         $DDoS_Protection= new DDoS_Protection();
    170163        $HTTPS_Settings = new HTTPS_Settings();
    171         $firewall       = new firewall();
    172         $Cache_Settings = new Caching_Settings();
    173164        $Page_Rules     = new Page_Rules();
    174165        $auto_add_domain= new Auto_Add_Domain();
     
    184175        $this->loader->add_action( 'wp_ajax_ar_cdn_options', $cdn_options, 'ajax_saving_options' );
    185176        $this->loader->add_action( 'wp_ajax_ar_acceleration_options', $acceleration, 'ajax_saving_options' );
    186         $this->loader->add_action( 'wp_ajax_ar_cache_status', $Cache_Settings, 'ajax_saving_options' );
    187         $this->loader->add_action( 'init', $Cache_Settings, 'save_expiration_time_options' );
    188         $this->loader->add_action( 'wp_ajax_ar_ddos_protection_options', $DDoS_Protection, 'ajax_saving_options' );
    189177        $this->loader->add_action( 'wp_ajax_ar_https_options', $HTTPS_Settings, 'ajax_saving_options' );
    190         $this->loader->add_action( 'wp_ajax_ar_firewall', $firewall, 'ajax_saving_options' );
    191         $this->loader->add_action( 'wp_ajax_ar_firewall_change_rules_priority', $firewall, 'change_rule_priority' );
    192         $this->loader->add_action( 'wp_ajax_ar_firewall_create_rule', $firewall, 'ajax_add_rules' );
    193         $this->loader->add_action( 'wp_ajax_ar_firewall_delete_rule', $firewall, 'ajax_delete_rules' );
    194         $this->loader->add_action( 'wp_ajax_ar_firewall_get_rule', $firewall, 'ajax_get_rule' );
    195         $this->loader->add_action( 'wp_ajax_ar_firewall_update_rule', $firewall, 'ajax_update_rules' );
     178        //$this->loader->add_action( 'wp_ajax_ar_firewall', $firewall, 'ajax_saving_options' );
     179        //$this->loader->add_action( 'wp_ajax_ar_firewall_change_rules_priority', $firewall, 'change_rule_priority' );
     180        //$this->loader->add_action( 'wp_ajax_ar_firewall_create_rule', $firewall, 'ajax_add_rules' );
     181        //$this->loader->add_action( 'wp_ajax_ar_firewall_delete_rule', $firewall, 'ajax_delete_rules' );
     182        //$this->loader->add_action( 'wp_ajax_ar_firewall_get_rule', $firewall, 'ajax_get_rule' );
     183        //$this->loader->add_action( 'wp_ajax_ar_firewall_update_rule', $firewall, 'ajax_update_rules' );
    196184        $this->loader->add_action( 'init', $purge_cache, 'purge_arvan_cache' );
    197185        $this->loader->add_action( 'save_post', $purge_cache, 'purge_arvan_cache_onsave' );
  • arvancloud-cdn/tags/1.0.1/wp-arvancloud-cdn.php

    r3256709 r3303568  
    1111 * Plugin URI:        https://www.arvancloud.ir/fa/products/cdn
    1212 * Description:       ArvanCloud CDN service caches your website content. Using this plugin, you will be able to purge and update the cached version, either manually or automatically, so that your users visit the latest version of your website at any time.
    13  * Version:           0.9.18
     13 * Version:           1.0.1
    1414 * Requires PHP:      7.2
    1515 * Author:            Khorshid, ArvanCloud
     
    2727
    2828
    29 define( 'ACCDN_VERSION', '0.9.18' );
     29define( 'ACCDN_VERSION', '1.0.1' );
    3030define( 'ACCDN_NAME', __( 'ArvanCloud CDN', 'arvancloud-cdn' ) );
    3131define( 'ACCDN_SLUG', 'arvancloud-cdn');
  • arvancloud-cdn/trunk/README.txt

    r3256709 r3303568  
    33Tags: CDN, arvancloud
    44Requires at least: 4.0
    5 Tested up to: 6.1
     5Tested up to: 6.8
    66Requires PHP: 7.2
    7 Stable tag: 0.9.18
     7Stable tag: 1.0.1
    88License: GPLv3 or later
    99License URI: http://www.gnu.org/licenses/gpl-3.0.html
     
    5656
    5757== Changelog ==
     58= 1.0.1 – 2025-05-30
     59* Introduce new user interface
     60* Some minor improvements
     61
    5862= 0.9.18 - 2025-03-16 =
    5963* fix: Reload DDoS settings page after changing mode
  • arvancloud-cdn/trunk/admin/assets/css/admin-rtl.css

    r2752685 r3303568  
    77         url('../fonts/yekan-bakh-regular.woff') format('woff'),  /* FF3.6+, IE9, Chrome6+, Saf5.1+*/
    88         url('../fonts/yekan-bakh-regular.ttf') format('truetype');
     9}
     10
     11@font-face {
     12    font-family: 'yekan-bakh';
     13    font-style: normal;
     14    font-weight: 500;
     15    src: url('../fonts/yekan-bakh-medium.eot');
     16    src: url('../fonts/yekan-bakh-medium.eot?#iefix') format('embedded-opentype'),  /* IE6-8 */
     17         url('../fonts/yekan-bakh-medium.woff') format('woff'),  /* FF3.6+, IE9, Chrome6+, Saf5.1+*/
     18         url('../fonts/yekan-bakh-medium.ttf') format('truetype');
    919}
    1020
  • arvancloud-cdn/trunk/admin/assets/css/wp-arvancloud-cdn-admin.css

    r2752685 r3303568  
    524524
    525525.arvan-card {
    526     max-width: 1232px;
     526    max-width: 960px;
    527527    width: calc(100% - 48px);
    528528    background: #fff;
    529529    background-color: #fff;
    530     box-shadow: 0 2px 5px rgb(0 0 0 / 5%);
    531     border-radius: 5px;
     530    border-radius: 16px;
    532531    padding: 24px;
    533     margin-bottom: 20px;
     532    margin: auto auto 20px;
    534533}
    535534
  • arvancloud-cdn/trunk/admin/assets/js/wp-arvancloud-cdn-admin.js

    r3256709 r3303568  
    44  $(document).ready(function() {
    55
    6     $('.cdn-option input[type=checkbox], .cdn-option input[type=radio]').on('click', function(e) {
     6    $('.cdn-option-new input[type=checkbox], .cdn-option-new input[type=radio], .cdn-option-new .checkbox').on('click', function(e) {
    77      e.preventDefault()
    88      showModalLoader()
     9
    910      var form_type = $('form.arvancloud-options-form').attr('data-type');
    1011      if (form_type == 'acceleration') {
     
    1213          name: $(this).attr('name'),
    1314          status: $(this).is(":checked"),
    14           label: $(this).parent().parent().find('h3').html(),
     15          label: $(this).data('label'),
    1516          js: $('#js_optimization').is(":checked"),
    1617          css: $('#css_optimization').is(":checked"),
     18          png: $('#png_optimization').is(":checked"),
     19          jpeg: $('#jpeg_optimization').is(":checked"),
     20          gif: $('#gif_optimization').is(":checked"),
    1721        };
     22
    1823      } else if (form_type == 'ddos_protection') {
    1924        var ele = $('input[name="ddos_protection_mode"]:checked');
     
    2126          name:   $(ele).attr('name'),
    2227          value:  $(ele).val(),
    23           label:  $('form.arvancloud-options-form').parent().find('h2').html(),
     28          label:  $(this).parent().parent().parent().find('h2').html(),
    2429        };
    2530      } else if (form_type == 'cache_status') {
     
    3439          name:       $(this).attr('name'),
    3540          status:     $(this).is(":checked"),
    36           label:      $(this).parent().parent().find('h3').html(),
     41          label:      $(this).parent().parent().parent().find('h2').html(),
    3742          form_type:  form_type,
    3843        };
  • arvancloud-cdn/trunk/admin/class-setup-admin.php

    r2777664 r3303568  
    55use WP_Arvan\CDN\Cache\Page_Rules;
    66use WP_Arvan\CDN\Domain_Info;
     7//use WP_Arvan\Security\DDoS_Protection;
     8
    79use WP_Arvan\Helper;
    810/**
     
    7072
    7173        wp_enqueue_style( $this->plugin_name, plugin_dir_url( __FILE__ ) . 'assets/css/wp-arvancloud-cdn-admin.css', array(), $this->version, 'all' );
    72 
    73         if ( is_rtl() ) {
     74        wp_enqueue_style( 'components', plugin_dir_url( ACCDN_PLUGIN_ABSOLUTE ) . 'assets/css/main.css', array($this->plugin_name), $this->version, 'all' );
     75
     76        //if ( is_rtl() ) {
    7477            wp_enqueue_style( $this->plugin_name . '-rtl', plugin_dir_url( __FILE__ ) . 'assets/css/admin-rtl.css', array(), $this->version, 'all' );
    75         }
     78        //}
    7679        wp_enqueue_style( 'toastrjs', plugin_dir_url( __FILE__ ) . 'assets/css/toastr.css', array(), $this->version, 'all' );
    7780        wp_enqueue_style( 'select2-css', plugin_dir_url( __FILE__ ) . 'assets/css/select2.min.css', array(), '4.1.0', 'all' );
     
    100103        if ( isset($_GET['page']) && substr( sanitize_text_field($_GET['page']), 0, 14 ) === ACCDN_SLUG) {
    101104            wp_enqueue_script( 'ar-cdn', plugin_dir_url( __FILE__ ) . 'assets/js/wp-arvancloud-cdn-admin.js', array( 'jquery', 'toastrjs' ), $this->version, false );
     105            wp_enqueue_script( 'cdn-admin', dirname(plugin_dir_url( __FILE__ )) . '/assets/js/cdn-admin.js', array( 'jquery', 'toastrjs' ), $this->version, false );
    102106            wp_enqueue_script( 'toastrjs', plugin_dir_url( __FILE__ ) . 'assets/js/toastr.js', array( 'jquery' ), '2.1.3', false );
    103    
     107
    104108            wp_enqueue_script('chartjs', plugin_dir_url( __FILE__ ) . 'assets/js/chart.min.js');
     109            wp_enqueue_script('chartjs-geo', plugin_dir_url( __FILE__ ) . 'assets/js/chartjs-chart-geo.min.js');
    105110            wp_enqueue_script('arvan-reports', plugin_dir_url( __FILE__ ) . 'assets/js/reports.js');
    106             wp_enqueue_script('arvan-firewall', plugin_dir_url( __FILE__ ) . 'assets/js/firewall.js');
    107    
     111
    108112            wp_enqueue_script('select2', plugin_dir_url( __FILE__ ) . 'assets/js/select2.min.js', array( 'jquery' ), '4.1.0', false );
    109113            wp_localize_script(
     
    122126                ],
    123127            );
    124             wp_localize_script(
    125                 'arvan-firewall',
    126                 'ar_cdn_ajax_object',
    127                 [
    128                     'ajax_url'  => admin_url( 'admin-ajax.php' ),
    129                     'security'  => wp_create_nonce( 'ar-cdn-options-nonce' ),
    130                     'is_rtl'=> is_rtl(),
    131                     'strings'     => [
    132                         'wait'  => __('Please Wait', 'arvancloud-cdn'),
    133                         'sent'  => __('Request sent.', 'arvancloud-cdn'),
    134                         'updated' => __('Updated', 'arvancloud-cdn'),
    135                         'failed' => __('Update failed', 'arvancloud-cdn'),
    136                         'and'   => __('+ AND', 'arvancloud-cdn'),
    137                     ],
    138                     'rule_options' => [
    139                         'ip.src' => [
    140                             ''  => '',
    141                             '==' => __('Equal', 'arvancloud-cdn'),
    142                             '!=' => __('Not equal', 'arvancloud-cdn'),
    143                             'in' => __('Is in a set of:', 'arvancloud-cdn'),
    144                         ],
    145                         'ip.geoip.country' => [
    146                             ''  => '',
    147                             '==' => __('Equal', 'arvancloud-cdn'),
    148                             '!=' => __('Not equal', 'arvancloud-cdn'),
    149                             'in' => __('Is in a set of:', 'arvancloud-cdn'),
    150                         ],
    151                         'http.request.uri.path' => [
    152                             ''  => '',
    153                             '==' => __('Equal', 'arvancloud-cdn'),
    154                             '!=' => __('Not equal', 'arvancloud-cdn'),
    155                             'contains' => __('Contains:', 'arvancloud-cdn'),
    156                             'matches' => __('Matches regex', 'arvancloud-cdn'),
    157                             'in' => __('Is in a set of:', 'arvancloud-cdn'),
    158                             'starts_with' => __('Starts with', 'arvancloud-cdn'),
    159                             'ends_with' => __('Ends with', 'arvancloud-cdn'),
    160                         ],
    161                         'http.host' => [
    162                             ''  => '',
    163                             '==' => __('Equal', 'arvancloud-cdn'),
    164                             '!=' => __('Not equal', 'arvancloud-cdn'),
    165                             'contains' => __('Contains:', 'arvancloud-cdn'),
    166                             'matches' => __('Matches regex', 'arvancloud-cdn'),
    167                             'in' => __('Is in a set of:', 'arvancloud-cdn'),
    168                             'starts_with' => __('Starts with', 'arvancloud-cdn'),
    169                             'ends_with' => __('Ends with', 'arvancloud-cdn'),
    170                         ],
    171                     ],
    172                     'rule_filter_type' => [
    173                         '' => '',
    174                         'ip.src' => __('IP Source Address', 'arvancloud-cdn'),
    175                         'ip.geoip.country' => __('Country', 'arvancloud-cdn'),
    176                         'http.request.uri.path' => __('URI Path', 'arvancloud-cdn'),
    177                         'http.host' => __('Hostname', 'arvancloud-cdn'),
    178                     ],
    179                     'rule_labels' => [
    180                         __('Parameter', 'arvancloud-cdn'),
    181                         __('Operator', 'arvancloud-cdn'),
    182                         __('Value', 'arvancloud-cdn'),
    183                     ],
    184                     'list_of_countries' => Helper::all_countries(),
    185                 ],
    186             );
    187128        }
    188129    }
     
    197138    public function setup_admin_menu() {
    198139
    199         add_menu_page( 
    200             __( ACCDN_NAME, 'arvancloud-cdn' ), 
    201             __( ACCDN_NAME, 'arvancloud-cdn'), 
    202             'manage_options', 
    203             ACCDN_SLUG, 
     140        add_menu_page(
     141            __( ACCDN_NAME, 'arvancloud-cdn' ),
     142            __( ACCDN_NAME, 'arvancloud-cdn'),
     143            'manage_options',
     144            ACCDN_SLUG,
    204145            __CLASS__ . '::settings_page',
    205146            ACCDN_PLUGIN_ROOT_URL . 'admin/assets/img/arvancloud-logo.svg'
     
    227168            );
    228169
    229             add_submenu_page(
    230                 ACCDN_SLUG,
    231                 __( 'DDoS Protection', 'arvancloud-cdn' ),
    232                 __( 'DDoS Protection', 'arvancloud-cdn' ),
    233                 'manage_options',
    234                 ACCDN_SLUG . '-ddos_protection',
    235                 __CLASS__ . '::ddos_protection_page',
    236             );
    237 
    238170
    239171            add_submenu_page(
     
    246178            );
    247179
    248             add_submenu_page(
    249                 ACCDN_SLUG,
    250                 __( 'Firewall', 'arvancloud-cdn' ),
    251                 __( 'Firewall', 'arvancloud-cdn' ),
    252                 'manage_options',
    253                 ACCDN_SLUG . '-firewall',
    254                 __CLASS__ . '::firewall_settings_page',
    255             );
    256 
    257             add_submenu_page(
    258                 ACCDN_SLUG,
    259                 __( 'Cache Level', 'arvancloud-cdn' ),
    260                 __( 'Caching Settings', 'arvancloud-cdn' ),
    261                 'manage_options',
    262                 ACCDN_SLUG . '-caching',
    263                 __CLASS__ . '::caching_settings_page',
    264             );
    265 
    266180
    267181            add_submenu_page(
     
    276190            add_submenu_page(
    277191                ACCDN_SLUG,
    278                 __( 'Status Analysis', 'arvancloud-cdn' ),
    279                 __( 'Status Analysis', 'arvancloud-cdn' ),
     192                __( 'Analytics', 'arvancloud-cdn' ),
     193                __( 'Analytics', 'arvancloud-cdn' ),
    280194                'manage_options',
    281                 ACCDN_SLUG . '-status-reports',
    282                 __CLASS__ . '::reports_status_page',
     195                ACCDN_SLUG . '-analytics',
     196                __CLASS__ . '::analytics',
    283197            );
    284198
    285199        }
    286 
     200        add_submenu_page(
     201            ACCDN_SLUG,
     202            __( 'CDN Plans', 'arvancloud-cdn' ),
     203            __( 'CDN Plans', 'arvancloud-cdn' ),
     204            'manage_options',
     205            ACCDN_SLUG.'-plans',
     206            __CLASS__ . '::plans_page',
     207        );
     208
     209        add_submenu_page(
     210            ACCDN_SLUG,
     211            __( 'Troubleshoots', 'arvancloud-cdn' ),
     212            __( 'Troubleshoots', 'arvancloud-cdn' ),
     213            'manage_options',
     214            ACCDN_SLUG.'-troubleshoots',
     215            __CLASS__ . '::troubleshoots',
     216        );
    287217
    288218        add_submenu_page(
     
    294224            __CLASS__ . '::about_us_page'
    295225        );
     226
     227        // add_submenu_page(
     228        //     ACCDN_SLUG,
     229        //     __( 'Compontents', 'arvancloud-cdn' ),
     230        //     __( 'Compontents', 'arvancloud-cdn' ),
     231        //     'manage_options',
     232        //     ACCDN_SLUG . '-components',
     233        //     __CLASS__ . '::components'
     234        // );
    296235    }
    297236
     
    347286    }
    348287
    349     public static function reports_status_page() {
    350         require_once( 'views/reports/reports_status.php' );
    351     }
    352 
    353     public static function ddos_protection_page() {
    354         require_once( 'views/security/ddos_protection.php' );
     288    public static function analytics() {
     289        require_once( 'views/reports/analytics.php' );
    355290    }
    356291
     
    363298    }
    364299
    365     public static function firewall_settings_page() {
    366         require_once( 'views/security/firewall_settings.php' );
    367     }
    368 
    369     public static function caching_settings_page() {
    370         require_once( 'views/cache/caching_settings.php' );
    371     }
    372    
     300    public static function components() {
     301        require_once( ACCDN_PLUGIN_ROOT .'/components/components.php' );
     302    }
     303    public static function plans_page() {
     304        require_once( 'views/plans.php' );
     305    }
     306    public static function troubleshoots() {
     307        require_once( 'views/troubleshoots.php' );
     308    }
     309
    373310    /**
    374311     * about_us_page
     
    412349     */
    413350    public static function plugin_status() {
    414        
     351
    415352        $credentials_status = get_option( 'arvan-cloud-cdn-status' );
    416353        switch ($credentials_status) {
     
    433370
    434371        return wp_kses_post($status);
    435                
     372
    436373    }
    437374
    438375    public static function cdn_plan_level() {
    439        
     376
    440377        $cdn_level = Domain_Info::$plan_level;
    441378        switch ($cdn_level) {
  • arvancloud-cdn/trunk/admin/helper.php

    r2845955 r3303568  
    2424     */
    2525    public static function get_site_domain( $subdomain_check = true ) {
    26 
    2726        $pieces = parse_url(home_url());
    2827
     
    4443    }
    4544
    46     public static function size_convertor( $size=0 ) {
     45    public static function size_convertor( $size=0,$translate=true ) {
    4746        if($size < 1024) {
    48             return "{$size} " . esc_html__( 'Bytes', 'arvancloud-cdn' );
     47            return "{$size} " . ($translate?esc_html__( 'Bytes', 'arvancloud-cdn' ):'Bytes');
    4948        } else if ( $size < 1048576 ) {
    5049            $size_kb = round($size/1024);
    51             return "{$size_kb} " . esc_html__( 'Kilobyte', 'arvancloud-cdn' );
     50            return "{$size_kb} " . ($translate?esc_html__( 'Kilobyte', 'arvancloud-cdn' ):'KB');
    5251        } else if ( $size < 1073741824 ) {
    5352            $size_mb = round($size/1048576, 1);
    54             return "{$size_mb} " . esc_html__( 'Megabyte', 'arvancloud-cdn' );
     53            return "{$size_mb} " . ($translate?esc_html__( 'Megabyte', 'arvancloud-cdn' ):'MB');
    5554        } else {
    5655            $size_gb = round($size/1048576/1024, 1);
    57             return "{$size_gb} " . esc_html__( 'Gigabyte', 'arvancloud-cdn' );
     56            return "{$size_gb} " . ($translate?esc_html__( 'Gigabyte', 'arvancloud-cdn' ):'GB');
    5857        }
    5958    }
     
    7877
    7978        $countries = wp_remote_get( $country_endpoint );
    80        
     79
    8180        if (is_wp_error($countries) || !isset($countries['body']) || wp_remote_retrieve_response_code($countries) !== 200) {
    8281            return false;
     
    132131    }
    133132
     133       
     134    public static function set_firewall_settings(){
     135       
     136        $dm_info = Domain_Info::get_domain_info();
     137        if($dm_info['plan_level']>2){
     138            $waf_enable = Request_Arvan::patch('/waf/settings',json_encode(['mode'=>'protect']));
     139           
     140            if($waf_enable->status_code==200){
     141                $disable = [40002,41001,40026,41018,41029,41032,41033,41035,42069,51001,51033,51037,51039,90025];
     142                $pak_enable = Request_Arvan::patch('/waf/packages/default',json_encode(['is_enabled'=>true, 'disabled_rules'=>$disable]));
     143               
     144                if($pak_enable->status_code==200){
     145                    $disable = [920220,920240,920272,920274,942421];
     146                    $pak_enable = Request_Arvan::patch('/waf/packages/crs',json_encode(['is_enabled'=>true, 'disabled_rules'=>$disable]));
     147                }
     148               
     149                if($pak_enable->status_code==200){
     150                    $disable = [];
     151                    $pak_enable = Request_Arvan::patch('/waf/packages/comodo',json_encode(['is_enabled'=>true, 'disabled_rules'=>$disable]));
     152                }
     153               
     154                if($pak_enable->status_code != 200)
     155                    Helper::show_admin_notice('Unable connect to active packages');
     156            }else
     157                Helper::show_admin_notice('Unable connect to arvan server');
     158        }
     159    }
    134160}
  • arvancloud-cdn/trunk/admin/inc/API/HTTP/class-request-arvan.php

    r2845955 r3303568  
    8282    public static function post(string $endpoint = 'domains/', string $data, string $api_key = null)
    8383    {
    84 
    8584        $headers = self::get_headers($api_key);
    8685        $response = \Requests::post( self::$arvan_cloud . $endpoint, $headers, $data );
  • arvancloud-cdn/trunk/admin/inc/CDN/class-acceleration.php

    r2777664 r3303568  
    3232        // request is correct
    3333        $item = array_map( 'sanitize_text_field', $_GET['option_item'] );
    34 
     34        if($item['name']=='resize_images'){
     35            $data = array(
     36                "status"   => $item['status']?'on':'off',
     37                //"height_by"=> 'height',
     38                //"width_by" => 'width',
     39            );
     40            $response = Request_Arvan::patch('/image-resize', json_encode($data));
     41        }else{
    3542        // should send request to arvancloud
    3643       
     
    3845        $js_status  = ($item['js'] == 'true');
    3946        $css_status = ($item['css'] == 'true');
     47        $png_status = ($item['png'] == 'true');
     48        $jpeg_status = ($item['jpeg'] == 'true');
     49        $gif_status = ($item['gif'] == 'true');
    4050        $data = array(
    4151            "status"=> "on",
     
    4454        if ($js_status) array_push( $data['extensions'], 'js' );
    4555        if ($css_status) array_push( $data['extensions'], 'css' );
     56        if ($png_status) array_push( $data['extensions'], 'png' );
     57        if ($jpeg_status) array_push( $data['extensions'], 'jpeg' );
     58        if ($gif_status) array_push( $data['extensions'], 'gif' );
    4659
    4760        $response = Request_Arvan::patch($endpoint, json_encode($data));
     61        }
    4862        $http_code = $response->status_code;
    4963
     
    6478            'js_optimization',
    6579            'css_optimization',
     80            'png_optimization',
     81            'jpeg_optimization',
     82            'gif_optimization',
     83            'resize_images'
    6684        ];
    6785
     
    7997        return Request_Arvan::get("domains/$domain/acceleration");
    8098    }
     99
     100    public static function get_img_options() {
     101        $domain = Helper::get_site_domain();
     102
     103        return Request_Arvan::get("domains/$domain/image-resize");
     104    }
    81105}
  • arvancloud-cdn/trunk/admin/inc/CDN/class-cdn-options.php

    r2788597 r3303568  
    3232
    3333        if ( sanitize_text_field($_GET['option_item']['name']) == 'setup_recommended_rules' ) {
    34             if ( $_GET['option_item']['status'] == 'true' ) {
    35                 Page_Rules::setup_recommended_rules();
     34
     35            /*if ( $_GET['option_item']['status'] == 'true' ) {
     36                Page_Rules::setup_recommended_rules();
    3637            } else {
    3738                Page_Rules::update_recommended_rules(false);
    38             }
    39 
     39            }*/
     40            self::setup_wordpress_optimum_settings();
    4041            wp_send_json_success();
    4142            wp_die();
     
    5354
    5455        // should send request to arvancloud
    55        
    56         $endpoint = '/caching';
    57         $data = array($item[ 'name' ] => ($item['status'] == 'true') ? 1 : 0);
    58         $response = Request_Arvan::patch($endpoint, json_encode($data));
     56        if($item['name'] == 'ddos_protection_mode')
     57        {
     58            $endpoint = '/ddos/settings';
     59            $data = array('protection_mode' => ($item['status'] == 'true') ? 'javascript' : 'off');
     60            $response = Request_Arvan::patch($endpoint, json_encode($data));
     61        }else if($item['name'] == 'cache_status')
     62        {
     63
     64            $endpoint = '/caching';
     65            $data = array('cache_status' => ($item['status'] == 'true') ? 'query_string' : 'off');
     66            $response = Request_Arvan::patch($endpoint, json_encode($data));
     67        }else{
     68            $endpoint = '/caching';
     69            $data = array($item[ 'name' ] => ($item['status'] == 'true') ? 1 : 0);
     70            $response = Request_Arvan::patch($endpoint, json_encode($data));
     71        }
     72
     73
    5974        $http_code = $response->status_code;
    6075
     
    85100            'cache_args',
    86101            'cache_arg',
    87             'setup_recommended_rules'
     102            'setup_recommended_rules',
     103            'ddos_protection_mode'
    88104        ];
    89105
     
    101117        return Request_Arvan::get("domains/$domain/caching");
    102118    }
     119
     120    public static function setup_wordpress_optimum_settings(){
     121
     122        self::wp_optimum_set_waf_rules();
     123        self::wp_optimum_set_global_rules();
     124        self::wp_optimum_set_acceleration_rules();
     125        self::wp_optimum_set_firewall_rules();
     126        self::wp_optimum_set_page_rules();
     127    }
     128
     129    private static function wp_optimum_set_global_rules(){
     130        /*
     131         * Set caching data
     132         */
     133
     134        $endpoint = '/caching';
     135        $data = array(
     136            'cache_status' => 'query_string',
     137            'cache_developer_mode'=>false,
     138            'cache_page_200'=>'30d',
     139            'cache_page_any'=>'0s',
     140            'cache_browser'=>'5h',
     141        );
     142        Request_Arvan::patch($endpoint, json_encode($data));
     143
     144        $endpoint = '/ddos/settings';
     145        $data = array(
     146            "protection_mode"=> "cookie",
     147        );
     148
     149        $response = Request_Arvan::patch($endpoint, json_encode($data));
     150
     151    }
     152
     153
     154    private static function wp_optimum_set_acceleration_rules(){
     155        $endpoint   = '/acceleration';
     156
     157        $data = array(
     158            "status"=> "on",
     159            "extensions"=> []
     160        );
     161        array_push( $data['extensions'], 'js', 'css' );
     162
     163        if(Domain_Info::$plan_level > 1)
     164        {
     165            array_push( $data['extensions'], 'gif', 'jpeg', 'png' );
     166        }
     167        /*
     168         * acceleration for professional account should be implemented
     169         */
     170        $response = Request_Arvan::patch($endpoint, json_encode($data));
     171
     172    }
     173
     174    private static function wp_optimum_set_page_rules(){
     175
     176        $acceleration = [
     177            'status' => 'off',
     178            'extensions' => []
     179        ];
     180
     181
     182        $data = [
     183            'seq'=>'5',
     184            'cache_status' => 'off',
     185            'cache_browser'=>'0s',
     186            'cache_page_any'=>'0s',
     187            'cache_page_200'=>'0s',
     188            'cache_ignore_sc'=>false,
     189            'cache_args'=>false,
     190            'acceleration' => $acceleration,
     191            'image_resize'=> [
     192                'status'=>'off'
     193            ],
     194        ];
     195
     196        if(Page_Rules::is_rule_exist('/wp-admin/*')){
     197            Page_Rules::remove_rule('/wp-admin/*');
     198        }
     199        Page_Rules::add_rule('/wp-admin/*', 'off', $data);
     200
     201        if ( in_array( 'woocommerce/woocommerce.php', apply_filters( 'active_plugins', get_option( 'active_plugins' ) ) ) ) {
     202
     203            if(Page_Rules::is_rule_exist('/cart')){
     204                Page_Rules::remove_rule('/cart');
     205            }
     206            Page_Rules::add_rule('/cart', 'off', $data);
     207
     208            if(Page_Rules::is_rule_exist('/checkout')){
     209                Page_Rules::remove_rule('/checkout');
     210            }
     211            Page_Rules::add_rule('/checkout', 'off', $data);
     212
     213            if(Page_Rules::is_rule_exist('/my-account')){
     214                Page_Rules::remove_rule('/my-account');
     215            }
     216            Page_Rules::add_rule('/my-account', 'off', $data);
     217        }
     218
     219        /*
     220         * wp upload folder based on acceleration settings
     221         */
     222
     223        $acceleration = Acceleration::get_options();
     224
     225        $data = [
     226            'seq'=>'5',
     227            'cache_status' => 'off',
     228            'cache_browser'=>'0s',
     229            'cache_page_any'=>'0s',
     230            'cache_page_200'=>'0s',
     231            'cache_ignore_sc'=>false,
     232            'cache_args'=>false,
     233            'acceleration' => $acceleration,
     234            'image_resize'=> [
     235                'status'=>'off'
     236            ],
     237        ];
     238
     239        if(Page_Rules::is_rule_exist('/wp-content/uploads/*')){
     240            Page_Rules::remove_rule('/wp-content/uploads/*');
     241        }
     242        Page_Rules::add_rule('/wp-content/uploads/*', 'off', $data);
     243
     244    }
     245
     246    private static function wp_optimum_set_firewall_rules(){
     247        $data = array(
     248            'action'        => 'deny',
     249            'name'          => 'xmlrpcphp Blocking',
     250            'filter_expr'   => "((http.request.uri.path contains \"/xmlrpc.php**\"))",
     251            'is_enabled'    => true,
     252        );
     253
     254        $endpoint = 'domains/' . Helper::get_site_domain() . '/firewall/rules';
     255
     256        $response = Request_Arvan::post( $endpoint, json_encode( $data));
     257    }
     258
     259    public function wp_optimum_set_waf_rules(){
     260       
     261        $dm_info = Domain_Info::get_domain_info();
     262        if($dm_info['plan_level']>2){
     263            $waf_enable = Request_Arvan::patch('/waf/settings',json_encode(['mode'=>'protect']));
     264           
     265            if($waf_enable->status_code==200){
     266                $disable = [40002,41001,40026,41018,41029,41032,41033,41035,42069,51001,51033,51037,51039,90025];
     267                $pak_enable = Request_Arvan::patch('/waf/packages/default',json_encode(['is_enabled'=>true, 'disabled_rules'=>$disable]));
     268               
     269                if($pak_enable->status_code==200){
     270                    $disable = [920220,920240,920272,920274,942421];
     271                    $pak_enable = Request_Arvan::patch('/waf/packages/crs',json_encode(['is_enabled'=>true, 'disabled_rules'=>$disable]));
     272                }
     273               
     274                if($pak_enable->status_code==200){
     275                    $disable = [];
     276                    $pak_enable = Request_Arvan::patch('/waf/packages/comodo',json_encode(['is_enabled'=>true, 'disabled_rules'=>$disable]));
     277                }
     278               
     279                if($pak_enable->status_code != 200)
     280                    Helper::show_admin_notice('Unable connect to active packages');
     281            }else
     282                Helper::show_admin_notice('Unable connect to arvan server');
     283        }
     284    }
    103285}
  • arvancloud-cdn/trunk/admin/inc/CDN/class-domain-auto-add.php

    r2943546 r3303568  
    3838
    3939        $this->cdn_domain_list = [];
    40 
    4140    }
    4241
  • arvancloud-cdn/trunk/admin/inc/CDN/class-reports.php

    r2943546 r3303568  
    142142        $this->labels = $this->format_chart_label();
    143143        $this->datasets = $this->format_chart_datasets();
     144        $this->lists    = isset($report['lists'])?$report['lists']:[];
    144145
    145146        self::$_instance = $this;
     
    326327    private function set_report_data($endpoint, $charts)
    327328    {
    328         if ($endpoint == 'traffics' && $this->report_type != 'requests') {
     329        if (in_array($endpoint,['traffics','traffics/map','dns-geo']) && $this->report_type != 'requests') {
    329330            return $charts['requests'];
    330331        } else if ($endpoint == 'traffics') {
  • arvancloud-cdn/trunk/admin/views/acceleration.php

    r2752685 r3303568  
    11<?php
     2use WP_Arvan\CDN\Domain_Info;
    23use WP_Arvan\CDN\Acceleration;
    34
    45$options = Acceleration::get_options();
    5 if(!$options || !isset($options['status'])) {
    6     wp_safe_redirect( esc_url( admin_url( '/admin.php?page=arvancloud-cdn' ) ) );
     6$ioption = Acceleration::get_img_options();
     7if (!$options || !isset($options['status'])) {
     8    wp_safe_redirect(esc_url(admin_url('/admin.php?page=arvancloud-cdn')));
    79}
    8 
    9 $js_optimization    = false;
    10 $css_optimization   = false;
     10$level = Domain_Info::get_domain_info()['plan_level'];
     11$js_optimization = false;
     12$css_optimization = false;
     13$png_optimization = false;
     14$jpeg_optimization = false;
     15$gif_optimization = false;
    1116if ($options['status'] == true && isset($options['extensions'])) {
    12     $js_optimization    = in_array('js', $options['extensions']);
    13     $css_optimization   = in_array('css', $options['extensions']);
     17    $js_optimization = in_array('js', $options['extensions']);
     18    $css_optimization = in_array('css', $options['extensions']);
     19    $png_optimization = in_array('png', $options['extensions']);
     20    $jpeg_optimization = in_array('jpeg', $options['extensions']);
     21    $gif_optimization = in_array('gif', $options['extensions']);
    1422}
    1523?>
    16 
    17 
    1824<div class="wrap ar-wrap">
    19     <h1><?php esc_html_e('Web Acceleration', 'arvancloud-cdn'); ?></h1>
    20     <?php require_once( ACCDN_PLUGIN_ROOT . 'admin/views/components/header.php' ) ?>
     25    <?php require_once(ACCDN_PLUGIN_ROOT . 'admin/views/components/header.php') ?>
    2126    <br>
    22    
    2327    <div class="arvan-wrapper">
    2428        <div class="arvan-card">
    25             <h2><?php esc_html_e('Web Acceleration', 'arvancloud-cdn'); ?></h2>
    26             <p><?php echo esc_html__( 'When this feature is enabled, ArvanCloud\'s edge servers will be shown the latest cache version of your site to the users if your website or web server goes down.', 'arvancloud-cdn' ) ?></p>
    27             <form class="arvancloud-options-form arvancloud-acceleration-options" method="post" action="<?php echo esc_url( admin_url( '/admin.php?page=arvancloud-cdn' )); ?>" data-type="acceleration">
    28                 <div class="cdn-option">
    29                     <div class="input-container">
    30                         <input type="checkbox" id="js_optimization" name="js_optimization" <?php echo $js_optimization ? 'checked' : ''; ?>/>
    31                         <label for="js_optimization">Toggle</label>
    32                     </div>
    33                     <div class="detail-container">
    34                         <h3><?php esc_html_e('JavaScript Optimization', 'arvancloud-cdn'); ?></h3>
    35                         <p><?php esc_html_e('With enabling this feature the size of files will decrease by linearizing, summarizing, and removing comments.', 'arvancloud-cdn'); ?></p>
    36                     </div>
     29            <form class="arvancloud-options-form arvancloud-acceleration-options" method="post"
     30                  action="<?php echo esc_url(admin_url('/admin.php?page=arvancloud-cdn')); ?>" data-type="acceleration">
     31                <div class="ar-acceleration">
     32                    <h1 class="mb-8 acceleration-title"><?php esc_html_e('Web Acceleration', 'arvancloud-cdn'); ?></h1>
     33                    <p class="font-14 font-weight-medium"><?php echo esc_html__('When this feature is enabled, ArvanCloud\'s edge servers will be shown the latest cache version of your site to the users if your website or web server goes down.', 'arvancloud-cdn') ?></p>
     34                    <article class="cdn-option-new ar-card p-24 mb-24">
     35                        <h2 class="mb-8"><?php esc_html_e('CSS and JavaScript Optimization', 'arvancloud-cdn'); ?></h2>
     36                        <p class="font-14 font-weight-medium mb-16"><?php esc_html_e('With enabling this feature the size of files will decrease by linearizing, summarizing, and removing comments.', 'arvancloud-cdn'); ?></p>
     37                        <div>
     38                            <div class="custom-switch custom-switch--large me-24">
     39                                <input data-label="<?php esc_html_e('CSS Optimization', 'arvancloud-cdn'); ?>"
     40                                       class="custom-switch-input" type="checkbox" id="css_optimization"
     41                                       name="css_optimization" <?php echo ($css_optimization == true) ? 'checked' : ''; ?>>
     42                                <label class="custom-switch-label" for="css_optimization">CSS</label>
     43                            </div>
     44                            <div class="custom-switch custom-switch--large">
     45                                <input data-label="<?php esc_html_e('Javascript Optimization', 'arvancloud-cdn'); ?>"
     46                                       class="custom-switch-input" type="checkbox" id="js_optimization"
     47                                       name="js_optimization" <?php echo ($js_optimization == true) ? 'checked' : ''; ?>>
     48                                <label class="custom-switch-label" for="js_optimization">JavaScript</label>
     49                            </div>
     50                        </div>
     51                    </article>
     52                    <article class="cdn-option-new ar-card p-24 mb-24">
     53                        <h2 class="mb-8"><?php esc_html_e('Image Compression', 'arvancloud-cdn'); ?></h2>
     54                        <p class="font-14 font-weight-medium mb-16"><?php esc_html_e('When enabled, converting images to Webp reduces file size and speeds up loading', 'arvancloud-cdn'); ?> </p>
     55                        <div>
     56                            <div class="custom-switch custom-switch--large me-24">
     57                                <input data-label="<?php esc_html_e('JPG Optimization', 'arvancloud-cdn'); ?>" class="custom-switch-input"  type="checkbox" id="jpeg_optimization" name="jpeg_optimization" <?php echo ($jpeg_optimization == true) ? 'checked' : ''; ?>>
     58                                <label class="custom-switch-label" for="jpeg_optimization">JPG</label>
     59                            </div>
     60                            <div class="custom-switch custom-switch--large me-24">
     61                                <input data-label="<?php esc_html_e('PNG Optimization', 'arvancloud-cdn'); ?>" class="custom-switch-input" type="checkbox" id="png_optimization" name="png_optimization" <?php echo ($png_optimization == true) ? 'checked' : ''; ?>>
     62                                <label class="custom-switch-label" for="png_optimization">PNG</label>
     63                            </div>
     64                            <div class="custom-switch custom-switch--large">
     65                                <input data-label="<?php esc_html_e('GIF Optimization', 'arvancloud-cdn'); ?>" class="custom-switch-input"  type="checkbox" id="gif_optimization" name="gif_optimization" <?php echo ($gif_optimization == true) ? 'checked' : ''; ?>>
     66                                <label class="custom-switch-label" for="gif_optimization">GIF</label>
     67                            </div>
     68                        </div>
     69                    </article>
     70                    <article class="ar-card p-24 mb-24">
     71                        <div class="display-flex align-items-start">
     72                            <div class="flex-grow-1 me-16 mb-16">
     73                                <div class="cdn-option-new custom-switch custom-switch--large mb-8">
     74                                    <input class="custom-switch-input" <?php echo $level==1?' disabled="disabled"':''; echo $ioption['status']=='on'?'checked="checked"':'' ?> type="checkbox" name="resize_images" id="custom-checkbox-17">
     75                                    <label class="custom-switch-label" for="custom-checkbox-17"><h2 class="m-0"><?php esc_html_e('Image Resizing', 'arvancloud-cdn'); ?></h2></label>
     76                                </div>
     77                                <p class="font-14 font-weight-medium m-0"><?php esc_html_e('The CDN server displays the images according to the dimensions requested by the user and removes the extra load from your main server. When enabled, add the desired dimensions in the end of the file address. Example:', 'arvancloud-cdn'); ?></p>
     78                            </div>
     79                            <a class="btn btn--enterprise btn--medium" href="https://panel.arvancloud.ir/cdn/<?php echo \WP_Arvan\Helper::get_site_domain() ?>/plans"><?php esc_html_e('Upgrade Plan', 'arvancloud-cdn'); ?></a>
     80                        </div>
     81                        <p class="m-0 dir-ltr ar-example-msg"><?php echo \WP_Arvan\Helper::get_site_domain(); ?>/imagename.jpg?width=100&height=50</p>
     82                        <p class="display-flex align-items-start"><?php esc_html_e('This feature is active in professional and higher packages.', 'arvancloud-cdn'); ?></p>
     83                    </article>
     84                    <div id="lock-modal"></div>
     85                    <div id="loading-circle"></div>
    3786                </div>
    38                 <div class="cdn-option">
    39                     <div class="input-container">
    40                         <input type="checkbox" id="css_optimization" name="css_optimization" <?php echo $css_optimization ? 'checked' : ''; ?>/>
    41                         <label for="css_optimization">Toggle</label>
    42                     </div>
    43                     <div class="detail-container">
    44                         <h3><?php esc_html_e('CSS Optimization', 'arvancloud-cdn'); ?></h3>
    45                         <p><?php esc_html_e('With enabling this feature the size of files will decrease by linearizing, summarizing, and removing comments.', 'arvancloud-cdn'); ?></p>
    46                     </div>
    47                 </div>
    48 
    49 
    50                 <div id="lock-modal"></div>
    51                 <div id="loading-circle"></div>
    5287            </form>
    5388        </div>
    5489    </div>
    55    
    56  
    5790    <br>
    58     <?php require_once( ACCDN_PLUGIN_ROOT . 'admin/views/components/footer.php' ); ?>
     91    <?php require_once(ACCDN_PLUGIN_ROOT . 'admin/views/components/footer.php'); ?>
    5992</div>
  • arvancloud-cdn/trunk/admin/views/components/footer.php

    r2850501 r3303568  
    22use WP_Arvan\Helper;
    33?>
    4 <div class="acs-footer">
    5     <div class="acs-footer-links">       
    6         <ul>
    7             <li><a href="https://panel.arvancloud.ir/cdn/<?php echo Helper::get_site_domain(); ?>/plans" target="_blank" rel="noopener noreferrer"><?php echo esc_html_e( 'CDN Plans', 'arvancloud-cdn' ) ?> <span class="dashicons dashicons-external"></span></a></li>
    8             <li><a href="https://forum.arvancloud.ir/c/cdn/47" target="_blank" rel="noopener noreferrer"><?php echo esc_html_e( 'Support', 'arvancloud-cdn' ) ?> <span class="dashicons dashicons-external"></span></a></li>
    9             <li><a href="mailto:[email protected]" target="_blank" rel="noopener noreferrer"><?php echo esc_html_e( 'Email Us', 'arvancloud-cdn' ) ?> <span class="dashicons dashicons-email"></span></a></li>
    10         </ul>
    11     </div>
    12     <div class="acs-footer-social">
    13         <div class="footer__social-icons">
    14             <?php
    15             if ( get_locale() == 'fa_IR' ) {
    16                 echo wp_kses_post('<a class="footer__social-icons__link footer__social-icons--telegram" href="https://t.me/arvancloud" target="_blank" rel="noopener noreferrer">
    17                     <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 34.59 29.03"><g><g><path d="M34.05,2.17,26.35,27.4a1.4,1.4,0,0,1-2.21.85L12.93,19.87,12.32,26a.56.56,0,0,1-1.08.12L8.3,17.57,1.47,15.35a1.4,1.4,0,0,1-.08-2.63L32.17.6A1.4,1.4,0,0,1,34.05,2.17Z" style="fill:none;stroke:#7ce8dd;stroke-linecap:round;stroke-linejoin:round;stroke-width:1.00622773842599px"></path><polyline points="8.3 17.57 27.96 5.6 12.93 19.87" style="fill:none;stroke:#7ce8dd;stroke-linecap:round;stroke-linejoin:round;stroke-width:1.00622773842599px"></polyline><line x1="16.49" y1="22.53" x2="12.07" y2="26.37" style="fill:none;stroke:#7ce8dd;stroke-linecap:round;stroke-linejoin:round;stroke-width:1.00622773842599px"></line></g></g></svg>                   
    18                     </a>');
    19             }
    20             ?>
    21            
    22             <a class="footer__social-icons__link footer__social-icons--linkedin" href="<?php echo esc_url(get_locale() == 'fa_IR' ? 'https://www.linkedin.com/company/arvancloud-fa' : 'https://www.linkedin.com/company/arvancloud') ?>" target="_blank" rel="noopener noreferrer">
    23                 <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 29.41 29.85"><g><g><rect x="0.97" y="10.18" width="6.53" height="19.16" style="fill:none;stroke:#7ce8dd;stroke-linecap:round;stroke-linejoin:round;stroke-width:1.00622773842599px"></rect><path d="M28.9,16.17V29.34H22.38V17.53a2.43,2.43,0,0,0-1.2-2.13A3.09,3.09,0,0,0,19.6,15a2.79,2.79,0,0,0-1.29.34,3.62,3.62,0,0,0-1.91,3.26V29.34H9.87V10.18H16.4v2.05A8,8,0,0,1,21.09,10a11.27,11.27,0,0,1,3,.28h0l.24.07a8,8,0,0,1,.78.25l.23.1.22.09.24.13a5.64,5.64,0,0,1,.7.46l0,0A6,6,0,0,1,28.9,16.17Z" style="fill:none;stroke:#7ce8dd;stroke-linecap:round;stroke-linejoin:round;stroke-width:1.00622773842599px"></path><circle cx="4.42" cy="4.42" r="3.92" style="fill:none;stroke:#7ce8dd;stroke-linecap:round;stroke-linejoin:round;stroke-width:1.00622773842599px"></circle></g></g></svg>                   
    24             </a>
    25             <a class="footer__social-icons__link footer__social-icons--twitter" href="<?php echo esc_url(get_locale() == 'fa_IR' ? 'https://twitter.com/ArvanCloud_fa' : 'https://twitter.com/ArvanCloud') ?>" target="_blank" rel="noopener noreferrer">
    26                 <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 34.72 28.86"><g><g><path d="M8.81,23.82a7.45,7.45,0,0,1-2.72,1.94,10.49,10.49,0,0,1-2.5.83A5.9,5.9,0,0,1,1,26.78c11.19,4.6,28.58-.61,28.66-19.15,0,0,3.68-2.07,4.59-4.68L31.68,4,33.45.66a8.5,8.5,0,0,1-5.59,2.22C26.17-.95,15-1,16.67,9.31,8.32,10.31,1.35,2.5,1.35,2.5S-.49,7.78,3.87,11c0,0-.42,1.13-3.37,0,0,0,.92,5.9,6,5.9,0,0,.41,2.74-3.3,1.91A7.67,7.67,0,0,0,9.54,22a7.23,7.23,0,0,1-.17.8A3.68,3.68,0,0,1,8.81,23.82Z" style="fill:none;stroke:#7ce8dd;stroke-linecap:round;stroke-linejoin:round;stroke-width:1.00622773842599px"></path></g></g></svg>                   
    27             </a>
    28             <a class="footer__social-icons__link footer__social-icons--instagram" href="<?php echo esc_url(get_locale() == 'fa_IR' ? 'https://instagram.com/arvancloud_fa' : 'https://www.instagram.com/arvancloud') ?>" target="_blank" rel="noopener noreferrer">
    29                 <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 29.2 29.34"><g><g><rect x="0.5" y="0.5" width="28.19" height="28.34" rx="8.18" ry="8.18" style="fill:none;stroke:#7ce8dd;stroke-linecap:round;stroke-linejoin:round;stroke-width:1.00622773842599px"></rect><circle cx="14.6" cy="14.67" r="6.8" style="fill:none;stroke:#7ce8dd;stroke-linecap:round;stroke-linejoin:round;stroke-width:1.00622773842599px"></circle><circle cx="22.61" cy="6.65" r="1.22" style="fill:none;stroke:#7ce8dd;stroke-linecap:round;stroke-linejoin:round;stroke-width:1.00622773842599px"></circle></g></g></svg>                   
    30             </a>
    31             <a class="footer__social-icons__link footer__social-icons--github" href="https://github.com/arvancloud" target="_blank" rel="noopener noreferrer">
    32                 <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 139.04 160.41"><path d="M93.75,102.76c29.9-.11,57.07-38.71,33.1-72.61,2-5.25,2.25-19-1.75-26.75-8.25-2.75-28.25,9.75-28.25,9.75-13.75-7.5-38.24-4.42-47,.25,0,0-20-12.5-28.25-9.75-4,7.75-3.75,21.5-1.75,26.75C-4.11,64.3,23.06,102.9,53,103a1.35,1.35,0,0,1,1.18,2c-1.85,3-3.51,8-4.76,13.82a54.86,54.86,0,0,1-8,1,17.75,17.75,0,0,1-15.18-7.11c-3.17-4.24-6-9.14-9.91-11.37C10.8,98.22,6.22,98.2,3.64,100a1.55,1.55,0,0,0,.21,2.63c13.51,7.09,14.17,19.06,22.5,25.25,5.14,3.81,16.93,4.56,21,4.71-.71,8.84-.41,17.94,1.48,24.79l49-.25c4.32-15.7.36-43.19-5.28-52.35A1.35,1.35,0,0,1,93.75,102.76Z" style="fill:none;stroke:#8ccece;stroke-miterlimit:10;stroke-width:6px"></path></svg>                   
    33             </a>
     4<div class="arvan-wrapper">
     5    <div class="arvan-footer arvan-wrapper-card">
     6        <div class="ar-footer-row">
     7            <div class="ar-footer-col">
     8                <a class="ar-footer-link me-24" href="mailto:[email protected]">
     9                    <svg class="me-8" width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
     10                        <path d="M2.66668 2.66669H13.3333C14.0667 2.66669 14.6667 3.26669 14.6667 4.00002V12C14.6667 12.7334 14.0667 13.3334 13.3333 13.3334H2.66668C1.93334 13.3334 1.33334 12.7334 1.33334 12V4.00002C1.33334 3.26669 1.93334 2.66669 2.66668 2.66669Z" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round"/>
     11                        <path d="M14.6667 4L8.00001 8.66667L1.33334 4" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round"/>
     12                    </svg>
     13                    <?php echo esc_html_e( 'Email Us', 'arvancloud-cdn' ) ?>
     14                </a>
     15                <a class="ar-footer-link me-24" href="https://forum.arvancloud.ir/c/cdn/47" target="_blank">
     16                    <svg class="me-8" width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
     17                        <path d="M10.0333 3.33335C10.6845 3.4604 11.2829 3.77886 11.752 4.24798C12.2211 4.7171 12.5396 5.31553 12.6666 5.96669M10.0333 0.666687C11.3862 0.816978 12.6477 1.4228 13.6108 2.38469C14.5739 3.34658 15.1813 4.60736 15.3333 5.96002M14.6666 11.28V13.28C14.6674 13.4657 14.6294 13.6495 14.555 13.8196C14.4806 13.9897 14.3715 14.1424 14.2347 14.2679C14.0979 14.3934 13.9364 14.489 13.7605 14.5485C13.5846 14.608 13.3982 14.6301 13.2133 14.6134C11.1619 14.3904 9.19131 13.6895 7.45998 12.5667C5.84919 11.5431 4.48353 10.1775 3.45998 8.56669C2.33329 6.82749 1.63214 4.84735 1.41331 2.78669C1.39665 2.60233 1.41856 2.41653 1.47764 2.2411C1.53673 2.06568 1.63169 1.90448 1.75649 1.76777C1.88128 1.63106 2.03318 1.52183 2.2025 1.44704C2.37183 1.37224 2.55487 1.33353 2.73998 1.33335H4.73998C5.06351 1.33017 5.37717 1.44474 5.62248 1.65571C5.8678 1.86668 6.02803 2.15965 6.07331 2.48002C6.15772 3.12006 6.31428 3.74851 6.53998 4.35335C6.62967 4.59197 6.64908 4.8513 6.59591 5.10061C6.54274 5.34992 6.41922 5.57876 6.23998 5.76002L5.39331 6.60669C6.34235 8.27572 7.72428 9.65765 9.39331 10.6067L10.24 9.76002C10.4212 9.58078 10.6501 9.45725 10.8994 9.40408C11.1487 9.35091 11.408 9.37032 11.6466 9.46002C12.2515 9.68572 12.8799 9.84227 13.52 9.92669C13.8438 9.97237 14.1396 10.1355 14.351 10.385C14.5624 10.6345 14.6748 10.9531 14.6666 11.28Z" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round"/>
     18                    </svg>
     19                    <?php echo esc_html_e( 'Support', 'arvancloud-cdn' ) ?>
     20                </a>
     21                <a class="ar-footer-link me-24" href="https://panel.arvancloud.ir/cdn/<?php echo Helper::get_site_domain(); ?>/plans" target="_blank">
     22                    <svg class="me-8" width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
     23                        <path d="M12 8.66667V12.6667C12 13.0203 11.8595 13.3594 11.6095 13.6095C11.3594 13.8595 11.0203 14 10.6667 14H3.33333C2.97971 14 2.64057 13.8595 2.39052 13.6095C2.14048 13.3594 2 13.0203 2 12.6667V5.33333C2 4.97971 2.14048 4.64057 2.39052 4.39052C2.64057 4.14048 2.97971 4 3.33333 4H7.33333" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round"/>
     24                        <path d="M10 2H14V6" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round"/>
     25                        <path d="M6.66669 9.33333L14 2" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round"/>
     26                    </svg>
     27                    <?php echo esc_html_e( 'CDN Plans', 'arvancloud-cdn' ) ?>
     28                </a>
     29            </div>
     30            <div class="ar-footer-col">
     31                <a
     32                    class="ar-footer-social me-8"
     33                    href="<?php echo esc_url(get_locale() == 'fa_IR' ? 'https://twitter.com/ArvanCloud_fa' : 'https://twitter.com/ArvanCloud') ?>"
     34                    target="_blank">
     35                        <svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
     36                            <path d="M15.3333 1.99999C14.6949 2.45031 13.988 2.79473 13.24 3.01999C12.8385 2.55833 12.3048 2.23112 11.7113 2.08261C11.1178 1.9341 10.493 1.97145 9.92135 2.18963C9.34974 2.4078 8.85892 2.79626 8.51528 3.30247C8.17164 3.80868 7.99176 4.40821 7.99996 5.01999V5.68666C6.82838 5.71704 5.66748 5.4572 4.62063 4.93029C3.57379 4.40338 2.6735 3.62575 1.99996 2.66666C1.99996 2.66666 -0.666707 8.66666 5.33329 11.3333C3.96031 12.2653 2.32473 12.7326 0.666626 12.6667C6.66663 16 14 12.6667 14 4.99999C13.9993 4.81429 13.9815 4.62905 13.9466 4.44666C14.627 3.77565 15.1072 2.92847 15.3333 1.99999V1.99999Z" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round"/>
     37                        </svg>
     38                </a>
     39                <a
     40                    class="ar-footer-social me-8"
     41                    href="https://github.com/arvancloud"
     42                    target="_blank">
     43                        <svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
     44                            <path d="M6.00004 12.6667C2.66671 13.6667 2.66671 11 1.33337 10.6667M10.6667 14.6667V12.0867C10.6917 11.7688 10.6488 11.4492 10.5407 11.1492C10.4327 10.8492 10.262 10.5756 10.04 10.3467C12.1334 10.1133 14.3334 9.32 14.3334 5.68C14.3332 4.74922 13.9752 3.85413 13.3334 3.18C13.6373 2.36567 13.6158 1.46557 13.2734 0.666666C13.2734 0.666666 12.4867 0.433332 10.6667 1.65333C9.13871 1.23921 7.52804 1.23921 6.00004 1.65333C4.18004 0.433332 3.39337 0.666666 3.39337 0.666666C3.05096 1.46557 3.02947 2.36567 3.33337 3.18C2.68679 3.85913 2.32839 4.76231 2.33337 5.7C2.33337 9.31333 4.53337 10.1067 6.62671 10.3667C6.40737 10.5933 6.23822 10.8636 6.13025 11.1599C6.02228 11.4563 5.97791 11.772 6.00004 12.0867V14.6667" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round"/>
     45                        </svg>
     46                </a>
     47                <a
     48                    class="ar-footer-social me-8"
     49                    href="<?php echo esc_url(get_locale() == 'fa_IR' ? 'https://instagram.com/arvancloud_fa' : 'https://www.instagram.com/arvancloud') ?>"
     50                    target="_blank">
     51                        <svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
     52                            <path d="M11.3334 1.33331H4.66671C2.82576 1.33331 1.33337 2.8257 1.33337 4.66665V11.3333C1.33337 13.1743 2.82576 14.6666 4.66671 14.6666H11.3334C13.1743 14.6666 14.6667 13.1743 14.6667 11.3333V4.66665C14.6667 2.8257 13.1743 1.33331 11.3334 1.33331Z" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round"/>
     53                            <path d="M10.6667 7.58002C10.7489 8.13485 10.6542 8.7015 10.3958 9.19936C10.1375 9.69723 9.72877 10.101 9.22776 10.3531C8.72675 10.6053 8.15897 10.6931 7.6052 10.604C7.05143 10.5149 6.53985 10.2534 6.14323 9.85679C5.74662 9.46018 5.48516 8.9486 5.39605 8.39483C5.30694 7.84105 5.39472 7.27328 5.64689 6.77227C5.89907 6.27125 6.3028 5.86251 6.80066 5.60418C7.29853 5.34585 7.86518 5.25108 8.42001 5.33335C8.98596 5.41727 9.50991 5.68099 9.91447 6.08556C10.319 6.49012 10.5828 7.01407 10.6667 7.58002Z" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round"/>
     54                            <path d="M11.6666 4.33331H11.6733" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round"/>
     55                        </svg>
     56                </a>
     57                <a
     58                    class="ar-footer-social me-8"
     59                    href="<?php echo esc_url(get_locale() == 'fa_IR' ? 'https://www.linkedin.com/company/arvancloud-fa' : 'https://www.linkedin.com/company/arvancloud') ?>"
     60                    target="_blank">
     61                        <svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
     62                            <path d="M10.6666 5.33331C11.7275 5.33331 12.7449 5.75474 13.4951 6.50489C14.2452 7.25503 14.6666 8.27245 14.6666 9.33331V14H12V9.33331C12 8.97969 11.8595 8.64055 11.6094 8.3905C11.3594 8.14046 11.0202 7.99998 10.6666 7.99998C10.313 7.99998 9.97387 8.14046 9.72382 8.3905C9.47377 8.64055 9.33329 8.97969 9.33329 9.33331V14H6.66663V9.33331C6.66663 8.27245 7.08805 7.25503 7.8382 6.50489C8.58834 5.75474 9.60576 5.33331 10.6666 5.33331V5.33331Z" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round"/>
     63                            <path d="M4.00004 6H1.33337V14H4.00004V6Z" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round"/>
     64                            <path d="M2.66671 3.99998C3.40309 3.99998 4.00004 3.40303 4.00004 2.66665C4.00004 1.93027 3.40309 1.33331 2.66671 1.33331C1.93033 1.33331 1.33337 1.93027 1.33337 2.66665C1.33337 3.40303 1.93033 3.99998 2.66671 3.99998Z" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round"/>
     65                        </svg>
     66                </a>
     67                <a
     68                    class="ar-footer-social me-8"
     69                    href="https://t.me/arvancloud"
     70                    target="_blank">
     71                        <svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
     72                            <path d="M14.6667 1.33331L7.33337 8.66665" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round"/>
     73                            <path d="M14.6667 1.33331L10 14.6666L7.33337 8.66665L1.33337 5.99998L14.6667 1.33331Z" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round"/>
     74                        </svg>
     75                </a>
     76            </div>
    3477        </div>
    3578    </div>
    3679</div>
     80
     81<script type="text/javascript">
     82    jQuery('#wpcontent').addClass('background-gray-200');
     83</script>
  • arvancloud-cdn/trunk/admin/views/components/header.php

    r2850501 r3303568  
    33use WP_Arvan\Helper;
    44?>
    5 <hr />
    6 <div class="arvan-head">
     5
     6<div class="arvan-head display-none">
    77    <div class="arvan-status">
    88
     
    4747    </div>
    4848</div>
    49 
    50 <hr />
  • arvancloud-cdn/trunk/admin/views/options-display.php

    r2943546 r3303568  
    22use WP_Arvan\CDN\CDN_Options;
    33use WP_Arvan\CDN\Cache\Page_Rules;
     4//use WP_Arvan\Security\DDoS_Protection;
    45
    56$automatic_cleaning = get_option( 'arvan-cloud-cdn-automatic-cleaning' );
     
    1314
    1415$setup_recommended_rules = Page_Rules::is_recommended_rule_enabled();
     16
     17/*$ddos = new DDoS_Protection;
     18$ddos_status = $ddos->get_status();
     19
     20$cache_setting = \WP_Arvan\CDN\Cache\Caching_Settings::get_options();
     21$cache_status = $cache_setting['cache_status'];*/
     22
    1523?>
    1624
    1725
    1826<div class="wrap ar-wrap">
    19     <h1><?php echo esc_html_e( 'CDN Options', 'arvancloud-cdn' ) ?></h1>
    2027    <?php require_once( ACCDN_PLUGIN_ROOT . 'admin/views/components/header.php' ) ?>
    2128    <br>
     
    2330        <div class="arvan-card">
    2431            <form class="arvancloud-options-form arvancloud-cdn-options-form" method="post" action="<?php echo esc_url( admin_url( '/admin.php?page=arvancloud-cdn' )); ?>" data-type="cdn_options">
    25                 <div class="cdn-option">
    26                     <div class="input-container">
    27                         <a class="purge-arvan-cache" href="<?php echo esc_url('admin.php?page=' . ACCDN_SLUG . '&purge_arvan_cache=1' . '&_wpnonce=' . esc_attr( $nonce_purge_cache )); ?>"><?php echo esc_html_e('Purge Cache', 'arvancloud-cdn'); ?></a>
     32                <div class="ar-dashboard">
     33                <article class="cdn-option-new ar-card action-card">
     34                    <div class="action-card__content">
     35                        <h2 class="action-card__title"><?php esc_html_e( 'Optimum settings for WordPress', 'arvancloud-cdn' ) ?></h2>
     36                        <p class="action-card__desc"><?php echo esc_html_e( 'By clicking on the opposite button, the optimal settings for WordPress will be automatically applied to you.', 'arvancloud-cdn' ) ?></p>
    2837                    </div>
    29                     <div class="detail-container">
    30                         <h3><?php echo esc_html_e('Purge Cache', 'arvancloud-cdn'); ?></h3>
    31                         <p><?php echo esc_html_e('This will help you to get the full version of the new data from your web server by clearing the cache data from Arvan servers.', 'arvancloud-cdn'); ?></p>
     38                    <div class="action-card__action">
     39                        <button type="button" class="btn btn--primary btn--medium px-24 checkbox" name="setup_recommended_rules" id="setup_recommended_rules"><?php  esc_html_e( 'Apply settings', 'arvancloud-cdn' ) ?></button>
    3240                    </div>
     41                </article>
     42                <article class="cdn-option-new ar-card action-card">
     43                    <div class="action-card__content">
     44                        <h2 class="action-card__title"><?php  esc_html_e( 'DDoS Protection', 'arvancloud-cdn' ) ?></h2>
     45                        <p class="action-card__desc"><?php  esc_html_e( 'All ArvanCloud servers automatically prevent DDoS attacks in the network layer. This work is done with the help and combination of several different methods to prevent the arrival of manipulated and multiple packets from the same source.You can also prevent higher layer attacks by activating this service.', 'arvancloud-cdn' ) ?>
     46
     47                        </p>
     48                        <p class="desc-with-dot"><?php  esc_html_e( 'To apply more advanced settings, you can refer to Arvan cloud\'s panel.', 'arvancloud-cdn' ) ?></p>
     49                    </div>
     50                    <div class="action-card__action">
     51                        <div class="custom-switch custom-switch--large mb-16">
     52                            <input class="custom-switch-input" type="checkbox" id="ddos_protection_mode" name="ddos_protection_mode" <?php echo $ddos_status ? 'checked' : ''; ?>>
     53                            <label class="custom-switch-label" for="ddos_protection_mode">
     54                                <span class="active-label"><?php  esc_html_e( 'Enable', 'arvancloud-cdn' ) ?></span>
     55                                <span class="inactive-label"><?php  esc_html_e( 'Disable', 'arvancloud-cdn' ) ?></span>
     56                            </label>
     57                        </div>
     58                        <a class="btn btn--outline-primary btn--medium" href="https://panel.arvancloud.ir/cdn/<?php echo \WP_Arvan\Helper::get_site_domain() ?>/ddos" target="_blank"><?php  esc_html_e( 'Panel', 'arvancloud-cdn' ) ?></a>
     59                    </div>
     60                </article>
     61                <article class="cdn-option-new ar-card action-card">
     62                    <div class="action-card__content">
     63                        <h2 class="action-card__title"><?php  esc_html_e( 'Caching Settings', 'arvancloud-cdn' ) ?></h2>
     64                        <p class="action-card__desc">
     65                            <?php  esc_html_e( 'By selecting the cache level, you can determine what content will be cached from your website in Arvan cloud', 'arvancloud-cdn' ) ?>
     66                        </p>
     67                    </div>
     68                    <div class="action-card__action">
     69                        <div class="custom-switch custom-switch--large">
     70                            <input class="custom-switch-input" type="checkbox" id="cache_status" name="cache_status" <?php echo $cache_status == 'off' ? '' : 'checked'; ?>>
     71                            <label class="custom-switch-label" for="cache_status">
     72                                <span class="active-label"><?php  esc_html_e( 'Enable', 'arvancloud-cdn' ) ?></span>
     73                                <span class="inactive-label"><?php  esc_html_e( 'Disable', 'arvancloud-cdn' ) ?></span>
     74                            </label>
     75                        </div>
     76                    </div>
     77                </article>
     78                <article class="ar-card action-card">
     79                    <div class="action-card__content">
     80                        <h2 class="action-card__title"><?php esc_html_e('Purge Cache', 'arvancloud-cdn'); ?></h2>
     81                        <p class="action-card__desc">
     82                            <?php esc_html_e('Purging cached files, forces ArvanCloud to fetch a fresh version of those files from your origin server.', 'arvancloud-cdn'); ?>
     83                        </p>
     84                        <p class="desc-with-dot">
     85                            <?php esc_html_e('Clean everything', 'arvancloud-cdn') ?>: <span class="font-weight-medium"><?php esc_html_e('No content will be cached on Arvan\'s side. Requests are sent directly to the main servers.', 'arvancloud-cdn') ?></span>
     86                        </p>
     87                        <p class="desc-with-dot"><span class="font-weight-medium"><?php echo esc_html_e('Clear everything', 'arvancloud-cdn'); ?>: </span>
     88                            <?php esc_html_e('All cached content on ArvanCloud\'s edge servers will be deleted. Requests are sent directly to the main servers', 'arvancloud-cdn'); ?>
     89                        </p>
     90                    </div>
     91                    <div class="action-card__action">
     92                        <button class="btn btn--outline-red btn--medium ar-modal-toggle" data-modal="modal-one" onclick="return false;"><?php echo esc_html_e('Clean Everything', 'arvancloud-cdn'); ?></button>
     93                    </div>
     94                </article>
     95
     96                <div class="ar-modal" id="modal-one">
     97                    <header class="ar-modal__header">
     98                        <div class="ar-modal__title"><?php esc_html_e('Purge all?', 'arvancloud-cdn') ?></div>
     99                        <button class="ar-modal__close" data-action="close">
     100                            <svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
     101                                <path d="M16 8L8 16M16 16L8 8" stroke="#647E9A" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
     102                            </svg>
     103                        </button>
     104                    </header>
     105                    <div class="ar-modal__content">
     106                        <div class="ar-mddal__icon">
     107                            <svg width="32" height="28" viewBox="0 0 32 28" fill="none" xmlns="http://www.w3.org/2000/svg">
     108                                <path d="M13.7195 3.14718L2.42621 22.0005C2.19336 22.4037 2.07016 22.8609 2.06886 23.3265C2.06755 23.7922 2.18819 24.25 2.41877 24.6546C2.64936 25.0591 2.98184 25.3962 3.38315 25.6323C3.78446 25.8685 4.24061 25.9954 4.70621 26.0005H27.2929C27.7585 25.9954 28.2146 25.8685 28.6159 25.6323C29.0172 25.3962 29.3497 25.0591 29.5803 24.6546C29.8109 24.25 29.9315 23.7922 29.9302 23.3265C29.9289 22.8609 29.8057 22.4037 29.5729 22.0005L18.2795 3.14718C18.0418 2.75533 17.7072 2.43134 17.3078 2.2065C16.9084 1.98165 16.4579 1.86353 15.9995 1.86353C15.5412 1.86353 15.0906 1.98165 14.6913 2.2065C14.2919 2.43134 13.9572 2.75533 13.7195 3.14718V3.14718Z" stroke="#EE5353" stroke-width="3" stroke-linecap="round" stroke-linejoin="round"/>
     109                                <path d="M16 10V15.3333" stroke="#EE5353" stroke-width="3" stroke-linecap="round" stroke-linejoin="round"/>
     110                                <path d="M16 20.6667H16.0133" stroke="#EE5353" stroke-width="3" stroke-linecap="round" stroke-linejoin="round"/>
     111                            </svg>
     112                        </div>
     113                        <h2 class="mb-8"><?php esc_html_e('Are You Sure You Want To Purge All Files?', 'arvancloud-cdn') ?></h2>
     114                        <p class="font-12 font-weight-medium m-0 text-align-center">
     115                            <?php esc_html_e('Purging cache may slow down your website temporarily.', 'arvancloud-cdn') ?>
     116                        </p>
     117                    </div>
     118                    <footer class="ar-modal__footer">
     119                        <button class="btn btn--outline-gray btn--medium me-16" data-action="close"><?php esc_html_e('Cancel', 'arvancloud-cdn'); ?></button>
     120                        <a class="btn btn--red btn--medium" href="<?php echo esc_url('admin.php?page=' . ACCDN_SLUG . '&purge_arvan_cache=1' . '&_wpnonce=' . esc_attr( $nonce_purge_cache )); ?>"><?php esc_html_e('Delete', 'arvancloud-cdn'); ?></a>
     121
     122                    </footer>
    33123                </div>
    34                 <div class="cdn-option">
    35                     <div class="input-container">
    36                         <input type="checkbox" id="setup_recommended_rules" name="setup_recommended_rules" <?php echo $setup_recommended_rules ? 'checked' : ''; ?>/>
    37                         <label for="setup_recommended_rules">Toggle</label>
     124                <article class="cdn-option-new ar-card action-card">
     125                    <div class="action-card__content">
     126                        <h2 class="action-card__title"><?php esc_html_e('Development Mode', 'arvancloud-cdn'); ?></h2>
     127                        <p class="action-card__desc ">
     128                            <?php esc_html_e('Activating Development Mode will temporarily stop caching so that developers can work easier. Web optimization will also be disabled.', 'arvancloud-cdn'); ?>
     129                        </p>
    38130                    </div>
    39                     <div class="detail-container">
    40                         <h3><?php esc_html_e('Add WordPress Recomanded Page Rules', 'arvancloud-cdn'); ?></h3>
    41                         <p><?php esc_html_e('After activating of this feature, The cache in /wp-admin/* and /wp-login/* is ignored.', 'arvancloud-cdn'); ?></p>
     131                    <div class="action-card__action">
     132                        <div class="custom-switch custom-switch--large">
     133                            <input class="custom-switch-input" type="checkbox" id="cache_developer_mode" name="cache_developer_mode" <?php echo $development_mode ? 'checked' : ''; ?>>
     134                            <label class="custom-switch-label" for="cache_developer_mode">
     135                                <span class="active-label"><?php  esc_html_e( 'Enable', 'arvancloud-cdn' ) ?></span>
     136                                <span class="inactive-label"><?php  esc_html_e( 'Disable', 'arvancloud-cdn' ) ?></span>
     137                            </label>
     138                        </div>
    42139                    </div>
    43                 </div>
    44                 <div class="cdn-option">
    45                     <div class="input-container">
    46                         <input type="checkbox" id="cache_consistent_uptime" name="cache_consistent_uptime" <?php echo $cache_consistent_uptime ? 'checked' : ''; ?>/>
    47                         <label for="cache_consistent_uptime">Toggle</label>
     140                </article>
     141                <article class="cdn-option-new ar-card action-card">
     142                    <div class="action-card__content">
     143                        <h2 class="action-card__title"><?php esc_html_e('Always Online', 'arvancloud-cdn'); ?></h2>
     144                        <p class="action-card__desc">
     145                            <?php esc_html_e('After activating of this feature, in case of website or webserver tome out, the last saved version in arvancloud will be shown to the user. Arvancloud can only show the main page or dynamic pages if it has the permission to cache.', 'arvancloud-cdn'); ?>
     146                        </p>
    48147                    </div>
    49                     <div class="detail-container">
    50                         <h3><?php echo esc_html_e('Always Online', 'arvancloud-cdn'); ?></h3>
    51                         <p><?php echo esc_html_e('After activating of this feature, in case of website or webserver time out, the last saved version in arvancloud will be shown to the user. Arvancloud can only show the main page or dynamic pages if it has the permission to cache.', 'arvancloud-cdn'); ?></p>
     148                    <div class="action-card__action">
     149                        <div class="custom-switch custom-switch--large">
     150                            <input class="custom-switch-input" type="checkbox" id="cache_consistent_uptime" name="cache_consistent_uptime" <?php echo $cache_consistent_uptime ? 'checked' : ''; ?>>
     151                            <label class="custom-switch-label" for="cache_consistent_uptime">
     152                                <span class="active-label"><?php  esc_html_e( 'Enable', 'arvancloud-cdn' ) ?></span>
     153                                <span class="inactive-label"><?php  esc_html_e( 'Disable', 'arvancloud-cdn' ) ?></span>
     154                            </label>
     155                        </div>
    52156                    </div>
    53                 </div>
    54                 <div class="cdn-option">
    55                     <div class="input-container">
    56                         <input type="checkbox" id="cache_developer_mode" name="cache_developer_mode" <?php echo $development_mode ? 'checked' : ''; ?>/>
    57                         <label for="cache_developer_mode">Toggle</label>
    58                     </div>
    59                     <div class="detail-container">
    60                         <h3><?php echo esc_html_e('Development Mode', 'arvancloud-cdn'); ?></h3>
    61                         <p><?php echo esc_html_e('Activating Development Mode will temporarily stop caching so that developers can work easier. Web optimization will also be disabled.', 'arvancloud-cdn'); ?></p>
    62                     </div>
    63                 </div>
    64                 <div class="cdn-option">
    65                     <div class="input-container">
    66                         <input type="checkbox" id="automatic_cleaning" name="automatic_cleaning" <?php echo $automatic_cleaning ? 'checked' : ''; ?>/>
    67                         <label for="automatic_cleaning">Toggle</label>
    68                     </div>
    69                     <div class="detail-container">
    70                         <h3><?php echo esc_html_e('Automatic cleaning', 'arvancloud-cdn'); ?></h3>
    71                         <p><?php echo esc_html_e('Automatically clear cache when a post or page or custom post type is edited or created or deleted.', 'arvancloud-cdn'); ?></p>
    72                     </div>
    73                 </div>
     157                </article>
     158
    74159
    75160                <div id="lock-modal"></div>
    76161                <div id="loading-circle"></div>
     162                </div>
    77163            </form>
    78164        </div>
  • arvancloud-cdn/trunk/admin/views/reports/reports.php

    r2761065 r3303568  
    127127                    <div class="report-with-labels">
    128128                        <div class="report">
    129                             <canvas id="<?php echo $report->chart_ID;; ?>"></canvas>
     129                            <canvas id="<?php echo $report->chart_ID; ?>"></canvas>
    130130                        </div>
    131131                        <div class="report-labels">
  • arvancloud-cdn/trunk/admin/views/security/https_settings.php

    r2761065 r3303568  
    11<?php
     2namespace WP_Arvan;
    23use WP_Arvan\Security\HTTPS_Settings;
    34use WP_Arvan\CDN\Domain_Info;
     5use WP_Arvan\API\HTTP\Request_Arvan;
    46
    5 $HTTPS = new HTTPS_Settings(true);
    6 
    7 
     7$domain  = helper::get_site_domain();
     8$HTTPS   = new HTTPS_Settings(true);
    89$is_DNS_Cloud_enabled = Domain_Info::$DNS_Cloud;
    9 
     10$fcolor  = $HTTPS->data['ssl_status']?'green':'red';
     11$balance = Request_Arvan::get("domains/$domain/load-balancers/settings");
     12$rcolor  = $balance['protocol']=='https'?'green':'red';
    1013
    1114$HSTS_duration = [
     
    1922    '24mo'    => sprintf( __('%s Month', 'arvancloud-cdn'), 24),
    2023];
    21 
    2224?>
    2325
    24 
    2526<div class="wrap ar-wrap">
    26     <h1><?php esc_html_e('HTTPS Settings', 'arvancloud-cdn'); ?></h1>
    27     <?php
    28     if ( !$is_DNS_Cloud_enabled )
     27    <?php
     28    if ( !$is_DNS_Cloud_enabled  )
    2929        echo wp_kses_post('<div class="notice notice-error is-dismissible"><p>'. esc_html__( 'HTTP Protocol will only be activated for the records with an enabled cloud icon. ', 'arvancloud-cdn' ) .'</p></div>');
    3030    ?>
    3131    <?php require_once( ACCDN_PLUGIN_ROOT . 'admin/views/components/header.php' ) ?>
    3232    <br>
    33    
     33
    3434    <div class="arvan-wrapper">
    35         <div class="arvan-card">
    36             <h2><?php esc_html_e('HTTPS Settings', 'arvancloud-cdn'); ?></h2>
    3735            <form class="arvancloud-options-form arvancloud-acceleration-options" method="post" action="<?php echo esc_url( admin_url( '/admin.php?page=arvancloud-cdn' )); ?>" data-type="https">
    3836
    39            
    4037
    41                 <div class="cdn-option" id="HTTPS">
    42                     <div class="input-container">
    43                         <input  id="ssl_status" type="checkbox" name="ssl_status" <?php echo $HTTPS->is_HTTPS ? 'checked' : ''; ?>/>
    44                         <label for="ssl_status">Toggle</label>
     38        <div class="arvan-wrapper-card">
     39            <div class="ar-https-visual">
     40                <div>
     41                    <img class="mb-8" src="<?php echo ACCDN_PLUGIN_ROOT_URL . 'assets/images/browser.png'; ?>" alt="browser">
     42                    <div class="https-visual__text">Browser</div>
     43                </div>
     44                <div class="display-flex">
     45                    <span>
     46                        <img src="<?php echo ACCDN_PLUGIN_ROOT_URL . 'assets/images/direction-'.$fcolor.'.svg'; ?>" alt="">
     47                    </span>
     48                    <span class="https-visual__text mx-40 color-<?php echo $fcolor; ?>-500 font-14"><?php echo $HTTPS->data['ssl_status']?'HTTPS':'HTTP'; ?></span>
     49                    <span>
     50                        <img src="<?php echo ACCDN_PLUGIN_ROOT_URL . 'assets/images/direction-'.$fcolor.'.svg'; ?>" alt="">
     51                    </span>
     52                </div>
     53                <div>
     54                    <img class="mb-8" src="<?php echo ACCDN_PLUGIN_ROOT_URL . 'assets/images/arvan-logo.svg'; ?>" alt="arvan logo">
     55                    <div class="https-visual__text font-weight-bold color-green-500">ArvanCloud</div>
     56                </div>
     57                <div class="display-flex">
     58                    <span>
     59                        <img src="<?php echo ACCDN_PLUGIN_ROOT_URL . 'assets/images/direction-'.$rcolor.'.svg'; ?>" alt="">
     60                    </span>
     61                    <span class="https-visual__text mx-40 color-green-500 font-14"><?php echo strtoupper($balance['protocol']) ; ?></span>
     62                    <span>
     63                        <img src="<?php echo ACCDN_PLUGIN_ROOT_URL . 'assets/images/direction-'.$rcolor.'.svg'; ?>" alt="">
     64                    </span>
     65                </div>
     66                <div>
     67                    <img class="mb-8" src="<?php echo ACCDN_PLUGIN_ROOT_URL . 'assets/images/server.png'; ?>" alt="">
     68                    <div class="https-visual__text">Servers</div>
     69                </div>
     70            </div>
     71        </div>
     72
     73        <div class="arvan-wrapper-card">
     74            <div class="ar-https">
     75                <div class="custom-switch custom-switch--large mb-8 cdn-option-new">
     76                    <input class="custom-switch-input cdn-option" type="checkbox" id="HTTPS_Rewrite" name="ssl_status" <?php echo $HTTPS->is_HTTPS ? 'checked="checked"' : ''; ?>>
     77                    <label class="custom-switch-label" for="HTTPS_Rewrite">
     78                        <h1 class="m-0"><?php esc_html_e('Activate HTTPS', 'arvancloud-cdn') ?></h1>
     79                    </label>
     80                </div>
     81                <p class="mb-24 font-14 font-weight-medium"><?php esc_html_e('SSL/TLS secure protocol will be activated for your domain To enable HTTPS on the domain, you need to replace your name servers with ArvanCloud NSs and enable the cloud icon for the domain.', 'arvancloud-cdn') ?></p>
     82                <article class="ar-card p-24">
     83                    <header class="display-flex align-items-start mb-24">
     84                        <div class="me-16 flex-grow-1">
     85                            <h2 class="mb-8"><?php esc_html_e('Certificates', 'arvancloud-cdn') ?></h2>
     86                            <p class="font-14 font-weight-medium m-0"><?php esc_html_e('To activate HTTPS, you need to have an active certificate.', 'arvancloud-cdn') ?> </p>
     87                        </div>
     88                        <a class="btn btn--outline-primary btn--medium certificate-button" href="https://panel.arvancloud.ir/cdn/<?php echo Helper::get_site_domain(); ?>/https" target="_blank"><?php esc_html_e('Private Certificate', 'arvancloud-cdn') ?></a>
     89                    </header>
     90                    <div class="certificate-table">
     91                        <div class="certificate-table__row header-row">
     92                            <div class="certificate-table__col type-col"><?php esc_html_e('Type', 'arvancloud-cdn') ?></div>
     93                            <div class="certificate-table__col domain-col"><?php esc_html_e('Subdomains', 'arvancloud-cdn') ?></div>
     94                            <div class="certificate-table__col status-col"><?php esc_html_e('Status', 'arvancloud-cdn') ?></span></div>
     95                            <div class="certificate-table__col duration-col"><?php esc_html_e('Validity Duration', 'arvancloud-cdn') ?> </div>
     96                        </div>
     97                        <?php
     98                        if(!empty($HTTPS->data['certificates'])){
     99                            foreach($HTTPS->data['certificates'] as $cert){
     100
     101                                $date = strtotime(substr($cert['expiry_date'],0,10))-time();
     102                                $days = floor($date / 86400);
     103                        ?>
     104                        <div class="ar-card ar-accordion certificate-accordion">
     105                            <div class="certificate-table__row certificate-row">
     106                                    <div class="certificate-table__col type-col">
     107                                        <div class="custom-checkbox">
     108                                        <input class="custom-checkbox-input" <?php echo $cert['active']?'checked="checked"':''; ?> type="checkbox" id="custom-checkbox-18">
     109                                        <label class="custom-checkbox-label" for="custom-checkbox-18"><?php esc_html_e('ArvanCloud Certificate', 'arvancloud-cdn') ?></label>
     110                                    </div>
     111                                </div>
     112                                <div class="certificate-table__col domain-col"><?php echo implode(', ',$cert['domain_names']); ?></div>
     113                                <div class="certificate-table__col status-col"><span class="ar-status ar-status--success"><?php echo $cert['active']?__('Valid', 'arvancloud-cdn'):__('Invalid', 'arvancloud-cdn'); ?></span></div>
     114                                <div class="certificate-table__col duration-col"><?php echo $days; ?> <?php esc_html_e('day', 'arvancloud-cdn') ?></div>
     115                                <div class="certificate-table__arrow ar-accordion__toggle"></div>
     116                            </div>
     117                            <div class="ar-accordion__content certificate-accordion__content">
     118                                <div class="certificate-accordion__content-box">
     119                                    <p class="mb-8 font-14 color-gray-900">
     120                                        <span class="font-weight-bold me-4"><?php esc_html_e('Issued by:', 'arvancloud-cdn') ?> </span>
     121                                        <span><?php echo $cert['issuer']; ?></span>
     122                                    </p>
     123                                    <p class="m-0 font-14 color-gray-900">
     124                                        <span class="font-weight-bold me-4"><?php esc_html_e('Valid until date:', 'arvancloud-cdn') ?> </span>
     125                                        <span><bdi><?php echo str_replace(['T','Z'],' ',$cert['expiry_date']); ?></bdi></span>
     126                                    </p>
     127                                </div>
     128                            </div>
     129                        </div>
     130                        <?php
     131                            }
     132                        }
     133                        ?>
    45134                    </div>
    46                     <div class="detail-container">
    47                         <h3><?php esc_html_e('Activate HTTPS', 'arvancloud-cdn'); ?></h3>
    48                         <p><?php _e('SSL/TLS secure protocol will be activated for your domain <br> <strong>To enable HTTPS on the domain, you need to replace your name servers with ArvanCloud NSs and enable the cloud icon for the domain.</strong>', 'arvancloud-cdn'); ?></p>
    49                     </div>
    50                 </div>
     135                </article>
     136            </div>
     137        </div>
    51138
    52 
    53 
    54                 <div class="cdn-option <?php echo !$HTTPS->is_HTTPS ? 'disabled' : ''; ?>" id="HTTPS_Default">
    55                     <div class="input-container">
    56                         <input  id="https_redirect" type="checkbox" name="https_redirect" <?php echo $HTTPS->is_HTTPS_Default ? 'checked' : ''; ?>/>
    57                         <label for="https_redirect">Toggle</label>
    58                     </div>
    59                     <div class="detail-container">
    60                         <h3><?php esc_html_e('Set HTTPS as Default', 'arvancloud-cdn'); ?></h3>
    61                         <p><?php esc_html_e('All HTTP requests will automatically be redirected to HTTPS.', 'arvancloud-cdn'); ?></p>
    62                     </div>
    63                 </div>
    64 
    65 
    66                 <div class="cdn-option <?php echo !$HTTPS->is_HTTPS ? 'disabled' : ''; ?>" id="HTTPS_Rewrite">
    67                     <div class="input-container">
    68                         <input  id="replace_http" type="checkbox" name="replace_http" <?php echo $HTTPS->is_HTTPS_Rewrite ? 'checked' : ''; ?>/>
    69                         <label for="replace_http">Toggle</label>
    70                     </div>
    71                     <div class="detail-container">
    72                         <h3><?php esc_html_e('Rewrite Files Based on HTTPS', 'arvancloud-cdn'); ?></h3>
    73                         <p><?php esc_html_e('Resource files and website links will be converted to HTTPS. This will prevent mixed content error.', 'arvancloud-cdn'); ?></p>
    74                     </div>
    75                 </div>
    76 
    77 
    78                 <div class="cdn-option <?php echo !$HTTPS->is_HTTPS_Default ? 'disabled' : ''; ?>" id="HSTS">
    79                     <div class="input-container">
    80                         <a class="edit-settings"><?php esc_html_e('Edit Settings', 'arvancloud-cdn'); ?></a>
    81                     </div>
    82                     <div class="detail-container">
    83                         <h3><?php esc_html_e('HSTS Protocol', 'arvancloud-cdn'); ?></h3>
    84                         <p><?php esc_html_e('HSTS protocol improves the security of request transmission and prevents MITM attacks.', 'arvancloud-cdn'); ?></p>
    85                     </div>
    86                 </div>
    87 
    88 
    89                 <div id="lock-modal"></div>
    90                 <div id="loading-circle"></div>
    91139            </form>
    92         </div>
    93140    </div>
    94141
    95     <div id="side-modal" class="side-modal-HSTS">
    96         <div class="side-modal-wrapper">
    97             <div class="side-modal-heading">
    98                 <h3><?php esc_html_e('HSTS Settings', 'arvancloud-cdn'); ?></h3>
    99                 <button class="close">
    100                     <svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg" class="v1:ar-icon v1:ar-icon-times"><g stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"><path d="M12 4L4 12"></path> <path d="M4 4L12 12"></path></g></svg>
    101                 </button>
    102             </div>
    103             <form>
    104                 <div class="ar-bg-blue-gray">
    105                     <p><?php esc_html_e('HSTS or Security Transport Strict Http will improve the security of requests\' transmission from HTTP to HTTPS and prevents MITM attacks.', 'arvancloud-cdn'); ?></p>
    106                     <p><?php esc_html_e('Attention: Visitors\' browsers will cache these settings. Please consider purging by cache expiration when applying HSTS settings.', 'arvancloud-cdn'); ?></p>
    107                     <hr>
    108                     <div class="ar-simple-checkbox ar-agreement">
    109                         <input id="ar-https-agreement" type="checkbox" role="checkbox" value="I Understand and Accept the Rules.">
    110                         <label for="ar-https-agreement" ><?php _e('I Understand and Accept the Rules.', 'arvancloud-cdn') ?></label>
    111                     </div>
    112                 </div>
    113                 <br>
    114                 <div class="ar-checkbox-wrapper disabled">
    115                     <div class="ar-checkbox">
    116                         <input id="hsts_status" type="checkbox" name="hsts_status" <?php echo $HTTPS->is_HSTS ? 'checked' : ''; ?>>
    117                         <label for="hsts_status">Toggle</label>
    118                     </div>
    119                     <span class="ar-label"><?php _e('Enable HSTS Protocol', 'arvancloud-cdn') ?></span>
    120                 </div>
    121                
    122                 <div class="ar-dropdown-wrapper disabled">
    123                     <span class="ar-label"><?php _e('What is the duration in which the browser is required to show the HTTPS version of the website?', 'arvancloud-cdn') ?></span>
    124                     <select class="ar-dropdown" name="hsts_max_age">
    125                         <?php
    126                         foreach ($HSTS_duration as $key => $title) {
    127                             $selected = $HTTPS->hsts_max_age == $key ? 'selected' : '';
    128                             echo '<option value="'. $key .'"'. $selected .'>' . $title .'</option>';
    129                         }
    130                         ?>
    131                     </select>
    132                 </div>
    133 
    134                 <br>
    135                 <hr>
    136                 <br>
    137                 <br>
    138 
    139                 <div class="ar-checkbox-wrapper disabled">
    140                     <div class="ar-checkbox">
    141                         <input id="hsts_subdomain" type="checkbox" name="hsts_subdomain" <?php echo $HTTPS->is_HSTS_subdomain ? 'checked' : ''; ?>>
    142                         <label for="hsts_subdomain">Toggle</label>
    143                     </div>
    144                     <span class="ar-label"><?php _e('Use HSTS for all Subdomains', 'arvancloud-cdn') ?></span>
    145                 </div>
    146                 <div class="ar-checkbox-wrapper disabled">
    147                     <div class="ar-checkbox">
    148                         <input id="hsts_preload" type="checkbox" name="hsts_preload" <?php echo $HTTPS->is_HSTS_preload ? 'checked' : ''; ?>>
    149                         <label for="hsts_preload">Toggle</label>
    150                     </div>
    151                     <span class="ar-label"><?php _e('Prepare the Domain for the Search Engines', 'arvancloud-cdn') ?></span>
    152                 </div>
    153 
    154                 <div class="ar-submit-bottons-modal">
    155                     <button class="ar-cancel-modal"><?php esc_html_e('Cancel', 'arvancloud-cdn'); ?></button>
    156                     <button class="ar-submit-modal disabled"><?php esc_html_e('Save', 'arvancloud-cdn'); ?></button>
    157                 </div>
    158             </form>
    159         </div>
    160     </div>
    161    
    162  
    163142    <br>
    164143    <?php require_once( ACCDN_PLUGIN_ROOT . 'admin/views/components/footer.php' ); ?>
  • arvancloud-cdn/trunk/admin/views/settings-display.php

    r3243413 r3303568  
    11<?php
    2 
    3 $credentials_status = get_option( 'arvan-cloud-cdn-status' );
     2$credentials_status = get_option('arvan-cloud-cdn-status');
    43?>
    5 
    6 
    74<div class="wrap ar-wrap">
    8     <h1><?php echo esc_html_e( 'CDN General Settings', 'arvancloud-cdn' ) ?></h1>
    9     <?php require_once( ACCDN_PLUGIN_ROOT . 'admin/views/components/header.php' ) ?>
    10     <h3><?php echo esc_html_e( 'Configure CDN API', 'arvancloud-cdn' ) ?></h3>
    11     <form class="arvancloud-cdn-config-form" method="post" action="<?php echo esc_url(admin_url( '/admin.php?page=arvancloud-cdn' )); ?>">
    12         <section class="ar-cdn-container">
    13             <div class="ar-cdn-box">
    14                 <label for="accdn-api-key">API Key</label>
    15                 <input type="text" name="accdn-api-key" value="" autocomplete="off"  placeholder="<?php echo !empty($credentials_status) ? esc_html_e( "-- not shown --", 'arvancloud-cdn' ) : 'apikey 8e19****-****-****-****-****2e67dfab' ?> ">
     5    <form class="arvancloud-cdn-config-form" method="post"
     6          action="<?php echo esc_url(admin_url('/admin.php?page=arvancloud-cdn')); ?>">
     7        <div class="arvan-card">
     8            <div class="ar-auth">
     9                <?php require_once(ACCDN_PLUGIN_ROOT . 'admin/views/components/header.php') ?>
     10                <article class="ar-card p-24">
     11                    <h2 class="mb-8"><?php esc_html_e('CDN API Key', 'arvancloud-cdn') ?></h2>
     12                    <p class="font-14 font-weight-medium mb-8"><?php
     13                        esc_html_e('To get the access key, it is necessary to create a new access key by referring to the settings and adding a new machine users and enter it in the section below.', 'arvancloud-cdn')
     14                    ?></p>
     15                    <a class="link-with-icon icon-end mb-16" href="" target="_blank"><?php esc_html_e('Login to the panel', 'arvancloud-cdn') ?></a>
     16                    <p class="mb-8 color-gray-900 font-weight-medium"><?php esc_html_e('Access key', 'arvancloud-cdn') ?></p>
     17                    <div class="auth-field-group">
     18                        <input class="auth-input form-text-input dir-ltr" value="" autocomplete="off"
     19                               name="accdn-api-key" type="text"
     20                               placeholder="<?php echo !empty($credentials_status) ? esc_html_e("-- not shown --", 'arvancloud-cdn') : 'Apikey ********-****-****-****-************' ?>">
     21                        <button class="btn btn--primary btn--medium ms-16" name="config_arvancloud_api_key"
     22                                value="1"><?php echo esc_html_e("Save", 'arvancloud-cdn') ?></button>
     23                    </div>
     24                </article>
    1625            </div>
    17             <div class="ar-cdn-box">
    18                 <a class="get-api-key" href="https://panel.arvancloud.ir/profile/machine-user/" target="_blank" rel="noopener noreferrer"><?php echo esc_html_e('Get API Key', 'arvancloud-cdn'); ?></a>
    19             </div>
    20             <p><button type="submit" class="button button-primary" name="config_arvancloud_api_key" value="1"><?php echo esc_html_e( "Save", 'arvancloud-cdn' ) ?></button></p>
    21         </section>
     26        </div>
    2227    </form>
    2328    <br>
    24 
    2529    <br>
    2630    <br>
    27     <?php require_once( ACCDN_PLUGIN_ROOT . 'admin/views/components/footer.php' ); ?>
     31    <?php require_once(ACCDN_PLUGIN_ROOT . 'admin/views/components/footer.php'); ?>
    2832</div>
  • arvancloud-cdn/trunk/includes/class-setup.php

    r2788597 r3303568  
    66use WP_Arvan\CDN\Purge_Cache;
    77use WP_Arvan\CDN\Acceleration;
    8 use WP_Arvan\CDN\Cache\Caching_Settings;
    98use WP_Arvan\CDN\Cache\Page_Rules;
    109use WP_Arvan\CDN\Auto_Add_Domain;
    11 use WP_Arvan\Security\DDoS_Protection;
    1210use WP_Arvan\Security\HTTPS_Settings;
    13 use WP_Arvan\Security\Firewall;
    1411
    1512/**
     
    126123        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/inc/CDN/class-reports.php';
    127124        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/inc/CDN/class-acceleration.php';
    128         require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/inc/CDN/Cache/class-caching-settings.php';
    129125        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/inc/CDN/Cache/class-page-rules.php';
    130         require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/inc/Security/class-ddos_protection.php';
    131126        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/inc/Security/class-https-settings.php';
    132         require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/inc/Security/class-firewall.php';
    133127
    134128        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/inc/CDN/class-domain-auto-add.php';
     
    167161        $cdn_options    = new CDN_Options();
    168162        $acceleration   = new Acceleration();
    169         $DDoS_Protection= new DDoS_Protection();
    170163        $HTTPS_Settings = new HTTPS_Settings();
    171         $firewall       = new firewall();
    172         $Cache_Settings = new Caching_Settings();
    173164        $Page_Rules     = new Page_Rules();
    174165        $auto_add_domain= new Auto_Add_Domain();
     
    184175        $this->loader->add_action( 'wp_ajax_ar_cdn_options', $cdn_options, 'ajax_saving_options' );
    185176        $this->loader->add_action( 'wp_ajax_ar_acceleration_options', $acceleration, 'ajax_saving_options' );
    186         $this->loader->add_action( 'wp_ajax_ar_cache_status', $Cache_Settings, 'ajax_saving_options' );
    187         $this->loader->add_action( 'init', $Cache_Settings, 'save_expiration_time_options' );
    188         $this->loader->add_action( 'wp_ajax_ar_ddos_protection_options', $DDoS_Protection, 'ajax_saving_options' );
    189177        $this->loader->add_action( 'wp_ajax_ar_https_options', $HTTPS_Settings, 'ajax_saving_options' );
    190         $this->loader->add_action( 'wp_ajax_ar_firewall', $firewall, 'ajax_saving_options' );
    191         $this->loader->add_action( 'wp_ajax_ar_firewall_change_rules_priority', $firewall, 'change_rule_priority' );
    192         $this->loader->add_action( 'wp_ajax_ar_firewall_create_rule', $firewall, 'ajax_add_rules' );
    193         $this->loader->add_action( 'wp_ajax_ar_firewall_delete_rule', $firewall, 'ajax_delete_rules' );
    194         $this->loader->add_action( 'wp_ajax_ar_firewall_get_rule', $firewall, 'ajax_get_rule' );
    195         $this->loader->add_action( 'wp_ajax_ar_firewall_update_rule', $firewall, 'ajax_update_rules' );
     178        //$this->loader->add_action( 'wp_ajax_ar_firewall', $firewall, 'ajax_saving_options' );
     179        //$this->loader->add_action( 'wp_ajax_ar_firewall_change_rules_priority', $firewall, 'change_rule_priority' );
     180        //$this->loader->add_action( 'wp_ajax_ar_firewall_create_rule', $firewall, 'ajax_add_rules' );
     181        //$this->loader->add_action( 'wp_ajax_ar_firewall_delete_rule', $firewall, 'ajax_delete_rules' );
     182        //$this->loader->add_action( 'wp_ajax_ar_firewall_get_rule', $firewall, 'ajax_get_rule' );
     183        //$this->loader->add_action( 'wp_ajax_ar_firewall_update_rule', $firewall, 'ajax_update_rules' );
    196184        $this->loader->add_action( 'init', $purge_cache, 'purge_arvan_cache' );
    197185        $this->loader->add_action( 'save_post', $purge_cache, 'purge_arvan_cache_onsave' );
  • arvancloud-cdn/trunk/wp-arvancloud-cdn.php

    r3256709 r3303568  
    1111 * Plugin URI:        https://www.arvancloud.ir/fa/products/cdn
    1212 * Description:       ArvanCloud CDN service caches your website content. Using this plugin, you will be able to purge and update the cached version, either manually or automatically, so that your users visit the latest version of your website at any time.
    13  * Version:           0.9.18
     13 * Version:           1.0.1
    1414 * Requires PHP:      7.2
    1515 * Author:            Khorshid, ArvanCloud
     
    2727
    2828
    29 define( 'ACCDN_VERSION', '0.9.18' );
     29define( 'ACCDN_VERSION', '1.0.1' );
    3030define( 'ACCDN_NAME', __( 'ArvanCloud CDN', 'arvancloud-cdn' ) );
    3131define( 'ACCDN_SLUG', 'arvancloud-cdn');
Note: See TracChangeset for help on using the changeset viewer.