Plugin Directory

Changeset 3024513


Ignore:
Timestamp:
01/20/2024 03:51:12 PM (2 years ago)
Author:
importify
Message:

version 1.0.4

Location:
editorify
Files:
23 added
2 edited

Legend:

Unmodified
Added
Removed
  • editorify/trunk/editorify.php

    r3016643 r3024513  
    88 * Plugin Name: Editorify
    99 * Description: Boost Your Sales By Adding Products Reviews, Videos & Images to your product page
    10  * Version: 1.0.3
     10 * Version: 1.0.4
    1111 * Author: Editorify
    1212 * Author URI: https://editorify.com
     
    2020
    2121define("EDITORIFY_API_URL", "https://apps.editorify.com");
    22 define('EDITORIFY_VERSION', '1.0');
     22define('EDITORIFY_VERSION', '1.0.4');
    2323define('EDITORIFY_PATH', dirname(__FILE__));
    2424define('EDITORIFY_FOLDER', basename(EDITORIFY_PATH));
     
    2626define('EDITORIFY_API_KEY', get_option('editorify_api_key'));
    2727define("EDITORIFY_DEVELOPMENT", (stripos(EDITORIFY_API_URL, "dev.editorify") !== false ? "dev" : ""));
    28 define("EDITORIFY_DEBUG", true);
     28define("EDITORIFY_DEBUG", false);
    2929
    3030register_activation_hook(__FILE__, 'editorify_activation_hook');
     
    3434add_action('admin_menu', 'editorify_admin_menu');
    3535add_action('wp_head', 'editorify_script');
    36 add_action("wp_ajax_nopriv_editorify_installation", "editorify_installation");
    37 add_action("wp_ajax_editorify_installation", "editorify_installation");
     36
    3837
    3938function editorify_activation_hook()
     
    5049        if ($response['success'] > 0) {
    5150
    52             editorify_log('api key: ' . $response['api_key'], get_site_url());
    53             editorify_log((!get_option('editorify_api_key') ? "yes" : "no"), get_site_url());
     51           
    5452
    5553            if (!get_option('editorify_api_key')) {
    5654                add_option('editorify_api_key', $response['api_key']);
    5755
    58                 editorify_log($response['app_name'] . " " . $response['user_id'] . " " . $response['scope'], get_site_url());
     56               
    5957
    6058                if (class_exists("WC_Auth")) {
     
    8482                }
    8583
    86                 editorify_log('after auth');
     84               
    8785            } else {
    8886                update_option('editorify_api_key', $response['api_key']);
    8987            }
    9088        } else {
    91             editorify_log('invalid response - api key', get_site_url());
     89           
    9290
    9391            if (!get_option('editorify_error')) {
     
    9795        }
    9896    } else {
    99         editorify_log('error getting response - api key', get_site_url());
     97       
    10098
    10199        if (!get_option('editorify_error')) {
     
    197195            'body' => json_encode($data),
    198196        );
    199         editorify_log('sending request', $url);
     197       
    200198        $response = wp_remote_post($url, $data);
    201         editorify_log('got response', $url);
     199       
    202200
    203201        if (!is_wp_error($response)) {
     
    209207        return 0;
    210208    } catch (Exception $err) {
    211         editorify_handle_error('failed sending request', $err, $data);
    212     }
    213 }
    214 
    215 function editorify_log($message, $data = null)
    216 {
    217     $log = null;
    218 
    219     if (isset($data)) {
    220         $log = "\n[Editorify] " . $message . ":\n" . print_r($data, true);
    221     } else {
    222         $log = "\n[Editorify] " . $message;
    223     }
    224     error_log($log);
    225 
    226     if (EDITORIFY_DEBUG) {
    227         $plugin_log_file = plugin_dir_path(__FILE__) . 'debug.log';
    228         error_log($log . "\n", 3, $plugin_log_file);
    229     }
    230 }
    231 
    232 function editorify_handle_error($message, $err, $data = null)
    233 {
    234     editorify_log($message, $err);
    235 }
     209        if(EDITORIFY_DEBUG)
     210        {
     211            echo $err;
     212        }
     213    }
     214}
     215
     216
    236217
    237218function editorify_plugin_redirect()
     
    292273    }
    293274}
    294 function editorify_installation()
    295 {
    296     if (in_array('woocommerce/woocommerce.php', apply_filters('active_plugins', get_option('active_plugins'))) && !get_option('editorify_error')) {
    297         $json['success'] = 1;
    298         $json['api_key'] = get_option('editorify_api_key');
    299     } else {
    300         $json["success"] = 0;
    301     }
    302 
    303     wp_send_json($json);
    304     wp_die();
    305 }
     275
    306276
    307277?>
  • editorify/trunk/readme.txt

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