PluginProbe
Contact List – Online Staff Directory & Address Book / trunk
Contact List – Online Staff Directory & Address Book vtrunk
3.0.22 trunk 2.9.80 2.9.81 2.9.82 2.9.83 2.9.84 2.9.85 2.9.86 2.9.87 2.9.88 2.9.89 2.9.90 2.9.91 2.9.92 2.9.93 2.9.94 2.9.95 2.9.96 2.9.97 2.9.98 2.9.99 3.0.0 3.0.1 3.0.10 All 44 releases
contact-list / contact-list.php

contact-list.php in Contact List – Online Staff Directory & Address Book trunk, at contact-list.php

187 lines 7.0 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 /**
4 * The plugin bootstrap file
5 *
6 * This file is read by WordPress to generate the plugin information in the plugin
7 * admin area. This file also includes all of the dependencies used by the plugin,
8 * registers the activation and deactivation functions, and defines a function
9 * that starts the plugin.
10 *
11 * @link https://www.contactlistpro.com
12 * @since 1.0.0
13 * @package Contact_List
14 *
15 * @wordpress-plugin
16 * Plugin Name: Contact List
17 * Description: Easily display contact information on your site with this simple plugin.
18 * Version: 3.0.22
19 * Author: Contact List – Staff Directory
20 * Author URI: https://www.contactlistpro.com
21 * License: GPL-2.0+
22 * License URI: http://www.gnu.org/licenses/gpl-2.0.txt
23 * Text Domain: contact-list
24 * Domain Path: /languages
25 */
26 // If this file is called directly, abort.
27 if ( !defined( 'WPINC' ) ) {
28 die;
29 }
30 if ( function_exists( 'contact_list_fs' ) ) {
31 contact_list_fs()->set_basename( false, __FILE__ );
32 } else {
33 require_once __DIR__ . '/vendor/autoload.php';
34 if ( !function_exists( 'contact_list_fs' ) ) {
35 // Create a helper function for easy SDK access.
36 function contact_list_fs() {
37 global $contact_list_fs;
38 $s = get_option( 'contact_list_settings' );
39 if ( !isset( $contact_list_fs ) ) {
40 // Include Freemius SDK.
41 // SDK is auto-loaded through Composer
42 $settings_contact = false;
43 $settings_support = true;
44 $contact_list_fs = fs_dynamic_init( array(
45 'id' => '5106',
46 'slug' => 'contact-list',
47 'premium_slug' => 'contact-list-pro',
48 'type' => 'plugin',
49 'public_key' => 'pk_9808753bcf234f1feef91bd833ab6',
50 'is_premium' => false,
51 'premium_suffix' => 'Pro',
52 'has_addons' => false,
53 'has_paid_plans' => true,
54 'is_org_compliant' => true,
55 'trial' => array(
56 'days' => 7,
57 'is_require_payment' => true,
58 ),
59 'menu' => array(
60 'slug' => 'contact-list',
61 'contact' => $settings_contact,
62 'support' => $settings_support,
63 'parent' => array(
64 'slug' => 'options-general.php',
65 ),
66 ),
67 'is_live' => true,
68 ) );
69 }
70 return $contact_list_fs;
71 }
72
73 // Init Freemius.
74 contact_list_fs();
75 // Signal that SDK was initiated.
76 do_action( 'contact_list_fs_loaded' );
77 }
78 function contact_list_fs_custom_connect_message( $message, $user_first_name ) {
79 return sprintf( __( 'Hey %1$s' ) . ',<br>' . __( 'never miss an important update -- opt-in to our security and feature updates notifications, and non-sensitive diagnostic tracking with freemius.com.' ), $user_first_name );
80 }
81
82 contact_list_fs()->add_filter(
83 'connect_message',
84 'contact_list_fs_custom_connect_message',
85 10,
86 6
87 );
88 function contact_list_freemius_custom_is_submenu_visible( $is_visible, $menu_id ) {
89 if ( $menu_id == 'contact' ) {
90 return contact_list_fs()->can_use_premium_code();
91 } elseif ( $menu_id == 'support' ) {
92 return !contact_list_fs()->can_use_premium_code();
93 }
94 return $is_visible;
95 }
96
97 contact_list_fs()->add_filter(
98 'is_submenu_visible',
99 'contact_list_freemius_custom_is_submenu_visible',
100 10,
101 2
102 );
103 function contact_list_fs_custom_connect_message_on_update(
104 $message,
105 $user_first_name,
106 $plugin_title,
107 $user_login,
108 $site_link,
109 $freemius_link
110 ) {
111 return sprintf(
112 __( 'Hey %1$s' ) . ',<br>' . __( 'Please help us improve %2$s! If you opt-in, some data about your usage of %2$s will be sent to %5$s. If you skip this, that\'s okay! %2$s will still work just fine.' ),
113 $user_first_name,
114 '<b>' . $plugin_title . '</b>',
115 '<b>' . $user_login . '</b>',
116 $site_link,
117 $freemius_link
118 );
119 }
120
121 contact_list_fs()->add_filter(
122 'connect_message_on_update',
123 'contact_list_fs_custom_connect_message_on_update',
124 10,
125 6
126 );
127 contact_list_fs()->add_filter( 'show_deactivation_feedback_form', '__return_false' );
128 function contact_list_fs_custom_icon() {
129 return dirname( __FILE__ ) . '/img/plugin-icon/icon.svg';
130 }
131
132 contact_list_fs()->add_filter( 'plugin_icon', 'contact_list_fs_custom_icon' );
133 $s = get_option( 'contact_list_settings' );
134 $order_by = '_cl_last_name';
135 if ( isset( $s['order_by'] ) && $s['order_by'] ) {
136 $order_by = sanitize_text_field( $s['order_by'] );
137 }
138 // define('CONTACT_LIST_PLUGIN_NAME', 'contact-list');
139 define( 'CONTACT_LIST_ORDER_BY', $order_by );
140 define( 'CONTACT_LIST_VERSION', '3.0.22' );
141 define( 'CONTACT_LIST_URI', plugin_dir_url( __FILE__ ) );
142 define( 'CONTACT_LIST_PATH', plugin_dir_path( __FILE__ ) );
143 define( 'CONTACT_LIST_CPT', 'contact' );
144 define( 'CONTACT_LIST_CAT1', 'cl_1' );
145 define( 'CONTACT_LIST_CAT2', 'cl_2' );
146 define( 'CONTACT_LIST_CAT3', 'cl_3' );
147 /**
148 * The code that runs during plugin activation.
149 * This action is documented in includes/class-contact-list-activator.php
150 */
151 function activate_contact_list() {
152 require_once plugin_dir_path( __FILE__ ) . 'includes/class-contact-list-activator.php';
153 Contact_List_Activator::activate();
154 }
155
156 /**
157 * The code that runs during plugin deactivation.
158 * This action is documented in includes/class-contact-list-deactivator.php
159 */
160 function deactivate_contact_list() {
161 require_once plugin_dir_path( __FILE__ ) . 'includes/class-contact-list-deactivator.php';
162 Contact_List_Deactivator::deactivate();
163 }
164
165 register_activation_hook( __FILE__, 'activate_contact_list' );
166 register_deactivation_hook( __FILE__, 'deactivate_contact_list' );
167 /**
168 * The core plugin class that is used to define internationalization,
169 * admin-specific hooks, and public-facing site hooks.
170 */
171 require plugin_dir_path( __FILE__ ) . 'includes/class-contact-list.php';
172 /**
173 * Begins execution of the plugin.
174 *
175 * Since everything within the plugin is registered via hooks,
176 * then kicking off the plugin from this point in the file does
177 * not affect the page life cycle.
178 *
179 * @since 1.0.0
180 */
181 function run_contact_list() {
182 $plugin = new Contact_List();
183 $plugin->run();
184 }
185
186 run_contact_list();
187 }