Plugin Directory

Changeset 3066915 for wp-letsencrypt-ssl


Ignore:
Timestamp:
04/08/2024 12:19:29 PM (13 months ago)
Author:
gowebsmarty
Message:

v7.1.0 release

Location:
wp-letsencrypt-ssl
Files:
293 added
9 edited

Legend:

Unmodified
Added
Removed
  • wp-letsencrypt-ssl/trunk/admin/le_admin.php

    r3063695 r3066915  
    505505    public function wple_rateus()
    506506    {
    507         $cert = ABSPATH . 'keys/certificate.crt';
     507        $cert = WPLE_Trait::wple_cert_directory() . 'certificate.crt';
    508508       
    509509        if ( file_exists( $cert ) ) {
     
    736736          <li>';
    737737        WPLE_Trait::wple_copy_and_download( $html );
     738        $nonroot_instruction = sprintf(
     739            __( "If you have root SSH access, edit your server config file and point your SSL paths to %scertificate.crt%s & %sprivate.pem%s files located in %s folder. If you don't have either cPanel or root SSH access, Upgrade to %sPRO%s version for automatic SSL installation and automatic SSL renewal.", 'wp-letsencrypt-ssl' ),
     740            '<strong>',
     741            '</strong>',
     742            '<strong>',
     743            '</strong>',
     744            '<strong>' . WPLE_Trait::wple_cert_directory() . '</strong>',
     745            '<a href="' . admin_url( '/admin.php?page=wp_encryption-pricing&checkout=true&plan_id=8210&plan_name=pro&billing_cycle=annual&pricing_id=7965&currency=usd' ) . '"><strong>',
     746            '</strong></a>'
     747        );
     748        if ( !get_option( 'wple_parent_reachable' ) ) {
     749            $nonroot_instruction = sprintf(
     750                __( "If you have root SSH access, download certificate.crt & private.pem files from above and upload them onto a secure folder on your server. Then edit your server config file and point the SSL paths to uploaded %scertificate.crt%s & %sprivate.pem%s files. If you don't have either cPanel or root SSH access, Upgrade to %sPRO%s version for automatic SSL installation and automatic SSL renewal.", 'wp-letsencrypt-ssl' ),
     751                '<strong>',
     752                '</strong>',
     753                '<strong>',
     754                '</strong>',
     755                '<a href="' . admin_url( '/admin.php?page=wp_encryption-pricing&checkout=true&plan_id=8210&plan_name=pro&billing_cycle=annual&pricing_id=7965&currency=usd' ) . '"><strong>',
     756                '</strong></a>'
     757            );
     758        }
    738759        $html .= '</li>
    739760          <li>5. ' . sprintf( __( 'Click on %sInstall certificate%s', 'wp-letsencrypt-ssl' ), '<strong>', '</strong>' ) . '</li>
     
    747768              <div>
    748769                <h3>' . esc_html__( "Don't have cPanel?", 'wp-letsencrypt-ssl' ) . '</h3>
    749                 <p>' . esc_html__( "cPanel link goes to 404 not found page?. ", 'wp-letsencrypt-ssl' ) . sprintf(
    750             __( "If you have root SSH access, edit your server config file and point your SSL paths to %scertificate.crt%s & %sprivate.pem%s files in %skeys/%s folder. If you don't have either cPanel or root SSH access, Upgrade to %sPRO%s version for automatic SSL installation and automatic SSL renewal.", 'wp-letsencrypt-ssl' ),
    751             '<strong>',
    752             '</strong>',
    753             '<strong>',
    754             '</strong>',
    755             '<strong>',
    756             '</strong>',
    757             '<a href="' . admin_url( '/admin.php?page=wp_encryption-pricing&checkout=true&plan_id=8210&plan_name=pro&billing_cycle=annual&pricing_id=7965&currency=usd' ) . '"><strong>',
    758             '</strong></a>'
    759         ) . '<br><br><span style="display:none">' . sprintf( __( 'You can also upgrade to our %sCDN%s plan to avail fully automatic SSL + Fastest CDN + Firewall Security.', 'wp-letsencrypt-ssl' ), '<a href="https://wpencryption.com/cdn-firewall/" target="_blank">', '</a>' ) . '</span></p>
     770                <p>' . esc_html__( "cPanel link goes to 404 not found page?. ", 'wp-letsencrypt-ssl' ) . $nonroot_instruction . '<br><br><span style="display:none">' . sprintf( __( 'You can also upgrade to our %sCDN%s plan to avail fully automatic SSL + Fastest CDN + Firewall Security.', 'wp-letsencrypt-ssl' ), '<a href="https://wpencryption.com/cdn-firewall/" target="_blank">', '</a>' ) . '</span></p>
    760771              </div>
    761772              <div>
     
    813824            $generic .= '<p class="firepro">' . $thirdparty . ' ' . $firerec . '</p>';
    814825        } else {
    815             if ( file_exists( ABSPATH . 'keys/certificate.crt' ) ) {
     826            if ( file_exists( WPLE_Trait::wple_cert_directory() . 'certificate.crt' ) ) {
    816827                $generic .= '<br><br>' . WPLE_Trait::wple_kses( __( 'You already seem to have certificate generated and stored. Please try downloading certs from <strong>Download SSL Certificates</strong> page and open in a text editor like notepad to check if certificate is not empty.', 'wp-letsencrypt-ssl' ) );
    817828            }
     
    870881                exit( 'No Trespassing Allowed' );
    871882            }
    872             $keys = ABSPATH . 'keys/';
     883            $keys = WPLE_Trait::wple_cert_directory();
    873884            $files = array(
    874885                $keys . 'public.pem',
     
    10411052        ?></h2>
    10421053
    1043     <h4 class="pricing-intro-subhead">Purchase once and use for lifetime - Trusted Globally by <b>110,000+</b> WordPress Users (Looking for <a href="<?php
     1054    <h4 class="pricing-intro-subhead">Purchase once and use for lifetime - Trusted Globally by <b>250,000+</b> WordPress Users (Looking for <a href="<?php
    10441055        echo  admin_url( '/admin.php?page=wp_encryption&gopro=3' ) ;
    10451056        ?>">Annual</a> | <a href="<?php
     
    11381149
    11391150    <h2 class="pricing-intro-head">FLAWLESS SSL SOLUTION FOR LOWEST PRICE EVER <small>(Limited Offer)</small></h2>
    1140     <h4 class="pricing-intro-subhead">Upgrade to PRO today for <strong>Fully automatic SSL</strong> & get automatic <strong>CDN + Security</strong> for FREE! - Trusted Globally by <b>110,000+</b> WordPress Users <span class="dashicons dashicons-editor-help wple-tooltip" data-tippy="A complete bundle worth $360!"></span></h4>
     1151    <h4 class="pricing-intro-subhead">Upgrade to PRO today for <strong>Fully automatic SSL</strong> & get automatic <strong>CDN + Security</strong> for FREE! - Trusted Globally by <b>250,000+</b> WordPress Users <span class="dashicons dashicons-editor-help wple-tooltip" data-tippy="A complete bundle worth $360!"></span></h4>
    11411152
    11421153    <div style="text-align:center">
     
    12121223    {
    12131224        $html .= WPLE_Trait::wple_progress_bar();
    1214         ///$cert = ABSPATH . 'keys/certificate.crt';
    12151225        $leopts = get_option( 'wple_opts' );
    12161226        $future = strtotime( $leopts['expiry'] );
  • wp-letsencrypt-ssl/trunk/admin/le_admin_pages.php

    r3063695 r3066915  
    403403    public function wple_download_page()
    404404    {
    405         $cert = ABSPATH . 'keys/certificate.crt';
     405        $cert = WPLE_Trait::wple_cert_directory() . 'certificate.crt';
    406406        $forced_completion = get_option( 'wple_backend' );
    407407        $html = '<div class="download-certs" data-update="' . wp_create_nonce( 'wpledownloadpage' ) . '">';
  • wp-letsencrypt-ssl/trunk/admin/le_ajax.php

    r3043670 r3066915  
    295295    $ftype = $_GET['gettype'];
    296296    $output = '';
    297     $keypath = ABSPATH . 'keys/';
     297    $keypath = WPLE_Trait::wple_cert_directory();
    298298
    299299    switch ($ftype) {
     
    302302        break;
    303303      case 'key':
    304         if (file_exists($keypath . 'private.pem')) $output = file_get_contents($keypath . 'private.pem');
     304        $output = WPLE_Trait::wple_get_private_key();
    305305        break;
    306306      case 'cabundle':
  • wp-letsencrypt-ssl/trunk/admin/le_handlers.php

    r2995858 r3066915  
    133133                case '1':
    134134                    $file = uniqid() . '-cert.crt';
    135                     file_put_contents( $file, file_get_contents( ABSPATH . 'keys/certificate.crt' ) );
     135                    file_put_contents( $file, file_get_contents( WPLE_Trait::wple_cert_directory() . 'certificate.crt' ) );
    136136                    break;
    137137                case '2':
    138138                    $file = uniqid() . '-key.pem';
    139                     file_put_contents( $file, file_get_contents( ABSPATH . 'keys/private.pem' ) );
     139                    file_put_contents( $file, WPLE_Trait::wple_get_private_key() );
    140140                    break;
    141141                case '3':
  • wp-letsencrypt-ssl/trunk/classes/le-core.php

    r3063695 r3066915  
    140140            }
    141141           
     142            $storage = 'WEB';
     143            /**
     144             * Set certificate storage path
     145             * Re-check permission each time
     146             * @since 7.1.0
     147             */
     148            $keys_above_root = dirname( ABSPATH, 1 ) . '/ssl/' . sanitize_file_name( WPLE_Trait::get_root_domain() );
     149           
     150            if ( file_exists( $keys_above_root ) && is_writable( $keys_above_root ) ) {
     151                //already created
     152                $storage = 'ROOT';
     153                update_option( 'wple_parent_reachable', true );
     154            } else {
     155               
     156                if ( @mkdir( $keys_above_root, 0755, true ) ) {
     157                    //directory creation success
     158                    $testfile = $keys_above_root . '/testfile';
     159                    @file_put_contents( $testfile, 'test123' );
     160                   
     161                    if ( file_exists( $testfile ) && file_get_contents( $testfile ) == 'test123' ) {
     162                        //file creation possible
     163                        unlink( $testfile );
     164                        update_option( 'wple_parent_reachable', true );
     165                        $storage = 'ROOT';
     166                    } else {
     167                        //file creation not possible
     168                        update_option( 'wple_parent_reachable', false );
     169                    }
     170               
     171                } else {
     172                    update_option( 'wple_parent_reachable', false );
     173                }
     174           
     175            }
     176           
    142177            $PRO = ( wple_fs()->can_use_premium_code__premium_only() ? 'PRO' : '' );
    143178            $PRO .= ( $this->wcard ? ' WILDCARD SSL ' : ' SINGLE DOMAIN SSL ' );
     
    149184            }
    150185            $PRO .= $cpanel;
    151             $this->wple_log( '<b>' . WPLE_PLUGIN_VER . ' ' . $PRO . ' - ' . esc_html( site_url() ) . '</b>', 'success', 'w' );
     186            $this->wple_log( '<b>' . WPLE_PLUGIN_VER . ' ' . $PRO . ' - ' . esc_html( site_url() ) . ' - ' . esc_html( $storage ) . '</b>', 'success', 'w' );
    152187            $this->wple_log( "Domain covered:\n" . json_encode( $this->domains ) . "\n" );
    153188        }
     
    195230    {
    196231        try {
    197             $keydir = ABSPATH . 'keys/';
     232            $keydir = WPLE_Trait::wple_cert_directory();
    198233            $sourceIP = get_option( 'wple_sourceip' );
     234            //since 7.1 restore account key from option
     235            $acckey_path = $keydir . '__account/private.pem';
     236           
     237            if ( !file_exists( $acckey_path ) ) {
     238                $acckey = ( get_option( 'wple_acc_key' ) ? get_option( 'wple_acc_key' ) : '' );
     239                file_put_contents( $acckey_path, preg_replace( '#<br\\s*/?>#i', "", $acckey ) );
     240            }
     241           
    199242            $this->client = new LEClient(
    200243                $this->email,
     
    307350           
    308351            delete_option( 'wple_hold_cron' );
    309             $cert = ABSPATH . 'keys/certificate.crt';
     352            $cert = WPLE_Trait::wple_cert_directory() . 'certificate.crt';
    310353           
    311354            if ( file_exists( $cert ) ) {
     
    324367                $this->wple_send_usage_data();
    325368            }
     369            /**
     370             * Case: Couldn't store above web root dir
     371             * Delete private key and store in option
     372             * Delete account key and store in option
     373             * @since 7.0.0
     374             */
     375           
     376            if ( !get_option( 'wple_parent_reachable' ) ) {
     377                $priv_key = WPLE_Trait::wple_cert_directory() . 'private.pem';
     378                $acc_key = WPLE_Trait::wple_cert_directory() . '__account/private.pem';
     379               
     380                if ( file_exists( $priv_key ) ) {
     381                    $priv_key_content = sanitize_textarea_field( file_get_contents( $priv_key ) );
     382                    $priv_key_content = nl2br( $priv_key_content );
     383                    update_option( 'wple_priv_key', $priv_key_content );
     384                    unlink( $priv_key );
     385                    $acc_key_content = sanitize_textarea_field( file_get_contents( $acc_key ) );
     386                    $acc_key_content = nl2br( $acc_key_content );
     387                    update_option( 'wple_acc_key', $acc_key_content );
     388                    unlink( $acc_key );
     389                    $this->wple_log( "Stored private key as option" );
     390                }
     391           
     392            }
     393           
    326394            wp_redirect( admin_url( '/admin.php?page=wp_encryption' ), 302 );
    327395            exit;
     
    377445    public function wple_save_expiry_date()
    378446    {
    379         $certfile = ABSPATH . 'keys/certificate.crt';
     447        $certfile = WPLE_Trait::wple_cert_directory() . 'certificate.crt';
    380448        //TODO: expiry saved separately on each mapped site?
    381449       
     
    454522        $srvr = array(
    455523            'challenge_folder_exists' => '',
    456             'certificate_exists'      => file_exists( ABSPATH . 'keys/certificate.crt' ),
     524            'certificate_exists'      => file_exists( WPLE_Trait::wple_cert_directory() . 'certificate.crt' ),
    457525            'server_software'         => $_SERVER['SERVER_SOFTWARE'],
    458526            'http_host'               => site_url(),
     
    617685       
    618686        if ( get_option( 'wple_email_certs' ) == true ) {
    619             $certificate = ABSPATH . 'keys/certificate.crt';
     687            $certificate = WPLE_Trait::wple_cert_directory() . 'certificate.crt';
    620688            if ( class_exists( 'ZipArchive' ) ) {
    621689               
     
    623691                    $this->wple_log( 'Emailing certs as attachment' );
    624692                    $zip = new ZipArchive();
    625                     $zip->open( ABSPATH . 'keys/certificates.zip', ZipArchive::CREATE );
     693                    $zip->open( WPLE_Trait::wple_cert_directory() . 'certificates.zip', ZipArchive::CREATE );
    626694                    $zip->addFile( $certificate, 'certificate.crt' );
    627695                    $ret = $this->wple_parseCertificate( $certificate );
    628696                    $certexpirydate = date( 'd-m-Y', $ret['validTo_time_t'] );
    629                     $pemfile = ABSPATH . 'keys/private.pem';
     697                    $pemfile = WPLE_Trait::wple_cert_directory() . 'private.pem';
    630698                    $zip->addFile( $pemfile, 'private.pem' );
    631699                    $cabundle = WPLE_DIR . 'cabundle/ca.crt';
     
    642710                            $body,
    643711                            $headers,
    644                             array( ABSPATH . 'keys/certificates.zip' )
     712                            array( WPLE_Trait::wple_cert_directory() . 'certificates.zip' )
    645713                        );
    646714                    }
    647                     unlink( ABSPATH . 'keys/certificates.zip' );
     715                    unlink( WPLE_Trait::wple_cert_directory() . 'certificates.zip' );
    648716                } else {
    649717                    $this->wple_log( 'Emailing certs skipped as certificate.crt not found.' );
  • wp-letsencrypt-ssl/trunk/classes/le-deactivator.php

    r3063695 r3066915  
    3535        $opts['force_ssl'] = 0;
    3636        update_option( 'wple_opts', $opts );
    37         // retained - wple_opts, wple_show_reminder, wple_send_usage, wple_error, wple_complete, wple_failed_verification, wple_mixed_issues
     37        // retained - wple_opts, wple_show_reminder, wple_send_usage, wple_error, wple_complete, wple_failed_verification, wple_mixed_issues, wple_priv_key
    3838        $opts_to_delete = array(
    3939            'wple_backup_suggested',
     
    6060            'wple_sourceip',
    6161            'wple_order_refreshed',
    62             'wple_sourceip_enable'
     62            'wple_sourceip_enable',
     63            'wple_parent_reachable'
    6364        );
    6465        foreach ( $opts_to_delete as $optname ) {
  • wp-letsencrypt-ssl/trunk/classes/le-trait.php

    r3063695 r3066915  
    212212        $srvr = array(
    213213            'challenge_folder_exists' => '',
    214             'certificate_exists'      => file_exists( ABSPATH . 'keys/certificate.crt' ),
     214            'certificate_exists'      => file_exists( WPLE_Trait::wple_cert_directory() . 'certificate.crt' ),
    215215            'server_software'         => $_SERVER['SERVER_SOFTWARE'],
    216216            'http_host'               => $_SERVER['HTTP_HOST'],
     
    949949   
    950950    }
     951   
     952    /**
     953     * Returns cert directory
     954     *
     955     * @since 7.0.0
     956     */
     957    public static function wple_cert_directory()
     958    {
     959       
     960        if ( get_option( 'wple_parent_reachable' ) ) {
     961            $dir = dirname( ABSPATH, 1 ) . '/ssl/' . sanitize_file_name( WPLE_Trait::get_root_domain() ) . '/';
     962        } else {
     963            $dir = ABSPATH . 'keys/';
     964        }
     965       
     966        return $dir;
     967    }
     968   
     969    public static function wple_get_private_key()
     970    {
     971        $keypath = WPLE_Trait::wple_cert_directory();
     972        $pkey = get_option( 'wple_priv_key' );
     973       
     974        if ( file_exists( $keypath . 'private.pem' ) ) {
     975            return file_get_contents( $keypath . 'private.pem' );
     976        } elseif ( $pkey !== false ) {
     977            return preg_replace( '#<br\\s*/?>#i', "", $pkey );
     978        } else {
     979            return '';
     980        }
     981   
     982    }
    951983
    952984}
  • wp-letsencrypt-ssl/trunk/readme.txt

    r3063695 r3066915  
    66Tested up to: 6.5
    77Requires PHP: 7.0
    8 Stable tag: 7.0.0
     8Stable tag: 7.1.0
    99
    1010Lifetime SSL solution & Security - Install free SSL certificate & enable HTTPS redirect, HTTPS mail, fix SSL errors, SSL score, SSL details & monitoring.
     
    176176== Changelog ==
    177177
     178= 7.1.0 =
     179* Free Version - Store SSL certificate & key in ssl/domain.com/ directory above web root to avoid public access in case htaccess is not supported
     180* Store keys as option if root dir access is restricted
     181
    178182= 7.0.0 =
    179183* PRO - CERT PANEL improvements
     
    182186
    183187= 6.6.0 =
    184 * Freemius sdk update
    185188* http file names correction
    186189* SSL labs scan improvements
     190* Freemius SDK update to 2.6.2
     191* Fixed issue with http verification file names
    187192
    188193= 6.5.0 =
  • wp-letsencrypt-ssl/trunk/wp-letsencrypt.php

    r3063695 r3066915  
    88 * Plugin URI:        https://wpencryption.com
    99 * Description:       Secure your WordPress site with free SSL certificate and force HTTPS. Enable HTTPS padlock. Just activating this plugin won't help! - Please run the SSL install form of WP Encryption found on left panel.
    10  * Version:           7.0.0
     10 * Version:           7.1.0
    1111 * Author:            WP Encryption SSL HTTPS
    1212 * Author URI:        https://wpencryption.com
     
    3535 */
    3636if ( !defined( 'WPLE_PLUGIN_VER' ) ) {
    37     define( 'WPLE_PLUGIN_VER', '7.0.0' );
     37    define( 'WPLE_PLUGIN_VER', '7.1.0' );
    3838}
    3939if ( !defined( 'WPLE_BASE' ) ) {
Note: See TracChangeset for help on using the changeset viewer.