Plugin Directory

Changeset 2961090


Ignore:
Timestamp:
08/31/2023 10:52:19 AM (3 years ago)
Author:
sajdoko
Message:

Added backward compatibility down to PHP 5.6.

Location:
lw-all-in-one/trunk
Files:
10 edited

Legend:

Unmodified
Added
Removed
  • lw-all-in-one/trunk/admin/class-lw-all-in-one-admin.php

    r2960449 r2961090  
    2525   * @var      string    $plugin_name    The ID of this plugin.
    2626   */
    27   private string $plugin_name;
     27  private $plugin_name;
    2828
    2929  /**
     
    3333   * @var      string    $version    The current version of this plugin.
    3434   */
    35   private string $version;
     35  private $version;
    3636
    3737  /**
     
    4141   * @param  string  $version    The version of this plugin.
    4242   */
    43   public function __construct( string $plugin_name, string $version) {
     43  public function __construct( $plugin_name, $version) {
    4444
    4545    $this->plugin_name = $plugin_name;
     
    4848  }
    4949
    50   public function enqueue_styles($hook): void {
     50  public function enqueue_styles($hook){
    5151    if (preg_match('/page_lw_all_in_one/', $hook)) {
    5252      $min = defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ? '' : '.min';
     
    5555  }
    5656
    57   public function enqueue_scripts($hook): void {
     57  public function enqueue_scripts($hook){
    5858    // echo $hook;
    5959    // die();
     
    220220  public function get_plugin_options($parent_key = false, $key = false) {
    221221    $options = get_option($this->plugin_name);
     222
    222223    if ($parent_key !== false) {
    223         return $options[ $parent_key ][ $key ] ?? '';
     224      if (isset($options[$parent_key]) && isset($options[$parent_key][$key])) {
     225        return $options[$parent_key][$key];
     226      } else {
     227        return false;
     228      }
    224229    } else {
    225         return $options[ $key ] ?? '';
    226     }
    227   }
     230      if (isset($options[$key])) {
     231        return $options[$key];
     232      } else {
     233        return false;
     234      }
     235    }
     236  }
     237
    228238
    229239  public function lw_all_in_one_header_scripts_from_tab() {
     
    265275  }
    266276
    267   public function lw_all_in_one_is_base64($string): bool {
     277  public function lw_all_in_one_is_base64($string) {
    268278    return (bool) preg_match('/^[a-zA-Z0-9\/\r\n+]*={0,2}$/', $string);
    269279  }
  • lw-all-in-one/trunk/admin/class-lw-all-in-one-cf7.php

    r2957218 r2961090  
    2525   * @var      string    $plugin_name    The ID of this plugin.
    2626   */
    27   private string $plugin_name;
     27  private $plugin_name;
    2828
    2929  /**
     
    3434   */
    3535  private $version;
    36   private string $lw_api_url = 'https://localwebapi.ids.al/contactFormWeb';
     36  private $lw_api_url = 'https://localwebapi.ids.al/contactFormWeb';
    3737
    3838  /**
     
    4242   * @param  string  $version    The version of this plugin.
    4343   */
    44   public function __construct( string $plugin_name, string $version) {
     44  public function __construct( $plugin_name, $version) {
    4545
    4646    $this->plugin_name = $plugin_name;
  • lw-all-in-one/trunk/admin/class-lw-all-in-one-ga-events.php

    r2957218 r2961090  
    2525   * @var      string    $plugin_name    The ID of this plugin.
    2626   */
    27   private string $plugin_name;
     27  private $plugin_name;
    2828
    2929  /**
     
    4141   * @param  string  $version    The version of this plugin.
    4242   */
    43   public function __construct( string $plugin_name, string $version) {
     43  public function __construct( $plugin_name, $version) {
    4444
    4545    $this->plugin_name = $plugin_name;
  • lw-all-in-one/trunk/admin/class-lw-all-in-one-privacy-policy-pages.php

    r2957218 r2961090  
    2525   * @var      string    $plugin_name    The ID of this plugin.
    2626   */
    27   private string $plugin_name;
     27  private $plugin_name;
    2828
    2929  /**
  • lw-all-in-one/trunk/admin/class-lw-all-in-one-wim.php

    r2957218 r2961090  
    2525   * @var      string    $plugin_name    The ID of this plugin.
    2626   */
    27   private string $plugin_name;
     27  private $plugin_name;
    2828
    2929  /**
     
    3535  private $version;
    3636
    37   private string $wim_veify_api_url = 'https://localweb.it/chat/api/cliente/verifica-plugin.php';
     37  private $wim_veify_api_url = 'https://localweb.it/chat/api/cliente/verifica-plugin.php';
    3838
    3939  /**
     
    4343   * @param  string  $version    The version of this plugin.
    4444   */
    45   public function __construct( string $plugin_name, string $version) {
     45  public function __construct( $plugin_name, $version) {
    4646
    4747    $this->plugin_name = $plugin_name;
     
    142142  }
    143143
    144   public function lw_all_in_one_old_wim_is_active_deactivate(): void {
     144  public function lw_all_in_one_old_wim_is_active_deactivate(){
    145145    if (is_plugin_active('web-instant-messenger/web-instant-messenger.php')) {
    146146      delete_option('wim_activation_status');
  • lw-all-in-one/trunk/includes/class-lw-all-in-one.php

    r2957218 r2961090  
    4141   *
    4242   * @access   protected
    43    * @var      string    $plugin_name    The string used to uniquely identify this plugin.
     43   * @var      $plugin_name    The string used to uniquely identify this plugin.
    4444   */
    45   protected string $plugin_name;
     45  protected $plugin_name;
    4646
    4747  /**
     
    4949   *
    5050   * @access   protected
    51    * @var      string    $version    The current version of the plugin.
     51   * @var      $version    The current version of the plugin.
    5252   */
    53   protected string $version;
     53  protected $version;
    5454
    5555  /**
     
    351351  public function check_plugin_options($parent_key = false, $key = false) {
    352352    $options = get_option($this->plugin_name);
     353
    353354    if ($parent_key !== false) {
    354         return $options[ $parent_key ][ $key ] ?? false;
    355     } else {
    356         return $options[ $key ] ?? false;
     355      if (isset($options[$parent_key]) && isset($options[$parent_key][$key])) {
     356        return $options[$parent_key][$key];
     357      } else {
     358        return false;
     359      }
     360    } else {
     361      if (isset($options[$key])) {
     362        return $options[$key];
     363      } else {
     364        return false;
     365      }
    357366    }
    358367  }
  • lw-all-in-one/trunk/includes/helpers/lw-all-in-one-helper-functions.php

    r2957218 r2961090  
    22
    33if (!function_exists('clean_domain')) {
    4   function clean_domain($domain): string {
     4  function clean_domain($domain) {
    55    $clean = preg_replace('#^http(s)?://#', '', $domain);
    66    $clean = preg_replace('/^www\./', '', $clean);
     
    1818
    1919if (!function_exists('lw_all_in_one_validate_tracking_id')) {
    20   function lw_all_in_one_validate_tracking_id($str): bool {
     20  function lw_all_in_one_validate_tracking_id($str) {
    2121    return (bool) preg_match('/^UA-\d+-\d+$|^G-[a-zA-Z0-9]+$|^GTM-[a-zA-Z0-9]+$|^AW-[a-zA-Z0-9]+$|^DC-[a-zA-Z0-9]+$/i', strval($str));
    2222  }
  • lw-all-in-one/trunk/lw-all-in-one.php

    r2960450 r2961090  
    1010 * Plugin Name:       LocalWeb All In One
    1111 * Description:       LocalWeb All In One should be installed only on websites created by Local Web S.R.L, because it extends certain functionalities of the website which may send certain data to LocalWeb's servers. This is to make possible showing data on LocalWeb App.
    12  * Version:           1.7.1
     12 * Version:           1.7.2
    1313 * Author:            Local Web S.R.L
    1414 * Author URI:        https://localweb.it/
     
    2929 * Currently plugin version.
    3030 */
    31 define('LW_ALL_IN_ONE_VERSION', '1.7.1');
     31define('LW_ALL_IN_ONE_VERSION', '1.7.2');
    3232
    3333/**
  • lw-all-in-one/trunk/public/class-lw-all-in-one-public.php

    r2957218 r2961090  
    2828   * @var      string    $plugin_name    The ID of this plugin.
    2929   */
    30   private string $plugin_name;
     30  private $plugin_name;
    3131
    3232  /**
     
    3636   * @var      string    $version    The current version of this plugin.
    3737   */
    38   private string $version;
     38  private $version;
    3939
    4040  /**
     
    4444   * @param  string  $version    The version of this plugin.
    4545   */
    46   public function __construct( string $plugin_name, string $version) {
     46  public function __construct( $plugin_name, $version) {
    4747
    4848    $this->plugin_name = $plugin_name;
     
    6666   *
    6767   */
    68   public function enqueue_scripts(): void {
     68  public function enqueue_scripts(){
    6969    //Plugin options
    7070    $options = get_option($this->plugin_name);
     
    112112  }
    113113
    114   public function lw_all_in_one_dequeue(): void {
     114  public function lw_all_in_one_dequeue(){
    115115    //Plugin options
    116116    $options = get_option($this->plugin_name);
     
    125125    }
    126126
    127     function lw_all_in_one_dequeue_styles(): void {
     127    function lw_all_in_one_dequeue_styles(){
    128128      global $wp_styles;
    129129      foreach( $wp_styles->queue as $style ) {
     
    134134    }
    135135
    136     function lw_all_in_one_dequeue_scripts(): void {
     136    function lw_all_in_one_dequeue_scripts(){
    137137      global $wp_scripts;
    138138      foreach( $wp_scripts->queue as $style ) {
  • lw-all-in-one/trunk/readme.txt

    r2960955 r2961090  
    44Requires at least: 4.8.5
    55Tested up to: 6.3
    6 Stable tag: 1.7.1
    7 Requires PHP: 7.0
     6Stable tag: 1.7.2
     7Requires PHP: 5.6
    88License: GPLv2 or later
    99License URI: https://www.gnu.org/licenses/gpl-2.0.html
     
    3030
    3131## Changelog
     32
     33### 1.7.2
     34- Added backward compatibility down to PHP 5.6.
    3235
    3336### 1.7.1
Note: See TracChangeset for help on using the changeset viewer.