Plugin Directory

Changeset 2943206


Ignore:
Timestamp:
07/25/2023 04:50:22 PM (3 years ago)
Author:
aspiesoft
Message:

: bug fixes for php updates

Location:
aspiesoft-auto-embed/trunk
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • aspiesoft-auto-embed/trunk/aspiesoft-auto-embed.php

    r2835721 r2943206  
    77Plugin URI: https://github.com/AspieSoft/aspiesoft-auto-embed
    88Description: Easily Embed Dynamic Lazy Loading Youtube Videos And More Simply By Pasting The Url.
    9 Version: 1.5.7
     9Version: 1.5.8
    1010Author: AspieSoft
    1111Author URI: https://www.aspiesoft.com
     
    123123      // version added so updates to functions can still occur without breaking other plugins
    124124      require_once(plugin_dir_path(__FILE__).'functions.php');
    125       global $aspieSoft_Functions_v1_3;
    126       self::$func = $aspieSoft_Functions_v1_3;
     125      global $AspieSoft_Functions_v1_4;
     126      self::$func = $AspieSoft_Functions_v1_4;
    127127
    128128      self::$options = self::$func::options($this->plugin);
     
    164164        $this->enableOptionsAutoload();
    165165      }
    166       //flush_rewrite_rules();
     166      flush_rewrite_rules();
    167167    }
    168168
     
    171171        $this->disableOptionsAutoload();
    172172      }
    173       //flush_rewrite_rules();
     173      flush_rewrite_rules();
    174174    }
    175175
  • aspiesoft-auto-embed/trunk/functions.php

    r2714980 r2943206  
    66}
    77
    8 if(!class_exists('AspieSoft_Functions_v1_3')){
    9 
    10   class AspieSoft_Functions_v1_3{
     8if(!class_exists('AspieSoft_Functions_v1_4')){
     9
     10  class AspieSoft_Functions_v1_4{
    1111
    1212    public static function startsWith($haystack, $needle){
     
    5454      }
    5555      foreach($attr as $v){
    56         if($v !== null){
     56        if(isset($v)){
    5757          return $v;
    5858        }
     
    103103      if(is_multisite()){
    104104        $option = sanitize_text_field(get_option($name));
    105         if(!isset($option) || !$option || $option === null || $option === ''){
     105        if(!isset($option) || $option === ''){
    106106          $option = sanitize_text_field(get_site_option($name));
    107107        }
     
    109109        $option = sanitize_text_field(get_option($name));
    110110      }
    111       if(!isset($option) || !$option || $option === null || $option === ''){
     111      if(!isset($option) || $option === ''){
    112112        $option = $default;
    113113      }
     
    186186        if($onActivation){
    187187          $value = self::options_get($plugin, $name, null, false);
    188           if($value && $value !== null){
     188          if(isset($value)){
    189189            // twice with name change to force update
    190190            self::options_set($plugin, $name, 'autoload:'.$value, $global, $autoload);
     
    205205  }
    206206
    207   global $aspieSoft_Functions_v1_3;
    208   $aspieSoft_Functions_v1_3 = new AspieSoft_Functions_v1_3();
     207  global $AspieSoft_Functions_v1_4;
     208  $AspieSoft_Functions_v1_4 = new AspieSoft_Functions_v1_4();
    209209
    210210}
  • aspiesoft-auto-embed/trunk/readme.txt

    r2835721 r2943206  
    44Requires at least: 3.0.1
    55Tested up to: 6.0.2
    6 Stable tag: 1.5.7
     6Stable tag: 1.5.8
    77Requires PHP: 5.2.4
    88License: GPLv2 or later
  • aspiesoft-auto-embed/trunk/src/admin.php

    r2714980 r2943206  
    2222      $this->plugin = $pluginData;
    2323      require_once(plugin_dir_path(__FILE__).'../functions.php');
    24       global $aspieSoft_Functions_v1_3;
    25       self::$func = $aspieSoft_Functions_v1_3;
     24      global $AspieSoft_Functions_v1_4;
     25      self::$func = $AspieSoft_Functions_v1_4;
    2626      self::$options = self::$func::options($this->plugin);
    2727      self::$optionsGlobal = self::$func::options(array('setting' => 'global'));
  • aspiesoft-auto-embed/trunk/src/assets/0settings.php

    r2714980 r2943206  
    2525      $this->plugin = $pluginData;
    2626      require_once(plugin_dir_path(__FILE__) . '../../functions.php');
    27       global $aspieSoft_Functions_v1_3;
    28       self::$func = $aspieSoft_Functions_v1_3;
     27      global $AspieSoft_Functions_v1_4;
     28      self::$func = $AspieSoft_Functions_v1_4;
    2929    }
    3030
  • aspiesoft-auto-embed/trunk/src/main.php

    r2714980 r2943206  
    2121      $this->plugin = $pluginData;
    2222      require_once(plugin_dir_path(__FILE__).'../functions.php');
    23       global $aspieSoft_Functions_v1_3;
    24       self::$func = $aspieSoft_Functions_v1_3;
     23      global $AspieSoft_Functions_v1_4;
     24      self::$func = $AspieSoft_Functions_v1_4;
    2525      self::$options = self::$func::options($this->plugin);
    2626    }
     
    3737
    3838      $altShortcode_default = self::$options['get']('altShortcode_default');
    39       if($altShortcode_default && $altShortcode_default !== null){
     39      if(isset($altShortcode_default)){
    4040        add_shortcode($altShortcode_default, array($this, 'shortcode_Embed'));
    4141      }
    4242
    4343      $altShortcode = self::$options['get']('altShortcode');
    44       if($altShortcode && $altShortcode !== null){ // add custom shortcode from settings, if it exists
     44      if(isset($altShortcode)){ // add custom shortcode from settings, if it exists
    4545        add_shortcode($altShortcode, array($this, 'shortcode_YoutubeEmbed'));
    4646      }
  • aspiesoft-auto-embed/trunk/src/settings.php

    r2714980 r2943206  
    2525      );
    2626      if (is_array($default)) {
    27         if ($default['width'] !== null) {
     27        if (isset($default['width'])) {
    2828          $sizes['width'] = $default['width'];
    2929        }
    30         if ($default['min-width'] !== null) {
     30        if (isset($default['min-width'])) {
    3131          $sizes['min-width'] = $default['min-width'];
    3232        }
    33         if ($default['max-width'] !== null) {
     33        if (isset($default['max-width'])) {
    3434          $sizes['max-width'] = $default['max-width'];
    3535        }
    36         if ($default['ratio'] !== null) {
     36        if (isset($default['ratio'])) {
    3737          $sizes['ratio'] = $default['ratio'];
    3838        }
  • aspiesoft-auto-embed/trunk/templates/admin.php

    r2714980 r2943206  
    3333
    3434        // unique identifier to allow multiple sessions
    35         $computerId = hash('sha256', sanitize_text_field($_SERVER['HTTP_USER_AGENT']).sanitize_text_field($_SERVER['LOCAL_ADDR']).sanitize_text_field($_SERVER['LOCAL_PORT']).sanitize_text_field($_SERVER['REMOTE_ADDR']));
     35        $computerId = '';
     36        if(isset($_SERVER['HTTP_USER_AGENT'])){
     37          $computerId .= sanitize_text_field($_SERVER['HTTP_USER_AGENT']);
     38        }
     39        if(isset($_SERVER['LOCAL_ADDR'])){
     40          $computerId .= sanitize_text_field($_SERVER['LOCAL_ADDR']);
     41        }
     42        if(isset($_SERVER['LOCAL_PORT'])){
     43          $computerId .= sanitize_text_field($_SERVER['LOCAL_PORT']);
     44        }
     45        if(isset($_SERVER['REMOTE_ADDR'])){
     46          $computerId .= sanitize_text_field($_SERVER['REMOTE_ADDR']);
     47        }
     48        $computerId = hash('sha256', $computerId);
    3649
    3750        // verify session token
     
    172185      // load common functions
    173186      require_once(plugin_dir_path(__FILE__).'../functions.php');
    174       global $aspieSoft_Functions_v1_3;
    175       self::$func = $aspieSoft_Functions_v1_3;
     187      global $AspieSoft_Functions_v1_4;
     188      self::$func = $AspieSoft_Functions_v1_4;
    176189    }
    177190
Note: See TracChangeset for help on using the changeset viewer.