Skip to content
Open

33 #39

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file modified .DS_Store
Binary file not shown.
43 changes: 0 additions & 43 deletions .travis.yml

This file was deleted.

127 changes: 0 additions & 127 deletions bin/install-wp-tests.sh

This file was deleted.

95 changes: 42 additions & 53 deletions buddy-notification-bell.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,66 +12,55 @@
* @package Buddy_Notification_Bell
*
* @wordpress-plugin
* Plugin Name: Buddy Notification Bell
* Plugin URI: http://buddydevelopers.com
* Description: This plugin convert buddypress notification to buddypress Notification bell. It show all notification with bell alert and anywhere you want with just one shortcode.
* Version: 1.0.3
* Author: buddydevelopers
* Author URI: http://buddydevelopers.com
* License: GPL-2.0+
* License URI: http://www.gnu.org/licenses/gpl-2.0.txt
* Text Domain: buddy-notification-bell
* Domain Path: /languages
* Plugin Name: Buddy Notification Bell
* Plugin URI: http://buddydevelopers.com
* Description: WordPress Notifications Management system. This plugins shows you all types of WordPress and WordPress plugins notifications like facebook/twitter does.
* Version: 2.0.0
* Author: BuddyDevelopers
* Author URI: http://buddydevelopers.com
* License: GPL-2.0+
* License URI: http://www.gnu.org/licenses/gpl-2.0.txt
* Text Domain: buddy-notification-bell
* Domain Path: /languages
*/

/**
* This file is the main file of plugin that define constant and call the loader.
*
* @since 2.0.0
* @package bnb
*/
// If this file is called directly, abort.
if ( ! defined( 'WPINC' ) ) {
die;
}

/* Only load code that needs BuddyPress to run once BP is loaded and initialized. */
function load_bnb_component_init() {
defined( 'ABSPATH' ) || exit;

if ( ! defined( 'BUDDY_NOTIFICATION_BELL_PLUGINS_URL' ) ) {
define( 'BUDDY_NOTIFICATION_BELL_PLUGINS_URL', plugin_dir_url( __FILE__ ) );
}

if ( ! defined( 'BUDDY_NOTIFICATION_BELL_PLUGINS_PATH' ) ) {
define( 'BUDDY_NOTIFICATION_BELL_PLUGINS_PATH', plugin_dir_path( __FILE__ ) );
}

$bp = buddypress();
// Allow plugin functionality to work only when Notification module is enabled.
if( isset( $bp->notifications ) && !empty( $bp->notifications )){
require_once plugin_dir_path( __FILE__ ) . 'includes/class-notification-bell-public.php';
require_once plugin_dir_path( __FILE__ ) . 'includes/class-notification-bell-settings.php';
$instance = Buddy_Notification_Bell_Public::get_instance();
$instance = Buddy_Notification_Bell_Settings::get_instance();
}
// Define plugin constants.
if ( ! defined( 'BUDDY_NOTIFICATION_BELL_PLUGINS_URL' ) ) {
define( 'BUDDY_NOTIFICATION_BELL_PLUGINS_URL', plugin_dir_url( __FILE__ ) );
}
add_action( 'bp_include', 'load_bnb_component_init' );

/**
* Add Admin notification when BuddyPress is inactive.
*/
function bnb_admin_notice() {
if( ! is_plugin_active('buddypress/bp-loader.php') ){ ?>
<div class="notice notice-warning is-dismissible">
<p><?php _e( 'Buddy Notification Bell required BuddyPress to be activated', 'buddy-notification-bell' ); ?></p>
</div>
<?php }
if ( ! defined( 'BUDDY_NOTIFICATION_BELL_PLUGINS_PATH' ) ) {
define( 'BUDDY_NOTIFICATION_BELL_PLUGINS_PATH', plugin_dir_path( __FILE__ ) );
}
add_action( 'admin_notices', 'bnb_admin_notice' );

function buddy_bell_plugin_settings_link($links) {
$addition_option = array(
'Settings' => 'options-general.php?page=buddy-notifications.php',
'Hire Us' => 'https://buddydevelopers.com'
// Load the plugin files
require_once BUDDY_NOTIFICATION_BELL_PLUGINS_PATH . 'src/bnb-loader.php';

/** Create custom table */
function buddy_notification_bell_init() {
global $wpdb;

);
foreach( $addition_option as $key => $value ){
$links[] = '<a href="'. $value .'">'. $key .'</a>';
}
return $links;
$table_name = $wpdb->prefix . 'bnb_notifications';
$sql = "CREATE TABLE $table_name (
id bigint(20) NOT NULL AUTO_INCREMENT PRIMARY KEY,
user_id bigint(20) NOT NULL,
item_id bigint(20) NOT NULL,
secondary_item_id bigint(20) NOT NULL,
component_name varchar(75) NOT NULL,
component_action varchar(75) NOT NULL,
date_notified datetime NOT NULL,
is_new bool NOT NULL DEFAULT 0
);";
include_once ABSPATH . 'wp-admin/includes/upgrade.php';
dbDelta( $sql );
}
add_filter("plugin_action_links_".plugin_basename(__FILE__), 'buddy_bell_plugin_settings_link' );
register_activation_hook( __FILE__, 'buddy_notification_bell_init' );
12 changes: 0 additions & 12 deletions composer.json

This file was deleted.

53 changes: 0 additions & 53 deletions composer.lock

This file was deleted.

Loading