Really Simple SSL - Version 5.3.0

Version Description

  • Improvement: added PHP 8.1 compatibility
  • Improvement: updated .htaccess redirect comment
  • New: add installation helper
  • Improvement: is_writable check in Let's Encrypt
  • Improvement: Catch not set subject alternative and common names in cert
Download this release

Release Info

Developer RogierLankhorst
Plugin Icon 128x128 Really Simple SSL
Version 5.3.0
Comparing to
See all releases

Code changes from version 5.2.3 to 5.3.0

class-admin.php CHANGED
@@ -319,6 +319,22 @@ class rsssl_admin extends rsssl_front_end
319
  }
320
  }
321
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
322
  update_option( 'rsssl_current_version', rsssl_version );
323
  }
324
 
@@ -584,7 +600,7 @@ class rsssl_admin extends rsssl_front_end
584
  <li class="rsssl-error">
585
  <?php _e("Could not test certificate.", "really-simple-ssl") ?>&nbsp;<?php _e("Automatic certificate detection is not possible on your server.", "really-simple-ssl") ?>
586
  <?php RSSSL()->rsssl_help->get_help_tip(__("If you’re certain an SSL certificate is present, please check “Override SSL detection” to continue activating SSL.", "really-simple-ssl"), false, true );?>
587
- </li>
588
  <?php } else { ?>
589
  <li class="rsssl-error"><?php _e("No SSL certificate has been detected.", "really-simple-ssl") ?>&nbsp;
590
  <?php printf(__("Please %srefresh detection%s if a certificate has been installed recently.", "really-simple-ssl"), '<a href="'.add_query_arg(array('page'=>'rlrsssl_really_simple_ssl', 'rsssl_recheck_certificate'=>1), admin_url('options-general.php')).'">', '</a>') ?>
@@ -1073,11 +1089,15 @@ class rsssl_admin extends rsssl_front_end
1073
  *
1074
  */
1075
 
1076
- public function trace_log($msg)
1077
  {
1078
  if (defined('RSSSL_DOING_SYSTEM_STATUS') || (defined('WP_DEBUG') && WP_DEBUG ) )
1079
 
1080
- if (strpos($this->debug_log, $msg)) return;
 
 
 
 
1081
  $this->debug_log = $this->debug_log . "\n" . $msg;
1082
  }
1083
 
@@ -1920,9 +1940,11 @@ class rsssl_admin extends rsssl_front_end
1920
 
1921
  } else {
1922
  // remove everything
1923
- $pattern = "/#\s?BEGIN\s?rlrssslReallySimpleSSL.*?#\s?END\s?rlrssslReallySimpleSSL/s";
 
1924
  //only remove if the pattern is there at all
1925
- if (preg_match($pattern, $htaccess)) $htaccess = preg_replace($pattern, "", $htaccess);
 
1926
 
1927
  }
1928
 
@@ -1935,33 +1957,6 @@ class rsssl_admin extends rsssl_front_end
1935
  }
1936
  }
1937
 
1938
- /**
1939
- * @return bool|string
1940
- *
1941
- * Get the .htaccess version
1942
- *
1943
- * @access public
1944
- *
1945
- */
1946
-
1947
- public function get_htaccess_version()
1948
- {
1949
- if (!file_exists($this->htaccess_file())) return false;
1950
-
1951
- $htaccess = file_get_contents($this->htaccess_file());
1952
- $versionpos = strpos($htaccess, "rsssl_version");
1953
-
1954
- if ($versionpos === false) {
1955
- //no version found, so not .htaccess rules.
1956
- return false;
1957
- } else {
1958
- //find closing marker of version
1959
- $close = strpos($htaccess, "]", $versionpos);
1960
- $version = substr($htaccess, $versionpos + 14, $close - ($versionpos + 14));
1961
- return $version;
1962
- }
1963
- }
1964
-
1965
  /**
1966
  * @return bool
1967
  *
@@ -2020,9 +2015,10 @@ class rsssl_admin extends rsssl_front_end
2020
 
2021
  $htaccess = file_get_contents($this->htaccess_file());
2022
 
2023
- $check = null;
2024
- preg_match("/BEGIN rlrssslReallySimpleSSL/", $htaccess, $check);
2025
- if (count($check) === 0) {
 
2026
  return false;
2027
  } else {
2028
  return true;
@@ -2318,9 +2314,13 @@ class rsssl_admin extends rsssl_front_end
2318
  return;
2319
  }
2320
 
2321
- $htaccess = file_get_contents($this->htaccess_file());
2322
- $htaccess = preg_replace("/#\s?BEGIN\s?rlrssslReallySimpleSSL.*?#\s?END\s?rlrssslReallySimpleSSL/s", "", $htaccess);
2323
- $htaccess = preg_replace("/\n+/", "\n", $htaccess);
 
 
 
 
2324
 
2325
  $rules = $this->get_redirect_rules();
2326
 
@@ -2510,7 +2510,7 @@ class rsssl_admin extends rsssl_front_end
2510
  }
2511
 
2512
  if (strlen($rule) > 0) {
2513
- $rule = "\n" . "# BEGIN rlrssslReallySimpleSSL rsssl_version[" . rsssl_version . "]\n" . $rule . "# END rlrssslReallySimpleSSL" . "\n";
2514
  }
2515
 
2516
  $rule = apply_filters("rsssl_htaccess_output", $rule);
@@ -2925,7 +2925,7 @@ class rsssl_admin extends rsssl_front_end
2925
  *
2926
  */
2927
 
2928
- public function admin_tabs($current = 'homepage')
2929
  {
2930
  $tabs = array(
2931
  'configuration' => '',
@@ -3917,10 +3917,9 @@ class rsssl_admin extends rsssl_front_end
3917
 
3918
  public function settings_page()
3919
  {
3920
- if (!current_user_can($this->capability)) return;
3921
- if ( isset ($_GET['tab'] ) ) $this->admin_tabs( $_GET['tab'] ); else $this->admin_tabs('configuration');
3922
- if ( isset ($_GET['tab'] ) ) $tab = $_GET['tab']; else $tab = 'configuration';
3923
-
3924
  $high_contrast = $this->high_contrast ? 'rsssl-high-contrast' : ''; ?>
3925
  <div class="rsssl-container <?php echo $high_contrast ?>">
3926
  <div class="rsssl-main"><?php
@@ -3930,8 +3929,8 @@ class rsssl_admin extends rsssl_front_end
3930
  do_action("rsssl_configuration_page");
3931
  break;
3932
  }
3933
- //possibility to hook into the tabs.
3934
  do_action("show_tab_{$tab}");
 
3935
  ?>
3936
  </div>
3937
  </div>
@@ -4465,121 +4464,50 @@ class rsssl_admin extends rsssl_front_end
4465
 
4466
  ?>
4467
  <?php add_thickbox();?>
4468
- <?php if ( is_rtl() ) { ?>
4469
  <style>
4470
  #TB_ajaxContent.rsssl-deactivation-popup {
4471
  text-align: center !important;
4472
- width:750px;
4473
  }
4474
  #TB_window.rsssl-deactivation-popup {
4475
- height: 440px !important;
4476
- border-right: 7px solid black;
 
 
 
 
 
 
 
 
 
4477
  }
4478
  .rsssl-deactivation-popup #TB_title{
4479
- height: 70px;
4480
- border-bottom: 1px solid #dedede;
4481
- }
4482
- .rsssl-deactivation-popup #TB_ajaxWindowTitle {
4483
- font-weight:bold;
4484
- font-size:30px;
4485
- padding: 20px;
4486
- }
4487
-
4488
- .rsssl-deactivation-popup .tb-close-icon {
4489
- color:#dedede;
4490
- width: 50px;
4491
- height: 50px;
4492
- top: 12px;
4493
- left: 20px;
4494
- }
4495
- .rsssl-deactivation-popup .tb-close-icon:before {
4496
- font: normal 50px/50px dashicons;
4497
- }
4498
- .rsssl-deactivation-popup #TB_closeWindowButton:focus .tb-close-icon {
4499
- outline:0;
4500
- box-shadow: 0 0 0 0 #5b9dd9, 0 0 0 0 rgba(30, 140, 190, .8);
4501
- color:#dedede;
4502
- }
4503
- .rsssl-deactivation-popup #TB_closeWindowButton .tb-close-icon:hover {
4504
- color:#666;
4505
- }
4506
- .rsssl-deactivation-popup #TB_closeWindowButton:focus {
4507
- outline:0;
4508
- }
4509
- .rsssl-deactivation-popup #TB_ajaxContent {
4510
- width: 100% !important;
4511
- padding: 0;
4512
- }
4513
-
4514
- .rsssl-deactivation-popup .button-rsssl-tertiary.button {
4515
- background-color: #D7263D !important;
4516
- color: white !important;
4517
- border-color: #D7263D;
4518
- }
4519
-
4520
- .rsssl-deactivation-popup .button-rsssl-tertiary.button:hover {
4521
- background-color: #f1f1f1 !important;
4522
- color: #d7263d !important;
4523
- }
4524
-
4525
- .rsssl-deactivate-notice-content {
4526
- margin: 20px
4527
- }
4528
- .rsssl-deactivate-notice-content h3 , .rsssl-deactivate-notice-content ul{
4529
- font-size:1.1em;
4530
- }
4531
-
4532
- .rsssl-deactivate-notice-footer {
4533
- padding-top: 20px;
4534
- position:absolute;
4535
- bottom:15px;
4536
- width: 94%;
4537
- margin-right: 3%;
4538
- border-top: 1px solid #dedede;
4539
- }
4540
-
4541
- .rsssl-deactivation-popup ul {
4542
- list-style: circle;
4543
- padding-right: 20px;
4544
- }
4545
- .rsssl-deactivation-popup a {
4546
- margin-left:10px !important;
4547
- }
4548
- </style>
4549
- <?php } else { ?>
4550
- <style>
4551
- #TB_ajaxContent.rsssl-deactivation-popup {
4552
- text-align: center !important;
4553
- width:750px;
4554
- }
4555
- #TB_window.rsssl-deactivation-popup {
4556
- height: 440px !important;
4557
- border-left: 7px solid black;
4558
- }
4559
- .rsssl-deactivation-popup #TB_title{
4560
- height: 70px;
4561
- border-bottom: 1px solid #dedede;
4562
  }
4563
  .rsssl-deactivation-popup #TB_ajaxWindowTitle {
4564
  font-weight:bold;
4565
- font-size:30px;
4566
  padding: 20px;
 
4567
  }
4568
 
4569
  .rsssl-deactivation-popup .tb-close-icon {
4570
- color:#dedede;
4571
- width: 50px;
4572
- height: 50px;
4573
  top: 12px;
4574
  right: 20px;
4575
  }
4576
  .rsssl-deactivation-popup .tb-close-icon:before {
4577
- font: normal 50px/50px dashicons;
4578
  }
4579
  .rsssl-deactivation-popup #TB_closeWindowButton:focus .tb-close-icon {
4580
  outline:0;
4581
- box-shadow: 0 0 0 0 #5b9dd9, 0 0 0 0 rgba(30, 140, 190, .8);
4582
- color:#dedede;
4583
  }
4584
  .rsssl-deactivation-popup #TB_closeWindowButton .tb-close-icon:hover {
4585
  color:#666;
@@ -4589,7 +4517,8 @@ class rsssl_admin extends rsssl_front_end
4589
  }
4590
  .rsssl-deactivation-popup #TB_ajaxContent {
4591
  width: 100% !important;
4592
- padding: 0;
 
4593
  }
4594
 
4595
  .rsssl-deactivation-popup .button-rsssl-tertiary.button {
@@ -4605,26 +4534,33 @@ class rsssl_admin extends rsssl_front_end
4605
 
4606
  .rsssl-deactivate-notice-content {
4607
  margin: 20px
 
4608
  }
4609
  .rsssl-deactivate-notice-content h3 , .rsssl-deactivate-notice-content ul{
4610
- font-size:1.1em;
4611
  }
4612
 
4613
  .rsssl-deactivate-notice-footer {
4614
- padding-top: 20px;
 
 
4615
  position:absolute;
4616
- bottom:15px;
4617
- width: 94%;
4618
- margin-left: 3%;
4619
- border-top: 1px solid #dedede;
4620
  }
4621
 
4622
  .rsssl-deactivation-popup ul {
4623
- list-style: circle;
4624
  padding-left: 20px;
4625
  }
4626
- .rsssl-deactivation-popup a {
4627
- margin-right:10px !important;
 
 
 
 
 
 
 
 
4628
  }
4629
  </style>
4630
  <?php } ?>
@@ -4633,7 +4569,7 @@ class rsssl_admin extends rsssl_front_end
4633
  $('#rsssl_close_tb_window').click(tb_remove);
4634
  $(document).on('click', '#deactivate-really-simple-ssl', function(e){
4635
  e.preventDefault();
4636
- tb_show( '<?php _e("Are you sure?", "really-simple-ssl") ?>', '#TB_inline?height=420&inlineId=deactivate_keep_ssl', 'null');
4637
  $("#TB_window").addClass('rsssl-deactivation-popup');
4638
 
4639
  });
@@ -5158,7 +5094,7 @@ if ( !function_exists('rsssl_letsencrypt_wizard_url') ) {
5158
  if ( !function_exists('rsssl_detected_duplicate_ssl_plugin')) {
5159
  function rsssl_detected_duplicate_ssl_plugin( $return_name = false ){
5160
  $plugin = false;
5161
- if ( defined('WPLE_VERSION') ){
5162
  $plugin = "WP Encryption";
5163
  } elseif( defined('WPSSL_VER') ) {
5164
  $plugin = "WP Free SSL";
@@ -5197,4 +5133,4 @@ if ( !function_exists('rsssl_ssl_detection_overridden' ) ) {
5197
  }
5198
  return false;
5199
  }
5200
- }
319
  }
320
  }
321
 
322
+ if ( $prev_version && version_compare( $prev_version, '5.3.0', '<=' ) ) {
323
+
324
+ if ( file_exists($this->htaccess_file() ) && is_writable($this->htaccess_file() ) ) {
325
+ $htaccess = file_get_contents( $this->htaccess_file() );
326
+
327
+ $pattern_start = "/rlrssslReallySimpleSSL rsssl_version\[.*.]/";
328
+ $pattern_end = "/rlrssslReallySimpleSSL/";
329
+
330
+ if ( preg_match_all( $pattern_start, $htaccess ) ) {
331
+ $htaccess = preg_replace( $pattern_start, "Really Simple SSL Redirect " . rsssl_version, $htaccess );
332
+ $htaccess = preg_replace( $pattern_end, "Really Simple SSL Redirect", $htaccess );
333
+ file_put_contents( $this->htaccess_file(), $htaccess );
334
+ }
335
+ }
336
+ }
337
+
338
  update_option( 'rsssl_current_version', rsssl_version );
339
  }
340
 
600
  <li class="rsssl-error">
601
  <?php _e("Could not test certificate.", "really-simple-ssl") ?>&nbsp;<?php _e("Automatic certificate detection is not possible on your server.", "really-simple-ssl") ?>
602
  <?php RSSSL()->rsssl_help->get_help_tip(__("If you’re certain an SSL certificate is present, please check “Override SSL detection” to continue activating SSL.", "really-simple-ssl"), false, true );?>
603
+ </li>
604
  <?php } else { ?>
605
  <li class="rsssl-error"><?php _e("No SSL certificate has been detected.", "really-simple-ssl") ?>&nbsp;
606
  <?php printf(__("Please %srefresh detection%s if a certificate has been installed recently.", "really-simple-ssl"), '<a href="'.add_query_arg(array('page'=>'rlrsssl_really_simple_ssl', 'rsssl_recheck_certificate'=>1), admin_url('options-general.php')).'">', '</a>') ?>
1089
  *
1090
  */
1091
 
1092
+ public function trace_log( $msg )
1093
  {
1094
  if (defined('RSSSL_DOING_SYSTEM_STATUS') || (defined('WP_DEBUG') && WP_DEBUG ) )
1095
 
1096
+ if ( $this->debug_log !== null ) {
1097
+ if ( strpos( $this->debug_log, $msg ) ) {
1098
+ return;
1099
+ }
1100
+ }
1101
  $this->debug_log = $this->debug_log . "\n" . $msg;
1102
  }
1103
 
1940
 
1941
  } else {
1942
  // remove everything
1943
+ $pattern_old = "/#\s?BEGIN\s?rlrssslReallySimpleSSL.*?#\s?END\s?rlrssslReallySimpleSSL/s";
1944
+ $pattern_new = "/#\s?BEGIN\s?Really Simple SSL Redirect.*?#\s?END\s?Really Simple SSL Redirect/s";
1945
  //only remove if the pattern is there at all
1946
+ if (preg_match($pattern_old, $htaccess)) $htaccess = preg_replace($pattern_old, "", $htaccess);
1947
+ if (preg_match($pattern_new, $htaccess)) $htaccess = preg_replace($pattern_new, "", $htaccess);
1948
 
1949
  }
1950
 
1957
  }
1958
  }
1959
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1960
  /**
1961
  * @return bool
1962
  *
2015
 
2016
  $htaccess = file_get_contents($this->htaccess_file());
2017
 
2018
+ preg_match("/BEGIN rlrssslReallySimpleSSL/", $htaccess, $old);
2019
+ preg_match("/BEGIN Really Simple SSL Redirect/", $htaccess, $new);
2020
+
2021
+ if ( count( $old ) === 0 && count( $new ) === 0 ) {
2022
  return false;
2023
  } else {
2024
  return true;
2314
  return;
2315
  }
2316
 
2317
+ $pattern_old = "/#\s?BEGIN\s?rlrssslReallySimpleSSL.*?#\s?END\s?rlrssslReallySimpleSSL/s";
2318
+ $pattern_new = "/#\s?BEGIN\s?Really Simple SSL Redirect.*?#\s?END\s?Really Simple SSL Redirect/s";
2319
+
2320
+ $htaccess = file_get_contents($this->htaccess_file());
2321
+ $htaccess = preg_replace($pattern_old, "", $htaccess);
2322
+ $htaccess = preg_replace($pattern_new, "", $htaccess);
2323
+ $htaccess = preg_replace("/\n+/", "\n", $htaccess);
2324
 
2325
  $rules = $this->get_redirect_rules();
2326
 
2510
  }
2511
 
2512
  if (strlen($rule) > 0) {
2513
+ $rule = "\n" . "# BEGIN Really Simple SSL Redirect" . rsssl_version . "\n" . $rule . "# END Really Simple SSL Redirect" . "\n";
2514
  }
2515
 
2516
  $rule = apply_filters("rsssl_htaccess_output", $rule);
2925
  *
2926
  */
2927
 
2928
+ public function admin_tabs($current = 'configuration')
2929
  {
2930
  $tabs = array(
2931
  'configuration' => '',
3917
 
3918
  public function settings_page()
3919
  {
3920
+ if (!current_user_can($this->capability)) return;
3921
+ $tab = isset( $_GET['tab']) ? sanitize_title($_GET['tab']) : 'configuration';
3922
+ $this->admin_tabs($tab );
 
3923
  $high_contrast = $this->high_contrast ? 'rsssl-high-contrast' : ''; ?>
3924
  <div class="rsssl-container <?php echo $high_contrast ?>">
3925
  <div class="rsssl-main"><?php
3929
  do_action("rsssl_configuration_page");
3930
  break;
3931
  }
 
3932
  do_action("show_tab_{$tab}");
3933
+ do_action("rsssl_show_tab_{$tab}");
3934
  ?>
3935
  </div>
3936
  </div>
4464
 
4465
  ?>
4466
  <?php add_thickbox();?>
4467
+ <?php { ?>
4468
  <style>
4469
  #TB_ajaxContent.rsssl-deactivation-popup {
4470
  text-align: center !important;
 
4471
  }
4472
  #TB_window.rsssl-deactivation-popup {
4473
+ height:390px!important;
4474
+ top:initial!important;
4475
+ margin-top:initial!important;
4476
+ margin-left:initial!important;
4477
+ display:flex;
4478
+ flex-direction: column;
4479
+ top: 50%!important;
4480
+ left: 50%;
4481
+ transform: translate(-50%, -50%);
4482
+ width:576px!important;
4483
+ border-radius:12px!important;
4484
  }
4485
  .rsssl-deactivation-popup #TB_title{
4486
+ padding-bottom: 20px;
4487
+ border-radius:12px;
4488
+ border-bottom:none!important;
4489
+ background:#fff#important;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
4490
  }
4491
  .rsssl-deactivation-popup #TB_ajaxWindowTitle {
4492
  font-weight:bold;
4493
+ font-size:20px;
4494
  padding: 20px;
4495
+ background:#fff#important;
4496
  }
4497
 
4498
  .rsssl-deactivation-popup .tb-close-icon {
4499
+ color:#333;
4500
+ width: 25px;
4501
+ height: 25px;
4502
  top: 12px;
4503
  right: 20px;
4504
  }
4505
  .rsssl-deactivation-popup .tb-close-icon:before {
4506
+ font: normal 25px/25px dashicons;
4507
  }
4508
  .rsssl-deactivation-popup #TB_closeWindowButton:focus .tb-close-icon {
4509
  outline:0;
4510
+ color:#666;
 
4511
  }
4512
  .rsssl-deactivation-popup #TB_closeWindowButton .tb-close-icon:hover {
4513
  color:#666;
4517
  }
4518
  .rsssl-deactivation-popup #TB_ajaxContent {
4519
  width: 100% !important;
4520
+ height:initial!important;
4521
+ padding-left: 20px!important;
4522
  }
4523
 
4524
  .rsssl-deactivation-popup .button-rsssl-tertiary.button {
4534
 
4535
  .rsssl-deactivate-notice-content {
4536
  margin: 20px
4537
+ font-size: 12px!important;
4538
  }
4539
  .rsssl-deactivate-notice-content h3 , .rsssl-deactivate-notice-content ul{
4540
+ font-size:12px!important;
4541
  }
4542
 
4543
  .rsssl-deactivate-notice-footer {
4544
+ display: flex;
4545
+ gap:10px;
4546
+ padding: 20px 10px 20px 0;
4547
  position:absolute;
 
 
 
 
4548
  }
4549
 
4550
  .rsssl-deactivation-popup ul {
4551
+ list-style: disc;
4552
  padding-left: 20px;
4553
  }
4554
+ .rsssl-deactivate-notice-footer .button {
4555
+ border-radius: 6px!important;
4556
+ padding: 10px;
4557
+ min-width: 120px;
4558
+ white-space: nowrap;
4559
+ border-radius: var(--cmplz_button_border_radius);
4560
+ cursor: pointer;
4561
+ text-decoration: none;
4562
+ text-align: center;
4563
+
4564
  }
4565
  </style>
4566
  <?php } ?>
4569
  $('#rsssl_close_tb_window').click(tb_remove);
4570
  $(document).on('click', '#deactivate-really-simple-ssl', function(e){
4571
  e.preventDefault();
4572
+ tb_show( '<?php _e("Are you sure?", "really-simple-ssl") ?>', '#TB_inline?height=auto&inlineId=deactivate_keep_ssl', 'null');
4573
  $("#TB_window").addClass('rsssl-deactivation-popup');
4574
 
4575
  });
5094
  if ( !function_exists('rsssl_detected_duplicate_ssl_plugin')) {
5095
  function rsssl_detected_duplicate_ssl_plugin( $return_name = false ){
5096
  $plugin = false;
5097
+ if ( defined('WPLE_PLUGIN_VERSION') ){
5098
  $plugin = "WP Encryption";
5099
  } elseif( defined('WPSSL_VER') ) {
5100
  $plugin = "WP Free SSL";
5133
  }
5134
  return false;
5135
  }
5136
+ }
class-certificate.php CHANGED
@@ -38,12 +38,10 @@ if ( ! class_exists( 'rsssl_certificate' ) ) {
38
  $domain = site_url();
39
  //Parse to strip off any /subfolder/
40
  $parse = parse_url($domain);
41
- $domain = $parse['host'];
42
-
43
- if ( !function_exists('stream_context_get_params') ) {
44
  set_transient('rsssl_certinfo', 'no-response', DAY_IN_SECONDS);
45
  } else {
46
- //get certificate info
47
  $certinfo = $this->get_certinfo($domain);
48
 
49
  if ( !$certinfo ) {
@@ -85,8 +83,8 @@ if ( ! class_exists( 'rsssl_certificate' ) ) {
85
  {
86
  //first check standard situation
87
  //Get both the common name(s) and the alternative names from the certificate
88
- $certificate_common_names = isset($certinfo['subject']['CN']) ? $certinfo['subject']['CN'] : false;
89
- $certificate_alternative_names = isset($certinfo['extensions']['subjectAltName']) ? $certinfo['extensions']['subjectAltName'] : false;
90
  //Check if the domain is found in either the certificate common name(s) (CN) or alternative name(s) (AN)
91
  $pos_cn = strpos($certificate_common_names, $domain);
92
  $pos_an = strpos($certificate_alternative_names, $domain);
@@ -100,7 +98,7 @@ if ( ! class_exists( 'rsssl_certificate' ) ) {
100
  //strip of asterisk, and check if the wildcard domain is part of current domain
101
  $cert_domains = array();
102
  if ( $this->is_wildcard() ) {
103
- $certificate_alternative_names = isset($certinfo['extensions']['subjectAltName']) ? explode(', ',$certinfo['extensions']['subjectAltName']) : false;
104
  $cert_domains[] = trim(str_replace('*', '', $certificate_common_names));
105
  foreach ($certificate_alternative_names as $subjectAltName) {
106
  $cert_domains[] = trim(str_replace('*', '', $subjectAltName));
38
  $domain = site_url();
39
  //Parse to strip off any /subfolder/
40
  $parse = parse_url($domain);
41
+ if ( !isset($parse['host']) || !function_exists('stream_context_get_params') ) {
 
 
42
  set_transient('rsssl_certinfo', 'no-response', DAY_IN_SECONDS);
43
  } else {
44
+ $domain = $parse['host'];
45
  $certinfo = $this->get_certinfo($domain);
46
 
47
  if ( !$certinfo ) {
83
  {
84
  //first check standard situation
85
  //Get both the common name(s) and the alternative names from the certificate
86
+ $certificate_common_names = isset($certinfo['subject']['CN']) ? $certinfo['subject']['CN'] : '';
87
+ $certificate_alternative_names = isset($certinfo['extensions']['subjectAltName']) ? $certinfo['extensions']['subjectAltName'] : '';
88
  //Check if the domain is found in either the certificate common name(s) (CN) or alternative name(s) (AN)
89
  $pos_cn = strpos($certificate_common_names, $domain);
90
  $pos_an = strpos($certificate_alternative_names, $domain);
98
  //strip of asterisk, and check if the wildcard domain is part of current domain
99
  $cert_domains = array();
100
  if ( $this->is_wildcard() ) {
101
+ $certificate_alternative_names = explode(', ',$certificate_alternative_names);
102
  $cert_domains[] = trim(str_replace('*', '', $certificate_common_names));
103
  foreach ($certificate_alternative_names as $subjectAltName) {
104
  $cert_domains[] = trim(str_replace('*', '', $subjectAltName));
class-server.php CHANGED
@@ -46,7 +46,8 @@ if ( ! class_exists( 'rsssl_server' ) ) {
46
  if ( defined( 'RSSSL_SERVER_OVERRIDE' ) ) {
47
  return RSSSL_SERVER_OVERRIDE;
48
  }
49
- $server_raw = strtolower( filter_var( $_SERVER['SERVER_SOFTWARE'], FILTER_SANITIZE_STRING ) );
 
50
 
51
  //figure out what server they're using
52
  if ( strpos( $server_raw, 'apache' ) !== false ) {
46
  if ( defined( 'RSSSL_SERVER_OVERRIDE' ) ) {
47
  return RSSSL_SERVER_OVERRIDE;
48
  }
49
+
50
+ $server_raw = strtolower( htmlspecialchars( $_SERVER['SERVER_SOFTWARE'] ) );
51
 
52
  //figure out what server they're using
53
  if ( strpos( $server_raw, 'apache' ) !== false ) {
lets-encrypt/class-letsencrypt-handler.php CHANGED
@@ -1337,11 +1337,11 @@ class rsssl_letsencrypt_handler {
1337
 
1338
  public function key_directory(){
1339
  $directory = $this->get_directory_path();
1340
- if ( ! file_exists( $directory . 'ssl' ) ) {
1341
  mkdir( $directory . 'ssl' );
1342
  }
1343
 
1344
- if ( ! file_exists( $directory . 'ssl/keys' ) ) {
1345
  mkdir( $directory . 'ssl/keys' );
1346
  }
1347
 
1337
 
1338
  public function key_directory(){
1339
  $directory = $this->get_directory_path();
1340
+ if ( ! file_exists( $directory . 'ssl' ) && is_writable($directory) ) {
1341
  mkdir( $directory . 'ssl' );
1342
  }
1343
 
1344
+ if ( ! file_exists( $directory . 'ssl/keys' ) && is_writable($directory.'ssl') ) {
1345
  mkdir( $directory . 'ssl/keys' );
1346
  }
1347
 
lets-encrypt/wizard/assets/select2/css/select2.min.css CHANGED
@@ -1 +1 @@
1
- .select2-container{box-sizing:border-box;display:inline-block;margin:0;position:relative;vertical-align:middle}.select2-container .select2-selection--single{box-sizing:border-box;cursor:pointer;display:block;height:28px;user-select:none;-webkit-user-select:none}.select2-container .select2-selection--single .select2-selection__rendered{display:block;padding-left:8px;padding-right:20px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.select2-container .select2-selection--single .select2-selection__clear{position:relative}.select2-container[dir="rtl"] .select2-selection--single .select2-selection__rendered{padding-right:8px;padding-left:20px}.select2-container .select2-selection--multiple{box-sizing:border-box;cursor:pointer;display:block;min-height:32px;user-select:none;-webkit-user-select:none}.select2-container .select2-selection--multiple .select2-selection__rendered{display:inline-block;overflow:hidden;padding-left:8px;text-overflow:ellipsis;white-space:nowrap}.select2-container .select2-search--inline{float:left}.select2-container .select2-search--inline .select2-search__field{box-sizing:border-box;border:0;font-size:100%;margin-top:5px;padding:0}.select2-container .select2-search--inline .select2-search__field::-webkit-search-cancel-button{-webkit-appearance:none}.select2-dropdown{background-color:white;border:1px solid #aaa;border-radius:4px;box-sizing:border-box;display:block;position:absolute;left:-100000px;width:100%;z-index:1051}.select2-results{display:block}.select2-results__options{list-style:none;margin:0;padding:0}.select2-results__option{padding:6px;user-select:none;-webkit-user-select:none}.select2-results__option[aria-selected]{cursor:pointer}.select2-container--open .select2-dropdown{left:0}.select2-container--open .select2-dropdown--above{border-bottom:0;border-bottom-left-radius:0;border-bottom-right-radius:0}.select2-container--open .select2-dropdown--below{border-top:0;border-top-left-radius:0;border-top-right-radius:0}.select2-search--dropdown{display:block;padding:4px}.select2-search--dropdown .select2-search__field{padding:4px;width:100%;box-sizing:border-box}.select2-search--dropdown .select2-search__field::-webkit-search-cancel-button{-webkit-appearance:none}.select2-search--dropdown.select2-search--hide{display:none}.select2-close-mask{border:0;margin:0;padding:0;display:block;position:fixed;left:0;top:0;min-height:100%;min-width:100%;height:auto;width:auto;opacity:0;z-index:99;background-color:#fff;filter:alpha(opacity=0)}.select2-hidden-accessible{border:0 !important;clip:rect(0 0 0 0) !important;-webkit-clip-path:inset(50%) !important;clip-path:inset(50%) !important;height:1px !important;overflow:hidden !important;padding:0 !important;position:absolute !important;width:1px !important;white-space:nowrap !important}.select2-container--default .select2-selection--single{background-color:#fff;border:1px solid #aaa;border-radius:4px}.select2-container--default .select2-selection--single .select2-selection__rendered{color:#444;line-height:28px}.select2-container--default .select2-selection--single .select2-selection__clear{cursor:pointer;float:right;font-weight:bold}.select2-container--default .select2-selection--single .select2-selection__placeholder{color:#999}.select2-container--default .select2-selection--single .select2-selection__arrow{height:26px;position:absolute;top:1px;right:1px;width:20px}.select2-container--default .select2-selection--single .select2-selection__arrow b{border-color:#888 transparent transparent transparent;border-style:solid;border-width:5px 4px 0 4px;height:0;left:50%;margin-left:-4px;margin-top:-2px;position:absolute;top:50%;width:0}.select2-container--default[dir="rtl"] .select2-selection--single .select2-selection__clear{float:left}.select2-container--default[dir="rtl"] .select2-selection--single .select2-selection__arrow{left:1px;right:auto}.select2-container--default.select2-container--disabled .select2-selection--single{background-color:#eee;cursor:default}.select2-container--default.select2-container--disabled .select2-selection--single .select2-selection__clear{display:none}.select2-container--default.select2-container--open .select2-selection--single .select2-selection__arrow b{border-color:transparent transparent #888 transparent;border-width:0 4px 5px 4px}.select2-container--default .select2-selection--multiple{background-color:white;border:1px solid #aaa;border-radius:4px;cursor:text}.select2-container--default .select2-selection--multiple .select2-selection__rendered{box-sizing:border-box;list-style:none;margin:0;padding:0 5px;width:100%}.select2-container--default .select2-selection--multiple .select2-selection__rendered li{list-style:none}.select2-container--default .select2-selection--multiple .select2-selection__placeholder{color:#999;margin-top:5px;float:left}.select2-container--default .select2-selection--multiple .select2-selection__clear{cursor:pointer;float:right;font-weight:bold;margin-top:5px;margin-right:10px}.select2-container--default .select2-selection--multiple .select2-selection__choice{background-color:#e4e4e4;border:1px solid #aaa;border-radius:4px;cursor:default;float:left;margin-right:5px;margin-top:5px;padding:0 5px}.select2-container--default .select2-selection--multiple .select2-selection__choice__remove{color:#999;cursor:pointer;display:inline-block;font-weight:bold;margin-right:2px}.select2-container--default .select2-selection--multiple .select2-selection__choice__remove:hover{color:#333}.select2-container--default[dir="rtl"] .select2-selection--multiple .select2-selection__choice,.select2-container--default[dir="rtl"] .select2-selection--multiple .select2-selection__placeholder,.select2-container--default[dir="rtl"] .select2-selection--multiple .select2-search--inline{float:right}.select2-container--default[dir="rtl"] .select2-selection--multiple .select2-selection__choice{margin-left:5px;margin-right:auto}.select2-container--default[dir="rtl"] .select2-selection--multiple .select2-selection__choice__remove{margin-left:2px;margin-right:auto}.select2-container--default.select2-container--focus .select2-selection--multiple{border:solid black 1px;outline:0}.select2-container--default.select2-container--disabled .select2-selection--multiple{background-color:#eee;cursor:default}.select2-container--default.select2-container--disabled .select2-selection__choice__remove{display:none}.select2-container--default.select2-container--open.select2-container--above .select2-selection--single,.select2-container--default.select2-container--open.select2-container--above .select2-selection--multiple{border-top-left-radius:0;border-top-right-radius:0}.select2-container--default.select2-container--open.select2-container--below .select2-selection--single,.select2-container--default.select2-container--open.select2-container--below .select2-selection--multiple{border-bottom-left-radius:0;border-bottom-right-radius:0}.select2-container--default .select2-search--dropdown .select2-search__field{border:1px solid #aaa}.select2-container--default .select2-search--inline .select2-search__field{background:transparent;border:0;outline:0;box-shadow:none;-webkit-appearance:textfield}.select2-container--default .select2-results>.select2-results__options{max-height:200px;overflow-y:auto}.select2-container--default .select2-results__option[role=group]{padding:0}.select2-container--default .select2-results__option[aria-disabled=true]{color:#999}.select2-container--default .select2-results__option[aria-selected=true]{background-color:#ddd}.select2-container--default .select2-results__option .select2-results__option{padding-left:1em}.select2-container--default .select2-results__option .select2-results__option .select2-results__group{padding-left:0}.select2-container--default .select2-results__option .select2-results__option .select2-results__option{margin-left:-1em;padding-left:2em}.select2-container--default .select2-results__option .select2-results__option .select2-results__option .select2-results__option{margin-left:-2em;padding-left:3em}.select2-container--default .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option{margin-left:-3em;padding-left:4em}.select2-container--default .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option{margin-left:-4em;padding-left:5em}.select2-container--default .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option{margin-left:-5em;padding-left:6em}.select2-container--default .select2-results__option--highlighted[aria-selected]{background-color:#5897fb;color:white}.select2-container--default .select2-results__group{cursor:default;display:block;padding:6px}.select2-container--classic .select2-selection--single{background-color:#f7f7f7;border:1px solid #aaa;border-radius:4px;outline:0;background-image:-webkit-linear-gradient(top,white 50%,#eee 100%);background-image:-o-linear-gradient(top,white 50%,#eee 100%);background-image:linear-gradient(to bottom,white 50%,#eee 100%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#FFFFFFFF',endColorstr='#FFEEEEEE',GradientType=0)}.select2-container--classic .select2-selection--single:focus{border:1px solid #5897fb}.select2-container--classic .select2-selection--single .select2-selection__rendered{color:#444;line-height:28px}.select2-container--classic .select2-selection--single .select2-selection__clear{cursor:pointer;float:right;font-weight:bold;margin-right:10px}.select2-container--classic .select2-selection--single .select2-selection__placeholder{color:#999}.select2-container--classic .select2-selection--single .select2-selection__arrow{background-color:#ddd;border:0;border-left:1px solid #aaa;border-top-right-radius:4px;border-bottom-right-radius:4px;height:26px;position:absolute;top:1px;right:1px;width:20px;background-image:-webkit-linear-gradient(top,#eee 50%,#ccc 100%);background-image:-o-linear-gradient(top,#eee 50%,#ccc 100%);background-image:linear-gradient(to bottom,#eee 50%,#ccc 100%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#FFEEEEEE',endColorstr='#FFCCCCCC',GradientType=0)}.select2-container--classic .select2-selection--single .select2-selection__arrow b{border-color:#888 transparent transparent transparent;border-style:solid;border-width:5px 4px 0 4px;height:0;left:50%;margin-left:-4px;margin-top:-2px;position:absolute;top:50%;width:0}.select2-container--classic[dir="rtl"] .select2-selection--single .select2-selection__clear{float:left}.select2-container--classic[dir="rtl"] .select2-selection--single .select2-selection__arrow{border:0;border-right:1px solid #aaa;border-radius:0;border-top-left-radius:4px;border-bottom-left-radius:4px;left:1px;right:auto}.select2-container--classic.select2-container--open .select2-selection--single{border:1px solid #5897fb}.select2-container--classic.select2-container--open .select2-selection--single .select2-selection__arrow{background:transparent;border:0}.select2-container--classic.select2-container--open .select2-selection--single .select2-selection__arrow b{border-color:transparent transparent #888 transparent;border-width:0 4px 5px 4px}.select2-container--classic.select2-container--open.select2-container--above .select2-selection--single{border-top:0;border-top-left-radius:0;border-top-right-radius:0;background-image:-webkit-linear-gradient(top,white 0,#eee 50%);background-image:-o-linear-gradient(top,white 0,#eee 50%);background-image:linear-gradient(to bottom,white 0,#eee 50%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#FFFFFFFF',endColorstr='#FFEEEEEE',GradientType=0)}.select2-container--classic.select2-container--open.select2-container--below .select2-selection--single{border-bottom:0;border-bottom-left-radius:0;border-bottom-right-radius:0;background-image:-webkit-linear-gradient(top,#eee 50%,white 100%);background-image:-o-linear-gradient(top,#eee 50%,white 100%);background-image:linear-gradient(to bottom,#eee 50%,white 100%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#FFEEEEEE',endColorstr='#FFFFFFFF',GradientType=0)}.select2-container--classic .select2-selection--multiple{background-color:white;border:1px solid #aaa;border-radius:4px;cursor:text;outline:0}.select2-container--classic .select2-selection--multiple:focus{border:1px solid #5897fb}.select2-container--classic .select2-selection--multiple .select2-selection__rendered{list-style:none;margin:0;padding:0 5px}.select2-container--classic .select2-selection--multiple .select2-selection__clear{display:none}.select2-container--classic .select2-selection--multiple .select2-selection__choice{background-color:#e4e4e4;border:1px solid #aaa;border-radius:4px;cursor:default;float:left;margin-right:5px;margin-top:5px;padding:0 5px}.select2-container--classic .select2-selection--multiple .select2-selection__choice__remove{color:#888;cursor:pointer;display:inline-block;font-weight:bold;margin-right:2px}.select2-container--classic .select2-selection--multiple .select2-selection__choice__remove:hover{color:#555}.select2-container--classic[dir="rtl"] .select2-selection--multiple .select2-selection__choice{float:right;margin-left:5px;margin-right:auto}.select2-container--classic[dir="rtl"] .select2-selection--multiple .select2-selection__choice__remove{margin-left:2px;margin-right:auto}.select2-container--classic.select2-container--open .select2-selection--multiple{border:1px solid #5897fb}.select2-container--classic.select2-container--open.select2-container--above .select2-selection--multiple{border-top:0;border-top-left-radius:0;border-top-right-radius:0}.select2-container--classic.select2-container--open.select2-container--below .select2-selection--multiple{border-bottom:0;border-bottom-left-radius:0;border-bottom-right-radius:0}.select2-container--classic .select2-search--dropdown .select2-search__field{border:1px solid #aaa;outline:0}.select2-container--classic .select2-search--inline .select2-search__field{outline:0;box-shadow:none}.select2-container--classic .select2-dropdown{background-color:white;border:1px solid transparent}.select2-container--classic .select2-dropdown--above{border-bottom:0}.select2-container--classic .select2-dropdown--below{border-top:0}.select2-container--classic .select2-results>.select2-results__options{max-height:200px;overflow-y:auto}.select2-container--classic .select2-results__option[role=group]{padding:0}.select2-container--classic .select2-results__option[aria-disabled=true]{color:grey}.select2-container--classic .select2-results__option--highlighted[aria-selected]{background-color:#3875d7;color:white}.select2-container--classic .select2-results__group{cursor:default;display:block;padding:6px}.select2-container--classic.select2-container--open .select2-dropdown{border-color:#5897fb}
1
+ .select2-container{box-sizing:border-box;display:inline-block;margin:0;position:relative;vertical-align:middle}.select2-container .select2-selection--single{box-sizing:border-box;cursor:pointer;display:block;height:28px;user-select:none;-webkit-user-select:none}.select2-container .select2-selection--single .select2-selection__rendered{display:block;padding-left:8px;padding-right:20px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.select2-container .select2-selection--single .select2-selection__clear{position:relative}.select2-container[dir=rtl] .select2-selection--single .select2-selection__rendered{padding-right:8px;padding-left:20px}.select2-container .select2-selection--multiple{box-sizing:border-box;cursor:pointer;display:block;min-height:32px;user-select:none;-webkit-user-select:none}.select2-container .select2-selection--multiple .select2-selection__rendered{display:inline-block;overflow:hidden;padding-left:8px;text-overflow:ellipsis;white-space:nowrap}.select2-container .select2-search--inline,.select2-container--default[dir=rtl] .select2-selection--single .select2-selection__clear{float:left}.select2-container .select2-search--inline .select2-search__field{box-sizing:border-box;border:0;font-size:100%;margin-top:5px;padding:0}.select2-container .select2-search--inline .select2-search__field::-webkit-search-cancel-button,.select2-search--dropdown .select2-search__field::-webkit-search-cancel-button{-webkit-appearance:none}.select2-dropdown{background-color:#fff;border:1px solid #aaa;border-radius:4px;box-sizing:border-box;display:block;position:absolute;left:-100000px;width:100%;z-index:1051}.select2-results{display:block}.select2-results__options{list-style:none;margin:0;padding:0}.select2-results__option{padding:6px;user-select:none;-webkit-user-select:none}.select2-results__option[aria-selected]{cursor:pointer}.select2-container--open .select2-dropdown{left:0}.select2-container--open .select2-dropdown--above{border-bottom:none;border-bottom-left-radius:0;border-bottom-right-radius:0}.select2-container--open .select2-dropdown--below{border-top:none;border-top-left-radius:0;border-top-right-radius:0}.select2-search--dropdown{display:block;padding:4px}.select2-search--dropdown .select2-search__field{padding:4px;width:100%;box-sizing:border-box}.select2-search--dropdown.select2-search--hide{display:none}.select2-close-mask{border:0;margin:0;padding:0;display:block;position:fixed;left:0;top:0;min-height:100%;min-width:100%;height:auto;width:auto;opacity:0;z-index:99;background-color:#fff;filter:alpha(opacity=0)}.select2-hidden-accessible{border:0!important;clip:rect(0 0 0 0)!important;-webkit-clip-path:inset(50%)!important;clip-path:inset(50%)!important;height:1px!important;overflow:hidden!important;padding:0!important;position:absolute!important;width:1px!important;white-space:nowrap!important}.select2-container--default .select2-selection--multiple,.select2-container--default .select2-selection--single{background-color:#fff;border:1px solid #aaa;border-radius:4px}.select2-container--default .select2-selection--single .select2-selection__rendered{color:#444;line-height:28px}.select2-container--default .select2-selection--single .select2-selection__clear{cursor:pointer;float:right;font-weight:700}.select2-container--default .select2-selection--single .select2-selection__placeholder{color:#999}.select2-container--default .select2-selection--single .select2-selection__arrow{height:26px;position:absolute;top:1px;right:1px;width:20px}.select2-container--classic .select2-selection--single .select2-selection__arrow b,.select2-container--default .select2-selection--single .select2-selection__arrow b{border-color:#888 transparent transparent;border-style:solid;border-width:5px 4px 0;height:0;left:50%;margin-left:-4px;margin-top:-2px;position:absolute;top:50%;width:0}.select2-container--default[dir=rtl] .select2-selection--single .select2-selection__arrow{left:1px;right:auto}.select2-container--default.select2-container--disabled .select2-selection--single{background-color:#eee;cursor:default}.select2-container--default.select2-container--disabled .select2-selection--single .select2-selection__clear{display:none}.select2-container--classic.select2-container--open .select2-selection--single .select2-selection__arrow b,.select2-container--default.select2-container--open .select2-selection--single .select2-selection__arrow b{border-color:transparent transparent #888;border-width:0 4px 5px}.select2-container--default .select2-selection--multiple{cursor:text}.select2-container--default .select2-selection--multiple .select2-selection__rendered{box-sizing:border-box;list-style:none;margin:0;padding:0 5px;width:100%}.select2-container--default .select2-selection--multiple .select2-selection__rendered li{list-style:none}.select2-container--default .select2-selection--multiple .select2-selection__placeholder{color:#999;margin-top:5px;float:left}.select2-container--default .select2-selection--multiple .select2-selection__clear{cursor:pointer;float:right;font-weight:700;margin-top:5px;margin-right:10px}.select2-container--default .select2-selection--multiple .select2-selection__choice{background-color:#e4e4e4;border:1px solid #aaa;border-radius:4px;cursor:default;float:left;margin-right:5px;margin-top:5px;padding:0 5px}.select2-container--default .select2-selection--multiple .select2-selection__choice__remove{color:#999;cursor:pointer;display:inline-block;font-weight:700;margin-right:2px}.select2-container--default .select2-selection--multiple .select2-selection__choice__remove:hover{color:#333}.select2-container--default[dir=rtl] .select2-selection--multiple .select2-search--inline,.select2-container--default[dir=rtl] .select2-selection--multiple .select2-selection__choice,.select2-container--default[dir=rtl] .select2-selection--multiple .select2-selection__placeholder{float:right}.select2-container--default[dir=rtl] .select2-selection--multiple .select2-selection__choice{margin-left:5px;margin-right:auto}.select2-container--default[dir=rtl] .select2-selection--multiple .select2-selection__choice__remove{margin-left:2px;margin-right:auto}.select2-container--default.select2-container--focus .select2-selection--multiple{border:solid #000 1px;outline:0}.select2-container--default.select2-container--disabled .select2-selection--multiple{background-color:#eee;cursor:default}.select2-container--default.select2-container--disabled .select2-selection__choice__remove{display:none}.select2-container--default.select2-container--open.select2-container--above .select2-selection--multiple,.select2-container--default.select2-container--open.select2-container--above .select2-selection--single{border-top-left-radius:0;border-top-right-radius:0}.select2-container--default.select2-container--open.select2-container--below .select2-selection--multiple,.select2-container--default.select2-container--open.select2-container--below .select2-selection--single{border-bottom-left-radius:0;border-bottom-right-radius:0}.select2-container--default .select2-search--dropdown .select2-search__field{border:1px solid #aaa}.select2-container--default .select2-search--inline .select2-search__field{background:0 0;border:0;outline:0;box-shadow:none;-webkit-appearance:textfield}.select2-container--default .select2-results>.select2-results__options{max-height:200px;overflow-y:auto}.select2-container--default .select2-results__option[role=group]{padding:0}.select2-container--default .select2-results__option[aria-disabled=true]{color:#999}.select2-container--default .select2-results__option[aria-selected=true]{background-color:#ddd}.select2-container--default .select2-results__option .select2-results__option{padding-left:1em}.select2-container--default .select2-results__option .select2-results__option .select2-results__group{padding-left:0}.select2-container--default .select2-results__option .select2-results__option .select2-results__option{margin-left:-1em;padding-left:2em}.select2-container--default .select2-results__option .select2-results__option .select2-results__option .select2-results__option{margin-left:-2em;padding-left:3em}.select2-container--default .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option{margin-left:-3em;padding-left:4em}.select2-container--default .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option{margin-left:-4em;padding-left:5em}.select2-container--default .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option{margin-left:-5em;padding-left:6em}.select2-container--default .select2-results__option--highlighted[aria-selected]{background-color:#5897fb;color:#fff}.select2-container--default .select2-results__group{cursor:default;display:block;padding:6px}.select2-container--classic .select2-selection--single{background-color:#f7f7f7;border:1px solid #aaa;border-radius:4px;outline:0;background-image:-webkit-linear-gradient(top,#fff 50%,#eee 100%);background-image:-o-linear-gradient(top,#fff 50%,#eee 100%);background-image:linear-gradient(to bottom,#fff 50%,#eee 100%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#FFFFFFFF', endColorstr='#FFEEEEEE', GradientType=0)}.select2-container--classic .select2-selection--single:focus{border:1px solid #5897fb}.select2-container--classic .select2-selection--single .select2-selection__rendered{color:#444;line-height:28px}.select2-container--classic .select2-selection--single .select2-selection__clear{cursor:pointer;float:right;font-weight:700;margin-right:10px}.select2-container--classic .select2-selection--single .select2-selection__placeholder{color:#999}.select2-container--classic .select2-selection--single .select2-selection__arrow{background-color:#ddd;border:0;border-left:1px solid #aaa;border-top-right-radius:4px;border-bottom-right-radius:4px;height:26px;position:absolute;top:1px;right:1px;width:20px;background-image:-webkit-linear-gradient(top,#eee 50%,#ccc 100%);background-image:-o-linear-gradient(top,#eee 50%,#ccc 100%);background-image:linear-gradient(to bottom,#eee 50%,#ccc 100%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#FFEEEEEE', endColorstr='#FFCCCCCC', GradientType=0)}.select2-container--classic[dir=rtl] .select2-selection--single .select2-selection__clear{float:left}.select2-container--classic[dir=rtl] .select2-selection--single .select2-selection__arrow{border:0;border-right:1px solid #aaa;border-radius:0;border-top-left-radius:4px;border-bottom-left-radius:4px;left:1px;right:auto}.select2-container--classic.select2-container--open .select2-selection--single{border:1px solid #5897fb}.select2-container--classic.select2-container--open .select2-selection--single .select2-selection__arrow{background:0 0;border:0}.select2-container--classic.select2-container--open.select2-container--above .select2-selection--single{border-top:none;border-top-left-radius:0;border-top-right-radius:0;background-image:-webkit-linear-gradient(top,#fff 0,#eee 50%);background-image:-o-linear-gradient(top,#fff 0,#eee 50%);background-image:linear-gradient(to bottom,#fff 0,#eee 50%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#FFFFFFFF', endColorstr='#FFEEEEEE', GradientType=0)}.select2-container--classic.select2-container--open.select2-container--below .select2-selection--single{border-bottom:none;border-bottom-left-radius:0;border-bottom-right-radius:0;background-image:-webkit-linear-gradient(top,#eee 50%,#fff 100%);background-image:-o-linear-gradient(top,#eee 50%,#fff 100%);background-image:linear-gradient(to bottom,#eee 50%,#fff 100%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#FFEEEEEE', endColorstr='#FFFFFFFF', GradientType=0)}.select2-container--classic .select2-selection--multiple{background-color:#fff;border:1px solid #aaa;border-radius:4px;cursor:text;outline:0}.select2-container--classic .select2-selection--multiple:focus{border:1px solid #5897fb}.select2-container--classic .select2-selection--multiple .select2-selection__rendered{list-style:none;margin:0;padding:0 5px}.select2-container--classic .select2-selection--multiple .select2-selection__clear{display:none}.select2-container--classic .select2-selection--multiple .select2-selection__choice{background-color:#e4e4e4;border:1px solid #aaa;border-radius:4px;cursor:default;float:left;margin-right:5px;margin-top:5px;padding:0 5px}.select2-container--classic .select2-selection--multiple .select2-selection__choice__remove{color:#888;cursor:pointer;display:inline-block;font-weight:700;margin-right:2px}.select2-container--classic .select2-selection--multiple .select2-selection__choice__remove:hover{color:#555}.select2-container--classic[dir=rtl] .select2-selection--multiple .select2-selection__choice{float:right;margin-left:5px;margin-right:auto}.select2-container--classic[dir=rtl] .select2-selection--multiple .select2-selection__choice__remove{margin-left:2px;margin-right:auto}.select2-container--classic.select2-container--open .select2-selection--multiple{border:1px solid #5897fb}.select2-container--classic.select2-container--open.select2-container--above .select2-selection--multiple{border-top:none;border-top-left-radius:0;border-top-right-radius:0}.select2-container--classic.select2-container--open.select2-container--below .select2-selection--multiple{border-bottom:none;border-bottom-left-radius:0;border-bottom-right-radius:0}.select2-container--classic .select2-search--dropdown .select2-search__field{border:1px solid #aaa;outline:0}.select2-container--classic .select2-search--inline .select2-search__field{outline:0;box-shadow:none}.select2-container--classic .select2-dropdown{background-color:#fff;border:1px solid transparent}.select2-container--classic .select2-dropdown--above{border-bottom:none}.select2-container--classic .select2-dropdown--below{border-top:none}.select2-container--classic .select2-results>.select2-results__options{max-height:200px;overflow-y:auto}.select2-container--classic .select2-results__option[role=group]{padding:0}.select2-container--classic .select2-results__option[aria-disabled=true]{color:gray}.select2-container--classic .select2-results__option--highlighted[aria-selected]{background-color:#3875d7;color:#fff}.select2-container--classic .select2-results__group{cursor:default;display:block;padding:6px}.select2-container--classic.select2-container--open .select2-dropdown{border-color:#5897fb}
lets-encrypt/wizard/notices.php CHANGED
@@ -3,9 +3,9 @@ add_action( 'rsssl_notice_include_alias', 'rsssl_notice_include_alias', 10, 1 );
3
  function rsssl_notice_include_alias( $args ) {
4
  if (!rsssl_is_subdomain() && !RSSSL_LE()->letsencrypt_handler->alias_domain_available() ) {
5
  if (strpos(site_url(), 'www.') !== false ) {
6
- rsssl_sidebar_notice( __( "The non-www version of your site does not point to this website. This is recommended, as it will allow you to add it to the certificate as well.", 'complianz-gdpr' ), 'warning' );
7
  } else {
8
- rsssl_sidebar_notice( __( "The www version of your site does not point to this website. This is recommended, as it will allow you to add it to the certificate as well.", 'complianz-gdpr' ), 'warning' );
9
  }
10
  }
11
  }
3
  function rsssl_notice_include_alias( $args ) {
4
  if (!rsssl_is_subdomain() && !RSSSL_LE()->letsencrypt_handler->alias_domain_available() ) {
5
  if (strpos(site_url(), 'www.') !== false ) {
6
+ rsssl_sidebar_notice( __( "The non-www version of your site does not point to this website. This is recommended, as it will allow you to add it to the certificate as well.", 'really-simple-ssl' ), 'warning' );
7
  } else {
8
+ rsssl_sidebar_notice( __( "The www version of your site does not point to this website. This is recommended, as it will allow you to add it to the certificate as well.", 'really-simple-ssl' ), 'warning' );
9
  }
10
  }
11
  }
readme.txt CHANGED
@@ -6,7 +6,7 @@ Requires at least: 4.9
6
  License: GPL2
7
  Tested up to: 5.9
8
  Requires PHP: 5.6
9
- Stable tag: 5.2.3
10
 
11
  No setup required! You only need an SSL certificate, and this plugin will do the rest.
12
 
@@ -90,6 +90,13 @@ The plugin checks your certificate before enabling, but if, for example, you mig
90
  If you can't deactivate, do not just remove the plugin folder to uninstall! Follow these [instructions](https://really-simple-ssl.com/knowledge-base/uninstall-websitebackend-not-accessible/) instead.
91
 
92
  == Changelog ==
 
 
 
 
 
 
 
93
  = 5.2.3 =
94
  * Bumped tested up to 5.9
95
 
6
  License: GPL2
7
  Tested up to: 5.9
8
  Requires PHP: 5.6
9
+ Stable tag: 5.3.0
10
 
11
  No setup required! You only need an SSL certificate, and this plugin will do the rest.
12
 
90
  If you can't deactivate, do not just remove the plugin folder to uninstall! Follow these [instructions](https://really-simple-ssl.com/knowledge-base/uninstall-websitebackend-not-accessible/) instead.
91
 
92
  == Changelog ==
93
+ = 5.3.0 =
94
+ * Improvement: added PHP 8.1 compatibility
95
+ * Improvement: updated .htaccess redirect comment
96
+ * New: add installation helper
97
+ * Improvement: is_writable check in Let's Encrypt
98
+ * Improvement: Catch not set subject alternative and common names in cert
99
+
100
  = 5.2.3 =
101
  * Bumped tested up to 5.9
102
 
rlrsssl-really-simple-ssl.php CHANGED
@@ -3,7 +3,7 @@
3
  * Plugin Name: Really Simple SSL
4
  * Plugin URI: https://really-simple-ssl.com
5
  * Description: Lightweight plugin without any setup to make your site SSL proof
6
- * Version: 5.2.3
7
  * Author: Really Simple Plugins
8
  * Author URI: https://really-simple-plugins.com
9
  * License: GPL2
@@ -66,6 +66,7 @@ class REALLY_SIMPLE_SSL
66
  public $really_simple_ssl;
67
  public $rsssl_help;
68
  public $rsssl_certificate;
 
69
 
70
  private function __construct()
71
  {
@@ -95,7 +96,6 @@ class REALLY_SIMPLE_SSL
95
  self::$instance->rsssl_help = new rsssl_help();
96
  self::$instance->rsssl_certificate = new rsssl_certificate();
97
  self::$instance->rsssl_site_health = new rsssl_site_health();
98
-
99
  if ( $wpcli ) {
100
  self::$instance->rsssl_wp_cli = new rsssl_wp_cli();
101
  }
@@ -117,7 +117,7 @@ class REALLY_SIMPLE_SSL
117
  define('rsssl_file', __FILE__);
118
  }
119
  $debug = defined('RSSSL_DEBUG') && RSSSL_DEBUG ? time() : '';
120
- define('rsssl_version', '5.2.3'.$debug);
121
  define('rsssl_le_cron_generation_renewal_check', 20);
122
  define('rsssl_le_manual_generation_renewal_check', 15);
123
  }
@@ -143,6 +143,9 @@ class REALLY_SIMPLE_SSL
143
  require_once(rsssl_path . 'class-help.php');
144
  require_once(rsssl_path . 'class-certificate.php');
145
  require_once(rsssl_path . 'class-site-health.php');
 
 
 
146
  }
147
 
148
  if ( is_admin() || wp_doing_cron() ) {
3
  * Plugin Name: Really Simple SSL
4
  * Plugin URI: https://really-simple-ssl.com
5
  * Description: Lightweight plugin without any setup to make your site SSL proof
6
+ * Version: 5.3.0
7
  * Author: Really Simple Plugins
8
  * Author URI: https://really-simple-plugins.com
9
  * License: GPL2
66
  public $really_simple_ssl;
67
  public $rsssl_help;
68
  public $rsssl_certificate;
69
+ public $rsp_upgrade_to_pro;
70
 
71
  private function __construct()
72
  {
96
  self::$instance->rsssl_help = new rsssl_help();
97
  self::$instance->rsssl_certificate = new rsssl_certificate();
98
  self::$instance->rsssl_site_health = new rsssl_site_health();
 
99
  if ( $wpcli ) {
100
  self::$instance->rsssl_wp_cli = new rsssl_wp_cli();
101
  }
117
  define('rsssl_file', __FILE__);
118
  }
119
  $debug = defined('RSSSL_DEBUG') && RSSSL_DEBUG ? time() : '';
120
+ define('rsssl_version', '5.3.0'.$debug);
121
  define('rsssl_le_cron_generation_renewal_check', 20);
122
  define('rsssl_le_manual_generation_renewal_check', 15);
123
  }
143
  require_once(rsssl_path . 'class-help.php');
144
  require_once(rsssl_path . 'class-certificate.php');
145
  require_once(rsssl_path . 'class-site-health.php');
146
+ if ( isset($_GET['install_pro'])) {
147
+ require_once(rsssl_path . 'upgrade/upgrade-to-pro.php');
148
+ }
149
  }
150
 
151
  if ( is_admin() || wp_doing_cron() ) {
upgrade/ajax.js ADDED
@@ -0,0 +1,51 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+
2
+ var rsp_ajax = {};
3
+
4
+ rsp_ajax.x = function () {
5
+ if (typeof XMLHttpRequest !== 'undefined') {
6
+ return new XMLHttpRequest();
7
+ }
8
+ var versions = [
9
+ "MSXML2.XmlHttp.6.0",
10
+ "MSXML2.XmlHttp.5.0",
11
+ "MSXML2.XmlHttp.4.0",
12
+ "MSXML2.XmlHttp.3.0",
13
+ "MSXML2.XmlHttp.2.0",
14
+ "Microsoft.XmlHttp"
15
+ ];
16
+
17
+ var xhr;
18
+ for (var i = 0; i < versions.length; i++) {
19
+ try {
20
+ xhr = new ActiveXObject(versions[i]);
21
+ break;
22
+ } catch (e) {
23
+ }
24
+ }
25
+ return xhr;
26
+ };
27
+
28
+ rsp_ajax.send = function (url, callback, method, data, async) {
29
+ if (async === undefined) {
30
+ async = true;
31
+ }
32
+ var x = rsp_ajax.x();
33
+ x.open(method, url, async);
34
+ x.onreadystatechange = function () {
35
+ if (x.readyState == 4) {
36
+ callback(x.responseText)
37
+ }
38
+ };
39
+ if (method == 'POST') {
40
+ x.setRequestHeader('Content-type', 'application/x-www-form-urlencoded');
41
+ }
42
+ x.send(data)
43
+ };
44
+
45
+ rsp_ajax.get = function (url, data, callback, async) {
46
+ var query = [];
47
+ for (var key in data) {
48
+ query.push(encodeURIComponent(key) + '=' + encodeURIComponent(data[key]));
49
+ }
50
+ rsp_ajax.send(url + (query.length ? '?' + query.join('&') : ''), callback, 'GET', null, async)
51
+ };
upgrade/ajax.min.js ADDED
@@ -0,0 +1 @@
 
1
+ var rsp_ajax={};rsp_ajax.x=function(){if(typeof XMLHttpRequest!=="undefined"){return new XMLHttpRequest}var versions=["MSXML2.XmlHttp.6.0","MSXML2.XmlHttp.5.0","MSXML2.XmlHttp.4.0","MSXML2.XmlHttp.3.0","MSXML2.XmlHttp.2.0","Microsoft.XmlHttp"];var xhr;for(var i=0;i<versions.length;i++){try{xhr=new ActiveXObject(versions[i]);break}catch(e){}}return xhr};rsp_ajax.send=function(url,callback,method,data,async){if(async===undefined){async=true}var x=rsp_ajax.x();x.open(method,url,async);x.onreadystatechange=function(){if(x.readyState==4){callback(x.responseText)}};if(method=="POST"){x.setRequestHeader("Content-type","application/x-www-form-urlencoded")}x.send(data)};rsp_ajax.get=function(url,data,callback,async){var query=[];for(var key in data){query.push(encodeURIComponent(key)+"="+encodeURIComponent(data[key]))}rsp_ajax.send(url+(query.length?"?"+query.join("&"):""),callback,"GET",null,async)};
upgrade/img/burst.png ADDED
Binary file
upgrade/img/complianz-gdpr.gif ADDED
Binary file
upgrade/img/definitions.png ADDED
Binary file
upgrade/img/really-simple-ssl.png ADDED
Binary file
upgrade/upgrade-to-pro.css ADDED
@@ -0,0 +1,219 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /**move to css variables in time */
2
+ :root {
3
+ --rsp-break-xs: 400px;
4
+ --rsp-break-s: 576px;
5
+ --rsp-break-m: 768px;
6
+ --rsp-break-l: 992px;
7
+ --rsp-break-xl: 1200px;
8
+ --rsp-break-xxl: 1400px;
9
+ --rsp-spacing-xs: 10px;
10
+ --rsp-spacing-s: 15px;
11
+ --rsp-spacing-m: 20px;
12
+ --rsp-spacing-l: 30px;
13
+ --rsp-spacing-xl: 40px;
14
+ --rsp-grid-margin: var(--rsp-spacing-xs);
15
+ --rsp-grid-gap: var(--rsp-spacing-m);
16
+ --rsp-border-radius: 12px;
17
+ --rsp-border: 1px solid var(--rsp-border-color);
18
+ --rsp-box-shadow: rgba(0, 0, 0, 0.1) 0px 4px 6px -1px, rgba(0, 0, 0, 0.06) 0px 2px 4px -1px;
19
+ --rsp-border-color: #dfdfdf;
20
+ --rsp-black: #333;
21
+ --rsp-white: #fff;
22
+ --rsp-yellow: #f4bf3e;
23
+ --rsp-blue: #29b6f6;
24
+ --rsp-dark-blue: #5A6FA5;
25
+ --rsp-green: #2e8a37;
26
+ --rsp-red: #D7263D;
27
+ --rsp-pink: #E35899;
28
+ --rsp-orange: #f39c12;
29
+ --rsp-yellow-faded: rgba(244, 191, 62, 0.1);
30
+ --rsp-blue-faded: rgba(41, 182, 246, 0.1);
31
+ --rsp-dark-blue-faded: rgba(41, 182, 246, 0.1);
32
+ --rsp-green-faded: rgba(46, 138, 55, 0.1);
33
+ --rsp-red-faded: rgba(215, 38, 61, 0.1);
34
+ --rsp-pink-faded: rgba(227, 88, 153, 0.1);
35
+ --rsp-orange-faded: rgba(243, 156, 18, 0.1);
36
+ --rsp-background-block-color: var(--rsp-white);
37
+ --rsp-background-color: #f0f0f1;
38
+ --rsp-input-background-color: #F1F1F1;
39
+ --rsp-input-text-color: var(--rsp-text-color);
40
+ --rsp-input-border-color: #8c8f94;
41
+ --rsp-text-color: rgba(26, 26, 26, 0.9);
42
+ --rsp-text-color-invert: rgba(255, 255, 255, 0.9);
43
+ --rsp-text-color-white: rgba(255, 255, 255, 0.9);
44
+ --rsp-text-color-light: rgba(69, 69, 82, 0.9);
45
+ --rsp-grey-200: #fafafa;
46
+ --rsp-grey-300: #ededed;
47
+ --rsp-grey-400: #c6c6c6;
48
+ --rsp-grey-500: #737373;
49
+ --rsp-grey-600: #696969;
50
+ --rsp-color-success: var(--rsp-green);
51
+ --rsp-color-error: var(--rsp-red);
52
+ --rsp-color-warning: var(--rsp-orange);
53
+ --rsp-color-open: var(--rsp-yellow);
54
+ --rsp-fs-100: 0.6125rem;
55
+ --rsp-fs-200: 0.625rem;
56
+ --rsp-fs-300: 0.8125rem;
57
+ --rsp-fs-400: 0.875rem;
58
+ --rsp-fs-500: 1rem;
59
+ --rsp-fs-600: 1.125rem;
60
+ --rsp-fs-700: 1.25rem;
61
+ --rsp-fs-800: 1.5rem;
62
+ --rsp-fs-900: 2.5rem;
63
+ --rsp-brand-primary: var(--rsp-green);
64
+ --rsp-brand-secondary: var(--rsp-yellow);
65
+ --rsp-brand-primary-faded: var(--rsp-green-faded);
66
+ }
67
+ #rsp-step-template,
68
+ #rsp-plugin-suggestion-template {
69
+ display: none;
70
+ }
71
+ .rsp-recommended {
72
+ padding-bottom: 10px;
73
+ }
74
+ .rsp-plugin-suggestion {
75
+ display: flex;
76
+ gap: 10px;
77
+ padding: 20px 10px;
78
+ background-color: #f0f6fc;
79
+ }
80
+ .rsp-plugin-suggestion .rsp-title {
81
+ font-weight: bold;
82
+ }
83
+ .rsp-plugin-suggestion .rsp-description-short {
84
+ font-weight: bold;
85
+ font-size: 10px;
86
+ }
87
+ .rsp-plugin-suggestion .rsp-icon img {
88
+ width: 50px;
89
+ height: inherit;
90
+ }
91
+ .rsp-plugin-suggestion .rsp-description {
92
+ color: #888;
93
+ font-size: 11px;
94
+ line-height: 13px;
95
+ width: 300px;
96
+ }
97
+ .rsp-plugin-suggestion .rsp-install-button {
98
+ align-items: center;
99
+ justify-content: center;
100
+ display: flex;
101
+ }
102
+ .rsp-plugin-suggestion .rsp-install-button .button-secondary {
103
+ font-size: 18px;
104
+ }
105
+ .rsp-plugin-suggestion .star-rating .star {
106
+ width: 16px;
107
+ height: 16px;
108
+ font-size: 16px;
109
+ }
110
+ .rsp-modal-transparent-background {
111
+ position: fixed;
112
+ width: 100%;
113
+ height: 100%;
114
+ top: 0;
115
+ left: 0;
116
+ right: 0;
117
+ bottom: 0;
118
+ background-color: rgba(0, 0, 0, 0.7);
119
+ z-index: 9999;
120
+ }
121
+ .rsp-modal-transparent-background .rsp-install-plugin-modal {
122
+ max-height: calc(100vh - 20px);
123
+ position: fixed;
124
+ left: 50%;
125
+ top: 50%;
126
+ -ms-transform: translateX(-50%) translateY(-50%);
127
+ transform: translateX(-50%) translateY(-50%);
128
+ width: fit-content;
129
+ height: fit-content;
130
+ min-width: 700px;
131
+ padding: 25px;
132
+ background-color: white;
133
+ border-radius: 10px;
134
+ }
135
+ .rsp-modal-transparent-background .rsp-install-plugin-modal h3 {
136
+ font-size: 23px;
137
+ margin: 0 0 20px 0;
138
+ }
139
+ .rsp-modal-transparent-background .rsp-install-plugin-modal .rsp-progress-bar-container {
140
+ margin: 0 0 15px 0;
141
+ }
142
+ .rsp-modal-transparent-background .rsp-install-plugin-modal .rsp-progress-bar-container .rsp-progress {
143
+ overflow: hidden;
144
+ height: 10px;
145
+ border-radius: 5px;
146
+ width: 100%;
147
+ }
148
+ .rsp-modal-transparent-background .rsp-install-plugin-modal .rsp-progress-bar-container .rsp-progress .rsp-bar {
149
+ height: 100%;
150
+ }
151
+ .rsp-modal-transparent-background .rsp-install-plugin-modal .rsp-install-steps {
152
+ display: flex;
153
+ flex-direction: column;
154
+ margin: 0 0 15px 0;
155
+ }
156
+ .rsp-modal-transparent-background .rsp-install-plugin-modal .rsp-install-steps .rsp-install-step {
157
+ display: grid;
158
+ grid-template-columns: 50px 1fr;
159
+ grid-template-rows: 25px;
160
+ align-items: center;
161
+ }
162
+ .rsp-modal-transparent-background .rsp-install-plugin-modal .rsp-footer {
163
+ display: flex;
164
+ gap: 20px;
165
+ align-items: center;
166
+ }
167
+ .rsp-modal-transparent-background .rsp-install-plugin-modal .rsp-footer .rsp-error-message {
168
+ color: #D7263D;
169
+ font-weight: 14px;
170
+ }
171
+ .rsp-modal-transparent-background .rsp-install-plugin-modal .rsp-footer .rsp-error-message a {
172
+ color: #D7263D;
173
+ }
174
+ .rsp-modal-transparent-background .rsp-install-plugin-modal .rsp-footer .rsp-btn {
175
+ width: fit-content;
176
+ margin: 0;
177
+ }
178
+ .rsp-modal-transparent-background .rsp-install-plugin-modal .rsp-footer .rsp-btn.rsp-yellow {
179
+ background-color: #f8be2e;
180
+ color: #333;
181
+ font-size: 17px;
182
+ border: 1px solid #f8be2e;
183
+ }
184
+ .rsp-modal-transparent-background .rsp-install-plugin-modal .rsp-footer .rsp-btn.rsp-yellow:hover {
185
+ background-color: #f8be2e;
186
+ border: 1px solid #f8be2e;
187
+ }
188
+ .rsp-modal-transparent-background .rsp-install-plugin-modal .rsp-footer .rsp-btn.rsp-red {
189
+ background-color: #D7263D;
190
+ color: white;
191
+ border: 1px solid #D7263D;
192
+ }
193
+ .rsp-modal-transparent-background .rsp-install-plugin-modal .rsp-footer .rsp-btn.rsp-red:hover {
194
+ background-color: #D7263D;
195
+ border: 1px solid #D7263D;
196
+ }
197
+ .rsp-modal-transparent-background .rsp-install-plugin-modal .rsp-bullet {
198
+ height: 13px;
199
+ width: 13px;
200
+ border-radius: 50%;
201
+ margin-right: 10px;
202
+ text-decoration: none;
203
+ }
204
+ .rsp-modal-transparent-background .rsp-install-plugin-modal .rsp-grey {
205
+ background-color: #eeeeee;
206
+ }
207
+ .rsp-modal-transparent-background .rsp-install-plugin-modal .rsp-green {
208
+ background-color: #61ce70;
209
+ }
210
+ .rsp-modal-transparent-background .rsp-install-plugin-modal .rsp-red {
211
+ background-color: #D7263D;
212
+ }
213
+ .rsp-modal-transparent-background .rsp-install-plugin-modal .rsp-yellow {
214
+ background-color: #f8be2e;
215
+ }
216
+ .rsp-modal-transparent-background .rsp-install-plugin-modal .rsp-hidden {
217
+ display: none;
218
+ }
219
+ /*# sourceMappingURL=upgrade-to-pro.css.map */
upgrade/upgrade-to-pro.css.map ADDED
@@ -0,0 +1 @@
 
1
+ {"version":3,"sources":["/Users/rlankhorst/Sites/localhost/reallysimplessl/wp-content/plugins/updates/really-simple-ssl/assets/css/variables.less","upgrade-to-pro.less"],"names":[],"mappings":";AAwCA;EAEE,qBAAA;EACA,oBAAA;EACA,oBAAA;EACA,oBAAA;EACA,sBAAA;EACA,uBAAA;EAGA,sBAAA;EACA,qBAAA;EACA,qBAAA;EACA,qBAAA;EACA,sBAAA;EAGA,mBAAmB,qBAAnB;EACA,gBAAgB,oBAAhB;EAGA,yBAAA;EACA,wBAAwB,uBAAxB;EACA,2FAAA;EACA,2BAAA;EAGA,iBAAA;EACA,iBAAA;EACA,qBAAA;EACA,mBAAA;EACA,wBAAA;EACA,oBAAA;EACA,kBAAA;EACA,mBAAA;EACA,qBAAA;EAEA,2CAAA;EACA,yCAAA;EACA,8CAAA;EACA,yCAAA;EACA,uCAAA;EACA,yCAAA;EACA,2CAAA;EAEA,8BAA8B,gBAA9B;EACA,+BAAA;EAGA,qCAAA;EACA,wBAAwB,qBAAxB;EACA,iCAAA;EAEA,uCAAA;EACA,iDAAA;EACA,gDAAA;EACA,6CAAA;EAEA,uBAAA;EACA,uBAAA;EACA,uBAAA;EACA,uBAAA;EACA,uBAAA;EAGA,qBAAqB,gBAArB;EACA,mBAAmB,cAAnB;EACA,qBAAqB,iBAArB;EACA,kBAAkB,iBAAlB;EAGA,uBAAA;EACA,sBAAA;EACA,uBAAA;EACA,sBAAA;EACA,kBAAA;EACA,sBAAA;EACA,qBAAA;EACA,oBAAA;EACA,oBAAA;EAGA,qBAAqB,gBAArB;EACA,uBAAuB,iBAAvB;EACA,2BAA2B,sBAA3B;;AC1HF;AAAoB;EAClB,aAAA;;AAEF;EACE,oBAAA;;AAEF;EACE,aAAA;EACA,SAAA;EACA,kBAAA;EACA,yBAAA;;AAJF,sBAKE;EACD,iBAAA;;AAND,sBAQE;EACD,iBAAA;EACA,eAAA;;AAVD,sBAYE,UAAU;EACX,WAAA;EACA,eAAA;;AAdD,sBAgBE;EACD,WAAA;EACA,eAAA;EACA,iBAAA;EACA,YAAA;;AApBD,sBAsBE;EACD,mBAAA;EACA,uBAAA;EACA,aAAA;;AAzBD,sBAsBE,oBAID;EACE,eAAA;;AA3BH,sBA8BE,aAAa;EACd,WAAA;EACA,YAAA;EACA,eAAA;;AAGD;EAEE,eAAA;EACA,WAAA;EACA,YAAA;EACA,MAAA;EACA,OAAA;EACA,QAAA;EACA,SAAA;EACA,oCAAA;EACA,aAAA;;AAVF,iCAYE;EAEE,YAAY,kBAAZ;EACA,eAAA;EACA,SAAA;EACA,QAAA;EACA,eAAe,iBAAiB,gBAAhC;EACA,WAAW,iBAAiB,gBAA5B;EACA,kBAAA;EACA,mBAAA;EACH,gBAAA;EACG,aAAA;EACA,uBAAA;EACA,mBAAA;;AAzBJ,iCAYE,0BAcD;EACE,eAAA;EACA,kBAAA;;AA5BH,iCAYE,0BAkBE;EACE,kBAAA;;AA/BN,iCAYE,0BAkBE,4BAGE;EACE,gBAAA;EACA,YAAA;EACA,kBAAA;EACA,WAAA;;AArCR,iCAYE,0BAkBE,4BAGE,cAME;EACE,YAAA;;AAxCV,iCAYE,0BAiCE;EACE,aAAA;EACA,sBAAA;EACA,kBAAA;;AAhDN,iCAYE,0BAiCE,mBAKE;EACE,aAAA;EACA,+BAAA;EACA,wBAAA;EACA,mBAAA;;AAtDR,iCAYE,0BA8CD;EACE,aAAA;EACA,SAAA;EACA,mBAAA;;AA7DH,iCAYE,0BA8CD,YAIE;EACD,cAAA;EACA,iBAAA;;AAhEF,iCAYE,0BA8CD,YAIE,mBAGD;EACE,cAAA;;AAlEJ,iCAYE,0BA8CD,YAWE;EACD,kBAAA;EACA,SAAA;;AAEA,iCA7DA,0BA8CD,YAWE,SAIA;EACC,yBAAA;EACA,WAAA;EACA,eAAA;EACA,yBAAA;;AAEA,iCAnEF,0BA8CD,YAWE,SAIA,WAME;EACF,yBAAA;EACA,yBAAA;;AAID,iCAzEA,0BA8CD,YAWE,SAgBA;EACC,yBAAA;EACA,YAAA;EACA,yBAAA;;AAEA,iCA9EF,0BA8CD,YAWE,SAgBA,QAKE;EACF,yBAAA;EACA,yBAAA;;AA5FH,iCAYE,0BAsFE;EACE,YAAA;EACA,WAAA;EACA,kBAAA;EACA,kBAAA;EACA,qBAAA;;AAvGN,iCAYE,0BA8FE;EACE,yBAAA;;AA3GN,iCAYE,0BAkGE;EACE,yBAAA;;AA/GN,iCAYE,0BAsGE;EACE,yBAAA;;AAnHN,iCAYE,0BA0GE;EACE,yBAAA;;AAvHN,iCAYE,0BA8GE;EACE,aAAA","file":"upgrade-to-pro.css"}
upgrade/upgrade-to-pro.js ADDED
@@ -0,0 +1,119 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ const rsp_steps = rsp_upgrade.steps;
2
+ let rsp_download_link = '';
3
+ let rsp_progress = 0;
4
+
5
+ //set up steps html
6
+ let rsp_template = document.getElementById('rsp-step-template').innerHTML;
7
+ let rsp_total_step_html = '';
8
+ rsp_steps.forEach( (step, i) => {
9
+ let stepHtml = rsp_template;
10
+ stepHtml = stepHtml.replace('{doing}', step.doing);
11
+ stepHtml = stepHtml.replace('{step}', 'rsp-step-'+i);
12
+ rsp_total_step_html += stepHtml;
13
+ });
14
+ document.querySelector('.rsp-install-steps').innerHTML = rsp_total_step_html;
15
+
16
+ const rsp_set_progress = () => {
17
+ if ( rsp_progress>=100 ) rsp_progress=100;
18
+ let progress_bar_container = document.querySelector(".rsp-progress-bar-container");
19
+ let progressEl = progress_bar_container.querySelector(".rsp-progress");
20
+ let bar = progressEl.querySelector(".rsp-bar");
21
+ bar.style = "width: " + rsp_progress + "%;";
22
+
23
+ if ( rsp_progress == 100 ) {
24
+ clearInterval(window.rsp_interval);
25
+ }
26
+ }
27
+
28
+ const rsp_stop_progress = () => {
29
+ clearInterval(window.rsp_interval);
30
+ let progress_bar_container = document.querySelector(".rsp-progress-bar-container");
31
+
32
+ let progressEl = progress_bar_container.querySelector(".rsp-progress");
33
+ var bar = progressEl.querySelector(".rsp-bar");
34
+ bar.style = "width: 100%;";
35
+ bar.classList.remove('rsp-green');
36
+ bar.classList.add('rsp-red');
37
+ clearInterval(window.rsp_interval);
38
+ }
39
+
40
+
41
+ const rsp_process_step = (current_step) => {
42
+ let previous_progress = current_step * Math.ceil(100/(rsp_upgrade.steps.length));
43
+ let progress_step = (current_step+1) * Math.ceil(100/(rsp_upgrade.steps.length));
44
+
45
+ clearInterval(window.rsp_interval);
46
+ window.rsp_interval = setInterval(function () {
47
+ let inc = 0.5;
48
+ //very slow if we're close to the target progress for this step.
49
+ if ( ( rsp_progress > progress_step-1 ) ) {
50
+ inc = 0.01;
51
+ }
52
+
53
+ rsp_progress += inc;
54
+ if (rsp_progress >= 100) {
55
+ rsp_progress = 100;
56
+ }
57
+ rsp_set_progress();
58
+ }, 100);
59
+
60
+ current_step = parseInt(current_step);
61
+ let step = rsp_steps[current_step];
62
+ let error = step['error'];
63
+ let success = step['success'];
64
+
65
+ // Get arguments from url
66
+ const query_string = window.location.search;
67
+ const urlParams = new URLSearchParams(query_string);
68
+
69
+ let data = {
70
+ 'action': step['action'],
71
+ 'token': rsp_upgrade.token,
72
+ 'plugin': urlParams.get('plugin'),
73
+ 'license': urlParams.get('license'),
74
+ 'item_id': urlParams.get('item_id'),
75
+ 'api_url': urlParams.get('api_url'),
76
+ 'download_link': rsp_download_link,
77
+ 'install_pro': true,
78
+ };
79
+
80
+ rsp_ajax.get(rsp_upgrade.admin_url, data, function(response) {
81
+ let step_element = document.querySelector(".rsp-step-"+current_step);
82
+ if ( !step_element ) return;
83
+
84
+ let step_color = step_element.querySelector(".rsp-step-color");
85
+ let step_text = step_element.querySelector(".rsp-step-text");
86
+ let data = JSON.parse(response);
87
+
88
+ if ( data.success ) {
89
+ if ( data.download_link ){
90
+ rsp_download_link = data.download_link;
91
+ }
92
+ step_color.innerHTML = "<div class='rsp-green rsp-bullet'></div>";
93
+ step_text.innerHTML = "<span>"+step.success+"</span>";
94
+
95
+ if ( current_step + 1 == rsp_steps.length ) {
96
+ let templateHtml = document.getElementById('rsp-plugin-suggestion-template').innerHTML;
97
+ document.querySelector('.rsp-install-steps').innerHTML = templateHtml;
98
+ document.querySelector('.rsp-install-plugin-modal h3').innerText = rsp_upgrade.finished_title;
99
+ document.querySelector(".rsp-btn.rsp-visit-dashboard").classList.remove("rsp-hidden");
100
+ rsp_progress = 100;
101
+ rsp_set_progress();
102
+ } else {
103
+ rsp_progress = progress_step;
104
+ rsp_set_progress(progress_step);
105
+ rsp_process_step( current_step+1 );
106
+ }
107
+ } else {
108
+ step_color.innerHTML = "<div class='rsp-red rsp-bullet'></div>";
109
+ if ( data.message ) {
110
+ document.querySelector(".rsp-error-message.rsp-"+step['type']+" span").innerText = data.message;
111
+ }
112
+ step_text.innerHTML = "<span>"+step.error+"</span>";
113
+ rsp_stop_progress();
114
+ document.querySelector(".rsp-btn.rsp-cancel").classList.remove("rsp-hidden");
115
+ document.querySelector(".rsp-error-message.rsp-"+step['type']).classList.remove("rsp-hidden");
116
+ }
117
+ });
118
+ }
119
+ rsp_process_step(0);
upgrade/upgrade-to-pro.less ADDED
@@ -0,0 +1,182 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ @import '../assets/css/variables.less';
2
+
3
+ #rsp-step-template, #rsp-plugin-suggestion-template {
4
+ display:none;
5
+ }
6
+ .rsp-recommended {
7
+ padding-bottom:10px;
8
+ }
9
+ .rsp-plugin-suggestion {
10
+ display:flex;
11
+ gap:10px;
12
+ padding:20px 10px;
13
+ background-color: #f0f6fc;
14
+ .rsp-title {
15
+ font-weight:bold;
16
+ }
17
+ .rsp-description-short{
18
+ font-weight: bold;
19
+ font-size:10px;
20
+ }
21
+ .rsp-icon img {
22
+ width:50px;
23
+ height:inherit;
24
+ }
25
+ .rsp-description {
26
+ color:@grey-dark;
27
+ font-size: 11px;
28
+ line-height: 13px;
29
+ width:300px;
30
+ }
31
+ .rsp-install-button {
32
+ align-items: center;
33
+ justify-content: center;
34
+ display: flex;
35
+ .button-secondary {
36
+ font-size: 18px;
37
+ }
38
+ }
39
+ .star-rating .star {
40
+ width: 16px;
41
+ height: 16px;
42
+ font-size: 16px;
43
+ }
44
+ }
45
+ .rsp-modal-transparent-background {
46
+
47
+ position: fixed;
48
+ width: 100%;
49
+ height: 100%;
50
+ top: 0;
51
+ left: 0;
52
+ right: 0;
53
+ bottom: 0;
54
+ background-color: rgba(0, 0, 0, 0.7);
55
+ z-index: 9999;
56
+
57
+ .rsp-install-plugin-modal {
58
+
59
+ max-height: calc(100vh - 20px);
60
+ position: fixed;
61
+ left: 50%;
62
+ top: 50%;
63
+ -ms-transform: translateX(-50%) translateY(-50%);
64
+ transform: translateX(-50%) translateY(-50%);
65
+ width: fit-content;
66
+ height: fit-content;
67
+ min-width: 700px;
68
+ padding: 25px;
69
+ background-color: white;
70
+ border-radius: 10px;
71
+ h3 {
72
+ font-size:23px;
73
+ margin: 0 0 20px 0;
74
+ }
75
+ .rsp-progress-bar-container {
76
+ margin: 0 0 15px 0;
77
+
78
+ .rsp-progress {
79
+ overflow: hidden;
80
+ height: 10px;
81
+ border-radius: 5px;
82
+ width: 100%;
83
+
84
+ .rsp-bar {
85
+ height: 100%;
86
+ }
87
+ }
88
+ }
89
+
90
+ .rsp-install-steps {
91
+ display: flex;
92
+ flex-direction: column;
93
+ margin: 0 0 15px 0;
94
+
95
+ .rsp-install-step {
96
+ display: grid;
97
+ grid-template-columns: 50px 1fr;
98
+ grid-template-rows: 25px;
99
+ align-items: center;
100
+ }
101
+
102
+ }
103
+ .rsp-footer {
104
+ display:flex;
105
+ gap:20px;
106
+ align-items: center;
107
+ .rsp-error-message {
108
+ color:@rsp-red;
109
+ font-weight:14px;
110
+ a {
111
+ color:@rsp-red;
112
+ }
113
+ }
114
+ .rsp-btn {
115
+ width: fit-content;
116
+ margin: 0;
117
+
118
+ &.rsp-yellow {
119
+ background-color: @rsp-yellow;
120
+ color: #333;
121
+ font-size:17px;
122
+ border: 1px solid @rsp-yellow;
123
+
124
+ &:hover {
125
+ background-color: @rsp-yellow;
126
+ border: 1px solid @rsp-yellow;
127
+ }
128
+ }
129
+
130
+ &.rsp-red {
131
+ background-color: @rsp-red;
132
+ color: white;
133
+ border: 1px solid @rsp-red;
134
+
135
+ &:hover {
136
+ background-color: @rsp-red;
137
+ border: 1px solid @rsp-red;
138
+ }
139
+ }
140
+ }
141
+ }
142
+
143
+ .rsp-bullet {
144
+ height: 13px;
145
+ width: 13px;
146
+ border-radius: 50%;
147
+ margin-right: 10px;
148
+ text-decoration: none;
149
+ }
150
+
151
+ .rsp-grey {
152
+ background-color: @grey-light;
153
+ }
154
+
155
+ .rsp-green {
156
+ background-color: @rsp-green;
157
+ }
158
+
159
+ .rsp-red {
160
+ background-color: @rsp-red;
161
+ }
162
+
163
+ .rsp-yellow {
164
+ background-color: @rsp-yellow;
165
+ }
166
+
167
+ .rsp-hidden {
168
+ display: none;
169
+ }
170
+
171
+ }
172
+
173
+ }
174
+
175
+
176
+
177
+
178
+
179
+
180
+
181
+
182
+
upgrade/upgrade-to-pro.min.css ADDED
@@ -0,0 +1 @@
 
1
+ :root{--rsp-break-xs:400px;--rsp-break-s:576px;--rsp-break-m:768px;--rsp-break-l:992px;--rsp-break-xl:1200px;--rsp-break-xxl:1400px;--rsp-spacing-xs:10px;--rsp-spacing-s:15px;--rsp-spacing-m:20px;--rsp-spacing-l:30px;--rsp-spacing-xl:40px;--rsp-grid-margin:var(--rsp-spacing-xs);--rsp-grid-gap:var(--rsp-spacing-m);--rsp-border-radius:12px;--rsp-border:1px solid var(--rsp-border-color);--rsp-box-shadow:rgba(0, 0, 0, 0.1) 0px 4px 6px -1px, rgba(0, 0, 0, 0.06) 0px 2px 4px -1px;--rsp-border-color:#dfdfdf;--rsp-black:#333;--rsp-white:#fff;--rsp-yellow:#f4bf3e;--rsp-blue:#29b6f6;--rsp-dark-blue:#5A6FA5;--rsp-green:#2e8a37;--rsp-red:#D7263D;--rsp-pink:#E35899;--rsp-orange:#f39c12;--rsp-yellow-faded:rgba(244, 191, 62, 0.1);--rsp-blue-faded:rgba(41, 182, 246, 0.1);--rsp-dark-blue-faded:rgba(41, 182, 246, 0.1);--rsp-green-faded:rgba(46, 138, 55, 0.1);--rsp-red-faded:rgba(215, 38, 61, 0.1);--rsp-pink-faded:rgba(227, 88, 153, 0.1);--rsp-orange-faded:rgba(243, 156, 18, 0.1);--rsp-background-block-color:var(--rsp-white);--rsp-background-color:#f0f0f1;--rsp-input-background-color:#F1F1F1;--rsp-input-text-color:var(--rsp-text-color);--rsp-input-border-color:#8c8f94;--rsp-text-color:rgba(26, 26, 26, 0.9);--rsp-text-color-invert:rgba(255, 255, 255, 0.9);--rsp-text-color-white:rgba(255, 255, 255, 0.9);--rsp-text-color-light:rgba(69, 69, 82, 0.9);--rsp-grey-200:#fafafa;--rsp-grey-300:#ededed;--rsp-grey-400:#c6c6c6;--rsp-grey-500:#737373;--rsp-grey-600:#696969;--rsp-color-success:var(--rsp-green);--rsp-color-error:var(--rsp-red);--rsp-color-warning:var(--rsp-orange);--rsp-color-open:var(--rsp-yellow);--rsp-fs-100:0.6125rem;--rsp-fs-200:0.625rem;--rsp-fs-300:0.8125rem;--rsp-fs-400:0.875rem;--rsp-fs-500:1rem;--rsp-fs-600:1.125rem;--rsp-fs-700:1.25rem;--rsp-fs-800:1.5rem;--rsp-fs-900:2.5rem;--rsp-brand-primary:var(--rsp-green);--rsp-brand-secondary:var(--rsp-yellow);--rsp-brand-primary-faded:var(--rsp-green-faded)}#rsp-plugin-suggestion-template,#rsp-step-template{display:none}.rsp-recommended{padding-bottom:10px}.rsp-plugin-suggestion{display:flex;gap:10px;padding:20px 10px;background-color:#f0f6fc}.rsp-plugin-suggestion .rsp-title{font-weight:700}.rsp-plugin-suggestion .rsp-description-short{font-weight:700;font-size:10px}.rsp-plugin-suggestion .rsp-icon img{width:50px;height:inherit}.rsp-plugin-suggestion .rsp-description{color:#888;font-size:11px;line-height:13px;width:300px}.rsp-plugin-suggestion .rsp-install-button{align-items:center;justify-content:center;display:flex}.rsp-plugin-suggestion .rsp-install-button .button-secondary{font-size:18px}.rsp-plugin-suggestion .star-rating .star{width:16px;height:16px;font-size:16px}.rsp-modal-transparent-background{position:fixed;width:100%;height:100%;top:0;left:0;right:0;bottom:0;background-color:rgba(0,0,0,.7);z-index:9999}.rsp-modal-transparent-background .rsp-install-plugin-modal{max-height:calc(100vh - 20px);position:fixed;left:50%;top:50%;-ms-transform:translateX(-50%) translateY(-50%);transform:translateX(-50%) translateY(-50%);width:fit-content;height:fit-content;min-width:700px;padding:25px;background-color:#fff;border-radius:10px}.rsp-modal-transparent-background .rsp-install-plugin-modal h3{font-size:23px;margin:0 0 20px}.rsp-modal-transparent-background .rsp-install-plugin-modal .rsp-progress-bar-container{margin:0 0 15px}.rsp-modal-transparent-background .rsp-install-plugin-modal .rsp-progress-bar-container .rsp-progress{overflow:hidden;height:10px;border-radius:5px;width:100%}.rsp-modal-transparent-background .rsp-install-plugin-modal .rsp-progress-bar-container .rsp-progress .rsp-bar{height:100%}.rsp-modal-transparent-background .rsp-install-plugin-modal .rsp-install-steps{display:flex;flex-direction:column;margin:0 0 15px}.rsp-modal-transparent-background .rsp-install-plugin-modal .rsp-install-steps .rsp-install-step{display:grid;grid-template-columns:50px 1fr;grid-template-rows:25px;align-items:center}.rsp-modal-transparent-background .rsp-install-plugin-modal .rsp-footer{display:flex;gap:20px;align-items:center}.rsp-modal-transparent-background .rsp-install-plugin-modal .rsp-footer .rsp-error-message{color:#d7263d;font-weight:14px}.rsp-modal-transparent-background .rsp-install-plugin-modal .rsp-footer .rsp-error-message a{color:#d7263d}.rsp-modal-transparent-background .rsp-install-plugin-modal .rsp-footer .rsp-btn{width:fit-content;margin:0}.rsp-modal-transparent-background .rsp-install-plugin-modal .rsp-footer .rsp-btn.rsp-yellow{background-color:#f8be2e;color:#333;font-size:17px;border:1px solid #f8be2e}.rsp-modal-transparent-background .rsp-install-plugin-modal .rsp-footer .rsp-btn.rsp-yellow:hover{background-color:#f8be2e;border:1px solid #f8be2e}.rsp-modal-transparent-background .rsp-install-plugin-modal .rsp-footer .rsp-btn.rsp-red{background-color:#d7263d;color:#fff;border:1px solid #d7263d}.rsp-modal-transparent-background .rsp-install-plugin-modal .rsp-footer .rsp-btn.rsp-red:hover{background-color:#d7263d;border:1px solid #d7263d}.rsp-modal-transparent-background .rsp-install-plugin-modal .rsp-bullet{height:13px;width:13px;border-radius:50%;margin-right:10px;text-decoration:none}.rsp-modal-transparent-background .rsp-install-plugin-modal .rsp-grey{background-color:#eee}.rsp-modal-transparent-background .rsp-install-plugin-modal .rsp-green{background-color:#61ce70}.rsp-modal-transparent-background .rsp-install-plugin-modal .rsp-red{background-color:#d7263d}.rsp-modal-transparent-background .rsp-install-plugin-modal .rsp-yellow{background-color:#f8be2e}.rsp-modal-transparent-background .rsp-install-plugin-modal .rsp-hidden{display:none}
upgrade/upgrade-to-pro.min.js ADDED
@@ -0,0 +1 @@
 
1
+ const rsp_steps=rsp_upgrade.steps;let rsp_download_link="";let rsp_progress=0;let rsp_template=document.getElementById("rsp-step-template").innerHTML;let rsp_total_step_html="";rsp_steps.forEach((step,i)=>{let stepHtml=rsp_template;stepHtml=stepHtml.replace("{doing}",step.doing);stepHtml=stepHtml.replace("{step}","rsp-step-"+i);rsp_total_step_html+=stepHtml});document.querySelector(".rsp-install-steps").innerHTML=rsp_total_step_html;const rsp_set_progress=()=>{if(rsp_progress>=100)rsp_progress=100;let progress_bar_container=document.querySelector(".rsp-progress-bar-container");let progressEl=progress_bar_container.querySelector(".rsp-progress");let bar=progressEl.querySelector(".rsp-bar");bar.style="width: "+rsp_progress+"%;";if(rsp_progress==100){clearInterval(window.rsp_interval)}};const rsp_stop_progress=()=>{clearInterval(window.rsp_interval);let progress_bar_container=document.querySelector(".rsp-progress-bar-container");let progressEl=progress_bar_container.querySelector(".rsp-progress");var bar=progressEl.querySelector(".rsp-bar");bar.style="width: 100%;";bar.classList.remove("rsp-green");bar.classList.add("rsp-red");clearInterval(window.rsp_interval)};const rsp_process_step=current_step=>{let previous_progress=current_step*Math.ceil(100/rsp_upgrade.steps.length);let progress_step=(current_step+1)*Math.ceil(100/rsp_upgrade.steps.length);clearInterval(window.rsp_interval);window.rsp_interval=setInterval(function(){let inc=.5;if(rsp_progress>progress_step-1){inc=.01}rsp_progress+=inc;if(rsp_progress>=100){rsp_progress=100}rsp_set_progress()},100);current_step=parseInt(current_step);let step=rsp_steps[current_step];let error=step["error"];let success=step["success"];const query_string=window.location.search;const urlParams=new URLSearchParams(query_string);let data={action:step["action"],token:rsp_upgrade.token,plugin:urlParams.get("plugin"),license:urlParams.get("license"),item_id:urlParams.get("item_id"),api_url:urlParams.get("api_url"),download_link:rsp_download_link,install_pro:true};rsp_ajax.get(rsp_upgrade.admin_url,data,function(response){let step_element=document.querySelector(".rsp-step-"+current_step);if(!step_element)return;let step_color=step_element.querySelector(".rsp-step-color");let step_text=step_element.querySelector(".rsp-step-text");let data=JSON.parse(response);if(data.success){if(data.download_link){rsp_download_link=data.download_link}step_color.innerHTML="<div class='rsp-green rsp-bullet'></div>";step_text.innerHTML="<span>"+step.success+"</span>";if(current_step+1==rsp_steps.length){let templateHtml=document.getElementById("rsp-plugin-suggestion-template").innerHTML;document.querySelector(".rsp-install-steps").innerHTML=templateHtml;document.querySelector(".rsp-install-plugin-modal h3").innerText=rsp_upgrade.finished_title;document.querySelector(".rsp-btn.rsp-visit-dashboard").classList.remove("rsp-hidden");rsp_progress=100;rsp_set_progress()}else{rsp_progress=progress_step;rsp_set_progress(progress_step);rsp_process_step(current_step+1)}}else{step_color.innerHTML="<div class='rsp-red rsp-bullet'></div>";if(data.message){document.querySelector(".rsp-error-message.rsp-"+step["type"]+" span").innerText=data.message}step_text.innerHTML="<span>"+step.error+"</span>";rsp_stop_progress();document.querySelector(".rsp-btn.rsp-cancel").classList.remove("rsp-hidden");document.querySelector(".rsp-error-message.rsp-"+step["type"]).classList.remove("rsp-hidden")}})};rsp_process_step(0);
upgrade/upgrade-to-pro.php ADDED
@@ -0,0 +1,702 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ if ( ! defined( 'ABSPATH' ) ) exit;
3
+
4
+ /**
5
+ * Allows plugins to use their own update API.
6
+ *
7
+ * @author Easy Digital Downloads
8
+ * @version 1.7
9
+ */
10
+ if ( !class_exists('rsp_upgrade_to_pro') ){
11
+ class rsp_upgrade_to_pro {
12
+ private $version = 1;
13
+ private $api_url = "";
14
+ private $license = "";
15
+ private $item_id = "";
16
+ private $slug = "";
17
+ private $health_check_timeout = 5;
18
+ private $plugin_name = "";
19
+ private $plugin_constant = "";
20
+ private $steps;
21
+ private $prefix;
22
+ private $dashboard_url;
23
+
24
+ /**
25
+ * Class constructor.
26
+ *
27
+ */
28
+ public function __construct() {
29
+
30
+ if ( isset($_GET['license']) ) {
31
+ $this->license = sanitize_title($_GET['license']);
32
+ }
33
+
34
+ if ( isset($_GET['item_id']) ) {
35
+ $this->item_id = sanitize_title($_GET['item_id']);
36
+ }
37
+
38
+ if ( isset($_GET['plugin']) ) {
39
+ $plugin = sanitize_title($_GET['plugin']);
40
+ switch ($plugin) {
41
+ case "rsssl_pro":
42
+ $this->slug = "really-simple-ssl-pro/really-simple-ssl-pro.php";
43
+ $this->plugin_name = "Really Simple SSL Pro";
44
+ $this->plugin_constant = "rsssl_pro";
45
+ $this->prefix = "rsssl_";
46
+ $this->api_url = "https://really-simple-ssl.com";
47
+ $this->dashboard_url = add_query_arg(["page" => "rlrsssl_really_simple_ssl"], admin_url( "admin.php/options-general.php" ));
48
+ break;
49
+ case "brst_pro":
50
+ $this->slug = "burst";
51
+ $this->plugin_name = "Burst";
52
+ $this->plugin_constant = "burst_premium";
53
+ $this->prefix = "burst_";
54
+ $this->api_url = "https://burst-statistics.com";
55
+ $this->dashboard_url = add_query_arg(["page" => "burst"], admin_url( "admin.php" ));
56
+ break;
57
+ case "cmplz_pro":
58
+ default:
59
+ $this->slug = "complianz-gdpr-premium/complianz-gpdr-premium.php";
60
+ $this->plugin_name = "Complianz";
61
+ $this->plugin_constant = "cmplz_premium";
62
+ $this->prefix = "cmplz_";
63
+ $this->api_url = "https://complianz.io";
64
+ $this->dashboard_url = add_query_arg(["page" => "complianz"], admin_url( "admin.php" ));
65
+ break;
66
+ }
67
+ }
68
+
69
+ $this->steps = array(
70
+ array(
71
+ 'action' => 'rsp_upgrade_destination_clear',
72
+ 'doing' => __("Checking if plugin folder exists...", "really-simple-ssl"),
73
+ 'success' => __("Able to create destination folder", "really-simple-ssl"),
74
+ 'error' => __("Destination folder already exists", "really-simple-ssl"),
75
+ 'type' => 'folder',
76
+ ),
77
+ array(
78
+ 'action' => 'rsp_upgrade_activate_license',
79
+ 'doing' => __("Validating license...", "really-simple-ssl"),
80
+ 'success' => __("License valid", "really-simple-ssl"),
81
+ 'error' => __("License invalid", "really-simple-ssl"),
82
+ 'type' => 'license',
83
+ ),
84
+ array(
85
+ 'action' => 'rsp_upgrade_package_information',
86
+ 'doing' => __("Retrieving package information...", "really-simple-ssl"),
87
+ 'success' => __("Package information retrieved", "really-simple-ssl"),
88
+ 'error' => __("Failed to gather package information", "really-simple-ssl"),
89
+ 'type' => 'package',
90
+ ),
91
+ array(
92
+ 'action' => 'rsp_upgrade_install_plugin',
93
+ 'doing' => __("Installing plugin...", "really-simple-ssl"),
94
+ 'success' => __("Plugin installed", "really-simple-ssl"),
95
+ 'error' => __("Failed to install plugin", "really-simple-ssl"),
96
+ 'type' => 'install',
97
+ ),
98
+ array(
99
+ 'action' => 'rsp_upgrade_activate_plugin',
100
+ 'doing' => __("Activating plugin...", "really-simple-ssl"),
101
+ 'success' => __("Plugin activated", "really-simple-ssl"),
102
+ 'error' => __("Failed to activate plugin", "really-simple-ssl"),
103
+ 'type' => 'activate',
104
+ )
105
+ );
106
+
107
+ // Set up hooks.
108
+ $this->init();
109
+ }
110
+
111
+ private function get_suggested_plugin($attr){
112
+ $plugin_to_be_installed = false;
113
+ if (isset($_GET['plugin']) && $_GET['plugin']==='cmplz_pro' ) {
114
+ $plugin_to_be_installed = 'complianz-gdpr';
115
+ } else if (isset($_GET['plugin']) && $_GET['plugin']==='rsssl_pro' ) {
116
+ $plugin_to_be_installed = 'really-simple-ssl';
117
+ } else if (isset($_GET['plugin']) && $_GET['plugin']==='burst_pro' ) {
118
+ $plugin_to_be_installed = 'burst';
119
+ }
120
+
121
+ $path = __FILE__;
122
+ if (strpos($path, 'really-simple-ssl')!==false) {
123
+ $current_plugin = 'really-simple-ssl';
124
+ } else if (strpos($path, 'complianz')!==false){
125
+ $current_plugin = 'complianz-gdpr';
126
+ } else if (strpos($path, 'burst')!==false){
127
+ $current_plugin = 'burst';
128
+ }
129
+ $dir_url = plugin_dir_url(__FILE__).'img/';
130
+
131
+ $suggestion = $fallback_suggestion = [
132
+ 'icon_url' => $dir_url.'burst.png',
133
+ 'constant' => 'burst_version',
134
+ 'title' => 'Burst – Privacy Friendly Statistics',
135
+ 'description_short' => __('Self-hosted and privacy-friendly analytics tool.', "really-simple-ssl"),
136
+ 'disabled' => '',
137
+ 'button_text' => __("Install", "really-simple-ssl"),
138
+ 'slug' => 'burst-statistics',
139
+ 'description' => __("Get detailed insights into visitors' behaviour with Burst Statistics, the privacy-friendly analytics dashboard from Really Simple Plugins.", "really-simple-ssl"),
140
+ 'install_url' => 'burst%20statistics%20hesseldejong%20%20burst-statistics.com&tab=search&type=term',
141
+ ];
142
+
143
+ if ( $plugin_to_be_installed === 'really-simple-ssl' ){
144
+ $suggestion = [
145
+ 'icon_url' => $dir_url.'complianz-gdpr.gif',
146
+ 'constant' => 'cmplz_version',
147
+ 'title' => 'Complianz GDPR/CCPA',
148
+ 'description_short' => __('GDPR/CCPA Privacy Suite', "really-simple-ssl"),
149
+ 'disabled' => '',
150
+ 'button_text' => __("Install", "really-simple-ssl"),
151
+ 'slug' => 'complianz-gdpr',
152
+ 'description' => __('Configure your Cookie Notice, Cookie Consent and Cookie Policy with our Wizard and Cookie Scan. Supports GDPR, DSGVO, TTDSG, LGPD, POPIA, RGPD, CCPA and PIPEDA.', "really-simple-ssl"),
153
+ 'install_url' => 'complianz+gdpr+POPIA&tab=search&type=term',
154
+ ];
155
+ if ($current_plugin==='complianz-gdpr') {
156
+ $suggestion = $fallback_suggestion;
157
+ }
158
+ }
159
+
160
+ if ( $plugin_to_be_installed === 'complianz-gdpr' ){
161
+ $suggestion = [
162
+ 'icon_url' => $dir_url.'really-simple-ssl.png',
163
+ 'constant' => 'rsssl_version',
164
+ 'title' => 'Really Simple SSL',
165
+ 'description_short' => __('One click SSL optimization', "really-simple-ssl"),
166
+ 'disabled' => '',
167
+ 'button_text' => __("Install", "really-simple-ssl"),
168
+ 'slug' => 'really-simple-ssl',
169
+ 'description' => __('Really Simple SSL automatically detects your settings and configures your website to run over HTTPS. To keep it lightweight, we kept the options to a minimum. Your website will move to SSL with one click.', "really-simple-ssl"),
170
+ 'install_url' => 'ssl%20really%20simple%20plugins%20complianz+HSTS&tab=search&type=term',
171
+ ];
172
+ if ($current_plugin==='really-simple-ssl') {
173
+ $suggestion = $fallback_suggestion;
174
+ }
175
+ }
176
+
177
+ $suggestion['install_url'] = admin_url('plugin-install.php?s=').$suggestion['install_url'];
178
+ if (defined($suggestion['constant'])){
179
+ $suggestion['install_url'] = '#';
180
+ $suggestion['button_text'] = __("Installed", "really-simple-ssl");
181
+ $suggestion['disabled'] = 'disabled';
182
+ }
183
+
184
+ return $suggestion[$attr];
185
+ }
186
+
187
+ /**
188
+ * Set up WordPress filters to hook into WP's update process.
189
+ *
190
+ * @uses add_filter()
191
+ *
192
+ * @return void
193
+ */
194
+ public function init() {
195
+ add_action( 'admin_footer', array( $this, 'print_install_modal' ) );
196
+ add_action( 'admin_enqueue_scripts', array( $this, 'enqueue_assets') );
197
+ add_action( 'wp_ajax_rsp_upgrade_destination_clear', array($this, 'process_ajax_destination_clear') );
198
+ add_action( 'wp_ajax_rsp_upgrade_activate_license', array($this, 'process_ajax_activate_license') );
199
+ add_action( 'wp_ajax_rsp_upgrade_package_information', array($this, 'process_ajax_package_information') );
200
+ add_action( 'wp_ajax_rsp_upgrade_install_plugin', array($this, 'process_ajax_install_plugin') );
201
+ add_action( 'wp_ajax_rsp_upgrade_activate_plugin', array($this, 'process_ajax_activate_plugin') );
202
+ }
203
+
204
+ /**
205
+ * Enqueue javascript
206
+ * @todo minification
207
+ */
208
+ public function enqueue_assets( $hook ) {
209
+ if ( $hook === "plugins.php" && isset($_GET['install_pro']) ) {
210
+ $minified = ( defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ) ? '' : '.min';
211
+ wp_register_style( 'rsp-upgrade-css', plugin_dir_url(__FILE__) . "upgrade-to-pro$minified.css", false, $this->version );
212
+ wp_enqueue_style( 'rsp-upgrade-css' );
213
+ wp_enqueue_script( 'rsp-ajax-js', plugin_dir_url(__FILE__) . "ajax$minified.js", array(), $this->version, true );
214
+ wp_enqueue_script( 'rsp-upgrade-js', plugin_dir_url(__FILE__) . "upgrade-to-pro$minified.js", array(), $this->version, true );
215
+ wp_localize_script(
216
+ 'rsp-upgrade-js',
217
+ 'rsp_upgrade',
218
+ array(
219
+ 'steps' => $this->steps,
220
+ 'admin_url' => admin_url( 'admin-ajax.php' ),
221
+ 'token' => wp_create_nonce( 'upgrade_to_pro_nonce'),
222
+ 'cmplz_nonce' => wp_create_nonce( 'complianz_save'),
223
+ 'finished_title' => __("Installation finished", "really-simple-ssl"),
224
+ )
225
+ );
226
+ }
227
+ }
228
+
229
+ /**
230
+ * Calls the API and, if successfull, returns the object delivered by the API.
231
+ *
232
+ * @uses get_bloginfo()
233
+ * @uses wp_remote_post()
234
+ * @uses is_wp_error()
235
+ *
236
+ * @return false|object
237
+ */
238
+ private function api_request() {
239
+ if ( !current_user_can('manage_options') ) {
240
+ return false;
241
+ }
242
+ global $edd_plugin_url_available;
243
+
244
+ // Do a quick status check on this domain if we haven't already checked it.
245
+ $store_hash = md5( $this->api_url );
246
+ if ( ! is_array( $edd_plugin_url_available ) || ! isset( $edd_plugin_url_available[ $store_hash ] ) ) {
247
+ $test_url_parts = parse_url( $this->api_url );
248
+ $port = ! empty( $test_url_parts['port'] ) ? ':' . $test_url_parts['port'] : '';
249
+ $host = ! empty( $test_url_parts['host'] ) ? $test_url_parts['host'] : '';
250
+ $test_url = 'https://' . $host . $port;
251
+ $response = wp_remote_get( $test_url, array( 'timeout' => $this->health_check_timeout, 'sslverify' => true ) );
252
+ $edd_plugin_url_available[ $store_hash ] = is_wp_error( $response ) ? false : true;
253
+ }
254
+
255
+ if ( false === $edd_plugin_url_available[ $store_hash ] ) {
256
+ return false;
257
+ }
258
+
259
+ if( $this->api_url == trailingslashit ( home_url() ) ) {
260
+ return false; // Don't allow a plugin to ping itself
261
+ }
262
+
263
+ $api_params = array(
264
+ 'edd_action' => 'get_version',
265
+ 'license' => ! empty( $this->license ) ? $this->license : '',
266
+ 'item_id' => isset( $this->item_id ) ? $this->item_id : false,
267
+ 'url' => home_url(),
268
+ );
269
+ $request = wp_remote_post( $this->api_url, array( 'timeout' => 15, 'sslverify' => true, 'body' => $api_params ) );
270
+ if ( ! is_wp_error( $request ) ) {
271
+ $request = json_decode( wp_remote_retrieve_body( $request ) );
272
+ }
273
+
274
+ if ( $request && isset( $request->sections ) ) {
275
+ $request->sections = maybe_unserialize( $request->sections );
276
+ } else {
277
+ $request = false;
278
+ }
279
+
280
+ if ( $request && isset( $request->banners ) ) {
281
+ $request->banners = maybe_unserialize( $request->banners );
282
+ }
283
+
284
+ if ( $request && isset( $request->icons ) ) {
285
+ $request->icons = maybe_unserialize( $request->icons );
286
+ }
287
+
288
+ if( ! empty( $request->sections ) ) {
289
+ foreach( $request->sections as $key => $section ) {
290
+ $request->$key = (array) $section;
291
+ }
292
+ }
293
+
294
+ return $request;
295
+ }
296
+
297
+ /**
298
+ * Prints a modal with bullets for each step of the install process
299
+ */
300
+ public function print_install_modal()
301
+ {
302
+ if ( !current_user_can('manage_options') ) {
303
+ return false;
304
+ }
305
+
306
+ if ( is_admin() && isset($_GET['install_pro']) && isset($_GET['license']) && isset($_GET['item_id']) && isset($_GET['plugin']) ) {
307
+ $dashboard_url = $this->dashboard_url;
308
+ $plugins_url = admin_url( "plugins.php" );
309
+ ?>
310
+ <div id="rsp-step-template">
311
+ <div class="rsp-install-step {step}">
312
+ <div class="rsp-step-color">
313
+ <div class="rsp-grey rsp-bullet"></div>
314
+ </div>
315
+ <div class="rsp-step-text">
316
+ <span>{doing}</span>
317
+ </div>
318
+ </div>
319
+ </div>
320
+ <div id="rsp-plugin-suggestion-template">
321
+ <div class="rsp-recommended"><?php _e("Recommended by Really Simple Plugins","really-simple-ssl")?></div>
322
+ <div class="rsp-plugin-suggestion">
323
+ <div class="rsp-icon"><img alt="suggested plugin icon" src="<?=$this->get_suggested_plugin('icon_url')?>"></div>
324
+ <div class="rsp-summary">
325
+ <div class="rsp-title"><?=$this->get_suggested_plugin('title')?></div>
326
+ <div class="rsp-description_short"><?=$this->get_suggested_plugin('description_short')?></div>
327
+ <div class="rsp-rating"><?php
328
+ $plugin_info = $this->get_plugin_info($this->get_suggested_plugin('slug'));
329
+
330
+ if (!is_wp_error($plugin_info) && !empty($plugin_info->rating)) {
331
+ wp_star_rating([
332
+ 'rating' => $plugin_info->rating,
333
+ 'type' => 'percent',
334
+ 'number' => $plugin_info->num_ratings
335
+ ]
336
+ );
337
+ }
338
+ ?></div>
339
+ </div>
340
+ <div class="rsp-description"><?=$this->get_suggested_plugin('description')?></div>
341
+ <div class="rsp-install-button"><a class="button-secondary" <?=$this->get_suggested_plugin('disabled')?> href="<?=$this->get_suggested_plugin('install_url')?>"><?=$this->get_suggested_plugin('button_text')?></a></div>
342
+ </div>
343
+ </div>
344
+ <div class="rsp-modal-transparent-background">
345
+ <div class="rsp-install-plugin-modal">
346
+ <h3><?php echo __("Installing", "really-simple-ssl") . " " . $this->plugin_name ?></h3>
347
+ <div class="rsp-progress-bar-container">
348
+ <div class="rsp-progress rsp-grey">
349
+ <div class="rsp-bar rsp-green" style="width:0%"></div>
350
+ </div>
351
+ </div>
352
+ <div class="rsp-install-steps">
353
+
354
+ </div>
355
+ <div class="rsp-footer">
356
+ <a href="<?php echo $dashboard_url ?>" role="button" class="button-primary rsp-yellow rsp-hidden rsp-btn rsp-visit-dashboard">
357
+ <?php echo __("Visit Dashboard", "really-simple-ssl") ?>
358
+ </a>
359
+ <a href="<?php echo $plugins_url ?>" role="button" class="button-primary rsp-red rsp-hidden rsp-btn rsp-cancel">
360
+ <?php echo __("Cancel", "really-simple-ssl") ?>
361
+ </a>
362
+ <div class="rsp-error-message rsp-folder rsp-package rsp-install rsp-activate rsp-hidden"><span><?php _e('An Error Occurred:',"really-simple-ssl")?></span>&nbsp;<?php printf(__('Install %sManually%s.',"really-simple-ssl").'&nbsp;', '<a target="_blank" href="https://really-simple-ssl.com/knowledge-base/install-really-simple-ssl-pro/">','</a>')?></div>
363
+ <div class="rsp-error-message rsp-license rsp-hidden"><span><?php _e('An Error Occurred:',"really-simple-ssl")?></span>&nbsp;<?php printf(__('Check your %slicense%s.',"really-simple-ssl").'&nbsp;', '<a target="_blank" href="https://really-simple-ssl.com/account/">','</a>')?></div>
364
+ </div>
365
+ </div>
366
+ </div>
367
+ <?php
368
+ }
369
+ }
370
+
371
+
372
+ /**
373
+ * Retrieve plugin info for rating use
374
+ *
375
+ * @uses plugins_api() Get the plugin data
376
+ *
377
+ * @param string $slug The WP.org directory repo slug of the plugin
378
+ *
379
+ * @version 1.0
380
+ */
381
+ private function get_plugin_info($slug = '')
382
+ {
383
+ require_once ABSPATH . 'wp-admin/includes/plugin-install.php';
384
+ $plugin_info = get_transient('rsp_'.$slug . '_plugin_info');
385
+ if ( empty($plugin_info) ) {
386
+ $plugin_info = plugins_api('plugin_information', array('slug' => $slug));
387
+ if (!is_wp_error($plugin_info)) {
388
+ set_transient('rsp_'.$slug . '_plugin_info', $plugin_info, WEEK_IN_SECONDS);
389
+ }
390
+ }
391
+ return $plugin_info;
392
+ }
393
+
394
+ /**
395
+ * Ajax GET request
396
+ *
397
+ * Checks if the destination folder already exists
398
+ *
399
+ * Requires from GET:
400
+ * - 'token' => wp_nonce 'upgrade_to_pro_nonce'
401
+ * - 'plugin' (This will set $this->slug (Ex. 'really-simple-ssl-pro/really-simple-ssl-pro.php'), based on which plugin)
402
+ *
403
+ * Echoes array [success]
404
+ */
405
+ public function process_ajax_destination_clear()
406
+ {
407
+ $error = false;
408
+ $response = [
409
+ 'success' => false,
410
+ ];
411
+
412
+ if ( !current_user_can('manage_options') ) {
413
+ $error = true;
414
+ }
415
+
416
+ if (defined($this->plugin_constant)) {
417
+ $error = true;
418
+ $response = [
419
+ 'success' => false,
420
+ 'message' => __("Plugin already installed!", "really-simple-ssl"),
421
+ ];
422
+ }
423
+
424
+ if ( !$error && isset($_GET['token']) && wp_verify_nonce($_GET['token'], 'upgrade_to_pro_nonce') && isset($_GET['plugin']) ) {
425
+ if ( !file_exists(WP_PLUGIN_DIR . '/' . $this->slug) ) {
426
+ $response = [
427
+ 'success' => true,
428
+ ];
429
+ }
430
+ }
431
+
432
+ $response = json_encode($response);
433
+ header("Content-Type: application/json");
434
+ echo $response;
435
+ exit;
436
+ }
437
+
438
+
439
+ /**
440
+ * Ajax GET request
441
+ *
442
+ * Links the license on the website to this site
443
+ *
444
+ * Requires from GET:
445
+ * - 'token' => wp_nonce 'upgrade_to_pro_nonce'
446
+ * - 'license'
447
+ * - 'item_id'
448
+ *
449
+ * (Without this link you cannot download the pro package from the website)
450
+ *
451
+ * Echoes array [license status, response message]
452
+ */
453
+ public function process_ajax_activate_license()
454
+ {
455
+ $error = false;
456
+ $response = [
457
+ 'success' => false,
458
+ 'message' => '',
459
+ ];
460
+
461
+ if ( !current_user_can('manage_options') ) {
462
+ $error = true;
463
+ }
464
+
465
+ if (!$error && isset($_GET['token']) && wp_verify_nonce($_GET['token'], 'upgrade_to_pro_nonce') && isset($_GET['license']) && isset($_GET['item_id']) ) {
466
+ $license = sanitize_title($_GET['license']);
467
+ $item_id = intval($_GET['item_id']);
468
+ $response = $this->validate($license, $item_id);
469
+ update_site_option($this->prefix.'auto_installed_license', $license);
470
+ }
471
+
472
+ $response = json_encode($response);
473
+ header("Content-Type: application/json");
474
+ echo $response;
475
+ exit;
476
+ }
477
+
478
+
479
+ /**
480
+ * Activate the license on the websites url at EDD
481
+ *
482
+ * Stores values in database:
483
+ * - {$this->pro_prefix}license_activations_left
484
+ * - {$this->pro_prefix}license_expires
485
+ * - {$this->pro_prefix}license_activation_limit
486
+ *
487
+ * @param $license
488
+ * @param $item_id
489
+ *
490
+ * @return array [license status, response message]
491
+ */
492
+
493
+ private function validate( $license, $item_id ) {
494
+ $message = "";
495
+ $success = false;
496
+
497
+ if ( !current_user_can('manage_options') ) {
498
+ return [
499
+ 'success' => $success,
500
+ 'message' => $message,
501
+ ];
502
+ }
503
+
504
+ // data to send in our API request
505
+ $api_params = array(
506
+ 'edd_action' => 'activate_license',
507
+ 'license' => $license,
508
+ 'item_id' => $item_id,
509
+ 'url' => home_url()
510
+ );
511
+
512
+ // Call the custom API.
513
+ $response = wp_remote_post( $this->api_url, array( 'timeout' => 15, 'sslverify' => false, 'body' => $api_params ) );
514
+
515
+ // make sure the response came back okay
516
+ if ( is_wp_error( $response ) || 200 !== wp_remote_retrieve_response_code( $response ) ) {
517
+ if ( is_wp_error( $response ) ) {
518
+ $message = $response->get_error_message();
519
+ } else {
520
+ $message = __( 'An error occurred, please try again.', "really-simple-ssl");
521
+ }
522
+ } else {
523
+ $license_data = json_decode( wp_remote_retrieve_body( $response ) );
524
+ if ( false === $license_data->success ) {
525
+ switch( $license_data->error ) {
526
+ case 'expired' :
527
+ $message = sprintf(
528
+ __( 'Your license key expired on %s.', "really-simple-ssl"),
529
+ date_i18n( get_option( 'date_format' ), strtotime( $license_data->expires, current_time( 'timestamp' ) ) )
530
+ );
531
+ break;
532
+ case 'disabled' :
533
+ case 'revoked' :
534
+ $message = __( 'Your license key has been disabled.', "really-simple-ssl");
535
+ break;
536
+ case 'missing' :
537
+ $message = __('Missing license.', "really-simple-ssl");
538
+ break;
539
+ case 'invalid' :
540
+ $message = __( 'Invalid license.', "really-simple-ssl");
541
+ break;
542
+ case 'site_inactive' :
543
+ $message = __( 'Your license is not active for this URL.', "really-simple-ssl" );
544
+ break;
545
+ case 'item_name_mismatch' :
546
+ $message = __( 'This appears to be an invalid license key for this plugin.', "really-simple-ssl" );
547
+ break;
548
+ case 'no_activations_left':
549
+ $message = __( 'Your license key has reached its activation limit.', "really-simple-ssl");
550
+ break;
551
+ default :
552
+ $message = __( 'An error occurred, please try again.', "really-simple-ssl" );
553
+ break;
554
+ }
555
+ } else {
556
+ $success = $license_data->license === 'valid';
557
+ }
558
+ }
559
+
560
+ $response = [
561
+ 'success' => $success,
562
+ 'message' => $message,
563
+ ];
564
+
565
+ return $response;
566
+ }
567
+
568
+
569
+ /**
570
+ * Ajax GET request
571
+ *
572
+ * Do an API request to get the download link where to download the pro package
573
+ *
574
+ * Requires from GET:
575
+ * - 'token' => wp_nonce 'upgrade_to_pro_nonce'
576
+ * - 'license'
577
+ * - 'item_id'
578
+ *
579
+ * Echoes array [success, download_link]
580
+ */
581
+ public function process_ajax_package_information()
582
+ {
583
+ if ( !current_user_can('manage_options') ) {
584
+ return false;
585
+ }
586
+
587
+ if ( isset($_GET['token']) && wp_verify_nonce($_GET['token'], 'upgrade_to_pro_nonce') && isset($_GET['license']) && isset($_GET['item_id']) ) {
588
+ $api = $this->api_request();
589
+ if ( $api && isset($api->download_link) ) {
590
+ $response = [
591
+ 'success' => true,
592
+ 'download_link' => $api->download_link,
593
+ ];
594
+ } else {
595
+ $response = [
596
+ 'success' => false,
597
+ 'download_link' => "",
598
+ ];
599
+ }
600
+ $response = json_encode($response);
601
+ header("Content-Type: application/json");
602
+ echo $response;
603
+ exit;
604
+
605
+ }
606
+ }
607
+
608
+
609
+ /**
610
+ * Ajax GET request
611
+ *
612
+ * Download and install the plugin
613
+ *
614
+ * Requires from GET:
615
+ * - 'token' => wp_nonce 'upgrade_to_pro_nonce'
616
+ * - 'download_link'
617
+ * (Linked license on the website to this site)
618
+ *
619
+ * Echoes array [success]
620
+ */
621
+ public function process_ajax_install_plugin()
622
+ {
623
+ $message = '';
624
+
625
+ if ( !current_user_can('manage_options') ) {
626
+ return [
627
+ 'success' => false,
628
+ 'message' => $message,
629
+ ];
630
+ }
631
+
632
+ if ( isset($_GET['token']) && wp_verify_nonce($_GET['token'], 'upgrade_to_pro_nonce') && isset($_GET['download_link']) ) {
633
+
634
+ $download_link = esc_url_raw($_GET['download_link']);
635
+ require_once ABSPATH . 'wp-admin/includes/class-wp-upgrader.php';
636
+ include_once ABSPATH . 'wp-admin/includes/plugin-install.php';
637
+
638
+ $skin = new WP_Ajax_Upgrader_Skin();
639
+ $upgrader = new Plugin_Upgrader( $skin );
640
+ $result = $upgrader->install( $download_link );
641
+
642
+ if ( $result ) {
643
+ $response = [
644
+ 'success' => true,
645
+ ];
646
+ } else {
647
+ if ( is_wp_error($result) ){
648
+ $message = $result->get_error_message();
649
+ }
650
+ $response = [
651
+ 'success' => false,
652
+ 'message' => $message,
653
+ ];
654
+ }
655
+
656
+ $response = json_encode($response);
657
+ header("Content-Type: application/json");
658
+ echo $response;
659
+ exit;
660
+ }
661
+ }
662
+
663
+
664
+ /**
665
+ * Ajax GET request
666
+ *
667
+ * Do an API request to get the download link where to download the pro package
668
+ *
669
+ * Requires from GET:
670
+ * - 'token' => wp_nonce 'upgrade_to_pro_nonce'
671
+ * - 'plugin' (This will set $this->slug (Ex. 'really-simple-ssl-pro/really-simple-ssl-pro.php'), based on which plugin)
672
+ *
673
+ * Echoes array [success]
674
+ */
675
+ public function process_ajax_activate_plugin()
676
+ {
677
+ if ( !current_user_can('manage_options') ) {
678
+ return false;
679
+ }
680
+
681
+ if ( isset($_GET['token']) && wp_verify_nonce($_GET['token'], 'upgrade_to_pro_nonce') && isset($_GET['plugin']) ) {
682
+
683
+ $result = activate_plugin( $this->slug );
684
+
685
+ if ( !is_wp_error($result) ) {
686
+ $response = [
687
+ 'success' => true,
688
+ ];
689
+ } else {
690
+ $response = [
691
+ 'success' => false,
692
+ ];
693
+ }
694
+ $response = json_encode($response);
695
+ header("Content-Type: application/json");
696
+ echo $response;
697
+ exit;
698
+ }
699
+ }
700
+ }
701
+ $rsp_upgrade_to_pro = new rsp_upgrade_to_pro();
702
+ }