| 1 |
<?php |
| 2 |
/** |
| 3 |
* WP Ultimate Exporter plugin file. |
| 4 |
* |
| 5 |
* Copyright (C) 2010-2020, Smackcoders Inc - info@smackcoders.com |
| 6 |
*/ |
| 7 |
|
| 8 |
namespace Smackcoders\SMEXP; |
| 9 |
|
| 10 |
if ( ! defined( 'ABSPATH' ) ) |
| 11 |
exit; // Exit if accessed directly |
| 12 |
|
| 13 |
class ExpInstall { |
| 14 |
|
| 15 |
protected static $instance = null,$smack_instance,$tables_instance; |
| 16 |
private static $db_updates = array(); |
| 17 |
/** |
| 18 |
* SmackCSVInstall Constructor |
| 19 |
*/ |
| 20 |
public function __construct() { |
| 21 |
$this->plugin = Plugin::getInstance(); |
| 22 |
} |
| 23 |
|
| 24 |
/** |
| 25 |
* SmackCSVInstall Instance |
| 26 |
*/ |
| 27 |
public static function getInstance() { |
| 28 |
if ( null == self::$instance ) { |
| 29 |
self::$instance = new self; |
| 30 |
self::$smack_instance = new ExpInstall(); |
| 31 |
} |
| 32 |
return self::$instance; |
| 33 |
} |
| 34 |
|
| 35 |
/** |
| 36 |
* Hook in tabs. |
| 37 |
*/ |
| 38 |
public static function init($slug) { |
| 39 |
add_filter('plugin_action_links_'.$slug, array(__CLASS__, 'plugin_row_meta'), 10, 3); |
| 40 |
} |
| 41 |
|
| 42 |
/** |
| 43 |
* Show row meta on the plugin screen. |
| 44 |
* |
| 45 |
* @param mixed $links Plugin Row Meta |
| 46 |
* @param mixed $file Plugin Base file |
| 47 |
* @return array |
| 48 |
*/ |
| 49 |
public static function plugin_row_meta( $links, $file ) { |
| 50 |
|
| 51 |
$active_plugins = get_option('active_plugins'); |
| 52 |
if(in_array('wp-ultimate-csv-importer/wp-ultimate-csv-importer.php', $active_plugins)){ |
| 53 |
return $links; |
| 54 |
} |
| 55 |
else{ |
| 56 |
|
| 57 |
$row_meta = array( |
| 58 |
'install_csv_importer' => '<a style="font-weight: bold;color: #d54e21;font-size: 105%;" href="' . esc_url( apply_filters( 'install_csv_importer', 'https://wordpress.org/plugins/wp-ultimate-csv-importer/' ) ) . '" title="' . esc_attr( __( 'Install CSV Importer', 'wp-ultimate-csv-importer' ) ) . '" target="_blank">' . __( 'Install CSV Importer', 'wp-ultimate-csv-importer' ) . '</a>' |
| 59 |
); |
| 60 |
return $row_meta + $links; |
| 61 |
} |
| 62 |
} |
| 63 |
|
| 64 |
} |
| 65 |
|