Plugin Directory

Changeset 1477223


Ignore:
Timestamp:
08/17/2016 07:25:10 PM (10 years ago)
Author:
MalteseSolutions
Message:

Version 2.0
Complete overhaul of the code

Location:
fireems-stats/trunk
Files:
44 added
3 edited

Legend:

Unmodified
Added
Removed
  • fireems-stats/trunk/fireems-stats.php

    r1445425 r1477223  
    11<?php
    2 /*
    3 Plugin Name: Fire/EMS Stats (Lite)
    4 Plugin URI: http://www.maltesesolutions.com
    5 Description: This plugin will display your Fire/EMS Stats.
    6 Version: 1.2.3
    7 Author: Maltese Solutions
    8 Author URI: http://www.maltesesolutions.com
    9 License: GPLv2
    10 */
    112
    12 define('FIREEMS_VERSION', '1.2.3'); //since 1.2.1
    13 define('FIREEMS_PATH',  plugin_dir_path( __FILE__ ) );
    14 define('FIREEMS_URL', WP_PLUGIN_URL."/fireems-stats/" );
    15 require_once(FIREEMS_PATH."inc/functions.php");
    16 require_once(FIREEMS_PATH."inc/admin.php");
    17 require_once(FIREEMS_PATH."inc/widget.php");
    18 register_activation_hook( __FILE__, 'FireEMS_install' );
    19 ?>
     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              http://www.maltesesolutions.com
     12 * @since             2.0.0
     13 * @package           Fireems_Stats
     14 *
     15 * @wordpress-plugin
     16 * Plugin Name:       FireEMS Stats
     17 * Plugin URI:        http://www.maltesesolutions.com
     18 * Description:       Plugin that allows your Fire or EMS Organizaiton to list its monthly activity.
     19 * Version:           2.0.0
     20 * Author:            MalteseSolutions
     21 * Author URI:        http://www.maltesesolutions.com
     22 * License:           GPL-2.0+
     23 * License URI:       http://www.gnu.org/licenses/gpl-2.0.txt
     24 * Text Domain:       fireems-stats
     25 * Domain Path:       /languages
     26 */
     27
     28
     29// If this file is called directly, abort.
     30if ( ! defined( 'WPINC' ) ) {
     31    die;
     32}
     33
     34ob_start();
     35
     36/**
     37 * The code that runs during plugin activation.
     38 * This action is documented in includes/class-fireems-stats-activator.php
     39 */
     40function activate_fireems_stats() {
     41    require_once plugin_dir_path( __FILE__ ) . 'includes/class-fireems-stats-activator.php';
     42    Fireems_Stats_Activator::activate();
     43}
     44
     45/**
     46 * The code that runs during plugin deactivation.
     47 * This action is documented in includes/class-fireems-stats-deactivator.php
     48 */
     49function deactivate_fireems_stats() {
     50    require_once plugin_dir_path( __FILE__ ) . 'includes/class-fireems-stats-deactivator.php';
     51    Fireems_Stats_Deactivator::deactivate();
     52}
     53
     54register_activation_hook( __FILE__, 'activate_fireems_stats' );
     55register_deactivation_hook( __FILE__, 'deactivate_fireems_stats' );
     56
     57/**
     58 * The core plugin class that is used to define internationalization,
     59 * admin-specific hooks, and public-facing site hooks.
     60 */
     61require plugin_dir_path( __FILE__ ) . 'includes/class-fireems-stats.php';
     62
     63/**
     64 * Begins execution of the plugin.
     65 *
     66 * Since everything within the plugin is registered via hooks,
     67 * then kicking off the plugin from this point in the file does
     68 * not affect the page life cycle.
     69 *
     70 * @since    2.0.0
     71 */
     72function run_fireems_stats() {
     73
     74    $plugin = new Fireems_Stats();
     75    $plugin->run();
     76
     77}
     78run_fireems_stats();
  • fireems-stats/trunk/readme.txt

    r1445425 r1477223  
    33Tags: fire department, EMS, monthly calls, fire stats, ems stats, fire
    44Requires at least: 4.0
    5 Tested up to: 4.5
    6 Stable tag: 1.2.3
     5Tested up to: 4.6
     6Stable tag: 2.0.0
    77License: GPLv2 or later
    88License URI: http://www.gnu.org/licenses/gpl-2.0.html
     
    1616Edit your stats manually to keep your visitors and community up to date.
    1717
    18 Live Demo: [Pro Version](http://wpdemo.maltesesolutions.com).
    1918
    2019= Like this plugin? =
     
    3534
    3635FireEMS Stats allows your Fire or EMS Organization to list monthly activity on the front page.
    37 Edit your stats manually to keep your visitors and community up to date.
     36You can edit your stats manually to keep your visitors and community up to date.
    3837
    3938== Frequently Asked Questions ==
     
    5251
    5352== Changelog ==
     53
     54= 2.0.0 (2016-8-17) =
     55* Complete rewrite of the code
     56* Updated to Object Oriented
     57* Integration of Tom McFarlins Boilerplate Plugin
     58* Admin now utilizes Bootstrap 3.3.7
     59* Stats updates are now completed with ajax calls
     60* Improved CSS
     61* Added additional features to widget
     62* Now available for translations
     63* Compatible with WordPress 4.6
     64* Compatible with prior versions of Fire/EMS Stats
    5465
    5566= 1.2.3 (2016-06-29) =
  • fireems-stats/trunk/uninstall.php

    r1378271 r1477223  
    11<?php
     2
    23/**
    3  * Uninstall
     4 * Fired when the plugin is uninstalled.
    45 *
    5  * @link       http://maltesesolutions.com
    6  * @since      1.2.2
     6 * @link       http://www.maltesesolutions.com
     7 * @since      2.0.0
    78 *
    8  * @package    FireEms Stats
     9 * @package    Fireems_Stats
    910 */
    1011
    11 //if uninstall not called from WordPress exit
    12 if ( !defined( 'WP_UNINSTALL_PLUGIN' ) )
    13     exit();
     12// If uninstall not called from WordPress, then exit.
     13if ( ! defined( 'WP_UNINSTALL_PLUGIN' ) ) {
     14    exit;
     15}
     16
    1417global $wpdb;
     18
    1519$prefix = $wpdb->prefix;
     20
    1621$stats = $prefix.'fireEMS';
     22
    1723$stats_db = $prefix.'fireEMS_';
    1824
    1925// Delete All Stat Years
    20 $wpdb->query($sql);
    21 $sql = "select year from $stats order by year";
    22 $result = $wpdb->get_results($sql);
    23 foreach ($result as $data) {
    24     $sql = "DROP TABLE $stats_db".$data->year;
    25     $wpdb->query($sql);
    26 }
    27 $sql = "DROP TABLE $stats";
     26
    2827$wpdb->query($sql);
    2928
    30 $option_name = 'fireEMS';
    31 delete_option( $option_name );
     29$sql = "select year from $stats order by year";
     30
     31$result = $wpdb->get_results($sql);
     32
     33foreach ($result as $data) {
     34
     35    $sql = "DROP TABLE $stats_db".$data->year;
     36
     37    $wpdb->query($sql);
     38
     39}
     40
     41$sql = "DROP TABLE $stats";
     42
     43$wpdb->query($sql);
     44
     45delete_option( 'fireEMS' );
Note: See TracChangeset for help on using the changeset viewer.