Plugin Directory

Changeset 3027244


Ignore:
Timestamp:
01/26/2024 09:07:22 AM (2 years ago)
Author:
importify
Message:

version 1.0.4

Location:
popify-sales-pop-ups
Files:
25 added
2 edited

Legend:

Unmodified
Added
Removed
  • popify-sales-pop-ups/trunk/popify.php

    r3016644 r3027244  
    88 * Plugin Name: Popify Sales Pop Ups
    99 * Description: Popify is the best free tool for Social Proof, Recent Sales Popup, Customer Reviews Pop up, Recent Orders and Abandoned cart recovery.
    10  * Version: 1.0.3
     10 * Version: 1.0.4
    1111 * Author: Popify
    1212 * Author URI: https://popify.app
     
    2020
    2121define("POPIFY_API_URL", "https://app.popify.app");
    22 define('POPIFY_VERSION', '1.0');
     22define('POPIFY_VERSION', '1.0.4');
    2323define('POPIFY_PATH', dirname(__FILE__));
    2424define('POPIFY_FOLDER', basename(POPIFY_PATH));
     
    2626define('POPIFY_API_KEY', get_option('popify_api_key'));
    2727define("POPIFY_DEVELOPMENT", (stripos(POPIFY_API_URL, "dev.popify") !== false ? "dev" : ""));
    28 define("POPIFY_DEBUG", true);
     28define("POPIFY_DEBUG", false);
    2929
    3030register_activation_hook(__FILE__, 'popify_activation_hook');
     
    3434add_action('admin_menu', 'popify_admin_menu');
    3535add_action('wp_head', 'popify_script');
    36 add_action("wp_ajax_nopriv_popify_installation","popify_installation");
    37 add_action("wp_ajax_popify_installation","popify_installation");
    3836
    3937function popify_activation_hook()
     
    5149        if ($response['success'] > 0)
    5250        {
    53             popify_log('api key: '.$response['api_key'], get_site_url());
    54       popify_log((!get_option('popify_api_key') ? "yes" : "no"), get_site_url());
     51           
    5552
    5653            if (!get_option('popify_api_key'))
     
    5855                add_option('popify_api_key',$response['api_key']);
    5956
    60         popify_log($response['app_name']." ".$response['user_id']." ".$response['scope'], get_site_url());
     57       
    6158       
    6259        if (class_exists("WC_Auth"))
     
    8784        }
    8885
    89         popify_log('after auth');
     86       
    9087            }
    9188            else
     
    9693        else
    9794        {
    98             popify_log('invalid response - api key', get_site_url());
     95           
    9996     
    10097      if (!get_option('popify_error'))
     
    107104    else
    108105    {
    109         popify_log('error getting response - api key', get_site_url());
     106       
    110107
    111108    if (!get_option('popify_error'))
     
    215212      'body' => json_encode($data),
    216213    );
    217     popify_log('sending request', $url);
     214   
    218215    $response = wp_remote_post($url, $data);
    219     popify_log('got response', $url);
     216   
    220217   
    221218    if (!is_wp_error($response))
     
    230227  catch(Exception $err)
    231228  {
    232     popify_handle_error('failed sending request', $err, $data);
    233   }
    234 }
    235 
    236 function popify_log($message, $data = null)
    237 {
    238   $log = null;
    239 
    240   if (isset($data))
    241   {
    242     $log = "\n[Popify] " . $message . ":\n" . print_r($data, true);
    243   }
    244   else
    245   {
    246     $log = "\n[Popify] " . $message;
    247   }
    248   error_log($log);
    249 
    250   if (POPIFY_DEBUG)
    251   {
    252     $plugin_log_file = plugin_dir_path(__FILE__).'debug.log';
    253     error_log($log."\n", 3, $plugin_log_file);
    254   }
    255 }
    256 
    257 function popify_handle_error($message, $err, $data = null)
    258 {
    259   popify_log($message, $err);
     229    if(POPIFY_DEBUG)
     230    {
     231      echo $err;
     232    }
     233  }
    260234}
    261235
     
    338312}
    339313
    340 function popify_installation()
    341 {
    342   if (in_array('woocommerce/woocommerce.php', apply_filters( 'active_plugins', get_option( 'active_plugins'))) && !get_option('popify_error'))
    343   {
    344     $json['success'] = 1;
    345     $json['api_key'] = get_option('popify_api_key');
    346   }
    347   else
    348   {
    349     $json["success"] = 0;
    350   }
    351 
    352   wp_send_json($json);
    353   wp_die();
    354 }
    355314
    356315?>
  • popify-sales-pop-ups/trunk/readme.txt

    r3016644 r3027244  
    66Requires PHP: 5.4
    77Tested up to: 6.4.2
    8 Stable tag: 1.0.3
     8Stable tag: 1.0.4
    99Plugin URI: https://popify.app
    1010License: proprietary
Note: See TracChangeset for help on using the changeset viewer.