Plugin Directory

Changeset 1967665


Ignore:
Timestamp:
11/02/2018 10:18:56 AM (7 years ago)
Author:
oseuk
Message:

Update to version 1.2.4

Location:
ose-lets-encrypt
Files:
2 added
10 edited
1 copied

Legend:

Unmodified
Added
Removed
  • ose-lets-encrypt/tags/1.2.4/README.txt

    r1966376 r1967665  
    66Tested up to: 4.9.8
    77Requires PHP: 5.3
    8 Stable tag: 1.2.3
     8Stable tag: 1.2.4
    99License: GNU General Public License v3
    1010License URI: http://www.gnu.org/licenses/gpl-3.0.txt
     
    6565
    6666== Changelog ==
     67= 1.2.4
     68* Change web token generation function to generate token only once
     69* Add automatic renewal of ssl certificates function in cronjob setting section
     70
    6771= 1.2.3
    6872* Change clear all option cache to clear ose-lets-encrypt cache data
  • ose-lets-encrypt/tags/1.2.4/acme.php

    r1966139 r1967665  
    2222        if(file_exists($wp_load)) {
    2323            require( $wp_load);
     24            wp_cache_delete ( 'oseletsencrypt_data', 'options' );
    2425            $options = get_option('oseletsencrypt_data', array());
    2526            if($options['web_token'] == $_GET['token'] && $options['filename'] == $_GET['filename']){
  • ose-lets-encrypt/tags/1.2.4/assets/css/admin.css

    r1958953 r1967665  
    8989    padding: 5px 15px !important;
    9090}
     91
     92#timer{
     93    display: none;
     94}
     95#cronjob-setting{
     96    margin-left: 10px;
     97}
  • ose-lets-encrypt/tags/1.2.4/assets/js/admin.js

    r1965009 r1967665  
    102102                            data = jQuery.parseJSON(response);
    103103                            jQuery('#response-message').text(data.message);
     104                            reloadPage();
    104105                        }
    105106                    } );
     
    108109        });
    109110    }
     111   
     112    function reloadPage() {
     113        jQuery('#timer').show();
     114        var timeleft = 10;
     115        var downloadTimer = setInterval(function(){
     116            timeleft--;
     117            document.getElementById("countdowntimer").textContent = timeleft;
     118            if(timeleft <= 0){
     119                clearInterval(downloadTimer);
     120                window.location.reload();
     121            }
     122        },1000);
     123    }
     124
    110125} );
  • ose-lets-encrypt/tags/1.2.4/ose-letsencrypt.php

    r1966376 r1967665  
    1616 * Plugin URI:        https://www.opensource-excellence.com/
    1717 * Description:       OSE Free SSL is an easy-to-use plugin to create SSL certificates from Let’s Encrypt (https://letsencrypt.org) platform which provides free SSL certificates for everyone to turn on https protocol.
    18  * Version:           1.2.3
     18 * Version:           1.2.4
    1919 * Author:            Open Source Excellence
    2020 * Author URI:        https://www.opensource-excellence.com/
     
    3434if(!defined('OSELETSENCRYPT_PATH'))
    3535    define('OSELETSENCRYPT_PATH', plugin_dir_path( __FILE__ ));
    36 if(!defined('OSELETSENCRYPT_ENDPOINT'))
    37     define('OSELETSENCRYPT_ENDPOINT', 'https://www.1o1wp.com/');
    3836if(!defined('OSELETSENCRYPT_PROTOCOL'))
    3937    define('OSELETSENCRYPT_PROTOCOL', 'https');
     
    7876        add_action('wp_ajax_store_account_data',  array($this,'storeAccountData'));
    7977        add_action('wp_ajax_check_account_data',  array($this,'checkAccountData'));
    80         add_action('wp_ajax_send_ssl_request',  array($this,'sendSslRequest'));
     78        add_action('wp_ajax_send_ssl_request',  array($this,'sendSslRequestAjax'));
    8179        add_action('wp_ajax_create_folders',  array($this,'createFolders'));
    8280        //add_action('wp_ajax_get_terms',  array($this,'getTerms'));
     
    262260            return;
    263261        }
    264         wp_enqueue_style('oseletsencrypt-bootstrap', OSELETSENCRYPT_URL. 'assets/css/bootstrap.min.css');
    265         wp_enqueue_style('oseletsencrypt-milligram', OSELETSENCRYPT_URL. 'assets/css/milligram.css');
    266         wp_enqueue_style('oseletsencrypt-milligram-map', OSELETSENCRYPT_URL. 'assets/css/milligram.css.map');
     262        wp_enqueue_style('oseletsencrypt-bootstrap', OSELETSENCRYPT_URL. 'assets/css/bootstrap.min.css', array(), 1.0);
     263        wp_enqueue_style('oseletsencrypt-milligram', OSELETSENCRYPT_URL. 'assets/css/milligram.css', array(), 1.0);
     264        wp_enqueue_style('oseletsencrypt-milligram-map', OSELETSENCRYPT_URL. 'assets/css/milligram.css.map', array(), 1.0);
    267265        wp_enqueue_style('oseletsencrypt-googleapis', 'https://fonts.googleapis.com/css?family=Roboto:300,300italic,700,700italic');
    268         wp_enqueue_style('oseletsencrypt-normalize', OSELETSENCRYPT_URL. 'assets/css/normalize.css');
    269         wp_enqueue_style('oseletsencrypt-admin', OSELETSENCRYPT_URL. 'assets/css/admin.css');
     266        wp_enqueue_style('oseletsencrypt-normalize', OSELETSENCRYPT_URL. 'assets/css/normalize.css', array(), 1.0);
     267        wp_enqueue_style('oseletsencrypt-admin', OSELETSENCRYPT_URL. 'assets/css/admin.css' ,array(), '1.2.4');
    270268        wp_enqueue_script('oseletsencrypt-bootstrap', OSELETSENCRYPT_URL. 'assets/js/bootstrap.min.js', array(), 1.0);
    271269        wp_enqueue_script('oseletsencrypt-bootbox', OSELETSENCRYPT_URL. 'assets/js/bootbox.min.js', array(), 1.0);
    272         wp_enqueue_script('oseletsencrypt-admin', OSELETSENCRYPT_URL. 'assets/js/admin.js', array(), 1.0);
     270        wp_enqueue_script('oseletsencrypt-admin', OSELETSENCRYPT_URL. 'assets/js/admin.js', array(), '1.2.4');
    273271
    274272        $admin_options = array(
     
    307305        ?>
    308306
    309         <div class="wrap">
     307        <hr class="wrap">
    310308            <form id="oseletsencrypt-account-form" class="">
    311309                <!--
     
    373371                                <div id="response-message" class="success-message">
    374372                                </div>
    375 
     373                                <div id="timer"><?php echo __( 'This Page will be reloaded in', 'ose-lets-encrypt' ); ?> <span id="countdowntimer">10 </span> <?php echo __( 'seconds', 'ose-lets-encrypt' ); ?></div>
    376374                                <button class="button" id="oseletsencrypt-account-save" type="submit" disabled="true">
    377375                                    <?php echo __( 'Save Configuration', 'ose-lets-encrypt' ); ?>
     
    389387                        </div>
    390388                    </fieldset>
     389                    <hr>
     390                    <div id="cronjob-setting">
     391                        <?php echo __( 'Automatic SSL certificates renewal Cron Job Example', 'ose-lets-encrypt' ); ?>:
     392                        </br>
     393                        <?php
     394                        if(isset($data['web_token']) && !empty($data['web_token'])) {
     395                            $min = date("i");
     396                            $hour = date("H");
     397                            $day = date("d");
     398                            $cron = $min . "  " . $hour . "  " . $day . "  */2  *";
     399                            echo $cron . " /usr/bin/curl --silent " . $this->getCronJobUrl(). "&>/dev/null";
     400                        }
     401                        ?>
     402                    </div>
    391403                </div>
    392404            </form>
     
    415427            </div>
    416428
    417         </div>
     429
    418430        <?php
    419431    }
    420432
    421     public function sendSslRequest(){
     433    public function sendSslRequestAjax(){
    422434        if (wp_verify_nonce($_POST['security'], $this->_nonce) === false)
    423435            die(__( 'Invalid Request! Reload your page please.', 'ose-lets-encrypt' ));
    424 
     436        return $this->sendSslRequest();
     437    }
     438    public function sendSslRequest(){
    425439        $data = $this->getData();
    426440        $data = $this->sanitizeData($data);
     
    452466    }
    453467    protected function generateToken($length = 32, $chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz1234567890') {
     468        $token = $this->getWebToken();
     469        if(!empty($token)){
     470            return $token;
     471        }
    454472        $chars_length = (strlen($chars) - 1);
    455473        $string = $chars{rand(0, $chars_length)};
     
    574592        return $result;
    575593    }
     594    protected function getCronJobUrl(){
     595        $token = $this->getWebToken();
     596        return str_replace("http://","https://",OSELETSENCRYPT_URL.'cron.php?web_token='.$token);
     597    }
     598    protected function getWebToken(){
     599        $data = $this->getData();
     600        if(isset($data['web_token']) && !empty($data['web_token'])){
     601            return $data['web_token'];
     602        }
     603        return false;
     604    }
    576605}
    577606
  • ose-lets-encrypt/trunk/README.txt

    r1966376 r1967665  
    66Tested up to: 4.9.8
    77Requires PHP: 5.3
    8 Stable tag: 1.2.3
     8Stable tag: 1.2.4
    99License: GNU General Public License v3
    1010License URI: http://www.gnu.org/licenses/gpl-3.0.txt
     
    6565
    6666== Changelog ==
     67= 1.2.4
     68* Change web token generation function to generate token only once
     69* Add automatic renewal of ssl certificates function in cronjob setting section
     70
    6771= 1.2.3
    6872* Change clear all option cache to clear ose-lets-encrypt cache data
  • ose-lets-encrypt/trunk/acme.php

    r1966139 r1967665  
    2222        if(file_exists($wp_load)) {
    2323            require( $wp_load);
     24            wp_cache_delete ( 'oseletsencrypt_data', 'options' );
    2425            $options = get_option('oseletsencrypt_data', array());
    2526            if($options['web_token'] == $_GET['token'] && $options['filename'] == $_GET['filename']){
  • ose-lets-encrypt/trunk/assets/css/admin.css

    r1958953 r1967665  
    8989    padding: 5px 15px !important;
    9090}
     91
     92#timer{
     93    display: none;
     94}
     95#cronjob-setting{
     96    margin-left: 10px;
     97}
  • ose-lets-encrypt/trunk/assets/js/admin.js

    r1965009 r1967665  
    102102                            data = jQuery.parseJSON(response);
    103103                            jQuery('#response-message').text(data.message);
     104                            reloadPage();
    104105                        }
    105106                    } );
     
    108109        });
    109110    }
     111   
     112    function reloadPage() {
     113        jQuery('#timer').show();
     114        var timeleft = 10;
     115        var downloadTimer = setInterval(function(){
     116            timeleft--;
     117            document.getElementById("countdowntimer").textContent = timeleft;
     118            if(timeleft <= 0){
     119                clearInterval(downloadTimer);
     120                window.location.reload();
     121            }
     122        },1000);
     123    }
     124
    110125} );
  • ose-lets-encrypt/trunk/ose-letsencrypt.php

    r1966376 r1967665  
    1616 * Plugin URI:        https://www.opensource-excellence.com/
    1717 * Description:       OSE Free SSL is an easy-to-use plugin to create SSL certificates from Let’s Encrypt (https://letsencrypt.org) platform which provides free SSL certificates for everyone to turn on https protocol.
    18  * Version:           1.2.3
     18 * Version:           1.2.4
    1919 * Author:            Open Source Excellence
    2020 * Author URI:        https://www.opensource-excellence.com/
     
    3434if(!defined('OSELETSENCRYPT_PATH'))
    3535    define('OSELETSENCRYPT_PATH', plugin_dir_path( __FILE__ ));
    36 if(!defined('OSELETSENCRYPT_ENDPOINT'))
    37     define('OSELETSENCRYPT_ENDPOINT', 'https://www.1o1wp.com/');
    3836if(!defined('OSELETSENCRYPT_PROTOCOL'))
    3937    define('OSELETSENCRYPT_PROTOCOL', 'https');
     
    7876        add_action('wp_ajax_store_account_data',  array($this,'storeAccountData'));
    7977        add_action('wp_ajax_check_account_data',  array($this,'checkAccountData'));
    80         add_action('wp_ajax_send_ssl_request',  array($this,'sendSslRequest'));
     78        add_action('wp_ajax_send_ssl_request',  array($this,'sendSslRequestAjax'));
    8179        add_action('wp_ajax_create_folders',  array($this,'createFolders'));
    8280        //add_action('wp_ajax_get_terms',  array($this,'getTerms'));
     
    262260            return;
    263261        }
    264         wp_enqueue_style('oseletsencrypt-bootstrap', OSELETSENCRYPT_URL. 'assets/css/bootstrap.min.css');
    265         wp_enqueue_style('oseletsencrypt-milligram', OSELETSENCRYPT_URL. 'assets/css/milligram.css');
    266         wp_enqueue_style('oseletsencrypt-milligram-map', OSELETSENCRYPT_URL. 'assets/css/milligram.css.map');
     262        wp_enqueue_style('oseletsencrypt-bootstrap', OSELETSENCRYPT_URL. 'assets/css/bootstrap.min.css', array(), 1.0);
     263        wp_enqueue_style('oseletsencrypt-milligram', OSELETSENCRYPT_URL. 'assets/css/milligram.css', array(), 1.0);
     264        wp_enqueue_style('oseletsencrypt-milligram-map', OSELETSENCRYPT_URL. 'assets/css/milligram.css.map', array(), 1.0);
    267265        wp_enqueue_style('oseletsencrypt-googleapis', 'https://fonts.googleapis.com/css?family=Roboto:300,300italic,700,700italic');
    268         wp_enqueue_style('oseletsencrypt-normalize', OSELETSENCRYPT_URL. 'assets/css/normalize.css');
    269         wp_enqueue_style('oseletsencrypt-admin', OSELETSENCRYPT_URL. 'assets/css/admin.css');
     266        wp_enqueue_style('oseletsencrypt-normalize', OSELETSENCRYPT_URL. 'assets/css/normalize.css', array(), 1.0);
     267        wp_enqueue_style('oseletsencrypt-admin', OSELETSENCRYPT_URL. 'assets/css/admin.css' ,array(), '1.2.4');
    270268        wp_enqueue_script('oseletsencrypt-bootstrap', OSELETSENCRYPT_URL. 'assets/js/bootstrap.min.js', array(), 1.0);
    271269        wp_enqueue_script('oseletsencrypt-bootbox', OSELETSENCRYPT_URL. 'assets/js/bootbox.min.js', array(), 1.0);
    272         wp_enqueue_script('oseletsencrypt-admin', OSELETSENCRYPT_URL. 'assets/js/admin.js', array(), 1.0);
     270        wp_enqueue_script('oseletsencrypt-admin', OSELETSENCRYPT_URL. 'assets/js/admin.js', array(), '1.2.4');
    273271
    274272        $admin_options = array(
     
    307305        ?>
    308306
    309         <div class="wrap">
     307        <hr class="wrap">
    310308            <form id="oseletsencrypt-account-form" class="">
    311309                <!--
     
    373371                                <div id="response-message" class="success-message">
    374372                                </div>
    375 
     373                                <div id="timer"><?php echo __( 'This Page will be reloaded in', 'ose-lets-encrypt' ); ?> <span id="countdowntimer">10 </span> <?php echo __( 'seconds', 'ose-lets-encrypt' ); ?></div>
    376374                                <button class="button" id="oseletsencrypt-account-save" type="submit" disabled="true">
    377375                                    <?php echo __( 'Save Configuration', 'ose-lets-encrypt' ); ?>
     
    389387                        </div>
    390388                    </fieldset>
     389                    <hr>
     390                    <div id="cronjob-setting">
     391                        <?php echo __( 'Automatic SSL certificates renewal Cron Job Example', 'ose-lets-encrypt' ); ?>:
     392                        </br>
     393                        <?php
     394                        if(isset($data['web_token']) && !empty($data['web_token'])) {
     395                            $min = date("i");
     396                            $hour = date("H");
     397                            $day = date("d");
     398                            $cron = $min . "  " . $hour . "  " . $day . "  */2  *";
     399                            echo $cron . " /usr/bin/curl --silent " . $this->getCronJobUrl(). "&>/dev/null";
     400                        }
     401                        ?>
     402                    </div>
    391403                </div>
    392404            </form>
     
    415427            </div>
    416428
    417         </div>
     429
    418430        <?php
    419431    }
    420432
    421     public function sendSslRequest(){
     433    public function sendSslRequestAjax(){
    422434        if (wp_verify_nonce($_POST['security'], $this->_nonce) === false)
    423435            die(__( 'Invalid Request! Reload your page please.', 'ose-lets-encrypt' ));
    424 
     436        return $this->sendSslRequest();
     437    }
     438    public function sendSslRequest(){
    425439        $data = $this->getData();
    426440        $data = $this->sanitizeData($data);
     
    452466    }
    453467    protected function generateToken($length = 32, $chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz1234567890') {
     468        $token = $this->getWebToken();
     469        if(!empty($token)){
     470            return $token;
     471        }
    454472        $chars_length = (strlen($chars) - 1);
    455473        $string = $chars{rand(0, $chars_length)};
     
    574592        return $result;
    575593    }
     594    protected function getCronJobUrl(){
     595        $token = $this->getWebToken();
     596        return str_replace("http://","https://",OSELETSENCRYPT_URL.'cron.php?web_token='.$token);
     597    }
     598    protected function getWebToken(){
     599        $data = $this->getData();
     600        if(isset($data['web_token']) && !empty($data['web_token'])){
     601            return $data['web_token'];
     602        }
     603        return false;
     604    }
    576605}
    577606
Note: See TracChangeset for help on using the changeset viewer.