PluginProbe
Ryviu – Review Importer & Product Reviews / 3.1.26
Ryviu – Review Importer & Product Reviews v3.1.26
3.1.28 3.1.27 trunk 2.0 3.0.2 3.0.7 3.1.14 3.1.25 3.1.26
ryviu / ryviu.php

ryviu.php in Ryviu – Review Importer & Product Reviews 3.1.26, at ryviu.php

126 lines 5.0 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * The plugin bootstrap file
4 *
5 * This file is read by WordPress to generate the plugin information in the plugin
6 * admin area. This file also includes all of the dependencies used by the plugin,
7 * registers the activation and deactivation functions, and defines a function
8 * that starts the plugin.
9 *
10 * @link https://www.ryviu.com
11 * @since 2.0.0
12 * @package Ryviu
13 *
14 * @wordpress-plugin
15 * Plugin Name: Ryviu – Review Importer & Product Reviews
16 * Plugin URI: https://www.ryviu.com
17 * Description: Import product reviews from AliExpress, Amazon, and Etsy to WooCommerce in seconds. Boost social proof for your dropshipping store with photo reviews and Q&A. With Ryviu, you can easily customize and display these reviews on your store.
18 * Version: 3.1.26
19 * Requires at least: 4.0
20 * Tested up to: 6.9
21 * WC requires at least: 3.0
22 * WC tested up to: 10.7
23 * Author: Ryviu
24 * Author URI: https://www.ryviu.com
25 * License: GPL-2.0+
26 * License URI: http://www.gnu.org/licenses/gpl-2.0.txt
27 * Text Domain: ryviu
28 * Domain Path: /languages
29 */
30
31 // If this file is called directly, abort.
32 if ( ! defined( 'WPINC' ) ) {
33 die;
34 }
35 $urlparts = wp_parse_url( site_url() );
36 $domain = $urlparts['host'];
37
38 define('RYVIU_SHOP_DOMAIN', $domain);
39 define('RYVIU_WOO_VERSION', '3.1.26');
40 defined('DS') ? null : define('DS', DIRECTORY_SEPARATOR);
41 define('RYVIU_DIR_PATH', plugin_dir_path(__FILE__) );
42 define('RYVIU_URL_ASSETS', plugins_url( 'assets/', __FILE__ ) );
43 define('RYVIU_APP_HOOK_URL', 'https://app.ryviu.io/webhook/woocommerce/');
44 define('RYVIU_NAMESPACE', 'ryviu/v1');
45
46 add_action( 'before_woocommerce_init', function() {
47 if ( class_exists( \Automattic\WooCommerce\Utilities\FeaturesUtil::class ) ) {
48 \Automattic\WooCommerce\Utilities\FeaturesUtil::declare_compatibility( 'custom_order_tables', __FILE__, true );
49 }
50 } );
51
52 require_once RYVIU_DIR_PATH . 'includes/main-class.php';
53
54 /**
55 * The code that runs during plugin activation.
56 */
57 function activate_ryviu() {
58 RyviuMain::activate();
59 }
60
61 /**
62 * The code that runs during plugin uninstall.
63 */
64 function uninstall_ryviu(){
65 RyviuMain::uninstall();
66 }
67
68 add_filter('plugin_action_links_'.plugin_basename(__FILE__), 'code_add_plugin_page_settings_link');
69 // Add Menu Ryviu to Dashboard WordPress
70 function code_add_plugin_page_settings_link( $links ) {
71 $links[] = '<a href="' .
72 admin_url( 'options-general.php?page=ryviu-setting-admin' ) .
73 '">' . __('Settings') . '</a>';
74 return $links;
75 }
76
77 // Show notice when do not connect store with Ryviu
78 function r_admin_notices() {
79
80 $settings = get_option( 'ryviu_client_settings' );
81
82 $image_url = RYVIU_URL_ASSETS.'images/logo-ryviu-v9.png';
83
84 if(!$settings || $settings == new \stdClass()){
85 echo '<div class="notice notice-error is-dismissible r-cl-connect"><div class="r--notices"><img src="'.$image_url.'" alt="" /><p><b>Ryviu:</b> It looks like there is a problem connecting your store to Ryviu. Please <a class="ryviu-check-connect" href="javascript:void(0)">click here</a> to check the issue, or please <a target="_blank" href="https://www.ryviu.com/contact-us">contact us</a> for help.</p></div></div>';
86 echo '<div class="notice notice-success is-dismissible r-cl-connect"><p class="r--notices"><img src="'.$image_url.'" alt="" /><b>Ryviu:</b> Successful connection.</p></div>';
87 }else{
88 $ryviu_settings = get_option( 'ryviu_settings_reviews' );
89 $ryviu_version = get_option( 'ryviu_version' );
90 if (array_key_exists('ryviu_frontend_version', $ryviu_settings)) {
91 $ryviu_frontend_version = $ryviu_settings['ryviu_frontend_version'];
92
93 if(!$ryviu_version){
94 $ryviu_version = $ryviu_frontend_version;
95 RyviuMain::ryviu_update_frontend($ryviu_frontend_version, false);
96 }else{
97 if($ryviu_frontend_version != $ryviu_version){
98 $ryviu_version = $ryviu_frontend_version;
99 RyviuMain::ryviu_update_frontend($ryviu_frontend_version, false);
100 }
101 }
102 }
103
104 if(!$ryviu_version || ($ryviu_version && $ryviu_version == 1)){
105 echo '<div class="notice notice-info is-dismissible r-cl-update"><div class="r--notices"><img src="'.$image_url.'" alt="" /><p><b>Ryviu:</b>&nbsp; Enhancing your store\'s frontend with the new design for the reviews widget, featuring a user-friendly layout and more customizable options. <a class="ryviu-view-demo" target="_blank" href="https://version2.omazing.us/">Click here</a> to see the demo or <a class="ryviu-update-frontend" href="javascript:void(0)">update now</a>.</p></div></div>';
106 echo '<div class="notice notice-success is-dismissible rpl--hide r-cl-update"><p class="r--notices"><img src="'.$image_url.'" alt="" /><b>Ryviu:</b>&nbsp; Successful update.</p></div>';
107 }
108 }
109 }
110
111
112 register_activation_hook( __FILE__, 'activate_ryviu' );
113 register_uninstall_hook( __FILE__, 'uninstall_ryviu' );
114 add_action( 'admin_notices','r_admin_notices');
115 RyviuMain::re_order_plugin();
116
117 // Include main ryviu class
118 require_once RYVIU_DIR_PATH . 'includes/class-ryviu.php';
119
120 // Main Class Called
121 function RYVIU() {
122 return RyviuWoo::instance();
123 }
124
125 $GLOBALS['RYVIU'] = RYVIU();
126