Plugin Directory

Changeset 2929749


Ignore:
Timestamp:
06/22/2023 02:51:37 PM (3 years ago)
Author:
speedify
Message:

Releasing version 3.5.1

Location:
auto-install-free-ssl
Files:
276 added
13 edited

Legend:

Unmodified
Added
Removed
  • auto-install-free-ssl/trunk/FreeSSLAuto/src/Admin/Factory.php

    r2921218 r2929749  
    315315    /**
    316316     * Returns the cPanel host
    317      *
     317     * Improved since 3.5.1
     318     *
     319     * @param $hostname
     320     *
     321     * @return false|string
     322     */
     323    public function getcPanelHost( $hostname )
     324    {
     325        $cpanel_settings = get_option( 'cpanel_settings_auto_install_free_ssl' );
     326        if ( isset( $cpanel_settings['cpanel_host'] ) ) {
     327            return $cpanel_settings['cpanel_host'];
     328        }
     329        $cpanel_host = false;
     330       
     331        if ( !aifs_is_os_windows() ) {
     332            $hostname = str_replace( [
     333                'https://',
     334                'http://',
     335                'https://www.',
     336                'http://www.'
     337            ], '', $hostname );
     338            $possible_hosts = [
     339                "http://" . gethostbyname( 'localhost' ) . ':2083',
     340                "http://" . gethostbyname( 'localhost' ) . '/cpanel',
     341                "https://" . $hostname . ':2083',
     342                "http://" . $hostname . '/cpanel',
     343                "http://" . $hostname . ':2083',
     344                "https://" . $hostname . '/cpanel'
     345            ];
     346            foreach ( $possible_hosts as $curl_url ) {
     347                $handle = curl_init();
     348                curl_setopt( $handle, CURLOPT_URL, $curl_url );
     349                curl_setopt( $handle, CURLOPT_SSL_VERIFYHOST, false );
     350                curl_setopt( $handle, CURLOPT_SSL_VERIFYPEER, false );
     351                curl_setopt( $handle, CURLOPT_RETURNTRANSFER, true );
     352                curl_setopt( $handle, CURLOPT_HEADER, true );
     353                curl_setopt( $handle, CURLOPT_TIMEOUT, 5 );
     354                // @since 3.2.3
     355                curl_setopt( $handle, CURLOPT_FOLLOWLOCATION, true );
     356                $response = curl_exec( $handle );
     357                $effective_url = curl_getinfo( $handle, CURLINFO_EFFECTIVE_URL );
     358                $redirect_url = curl_getinfo( $handle, CURLINFO_REDIRECT_URL );
     359                $http_status_code = curl_getinfo( $handle, CURLINFO_HTTP_CODE );
     360                $error = curl_errno( $handle );
     361                curl_close( $handle );
     362                $checkURL = $this->checkcPanelInUrl( $effective_url );
     363               
     364                if ( ($http_status_code === 301 || $http_status_code === 200) && ($checkURL['endsWith2083Port'] || $checkURL['endsWithCpanel']) && strpos( $response, 'cPanel' ) !== false ) {
     365                    $hostname = $checkURL['string'];
     366                   
     367                    if ( $checkURL['endsWith2083Port'] ) {
     368                        //if(strpos($response, 'login') !== false)
     369                        $hostname = str_replace( [ 'https://', 'http://' ], '', $hostname );
     370                        $hostname = substr( $hostname, 0, -5 );
     371                    } else {
     372                       
     373                        if ( $checkURL['endsWithCpanel'] ) {
     374                            //if(strpos($response, ':2083') !== false || strpos($response, ':2082') !== false)
     375                            $hostname = str_replace( [ 'https://', 'http://' ], '', $hostname );
     376                            $hostname = substr( $hostname, 0, -7 );
     377                        }
     378                   
     379                    }
     380                   
     381                    if ( strpos( $hostname, 'www.' ) !== false && strpos( $hostname, 'www.' ) === 0 ) {
     382                        //If www. found at the beginning, remove it
     383                        $hostname = substr( $hostname, 4 );
     384                    }
     385                    $cpanel_host = $hostname;
     386                    break;
     387                    // Exit the loop if cPanel host is found
     388                }
     389           
     390            }
     391            //following if block ensures detection even if all the above methods fail
     392            if ( $cpanel_host === false ) {
     393               
     394                if ( !$this->is_parent_dir_restricted_by_open_basedir() && is_dir( '/usr/local/cpanel' ) || $this->port_exists( 2083 ) || $this->port_exists( 2082 ) ) {
     395                    $hostname = str_replace( [ 'https://', 'http://' ], '', $hostname );
     396                    if ( strpos( $hostname, 'www.' ) !== false && strpos( $hostname, 'www.' ) === 0 ) {
     397                        //If www. found at the beginning, remove it
     398                        $hostname = substr( $hostname, 4 );
     399                    }
     400                    $cpanel_host = $hostname;
     401                }
     402           
     403            }
     404        }
     405       
     406       
     407        if ( $cpanel_settings && is_array( $cpanel_settings ) ) {
     408            $cpanel_settings['cpanel_host'] = $cpanel_host;
     409            update_option( 'cpanel_settings_auto_install_free_ssl', $cpanel_settings );
     410        } else {
     411            update_option( 'cpanel_settings_auto_install_free_ssl', [
     412                'cpanel_host' => $cpanel_host,
     413            ] );
     414        }
     415       
     416        return $cpanel_host;
     417    }
     418   
     419    /**
     420     * Check if '/cpanel' or ':2083' exists in the given URL
     421     * @param $string
     422     * @since 3.5.1
     423     * @return array
     424     */
     425    public function checkcPanelInUrl( $string )
     426    {
     427        // Remove '/' if it exists at the end of the string
     428        if ( substr( $string, -1 ) === '/' ) {
     429            $string = rtrim( $string, '/' );
     430        }
     431        // Check if '/cpanel' or ':2083' exists at the end of the string
     432        $endsWithCpanel = substr( $string, -7 ) === '/cpanel';
     433        $endsWithPort = substr( $string, -5 ) === ':2083';
     434        return [
     435            'endsWithCpanel'   => $endsWithCpanel,
     436            'endsWith2083Port' => $endsWithPort,
     437            'string'           => $string,
     438        ];
     439    }
     440   
     441    /**
     442     * Returns the cPanel host
     443     * Improved since 3.5.1
    318444     * @param $hostname
    319445     * @param $is_reset_host
    320446     * @param $strict_check
    321447     *
    322      * @return array|false|string|string[]
    323      */
    324     public function getcPanelHost( $hostname, $is_reset_host = false, $strict_check = false )
     448     * @return false|string
     449     */
     450    public function getcPanelHost_v1( $hostname, $is_reset_host = false, $strict_check = false )
    325451    {
    326452        $cpanel_settings = ( get_option( 'cpanel_settings_auto_install_free_ssl' ) ? get_option( 'cpanel_settings_auto_install_free_ssl' ) : add_option( 'cpanel_settings_auto_install_free_ssl' ) );
     
    328454            return $cpanel_settings['cpanel_host'];
    329455        }
     456        //@todo use gethostbyname('localhost') too
    330457        $cpanel_host = false;
    331         /*if(aifs_is_os_windows()){
    332            return false;
    333           }*/
    334458       
    335459        if ( !aifs_is_os_windows() ) {
     
    352476            $error = curl_errno( $handle );
    353477            curl_close( $handle );
    354             /*if ( $http_status_code === 3 ) {
    355                return false;
    356               }*/
    357478           
    358479            if ( $http_status_code !== 3 ) {
     
    369490                        $link = substr( $link, 4 );
    370491                    }
    371                     return $this->getcPanelHost( $link, true );
     492                    return $this->getcPanelHost( $link );
    372493                }
    373494               
     
    379500               
    380501                if ( $http_status_code === 0 ) {
    381                     return $this->getcPanelHost( $hostname, true, true );
    382                 }
    383                
    384                 if ( $http_status_code === 301 && strpos( $effective_url, 'https://' ) === 0 && strpos( $effective_url, ':2083' ) !== false ) {
    385                     $last_slash_pos = strpos( $effective_url, '/', -1 );
    386                     if ( $last_slash_pos !== false ) {
    387                         $hostname = substr( $effective_url, 0, $last_slash_pos );
    388                     }
    389                     $hostname = str_replace( 'https://', '', $hostname );
    390                     $hostname = str_replace( ':2083', '', $hostname );
     502                    return $this->getcPanelHost( $hostname );
     503                }
     504                $checkURL = $this->checkcPanelInUrl( $effective_url );
     505                //Improved since 3.5.1
     506               
     507                if ( ($http_status_code === 301 || $http_status_code === 200) && ($checkURL['endsWith2083Port'] || $checkURL['endsWithCpanel']) && strpos( $response, 'cPanel' ) !== false ) {
     508                    $hostname = $checkURL['string'];
     509                   
     510                    if ( $checkURL['endsWith2083Port'] ) {
     511                        //if(strpos($response, 'login') !== false)
     512                        $hostname = str_replace( [ 'https://', 'http://' ], '', $hostname );
     513                        $hostname = substr( $hostname, 0, -5 );
     514                    } else {
     515                       
     516                        if ( $checkURL['endsWithCpanel'] ) {
     517                            //if(strpos($response, ':2083') !== false || strpos($response, ':2082') !== false)
     518                            $hostname = str_replace( [ 'https://', 'http://' ], '', $hostname );
     519                            $hostname = substr( $hostname, 0, -7 );
     520                        }
     521                   
     522                    }
     523                   
    391524                    if ( strpos( $hostname, 'www.' ) !== false && strpos( $hostname, 'www.' ) === 0 ) {
    392525                        //If www. found at the beginning, remove it
    393526                        $hostname = substr( $hostname, 4 );
    394527                    }
    395                     //return $hostname;
    396528                    $cpanel_host = $hostname;
    397529                } else {
    398530                   
    399                     if ( $http_status_code === 200 ) {
    400                         $hostname = str_replace( 'http://', '', $hostname );
    401                         $hostname = str_replace( 'https://', '', $hostname );
     531                    if ( !$this->is_parent_dir_restricted_by_open_basedir() && is_dir( '/usr/local/cpanel' ) || $this->port_exists( 2083 ) || $this->port_exists( 2082 ) ) {
     532                        //Improved since 3.5.1
     533                        $hostname = str_replace( [ 'https://', 'http://' ], '', $hostname );
    402534                        if ( strpos( $hostname, 'www.' ) !== false && strpos( $hostname, 'www.' ) === 0 ) {
    403535                            //If www. found at the beginning, remove it
    404536                            $hostname = substr( $hostname, 4 );
    405537                        }
    406                         //return $hostname;
    407538                        $cpanel_host = $hostname;
    408                     } else {
    409                        
    410                         if ( !$this->is_parent_dir_restricted_by_open_basedir() && is_dir( '/usr/local/cpanel' ) ) {
    411                             $hostname = str_replace( 'http://', '', $hostname );
    412                             $hostname = str_replace( 'https://', '', $hostname );
    413                             if ( strpos( $hostname, 'www.' ) !== false && strpos( $hostname, 'www.' ) === 0 ) {
    414                                 //If www. found at the beginning, remove it
    415                                 $hostname = substr( $hostname, 4 );
    416                             }
    417                             //return $hostname;
    418                             $cpanel_host = $hostname;
    419                         }
    420                    
    421539                    }
    422540               
     
    433551   
    434552    /**
    435      * Returns the cPanel host
    436      *
    437      * @param $hostname
    438      * @param $is_reset_host
    439      * @param $strict_check
    440      *
    441      * @return array|false|string|string[]
    442      */
    443     public function getcPanelHost_v0( $hostname, $is_reset_host = false, $strict_check = false )
    444     {
     553     * Detects whether the control panel is cPanel
     554     * Improved since 3.5.1
     555     * @return bool
     556     */
     557    public function is_cpanel()
     558    {
     559       
    445560        if ( aifs_is_os_windows() ) {
    446561            return false;
    447         }
    448         //$hostname = str_replace('http://www.', 'http://', $hostname);
    449         //$hostname = str_replace('https://www.', 'https://', $hostname);
    450         $hostname = str_replace( [ 'https://', 'https://www.', 'http://www.' ], 'http://', $hostname );
    451         $handle = curl_init();
    452         curl_setopt( $handle, CURLOPT_URL, $hostname . (( $strict_check ? '/cpanel' : ':2083' )) );
    453         //curl_setopt($handle, CURLOPT_POST, true);
    454         //curl_setopt($handle, CURLOPT_HTTPHEADER, array('Connection' => 'close'));
    455         //curl_setopt($handle, CURLOPT_HEADER, true);
    456         curl_setopt( $handle, CURLOPT_SSL_VERIFYHOST, false );
    457         curl_setopt( $handle, CURLOPT_SSL_VERIFYPEER, false );
    458         curl_setopt( $handle, CURLOPT_RETURNTRANSFER, true );
    459         curl_setopt( $handle, CURLOPT_HEADER, true );
    460         curl_setopt( $handle, CURLOPT_TIMEOUT, 5 );
    461         // @since 3.2.3
    462         if ( $strict_check ) {
    463             curl_setopt( $handle, CURLOPT_FOLLOWLOCATION, true );
    464         }
    465         //curl_setopt($handle, CURLOPT_SSL_VERIFYPEER, false);
    466         //curl_setopt($handle, CURLOPT_SSL_VERIFYHOST, 0);
    467         $response = curl_exec( $handle );
    468         $effective_url = curl_getinfo( $handle, CURLINFO_EFFECTIVE_URL );
    469         $redirect_url = curl_getinfo( $handle, CURLINFO_REDIRECT_URL );
    470         $http_status_code = curl_getinfo( $handle, CURLINFO_HTTP_CODE );
    471         $error = curl_errno( $handle );
    472         curl_close( $handle );
    473         /*echo "Status code: ".$http_status_code."<br /><br />";
    474                 //echo "Response: ".$response."<br /><br />";
    475                 echo "Error: ".$error."<br /><br />";
    476                 echo "Effective URL: ".$effective_url."<br /><br />";
    477                 echo "Redirect URL: ".$redirect_url."<br /><br />";*/
    478         //return;
    479         if ( $http_status_code === 3 ) {
    480             return false;
    481         }
    482        
    483         if ( $is_reset_host === false && $http_status_code === 301 ) {
    484             if ( isset( $redirect_url ) ) {
    485                 $response = $redirect_url;
    486             }
    487             $start = strpos( $response, 'https://' );
    488             $end = strpos( $response, ':2083' );
    489             $link = substr( $response, $start, $end - $start );
    490             if ( strpos( $link, 'www.' ) !== false && strpos( $link, 'www.' ) === 0 ) {
    491                 //If www. found at the beginning, remove it
    492                 $link = substr( $link, 4 );
    493             }
    494             return $this->getcPanelHost( $link, true );
    495         }
    496        
    497        
    498         if ( in_array( $http_status_code, [ 400 ] ) ) {
    499             $link = str_replace( 'http://', 'https://', $hostname );
    500             return $this->getcPanelHost( $link );
    501         }
    502        
    503         if ( $http_status_code === 0 ) {
    504             return $this->getcPanelHost( $hostname, true, true );
    505         }
    506        
    507         if ( $http_status_code === 301 && strpos( $effective_url, 'https://' ) === 0 && strpos( $effective_url, ':2083' ) !== false ) {
    508             $last_slash_pos = strpos( $effective_url, '/', -1 );
    509             if ( $last_slash_pos !== false ) {
    510                 $hostname = substr( $effective_url, 0, $last_slash_pos );
    511             }
    512             $hostname = str_replace( 'https://', '', $hostname );
    513             $hostname = str_replace( ':2083', '', $hostname );
    514             if ( strpos( $hostname, 'www.' ) !== false && strpos( $hostname, 'www.' ) === 0 ) {
    515                 //If www. found at the beginning, remove it
    516                 $hostname = substr( $hostname, 4 );
    517             }
    518             return $hostname;
    519         }
    520        
    521        
    522         if ( $http_status_code === 200 ) {
    523             $hostname = str_replace( 'http://', '', $hostname );
    524             $hostname = str_replace( 'https://', '', $hostname );
    525             if ( strpos( $hostname, 'www.' ) !== false && strpos( $hostname, 'www.' ) === 0 ) {
    526                 //If www. found at the beginning, remove it
    527                 $hostname = substr( $hostname, 4 );
    528             }
    529             return $hostname;
    530         }
    531        
    532         //following if block ensures detection even if all the above methods fail
    533        
    534         if ( !$this->is_parent_dir_restricted_by_open_basedir() && is_dir( '/usr/local/cpanel' ) ) {
    535             $hostname = str_replace( 'http://', '', $hostname );
    536             $hostname = str_replace( 'https://', '', $hostname );
    537             if ( strpos( $hostname, 'www.' ) !== false && strpos( $hostname, 'www.' ) === 0 ) {
    538                 //If www. found at the beginning, remove it
    539                 $hostname = substr( $hostname, 4 );
    540             }
    541             return $hostname;
    542         }
    543        
    544         return false;
    545         //i.e., NOT cPanel
    546     }
    547    
    548     /**
    549      * Detects whether the control panel is cPanel
    550      *
    551      * @return bool
    552      */
    553     public function is_cpanel()
    554     {
    555        
    556         if ( aifs_is_os_windows() ) {
    557             return false;
    558         } else {
    559            
    560             if ( !$this->is_parent_dir_restricted_by_open_basedir() && (is_dir( '/usr/local/cpanel' ) || $this->getcPanelHost( get_site_url() ) !== false) ) {
     562        } else {
     563           
     564            if ( !$this->is_parent_dir_restricted_by_open_basedir() && is_dir( '/usr/local/cpanel' ) ) {
    561565                return true;
    562566            } else {
    563                 return false;
     567               
     568                if ( $this->port_exists( 2083 ) ) {
     569                    return true;
     570                } else {
     571                   
     572                    if ( $this->port_exists( 2082 ) ) {
     573                        return true;
     574                    } else {
     575                       
     576                        if ( $this->getcPanelHost( aifs_get_domain() ) !== false ) {
     577                            return true;
     578                        } else {
     579                            return false;
     580                        }
     581                   
     582                    }
     583               
     584                }
     585           
    564586            }
    565587       
     
    733755    {
    734756        //return substr(ABSPATH, 0, strlen(ABSPATH)-1); //remove / from the end of ABSPATH
     757        if ( !function_exists( 'get_home_path' ) ) {
     758            require_once ABSPATH . 'wp-admin/includes/file.php';
     759        }
    735760        $home_path = get_home_path();
    736761        $last_character = substr( $home_path, strlen( $home_path ) - 1 );
  • auto-install-free-ssl/trunk/FreeSSLAuto/src/Admin/Log.php

    r2905766 r2929749  
    3737   
    3838    public $factory;
    39 
    40     /**
     39    public $page_url;
     40
     41    /**
    4142     * Start up
    4243     */
     
    5051
    5152        add_action('admin_menu', array($this, 'log_page_menu'));
     53
     54        $site_url = parse_url( get_site_url() );
     55        $this->page_url = $site_url['scheme'] . "://" . $site_url['host'] . $_SERVER['REQUEST_URI'];
    5256    }
    5357   
     
    99103
    100104                                    <?php
    101                                     $view_log_url = wp_nonce_url( get_site_url().$_SERVER['REQUEST_URI'], 'aifs_view_log', 'aifsviewlog' )."&date=";
     105                                    $view_log_url = wp_nonce_url( $this->page_url, 'aifs_view_log', 'aifsviewlog' )."&date=";
    102106
    103107                                    foreach ($files as $file):
     
    158162                            <?php
    159163                            if(!get_option('aifs_delete_plugin_data_on_deactivation')){
    160                                 $link_to_delete_data = wp_nonce_url( get_site_url().$_SERVER['REQUEST_URI'], 'aifs_delete_data_on_deactivate', 'aifsdeleteplugindata' );
     164                                $link_to_delete_data = wp_nonce_url( $this->page_url, 'aifs_delete_data_on_deactivate', 'aifsdeleteplugindata' );
    161165                                $title = __( "DELETE plugin data on deactivation", 'auto-install-free-ssl' );
    162166                                $confirm = __( "Would you like to DELETE plugin data on deactivation?", 'auto-install-free-ssl' );
     
    165169                            }
    166170                            else {
    167                                 $link_to_keep_data = wp_nonce_url( get_site_url() . $_SERVER['REQUEST_URI'], 'aifs_keep_data_intact_on_deactivate', 'aifskeepplugindataintact' );
     171                                $link_to_keep_data = wp_nonce_url( $this->page_url, 'aifs_keep_data_intact_on_deactivate', 'aifskeepplugindataintact' );
    168172                                $title = __( "You could keep plugin data INTACT on deactivation", 'auto-install-free-ssl' );
    169173                                /* translators: %1$s: Name of this plugin, i.e., 'Auto-Install Free SSL'; %2$s: Opening HTML 'a' tag; %3$s: Closing 'a' tag (Opening and closing 'a' tags create a hyperlink with the enclosed text.) */
     
    192196            }
    193197            update_option( 'aifs_delete_plugin_data_on_deactivation', 1);
    194             wp_redirect($this->factory->aifs_remove_parameters_from_url(get_site_url().$_SERVER['REQUEST_URI'], ['aifsdeleteplugindata']));
     198            wp_redirect($this->factory->aifs_remove_parameters_from_url($this->page_url, ['aifsdeleteplugindata']));
    195199
    196200            //Display success message
     
    202206                }
    203207                update_option( 'aifs_delete_plugin_data_on_deactivation', 0);
    204                 wp_redirect($this->factory->aifs_remove_parameters_from_url(get_site_url().$_SERVER['REQUEST_URI'], ['aifskeepplugindataintact']));
     208                wp_redirect($this->factory->aifs_remove_parameters_from_url($this->page_url, ['aifskeepplugindataintact']));
    205209
    206210                //Display success message
  • auto-install-free-ssl/trunk/assets/css/aifs-admin.css

    r2921218 r2929749  
    331331/* Header */
    332332.aifs-header{
     333    width: 103.7%;
    333334    background-position: 6%;
    334335    background-repeat: no-repeat;
  • auto-install-free-ssl/trunk/auto-install-free-ssl.php

    r2921218 r2929749  
    77 * Plugin URI:  https://freessl.tech
    88 * Description: Generate & install Free SSL Certificates, activate force HTTPS redirect with one click to fix insecure links & mixed content warnings, and get automatic Renewal Reminders.
    9  * Version:     3.5.0
     9 * Version:     3.5.1
    1010 * Requires at least: 4.1
    1111 * Requires PHP:      5.6
     
    265265    /*
    266266     * Delete plugin data on deactivation
     267     * Removed 'aifs_user_since_free_only_version' since 3.5.1
    267268     * @since 3.2.7
    268269     */
     
    279280            'aifs_generate_ssl_manually',
    280281            'aifs_return_array_step1_manually',
    281             'aifs_user_since_free_only_version',
    282282            'aifs_free_plan_selected',
    283283            'aifs_domains_to_revoke_cert',
     
    456456//add_action( 'activated_plugin', 'aifs_activation_redirect' );
    457457/**
    458  * Merge all the options in a single array
     458 * Merge all the options in a single array.
     459 * Improved since 3.5.1
    459460 * */
    460461function aifs_get_app_settings()
    461462{
    462     $app_settings = array();
    463    
    464     if ( get_option( 'basic_settings_auto_install_free_ssl' ) ) {
    465         $app_settings = get_option( 'basic_settings_auto_install_free_ssl' );
     463    $basic_settings = get_option( 'basic_settings_auto_install_free_ssl' );
     464   
     465    if ( $basic_settings && is_array( $basic_settings ) ) {
     466        $app_settings = $basic_settings;
    466467    } else {
    467468        return false;
    468469    }
    469470   
    470     if ( get_option( 'cpanel_settings_auto_install_free_ssl' ) ) {
    471         $app_settings = array_merge( $app_settings, get_option( 'cpanel_settings_auto_install_free_ssl' ) );
    472     }
    473     if ( get_option( 'exclude_domains_auto_install_free_ssl' ) ) {
    474         $app_settings = array_merge( $app_settings, get_option( 'exclude_domains_auto_install_free_ssl' ) );
    475     }
    476     if ( get_option( 'dns_provider_auto_install_free_ssl' ) ) {
    477         $app_settings = array_merge( $app_settings, get_option( 'dns_provider_auto_install_free_ssl' ) );
    478     }
    479     if ( get_option( 'all_domains_auto_install_free_ssl' ) ) {
    480         $app_settings = array_merge( $app_settings, get_option( 'all_domains_auto_install_free_ssl' ) );
     471    $cpanel_settings = get_option( 'cpanel_settings_auto_install_free_ssl' );
     472    if ( $cpanel_settings && is_array( $cpanel_settings ) ) {
     473        $app_settings = array_merge( $app_settings, $cpanel_settings );
     474    }
     475    $exclude_domains = get_option( 'exclude_domains_auto_install_free_ssl' );
     476    if ( $exclude_domains && is_array( $exclude_domains ) ) {
     477        $app_settings = array_merge( $app_settings, $exclude_domains );
     478    }
     479    $dns_provider = get_option( 'dns_provider_auto_install_free_ssl' );
     480    if ( $dns_provider && is_array( $dns_provider ) ) {
     481        $app_settings = array_merge( $app_settings, $dns_provider );
     482    }
     483    $all_domains = get_option( 'all_domains_auto_install_free_ssl' );
     484    if ( $all_domains && is_array( $all_domains ) ) {
     485        $app_settings = array_merge( $app_settings, $all_domains );
    481486    }
    482487    /*if ( get_option( 'domains_to_revoke_cert_auto_install_free_ssl' ) ) {
    483488                $app_settings = array_merge( $app_settings, get_option( 'domains_to_revoke_cert_auto_install_free_ssl' ) );
    484489            }*/
    485     if ( get_option( 'aifs_domains_to_revoke_cert' ) ) {
    486         $app_settings = array_merge( $app_settings, get_option( 'aifs_domains_to_revoke_cert' ) );
     490    $domains_revoke_cert = get_option( 'aifs_domains_to_revoke_cert' );
     491    if ( $domains_revoke_cert && is_array( $domains_revoke_cert ) ) {
     492        $app_settings = array_merge( $app_settings, $domains_revoke_cert );
    487493    }
    488494    return $app_settings;
  • auto-install-free-ssl/trunk/freemius/includes/class-freemius.php

    r2914082 r2929749  
    2588625886                $thank_you,
    2588725887                $already_opted_in,
    25888                 sprintf( $this->get_text_inline( 'Due to the new %sEU General Data Protection Regulation (GDPR)%s compliance requirements it is required that you provide your explicit consent, again, confirming that you are onboard :-)', 'due-to-gdpr-compliance-requirements' ), '<a href="https://eugdpr.org/" target="_blank" rel="noopener noreferrer">', '</a>' ) .
     25888                sprintf( $this->get_text_inline( 'Due to the new %sEU General Data Protection Regulation (GDPR)%s compliance requirements it is required that you provide your explicit consent, again, confirming that you are onboard :-)', 'due-to-gdpr-compliance-requirements' ), '<a href="https://ec.europa.eu/info/law/law-topic/data-protection_en/" target="_blank" rel="noopener noreferrer">', '</a>' ) .
    2588925889                '<br><br>' .
    2589025890                '<b>' . $this->get_text_inline( "Please let us know if you'd like us to contact you for security & feature updates, educational content, and occasional offers:", 'contact-for-updates' ) . '</b>' .
  • auto-install-free-ssl/trunk/freemius/start.php

    r2914082 r2929749  
    1616     * @var string
    1717     */
    18     $this_sdk_version = '2.5.8';
     18    $this_sdk_version = '2.5.9';
    1919
    2020    #region SDK Selection Logic --------------------------------------------------------------------
  • auto-install-free-ssl/trunk/freemius/templates/account.php

    r2821062 r2929749  
    106106
    107107    $has_tabs = $fs->_add_tabs_before_content();
    108 
    109     if ( $has_tabs ) {
    110         $query_params['tabs'] = 'true';
    111     }
    112108
    113109    // Aliases.
  • auto-install-free-ssl/trunk/freemius/templates/forms/affiliation.php

    r2821062 r2929749  
    8888    $module_id                   = $fs->get_id();
    8989    $affiliate_program_terms_url = "https://freemius.com/plugin/{$module_id}/{$slug}/legal/affiliate-program/";
     90
     91    $has_tabs = $fs->_add_tabs_before_content();
    9092?>
    9193<div id="fs_affiliation_content_wrapper" class="wrap">
     
    501503    </div>
    502504<?php
     505    if ( $has_tabs ) {
     506        $fs->_add_tabs_after_content();
     507    }
     508
    503509    $params = array(
    504510        'page'           => 'affiliation',
  • auto-install-free-ssl/trunk/freemius/templates/gdpr-optin-js.php

    r2821062 r2929749  
    3030                    cursor         = $this.css( 'cursor' ),
    3131                    $products      = $gdprOptinNotice.find( 'span[data-plugin-id]' ),
    32                     pluginIDs      = [];
     32                    pluginIDs      = [],
     33                    ajaxUrl        = <?php echo Freemius::ajax_url() ?>;
    3334
    3435                if ( $products.length > 0 ) {
     
    3940
    4041                $.ajax({
    41                     url       : <?php echo Freemius::ajax_url() ?> + '?' + $.param({
     42                        url      : ajaxUrl + (ajaxUrl.includes('?') ? '&' : '?') + $.param({
    4243                        action   : '<?php echo $fs->get_ajax_action( 'gdpr_optin_action' ) ?>',
    4344                        security : '<?php echo $fs->get_ajax_security( 'gdpr_optin_action' ) ?>',
  • auto-install-free-ssl/trunk/freemius/templates/plugin-info/description.php

    r2835481 r2929749  
    5757            <?php $i = 0;
    5858                foreach ( $screenshots as $s => $url ) : ?>
    59                     <?php
    60                     // Relative URLs are replaced with WordPress.org base URL
    61                     // therefore we need to set absolute URLs.
    62                     $url = 'http' . ( WP_FS__IS_HTTPS ? 's' : '' ) . ':' . $url;
    63                     ?>
    6459                    <li class="<?php echo ( 0 === $i % 2 ) ? 'odd' : 'even' ?>">
    6560                        <style>
  • auto-install-free-ssl/trunk/freemius/templates/plugin-info/screenshots.php

    r2750244 r2929749  
    2323    <?php $i = 0;
    2424        foreach ( $screenshots as $s => $url ) : ?>
    25             <?php
    26             // Relative URLs are replaced with WordPress.org base URL
    27             // therefore we need to set absolute URLs.
    28             $url = 'http' . ( WP_FS__IS_HTTPS ? 's' : '' ) . ':' . $url;
    29             ?>
    3025            <li>
    3126                <a href="<?php echo $url ?>" title="<?php echo esc_attr( sprintf( fs_text_inline( 'Click to view full-size screenshot %d', 'view-full-size-x', $plugin->slug ), $i ) ) ?>"><img src="<?php echo $url ?>"></a>
  • auto-install-free-ssl/trunk/freemius/templates/tabs-capture-js.php

    r2821062 r2929749  
    4343                    aboveTabsHtml = settingHtml.substr(0, tabsPosition);
    4444
    45                     var tabsHtml = $('.wrap .nav-tab-wrapper').clone().wrap('<div>').parent().html();
     45                    var tabsHtml = $('.wrap .nav-tab-wrapper').clone().wrap('<div>').parent().html(),
     46                        ajaxUrl  = <?php echo Freemius::ajax_url() ?>;
    4647
    4748                    $.ajax({
    48                         url        : <?php echo Freemius::ajax_url() ?> + '?' + $.param({
     49                            url      : ajaxUrl + (ajaxUrl.includes('?') ? '&' : '?') + $.param({
    4950                            action   : '<?php echo $fs->get_ajax_action( 'store_tabs' ) ?>',
    5051                            security : '<?php echo $fs->get_ajax_security( 'store_tabs' ) ?>',
  • auto-install-free-ssl/trunk/readme.txt

    r2921218 r2929749  
    77Requires at least: 4.1
    88Tested up to: 6.2
    9 Stable tag: 3.5.0
     9Stable tag: 3.5.1
    1010Requires PHP: 5.6
    1111Development location: https://freessl.tech
     
    2727
    2828
    29 `    325,000+ DOWNLOADS!!`
     29`    330,500+ DOWNLOADS!!`
    3030
    3131
Note: See TracChangeset for help on using the changeset viewer.