PluginProbe
GamiPress – Gamification plugin to reward points, badges & ranks in WordPress, now with AI / trunk
GamiPress – Gamification plugin to reward points, badges & ranks in WordPress, now with AI vtrunk
8.0.1 8.0.2 8.0.0 7.9.9.7 7.9.9.6 7.9.9.5 7.9.9.4 7.9.9.3 7.9.9.2 7.9.9.1 7.9.9 7.9.8 7.9.7 7.9.6 7.9.5 7.9.4 7.9.3 7.9.2 7.9.1 7.9.0 7.8.9 7.8.8 7.8.7 7.8.6 7.8.5 All 44 releases
gamipress / includes / install.php

install.php in GamiPress – Gamification plugin to reward points, badges & ranks in WordPress, now with AI trunk, at includes/install.php

62 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 * Install
4 *
5 * @package GamiPress\Install
6 * @author GamiPress <contact@gamipress.com>, Ruben Garcia <rubengcdev@gmail.com>
7 * @since 1.1.0
8 */
9 // Exit if accessed directly
10 if( !defined( 'ABSPATH' ) ) exit;
11
12 function gamipress_install() {
13
14 // Setup default GamiPress options
15 if( gamipress_is_network_wide_active() ) {
16 $gamipress_settings = ( $exists = get_site_option( 'gamipress_settings' ) ) ? $exists : array();
17 } else {
18 $gamipress_settings = ( $exists = get_option( 'gamipress_settings' ) ) ? $exists : array();
19 }
20
21 if ( empty( $gamipress_settings ) ) {
22
23 $gamipress_settings['minimum_role'] = 'manage_options';
24 $gamipress_settings['points_image_size'] = array( 'width' => 50, 'height' => 50 );
25 $gamipress_settings['achievement_image_size'] = array( 'width' => 100, 'height' => 100 );
26 $gamipress_settings['rank_image_size'] = array( 'width' => 100, 'height' => 100 );
27
28 if( gamipress_is_network_wide_active() ) {
29 update_site_option( 'gamipress_settings', $gamipress_settings );
30 } else {
31 update_option( 'gamipress_settings', $gamipress_settings );
32 }
33 }
34
35 // Setup default GamiPress installation date
36 if( gamipress_is_network_wide_active() ) {
37 $gamipress_install_date = ( $exists = get_site_option( 'gamipress_install_date' ) ) ? $exists : '';
38 } else {
39 $gamipress_install_date = ( $exists = get_option( 'gamipress_install_date' ) ) ? $exists : '';
40 }
41
42 if ( empty( $gamipress_install_date ) ) {
43
44 if( gamipress_is_network_wide_active() ) {
45 update_site_option( 'gamipress_install_date', date( 'Y-m-d H:i:s' ) );
46 } else {
47 update_option( 'gamipress_install_date', date( 'Y-m-d H:i:s' ) );
48 }
49 }
50
51 // Register GamiPress custom DB tables
52 gamipress_register_custom_tables();
53
54 if( ! GamiPress()->db instanceof GamiPress_Database ) {
55 GamiPress()->pre_init();
56 gamipress_init_multisite();
57 }
58
59 // Register GamiPress post types and flush rewrite rules
60 gamipress_flush_rewrite_rules();
61 }
62