PluginProbe
Favorites / trunk
Favorites vtrunk
2.3.8 trunk 1.0 1.0.1 1.0.2 1.0.3 1.0.4 1.0.5 1.1.0 1.1.1 1.1.2 1.1.3 1.1.4 1.2.0 1.2.1 1.2.2 1.2.3 2.0.1 2.0.2 2.1.0 2.1.1 2.1.2 2.1.3 2.1.4 2.1.5 All 35 releases
favorites / favorites.php

favorites.php in Favorites trunk, at favorites.php

59 lines 2.1 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /*
3 Plugin Name: Favorites
4 Plugin URI: https://hookandfilter.com/plugins/favorites/
5 Description: Simple and flexible favorite buttons for any post type.
6 Version: 2.3.8
7 Author: Hook & Filter
8 Author URI: https://hookandfilter.com
9 Text Domain: favorites
10 Domain Path: /languages/
11 License: GPLv2 or later.
12 Copyright: Hook & Filter
13 */
14
15 /* Copyright 2026 Hook & Filter (email : support@hookandfilter.com)
16
17 This program is free software; you can redistribute it and/or modify
18 it under the terms of the GNU General Public License, version 2, as
19 published by the Free Software Foundation.
20
21 This program is distributed in the hope that it will be useful,
22 but WITHOUT ANY WARRANTY; without even the implied warranty of
23 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
24 GNU General Public License for more details.
25
26 You should have received a copy of the GNU General Public License
27 along with this program; if not, write to the Free Software
28 Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
29 */
30
31 /**
32 * Check WordPress and PHP versions before instantiating plugin
33 */
34 register_activation_hook( __FILE__, 'favorites_check_versions' );
35
36 define( 'FAVORITES_PLUGIN_FILE', __FILE__ );
37
38 function favorites_check_versions( $wp = '3.9', $php = '5.3.2' ) {
39 global $wp_version;
40 if ( version_compare( PHP_VERSION, $php, '<' ) ) $flag = 'PHP';
41 elseif ( version_compare( $wp_version, $wp, '<' ) ) $flag = 'WordPress';
42 else return;
43 $version = 'PHP' == $flag ? $php : $wp;
44
45 if (function_exists('deactivate_plugins')){
46 deactivate_plugins( basename( __FILE__ ) );
47 }
48
49 wp_die('<p>The <strong>Favorites</strong> plugin requires'.$flag.' version '.$version.' or greater.</p>','Plugin Activation Error', array( 'response'=>200, 'back_link'=>TRUE ) );
50 }
51
52 if( !class_exists('Bootstrap') ) :
53 favorites_check_versions();
54 require_once(__DIR__ . '/vendor/autoload.php');
55 require_once(__DIR__ . '/app/Favorites.php');
56 require_once(__DIR__ . '/app/API/functions.php');
57 Favorites::init();
58 endif;
59